NSScreencast Episode #76 Extracting Data From Strings
Extracting Data From Strings - NSScreencast
文章から文字列を抽出する
- NSRegularExpression
- regularExpressionWithPattern:@"^Name:\s*?(.+)"
- options:NSRegularExpressionCaseInsensitive
- \w, \s
- enumerateMatchesInString
- usingBlock
- [input substringWithRange:range];
- regularExpressionWithPattern:@"^Name:\s*?(.+)"
- NSDataDetector : NSHipster
- dataDetectorWithTypes:NSTextCheckingAllTypes
- enumerateMatchesInString
- NSLinguisticTagger : NSHipster
- availableTagSchemesForLanguage:@"en"];
- options = NSLinguisticTaggerOmitWhitespace | NSLinguisticTaggerOmitPunctuation | NSLinguisticTaggerJoinNames
- NSLinguisticTagSchemeLexicalClass etc
- https://github.com/NSHipster/articles/blob/master/2012-10-22-nslinguistictagger.md
- Word, Punctuation, Whitespace
- Other, Noun, Verb, Adjective, Adverb, Pronoun, Determiner, Particle, Preposition, Number, Conjunction, Interjection, Classifier, Idiom, OtherWord, SentenceTerminator, OpenQuote, CloseQuote, OpenParenthesis, CloseParenthesis, WordJoiner, Dash, OtherPunctuation, ParagraphBreak, OtherWhitespace
- PersonalName, PlaceName, OrganizationName
- Fantastical