Expression

CoreNLP/simple. Expression

Class representing an Expression

Constructor

new Expression(text, pattern)

Source:

Create an Expression

Parameters:
Name Type Description
text string
pattern string

Either TokensRegex, Semgrex or Tregex valid pattern

Extends

  • Annotable

Methods

(static) fromJSON(data) → {Expression}

Source:

Get an instance of Expression from a given JSON

Parameters:
Name Type Description
data ExpressionJSON

The expression data, as returned by CoreNLP API service

Returns:

expression - A new Expression instance

Type
Expression

fromJSON(data) → {Expression}

Source:

Update an instance of Expression with data provided by a JSON

Parameters:
Name Type Description
data ExpressionJSON

The expression data, as returned by CoreNLP API service

Returns:

expression - The current expression instance

Type
Expression

mergeTokensFromDocument(document) → {Expression}

Source:
See:

Hydrate the Expression instance with Token objects from an annotated Document

Parameters:
Name Type Description
document Document

An annotated document from where to extract the tokens

Returns:

expression - The current expression instance

Type
Expression

pattern() → {string}

Source:

Get the pattern

Returns:

pattern - The expression pattern

Type
string

sentence(index) → {ExpressionSentence}

Source:

Get the sentence for a given index

Parameters:
Name Type Description
index number

The position of the sentence to get

Returns:

sentence - An expression sentence

Type
ExpressionSentence

sentences() → {Array.<ExpressionSentence>}

Source:

Get a list of sentences

Returns:

sentences - The expression sentences

Type
Array.<ExpressionSentence>

toString() → {string}

Source:

Get a string representation

Returns:

expression

Type
string