/**
         * Constructor
         *
         * @param fst  FST with surface forms
         * @param dictionary  token info dictionary
         * @param unknownDictionary  unknown word dictionary
         * @param userDictionary  user dictionary
         * @param mode  tokenization {@link Mode mode}
         */
        public ViterbiBuilder(FST.FST fst,
                              TokenInfoDictionary dictionary,
                              UnknownDictionary unknownDictionary,
                              UserDictionary userDictionary,
                              Mode mode)
        {
            this.fst               = fst;
            this.dictionary        = dictionary;
            this.unknownDictionary = unknownDictionary;
            this.userDictionary    = userDictionary;

            this.useUserDictionary = (userDictionary != null);

            if (mode == Mode.SEARCH || mode == Mode.EXTENDED)
            {
                searchMode = true;
            }
            this.characterDefinitions = unknownDictionary.GetCharacterDefinition();
        }