Score RTypeNone or RTypeOne scriptspan into doc_tote and vec, updating scoringcontext
| 1130 | // Score RTypeNone or RTypeOne scriptspan into doc_tote and vec, updating |
| 1131 | // scoringcontext |
| 1132 | void ScoreEntireScriptSpan(const LangSpan& scriptspan, |
| 1133 | ScoringContext* scoringcontext, |
| 1134 | DocTote* doc_tote, |
| 1135 | ResultChunkVector* vec) { |
| 1136 | int bytes = scriptspan.text_bytes; |
| 1137 | // Artificially set score to 1024 per 1KB, or 1 per byte |
| 1138 | int score = bytes; |
| 1139 | int reliability = 100; |
| 1140 | // doc_tote uses full languages |
| 1141 | Language one_one_lang = DefaultLanguage(scriptspan.ulscript); |
| 1142 | doc_tote->Add(one_one_lang, bytes, score, reliability); |
| 1143 | |
| 1144 | if (scoringcontext->flags_cld2_html) { |
| 1145 | ChunkSummary chunksummary = { |
| 1146 | 1, 0, |
| 1147 | one_one_lang, UNKNOWN_LANGUAGE, score, 1, |
| 1148 | bytes, 0, scriptspan.ulscript, reliability, reliability |
| 1149 | }; |
| 1150 | CLD2_Debug(scriptspan.text, 1, scriptspan.text_bytes, |
| 1151 | false, false, NULL, |
| 1152 | scoringcontext, NULL, &chunksummary); |
| 1153 | } |
| 1154 | |
| 1155 | // First byte is always a space |
| 1156 | JustOneItemToVector(scoringcontext->scanner, scriptspan.text, |
| 1157 | one_one_lang, 1, bytes - 1, vec); |
| 1158 | |
| 1159 | scoringcontext->prior_chunk_lang = UNKNOWN_LANGUAGE; |
| 1160 | } |
| 1161 | |
| 1162 | // Score RTypeCJK scriptspan into doc_tote and vec, updating scoringcontext |
| 1163 | void ScoreCJKScriptSpan(const LangSpan& scriptspan, |
no test coverage detected