tomofi commited on
Commit
1ae5746
1 Parent(s): 8913fd3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -23,9 +23,10 @@ if st.button('Update NEologd', help='It may take some time'):
23
  text = st.text_area("input", "麩菓子は、麩を主材料とした日本の菓子。")
24
 
25
  def make_row(word, kana_index=7, lemma_index=6):
26
- ff = word.feature.split(",")
27
- return dict(surface=word.surface, kana=ff[kana_index], lemma=ff[lemma_index],
28
- pos1=ff[0], pos2=ff[1], pos3=ff[2], pos4=ff[3])
 
29
 
30
  """
31
  #### [mecab-ipadic-NEologd : Neologism dictionary for MeCab](https://github.com/neologd/mecab-ipadic-neologd)
 
23
  text = st.text_area("input", "麩菓子は、麩を主材料とした日本の菓子。")
24
 
25
  def make_row(word, kana_index=7, lemma_index=6):
26
+ # https://stackoverflow.com/a/49774255/5602117
27
+ ff = dict(enumerate(word.feature.split(",")))
28
+ return dict(surface=word.surface, kana=ff.get(kana_index), lemma=ff.get(lemma_index),
29
+ pos1=ff.get(0), pos2=ff.get(1), pos3=ff.get(2), pos4=ff.get(3))
30
 
31
  """
32
  #### [mecab-ipadic-NEologd : Neologism dictionary for MeCab](https://github.com/neologd/mecab-ipadic-neologd)