NCToken

trait NCToken extends NCPropertyMap

Represents a contiguous substring of the original input text produced by NCTokenParser. A token is the result of tokenization - the process of demarcating and classifying sections of a string of input characters. See NCPipeline for documentation on the tokens place in the overall processing pipeline.

Note that both NCToken and NCEntity interfaces extend NCPropertyMap interface that allows them to store custom metadata properties. Parser, enrichers and validators for tokens and entities use this capability to store and check their properties in tokens and entities.

See also:
Source:
NCToken.scala
class Object
trait Matchable
class Any

Value members

Abstract methods

Gets the inclusive end position of this token's text in the original input text supplied to NCTokenParser.tokenize method.

Gets the inclusive end position of this token's text in the original input text supplied to NCTokenParser.tokenize method.

Returns:

End position (inclusive) of this token's text in the original input text.

Source:
NCToken.scala

Gets the index of this token in the list returned by NCTokenParser.tokenize method.

Gets the index of this token in the list returned by NCTokenParser.tokenize method.

Returns:

Zero-based index of this token in the list returned by NCTokenParser.tokenize method

Source:
NCToken.scala

Gets the inclusive start position of this token's text in the original input text supplied to NCTokenParser.tokenize method.

Gets the inclusive start position of this token's text in the original input text supplied to NCTokenParser.tokenize method.

Returns:

Start position (inclusive) of this token's text in the original input text.

Source:
NCToken.scala

Gets the text of this token.

Gets the text of this token.

Returns:

Text of this token.

Source:
NCToken.scala

Inherited methods

def apply[T](key: String): T

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

Value parameters:
key

The key whose associated value is to be returned.

Returns:

The value to which the specified key is mapped, or null if this map contains no mapping for the key.

Inherited from:
NCPropertyMap
Source:
NCPropertyMap.scala
def clear(): Unit

Removes all of the mappings from this map. The map will be empty after this call returns.

Removes all of the mappings from this map. The map will be empty after this call returns.

Inherited from:
NCPropertyMap
Source:
NCPropertyMap.scala

Returns true if this map contains a mapping for the specified key.

Returns true if this map contains a mapping for the specified key.

Returns:

true if this map contains a mapping for the specified key.

Inherited from:
NCPropertyMap
Source:
NCPropertyMap.scala
def get[T](key: String): Option[T]

Returns the value to which the specified key is mapped.

Returns the value to which the specified key is mapped.

Value parameters:
key

The key whose associated value is to be returned.

Returns:

The value to which the specified key is mapped as an optional.

Inherited from:
NCPropertyMap
Source:
NCPropertyMap.scala

Returns a set view of the keys contained in this map.

Returns a set view of the keys contained in this map.

Returns:

A set view of the keys contained in this map.

Inherited from:
NCPropertyMap
Source:
NCPropertyMap.scala
def put[T](key: String, obj: Any): T

Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced by the specified value.

Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced by the specified value.

Value parameters:
key

Key with which the specified value is to be associated.

obj

Value to be associated with the specified key.

Returns:

The previous value associated with key, or null if there was no mapping for key.

Inherited from:
NCPropertyMap
Source:
NCPropertyMap.scala
def putIfAbsent[T](key: String, obj: T): T

If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.

If the specified key is not already associated with a value (or is mapped to null) associates it with the given value and returns null, else returns the current value.

Value parameters:
key

Key with which the specified value is to be associate

obj

Value to be associated with the specified key

Returns:

The previous value associated with the specified key, or null if there was no mapping for the key.

Inherited from:
NCPropertyMap
Source:
NCPropertyMap.scala
def remove(key: String, obj: Any): Boolean

Removes the entry for the specified key only if it is currently mapped to the specified value.

Removes the entry for the specified key only if it is currently mapped to the specified value.

Value parameters:
key

Key with which the specified value is associated value.

obj

Value expected to be associated with the specified key.

Returns:

true if the value was removed.

Inherited from:
NCPropertyMap
Source:
NCPropertyMap.scala
def remove[T](key: String): T

Removes the mapping for a key from this map if it is present.

Removes the mapping for a key from this map if it is present.

Value parameters:
key

Key whose mapping is to be removed from the map.

Returns:

The previous value associated with key, or null if there was no mapping for key.

Inherited from:
NCPropertyMap
Source:
NCPropertyMap.scala