//License:
See LICENSE.txt for copy of source license (AGPLv3)
//Copyright:
Author: Richard Bruce Baxter Copyright (c) 2005-2012 Baxter AI (baxterai.com)
//Release Notes:
For best performance, GIA requires specification of -lrpfolder (even if not using -lrp). This is used to perform a look up of WikipediaIrregularVerbs.txt in order to detect irregular verbs where they have not been pos tagged correctly by NLP. This is only applicable for releases >= 12 Nov 2012.
//Change Record:
Release-30July2012:
OpenGIA 29-July-2012 - first public release
OpenGIA 31-July-2012 - fix bug in advanced referencing (fill in temporary sentence word arrays with dummy prepositional data to prevent memory access failure upon assignment of preposition based references)
OpenGIA 03-August-2012 - continued NLG peformance - support noun plurality (replace indefinite articles 'a' -> 'some') and first letter vowels (modify indefinite articles 'a' -> 'an' [INCOMPLETE])
OpenGIA 03-August-2012 - improve stanford multi-word preposition reduction (ignore case _prep + _adverb) - remove RELATION_TYPE_ADJECTIVE_ADVMOD from redistributionStanfordRelationsMultiwordPrepositionIntermediaryRelationsTypeB
OpenGIA 03-August-2012 - fix bug in advanced referencing updates - assignment of grammaticalNumber (plural) to properties - remove grammaticalNumberTemp
OpenGIA 04-August-2012 - update NLG - GIA_NLG_SUPPORT_TIME_CONDITIONS
OpenGIA 06-August-2012 - update NLG - improve NLG_INPUTVIEW_THREE_ENTITY_SENTENCES_ADD_SINGLE_PROPERTY_AND_CONDITION_LINKS_DO_NOT_READD_SENTENCES_CONTAINED_THEREIN [INCOMPLETE]
OpenGIA 07-August-2012 - improve who/what query interpretation
OpenGIA 07-August-2012b - add GIA_USE_REDISTRIBUTE_STANFORD_RELATIONS_PHRASAL_VERB_PARTICLE_AND_OBJECT_OF_PREPOSITION
Release-15August2012:
OpenGIA 09-August-2012a - add GIA_REDISTRIBUTE_RELATIONS_INTERPRET_OF_AS_POSSESSIVE/GIA_REDISTRIBUTE_RELATIONS_SUPPORT_NAME_OF/GIA_REDISTRIBUTE_RELATIONS_SUPPORT_WHAT_IS_THE_NAME_NUMBER_OF_QUERIES - interpret "of" as possessive (property) / "its name is" / "what is the name/number of" queries (complements "how many" queries) [INCOMPLETE: return number of (advanced) references to the comparison variable node within its context found {eg 'A red dog is called max. A red dog is called Sam.' => 2}, instead of just the quantityNumber associated with the newest referenced entity => 1], add GIA_DEFINE_PROPERTIES_BASED_UPON_DETERMINATES_OF_DEFINITION_ENTITIES (improve GIA concept/property assignment performance), add GIA_SUPPORT_NAMES
OpenGIA 10-August-2012a - correct variable naming / bring GIA in line with Aristotle's Categories - replace all instances of 'property' with 'substance'/'instance'/'property' depending upon its precise meaning [INCOMPLETE].
OpenGIA 10-August-2012a - Make GIA support properties of concepts (eg "Bats have pies") - split addOrConnectPropertyToEntity into connectPropertyToEntity and addOrConnectPropertyToEntity
OpenGIA 11-August-2012a - fix bug in redistributeStanfordRelationsInterpretNameOfAsDefinition, replace GIA_REDISTRIBUTE_RELATIONS_INTERPRET_OF_AS_POSSESSIVE with GIA_TRANSLATOR_INTERPRET_OF_AS_POSSESSIVE, resplit addOrConnectPropertyToEntity into addOrConnectPropertyToEntityAddOnlyIfOwnerIsProperty and addOrConnectPropertyToEntity
OpenGIA 12-August-2012a - fixed limitation in advanced referencing (required actions) - removed GIA_USE_ADVANCED_REFERENCING_IDENTIFY_SETS_WITH_SUBJECT_OR_OBJECT_ONLY, added GIA_USE_ADVANCED_REFERENCING_IDENTIFY_DEFINITE_SETS_ONLY_ACCEPT_PROPERNOUNS
OpenGIA 15-August-2012a - add GIA_SUPPORT_ALIASES (with equalities/merging: for definition links between 2 substances), GIA_SUPPORT_WHICH_QUERY_ALIAS_ANSWERS, GIA_SUPPORT_WHO_QUERY_ALIAS_ANSWERS, GIA_SUPPORT_WHAT_IS_THE_TIME_QUERY_ALIAS_ANSWERS, update GIA_DEFINE_SUBSTANCES_BASED_UPON_DETERMINATES_OF_DEFINITION_ENTITIES, disable GIA_QUERY_TRACE_INSTANTIATIONS_DO_NOT_INCREMENT_NUMBER_OF_MATCHED_NODES
OpenGIA 16-August-2012a - fix up issue with yes/no queries (confidence threshold) as resultant of introducing GIA_SUPPORT_ALIASES (ie disabling GIA_QUERY_TRACE_INSTANTIATIONS_DO_NOT_INCREMENT_NUMBER_OF_MATCHED_NODES)
OpenGIA 16-August-2012a - add aliases to XML i/o
OpenGIA 17-August-2012a - add aliases to filesystem database, apply fixes to enable GIA_USE_DATABASE basic test cases to work with GIA_USE_ADVANCED_REFERENCING_SUPPORT_INTRASENTENCE_REFERENCING, GIA_USE_NLG_NO_MORPHOLOGY_GENERATOR, and GIA_SUPPORT_ALIASES: disable database when performing intrasentence reference calculations within createGIACoreferenceInListBasedUponIdentifiedReferenceSets, DBaddBlankString/DBreplaceBlankString with '-' when writing/reading strings from database
OpenGIA 21-August-2012a - update translator algorithm comments
OpenGIA 22-August-2012a - test basic database i/o with queries - disable database access during query net generation
OpenGIA 22-August-2012b - disable redundant 'that' nodes [disableRedundantNodesStanfordParser / complm]
OpenGIA 22-August-2012b - further constrain by/through having/being conditions [RELATION_TYPE_HAVING_AND_BEING_CONDITIONS_PREPOSITIONS]
Release-25September2012:
OpenGIA 5-September-2012a - implement phrasal verb and multiword preposition reduction using new GIA LRP (language reduction preprocessor)
OpenGIA 8-September-2012a - first working test of multi-word preposition reduction
OpenGIA 10-September-2012a - first working test of phrasal verb (multi-word verb) reduction
OpenGIA 12-September-2012a - compatibility updates for GIA code extension
OpenGIA 15-September-2012a - compatibility updates for GIA code extension
OpenGIA 18-September-2012a - support for high level shell script
OpenGIA 19-September-2012a - update GIA to accept multiple txt/NLP files (specify file list boolean)
OpenGIA 21-September-2012a - GIA_FREE_MEMORY1 - delete unused data structures
OpenGIA 21-September-2012a - GIA_FREE_MEMORY2 - handle memory correctly in advanced referencing preliminary round - use entityNodesActiveListCompleteTemp/entityNodesActiveListSubstancesTemp/entityNodesActiveListActionsTemp/entityNodesActiveListConditionsTemp
OpenGIA 21-September-2012a - GIA_APPLY_BUG_WORKAROUND_WHERE_A_CONCEPT_ENTITY_OF_INSTANCE_0_CAN_HAVE_NODE_DEFINING_INSTANCE
OpenGIA 22-September-2012a - STANFORD_CORENLP_DISABLE_INDEPENDENT_POS_TAGGER_WHEN_PARSING_RELATIONS
OpenGIA 22-September-2012a - mitigate effects of wordnet memory leak - WORDNET_CAPI_MEMORY_LEAK/GIA_USE_SYNONYMN_DETECTION_ONLY_DURING_QUERIES
OpenGIA 22-September-2012a - fix bug with GIA_SUPPORT_INCONSISTENCY_BETWEEN_STANFORD_PARSER_AND_STANFORD_CORENLP_PARSING_OF_CONSECUTIVE_FULL_STOPS
OpenGIA 23-September-2012a - GIA_FREE_MEMORY3 - free wordnet memory (use free_syns/free_synset/free_index functions in wn.h)
OpenGIA 23-September-2012a - remove temporary comments / print commands from all BAI code (or re-position inside DEBUG pre-processors)
OpenGIA 23-September-2012a - patch free wordnet memory code
OpenGIA 23-September-2012a - add -dbfolder and -lrpfolder and -syndet (make synonymn detection/Wordnet usage optional via command line parameter) parameters to GIAmain
OpenGIA 23-September-2012a - test consecutive multi-word (phrasal) verb and multi-word preposition
OpenGIA 23-September-2012a - test multiple sentences multi-word (phrasal) verb and multi-word preposition (get -nlprelation 1 to work with LRP)
OpenGIA 24-September-2012a - make LRP usage optional. Ensure initialisation of useDatabase, useLRP, and useSynDet (synonymnDetectionStatus) global variables via standard initialisation function set (initialiseDatabase, initialiseLRP, and initialiseWordNet). Add Optional preprocessor parameter GIA_LRP_DISABLE_REDISTRIBUTE_RELATIONS_POST_NLP_MULTIWORD_PREPOSITION_REDUCTION: disable stanford multiword prepositions when using lrp
OpenGIA 24-September-2012a - patch free wordnet memory code - fix up invocation of free_syns/free_synset
OpenGIA 24-September-2012a - patch free wordnet memory code - fix up another minor issue with clearing memory [add another invocation of free_synset] in checkIfSynsetListContainsSynonymousEntityNamesAndRecordMostPopularSynset()
OpenGIA 24-September-2012a - patch free wordnet memory code - including rework of looping in checkIfSynsetListContainsSynonymousEntityNamesAndRecordMostPopularSynset() function
OpenGIA 24-September-2012a - make lrp work with specified working/temp folders
OpenGIA 24-September-2012a - make sure the entire multiword phrasal verb / preposition is matched (in case currentTagInPlainTextSentenceTemp reaches end of sentence without matching the multiword phrasal verb / preposition in its entirety)
OpenGIA 28-September-2012a - source comments clean up / OpenCS compatibility updates
Release-15October2012:
OpenGIA 11-October-2012a - upgrade all svg code to use XMLParserClass
OpenGIA 11-October-2012a - draw nodes for each sentence consecutively (need to record/associate sentenceIndex with each entity node - including concept entity nodes)
OpenGIA 11-October-2012a - start implementation of GIA_TRANSLATOR_PREVENT_DOUBLE_LINKS_ASSIGN_CONFIDENCES; assign weight to new identical connections (don't duplicate properties or definitions)
OpenGIA 11-October-2012a - fix; in GIATranslatorOperations.cpp, restore addOrConnectPropertyToEntityAddOnlyIfOwnerIsProperty to only execute addOrConnectPropertyToEntity when thing entity is not a concept
OpenGIA 12-October-2012a - assign weight to new identical connections (don't duplicate conditions or actions)
OpenGIA 12-October-2012a - fix up draw nodes for each sentence consecutively with advanced referencing; initialise wasReferenceTemp (ie wasReferenceTemp = false) + change new instances of wasReferenceTemp to wasReference (as wasReferenceTemp appears to be reset on a per sentence basis)
OpenGIA 12-October-2012a - get advanced referencing for working in missing cases - change traceInstantiations value in createGIACoreferenceInListBasedUponIdentifiedReferenceSets() traceEntityNode function call
OpenGIA 13-October-2012a - activate GIA_TRANSLATOR_PREVENT_DOUBLE_LINKS_ASSIGN_CONFIDENCES
OpenGIA 14-October-2012a - prepare code for isSubstance being optionally isSubstanceConcept + update GIAXML, GIAdatabase, GIAdraw [, anything else required?] with isSubstanceConcept i/o
OpenGIA 14-October-2012a - update defineSubstancesBasedOnDeterminatesOfDefinitionEntities to support GIA_DEFINE_SUBSTANCES_BASED_UPON_DETERMINATES_OF_DEFINITION_ENTITIES_CASE_8_GOVERNOR_NAME_DEPENDENT_NAME (change 'else if' to 'if')
OpenGIA 14-October-2012a - fix bug in linkEntityDefinitionsAppositiveOfNouns/mergeEntityNodesAddAlias - initialise isNameQuery (ie isNameQuery = false)
OpenGIA 14-October-2012a - update GIATranslatorDefineSubstances.cpp to define isSubstanceConcept
OpenGIA 14-October-2012a - make GIA_SUPPORT_SPECIFIC_CONCEPTS compatible with advanced referencing
OpenGIA 14-October-2012a - fix bug in recent GIAnlg.cpp update - see prepare code for isSubstance being optionally isSubstanceConcept
OpenGIA 19-October-2012a - GIA_USE_DATABASE support Windows
OpenGIA 28-October-2012a - fix up NLG output in the case of actions with only an object attached
OpenGIA 28-October-2012a - query variables attached to conditions-actions(-conditions) were not been generated correctly
OpenGIA 28-October-2012b - add GIA_TRANSLATOR_INTERPRET_OF_AS_OBJECT_FOR_CONTINUOUS_VERBS and GIA_TRANSLATOR_CORRECT_IRREGULAR_VERB_LEMMAS support: interpret prep_of(xing, y) as obj(xing, y) via redistributeStanfordRelationsInterpretOfAsObjectForContinuousVerbs()
OpenGIA 28-October-2012b - restore NLG output (uncomment code) - fix artefact introduced 28-October-2012a
OpenGIA 02-November-2012a - remove appending '/' requirement on user definition of -lrpfolder/-dbfolder parameters [remove appending '/' condition on folder specification]
OpenGIA 02-November-2012b - create a GIA_DATABASE_TEST_MODE_LOAD_ALL_ENTITIES_AND_CONNECTIONS_TO_ACTIVE_LIST_UPON_READ prepocessor option add all nodes to active list when read data base; that way the database i/o functions can be tested exactly/precisely [updated initialiseDatabase to execute DBreadDatabase (which in turn invokes DBreadVectorConnections for each concept entity)]
OpenGIA 02-November-2012b - correct version of DBreadVectorConnections (to allow loop backs from database entities back to active node list entities - see entityNodesActiveListCompleteFastIndexDBactive [+ rename unordered map entityNodesTempActiveListComplete to entityNodesActiveListCompleteFastIndexDBcache])
OpenGIA 02-November-2012b - update linkAdvancedReferencesGIA to only invoke addEntityNodeToActiveLists if referenceSource is not already in active list, ie if(entityInActiveListComplete(referenceSource))
OpenGIA 07-November-2012a - manually assign a correspondence between each irregular verb and how it should be treated when a subject of an 'of' prepositional dependency relation (add a fourth/final column of WikipediaIrregularVerbs.txt)
OpenGIA 07-November-2012a - disable STANFORD_PARSER_USE_POS_TAGS and remove determineIfWordIsVerbContinuousCase() from redistributeStanfordRelationsInterpretOfAsObjectForContinuousVerbs() [this is required else all words ending with ing including "meaning of" will be interpreted as verbs]
OpenGIA 07-November-2012b - change defineToBeAndToDoPropertiesAndConditions() to actually treat todo and subject relation as substance link when GIA_DO_NOT_SUPPORT_SPECIAL_CASE_1C_RELATIONS_TREAT_TODO_AND_SUBJECT_RELATION_AS_SUBSTANCE_LINK is disabled [ie perform as expected]
OpenGIA 07-November-2012b - GIA_DO_NOT_SUPPORT_SPECIAL_CASE_1C_RELATIONS_TREAT_TODO_AND_SUBJECT_RELATION_AS_SUBSTANCE_LINK must be enabled for normalisation of some cases [ie enable GIA_DO_NOT_SUPPORT_SPECIAL_CASE_1C_RELATIONS_TREAT_TODO_AND_SUBJECT_RELATION_AS_SUBSTANCE_LINK to maintain current implementation]
OpenGIA 07-November-2012b - enable setting of partnerTypeObjectSpecialConditionToDoSubstanceFound for both stanford + relex, assuming GIA_DO_NOT_SUPPORT_SPECIAL_CASE_1C_RELATIONS_TREAT_TODO_AND_SUBJECT_RELATION_WITH_BE_AS_DEFINITION_LINK!
OpenGIA 08-November-2012a - GIAdatabase.cpp set newEntityNode's entityName and idInstance before calling addEntityNodesActiveListCompleteFastIndexDBactive() + GIATranslator.cpp fix up typo 'entityNodesActiveListCompleteFastIndexDBactiveOriginal = getDBentityNodesActiveListCompleteFastIndexDBactive();'
OpenGIA 08-November-2012a - set wasReference for all read entities in DBreadDatabase()
OpenGIA 08-November-2012a - add missing addEntityNodesActiveListCompleteFastIndexDBcache(conceptEntityNode) call in DBreadDatabase()
OpenGIA 08-November-2012a - uncomment SetCurrentDirectory(tempFolderCharStar) in GIAmain.cpp before final semanticNet.svg/.ppm/.ldr/etc print routines [required when using database] + add another instance of SetCurrentDirectory(tempFolderCharStar) before final answer.txt print routine
OpenGIA 08-November-2012a - shift declaration of char tempConfidenceStringCharStar[100]; and char tempMaxConfidenceStringCharStar[100]; - C++ issue/corrupt stack?
OpenGIA 12-November-2012a - fix bug in defineSubstanceConcepts() - need to ensure thing is a noun ie (featureArrayTemp[thingIndex]->grammaticalWordType == GRAMMATICAL_WORD_TYPE_NOUN)
OpenGIA 12-November-2012a - need to ensure that pronouns FEATURE_POS_TAG_PERSONAL_PRONOUN "PRP"/FEATURE_POS_TAG_POSSESSIVE_PRONOUN "PP$" are assigned nouns via convertStanfordPOSTagToRelexPOSTypeAndWordnetWordType() - add them to arrays featurePOSTagMinimalArray[]/featurePOSTagCrossReferenceRelexPOSTypeArray[]
OpenGIA 12-November-2012a - fix up assignment of subjObjRelationAlreadyAdded: re-disable use of partnerTypeObjectSpecialConditionToDoSubstanceFound without Relex
OpenGIA 12-November-2012a - extend substance concepts - activate GIA_SUPPORT_SPECIFIC_CONCEPTS_ASSIGN_TO_PRONOUNS_AND_PROPERNOUNS
OpenGIA 12-November-2012b - fix up assignment of subjObjRelationAlreadyAdded: re-enable use of partnerTypeObjectSpecialConditionToDoSubstanceFound without Relex - introduce partnerTypeObjectSpecialConditionToDoSubstanceFoundAssumeUsed
Release-15November2012:
OpenGIA 12-November-2012a - change implementation of nn; nn(shop-6, toy-5) -> toy is a property of shop (not shop is a property of concept toy) - GIA_TRANSLATOR_INTERPRET_PRENOMINAL_MODIFIER_DEPENDENT_AS_PROPERTY_INSTEAD_OF_GOVERNOR
OpenGIA 12-November-2012a - make dogs into a substance with "Red dogs are..." nn(dogs-2, Red-1) - GIA_TRANSLATOR_DEFINE_NOUNS_WITH_PRENOMINAL_MODIFIERS_AS_SUBSTANCES; update and change defineSubstancesNounsWithAdjectives() to defineSubstancesNounsWithAdjectivesOrPrenominalModifiers()
OpenGIA 13-November-2012a - [CHECK THIS] change interpretation of ccomp to action object rather than action property - GIA_TRANSLATOR_INTERPRET_CLAUSAL_COMPLEMENT_AS_ACTION_OBJECT_INSTEAD_OF_ACTION_PROPERTY (eg He says that you like to swim / ccomp(say, like) -> obj(say, like), Moses knew I was angry. / ccomp(knew-2, angry-5) -> obj(knew-2, angry-5)
OpenGIA 13-November-2012a - for Relex parsing only update switchArgumentsAndFunctionsWhereNecessary() to convert RELATION_TYPE_OBJECT_THAT_RELEX_EXPLICIT_PREPOSITION (relation type "that") into RELATION_TYPE_OBJECT_THAT_RELEX (relation type "_that") such that it can be correctly processed by GIATranslatorLinkEntities.h linkSubjectObjectRelationships() (NB relationTypeObjectNameArray[] = {RELATION_TYPE_OBJECT, RELATION_TYPE_OBJECT_THAT_RELEX})
OpenGIA 13-November-2012a - add redistributeStanfordRelationsExpletives()
OpenGIA 13-November-2012a - implement GIA bot - switch first and second person - GIA_USE_BOT / GIA_BOT_SWITCH_FIRST_AND_SECOND_PERSON - switch "you for I" (and vice versa)
OpenGIA 13-November-2012a - Interpret the indefinite plural 'some' determinate (GRAMMATICAL_DETERMINER_INDEFINITE_PLURAL) as a definite determinate for the purposes of GIA (ie like 'the') - ie it implies a plain substance always, and never a subtance concept
OpenGIA 14-November-2012a - fix up assignment of subjObjRelationAlreadyAdded: re-enable use of partnerTypeObjectSpecialConditionToDoSubstanceFound without Relex - introduce partnerTypeObjectSpecialConditionToDoSubstanceFoundAssumeUsed
OpenGIA 18-November-2012a - manually decapitalise first letter of each word in function before abbreviations (ie double capitalisation)
OpenGIA 19-November-2012a - support write of arbitrary svg width/height and viewport parameters
OpenGIA 28-November-2012a - change FEATURE_NER_NAME_CONCATENATION_TOKEN from " " to "_"
OpenGIA 28-November-2012a - with GIA_DATABASE_TEST_MODE_LOAD_ALL_ENTITIES_AND_CONNECTIONS_TO_ACTIVE_LIST_UPON_READ enabled, ensure a) concept nodes are not duplicated, b) concept nodes are added to entityNodesActiveListConcepts and entityNodesActiveListComplete, and c) instances added to entityNodesActiveListComplete
OpenGIA 28-November-2012a - fix GIA_USE_DATABASE record of quantityNumber (plus quantityNumberString, quantityModifier, quantityModifierStrings, hasQuantityMultiplier, and measureType)
OpenGIA 28-November-2012a - update GIAdatabase.cpp to not write connections to disabled nodes - GIA_DATABASE_ONLY_WRITE_CONNECTIONS_TO_ENABLED_ENTITY_NODES
OpenGIA 28-November-2012a - enabled GIA_DATABASE_DO_NOT_WRITE_DISABLED_ENTITY_NODES and GIA_DATABASE_NET_DO_NOT_WRITE_CONNECTIONS_TO_DISABLED_ENTITY_NODES
OpenGIA 28-November-2012a - for consistency, enabled GIA_SEMANTIC_NET_DO_NOT_WRITE_DISABLED_ENTITY_NODES and GIA_SEMANTIC_NET_DO_NOT_WRITE_CONNECTIONS_TO_DISABLED_ENTITY_NODES
OpenGIA 28-November-2012a - update new GIA_SUPPORT_SPECIFIC_CONCEPTS condition in linkEntityDefinitionsAppositiveOfNouns() as specific concepts can be names. Implement isName, ie if((thingEntity->isSubstance || thingEntity->isNameQuery) && (definitionEntity->isSubstance || definitionEntity->isNameQuery))
OpenGIA 28-November-2012a - make mergeEntityNodesAddAlias() unreliant upon idActiveList
OpenGIA 28-November-2012a - update mergeEntityNodesAddAlias() to not merge concept node links of entityNodeToMerge - see multiple use of condition (i == GIA_ENTITY_VECTOR_CONNECTION_TYPE_NODE_DEFINING_INSTANCE)
OpenGIA 28-November-2012a - fix xml file read crash with GIA_SEMANTIC_NET_DO_NOT_WRITE_DISABLED_ENTITY_NODES - update resetIDsForNodeList to not reset idActiveList if entity is disabled
OpenGIA 28-November-2012a - aliasing algorithm reversion mergeEntityNodesAddAlias() including GIA_SUPPORT_MORE_THAN_ONE_NODE_DEFINING_AN_INSTANCE - NB this is required for advanced referencing to work properly with specific cases of aliasing eg; The name of the red dog is Tom. Tom ate a bone near the house.
OpenGIA 28-November-2012a - replace all instances of "instanceEntity->entityVectorConnectionsArray[GIA_ENTITY_VECTOR_CONNECTION_TYPE_NODE_DEFINING_INSTANCE])->back()->entity" with "getPrimaryConceptNodeDefiningInstance(instanceEntity)"
OpenGIA 28-November-2012a - fix getPrimaryConceptNodeDefiningInstance reference in GIATranslator.cpp
OpenGIA 28-November-2012a - disable GIA_USE_RELEX_UPDATE_ADD_PARAGRAPH_TAGS - NB GIA no longer works with BAI Relex <paragraph> tag upgrade - as sentence ID is used exclusively for a variety of purposes (without paragraph id): therefore will need to determine a new method of establishing intra paragraph referencing.
OpenGIA 28-November-2012a - introduce maxNumberSentences instead of relying upon inefficient hard coded MAXIMUM_NUMBER_OF_SENTENCES_IN_INPUT_TEXT (1000000)
OpenGIA 28-November-2012a - introduce thisIsDefinitionAndPreviousNodeWasInstance into GIA draw
OpenGIA 28-November-2012a - update DBreadDatabase for GIA_SUPPORT_MORE_THAN_ONE_NODE_DEFINING_AN_INSTANCE: test if entity has already had its connections loaded (and therefore has already been added to entityNodesActiveListComplete)
OpenGIA 28-November-2012a - properly update (*connectionIter2)->entityName and (*connectionIter2)->idInstance in mergeEntityNodesAddAlias
OpenGIA 28-November-2012a - update new GIA_SUPPORT_SPECIFIC_CONCEPTS condition in testReferencedEntityNodeForExactNameMatch() as specific concepts can be names (check if substances have aliases).
OpenGIA 28-November-2012a - disable GIA_DATABASE_TEST_MODE_LOAD_ALL_ENTITIES_AND_CONNECTIONS_TO_ACTIVE_LIST_UPON_READ for release
OpenGIA 28-November-2012b - GIA_ADVANCED_REFERENCING_DO_NOT_REAPPLY_IS_SUBSTANCE_CONCEPT_TO_REFERENCES - do not utilise mustSetIsSubstanceConceptBasedOnApposRelation when wasReference is set
OpenGIA 28-November-2012b - implement GIA_QUERY_DO_NOT_SEARCH_DISABLED_NODES (should not be required)
OpenGIA 28-November-2012b - in linkAdvancedReferencesGIA() add DBreadVectorConnections(referenceSourceConceptEntity, GIA_ENTITY_VECTOR_CONNECTION_TYPE_ASSOCIATED_INSTANCES); //read the associated instance vector connections from the database for the concept node of the reference node (which has not necessarily already been loaded in the case of GIA_SUPPORT_MORE_THAN_ONE_NODE_DEFINING_AN_INSTANCE) - enabling the reference node to be found linkAdvancedReferencesGIA
OpenGIA 28-November-2012b - in linkAdvancedReferencesGIA() add for all i, DBreadVectorConnections(referenceSource, i); //read all vector connections for the reference (this is required because writeVectorConnection() presumes entityVectorConnectionsReferenceListLoadedArray[i] to be true in all cases - ie, in case the reference is ammended with new connections by GIATranslator which it is very likely to be the case)
OpenGIA 28-November-2012b - update DBwriteEntityNodeFile() to perform a check of string sizes written via fprintf; ie; entityName.c_str(), wordOrig.c_str(), aliasesString.c_str(), quantityNumberString.c_str(), and quantityModifierString.c_str()