import org.apache.poi.poifs.filesystem.Entry;
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
+import org.apache.poi.util.LocaleUtil;
import org.apache.poi.util.StringUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
continue;
}
+ if (characterRun.isCapitalized() || characterRun.isSmallCaps()) {
+ text = text.toUpperCase(LocaleUtil.getUserLocale());
+ }
+
if (characterRun.isSpecialCharacter()) {
if (text.charAt(0) == SPECCHAR_AUTONUMBERED_FOOTNOTE_REFERENCE
&& (wordDocument instanceof HWPFDocument)) {
}
}
+ @Test
+ void testCapitalized() throws Exception {
+ try (WordExtractor wExt = openExtractor("capitalized.doc")) {
+ String text = wExt.getText().trim();
+ assertEquals("The following word is: CAPITALIZED.", text);
+ }
+ }
+
private WordExtractor openExtractor(String fileName) throws IOException {
try (InputStream is = docTests.openResourceAsStream(fileName)) {
return new WordExtractor(is);