![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() 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". | |
![]() |
|
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 |
|
![]() |
|
![]() |
|
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".
|
|
![]() |
|
![]() |
|
Hi Adam,
Thank you very much! I have tried the dxl script ant it wor´ked just as I wanted. |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
count occurrence of "shall" in objects
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.