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