File tree Expand file tree Collapse file tree
src/main/kotlin/xyz/javecs/tools/text2expr/parsers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import xyz.javecs.tools.text2expr.utils.normalize
77
88private val tokenizer = Tokenizer ()
99
10- data class Evaluation (val value : Number = Double .NaN )
10+ data class Evaluation (val value : Number = Double .NaN )
1111class RuleBuilder (source : String ) {
1212 private val parser = RuleParser ()
1313
@@ -31,9 +31,7 @@ class RuleBuilder(source: String) {
3131 " PR" -> if (value.contains(token.pronunciation)) matched++
3232 }
3333 }
34- if (word.fields.size == matched) {
35- return i
36- }
34+ if (word.fields.size == matched) return i
3735 }
3836 return - 1
3937 }
@@ -50,12 +48,8 @@ class RuleBuilder(source: String) {
5048 var start = - 1
5149 rule().forEach {
5250 start = indexOf(it, tokens, start + 1 )
53- if (start < 0 ) {
54- return false
55- }
56- if (it.id.isNotEmpty()) {
57- recognizedId(Pair (it.id, tokens[start].surface))
58- }
51+ if (start < 0 ) return false
52+ if (it.id.isNotEmpty()) recognizedId(Pair (it.id, tokens[start].surface))
5953 }
6054 return true
6155 }
You can’t perform that action at this time.
0 commit comments