Skip to content

Commit

Permalink
remove doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kermitt2 committed Oct 21, 2019
1 parent 4aa5983 commit cacc48b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public Document processing(File input,
GrobidAnalysisConfig config) throws Exception {
DocumentSource documentSource = null;
String extension = FilenameUtils.getExtension(input.getName());
if ( extension != null && (extension.toLowerCase().equals("docx") || extension.toLowerCase().equals("doc")) ) {
if ( extension != null && (extension.toLowerCase().equals("docx")) ) {
documentSource = DocumentSource.fromDocx(input, config.getStartPage(), config.getEndPage(),
config.getPdfAssetPath() != null, true, false);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public Pair<String, Document> processing(File input, BiblioItem resHeader, Grobi
DocumentSource documentSource = null;
try {
String extension = FilenameUtils.getExtension(input.getName());
if ( extension != null && (extension.toLowerCase().equals("docx") || extension.toLowerCase().equals("doc")) ) {
if ( extension != null && (extension.toLowerCase().equals("docx")) ) {
documentSource = DocumentSource.fromDocx(input, config.getStartPage(), config.getEndPage());
} else {
documentSource = DocumentSource.fromPdf(input, config.getStartPage(), config.getEndPage());
Expand All @@ -104,7 +104,7 @@ public Pair<String, Document> processing2(String input, BiblioItem resHeader, Gr
DocumentSource documentSource = null;
try {
String extension = FilenameUtils.getExtension(input);
if ( extension != null && (extension.toLowerCase().equals("docx") || extension.toLowerCase().equals("doc")) ) {
if ( extension != null && (extension.toLowerCase().equals("docx")) ) {
documentSource = DocumentSource.fromDocx(new File(input), config.getStartPage(), config.getEndPage());
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ public Response processStatelessHeaderDocument(final InputStream inputStream, fi
String fileNameLow = fileName.toLowerCase();
if (fileNameLow.endsWith("docx"))
extension = "docx";
else if (fileNameLow.endsWith("doc"))
extension = "doc";
}

// the tmp file will have an unambiguous file extension (e.g. .pdf. .docx, .doc, ...)
originFile = IOUtilities.writeInputFile(inputStream, extension);
if (originFile == null) {
Expand Down Expand Up @@ -179,8 +177,6 @@ public Response processFulltextDocument(final InputStream inputStream,
String fileNameLow = fileName.toLowerCase();
if (fileNameLow.endsWith("docx"))
extension = "docx";
else if (fileNameLow.endsWith("doc"))
extension = "doc";
}

// the tmp file will have an unambiguous file extension (e.g. .pdf. .docx, .doc, ...)
Expand Down Expand Up @@ -280,8 +276,6 @@ public Response processStatelessFulltextAssetDocument(final InputStream inputStr
String fileNameLow = fileName.toLowerCase();
if (fileNameLow.endsWith("docx"))
extension = "docx";
else if (fileNameLow.endsWith("doc"))
extension = "doc";
}

// the tmp file will have an unambiguous file extension (e.g. .pdf. .docx, .doc, ...)
Expand Down Expand Up @@ -540,8 +534,6 @@ public Response processStatelessReferencesDocument(final InputStream inputStream
String fileNameLow = fileName.toLowerCase();
if (fileNameLow.endsWith("docx"))
extension = "docx";
else if (fileNameLow.endsWith("doc"))
extension = "doc";
}

originFile = IOUtilities.writeInputFile(inputStream, extension);
Expand Down

0 comments on commit cacc48b

Please sign in to comment.