[line 33]
This class represents a text sample to be parsed.
This separates the analysis of a text sample from the primary LanguageDetect class. After a new profile has been built, the data can be retrieved using the accessor functions.
This class is intended to be used by the Text_LanguageDetect class, not end-users.
- Author: Nicholas Pisarro
- Version: release: 0.3.0
- Copyright: 2006
- License: BSD
analyze [line 213]
Executes the parsing operation
Be sure to call the set*() functions to set options and the prepare*() functions first to tell it what kind of data to compute
Afterwards the get*() functions can be used to access the compiled information.
getTrigramFreqs [line 186]
array &getTrigramFreqs(
)
Return the trigram freqency table
only used in testing to make sure the parser is working
- Return: trigram freqencies in the text sample
- Access: public
getTrigramRanks [line 173]
array &getTrigramRanks(
)
Returns the trigram ranks for the text sample
- Return: trigram ranks in the text sample
- Access: public
getUnicodeBlocks [line 197]
array &getUnicodeBlocks(
)
returns the array of unicode blocks
- Return: unicode blocks in the text sample
- Access: public
prepareTrigram [line 129]
void prepareTrigram(
[bool
$bool = true])
turn on/off trigram counting
Parameters:
bool
$bool
—
true for on, false for off
prepareUnicode [line 140]
void prepareUnicode(
[bool
$bool = true])
turn on/off unicode block counting
Parameters:
bool
$bool
—
true for on, false for off
setPadStart [line 151]
void setPadStart(
[bool
$bool = true])
turn on/off padding the beginning of the sample string
Parameters:
bool
$bool
—
true for on, false for off
setUnicodeSkipSymbols [line 162]
void setUnicodeSkipSymbols(
[bool
$bool = true])
Should the unicode block counter skip non-alphabetical ascii chars?
Parameters:
bool
$bool
—
true for on, false for off
validateString [line 115]
bool validateString(
string
$str)
Returns true if a string is suitable for parsing
- Return: true if acceptable, false if not
- Access: public
Parameters:
string
$str
—
input string to test