-
Notifications
You must be signed in to change notification settings - Fork 34
Translate Objectif pseudo code into CEG #471
base: develop
Are you sure you want to change the base?
Conversation
… the model description)
# Conflicts: # bundles/specmate-cause-effect-patterns/.classpath # bundles/specmate-integration-test/.classpath # bundles/specmate-integration-test/bnd.bnd # bundles/specmate-integration-test/resources/test_rules.objectif # bundles/specmate-model-generation/bnd.bnd # bundles/specmate-model-generation/generated/buildfiles # bundles/specmate-model-generation/src/com/specmate/modelgeneration/GenerateModelFromRequirementService.java # bundles/specmate-model-generation/src/com/specmate/modelgeneration/PatternbasedCEGGenerator.java # bundles/specmate-objectif/src/com/specmate/objectif/resolve/rule/ObjectifNode.java # bundles/specmate-std-env/dev-specmate-all.bndrun
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not working for
WENN A ODER B
DANN
C
SONST
WENN
E ODER F
DANN
D
SONST
K
ENDE-WENN
ENDE-WENN
@@ -242,9 +242,12 @@ private static void printConstituent(Constituent con, StringJoiner joiner) { | |||
private static String DE_Pattern = "\\b(der|die|das|ein|eine|einen)\\b"; | |||
|
|||
public static ELanguage detectLanguage(String text) { | |||
if (text.matches(".*WENN.*ENDE-WENN.*")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the dot will not match line breaks, hence something like below is not detected. Solution: Use pattern=Pattern.compile(.*WENN.ENDE-WENN., Pattern.DOT_ALL)
pattern.matcher(text).matches()
WENN bla
DANN
blup
ENDE-WENN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in new commit
@@ -1,4 +1,4 @@ | |||
WENN A=5 UND B=3 DANN C=7 ENDE-WENN | |||
WENN A=5 UND X=9 DANN C=7 ENDE-WENN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible to add multiline text to the test?
try { | ||
rules = new BusinessRuleUtil().parseXTextResource(text); | ||
} catch (XTextException e) { | ||
throw new SpecmateInternalException(ErrorCode.INTERNAL_PROBLEM, "..."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a sensible exception message. something that indicates that the xtext pasrsing went wrong. also include the orginal message (e.getMessage())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in new commit
@@ -1,4 +1,4 @@ | |||
WENN A=5 UND B=3 DANN C=7 ENDE-WENN | |||
WENN A=5 UND X=9 DANN C=7 ENDE-WENN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The model generation does not work when special chars (e.g. [(*<)) or umlauts (ÄÖÜ etc.) are in the text
The model generation does not work when line breaks are in the text (see comment below)
Pelase fix and add tests
Generally it seems that "SONST" is not correctly interpreted. I oculd not create a working example |
…unit test for xtext parsing
No description provided.