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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/Cargo.toml +6 -0
  3. data/README.md +15 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c2b4fe3b5ae6cc040cb3c8907caf19f2136db015c449eb6ebcf47e33a16bfe8
4
- data.tar.gz: 14e9f373a2e402248ad0cf1c8c731223cc876431979ff5d5db70d88c2865a511
3
+ metadata.gz: 338b8dc5bfd2370503e27b86a07ee433ad3b8230bcbc39ae004cc7833d95f1a9
4
+ data.tar.gz: 56439ac1cf9d2b3edf429cdc72375420c883fb314b200f98fd39eee8a752c951
5
5
  SHA512:
6
- metadata.gz: 846a0b3be3fdb5c5abe4c8356e8ee37e1be584f1360acc608cdf1530ba521ddbec79927422dddca04b8ac8e4369d54c57cf620e4b45fe3459de25db46c31de2e
7
- data.tar.gz: 34b35ab22834a478df2b8ac255f98b7d01a3e430951f38062dfba3c518bad7f515c788031f11308af8be22e8f4aff54fb08c00a63e97a44a221b6dc3290ebd1b
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lindera
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lindera contributors