Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: Rhapsody Gateway detect embedded shalls
Topic Summary:
Created On: 22-Sep-2005 12:39
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 22-Sep-2005 12:39
User is offline View Users Profile Print this message


Charlie Lane

Posts: 18
Joined: 11-May-2005

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?
Report this to a Moderator Report this to a Moderator
 29-Sep-2005 12:14
User is offline View Users Profile Print this message


Andreas Themis

Posts: 265
Joined: 29-Nov-2005

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
Report this to a Moderator Report this to a Moderator
 29-Sep-2005 12:35
User is offline View Users Profile Print this message


Charlie Lane

Posts: 18
Joined: 11-May-2005

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["?
Report this to a Moderator Report this to a Moderator
 11-Apr-2006 14:53
User is offline View Users Profile Print this message


Pieter J Pretorius

Posts: 2
Joined: 29-Mar-2005

Where is the document that describes the GateWay - Word expressions?

Thanks
Pieter
Report this to a Moderator Report this to a Moderator
 12-Apr-2006 12:46
User is offline View Users Profile Print this message


Pieter J Pretorius

Posts: 2
Joined: 29-Mar-2005

I see that they use Microsoft regular expressions.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 0 users logged in.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.