From 38767703ce2c81925c3ea06375e1691fc89c9ee3 Mon Sep 17 00:00:00 2001 From: Marvin Elsen Date: Sun, 15 Sep 2024 15:55:04 +0200 Subject: [PATCH 1/3] Add license --- LICENSE | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6c2803c --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2024 Marvin Elsen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file -- 2.43.0 From b3164155e8ae6d6aee4948c1c13881b159a336f4 Mon Sep 17 00:00:00 2001 From: Marvin Elsen Date: Sun, 15 Sep 2024 15:55:19 +0200 Subject: [PATCH 2/3] Add readme --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..db20a62 --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# CC-CEDICT Parser for Kotlin + +A parser for the [CC-CEDICT](https://www.mdbg.net/chinese/dictionary?page=cedict) written in [Kotlin](https://kotlinlang.org). + +## Installation + +_CC-CEDICT Parser for Kotlin_ is available +from [my self-hosted Gitea instance](https://gitea.marvinelsen.com/marvinelsen/cedict-parser). + +First, add the repository to your `build.gradle.kts` file: + +```kotlin +repositories { + maven { + url = uri("https://gitea.marvinelsen.com/api/packages/marvinelsen/maven") + } +} +``` + +Afterwards, add the package dependency to your `build.gradle.kts` file: + +```kotlin +dependencies { + implementation("com.marvinelsen:cedict-parser:1.0-SNAPSHOT") +} +``` + +## Usage + +```kotlin +fun main() { + val cedictInputStream = GZIPInputStream(object {}.javaClass.getResourceAsStream("/cedict_1_0_ts_utf-8_mdbg.txt.gz")!!) + + val cedictParser = CedictParser.instance + val cedictEntries = cedictParser.parseCedict(cedictInputStream) + + for (entry in cedictEntries) { + println(entry.traditional) + println(entry.simplified) + println(entry.pinyinSyllables.joinToString(" ")) + println(entry.definitions.joinToString("/") { it.glosses.joinToString(";") }) + } +} +``` + +## License + +All source code in this repository is licensed under a [MIT license](LICENSE), unless otherwise noted. + +To the following third-party code, data, and files in the repository different licenses apply: + +### CC-CEDICT + +[CC-CEDICT](https://cc-cedict.org/wiki) is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). \ No newline at end of file -- 2.43.0 From 2e9d14944b47e96c6688d45055122f5bba500c0e Mon Sep 17 00:00:00 2001 From: Marvin Elsen Date: Sun, 15 Sep 2024 15:57:17 +0200 Subject: [PATCH 3/3] Improve phrasing --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index db20a62..e65f6b0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # CC-CEDICT Parser for Kotlin -A parser for the [CC-CEDICT](https://www.mdbg.net/chinese/dictionary?page=cedict) written in [Kotlin](https://kotlinlang.org). +A parser for the [CC-CEDICT](https://www.mdbg.net/chinese/dictionary?page=cedict) Chinese-to-English dictionary written +in [Kotlin](https://kotlinlang.org). ## Installation @@ -29,7 +30,8 @@ dependencies { ```kotlin fun main() { - val cedictInputStream = GZIPInputStream(object {}.javaClass.getResourceAsStream("/cedict_1_0_ts_utf-8_mdbg.txt.gz")!!) + val cedictInputStream = + GZIPInputStream(object {}.javaClass.getResourceAsStream("/cedict_1_0_ts_utf-8_mdbg.txt.gz")!!) val cedictParser = CedictParser.instance val cedictEntries = cedictParser.parseCedict(cedictInputStream) @@ -51,4 +53,5 @@ To the following third-party code, data, and files in the repository different l ### CC-CEDICT -[CC-CEDICT](https://cc-cedict.org/wiki) is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). \ No newline at end of file +[CC-CEDICT](https://cc-cedict.org/wiki) is licensed under +a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). \ No newline at end of file -- 2.43.0