Overall Design and Schema
For the purpose of our demo, we will undergo a rather simple parsing implementation for inbound SMS messages.
The schema model can be found on our google document link
But the main ideas are as such:
- High level, there's a form with a prefix for what type of data it's about to contain.
- A form contains any number of fields represented by a well defined fieldtypes.
- A fieldtype is a simple data definition with a regular expression definition to parse
A form will be parsed by the fields in order greedily based upon the regular expressions in the fieldtypes.
Currently we're supporting the following fieldtypes with these regular expressions. Please edit if there are any fixes or other types that need support.
FieldType Name | DataType | Regular Expression |
boolean | boolean | (t|f|true|false|y|n|yes|no) |
length | integer | (\d+{1,3})(?:\s*(cm|mm|m|meter|meters)) |
ratio | float | (\d+\:\d+)|(\d+\/\d+) |
height | integer | (\d+{1,3})(?:\s*(cm|m|in)) |
weight | float | (\d+{1,3})(?c:\s*(kg|kilo|kilos)) |
number | number | \d+ |
word | string | \w+ |
In Android
How this plays out in Android will be governed by the storage of the field schema in the Sqlite database on the phone. In the current iteration (jan-2009), the parsing method will be governed by an interface linked to the parsemethod
Attachments
-
backendflow.pdf
(45.5 KB) - added by dmyung
3 years ago.
Back end flow of SMS data