Revision: 11904
http://sourceforge.net/p/foray/code/11904
Author: victormote
Date: 2021-10-15 12:21:25 +0000 (Fri, 15 Oct 2021)
Log Message:
-----------
Add logging info about what is being parsed.
Modified Paths:
--------------
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DictionaryParser.java
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DictionaryResource.java
trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DictionarySerializer.java
Modified: trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DictionaryParser.java
===================================================================
--- trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DictionaryParser.java 2021-07-05 17:56:00 UTC (rev 11903)
+++ trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DictionaryParser.java 2021-10-15 12:21:25 UTC (rev 11904)
@@ -63,11 +63,12 @@
/**
* Parses a given InputStream and places the parsed information into the dictionary.
* @param inputStream The input stream to parse.
+ * @param description Description of {@literal inputStream}, useful for user messages.
* @throws IOException For IO errors during parsing.
* @return The parsed dictionary.
*/
- public SegmentDictionary parse(final InputStream inputStream) throws IOException {
- logger.info("Begin dictionary word list parsing.");
+ public SegmentDictionary parse(final InputStream inputStream, final String description) throws IOException {
+ logger.info("Begin dictionary word list parsing: " + description);
final InputStreamReader isReader = new InputStreamReader(inputStream);
final BufferedReader reader = new BufferedReader(isReader);
Modified: trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DictionaryResource.java
===================================================================
--- trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DictionaryResource.java 2021-07-05 17:56:00 UTC (rev 11903)
+++ trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DictionaryResource.java 2021-10-15 12:21:25 UTC (rev 11904)
@@ -132,7 +132,7 @@
final DictionaryParser parser = new DictionaryParser();
SegmentDictionary dictionary = null;
try {
- dictionary = parser.parse(inputStream);
+ dictionary = parser.parse(inputStream, location.getLocationDescription());
} catch (final IOException e) {
getLogger().error("IOException", e);
return null;
Modified: trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DictionarySerializer.java
===================================================================
--- trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DictionarySerializer.java 2021-07-05 17:56:00 UTC (rev 11903)
+++ trunk/foray/foray-hyphen/src/main/java/org/foray/hyphen/DictionarySerializer.java 2021-10-15 12:21:25 UTC (rev 11904)
@@ -124,7 +124,7 @@
/* Parse the dictionary. */
try {
final InputStream inputStream = infile.toURI().toURL().openStream();
- dictionary = parser.parse(inputStream);
+ dictionary = parser.parse(inputStream, infile.getAbsolutePath());
} catch (final IOException e) {
this.logger.error(e.getMessage());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|