Warning: session_start(): open(/var/lib/php/sessions/sess_be3m3a01450lo52m0e0b1undfc, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
svoid ai_parseTree_makeWeights(AI_BottomUpParser1 parser, L productions, final PTElement e) {
// Descend first
for (PTElement child : ai_parseTree_getChildren(parser, productions, e))
ai_parseTree_makeWeights(parser, productions, child);
// Then calculate this node's weight
// check for explicit anti-examples
if (e instanceof HaveCategory && ai_antiWordCategoriesWithElements().get(e/HaveCategory.category).contains(e.text()))
ret with e.weight = 0.1;
if (e instanceof ChoosePart)
e.weight = avg(first(e.children).weight, second(e.children).weight);
else if (e instanceof HaveCategory && empty(e.children))
e.weight = or(ai_getWordToCategoryWeight(e.text(), e/HaveCategory.category), 1.0);
else
e.weight = collectMaxDouble(e.children, 'weight);
ai_Reconstructed r =
e instanceof ChoosePart ? e/ChoosePart.reconstruction
: e instanceof HaveCategory ? e/HaveCategory.reconstruction : null;
if (r != null)
e.weight *= r.production.weight;
}