Options
All
  • Public
  • Public/Protected
  • All
Menu

Multi-Lingual Word Alignment Prediction

Hierarchy

  • WordMap

Index

Constructors

constructor

  • Parameters

    Returns WordMap

Properties

Private engine

engine: Engine

Private forceOccurrenceOrder

forceOccurrenceOrder: boolean

Methods

appendAlignmentMemory

  • Appends alignment memory engine.

    Parameters

    Returns void

appendAlignmentMemoryString

  • appendAlignmentMemoryString(source: string, target: string): Alignment[]
  • Appends some alignment memory. This may be multiple lines of text or a single line.

    Parameters

    • source: string

      a string of source phrases separated by new lines

    • target: string

      a string of target phrases separated by new lines

    Returns Alignment[]

    an array of alignment objects (as a convenience)

appendCorpus

  • appendCorpus(corpus: string[][]): void
  • Adds an array of corpus

    Parameters

    • corpus: string[][]

    Returns void

appendCorpusString

  • appendCorpusString(source: string, target: string): void
  • Add corpus to the MAP. These may be single sentences or multiple sentence delimited by new lines.

    Parameters

    • source: string
    • target: string

    Returns void

appendCorpusTokens

  • appendCorpusTokens(sourceTokens: Token[][], targetTokens: Token[][]): void
  • Adds tokenized corpus to map

    Parameters

    • sourceTokens: Token[][]
    • targetTokens: Token[][]

    Returns void

clearAlignmentMemory

  • clearAlignmentMemory(): void
  • Removes all alignment memory from the engine

    Returns void

predict

  • predict(sourceSentence: string | Token[], targetSentence: string | Token[], maxSuggestions?: number, minConfidence?: number): Suggestion[]
  • Predicts the word alignments between the sentences.

    Parameters

    • sourceSentence: string | Token[]

      a sentence from the source text

    • targetSentence: string | Token[]

      a sentence from the target text

    • Default value maxSuggestions: number = 1

      the maximum number of suggestions to return

    • Default value minConfidence: number = 0.1

      the minimum confidence score required for a prediction to be used

    Returns Suggestion[]

predictWithBenchmark

  • predictWithBenchmark(sourceSentence: string, targetSentence: string, benchmark: Alignment[], maxSuggestions?: number, minConfidence?: number): Suggestion[]
  • Predicts word alignments between the sentences. Returns an array of suggestions that match the benchmark.

    Parameters

    • sourceSentence: string
    • targetSentence: string
    • benchmark: Alignment[]
    • Default value maxSuggestions: number = 1
    • Default value minConfidence: number = 0.1

      the minimum confidence score required for a prediction to be used

    Returns Suggestion[]

Generated using TypeDoc