[
https://issues.apache.org/jira/browse/TIKA-4694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18129388#comment-18129388
]
ASF GitHub Bot commented on TIKA-4694:
--------------------------------------
Vivek-Suryawanshi opened a new pull request, #3376:
URL: https://github.com/apache/tika/pull/3376
## Issue
https://issues.apache.org/jira/browse/TIKA-4694
## Summary
This PR fixes missing line-count and paragraph-count metadata when
parsing legacy Microsoft Word (.doc) documents.
The existing SummaryExtractor handles several Office metadata
properties but does not extract these two stored counts.
## Changes
- Added extraction of line and paragraph counts using
DocumentSummaryInformation.getLineCount() and getParCount().
- Reused the existing Office.LINE_COUNT and Office.PARAGRAPH_COUNT
metadata properties.
- Added a regression test in WordParserTest using
testWORD_2006ml.doc.
- Added an entry to CHANGES.txt.
The implementation uses the existing metadata-handling logic.
Missing or non-positive counts are omitted.
## Testing
Tested locally on Windows 11 with JDK 21 and Maven 3.10.0.
Command:
./mvnw.cmd test -pl
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module
-am -Dtest=WordParserTest -Dsurefire.failIfNoSpecifiedTests=false
Results:
- BUILD SUCCESS.
- WordParserTest: 39 tests reported.
- 0 failures.
- 0 errors.
- 2 skipped.
- New testLineAndParagraphCount regression test passed.
The test document contains stored values of 12 lines and
3 paragraphs.
A group reviewer also independently verified that the new
regression test fails when the production fix is removed.
The full Microsoft parser test suite has not been run.
## AI Assistance
ChatGPT (OpenAI) was used to assist with code investigation,
implementation, test development, and documentation.
The commit includes the Generated-by trailer.
> Apache Tika Parser : Line Count and Paragraph count are not coming for doc
> extensions type using Tika File metadata
> --------------------------------------------------------------------------------------------------------------------
>
> Key: TIKA-4694
> URL: https://issues.apache.org/jira/browse/TIKA-4694
> Project: Tika
> Issue Type: Bug
> Components: parser
> Affects Versions: 3.2.3
> Reporter: Arpit
> Priority: Major
>
> Currently we are using <tika-core.version>3.2.3</tika-core. Version> , where
> we are seeing Line Count and Paragraph count attribute are not coming for
> doc extensions type
> Note : When we are opening the doc using any tool we are able to see the line
> count and paragraph
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)