Пример #1
0
 public TermEntryStats(
     Term term,
     IDocumentLink documentLink,
     double termFrequency,
     double inverseDocFrequency)
 {
     Term                = term;
     DocumentLink        = documentLink;
     TermFrequency       = termFrequency;
     InverseDocFrequency = inverseDocFrequency;
 }
Пример #2
0
 /// <summary>
 /// Create document from document link.
 /// </summary>
 public static IDocument ToDocument(this IDocumentLink documentLink, IEnumerable <string> lines)
 => documentLink.ToDocument(lines.ToArray());
Пример #3
0
 /// <summary>
 /// Create document from document link.
 /// </summary>
 public static IDocument ToDocument(this IDocumentLink documentLink, params string[] lines)
 => new Document(documentLink.SubsectionName, documentLink.Name, lines);
Пример #4
0
 /// <summary>
 /// Get relative path to file by its link.
 /// </summary>
 public static string RelativePath(this IDocumentLink documentLink)
 => Path.Combine(documentLink.SubsectionName, documentLink.Name);
 /// <param name="weight">
 /// Weight of search item.
 /// </param>
 /// <param name="pageDocumentLink">
 /// Link to document of page which this item corresponds to.
 /// </param>
 public WeightedResultItem(
     double weight,
     IDocumentLink pageDocumentLink) : base(pageDocumentLink)
     => this.weight = weight;
Пример #6
0
 /// <param name="pageDocumentLink">
 /// Link to document of page which this item corresponds to.
 /// </param>
 public DocLinkResultItem(IDocumentLink pageDocumentLink)
 => this.pageDocumentLink = pageDocumentLink;
Пример #7
0
 /// <summary>
 /// Represent itself as <see cref="IDocument"/> instance.
 /// </summary>
 public IDocument AsDocument(IDocumentLink documentLink)
 => JsonSerializer
 .Serialize(termsToDocuments, JsonOptions)
 .To(serialized => documentLink.ToDocument(serialized));
Пример #8
0
 /// <inheritdoc />
 public override void Write(
     Utf8JsonWriter writer,
     IDocumentLink value,
     JsonSerializerOptions options) => writer.WriteStringValue(value.Name);