|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.tagger.maxent.GlobalHolder
public class GlobalHolder
This class holds many global variables and other things that are used by the Stanford MaxEnt Part-of-speech Tagger package.
Method Summary | |
---|---|
protected static boolean |
convertMultifileTagger(String filename,
String newFilename,
TaggerConfig config)
This method is provided for backwards compatibility with the old tagger. |
protected static void |
dumpModel()
|
static LambdaSolve |
getLambdaSolve()
|
protected static int |
getNum(FeatureKey s)
|
static TTags |
getTags()
|
protected static void |
init()
|
protected static void |
init(TaggerConfig config)
|
protected static boolean |
isRare(String word)
|
protected static TaggerConfig |
readModelAndInit(TaggerConfig config,
DataInputStream rf,
boolean printLoading)
This reads the complete tagger from a single model file, and inits the tagger using a combination of the properties passed in and parameters from the file. |
protected static TaggerConfig |
readModelAndInit(TaggerConfig config,
String modelFileOrUrl,
boolean printLoading)
This reads the complete tagger from a single model stored in a file, at a URL, or as a resource in a jar file, and inits the tagger using a combination of the properties passed in and parameters from the file. |
protected static void |
saveModel(String filename,
TaggerConfig config)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static LambdaSolve getLambdaSolve()
protected static void init()
protected static void init(TaggerConfig config)
protected static int getNum(FeatureKey s)
protected static void saveModel(String filename, TaggerConfig config)
protected static boolean convertMultifileTagger(String filename, String newFilename, TaggerConfig config) throws Exception
filename
- The name of the holder file, which is also used as a prefix for other filenamesnewFilename
- The name of the new one-file model that will be writtenconfig
- tagger configuration file
Exception
- ??protected static TaggerConfig readModelAndInit(TaggerConfig config, String modelFileOrUrl, boolean printLoading) throws Exception
Note for the future: This assumes that the TaggerConfig in the file has already been read and used. This work is done inside the constructor of TaggerConfig. It might be better to refactor things so that is all done inside this method, but for the moment it seemed better to leave working code alone [cdm 2008].
config
- The tagger configmodelFileOrUrl
- The name of the model file. This routine opens and closes it.
Exception
- If I/O errors, etc.protected static TaggerConfig readModelAndInit(TaggerConfig config, DataInputStream rf, boolean printLoading) throws IOException, ClassNotFoundException
Note for the future: This assumes that the TaggerConfig in the file has already been read and used. It might be better to refactor things so that is all done inside this method, but for the moment it seemed better to leave working code alone [cdm 2008].
config
- The tagger configrf
- DataInputStream to read from. It's the caller's job to open and close this stream.
IOException
- If I/O errors
ClassNotFoundException
- If serialization errorsprotected static void dumpModel()
protected static boolean isRare(String word)
public static TTags getTags()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |