|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvardwrapper.VARD
public class VARD
The 'interface' to VARD, allows for single words and files to be normalised.
Constructor Summary | |
---|---|
VARD(java.io.File setupFolder,
double threshold,
double fWeight,
boolean useCache)
Instantiates a new VARD session. |
Method Summary | |
---|---|
java.util.List<Suggestion> |
getNormalisationSuggestions(java.lang.String variant,
int limit)
Gets a list of normalisation suggestions ranked by confidence score (descending) for the given variant. |
double |
getThreshold()
|
boolean |
isUseCache()
|
boolean |
isVariant(java.lang.String word)
Checks if a word is a varaint, i.e. |
Normalisation |
normalise(java.lang.String word)
Attempts a normalisation of the given word. |
NormalisationStats |
normaliseFile(java.io.File original,
java.io.File xmlOut,
java.io.File plainOut)
Normalise a whole text in a file, uses the full setup as if normalised using Batch mode of VARD. |
java.lang.String |
normaliseToString(java.lang.String word)
Attempts to normalise the given word and returns either the normalisation made, or just the word if no normalisation was possible (no suggestions above threshold) or if the word wasn't a variant. |
void |
resetCache()
Empties the current normalisation cache. |
void |
setThreshold(double threshold)
Sets the current threshold to be used during normalisation. |
void |
setUseCache(boolean useCache)
Sets whether or not to use the normalisation cache. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VARD(java.io.File setupFolder, double threshold, double fWeight, boolean useCache) throws java.io.IOException
setupFolder
- The folder to use to initialise vard, this is the setup folder selected when opening VARD. If the folder isn't present then a new folder will be created with default settings (not really recommended as some training should be completed before automatic normalisation).threshold
- The normalisation threshold for use throughout processing (whether by file or word).fWeight
- The fWeight to use when calculating confidence scores.useCache
- Whether or not to use caching for normalisation. If true, then each normalisation made will be stored, if the word to normalise is seen again then the same Normalisation instance is used again (for normaliseToString, the same word (normalisation or original form) will be returned).
java.io.IOException
- if error loading setup from folder.Method Detail |
---|
public boolean isVariant(java.lang.String word)
word
- the word to assess.
public java.util.List<Suggestion> getNormalisationSuggestions(java.lang.String variant, int limit)
variant
- the variant to find normalisation suggestions for.limit
- the maximum number of suggestions to find. If the total number of suggestions is less than the limit, all suggestions will be returned. If limit is 0, all suggestions will be found (can be a long list, especially for short words).
public Normalisation normalise(java.lang.String word)
word
- the word to be normalised.
public java.lang.String normaliseToString(java.lang.String word)
word
- The word to attempt to normalise.
public NormalisationStats normaliseFile(java.io.File original, java.io.File xmlOut, java.io.File plainOut) throws VARDException
original
- the original file to be normalisedxmlOut
- the output file for the XML tagged normalised file. If NULL, XML version will not be created.plainOut
- the output file for normalised version without XML tags. If NULL, plain version will not be created.
VARDException
- if any exceptions are thrown by VARD during normalisation or saving outputs.public void setThreshold(double threshold)
threshold
- The normalisation threshold to change to.public double getThreshold()
public void setUseCache(boolean useCache)
useCache
- TRUE or FALSE as to whether to use normalisation cache.public boolean isUseCache()
public void resetCache()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |