Skip to content

Commit c20b797

Browse files
committed
chore(rule): remove . from sentence splitter
1 parent 9446373 commit c20b797

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/no-doubled-joshi.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ const defaultOptions = {
4141
};
4242

4343

44+
/*
45+
1. Paragraph Node -> text
46+
2. text -> sentences
47+
3. tokenize sentence
48+
4. report error if found word that match the rule.
49+
50+
*/
4451
export default function (context, options = {}) {
4552
const helper = new RuleHelper(context);
4653
// 最低間隔値
@@ -54,7 +61,9 @@ export default function (context, options = {}) {
5461
}
5562
const source = new StringSource(node);
5663
let text = source.toString();
57-
let sentences = splitSentences(text).filter(node => {
64+
let sentences = splitSentences(text, {
65+
charRegExp: /[\?\!]/
66+
}).filter(node => {
5867
return node.type === SentenceSyntax.Sentence;
5968
});
6069
return getTokenizer().then(tokenizer => {

0 commit comments

Comments
 (0)