Methods
(static) create(options, metadataOptions)
- Source:
 
Create a valid TokenTagging with required fields AnnotationMetadata and UUID
Example usage:
tt = TokenTagging.create({taggingType: 'NER'}, {tool: 'HIT'})
Parameters:
| Name | Type | Description | 
|---|---|---|
options | 
            
            Object | Override default TokenTagging fields (except metadata)  | 
        
metadataOptions | 
            
            Object | Override default tokenTagging.metadata fields  | 
        
bioGetBIOValue({Integer) → {String|null}
- Source:
 
Get BIO value for TaggedToken at tokenIndex
Parameters:
| Name | Type | Description | 
|---|---|---|
{Integer | 
            
            tokenIndex  | 
        
Returns:
- 'B', 'I', 'O' or null
 
- Type
 - String | null
 
bioGetTagSeparator() → {String}
- Source:
 
Returns separator character for BIO TokenTaggings.
If the separator character had not been set before this function was called, the separator character will be set to '-'.
Returns:
- Separator character for BIO TokenTaggings
 
- Type
 - String
 
bioGetTagValue({Integer) → {String|null}
- Source:
 
Get tag value (stripped of BIO tag and separator) for TaggedToken at tokenIndex
Parameters:
| Name | Type | Description | 
|---|---|---|
{Integer | 
            
            tokenIndex  | 
        
Returns:
- 'B', 'I', 'O' or null
 
- Type
 - String | null
 
bioGetTokenIndexForB(tokenIndex) → {Number}
- Source:
 
Returns token index of 'B' tag for the (possibly multi-token) 'BI' tagging at the specified tokenIndex.
If the tag at tokenIndex is a 'B' tag, return tokenIndex. If the tag at tokenIndex is an 'I' tag, find the index of the 'B' tag for this 'I' tag.
Parameters:
| Name | Type | Description | 
|---|---|---|
tokenIndex | 
            
            Number | 
Throws:
- 
        
Thrown if the tag at TokenIndex is not a 'B' or 'I' tag. Also thrown if the tag at TokenIndex is a valid 'I' tag, but not part of a valid 'BI*' multi-token tagging.
 - Type
 - TypeError
 
Returns:
- Token index of "B" tag
 
- Type
 - Number
 
bioSetTaggedTokenTag(bioValue, tagText, tokenIndex)
- Source:
 
Set BIO TaggedToken tag
Parameters:
| Name | Type | Description | 
|---|---|---|
bioValue | 
            
            String | Should be 'B', 'I' or 'O'  | 
        
tagText | 
            
            String | |
tokenIndex | 
            
            Number | 
Throws:
- 
        
Thrown if bioValue is not 'B'|'I'|'O'. Also thrown if bioValue is 'I', but not part of a valid 'BI*' multi-token tagging.
 - Type
 - TypeError
 
bioSetTagSeparator(separator)
- Source:
 
For BIO TokenTaggings, sets separator character to be used between B/I/O character and rest of tag
Parameters:
| Name | Type | Description | 
|---|---|---|
separator | 
            
            String | String used as separator character  | 
        
deepCopyTaggedTokenList() → {Array.<TaggedToken>}
- Source:
 
Return a deep copy of this TokenTagging's taggedTokenList.
Returns:
- Type
 - Array.<TaggedToken>
 
getTaggedTokenWithTokenIndex(tokenIndex) → {TaggedToken|null}
- Source:
 
Return the TaggedToken (or null) with the specified tokenIndex
Parameters:
| Name | Type | Description | 
|---|---|---|
tokenIndex | 
            
            Number | 
Returns:
- Type
 - TaggedToken | null
 
setAllTaggedTokenTags(tokenization, tagText)
- Source:
 
Set taggedTokenList to a list of TaggedTokens (one per token) with identical tags
Parameters:
| Name | Type | Description | 
|---|---|---|
tokenization | 
            
            Tokenization | Used to determine # of TokenTags  | 
        
tagText | 
            
            String | Value for each TaggedToken's "tag" field  | 
        
setTaggedTokenTag(tagText, tokenIndex)
- Source:
 
Sets the tag of the TaggedToken with the specified tokenIndex. If a TaggedToken with the specified tokenIndex does not exist, than it will be created.
Parameters:
| Name | Type | Description | 
|---|---|---|
tagText | 
            
            String | |
tokenIndex | 
            
            Number |