Pull request #32: Remove '-' in headernames

Merge in RED/redaction-service from tablesHeader3 to master

* commit '272c7cc2287b146664b8bb277c3731262ac78a19':
  Remove '-' in headernames
This commit is contained in:
Thierry Goeckel 2020-08-24 16:15:44 +02:00
commit 6483e637c6
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){
String cleanHeaderName = headerName.replaceAll("\n", "")
.replaceAll(" ", "");
.replaceAll(" ", "")
.replaceAll("-", "");
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) {
String cleanHeaderName = cellHeader.replaceAll("\n", "")
.replaceAll(" ", "");
.replaceAll(" ", "")
.replaceAll("-", "");
TextBlock value = tabularData.get(cleanHeaderName);
if (value == null) {

View File

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