Class OldNgramExtractor


  • @Deprecated
    public class OldNgramExtractor
    extends Object
    Deprecated.
    Author:
    Nakatani Shuyo
    • Constructor Detail

      • OldNgramExtractor

        public OldNgramExtractor()
        Deprecated.
    • Method Detail

      • extractNGrams

        @NotNull
        @Deprecated
        public static @NotNull List<String> extractNGrams​(@NotNull
                                                          @NotNull CharSequence text,
                                                          @Nullable
                                                          @Nullable OldNgramExtractor.Filter filter)
        Deprecated.
        This was the method found in the com.cybozu.labs.langdetect.Detector class, it was used to extract grams from the to-analyze text. NOTE: although it adds the first ngram with space, it does not add the last n-gram with space. example: "foo" gives " fo" but not "oo "!. It is not clear yet whether this is desired (and why) or a bug. TODO replace this algorithm with a simpler, faster one that uses less memory: only by position shifting. also, the returned list size can be computed before making it (based on text length and number of n-grams).