lindera 5.2.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Cargo.toml +6 -0
- data/README.md +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 338b8dc5bfd2370503e27b86a07ee433ad3b8230bcbc39ae004cc7833d95f1a9
|
|
4
|
+
data.tar.gz: 56439ac1cf9d2b3edf429cdc72375420c883fb314b200f98fd39eee8a752c951
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a80ee9946ac2be6352efe6d26fe36928fc88fcd75abd90ea41d404451d62f72a7d24e42b68b05d377527de036d926eb22d689cd6a708fe440632cb6016bb5c49
|
|
7
|
+
data.tar.gz: 869ed3620414b85a646e6cbaa5b799edf9b2db834d1435ce9618c8bb20d4bb9e4552a65e982b637d1ecb365a72b823d5f7875a16660fbe601bc90e84b23a9380
|
data/Cargo.toml
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "lindera-ruby"
|
|
3
|
+
# Distributed via RubyGems, not crates.io.
|
|
4
|
+
publish = false
|
|
3
5
|
version = { workspace = true }
|
|
4
6
|
edition = { workspace = true }
|
|
7
|
+
rust-version = { workspace = true }
|
|
5
8
|
description = "A Ruby binding for Lindera."
|
|
6
9
|
documentation = "https://docs.rs/lindera-ruby"
|
|
7
10
|
homepage = { workspace = true }
|
|
@@ -21,6 +24,9 @@ embed-ipadic-neologd = [
|
|
|
21
24
|
"lindera/embed-ipadic-neologd",
|
|
22
25
|
] # Include Japanese dictionary (IPADIC NEologd)
|
|
23
26
|
embed-unidic = ["lindera/embed-unidic"] # Include Japanese dictionary (UniDic)
|
|
27
|
+
embed-sudachidict = [
|
|
28
|
+
"lindera/embed-sudachidict",
|
|
29
|
+
] # Include Japanese dictionary (SudachiDict)
|
|
24
30
|
embed-ko-dic = ["lindera/embed-ko-dic"] # Include Korean dictionary (ko-dic)
|
|
25
31
|
embed-cc-cedict = [
|
|
26
32
|
"lindera/embed-cc-cedict",
|
data/README.md
CHANGED
|
@@ -49,6 +49,21 @@ tokens.each do |token|
|
|
|
49
49
|
end
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
### Converting Tokens to Plain Data
|
|
53
|
+
|
|
54
|
+
`to_h` returns the token as a plain Hash keyed by Symbols, keeping each
|
|
55
|
+
field's natural Ruby type, so it serializes without a custom encoder:
|
|
56
|
+
|
|
57
|
+
```ruby
|
|
58
|
+
require 'json'
|
|
59
|
+
|
|
60
|
+
data = tokens.first.to_h
|
|
61
|
+
# {surface: ..., byte_start: 0, byte_end: 9, position: 0,
|
|
62
|
+
# word_id: 12345, is_unknown: false, details: [...]}
|
|
63
|
+
|
|
64
|
+
JSON.generate(tokens.map(&:to_h))
|
|
65
|
+
```
|
|
66
|
+
|
|
52
67
|
### Using TokenizerBuilder
|
|
53
68
|
|
|
54
69
|
```ruby
|