Options
All
  • Public
  • Public/Protected
  • All
Menu

A collection of indexes on the static content. TODO: maybe I should split this into sentences as well. e.g. a source SentenceIndex and a target SentenceIndex Then we could reuse it in other places such as word-mt.

Hierarchy

  • StaticIndex

Index

Constructors

constructor

  • Returns StaticIndex

Properties

Private srcCharLength

srcCharLength: number

Private srcNgramFreqIndex

srcNgramFreqIndex: NgramIndex

Private srcTokenLength

srcTokenLength: number

Private tgtCharLength

tgtCharLength: number

Private tgtNgramFreqIndex

tgtNgramFreqIndex: NgramIndex

Private tgtTokenLength

tgtTokenLength: number

Accessors

sourceCharacterLength

  • get sourceCharacterLength(): number
  • Returns the character length of the entire source

    Returns number

sourceNgramFrequency

  • Returns an index of source n-gram frequencies in the corpus

    Returns NgramIndex

sourceTokenLength

  • get sourceTokenLength(): number
  • Returns the {@link Token} length of the entire source

    Returns number

targetCharLength

  • get targetCharLength(): number
  • Returns the character length of the entire target

    Returns number

targetNgramFrequency

  • Returns an index of target n-gram frequencies in the corpus

    Returns NgramIndex

targetTokenLength

  • get targetTokenLength(): number
  • Returns the {@link Token} length of the entire target

    Returns number

Methods

addSentence

  • addSentence(sourceTokens: Token[], targetTokens: Token[], sourceNgrams: Ngram[], targetNgrams: Ngram[]): void
  • Adds a sentence to the index. The tokens in these n-grams must be measured for accurate positional metrics. The n-grams are passed as arguments instead of being generated internally to reduce duplicating work.

    Parameters

    • sourceTokens: Token[]

      the source sentence tokens

    • targetTokens: Token[]

      the target sentence tokens

    • sourceNgrams: Ngram[]

      the source sentence n-grams

    • targetNgrams: Ngram[]

      the target sentence n-grams

    Returns void

Generated using TypeDoc