Ejemplo n.º 1
0
        public static AddressBookParsedResult parse(Result result)
        {
            string text = result.Text;

            if (text == null || !text.StartsWith("MECARD:"))
            {
                return(null);
            }
            string[] array = AbstractDoCoMoResultParser.matchDoCoMoPrefixedField("N:", text, true);
            if (array == null)
            {
                return(null);
            }
            string value_Renamed = AddressBookDoCoMoResultParser.parseName(array[0]);
            string pronunciation = AbstractDoCoMoResultParser.matchSingleDoCoMoPrefixedField("SOUND:", text, true);

            string[] phoneNumbers = AbstractDoCoMoResultParser.matchDoCoMoPrefixedField("TEL:", text, true);
            string[] emails       = AbstractDoCoMoResultParser.matchDoCoMoPrefixedField("EMAIL:", text, true);
            string   note         = AbstractDoCoMoResultParser.matchSingleDoCoMoPrefixedField("NOTE:", text, false);

            string[] addresses = AbstractDoCoMoResultParser.matchDoCoMoPrefixedField("ADR:", text, true);
            string   text2     = AbstractDoCoMoResultParser.matchSingleDoCoMoPrefixedField("BDAY:", text, true);

            if (text2 != null && !ResultParser.isStringOfDigits(text2, 8))
            {
                text2 = null;
            }
            string url = AbstractDoCoMoResultParser.matchSingleDoCoMoPrefixedField("URL:", text, true);
            string org = AbstractDoCoMoResultParser.matchSingleDoCoMoPrefixedField("ORG:", text, true);

            return(new AddressBookParsedResult(ResultParser.maybeWrap(value_Renamed), pronunciation, phoneNumbers, emails, note, addresses, org, text2, null, url));
        }
Ejemplo n.º 2
0
 private static bool isLikeVCardDate(string value_Renamed)
 {
     return(value_Renamed == null || ResultParser.isStringOfDigits(value_Renamed, 8) || (value_Renamed.Length == 10 && value_Renamed[4] == '-' && value_Renamed[7] == '-' && VCardResultParser.isSubstringOfDigits(value_Renamed, 0, 4) && VCardResultParser.isSubstringOfDigits(value_Renamed, 5, 2) && VCardResultParser.isSubstringOfDigits(value_Renamed, 8, 2)));
 }