// Search for some words in some texts and return a total score static double scoredSearch_scoreWeighted(Iterable l, LPair words) { double score = 0; if (l != null) for (S s : l) score += scoredSearch_scoreWeighted(s, words); ret score; } static double scoredSearch_scoreWeighted(S s, LPair words) { int score = 0; if (nempty(s)) for (S word, double weight : unpair words) score += scoredSearch_score_single(s, word)*weight; ret score; }