analyze-desumasu-dearu 
文の敬体(ですます調)、常体(である調)を解析するライブラリ
Installation
npm install analyze-desumasu-dearu
Usage
import {analyzeDesumasu, analyzeDearu} from "analyze-desumasu-dearu";
let text = "昨日はいい天気であったのだが、今日は悪天候である。";
// である の情報
let ret = analyzeDearu(text);
/*
[{
value: "のだが",
index: 11
},
{
value: "である。",
index: 21
}
]
*/
// ですます は含まれてないので空の配列を返す
analyzeDesumasu(text);// []Tests
npm test
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request :D
License
MIT
Acknowledge
Thank for RedPen.