User Tools

Site Tools


howtos:importing_informant_definitions_-_sets_and_categories

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
howtos:importing_informant_definitions_-_sets_and_categories [2009/10/28 13:44]
marcus.williams created
howtos:importing_informant_definitions_-_sets_and_categories [2016/03/01 14:35]
marcus.williams [Element names - characters to avoid]
Line 1: Line 1:
-[Found this stuff in the create() tool documentation. We can trim as required]+**Found this stuff in the create() tool documentation. We can trim as required.** 
 + 
 +List the ways set informants can be defined: 
 +  * manually in Documenter 
 +  * copy-and-paste from one Documenter .dmm file to another  
 +  * from an informant definition file within Documenter (set or category) 
 +    * sets definition files can be created from the source data with a TOOL script 
 +  
 +Sequence informants are defined in the Documenter dialogue box. 
  
 ====== Creating a Set Object ====== ====== Creating a Set Object ======
Line 58: Line 66:
  
 ==== Examples: ==== ==== Examples: ====
 +<​code>​
 crop[] = create (; object=set, dataFile=crop.txt) crop[] = create (; object=set, dataFile=crop.txt)
 +</​code>​
 +
 where '​crop.txt'​ is a file containing: where '​crop.txt'​ is a file containing:
 +
 +<​file>​
 ! the set '​crop'​ ! the set '​crop'​
 wheat "wheat seed crop" wheat "wheat seed crop"
 corn "corn seed crop" corn "corn seed crop"
 barley "​barley seed crop" barley "​barley seed crop"
-Creates the set object, crop[], containing the elements:​{wheat,​ corn, barley}+</​file>​ 
 + 
 +Creates the set object, ​''​crop[]''​, containing the elements:​{wheat,​ corn, barley}
  
 ===== Specifying the Object Data from a Parameter ===== ===== Specifying the Object Data from a Parameter =====
Line 149: Line 163:
  
 The statement creates a set object with a description of "​gender":​ The statement creates a set object with a description of "​gender":​
 +
 +===== Element names - characters to avoid =====
 +
 +:!: The comma ","​ and period "​."​ characters must not be used used in element names (they cause issues with Documenter and category definitions).
 +
 +It is highly reccomended that whitespace and other non-alphanumeric characters be avoided in element names.
 +
 +Here is an example:
 +
 +<​code>​
 +localinformant employmentSector_d[] = create (; object=set, delimiter=",",​ \
 + allowDuplicate=off,​ \
 + elemNamesFromColNum=1,​ firstLine=1,​ \
 + searchElemName1=",",​ replaceElemName1="",​ \
 + searchElemName2="​.",​ replaceElemName2="​_",​ \
 + searchElemName3="&",​ replaceElemName3="​and",​ \
 + searchElemName4="/",​ replaceElemName4="​_",​ \
 + searchElemName5="​(",​ replaceElemName5="",​ \
 + searchElemName6="​)",​ replaceElemName6="",​ \
 + searchElemName7="​]",​ replaceElemName7="",​ \
 + searchElemName8="​[",​ replaceElemName8="",​ \
 + searchElemName9="​-",​ replaceElemName9="​_",​ \
 + searchElemName10="'",​ replaceElemName10="",​ \
 + searchElemName11="​$",​ replaceElemName11="​dlr",​ \
 + searchElemName12="​%",​ replaceElemName12="​pct",​ \
 + searchElemName13=":",​ replaceElemName13="",​ \
 + stripLeadingWhiteSpace=off,​ \
 + replaceWhiteSpaceInElemName="​_"​ , \
 + file=$fileName)
 +</​code>​
 +
 +====== Creating a Category Object ======
 +
 +===== Specifying the Category Definition from Parameters =====
 +
 +Example:
 +
 +<​code>​
 +localinformant egtCOfte_nr[] = create (; object=category,​ \
 + desc="​elecGenTech category of fuelTypeElec",​ \
 + groups = elecGenTech,​ \
 + members = fuelTypeElec,​ \
 + delimiter = ",",​ \
 + "​combSteamSF"​ = "​coal,​heavyOil,​petroleumCoke,​naturalGas",​ \
 + "​combTurbineSF"​ = "​coal,​heavyOil,​petroleumCoke,​naturalGas",​ \
 + "​combineCycleSF"​ = "​coal,​heavyOil,​petroleumCoke,​naturalGas",​ \
 + "​nucLWSteam"​ = "​urainium",​ \
 + "​nucHWSteam"​ = "​urainium",​ \
 + "​combSteamMF"​ = "​multiFuel",​ \
 + "​combTurbineMF"​ = "​multiFuel",​ \
 + "​combineCycleMF"​ = "​multiFuel",​ \
 + "​industrialSector"​ = "​nonSpecifiedFuel",​ \
 + "​commercialSector"​ = "​nonSpecifiedFuel"​)
 +</​code>​
howtos/importing_informant_definitions_-_sets_and_categories.txt · Last modified: 2024/03/14 10:21 (external edit)