The code is of course wrong since the conditions are not part of the
rule. I committed a new version.
Can you please check if there are rules with features in the list
rulesToTest now?
Aren't there any new rules in the prior code?
// first only add conditions, e.g., for features
List<TextRulerSlotPattern> patterns = rule.getPatterns();
for (TextRulerSlotPattern eachPattern : patterns) {
for (TextRulerRuleItem item : eachPattern.fillerPattern) {
if (item instanceof WhiskRuleItem) {
WhiskRuleItem wri = (WhiskRuleItem) item;
WhiskRule proposedRule = rule;
TextRulerWordConstraint wordConstraint = wri.getWordConstraint();
for (String eachFeature : consideredFeatures) {
...
If that won't solve the problem, I fear I have to debug the problem, but
I can't reproduce it with my test data.
Best,
Peter
On 10.06.2013 11:34, Sondes Bannour wrote:
> yes i added the features names in the features and yes actually in
> extendRule function the features are not empty. In this code:
>
> // expend with feature conditions
> WhiskRule proposedRuleF = null;
> WhiskRuleItem tf = null;
> for (String eachFeature : consideredFeatures) {
> Map<String, String> featureMap =
> t.getWordConstraint().getTokenAnnotation()
> .getFeatureMap();
> String stringValue = featureMap.get(eachFeature);
> if (stringValue != null) {
> proposedRuleF = proposedRule.copy();
> tf = term;
> tf.activateFeature(stringValue);
> proposedRuleF.setNeedsCompile(true);
> if (!rulesToTest.contains(proposedRuleF)) {
> rulesToTest.add(proposedRuleF);
> }
> }
> }
>
> tf.getActivatedFeatures() is not empty as well but still don't get rules
> with FEATUREs.
>
> Best,
> Sondes
>