File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ import {RuleHelper} from "textlint-rule-helper"
44import { getTokenizer } from "kuromojin" ;
55import splitSentences from "sentence-splitter" ;
66import Source from "structured-source" ;
7- const defaultOptions = { max : 3 } ;
7+ const defaultOptions = {
8+ max : 3 , // 1文に利用できる最大の、の数
9+ strict : false // 例外ルールを適応するかどうか
10+ } ;
811
912function isSandwichedMeishi ( {
1013 before,
@@ -22,6 +25,7 @@ function isSandwichedMeishi({
2225 */
2326export default function ( context , options = { } ) {
2427 const maxLen = options . max || defaultOptions . max ;
28+ const isStrict = options . strict || defaultOptions . strict ;
2529 let helper = new RuleHelper ( context ) ;
2630 let { Syntax, RuleError, report, getSource} = context ;
2731 return {
@@ -55,7 +59,8 @@ export default function (context, options = {}) {
5559 token : token ,
5660 after : tokens [ index + 1 ]
5761 } ) ;
58- if ( isSandwiched ) {
62+ // strictなら例外を例外としない
63+ if ( ! isStrict && isSandwiched ) {
5964 return ;
6065 }
6166 currentTenCount ++ ;
You can’t perform that action at this time.
0 commit comments