use of org.omegat.core.statistics.StatCount in project omegat by omegat-org.
the class XLIFFFilterTest method testStatCounting.
@Test
public void testStatCounting() throws Exception {
String f = "test/data/filters/xliff/file-XLIFFFilter-statcount.xlf";
StatisticsSettings.setCountingProtectedText(true);
StatisticsSettings.setCountingCustomTags(true);
IProject.FileInfo fi = loadSourceFiles(filter, f);
StatCount counts = new StatCount(fi.entries.get(0));
assertEquals(4, counts.words);
}
use of org.omegat.core.statistics.StatCount in project omegat by omegat-org.
the class XLIFFFilterTest method testStatCountingNoProtectedText.
@Test
public void testStatCountingNoProtectedText() throws Exception {
String f = "test/data/filters/xliff/file-XLIFFFilter-statcount.xlf";
StatisticsSettings.setCountingProtectedText(false);
StatisticsSettings.setCountingCustomTags(true);
IProject.FileInfo fi = loadSourceFiles(filter, f);
StatCount counts = new StatCount(fi.entries.get(0));
assertEquals(2, counts.words);
}
use of org.omegat.core.statistics.StatCount in project omegat by omegat-org.
the class XLIFFFilterTest method testStatCountingNoCustomTags.
@Test
public void testStatCountingNoCustomTags() throws Exception {
String f = "test/data/filters/xliff/file-XLIFFFilter-statcount.xlf";
StatisticsSettings.setCountingProtectedText(true);
StatisticsSettings.setCountingCustomTags(false);
Preferences.setPreference(Preferences.CHECK_CUSTOM_PATTERN, "CUSTOM");
PatternConsts.updatePlaceholderPattern();
IProject.FileInfo fi = loadSourceFiles(filter, f);
StatCount counts = new StatCount(fi.entries.get(0));
assertEquals(3, counts.words);
}