|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.illinois.cs.cogcomp.lbj.coref.features.Matches
public class Matches
Stores pairings of equivalent strings, loaded from a file.
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
m_aToB
|
protected java.util.Map<java.lang.String,java.lang.String> |
m_bToA
|
Constructor Summary | |
---|---|
Matches()
Creates an empty matching. |
|
Matches(java.lang.String filename)
Creates the mapping and loads it from the specified file. |
Method Summary | |
---|---|
boolean |
doMatch(java.lang.String s,
java.lang.String t)
Determines whether a pair of strings is a match. |
protected void |
load(java.lang.String filename)
Loads the matchings into this from a file. |
protected java.lang.String |
removeParenthetical(java.lang.String full)
Removes all parenthetical phrases not containing any nested parentheses. |
java.lang.String |
toString()
Converts this mapping to a string in an unspecified format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<java.lang.String,java.lang.String> m_aToB
protected java.util.Map<java.lang.String,java.lang.String> m_bToA
Constructor Detail |
---|
public Matches()
public Matches(java.lang.String filename)
filename
- The file specifying the mapping,
in the format specified by the load
method.Method Detail |
---|
public boolean doMatch(java.lang.String s, java.lang.String t)
doMatch(s,t) == doMatch(t,s)
.
For now, this method is not case sensitive.
s
- One stringt
- Another string.
public java.lang.String toString()
toString
in class java.lang.Object
protected void load(java.lang.String filename)
this
from a file.
The format of each line of the file is a:b
Optionally, b may be a comma-space (", ") separated list,
in which case, each element of that list will be associated
with a, while a will be associated with b treated as a single string.
filename
- The name of the file, which must be relative
to the classpath.protected java.lang.String removeParenthetical(java.lang.String full)
full
- The full string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |