Skip to content

Instantly share code, notes, and snippets.

@maiha
Created January 5, 2010 21:11
Show Gist options
  • Save maiha/269729 to your computer and use it in GitHub Desktop.
Save maiha/269729 to your computer and use it in GitHub Desktop.
require 'chawan'
text = '本日はバリ晴天なりっす'
Chawan.parse(text)
=> [<名詞: '本日'>, <助詞: 'は'>, <名詞: 'バリ'>, <名詞: '晴天'>, <助動詞: 'なり'>, <助動詞: 'っす'>]
Chawan.parse(text).noun
=> [<名詞: '本日'>, <名詞: 'バリ'>, <名詞: '晴天'>]
Chawan.parse(text).compact.noun
=> [<名詞: '本日'>, <名詞: 'バリ晴天'>]
Chawan.parse(text).noun.compact
=> [<名詞: '本日バリ晴天'>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment