My favorites
▼
|
Sign in
android-traditional-chinese-ime
Traditional Chinese Input Methods for Android
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
src
/
com
/
googlecode
/
tcime
/
WordDictionary.java
‹r2
r14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.googlecode.tcime;
import android.content.Context;
import android.util.Log;
import java.util.concurrent.CountDownLatch;
/**
* Reads a word-dictionary and provides word-suggestions as a list of characters
* for the specified input.
*/
public abstract class WordDictionary {
private final CountDownLatch loading = new CountDownLatch(1);
private final DictionaryLoader loader;
protected WordDictionary(
Context context, int dictionaryId, int approxDictionarySize) {
loader = new DictionaryLoader(
context.getResources().openRawResource(dictionaryId),
approxDictionarySize, loading);
new Thread(loader).start();
}
protected char[][] dictionary() {
try {
loading.await();
} catch (InterruptedException e) {
Log.e("WordDictionary", "Loading is interrupted: ", e);
}
return loader.result();
}
/**
* Returns a string containing words as suggestions for the specified input.
*
* @param input should not be null.
* @return a concatenated string of characters, or an empty string if there
* is no word for that input.
*/
public abstract String getWords(CharSequence input);
}
Show details
Hide details
Change log
r3
by super.brother3 on Mar 19, 2010
Diff
Move package
Go to:
/trunk/AndroidManifest.xml
/trunk/res/layout/candidates.xml
/trunk/res/layout/input.xml
...id/inputmethod/zhuyin/About.java
...utmethod/zhuyin/AbstractIME.java
...method/zhuyin/CandidateView.java
.../zhuyin/CandidatesContainer.java
...od/zhuyin/CangjieDictionary.java
...method/zhuyin/CangjieEditor.java
...putmethod/zhuyin/CangjieIME.java
...tmethod/zhuyin/CangjieTable.java
...hod/zhuyin/DictionaryLoader.java
...d/inputmethod/zhuyin/Editor.java
...ethod/zhuyin/KeyboardSwitch.java
...hod/zhuyin/PhraseDictionary.java
...tmethod/zhuyin/SoftKeyboard.java
...hod/zhuyin/SoftKeyboardView.java
...ethod/zhuyin/WordDictionary.java
...hod/zhuyin/ZhuyinDictionary.java
...tmethod/zhuyin/ZhuyinEditor.java
...nputmethod/zhuyin/ZhuyinIME.java
...utmethod/zhuyin/ZhuyinTable.java
/trunk/src/com/googlecode
/trunk/src/com/googlecode/tcime
.../com/googlecode/tcime/About.java
...ooglecode/tcime/AbstractIME.java
...glecode/tcime/CandidateView.java
...e/tcime/CandidatesContainer.java
...ode/tcime/CangjieDictionary.java
...glecode/tcime/CangjieEditor.java
...googlecode/tcime/CangjieIME.java
...oglecode/tcime/CangjieTable.java
...code/tcime/DictionaryLoader.java
...com/googlecode/tcime/Editor.java
...lecode/tcime/KeyboardSwitch.java
...code/tcime/PhraseDictionary.java
...oglecode/tcime/SoftKeyboard.java
...code/tcime/SoftKeyboardView.java
...lecode/tcime/WordDictionary.java
...code/tcime/ZhuyinDictionary.java
...oglecode/tcime/ZhuyinEditor.java
.../googlecode/tcime/ZhuyinIME.java
...ooglecode/tcime/ZhuyinTable.java
Project members,
sign in
to write a code review
Older revisions
r2
by super.brother3 on Mar 18, 2010
Diff
Initial checkin.
All revisions of this file
File info
Size: 1780 bytes, 58 lines
View raw file
Powered by
Google Project Hosting