Class TokenInfoFST


  • public final class TokenInfoFST
    extends java.lang.Object
    Thin wrapper around an FST with root-arc caching for Japanese.

    Depending upon fasterButMoreRam, either just kana (191 arcs), or kana and han (28,607 arcs) are cached. The latter offers additional performance at the cost of more RAM.

    • Field Detail

      • fst

        private final FST<java.lang.Long> fst
      • cacheCeiling

        private final int cacheCeiling
      • rootCache

        private final FST.Arc<java.lang.Long>[] rootCache
      • NO_OUTPUT

        public final java.lang.Long NO_OUTPUT
    • Constructor Detail

      • TokenInfoFST

        public TokenInfoFST​(FST<java.lang.Long> fst,
                            boolean fasterButMoreRam)
                     throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • cacheRootArcs

        private FST.Arc<java.lang.Long>[] cacheRootArcs()
                                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • findTargetArc

        public FST.Arc<java.lang.Long> findTargetArc​(int ch,
                                                     FST.Arc<java.lang.Long> follow,
                                                     FST.Arc<java.lang.Long> arc,
                                                     boolean useCache,
                                                     FST.BytesReader fstReader)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • getFirstArc

        public FST.Arc<java.lang.Long> getFirstArc​(FST.Arc<java.lang.Long> arc)
      • getInternalFST

        FST<java.lang.Long> getInternalFST()