|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mit.jmwe.index.InMemoryMWEIndex
edu.mit.jmwe.index.MWEIndex
public class MWEIndex
Simple implementation of IMWEIndex
that reads an index, possibly with internal comments
prefixed by '//' or ';;', from a URL.
Field Summary |
---|
Fields inherited from class edu.mit.jmwe.index.InMemoryMWEIndex |
---|
lifecycleLock |
Fields inherited from interface edu.mit.jmwe.index.IMWEIndex |
---|
commentDoubleSemicolon, commentDoubleSlash |
Constructor Summary | |
---|---|
MWEIndex(File file)
Constructs the index from the given source file pointing to a list of multi-word expressions. |
|
MWEIndex(Iterable<String> origData)
Constructs the index from a String of multi-word expressions. |
|
MWEIndex(Map<IMWEDescID,? extends IRootMWEDesc> rootDescs)
Constructs the index from a map of IMWEDescIDs to IRootMWEDescs. |
|
MWEIndex(String... rootDescs)
Constructs this index from an array of multi-word expression strings. |
|
MWEIndex(URL url)
Constructs a new MWE index that uses the data from the specified URL to construct its index. |
Method Summary | |
---|---|
protected Map<IMWEDescID,? extends IRootMWEDesc> |
createData()
|
URL |
getSource()
Returns the URL used by this index. |
Methods inherited from class edu.mit.jmwe.index.InMemoryMWEIndex |
---|
checkOpen, close, createData, createData, createIndex, get, get, getAll, getIndexIterator, getInflectedMWEDesc, getRootIterator, getRootMWEDesc, insert, isComment, isOpen, open |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MWEIndex(String... rootDescs)
rootDescs
- the array of multi-word expression strings this index will be
constructed from.public MWEIndex(Iterable<String> origData)
this_and_that_R
origData
- iterable of multi-word expression definitions. The parts and
part of speech of each multi-word expression should be
separated by underscores and each multi-word expression, if
there is more than one, should be separated by a space
character.public MWEIndex(Map<IMWEDescID,? extends IRootMWEDesc> rootDescs)
rootDescs
- a map of IMWEDescIDs to IRootMWEDescs. May not be
/null
.public MWEIndex(File file)
file
- the list of multi-word expressions. May not be
null
.public MWEIndex(URL url)
url
- the URL at which the index data is found
NullPointerException
- if the specified URL is null
Method Detail |
---|
public URL getSource()
null
, used by this indexprotected Map<IMWEDescID,? extends IRootMWEDesc> createData() throws IOException
createData
in class InMemoryMWEIndex
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |