Package org.omegat.core.statistics
Class Statistics
java.lang.Object
org.omegat.core.statistics.Statistics
Save project statistic into text file.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StatsResultbuildProjectStats(IProject project) Builds a file with statistic info about the project.static StringGet unique key for segment for uniqueness calculation.static intComputes the number of characters excluding spaces in a string.static intComputes the number of characters with spaces in a string.static intnumberOfWords(String str) Computes the number of words in a string.static voidWrites the specified text to a file, along with the current date and time.static voidwriteStat(String dir, StatsResult result) Writes the statistics result to the specified directory in all selected output formats.static voidwriteStat(String dir, StatsResult result, StatOutputFormat format) Writes the statistics result to the specified directory in the given output format.
-
Method Details
-
numberOfCharactersWithoutSpaces
Computes the number of characters excluding spaces in a string. Special char for tag replacement not calculated. -
numberOfCharactersWithSpaces
Computes the number of characters with spaces in a string. Special char for tag replacement not calculated. -
numberOfWords
Computes the number of words in a string. -
writeStat
Writes the specified text to a file, along with the current date and time. If the target file's parent directories do not exist, they will be created. Any existing content in the file will be overwritten.- Parameters:
filename- the name and path of the file to which the text will be writtentext- the text content to write to the file
-
writeStat
Writes the statistics result to the specified directory in all selected output formats.- Parameters:
dir- the directory where the statistics should be writtenresult- the statistics result object containing the data to be written
-
writeStat
Writes the statistics result to the specified directory in the given output format. Depending on the format, the data is written as text, XML, or JSON. The file is encoded in UTF-8. If any errors occur during file writing, they are logged.- Parameters:
dir- the directory where the statistics file should be writtenresult- the statistics result object containing the data to be writtenformat- the format in which the statistics should be written (TEXT, XML, or JSON)
-
getUniquenessKey
Get unique key for segment for uniqueness calculation. -
buildProjectStats
Builds a file with statistic info about the project. The total word & character count of the project, the total number of unique segments, plus the details for each file.
-