Remove '-' in headernames

This commit is contained in:
deiflaender 2020-08-24 15:39:50 +02:00
parent 559c421542
commit 272c7cc228
2 changed files with 6 additions and 3 deletions

View File

@ -37,7 +37,8 @@ public class Section {
public boolean rowEquals(String headerName, String value){ public boolean rowEquals(String headerName, String value){
String cleanHeaderName = headerName.replaceAll("\n", "") String cleanHeaderName = headerName.replaceAll("\n", "")
.replaceAll(" ", ""); .replaceAll(" ", "")
.replaceAll("-", "");
return tabularData != null && tabularData.containsKey(cleanHeaderName) && tabularData.get(cleanHeaderName).getText().equals(value); return tabularData != null && tabularData.containsKey(cleanHeaderName) && tabularData.get(cleanHeaderName).getText().equals(value);
} }
@ -173,7 +174,8 @@ public class Section {
public void highlightCell(String cellHeader, int ruleNumber, String type) { public void highlightCell(String cellHeader, int ruleNumber, String type) {
String cleanHeaderName = cellHeader.replaceAll("\n", "") String cleanHeaderName = cellHeader.replaceAll("\n", "")
.replaceAll(" ", ""); .replaceAll(" ", "")
.replaceAll("-", "");
TextBlock value = tabularData.get(cleanHeaderName); TextBlock value = tabularData.get(cleanHeaderName);
if (value == null) { if (value == null) {

View File

@ -65,7 +65,8 @@ public class EntityRedactionService {
headerCell.getTextBlocks().forEach(textBlock -> headerBuilder.append(textBlock.getText())); headerCell.getTextBlocks().forEach(textBlock -> headerBuilder.append(textBlock.getText()));
String headerName = headerBuilder.toString() String headerName = headerBuilder.toString()
.replaceAll("\n", "") .replaceAll("\n", "")
.replaceAll(" ", ""); .replaceAll(" ", "")
.replaceAll("-", "");
tabularData.put(headerName, cell.getTextBlocks().get(0)); tabularData.put(headerName, cell.getTextBlocks().get(0));
}); });
for (TextBlock textBlock : cell.getTextBlocks()) { for (TextBlock textBlock : cell.getTextBlocks()) {