Package opennlp.tools.util.normalizer
package opennlp.tools.util.normalizer
-
ClassDescriptionA
CharSequenceNormalizerthat folds diacritics for matching, the multilingual-safe counterpart to a Latin-only ASCII folding filter.ACharSequenceNormalizerimplementation that aggregates the functionality of other normalizers.AnOffsetAwareNormalizerthat applies a chain of offset-aware normalizers in order and composes their per-stageAlignments withAlignment.andThen(Alignment), so the result maps a span found in the fully normalized text back to the original input through every stage.The result of a normalization that keeps the original text alongside the normalized form and a fullAlignmentbetween them.A bidirectional alignment between an original text and a normalized form of it.Builds anAlignmentas the normalized text is produced, by recording each edit in order.ASCII character helpers shared by the normalizer implementations of this package, so the character definitions cannot drift apart between classes.ACharSequenceNormalizerthat replaces unambiguous list-bullet characters with a space, so a bullet acts as a token separator rather than sticking to the following word.Loads the line-based data files bundled with OpenNLP, such as the Unicode Character Database extracts and the project-authored emoji tables.Holds data that is loaded on the first call toBundledUnicodeData.Lazy.get().Receives one line of a data file.Parses a bundled data stream.ACharSequenceNormalizerthat lower cases text for case-insensitive matching.A configurable class of Unicode code points and the cursor based operations over it.Chooses the code point that replaces one maximal run of member code points.A char sequence normalizer, used to adjusting (prune, substitute, add, etc.) characters in order to remove noise from textShared code-point decoding for forward (and reverse) cursor scans overCharSequencetext.A code point at an index together with its UTF-16 width.An immutable set of Unicode code points with O(1) membership.Computes the Unicode confusable skeleton of text, following the skeleton algorithm defined in UTS #39 (Unicode Security Mechanisms).ACharSequenceNormalizerthat reduces text to its Unicode confusable skeleton (UTS #39).ACharSequenceNormalizerthat maps every Unicode dash to an ASCII hyphen-minus (U+002D), reusing the cursor basedCharClass.dashes()engine.ACharSequenceNormalizerthat maps Unicode decimal digits to their ASCII equivalents, so for example Arabic-Indic, Devanagari, or fullwidth digits all become0-9.A layer of theTermnormalization stack, in increasing order of aggressiveness.ACharSequenceNormalizerthat expands the ellipsis and leader characters to ASCII dots: the horizontal ellipsis (U+2026) to"..."and the two-dot leader (U+2025) to"..".The annotation record of one emoji: an extensible per-symbol store of attribute values, each carrying its own provenance.One attribute value with its provenance, mirroring one row of the bundled data file.The joined-facts layer of the emoji annotation record store: a hook through which facts that live in user-installed data, typically a gazetteer (coordinates, containment chain, GeoNames or Who's On First identifiers), are resolved at run time and merged into anEmojiAnnotation.The bundled-facts layer of the emoji annotation record store: license-clean, provenance-tagged attributes intrinsic to a pictograph (name, coarse sentiment, entity type, document category), loaded on first use from the project-authoredemoji-annotations.txtresource.Assembles oneEmojiAnnotationper symbol from bundled facts (EmojiAnnotations), derived facts (EmojiFlags), and optional joined facts (EmojiAnnotationJoin).The document-category hint of an annotated emoji, one constant per group header of the upstream Unicodeemoji-test.txt(Emoji Keyboard/Display Test Data for UTS #51).ACharSequenceNormalizerimplementation that replaces each run of complete emoji with one space.The bundled emoji/emoticon fold tables (emoji-emoticons.txt) and the sequence substitution shared byEmojiToEmoticonCharSequenceNormalizerandEmoticonToEmojiCharSequenceNormalizer.One direction table, keyed by the first code point of the source sequence, candidates ordered longest source first so a scan is longest-match.One fold row: a source code point sequence and its replacement.The two direction tables produced byEmojiEmoticons.parse(InputStream).The coarse entity type of an annotated emoji, a small project-authored taxonomy assigned from the subgroup headers of the upstream Unicodeemoji-test.txt(Emoji Keyboard/Display Test Data for UTS #51), with documented exceptions: for example theface-smilingandface-concernedsubgroups map toEmojiEntityType.FACEandtransport-groundmaps toEmojiEntityType.VEHICLE.The derived-facts layer of the emoji annotation record store: decodes flag emoji to ISO 3166 codes purely from the code point sequence, with no data file.ACharSequenceNormalizerthat folds emoji to ASCII emoticons, using the bundledemoji-emoticons.txtmapping (for example U+1F642 SLIGHTLY SMILING FACE to:)).ACharSequenceNormalizerthat folds ASCII emoticons to emoji, using the bundledemoji-emoticons.txtmapping (for example:-)to U+1F642 SLIGHTLY SMILING FACE).ACharSequenceNormalizerthat applies Unicode full case folding for case-insensitive matching, as defined by the Default Case Algorithms in Section 3.13 of the Unicode Standard, using the bundledCaseFolding.txtdata of the Unicode Character Database.ACharSequenceNormalizerthat transliterates German umlauts and the eszett the way German conventionally expands them (DIN 5007-2): a-umlaut toae, o-umlaut tooe, u-umlaut toue, and eszett toss, with the capital umlauts and the capital eszett (U+1E9E) expanded likewise.Reads the hex code point notation of Unicode data files and similar code point tables: one code point as hex digits (1F600), a sequence as hex digits separated by whitespace (1F468 200D 1F469), and an inclusive range as two code points joined by two dots (1F3FB..1F3FF).ACharSequenceNormalizerthat removes invisible format and bidirectional control characters that add no textual content and are a common source of noise and spoofing (the byte-order mark, zero width space, word joiner, bidi marks/embeddings/overrides/isolates, the invisible math operators, soft hyphen, and the Arabic letter mark).AnOffsetAwareNormalizerthat collapses runs of Unicode whitespace likeWhitespaceCharSequenceNormalizer, but keeps line and paragraph structure: any whitespace run that contains a line break collapses to a single newline (U+000A) instead of a space, and leading and trailing whitespace is trimmed.Finds email addresses in text forUrlCharSequenceNormalizerand classifies whole tokens as email addresses.ACharSequenceNormalizerthat applies Unicode Normalization Form C (canonical composition, UAX #15).ACharSequenceNormalizerthat applies Unicode Normalization Form KC (compatibility composition, UAX #15).Per-language normalization settings, mirroring how OpenNLP already selects a Snowball stemmer by language.A registry ofNormalizationProfiles by language, with detection-based fallback: pick the profile for a requested language, or detect the language with aLanguageDetectorwhen it is unspecified.ACharSequenceNormalizerimplementation that normalizes text in terms of numbers: every maximal run of ASCII digits (0to9), that is the longest unbroken stretch of consecutive digits, is replaced by a single space.ACharSequenceNormalizerthat can additionally report theAlignmentfrom its normalized output back to the input, so a span found in the normalized text maps to the exact character offsets of the original.AnOffsetAwareNormalizerthat unwraps hard-wrapped prose while keeping real paragraph breaks.ACharSequenceNormalizerthat folds typographic quotation marks to their ASCII forms: the single quotes and apostrophes to'and the double quotes to".ACharSequenceNormalizerimplementation that shrinks repeated whitespace and repeated characters in text, in three steps: Each run of two or more ASCII whitespace characters (tab, line feed, vertical tab, form feed, carriage return, or space) collapses to a single space.ACharSequenceNormalizerimplementation that normalizes social media text: hashtags, user handles, retweet markers, emoticons, and repeated laughter.One token as a stack of normalization layers.A builder forTermAnalyzer.Entry point for composing normalization steps into a singleCharSequenceNormalizer.A fluent builder that appends normalization steps in order and composes them into oneCharSequenceNormalizerviaTextNormalizer.Builder.build().Reference data for Unicode dashes, plus O(1) membership lookups.The Unicode general category of a dash code point.One Unicode dash code point and its reference attributes.Finds complete emoji at a position of a text, from the bundled inventory of Unicode Emoji 18.0 sequences.WhatUnicodeEmojiSequences.candidateAt(CharSequence, int)found at a position.A trie node: the code points that may follow, and whether a sequence ends here.The result of one trie walk.Reference data for Unicode whitespace, plus O(1) membership lookups.Line-breaking behavior, mirroring the "Notes" column of the reference table.Unicode general category for a whitespace or related code point.One related code point that is commonly confused with whitespace but is not (White_Space=no).One Unicode whitespace code point and its reference attributes.ACharSequenceNormalizerimplementation that replaces eachhttporhttpsURL and each email address with one space.ACharSequenceNormalizerthat collapses each run of Unicode whitespace to a single ASCII space and trims the edges, reusing the cursor basedCharClass.whitespace()engine.