Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rule): Accept non-independent(非自立) verb that is previous of "たり" #2

Merged
merged 1 commit into from
Jan 16, 2018

Conversation

moznion
Copy link
Contributor

@moznion moznion commented Jan 16, 2018

Problem

Valid sentence is treated as invalid; for example 利用方法を学習したり、実際に試してみたりすることができる環境です.

This example is analyzed as following;

[ { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 894860,
       word_type: 'KNOWN',
       surface_form: '利用',
       pos: '名詞',
       pos_detail_1: 'サ変接続',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: '利用',
       reading: 'リヨウ',
       pronunciation: 'リヨー' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 1488950,
       word_type: 'KNOWN',
       surface_form: '方法',
       pos: '名詞',
       pos_detail_1: '一般',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: '方法',
       reading: 'ホウホウ',
       pronunciation: 'ホーホー' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 92880,
       word_type: 'KNOWN',
       surface_form: 'を',
       pos: '助詞',
       pos_detail_1: '格助詞',
       pos_detail_2: '一般',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'を',
       reading: 'ヲ',
       pronunciation: 'ヲ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 496210,
       word_type: 'KNOWN',
       surface_form: '学習',
       pos: '名詞',
       pos_detail_1: 'サ変接続',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: '学習',
       reading: 'ガクシュウ',
       pronunciation: 'ガクシュー' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 3011810,
       word_type: 'KNOWN',
       surface_form: 'し',
       pos: '動詞',
       pos_detail_1: '自立',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: 'サ変・スル',
       conjugated_form: '連用形',
       basic_form: 'する',
       reading: 'シ',
       pronunciation: 'シ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 92960,
       word_type: 'KNOWN',
       surface_form: 'たり',
       pos: '助詞',
       pos_detail_1: '並立助詞',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'たり',
       reading: 'タリ',
       pronunciation: 'タリ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 51340,
       word_type: 'KNOWN',
       surface_form: '、',
       pos: '名詞',
       pos_detail_1: '数',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: '、',
       reading: '、',
       pronunciation: '、' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 2198950,
       word_type: 'KNOWN',
       surface_form: '実際',
       pos: '名詞',
       pos_detail_1: '一般',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: '実際',
       reading: 'ジッサイ',
       pronunciation: 'ジッサイ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 92030,
       word_type: 'KNOWN',
       surface_form: 'に',
       pos: '助詞',
       pos_detail_1: '格助詞',
       pos_detail_2: '一般',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'に',
       reading: 'ニ',
       pronunciation: 'ニ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 550320,
       word_type: 'KNOWN',
       surface_form: '試し',
       pos: '動詞',
       pos_detail_1: '自立',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '五段・サ行',
       conjugated_form: '連用形',
       basic_form: '試す',
       reading: 'タメシ',
       pronunciation: 'タメシ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 92780,
       word_type: 'KNOWN',
       surface_form: 'て',
       pos: '助詞',
       pos_detail_1: '接続助詞',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'て',
       reading: 'テ',
       pronunciation: 'テ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 2943410,
       word_type: 'KNOWN',
       surface_form: 'み',
       pos: '動詞',
       pos_detail_1: '非自立',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '一段',
       conjugated_form: '連用形',
       basic_form: 'みる',
       reading: 'ミ',
       pronunciation: 'ミ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 92960,
       word_type: 'KNOWN',
       surface_form: 'たり',
       pos: '助詞',
       pos_detail_1: '並立助詞',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'たり',
       reading: 'タリ',
       pronunciation: 'タリ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 3011740,
       word_type: 'KNOWN',
       surface_form: 'する',
       pos: '動詞',
       pos_detail_1: '自立',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: 'サ変・スル',
       conjugated_form: '基本形',
       basic_form: 'する',
       reading: 'スル',
       pronunciation: 'スル' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 63910,
       word_type: 'KNOWN',
       surface_form: 'こと',
       pos: '名詞',
       pos_detail_1: '非自立',
       pos_detail_2: '一般',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'こと',
       reading: 'コト',
       pronunciation: 'コト' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 92920,
       word_type: 'KNOWN',
       surface_form: 'が',
       pos: '助詞',
       pos_detail_1: '格助詞',
       pos_detail_2: '一般',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'が',
       reading: 'ガ',
       pronunciation: 'ガ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 3370300,
       word_type: 'KNOWN',
       surface_form: 'できる',
       pos: '動詞',
       pos_detail_1: '自立',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '一段',
       conjugated_form: '基本形',
       basic_form: 'できる',
       reading: 'デキル',
       pronunciation: 'デキル' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 361770,
       word_type: 'KNOWN',
       surface_form: '環境',
       pos: '名詞',
       pos_detail_1: '一般',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: '環境',
       reading: 'カンキョウ',
       pronunciation: 'カンキョー' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 23760,
       word_type: 'KNOWN',
       surface_form: 'です',
       pos: '助動詞',
       pos_detail_1: '*',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '特殊・デス',
       conjugated_form: '基本形',
       basic_form: 'です',
       reading: 'デス',
       pronunciation: 'デス' } } ]

The verb that is previous of "たり", that is only allowed independent (自立) verb.

Solution

Allow non-independent (非自立) verb.

Problem
--

Valid sentence is treated as invalid; for example `利用方法を学習したり、実際に試してみたりすることができる環境です`.

This example is analyzed as following;

```
[ { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 894860,
       word_type: 'KNOWN',
       surface_form: '利用',
       pos: '名詞',
       pos_detail_1: 'サ変接続',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: '利用',
       reading: 'リヨウ',
       pronunciation: 'リヨー' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 1488950,
       word_type: 'KNOWN',
       surface_form: '方法',
       pos: '名詞',
       pos_detail_1: '一般',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: '方法',
       reading: 'ホウホウ',
       pronunciation: 'ホーホー' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 92880,
       word_type: 'KNOWN',
       surface_form: 'を',
       pos: '助詞',
       pos_detail_1: '格助詞',
       pos_detail_2: '一般',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'を',
       reading: 'ヲ',
       pronunciation: 'ヲ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 496210,
       word_type: 'KNOWN',
       surface_form: '学習',
       pos: '名詞',
       pos_detail_1: 'サ変接続',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: '学習',
       reading: 'ガクシュウ',
       pronunciation: 'ガクシュー' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 3011810,
       word_type: 'KNOWN',
       surface_form: 'し',
       pos: '動詞',
       pos_detail_1: '自立',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: 'サ変・スル',
       conjugated_form: '連用形',
       basic_form: 'する',
       reading: 'シ',
       pronunciation: 'シ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 92960,
       word_type: 'KNOWN',
       surface_form: 'たり',
       pos: '助詞',
       pos_detail_1: '並立助詞',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'たり',
       reading: 'タリ',
       pronunciation: 'タリ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 51340,
       word_type: 'KNOWN',
       surface_form: '、',
       pos: '名詞',
       pos_detail_1: '数',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: '、',
       reading: '、',
       pronunciation: '、' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 2198950,
       word_type: 'KNOWN',
       surface_form: '実際',
       pos: '名詞',
       pos_detail_1: '一般',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: '実際',
       reading: 'ジッサイ',
       pronunciation: 'ジッサイ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 92030,
       word_type: 'KNOWN',
       surface_form: 'に',
       pos: '助詞',
       pos_detail_1: '格助詞',
       pos_detail_2: '一般',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'に',
       reading: 'ニ',
       pronunciation: 'ニ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 550320,
       word_type: 'KNOWN',
       surface_form: '試し',
       pos: '動詞',
       pos_detail_1: '自立',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '五段・サ行',
       conjugated_form: '連用形',
       basic_form: '試す',
       reading: 'タメシ',
       pronunciation: 'タメシ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 92780,
       word_type: 'KNOWN',
       surface_form: 'て',
       pos: '助詞',
       pos_detail_1: '接続助詞',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'て',
       reading: 'テ',
       pronunciation: 'テ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 2943410,
       word_type: 'KNOWN',
       surface_form: 'み',
       pos: '動詞',
       pos_detail_1: '非自立',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '一段',
       conjugated_form: '連用形',
       basic_form: 'みる',
       reading: 'ミ',
       pronunciation: 'ミ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 92960,
       word_type: 'KNOWN',
       surface_form: 'たり',
       pos: '助詞',
       pos_detail_1: '並立助詞',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'たり',
       reading: 'タリ',
       pronunciation: 'タリ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 3011740,
       word_type: 'KNOWN',
       surface_form: 'する',
       pos: '動詞',
       pos_detail_1: '自立',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: 'サ変・スル',
       conjugated_form: '基本形',
       basic_form: 'する',
       reading: 'スル',
       pronunciation: 'スル' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 63910,
       word_type: 'KNOWN',
       surface_form: 'こと',
       pos: '名詞',
       pos_detail_1: '非自立',
       pos_detail_2: '一般',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'こと',
       reading: 'コト',
       pronunciation: 'コト' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 92920,
       word_type: 'KNOWN',
       surface_form: 'が',
       pos: '助詞',
       pos_detail_1: '格助詞',
       pos_detail_2: '一般',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: 'が',
       reading: 'ガ',
       pronunciation: 'ガ' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 3370300,
       word_type: 'KNOWN',
       surface_form: 'できる',
       pos: '動詞',
       pos_detail_1: '自立',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '一段',
       conjugated_form: '基本形',
       basic_form: 'できる',
       reading: 'デキル',
       pronunciation: 'デキル' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 361770,
       word_type: 'KNOWN',
       surface_form: '環境',
       pos: '名詞',
       pos_detail_1: '一般',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '*',
       conjugated_form: '*',
       basic_form: '環境',
       reading: 'カンキョウ',
       pronunciation: 'カンキョー' } },
  { type: 'WordNode',
    children: [ [Object] ],
    position: { start: [Object], end: [Object] },
    data:
     { word_id: 23760,
       word_type: 'KNOWN',
       surface_form: 'です',
       pos: '助動詞',
       pos_detail_1: '*',
       pos_detail_2: '*',
       pos_detail_3: '*',
       conjugated_type: '特殊・デス',
       conjugated_form: '基本形',
       basic_form: 'です',
       reading: 'デス',
       pronunciation: 'デス' } } ]
```

The verb that is previous of "たり", that is only allowed independent (自立) verb.

Solution
--

Allow non-independent (非自立) verb.
@azu azu merged commit 6b32967 into textlint-ja:master Jan 16, 2018
@azu
Copy link
Member

azu commented Jan 16, 2018

@moznion Thanks.
I've released v1.0.3

@moznion
Copy link
Contributor Author

moznion commented Jan 16, 2018

@azu Thank you for the lightning reply!

@moznion moznion deleted the support_prev_hijiritsu_verb branch January 16, 2018 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants