forked from HiltonRoscoe/GlossaryMD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregexner.txt
32 lines (32 loc) · 1.44 KB
/
regexner.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#import('text', 'com.nomagic.reportwizard.tools.TextTool')
#import('hrsort', 'com.hiltonroscoe.mdreportext.Sorter')
#import('hrlang', 'com.hiltonroscoe.mdreportext.Language')
#set($packages = $array.createArray())
#set($void = $array.addCollection($packages, $Package))
#set($void = $array.addCollection($packages, $SmartPackage))
#foreach ($package in $sorter.sort($packages, "qualifiedName"))
#set($qualifiedName = $package.qualifiedName)
#set ($classList = $array.createArray())
#set ($interfaceList = $array.createArray())
#set ($enumerationList = $array.createArray())
#foreach ($element in $report.getOwnedElementsIncludingAdditional($package, true))
#if ($element.elementType == "class")
#set ($void = $classList.add($element))
#elseif ($element.elementType == "interface")
#set ($void = $interfaceList.add($element))
#elseif ($element.elementType == "enumeration")
#set ($void = $enumerationList.add($element))
#end
#end
#macro( tokenregex $name)#set ($wordsInTerm = $hrlang.getWords($name))
( (#foreach ($lemma in $hrlang.getLemmas($name))[ {lemma:/\Q$lemma\E/} || {word:/\Q$wordsInTerm.get($foreach.index)\E/} ]#end) )#end
#end
#foreach ($class in $sorter.sort($classList))
#set ($synonyms = $report.getStereotypeProperty($class, "glossaryEntry", "synonyms"))
#foreach($synonym in $synonyms)
#if ($synonym != "")
#tokenregex($synonym) GLOSSARY_TERM $class.name $synonym.length()
#end
#end
#tokenregex($class.name) GLOSSARY_TERM $class.name $class.name.length()
#end