There are 4 code examples for java.util.Dictionary.
The API names are highlighted below.
You can use
button
to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.
Project Name: hnlpengine-nlpengine Package: nlp.lang.he.morph.erel.io
Source Code: CollectionReader.java (Click to view .java file)
Method Code:
/**
* read a dictionary whose keys are String's and whose items are of a given
* class. The dictionary format is: { <class> k1 <sep> d1 k2 <sep> d2 ... }
* where: <class> is the class of the items, ki are the String keys, <sep>
* is the keydata_seperator, and di are the elements. The elements can be
* separated by any whitespace char (space, newline, etc.) The format of an
* empty dictionary is: {}
* @param thedictionary-- the place to where the elements will be added.
* @param keydata_separator-- the character that stands between a key and it's data.
*/
public void readWordDictionary(Dictionary thedictionary,char keydata_separator) throws IOException, ClassNotFoundException {
dictionarystart();
if (dictionaryend()) return;
Class theDataClass=readClass();
String nextKey;
Object nextData;
for (int counter=0; ; counter++) {
if (dictionaryend()) {
System.out.println("read " + counter + " dictionary entries");
return;
}
nextKey=readWord(keydata_separator);
nextData=readObject(theDataClass);
thedictionary.put(nextKey,nextData);
}
}
Project Name: hnlpengine-nlpengine Package: nlp.lang.he.morph.erel.io
Source Code: FuzzyObjectReader.java (Click to view .java file)
Method Code:
/**
* read a dictionary whose keys are String's and whose items are of class
* nextObjectClass.
* @param thedictionary-- the place to where the elements will be read.
* @param keydata_separator-- the character that stands between a key and it's data.
* @throws ClassNotFoundException
* @see #setNextObjectClass(Class)
*/
public void readWordDictionary(java.util.Dictionary thedictionary,char keydata_separator) throws IOException, ClassNotFoundException {
dictionarystart();
String curkey;
for (; ; ) {
if (dictionaryend()) return;
curkey=readWord(keydata_separator);
Object nextObject=readObject();
thedictionary.put(curkey,nextObject);
}
}
Project Name: hnlpengine-nlpengine Package: nlp.lang.he.morph.erel.io
Source Code: CollectionWriter.java (Click to view .java file)
Method Code:
/**
* write a dictionary whose keys are String's and whose items are of an
* IDENTICAL TYPE. The dictionary format is: { <class> \n k1 <sep> d1 \n k2
* <sep> d2 \n ... } where: <class> is the class of the items, ki are the
* String keys, <sep> is the keydata_separator, di are the elements and \n
* is the newline char. The format of an empty dictionary is: {\n}
* @param thedictionary-- the place to where the elements will be added.
* @param keydata_separator-- the character that stands between a key and it's data.
*/
public void writeWordDictionary(java.util.Dictionary thedictionary,String keydata_separator) throws IOException {
writeWordDictionary(thedictionary,keydata_separator,"\r\n");
}
Project Name: hnlpengine-nlpengine Package: nlp.lang.he.morph.erel.util
Source Code: MultiMap.java (Click to view .java file)
Method Code:
/**
* @return the number of KEYS contained in this multimap
*/
public int size(){
return map.size();
}