|
|||||||||
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 | |
---|---|
static boolean |
add(FeatureKey s)
Adds a FeatureKey to the set of known FeatureKeys. |
static boolean |
convertMultifileTagger(String filename,
String newFilename,
TaggerConfig config)
This method is provided for backwards compatibility with the old tagger. |
static void |
dumpModel()
|
static LambdaSolve |
getLambdaSolve()
|
static int |
getNum(FeatureKey s)
|
static int |
getNum(FeatureKey s,
HashMap<FeatureKey,Integer> fAssocs)
|
static void |
init()
|
static void |
init(TaggerConfig config)
|
static boolean |
isRare(String word)
|
static HashMap<FeatureKey,Integer> |
readAssociations(String modelFilename)
This reads the .assoc file. |
static TaggerConfig |
readConfig(DataInputStream stream)
read in the TaggerConfig |
static void |
readExtractors(InputStream file)
Read the extractors from a stream. |
static void |
readExtractors(String filename)
Read the extractors from a filename. |
static void |
readModelAndInit(String filename)
This reads the complete tagger from a single model file, and inits the tagger using a combination of the properties passed in and those read from the file. |
static void |
readModelAndInit(TaggerConfig config,
String filename)
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. |
static void |
save_model(String filename,
TaggerConfig config)
|
static void |
saveConfig(TaggerConfig config,
OutputStream os)
serialize the TaggerConfig |
static void |
saveExtractors(OutputStream os)
serialize the ExtractorFrames and ExtractorFramesRare in filename |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static LambdaSolve getLambdaSolve()
public static void init()
public static void init(TaggerConfig config)
public static boolean add(FeatureKey s)
s
- The feature key to be added
public static int getNum(FeatureKey s)
public static int getNum(FeatureKey s, HashMap<FeatureKey,Integer> fAssocs)
public static void saveConfig(TaggerConfig config, OutputStream os) throws IOException
IOException
public static TaggerConfig readConfig(DataInputStream stream) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static void saveExtractors(OutputStream os) throws IOException
IOException
public static void readExtractors(String filename) throws Exception
Exception
public static void readExtractors(InputStream file) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static HashMap<FeatureKey,Integer> readAssociations(String modelFilename)
modelFilename
- The string .assoc is appended and feature
associations are then read from this file
public static void save_model(String filename, TaggerConfig config)
public 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
-
Exception
public static void readModelAndInit(String filename) throws Exception
filename
- Filename to read from. It's closed afterwords
Exception
- If I/O errors, etc.public static void readModelAndInit(TaggerConfig config, String filename) throws Exception
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 configfilename
- Filename to read from. It's closed afterwards.
Exception
- If I/O errors, etc.public static void dumpModel()
public static boolean isRare(String word)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |