Package opennlp.tools.postag
Klasse POSTagFormatMapper
java.lang.Object
opennlp.tools.postag.POSTagFormatMapper
- Bekannte direkte Unterklassen:
POSTagFormatMapper.NoOp
A mapping implementation for converting between different POS tag formats.
This class supports conversion between Penn Treebank (PENN) and Universal Dependencies (UD) formats.
The conversion is based on the Universal Dependencies conversion table.
Please note that when converting from UD to Penn format, there may be ambiguity in some cases.
-
Verschachtelte Klassen - Übersicht
Verschachtelte Klassen -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungconvertTag
(String tag) Converts a given tag to the specified format.String[]
convertTags
(List<String> tags) Converts a list of tags to the specified format.static POSTagFormat
guessFormat
(POSModel posModel) Guesses thePOSTagFormat
of a givenPOSModel
-
Methodendetails
-
convertTags
Converts a list of tags to the specified format.- Parameter:
tags
- a list of tags to be converted.- Gibt zurück:
- an array containing the converted tags with the same order and size as the given input list.
Note: A given tag might be
?
if no mapping for the giventag
could be found.
-
convertTag
Converts a given tag to the specified format.- Parameter:
tag
- no restrictions on this parameter.- Gibt zurück:
- the converted tag form or
?
if no mapping fortag
could be found.
-
getGuessedFormat
- Gibt zurück:
- The guessed
POSTagFormat
. Guaranteed to be notnull
.
-
guessFormat
Guesses thePOSTagFormat
of a givenPOSModel
- Parameter:
posModel
- must not benull
.- Gibt zurück:
- the guessed
POSTagFormat
.
-