Пример #1
0
        public void AddDocumentToIndex(DocumentTokens documentTokens)
        {
            DocumentsById.Add(documentTokens.DocumentId, documentTokens.TokensByPosition
                              .OrderBy(x => x.position)
                              .Select(x => x.token)
                              .ToList());

            foreach (var(position, token) in documentTokens.TokensByPosition)
            {
                AddToken(token, documentTokens.DocumentId, position);
            }
        }
Пример #2
0
 private List <string> GetTokens(DocumentTokens documentTokens)
 {
     return(documentTokens.TokensByPosition.Select(x => x.token).Distinct().ToList());
 }
Пример #3
0
 public void SetTokens(DocumentTokens titleTokens, DocumentTokens contentTokens)
 {
     TitleTokens   = titleTokens;
     ContentTokens = contentTokens;
 }