Score one scriptspan into doc_tote and vec, updating scoringcontext Inputs: One scriptspan of perhaps 40-60KB, all same script lower-case letters and single ASCII spaces. First character is a space to allow simple begining-of-word detect. End of buffer has three spaces and NUL to allow easy scan-to-end-of-word. Scoring context of scoring tables flags running boosts Outputs: Updated doc_tote giving
| 1300 | // the next-level-down routines. |
| 1301 | // |
| 1302 | void ScoreOneScriptSpan(const LangSpan& scriptspan, |
| 1303 | ScoringContext* scoringcontext, |
| 1304 | DocTote* doc_tote, |
| 1305 | ResultChunkVector* vec) { |
| 1306 | if (scoringcontext->flags_cld2_verbose) { |
| 1307 | fprintf(scoringcontext->debug_file, "<br>ScoreOneScriptSpan(%s,%d) ", |
| 1308 | ULScriptCode(scriptspan.ulscript), scriptspan.text_bytes); |
| 1309 | // Optionally print the chunk lowercase letters/marks text |
| 1310 | string temp(&scriptspan.text[0], scriptspan.text_bytes); |
| 1311 | fprintf(scoringcontext->debug_file, "'%s'", |
| 1312 | GetHtmlEscapedText(temp).c_str()); |
| 1313 | fprintf(scoringcontext->debug_file, "<br>\n"); |
| 1314 | } |
| 1315 | scoringcontext->prior_chunk_lang = UNKNOWN_LANGUAGE; |
| 1316 | scoringcontext->oldest_distinct_boost = 0; |
| 1317 | ULScriptRType rtype = ULScriptRecognitionType(scriptspan.ulscript); |
| 1318 | if (scoringcontext->flags_cld2_score_as_quads && (rtype != RTypeCJK)) { |
| 1319 | rtype = RTypeMany; |
| 1320 | } |
| 1321 | switch (rtype) { |
| 1322 | case RTypeNone: |
| 1323 | case RTypeOne: |
| 1324 | ScoreEntireScriptSpan(scriptspan, scoringcontext, doc_tote, vec); |
| 1325 | break; |
| 1326 | case RTypeCJK: |
| 1327 | ScoreCJKScriptSpan(scriptspan, scoringcontext, doc_tote, vec); |
| 1328 | break; |
| 1329 | case RTypeMany: |
| 1330 | ScoreQuadScriptSpan(scriptspan, scoringcontext, doc_tote, vec); |
| 1331 | break; |
| 1332 | } |
| 1333 | } |
| 1334 | |
| 1335 | } // End namespace CLD2 |
| 1336 |
no test coverage detected