Package org.languagetool.chunking
Class GermanChunker
- java.lang.Object
-
- org.languagetool.chunking.GermanChunker
-
- All Implemented Interfaces:
org.languagetool.chunking.Chunker
public class GermanChunker extends java.lang.Object implements org.languagetool.chunking.Chunker
A rule-based German chunker for noun phrases. Please note that this chunker has not been evaluated as a stand-alone chunker, it has only been used and tested in the context of LanguageTool's error detection rules.- Since:
- 2.9
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
GermanChunker.AffectedSpans
(package private) static class
GermanChunker.PhraseType
private static class
GermanChunker.RegularExpressionWithPhraseType
private static class
GermanChunker.Span
-
Field Summary
Fields Modifier and Type Field Description private static boolean
debug
private static TokenExpressionFactory
FACTORY
private static java.util.Set<java.lang.String>
FILTER_TAGS
private static java.util.List<GermanChunker.RegularExpressionWithPhraseType>
REGEXES1
private static java.util.List<GermanChunker.RegularExpressionWithPhraseType>
REGEXES2
private static java.util.Map<java.lang.String,java.lang.String>
SYNTAX_EXPANSION
-
Constructor Summary
Constructors Constructor Description GermanChunker()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addChunkTags(java.util.List<org.languagetool.AnalyzedTokenReadings> tokenReadings)
private void
apply(GermanChunker.RegularExpressionWithPhraseType regex, java.util.List<ChunkTaggedToken> tokens)
private void
assignChunksToReadings(java.util.List<ChunkTaggedToken> chunkTaggedTokens)
private static GermanChunker.RegularExpressionWithPhraseType
build(java.lang.String expr, GermanChunker.PhraseType phraseType)
private static GermanChunker.RegularExpressionWithPhraseType
build(java.lang.String expr, GermanChunker.PhraseType phraseType, boolean overwrite)
private GermanChunker.AffectedSpans
doApplyRegex(GermanChunker.RegularExpressionWithPhraseType regex, java.util.List<ChunkTaggedToken> tokens)
(package private) java.util.List<ChunkTaggedToken>
getBasicChunks(java.util.List<org.languagetool.AnalyzedTokenReadings> tokenReadings)
private org.languagetool.chunking.ChunkTag
getChunkTag(GermanChunker.RegularExpressionWithPhraseType regex, edu.washington.cs.knowitall.regex.Match<ChunkTaggedToken> match, int i)
private java.lang.String
getDebugString(java.util.List<ChunkTaggedToken> tokens)
static boolean
isDebug()
Deprecated.for internal use onlyprivate void
printDebugInfo(GermanChunker.RegularExpressionWithPhraseType regex, GermanChunker.AffectedSpans affectedSpans, java.lang.String debug)
static void
setDebug(boolean debugMode)
Deprecated.for internal use only
-
-
-
Field Detail
-
FILTER_TAGS
private static final java.util.Set<java.lang.String> FILTER_TAGS
-
FACTORY
private static final TokenExpressionFactory FACTORY
-
SYNTAX_EXPANSION
private static final java.util.Map<java.lang.String,java.lang.String> SYNTAX_EXPANSION
-
debug
private static boolean debug
-
REGEXES1
private static final java.util.List<GermanChunker.RegularExpressionWithPhraseType> REGEXES1
-
REGEXES2
private static final java.util.List<GermanChunker.RegularExpressionWithPhraseType> REGEXES2
-
-
Method Detail
-
setDebug
public static void setDebug(boolean debugMode)
Deprecated.for internal use only
-
isDebug
public static boolean isDebug()
Deprecated.for internal use only
-
build
private static GermanChunker.RegularExpressionWithPhraseType build(java.lang.String expr, GermanChunker.PhraseType phraseType)
-
build
private static GermanChunker.RegularExpressionWithPhraseType build(java.lang.String expr, GermanChunker.PhraseType phraseType, boolean overwrite)
-
addChunkTags
public void addChunkTags(java.util.List<org.languagetool.AnalyzedTokenReadings> tokenReadings)
- Specified by:
addChunkTags
in interfaceorg.languagetool.chunking.Chunker
-
getBasicChunks
java.util.List<ChunkTaggedToken> getBasicChunks(java.util.List<org.languagetool.AnalyzedTokenReadings> tokenReadings)
-
apply
private void apply(GermanChunker.RegularExpressionWithPhraseType regex, java.util.List<ChunkTaggedToken> tokens)
-
assignChunksToReadings
private void assignChunksToReadings(java.util.List<ChunkTaggedToken> chunkTaggedTokens)
-
doApplyRegex
private GermanChunker.AffectedSpans doApplyRegex(GermanChunker.RegularExpressionWithPhraseType regex, java.util.List<ChunkTaggedToken> tokens)
-
getChunkTag
private org.languagetool.chunking.ChunkTag getChunkTag(GermanChunker.RegularExpressionWithPhraseType regex, edu.washington.cs.knowitall.regex.Match<ChunkTaggedToken> match, int i)
-
printDebugInfo
private void printDebugInfo(GermanChunker.RegularExpressionWithPhraseType regex, GermanChunker.AffectedSpans affectedSpans, java.lang.String debug)
-
getDebugString
private java.lang.String getDebugString(java.util.List<ChunkTaggedToken> tokens)
-
-