info.ephyra.questionanalysis.atype
Class WordNetAnswerTypeMapping
java.lang.Object
info.ephyra.questionanalysis.atype.WordNetAnswerTypeMapping
public class WordNetAnswerTypeMapping
- extends java.lang.Object
Uses WordNet to map question focus terms to answer types.
- Version:
- 2008-02-10
- Author:
- Justin Betteridge
|
Field Summary |
private static java.util.Comparator<AnswerType> |
atypeComparator
|
private static boolean |
initialized
|
private static org.apache.log4j.Logger |
log
|
private static net.didion.jwnl.data.PointerUtils |
pUtils
|
private static java.util.Map<java.lang.String,java.lang.String> |
wnAtypeMap
|
private static java.util.List<java.lang.String> |
wnAtypeMapKeys
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static final org.apache.log4j.Logger log
wnAtypeMap
private static java.util.Map<java.lang.String,java.lang.String> wnAtypeMap
wnAtypeMapKeys
private static java.util.List<java.lang.String> wnAtypeMapKeys
pUtils
private static net.didion.jwnl.data.PointerUtils pUtils
initialized
private static boolean initialized
atypeComparator
private static java.util.Comparator<AnswerType> atypeComparator
WordNetAnswerTypeMapping
public WordNetAnswerTypeMapping()
initialize
public static void initialize()
throws java.lang.Exception
- Initializes static resources. The input properties that must be defined are:
- jwnl.configuration : the location of the configuration file for JWNL
- edu.cmu.lti.javelin.qa.english.WordNetAnswerTypeMapping.mapFile :
the location of the file specifying a mapping from WordNet synsets
to answer subtypes. The one-to-many mapping must be specified
one element per line, with the domain and range values separated by a comma.
Blank lines and lines beginning with "#" are ignored. WordNet synsets must be
represented by concatenating the list of lemmas in the synset, separating them
with a dash ("-"), followed by another "-" and the database file offset of the synset.
(Note: this offset value will vary with the version of WordNet used.)
Thus, an example of an element of the mapping is:
body_of_water-water-8651117,ocean
- Throws:
java.lang.Exception - if one of the required properties is not defined.
isInitialized
public static boolean isInitialized()
setInitialized
public static void setInitialized(boolean init)
getAnswerType
public static java.lang.String getAnswerType(edu.cmu.lti.javelin.qa.Term focusTerm)
findWnMapMatch
private static AnswerType findWnMapMatch(net.didion.jwnl.data.Synset synset,
int level)
throws java.lang.Exception
- Throws:
java.lang.Exception
buildSynsetString
private static java.lang.String buildSynsetString(net.didion.jwnl.data.Synset node)