質問編集履歴

2

写真追加

2018/06/18 03:03

投稿

---stax---
---stax---

スコア148

title CHANGED
File without changes
body CHANGED
@@ -15,9 +15,11 @@
15
15
 
16
16
  以下が作成した簡略辞書です「100.csv」
17
17
  ![簡略辞書](b0b918153bdf1619b6eaff59fffe4dbd.png)
18
+
19
+ ![イメージ説明](7356a1248c76412881530b094e40efad.png)
20
+
18
21
  この辞書を読み込ませると
19
22
  ```
20
-
21
23
  #作成した辞書使う場合
22
24
  ---------------------------------------------------------------------------
23
25
  ValueError Traceback (most recent call last)

1

エラー内容追記

2018/06/18 03:03

投稿

---stax---
---stax---

スコア148

title CHANGED
File without changes
body CHANGED
@@ -19,9 +19,36 @@
19
19
  ```
20
20
 
21
21
  #作成した辞書使う場合
22
+ ---------------------------------------------------------------------------
23
+ ValueError Traceback (most recent call last)
24
+ <ipython-input-13-13ce50d97c07> in <module>()
25
+ 53 #t = Tokenizer()
26
+ 54 #作成した辞書使う場合
22
- t = Tokenizer(r'C:\Users\Desktop\100.csv', udic_type='simpledic', udic_enc="utf8")
27
+ ---> 55 t = Tokenizer(r'C:\Users\Desktop\100.csv', udic_type='simpledic', udic_enc="utf8")
28
+ 56
29
+ 57 ret = []
23
30
 
31
+ ~\AppData\Local\Continuum\anaconda3\lib\site-packages\janome\tokenizer.py in __init__(self, udic, udic_enc, udic_type, max_unknown_length, wakati, mmap)
32
+ 166 if udic.endswith('.csv'):
33
+ 167 # build user dictionary from CSV
34
+ --> 168 self.user_dic = UserDictionary(udic, udic_enc, udic_type, connections)
35
+ 169 elif os.path.isdir(udic):
36
+ 170 # load compiled user dictionary
24
37
 
38
+ ~\AppData\Local\Continuum\anaconda3\lib\site-packages\janome\dic.py in __init__(self, user_dict, enc, type, connections)
39
+ 372 """
40
+ 373 build_method = getattr(self, 'build' + type)
41
+ --> 374 compiledFST, entries = build_method(user_dict, enc)
42
+ 375 Dictionary.__init__(self, [compiledFST], entries, connections)
43
+ 376
44
+
45
+ ~\AppData\Local\Continuum\anaconda3\lib\site-packages\janome\dic.py in buildsimpledic(self, user_dict, enc)
46
+ 402 for line in f:
47
+ 403 line = line.rstrip()
48
+ --> 404 surface, pos_major, reading = line.split(',')
49
+ 405 part_of_speech = ','.join([pos_major, u'*', u'*', u'*'])
50
+ 406 morph_id = len(surfaces)
51
+
25
52
  ValueError: not enough values to unpack (expected 3, got 1)
26
53
  ```
27
54
  というエラーが発生しどこが原因か分からず悩んでいます