Changeset 33812 for other-projects
- Timestamp:
- 2019-12-18T21:36:07+13:00 (4 years ago)
- Location:
- other-projects/maori-lang-detection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/maori-lang-detection/conf/countrycodes.json
r33805 r33812 1 1 /* CountryCodes with geolocation from https://developers.google.com/public-data/docs/canonical/countries_csv */ 2 /* BEWARE OF ADDING OR MODIFYING COMMENTS IN THIS FILE INTO MULTILINE COMMENTS, AS JAVA CODE CAN'T DEAL WITH THAT */3 2 4 3 /* 1 */ -
other-projects/maori-lang-detection/src/org/greenstone/atea/CountryCodeCountsMapData.java
r33805 r33812 81 81 * TO RUN: 82 82 * maori-lang-detection/src$ 83 * java -cp ".:../conf:../lib/*" org/greenstone/atea/CountryCodeCountsMapData ../mongodb-data/count rycodes.json ../mongodb-data/counts.json83 * java -cp ".:../conf:../lib/*" org/greenstone/atea/CountryCodeCountsMapData ../mongodb-data/counts.json 84 84 *################### 85 85 * … … 215 215 new StringBuilder("["); 216 216 String line; 217 218 boolean multi_line_comment = false; 219 217 220 while((line = reader.readLine()) != null) { 218 line = line.replaceAll("/\\* [^\\/]* \\*/", ""); // get rid of any multiline comments symbols on a single line 221 line = line.trim(); 222 223 // ignore any single line comments nested in multi-line symbols 224 if(line.startsWith("/*") && line.endsWith("*/")) { 225 continue; // skip line 226 } 227 228 // skip multi-line comments spread over multiple lines 229 // assumes this ends on a line containing */ without further content on the line. 230 if(line.startsWith("/*") && !line.endsWith("*/")) { 231 multi_line_comment = true; 232 continue; // skip line 233 } 234 if(multi_line_comment) { 235 if(line.contains("*/")) { 236 multi_line_comment = false; 237 } 238 239 continue; // we're in a comment or at end of comment, skip line 240 } 241 219 242 str.append(line); 220 243 if(line.endsWith("}")) {
Note:
See TracChangeset
for help on using the changeset viewer.