Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@
public class LanguageDetectorFactory extends BaseToolFactory {

/**
* @return Retrieves a {@link LanguageDetectorContextGenerator}.
* @return Retrieves a {@link LanguageDetectorContextGenerator}. The deprecated emoji
* normalizer stays in this chain because existing models were trained with it.
*/
@SuppressWarnings("deprecation")
public LanguageDetectorContextGenerator getContextGenerator() {
return new DefaultLanguageDetectorContextGenerator(1, 3,
EmojiCharSequenceNormalizer.getInstance(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public enum Dimension {
/** Diacritic and accent folding; lossy, script gated, and language-wrong for some languages. */
ACCENT_FOLD(AccentFoldCharSequenceNormalizer::getInstance),

/** Emoji folded to ASCII emoticons where a mapping exists; lossy, for matching only. */
EMOJI_FOLD(EmojiToEmoticonCharSequenceNormalizer::getInstance),

/** Confusable (homoglyph) skeleton folding per UTS #39; lossy, for matching only. */
CONFUSABLE_FOLD(ConfusableSkeletonCharSequenceNormalizer::getInstance),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
/**
* A {@link EmojiCharSequenceNormalizer} implementation that normalizes text
* in terms of emojis. Every encounter will be replaced by a whitespace.
*
* @deprecated Replaces every supplementary-plane code point with a space, not only emoji. Use
* {@link EmojiToEmoticonCharSequenceNormalizer} instead.
*/
@Deprecated(since = "3.0.0")
public class EmojiCharSequenceNormalizer implements CharSequenceNormalizer {

private static final long serialVersionUID = 4553401197981667914L;
Expand Down
Loading