-
-
Notifications
You must be signed in to change notification settings - Fork 17
Inflection-64 Convert dictionary-parser to consume Wikidata #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8101076
Inflection-64 Convert dictionary-parser to consume Wikidata
grhoten 4b09549
Inflection-64 Convert dictionary-parser to consume Wikidata
grhoten c570160
Inflection-64 Convert dictionary-parser to consume Wikidata
grhoten 78a3ec3
Inflection-64 Convert dictionary-parser to consume Wikidata
grhoten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,15 @@ | ||
| /* | ||
| * Copyright 2025 Unicode Incorporated and others. All rights reserved. | ||
| * Copyright 2020-2024 Apple Inc. All rights reserved. | ||
| */ | ||
| // This is a sorted map of every dependency we want to use throughout the whole Inflection repo | ||
| ext.dependencyVersions = [ | ||
| commons_text: '1.10.0', | ||
| icu4j: '75.1', | ||
| commons_compress: '1.27.1', | ||
| commons_text: '1.13.0', | ||
| icu4j: '76.1', | ||
| jackson: '2.18.2', | ||
| jsr305: '3.0.2', | ||
| junit_jupiter: '5.10.2', | ||
| junit_platform: '1.10.2', | ||
| log4j: '2.22.1', | ||
| xerces: '2.12.2', | ||
| junit_jupiter: '5.11.4', | ||
| junit_platform: '1.11.4', | ||
| log4j: '2.24.3', | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...tion/tools/dictionary-parser/ParseLexicon → ...ion/tools/dictionary-parser/ParseWikidata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,10 @@ | ||
| # | ||
| # Copyright 2025 Unicode Incorporated and others. All rights reserved. | ||
| # Copyright 2020-2024 Apple Inc. All rights reserved. | ||
| # | ||
| JAR=build/libs/dictionary-parser-all.jar | ||
| if [ ! -e "$JAR" ] | ||
| then | ||
| ../../gradlew clean fatJar >&2 | ||
| fi | ||
| java -Dfile.encoding=UTF-8 -cp $JAR com.apple.lexicon.ParseLexicon $* | ||
| java -Dfile.encoding=UTF-8 -cp $JAR org.unicode.wikidata.ParseWikidata $* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,24 @@ | ||
| <!-- | ||
| Copyright 2025 Unicode Incorporated and others. All rights reserved. | ||
| Copyright 2021-2024 Apple Inc. All rights reserved. | ||
| --> | ||
| # Dictionary Parsers | ||
|
|
||
| These tools generate files that describes the grammatical properties of words from the various sources. | ||
|
|
||
| ## Usage for Wiktionary | ||
| ## Usage for Wikidata | ||
|
|
||
| 1) Download a copy of Wiktionary data from http://dumps.wikimedia.org/ (e.g. http://dumps.wikimedia.org/enwiktionary/20130825/enwiktionary-20130825-pages-articles.xml.bz2) | ||
| 1) Download a copy of Wiktionary data from https://dumps.wikimedia.org/wikidatawiki/entities/ (e.g. https://dumps.wikimedia.org/wikidatawiki/entities/20250115/wikidata-20250115-lexemes.json.bz2) | ||
| 2) Decompress dump | ||
| 3) Run `./ParseWiktionary ~/Downloads/enwiktionary-20130825-pages-articles.xml > ../../resources/com/apple/inflection/dictionary/dictionary_en.lst` | ||
|
|
||
| ## Usage for Apple's Lexical Resources (ALR) | ||
|
|
||
| 1) Get the latest lexicon for your language. | ||
| 2) Check what options were used for your language. They are at the end of the generated dictionary_XX.lst, look for "generated with options" | ||
| - Run `grep 'generated with options' ../../resources/com/apple/inflection/dictionary/dictionary_XX.lst | cut -d':' -f2` | ||
| 3) Check what options were used for your language. They are at the end of the generated dictionary_XX.lst, look for "generated with options" | ||
| - Run `grep 'generated with options' ../../resources/org/unicode/inflection/dictionary/dictionary_XX.lst | cut -d':' -f2` | ||
| - If the above command prints nothing, no additional options were used to generate the file, or it was generated with a different tool. | ||
| - To see what options are available run `./ParseLexicon` | ||
| 3) Run | ||
| - At minimum use the `--locale` option to specify the ISO-639 code for the language to extract. | ||
| 4) Run | ||
| ``` | ||
| ./ParseLexicon <THE_OPTIONS_FROM_STEP_2> \ | ||
| --inflections ../../resources/com/apple/inflection/dictionary/inflectional_XX.xml \ | ||
| <THE_LEXICON_FILE> \ | ||
| > ../../resources/com/apple/inflection/dictionary/dictionary_XX.lst | ||
| ./ParseWikidata <THE_OPTIONS_FROM_STEP_3> \ | ||
| --inflections ../../resources/org/unicode/inflection/dictionary/inflectional_XX.xml \ | ||
| --dictionary ../../resources/org/unicode/inflection/dictionary/dictionary_XX.lst \ | ||
| <wikidata-NNNNNNNN-lexemes.json.bz2> | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.