Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: count occurrence of "shall" in objects
Topic Summary:
Created On: 17-May-2005 12:31
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
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.
Answer This question was answered by Adam Gerber, on Wednesday, May 18, 2005 7:26 AM

Answer:
You could do something like this. First create an integer attribute named "Shall Count" Then run this script. You could do this in a DXL attribute also. The script would need to be modified a little. Might want to look at other variations of shall also like "[s]Shall".
 17-May-2005 12:31
User is offline View Users Profile Print this message


Haiat Ebraham

Posts: 9
Joined: 25-Feb-2005

Hi,

I want to see how many times the word "shall" occurrs in each object.
Does anyone know how to do that?

I have not written any DXL scripts before and I have not used DOORS very long.
 
Kind regards
Haiat
Report this to a Moderator Report this to a Moderator
 17-May-2005 13:38
User is offline View Users Profile Print this message


Adam Gerber

Posts: 17
Joined: 8-Oct-2002

Answer Answer
You could do something like this. First create an integer attribute named "Shall Count" Then run this script. You could do this in a DXL attribute also. The script would need to be modified a little. Might want to look at other variations of shall also like "[s]Shall".
Report this to a Moderator Report this to a Moderator
 17-May-2005 14:16
User is offline View Users Profile Print this message


Haiat Ebraham

Posts: 9
Joined: 25-Feb-2005

Hi Adam,

Thank you very much!

I have tried the dxl script ant it wor´ked just as I wanted.

Report this to a Moderator Report this to a Moderator
 17-May-2005 14:28
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

No problem, try the following:

Module m = current
string s
Object o
int numShalls

Regexp hasShall = regexp "(shall)"

for o in m do
{
numShalls = 0
s = o."Object Text" ""

while (s != "" && hasShall s)
{
numShalls++

s = s[end 1:]
}

if (numShalls > 0)
{
print("Object " identifier(o) " contains " numShalls " \"shalls\"\n")
}
}



-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 18-May-2005 22:01
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

It seems to count the number of objects that contain at least one 'shall' in the Object Text. That is probably what you want, but that's not the same thing as counting all the shall's in the document, since an object may have more than one 'shall', such as this paragraph.

- Louie
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

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