package nimbus.keydic;

import android.content.Context;

import java.util.ArrayList;

/**
 * Created by InJung on 2015. 5. 30..
 */
public class Word {
    private String mLeft;
    private String mCenter;
    private String mRight;
    private String mExample;

    private static ArrayList<Word> wordList = null;

    public static Word get(int _index) {
        if (wordList == null)
            return null;

        return wordList.get(_index);
    }

    public static Word findWord(String _center) {
        for (Word word : wordList) {
            if (word.mCenter.equals(_center))
                return word;
        }

        return null;
    }

    public static void init(final Context _context) {
        wordList = new ArrayList<Word>();
        String[] words = _context.getResources().getStringArray(R.array.words);
        for (int i = 0; i < words.length / 5; i++) {
            Word word = new Word(words[i * 5 + 1], words[i * 5 + 2], words[i * 5 + 3], words[i * 5 + 4]);
            wordList.add(word);
        }
    }

    public Word(String _left, String _center, String _right, String _example) {
        mLeft = _left.equals("blank") ? "" : _left;
        mCenter = _center;
        mRight = _right.equals("blank") ? "" : _right;
        mExample = _example;
    }

    public String getLeft() {
        return mLeft;
    }

    public String getCenter() {
        return mCenter;
    }

    public String getRight() {
        return mRight;
    }

    public String getExample() {
        return mExample;
    }
}

@@ -643,32 +643,842 @@
 rn null;%0A    %7D%0A%0A
+    public static String%5B%5D getAllWords() %7B%0A        String%5B%5D values = new String%5BwordList.size()%5D;%0A        for (int i = 0; i %3C wordList.size(); i++)%0A            values%5Bi%5D = wordList.get(i).getCenter();%0A%0A        return values;%0A    %7D%0A%0A    public static ArrayList%3CWord%3E findWords(String _left, String _center, String _right) %7B%0A        ArrayList%3CWord%3E words = new ArrayList%3C%3E();%0A        for (Word word : wordList) %7B%0A            if (!word.mCenter.equals(_center))%0A                continue;%0A%0A            if (!_left.equals(%22%22) && word.mLeft.equals(_left))%0A                words.add(word);%0A%0A            if (!_right.equals(%22%22) && word.mRight.equals(_right))%0A                words.add(word);%0A%0A            if (_left.equals(%22%22) && _right.equals(%22%22))%0A                words.add(word);%0A        %7D%0A%0A        return words;%0A    %7D%0A%0A
     public stati

Fix Word Class