![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Rhapsody Gateway detect embedded shalls Topic Summary: Created On: 22-Sep-2005 12:39 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I'm experimenting with Rhapsody Gateway to interpret a Word requirements document in which the requirements are indicated by paragraphs (of style Requirement_Text) of the form:
[INDENT]The sky shall[16 V] be blue. The blue shall cover the entire sky, no clouds. The leaves shall[17 C] be green.[/INDENT] Which means that the first 2 lines are requirement 16 and the last one is requirement 17. To interpret this, I am attempting to use a regular expression for type Requirement as follows: [INDENT]^Requirement_Text\t(.+shall)\[(.+)\](.+$)[/INDENT] where I specify the fields as Text, Identifer and Text respectively. Unfortunately, the result is that the requirement text for the requirement named "16 V" is: [INDENT]The sky shall be blue. The sky shall[16 V] be blue. The sky shall[16 V] be blue. The blue shall cover the entire sky, no clouds.[/INDENT] In other words, the complete paragraph has been repeated twice unneccesarily. That also happens with requirement text for "17 C". Any suggestions on what I've got wrong? |
|
![]() |
|
![]() |
|
Hi Charlie,
Your idea to allocate fields of the requirement expression is very good, and let us say we are impressed because it is not a basic notion !! One detail : You should avoid to include $ (end of line) in the parenthesis. Instead of: ^Requirement_Text\t(.+shall)\[(.+)\](.+$) prefer ^Requirement_Text\t(.+shall)\[(.+)\](.+$) Your problem is simple : you captured the ID but also the text thanks to the definition of the requirement element. But as you used the default Word style "Requirement_Text", you also captured each paragraph because of the "Text" element definition in your type. So you need to avoid this redundancy by increasing condition on "text" capture, i.e. by saying you want to get paragraphs using the style "Requirement_Text" but with no square bracket [ in it, because you already captured this information. If you modify the Text definition using : ^Requirement_Text\t([^\[]+)$ (not easy to read but means everything except [^ ] a square bracket \[) It will solve the problem. Best regards, Andreas |
|
![]() |
|
![]() |
|
Ah, yes, thanks Andreas. That works much better.
One complication is that square brackets are used in our documents for other things, like cross-references, so the exception of left square bracket actually excludes other lines that are wanted as text. Actually what I want to say for the text lines is "anything of style Requirement_Text except if it contains shall[". I can't just insert the word shall to make ^Requirement_Text\t([^shall\[]+)$ because that also excludes lines that include s, h, a or l. Is there an enhancement to that expression that will only exclude lines if they include "shall["? |
|
![]() |
|
![]() |
|
Where is the document that describes the GateWay - Word expressions?
Thanks Pieter |
|
![]() |
|
![]() |
|
I see that they use Microsoft regular expressions.
|
|
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
Rhapsody Gateway detect embedded shalls
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.