// 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.*;
    }

    @Override
    public int getWordId(String headword, short posId, String readingForm) {
        for (int dictId = 1; dictId < lexicons.size(); dictId++) {
            int wid = lexicons.get(dictId).getWordId(headword, posId, readingForm);
            if (wid >= 0) {
                return buildWordId(dictId, wid);
            }
        }
        return lexicons.get(0).getWordId(headword, posId, readingForm);
    }

    @Override
    public short getLeftId(int wordId) {
        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) {
// 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.*;

    }

    @Override
    public int getWordId(String headword, short posId, String readingForm) {
        for (int dictId = 1; dictId < lexicons.size(); dictId++) {
            int wid = lexicons.get(dictId).getWordId(headword, posId, readingForm);
            if (wid >= 0) {
                return buildWordId(dictId, wid);
            }
        }
        return lexicons.get(0).getWordId(headword, posId, readingForm);
    }

    @Override
    public short getLeftId(int wordId) {
        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);