// Path: org.juzidian.cedict/src/main/java/org/juzidian/cedict/CedictEntry.java
// public interface CedictEntry {
// 
// 	String getTraditionalCharacters();
// 
// 	String getSimplifiedCharacters();
// 
// 	List<CedictPinyinSyllable> getPinyinSyllables();
// 
// 	List<String> getDefinitions();
// 
// }
// 
// Path: org.juzidian.core/src/main/java/org/juzidian/core/DictionaryEntry.java
// public class DictionaryEntry {
// 
// 	private final String traditional;
// 
// 	private final String simplified;
// 
// 	private final List<PinyinSyllable> pinyin;
// 
// 	private final List<String> definitions;
// 
// 	public DictionaryEntry(final String traditional, final String simplified, final List<PinyinSyllable> pinyin,
// 			final List<String> definitions) {
// 		this.traditional = traditional;
// 		this.simplified = simplified;
// 		this.pinyin = pinyin;
// 		this.definitions = definitions;
// 	}
// 
// 	/**
// 	 * @return the traditional Chinese representation of the word.
// 	 */
// 	public String getTraditional() {
// 		return this.traditional;
// 	}
// 
// 	/**
// 	 * @return the simplified Chinese representation of the word.
// 	 */
// 	public String getSimplified() {
// 		return this.simplified;
// 	}
// 
// 	/**
// 	 * @return the Pinyin phonetic representation of the word.
// 	 */
// 	public List<PinyinSyllable> getPinyin() {
// 		return Collections.unmodifiableList(this.pinyin);
// 	}
// 
// 	/**
// 	 * @return a list of English definitions for the word.
// 	 */
// 	public List<String> getDefinitions() {
// 		return Collections.unmodifiableList(this.definitions);
// 	}
// 
// 	/**
// 	 * @param pinyinSyllables a list of {@link PinyinSyllable}.
// 	 * @return <code>true</code> if this word starts with the given syllables.
// 	 */
// 	public boolean pinyinStartsWith(final Collection<PinyinSyllable> pinyinSyllables) {
// 		final List<PinyinSyllable> actualPinyinSyllables = this.getPinyin();
// 		int index = 0;
// 		for (final PinyinSyllable pinyinSyllable : pinyinSyllables) {
// 			if (index >= actualPinyinSyllables.size()) {
// 				return false;
// 			}
// 			final PinyinSyllable actualPinyinSyllable = actualPinyinSyllables.get(index);
// 			if (!pinyinSyllable.matches(actualPinyinSyllable)) {
// 				return false;
// 			}
// 			index += 1;
// 		}
// 		return true;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return this.getClass().getSimpleName() + " [" + this.getTraditional() + ", " + this.getSimplified() + ", " + this.getPinyinString()
// 				+ ", " + this.getDefinitions() + "]";
// 	}
// 
// 	private String getPinyinString() {
// 		final StringBuilder stringBuilder = new StringBuilder();
// 		for (final PinyinSyllable pinyinSyllable : this.getPinyin()) {
// 			stringBuilder.append(pinyinSyllable.getDisplayValue()).append(" ");
// 		}
// 		return stringBuilder.toString().trim();
// 	}
// 
// }


import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import javax.inject.Inject;
import org.juzidian.cedict.CedictEntry;
import org.juzidian.cedict.CedictLoadHandler;
import org.juzidian.core.DictionaryEntry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
 * Copyright Nathan Jones 2012
 *
 * This file is part of Juzidian.
 *
 * Juzidian is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Juzidian is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Juzidian.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.juzidian.dataload;




class EntryCollector implements CedictLoadHandler {

	private static final Logger LOGGER = LoggerFactory.getLogger(EntryCollector.class);

	private final CedictEntryToDictionaryEntryConverter entryConverter;

	private final List<DictionaryEntry> entries = new LinkedList<DictionaryEntry>();

	@Inject
	public EntryCollector(final CedictEntryToDictionaryEntryConverter entryConverter) {
		this.entryConverter = entryConverter;
	}

	public Collection<DictionaryEntry> getEntries() {
		return this.entries;
	}

	@Override
	public void loadingStarted() {

	}

	@Override
// Path: org.juzidian.cedict/src/main/java/org/juzidian/cedict/CedictEntry.java
// public interface CedictEntry {
// 
// 	String getTraditionalCharacters();
// 
// 	String getSimplifiedCharacters();
// 
// 	List<CedictPinyinSyllable> getPinyinSyllables();
// 
// 	List<String> getDefinitions();
// 
// }
// 
// Path: org.juzidian.core/src/main/java/org/juzidian/core/DictionaryEntry.java
// public class DictionaryEntry {
// 
// 	private final String traditional;
// 
// 	private final String simplified;
// 
// 	private final List<PinyinSyllable> pinyin;
// 
// 	private final List<String> definitions;
// 
// 	public DictionaryEntry(final String traditional, final String simplified, final List<PinyinSyllable> pinyin,
// 			final List<String> definitions) {
// 		this.traditional = traditional;
// 		this.simplified = simplified;
// 		this.pinyin = pinyin;
// 		this.definitions = definitions;
// 	}
// 
// 	/**
// 	 * @return the traditional Chinese representation of the word.
// 	 */
// 	public String getTraditional() {
// 		return this.traditional;
// 	}
// 
// 	/**
// 	 * @return the simplified Chinese representation of the word.
// 	 */
// 	public String getSimplified() {
// 		return this.simplified;
// 	}
// 
// 	/**
// 	 * @return the Pinyin phonetic representation of the word.
// 	 */
// 	public List<PinyinSyllable> getPinyin() {
// 		return Collections.unmodifiableList(this.pinyin);
// 	}
// 
// 	/**
// 	 * @return a list of English definitions for the word.
// 	 */
// 	public List<String> getDefinitions() {
// 		return Collections.unmodifiableList(this.definitions);
// 	}
// 
// 	/**
// 	 * @param pinyinSyllables a list of {@link PinyinSyllable}.
// 	 * @return <code>true</code> if this word starts with the given syllables.
// 	 */
// 	public boolean pinyinStartsWith(final Collection<PinyinSyllable> pinyinSyllables) {
// 		final List<PinyinSyllable> actualPinyinSyllables = this.getPinyin();
// 		int index = 0;
// 		for (final PinyinSyllable pinyinSyllable : pinyinSyllables) {
// 			if (index >= actualPinyinSyllables.size()) {
// 				return false;
// 			}
// 			final PinyinSyllable actualPinyinSyllable = actualPinyinSyllables.get(index);
// 			if (!pinyinSyllable.matches(actualPinyinSyllable)) {
// 				return false;
// 			}
// 			index += 1;
// 		}
// 		return true;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		return this.getClass().getSimpleName() + " [" + this.getTraditional() + ", " + this.getSimplified() + ", " + this.getPinyinString()
// 				+ ", " + this.getDefinitions() + "]";
// 	}
// 
// 	private String getPinyinString() {
// 		final StringBuilder stringBuilder = new StringBuilder();
// 		for (final PinyinSyllable pinyinSyllable : this.getPinyin()) {
// 			stringBuilder.append(pinyinSyllable.getDisplayValue()).append(" ");
// 		}
// 		return stringBuilder.toString().trim();
// 	}
// 
// }


// Path: org.juzidian.dataload/src/main/java/org/juzidian/dataload/EntryCollector.java
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import javax.inject.Inject;
import org.juzidian.cedict.CedictEntry;
import org.juzidian.cedict.CedictLoadHandler;
import org.juzidian.core.DictionaryEntry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/*
 * Copyright Nathan Jones 2012
 *
 * This file is part of Juzidian.
 *
 * Juzidian is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Juzidian is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Juzidian.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.juzidian.dataload;




class EntryCollector implements CedictLoadHandler {

	private static final Logger LOGGER = LoggerFactory.getLogger(EntryCollector.class);

	private final CedictEntryToDictionaryEntryConverter entryConverter;

	private final List<DictionaryEntry> entries = new LinkedList<DictionaryEntry>();

	@Inject
	public EntryCollector(final CedictEntryToDictionaryEntryConverter entryConverter) {
		this.entryConverter = entryConverter;
	}

	public Collection<DictionaryEntry> getEntries() {
		return this.entries;
	}

	@Override
	public void loadingStarted() {

	}

	@Override
	public void entryLoaded(final CedictEntry cedictEntry) {