public class InterLingualIndex
extends java.lang.Object
Note that this class loads resource files into memory on demand for mapping purposes, and once loaded, they are never unloaded.
Constructor and Description |
---|
InterLingualIndex() |
Modifier and Type | Method and Description |
---|---|
static Dictionary |
getDictionary(java.lang.String wordnetSource,
java.lang.String languageCode)
Gets a dictionary for a language from a known prepackaged source.
|
static SynsetMapper |
loadMapper(Dictionary sourceDictionary,
Dictionary targetDictionary)
Loads a mapper from one dictionary to another, automatically using
the correct interlingual index (if one is available) for word sense
alignment.
|
static Synset |
mapSynset(Synset sourceSynset,
Dictionary targetDictionary)
Maps a synset from one dictionary to another, automatically using
the correct interlingual index (if one is available) for word sense
alignment.
|
public static Dictionary getDictionary(java.lang.String wordnetSource, java.lang.String languageCode) throws JWNLException
wordnetSource
- one of wn31
: Princeton WordNet 3.1wn31/map
: Princeton WordNet 3.1 (via serialized form)wn30
: Princeton WordNet 3.0wn21
: Princeton WordNet 2.1mcr30
: Multilingual Central Repository (MCR) 3.0languageCode
- ISO 639-3 three-letter language code, e.g. eng
or
spa
JWNLException
- if dictionary unknown or resource unavailablepublic static Synset mapSynset(Synset sourceSynset, Dictionary targetDictionary) throws JWNLException
sourceSynset
- the synset to be mapped from the source dictionarytargetDictionary
- the target dictionary into which
sourceSynset
should be mappedsourceSynset
in the target
dictionary, or null if no mapping is availableJWNLException
- if mapping or dictionary resources unavailable or
could not be accessedpublic static SynsetMapper loadMapper(Dictionary sourceDictionary, Dictionary targetDictionary) throws JWNLException
sourceDictionary
- the source dictionary from which synsets will be mappedtargetDictionary
- the target dictionary into which
synsets will be mappedSynsetMapper
JWNLException
- if mapping or dictionary resources unavailable or
could not be accessed