]> gitweb.fperrin.net Git - Dictionary.git/blobdiff - src/com/hughes/android/dictionary/Dictionary.java
go
[Dictionary.git] / src / com / hughes / android / dictionary / Dictionary.java
index 3133e281dcdd82b33436361ede4f92939ec40296..5de8d3262508a3b105f1776c93d4d6817fd1c79c 100755 (executable)
@@ -6,6 +6,7 @@ import java.util.ArrayList;
 import java.util.List;\r
 import java.util.concurrent.atomic.AtomicBoolean;\r
 \r
+import com.hughes.android.dictionary.engine.Language;\r
 import com.hughes.util.CachingList;\r
 import com.hughes.util.raf.RAFList;\r
 import com.hughes.util.raf.RAFFactory;\r
@@ -18,8 +19,7 @@ public final class Dictionary implements RAFSerializable<Dictionary> {
   \r
   private static final String VERSION_CODE = "DictionaryVersion=2.0";\r
 \r
-  static final RAFSerializer<SimpleEntry> ENTRY_SERIALIZER = new RAFSerializableSerializer<SimpleEntry>(\r
-      SimpleEntry.RAF_FACTORY);\r
+  static final RAFSerializer<SimpleEntry> ENTRY_SERIALIZER = null;\r
   static final RAFSerializer<Row> ROW_SERIALIZER = new RAFSerializableSerializer<Row>(\r
       Row.RAF_FACTORY);\r
   static final RAFSerializer<IndexEntry> INDEX_ENTRY_SERIALIZER = new RAFSerializableSerializer<IndexEntry>(\r
@@ -41,8 +41,7 @@ public final class Dictionary implements RAFSerializable<Dictionary> {
   public Dictionary(final RandomAccessFile raf) throws IOException {\r
     dictionaryInfo = raf.readUTF();\r
     sources = new ArrayList<String>(RAFList.create(raf, RAFSerializer.STRING, raf.getFilePointer()));\r
-    entries = CachingList.create(RAFList.create(raf, ENTRY_SERIALIZER, raf\r
-        .getFilePointer()), 10000);\r
+    entries = null;\r
     languageDatas[0] = new LanguageData(this, raf, SimpleEntry.LANG1);\r
     languageDatas[1] = new LanguageData(this, raf, SimpleEntry.LANG2);\r
     final String version = raf.readUTF();\r
@@ -54,7 +53,7 @@ public final class Dictionary implements RAFSerializable<Dictionary> {
   public void write(RandomAccessFile raf) throws IOException {\r
     raf.writeUTF(dictionaryInfo);\r
     RAFList.write(raf, sources, RAFSerializer.STRING);\r
-    RAFList.write(raf, entries, ENTRY_SERIALIZER);\r
+    //RAFList.write(raf, entries, ENTRY_SERIALIZER);\r
     languageDatas[0].write(raf);\r
     languageDatas[1].write(raf);\r
     raf.writeUTF(VERSION_CODE);\r
@@ -95,8 +94,9 @@ public final class Dictionary implements RAFSerializable<Dictionary> {
     }\r
 \r
     String rowToString(final Row row, final boolean onlyFirstSubentry) {\r
-      return row.isToken() ? sortedIndex.get(row.getIndex()).word : entries\r
-          .get(row.getIndex()).getRawText(onlyFirstSubentry);\r
+      return null;\r
+      //return row.isToken() ? sortedIndex.get(row.getIndex()).word : entries\r
+      //    .get(row.getIndex()).getRawText(onlyFirstSubentry);\r
     }\r
 \r
     int lookup(String word, final AtomicBoolean interrupted) {\r