public TermEntryStats( Term term, IDocumentLink documentLink, double termFrequency, double inverseDocFrequency) { Term = term; DocumentLink = documentLink; TermFrequency = termFrequency; InverseDocFrequency = inverseDocFrequency; }
/// <summary> /// Create document from document link. /// </summary> public static IDocument ToDocument(this IDocumentLink documentLink, IEnumerable <string> lines) => documentLink.ToDocument(lines.ToArray());
/// <summary> /// Create document from document link. /// </summary> public static IDocument ToDocument(this IDocumentLink documentLink, params string[] lines) => new Document(documentLink.SubsectionName, documentLink.Name, lines);
/// <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;
/// <param name="pageDocumentLink"> /// Link to document of page which this item corresponds to. /// </param> public DocLinkResultItem(IDocumentLink pageDocumentLink) => this.pageDocumentLink = pageDocumentLink;
/// <summary> /// Represent itself as <see cref="IDocument"/> instance. /// </summary> public IDocument AsDocument(IDocumentLink documentLink) => JsonSerializer .Serialize(termsToDocuments, JsonOptions) .To(serialized => documentLink.ToDocument(serialized));
/// <inheritdoc /> public override void Write( Utf8JsonWriter writer, IDocumentLink value, JsonSerializerOptions options) => writer.WriteStringValue(value.Name);