// Path: src/main/java/com/worksap/nlp/sudachi/WordId.java
// public class WordId {
//     private WordId() {
//     }
// 
//     /**
//      * Internal word ids can't be larger than this number
//      */
//     public static final int MAX_WORD_ID = 0x0fffffff;
// 
//     /**
//      * Dictionary ids can't be larger than this number
//      */
//     public static final int MAX_DIC_ID = 0xe;
// 
//     public static int makeUnchecked(int dic, int word) {
//         int dicPart = dic << 28;
//         return dicPart | word;
//     }
// 
//     /**
//      * Make combined WordId from dictionary and internal parts. This method does
//      * bound checking.
//      *
//      * @param dic
//      *            dictionary id. 0 is system, 1 and above are user.
//      * @param word
//      *            word id inside the dictionary.
//      * @return combined word id.
//      */
//     public static int make(int dic, int word) {
//         if (word > MAX_WORD_ID) {
//             throw new IndexOutOfBoundsException("wordId is too large: " + word);
//         }
//         if (dic > MAX_DIC_ID) {
//             throw new IndexOutOfBoundsException("dictionaryId is too large: " + dic);
//         }
//         return makeUnchecked(dic, word);
//     }
// 
//     /**
//      * Extract dictionary number from the combined word id
//      * 
//      * @param wordId
//      *            combined word id
//      * @return dictionary number
//      */
//     public static int dic(int wordId) {
//         return wordId >>> 28;
//     }
// 
//     /**
//      * Extract internal word id from the combined word id
//      * 
//      * @param wordId
//      *            combined word id
//      * @return internal word id
//      */
//     public static int word(int wordId) {
//         return wordId & MAX_WORD_ID;
//     }
// }


import com.worksap.nlp.sudachi.WordId;
import java.util.*;
        return lexicons.get(getDictionaryId(wordId)).getLeftId(getWordId(wordId));
    }

    @Override
    public short getRightId(int wordId) {
        return lexicons.get(getDictionaryId(wordId)).getRightId(getWordId(wordId));
    }

    @Override
    public short getCost(int wordId) {
        return lexicons.get(getDictionaryId(wordId)).getCost(getWordId(wordId));
    }

    @Override
    public WordInfo getWordInfo(int wordId) {
        int dictionaryId = WordId.dic(wordId);
        int internalId = WordId.word(wordId);
        WordInfo wordInfo = lexicons.get(dictionaryId).getWordInfo(internalId);
        short posId = wordInfo.getPOSId();
        if (dictionaryId > 0 && posId >= posOffsets.get(1)) { // user defined part-of-speech
            wordInfo.setPOSId((short) (wordInfo.getPOSId() - posOffsets.get(1) + posOffsets.get(dictionaryId)));
        }
        convertSplit(wordInfo.getAunitSplit(), dictionaryId);
        convertSplit(wordInfo.getBunitSplit(), dictionaryId);
        convertSplit(wordInfo.getWordStructure(), dictionaryId);
        return wordInfo;
    }

    @Override
    public int getDictionaryId(int wordId) {
// Path: src/main/java/com/worksap/nlp/sudachi/WordId.java
// public class WordId {
//     private WordId() {
//     }
// 
//     /**
//      * Internal word ids can't be larger than this number
//      */
//     public static final int MAX_WORD_ID = 0x0fffffff;
// 
//     /**
//      * Dictionary ids can't be larger than this number
//      */
//     public static final int MAX_DIC_ID = 0xe;
// 
//     public static int makeUnchecked(int dic, int word) {
//         int dicPart = dic << 28;
//         return dicPart | word;
//     }
// 
//     /**
//      * Make combined WordId from dictionary and internal parts. This method does
//      * bound checking.
//      *
//      * @param dic
//      *            dictionary id. 0 is system, 1 and above are user.
//      * @param word
//      *            word id inside the dictionary.
//      * @return combined word id.
//      */
//     public static int make(int dic, int word) {
//         if (word > MAX_WORD_ID) {
//             throw new IndexOutOfBoundsException("wordId is too large: " + word);
//         }
//         if (dic > MAX_DIC_ID) {
//             throw new IndexOutOfBoundsException("dictionaryId is too large: " + dic);
//         }
//         return makeUnchecked(dic, word);
//     }
// 
//     /**
//      * Extract dictionary number from the combined word id
//      * 
//      * @param wordId
//      *            combined word id
//      * @return dictionary number
//      */
//     public static int dic(int wordId) {
//         return wordId >>> 28;
//     }
// 
//     /**
//      * Extract internal word id from the combined word id
//      * 
//      * @param wordId
//      *            combined word id
//      * @return internal word id
//      */
//     public static int word(int wordId) {
//         return wordId & MAX_WORD_ID;
//     }
// }


// Path: src/main/java/com/worksap/nlp/sudachi/dictionary/LexiconSet.java
import com.worksap.nlp.sudachi.WordId;
import java.util.*;

        return lexicons.get(getDictionaryId(wordId)).getLeftId(getWordId(wordId));
    }

    @Override
    public short getRightId(int wordId) {
        return lexicons.get(getDictionaryId(wordId)).getRightId(getWordId(wordId));
    }

    @Override
    public short getCost(int wordId) {
        return lexicons.get(getDictionaryId(wordId)).getCost(getWordId(wordId));
    }

    @Override
    public WordInfo getWordInfo(int wordId) {
        int dictionaryId = WordId.dic(wordId);
        int internalId = WordId.word(wordId);
        WordInfo wordInfo = lexicons.get(dictionaryId).getWordInfo(internalId);
        short posId = wordInfo.getPOSId();
        if (dictionaryId > 0 && posId >= posOffsets.get(1)) { // user defined part-of-speech
            wordInfo.setPOSId((short) (wordInfo.getPOSId() - posOffsets.get(1) + posOffsets.get(dictionaryId)));
        }
        convertSplit(wordInfo.getAunitSplit(), dictionaryId);
        convertSplit(wordInfo.getBunitSplit(), dictionaryId);
        convertSplit(wordInfo.getWordStructure(), dictionaryId);
        return wordInfo;
    }

    @Override
    public int getDictionaryId(int wordId) {
        return WordId.dic(wordId);