gD      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgh i j k l m n o p q r s t u v w x y z { | } ~                                   ! " # $ % & '()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~        !!!!!!& Safe-Inferred +Adds a metric at the beginning of the list B (note we reverse the order whene we want to print the metrics)       " Safe-Inferred  !"#$%&'()*!&'()*  !"#$%&'()*None++NoneAn alternative ," instance (the idea being that we  should reserve , for outputting actual Haskell) Minimal implementation is  or   between l r t == l   t   rparens t puts t between parentheses (())  squares t puts t between square brackets ([]) CSeparated by space unless one of them is empty (in which case just  the non-empty one) I think I want ($+$) here but I'm not sure I understand the * documentation from the pretty package. t1  t2, separates the two by a newline, unless one 0 of them is empty. The vertical equivalent to '( +)' JPuts list items on the same line if they are smaller than a certain width - otherwise, puts a newline in between them  + prettyCount toBlah "" (x,1) == "blah" + prettyCount toBlah "foos" (x,1) == "blah" . prettyCount toBlah "" (x,4) == "blah 4" 3 prettyCount toBlah "foos" (x,4) == "blah 4 foos" -./0   -./0None$GenI format; should round-trip with # by rights "Minimal definition, either one of  or  11None8 is something you want to perform detect polarities on. RestrictedPolarityKey c att( is a polarity key in which we only pay - attention to nodes that have the category c. This makes it possible 9 to have polarities for a just a small subset of nodes ' attribute  !"#$%&'()*+2345  !"#$%&'()*+ &)('%# $!"*+ # $!"%&)('*+2345None6-Intermediary type used for alphanumeric sort /putStr on stderr 4<Drop all characters up to and including the one in question 50Make the first character of a string upper case 60Make the first character of a string lower case 891 but only if it contains characters that are not  used in GenI identifiers :.break a list of items into sublists of length < the clump ? size, taking into consideration that each item in the clump 2 will have a single gap of padding interspersed 5any item whose length is greater than the clump size ! is put into a clump by itself given a length function  clumpBy (length.show) 8 [hello, this, is, a, list] ;FAn alphanumeric sort is one where you treat the numbers in the string F as actual numbers. An alphanumeric sort would put x2 before x100,  because 2 <6 10, wheraeas a naive sort would put it the other way # around because the characters 1 <$ 2. To sort alphanumerically, just  'sortBy (comparing toAlphaNum)' BA strict version of 7 C0True if the intersection of two lists is empty. DServes the same function as 8. It groups together J items by some property they have in common. The difference is that the ; property is used as a key to a Map that you can lookup. J9Return the list, modifying only the first matching item. KStrict version of mapTree! (for non-strict, just use fmap) LLike 9=, except on Trees. Filter might not be a good name, though, 2 because we return a list of nodes, not a tree. MThe leaf nodes of a Tree N#Return pairs of (parent, terminal) OO  fn filt t returns a version of t in which the first  node which filt matches is transformed using fn. PLike O+ except that it performs the operations on ! all nodes that match and doesn't care if any nodes match  or not QLike O but on a list of tree nodes R@Replace a node in the tree in-place with another node; keep the C children the same. If the node is not found in the tree, or if C there are multiple instances of the node, this is treated as an  error. S>errors specifically in GenI, which is very likely NOT the user' s fault. U+The module name for an arbitrary data type VAdd two intervals WW x builds a trivial interval from x to x Y6displays a bit vector, using a minimum number of bits 4,-.6:;/0123456789:;<=>?@ABCDEFGHIJKLMNOreplacement function filtering function PQreplacement function filtering function nodes R which node? STUVWXY<=>.,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY./0124356;798:<=>?@ABGCDEFHIJKLMNOPQR.VWX,-YSTU1,-.6;:/0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY<=>None Z7Note: you can define the final state either by setting ]  to Just f where f( is some function or by putting them in  ^ ]a will use this if defined ^can be ignored if ] is defined _=there can be more than one transition between any two states . and a transition could be the empty symbol ` if you don'*t care about grouping states into columns 0 you can just dump everything in one big list aa. returns all the final states of an automaton bb  aut st1 ab returns the states that st1 transitions  to via a. d9Returns all possible paths through an automaton from the  start state to any dead-end. .Each path is represented as a list of labels. 5We assume that the automaton does not have any loops  in it. e?The set of all bundled paths. A bundled path is a sequence of A states through the automaton from the start state to any dead < end. Any two neighbouring states can have more than one A possible transition between them, so the bundles can multiply - out to a lot of different possible paths. (The output is a list of lists of lists: ; Each item in the outer list is a bundled path through the ? automaton, i.e. without distinguishing between the possible 0 transitions from any two neighbouring states 7 Each item in the middle list is represents the set of 5 transitions between two given neighbouring states 5 Each item in the inner list represents a transition  between two given states Z[\]^_`abc from state  transition  to state defgZ[\]^_`abcdefgZ[\]^_`acbdefgZ[\]^_`abcdefg  Safe-Inferredhijklmnopq?@ABC hijklmnopq jklmnopqhi hijklmnopq?@ABC$ Safe-Inferred hijlmnopq jlmnopqhi None*r)A structure that can be traversed with a  -replacing ? function (typical use case: substitution after unification) @Approach suggested by Neil Mitchell after I found that Uniplate * seemed to hurt GenI performance a bit. sdescendGeniVal f x applies f to all  in x tIA schema value is a disjunction of GenI values. It allows us to express J fancy  disjunctions in tree schemata, ie. disjunctions over variables  and not just atoms (?X;?Y). DOur rule is that that when a tree schema is instantiated, any fancy 0 disjunctions must be crushed  into a single  lest it be  rejected (see ) -Note that this is still not recursive; we don't have disjunction over I schema values, nor can schema values refer to schema values. It just E allows us to express the idea that in tree schemata, you can have  either variable ?X or ?Y. v:An Idable is something that can be mapped to a unique id. < You might consider using this to implement Ord, but I won't. ? Note that the only use I have for this so far (20 dec 2005)  is in alpha-conversion. xA x2 is something which can return its variables as a E map from the variable to the number of times that variable occurs  in it. BImportant invariant: if the variable does not occur, then it does B not appear in the map (ie. all counts must be >= 1 or the item  does not occur at all) ?By variables, what I most had in mind was the GVar values in a L GeniVal. This notion is probably not very useful outside the context of < alpha-conversion task, but it seems general enough that I' ll keep it L around for a good bit, until either some use for it creeps up, or I find 9 a more general notion that I can transform this into. y collect x m+ increments our count for any variables in x + (adds not-yet-seen variables as needed) z%A variable label and its constraints {Unification can either & |or fail })succeed w both vars needing substitution  (constraint intersection), ~%succeed with a one-way substitution, %succeed for free (no substitutions), A variable substitution map. 1 GenI unification works by rewriting variables ' constant : no label, just constraints / variable : label, with or without constraints & anonymous : no label, no constraints Optional label (?X would have Just X) Optional values/ constraints $ Must have at least one if at all >Though it may seem a bit redudant, this is not quite the same  as having '[Text]' because Nothing means no constraints;  whereas Just []& (impossible here) would mean bottom.  x :! [] creates a single constant.  x :! xs N creates an atomic disjunction. It makes no difference which of the values  you supply for x and xs* as they will be sorted and nubed anyway. 2Create a singleton constant (no disjunction here) Create a variable &Create a variable with no constraints Create an anonymous value If v has exactly one value/constraint, returns it  An anonymous  (_ or ?_) has no labels/ constraints For debugging & performs unification on two lists of . If $ unification succeeds, it returns  Just (r,s) where r is ! the result of unification and v'erb!s! is a list of substitutions that  this unification results in. l1  l2 returns the result of l1  l2 if > doing a simultaneous traversal of both lists, each item in  l1$ subsumes the corresponding item in l2 unifyHelper unf gs1 gs20 zips two lists with some unification function. It' s meant to serve as a helper to  and  =Note that the first Subst is assumed to come chronologically % before the second one; so merging  { X -> Y } and  { Y -> 3 }  should give us { X -> 3; Y -> 3 }; See  for a warning! !Add to variable replacement to a  that logical comes before 6 the other stuff in it. So for example, if we have Y -> foo  and we want to insert X -> Y, we notice that, in fact, Y has  already been replaced by foo , so we add X -> foo instead >Note that it is undefined if you try to append something like  Y -> foo to Y -> bar+, because that would mean that unification  is broken See source code for details Note that we assume that it's acceptable to generate new " variable names by appending an x to them; this assumption @ is only safe if the variables have gone through the function  * or have been pre-processed and rewritten @ with some kind of common suffix to avoid an accidental match *intersectConstraints (Just cs1) (Just cs2) returns the intersection of  cs1 and cs2 if non-empty (or D if there's nothing in common) *If any of the arguments is unconstrained (Nothing), we simply return  the other.  x y returns the same result as  unifyOne x y if x  subsumes y or | otherwise Apply variable substitutions %Apply a single variable substitution FHere it is safe to say (X -> Y; Y -> Z) because this would be crushed / down into a final value of (X -> Z; Y -> Z) Core implementation for   For use by the Uniplate-esq s Core implementation for   For use by the Uniplate-esq s ;Anonymise any variable that occurs only once in the object - appends a unique suffix to all variables in A an object. This avoids us having to alpha convert all the time > and relies on the assumption finding that a unique suffix is  possible.  does the following: @ (if suffix is non-null) appends a suffix to all variable names ! to ensure global uniqueness > intersects constraints for for all variables within the same  object HConvert a fancy disjunction (allowing disjunction over variables) value I into a plain old atomic disjunction. The idea is to support a limited I notion of fancy disjunction by requiring that there be a single point F where this disjunction can be converted into a plain old variable. ; Note that we currently convert these to constants only. %Convert a list of fancy disjunctions =rstuvwthe unique id xyz{|}~non-empty list label  constraints EFGHIJKLMNOPQRS.rstuvwxyz{|}~.{~}|zxyvwturs2rstuvwxyz{~}|EFGHIJKLMNOPQRS%None#rstuvwxy{|}~%tu{~}|rsxyvw None 2Experimental, alternative representation of Flist ' which guarantees uniqueness of keys /An attribute-value pair, the typical use being  AvPair GeniVal' or if you have something even simpler   AvPair Text #A list of attribute-value pairs. It' s not a great idea to represent H feature structures with this because it allows for duplicates in the > attributes. But maybe sometimes you really do mean a list. "A feature structure with no pairs  Convert an  to a proper  ( Unsafely assumes the keys are unique  Convert an  to a simpler to process  ,Sort an Flist according with its attributes 3 performs feature structure unification, under the & these assumptions about the input:  Features are ordered 9 The Flists do not share variables (renaming has already  been done. ?The features are allowed to have different sets of attributes,  beacuse we use  to realign them. @ is a pre-procesing step used to ensure that feature structures M have the same set of keys. If a key is missing in one, we copy it to the " other with an anonymous value. ;The two feature structures must be sorted for this to work  Helper for  ; ignore 1Flatten a fancy disjunction attribute-value pair See  for details .Flatten a fancy-disjunction feature structure See  for details TUVWXYZ[\]^_TUVWXYZ[\]^_ NoneFlags are GenI'9s internal representation of command line arguments. We Euse phantom existential types (?) for representing GenI flags. This &makes it simpler to do things such as ``get the value of the MacrosFlg'' @whilst preserving type safety (we always know that MacrosFlg is Gassociated with String). The alternative would be writing getters and Bsetters for each flag, and that gets really boring after a while.  What kind of elementary trees we'%re getting. The typical use case is ! to provide tree schemata with  (which then get anchored into K the lexicon to give us elmentary trees). You can also have precompiled D trees hardcoded into your GenI-like program, or read preanchored ) elementary trees from somewhere else. lexical selection already done #built into geni, no parsing needed geni's text format +The tree assembly algorithm we want to use @A test suite and any test cases within that we want to pick out Requested optimisations CAt the time of this writing (2012-08-21), this is fairly sparse as E a lot of proposed optimisations have just been absorbed into GenI  as mandatory things. .guided realisation (needs polarity filtering) ,ignore literal constraints (pessimisation?) polarity filtering %all adjunction-related optimisations %all polarity-related optimisations  +This only has an effect if the flag is set updateFlags new old takes the flags from new plus any from old that  aren't mentioned in it d  flag constructor    new old `aba     a     6     `ab None=Anything that we would want to count the number constants in  (as opposed to variables) Number of constants 2Semantics, index constraints, literal constraints The intention here is that for (sem, icons, lcons)  all (c sem) lcons BA literal and any constraints associated with it (semantic input) 'A semantics is just a set of literals. JA single semantic literal containing its handle, predicate, and arguments JThis can be paramaterised on the kinds of variables it uses, for example,  @ for a semantics that you might still want to do unification on  or d if it's supposed to be ground. Hthe handle can be seen as a special kind of argument; stored separately ;An empty literal, not sure you should really be using this 6Strip any index or literal constraints from an input.  Use with care.  Default sorting for a semantics !Default comparison for a literal >Sort primarily putting the ones with the most constants first ? and secondarily by the number of instances a predicate occurs % (if plain string; atomic disjunction/vars treated as infinite) :Helper for displaying or pretty printing a semantic input 9This gives you a bit of control over how each literal is  displayed  DIs a handle generated by GenI. GenI lets you write literals without D a handle; in these cases a unique handle is generated and hidden  from the UI. !x ! y( returns all the possible ways to unify  x with some SUBSET of y so that x subsumes y.  If x does NOT subsume y, we return the empty list. " Helper for ! traversal #p1 # p2 is the unification of p1 and p2 if C both literals have the same arity, and the handles, predicates,  and arguments in p1# all subsume their counterparts in p2 $<Return the list of minimal ways to unify two semantics, ie. H where any literals that are not the product of a succesful unification ) really do not unify with anything else. %Helper traversal for $ &:Two literals unify if they have the same arity, and their 1 handles, predicates, and arguments also unify & !"#$%&efghijklmnopqrs !"#$%& !"#$%&! !"#$%&efghijklmnopqrsNone21Path equations can either hit a feature or a node's lexeme attribute 5"Left hand side of a path equation 91Parse a path equation using the GenI conventions ( This always succeeds, but can return  Just warning " if anything anomalous comes up  FIXME : make more efficient '()*+,-./0123456789:;<tuvwxy'()*+,-./0123456789:;<5876243/10.9:*-,+')(;<')(*-,+./1024358769:;<tuvwxyNone=A sentence composed of > instead of plain old words >(A lemma plus its morphological features =>?@ABCDEFGz{ =>?@ABCDEFG GFBCDE>?@A==>?@ABCDEFGz{NoneH8An annotated GeniVal. This is for a rather old, obscure > variant on the polarity filtering optimisation. To account = for zero literal semantics, we annotate each value in the  semantics with a positive/ negative marker. These markers ; are then counted up to determine with we need to insert < more literals into the semantics or not. See the manual * on polarity filtering for more details ILexical entry Knormally just a singleton,  useful for merging synonyms Ltree family to anchor to M,parameters (deprecrated; use the interface) N-features to unify with tree schema interface O,features to pick out family members we want Ppath equations Qlexical semantics R#polarities (must be same length as Q) SCollection of lexical entries T See also U 3 This version comes with some sensible defaults. U Variant of T but with more control V>Separate an input lexical semantics into the actual semantics 0 and the semantic polarity entries (which aren't used very much A in practice, being a sort of experimental feature to solve an " obscure-ish technical problem) W:Note that by convention we ignore the polarity associated  with the predicate itself HIJKLMNOPQRSTword  family name parameters list (deprecated) "interface (use instead of params) filters  equations  semantics Uword  family name parameters list (deprecated) "interface (use instead of params) filters  equations  semantics semantic polarities VW|}~HIJKLMNOPQRSTUVWSIJKLMNOPQRTUHVWHI JKLMNOPQRSTUVW|}~&NoneHIKLMNOPQRSTUVWSIKLMNOPQRTUKLMNOPQRHVWNone^A single node of a TAG tree. atop feature structure bbottom feature structure cFalse for na nodes d[] for na nodes g+for TAG, this would be the elementary tree ' that this node originally came from h<Essentially boolean representation of adjunction constraint i'inferred by GenI to be adjunction free  (ie. during realisation) j&hard-coded null-adjunction constraint ~Given a lexical item s' and a Tree GNode t, returns the tree t' 4 where l has been assigned to the anchor node in t' Given a lexical item l and a tree node n (actually a subtree D with no children), return the same node with the lexical item as I its unique child. The idea is that it converts terminal lexeme nodes I into preterminal nodes where the actual terminal is the given lexical  item ?Add an inferred adjunction constraint marker unless we already  see an explicit one Return the value of the cat attribute, if available 9Attributes recognised as lexemes, in order of preference A single node of a TAG tree. MThe default show for GNode tries to be very compact; it only shows the value B for cat attribute and any flags which are marked on that node. KThis is one the places where the pretty representation of a GenI object is & different from its GenI-format one DXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~1tXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~1yzopqrstuvwxlnm{|}~hkji^_`abcdefgXY]\[Zt)XY]\[Z^ _`abcdefghkjilnmo pqrstuvwxyz{|}~None  is a generalisation of .  can be empty An anchored grammar. P The grammar associates a set of semantic predicates to a list of trees each. addTags  tags key elem adds elem( to the the list of elements associated  to the key AGiven a tree(GNode) returns a list of substitution or adjunction H nodes, as well as remaining nodes with a null adjunction constraint. @Plug the first tree into the second tree at the specified node. 9 Anything below the second node is silently discarded. @ We assume the trees are pluggable; it is treated as a bug if  they are not! Given two trees auxt and t, splice the tree auxt into  t via the TAG adjunction rule. FAssigns a unique id to each element of this list, that is, an integer ' between 1 and the size of the list. CSorts trees into a Map.Map organised by the first literal of their E semantics. This is useful in at least three places: the polarity M optimisation, the gui display code, and code for measuring the efficiency H of GenI. Note: trees with a null semantics are filed under an empty  predicate, if any. >Normally, extracting the sentences from a TAG tree would just D consist of reading its leaves. But if you want the generator to C return inflected forms instead of just lemmas, you also need to H return the relevant features for each leaf. In TAG, or at least our H use of it, the features come from the *pre-terminal* nodes, that is, @ not the leaves themselves but their parents. Another bit of E trickiness: because of atomic disjunction, leaves might have more  than one value, so we can'+t just return a String lemma but a list of % String, one for each possibility. 3Try in order: lexeme, lexeme attributes, node name ?foot node of the aux tree  aux tree place to adjoin in target tree  target tree .y.y( None)Warnings from the morphological realiser 5Literals which did not receive any lexical selection A single custom warning BA warning that should be repeated for each lexical entry affected  This exists because we want the  instance, providing a C GenI-specific notion of appending which merges instances of the  same error -Sort, treating non-comporable items as equal .A warning may be displayed over several lines 'NoneNone?Given a description of what the root feature should unify with D return a -1 polarity for all relevant polarity keys. This allows ; us to compensate for the root node of any derived tree. *Convert any unconstrained polarities in a  to constrained ; ones, assuming a global list of known constrained keys. BEnsures that all states and transitions in the polarity automaton < are unique. This is a slight optimisation so that we don' t have to B repeatedly check the automaton for state uniqueness during its C construction, but it is essential that this check be done after  construction ;Note that this will crash if any of the entries are errors ;Note that this will crash if any of the entries are errors polarity to assign attribute to look for  feature structure to filter on (  only) $feature structure to get value from on error message None 2position in the input semantics, extra semantics,  polarity interval Aintermediate auts, seed aut, final aut, potentially modified sem EConstructs a polarity automaton. For debugging purposes, it returns I all the intermediate automata produced by the construction algorithm. 'Note: this is not the same function as ()!  The fact that we I preserve the order of the input semantics is important for our handling @ of multi-literal semantics and for semantic frequency sorting. FThe pruning algorithm takes as arguments a list of states to process. CAmong these, any state which does not have outgoing transitions is Iplaced on the blacklist. We remove all transitions to the blacklist and Eall states that only transition to the blacklist, and then we repeat &pruning, with a next batch of states. EFinally, we return the pruned automaton. Note: in order for this to Fwork, it is essential that the final states are *not* included in the list of states to process. KReturns a modified input semantics and lexical selection in which pronouns  are properly accounted for. KBuilds a fake semantic predicate that the index counting mechanism uses to  represent extra columns. . is a useful way to restrict the behaviour of F null semantic items like pronouns using the information generated by E the index counting mechanism. The problem with null semantic items @ is that their indices are not set, which means that they could ? potentially combine with any other tree. To make things more D efficient, we can set the index of these items and thus reduce the " number of spurious combinations. Notes 7 These combinations could produce false results if the J input has to use multiple pronouns. For example, if you wanted to say C something like John promises Mary to convince Paul to give her A his book , these combinations could instead produce give him  *her* book . ? This function works by FS unification on the root node of the  tree with the *[idx:i]$*. If unification is not possible, $ we simply return the tree as is. C This function renames the tree by appending the index to its name 5Given a list of paths (i.e. a list of list of trees) M return a list of trees such that each tree is annotated with the paths it  belongs to. 8Render the list of polarity automaton paths as a string 5A (trivially) packed representation of the singleton ) set containing a single polarity path 'an initial state for polarity automata 3polarities to detect (eg. cat)  root features to compensate for explicit extra polarities input semantics lexical selection . !"#$%&'()*+Z_`ad!daZ_`-NoneHDispatching consists of assigning a chart item to the right part of the G chart (agenda, trash, results list, etc). This is implemented as a K series of filters which can either fail or succeed. If a filter fails, B it may modify the item before passing it on to future filters. IA SentenceAut represents a set of sentences in the form of an automaton. I The labels of the automaton are the words of the sentence. But note! J word  in the sentence is in fact a tuple (lemma, inflectional feature H structures). Normally, the states are defined as integers, with the F only requirement being that each one, naturally enough, is unique. 3 represents the set of inputs a backend could take for the debugger  tag tree  @initialise the machine from the semantics and lexical selection  run a realisation step  ,run all realisations steps until completion %determine if realisation is finished .unpack chart results into a list of sentences Equivalent to 5 unless the input contains an empty or uninstatiated  semantics NPerforms surface realisation from an input semantics and a lexical selection. Statistics tracked  L pol_used_bundles - number of bundled paths through the polarity automaton.  see e > pol_used_paths - number of paths through the final automaton X pol_seed_paths - number of paths through the seed automaton (i.e. with no polarities). X This is normally just 1, unless you have multi-literal semantics O pol_total_states - combined number of states in the all the polarity automata J pol_total_tras - combined number of transitions in all polarity automata R pol_max_states - number of states in the polarity automaton with the most states [ pol_total_tras - number of transitions in the polarity automata with the most transitions = sem_literals - number of literals in the input semantics < lex_trees - total number of lexically selected trees ;assign a bit vector value to each literal in the semantics > the resulting map can then be used to construct a bit vector ! representation of the semantics Default implementation for the   function in   Sequence two dispatch filters. BIf the item meets some condition, use the first filter, otherwise  use the second one. %AThe names of lexically selected chart items used in a derivation 3      !"#$%-      !"#$%-     %"$# !"      !"#$%None empty for global Same as * with the sorting inverted -.these traces must not appear AT THE SAME TIME .the trace must NOT appear /the trace must appear >A positive constraint is violated when a trace is NOT present :A negative constraint is violated when a trace is present >Note that we will not notice if a constraint is violated more < than once. If you want to count multiple violations, you'll D either need to partition the input strings and map this function ) on each sublist or rewrite this code. 9Violations sorted so that the highest ranking constraint  (smallest number) goes first 6Sort the sentences so that the ones with the *lowest* 1 ranking violations (biggest number) go first. 7 Note that we return in groups for the sake of ties. 0Results are grouped so that ties can be noticed Whitespace-sensitive wrapping  Properties:  Only splits at whitespace  Lines at most len( characters long, whitespace permitting 4&'()*+,-./01 lex name traces 23!wrap after these many characters !wrap after these many characters &'()*+,-./0123,/.-)'&(*+1023)&'()*+,/.-0123None4'Inputs that go around a single testcase/input 77Custom morph realiser may define a custom set of flags  that it accepts 90OT constraints (optional, uses global if unset) @Note that this affects the geniFlags; we assume the morph flags  are not our business 456789:new old 456789:456789:456789:None>for gui @expected results (for testing) ;<=>?@A;<=>?@A;<=>?@A;<=>?@ANone 0Should be purely internal type to help parsing.  Injection to Y. We don'9t just use GType directly because the annotations convey  subtle distinctions that aren' t encoded, particularly between  lexemes and anchors >The original string representation of the semantics (for gui) H1Just the String representations of the semantics  in the test suite I.This is only used by the script genimakesuite <The original string representation of a test case semantics  (for gui) N<This makes it possible to read anchored trees, which may be " useful for debugging purposes. EFIXME: note that this is very rudimentary; we do not set id numbers,  parse polarities. You'll have to call @ some of our helper functions if you want that functionality. : recognises a list of parameters optionally followed by a  bang (vBerb$!$) and a list of attribute-value pairs. This whole thing is  to wrapped in the parens. TODO: deprecate 4 associates a numerical value to a polarity symbol,  that is,  or . Like #, but also accepts string literals Like # but allows for reserved words too ?Accepts: identifiers, bare reserved words, and string literals *identifier, permitting reserved words too J BC  D E FGHIJKLM N!O"#$%&'()*+,-.PQ/0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~BCDEFGHIJKLMNOPQGFHIMNLODECJKBPQD BC  D E FGHIJKLM N!O"#$%&'()*+,-.PQ/0None R%The default parameters configuration U?Uses the GetOpt library to process the command line arguments. 9 Note that we divide them into basic and advanced usage. \HPrint out a GenI-style usage message with options divided into sections +Displays the usage text for optimisations. = It shows a table of optimisation codes and their meaning. ?If we do not recognise a code, we output an error message. We 9 also take the liberty of expanding thematic codes like pol - into the respective list of optimisations. #Returns |Left| for any codes we don't recognise, or  |Right| if everything is ok. g,TODO: This is a horrible and abusive use of  =Hint: compose with (map toLower) to make it case-insensitive +Is case-insensitive, error if unknown type l;Update the internal instructions list, test suite and case 6 according to the contents of an instructions file. Basic approach D we always have instructions: if no instructions file, is specified < we infer virtual instructions from the test suite flag H * the testsuite and testcase flags are focusing tools, they pick out $ a subset from the instructions XRSTUVWXYZflag ;string reader for flag (probably |id| if already a String)  description [flag default value string reader (as in reqArg)  description \options  prog name ]^_`abcdefghijklmn     456789:RSTUVWXYZ[\]^_`abcdefghijklmnSTiR_]^\VWlU`fkahjdebcXYZ[gmnORSTUVWXYZ[\]^_`abcdefghijklmnNoneoDConverts information from a morphological information file into GenI's  internal format. pGFilters away from an input semantics any literals whose realisation is K strictly morphological. The first argument tells us helps identify the N morphological literals -- it associates literals with morphological stuff;  if it returns D, then it is non-morphological qq morphfn sem cands$ does the bulk of the morphological  input processing. We use morphfn to determine which literals in  semF contain morphological information and what information they contain. J Then we attach this morphological information to the relevant trees in  cand:. A tree is considered relevant w.r.t to a morphological L literal if its semantics contains at least one literal whose first index @ is the same as the first index of the morphological literal. ?Actually unify the morphological features into the anchor node  FIXME: we'2ll need to make sure this still works as promised ! when we implement co-anchors. rsetMorphAnchor n t) replaces the anchor node of a tree with n AWe assume the tree has exactly one anchor node. If it has none, B this explodes; if it has more than one, they all get replaced. sHExtracts the lemmas from a list of uninflected sentences. This is used 9 when the morphological generator is unavailable, doesn' t work, etc. tHConverts a list of uninflected sentences into inflected ones by calling opqrst=>?@ABCDEFGopqrstopqrts opqrstNone#yThe y2 monad supports warnings during lexical selection  and also failure via Maybe z,The result of the lexical selection process |@the main result: a set of elementary trees (ie. anchored trees) }Aif available, lexical entries that were used to produce anchored 4 trees (useful for identifying anchoring failure) ~ HINT: use *+ to initialise to empty See ,' if you want to use GenI with a custom  lexical selection function. <This aims to support users who want to do lexical selection @ directly from an input other than GenI style flat semantics. 9The requirement here is for you to provide some means of 7 converting the custom semantics to a GenI semantics 8Conversion from custom semantics to GenI semantic input Lexical selection function 9List of named inputs intended to act as a substitute for  test suites  (0 argument is for reporting error messages only) 9Performs standard GenI lexical selection as described in   >http://projects.haskell.org/GenI/manual/lexical-selection.html  This is just  lifted into IO  Helper for  6 (Standard GenI lexical selection is actually pure)  This is just       missingLexEntries ts lexs' returns any of the lexical candidates  lexs0 that were apparently not anchored succesfully. ?TODO: it does this by (wrongly) checking for each lexical item * to see if any of the anchored trees in ts have identical D semantics to that lexical item. The better way to do this would E be to throw a subsumption check on top of items reported missing,  because it'2s possible for the trees to add semantics through  unification. GSelect and returns the set of entries from the lexicon whose semantics ! subsumes the input semantics.  sem l$ attempts to unify the semantics of l with sem I If this succeeds, we use return the result(s); if it fails, we reject  l# as a lexical selection candidate. ( is a factorisation technique that uses B atomic disjunction to merge all synonyms into a single lexical @ entry. Two lexical entries are considered synonyms if their = semantics match and they point to the same tree families. <FIXME: 2006-10-11 - note that this is no longer being used, > because it breaks the case where two lexical entries differ 2 only by their use of path equations. Perhaps it' s worthwhile = just to add a check that the path equations match exactly. Note an anchoring error !defaultAnchoring schemata lex sem' implements the later half of lexical @ selection (tree anchoring and enrichement). It assumes that lex consists P just of the lexical items that have been selected, and tries to combine them  with the tree schemata. OThis function may be useful if you are implementing your own lexical selection 6 functions, and you want GenI to take over after you've given it a  [LexEntry] DGiven a lexical item, looks up the tree families for that item, and ! anchor the item to the trees. HCombine a single tree with its lexical item to form a bonafide TagElem. G This process can fail, however, because of filtering or enrichement See  9http://kowey.github.io/GenI/manual/lexical-selection.html  on enrichement  Helper for " (enrich by single path equation)  Helper for  enrichFeat av fs attempts to unify av with fs Note here that fs is an Flist [GeniVal] rather than the usual   Flist GeniVal0 you may expect. This is because it comes from  z) which allows non-atomic disjunctions of GeniVal E which have to be flatten down to at most atomic disjunctions once " lexical selection is complete. missingCoanchors l t. returns the list of coanchor node names from l  that were not found in t Split a lex entry'6s path equations into interface enrichement equations  or (co-)anchor modifiers seekCoanchor lhs t returns  Just node if t contains exactly one " node that can be identified by lhs, Nothing if it contains none. DIt crashes if there is more than one such node, because this should % have been caught earlier by GenI. matchNodeName lhs n is True if the lhs refers to the node n matchNodeNameHelper/ recognises anchor  by convention; otherwise,  it does a name match (The lemanchor mechanism is described in   4http://projects.haskell.org/manual/lexical-selection @The name of the lemanchor attribute (by convention; see source)  setOrigin n t marks the nodes in t as having come from  a tree named n Standard post-processing/$filtering steps that can take place > after lexical selection. Right now, this only consists of  paraphrase selection BRule out lexical selection results that violate trace constraints 5 if the tree fulfills the supplied trace constraints ,uvwxyz{|}~any warnings, plus the results ,uvwxyz{|}~,z{|}~yuxwvuxwvyz{|}~None) original  uninflected result results after morphology $warnings local  to this particular  item, cf.  "derivation tree behind the result normally a chart item id the lexical selection behind  this result (info only) see - #which OT constraints were violated = is the outcome of running GenI on a single input semantics. 0 Each distinct result is returned as a single  (NB: a single A result may expand into multiple strings through morphological  post-processing), one per chart item usually from lexical selection "things like number of chart items  to help study efficiency DThe file loading functions all work the same way: we load the file, & and try to parse it. If this doesn' t work, we just fail in IO, and G GenI dies. If we succeed, we update the program state passed in as  an IORef. FThe program state consists of its configuration options and abstract, 0 cleaned up representations of all the data it's had to load into memory H (tree schemata files, lexicon files, etc). The intention is for the I state to stay static until the next time something triggers some file  loading. the current configuration tree schemata lexical entries "function to extract morphological ) information from the semantics (you may  instead be looking for  .) simplified traces (optional) >The program state when you start GenI for the very first time IWe have one master function that loads all the files GenI is expected to K use. This just calls the sub-loaders below, some of which are exported L for use by the graphical interface. The master function also makes sure H to complain intelligently if some of the required files are missing. BNote that here we assume the input consists of UTF-8 encoded file 5Returns the input too (convenient for type checking) ;Load something, exiting GenI if we have not been given the  appropriate flag 0Load something from a string rather than a file :The macros are stored as a hashing function in the monad. 7Load something, but only if we are configured to do so 5Entry point! (the most useful function to know here) C Initialises the realiser (lexical selection, among other things), : Runs the builder (the surface realisation engine proper)  Unpacks the builder results 2 Finalises the results (morphological generation) KIn addition to the results, this returns a generator state. The latter is ? is mostly useful for debugging via the graphical interface. I Note that we assumes that you have already loaded in your grammar and  parsed your input semantics. simplifyResults  $ runGenI...' for an easier time if you don' t need the  surface realiser state This is a helper to runGenI. It'$s mainly useful if you are building % interactive GenI debugging tools. Given a builder state,  Unpacks the builder results 2 Finalises the results (morphological generation) > performs lexical selection and strips the input semantics of  any morpohological literals See  : does any post-processing steps that we want to integrate O into mainline GenI. So far, this consists of morphological realisation and  OT ranking KShow the sentences produced by the generator, in a relatively compact form 6No morphology! Pretend the lemma string is a sentence 2 is most likely useful for grammars produced by a ; metagrammar system. Given a tree name, we retrieve the `trace' G information from the grammar for all trees that have this name. We I assume the tree name was constructed by GenI; see the source code for  details. &We assume the name was constructed by  combineName ?Runs the lexical selection (be it the standard GenI version or > a custom function supplied by a user) and runs the results  through the universal . 'Also hunts for some warning conditions 8Standard GenI semantics and lexical selection algorithm  (with optional  preanchored mode) missingLiterals ts sem returns any literals in sem that do not  appear in any of the ts trees 9Post-processes lexical selection results to things which 3 GenI considers universal. No matter what custom ; lexical selection mechanism you supply, these preflight  checks will run. - attaches morphological information to trees : filters out any elementary tree whose semantics contains 0 things that are not in the input semantics @Note that this affects the geniFlags; we assume the morph flags  are not our business y   source (optional)  flag  description string to load flag  flag  null action job flag flag verbose  file to load  description summary  parsing cmd test-case-specific parameters test-case-specific parameters handler for custom semantics  semantics  !"#$%&'()*+,-./0?F?FQ       !"#$%&'()*+,-./0None7Things whose only use is within the graphical debugger nodes to highlight 1 if there are things wrong with this item, what? actually a set 1.guided realisation: polarity paths to explore 2guided realisation 3last-in-first-out 46True if the chart item has no open substitution nodes 5,True if the chart item is an auxiliary tree 6 True if both 4 and 5 are True !Creates an initial SimpleStatus. 7%Initial paths for guided realisation 8#Mark these nodes as non-adjunction 9?Arbitrarily selects and removes an element from the agenda and  returns it. :,Last-in-first-out selection from the agenda ;(Guided realisation variant on selection <8Note: returns ONE possible substitution (the head node) B of the first in the second. As all substitutions nodes should 2 be substituted we force substitution in order. = Ignore the next adjunction node > Ignore the next adjunction node  Ignore the next adjunction node ?/Trash an item, marking it as failing due to top/bot unification  error (and on what node) @=Given a tree, identify nodes that cannot take adjunction and A do top-bottom unification on them. Hopefully this will allow : us to detect top-bottom unification failures early on. 9Note: no need to propagate substitutions outside of this = because items are assumed to be self-contained. This sort @ of thing (what is self-contained) should really be reflected  in the types. A]Retrieves a list of trees from the chart which could be combined with the given agenda tree. 5 The current implementation searches for trees which 5 * do not have overlapping semantics with the given @ * are on the some of the same polarity automaton paths as the  current agenda item B3Helper function for when chart operations succeed. C"Mark this nodes as non-adjunction D.This is only used for the one-phase algorithm EAIf the item (ostensibly a result) does not have the correct root 8 category, return Nothing; otherwise return Just item FGHIJKL1MNOPQ23RSTUVWXYZ[\]^456_`use two phase algorithm  input items  GenI options 7a disable gui 8bcdefghi9:;jklmn<opqrs=>? failure msg tu@ aux trees me vAwBnodes to highlight xC node name new top feature yz{|}~DE*1eFGH  IJKL1MONPQ32RSTUVWXYZ[\]^456_`7a8bcdefghi9:;jklmn<opqrs=>?tu@vAwBxCyz{|}~DENoneIRun GenI without reading any test suites, just grab semantics from stdin (Run a test case with the specified name 3Runs the tests specified in our instructions list. 6 We assume that the grammar and lexicon are already " loaded into the monadic state. H If batch processing is enabled, save the results to the batch output M directory with one subdirectory per suite and per case within that suite.  =Return the batch directory or a temporary directory if unset  FUsed in processing instructions files. Each instruction consists of a ; suite file and a list of test case names from that file See  9http://projects.haskell.org/GenI/manual/command-line.html for F how testsuite, testcase, and instructions are expected to interact .(Exported for use by regression testing code) FRuns a case in the test suite. If the user does not specify any test F cases, we run the first one. If the user specifies a non-existing  test case we raise an error. ENot just the global warnings but the ones local to each response too GTODO: If somebody puts together a render function that emits Data.Text # we should just use that instead    seconds   raw text representation                 None! Safe-Inferred/01/*23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                               ! " # $ % & ' ( ) * + , - ./0123456789:;<=>?@ABCDEFFGHIIJKLMNOOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~)      !"#$%&''()*+,-./001234566789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrsttuvwxyyz{|}~.    !!!!!!!    " """"""""""/ !"#$/%&/'(/)*+,-./ 0 1 2 3 4/56 7 8 9 : ; < = > ? @ A B C D E F G H I J  K L M N O P Q R S/)TUVW X Y Z [ \ ] ^ I  _ ` a b c defghijklmnoIpqrstuvwxyz{|}I~I/*/%%w//N     FE !"#$%&'()(D(*(+(,(-(.(/(0(1(2(3(4(5(6(7(8(9(:(;(<(=>?@A@B@C@D@E@F@G@HIJIKILIMINIOIPIQIRISITIUIVIWIXIYIZI[I\I]I^I_I`>a@b@c@d@eIfIfIgIhIiIjIkIlIImInIoIpIqIqIrIsItIuIvIwIxIyIzI{I|I}I~IIIIIII#///////////////      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijLklmnopqrstu GenI-0.24.3NLP.GenI.ConfigurationNLP.GenI.PrettyNLP.GenI.StatisticsNLP.GenI.ErrorIONLP.GenI.GeniShowNLP.GenI.Polarity.TypesNLP.GenI.GeneralNLP.GenI.AutomatonData.FullList.InternalNLP.GenI.GeniVal.InternalNLP.GenI.FeatureStructure NLP.GenI.FlagNLP.GenI.SemanticsNLP.GenI.LexicalSelection.TypesNLP.GenI.Morphology.TypesNLP.GenI.Lexicon.InternalNLP.GenI.TreeSchema NLP.GenI.TagNLP.GenI.Warning.InternalNLP.GenI.Polarity.InternalNLP.GenI.PolarityNLP.GenI.BuilderNLP.GenI.OptimalityTheoryNLP.GenI.ControlNLP.GenI.TestSuiteNLP.GenI.ParserNLP.GenI.MorphologyNLP.GenI.LexicalSelectionNLP.GenINLP.GenI.Simple.SimpleBuilderNLP.GenI.Console NLP.GenI.MainBoolExp Paths_GenIParser Data.FullListNLP.GenI.GeniValNLP.GenI.LexiconNLP.GenI.Warning NLP.GenI.TagsmapBySem Data.Monoidmempty ConfigurationOptimalityTheory customMorphbaseData.Typeable.InternalTypeable<>Metric IntMetricStatisticsState Statistics updateMetrics queryMetrics emptyStatsinitialStatisticsStateFor addMetricshowFinalStats incrIntMetricqueryIntMetricErrorIO liftEitherPrettypretty prettyStrbetweenparenssquares<+>abovesqueezed prettyCountGeniShowgeniShow geniShowText geniShowTree geniKeyword PolarityAttrRestrictedPolarityAttr_rpkCatrpkAttSimplePolarityAttrspkAttSemPols PolarityKeyPolarityKeyVarPolarityKeyStr PolarityKeyAvreadPolarityAttrsshowPolarityAttrs BitVectorIntervalePutStr ePutStrLneFlushisGeniIdentLettertrimdropTillIncluding toUpperHead toLowerHead quoteStringmaybeQuoteText quoteTextclumpBy toAlphaNumfirst3second3third3fst3snd3thd3map'isEmptyIntersect groupByFMinsertToListMap histogrambuckets combinations mapMaybeMrepListmapTree' filterTree treeLeaves preTerminalsrepNode repAllNode listRepNode repNodeByNodegeniBugprettyException mkLogname!+!ival showInterval showBitVectorNFAstartSt isFinalSt finalStList transitionsstatesfinalSt lookupTransaddTransautomatonPathsautomatonPathSets numStatesnumTransitionsListable!:FullListfromFLindeedFLheadtail++sortNubDescendGeniValdescendGeniVal SchemaValIdableidOf Collectablecollect CollectedVarUnificationResultFailure SuccessRep2 SuccessRep SuccessSans MonadUnifySubstGeniValgLabel gConstraintsmkGConst mkGConstNonemkGVar mkGVarNonemkGAnon singletonValisAnon prettySubstunify allSubsume unifyHelper appendSubstprependToSubstunifyOneintersectConstraints subsumeOnereplace replaceOne replaceList replaceMapG replaceOneGanonymiseSingletonsfinaliseVarsById finaliseVarscrushOne crushList FeatStructAvPairavAttavValFlistemptyFeatStruct mkFeatStructfromFeatStruct sortFlist unifyFeat alignFeat alignFeatH crushAvPair crushFlistWeirdFlgGrammarTypeFlg BuilderFlg ViewCmdFlg VersionFlgVerboseModeFlg TimeoutFlg TestSuiteFlgTestInstructionsFlg TestCaseFlg StatsFileFlgNoLoadTestSuiteFlgRootFeatureFlgRankingConstraintsFlg PartialFlg OutputFileFlgOptimisationsFlg MorphInfoFlg MorphCmdFlg MetricsFlg MaxResultsFlg MaxStepsFlg TracesFlg MacrosFlg LexiconFlgInstructionsFileFlgHelpFlg FromStdinFlg EarlyDeathFlgDumpDerivationFlgDetectPolaritiesFlg DisableGuiFlg BatchDirFlgHasFlagsflagsonFlagsFlag GrammarType PreAnchored PreCompiledGeniHand BuilderTypeSimpleOnePhaseBuilder SimpleBuilder Instruction OptimisationGuided NoConstraints PolarisedAdjOptsPolOptsdefaultGrammarTypegetGrammarTypehasOptisFlaghasFlag deleteFlag modifyFlagsetFlaggetFlag getAllFlags getListFlag updateFlags HasConstants constantsSemInput LitConstrSemLiterallHandle lPredicatelArgs emptyLiteralremoveConstraintssortSemcompareOnLiteralsortByAmbiguitydisplaySemInputisInternalHandle subsumeSem subsumeSemHsubsumeLiteralunifySem unifySemH unifyLiteralLexCombineError2 StringError EnrichErrorLexCombineError SchemaErrorFamilyNotFoundError BoringError PathEqPair TopBottomBottomTop NodePathEqLhsPeqLexPeqFeat PathEqLhs PeqUnknownPeqJust PeqInterface parsePathEq showPathEqLhsshowLexCombineErrorcompressLexCombineErrorsLemmaPlusSentence LemmaPluslpLemmalpFeats MorphOutput moWarningsmoRealisations MorphRealiser MorphInputFnPolValueLexEntryiwordifamnameiparams iinterfaceifilters iequations isemanticsisempolsLexicon mkLexEntrymkFullLexEntry fromLexSemfromLexLiteralNodeNameGTypeOtherLexFootSubsGNodeGNgnnamegupgdownganchorglexemegtypegaconstrgoriginAdjunctionConstraint InferredNoAdj ExplicitNoAdjMaybeAdjPtypeAuxiliarInitialTtreeTTparamspfamilypidname pinterfaceptype psemanticsptracetreeMacros SchemaTreerootrootUpdfoot setAnchor setLexemeisAdjConstrainedaddInferredAdjConstraintgnnameIs gCategorylexemeAttributes showLexemecrushTreeGNode crushGNodeTagItemtgIdNametgIdNum tgSemanticstgTreeDerivationStepInitStepAdjunctionStepSubstitutionStep TagDerivationTagElemTEidname ttreenametidnumttypettree tsemantics tpolarities tinterfacettracetsempolsTagSitetsNametsUptsDowntsOriginTags addToTags detectSites toTagSitedsChilddsParent dsParentSiteplugTree spliceTree setTidnums tagLeaves getLexemets_synIncompletets_tbUnificationFailurets_rootFeatureMismatchts_semIncompleteWordFamilyCount LexWarningMissingCoanchorsLexCombineOneSchemaFailedLexCombineAllSchemataFailed GeniWarning MorphWarningNoLexSelectionCustomLexWarning GeniWarningsfromGeniWarningsmkGeniWarningsposort sortWarnings appendWarning mergeWarningshowGeniWarning toWfCountPolMapSemMapPolarityDetectionResultPD_UnconstrainedPD_Just PD_Nothing PD_UserErrordetectRootCompensation detectPolsHdetectPolaritytoZero substNodes substTops polarityKeysconvertUnconstrainedPolaritiesaddPolsnubAut__cat____idx__ pdResultspdToListPolAutPolStatePolSt PolPathSetAutDebug PolResultprIntermediate prInitialprFinalprSembuildAutomaton makePolAut fixPronounsdetectIdxConstraintsdeclareIdxConstraintssuggestPolFeatures detectSansIdx detectPolsdetectPolPaths emptyPolPaths polPathsNullpolPathsToList unionPolPathsintersectPolPathshasSharedPolPathsprettyPolPathssingletonPolPath FilterStatus NotFilteredFilteredDispatchFilter SemBitMap BuilderStateUninflectedDisjunction SentenceAutInput inSemInputinLexinCandsOutputBuilderinitstepstepAllfinishedunpackpartial GenStatusErrorActiveFinishedpreInitunlessEmptySemrundefineSemanticBitssemToBitVectorbitVectorToSemdefaultStepAll>--> condFilter incrCounter queryCounter initStatsdefaultMetricNamesnum_iterations chart_sizenum_comparisonslexicalSelectionOtResult GetTraces OtViolation OtRankingRankedOtConstraint OtConstraint NegativeConjC NegativeC PositiveC otWarnings rankResultsprettyViolations prettyRankParams builderType morphFlags geniFlagsranking updateParamsTestCasetcName tcSemStringtcSem tcExpectedtcParamsgeniLanguageDef geniValue geniFeats geniSemanticsgeniSemanticInput geniTestSuitegeniTestSuiteStringgeniDerivations geniWordsgeniWord geniLexicon geniMacros geniTagElems geniMorphInfotillEof parseFromFile emptyParamsgetBuilderType getRankingoptionsForStandardGenI basicSectionsoptionsSections nubBySwitchesnoArgreqArgoptArgusage treatArgstreatArgsWithParams defineParamsoptionsForBasicStuffoptionsForInputFiles macrosOption lexiconOption helpOption verboseOptionoptionsForOptimisationparseFlagWithParsecoptionsForBuildermainBuilderTypesoptionsForTestingoptionsForMorphologyprocessInstructionsreadGlobalConfig setLoggers readMorph stripMorphSem attachMorphsetMorphAnchor sansMorphinflectSentencesUsingCmdEnrichmentResult EnrFailed EnrNotFound EnrSuccess LexCombineLexicalSelection lsAnchored lsLexEntries lsWarningsLexicalSelector CustomSemfromCustomSemInputcustomSelectorcustomSemParsercustomSuiteParsercustomRenderSemdefaultLexicalSelectordefaultLexicalSelectionmissingLexEntriesdefaultLexicalChoice chooseCandI mergeSynonyms runLexCombinelexTelldefaultAnchoring combineList combineOneenrichenrichBy maybeEnrichBy enrichFeatmissingCoanchors lexEquations seekCoanchor matchNodeNamematchNodeNameHelper setLemAnchors _lemanchor setOrigindefaultPostProcessingpreselectParaphrasesrespectsConstraints ResultType PartialResultCompleteResult GeniLexSelnlTreenlTrace GeniSuccessgrLemmaSentencegrRealisations grResultType grWarnings grDerivationgrOrigingrLexSelection grRanking grViolations GeniError GeniResultGSuccessGError GeniResults grResultsgrGlobalWarnings grStatisticsBadInputExceptionLoadablelParselSet lSummarise ProgStateRef ProgStatepagrlemorphinftracesemptyProgStateloadEverythingloadFromString loadLexiconloadGeniMacros loadRanking loadTestSuite parseSemInput isSuccessrunGenisimplifyResultsextractResultsinitGenishowRealisationslemmaSentenceString prettyResult getTracesdefaultCustomSem SimpleGuiItem siHighlight siDiagnostic siFullSemsiIdname SimpleItemsiId siSubstnodes siAdjnodes siSemantics siPolpathssiNodes siDerivedsiRoot_siFoot_ siPendingTb siDerivation siGuiStuff SimpleStatus theAgenda theHoldingPentheCharttheTrash theResults genconfig SimpleStateChart AuxAgendaAgendasimpleBuilder_2psimpleBuilder_1p simpleBuilder addToAgenda addToCharttestEmptySimpleGuiIteminitSimpleBuildertestIapplyAdjNode testCanAdjoin unpackResultRunAs PartOfSuite Standalone consoleGeni getBatchDir loadNextSuite writeResultsmain mainWithState forceGuiFlagNotOrAndCondcheckStatmetrics metricToJSON jsonToMetric$fNFDataMetric$fNFDataStatistics$fJSONStatistics $fShowMetriccatchIOversionbindirlibdirdatadir libexecdir getBinDir getLibDir getDataDir getLibexecDirgetDataFileName $fErrorTextGHC.ShowShow$fPrettyInteger $fPrettyInt $fPrettyText $fPretty[]$fGeniShowTree$fNFDataPolarityAttr$fNFDataPolarityKey$fShowPolarityAttr$fPrettyPolarityKeyAlphaNumGHC.Basemap Data.ListgroupByGHC.ListfilterNA $fJSONText $fOrdAlphaNum $fBinaryText$fBinaryFullList$fNFDataFullList$fListableFullList $fListable[]$fFunctorFullList Data.MaybeNothing$fBinarySchemaVal$fBinaryGeniVal$fNFDataSchemaVal$fNFDataGeniVal$fDescendGeniValf$fDescendGeniValGeniVal$fGeniShowSchemaVal$fDescendGeniValSchemaVal$fCollectableSchemaVal$fCollectableGeniVal$fCollectable[]$fCollectableMaybe$fMonadUnifyEither$fGeniShowGeniVal$fPrettyGeniVal$fNFDataAvPair$fBinaryAvPair$fGeniShowAvPair $fGeniShow[]$fPrettyAvPair$fCollectableAvPair$fDescendGeniVal(,)$fDescendGeniVal(,)0$fDescendGeniValAvPair $fGeniShowMap $fPrettyMap$fEqFlag $fHasFlags[]$fShowBuilderTypeelem text-0.11.2.3Data.Text.InternalText$fBinaryLiteral$fNFDataLiteral $fGeniShow(,)$fGeniShow(,,) $fPretty(,,)$fGeniShowLiteral$fPrettyLiteral$fDescendGeniValLiteral$fHasConstantsLiteral$fHasConstants[]$fHasConstantsGeniVal$fCollectableLiteral $fOrdLiteral$fPrettyLexCombineError2$fPrettyLexCombineError $fPosetText$fPosetPathEqLhs$fPosetLexCombineError2$fPosetLexCombineError$fNFDataLemmaPlus$fNFDataMorphOutput$fNFDataLexEntry$fBinaryLexEntry$fPrettyLexEntry$fGeniShowLexEntry$fCollectableLexEntry$fDescendGeniValLexEntry $fNFDataGNode $fPrettyGNode $fNFDataPtype $fNFDataGType $fBinaryTtree$fNFDataAdjunctionConstraint$fBinaryAdjunctionConstraint $fBinaryGType $fBinaryGNode $fBinaryPtype$fGeniShowGNode$fGeniShowTtree$fGeniShowPtype$fDescendGeniValGNode$fCollectableGNode$fCollectableTree$fDescendGeniValMap$fCollectableTtree$fDescendGeniValTtreedsOpnmatch findSubTree firstMaybe$fNFDataDerivationStep$fNFDataTagElem$fGeniShowTagElem$fTagItemTagElem$fIdableTagElem$fCollectableTagElem$fDescendGeniValTagSite$fDescendGeniValTagElem $fOrdTagElem$fJSONDerivationStepMonoid$fPosetLexWarning$fPosetGeniWarning$fMonoidGeniWarnings buildColumnsprune indexLiteral assignIndexpolstart PolTransFnPolTrans PolPathMap SemWeightMapPredLite buildSeedAut buildSeedAut'buildSeedAutHelper buildPolAut buildPolAut'buildPolAutHelperprune' isExtraColidxConstraintKey sortSemByFreq fakestate $fOrdPolState$fShowPolStateid modifyStats namedMetricgen_time $fNFDataInput$fPrettyGenStatus#$fCollectableUninflectedDisjunction&$fDescendGeniValUninflectedDisjunction otLexNameRankedOtConstraint2 posViolations negViolationssortedViolations sortResultssortAndGroupByDecorationwordWrapLexItemlLexnamelTracesotConstraintViolated violations lexTraces toLexItemrankedOtConstraintToPairs neverViolatednonExistentTracescTraces concatRanknoRankindentedspaces splitAtBefore$fNFDataOtConstraint$fNFDataRankedOtConstraint$fNFDataOtViolation$fPrettyOtConstraint$fPrettyRankedOtConstraint$fJSONOtViolation$fJSONRankedOtConstraint$fJSONOtConstraint$fOrdRankedOtConstraint2$fOrdRankedOtConstraint$fHasFlagsParams$fPrettyTestCase$fGeniShowTestCase AnnotationgeniSemanticInputStringgeniTestCaseString geniParams geniPolarityGHC.Num+-flexiIdentifier identifierlooseIdentifierlooseFlexiIdentifier identifierR AnnoDefaultAnnoFoot AnnoSubst AnnoLexeme AnnoAnchorTestCaseOutput GeniValLike geniValueLikegeniAtomicDisjunctiongeniFancyDisjunction geniAttVal geniLiteral geniLiteral_geniIdxConstraints squaresString geniTestCase geniOutput geniTraces withWhite geniSentencegeniLexicalEntrygeniLexSemanticsgeniLexLiteral geniPolValueinitTypeauxType geniTreeDefgeniTreegeniNodefromAnnotationgeniNodeAnnotation geniTagElem morphEntrykeywordkeywordSemanticslexer whiteSpacecolon stringLiteralbracesreservedsymboldecode$fGeniValLikeSchemaVal$fGeniValLikeGeniVal parsec-3.1.3Text.Parsec.CharalphaNumanyCharchardigithexDigitletterlowernewlinenoneOfoctDigitoneOfsatisfyspacestringtabupperText.Parsec.CombinatoranyTokenchainlchainl1chainrchainr1choicecountendByendBy1eofmany1manyTill notFollowedByoption optionMaybeoptionalsepBysepBy1sepEndBy sepEndBy1 skipMany1Text.Parsec.ErrorerrorPosText.Parsec.PosincSourceColumn incSourceLinesetSourceColumn setSourceLine setSourceName sourceColumn sourceLine sourceNameText.Parsec.Prim<|>getInputgetParserState getPositiongetStatelabellabels lookAheadmanyparse parseTestsetInputsetParserState setPositionsetStateskipManytoken tokenPrim tokenPrimExtokens unexpected updateState ParseErrorColumnLine SourceName SourcePosState stateInputstatePos stateUserunconsStreamOkReplyParsecTParsecEmptyConsumedupdateParserState unknownErrortrysysUnExpectError runParserT runParser runParsecTrunPTrunPputState parserZero parserReturn parserPlus parserFail parserBind parsecMap modifyStatemkPTmergeErrorReply manyAccumText.Parsec.Text GenParserusageForOptimisationsreadOptimisationsparseOptimisationsGHC.ErrerrormReadBuilderTypereadBuilderTypeLogFmt LogFmtSimple LogFmtNullLogToLogToErr LogToFile LoggerConfiglcName lcPriority lcHandler lcFormatter OptSectiondefaultBuilderType emptyFlags getSwitches usageSectioninstructionsOption tracesOption rankingOptionoptionsForOutput partialOption outputOptionoptionsForUserInterface noguiOption versionOptiondefaultPolarityAttrsexampleRootFeatdefaultRootFeatrootFeatureOptioncoreOptimisationCodesoptimisationCodespolOptsadjOpts lookupOpt showOptCode describeOptlookupOptimisationfromStdinOptiontestSuiteOptionmaxResultsOptionmaxStepsOptionmorphInfoOptioninstructionsFilelogDefaultConfigsetGeniHandlerreadsQuotedStringPrec loggerConfig singleton maybeRead dropPrefix$fIsStringYamlLight $fReadLogFmt $fReadLogToSystem.Console.GetOptgetOpt'getOpt usageInfo RequireOrderPermute ReturnInOrderArgOrderOptionOptDescrNoArgReqArgOptArgArgDescrattachMorphHelperMNAME parsecToJSONlogname$fJSONLemmaPlus$fJSONMorphOutputGHC.IOFilePathghc-prim GHC.TypesTruelParseFromFile lSetState loadOrDie loadOptionalfinaliseResults readPidnamerunLexSelectionfinaliseLexSelectionmissingLiterals$fHasFlagsProgState PreAnchoredL TestSuiteLfromTestSuiteLTracesLMorphFnLLthrowOnParseError loadMorphInfo loadTraces fromParsecresultToEither2withFlagwithFlagOrIgnore withFlagOrDiewithLoadStatusparseFromFileMaybeBinarymkDefaultCustomSemreadPreAnchoredmkPreAnchoredLexicalSelector readFileUtf8 verbosity picosToMillis$fNFDataGeniLexSel$fNFDataResultType$fNFDataGeniError$fNFDataGeniSuccess$fNFDataGeniResult$fJSONGeniLexSel$fJSONResultType$fJSONGeniError$fJSONGeniSuccess$fJSONGeniResult$fJSONGeniResults$fLoadablePreAnchoredL$fPrettyGeniError$fLoadableTestSuiteL $fLoadable[]$fLoadableTracesL$fLoadableMorphFnL $fLoadable[]0 $fLoadable[]1$fExceptionBadInputExceptiongrPaths GrLifoAgenda LifoAgendaclosedaux closedAux initGrPathsmarkNonAdjunctionSites selectGiven selectLifo selectGuided iapplySubstsansAdjunction1psansAdjunction2ptrashTbUnificationErrordetectNa lookupChartcombineSimpleItems constrainAdj dpTbFailuredpRootFeatFailureTbEitherSimpleDispatchFilterChartIdStsem gencounter semBitMapGenerationPhaseAdjunctionPhaseSubstitutionPhaseTrashAgendaStrategyagendaStrategyisAdjunctionPhase assignNewId updateAgendaaddToAuxAgenda addToTrash addToResults lookupOrBugsiRootsiFootemptySimpleGuiItemmodifyGuiStuffadjdone siInitialinitSimpleIteminitSimpleGuiItemrenameNodesWithTidnumgenerateStep_1pgenerateStep_2pgenerateStep_2p_subgenerateStep_2p_adjtrashIt missingSem switchToAux semfilterapplySubstitutionapplySubstitution1papplyAdjunction2ppassiveAdjunction1pactiveAdjunction1pvalidAuxtryAdj iapplyAdjNode canAdjoinisRootOffilterCompatiblecombineSimpleGuiItemsaddToDerivationsimpleDispatch_2psimpleDispatch_2p_adjphasesimpleDispatch_1psimpleDispatch dpToAgenda dpToResults dpToTrashdpAux dpTbNaFailuretbUnifyNaNodes tbUnifyTree tbUnifyNode unpackResultsemptyFeatureStrlistToSentenceAutpartialResultscoverage countBits$fDescendGeniValSimpleItemrunStdinTestCaserunSpecificTestCaserunInstructions runOnSemInput allWarningsppJSONwithGeniTimeOutrunAsStandalone writeFileUtf8 putStrLnUtf8