Options
All
  • Public
  • Public/Protected
  • All
Menu

This algorithm calculates the relative distance between tokens within an n-gram. NOTE: this algorithm is only useful for dis-contiguous n-grams.

Some words that are textually identical but have different occurrences may be falsely suggested with a word farther away within the sentence.

This algorithm can be used to correct those false positives. Results range from 0 to 1.

Hierarchy

Implements

Index

Properties

Methods

Properties

name

name: string = "alignment relative occurrence"

Methods

execute

Static calculate

  • calculate(t: number, x: number, y: number): number
  • Calculates the relative distance between positions. A score of 0 means the tokens are on opposite sides of the sentence. A score of 1 means they are next to each other.

    Parameters

    • t: number

      length of sentence

    • x: number

      first position

    • y: number

      second position

    Returns number

Generated using TypeDoc