Package org.languagetool.tagging
Class ManualTagger
java.lang.Object
org.languagetool.tagging.ManualTagger
- All Implemented Interfaces:
WordTagger
A tagger that reads the POS information from a plain (UTF-8) text file. This
makes it possible for the user to edit the text file to let the system know
about new words or missing readings in the *.dict file.
File Format: fullform baseform postags (tab separated)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String[]private static final Stringprivate static final intprivate final it.unimi.dsi.fastutil.objects.Object2IntMap<String> A map from inflected forms to encoded lemma+POS pair offsets indataprivate static final intprivate static final intprivate static final int -
Constructor Summary
ConstructorsConstructorDescriptionManualTagger(InputStream inputStream) ManualTagger(InputStream inputStream, boolean internTags) -
Method Summary
Modifier and TypeMethodDescriptionprivate static Map<String, List<TaggedWord>> loadMapping(InputStream inputStream, boolean internTags) Look up a word's baseform (lemma) and POS information.
-
Field Details
-
DEFAULT_SEPARATOR
- See Also:
-
OFFSET_SHIFT
private static final int OFFSET_SHIFT- See Also:
-
MAX_LENGTH
private static final int MAX_LENGTH- See Also:
-
MAX_OFFSET
private static final int MAX_OFFSET- See Also:
-
ENTRY_SIZE
private static final int ENTRY_SIZE- See Also:
-
data
-
map
A map from inflected forms to encoded lemma+POS pair offsets indata
-
-
Constructor Details
-
ManualTagger
- Throws:
IOException
-
ManualTagger
- Throws:
IOException
-
-
Method Details
-
loadMapping
private static Map<String,List<TaggedWord>> loadMapping(InputStream inputStream, boolean internTags) throws IOException - Throws:
IOException
-
tag
Look up a word's baseform (lemma) and POS information.- Specified by:
tagin interfaceWordTagger- Parameters:
word- the word to be tagged- Returns:
- the possible POS tags, or an empty list
-