-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
60 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Example of tokenizing/analyzing Japanese text | ||
|
||
This example demonstrates how to analyzes a sentence (tokenize) and get the part-of-speech (POS) of each word using Kagome. | ||
|
||
- Target text data is as follows: | ||
|
||
```text | ||
すもももももももものうち | ||
``` | ||
|
||
- Example output: | ||
|
||
```shellsession | ||
$ cd /path/to/kagome/_examples/tokenize | ||
$ go run . | ||
---tokenize--- | ||
すもも 名詞,一般,*,*,*,*,すもも,スモモ,スモモ | ||
も 助詞,係助詞,*,*,*,*,も,モ,モ | ||
もも 名詞,一般,*,*,*,*,もも,モモ,モモ | ||
も 助詞,係助詞,*,*,*,*,も,モ,モ | ||
もも 名詞,一般,*,*,*,*,もも,モモ,モモ | ||
の 助詞,連体化,*,*,*,*,の,ノ,ノ | ||
うち 名詞,非自立,副詞可能,*,*,*,うち,ウチ,ウチ | ||
``` | ||
|
||
> __Note__ that tokenization varies depending on the dictionary used. In this example we use the IPA dictionary. |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Wakati Example with Kagome | ||
|
||
## Segmenting Japanese text into words with Kagome | ||
|
||
In this example, we demonstrate how to segment Japanese text into words using Kagome. | ||
|
||
- Target text data is as follows: | ||
|
||
```text | ||
すもももももももものうち | ||
``` | ||
|
||
- Example output: | ||
|
||
```shellsession | ||
$ cd /path/to/kagome/_examples/wakati | ||
$ go run . | ||
----wakati--- | ||
すもも/も/もも/も/もも/の/うち | ||
``` | ||
|
||
> __Note__ that segmentation varies depending on the dictionary used. | ||
> In this example we use the IPA dictionary. But for searching purposes, the Uni dictionary is recommended. | ||
> | ||
> - [What is a Kagome dictionary?](https://github.com/ikawaha/kagome/wiki/About-the-dictionary#what-is-a-kagome-dictionary) | Wiki | kagome @ GitHub |