File tree Expand file tree Collapse file tree
java/src/org/futo/inputmethod/latin/xlm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ class LanguageModel(
134134 if (matchStart != - 1 ) context = context.substring(matchStart)
135135
136136 // Trim the context
137- val stillNeedTrimming = { context: String -> context.length > 70 || context.count { it == ' ' } > 16 }
137+ val stillNeedTrimming = { context: String -> context.length > 200 || context.count { it == ' ' } > 40 }
138138 if (stillNeedTrimming(context)) {
139139 val v = context.indexOfLast { it == ' .' || it == ' ?' || it == ' !' }
140140 if (v != - 1 ) {
@@ -147,10 +147,10 @@ class LanguageModel(
147147 }
148148
149149 if (stillNeedTrimming(context) && context.contains(" " )) {
150- context = context.split(' ' ).takeLast(5 ).joinToString(separator = " " )
150+ context = context.split(' ' ).takeLast(15 ).joinToString(separator = " " )
151151 }
152152
153- if (context.length > 144 ) {
153+ if (context.length > 400 ) {
154154 // This context probably contains some spam without adequate whitespace to trim, set it to blank
155155 context = " "
156156 }
You can’t perform that action at this time.
0 commit comments