public void TryToMatch(TextToken token, List <RecognizedEntity> recognizedEntities) { foreach (var synonym in _allForms) { if (synonym.IsMatchedBy(token)) { recognizedEntities.Add(RecognizedEntity.Value(_entityName, synonym, _canonicalForm)); } } }
public IEnumerable <TextToken> Tokenize(TextToken token) { return(token.Split(_value, "[^0-9a-zA-Z'`]")); }
public TokensUnderPreparation(TextToken textToken) { _tokens = new [] { textToken }; }
public bool IsMatchedBy(TextToken token) { return(token.Matches(_value)); }
public static TokensUnderPreparation CreateInitial(string text) { return(new TokensUnderPreparation(TextToken.NotMatched(text))); }