Options
All
  • Public
  • Public/Protected
  • All
Menu

A collection of parsing functions

Hierarchy

  • Parser

Index

Methods

Static alignments

  • Generates an array of all possible alignments between two sets of n-grams

    deprecated

    used indexAlignmentPermutations instead (it's faster).

    Parameters

    • sourceNgrams: Ngram[]

      every possible n-gram in the source text

    • targetNgrams: Ngram[]

      every possible n-gram in the target text

    Returns Alignment[]

Static indexAlignmentPermutations

  • Indexes all possible alignment permutations between two sets of n-grams

    Parameters

    • sourceNgrams: Ngram[]

      every possible n-gram in the source text

    • targetNgrams: Ngram[]

      every possible n-gram in the target text

    • index: PermutationIndex

      the index that will receive the permutations

    Returns void

Static ngrams

  • ngrams(sentence: Token[], maxNgramLength?: number): Ngram[]
  • Generates an array of all possible contiguous n-grams within the sentence.

    Parameters

    • sentence: Token[]

      the tokens in a sentence

    • Default value maxNgramLength: number = 3

    Returns Ngram[]

Static sizedNgrams

  • sizedNgrams(sentence: Token[], ngramLength: number): Ngram[]
  • Returns an array of n-grams of a particular size from a sentence

    Parameters

    • sentence: Token[]

      the sentence from which n-grams will be read

    • ngramLength: number

      the length of each n-gram.

    Returns Ngram[]

Generated using TypeDoc