packages feed

FM-SBLEX (empty) → 3.0

raw patch · 90 files changed

+24252/−0 lines, 90 filesdep +arraydep +basedep +containerssetup-changed

Dependencies added: array, base, containers, haskell98

Files

+ FM-SBLEX.cabal view
@@ -0,0 +1,178 @@+Name: FM-SBLEX+Version: 3.0+cabal-version: >= 1.2+build-type: Simple+category: Natural Language Processing+Copyright: Lars Borin, Markus Forsberg, Aarne Ranta, Free software under GNU General Public License (GPL).+License: GPL+License-File: LICENSE+Maintainer: Lars Borin <lars.borin@gu.se>, Markus Forsberg <markus.forsberg@gu.se>, Aarne Ranta <aarne@chalmers.se>+Homepage: http://spraakbanken.gu.se/eng/research/swefn/fm-sblex+Synopsis: A set of computational morphology tools for Swedish diachronic lexicons. +Description: A set of computational morphology tools for Swedish diachronic lexicons. Retrieve up-to-date dictionaries from the homepage.+Extra-source-files: src/lib/trie_lib.h++Executable saldo+  Build-Depends: haskell98, base>=4 && <5, containers, array+  Main-is: Main.hs+  Extensions: ForeignFunctionInterface+  HS-source-dirs: src/lib src/saldo src/lib/Dict+  C-sources: src/lib/rts.c,  src/lib/trie_lib.c+  Includes: src/lib/trie_lib.h+  Other-modules:+    Combine,+    CTrie,           +    Frontend,+    Net,+    Tokenize,  +    Command,     +    Dictionary,+    General,    +    Options,       +    Trie,+    CommonMain,  +    DictToDictionary,+    GeneralIO,+    Print,+    UTF8,  +    Compound,  +    EditDistance,  +    Invariant,  +    SharedString,  +    Util,+    -- Dict +    Dict.Abs,  +    Dict.ErrM,  +    Dict.GetDict,+    Dict.Lex,  +    Dict.Par,  +    Dict.Print,  +    Dict.Skel, +    -- saldo+    AdjBuildSw,+    DictSw,  +    NounBuildSw,  +    PrintSw,  +    VerbBuildSw,  +    AdjRulesSw,  +    EncodeSw,  +    NounRulesSw,  +    RulesSw,  +    VerbRulesSw,  +    Attr,  +    GenRulesSw,  +    OtherBuildSw,  +    TestGenSw,  +    BuildSw,  +    Main,  +    OtherParadigms,+    TestSw,+    CommandsSw,+    Multiwords,+    OtherRulesSw,+    TypesSw++Executable dalin+  Build-Depends: haskell98, base>=4 && <5, containers, array+  Main-is: Main.hs+  Extensions: ForeignFunctionInterface+  HS-source-dirs: src/lib src/dalin src/lib/Dict+  C-sources: src/lib/rts.c,  src/lib/trie_lib.c+  Includes: src/lib/trie_lib.h+  Other-modules:+    Combine,     +    CTrie,             +    Frontend,   +    Net,           +    Tokenize,+    Command,     +    Dictionary,        +    General,    +    Options,       +    Trie,+    CommonMain,  +    DictToDictionary,  +    GeneralIO,  +    Print,         +    UTF8,+    Compound,    +    EditDistance,      +    Invariant,  +    SharedString,  +    Util,+    -- Dict  +    Dict.Abs,  +    Dict.ErrM,  +    Dict.GetDict,+    Dict.Lex,  +    Dict.Par,  +    Dict.Print,  +    Dict.Skel, +    -- dalin+    AdjBuildSw,+    AdjRulesSw,+    Attr,+    BuildSw,+    CommandsSw,+    DictSw,+    EncodeSw,+    GenRulesSw,+    Main,+    NounBuildSw,+    NounRulesSw,+    OtherBuildSw,+    OtherRulesSw,+    PrintSw,+    RulesSw,+    TestGenSw,+    TestSw,+    TypesSw,+    VerbBuildSw,+    VerbRulesSw++Executable fsv+  Build-Depends: haskell98, base>=4 && <5, containers, array+  Main-is: Main.hs+  Extensions: ForeignFunctionInterface+  HS-source-dirs: src/lib src/fsv src/lib/Dict+  C-sources: src/lib/rts.c,  src/lib/trie_lib.c+  Includes: src/lib/trie_lib.h+  Other-modules:+    Combine,     +    CTrie,             +    Frontend,   +    Net,           +    Tokenize,+    Command,     +    Dictionary,        +    General,    +    Options,       +    Trie,+    CommonMain,  +    DictToDictionary,  +    GeneralIO,  +    Print,         +    UTF8,+    Compound,    +    EditDistance,      +    Invariant,  +    SharedString,  +    Util,+    -- Dict  +    Dict.Abs,  +    Dict.ErrM,  +    Dict.GetDict,+    Dict.Lex,  +    Dict.Par,  +    Dict.Print,  +    Dict.Skel, +    -- fsv+    Build,     +    Dict,  +    PrintSw,  +    TestGen,  +    Types,+    Commands,  +    Main,  +    Rules,    +    Test
+ LICENSE view
@@ -0,0 +1,674 @@+                    GNU GENERAL PUBLIC LICENSE+                       Version 3, 29 June 2007++ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>+ Everyone is permitted to copy and distribute verbatim copies+ of this license document, but changing it is not allowed.++                            Preamble++  The GNU General Public License is a free, copyleft license for+software and other kinds of works.++  The licenses for most software and other practical works are designed+to take away your freedom to share and change the works.  By contrast,+the GNU General Public License is intended to guarantee your freedom to+share and change all versions of a program--to make sure it remains free+software for all its users.  We, the Free Software Foundation, use the+GNU General Public License for most of our software; it applies also to+any other work released this way by its authors.  You can apply it to+your programs, too.++  When we speak of free software, we are referring to freedom, not+price.  Our General Public Licenses are designed to make sure that you+have the freedom to distribute copies of free software (and charge for+them if you wish), that you receive source code or can get it if you+want it, that you can change the software or use pieces of it in new+free programs, and that you know you can do these things.++  To protect your rights, we need to prevent others from denying you+these rights or asking you to surrender the rights.  Therefore, you have+certain responsibilities if you distribute copies of the software, or if+you modify it: responsibilities to respect the freedom of others.++  For example, if you distribute copies of such a program, whether+gratis or for a fee, you must pass on to the recipients the same+freedoms that you received.  You must make sure that they, too, receive+or can get the source code.  And you must show them these terms so they+know their rights.++  Developers that use the GNU GPL protect your rights with two steps:+(1) assert copyright on the software, and (2) offer you this License+giving you legal permission to copy, distribute and/or modify it.++  For the developers' and authors' protection, the GPL clearly explains+that there is no warranty for this free software.  For both users' and+authors' sake, the GPL requires that modified versions be marked as+changed, so that their problems will not be attributed erroneously to+authors of previous versions.++  Some devices are designed to deny users access to install or run+modified versions of the software inside them, although the manufacturer+can do so.  This is fundamentally incompatible with the aim of+protecting users' freedom to change the software.  The systematic+pattern of such abuse occurs in the area of products for individuals to+use, which is precisely where it is most unacceptable.  Therefore, we+have designed this version of the GPL to prohibit the practice for those+products.  If such problems arise substantially in other domains, we+stand ready to extend this provision to those domains in future versions+of the GPL, as needed to protect the freedom of users.++  Finally, every program is threatened constantly by software patents.+States should not allow patents to restrict development and use of+software on general-purpose computers, but in those that do, we wish to+avoid the special danger that patents applied to a free program could+make it effectively proprietary.  To prevent this, the GPL assures that+patents cannot be used to render the program non-free.++  The precise terms and conditions for copying, distribution and+modification follow.++                       TERMS AND CONDITIONS++  0. Definitions.++  "This License" refers to version 3 of the GNU General Public License.++  "Copyright" also means copyright-like laws that apply to other kinds of+works, such as semiconductor masks.++  "The Program" refers to any copyrightable work licensed under this+License.  Each licensee is addressed as "you".  "Licensees" and+"recipients" may be individuals or organizations.++  To "modify" a work means to copy from or adapt all or part of the work+in a fashion requiring copyright permission, other than the making of an+exact copy.  The resulting work is called a "modified version" of the+earlier work or a work "based on" the earlier work.++  A "covered work" means either the unmodified Program or a work based+on the Program.++  To "propagate" a work means to do anything with it that, without+permission, would make you directly or secondarily liable for+infringement under applicable copyright law, except executing it on a+computer or modifying a private copy.  Propagation includes copying,+distribution (with or without modification), making available to the+public, and in some countries other activities as well.++  To "convey" a work means any kind of propagation that enables other+parties to make or receive copies.  Mere interaction with a user through+a computer network, with no transfer of a copy, is not conveying.++  An interactive user interface displays "Appropriate Legal Notices"+to the extent that it includes a convenient and prominently visible+feature that (1) displays an appropriate copyright notice, and (2)+tells the user that there is no warranty for the work (except to the+extent that warranties are provided), that licensees may convey the+work under this License, and how to view a copy of this License.  If+the interface presents a list of user commands or options, such as a+menu, a prominent item in the list meets this criterion.++  1. Source Code.++  The "source code" for a work means the preferred form of the work+for making modifications to it.  "Object code" means any non-source+form of a work.++  A "Standard Interface" means an interface that either is an official+standard defined by a recognized standards body, or, in the case of+interfaces specified for a particular programming language, one that+is widely used among developers working in that language.++  The "System Libraries" of an executable work include anything, other+than the work as a whole, that (a) is included in the normal form of+packaging a Major Component, but which is not part of that Major+Component, and (b) serves only to enable use of the work with that+Major Component, or to implement a Standard Interface for which an+implementation is available to the public in source code form.  A+"Major Component", in this context, means a major essential component+(kernel, window system, and so on) of the specific operating system+(if any) on which the executable work runs, or a compiler used to+produce the work, or an object code interpreter used to run it.++  The "Corresponding Source" for a work in object code form means all+the source code needed to generate, install, and (for an executable+work) run the object code and to modify the work, including scripts to+control those activities.  However, it does not include the work's+System Libraries, or general-purpose tools or generally available free+programs which are used unmodified in performing those activities but+which are not part of the work.  For example, Corresponding Source+includes interface definition files associated with source files for+the work, and the source code for shared libraries and dynamically+linked subprograms that the work is specifically designed to require,+such as by intimate data communication or control flow between those+subprograms and other parts of the work.++  The Corresponding Source need not include anything that users+can regenerate automatically from other parts of the Corresponding+Source.++  The Corresponding Source for a work in source code form is that+same work.++  2. Basic Permissions.++  All rights granted under this License are granted for the term of+copyright on the Program, and are irrevocable provided the stated+conditions are met.  This License explicitly affirms your unlimited+permission to run the unmodified Program.  The output from running a+covered work is covered by this License only if the output, given its+content, constitutes a covered work.  This License acknowledges your+rights of fair use or other equivalent, as provided by copyright law.++  You may make, run and propagate covered works that you do not+convey, without conditions so long as your license otherwise remains+in force.  You may convey covered works to others for the sole purpose+of having them make modifications exclusively for you, or provide you+with facilities for running those works, provided that you comply with+the terms of this License in conveying all material for which you do+not control copyright.  Those thus making or running the covered works+for you must do so exclusively on your behalf, under your direction+and control, on terms that prohibit them from making any copies of+your copyrighted material outside their relationship with you.++  Conveying under any other circumstances is permitted solely under+the conditions stated below.  Sublicensing is not allowed; section 10+makes it unnecessary.++  3. Protecting Users' Legal Rights From Anti-Circumvention Law.++  No covered work shall be deemed part of an effective technological+measure under any applicable law fulfilling obligations under article+11 of the WIPO copyright treaty adopted on 20 December 1996, or+similar laws prohibiting or restricting circumvention of such+measures.++  When you convey a covered work, you waive any legal power to forbid+circumvention of technological measures to the extent such circumvention+is effected by exercising rights under this License with respect to+the covered work, and you disclaim any intention to limit operation or+modification of the work as a means of enforcing, against the work's+users, your or third parties' legal rights to forbid circumvention of+technological measures.++  4. Conveying Verbatim Copies.++  You may convey verbatim copies of the Program's source code as you+receive it, in any medium, provided that you conspicuously and+appropriately publish on each copy an appropriate copyright notice;+keep intact all notices stating that this License and any+non-permissive terms added in accord with section 7 apply to the code;+keep intact all notices of the absence of any warranty; and give all+recipients a copy of this License along with the Program.++  You may charge any price or no price for each copy that you convey,+and you may offer support or warranty protection for a fee.++  5. Conveying Modified Source Versions.++  You may convey a work based on the Program, or the modifications to+produce it from the Program, in the form of source code under the+terms of section 4, provided that you also meet all of these conditions:++    a) The work must carry prominent notices stating that you modified+    it, and giving a relevant date.++    b) The work must carry prominent notices stating that it is+    released under this License and any conditions added under section+    7.  This requirement modifies the requirement in section 4 to+    "keep intact all notices".++    c) You must license the entire work, as a whole, under this+    License to anyone who comes into possession of a copy.  This+    License will therefore apply, along with any applicable section 7+    additional terms, to the whole of the work, and all its parts,+    regardless of how they are packaged.  This License gives no+    permission to license the work in any other way, but it does not+    invalidate such permission if you have separately received it.++    d) If the work has interactive user interfaces, each must display+    Appropriate Legal Notices; however, if the Program has interactive+    interfaces that do not display Appropriate Legal Notices, your+    work need not make them do so.++  A compilation of a covered work with other separate and independent+works, which are not by their nature extensions of the covered work,+and which are not combined with it such as to form a larger program,+in or on a volume of a storage or distribution medium, is called an+"aggregate" if the compilation and its resulting copyright are not+used to limit the access or legal rights of the compilation's users+beyond what the individual works permit.  Inclusion of a covered work+in an aggregate does not cause this License to apply to the other+parts of the aggregate.++  6. Conveying Non-Source Forms.++  You may convey a covered work in object code form under the terms+of sections 4 and 5, provided that you also convey the+machine-readable Corresponding Source under the terms of this License,+in one of these ways:++    a) Convey the object code in, or embodied in, a physical product+    (including a physical distribution medium), accompanied by the+    Corresponding Source fixed on a durable physical medium+    customarily used for software interchange.++    b) Convey the object code in, or embodied in, a physical product+    (including a physical distribution medium), accompanied by a+    written offer, valid for at least three years and valid for as+    long as you offer spare parts or customer support for that product+    model, to give anyone who possesses the object code either (1) a+    copy of the Corresponding Source for all the software in the+    product that is covered by this License, on a durable physical+    medium customarily used for software interchange, for a price no+    more than your reasonable cost of physically performing this+    conveying of source, or (2) access to copy the+    Corresponding Source from a network server at no charge.++    c) Convey individual copies of the object code with a copy of the+    written offer to provide the Corresponding Source.  This+    alternative is allowed only occasionally and noncommercially, and+    only if you received the object code with such an offer, in accord+    with subsection 6b.++    d) Convey the object code by offering access from a designated+    place (gratis or for a charge), and offer equivalent access to the+    Corresponding Source in the same way through the same place at no+    further charge.  You need not require recipients to copy the+    Corresponding Source along with the object code.  If the place to+    copy the object code is a network server, the Corresponding Source+    may be on a different server (operated by you or a third party)+    that supports equivalent copying facilities, provided you maintain+    clear directions next to the object code saying where to find the+    Corresponding Source.  Regardless of what server hosts the+    Corresponding Source, you remain obligated to ensure that it is+    available for as long as needed to satisfy these requirements.++    e) Convey the object code using peer-to-peer transmission, provided+    you inform other peers where the object code and Corresponding+    Source of the work are being offered to the general public at no+    charge under subsection 6d.++  A separable portion of the object code, whose source code is excluded+from the Corresponding Source as a System Library, need not be+included in conveying the object code work.++  A "User Product" is either (1) a "consumer product", which means any+tangible personal property which is normally used for personal, family,+or household purposes, or (2) anything designed or sold for incorporation+into a dwelling.  In determining whether a product is a consumer product,+doubtful cases shall be resolved in favor of coverage.  For a particular+product received by a particular user, "normally used" refers to a+typical or common use of that class of product, regardless of the status+of the particular user or of the way in which the particular user+actually uses, or expects or is expected to use, the product.  A product+is a consumer product regardless of whether the product has substantial+commercial, industrial or non-consumer uses, unless such uses represent+the only significant mode of use of the product.++  "Installation Information" for a User Product means any methods,+procedures, authorization keys, or other information required to install+and execute modified versions of a covered work in that User Product from+a modified version of its Corresponding Source.  The information must+suffice to ensure that the continued functioning of the modified object+code is in no case prevented or interfered with solely because+modification has been made.++  If you convey an object code work under this section in, or with, or+specifically for use in, a User Product, and the conveying occurs as+part of a transaction in which the right of possession and use of the+User Product is transferred to the recipient in perpetuity or for a+fixed term (regardless of how the transaction is characterized), the+Corresponding Source conveyed under this section must be accompanied+by the Installation Information.  But this requirement does not apply+if neither you nor any third party retains the ability to install+modified object code on the User Product (for example, the work has+been installed in ROM).++  The requirement to provide Installation Information does not include a+requirement to continue to provide support service, warranty, or updates+for a work that has been modified or installed by the recipient, or for+the User Product in which it has been modified or installed.  Access to a+network may be denied when the modification itself materially and+adversely affects the operation of the network or violates the rules and+protocols for communication across the network.++  Corresponding Source conveyed, and Installation Information provided,+in accord with this section must be in a format that is publicly+documented (and with an implementation available to the public in+source code form), and must require no special password or key for+unpacking, reading or copying.++  7. Additional Terms.++  "Additional permissions" are terms that supplement the terms of this+License by making exceptions from one or more of its conditions.+Additional permissions that are applicable to the entire Program shall+be treated as though they were included in this License, to the extent+that they are valid under applicable law.  If additional permissions+apply only to part of the Program, that part may be used separately+under those permissions, but the entire Program remains governed by+this License without regard to the additional permissions.++  When you convey a copy of a covered work, you may at your option+remove any additional permissions from that copy, or from any part of+it.  (Additional permissions may be written to require their own+removal in certain cases when you modify the work.)  You may place+additional permissions on material, added by you to a covered work,+for which you have or can give appropriate copyright permission.++  Notwithstanding any other provision of this License, for material you+add to a covered work, you may (if authorized by the copyright holders of+that material) supplement the terms of this License with terms:++    a) Disclaiming warranty or limiting liability differently from the+    terms of sections 15 and 16 of this License; or++    b) Requiring preservation of specified reasonable legal notices or+    author attributions in that material or in the Appropriate Legal+    Notices displayed by works containing it; or++    c) Prohibiting misrepresentation of the origin of that material, or+    requiring that modified versions of such material be marked in+    reasonable ways as different from the original version; or++    d) Limiting the use for publicity purposes of names of licensors or+    authors of the material; or++    e) Declining to grant rights under trademark law for use of some+    trade names, trademarks, or service marks; or++    f) Requiring indemnification of licensors and authors of that+    material by anyone who conveys the material (or modified versions of+    it) with contractual assumptions of liability to the recipient, for+    any liability that these contractual assumptions directly impose on+    those licensors and authors.++  All other non-permissive additional terms are considered "further+restrictions" within the meaning of section 10.  If the Program as you+received it, or any part of it, contains a notice stating that it is+governed by this License along with a term that is a further+restriction, you may remove that term.  If a license document contains+a further restriction but permits relicensing or conveying under this+License, you may add to a covered work material governed by the terms+of that license document, provided that the further restriction does+not survive such relicensing or conveying.++  If you add terms to a covered work in accord with this section, you+must place, in the relevant source files, a statement of the+additional terms that apply to those files, or a notice indicating+where to find the applicable terms.++  Additional terms, permissive or non-permissive, may be stated in the+form of a separately written license, or stated as exceptions;+the above requirements apply either way.++  8. Termination.++  You may not propagate or modify a covered work except as expressly+provided under this License.  Any attempt otherwise to propagate or+modify it is void, and will automatically terminate your rights under+this License (including any patent licenses granted under the third+paragraph of section 11).++  However, if you cease all violation of this License, then your+license from a particular copyright holder is reinstated (a)+provisionally, unless and until the copyright holder explicitly and+finally terminates your license, and (b) permanently, if the copyright+holder fails to notify you of the violation by some reasonable means+prior to 60 days after the cessation.++  Moreover, your license from a particular copyright holder is+reinstated permanently if the copyright holder notifies you of the+violation by some reasonable means, this is the first time you have+received notice of violation of this License (for any work) from that+copyright holder, and you cure the violation prior to 30 days after+your receipt of the notice.++  Termination of your rights under this section does not terminate the+licenses of parties who have received copies or rights from you under+this License.  If your rights have been terminated and not permanently+reinstated, you do not qualify to receive new licenses for the same+material under section 10.++  9. Acceptance Not Required for Having Copies.++  You are not required to accept this License in order to receive or+run a copy of the Program.  Ancillary propagation of a covered work+occurring solely as a consequence of using peer-to-peer transmission+to receive a copy likewise does not require acceptance.  However,+nothing other than this License grants you permission to propagate or+modify any covered work.  These actions infringe copyright if you do+not accept this License.  Therefore, by modifying or propagating a+covered work, you indicate your acceptance of this License to do so.++  10. Automatic Licensing of Downstream Recipients.++  Each time you convey a covered work, the recipient automatically+receives a license from the original licensors, to run, modify and+propagate that work, subject to this License.  You are not responsible+for enforcing compliance by third parties with this License.++  An "entity transaction" is a transaction transferring control of an+organization, or substantially all assets of one, or subdividing an+organization, or merging organizations.  If propagation of a covered+work results from an entity transaction, each party to that+transaction who receives a copy of the work also receives whatever+licenses to the work the party's predecessor in interest had or could+give under the previous paragraph, plus a right to possession of the+Corresponding Source of the work from the predecessor in interest, if+the predecessor has it or can get it with reasonable efforts.++  You may not impose any further restrictions on the exercise of the+rights granted or affirmed under this License.  For example, you may+not impose a license fee, royalty, or other charge for exercise of+rights granted under this License, and you may not initiate litigation+(including a cross-claim or counterclaim in a lawsuit) alleging that+any patent claim is infringed by making, using, selling, offering for+sale, or importing the Program or any portion of it.++  11. Patents.++  A "contributor" is a copyright holder who authorizes use under this+License of the Program or a work on which the Program is based.  The+work thus licensed is called the contributor's "contributor version".++  A contributor's "essential patent claims" are all patent claims+owned or controlled by the contributor, whether already acquired or+hereafter acquired, that would be infringed by some manner, permitted+by this License, of making, using, or selling its contributor version,+but do not include claims that would be infringed only as a+consequence of further modification of the contributor version.  For+purposes of this definition, "control" includes the right to grant+patent sublicenses in a manner consistent with the requirements of+this License.++  Each contributor grants you a non-exclusive, worldwide, royalty-free+patent license under the contributor's essential patent claims, to+make, use, sell, offer for sale, import and otherwise run, modify and+propagate the contents of its contributor version.++  In the following three paragraphs, a "patent license" is any express+agreement or commitment, however denominated, not to enforce a patent+(such as an express permission to practice a patent or covenant not to+sue for patent infringement).  To "grant" such a patent license to a+party means to make such an agreement or commitment not to enforce a+patent against the party.++  If you convey a covered work, knowingly relying on a patent license,+and the Corresponding Source of the work is not available for anyone+to copy, free of charge and under the terms of this License, through a+publicly available network server or other readily accessible means,+then you must either (1) cause the Corresponding Source to be so+available, or (2) arrange to deprive yourself of the benefit of the+patent license for this particular work, or (3) arrange, in a manner+consistent with the requirements of this License, to extend the patent+license to downstream recipients.  "Knowingly relying" means you have+actual knowledge that, but for the patent license, your conveying the+covered work in a country, or your recipient's use of the covered work+in a country, would infringe one or more identifiable patents in that+country that you have reason to believe are valid.++  If, pursuant to or in connection with a single transaction or+arrangement, you convey, or propagate by procuring conveyance of, a+covered work, and grant a patent license to some of the parties+receiving the covered work authorizing them to use, propagate, modify+or convey a specific copy of the covered work, then the patent license+you grant is automatically extended to all recipients of the covered+work and works based on it.++  A patent license is "discriminatory" if it does not include within+the scope of its coverage, prohibits the exercise of, or is+conditioned on the non-exercise of one or more of the rights that are+specifically granted under this License.  You may not convey a covered+work if you are a party to an arrangement with a third party that is+in the business of distributing software, under which you make payment+to the third party based on the extent of your activity of conveying+the work, and under which the third party grants, to any of the+parties who would receive the covered work from you, a discriminatory+patent license (a) in connection with copies of the covered work+conveyed by you (or copies made from those copies), or (b) primarily+for and in connection with specific products or compilations that+contain the covered work, unless you entered into that arrangement,+or that patent license was granted, prior to 28 March 2007.++  Nothing in this License shall be construed as excluding or limiting+any implied license or other defenses to infringement that may+otherwise be available to you under applicable patent law.++  12. No Surrender of Others' Freedom.++  If conditions are imposed on you (whether by court order, agreement or+otherwise) that contradict the conditions of this License, they do not+excuse you from the conditions of this License.  If you cannot convey a+covered work so as to satisfy simultaneously your obligations under this+License and any other pertinent obligations, then as a consequence you may+not convey it at all.  For example, if you agree to terms that obligate you+to collect a royalty for further conveying from those to whom you convey+the Program, the only way you could satisfy both those terms and this+License would be to refrain entirely from conveying the Program.++  13. Use with the GNU Affero General Public License.++  Notwithstanding any other provision of this License, you have+permission to link or combine any covered work with a work licensed+under version 3 of the GNU Affero General Public License into a single+combined work, and to convey the resulting work.  The terms of this+License will continue to apply to the part which is the covered work,+but the special requirements of the GNU Affero General Public License,+section 13, concerning interaction through a network will apply to the+combination as such.++  14. Revised Versions of this License.++  The Free Software Foundation may publish revised and/or new versions of+the GNU General Public License from time to time.  Such new versions will+be similar in spirit to the present version, but may differ in detail to+address new problems or concerns.++  Each version is given a distinguishing version number.  If the+Program specifies that a certain numbered version of the GNU General+Public License "or any later version" applies to it, you have the+option of following the terms and conditions either of that numbered+version or of any later version published by the Free Software+Foundation.  If the Program does not specify a version number of the+GNU General Public License, you may choose any version ever published+by the Free Software Foundation.++  If the Program specifies that a proxy can decide which future+versions of the GNU General Public License can be used, that proxy's+public statement of acceptance of a version permanently authorizes you+to choose that version for the Program.++  Later license versions may give you additional or different+permissions.  However, no additional obligations are imposed on any+author or copyright holder as a result of your choosing to follow a+later version.++  15. Disclaimer of Warranty.++  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.++  16. Limitation of Liability.++  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF+SUCH DAMAGES.++  17. Interpretation of Sections 15 and 16.++  If the disclaimer of warranty and limitation of liability provided+above cannot be given local legal effect according to their terms,+reviewing courts shall apply local law that most closely approximates+an absolute waiver of all civil liability in connection with the+Program, unless a warranty or assumption of liability accompanies a+copy of the Program in return for a fee.++                     END OF TERMS AND CONDITIONS++            How to Apply These Terms to Your New Programs++  If you develop a new program, and you want it to be of the greatest+possible use to the public, the best way to achieve this is to make it+free software which everyone can redistribute and change under these terms.++  To do so, attach the following notices to the program.  It is safest+to attach them to the start of each source file to most effectively+state the exclusion of warranty; and each file should have at least+the "copyright" line and a pointer to where the full notice is found.++    <one line to give the program's name and a brief idea of what it does.>+    Copyright (C) <year>  <name of author>++    This program is free software: you can redistribute it and/or modify+    it under the terms of the GNU General Public License as published by+    the Free Software Foundation, either version 3 of the License, or+    (at your option) any later version.++    This program is distributed in the hope that it will be useful,+    but WITHOUT ANY WARRANTY; without even the implied warranty of+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+    GNU General Public License for more details.++    You should have received a copy of the GNU General Public License+    along with this program.  If not, see <http://www.gnu.org/licenses/>.++Also add information on how to contact you by electronic and paper mail.++  If the program does terminal interaction, make it output a short+notice like this when it starts in an interactive mode:++    <program>  Copyright (C) <year>  <name of author>+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.+    This is free software, and you are welcome to redistribute it+    under certain conditions; type `show c' for details.++The hypothetical commands `show w' and `show c' should show the appropriate+parts of the General Public License.  Of course, your program's commands+might be different; for a GUI interface, you would use an "about box".++  You should also get your employer (if you work as a programmer) or school,+if any, to sign a "copyright disclaimer" for the program, if necessary.+For more information on this, and how to apply and follow the GNU GPL, see+<http://www.gnu.org/licenses/>.++  The GNU General Public License does not permit incorporating your program+into proprietary programs.  If your program is a subroutine library, you+may consider it more useful to permit linking proprietary applications with+the library.  If this is what you want to do, use the GNU Lesser General+Public License instead of this License.  But first, please read+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+ Setup.lhs view
@@ -0,0 +1,6 @@+#!/usr/bin/env runghc++> module Main where+> import Distribution.Simple+> main :: IO ()+> main = defaultMain
+ dist/build/dalin/dalin-tmp/Dict/Lex.hs view
@@ -0,0 +1,339 @@+{-# OPTIONS -fglasgow-exts -cpp #-}+{-# LINE 3 "src/lib/Dict/Lex.x" #-}++{-# OPTIONS -fno-warn-incomplete-patterns #-}+module Dict.Lex where+import UTF8+++#if __GLASGOW_HASKELL__ >= 603+#include "ghcconfig.h"+#elif defined(__GLASGOW_HASKELL__)+#include "config.h"+#endif+#if __GLASGOW_HASKELL__ >= 503+import Data.Array+import Data.Char (ord)+import Data.Array.Base (unsafeAt)+#else+import Array+import Char (ord)+#endif+#if __GLASGOW_HASKELL__ >= 503+import GHC.Exts+#else+import GlaExts+#endif+alex_base :: AlexAddr+alex_base = AlexA# "\xf8\xff\xff\xff\xfc\xff\xff\xff\xfd\xff\xff\xff\xdb\xff\xff\xff\xdc\xff\xff\xff\x00\x00\x00\x00\xf9\xff\xff\xff\xfa\xff\xff\xff\xdd\xff\xff\xff\xde\xff\xff\xff\xdf\xff\xff\xff\x12\x00\x00\x00\x00\x00\x00\x00\xf8\x00\x00\x00\x78\x01\x00\x00\x00\x00\x00\x00\x73\x00\x00\x00\x93\x00\x00\x00\x31\x00\x00\x00\x4e\x00\x00\x00"#++alex_table :: AlexAddr+alex_table = AlexA# "\x00\x00\x0b\x00\x0b\x00\x0b\x00\x0b\x00\x0b\x00\xff\xff\xff\xff\x01\x00\x07\x00\x07\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x10\x00\x0b\x00\x0b\x00\x0b\x00\x0b\x00\x0b\x00\x0c\x00\x0c\x00\x00\x00\x00\x00\x0c\x00\x03\x00\x07\x00\x06\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x0b\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0a\x00\x00\x00\x0c\x00\x04\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x00\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x12\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x12\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#++alex_check :: AlexAddr+alex_check = AlexA# "\xff\xff\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0a\x00\x0a\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x20\x00\xff\xff\x22\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x28\x00\x29\x00\xff\xff\xff\xff\x2c\x00\x2d\x00\x2d\x00\x2d\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x20\x00\x3b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\x27\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\xff\xff\x7d\x00\x7d\x00\x7d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0a\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0a\x00\xff\xff\x6e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x74\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\xff\xff\xff\xff\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\x5c\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\x5c\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\xff\xff\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xff\xff\x60\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\xff\xff\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xff\xff\x60\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#++alex_deflt :: AlexAddr+alex_deflt = AlexA# "\xff\xff\x02\x00\x02\x00\xff\xff\x09\x00\xff\xff\x09\x00\x09\x00\x09\x00\x09\x00\xff\xff\xff\xff\xff\xff\x0e\x00\x0e\x00\xff\xff\x11\x00\x11\x00\xff\xff\xff\xff"#++alex_accept = listArray (0::Int,19) [[],[(AlexAccSkip)],[(AlexAccSkip)],[],[(AlexAccSkip)],[(AlexAccSkip)],[],[],[],[],[(AlexAcc (alex_action_3))],[(AlexAccSkip)],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_4))],[(AlexAcc (alex_action_4))],[(AlexAcc (alex_action_5))],[],[],[],[(AlexAcc (alex_action_6))]]+{-# LINE 34 "src/lib/Dict/Lex.x" #-}+++tok f p s = f p s++share :: String -> String+share = decodeUTF8++data Tok =+   TS !String     -- reserved words and symbols+ | TL !String     -- string literals+ | TI !String     -- integer literals+ | TV !String     -- identifiers+ | TD !String     -- double precision float literals+ | TC !String     -- character literals++ deriving (Eq,Show,Ord)++data Token = +   PT  Posn Tok+ | Err Posn+  deriving (Eq,Show,Ord)++tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l+tokenPos (Err (Pn _ l _) :_) = "line " ++ show l+tokenPos _ = "end of file"++posLineCol (Pn _ l c) = (l,c)+mkPosToken t@(PT p _) = (posLineCol p, prToken t)++prToken t = case t of+  PT _ (TS s) -> s+  PT _ (TI s) -> s+  PT _ (TV s) -> s+  PT _ (TD s) -> s+  PT _ (TC s) -> s++  _ -> show t++data BTree = N | B String Tok BTree BTree deriving (Show)++eitherResIdent :: (String -> Tok) -> String -> Tok+eitherResIdent tv s = treeFind resWords+  where+  treeFind N = tv s+  treeFind (B a t left right) | s < a  = treeFind left+                              | s > a  = treeFind right+                              | s == a = t++resWords = N+   where b s = B s (TS s)++unescapeInitTail :: String -> String+unescapeInitTail = unesc . tail where+  unesc s = case s of+    '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs+    '\\':'n':cs  -> '\n' : unesc cs+    '\\':'t':cs  -> '\t' : unesc cs+    '"':[]    -> []+    c:cs      -> c : unesc cs+    _         -> []++-------------------------------------------------------------------+-- Alex wrapper code.+-- A modified "posn" wrapper.+-------------------------------------------------------------------++data Posn = Pn !Int !Int !Int+      deriving (Eq, Show,Ord)++alexStartPos :: Posn+alexStartPos = Pn 0 1 1++alexMove :: Posn -> Char -> Posn+alexMove (Pn a l c) '\t' = Pn (a+1)  l     (((c+7) `div` 8)*8+1)+alexMove (Pn a l c) '\n' = Pn (a+1) (l+1)   1+alexMove (Pn a l c) _    = Pn (a+1)  l     (c+1)++type AlexInput = (Posn, -- current position,+               Char,     -- previous char+               String)   -- current input string++tokens :: String -> [Token]+tokens str = go (alexStartPos, '\n', str)+    where+      go :: (Posn, Char, String) -> [Token]+      go inp@(pos, _, str) =+               case alexScan inp 0 of+                AlexEOF                -> []+                AlexError (pos, _, _)  -> [Err pos]+                AlexSkip  inp' len     -> go inp'+                AlexToken inp' len act -> act pos (take len str) : (go inp')++alexGetChar :: AlexInput -> Maybe (Char,AlexInput)+alexGetChar (p, c, [])    = Nothing+alexGetChar (p, _, (c:s)) =+    let p' = alexMove p c+     in p' `seq` Just (c, (p', c, s))++alexInputPrevChar :: AlexInput -> Char+alexInputPrevChar (p, c, s) = c++alex_action_3 =  tok (\p s -> PT p (TS $ share s)) +alex_action_4 =  tok (\p s -> PT p (eitherResIdent (TV . share) s)) +alex_action_5 =  tok (\p s -> PT p (TL $ share $ unescapeInitTail s)) +alex_action_6 =  tok (\p s -> PT p (TI $ share s))    +{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "<built-in>" #-}+{-# LINE 1 "<command-line>" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+-- -----------------------------------------------------------------------------+-- ALEX TEMPLATE+--+-- This code is in the PUBLIC DOMAIN; you may copy it freely and use+-- it for any purpose whatsoever.++-- -----------------------------------------------------------------------------+-- INTERNALS and main scanner engine++{-# LINE 37 "templates/GenericTemplate.hs" #-}++{-# LINE 47 "templates/GenericTemplate.hs" #-}+++data AlexAddr = AlexA# Addr#++#if __GLASGOW_HASKELL__ < 503+uncheckedShiftL# = shiftL#+#endif++{-# INLINE alexIndexInt16OffAddr #-}+alexIndexInt16OffAddr (AlexA# arr) off =+#ifdef WORDS_BIGENDIAN+  narrow16Int# i+  where+	i    = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low)+	high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))+	low  = int2Word# (ord# (indexCharOffAddr# arr off'))+	off' = off *# 2#+#else+  indexInt16OffAddr# arr off+#endif++++++{-# INLINE alexIndexInt32OffAddr #-}+alexIndexInt32OffAddr (AlexA# arr) off = +#ifdef WORDS_BIGENDIAN+  narrow32Int# i+  where+   i    = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#`+		     (b2 `uncheckedShiftL#` 16#) `or#`+		     (b1 `uncheckedShiftL#` 8#) `or#` b0)+   b3   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 3#)))+   b2   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 2#)))+   b1   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))+   b0   = int2Word# (ord# (indexCharOffAddr# arr off'))+   off' = off *# 4#+#else+  indexInt32OffAddr# arr off+#endif++++++#if __GLASGOW_HASKELL__ < 503+quickIndex arr i = arr ! i+#else+-- GHC >= 503, unsafeAt is available from Data.Array.Base.+quickIndex = unsafeAt+#endif+++++-- -----------------------------------------------------------------------------+-- Main lexing routines++data AlexReturn a+  = AlexEOF+  | AlexError  !AlexInput+  | AlexSkip   !AlexInput !Int+  | AlexToken  !AlexInput !Int a++-- alexScan :: AlexInput -> StartCode -> AlexReturn a+alexScan input (I# (sc))+  = alexScanUser undefined input (I# (sc))++alexScanUser user input (I# (sc))+  = case alex_scan_tkn user input 0# input sc AlexNone of+	(AlexNone, input') ->+		case alexGetChar input of+			Nothing -> ++++				   AlexEOF+			Just _ ->++++				   AlexError input'++	(AlexLastSkip input'' len, _) ->++++		AlexSkip input'' len++	(AlexLastAcc k input''' len, _) ->++++		AlexToken input''' len k+++-- Push the input through the DFA, remembering the most recent accepting+-- state it encountered.++alex_scan_tkn user orig_input len input s last_acc =+  input `seq` -- strict in the input+  let +	new_acc = check_accs (alex_accept `quickIndex` (I# (s)))+  in+  new_acc `seq`+  case alexGetChar input of+     Nothing -> (new_acc, input)+     Just (c, new_input) -> ++++	let+		!(base) = alexIndexInt32OffAddr alex_base s+		!((I# (ord_c))) = ord c+		!(offset) = (base +# ord_c)+		!(check)  = alexIndexInt16OffAddr alex_check offset+		+		!(new_s) = if (offset >=# 0#) && (check ==# ord_c)+			  then alexIndexInt16OffAddr alex_table offset+			  else alexIndexInt16OffAddr alex_deflt s+	in+	case new_s of +	    -1# -> (new_acc, input)+		-- on an error, we want to keep the input *before* the+		-- character that failed, not after.+    	    _ -> alex_scan_tkn user orig_input (len +# 1#) +			new_input new_s new_acc++  where+	check_accs [] = last_acc+	check_accs (AlexAcc a : _) = AlexLastAcc a input (I# (len))+	check_accs (AlexAccSkip : _)  = AlexLastSkip  input (I# (len))+	check_accs (AlexAccPred a predx : rest)+	   | predx user orig_input (I# (len)) input+	   = AlexLastAcc a input (I# (len))+	check_accs (AlexAccSkipPred predx : rest)+	   | predx user orig_input (I# (len)) input+	   = AlexLastSkip input (I# (len))+	check_accs (_ : rest) = check_accs rest++data AlexLastAcc a+  = AlexNone+  | AlexLastAcc a !AlexInput !Int+  | AlexLastSkip  !AlexInput !Int++data AlexAcc a user+  = AlexAcc a+  | AlexAccSkip+  | AlexAccPred a (AlexAccPred user)+  | AlexAccSkipPred (AlexAccPred user)++type AlexAccPred user = user -> AlexInput -> Int -> AlexInput -> Bool++-- -----------------------------------------------------------------------------+-- Predicates on a rule++alexAndPred p1 p2 user in1 len in2+  = p1 user in1 len in2 && p2 user in1 len in2++--alexPrevCharIsPred :: Char -> AlexAccPred _ +alexPrevCharIs c _ input _ _ = c == alexInputPrevChar input++--alexPrevCharIsOneOfPred :: Array Char Bool -> AlexAccPred _ +alexPrevCharIsOneOf arr _ input _ _ = arr ! alexInputPrevChar input++--alexRightContext :: Int -> AlexAccPred _+alexRightContext (I# (sc)) user _ _ input = +     case alex_scan_tkn user input 0# input sc AlexNone of+	  (AlexNone, _) -> False+	  _ -> True+	-- TODO: there's no need to find the longest+	-- match when checking the right context, just+	-- the first match will do.++-- used by wrappers+iUnbox (I# (i)) = i
+ dist/build/dalin/dalin-tmp/Dict/Par.hs view
@@ -0,0 +1,609 @@+{-# OPTIONS_GHC -fno-warn-overlapping-patterns #-}+{-# OPTIONS -fglasgow-exts -cpp #-}+{-# OPTIONS -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-}+module Dict.Par where+import Dict.Abs+import Dict.Lex+import Dict.ErrM+#if __GLASGOW_HASKELL__ >= 503+import qualified Data.Array as Happy_Data_Array+#else+import qualified Array as Happy_Data_Array+#endif+#if __GLASGOW_HASKELL__ >= 503+import qualified GHC.Exts as Happy_GHC_Exts+#else+import qualified GlaExts as Happy_GHC_Exts+#endif++-- parser produced by Happy Version 1.18.4++newtype HappyAbsSyn  = HappyAbsSyn HappyAny+#if __GLASGOW_HASKELL__ >= 607+type HappyAny = Happy_GHC_Exts.Any+#else+type HappyAny = forall a . a+#endif+happyIn10 :: (Ident) -> (HappyAbsSyn )+happyIn10 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn10 #-}+happyOut10 :: (HappyAbsSyn ) -> (Ident)+happyOut10 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut10 #-}+happyIn11 :: (Integer) -> (HappyAbsSyn )+happyIn11 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn11 #-}+happyOut11 :: (HappyAbsSyn ) -> (Integer)+happyOut11 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut11 #-}+happyIn12 :: (String) -> (HappyAbsSyn )+happyIn12 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn12 #-}+happyOut12 :: (HappyAbsSyn ) -> (String)+happyOut12 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut12 #-}+happyIn13 :: (Dictionary) -> (HappyAbsSyn )+happyIn13 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn13 #-}+happyOut13 :: (HappyAbsSyn ) -> (Dictionary)+happyOut13 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut13 #-}+happyIn14 :: ([Entry]) -> (HappyAbsSyn )+happyIn14 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn14 #-}+happyOut14 :: (HappyAbsSyn ) -> ([Entry])+happyOut14 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut14 #-}+happyIn15 :: ([Arg]) -> (HappyAbsSyn )+happyIn15 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn15 #-}+happyOut15 :: (HappyAbsSyn ) -> ([Arg])+happyOut15 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut15 #-}+happyIn16 :: ([Term]) -> (HappyAbsSyn )+happyIn16 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn16 #-}+happyOut16 :: (HappyAbsSyn ) -> ([Term])+happyOut16 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut16 #-}+happyIn17 :: (Entry) -> (HappyAbsSyn )+happyIn17 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn17 #-}+happyOut17 :: (HappyAbsSyn ) -> (Entry)+happyOut17 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut17 #-}+happyIn18 :: (Term) -> (HappyAbsSyn )+happyIn18 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn18 #-}+happyOut18 :: (HappyAbsSyn ) -> (Term)+happyOut18 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut18 #-}+happyIn19 :: (Arg) -> (HappyAbsSyn )+happyIn19 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn19 #-}+happyOut19 :: (HappyAbsSyn ) -> (Arg)+happyOut19 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut19 #-}+happyInTok :: (Token) -> (HappyAbsSyn )+happyInTok x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyInTok #-}+happyOutTok :: (HappyAbsSyn ) -> (Token)+happyOutTok x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOutTok #-}+++happyActOffsets :: HappyAddr+happyActOffsets = HappyA# "\x00\x00\x00\x00\x00\x00\xfd\xff\x41\x00\xfd\xff\xfd\xff\x41\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3a\x00\x00\x00\x00\x00\x3f\x00\x38\x00\x00\x00\x00\x00\x38\x00\x38\x00\x40\x00\x36\x00\x11\x00\x35\x00\x32\x00\x31\x00\x00\x00\xfd\xff\x33\x00\xfd\xff\x23\x00\xfd\xff\x00\x00\x00\x00\x16\x00\x00\x00\x00\x00\x00\x00"#++happyGotoOffsets :: HappyAddr+happyGotoOffsets = HappyA# "\x30\x00\x0c\x00\x21\x00\x1f\x00\x12\x00\x22\x00\x2f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x08\x00\x00\x00\x08\x00\x00\x00\x00\x00\x15\x00\x2c\x00\x0b\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#++happyDefActions :: HappyAddr+happyDefActions = HappyA# "\xf4\xff\xf4\xff\xf2\xff\xf0\xff\x00\x00\x00\x00\x00\x00\x00\x00\xf8\xff\xe9\xff\xe8\xff\xe7\xff\x00\x00\xf7\xff\xf6\xff\xe9\xff\x00\x00\xea\xff\xf2\xff\x00\x00\x00\x00\xef\xff\x00\x00\x00\x00\x00\x00\xf5\xff\x00\x00\xf1\xff\xf0\xff\xed\xff\xf0\xff\x00\x00\xf0\xff\xee\xff\xf3\xff\x00\x00\xeb\xff\xec\xff"#++happyCheck :: HappyAddr+happyCheck = HappyA# "\xff\xff\x00\x00\x01\x00\x02\x00\x07\x00\x08\x00\x09\x00\x06\x00\x00\x00\x08\x00\x09\x00\x00\x00\x01\x00\x02\x00\x05\x00\x07\x00\x04\x00\x06\x00\x00\x00\x08\x00\x09\x00\x00\x00\x01\x00\x02\x00\x07\x00\x07\x00\x04\x00\x06\x00\x0b\x00\x08\x00\x09\x00\x00\x00\x01\x00\x02\x00\x00\x00\x01\x00\x02\x00\x06\x00\x05\x00\x08\x00\x09\x00\x06\x00\x08\x00\x09\x00\x00\x00\x01\x00\x02\x00\x00\x00\x01\x00\x02\x00\x01\x00\x03\x00\x04\x00\x09\x00\x03\x00\xff\xff\x09\x00\x07\x00\x07\x00\x08\x00\x09\x00\x07\x00\x08\x00\x09\x00\x0b\x00\x0b\x00\x02\x00\x0b\x00\x05\x00\x0b\x00\xff\xff\xff\xff\x07\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#++happyTable :: HappyAddr+happyTable = HappyA# "\x00\x00\x0f\x00\x0a\x00\x0b\x00\x09\x00\x0e\x00\x0f\x00\x23\x00\x12\x00\x15\x00\x11\x00\x0f\x00\x0a\x00\x0b\x00\x1d\x00\x1a\x00\x17\x00\x1f\x00\x12\x00\x15\x00\x11\x00\x0f\x00\x0a\x00\x0b\x00\x09\x00\x13\x00\x26\x00\x21\x00\xff\xff\x15\x00\x11\x00\x0f\x00\x0a\x00\x0b\x00\x0f\x00\x0a\x00\x0b\x00\x14\x00\x16\x00\x15\x00\x11\x00\x25\x00\x10\x00\x11\x00\x09\x00\x0a\x00\x0b\x00\x09\x00\x0a\x00\x0b\x00\x23\x00\x18\x00\x19\x00\x1b\x00\x21\x00\x00\x00\x0c\x00\x09\x00\x09\x00\x0e\x00\x0f\x00\x09\x00\x0e\x00\x0f\x00\xff\xff\xff\xff\x1d\x00\xff\xff\x1f\x00\xff\xff\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#++happyReduceArr = Happy_Data_Array.array (7, 24) [+	(7 , happyReduce_7),+	(8 , happyReduce_8),+	(9 , happyReduce_9),+	(10 , happyReduce_10),+	(11 , happyReduce_11),+	(12 , happyReduce_12),+	(13 , happyReduce_13),+	(14 , happyReduce_14),+	(15 , happyReduce_15),+	(16 , happyReduce_16),+	(17 , happyReduce_17),+	(18 , happyReduce_18),+	(19 , happyReduce_19),+	(20 , happyReduce_20),+	(21 , happyReduce_21),+	(22 , happyReduce_22),+	(23 , happyReduce_23),+	(24 , happyReduce_24)+	]++happy_n_terms = 12 :: Int+happy_n_nonterms = 10 :: Int++happyReduce_7 = happySpecReduce_1  0# happyReduction_7+happyReduction_7 happy_x_1+	 =  case happyOutTok happy_x_1 of { (PT _ (TV happy_var_1)) -> +	happyIn10+		 (Ident happy_var_1+	)}++happyReduce_8 = happySpecReduce_1  1# happyReduction_8+happyReduction_8 happy_x_1+	 =  case happyOutTok happy_x_1 of { (PT _ (TI happy_var_1)) -> +	happyIn11+		 ((read happy_var_1) :: Integer+	)}++happyReduce_9 = happySpecReduce_1  2# happyReduction_9+happyReduction_9 happy_x_1+	 =  case happyOutTok happy_x_1 of { (PT _ (TL happy_var_1)) -> +	happyIn12+		 (happy_var_1+	)}++happyReduce_10 = happySpecReduce_1  3# happyReduction_10+happyReduction_10 happy_x_1+	 =  case happyOut14 happy_x_1 of { happy_var_1 -> +	happyIn13+		 (Dict (reverse happy_var_1)+	)}++happyReduce_11 = happySpecReduce_0  4# happyReduction_11+happyReduction_11  =  happyIn14+		 ([]+	)++happyReduce_12 = happySpecReduce_3  4# happyReduction_12+happyReduction_12 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut14 happy_x_1 of { happy_var_1 -> +	case happyOut17 happy_x_2 of { happy_var_2 -> +	happyIn14+		 (flip (:) happy_var_1 happy_var_2+	)}}++happyReduce_13 = happySpecReduce_0  5# happyReduction_13+happyReduction_13  =  happyIn15+		 ([]+	)++happyReduce_14 = happySpecReduce_2  5# happyReduction_14+happyReduction_14 happy_x_2+	happy_x_1+	 =  case happyOut15 happy_x_1 of { happy_var_1 -> +	case happyOut19 happy_x_2 of { happy_var_2 -> +	happyIn15+		 (flip (:) happy_var_1 happy_var_2+	)}}++happyReduce_15 = happySpecReduce_0  6# happyReduction_15+happyReduction_15  =  happyIn16+		 ([]+	)++happyReduce_16 = happySpecReduce_1  6# happyReduction_16+happyReduction_16 happy_x_1+	 =  case happyOut18 happy_x_1 of { happy_var_1 -> +	happyIn16+		 ((:[]) happy_var_1+	)}++happyReduce_17 = happySpecReduce_3  6# happyReduction_17+happyReduction_17 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut18 happy_x_1 of { happy_var_1 -> +	case happyOut16 happy_x_3 of { happy_var_3 -> +	happyIn16+		 ((:) happy_var_1 happy_var_3+	)}}++happyReduce_18 = happySpecReduce_2  7# happyReduction_18+happyReduction_18 happy_x_2+	happy_x_1+	 =  case happyOut10 happy_x_1 of { happy_var_1 -> +	case happyOut15 happy_x_2 of { happy_var_2 -> +	happyIn17+		 (E happy_var_1 (reverse happy_var_2)+	)}}++happyReduce_19 = happyReduce 5# 7# happyReduction_19+happyReduction_19 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut10 happy_x_1 of { happy_var_1 -> +	case happyOut15 happy_x_2 of { happy_var_2 -> +	case happyOut16 happy_x_4 of { happy_var_4 -> +	happyIn17+		 (EA happy_var_1 (reverse happy_var_2) happy_var_4+	) `HappyStk` happyRest}}}++happyReduce_20 = happyReduce 4# 8# happyReduction_20+happyReduction_20 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut10 happy_x_1 of { happy_var_1 -> +	case happyOut16 happy_x_3 of { happy_var_3 -> +	happyIn18+		 (TermC happy_var_1 happy_var_3+	) `HappyStk` happyRest}}++happyReduce_21 = happySpecReduce_1  8# happyReduction_21+happyReduction_21 happy_x_1+	 =  case happyOut19 happy_x_1 of { happy_var_1 -> +	happyIn18+		 (TermA happy_var_1+	)}++happyReduce_22 = happySpecReduce_1  9# happyReduction_22+happyReduction_22 happy_x_1+	 =  case happyOut10 happy_x_1 of { happy_var_1 -> +	happyIn19+		 (NId happy_var_1+	)}++happyReduce_23 = happySpecReduce_1  9# happyReduction_23+happyReduction_23 happy_x_1+	 =  case happyOut11 happy_x_1 of { happy_var_1 -> +	happyIn19+		 (NArg happy_var_1+	)}++happyReduce_24 = happySpecReduce_1  9# happyReduction_24+happyReduction_24 happy_x_1+	 =  case happyOut12 happy_x_1 of { happy_var_1 -> +	happyIn19+		 (NStr happy_var_1+	)}++happyNewToken action sts stk [] =+	happyDoAction 11# notHappyAtAll action sts stk []++happyNewToken action sts stk (tk:tks) =+	let cont i = happyDoAction i tk action sts stk tks in+	case tk of {+	PT _ (TS ";") -> cont 1#;+	PT _ (TS ",") -> cont 2#;+	PT _ (TS "{") -> cont 3#;+	PT _ (TS "}") -> cont 4#;+	PT _ (TS "(") -> cont 5#;+	PT _ (TS ")") -> cont 6#;+	PT _ (TV happy_dollar_dollar) -> cont 7#;+	PT _ (TI happy_dollar_dollar) -> cont 8#;+	PT _ (TL happy_dollar_dollar) -> cont 9#;+	_ -> cont 10#;+	_ -> happyError' (tk:tks)+	}++happyError_ tk tks = happyError' (tk:tks)++happyThen :: () => Err a -> (a -> Err b) -> Err b+happyThen = (thenM)+happyReturn :: () => a -> Err a+happyReturn = (returnM)+happyThen1 m k tks = (thenM) m (\a -> k a tks)+happyReturn1 :: () => a -> b -> Err a+happyReturn1 = \a tks -> (returnM) a+happyError' :: () => [(Token)] -> Err a+happyError' = happyError++pDictionary tks = happySomeParser where+  happySomeParser = happyThen (happyParse 0# tks) (\x -> happyReturn (happyOut13 x))++pListEntry tks = happySomeParser where+  happySomeParser = happyThen (happyParse 1# tks) (\x -> happyReturn (happyOut14 x))++pListArg tks = happySomeParser where+  happySomeParser = happyThen (happyParse 2# tks) (\x -> happyReturn (happyOut15 x))++pListTerm tks = happySomeParser where+  happySomeParser = happyThen (happyParse 3# tks) (\x -> happyReturn (happyOut16 x))++pEntry tks = happySomeParser where+  happySomeParser = happyThen (happyParse 4# tks) (\x -> happyReturn (happyOut17 x))++pTerm tks = happySomeParser where+  happySomeParser = happyThen (happyParse 5# tks) (\x -> happyReturn (happyOut18 x))++pArg tks = happySomeParser where+  happySomeParser = happyThen (happyParse 6# tks) (\x -> happyReturn (happyOut19 x))++happySeq = happyDontSeq+++returnM :: a -> Err a+returnM = return++thenM :: Err a -> (a -> Err b) -> Err b+thenM = (>>=)++happyError :: [Token] -> Err a+happyError ts =+  Bad $ "syntax error at " ++ tokenPos ts ++ +  case ts of+    [] -> []+    [Err _] -> " due to lexer error"+    _ -> " before " ++ unwords (map prToken (take 4 ts))++myLexer = tokens+{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "<built-in>" #-}+{-# LINE 1 "<command-line>" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+-- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp ++{-# LINE 28 "templates/GenericTemplate.hs" #-}+++data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList++++++{-# LINE 49 "templates/GenericTemplate.hs" #-}++{-# LINE 59 "templates/GenericTemplate.hs" #-}++{-# LINE 68 "templates/GenericTemplate.hs" #-}++infixr 9 `HappyStk`+data HappyStk a = HappyStk a (HappyStk a)++-----------------------------------------------------------------------------+-- starting the parse++happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll++-----------------------------------------------------------------------------+-- Accepting the parse++-- If the current token is 0#, it means we've just accepted a partial+-- parse (a %partial parser).  We must ignore the saved token on the top of+-- the stack in this case.+happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =+	happyReturn1 ans+happyAccept j tk st sts (HappyStk ans _) = +	(happyTcHack j (happyTcHack st)) (happyReturn1 ans)++-----------------------------------------------------------------------------+-- Arrays only: do the next action++++happyDoAction i tk st+	= {- nothing -}+++	  case action of+		0#		  -> {- nothing -}+				     happyFail i tk st+		-1# 	  -> {- nothing -}+				     happyAccept i tk st+		n | (n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}++				     (happyReduceArr Happy_Data_Array.! rule) i tk st+				     where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))+		n		  -> {- nothing -}+++				     happyShift new_state i tk st+				     where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))+   where off    = indexShortOffAddr happyActOffsets st+	 off_i  = (off Happy_GHC_Exts.+# i)+	 check  = if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#))+			then (indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==#  i)+			else False+ 	 action | check     = indexShortOffAddr happyTable off_i+		| otherwise = indexShortOffAddr happyDefActions st++{-# LINE 127 "templates/GenericTemplate.hs" #-}+++indexShortOffAddr (HappyA# arr) off =+#if __GLASGOW_HASKELL__ > 500+	Happy_GHC_Exts.narrow16Int# i+#elif __GLASGOW_HASKELL__ == 500+	Happy_GHC_Exts.intToInt16# i+#else+	Happy_GHC_Exts.iShiftRA# (Happy_GHC_Exts.iShiftL# i 16#) 16#+#endif+  where+#if __GLASGOW_HASKELL__ >= 503+	i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low)+#else+	i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.shiftL# high 8#) low)+#endif+	high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#)))+	low  = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr off'))+	off' = off Happy_GHC_Exts.*# 2#++++++data HappyAddr = HappyA# Happy_GHC_Exts.Addr#+++++-----------------------------------------------------------------------------+-- HappyState data type (not arrays)++{-# LINE 170 "templates/GenericTemplate.hs" #-}++-----------------------------------------------------------------------------+-- Shifting a token++happyShift new_state 0# tk st sts stk@(x `HappyStk` _) =+     let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in+--     trace "shifting the error token" $+     happyDoAction i tk new_state (HappyCons (st) (sts)) (stk)++happyShift new_state i tk st sts stk =+     happyNewToken new_state (HappyCons (st) (sts)) ((happyInTok (tk))`HappyStk`stk)++-- happyReduce is specialised for the common cases.++happySpecReduce_0 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_0 nt fn j tk st@((action)) sts stk+     = happyGoto nt j tk st (HappyCons (st) (sts)) (fn `HappyStk` stk)++happySpecReduce_1 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_1 nt fn j tk _ sts@((HappyCons (st@(action)) (_))) (v1`HappyStk`stk')+     = let r = fn v1 in+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))++happySpecReduce_2 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_2 nt fn j tk _ (HappyCons (_) (sts@((HappyCons (st@(action)) (_))))) (v1`HappyStk`v2`HappyStk`stk')+     = let r = fn v1 v2 in+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))++happySpecReduce_3 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_3 nt fn j tk _ (HappyCons (_) ((HappyCons (_) (sts@((HappyCons (st@(action)) (_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')+     = let r = fn v1 v2 v3 in+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))++happyReduce k i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happyReduce k nt fn j tk st sts stk+     = case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of+	 sts1@((HappyCons (st1@(action)) (_))) ->+        	let r = fn stk in  -- it doesn't hurt to always seq here...+       		happyDoSeq r (happyGoto nt j tk st1 sts1 r)++happyMonadReduce k nt fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happyMonadReduce k nt fn j tk st sts stk =+        happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))+       where sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))+             drop_stk = happyDropStk k stk++happyMonad2Reduce k nt fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happyMonad2Reduce k nt fn j tk st sts stk =+       happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))+       where sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))+             drop_stk = happyDropStk k stk++             off    = indexShortOffAddr happyGotoOffsets st1+             off_i  = (off Happy_GHC_Exts.+# nt)+             new_state = indexShortOffAddr happyTable off_i+++++happyDrop 0# l = l+happyDrop n (HappyCons (_) (t)) = happyDrop (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) t++happyDropStk 0# l = l+happyDropStk n (x `HappyStk` xs) = happyDropStk (n Happy_GHC_Exts.-# (1#::Happy_GHC_Exts.Int#)) xs++-----------------------------------------------------------------------------+-- Moving to a new state after a reduction+++happyGoto nt j tk st = +   {- nothing -}+   happyDoAction j tk new_state+   where off    = indexShortOffAddr happyGotoOffsets st+	 off_i  = (off Happy_GHC_Exts.+# nt)+ 	 new_state = indexShortOffAddr happyTable off_i+++++-----------------------------------------------------------------------------+-- Error recovery (0# is the error token)++-- parse error if we are in recovery and we fail again+happyFail  0# tk old_st _ stk =+--	trace "failing" $ +    	happyError_ tk++{-  We don't need state discarding for our restricted implementation of+    "error".  In fact, it can cause some bogus parses, so I've disabled it+    for now --SDM++-- discard a state+happyFail  0# tk old_st (HappyCons ((action)) (sts)) +						(saved_tok `HappyStk` _ `HappyStk` stk) =+--	trace ("discarding state, depth " ++ show (length stk))  $+	happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))+-}++-- Enter error recovery: generate an error token,+--                       save the old token and carry on.+happyFail  i tk (action) sts stk =+--      trace "entering error recovery" $+	happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)++-- Internal happy errors:++notHappyAtAll = error "Internal Happy error\n"++-----------------------------------------------------------------------------+-- Hack to get the typechecker to accept our action functions+++happyTcHack :: Happy_GHC_Exts.Int# -> a -> a+happyTcHack x y = y+{-# INLINE happyTcHack #-}+++-----------------------------------------------------------------------------+-- Seq-ing.  If the --strict flag is given, then Happy emits +--	happySeq = happyDoSeq+-- otherwise it emits+-- 	happySeq = happyDontSeq++happyDoSeq, happyDontSeq :: a -> b -> b+happyDoSeq   a b = a `seq` b+happyDontSeq a b = b++-----------------------------------------------------------------------------+-- Don't inline any functions from the template.  GHC has a nasty habit+-- of deciding to inline happyGoto everywhere, which increases the size of+-- the generated parser quite a bit.+++{-# NOINLINE happyDoAction #-}+{-# NOINLINE happyTable #-}+{-# NOINLINE happyCheck #-}+{-# NOINLINE happyActOffsets #-}+{-# NOINLINE happyGotoOffsets #-}+{-# NOINLINE happyDefActions #-}++{-# NOINLINE happyShift #-}+{-# NOINLINE happySpecReduce_0 #-}+{-# NOINLINE happySpecReduce_1 #-}+{-# NOINLINE happySpecReduce_2 #-}+{-# NOINLINE happySpecReduce_3 #-}+{-# NOINLINE happyReduce #-}+{-# NOINLINE happyMonadReduce #-}+{-# NOINLINE happyGoto #-}+{-# NOINLINE happyFail #-}++-- end of Happy Template.
+ dist/build/fsv/fsv-tmp/Dict/Lex.hs view
@@ -0,0 +1,339 @@+{-# OPTIONS -fglasgow-exts -cpp #-}+{-# LINE 3 "src/lib/Dict/Lex.x" #-}++{-# OPTIONS -fno-warn-incomplete-patterns #-}+module Dict.Lex where+import UTF8+++#if __GLASGOW_HASKELL__ >= 603+#include "ghcconfig.h"+#elif defined(__GLASGOW_HASKELL__)+#include "config.h"+#endif+#if __GLASGOW_HASKELL__ >= 503+import Data.Array+import Data.Char (ord)+import Data.Array.Base (unsafeAt)+#else+import Array+import Char (ord)+#endif+#if __GLASGOW_HASKELL__ >= 503+import GHC.Exts+#else+import GlaExts+#endif+alex_base :: AlexAddr+alex_base = AlexA# "\xf8\xff\xff\xff\xfc\xff\xff\xff\xfd\xff\xff\xff\xdb\xff\xff\xff\xdc\xff\xff\xff\x00\x00\x00\x00\xf9\xff\xff\xff\xfa\xff\xff\xff\xdd\xff\xff\xff\xde\xff\xff\xff\xdf\xff\xff\xff\x12\x00\x00\x00\x00\x00\x00\x00\xf8\x00\x00\x00\x78\x01\x00\x00\x00\x00\x00\x00\x73\x00\x00\x00\x93\x00\x00\x00\x31\x00\x00\x00\x4e\x00\x00\x00"#++alex_table :: AlexAddr+alex_table = AlexA# "\x00\x00\x0b\x00\x0b\x00\x0b\x00\x0b\x00\x0b\x00\xff\xff\xff\xff\x01\x00\x07\x00\x07\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x10\x00\x0b\x00\x0b\x00\x0b\x00\x0b\x00\x0b\x00\x0c\x00\x0c\x00\x00\x00\x00\x00\x0c\x00\x03\x00\x07\x00\x06\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x0b\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0a\x00\x00\x00\x0c\x00\x04\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x00\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x12\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x12\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#++alex_check :: AlexAddr+alex_check = AlexA# "\xff\xff\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0a\x00\x0a\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x20\x00\xff\xff\x22\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x28\x00\x29\x00\xff\xff\xff\xff\x2c\x00\x2d\x00\x2d\x00\x2d\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x20\x00\x3b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\x27\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\xff\xff\x7d\x00\x7d\x00\x7d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0a\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0a\x00\xff\xff\x6e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x74\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\xff\xff\xff\xff\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\x5c\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\x5c\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\xff\xff\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xff\xff\x60\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\xff\xff\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xff\xff\x60\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#++alex_deflt :: AlexAddr+alex_deflt = AlexA# "\xff\xff\x02\x00\x02\x00\xff\xff\x09\x00\xff\xff\x09\x00\x09\x00\x09\x00\x09\x00\xff\xff\xff\xff\xff\xff\x0e\x00\x0e\x00\xff\xff\x11\x00\x11\x00\xff\xff\xff\xff"#++alex_accept = listArray (0::Int,19) [[],[(AlexAccSkip)],[(AlexAccSkip)],[],[(AlexAccSkip)],[(AlexAccSkip)],[],[],[],[],[(AlexAcc (alex_action_3))],[(AlexAccSkip)],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_4))],[(AlexAcc (alex_action_4))],[(AlexAcc (alex_action_5))],[],[],[],[(AlexAcc (alex_action_6))]]+{-# LINE 34 "src/lib/Dict/Lex.x" #-}+++tok f p s = f p s++share :: String -> String+share = decodeUTF8++data Tok =+   TS !String     -- reserved words and symbols+ | TL !String     -- string literals+ | TI !String     -- integer literals+ | TV !String     -- identifiers+ | TD !String     -- double precision float literals+ | TC !String     -- character literals++ deriving (Eq,Show,Ord)++data Token = +   PT  Posn Tok+ | Err Posn+  deriving (Eq,Show,Ord)++tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l+tokenPos (Err (Pn _ l _) :_) = "line " ++ show l+tokenPos _ = "end of file"++posLineCol (Pn _ l c) = (l,c)+mkPosToken t@(PT p _) = (posLineCol p, prToken t)++prToken t = case t of+  PT _ (TS s) -> s+  PT _ (TI s) -> s+  PT _ (TV s) -> s+  PT _ (TD s) -> s+  PT _ (TC s) -> s++  _ -> show t++data BTree = N | B String Tok BTree BTree deriving (Show)++eitherResIdent :: (String -> Tok) -> String -> Tok+eitherResIdent tv s = treeFind resWords+  where+  treeFind N = tv s+  treeFind (B a t left right) | s < a  = treeFind left+                              | s > a  = treeFind right+                              | s == a = t++resWords = N+   where b s = B s (TS s)++unescapeInitTail :: String -> String+unescapeInitTail = unesc . tail where+  unesc s = case s of+    '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs+    '\\':'n':cs  -> '\n' : unesc cs+    '\\':'t':cs  -> '\t' : unesc cs+    '"':[]    -> []+    c:cs      -> c : unesc cs+    _         -> []++-------------------------------------------------------------------+-- Alex wrapper code.+-- A modified "posn" wrapper.+-------------------------------------------------------------------++data Posn = Pn !Int !Int !Int+      deriving (Eq, Show,Ord)++alexStartPos :: Posn+alexStartPos = Pn 0 1 1++alexMove :: Posn -> Char -> Posn+alexMove (Pn a l c) '\t' = Pn (a+1)  l     (((c+7) `div` 8)*8+1)+alexMove (Pn a l c) '\n' = Pn (a+1) (l+1)   1+alexMove (Pn a l c) _    = Pn (a+1)  l     (c+1)++type AlexInput = (Posn, -- current position,+               Char,     -- previous char+               String)   -- current input string++tokens :: String -> [Token]+tokens str = go (alexStartPos, '\n', str)+    where+      go :: (Posn, Char, String) -> [Token]+      go inp@(pos, _, str) =+               case alexScan inp 0 of+                AlexEOF                -> []+                AlexError (pos, _, _)  -> [Err pos]+                AlexSkip  inp' len     -> go inp'+                AlexToken inp' len act -> act pos (take len str) : (go inp')++alexGetChar :: AlexInput -> Maybe (Char,AlexInput)+alexGetChar (p, c, [])    = Nothing+alexGetChar (p, _, (c:s)) =+    let p' = alexMove p c+     in p' `seq` Just (c, (p', c, s))++alexInputPrevChar :: AlexInput -> Char+alexInputPrevChar (p, c, s) = c++alex_action_3 =  tok (\p s -> PT p (TS $ share s)) +alex_action_4 =  tok (\p s -> PT p (eitherResIdent (TV . share) s)) +alex_action_5 =  tok (\p s -> PT p (TL $ share $ unescapeInitTail s)) +alex_action_6 =  tok (\p s -> PT p (TI $ share s))    +{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "<built-in>" #-}+{-# LINE 1 "<command-line>" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+-- -----------------------------------------------------------------------------+-- ALEX TEMPLATE+--+-- This code is in the PUBLIC DOMAIN; you may copy it freely and use+-- it for any purpose whatsoever.++-- -----------------------------------------------------------------------------+-- INTERNALS and main scanner engine++{-# LINE 37 "templates/GenericTemplate.hs" #-}++{-# LINE 47 "templates/GenericTemplate.hs" #-}+++data AlexAddr = AlexA# Addr#++#if __GLASGOW_HASKELL__ < 503+uncheckedShiftL# = shiftL#+#endif++{-# INLINE alexIndexInt16OffAddr #-}+alexIndexInt16OffAddr (AlexA# arr) off =+#ifdef WORDS_BIGENDIAN+  narrow16Int# i+  where+	i    = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low)+	high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))+	low  = int2Word# (ord# (indexCharOffAddr# arr off'))+	off' = off *# 2#+#else+  indexInt16OffAddr# arr off+#endif++++++{-# INLINE alexIndexInt32OffAddr #-}+alexIndexInt32OffAddr (AlexA# arr) off = +#ifdef WORDS_BIGENDIAN+  narrow32Int# i+  where+   i    = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#`+		     (b2 `uncheckedShiftL#` 16#) `or#`+		     (b1 `uncheckedShiftL#` 8#) `or#` b0)+   b3   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 3#)))+   b2   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 2#)))+   b1   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))+   b0   = int2Word# (ord# (indexCharOffAddr# arr off'))+   off' = off *# 4#+#else+  indexInt32OffAddr# arr off+#endif++++++#if __GLASGOW_HASKELL__ < 503+quickIndex arr i = arr ! i+#else+-- GHC >= 503, unsafeAt is available from Data.Array.Base.+quickIndex = unsafeAt+#endif+++++-- -----------------------------------------------------------------------------+-- Main lexing routines++data AlexReturn a+  = AlexEOF+  | AlexError  !AlexInput+  | AlexSkip   !AlexInput !Int+  | AlexToken  !AlexInput !Int a++-- alexScan :: AlexInput -> StartCode -> AlexReturn a+alexScan input (I# (sc))+  = alexScanUser undefined input (I# (sc))++alexScanUser user input (I# (sc))+  = case alex_scan_tkn user input 0# input sc AlexNone of+	(AlexNone, input') ->+		case alexGetChar input of+			Nothing -> ++++				   AlexEOF+			Just _ ->++++				   AlexError input'++	(AlexLastSkip input'' len, _) ->++++		AlexSkip input'' len++	(AlexLastAcc k input''' len, _) ->++++		AlexToken input''' len k+++-- Push the input through the DFA, remembering the most recent accepting+-- state it encountered.++alex_scan_tkn user orig_input len input s last_acc =+  input `seq` -- strict in the input+  let +	new_acc = check_accs (alex_accept `quickIndex` (I# (s)))+  in+  new_acc `seq`+  case alexGetChar input of+     Nothing -> (new_acc, input)+     Just (c, new_input) -> ++++	let+		!(base) = alexIndexInt32OffAddr alex_base s+		!((I# (ord_c))) = ord c+		!(offset) = (base +# ord_c)+		!(check)  = alexIndexInt16OffAddr alex_check offset+		+		!(new_s) = if (offset >=# 0#) && (check ==# ord_c)+			  then alexIndexInt16OffAddr alex_table offset+			  else alexIndexInt16OffAddr alex_deflt s+	in+	case new_s of +	    -1# -> (new_acc, input)+		-- on an error, we want to keep the input *before* the+		-- character that failed, not after.+    	    _ -> alex_scan_tkn user orig_input (len +# 1#) +			new_input new_s new_acc++  where+	check_accs [] = last_acc+	check_accs (AlexAcc a : _) = AlexLastAcc a input (I# (len))+	check_accs (AlexAccSkip : _)  = AlexLastSkip  input (I# (len))+	check_accs (AlexAccPred a predx : rest)+	   | predx user orig_input (I# (len)) input+	   = AlexLastAcc a input (I# (len))+	check_accs (AlexAccSkipPred predx : rest)+	   | predx user orig_input (I# (len)) input+	   = AlexLastSkip input (I# (len))+	check_accs (_ : rest) = check_accs rest++data AlexLastAcc a+  = AlexNone+  | AlexLastAcc a !AlexInput !Int+  | AlexLastSkip  !AlexInput !Int++data AlexAcc a user+  = AlexAcc a+  | AlexAccSkip+  | AlexAccPred a (AlexAccPred user)+  | AlexAccSkipPred (AlexAccPred user)++type AlexAccPred user = user -> AlexInput -> Int -> AlexInput -> Bool++-- -----------------------------------------------------------------------------+-- Predicates on a rule++alexAndPred p1 p2 user in1 len in2+  = p1 user in1 len in2 && p2 user in1 len in2++--alexPrevCharIsPred :: Char -> AlexAccPred _ +alexPrevCharIs c _ input _ _ = c == alexInputPrevChar input++--alexPrevCharIsOneOfPred :: Array Char Bool -> AlexAccPred _ +alexPrevCharIsOneOf arr _ input _ _ = arr ! alexInputPrevChar input++--alexRightContext :: Int -> AlexAccPred _+alexRightContext (I# (sc)) user _ _ input = +     case alex_scan_tkn user input 0# input sc AlexNone of+	  (AlexNone, _) -> False+	  _ -> True+	-- TODO: there's no need to find the longest+	-- match when checking the right context, just+	-- the first match will do.++-- used by wrappers+iUnbox (I# (i)) = i
+ dist/build/fsv/fsv-tmp/Dict/Par.hs view
@@ -0,0 +1,609 @@+{-# OPTIONS_GHC -fno-warn-overlapping-patterns #-}+{-# OPTIONS -fglasgow-exts -cpp #-}+{-# OPTIONS -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-}+module Dict.Par where+import Dict.Abs+import Dict.Lex+import Dict.ErrM+#if __GLASGOW_HASKELL__ >= 503+import qualified Data.Array as Happy_Data_Array+#else+import qualified Array as Happy_Data_Array+#endif+#if __GLASGOW_HASKELL__ >= 503+import qualified GHC.Exts as Happy_GHC_Exts+#else+import qualified GlaExts as Happy_GHC_Exts+#endif++-- parser produced by Happy Version 1.18.4++newtype HappyAbsSyn  = HappyAbsSyn HappyAny+#if __GLASGOW_HASKELL__ >= 607+type HappyAny = Happy_GHC_Exts.Any+#else+type HappyAny = forall a . a+#endif+happyIn10 :: (Ident) -> (HappyAbsSyn )+happyIn10 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn10 #-}+happyOut10 :: (HappyAbsSyn ) -> (Ident)+happyOut10 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut10 #-}+happyIn11 :: (Integer) -> (HappyAbsSyn )+happyIn11 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn11 #-}+happyOut11 :: (HappyAbsSyn ) -> (Integer)+happyOut11 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut11 #-}+happyIn12 :: (String) -> (HappyAbsSyn )+happyIn12 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn12 #-}+happyOut12 :: (HappyAbsSyn ) -> (String)+happyOut12 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut12 #-}+happyIn13 :: (Dictionary) -> (HappyAbsSyn )+happyIn13 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn13 #-}+happyOut13 :: (HappyAbsSyn ) -> (Dictionary)+happyOut13 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut13 #-}+happyIn14 :: ([Entry]) -> (HappyAbsSyn )+happyIn14 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn14 #-}+happyOut14 :: (HappyAbsSyn ) -> ([Entry])+happyOut14 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut14 #-}+happyIn15 :: ([Arg]) -> (HappyAbsSyn )+happyIn15 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn15 #-}+happyOut15 :: (HappyAbsSyn ) -> ([Arg])+happyOut15 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut15 #-}+happyIn16 :: ([Term]) -> (HappyAbsSyn )+happyIn16 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn16 #-}+happyOut16 :: (HappyAbsSyn ) -> ([Term])+happyOut16 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut16 #-}+happyIn17 :: (Entry) -> (HappyAbsSyn )+happyIn17 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn17 #-}+happyOut17 :: (HappyAbsSyn ) -> (Entry)+happyOut17 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut17 #-}+happyIn18 :: (Term) -> (HappyAbsSyn )+happyIn18 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn18 #-}+happyOut18 :: (HappyAbsSyn ) -> (Term)+happyOut18 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut18 #-}+happyIn19 :: (Arg) -> (HappyAbsSyn )+happyIn19 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn19 #-}+happyOut19 :: (HappyAbsSyn ) -> (Arg)+happyOut19 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut19 #-}+happyInTok :: (Token) -> (HappyAbsSyn )+happyInTok x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyInTok #-}+happyOutTok :: (HappyAbsSyn ) -> (Token)+happyOutTok x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOutTok #-}+++happyActOffsets :: HappyAddr+happyActOffsets = HappyA# "\x00\x00\x00\x00\x00\x00\xfd\xff\x41\x00\xfd\xff\xfd\xff\x41\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3a\x00\x00\x00\x00\x00\x3f\x00\x38\x00\x00\x00\x00\x00\x38\x00\x38\x00\x40\x00\x36\x00\x11\x00\x35\x00\x32\x00\x31\x00\x00\x00\xfd\xff\x33\x00\xfd\xff\x23\x00\xfd\xff\x00\x00\x00\x00\x16\x00\x00\x00\x00\x00\x00\x00"#++happyGotoOffsets :: HappyAddr+happyGotoOffsets = HappyA# "\x30\x00\x0c\x00\x21\x00\x1f\x00\x12\x00\x22\x00\x2f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x08\x00\x00\x00\x08\x00\x00\x00\x00\x00\x15\x00\x2c\x00\x0b\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#++happyDefActions :: HappyAddr+happyDefActions = HappyA# "\xf4\xff\xf4\xff\xf2\xff\xf0\xff\x00\x00\x00\x00\x00\x00\x00\x00\xf8\xff\xe9\xff\xe8\xff\xe7\xff\x00\x00\xf7\xff\xf6\xff\xe9\xff\x00\x00\xea\xff\xf2\xff\x00\x00\x00\x00\xef\xff\x00\x00\x00\x00\x00\x00\xf5\xff\x00\x00\xf1\xff\xf0\xff\xed\xff\xf0\xff\x00\x00\xf0\xff\xee\xff\xf3\xff\x00\x00\xeb\xff\xec\xff"#++happyCheck :: HappyAddr+happyCheck = HappyA# "\xff\xff\x00\x00\x01\x00\x02\x00\x07\x00\x08\x00\x09\x00\x06\x00\x00\x00\x08\x00\x09\x00\x00\x00\x01\x00\x02\x00\x05\x00\x07\x00\x04\x00\x06\x00\x00\x00\x08\x00\x09\x00\x00\x00\x01\x00\x02\x00\x07\x00\x07\x00\x04\x00\x06\x00\x0b\x00\x08\x00\x09\x00\x00\x00\x01\x00\x02\x00\x00\x00\x01\x00\x02\x00\x06\x00\x05\x00\x08\x00\x09\x00\x06\x00\x08\x00\x09\x00\x00\x00\x01\x00\x02\x00\x00\x00\x01\x00\x02\x00\x01\x00\x03\x00\x04\x00\x09\x00\x03\x00\xff\xff\x09\x00\x07\x00\x07\x00\x08\x00\x09\x00\x07\x00\x08\x00\x09\x00\x0b\x00\x0b\x00\x02\x00\x0b\x00\x05\x00\x0b\x00\xff\xff\xff\xff\x07\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#++happyTable :: HappyAddr+happyTable = HappyA# "\x00\x00\x0f\x00\x0a\x00\x0b\x00\x09\x00\x0e\x00\x0f\x00\x23\x00\x12\x00\x15\x00\x11\x00\x0f\x00\x0a\x00\x0b\x00\x1d\x00\x1a\x00\x17\x00\x1f\x00\x12\x00\x15\x00\x11\x00\x0f\x00\x0a\x00\x0b\x00\x09\x00\x13\x00\x26\x00\x21\x00\xff\xff\x15\x00\x11\x00\x0f\x00\x0a\x00\x0b\x00\x0f\x00\x0a\x00\x0b\x00\x14\x00\x16\x00\x15\x00\x11\x00\x25\x00\x10\x00\x11\x00\x09\x00\x0a\x00\x0b\x00\x09\x00\x0a\x00\x0b\x00\x23\x00\x18\x00\x19\x00\x1b\x00\x21\x00\x00\x00\x0c\x00\x09\x00\x09\x00\x0e\x00\x0f\x00\x09\x00\x0e\x00\x0f\x00\xff\xff\xff\xff\x1d\x00\xff\xff\x1f\x00\xff\xff\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#++happyReduceArr = Happy_Data_Array.array (7, 24) [+	(7 , happyReduce_7),+	(8 , happyReduce_8),+	(9 , happyReduce_9),+	(10 , happyReduce_10),+	(11 , happyReduce_11),+	(12 , happyReduce_12),+	(13 , happyReduce_13),+	(14 , happyReduce_14),+	(15 , happyReduce_15),+	(16 , happyReduce_16),+	(17 , happyReduce_17),+	(18 , happyReduce_18),+	(19 , happyReduce_19),+	(20 , happyReduce_20),+	(21 , happyReduce_21),+	(22 , happyReduce_22),+	(23 , happyReduce_23),+	(24 , happyReduce_24)+	]++happy_n_terms = 12 :: Int+happy_n_nonterms = 10 :: Int++happyReduce_7 = happySpecReduce_1  0# happyReduction_7+happyReduction_7 happy_x_1+	 =  case happyOutTok happy_x_1 of { (PT _ (TV happy_var_1)) -> +	happyIn10+		 (Ident happy_var_1+	)}++happyReduce_8 = happySpecReduce_1  1# happyReduction_8+happyReduction_8 happy_x_1+	 =  case happyOutTok happy_x_1 of { (PT _ (TI happy_var_1)) -> +	happyIn11+		 ((read happy_var_1) :: Integer+	)}++happyReduce_9 = happySpecReduce_1  2# happyReduction_9+happyReduction_9 happy_x_1+	 =  case happyOutTok happy_x_1 of { (PT _ (TL happy_var_1)) -> +	happyIn12+		 (happy_var_1+	)}++happyReduce_10 = happySpecReduce_1  3# happyReduction_10+happyReduction_10 happy_x_1+	 =  case happyOut14 happy_x_1 of { happy_var_1 -> +	happyIn13+		 (Dict (reverse happy_var_1)+	)}++happyReduce_11 = happySpecReduce_0  4# happyReduction_11+happyReduction_11  =  happyIn14+		 ([]+	)++happyReduce_12 = happySpecReduce_3  4# happyReduction_12+happyReduction_12 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut14 happy_x_1 of { happy_var_1 -> +	case happyOut17 happy_x_2 of { happy_var_2 -> +	happyIn14+		 (flip (:) happy_var_1 happy_var_2+	)}}++happyReduce_13 = happySpecReduce_0  5# happyReduction_13+happyReduction_13  =  happyIn15+		 ([]+	)++happyReduce_14 = happySpecReduce_2  5# happyReduction_14+happyReduction_14 happy_x_2+	happy_x_1+	 =  case happyOut15 happy_x_1 of { happy_var_1 -> +	case happyOut19 happy_x_2 of { happy_var_2 -> +	happyIn15+		 (flip (:) happy_var_1 happy_var_2+	)}}++happyReduce_15 = happySpecReduce_0  6# happyReduction_15+happyReduction_15  =  happyIn16+		 ([]+	)++happyReduce_16 = happySpecReduce_1  6# happyReduction_16+happyReduction_16 happy_x_1+	 =  case happyOut18 happy_x_1 of { happy_var_1 -> +	happyIn16+		 ((:[]) happy_var_1+	)}++happyReduce_17 = happySpecReduce_3  6# happyReduction_17+happyReduction_17 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut18 happy_x_1 of { happy_var_1 -> +	case happyOut16 happy_x_3 of { happy_var_3 -> +	happyIn16+		 ((:) happy_var_1 happy_var_3+	)}}++happyReduce_18 = happySpecReduce_2  7# happyReduction_18+happyReduction_18 happy_x_2+	happy_x_1+	 =  case happyOut10 happy_x_1 of { happy_var_1 -> +	case happyOut15 happy_x_2 of { happy_var_2 -> +	happyIn17+		 (E happy_var_1 (reverse happy_var_2)+	)}}++happyReduce_19 = happyReduce 5# 7# happyReduction_19+happyReduction_19 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut10 happy_x_1 of { happy_var_1 -> +	case happyOut15 happy_x_2 of { happy_var_2 -> +	case happyOut16 happy_x_4 of { happy_var_4 -> +	happyIn17+		 (EA happy_var_1 (reverse happy_var_2) happy_var_4+	) `HappyStk` happyRest}}}++happyReduce_20 = happyReduce 4# 8# happyReduction_20+happyReduction_20 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut10 happy_x_1 of { happy_var_1 -> +	case happyOut16 happy_x_3 of { happy_var_3 -> +	happyIn18+		 (TermC happy_var_1 happy_var_3+	) `HappyStk` happyRest}}++happyReduce_21 = happySpecReduce_1  8# happyReduction_21+happyReduction_21 happy_x_1+	 =  case happyOut19 happy_x_1 of { happy_var_1 -> +	happyIn18+		 (TermA happy_var_1+	)}++happyReduce_22 = happySpecReduce_1  9# happyReduction_22+happyReduction_22 happy_x_1+	 =  case happyOut10 happy_x_1 of { happy_var_1 -> +	happyIn19+		 (NId happy_var_1+	)}++happyReduce_23 = happySpecReduce_1  9# happyReduction_23+happyReduction_23 happy_x_1+	 =  case happyOut11 happy_x_1 of { happy_var_1 -> +	happyIn19+		 (NArg happy_var_1+	)}++happyReduce_24 = happySpecReduce_1  9# happyReduction_24+happyReduction_24 happy_x_1+	 =  case happyOut12 happy_x_1 of { happy_var_1 -> +	happyIn19+		 (NStr happy_var_1+	)}++happyNewToken action sts stk [] =+	happyDoAction 11# notHappyAtAll action sts stk []++happyNewToken action sts stk (tk:tks) =+	let cont i = happyDoAction i tk action sts stk tks in+	case tk of {+	PT _ (TS ";") -> cont 1#;+	PT _ (TS ",") -> cont 2#;+	PT _ (TS "{") -> cont 3#;+	PT _ (TS "}") -> cont 4#;+	PT _ (TS "(") -> cont 5#;+	PT _ (TS ")") -> cont 6#;+	PT _ (TV happy_dollar_dollar) -> cont 7#;+	PT _ (TI happy_dollar_dollar) -> cont 8#;+	PT _ (TL happy_dollar_dollar) -> cont 9#;+	_ -> cont 10#;+	_ -> happyError' (tk:tks)+	}++happyError_ tk tks = happyError' (tk:tks)++happyThen :: () => Err a -> (a -> Err b) -> Err b+happyThen = (thenM)+happyReturn :: () => a -> Err a+happyReturn = (returnM)+happyThen1 m k tks = (thenM) m (\a -> k a tks)+happyReturn1 :: () => a -> b -> Err a+happyReturn1 = \a tks -> (returnM) a+happyError' :: () => [(Token)] -> Err a+happyError' = happyError++pDictionary tks = happySomeParser where+  happySomeParser = happyThen (happyParse 0# tks) (\x -> happyReturn (happyOut13 x))++pListEntry tks = happySomeParser where+  happySomeParser = happyThen (happyParse 1# tks) (\x -> happyReturn (happyOut14 x))++pListArg tks = happySomeParser where+  happySomeParser = happyThen (happyParse 2# tks) (\x -> happyReturn (happyOut15 x))++pListTerm tks = happySomeParser where+  happySomeParser = happyThen (happyParse 3# tks) (\x -> happyReturn (happyOut16 x))++pEntry tks = happySomeParser where+  happySomeParser = happyThen (happyParse 4# tks) (\x -> happyReturn (happyOut17 x))++pTerm tks = happySomeParser where+  happySomeParser = happyThen (happyParse 5# tks) (\x -> happyReturn (happyOut18 x))++pArg tks = happySomeParser where+  happySomeParser = happyThen (happyParse 6# tks) (\x -> happyReturn (happyOut19 x))++happySeq = happyDontSeq+++returnM :: a -> Err a+returnM = return++thenM :: Err a -> (a -> Err b) -> Err b+thenM = (>>=)++happyError :: [Token] -> Err a+happyError ts =+  Bad $ "syntax error at " ++ tokenPos ts ++ +  case ts of+    [] -> []+    [Err _] -> " due to lexer error"+    _ -> " before " ++ unwords (map prToken (take 4 ts))++myLexer = tokens+{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "<built-in>" #-}+{-# LINE 1 "<command-line>" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+-- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp ++{-# LINE 28 "templates/GenericTemplate.hs" #-}+++data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList++++++{-# LINE 49 "templates/GenericTemplate.hs" #-}++{-# LINE 59 "templates/GenericTemplate.hs" #-}++{-# LINE 68 "templates/GenericTemplate.hs" #-}++infixr 9 `HappyStk`+data HappyStk a = HappyStk a (HappyStk a)++-----------------------------------------------------------------------------+-- starting the parse++happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll++-----------------------------------------------------------------------------+-- Accepting the parse++-- If the current token is 0#, it means we've just accepted a partial+-- parse (a %partial parser).  We must ignore the saved token on the top of+-- the stack in this case.+happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =+	happyReturn1 ans+happyAccept j tk st sts (HappyStk ans _) = +	(happyTcHack j (happyTcHack st)) (happyReturn1 ans)++-----------------------------------------------------------------------------+-- Arrays only: do the next action++++happyDoAction i tk st+	= {- nothing -}+++	  case action of+		0#		  -> {- nothing -}+				     happyFail i tk st+		-1# 	  -> {- nothing -}+				     happyAccept i tk st+		n | (n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}++				     (happyReduceArr Happy_Data_Array.! rule) i tk st+				     where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))+		n		  -> {- nothing -}+++				     happyShift new_state i tk st+				     where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))+   where off    = indexShortOffAddr happyActOffsets st+	 off_i  = (off Happy_GHC_Exts.+# i)+	 check  = if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#))+			then (indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==#  i)+			else False+ 	 action | check     = indexShortOffAddr happyTable off_i+		| otherwise = indexShortOffAddr happyDefActions st++{-# LINE 127 "templates/GenericTemplate.hs" #-}+++indexShortOffAddr (HappyA# arr) off =+#if __GLASGOW_HASKELL__ > 500+	Happy_GHC_Exts.narrow16Int# i+#elif __GLASGOW_HASKELL__ == 500+	Happy_GHC_Exts.intToInt16# i+#else+	Happy_GHC_Exts.iShiftRA# (Happy_GHC_Exts.iShiftL# i 16#) 16#+#endif+  where+#if __GLASGOW_HASKELL__ >= 503+	i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low)+#else+	i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.shiftL# high 8#) low)+#endif+	high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#)))+	low  = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr off'))+	off' = off Happy_GHC_Exts.*# 2#++++++data HappyAddr = HappyA# Happy_GHC_Exts.Addr#+++++-----------------------------------------------------------------------------+-- HappyState data type (not arrays)++{-# LINE 170 "templates/GenericTemplate.hs" #-}++-----------------------------------------------------------------------------+-- Shifting a token++happyShift new_state 0# tk st sts stk@(x `HappyStk` _) =+     let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in+--     trace "shifting the error token" $+     happyDoAction i tk new_state (HappyCons (st) (sts)) (stk)++happyShift new_state i tk st sts stk =+     happyNewToken new_state (HappyCons (st) (sts)) ((happyInTok (tk))`HappyStk`stk)++-- happyReduce is specialised for the common cases.++happySpecReduce_0 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_0 nt fn j tk st@((action)) sts stk+     = happyGoto nt j tk st (HappyCons (st) (sts)) (fn `HappyStk` stk)++happySpecReduce_1 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_1 nt fn j tk _ sts@((HappyCons (st@(action)) (_))) (v1`HappyStk`stk')+     = let r = fn v1 in+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))++happySpecReduce_2 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_2 nt fn j tk _ (HappyCons (_) (sts@((HappyCons (st@(action)) (_))))) (v1`HappyStk`v2`HappyStk`stk')+     = let r = fn v1 v2 in+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))++happySpecReduce_3 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_3 nt fn j tk _ (HappyCons (_) ((HappyCons (_) (sts@((HappyCons (st@(action)) (_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')+     = let r = fn v1 v2 v3 in+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))++happyReduce k i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happyReduce k nt fn j tk st sts stk+     = case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of+	 sts1@((HappyCons (st1@(action)) (_))) ->+        	let r = fn stk in  -- it doesn't hurt to always seq here...+       		happyDoSeq r (happyGoto nt j tk st1 sts1 r)++happyMonadReduce k nt fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happyMonadReduce k nt fn j tk st sts stk =+        happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))+       where sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))+             drop_stk = happyDropStk k stk++happyMonad2Reduce k nt fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happyMonad2Reduce k nt fn j tk st sts stk =+       happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))+       where sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))+             drop_stk = happyDropStk k stk++             off    = indexShortOffAddr happyGotoOffsets st1+             off_i  = (off Happy_GHC_Exts.+# nt)+             new_state = indexShortOffAddr happyTable off_i+++++happyDrop 0# l = l+happyDrop n (HappyCons (_) (t)) = happyDrop (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) t++happyDropStk 0# l = l+happyDropStk n (x `HappyStk` xs) = happyDropStk (n Happy_GHC_Exts.-# (1#::Happy_GHC_Exts.Int#)) xs++-----------------------------------------------------------------------------+-- Moving to a new state after a reduction+++happyGoto nt j tk st = +   {- nothing -}+   happyDoAction j tk new_state+   where off    = indexShortOffAddr happyGotoOffsets st+	 off_i  = (off Happy_GHC_Exts.+# nt)+ 	 new_state = indexShortOffAddr happyTable off_i+++++-----------------------------------------------------------------------------+-- Error recovery (0# is the error token)++-- parse error if we are in recovery and we fail again+happyFail  0# tk old_st _ stk =+--	trace "failing" $ +    	happyError_ tk++{-  We don't need state discarding for our restricted implementation of+    "error".  In fact, it can cause some bogus parses, so I've disabled it+    for now --SDM++-- discard a state+happyFail  0# tk old_st (HappyCons ((action)) (sts)) +						(saved_tok `HappyStk` _ `HappyStk` stk) =+--	trace ("discarding state, depth " ++ show (length stk))  $+	happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))+-}++-- Enter error recovery: generate an error token,+--                       save the old token and carry on.+happyFail  i tk (action) sts stk =+--      trace "entering error recovery" $+	happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)++-- Internal happy errors:++notHappyAtAll = error "Internal Happy error\n"++-----------------------------------------------------------------------------+-- Hack to get the typechecker to accept our action functions+++happyTcHack :: Happy_GHC_Exts.Int# -> a -> a+happyTcHack x y = y+{-# INLINE happyTcHack #-}+++-----------------------------------------------------------------------------+-- Seq-ing.  If the --strict flag is given, then Happy emits +--	happySeq = happyDoSeq+-- otherwise it emits+-- 	happySeq = happyDontSeq++happyDoSeq, happyDontSeq :: a -> b -> b+happyDoSeq   a b = a `seq` b+happyDontSeq a b = b++-----------------------------------------------------------------------------+-- Don't inline any functions from the template.  GHC has a nasty habit+-- of deciding to inline happyGoto everywhere, which increases the size of+-- the generated parser quite a bit.+++{-# NOINLINE happyDoAction #-}+{-# NOINLINE happyTable #-}+{-# NOINLINE happyCheck #-}+{-# NOINLINE happyActOffsets #-}+{-# NOINLINE happyGotoOffsets #-}+{-# NOINLINE happyDefActions #-}++{-# NOINLINE happyShift #-}+{-# NOINLINE happySpecReduce_0 #-}+{-# NOINLINE happySpecReduce_1 #-}+{-# NOINLINE happySpecReduce_2 #-}+{-# NOINLINE happySpecReduce_3 #-}+{-# NOINLINE happyReduce #-}+{-# NOINLINE happyMonadReduce #-}+{-# NOINLINE happyGoto #-}+{-# NOINLINE happyFail #-}++-- end of Happy Template.
+ dist/build/saldo/saldo-tmp/Dict/Lex.hs view
@@ -0,0 +1,339 @@+{-# OPTIONS -fglasgow-exts -cpp #-}+{-# LINE 3 "src/lib/Dict/Lex.x" #-}++{-# OPTIONS -fno-warn-incomplete-patterns #-}+module Dict.Lex where+import UTF8+++#if __GLASGOW_HASKELL__ >= 603+#include "ghcconfig.h"+#elif defined(__GLASGOW_HASKELL__)+#include "config.h"+#endif+#if __GLASGOW_HASKELL__ >= 503+import Data.Array+import Data.Char (ord)+import Data.Array.Base (unsafeAt)+#else+import Array+import Char (ord)+#endif+#if __GLASGOW_HASKELL__ >= 503+import GHC.Exts+#else+import GlaExts+#endif+alex_base :: AlexAddr+alex_base = AlexA# "\xf8\xff\xff\xff\xfc\xff\xff\xff\xfd\xff\xff\xff\xdb\xff\xff\xff\xdc\xff\xff\xff\x00\x00\x00\x00\xf9\xff\xff\xff\xfa\xff\xff\xff\xdd\xff\xff\xff\xde\xff\xff\xff\xdf\xff\xff\xff\x12\x00\x00\x00\x00\x00\x00\x00\xf8\x00\x00\x00\x78\x01\x00\x00\x00\x00\x00\x00\x73\x00\x00\x00\x93\x00\x00\x00\x31\x00\x00\x00\x4e\x00\x00\x00"#++alex_table :: AlexAddr+alex_table = AlexA# "\x00\x00\x0b\x00\x0b\x00\x0b\x00\x0b\x00\x0b\x00\xff\xff\xff\xff\x01\x00\x07\x00\x07\x00\x07\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x10\x00\x0b\x00\x0b\x00\x0b\x00\x0b\x00\x0b\x00\x0c\x00\x0c\x00\x00\x00\x00\x00\x0c\x00\x03\x00\x07\x00\x06\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x0b\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0a\x00\x00\x00\x0c\x00\x04\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x00\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x12\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x12\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\x0d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#++alex_check :: AlexAddr+alex_check = AlexA# "\xff\xff\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0a\x00\x0a\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\x2d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x20\x00\xff\xff\x22\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x28\x00\x29\x00\xff\xff\xff\xff\x2c\x00\x2d\x00\x2d\x00\x2d\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x20\x00\x3b\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x41\x00\x42\x00\x43\x00\x44\x00\x45\x00\x46\x00\x47\x00\x48\x00\x49\x00\x4a\x00\x4b\x00\x4c\x00\x4d\x00\x4e\x00\x4f\x00\x50\x00\x51\x00\x52\x00\x53\x00\x54\x00\x55\x00\x56\x00\x57\x00\x58\x00\x59\x00\x5a\x00\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\x27\x00\x61\x00\x62\x00\x63\x00\x64\x00\x65\x00\x66\x00\x67\x00\x68\x00\x69\x00\x6a\x00\x6b\x00\x6c\x00\x6d\x00\x6e\x00\x6f\x00\x70\x00\x71\x00\x72\x00\x73\x00\x74\x00\x75\x00\x76\x00\x77\x00\x78\x00\x79\x00\x7a\x00\x7b\x00\xff\xff\x7d\x00\x7d\x00\x7d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0a\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5c\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x0a\x00\xff\xff\x6e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x74\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x22\x00\xff\xff\xff\xff\xc0\x00\xc1\x00\xc2\x00\xc3\x00\xc4\x00\xc5\x00\xc6\x00\xc7\x00\xc8\x00\xc9\x00\xca\x00\xcb\x00\xcc\x00\xcd\x00\xce\x00\xcf\x00\xd0\x00\xd1\x00\xd2\x00\xd3\x00\xd4\x00\xd5\x00\xd6\x00\x5c\x00\xd8\x00\xd9\x00\xda\x00\xdb\x00\xdc\x00\xdd\x00\xde\x00\xdf\x00\xe0\x00\xe1\x00\xe2\x00\xe3\x00\xe4\x00\xe5\x00\xe6\x00\xe7\x00\xe8\x00\xe9\x00\xea\x00\xeb\x00\xec\x00\xed\x00\xee\x00\xef\x00\xf0\x00\xf1\x00\xf2\x00\xf3\x00\xf4\x00\xf5\x00\xf6\x00\x5c\x00\xf8\x00\xf9\x00\xfa\x00\xfb\x00\xfc\x00\xfd\x00\xfe\x00\xff\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\xff\xff\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xff\xff\x60\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x0f\x00\x10\x00\x11\x00\x12\x00\x13\x00\x14\x00\x15\x00\x16\x00\x17\x00\x18\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\xff\xff\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\xff\xff\x2e\x00\x2f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x5b\x00\x5c\x00\x5d\x00\x5e\x00\xff\xff\x60\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7b\x00\x7c\x00\x7d\x00\x7e\x00\x7f\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#++alex_deflt :: AlexAddr+alex_deflt = AlexA# "\xff\xff\x02\x00\x02\x00\xff\xff\x09\x00\xff\xff\x09\x00\x09\x00\x09\x00\x09\x00\xff\xff\xff\xff\xff\xff\x0e\x00\x0e\x00\xff\xff\x11\x00\x11\x00\xff\xff\xff\xff"#++alex_accept = listArray (0::Int,19) [[],[(AlexAccSkip)],[(AlexAccSkip)],[],[(AlexAccSkip)],[(AlexAccSkip)],[],[],[],[],[(AlexAcc (alex_action_3))],[(AlexAccSkip)],[(AlexAcc (alex_action_3))],[(AlexAcc (alex_action_4))],[(AlexAcc (alex_action_4))],[(AlexAcc (alex_action_5))],[],[],[],[(AlexAcc (alex_action_6))]]+{-# LINE 34 "src/lib/Dict/Lex.x" #-}+++tok f p s = f p s++share :: String -> String+share = decodeUTF8++data Tok =+   TS !String     -- reserved words and symbols+ | TL !String     -- string literals+ | TI !String     -- integer literals+ | TV !String     -- identifiers+ | TD !String     -- double precision float literals+ | TC !String     -- character literals++ deriving (Eq,Show,Ord)++data Token = +   PT  Posn Tok+ | Err Posn+  deriving (Eq,Show,Ord)++tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l+tokenPos (Err (Pn _ l _) :_) = "line " ++ show l+tokenPos _ = "end of file"++posLineCol (Pn _ l c) = (l,c)+mkPosToken t@(PT p _) = (posLineCol p, prToken t)++prToken t = case t of+  PT _ (TS s) -> s+  PT _ (TI s) -> s+  PT _ (TV s) -> s+  PT _ (TD s) -> s+  PT _ (TC s) -> s++  _ -> show t++data BTree = N | B String Tok BTree BTree deriving (Show)++eitherResIdent :: (String -> Tok) -> String -> Tok+eitherResIdent tv s = treeFind resWords+  where+  treeFind N = tv s+  treeFind (B a t left right) | s < a  = treeFind left+                              | s > a  = treeFind right+                              | s == a = t++resWords = N+   where b s = B s (TS s)++unescapeInitTail :: String -> String+unescapeInitTail = unesc . tail where+  unesc s = case s of+    '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs+    '\\':'n':cs  -> '\n' : unesc cs+    '\\':'t':cs  -> '\t' : unesc cs+    '"':[]    -> []+    c:cs      -> c : unesc cs+    _         -> []++-------------------------------------------------------------------+-- Alex wrapper code.+-- A modified "posn" wrapper.+-------------------------------------------------------------------++data Posn = Pn !Int !Int !Int+      deriving (Eq, Show,Ord)++alexStartPos :: Posn+alexStartPos = Pn 0 1 1++alexMove :: Posn -> Char -> Posn+alexMove (Pn a l c) '\t' = Pn (a+1)  l     (((c+7) `div` 8)*8+1)+alexMove (Pn a l c) '\n' = Pn (a+1) (l+1)   1+alexMove (Pn a l c) _    = Pn (a+1)  l     (c+1)++type AlexInput = (Posn, -- current position,+               Char,     -- previous char+               String)   -- current input string++tokens :: String -> [Token]+tokens str = go (alexStartPos, '\n', str)+    where+      go :: (Posn, Char, String) -> [Token]+      go inp@(pos, _, str) =+               case alexScan inp 0 of+                AlexEOF                -> []+                AlexError (pos, _, _)  -> [Err pos]+                AlexSkip  inp' len     -> go inp'+                AlexToken inp' len act -> act pos (take len str) : (go inp')++alexGetChar :: AlexInput -> Maybe (Char,AlexInput)+alexGetChar (p, c, [])    = Nothing+alexGetChar (p, _, (c:s)) =+    let p' = alexMove p c+     in p' `seq` Just (c, (p', c, s))++alexInputPrevChar :: AlexInput -> Char+alexInputPrevChar (p, c, s) = c++alex_action_3 =  tok (\p s -> PT p (TS $ share s)) +alex_action_4 =  tok (\p s -> PT p (eitherResIdent (TV . share) s)) +alex_action_5 =  tok (\p s -> PT p (TL $ share $ unescapeInitTail s)) +alex_action_6 =  tok (\p s -> PT p (TI $ share s))    +{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "<built-in>" #-}+{-# LINE 1 "<command-line>" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+-- -----------------------------------------------------------------------------+-- ALEX TEMPLATE+--+-- This code is in the PUBLIC DOMAIN; you may copy it freely and use+-- it for any purpose whatsoever.++-- -----------------------------------------------------------------------------+-- INTERNALS and main scanner engine++{-# LINE 37 "templates/GenericTemplate.hs" #-}++{-# LINE 47 "templates/GenericTemplate.hs" #-}+++data AlexAddr = AlexA# Addr#++#if __GLASGOW_HASKELL__ < 503+uncheckedShiftL# = shiftL#+#endif++{-# INLINE alexIndexInt16OffAddr #-}+alexIndexInt16OffAddr (AlexA# arr) off =+#ifdef WORDS_BIGENDIAN+  narrow16Int# i+  where+	i    = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low)+	high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))+	low  = int2Word# (ord# (indexCharOffAddr# arr off'))+	off' = off *# 2#+#else+  indexInt16OffAddr# arr off+#endif++++++{-# INLINE alexIndexInt32OffAddr #-}+alexIndexInt32OffAddr (AlexA# arr) off = +#ifdef WORDS_BIGENDIAN+  narrow32Int# i+  where+   i    = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#`+		     (b2 `uncheckedShiftL#` 16#) `or#`+		     (b1 `uncheckedShiftL#` 8#) `or#` b0)+   b3   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 3#)))+   b2   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 2#)))+   b1   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))+   b0   = int2Word# (ord# (indexCharOffAddr# arr off'))+   off' = off *# 4#+#else+  indexInt32OffAddr# arr off+#endif++++++#if __GLASGOW_HASKELL__ < 503+quickIndex arr i = arr ! i+#else+-- GHC >= 503, unsafeAt is available from Data.Array.Base.+quickIndex = unsafeAt+#endif+++++-- -----------------------------------------------------------------------------+-- Main lexing routines++data AlexReturn a+  = AlexEOF+  | AlexError  !AlexInput+  | AlexSkip   !AlexInput !Int+  | AlexToken  !AlexInput !Int a++-- alexScan :: AlexInput -> StartCode -> AlexReturn a+alexScan input (I# (sc))+  = alexScanUser undefined input (I# (sc))++alexScanUser user input (I# (sc))+  = case alex_scan_tkn user input 0# input sc AlexNone of+	(AlexNone, input') ->+		case alexGetChar input of+			Nothing -> ++++				   AlexEOF+			Just _ ->++++				   AlexError input'++	(AlexLastSkip input'' len, _) ->++++		AlexSkip input'' len++	(AlexLastAcc k input''' len, _) ->++++		AlexToken input''' len k+++-- Push the input through the DFA, remembering the most recent accepting+-- state it encountered.++alex_scan_tkn user orig_input len input s last_acc =+  input `seq` -- strict in the input+  let +	new_acc = check_accs (alex_accept `quickIndex` (I# (s)))+  in+  new_acc `seq`+  case alexGetChar input of+     Nothing -> (new_acc, input)+     Just (c, new_input) -> ++++	let+		!(base) = alexIndexInt32OffAddr alex_base s+		!((I# (ord_c))) = ord c+		!(offset) = (base +# ord_c)+		!(check)  = alexIndexInt16OffAddr alex_check offset+		+		!(new_s) = if (offset >=# 0#) && (check ==# ord_c)+			  then alexIndexInt16OffAddr alex_table offset+			  else alexIndexInt16OffAddr alex_deflt s+	in+	case new_s of +	    -1# -> (new_acc, input)+		-- on an error, we want to keep the input *before* the+		-- character that failed, not after.+    	    _ -> alex_scan_tkn user orig_input (len +# 1#) +			new_input new_s new_acc++  where+	check_accs [] = last_acc+	check_accs (AlexAcc a : _) = AlexLastAcc a input (I# (len))+	check_accs (AlexAccSkip : _)  = AlexLastSkip  input (I# (len))+	check_accs (AlexAccPred a predx : rest)+	   | predx user orig_input (I# (len)) input+	   = AlexLastAcc a input (I# (len))+	check_accs (AlexAccSkipPred predx : rest)+	   | predx user orig_input (I# (len)) input+	   = AlexLastSkip input (I# (len))+	check_accs (_ : rest) = check_accs rest++data AlexLastAcc a+  = AlexNone+  | AlexLastAcc a !AlexInput !Int+  | AlexLastSkip  !AlexInput !Int++data AlexAcc a user+  = AlexAcc a+  | AlexAccSkip+  | AlexAccPred a (AlexAccPred user)+  | AlexAccSkipPred (AlexAccPred user)++type AlexAccPred user = user -> AlexInput -> Int -> AlexInput -> Bool++-- -----------------------------------------------------------------------------+-- Predicates on a rule++alexAndPred p1 p2 user in1 len in2+  = p1 user in1 len in2 && p2 user in1 len in2++--alexPrevCharIsPred :: Char -> AlexAccPred _ +alexPrevCharIs c _ input _ _ = c == alexInputPrevChar input++--alexPrevCharIsOneOfPred :: Array Char Bool -> AlexAccPred _ +alexPrevCharIsOneOf arr _ input _ _ = arr ! alexInputPrevChar input++--alexRightContext :: Int -> AlexAccPred _+alexRightContext (I# (sc)) user _ _ input = +     case alex_scan_tkn user input 0# input sc AlexNone of+	  (AlexNone, _) -> False+	  _ -> True+	-- TODO: there's no need to find the longest+	-- match when checking the right context, just+	-- the first match will do.++-- used by wrappers+iUnbox (I# (i)) = i
+ dist/build/saldo/saldo-tmp/Dict/Par.hs view
@@ -0,0 +1,609 @@+{-# OPTIONS_GHC -fno-warn-overlapping-patterns #-}+{-# OPTIONS -fglasgow-exts -cpp #-}+{-# OPTIONS -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-}+module Dict.Par where+import Dict.Abs+import Dict.Lex+import Dict.ErrM+#if __GLASGOW_HASKELL__ >= 503+import qualified Data.Array as Happy_Data_Array+#else+import qualified Array as Happy_Data_Array+#endif+#if __GLASGOW_HASKELL__ >= 503+import qualified GHC.Exts as Happy_GHC_Exts+#else+import qualified GlaExts as Happy_GHC_Exts+#endif++-- parser produced by Happy Version 1.18.4++newtype HappyAbsSyn  = HappyAbsSyn HappyAny+#if __GLASGOW_HASKELL__ >= 607+type HappyAny = Happy_GHC_Exts.Any+#else+type HappyAny = forall a . a+#endif+happyIn10 :: (Ident) -> (HappyAbsSyn )+happyIn10 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn10 #-}+happyOut10 :: (HappyAbsSyn ) -> (Ident)+happyOut10 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut10 #-}+happyIn11 :: (Integer) -> (HappyAbsSyn )+happyIn11 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn11 #-}+happyOut11 :: (HappyAbsSyn ) -> (Integer)+happyOut11 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut11 #-}+happyIn12 :: (String) -> (HappyAbsSyn )+happyIn12 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn12 #-}+happyOut12 :: (HappyAbsSyn ) -> (String)+happyOut12 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut12 #-}+happyIn13 :: (Dictionary) -> (HappyAbsSyn )+happyIn13 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn13 #-}+happyOut13 :: (HappyAbsSyn ) -> (Dictionary)+happyOut13 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut13 #-}+happyIn14 :: ([Entry]) -> (HappyAbsSyn )+happyIn14 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn14 #-}+happyOut14 :: (HappyAbsSyn ) -> ([Entry])+happyOut14 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut14 #-}+happyIn15 :: ([Arg]) -> (HappyAbsSyn )+happyIn15 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn15 #-}+happyOut15 :: (HappyAbsSyn ) -> ([Arg])+happyOut15 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut15 #-}+happyIn16 :: ([Term]) -> (HappyAbsSyn )+happyIn16 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn16 #-}+happyOut16 :: (HappyAbsSyn ) -> ([Term])+happyOut16 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut16 #-}+happyIn17 :: (Entry) -> (HappyAbsSyn )+happyIn17 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn17 #-}+happyOut17 :: (HappyAbsSyn ) -> (Entry)+happyOut17 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut17 #-}+happyIn18 :: (Term) -> (HappyAbsSyn )+happyIn18 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn18 #-}+happyOut18 :: (HappyAbsSyn ) -> (Term)+happyOut18 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut18 #-}+happyIn19 :: (Arg) -> (HappyAbsSyn )+happyIn19 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyIn19 #-}+happyOut19 :: (HappyAbsSyn ) -> (Arg)+happyOut19 x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOut19 #-}+happyInTok :: (Token) -> (HappyAbsSyn )+happyInTok x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyInTok #-}+happyOutTok :: (HappyAbsSyn ) -> (Token)+happyOutTok x = Happy_GHC_Exts.unsafeCoerce# x+{-# INLINE happyOutTok #-}+++happyActOffsets :: HappyAddr+happyActOffsets = HappyA# "\x00\x00\x00\x00\x00\x00\xfd\xff\x41\x00\xfd\xff\xfd\xff\x41\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3a\x00\x00\x00\x00\x00\x3f\x00\x38\x00\x00\x00\x00\x00\x38\x00\x38\x00\x40\x00\x36\x00\x11\x00\x35\x00\x32\x00\x31\x00\x00\x00\xfd\xff\x33\x00\xfd\xff\x23\x00\xfd\xff\x00\x00\x00\x00\x16\x00\x00\x00\x00\x00\x00\x00"#++happyGotoOffsets :: HappyAddr+happyGotoOffsets = HappyA# "\x30\x00\x0c\x00\x21\x00\x1f\x00\x12\x00\x22\x00\x2f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x08\x00\x00\x00\x08\x00\x00\x00\x00\x00\x15\x00\x2c\x00\x0b\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#++happyDefActions :: HappyAddr+happyDefActions = HappyA# "\xf4\xff\xf4\xff\xf2\xff\xf0\xff\x00\x00\x00\x00\x00\x00\x00\x00\xf8\xff\xe9\xff\xe8\xff\xe7\xff\x00\x00\xf7\xff\xf6\xff\xe9\xff\x00\x00\xea\xff\xf2\xff\x00\x00\x00\x00\xef\xff\x00\x00\x00\x00\x00\x00\xf5\xff\x00\x00\xf1\xff\xf0\xff\xed\xff\xf0\xff\x00\x00\xf0\xff\xee\xff\xf3\xff\x00\x00\xeb\xff\xec\xff"#++happyCheck :: HappyAddr+happyCheck = HappyA# "\xff\xff\x00\x00\x01\x00\x02\x00\x07\x00\x08\x00\x09\x00\x06\x00\x00\x00\x08\x00\x09\x00\x00\x00\x01\x00\x02\x00\x05\x00\x07\x00\x04\x00\x06\x00\x00\x00\x08\x00\x09\x00\x00\x00\x01\x00\x02\x00\x07\x00\x07\x00\x04\x00\x06\x00\x0b\x00\x08\x00\x09\x00\x00\x00\x01\x00\x02\x00\x00\x00\x01\x00\x02\x00\x06\x00\x05\x00\x08\x00\x09\x00\x06\x00\x08\x00\x09\x00\x00\x00\x01\x00\x02\x00\x00\x00\x01\x00\x02\x00\x01\x00\x03\x00\x04\x00\x09\x00\x03\x00\xff\xff\x09\x00\x07\x00\x07\x00\x08\x00\x09\x00\x07\x00\x08\x00\x09\x00\x0b\x00\x0b\x00\x02\x00\x0b\x00\x05\x00\x0b\x00\xff\xff\xff\xff\x07\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"#++happyTable :: HappyAddr+happyTable = HappyA# "\x00\x00\x0f\x00\x0a\x00\x0b\x00\x09\x00\x0e\x00\x0f\x00\x23\x00\x12\x00\x15\x00\x11\x00\x0f\x00\x0a\x00\x0b\x00\x1d\x00\x1a\x00\x17\x00\x1f\x00\x12\x00\x15\x00\x11\x00\x0f\x00\x0a\x00\x0b\x00\x09\x00\x13\x00\x26\x00\x21\x00\xff\xff\x15\x00\x11\x00\x0f\x00\x0a\x00\x0b\x00\x0f\x00\x0a\x00\x0b\x00\x14\x00\x16\x00\x15\x00\x11\x00\x25\x00\x10\x00\x11\x00\x09\x00\x0a\x00\x0b\x00\x09\x00\x0a\x00\x0b\x00\x23\x00\x18\x00\x19\x00\x1b\x00\x21\x00\x00\x00\x0c\x00\x09\x00\x09\x00\x0e\x00\x0f\x00\x09\x00\x0e\x00\x0f\x00\xff\xff\xff\xff\x1d\x00\xff\xff\x1f\x00\xff\xff\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"#++happyReduceArr = Happy_Data_Array.array (7, 24) [+	(7 , happyReduce_7),+	(8 , happyReduce_8),+	(9 , happyReduce_9),+	(10 , happyReduce_10),+	(11 , happyReduce_11),+	(12 , happyReduce_12),+	(13 , happyReduce_13),+	(14 , happyReduce_14),+	(15 , happyReduce_15),+	(16 , happyReduce_16),+	(17 , happyReduce_17),+	(18 , happyReduce_18),+	(19 , happyReduce_19),+	(20 , happyReduce_20),+	(21 , happyReduce_21),+	(22 , happyReduce_22),+	(23 , happyReduce_23),+	(24 , happyReduce_24)+	]++happy_n_terms = 12 :: Int+happy_n_nonterms = 10 :: Int++happyReduce_7 = happySpecReduce_1  0# happyReduction_7+happyReduction_7 happy_x_1+	 =  case happyOutTok happy_x_1 of { (PT _ (TV happy_var_1)) -> +	happyIn10+		 (Ident happy_var_1+	)}++happyReduce_8 = happySpecReduce_1  1# happyReduction_8+happyReduction_8 happy_x_1+	 =  case happyOutTok happy_x_1 of { (PT _ (TI happy_var_1)) -> +	happyIn11+		 ((read happy_var_1) :: Integer+	)}++happyReduce_9 = happySpecReduce_1  2# happyReduction_9+happyReduction_9 happy_x_1+	 =  case happyOutTok happy_x_1 of { (PT _ (TL happy_var_1)) -> +	happyIn12+		 (happy_var_1+	)}++happyReduce_10 = happySpecReduce_1  3# happyReduction_10+happyReduction_10 happy_x_1+	 =  case happyOut14 happy_x_1 of { happy_var_1 -> +	happyIn13+		 (Dict (reverse happy_var_1)+	)}++happyReduce_11 = happySpecReduce_0  4# happyReduction_11+happyReduction_11  =  happyIn14+		 ([]+	)++happyReduce_12 = happySpecReduce_3  4# happyReduction_12+happyReduction_12 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut14 happy_x_1 of { happy_var_1 -> +	case happyOut17 happy_x_2 of { happy_var_2 -> +	happyIn14+		 (flip (:) happy_var_1 happy_var_2+	)}}++happyReduce_13 = happySpecReduce_0  5# happyReduction_13+happyReduction_13  =  happyIn15+		 ([]+	)++happyReduce_14 = happySpecReduce_2  5# happyReduction_14+happyReduction_14 happy_x_2+	happy_x_1+	 =  case happyOut15 happy_x_1 of { happy_var_1 -> +	case happyOut19 happy_x_2 of { happy_var_2 -> +	happyIn15+		 (flip (:) happy_var_1 happy_var_2+	)}}++happyReduce_15 = happySpecReduce_0  6# happyReduction_15+happyReduction_15  =  happyIn16+		 ([]+	)++happyReduce_16 = happySpecReduce_1  6# happyReduction_16+happyReduction_16 happy_x_1+	 =  case happyOut18 happy_x_1 of { happy_var_1 -> +	happyIn16+		 ((:[]) happy_var_1+	)}++happyReduce_17 = happySpecReduce_3  6# happyReduction_17+happyReduction_17 happy_x_3+	happy_x_2+	happy_x_1+	 =  case happyOut18 happy_x_1 of { happy_var_1 -> +	case happyOut16 happy_x_3 of { happy_var_3 -> +	happyIn16+		 ((:) happy_var_1 happy_var_3+	)}}++happyReduce_18 = happySpecReduce_2  7# happyReduction_18+happyReduction_18 happy_x_2+	happy_x_1+	 =  case happyOut10 happy_x_1 of { happy_var_1 -> +	case happyOut15 happy_x_2 of { happy_var_2 -> +	happyIn17+		 (E happy_var_1 (reverse happy_var_2)+	)}}++happyReduce_19 = happyReduce 5# 7# happyReduction_19+happyReduction_19 (happy_x_5 `HappyStk`+	happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut10 happy_x_1 of { happy_var_1 -> +	case happyOut15 happy_x_2 of { happy_var_2 -> +	case happyOut16 happy_x_4 of { happy_var_4 -> +	happyIn17+		 (EA happy_var_1 (reverse happy_var_2) happy_var_4+	) `HappyStk` happyRest}}}++happyReduce_20 = happyReduce 4# 8# happyReduction_20+happyReduction_20 (happy_x_4 `HappyStk`+	happy_x_3 `HappyStk`+	happy_x_2 `HappyStk`+	happy_x_1 `HappyStk`+	happyRest)+	 = case happyOut10 happy_x_1 of { happy_var_1 -> +	case happyOut16 happy_x_3 of { happy_var_3 -> +	happyIn18+		 (TermC happy_var_1 happy_var_3+	) `HappyStk` happyRest}}++happyReduce_21 = happySpecReduce_1  8# happyReduction_21+happyReduction_21 happy_x_1+	 =  case happyOut19 happy_x_1 of { happy_var_1 -> +	happyIn18+		 (TermA happy_var_1+	)}++happyReduce_22 = happySpecReduce_1  9# happyReduction_22+happyReduction_22 happy_x_1+	 =  case happyOut10 happy_x_1 of { happy_var_1 -> +	happyIn19+		 (NId happy_var_1+	)}++happyReduce_23 = happySpecReduce_1  9# happyReduction_23+happyReduction_23 happy_x_1+	 =  case happyOut11 happy_x_1 of { happy_var_1 -> +	happyIn19+		 (NArg happy_var_1+	)}++happyReduce_24 = happySpecReduce_1  9# happyReduction_24+happyReduction_24 happy_x_1+	 =  case happyOut12 happy_x_1 of { happy_var_1 -> +	happyIn19+		 (NStr happy_var_1+	)}++happyNewToken action sts stk [] =+	happyDoAction 11# notHappyAtAll action sts stk []++happyNewToken action sts stk (tk:tks) =+	let cont i = happyDoAction i tk action sts stk tks in+	case tk of {+	PT _ (TS ";") -> cont 1#;+	PT _ (TS ",") -> cont 2#;+	PT _ (TS "{") -> cont 3#;+	PT _ (TS "}") -> cont 4#;+	PT _ (TS "(") -> cont 5#;+	PT _ (TS ")") -> cont 6#;+	PT _ (TV happy_dollar_dollar) -> cont 7#;+	PT _ (TI happy_dollar_dollar) -> cont 8#;+	PT _ (TL happy_dollar_dollar) -> cont 9#;+	_ -> cont 10#;+	_ -> happyError' (tk:tks)+	}++happyError_ tk tks = happyError' (tk:tks)++happyThen :: () => Err a -> (a -> Err b) -> Err b+happyThen = (thenM)+happyReturn :: () => a -> Err a+happyReturn = (returnM)+happyThen1 m k tks = (thenM) m (\a -> k a tks)+happyReturn1 :: () => a -> b -> Err a+happyReturn1 = \a tks -> (returnM) a+happyError' :: () => [(Token)] -> Err a+happyError' = happyError++pDictionary tks = happySomeParser where+  happySomeParser = happyThen (happyParse 0# tks) (\x -> happyReturn (happyOut13 x))++pListEntry tks = happySomeParser where+  happySomeParser = happyThen (happyParse 1# tks) (\x -> happyReturn (happyOut14 x))++pListArg tks = happySomeParser where+  happySomeParser = happyThen (happyParse 2# tks) (\x -> happyReturn (happyOut15 x))++pListTerm tks = happySomeParser where+  happySomeParser = happyThen (happyParse 3# tks) (\x -> happyReturn (happyOut16 x))++pEntry tks = happySomeParser where+  happySomeParser = happyThen (happyParse 4# tks) (\x -> happyReturn (happyOut17 x))++pTerm tks = happySomeParser where+  happySomeParser = happyThen (happyParse 5# tks) (\x -> happyReturn (happyOut18 x))++pArg tks = happySomeParser where+  happySomeParser = happyThen (happyParse 6# tks) (\x -> happyReturn (happyOut19 x))++happySeq = happyDontSeq+++returnM :: a -> Err a+returnM = return++thenM :: Err a -> (a -> Err b) -> Err b+thenM = (>>=)++happyError :: [Token] -> Err a+happyError ts =+  Bad $ "syntax error at " ++ tokenPos ts ++ +  case ts of+    [] -> []+    [Err _] -> " due to lexer error"+    _ -> " before " ++ unwords (map prToken (take 4 ts))++myLexer = tokens+{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+{-# LINE 1 "<built-in>" #-}+{-# LINE 1 "<command-line>" #-}+{-# LINE 1 "templates/GenericTemplate.hs" #-}+-- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp ++{-# LINE 28 "templates/GenericTemplate.hs" #-}+++data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList++++++{-# LINE 49 "templates/GenericTemplate.hs" #-}++{-# LINE 59 "templates/GenericTemplate.hs" #-}++{-# LINE 68 "templates/GenericTemplate.hs" #-}++infixr 9 `HappyStk`+data HappyStk a = HappyStk a (HappyStk a)++-----------------------------------------------------------------------------+-- starting the parse++happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll++-----------------------------------------------------------------------------+-- Accepting the parse++-- If the current token is 0#, it means we've just accepted a partial+-- parse (a %partial parser).  We must ignore the saved token on the top of+-- the stack in this case.+happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =+	happyReturn1 ans+happyAccept j tk st sts (HappyStk ans _) = +	(happyTcHack j (happyTcHack st)) (happyReturn1 ans)++-----------------------------------------------------------------------------+-- Arrays only: do the next action++++happyDoAction i tk st+	= {- nothing -}+++	  case action of+		0#		  -> {- nothing -}+				     happyFail i tk st+		-1# 	  -> {- nothing -}+				     happyAccept i tk st+		n | (n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}++				     (happyReduceArr Happy_Data_Array.! rule) i tk st+				     where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))+		n		  -> {- nothing -}+++				     happyShift new_state i tk st+				     where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))+   where off    = indexShortOffAddr happyActOffsets st+	 off_i  = (off Happy_GHC_Exts.+# i)+	 check  = if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#))+			then (indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==#  i)+			else False+ 	 action | check     = indexShortOffAddr happyTable off_i+		| otherwise = indexShortOffAddr happyDefActions st++{-# LINE 127 "templates/GenericTemplate.hs" #-}+++indexShortOffAddr (HappyA# arr) off =+#if __GLASGOW_HASKELL__ > 500+	Happy_GHC_Exts.narrow16Int# i+#elif __GLASGOW_HASKELL__ == 500+	Happy_GHC_Exts.intToInt16# i+#else+	Happy_GHC_Exts.iShiftRA# (Happy_GHC_Exts.iShiftL# i 16#) 16#+#endif+  where+#if __GLASGOW_HASKELL__ >= 503+	i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low)+#else+	i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.shiftL# high 8#) low)+#endif+	high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#)))+	low  = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr off'))+	off' = off Happy_GHC_Exts.*# 2#++++++data HappyAddr = HappyA# Happy_GHC_Exts.Addr#+++++-----------------------------------------------------------------------------+-- HappyState data type (not arrays)++{-# LINE 170 "templates/GenericTemplate.hs" #-}++-----------------------------------------------------------------------------+-- Shifting a token++happyShift new_state 0# tk st sts stk@(x `HappyStk` _) =+     let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in+--     trace "shifting the error token" $+     happyDoAction i tk new_state (HappyCons (st) (sts)) (stk)++happyShift new_state i tk st sts stk =+     happyNewToken new_state (HappyCons (st) (sts)) ((happyInTok (tk))`HappyStk`stk)++-- happyReduce is specialised for the common cases.++happySpecReduce_0 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_0 nt fn j tk st@((action)) sts stk+     = happyGoto nt j tk st (HappyCons (st) (sts)) (fn `HappyStk` stk)++happySpecReduce_1 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_1 nt fn j tk _ sts@((HappyCons (st@(action)) (_))) (v1`HappyStk`stk')+     = let r = fn v1 in+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))++happySpecReduce_2 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_2 nt fn j tk _ (HappyCons (_) (sts@((HappyCons (st@(action)) (_))))) (v1`HappyStk`v2`HappyStk`stk')+     = let r = fn v1 v2 in+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))++happySpecReduce_3 i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happySpecReduce_3 nt fn j tk _ (HappyCons (_) ((HappyCons (_) (sts@((HappyCons (st@(action)) (_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')+     = let r = fn v1 v2 v3 in+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))++happyReduce k i fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happyReduce k nt fn j tk st sts stk+     = case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of+	 sts1@((HappyCons (st1@(action)) (_))) ->+        	let r = fn stk in  -- it doesn't hurt to always seq here...+       		happyDoSeq r (happyGoto nt j tk st1 sts1 r)++happyMonadReduce k nt fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happyMonadReduce k nt fn j tk st sts stk =+        happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))+       where sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))+             drop_stk = happyDropStk k stk++happyMonad2Reduce k nt fn 0# tk st sts stk+     = happyFail 0# tk st sts stk+happyMonad2Reduce k nt fn j tk st sts stk =+       happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))+       where sts1@((HappyCons (st1@(action)) (_))) = happyDrop k (HappyCons (st) (sts))+             drop_stk = happyDropStk k stk++             off    = indexShortOffAddr happyGotoOffsets st1+             off_i  = (off Happy_GHC_Exts.+# nt)+             new_state = indexShortOffAddr happyTable off_i+++++happyDrop 0# l = l+happyDrop n (HappyCons (_) (t)) = happyDrop (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) t++happyDropStk 0# l = l+happyDropStk n (x `HappyStk` xs) = happyDropStk (n Happy_GHC_Exts.-# (1#::Happy_GHC_Exts.Int#)) xs++-----------------------------------------------------------------------------+-- Moving to a new state after a reduction+++happyGoto nt j tk st = +   {- nothing -}+   happyDoAction j tk new_state+   where off    = indexShortOffAddr happyGotoOffsets st+	 off_i  = (off Happy_GHC_Exts.+# nt)+ 	 new_state = indexShortOffAddr happyTable off_i+++++-----------------------------------------------------------------------------+-- Error recovery (0# is the error token)++-- parse error if we are in recovery and we fail again+happyFail  0# tk old_st _ stk =+--	trace "failing" $ +    	happyError_ tk++{-  We don't need state discarding for our restricted implementation of+    "error".  In fact, it can cause some bogus parses, so I've disabled it+    for now --SDM++-- discard a state+happyFail  0# tk old_st (HappyCons ((action)) (sts)) +						(saved_tok `HappyStk` _ `HappyStk` stk) =+--	trace ("discarding state, depth " ++ show (length stk))  $+	happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))+-}++-- Enter error recovery: generate an error token,+--                       save the old token and carry on.+happyFail  i tk (action) sts stk =+--      trace "entering error recovery" $+	happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)++-- Internal happy errors:++notHappyAtAll = error "Internal Happy error\n"++-----------------------------------------------------------------------------+-- Hack to get the typechecker to accept our action functions+++happyTcHack :: Happy_GHC_Exts.Int# -> a -> a+happyTcHack x y = y+{-# INLINE happyTcHack #-}+++-----------------------------------------------------------------------------+-- Seq-ing.  If the --strict flag is given, then Happy emits +--	happySeq = happyDoSeq+-- otherwise it emits+-- 	happySeq = happyDontSeq++happyDoSeq, happyDontSeq :: a -> b -> b+happyDoSeq   a b = a `seq` b+happyDontSeq a b = b++-----------------------------------------------------------------------------+-- Don't inline any functions from the template.  GHC has a nasty habit+-- of deciding to inline happyGoto everywhere, which increases the size of+-- the generated parser quite a bit.+++{-# NOINLINE happyDoAction #-}+{-# NOINLINE happyTable #-}+{-# NOINLINE happyCheck #-}+{-# NOINLINE happyActOffsets #-}+{-# NOINLINE happyGotoOffsets #-}+{-# NOINLINE happyDefActions #-}++{-# NOINLINE happyShift #-}+{-# NOINLINE happySpecReduce_0 #-}+{-# NOINLINE happySpecReduce_1 #-}+{-# NOINLINE happySpecReduce_2 #-}+{-# NOINLINE happySpecReduce_3 #-}+{-# NOINLINE happyReduce #-}+{-# NOINLINE happyMonadReduce #-}+{-# NOINLINE happyGoto #-}+{-# NOINLINE happyFail #-}++-- end of Happy Template.
+ src/dalin/AdjBuildSw.hs view
@@ -0,0 +1,119 @@+module AdjBuildSw where++import General+import Dictionary+import TypesSw+import RulesSw+import GenRulesSw++adjective :: Adjective -> Entry+adjective = entry++adj :: Int -> (Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes) -> (String -> Entry)+adj n (liten,litet,lilla,sma,mindre,minst,minsta) s = adjective $ +    adjective_prefixed n liten litet lilla sma mindre minst minsta s        ++adjc :: Int -> (Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes,Suffixes) -> (String -> Entry)+adjc n (liten,litet,lilla,sma,mindre,minst,minsta,småc) s = adjective $ +    excepts (adjective_prefixed n liten litet lilla sma mindre minst minsta s) [(AdjComp,strings $ concat [[x,x+?"-"] | x <- apply_suffixes (tk n s) småc]),+                                                                                (AdjSMS,strings $ [x+?"-" | x <- apply_suffixes (tk n s) småc])+                                                                               ]++adj_no_genitive_c :: Int -> (Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes,Suffixes) -> (String -> Entry)+adj_no_genitive_c n (liten,litet,lilla,sma,mindre,minst,minsta,småc) s = adjective $ no_genitive $+    excepts (adjective_prefixed n liten litet lilla sma mindre minst minsta s) [(AdjComp,strings $ concat [[x,x+?"-"] | x <- apply_suffixes (tk n s) småc]),+                                                                                (AdjSMS,strings $ [x+?"-" | x <- apply_suffixes (tk n s) småc])+                                                                               ]++adj_no_genitive :: Int -> (Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes) -> (String -> Entry)+adj_no_genitive n (liten,litet,lilla,sma,mindre,minst,minsta) s = adjective $ +    no_genitive $ adjective_prefixed n liten litet lilla sma mindre minst minsta s        ++adj_no_masc :: Int -> (Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes) -> (String -> Entry)+adj_no_masc n (liten,litet,lilla,sma,mindre,minst,minsta) s = adjective $ +    no_masc $ adjective_prefixed n liten litet lilla sma mindre minst minsta s        +++-- adjective 0+-- av_0  liten litet lilla sma = adjective $ av0 liten litet lilla sma++av_0_kronisk :: String -> Entry+av_0_kronisk = adjective . av0kronisk++av_0_konstlad :: String -> Entry+av_0_konstlad = adjective . av0konstlad++av_0_gängse :: String -> Entry+av_0_gängse = adjective . av0gängse++av_0_lastgammal :: String -> Entry+av_0_lastgammal = adjective . av0lastgammal ++av_0_medelstor :: String -> Entry+av_0_medelstor  = adjective . av0medelstor+++-- adjective 1++av_1_blek :: String -> Entry+av_1_blek = adjective . av1blek++av_1_blek_ng :: String -> Entry+av_1_blek_ng = adjective . no_genitive . av1blek++av_1_fri :: String -> Entry+av_1_fri = adjective . av1fri++av_1_lätt :: String -> Entry+av_1_lätt = adjective . av1lätt++av_1_glad :: String -> Entry+av_1_glad = adjective . av1glad++av_1_högljudd :: String -> Entry+av_1_högljudd = adjective . av1högljudd++av_1_hård :: String -> Entry+av_1_hård = adjective . av1hård++av_1_tunn :: String -> Entry+av_1_tunn = adjective . av1tunn++av_1_ensam :: String -> Entry+av_1_ensam = adjective . av1ensam++av_1_vacker :: String -> Entry+av_1_vacker = adjective . av1vacker++av_1_angelägen :: String -> Entry+av_1_angelägen = adjective . av1angelägen++av_1_ringa :: String -> Entry+av_1_ringa = adjective . av1ringa++av_1_akut :: String -> Entry+av_1_akut = adjective . av1akut++av_1_lat :: String -> Entry+av_1_lat = adjective . av1lat+++-- adjective 2++av_2_ung :: String -> Entry+av_2_ung = adjective . av2ung++av_2k_yttre :: String -> Entry+av_2k_yttre = adjective . av2yttre++-- uninflected adjective++av_i_diverse :: String -> Entry+av_i_diverse = entry . (const :: Str -> AdjInvForm -> Str) . mkStr ++av_ik_aktre :: String -> Entry+av_ik_aktre = entry . (const :: Str -> AdjCompInvForm -> Str) . mkStr++-- invariant multi-words adjectives+avm_i :: String -> Entry+avm_i = entry . (const :: Str -> AdjMInv -> Str) . mkStr
+ src/dalin/AdjRulesSw.hs view
@@ -0,0 +1,157 @@+----------------------------------------------------------------------+-- |+-- Module      : AdjRulesSw+-- Maintainer  : Markus Forsberg+-- Stability   : (stability)+-- Portability : (portability)+--+-- Swedish adjective functions+-------------------------------------------------------------------------+module AdjRulesSw where++import TypesSw+import General+import NounRulesSw(mk_case)+import GenRulesSw+import List(nub)++no_neutrum :: Adjective -> Adjective+no_neutrum f = missing f [(AF (Pos (Strong ASgNeutr))  c) | c <- values]++no_genitive :: Adjective -> Adjective+no_genitive f = missing f [(AF v Gen) | v <- values]++no_masc :: Adjective -> Adjective+no_masc f = missing f $ [AF (Pos (Weak (AxSg Sex_Masc))) v | v <- values] ++ [AF (Super (SupWeak Sex_Masc)) v | v <- values]++mk_adj_pos :: [String] -> [String] -> [String] -> [String] -> AdjFormPos -> [String]+mk_adj_pos liten litet lilla sma a = case a of+  Strong gn  -> case gn of+    ASgUtr   -> liten+    ASgNeutr -> litet+    APl      -> sma+  Weak sn -> case sn of+    AxSg g -> giveValues [lilla, lille] g+    AxPl -> sma+ where+   lille = let x = map (\s -> if (last s == 'a') then tk 1 s else s) lilla in +           -- avoid bra -> bre, få -> fe+             if (and (map (any is_vowel) x)) then nub (map (+?"e") x) else lilla++mk_adjective :: String -> String -> String -> String -> String -> String -> String -> Adjective+mk_adjective liten litet lilla sma mindre minst minsta = +    mk_adjective_v [liten] [litet] [lilla] [sma] [mindre] [minst] [minsta]++mk_adjective_v :: [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> Adjective+mk_adjective_v liten litet lilla sma mindre minst minsta AdjComp = strings $ concat [[x,x +? "-"] | x@(_:_) <- liten]+mk_adjective_v liten litet lilla sma mindre minst minsta AdjSMS  = strings $ [x +? "-" | x@(_:_) <- liten]+mk_adjective_v liten litet lilla sma mindre minst minsta (AF a c) = +  strings $ map (mk_case c) $ case a of+    Pos p   -> mk_adj_pos liten litet lilla sma p+    Comp    -> mindre +    Super s -> giveValues [minst, minsta,minste] s+ where minste = let x = map  (\s -> if (last s == 'a') then tk 1 s else s) minsta in +                 if +                     (and (map (any is_vowel) x)) then nub (map (+?"e") x) else []++adjective_prefixed :: Int -> Suffixes -> Suffixes -> Suffixes -> Suffixes -> +                             Suffixes -> Suffixes -> Suffixes -> String -> Adjective+adjective_prefixed n liten litet lilla sma mindre minst minsta s = +     mk_adjective_v (f liten) (f litet) (f lilla) (f sma) (f mindre) (f minst) (f minsta)+  where f = apply_suffixes (tk n s) -- map ((tk n s) ++)++extract_positive ::  Adjective -> AdjFormPos -> Str+extract_positive adj a = adj (AF (Pos a) Nom)++no_compare :: Adjective -> Adjective+no_compare a = a `only` positive_forms++adj_irreg :: String -> String -> String -> String -> Adjective+adj_irreg god gott battre bast = mk_adjective god gott (god ++ "a") (god ++ "a") battre bast (bast ++ "a")++adj_irreg3 :: String -> String -> String -> Adjective+adj_irreg3 ung yngre yngst = adj_irreg ung (ung ++ "t") yngre yngst++adj_almost_reg :: String -> String -> String -> Adjective+adj_almost_reg ljummen ljummet ljumma = mk_adjective ljummen ljummet ljumma ljumma (fv (ljumma) ++ "re") (fv (ljumma) ++ "st") (fv (ljumma) ++ "ste")++-- adjective 0+av0 :: String -> String -> String -> String -> Adjective+av0 liten litet lilla sma+    = no_compare $ mk_adjective liten litet lilla sma [] [] []++av0kronisk :: String -> Adjective+av0kronisk kronisk = adj_almost_reg kronisk (kronisk ++ "t") (kronisk ++ "a") `only` positive_forms++av0konstlad :: String -> Adjective+av0konstlad konstlad = adj_almost_reg konstlad (konstla ++ "t") (konstlad ++ "e") `only` positive_forms+ where konstla =tk 1 konstlad++av0gängse :: String -> Adjective+av0gängse = no_compare . const . mkStr++av0lastgammal :: String -> Adjective+av0lastgammal lastgammal = no_compare $ +       adj_almost_reg lastgammal (lastgammal ++ "t") (lastgamla) + where lastgamla =  (ungeminate (tk 2 lastgammal)) ++ "la"++av0medelstor :: String -> Adjective+av0medelstor medelstor = no_compare $ +  adj_almost_reg medelstor (medelstor ++ "t") (medelstor++"a")++-- adjective 1+av1blek :: String -> Adjective+av1blek blek = adj_almost_reg blek (blek ++ "t") (blek ++ "a")++av1fri :: String -> Adjective+av1fri fri = adj_almost_reg fri (fri ++ "tt") (fri ++ "a")++av1lätt :: String -> Adjective+av1lätt lätt = adj_almost_reg lätt lätt (lätt  ++ "a")++av1glad :: String -> Adjective+av1glad glad = adj_almost_reg glad (tk 1 glad  ++  "tt") (glad ++ "a")++av1högljudd :: String -> Adjective+av1högljudd högljudd = adj_almost_reg högljudd (höglju ++  "tt") (högljudd  ++ "a")+ where höglju = case reverse högljudd of+                 (c:c1:_) | c == c1 -> tk 2 högljudd+                 _                  -> tk 1 högljudd++av1hård :: String -> Adjective+av1hård hård = adj_almost_reg hård (tk 1 hård ++ "t")  (hård ++ "a")++av1tunn :: String -> Adjective+av1tunn tunn = adj_almost_reg tunn (tk 1 tunn ++ "t")  (tunn ++ "a")++av1ensam :: String -> Adjective+av1ensam ensam = mk_adjective ensam (ensam++"t") (ensam++ma) (ensam++ma) (ensam++ma ++ "re") (ensam++ ma ++ "st") (ensam++ma++"ste")+ where ma = [last ensam] ++ "a"++av1vacker :: String -> Adjective+av1vacker vacker = adj_almost_reg vacker vackert (mmn (drop_last_vowel vacker) ++ "a")+  where vackert = ifEndThen (== 'n') vacker (tk 1 vacker ++"t") (vacker++"t")++av1angelägen :: String -> Adjective+av1angelägen angelägen = adj_almost_reg angelägen (angeläg ++ "et") ((ungeminate angeläg) +? "na")+ where angeläg = tk 2 angelägen++av1ringa :: String -> Adjective+av1ringa ringa  = adj_almost_reg ringa ringa ringa++av1akut :: String -> Adjective+av1akut akut = adj_almost_reg akut (aku ++ "t") (akut ++ "a")+ where aku = tk 1 akut++av1lat :: String -> Adjective+av1lat lat = no_neutrum (av1akut lat)++-- adjective 2+av2ung :: String -> Adjective+av2ung ung = adj_irreg3 ung (yng++"re") (yng++"st")+  where yng = umlaut ung++av2yttre :: String -> Adjective+av2yttre yttre = missing (adj_irreg3 [] yttre ytterst) [ a | a@(AF (Pos _) _) <- values]+ where ytterst = (tk 2 yttre ++ "er") ++ "st"+
+ src/dalin/Attr.hs view
@@ -0,0 +1,27 @@+module Attr where++import General(Attr)++h_attr :: Attr+h_attr  = 0 ++init_attr :: Attr+init_attr  = 1++medial_attr :: Attr+medial_attr = 2++w_attr :: Attr+w_attr  = 3 ++wp_attr :: Attr+wp_attr = 4++d_attr :: Attr+d_attr  = 5++c_attr :: Attr+c_attr = 6++s_attr :: Attr+s_attr = 7
+ src/dalin/BuildSw.hs view
@@ -0,0 +1,12 @@+module BuildSw (+                module NounBuildSw,+                module AdjBuildSw,+                module VerbBuildSw,+                module OtherBuildSw+               ) where++import NounBuildSw+import AdjBuildSw+import VerbBuildSw+import OtherBuildSw+
+ src/dalin/CommandsSw.hs view
@@ -0,0 +1,2535 @@+module CommandsSw where++import BuildSw+import Frontend+import TypesSw+import GenRulesSw+import General(tk,(+?))+import Dictionary+import Attr+import Maybe(catMaybes)+import qualified Data.Map as Map++commands :: [(String, [String], [String] -> Entry)]+commands = [  ++ paradigm_h "nn_0m_tobak" ["tobak"] $+   noun_compound 0 Masc ([e ""], [e "en"], [], [],[(ungeminate, ""),(ds.ungeminate,"")],[(ungeminate,""),(ds.ungeminate,"")]),++ paradigm_h "nn_0n_kaffe" ["kaffe"] $+   noun_compound 0 Neutr ([e ""], [(drop_final_e,"et")], [], [],[(ungeminate, ""),(ds.ungeminate,"")],[(ungeminate,""),(ds.ungeminate,"")]),++ paradigm_h "nn_1f_dufva" ["dufva"] $+   noun_compound 1 Fem ([e "a"], [e "an"], [e "or"], [e "orna"],[(ungeminate, ""),(ds.ungeminate,"")],[(ungeminate,""),(ds.ungeminate,"")]),++ paradigm_h "nn_2m_ulf" ["ulf"] $+  noun_compound 0 Masc ([e ""], [(dpe.fr,"en")], [(dpe.fr,"ar")], [(dpe.fr,"arne"), (dpe.fr,"arna")],[(dpeu, ""),(ds.dpeu,"")],[(dpeu,""),(ds.dpeu,"")]),+ + paradigm_h "nn_2f_vår" ["vår"] $+  noun_compound 0 Fem ([e ""], [e "en"], [e "ar"], [e "arne", e "arna"],[e "",(ds,"")],[e "",(ds,"")]),++ paradigm_h "nn_2n_lof" ["lof"] $+  noun_compound 0 Neutr ([e ""], [(dpe.fr,"et")], [(dpe.fr,"ar")], [(dpe.fr,"arna")],[(dpeu, ""),(ds.dpeu,"")],[(dpeu,""),(ds.dpeu,"")]),++ paradigm_h "nn_3f_linie" ["linie"] $ +  noun_compound 0 Fem ([e ""], [(dpe,"en")], [(dpe,"er")], [(dpe,"erna")],[e "",(ds,"")],[e "",(ds,"")]),++ paradigm_h "nn_3m_vers"  ["vers"] $ +  noun_compound 0 Masc ([e ""], [e "en"], [e "er"], [e "erne", e "erna"],[(dpeu, ""),(ds.dpeu,"")],[(dpeu,""),(ds.dpeu,"")]),++ paradigm_h "nn_3n_vin"  ["vin"] $ +  noun_compound 0 Neutr ([e ""], [e "et"], [e "er"], [e "erna"],[(dpeu, ""),(ds.dpeu,"")],[(dpeu,""),(ds.dpeu,"")]),++ paradigm_h "nn_4m_bakdantare"  ["bakdantare"] $ +  noun_compound 0 Masc ([e ""], [(dpe,"en")], [(dpe,"en")], [e "ne", e "na"],[e "",(ds,"")],[e "",(ds,"")]),++ paradigm_h "nn_4n_äple" ["äple"] $   + noun_compound 0 Neutr ([e ""], [(dpe,"et")], [(dpe,"en")], [e "na"],[e "",(ds,"")],[e "",(ds,"")]),++ paradigm_h "nn_5f_mil" ["mil"] $ +  noun_compound 0 Fem ([e ""], [e "en"], [e ""], [e "arne"],[e "",(ds,"")],[e "",(ds,"")]),  ++ paradigm_h "nn_5m_väfvare" ["väfvare"] $  +  noun_compound 0 Masc ([e ""], [(dpe,"en")], [e ""], [(dpe,"ne"),(dpe,"na")],[e "",(ds,"")],[e "",(ds,"")]),++ paradigm_h "nn_5n_qval"  ["qval"] $ +  noun_compound 0 Neutr ([e ""], [e "et"], [e ""], [e "en"],[e "",(ds,"")],[e "",(ds,"")]),++  paradigm_h "av_2_blek" ["blek"] av_1_blek,++  paradigm_h "vb_1a_kalla" ["kalla"] v1,++  paradigm_h "vb_2a_ärfva" ["ärfva"] v2,++  paradigm_h "ab_i_öfver" ["öfver"] ab_bort,++  paradigm_h "pp_i_af" ["af"] prep,++  paradigm_h "kn_i_och" ["och"] conj+ ]++{-+commands :: [(String, [String], [String] -> Entry)]+commands = sal ++ sal_tail++suffix :: Int -> Entry -> String ->Entry+suffix n e s = map_wordforms ((tk n s)++) e++unDEFINED :: String -> Entry+unDEFINED _ = emptyEntry++noc :: (String -> Entry) -> (String -> Entry)+noc f = \s -> remove_param "sms" $ remove_param "ci" $ remove_param "cm" $ f s++sal_tail :: [(String, [String], [String] -> Entry)]+sal_tail =+ [+  paradigm_h "pm_fph_kleopatra"              ["Kleopatra"]            $ pm_f "ph",+  paradigm_h "pm_uls_storgatan"              ["Storgatan"]            $ pm_u "ls",+  paradigm_h "pm_ulf_centralen"              ["Centralen"]            $ pm_u "lf",+  paradigm_h "pm_noe_harvard"                ["Harvard"]              $ pm_n "oe",+  paradigm_h "pm_utz_bambara"                ["Bambara"]              $ pm_u "tz",+  paradigm_h "pm_vlg_nordsjön"               ["Nordsjön"]             $ pm_v "lg",+  paradigm_h "pm_uoc_operan"                 ["Operan"]               $ pm_u "oc",+  paradigm_h "pm_ueh_upplysningen"           ["Upplysningen"]         $ pm_u "eh",+  paradigm_h "pm_uaa_viggen"                 ["Viggen"]               $ pm_u "aa",+  paradigm_h "pm_naw_titanic"                ["Titanic"]              $ pm_n "aw",+  paradigm_h "pm_upm_audhumbla"              ["Audhumbla"]            $ pm_u "pm",+  paradigm_h "pm_uog_polisen"                ["Polisen"]              $ pm_u "og",+  paradigm_h "pm_uaa_camel"                  ["Camel"]                $ pm_u "aa",+  paradigm_h "pm_poc_hepstars"               ["Hepstars"]             $ pm_p "oc",+  paradigm_h "pm_naa_keso"                   ["Keso"]                 $ pm_n "aa",+  paradigm_h "pm_nac_saldo"                  ["SALDO"]                $ pm_n "ac",+  paradigm_h "pm_upa_brunte"                 ["Brunte"]               $ pm_u "pa",+  paradigm_h "pm_uop_landsorganisationen"    ["Landsorganisationen"]  $ pm_u "op",+  paradigm_h "pm_uoe_kursverksamheten"       ["Kursverksamheten"]     $ pm_u "oe",+  paradigm_h "pm_uap_vasaorden"              ["Vasaorden"]            $ pm_u "ap",+  paradigm_h "pm_nwm_aktuellt"               ["Aktuellt"]             $ pm_n "wm",+  paradigm_h "pm_nop_efta"                   ["EFTA"]                 $ pm_n "op",+  paradigm_h "pm_nog_skatteverket"           ["Skatteverket"]         $ pm_n "og",+  paradigm_h "pm_nog_knesset"                ["Knesset"]              $ pm_n "og",+  paradigm_h "pm_nog_interpol"               ["Interpol"]             $ pm_n "og",+  paradigm_h "pm_noc_musikforum"             ["Musikforum"]           $ pm_n "oc",+  paradigm_h "pm_nla_solsystemet"            ["Solsystemet"]          $ pm_n "la",+  paradigm_h "pm_hph_af"                     ["AF"]                   $ pm_h "ph",+  paradigm_h "pm_fph_barbro"                 ["Barbro"]               $ pm_f "ph",+  paradigm_h "pm_uwa_monalisa"               ["Monalisa"]             $ pm_u "wa",+  paradigm_h "pm_upc_ttaps-gruppen"          ["TTAPS-gruppen"]        $ pm_u "pc",+  paradigm_h "pm_uop_atlantpakten"           ["Atlantpakten"]         $ pm_u "op",+  paradigm_h "pm_uae_keso"                   ["Keso"]                 $ pm_u "ae",+  paradigm_h "pm_nwp_charta77"               ["Charta77"]             $ pm_n "wp",+  paradigm_h "pm_nos_gais"                   ["Gais"]                 $ pm_n "os",+  paradigm_h "pm_noa_finnair"                ["Finnair"]              $ pm_n "oa",+  paradigm_h "pm_nes_vasaloppet"             ["Vasaloppet"]           $ pm_n "es",+  paradigm_h "pm_nap_nobelpriset"            ["Nobelpriset"]          $ pm_n "ap",+  paradigm_h "pm_naa_camel"                  ["Camel"]                $ pm_n "aa",+  paradigm_h "pm_fpm_maria"                  ["Maria"]                $ +   set_inhs ["f","pm"] . set_pos "pm" . noun_f 1 Utr  ([e "a"], [e "an"], [e "or"], [e "orna"]),   +  paradigm_h "pma_woc_od"                    ["OD"]                   $ pma_w "oc",+  paradigm_h "pma_nwb_blm"                   ["FoF"]                  $ pma_n "wb",+  paradigm_h "pma_nom_svt"                   ["BBC"]                  $ pma_n "om",+  paradigm_h "pma_nos_gsk"                   ["GSK"]                  $ pma_n "os",+  paradigm_h "pma_nog_ab"                    ["AB"]                   $ pma_n "og",+  paradigm_h "pma_noa_sas"                   ["SAS"]                  $ pma_n "oa",+  paradigm_h "pma_nam_thx"                   ["THX"]                  $ pma_n "am",+  paradigm_h "pma_naf_jas"                   ["JAS"]                  $ pma_n "af",+  paradigm_h "pma_naa_lep"                   ["LEP"]                  $ pma_n "aa",+  paradigm_h "pma_mph_jr"                    ["Jr"]                   $ pma_m "ph",+  paradigm_h "pma_hph_nn"                    ["N.N."]                 $ pma_h "ph",+  paradigm_h "pma_noe_gu"                    ["GU"]                   $ pma_n "oe",+  paradigm_h "pma_nlp_eu"                    ["EU"]                   $ pma_n "lp",+  paradigm_h "pma_uwn_dn"                    ["DN"]                   $ pma_u "wn",+  paradigm_h "pma_ntm_cp"                    ["cp"]                   $ pma_n "tm",+  paradigm_h "pma_mpm_st"                    ["St"]                   $ pma_m "pm",+  paradigm_h "pmm_n0eh_andra_världskriget"   ["Andra världskriget"]   $ pmm_n "eh",+  paradigm_h "pmm_u0wc_fröken_julie"         ["Fröken Julie"]         $ pmm_u "wc",+  paradigm_h "pmm_u0la_stora_björnen"        ["Stora björnen"]        $ pmm_u "la",+  paradigm_h "pmm_n0op_grön_ungdom"          ["Grön ungdom"]          $ pmm_n "op",+  paradigm_h "pmm_u0tb_betula_alba"          ["betula alba"]          $ pmm_u "tb",+  paradigm_h "pmm_m0ph_birger_jarl"          ["Birger Jarl"]          $ pmm_m "ph",+  paradigm_h "pmm_u0oe_svenska_institutionen" ["Svenska institutionen"] $ pmm_u "oe",+  paradigm_h "pmm_u0aa_koh_i_noor"           ["Koh i noor"]           $ pmm_u "aa",+  paradigm_h "pmm_m0ph_per_olov"             ["Per Olov"]             $ pmm_m "ph",+  paradigm_h "pmm_m0ph_karl_den_tolfte"      ["Karl den tolfte"]      $ pmm_m "ph",+  paradigm_h "pmm_m0ph_el_greco"             ["el greco"]             $ pmm_m "ph",+  paradigm_h "pmm_f0pm_jungfru_maria"        ["jungfru Maria"]        $ pmm_f "pm",+  paradigm_h "pmm_n0lf_vita_huset"           ["Vita huset"]           $ pmm_n "lf",+  paradigm_h "pmm_m0ph_karl_xii"             ["Karl xii"]             $ pmam_m "ph",+  paradigm_h "pmm_h0ph_jonsson_lind"         ["Jonsson Lind"]         $ pmm_h "ph",+  paradigm_h "pmm_u0tm_parkinsons_sjukdom"   ["Parkinsons sjukdom"]   $ pmm_u "tm",+  paradigm_h "pmm_u0op_nysvenska_rörelsen"   ["Nysvenska rörelsen"]   $ pmm_u "op",+  paradigm_h "pmm_u0ls_lilla_nygatan"        ["Lilla Nygatan"]        $ pmm_u "ls",+  paradigm_h "pmm_u0en_big_bang"             ["Big Bang"]             $ pmm_u "en",+  paradigm_h "pmm_u0aw_cutty_sark"           ["Cutty Sark"]           $ pmm_u "aw",+  paradigm_h "pmm_n0oc_ebba_grön"            ["Ebba Grön"]            $ pmm_n "oc",+  paradigm_h "pmm_m0pm_john_blund"           ["John Blund"]           $ pmm_m "pm",+  paradigm_h "pmm_m0ph_adam_av_bremen"       ["Adam av Bremen"]       $ pmm_m "ph",+  paradigm_h "pmm_v0lf_notre_dame"           ["Notre Dame"]           $ pmm_v "lf",+  paradigm_h "pmm_u0wn_dagens_nyheter"       ["Dagens nyheter"]       $ pmm_u "wn",+  paradigm_h "pmm_u0es_davis_cup"            ["Davis cup"]              $ pmm_u "es",+  paradigm_h "pmm_u0er_marie_bebådelse"      ["Marie bebådelse"]        $ pmm_u "er",+  paradigm_h "pmm_u0eh_franska_revolutionen" ["Franska Revolutionen"]   $ pmm_u "eh",+  paradigm_h "pmm_u0ag_rolls_royce"          ["Rolls Royce"]            $ pmm_u "ag",+  paradigm_h "pmm_p0ph_bröderna_grim"         ["Bröderna Grim"]         $ pmm_p "ph",+  paradigm_h "pmm_m0ph_plinius_d_y"           ["Plinius d y"]           $ pmam_m "pa",+  paradigm_h "pmm_m0pa_pelle_svanslös"        ["Pelle Svanslös"]        $ pmm_m "pa",+  paradigm_h "pmm_f0ph_eva_ek"                ["Eva Ek"]                $ pmm_f "ph",+  paradigm_h "pmm_uatm_multipel_skleros"      ["multipel skleros"]      $ pmm_u "tm",+  paradigm_h "pmm_uatm_cerebral_pares"        ["cerebral pares"]        $ pmm_u "tm",+  paradigm_h "pmm_pcpm_hugin_och_munin"       ["Hugin och Munin"]       $ pmm_p "pm",+  paradigm_h "pmm_f1pm_jungfrun_från_orleans" ["Jungfrun från Orleans"] $ pmm_f "pm",+  paradigm_h "pmm_nu0wn_svenska_dagbladet"    ["Svenska Dagbladet"]     $ pmm_n "wn",+  paradigm_h "ab_2_bra"                  ["bra"] $ suffix 3 (ab_bra ["bra"] ["bättre"] ["bäst"]),+  paradigm_h "ab_2_nära"                 ["nära"] $ +   suffix 4 (ab_bra ["nära"] ["närmare", "närmre"] ["närmast", "närmst"]),+  paradigm_h "ab_2_mycket"               ["mycket"] $ suffix 6 (ab_bra ["mycket"] ["mer","mera"] ["mest"]),+  paradigm_h "ab_2_länge"                ["länge"] $ suffix 5 (ab_bra ["länge"] ["längre"] ["längst"]),+  paradigm_h "ab_2_illa"                 ["illa"] $ +    suffix 4 (ab_bra ["illa"] ["sämre","värre"] ["sämst","värst"]),+  paradigm_h "ab_2_gärna"                ["gärna"] $ suffix 5 (ab_bra ["gärna"] ["hellre"] ["helst"]),+  paradigm_h "ab_2_föga"                 ["föga"]  $ suffix 4 (ab_bra ["föga"] ["mindre"] ["minst"]),+  paradigm_h "ab_ik_vidare"              ["vidare"] $+    suffix 1 (ab_bra [] ["e"] []),+  paradigm_h "ab_2_lite"              ["lite"] $+     suffix 4 (ab_bra ["lite"] ["mindre"] ["minst"]),+  paradigm_h "ie_i_att"                  ["att"]            inf_mark,+  paradigm_h "sn_i_om"                   ["om"]             subj,+  paradigm_h "abh_i_ledes" ["ledes"] $ +   replace_attr w_attr s_attr . set_pos "abh" . ab_bort,  +  paradigm_h "avh_1_aktig" ["aktig"] $ +   replace_attr w_attr s_attr . set_pos "avh" . av_1_blek,+  paradigm_h "avh_1_akut" ["bent"] $ +   replace_attr w_attr s_attr . set_pos "avh" . av_1_akut,+  paradigm_h "avh_0_artad" ["artad"] $ +   replace_attr w_attr s_attr . set_pos "avh" . av_0_konstlad,+  paradigm_h "avh_0_buren" ["buren"] $ +   replace_attr w_attr s_attr . set_pos "avh" .+    adj 2 ([e "en"], [e "et"], [e "na"], [e "na"], [], [], []),+  paradigm_h "nnh_4u_bo" ["bo"] $ +   replace_attr w_attr s_attr . set_pos "nnh" . nn4,+  paradigm_h "nnh_2u_siding" ["siding"] $ +   replace_attr w_attr s_attr . set_pos "nnh" . +    noun_compound 0 Utr ([e ""], [e "en"], [e "ar"], [e "arna"], [(ds, "")],[(ds, "")]),+  paradigm_h "nnh_6u_tonnare" ["tonnare"] $ +   replace_attr w_attr s_attr . set_pos "nnh" .    +    noun_compound 0 Utr ([e ""], [e "n"], [e ""], [(tk 1, "na")],[(tk 1, "")],[(ds_drop,"")]), +  paradigm_h "nnh_dn_snåret" ["snåret"] $ +   replace_attr w_attr s_attr . set_pos "nnh" . +    noun_f 0 Neutr  ([], [e ""], [], []),+  paradigm_h "nn_3n_parti"     ["parti"]       nn3_parti,+  paradigm_h "nn_3u_fiber"     ["fiber"] $+   noun_compound 0 Utr ([e ""], [e "n"], [(dvu,"er")], [(dvu,"erna")],[e ""],[e "", (ds,"")]),   +  paradigm_h "nn_3u_tand"      ["tand"]        nn3_tand,+  paradigm_h "nn_3u_film"      ["film"] $+             noun_compound 0 Utr ([e ""], [e "en"], [e "er"], [e "erna"],[e ""],[e "", (ds,"")]),   ++  paradigm_h "nn_3u_bygd"      ["bygd"] $+             noun_compound 0 Utr ([e ""], [e "en"], [e "er"], [e "erna"],[e "",e "e"],[e "e", (ds,"")]),   ++  paradigm_h "nn_3u_plan"      ["plan"] $+             noun_compound 0 Utr ([e ""], [e "en"], [e "er"], [e "erna"],[e ""],[e "e",e "", (ds,"")]),   ++  paradigm_h "nn_3u_akademi"   ["akademi"] $+   noun_compound 0 Utr ([e ""], [e "n",e "en"], [e "er"], [e "erna"],[e ""],[e ""]),   ++  paradigm_h "nn_dn_rubbet"   ["rubbet"] $+   noun_compound 0 Neutr  ([], [e ""], [], [],[],[]),   ++  paradigm_h "nn_dp_tropikerna"   ["tropikerna"] $+   noun_compound 0 GPl ([], [], [], [e ""],[],[]),   ++  paradigm_h "nn_du_stampen"   ["stampen"] $+   noun_compound 0 Utr ([], [e ""], [], [],[],[]),   ++  paradigm_h "nn_np_ordalag"   ["ordalag"] $+   noun_f 0 GPl ([], [], [e ""], [e "en"]),   ++  paradigm_h "nn_rp_benvärmare"   ["benvärmare"] $+   noun_f 0 GPl ([], [], [e ""], [(tk 1, "na")]),   ++  paradigm_h "nn_rp_griller"   ["griller"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[],[]),   ++  paradigm_h "nn_rp_inälvor"   ["inälvor"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(ds . tk 2,"")],[(ds . tk 2,"")]),   ++  paradigm_h "nn_rp_johannesnycklar"   ["johannesnycklar"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(tk 3,"el"),(tk 3,"els")],[(tk 3,"el"),(tk 3,"els")]),   ++  paradigm_h "nn_rp_kläder"   ["kläder"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(tk 2,""),(ds . tk 2,""),(tk 2,"es")],[(tk 2,""),(ds . tk 2,""),(tk 2,"es")]),   +  paradigm_h "nn_rp_kråkfötter"   ["kråkfötter"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(ds . vc "o" . tk 3,"")], [(ds . vc "o" . tk 3,"")]),   ++  paradigm_h "nn_rp_paltor"   ["paltor"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(tk 2,"")],[(tk 2,""),(ds . tk 2,"")]),   ++  paradigm_h "nn_rp_specerier"   ["specerier"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(tk 2,"")],[(tk 2,"")]),   ++  paradigm_h "nn_rp_stadgar"   ["stadgar"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(tk 2,"e")],[(tk 2,"e")]),   ++  paradigm_h "nn_rp_svear"   ["svear"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(tk 1,"")],[(tk 1,"")]),   ++  paradigm_h "nn_rp_underkläder"   ["underkläder"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(ds . tk 2,""),(tk 2,"es")],[(ds . tk 2,""),(tk 2,"es")]),   ++  paradigm_h "pn_o_sån" ["sån"] $ +    pn_nagon ([e "",(tk 1,"dan")],[e "t",(tk 1,"dant")],[e "a",(tk 1,"dana")]),++  paradigm_h "pn_o_all" ["all"] $ +    pn_nagon ([e ""],[e "t"],[e "a"]),++  paradigm_h "pn_o_varsin" ["varsin"] $ +    pn_nagon ([e ""],[(tk 1,"tt")],[e "a"]),++  paradigm_h "pn_o_vem" ["vem"] $ +    pn_vem ([e ""],[e ""],[e "s"]),++  paradigm_h "pn_o_varandra" ["varandra"] $ +    pn_vem ([],[e ""],[e "s"]),++  paradigm_h "pn_o_man" ["man"] $ +   pn_han (P3,Sg) ([e ""],[(tk 3,"en")],[(tk 3, "ens")]),+    +  paradigm_h "pn_i_vars" ["vars"] $ pn_inv,++  paradigm_h "pn_o_sig" ["sig"] $+    pn_jag (P3,Sg) ([],[e "",(tk 2,"ej")],[(tk 1,"n")],[(tk 1,"tt")],[(tk 1,"na")]),++  paradigm_h "pn_o_ingen"             ["ingen"] $+   pn_nagon ([e ""],[(tk 1,"t")],[(tk 2,"a")]),++  paradigm_h "pn_o_den"               ["den"]   $+   pn_o_den, +  paradigm_h "pn_o_någon"             ["någon"] $+   pn_nagon ([e "", (tk 3,"n")],[(tk 1,"t"), (tk 3,"t")],[(tk 2,"ra")]),+ paradigm_h "pn_o_ingendera"        ["ingendera"] $+    pn_nagon ([e ""],[(tk 5,"tdera")],[(tk 6,"adera")]),+  paradigm_h "pn_o_vi"                ["vi"] $+    pn_jag  (P1,Pl) ([e ""],[(tk 2, "oss")],[(tk 2,"vår"),(tk 2,"våran")],[(tk 2,"vårt"),(tk 2,"vårat")],[(tk 2,"våra")]),+  paradigm_h "pn_o_de"                ["de"] $+   pn_han (P3,Pl) ([e "",(vc "o","m")],[(id,"m"),(vc "o","m")],[e "ras"]),+  paradigm_h "pn_o_varenda"           ["varenda"] $+   pn_nagon ([e "",(tk 1,"e")], [(tk 4, "tenda")],[]),+  paradigm_h "pn_o_vardera"           ["vardera"] $+   pn_nagon ([e ""], [(tk 4, "tdera")],[]),+  paradigm_h "pn_o_varannan"          ["varannan"] $+   pn_nagon ([e ""],[(tk 5,"tannat")],[]),+  paradigm_h "pn_o_var"               ["var"] $+   pn_nagon ([e ""],[e "t"],[]),+  paradigm_h "pn_o_samma"             ["samma"] $+   pn_nagon ([e "",(tk 1,"e")],[e ""],[e ""]),+  paradigm_h "pn_o_ni"                ["ni"] $+    pn_jag  (P2,Pl) ([e ""],[(tk 2, "er")],[(tk 2,"er"),(tk 2, "eran")],[(tk 2,"ert"),(tk 2,"erat")],[(tk 2,"era")]),+  paradigm_h "pn_o_jag"               ["jag"] $+    pn_jag  (P1,Sg) ([e ""],[(tk 3, "mig"),(tk 3,"mej")],[(tk 3,"min")],[(tk 3,"mitt")],[(tk 3,"mina")]),+  paradigm_h "pn_o_högstdensamme"     ["högstdensamme"] $+   pn_nagon ([e ""],[(tk 6,"tsamma")],[(tk 6,"samma")]),+  paradigm_h "pn_o_hon"               ["hon"] $+   pn_han (P3,Sg) ([e ""],[(vc "e","ne")],[(tk 2,"ennes")]),+  paradigm_h "pn_o_han"               ["han"] $+   pn_han (P3,Sg) ([e ""], [(vc "o","om")], [e "s"]),+  paradigm_h "pn_o_endera"            ["endera"] $+   pn_nagon ([e ""],[(tk 5,"ttdera")],[]),+  paradigm_h "pn_o_du"                ["du"] $+    pn_jag  (P2,Sg) ([e ""],[(tk 1, "ig"),(tk 1,"ej")],[(tk 1,"in")],[(tk 1,"itt")],[(tk 1,"ina")]),+  paradigm_h "pn_o_densamma"          ["densamma"] $+    pn_nagon ([e "",(tk 1,"e")],[(tk 6,"tsamma")],[(tk 6,"samma")]),+  paradigm_h "pn_o_denna"             ["denna"] $+   pn_nagon ([e "",(tk 1,"e")],[(tk 3,"tta")],[(tk 3,"ssa")]),+  paradigm_h "pn_o_annan"             ["annan"] $+   pn_nagon ([e ""],[(tk 1,"t")],[(tk 3,"dra")]),+  -- paradigm_h "al_o_den"               ["den"]               al_o_den,+  paradigm_h "nn_vu_mixer" ["mixer"]  $         +   noun_f 0 Utr  ([e ""], [e "n"], [(id,""), (dv,"ar"),(id,"s")], [(id,"na"), (dv,"arna"),e "sarna"]),   ++  paradigm_h "nn_vn_medium" ["medium"]  $     +   noun_f 0 Neutr  ([e ""], [(tk 2,"et")], [(tk 2,"er"),(tk 2,"a")], [(tk 2,"erna"),(tk 2,"ana")]),++  paradigm_h "nn_ou_bekant" ["bekant"]   $     +    noun Utr [""] ["en"] ["er","a"] ["erna"],++  paradigm_h "nn_on_memorandum" ["memorandum"]  $  +   noun_f 0 Neutr ([e ""], [e "", e "et"], [(tk 2, "a")], [(tk 2,"ana")]),++  paradigm_h "nn_1u_åder" ["åder"]    $       +   noun_compound 0 Utr ([e "",(dv,"a")], [e "n",(dv,"an")], [(dv,"or")], [(dv,"orna")],[e ""],[(dv,"e"), e ""]),++  paradigm_h "nn_1u_gata" ["gata"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(ungeminate.tk 1,""),(ungeminate.tk 1,"u")],[(ungeminate.tk 1,""),(ungeminate.tk 1,"u")]),++  paradigm_h "nn_1u_mamma" ["mamma"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(tk 1,"a")],[(tk 1,"e"),(tk 1,"a")]),++  -- paradigm_h "nn_1u_dagmamma" ["dagmamma"]    $       +  -- noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(tk 1,"e"),(tk 1,"a")],[(tk 1,"e"),(tk 1,"a")]),++  paradigm_h "nn_1u_människa" ["människa"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(ungeminate.tk 1,"o")],[(ungeminate.tk 1,"o")]),++  paradigm_h "nn_1u_kamera" ["kamera"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [e ""],[e ""]),++  paradigm_h "nn_1u_olja" ["olja"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(tk 1, "e")],[(tk 1, "e")]),++  paradigm_h "nn_1u_baksida" ["baksida"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(tk 1, "e"),(tk 1,"es")],[(tk 1, "e"),(tk 1,"es")]),++  paradigm_h "nn_1u_sida" ["sida"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(ungeminate.tk 1, ""),(tk 1,"o")],[(tk 1, "e"),(tk 1,"es")]),++  paradigm_h "nn_1u_folksaga" ["folksaga"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(tk 1, "e"),(tk 1,"o")],[(tk 1, "e"),(tk 1,"o")]),++  paradigm_h "nn_1u_kyrka" ["kyrka"]    $       +   noun_compound 1 Utr ([e "a"], [e "an"], [e "or"], [e "orna"], [(ungeminate,""),e "o"],[(ungeminate,""),e "o",(ds, ""),e "e"]),++  paradigm_h "nn_2u_mening" ["mening"]    $       +   noun_compound 0 Utr ([e ""], [e "en"], [e "ar"], [e "arna"], [(ds, "")],[(ds, "")]),++  paradigm_h "nn_3u_salong" ["salong"]    $       +   noun_compound 0 Utr ([e ""], [e "en"], [e "er"], [e "erna"], [(ds, "")],[(ds, "")]),++  paradigm_h "nn_5n_dike" ["dike"]    $       +   noun_compound 0 Neutr ([e ""], [e "t"], [e "n"], [e "na"], [(ds, "")],[(ds, "")]),++  paradigm_h "nn_5n_saldo" ["saldo"]    $       +   noun_compound 0 Neutr ([e ""], [e "t"], [e "n"], [e "na"], [e ""],[e ""]),++  paradigm_h "nn_6n_departement" ["departement"]    $       +   noun_compound 0 Neutr ([e ""], [e "et"], [e "en"], [e "ena"], [(ds, "")],[(ds, "")]),++  paradigm_h "nn_0u_svenska" ["svenska"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [], [], [(tk 1,"a"),(tk 1,"")],[(tk 1,"a"),(tk 1,"")]),++  paradigm_h "nn_vu_kart" ["kart"]   $       +   noun Utr [""] ["en"] ["ar",""] ["arna","en"],++  paradigm_h "nn_vn_mirakel" ["mirakel"]   $      +   noun_f 0 Neutr ([e ""], [(dv,"et")], [(id,""),(dv,"er")], +                          [(dv,"en"), (dv,"erna")]),++  paradigm_h "nn_0v_trim" ["trim"]  $  +   noun_f 0 Pend  ([e ""], [(geminate,"en"), (geminate,"et")], [], []),++  paradigm_h "nn_0v_blod" ["blod"]  $  +   noun_compound 0 Pend  ([e ""], [e "en", e "et"], [], [],[e "",(ds,"")],[e "",(ds,"")]),++  paradigm_h "nn_0v_gin" ["gin"]  $  +   noun_compound 0 Pend  ([e ""], [e "en", e "et"], [], [],[e ""],[e "",(ds,"")]),++  paradigm_h "nn_0v_tö" ["tö"]  $  +   noun_f 0 Pend  ([e ""], [e "et", e "n", e "t"], [], []),++  paradigm_h "nn_0n_bitumen" ["bitumen"]  $+   noun_f 0 Neutr ([e ""], [(id, ""),(vc "i", "et")], [], []),++  paradigm_h "nn_vn_lexikon" ["lexikon"]  $      +   noun_f 0 Neutr ([e ""], [e "et"], [(id,""),(tk 2,"a")], [e "en"]),++  paradigm_h "nn_2u_slarver" ["slarver"]  $    +   noun_f 0 Utr ([e ""], [e "n"], [(dvu,"ar"),(tk 2,"ar")], [(dvu,"arna"), (tk 2,"arna")]),++  paradigm_h "nn_2u_bräken" ["bräken"]  $    +   noun_f 0 Utr ([e ""], [e "", (dv, "en")], [(dv,"ar")], [(dv,"arna")]),++  paradigm_h "nn_2u_himmel" ["himmel"]  $     +   noun_f 0 Utr ([e ""], [(tk 3,"len"), (id,"en"),(id,"n")], [(tk 3, "lar")], [(tk 3, "larna")]),++  paradigm_h "nn_4n_fängelse" ["fängelse"]  $    +   noun Neutr [""] ["t"] ["r"] ["rna"],++  paradigm_h "nn_2u_dag" ["dag"]  $      +   noun_f 0 Utr ([e ""], [(id,"en"),(tk 1,"n")], [(id,"ar"),(tk 1,"r")], [(id,"arna"),(tk 1,"rna")]),++  paradigm_h "nn_vu_ponny" ["ponny"]  $      +   noun_f 0 Utr ([e ""], [e "n"], [(tk 1,"ies"),(id,"er")], [e "erna",(tk 1,"iesarna")]),++  paradigm_h "nn_vu_kollega" ["kollega"]  $      +   noun_f 0 Utr ([e ""], [e "n"], [(tk 1,"er"),(tk 1,"or")], [(tk 1,"erna"),(tk 1,"orna")]),++  paradigm_h "nn_vn_kolli" ["kolli"]  $       +   noun Neutr [""] ["t"] ["","n"] ["na"],++  paradigm_h "nn_6u_tum" ["tum"]  $        +   noun Utr [""] ["men"] [""] ["men"],++  paradigm_h "nn_6n_universum" ["universum"]  $    +   noun Neutr [""] ["", "et"] [""] ["en"],++  paradigm_h "nn_0n_gluten" ["gluten"]  $ +   noun_compound 0 Neutr ([e ""], [e "et",e ""],[],[],[e ""],[e ""]),++  paradigm_h "nn_vu_yard" ["yard"]  $        +   noun Utr [""] ["en"] ["","s"] ["en","sen"],++  paradigm_h "nn_vu_svan" ["svan"]  $         +   noun Utr [""] ["en"] ["ar","or"] ["arna","orna"],++  paradigm_h "nn_vn_tema" ["tema"]  $          +   noun Neutr [""] ["t"] ["n","ta"] ["na","tana"],++  paradigm_h "nn_vn_perfektum" ["perfektum"]  $     +   noun_f 0 Neutr ([e ""],[e "et"],[e "", (tk 2,"er")], [e "en",(tk 2,"erna")]),++  paradigm_h "nn_vn_maximum" ["maximum"]  $      +   noun_f 0 Neutr ([e ""], [e "",e "et",(tk 2, "et")], [(id,""),(tk 2,"a")],[(tk 2,"ana"),(id,"en")]),++  paradigm_h "nn_vn_frö" ["frö"]  $         +   noun Neutr [""] ["et","t"] ["er","n"] ["erna","na","en"],++  paradigm_h "nn_3u_materia" ["materia"]  $      +   noun_f 0 Utr ([e ""], [e "n"], [(tk 1,"er")], [(tk 1,"erna")]),++  paradigm_h "nn_0n_delirium" ["delirium"]  $+   noun_f 0 Neutr ([e ""],[(tk 2, "et")],[],[]),++  -- paradigm_h "nn_vv_fossil" ["fossil"]  $+  -- noun Pend [""] ["en","et"] ["er",""] ["erna","en"],++  paradigm_h "nn_vv_libretto" ["libretto"]  $+   noun Pend [""] ["n","t"] ["r","n"] ["rna","na"],++  paradigm_h "nn_vu_safari" ["safari"]  $+   noun Utr [""] ["n"] ["er","s"] ["erna","sarna"],++  paradigm_h "nn_vu_bungalow" ["bungalow"]  $+   noun Utr [""] ["en"] ["er","s"] ["erna"],++   paradigm_h "nn_ip_honoratiores" ["honoratiores"]  $+   noun_no_genitive GPl ([],[],[e ""],[]),++  paradigm_h "nn_7u_lady" ["lady"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 1,"ies")],[(tk 1,"ies"),(tk 1,"iesarna")]),++  paradigm_h "nn_6v_kvitten" ["kvitten"]  $+   noun Pend [""] [""] [""] ["a"],++  paradigm_h "nn_vv_franska" ["franska"]  $+   noun_f 0 Pend ([e ""],[e "n",e "t"],[(id,""),(tk 1,"or")], [e "na",(tk 1,"orna")]),++  paradigm_h "nn_4v_folie" ["folie"]  $+   noun Pend [""] ["n","t"] ["r"] ["rna"],++  paradigm_h "nn_3u_donjuan" ["donjuan"]  $+   noun Utr [""] [""] ["er"] ["erna"],++  paradigm_h "nn_2v_finger" ["finger"]  $+   noun_f 0 Pend ([e ""], [(dv,"et"),(id,"n")], [(dv,"ar")],[(dv,"arna")]),++  paradigm_h "nn_2u_biceps" ["biceps"]  $+   noun Utr [""] ["", "en"] ["ar"] ["arna"],++  paradigm_h "nn_1u_ultima" ["ultima"]  $+   noun_f 0 Utr ([e ""], [e "", e "n"], [(tk 1,"or")], [(tk 1,"orna")]),           ++  paradigm_h "nn_0n_opium" ["opium"]  $+   noun_compound 0 Neutr ([e ""], [(tk 2,"et"),(id,"et")],[],[],[e ""],[e ""]),++  paradigm_h "nn_vv_skogsrå" ["skogsrå"]  $+   noun Pend [""] ["et","t","n"] ["r","n"] ["rna","na"],++  paradigm_h "nn_vv_prisma" ["prisma"]  $+   noun_f 0 Pend ([e ""], [e "n",e "t"], [(tk 1, "or"),(tk 1,"er")], [(tk 1,"orna"),(tk 1,"erna")]),++  paradigm_h "nn_vv_hult" ["hult"]   $+   noun Pend [""] ["et","en"] ["","ar","er"] ["en","arna","erna"],++  paradigm_h "nn_vu_spaniel" ["spaniel"]   $   +   noun Utr [""] ["n"] ["ar","s"] ["arna"],++  paradigm_h "nn_vu_litteraturkanon" ["litteraturkanon"]  $+   noun Utr [""] ["en",""] ["er",""] ["erna"],++  paradigm_h "nn_vu_igloo" ["igloo"]  $+   noun Utr [""] ["n"] ["r","er","s"] ["rna","erna","sarna"],++  paradigm_h "nn_vn_alfa_io" ["i"]  $+   set_pos "nn" . nna Neutr ([e ""],[e "s"], [e "t", e "et"],[e "ts", e "ets"],[e "n", e ""],[e "ns",e "s"],[e "na",e "en"],[e "nas",e "ens"]),++  paradigm_h "nn_6n_deponens" ["deponens"]  $+   noun Neutr [""] [""] [""] ["en"],++  paradigm_h "nn_6n_andeväsen" ["andeväsen"]  $+   noun Neutr [""] ["det"] [""] ["a"],++  paradigm_h "nn_5n_altare" ["altare"]  $+   noun_f 0 Neutr ([e ""], [e "t"], [e "n"], [(tk 1,"na")]),++  paradigm_h "nn_3u_geranium" ["geranium"]  $+   noun_f 0 Utr ([e ""],[(tk 2,"en")],[(tk 2,"er")],[(tk 2,"erna")]),++  -- paradigm_h "nn_1u_toffel" ["toffel"]  $+  -- noun_compound 0 Utr ([e ""], [e "n"],[(dvu,"or")],[(dvu,"orna")],[e ""],[e ""]),++  paradigm_h "nn_1u_tavla" ["tavla"]  $+   noun_compound 0 Utr ([e ""], [e "n"],[(dv,"or")],[(dv,"orna")],[((\s -> insert_second_last s 'e') . tk 1,"")],[((\s -> insert_second_last s 'e') . tk 1,""),(tk 1,"e")]),++  paradigm_h "nn_1u_stamtavla" ["stamtavla"]  $+   noun_compound 0 Utr ([e ""], [e "n"],[(dv,"or")],[(dv,"orna")],[((\s -> insert_second_last s 'e') . tk 1,""),(tk 1,"e")],[((\s -> insert_second_last s 'e') . tk 1,""),(tk 1,"e")]),++  paradigm_h "nn_0v_dregel" ["dregel"]  $+   noun_compound 0 Pend ([e ""],[(id,"n"), (dvu,"et")], [], [],[e ""],[e ""]),++  paradigm_h "nn_0u_koppar" ["koppar"]  $+   noun_compound 0 Utr ([e ""], [e "en", e "n"],[],[],[e ""],[e ""]),++  paradigm_h "nn_vv_paraply" ["paraply"]  $+   noun Pend [""] ["et","t","n"] ["er","n"] ["erna","na"],++  paradigm_h "nn_vv_etage" ["etage"]  $+   noun Pend [""] ["t","n"] ["r",""] ["rna","n"],++  paradigm_h "nn_vv_chiffer" ["chiffer"]  $+   noun_f 0 Pend ([e ""],[(dv,"et"),(id,"n")],[(id,""),(dv,"er")],[(dv,"en"),(dv,"erna")]),++  paradigm_h "nn_vv_bolster" ["bolster"]  $+   noun_f 0 Pend ([e ""],[(dv,"et"),(id,"n")],[(id,""),(dv,"ar")],[(dv,"arna"), (dv,"en"),(id,"na")]),++  paradigm_h "nn_vu_teve" ["teve"]  $+   noun Utr [""] ["n"] ["","ar"] ["na","arna"],++  paradigm_h "nn_vu_rhododendron" ["rhododendron"]  $+   noun_f 0 Utr ([e ""], [e "en"], [e "",(tk 2, "er")], [(tk 2, "erna")]),++  paradigm_h "nn_vu_kofot" ["kofot"]  $+   noun_f 0 Utr ([e ""], [e "en"],[(id,"ar"),(umlaut . geminate,"er")],[(id,"arna"),(umlaut . geminate,"erna")]),++  paradigm_h "nn_vu_jourhavande" ["jourhavande"]  $+   noun Utr [""] ["n"] ["","n"] ["na"],++  paradigm_h "nn_vu_jockey" ["jockey"]  $+   noun Utr [""] ["n","en"] ["ar","er","s"] ["arna","erna"],++  paradigm_h "nn_vu_grej" ["grej"]  $+   noun Utr [""] ["en"] ["er","or"] ["erna","orna"],++  paradigm_h "nn_vu_drive" ["drive"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 1,"ar"),(id,"s")],[(tk 1,"arna")]),++  paradigm_h "nn_vu_cello" ["cello"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(id,"r"),(tk 1,"i")],[(tk 1,"orna")]),++  paradigm_h "nn_vn_trauma" ["trauma"]  $+   noun_f 0 Neutr ([e ""], [e "t"],[(id,"n"),(tk 1,"er")],[e "na",(tk 1,"erna")]),++  paradigm_h "nn_vn_stall" ["stall"]  $+   noun Neutr [""] ["et"] ["","ar"] ["en","arna"],++  paradigm_h "nn_vn_pi" ["pi"]  $+   noun Neutr [""] ["et","t"] ["","n"] ["na","en"],++  paradigm_h "nn_vn_paper" ["paper"]  $+   noun Neutr [""] ["et"] ["s",""] ["en"],++  paradigm_h "nn_vn_panorama" ["panorama"]  $+   noun_f 0 Neutr ([e ""], [e "t"],[(id,"n"),(tk 1,"or")],[e "na",(tk 1,"orna")]),++  paradigm_h "nn_vn_logi" ["logi"]  $+   noun Neutr [""] ["et","t"] ["er","n"] ["erna","na"],++  paradigm_h "nn_ou_medikus" ["medikus"]  $+   noun_f 0 Utr ([e ""], [e "",e "en"],[(tk 3,"ci")], [(tk 3,"cina")]),++  paradigm_h "nn_6v_årder" ["årder"]  $+   noun_f 0 Pend ([e ""],[(dv,"et"),(id,"n")], [e ""],[(dv,"en"),(id,"na")]),++  paradigm_h "nn_6v_hästskosöm" ["hästskosöm"]  $+   noun_f 0 Pend ([e ""], [(geminate,"et"),(geminate,"en")], [e ""], [(geminate,"en")]),++  paradigm_h "nn_6u_bror" ["bror"]   $+   noun_compound 0 Utr ([e ""],[(tk 1,"dern"),(id,"n")], [(umlaut . tk 1, "der")], [(umlaut . tk 1, "derna")],[e "",(ds,"")],[e "",(ds,"")]),++  paradigm_h "nn_6n_pansar" ["pansar"]  $+   noun_compound 0 Neutr ([e ""],[e "et"],[e ""],[e "na",e "en"],[e ""],[e ""]),++  paradigm_h "nn_3n_center" ["center"]  $+   noun_f 0 Neutr ([e ""],[(dv,"et")],[(dv,"er")],[(dv,"erna")]),++  paradigm_h "nn_6n_ankare" ["ankare"]  $+   noun_compound 0 Neutr ([e ""], [e "t"], [e "",e "n"],[(tk 1,"na")],[(tk 1,"")],[(tk 1,"")]),++  paradigm_h "nn_3v_plasma" ["plasma"]  $+   noun_f 0 Pend ([e ""], [e "t", e "n"],[(tk 1,"er")],[(tk 1,"erna")]),++  paradigm_h "nn_3u_papyrus" ["papyrus"]  $+   noun_f 0 Utr ([e ""],[(tk 2,"en"), (id,"en")],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_3n_alluvium" ["alluvium"]  $+   noun_f 0 Neutr ([e ""],[(id,"et"),(tk 2, "et")],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_3n_alkali" ["alkali"]  $+   noun Neutr [""] ["t"] ["er"] ["erna"],++  paradigm_h "nn_3n_gift" ["gift"] $+   noun_compound 0 Neutr ([e ""],[e "et"],[e "er"],[e "erna"],[e ""],[e "",(ds,"")]),++  paradigm_h "nn_3n_histamin" ["histamin"]  $+   noun_compound 0 Neutr ([e ""],[e "et"],[e "er"],[e "erna"],[e ""],[e ""]),++  paradigm_h "nn_3n_portvin" ["portvin"]  $+   noun_compound 0 Neutr ([e ""],[e "et"],[e "er"],[e "erna"],[(ds,"")],[(ds,"")]),++  paradigm_h "nn_3u_tid" ["tid"]  $+   noun_compound 0 Utr ([e ""],[e "en"],[e "er"],[e "erna"],[e "",(ds,"")],[e "",(ds,"")]),++  paradigm_h "nn_2v_skit" ["skit"]  $+   noun Pend [""] ["en","et"] ["ar"] ["arna"],++  paradigm_h "nn_2u_toddy" ["toddy"]  $+   noun_f 0 Utr ([e ""],[e "n"],[e "ar", (tk 1, "ar")],[e "arna", (tk 1,"arna")]),++  paradigm_h "nn_0u_praxis" ["praxis"]  $+   noun Utr [""] ["en",""] [] [],++  paradigm_h "nn_vv_stimulus" ["stimulus"]  $+   noun_f 0 Pend ([e ""], [e "", e "en", e "et"],[(id ,""),(tk 2,"i")], [e "en",(tk 2, "ina")]),++  paradigm_h "nn_vv_rå_gång" ["rå"]  $+   noun Pend [""] ["n","et","t"] ["r"] ["rna"],++  paradigm_h "nn_vv_ringfinger" ["ringfinger"]  $+   noun_f 0 Pend ([e ""],[(dv,"et"),(id,"n")], [(dv,"ar"),(id,"")], [(dv,"arna")]),++  paradigm_h "nn_vv_ordal" ["ordal"]  $+   noun Pend [""] ["et","en"] ["","ier"] ["ierna"],++  paradigm_h "nn_vv_halvankare" ["halvankare"]  $+   noun_f 0 Pend ([e ""], [e "t",e "n"], [e "",e "n"],[(tk 1, "na")]),++  paradigm_h "nn_vu_western" ["western"]  $     +   noun_f 0 Utr ([e ""],[e ""],[e "",e "s"],[e "a"]),++  paradigm_h "nn_vu_torso" ["torso"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 1,"er"),(id,"er"),(id,"r")], [(tk 1,"erna"),(id,"erna"),(id,"rna")]),++  paradigm_h "nn_vu_spång" ["spång"]  $+   noun_f 0 Utr ([e ""], [e "en"],[(id,"ar"),(vc "ä","er")], [(id,"arna"),(vc "ä","erna")]),++  -- paradigm_h "nn_vu_spann" ["spann"]  $+  -- noun_f 0 Utr ([e ""], [e "en"],[(id,"ar"),(vc "ä","er")],[(id,"arna"),(vc "ä", "erna")]),++  paradigm_h "nn_vu_scarf" ["scarf"]  $+   noun_f 0 Utr ([e ""], [e "en"],[(id,"ar"),(tk 1,"ves")],[(id,"arna"),(tk 1,"vesen")]),++  paradigm_h "nn_vu_rubel" ["rubel"]  $+   noun_f 0 Utr ([e ""], [e "n"],[e "",(dvu,"er")],[(dvu,"erna")]),++  paradigm_h "nn_vu_ro" ["ro"]   $+   noun Utr [""] ["n"] ["n","r"] ["na","rna"],++  paradigm_h "nn_vu_promovend" ["promovend"]  $+   noun Utr [""] ["en"] ["er","i"] ["erna","ina"],++  paradigm_h "nn_vu_preses" ["preses"]  $+   noun_f 0 Utr ([e ""], [e ""],[(tk 2, "ides"),(id,"ar")], [e "arna"]),++  paradigm_h "nn_vu_paria" ["paria"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(id,"s"),(tk 1,"or")],[(tk 1,"orna")]),++  paradigm_h "nn_vu_mikron" ["mikron"]  $+   noun Utr [""] ["en"] ["er",""] ["erna","en"],++  paradigm_h "nn_vu_lama" ["lama"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 1,"or"),(id,"er")],[(tk 1,"orna"),(id,"erna")]),++  paradigm_h "nn_vu_glass" ["glass"]  $+   noun Utr [""] ["en"] ["ar","er",""] ["arna","erna"],++  paradigm_h "nn_vu_gladiolus" ["gladiolus"]  $+   noun_f 0 Utr ([e ""], [e "en"],[(id,""),(tk 2,"er"),(id,"ar")], [(tk 2,"erna"),(id,"arna")]),++  paradigm_h "nn_vu_baby" ["baby"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(id,"ar"),(id,"er"),(tk 1,"ies")], [e "arna",e "erna",(tk 1,"iesarna")]),++  paradigm_h "nn_vu_albino" ["albino"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 1,"er"),(id,"s")],[(tk 1,"erna"),(id,"sarna")]),++  paradigm_h "nn_vn_stånd" ["stånd"]  $+   noun_f 0 Neutr ([e ""], [e "et"],[(id,""),(vc "ä","er")],[(id,"en"),(vc "ä","erna")]),++  paradigm_h "nn_vn_solo" ["solo"]  $+   noun_f 0 Neutr ([e ""], [e "t"],[(id,"n"),(tk 1,"i")], [e "na"]),++  paradigm_h "nn_vn_serum" ["serum"]  $+   noun_f 0 Neutr ([e ""], [e "",e "et"],[(id,""),(tk 2,"a")], [(tk 2,"ana"),e "en"]),++  -- paradigm_h "nn_vn_scenario" ["scenario"]  $+  -- noun_f 0 Neutr ([e ""], [e "t"],[(id,"n"),(tk 1,"er")],[(id,"na"),(tk 1,"erna")]),++  paradigm_h "nn_vn_rö" ["rö"]  $+   noun Neutr [""] ["t","et"] ["","n"] ["na"],++  paradigm_h "nn_vn_rekviem" ["rekviem"]  $+   noun_f 0 Neutr ([e ""],[(id,""),(tk 1,"t"),(tk 1,"met")],[(id,""),(tk 1,"r")],[(id,"en"),(tk 1,"rna")]),++  paradigm_h "nn_vn_omen" ["omen"]  $+   noun_f 0 Neutr ([e ""],[(id,"et"),(tk 2,"inet")],[(id,""),(tk 2,"ina")],[(id,"en")]),++  paradigm_h "nn_vn_mineral" ["mineral"]  $+   noun Neutr [""] ["et"] ["er", "ier"] ["erna","ierna"],++  paradigm_h "nn_vn_lim" ["lim"]  $+   noun Neutr [""] ["met"] ["", "mer"] ["men","merna"],++  paradigm_h "nn_vn_kompositum" ["kompositum"]  $+   noun_f 0 Neutr ([e ""],[(id,""),(tk 2,"et")],[(tk 2,"a"), (tk 2,"er")], [(tk 2,"erna")]),++  paradigm_h "nn_vn_ja" ["ja"]  $+   noun Neutr [""] ["et","t"] ["n", ""] ["na"],++  paradigm_h "nn_vn_härad" ["härad"]  $+   noun Neutr [""] ["et"] ["", "er","en"] ["ena","erna"],++  paradigm_h "nn_vn_gag" ["gag"]  $+   (noun Neutr [""] ["et"] ["s", ""] ["sen","en"]),++  paradigm_h "nn_vn_gage" ["gage"]  $+   noun_compound 0 Neutr ([e ""],[e "t"],[e "",e "r"],[e "n",e "rna"],[e ""],[e ""]),++  paradigm_h "nn_vn_apropå" ["apropå"]   $       +   noun Neutr [""] ["t"] ["n","er"] ["na","erna"],++  paradigm_h "nn_vn_alfa_z" ["z"]  $+   set_pos "nn" . nna Neutr ([e ""],[e "s"], [e "t"],[e "ts"],[e "n", e ""],[e "ns",e "s"],[e "na"],[e "nas"]),++  paradigm_h "nn_vn_ackordion" ["ackordion"]  $+   noun_f 0 Neutr ([e ""],[(id,"et"),(tk 2,"et")],[(id,""),(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_ov_styck" ["styck"]  $+   noun_compound 0 Pend ([e "",e "en",e "na"],[e "en",e "et"],[e "", e "en",e "na"],[e "ena"],[e ""],[e ""]),++  paradigm_h "nn_ov_diktamen" ["diktamen"]  $+   noun_f 0 Pend ([e ""], [e ""],[(tk 2,"ina")], [(tk 2,"ina")]),++  paradigm_h "nn_ou_putto" ["putto"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 1,"i")], [(tk 1,"ina")]),++  paradigm_h "nn_ou_penny" ["penny"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 2,"ce"),(tk 1,"ies")], [(tk 2,"cen"),(tk 1,"iesarna")]),++  paradigm_h "nn_ou_mekanikus" ["mekanikus"]  $+   noun_f 0 Utr ([e ""], [e "en"],[(tk 3,"ci")], [(tk 3,"cina")]),++  -- paradigm_h "nn_on_slusshuvud" ["slusshuvud"]  $+  -- noun Neutr [""] ["et"] ["en",""] ["ena"],++  paradigm_h "nn_on_gravamen" ["gravamen"]  $+   noun_f 0 Neutr ([e ""], [e "et"],[(tk 2,"ina")], []),++  paradigm_h "nn_7u_slogan" ["slogan"]  $+   noun Utr [""] ["","en"] ["s"] ["sen"],++  paradigm_h "nn_vu_romkom" ["romkom"]  $+   noun_compound 0 Utr ([e ""],[e "en",e "men"],[e "s", e "mar"],[e "sen",e "marna"],[e ""],[e ""]),++  paradigm_h "nn_vu_tortilla" ["tortilla"]  $+   noun_compound 1 Utr ([e "a"],[e "an"],[e "or", e "as"],[e "orna",e "asen",e "asena",e "asarna"],[e "a"],[e "a"]),++  paradigm_h "nn_7u_cashew" ["cashew"]  $+   noun_compound 0 Utr ([e ""],[e "en",e "n"],[e "s"],[e "sen"],[e ""],[e ""]),++  paradigm_h "nn_7n_skinhead" ["skinhead"]  $+   noun Neutr [""] ["et"] ["s"] ["sen"],++  paradigm_h "nn_6v_modus" ["modus"]  $+   noun Pend [""] ["","et"] [""] ["en"],++  paradigm_h "nn_6v_data" ["data"]  $+   noun_compound 0 Pend ([e ""],[e "n",e "t"],[e ""],[e "na"],[e ""],[e ""]),++  paradigm_h "nn_6u_man" ["man"]   $+   noun_f 0 Utr ([e ""], [e "nen"], [(umlaut,""),(id,""),(id,"nar")],[(umlaut,"nen"),(id,"narna")]),++  paradigm_h "nn_6u_iktus" ["iktus"]  $+   noun Utr [""] ["en", ""] [""] ["en"],++  paradigm_h "nn_6n_interregnum" ["interregnum"]  $+   noun_f 0 Neutr ([e ""], [e "et",e ""], [e ""], [e "en"]),++  paradigm_h "nn_5n_ri" ["ri"]  $+   noun Neutr [""] ["et"] ["n"] ["en","na"],++  paradigm_h "nn_3v_gelé" ["gelé"]  $+   noun_compound 0 Pend ([e ""],[e "n",e "t",e "et"],[e "er"],[e "erna"],[e ""],[e ""]),++  paradigm_h "nn_3u_fotnot" ["fotnot"]  $+   noun_f 0 Utr ([e ""], [e "en"], [(id,"er"),(vc "ö","ter")],[(id,"erna"),(vc "ö","terna")]),++  paradigm_h "nn_3u_farao" ["farao"]  $+   noun Utr [""] ["","n"] ["ner"] ["nerna"],++  paradigm_h "nn_3u_eforus" ["eforus"]  $+   noun_f 0 Utr ([e ""], [e ""],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_3n_seminarium" ["seminarium"]  $+   noun_f 0 Neutr ([e ""], [e "et",(tk 2, "et")],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_3n_futurum" ["futurum"]  $+   noun_f 0 Neutr ([e ""], [e "",e "et"],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_3n_dominion" ["dominion"]  $+   noun_f 0 Neutr ([e ""], [e ""],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_3v_aktivum" ["aktivum"]  $+   noun_f 0 Pend ([(tk 2,""), e ""],[(tk 2,"et"),(tk 2,"en"),(id,"et"),(id,"")],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_2u_stygger" ["stygger"]  $+   noun_f 0 Utr ([e ""],[(id,"n"),(tk 1,"n")],[(tk 2,"ar")],[(tk 2,"arna")]),++  paradigm_h "nn_2u_förmiddag" ["förmiddag"]  $ +   noun_f 0 Utr ([e ""],[(id,"en"),(tk 1,"n")],[(id,"ar")],[(id,"arna")]),++  paradigm_h "nn_2u_andur" ["andur"]  $+   noun_f 0 Utr ([e ""], [e "en",e "n"],[(dvu,"ar")],[(dvu,"arna")]),++  paradigm_h "nn_1v_antibiotika" ["antibiotika"]  $+   noun_f 0 Pend ([e ""], [e "n",e "t"],[(tk 1,"or")],[(tk 1,"orna")]),++  paradigm_h "nn_0v_status" ["status"]  $+   noun Pend [""] ["","en"] [] [],++  paradigm_h "nn_0v_hysteri" ["hysteri"]  $+   noun Pend [""] ["n","en","et","t"] [] [],++  paradigm_h "nn_0v_facit" ["facit"]  $+   noun_f 0 Pend ([e ""],[e ""],[],[]),++  paradigm_h "nn_0u_makadam" ["makadam"]  $+   noun_f 0 Utr ([e ""], [(geminate,"en"),(id,"en")], [], []),++  paradigm_h "nn_0u_aorta" ["aorta"]  $+   noun Utr [""] ["","n"] [] [],++  paradigm_h "nn_0n_karborundum" ["karborundum"]  $+   noun Neutr [""] ["","et"] [] [],++  paradigm_h "nn_0n_kammarkollegium" ["kammarkollegium"]  $+   noun_f 0 Neutr ([e ""],[e "",(tk 2,"et")],[],[]),++  paradigm_h "nn_0n_gehenna" ["gehenna"]   $+   noun Neutr [""] ["","t"] [] [],++  paradigm_h "nn_2u_bövel" ["bövel"]  $+   noun_f 0 Utr ([e ""],[e "n",e "en"],[(dvu,"ar")],[(dvu,"arna")]),++  paradigm_h "av_0s_ypperst" ["ypperst"]  $ +   adj 0 ([], [], [], [], [], [e ""], [e "a"]), ++  paradigm_h "av_0_korkad"            ["korkad"]         av_0_konstlad,+  paradigm_h "av_1_enkel"             ["enkel"]          av_1_vacker,+  paradigm_h "av_in_lurt"             ["lurt"]           av_i_diverse,+  paradigm_h "av_id_norra"            ["norra"]          av_i_diverse,+  paradigm_h "av_im_bemälde"          ["bemälde"]        av_i_diverse,+  paradigm_h "av_ik_smärre"           ["smärre"] +   $ adj 0 ([], [], [], [], [e ""], [], []), +  paradigm_h "avm_io0_diverse"        ["bevänt med"]   $ noc $ avm_i,+  paradigm_h "avm_ia0_diverse"        ["före detta"]   $ noc $ avm_i,+  paradigm_h "avm_ip0_diverse"        ["idel öra"]     $ noc $ avm_i,+  -- paradigm_h "av_0_skriftlärd"        ["skriftlärd"]      av_0_konstlad,++  paradigm_h "av_0_höger" ["höger"] +   (adj 2 ([e "er"], [e "er"], [e "ra"], [e "ra"], [], [], [])), ++  paradigm_h "av_0_världsbäst" ["världsbäst"]  +   (adj 0 ([e ""], [e ""], [e "a"], [e "a"], [], [], [])), ++  paradigm_h "av_0_vareviga" ["vareviga"] +   (adj 0 ([(tk 1, "")], [(tk 5, "teviga")], [], [],[], [], [])), ++  paradigm_h "av_0_sankt" ["sankt"] +   (adj 0 ([e ""], [e ""], [e "a"], [e "a"], [], [], [])), ++  paradigm_h "av_0_pytteliten" ["pytteliten"] +   (adjc 5 ([e "liten"], [e "litet"], [e "lilla"], [e "små"], [], [], [],[e "små"])), ++  paradigm_h "av_0_blott" ["blott"]   +   (adj 0 ([e ""], [e ""], [e "a"], [e "a"], [], [], [])), ++  paradigm_h "av_0s_innersta" ["innersta"] $ +   (adj 0 ([], [], [], [], [], [e ""], [])), ++  paradigm_h "av_0p_samtliga" ["samtliga"] +   (adj 0 ([], [], [], [e ""], [], [], [])), ++  paradigm_h "av_0d_nästa" ["nästa"] +   (adj 0 ([], [], [e ""], [], [], [], [])), ++  paradigm_h "av_0d_enda" ["enda"] +   (adj 0 ([], [], [e ""], [], [], [], [])), ++  paradigm_h "av_v_ond" ["ond"]  +   (adj 0 ([e ""],[(tk 1,"t")], [e "a"], [e "a"], [(id,"are"), (tk 3, "värre")], [(id,"ast"), (tk 3, "värst")], [(id,"aste"),(tk 3, "värsta")])), ++  paradigm_h "av_v_god" ["god"] +   (adj 0 ([e ""],[(tk 1,"tt")], [e "a"], [e "a"],[(id,"are"),(tk 3, "bättre")], [(id,"ast"),(tk 3,"bäst")],[(id,"aste"),(tk 3, "bästa")])), ++  paradigm_h "av_2_gammal" ["gammal"] +   (adj 6 ([e "gammal"], [e "gammalt"], [e "gamla"], [e "gamla"], [e "äldre"], [e "äldst"], [e "äldsta"])), ++   paradigm_h "av_2_bra" ["bra"] +   (adj 2 ([e "ra"], [e "ra"], [e "ra"], [e "ra"], [e "ättre"], [e "äst"], [e "ästa"])), ++  paradigm_h "av_v_nära" ["nära"]  +   (adj 1 ([e "a"], [e "a"], [e "a"], [e "a"], [e "mare",e "mre"], [e "mast",e "mst"], [e "masta",e "msta"])), ++  paradigm_h "av_v_förnäm" ["förnäm"] +    (adj 0 ([e ""], [e "t"], [e "a"], [e "a"], [e "are"], [e "st",e "ast"], [e "sta",e "asta"])), ++  paradigm_h "av_v_dålig" ["dålig"] +    (adj 0 ([e ""], [e "t"], [e "a"], [e "a"], [(tk 5,"sämre"), e "are"], [(tk 5,"sämst"),e "ast"], [(tk 5,"sämsta"), e "aste"])), ++  paradigm_h "av_2k_bakre" ["bakre"] +    (adj 2 ([], [], [], [], [e "re"], [e "ersta"], [e "ersta"])), ++  paradigm_h "pn_o_mycken" ["mycken"] $ set_pos "pn" . +     (adj 5 ([e "ycken"], [e "ycket"], [e "yckna"], [e "yckna"], [e "er",e "era"], [e "est"], [e "esta"])), ++  paradigm_h "pn_o_mången" ["mången"] $ set_pos "pn" . +    (adj_no_masc 0 ([e ""], [(tk 2, "t"),(tk 1, "t")], [(tk 2,"a")], [(tk 2,"a")], [(tk 6,"fler"),(tk 6,"flera")], [(tk 6, "flest")], [(tk 6,"flesta")])), ++  paradigm_h "av_2_liten" ["liten"]  +    (adjc 5 ([e "liten"], [e "litet"], [e "lilla"], [e "små"], [e "mindre"], [e "minst"], [e "minsta"],[e "små"])), ++  paradigm_h "av_2_få" ["få"] +    (adj 0 ([e ""], [e ""], [e ""], [e ""],[(umlaut, "rre")], [(umlaut,"rst")], [(umlaut,"rsta")])), ++  paradigm_h "av_1_orange" ["orange"] +    (adj 1 ([e "e"], [e "e", e "t", e "et"], [e "a", e "e", e "ea"], [e "a", e "e", e "ea"], [e "are", e "eare"], [e "ast",e "east"], [e "aste", e "easte"])), ++  paradigm_h "av_1_gratis" ["gratis"] +    (adj 0 ([e ""], [e "", e "t"], [e "", e "a"], [e "", e "a"], [e "are"], [e "ast"], [e "aste"])), ++  paradigm_h "av_1_knall" ["knall"] +    (adj 0 ([e ""], [e ""], [e "a"], [e "a"], [e "are"], [e "ast"], [e "aste"])), ++  paradigm_h "av_1_camp" ["camp"]  +    (adj 0 ([e ""], [e ""], [e "a"], [e "a"], [e "are"], [e "ast"], [e "aste"])), ++  paradigm_h "av_1_beige" ["beige"] +    (adj 0 ([e ""], [e "t"], [e "",e "a"], [e "",e "a"], +            [e "are"], [e "ast"], [e "aste"])), ++  paradigm_h "av_1_ball" ["ball"]  $+    adj 0 ([e ""], [e "",e "t"], [e "a"], [e "a"], [e "are"], [e "ast"], [e "aste"]), ++  paradigm_h "nnm_vv0_libretto" ["allt i allo"]  $+   noc $ +    last_mw "nnm" ((noun Pend [""] ["n","t"] ["r","n"] ["rna","na"])),++  paradigm_h "nnm_vv0_hult" ["bäst före-datum"]   $+   noc $ last_mw "nnm" (noun Pend [""] ["et","en"] ["","ar","er"] ["en","arna","erna"]),++  paradigm_h "nnm_0v_manna" ["lingua franca"] $+   noc $ last_mw "nnm" (noun_f 0 Pend ([e ""],[e "n", e "t"],[],[])),++  paradigm_h "nnm_du0_stampen" ["gordiska knuten"] $+   noc $ last_mw "nnm" (noun_f 0 Utr ([],[e ""],[],[])),++  paradigm_h "nnm_vu0_mikron" ["grand danois"] $+   noc $ last_mw "nnm" (noun Utr [""] ["en"] ["er",""] ["erna"]),++  paradigm_h "nnm_vu0_trio" ["femme fatale"] $+   noc $ last_mw "nnm" (noun Utr [""] ["n"] ["r","s"] ["rna"]),++  paradigm_h "nnm_vu0_bungalow" ["spin off"] $+   noc $ last_mw "nnm" (noun Utr [""] ["en"] ["er","s"] ["erna","sen"]),++  paradigm_h "nnm_vv0_pain_riche" ["pain riche"] $+   noc $ last_mw "nnm" (noun Pend [""] ["n","t"] ["r",""] ["rna","na"]),++  paradigm_h "nnm_vv0_deja_vu" ["déjá vu"]   $+   noc $ last_mw "nnm" (noun Pend [""] ["n","t"] ["r","n"] ["rna","na"]),++  paradigm_h "nnm_rp0_griller" ["scampi fritti"] $+   noc $ last_mw "nnm" (noun_f 0 GPl ([], [], [e ""], [e "na"])),   ++  paradigm_h "nnm_vn0_alfa_z" ["ettstrukna c"]  $+   noc $ last_mw "nnm" (nna Neutr ([e ""],[e "s"], [e "t"],[e "ts"],[],[],[],[])),++  paradigm_h "nnm_su0_pojke" ["dödens lammunge"] $+   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""], [], [(drop_final_e,"ar")], [])),++  paradigm_h "nnm_su0_tro" ["janssons frestelse"] $+   noc $ last_mw "nnm" (noun Utr [""] ["n"] [] []),++   paradigm_h "nnm_7u0_hit" ["negro spiritual"]  $+   noc $ last_mw "nnm" (noun Utr [""] ["en"] ["s"] ["sen"]),  ++  paradigm_h "nnm_7n0_skinhead" ["practical joke"]  $+   noc $ last_mw "nnm" (noun Neutr [""] ["t"] ["s"] ["sen"]),  ++  paradigm_h "nnm_6u0_yen" ["pol mag"]  $ +   noc $ last_mw "nnm" (noun Utr [""] ["en"] [""] ["en"]),  ++  paradigm_h "nnm_6n0_blad" ["flygande tefat"]  $+   noc $ last_mw "nnm" (noun Neutr [""] ["et"] [""] ["en"]),  ++  paradigm_h "nnm_5n0_ansikte" ["da capo"]  $+   noc $ last_mw "nnm" (noun Neutr [""] ["t"] ["n"] ["na"]),  ++  paradigm_h "nnm_ip0_honoratiores" ["lika goda kålsupare"]  $+   noc $ last_mw "nnm" (noun_no_genitive GPl ([],[],[e ""], [])),  ++  paradigm_h "nnm_3u0_film" ["medicine kandidat"]  $+   noc $ last_mw "nnm" (noun Utr [""] ["en"] ["er"] ["erna"]),  ++  paradigm_h "nnm_2u0_stol" ["vinst- och förlusträkning"]  $ +   noc $ last_mw "nnm" (noun Utr [""] ["en"] ["ar"] ["arna"]),  ++  paradigm_h "nnm_2u0_dag" ["bäst före-dag"]  $ +   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""], [(id,"en"),(tk 1,"n")], [(id,"ar"),(tk 1,"r")], [(id,"arna"),(tk 1,"rna")])),++  paradigm_h "nnm_2u0_nyckel" ["golden retriever"]  $ +   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "n"], [(dvu,"ar")], [(dvu,"arna")])),  ++  paradigm_h "nnm_rp1_vägnar" ["fjärilar i magen"]  $ +   noc $ first_mw "nnm" (noun_compound 0 GPl ([],[], [e ""], [e "na"],[],[])),  ++  paradigm_h "nnm_1u0_flicka" ["mul- och klövsjuka"]  $ +   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "n"], [(tk 1,"or")], [(tk 1,"orna")])),  ++  paradigm_h "nnm_0u0_hin" ["hin håle"]  $+    noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[], [], [])),  ++  paradigm_h "nnm_0u0_frid" ["rhode islandsås"]  $ +   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "en"], [], [])),  ++  paradigm_h "nnm_np0_ordalag" ["nordiska språk"]  $ +   noc $ last_mw "nnm" (noun_f 0 GPl ([],[], [e ""], [e "en"])),  ++  paradigm_h "nnm_4u0_linje" ["eau de cologne"]  $+   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "n"], [e "r"], [e "rna"])),  ++  paradigm_h "nnm_2u1_stol" ["ulv i fårakläder"]  $ +   noc $ first_mw "nnm" (noun_compound 0 Utr ([e ""],[e "en"], [e "ar"], [e "arna"],[],[])),  ++  paradigm_h "nnm_2u0_pojke" ["vandrande pinne"]  $ +   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "n"], [(drop_final_e,"ar")], [(drop_final_e,"arna")])),  ++  paradigm_h "nnm_rp0_kalla_kårar" ["kalla kårar"]  $+   noc $ last_mw "nnm" (noun_f 0 GPl ([],[], [e ""], [e "na"])),++  paradigm_h "nnm_1u1_flicka" ["fnurra på tråden"]  $ +   noc $ first_mw "nnm" (noun_compound 0 Utr ([e ""],[e "n"], [(tk 1,"or")], [(tk 1,"orna")],[],[])),  +  paradigm_h "nnm_0u0_tro" ["cherry brandy"]  $ +   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "n"], [], [])),++  paradigm_h "nnm_0u0_antimateria" ["idé- och lärdomshistoria"]  $+   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "n", (tk 1,"en")], [], [])),++  paradigm_h "nnm_in0_vaj" ["berått mod"]  $+   noc $ last_mw "nnm" (noun_no_genitive Neutr ([e ""],[], [], [])),++  paradigm_h "nnm_iu0_vift" ["gilla gång"]  $+   noc $ last_mw "nnm" (noun_no_genitive Utr ([e ""],[], [], [])),++  paradigm_h "nnm_dn0_rubbet" ["rubbet"] $+   noc $ last_mw "nnm" (noun_compound 0 Neutr ([],[e ""], [], [],[],[])),++  paradigm_h "nna_0v_pcb"  ["pcb"]  $ +   nna Pend ([e ""],[e "s"], [e "n", e "en",e "t",e "et"],[e "ns", e "ens",e "ts", e "ets"],[],[],[],[]),++  paradigm_h "nna_vu_dvd"  ["dvd"]  $ +   nnac Utr ([e ""],[e "s"], [e "n"],[e "ns"],[e "ar",e "er"],[e "ars",e "ers"],[e "arna",e "erna"],[e "arnas",e "ernas"]),++  paradigm_h "nna_0n_hk"  ["hk"]  $ +   nna Neutr ([e ""],[e "s"], [],[],[],[],[],[]),++  paradigm_h "nna_0u_jo"  ["jo"]  $ +   nna Utr ([e ""],[e "s"], [],[],[],[],[],[]),++  paradigm_h "nna_vv_dna"  ["dna"]  $ +   nna Pend ([e ""],[e "s"], +             [e "n", e "t"],[e "ns",e "ts"],+             [e "",e "er"],[e "s",e "ers"],+             [e "na",e "erna"],[e "nas",e "ernas"]+            ),+  paradigm_h "nna_6n_kg"   ["kg"]  $ +   nna Neutr ([e ""],[e "s"], [],[], [e ""], [e "s"], [], []),+  paradigm_h "nna_6u_lp"   ["lp"]  $ +   nna Utr ([e ""],[e "s"], [e "n"],[e "ns"],+            [e ""],[e "s"],[e "na"],[e "nas"]),+   paradigm_h "nna_in_ex"   ["ex"]  $ +   nna Neutr ([e ""],[],[],[],[],[],[],[]),+   paradigm_h "nna_6n_ekg"  ["ekg"]  $+   nna Neutr ([e ""],[e "s"], [e "t"],[e "ts"],+            [e "",e "n"],[e "s",e "ns"],[e "na"],[e "nas"]),+  paradigm_h "nna_vn_wc"   ["wc"]  $ +   nna Neutr ([e ""],[e "s"], +             [e "t"],[e "ts"],+             [e "",e "n"],[e "s",e "ns"],+             [e "en",e "na"],[e "ens",e "nas"]+            ),+  paradigm_h "nna_6v_pm"   ["pm"]  $ +   nna Pend ([e ""],[e "s"], +             [e "en", e "et"],[e "ens",e "ets"],+             [e ""],[e "s"],+             [e "na"],[e "nas"]+            ),+  paradigm_h "nna_2u_bh"   ["bh"]  $ +   nna Utr ([e ""],[e "s"], +            [e "en",e "n"],[e "ens", e "ns"],+            [e "ar"],[e "ars"],+            [e "arna"],[e "arnas"]+           ),++  paradigm_h "avm_0p0_gul" ["rangen stridig"]  $ +     noc $ last_mw "avm" $ av_1_blek_ng,+  paradigm_h "avm_0a0_diverse" ["ute efter"] $ +     noc $ last_mw "avm" av_i_diverse,+  paradigm_h "avm_0a0_korkad" ["så kallad"]  $ +     noc $ last_mw "avm" (adj 0 ([e ""], [(tk 1,"t")], [e "e"], [e "e"], [], [], [])),+  paradigm_h "avm_0p1_gul" ["hal som en ål"]  $ +     noc $ first_mw "avm" (adj_no_genitive_c 0 ([e ""], [e "t"], [], [], [], [], [],[])),+  paradigm_h "avm_0p1_brydd" ["stadd i"]  $ +     noc $ first_mw "avm" (adj_no_genitive_c 0 ([e ""], [(tk 2,"tt")], [], [], [], [], [],[])),+  paradigm_h "avm_0p0_diverse" ["ute efter"]  $ +     noc $ last_mw "avm" av_i_diverse,+  paradigm_h "avm_1p1_bred" ["glad i"]  $ +     noc $ first_mw "avm" (adj_no_genitive_c 0 ([e ""], [(tk 1,"tt")], [], [], [e "are"], [e "ast"], [e "aste"],[])),+  paradigm_h "avm_1p1_akut" ["fäst vid"]  $ +   noc $ first_mw "avm" (adj_no_genitive_c 0 ([e ""], [e ""], [], [], [e "are"], [e "ast"], [e "aste"],[])),+  paradigm_h "al_o_en" ["en"] $ al_o_en,+  paradigm_h "nn_0n_hindi" ["hindi"]  $+   noun_compound 0 Neutr ([e ""], [],[],[],[e ""],[e ""]),+  paradigm_h "nn_0n_kol-14" ["kol-14"] $ +   nn_kol_14,+  paradigm_h "nn_0u_hin" ["hin"]    $+   noun_f 0 Utr ([e ""], [],[],[]),+  paradigm_h "nn_0u_boskap" ["boskap"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[],[],[(ds,"")],[(ds,"")]),++  paradigm_h "nn_0u_brödsäd" ["brödsäd"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[],[],[(ds,""),e "es"],[(ds,""), e "es"]),++  -- paradigm_h "nn_0u_filmjölk" ["filmjölk"]    $+  --  noun_compound 0 Utr ([e ""], [e "en"],[],[],[e "",(ds,"")],[e "", (ds,"")]),++  paradigm_h "nn_0u_månsing" ["månsing"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[],[],[e ""],[e ""]),++  paradigm_h "nn_0u_kärnkraft" ["kärnkraft"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[],[],[e "",(ds,"")],[e "",(ds,"")]),++  paradigm_h "nn_6u_mat" ["mat"]    $+   noun_compound_ng 0 Utr ([e ""], [],[e ""],[],[],[]),++  paradigm_h "nn_0u_mjölk" ["mjölk"]    $+    noun_compound 0 Utr ([e ""], [e "en"],[],[],[e ""],[e "",(ds,"")]),++  paradigm_h "nn_0u_säd" ["säd"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[],[],[e "", e "es"],[e "es",(ds,"")]),++  paradigm_h "nn_2u_sten" ["sten"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[e "ar"],[e "arna"],[e ""],[e "",(ds,"")]),++  paradigm_h "nn_2u_herde" ["herde"]    $+   noun_compound 1 Utr ([e "e"], [e "en"],[e "ar"],[e "arna"],[e "e",e "a"],[e "a",e "e",e "es"]),++  paradigm_h "nn_2u_hjälte" ["hjälte"]    $+   noun_compound 1 Utr ([e "e"], [e "en"],[e "ar"],[e "arna"],[e "e"],[e "e", e "es"]),++  paradigm_h "nn_2u_pojke" ["pojke"]    $+   noun_compound 1 Utr ([e "e"], [e "en"],[e "ar"],[e "arna"],[(ungeminate,"")],[(ds . ungeminate,"")]),++  paradigm_h "nn_2u_ormbunke" ["ormbunke"]    $+   noun_compound 1 Utr ([e "e"], [e "en"],[e "ar"],[e "arna"],[(ungeminate,""),(ds . ungeminate,""),e "e",e "es"],[(ungeminate,""),(ds . ungeminate,""),e "e",e "es"]),++  paradigm_h "nn_2u_ängel" ["ängel"]    $+   noun_compound 0 Utr ([e ""], [e "n"],[(dvu, "ar")],[(dvu,"arna")],[e "",(dv,"a")],[e "",(ds,""),(dv,"a")]),++  paradigm_h "nn_3u_karbid" ["karbid"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[e "er"],[e "erna"],[e ""],[e ""]),++  paradigm_h "nn_ou_deputerad" ["deputerad"]  $ +   noun_f 0 Utr ([e ""], [e "en"],[e "e"],[e "ena"]),+  paradigm_h "nn_6u_yen" ["yen"]    $ +   noun_f 0 Utr ([e ""], [e "en"],[e ""],[e "en"]),+  paradigm_h "nn_vu_bagis" ["bagis"]  $ +   noun_f 0 Utr ([e ""], [e "en"],[e "",e "ar"],[e "en",e "arna"]),+  paradigm_h "nn_vu_order" ["order"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(id,""),(dv,"ar")],[e "na", (dv,"arna")]), +  paradigm_h "nn_vu_minut" ["minut"]  $ +   noun_f 0 Utr ([e ""], [e "en"],[e "er",e "rar"],[e "erna",e "rarna"]),+  paradigm_h "av_0_uppsutten" ["uppsutten"] $ +   (adj 2 ([e "en"], [e "et"], [e "na"], [e "na"], [], [], [])), +  paradigm_h "av_0_uppvikt" ["uppvikt"] $ +   (adj 0 ([e ""], [e ""], [e "a"], [e "a"], [], [], [])), +  paradigm_h "av_v_trång" ["trång"] $ +   (adj 0 ([e ""], [e "t"], [e "a"], [e "a"], [(vc "ä","re"),(id,"are")], +           [(vc "ä","st"),(id,"ast")], [(vc "ä","ste"),(id,"aste")])), +  paradigm_h "pnm_i_ditt_och_datt" ["ditt och datt"]  $ pnm_inv,+  paradigm_h "pnm_o_vem_som_helst" ["vem som helst"]  $ pnm_gen,+  paradigm_h "pnm_o_en_annan" ["en annan"]  $ pnm_gen2,+  paradigm_h "nnm_6na_segel" ["kort varsel"] $ noc $ nnm_6na_kort_varsel,+  paradigm_h "nnm_6na_glykemiskt_index" ["glykemiskt index"] $ noc $ nnm_6na_glykemiskt_index,+  paradigm_h "nnm_6ua_gås"   ["oplockad gås"]  $ noc $ nnm_6ua_oplockad_gås,+  paradigm_h "nnm_0ua_god_ton"           ["god ton"]  $ noc $ nnm_0ua_frid,+  paradigm_h "nnm_3ua_fransysk_visit" ["fransysk visit "]  $ noc $ nnm_3ua_film,+  paradigm_h "nnm_3ua_enarmad_bandit" ["enarmad bandit"]  $ noc $ nnm_3ua_enarmad_bandit,+  paradigm_h "nnm_1ua_svart_låda" ["svart låda"]  $ noc $ nnm_1ua_svart_låda,+ paradigm_h "nnm_3ua_rolig_historia" ["rolig historia"]  $ noc $ nnm_3ua_rolig_historia,+  paradigm_h "nnm_2ua_pojke" ["finsk pinne"] $ noc $ nnm_2ua_pojke,+  paradigm_h "nnm_dpc_göranden_och_låtanden" ["göranden och låtanden"]  $ noc $ nnm_5pc_göranden_och_låtanden,+  paradigm_h "nnm_0n0_fait_accompli" ["fait accompli"] $+    noc $ last_mw "nnm" (noun_f 0 Neutr ([e ""], [],[],[])),+  paradigm_h "nnm_0na_syre"     ["fritt vivre"]     $ noc $ nnm_0na_fritt_vivre,+  paradigm_h "nnm_2ua_stol"            ["varm korv"]       $ noc $ nnm_2ua_stol,+  paradigm_h "nnm_npc_kreti_och_pleti" ["kreti och pleti"] $ noc $ nnm_gpc_kreti_och_pleti,+  paradigm_h "ava_i_kungl"         ["Kungl."]        $ invar "ava",+  paradigm_h "vba_ia_jfr"          ["jfr"]           $ invar "vba",+  paradigm_h "ppa_i_pga"           ["pga"]           $ invar "ppa",+  paradigm_h "ppm_i_a_la"          ["a la"]          $ noc $ invar "ppm",+  paradigm_h "kna_i_o"             ["o"]             $ invar "kna",+  paradigm_h "snm_i_efter_det_att" ["efter det att"] $ noc $ invar "snm",+  paradigm_h "ssm_d2_svinhugg_går_igen" ["svinhugg går igen"] $ noc $ invar "ssm",+  paradigm_h "ssm_i1_märk_väl"          ["märk väl"]          $ noc $ invar "ssm",+  paradigm_h "ssm_d2_saken_är_biff"     ["saken är biff"]     $ noc $ invar "ssm",+  paradigm_h "nlm_gi_tusen_sinom_tusen" ["tusen sinom tusen"] $ noc $ invar "nlm"+ ]++sal :: [(String, [String], [String] -> Entry)]+sal =+ [+  paradigm_h "mxc_i_dygnetrunt"   ["dygnetrunt"]      (set_pos "mxc" . compound),+  paradigm_h "sxc_i_justitie"      ["justitie"]        compound,+  paradigm_h "ab_1_fort"          ["fort"]            ab_1_fort,+  paradigm_h "ab_i_bort"          ["bort"]            ab_bort,++  paradigm_h "ab_i_aldrig"        ["aldrig"]          ab_i_aldrig,+  paradigm_h "ab_is_främst"       ["främst"]          ab_främst,++  paradigm_h "aba_i_dvs"          ["dvs"]             aba_i_dvs,+  paradigm_h "abm_i_till_exempel" ["till exempel"]    abm_i_till_exempel,+  paradigm_h "av_0_lastgammal"    ["lastgammal"]      av_0_lastgammal,+  paradigm_h "av_0_medelstor"     ["medelstor"]       av_0_medelstor,+  paradigm_h "av_1_akut"          ["akut"]            av_1_akut,+  paradigm_h "av_1_blå"           ["blå"]   $+   (adj 0 ([e ""], [e "tt"], [e "a",e ""], [e "a",e ""], [e "are"], [e "ast"], [e "aste"])), ++  paradigm_h "av_1_bred"          ["bred"]            av_1_glad,+  paradigm_h "av_1_brydd"         ["brydd"]           av_1_högljudd,+  -- paradigm_h "av_1_grann"         ["grann"]           av_1_tunn,+  paradigm_h "av_1_gul"           ["gul"]             av_1_blek,        +  paradigm_h "av_1_lat"           ["lat"]             av_1_lat,+  paradigm_h "av_1_ny"            ["ny"]              av_1_fri,+  paradigm_h "av_1_rund"          ["rund"]            av_1_hård,+  paradigm_h "av_1_stum"          ["stum"]            av_1_ensam,+  paradigm_h "av_1_utbrunnen"     ["utbrunnen"]       av_1_angelägen,+  paradigm_h "av_i_diverse"       ["diverse"]         av_i_diverse,+  paradigm_h "in_i_aj"            ["aj"]              interj,+  paradigm_h "inm_i_aja_baja"     ["aja baja"]        interjm,+  paradigm_h "kn_i_och"           ["och"]             conj,+  paradigm_h "nl_g_halvannan"     ["halvannan"] $+   number ([e ""],[(tk 5,"tannat")],[],[],[e ""]),+  paradigm_h "nl_g_tu"            ["tu"] $+   number ([e ""],[e ""],[],[],[e ""]),+  paradigm_h "nl_g_tvenne"            ["tvenne"] $+   number ([e ""],[e ""],[],[],[]),+  paradigm_h "nl_i_i"             ["i"] $+   number_ng ([e ""],[e ""],[],[],[]),+  paradigm_h "nl_n_1"             ["1"] nl_n_1, +  paradigm_h "nl_n_elva"          ["elva"] $+   number ([e ""],[e ""],[(tk 2, "fte")],[(tk 2, "fte")],[e "",(tk 2, "fte")]),+  paradigm_h "nl_n_en"            ["en"] $+   number ([e ""],[(tk 1, "tt")],[(tk 2, "första")],[(tk 2, "förste")],[e "", (tk 1, "tt"),(tk 2, "första"),(tk 2, "förste")]),+  paradigm_h "nl_n_fem"           ["fem"] $+   number ([e ""],[e ""],[e "te"],[e "te"],[e "",e "te"]),+  paradigm_h "nl_n_fyra"          ["fyra"] $+   number ([e ""],[e ""],[(tk 3, "järde")],[(tk 3,"järde")],[e "",(tk 3,"järde")]),+  paradigm_h "nl_n_hundra"        ["hundra"] $+   number ([e ""],[e ""],[e "de"],[e "de"],[e "",e "de"]),+  paradigm_h "nl_n_sex"           ["sex"] $+    number ([e ""],[e ""],[(tk 2, "jätte")],[(tk 2,"jätte")],[e "", (tk 2,"jätte")]),+  paradigm_h "nl_n_tio"           ["tio"] $+   number ([e ""],[e ""],[e "nde"],[e "nde"],[e "", e "nde"]),+  paradigm_h "nl_n_tolv"          ["tolv"] $+   number ([e ""],[e ""],[(tk 1, "fte")],[(tk 1, "fte")],[e "", (tk 1,"fte")]),+  paradigm_h "nl_n_tre"           ["tre"] $+   number ([e ""],[e ""],[e "dje"],[e "dje"],[e "", e "dje"]),+  paradigm_h "nl_n_två"           ["två"] $+   number ([e ""],[e ""],[(tk 3, "andra")],[(tk 3, "andre")],[e "",(tk 3, "andra"),(tk 3,"andre")]),+  paradigm_h "nl_n_åtta"          ["åtta"] $+   number ([e ""],[e ""],[(tk 1, "onde")],[(tk 1, "onde")],[e "",(tk 1, "onde")]),+  paradigm_h "nn_0u_tro"          ["tro"] $+   noun_compound 0 Utr ([e ""], [e "n"], [], [],[(ds,"")],[(ds,"")]),  +  paradigm_h "nn_0u_radar" ["radar"] $+   noun_compound 0 Utr ([e ""], [e "n"], [], [],[e ""],[e ""]),  ++  paradigm_h "nn_0u_hemsjuka" ["hemsjuka"] $+   noun_compound 0 Utr ([e ""], [e "n"], [], [],[(tk 1, "e"),(ds,"")],[(tk 1,"e"),(ds,"")]),++  paradigm_h "nn_1u_skyltdocka" ["skyltdocka"] $+   noun_compound 1 Utr ([e "a"], [e "an"], [e "or"], [e "orna"],[e "e",(ds,"")],[e "e",(ds,"")]),++  paradigm_h "nn_0u_saltsyra" ["saltsyra"] $+   noun_compound 0 Utr ([e ""], [e "n"], [], [],[(tk 1, "e"),e ""],[(tk 1,"e"),e ""]),+  +  paradigm_h "nn_1u_aminosyra" ["aminosyra"] $+   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")],[(tk 1, "e"),e ""],[(tk 1,"e"),e ""]),++  paradigm_h "nn_0u_tjockolja" ["tjockolja"] $+   noun_compound 0 Utr ([e ""], [e "n"], [], [],[(tk 1, "e")],[(tk 1,"e")]),++  paradigm_h "nn_0n_babbel"       ["babbel"] $+   noun_compound 0 Neutr ([e ""], [(dvu,"et")], [], [],[e ""],[e ""]),  +   paradigm_h "nn_0n_cesium"       ["cesium"] $+   noun_compound 0 Neutr ([e ""], [(tk 2,"et"),e "et", e ""], [], [],[e ""],[e ""]),  +  paradigm_h "nn_0n_dalt"         ["dalt"] $+   noun_compound 0 Neutr ([e ""], [e "et"], [], [],[e ""],[e "", (ds, "")]),+  paradigm_h "nn_0n_koksalt" ["koksalt"] $+   noun_compound 0 Neutr ([e ""], [e "et"], [], [],[e "",(ds,"")],[e "",(ds,"")]),++  paradigm_h "nn_0n_landt" ["land"] $+   noun_compound 0 Neutr ([e ""], [e "et"], [], [],[(tk 1, "t")],[(tk 1, "t")]),++  paradigm_h "nn_0n_latin" ["latin"] $+   noun_compound 0 Neutr ([e ""], [e "et"], [], [],[e ""],[e ""]),++  paradigm_h "nn_0n_ansvar" ["ansvar"] $+   noun_compound 0 Neutr ([e ""], [e "et"], [], [],[(ds,"")],[(ds, "")]),++  paradigm_h "nn_0u_hälsa" ["hälsa"] $+   noun_compound 0 Utr ([e ""], [e "n"], [], [],[(tk 1, "o")],[(tk 1, "o"), (tk 1,"e")]),++  paradigm_h "nn_0n_oväsen" ["oväsen"] nn_0n_oväsen,+  paradigm_h "nn_0n_toapapper" ["toapapper"] $+   noun_f 0 Neutr ([e ""],[(dv, "et"),e "et"], [], []),  +  paradigm_h "nn_0n_raseri"       ["raseri"] $+   noun_compound 0 Neutr ([e ""],[e "et", e "t"], [], [],[e ""],[e ""]),  +  paradigm_h "nn_0n_skum"         ["skum"]          nn_0n_skum,+  paradigm_h "nn_0n_syre"         ["syre"]          nn_0n_kaffe,+  paradigm_h "nn_0u_akribi"       ["akribi"] $+ noun_compound 0 Utr ([e ""],[e "n", e "en"], [], [],[e ""],[e ""]),  +  paradigm_h "nn_0u_antimateria"  ["antimateria"] $+   noun_f 0 Utr ([e ""], [e "n",(tk 1, "en")], [], []),  +  paradigm_h "nn_0u_samverkan"    ["samverkan"]   $+   noun_compound 0 Utr ([e ""], [e ""], [], [],[(ds, "")],[(ds,"")]),++  paradigm_h "nn_0u_skam"         ["skam"]          nn_0u_skam,+  paradigm_h "nn_0v_bikarbonat"   ["bikarbonat"]    nn_0v_uran,+  paradigm_h "nn_0v_manna"        ["manna"]         nn_0v_manna,+  paradigm_h "nn_1u_ros"          ["ros"] $+   noun_compound 0 Utr ([e ""], [e "en"], [e "or"], [e "orna"], [e ""], [(ds,"")]),   +  paradigm_h "nn_2u_afton"        ["afton"] $+   noun_compound 0 Utr ([e ""], [e "en"], [(dv, "ar")], [(dv, "arna")],[e ""],[e "", (ds,"")]),   +  paradigm_h "nn_2u_bro"          ["bro"]           nn2,+  paradigm_h "nn_2u_dotter"       ["dotter"]          nn2_dotter,+  paradigm_h "nn_2u_fordran"      ["fordran"] $+   noun_compound 0 Utr ([e ""], [e ""], [(tk 2, "ingar")], [(tk 2, "ingarna")],[(ds,"")],[(ds,"")]),   +  paradigm_h "nn_2u_bokanmälan"   ["bokanmälan"] $+   noun_compound 0 Utr ([e ""], [e ""], [(tk 2, "ningar")], [(tk 2, "ningarna")],[(ds,"")],[(ds,"")]),   +  paradigm_h "nn_2u_fröken"       ["fröken"]          nn2_öken,+  paradigm_h "nn_2u_karl"         ["karl"]  $+   noun_f 0 Utr ([e ""], [e "n",e "en"], [e "ar"], [e "arna"]),  +  paradigm_h "nn_2u_mor"        ["mor"] nn2_moder,+  paradigm_h "nn_2u_morgon"       ["morgon"] $+   noun_f 0 Utr ([e ""], [e "en"], [(dv,"ar"),(tk 3,"nar")], [(dv,"arna"),(tk 3,"narna")]),  +  paradigm_h "nn_2u_mun"          ["mun"]             nn2_kam,+  paradigm_h "nn_3n_land"         ["land"] $+   noun_compound 0 Neutr ([e ""], [e "et"], [(vc "ä", "er")], [(vc "ä", "erna")],[(ds,"")],[(ds,"")]),   +  paradigm_h "nn_3n_museum"       ["museum"]          nn3_museum,+  paradigm_h "nn_3u_bok"          ["bok"]             nn3_bok,+  paradigm_h "nn_3u_fot"          ["fot"]             nn3_fot,+  paradigm_h "nn_3u_bockfot"      ["bockfot"]         nn3_bockfot,+  paradigm_h "nn_3u_historia"     ["historia"] $+   noun_f 0 Utr ([e ""], [(tk 1,"en"),e "n"], [(tk 1, "er")], [(tk 1 ,"erna")]),  +  paradigm_h "nn_3u_kavaljer"     ["kavaljer"]  $+   noun_f 0 Utr ([e ""], [e "en", e "n"], [e "er"], [e "erna"]),  +  paradigm_h "nn_3u_motor"        ["motor"] $+   noun_compound 0 Utr ([e ""], [e "n"], [e "er"], [e "erna"],[e ""],[e ""]),  +  paradigm_h "nn_3u_son"          ["son"] $+   (noun_f 0 Utr ([e ""], [e "en"], [(vc "ö","er")], [(vc "ö","erna")])),  +  paradigm_h "nn_3u_stad"         ["stad"] $+   (noun_compound 0 Utr ([e ""], [e "en",(tk 1,"n")], [(vc "ä","er")], [(vc "ä","erna")],[(ds,"")],[(ds,"")])),  +  paradigm_h "nn_3u_tång"         ["tång"] $+   (noun_f 0 Utr ([e ""], [e "en"], [(vc "ä","er")], [(vc "ä","erna")])),  +  paradigm_h "nn_3u_vän"          ["vän"]             nn3_vän,+  paradigm_h "nn_3v_flanell"      ["flanell"]         nn3_flanell,+  paradigm_h "nn_4u_bonde"        ["bonde"]           nn4_bonde,+  paradigm_h "nn_5n_ansikte"      ["ansikte"] $+   noun_compound 0 Neutr ([e ""], [e "t"], [e "n"], [e "na"],[(ds_drop, "")],[(ds_drop,"")]),   +  paradigm_h "nn_5n_bo"           ["bo"] $+   (noun_f 0 Neutr ([e ""], [e "t", e "et"], [e "n"], [e "en",e "na"])),  +  paradigm_h "nn_5u_anhållan"      ["anhållan"]         nn5_anmodan,+  paradigm_h "nn_6n_aber"         ["aber"] $+   (noun_f 0 Neutr ([e ""], [e "", (dv,"et"), e "et"], [e ""], [(dv, "en"),e "en"])),  +  paradigm_h "nn_6n_blad"         ["blad"] $+    noun_compound 0 Neutr ([e ""], [e "et"], [e ""], [e "en"],[e ""],[e "", (ds,"")]),   +  paradigm_h "nn_6n_system"         ["system"] $+    noun_compound 0 Neutr ([e ""], [e "et"], [e ""], [e "en"],[e ""],[e ""]),   +  paradigm_h "nn_6n_bord"         ["bord"] $+    noun_compound 0 Neutr ([e ""], [e "et"], [e ""], [e "en"],[e "",(ds,"")],[e "", (ds,"")]),   +  paradigm_h "nn_6n_foder"        ["foder"] $+    noun_compound 0 Neutr ([e ""], [(dvu, "et")], [e ""], [(dvu,"en"),e "na"],[e ""],[e ""]),   +  paradigm_h "nn_6n_frx"          ["f"]  $+     set_pos "nn" . nna Neutr ([e ""],[e "s"], [e "et"],[e "ets"],[e ""],[e "s"],[e "en"],[e "ens"]),+  paradigm_h "nn_6n_papper"       ["papper"] $+   (noun_compound 0 Neutr ([e ""], [(id,"et"),(dv,"et")], [(id,"")], [e "en", e "na", (dv,"en")],[e ""],[(ds,"")])),  +  paradigm_h "nn_6n_rum"          ["rum"]  $  nn6_program,+  paradigm_h "nn_6n_träd"         ["träd"] $+   (noun_f 0 Neutr ([e ""], [e "et"], [(id,""),(tk 1, "n")], [(id,"en"),(tk 1, "na")])),  +  paradigm_h "nn_6u_akademiker"   ["akademiker"]      nn6_akademiker,+  paradigm_h "nn_6u_vapenbroder" ["vapenbroder"]          nn_6u_broder,+  paradigm_h "nn_6u_anfader"        ["anfader"] $+   (noun_compound 0 Utr ([e ""], [e "n"], [(vc "ä" . tk 2, "er")],[(vc "ä" . tk 2,"erna")],[e "",(ds,"")],[e "",(ds,"")])),  +  paradigm_h "nn_6u_far"        ["far"] $+   (noun_compound 0 Utr ([e "",(tk 1,"der")], [(tk 1, "dern")], [(vc "ä" . tk 1, "der")],[(vc "ä" . tk 1,"derna")],[e "",(ds,""),(tk 1,"der"),(ds.tk 1,"der")],[e "",(ds,""),(tk 1,"der"),(ds.tk 1,"der")])),  +  paradigm_h "nn_6u_kammare"      ["kammare"] $+   (noun_compound 0 Utr ([e ""], [e "n"], [(tk 4,"rar"),(id,"")], [(tk 4,"rarna")],[(tk 1,"")],[(tk 1,"")])),  +  paradigm_h "nn_6u_kikare"       ["kikare"]  $+   noun_compound 0 Utr ([e ""], [e "n"], [e ""], [(tk 1, "na")],[(tk 1, "")],[(tk 1,"")]),   +  paradigm_h "nn_6u_mus"          ["mus"]             nn_6u_mus,+  paradigm_h "nn_6u_vaktman"      ["vaktman"]         nn_6u_vaktman,+  paradigm_h "nn_6v_borst"        ["borst"]           nn_6v_borst,+  paradigm_h "nn_7u_hit"          ["hit"] $+   noun_f 0 Utr ([e ""], [e "en"], [e "s"],[e "sen"]),  +  paradigm_h "nn_7u_ranger"      ["ranger"] $+   (noun_f 0 Utr ([e ""], [e "n"], [e "s"], [e "sen", e "sarna"])),  +  paradigm_h "nn_in_vaj"          ["vaj"]             nn_in_vaj,+  paradigm_h "nn_iu_vank"         ["vank"]            nn_iu_avvaktan,+  paradigm_h "nn_iv_hum"          ["hum"]             nn_iv_hum,+  paradigm_h "nn_on_öga"          ["öga"]       +   (noun_compound 0 Neutr ([e ""], [e "t"], [(tk 1,"on")], [(tk 1,"onen")],[(tk 1,"on")],[(tk 1,"on")])),  +  paradigm_h "nn_ou_officer"      ["officer"]         nn_ou_officer,+  paradigm_h "nn_vn_alfa_abc"     ["a"]  $+   replace_attr wp_attr w_attr . replace_attr h_attr w_attr . nn_vn_alfa_abc,+  paradigm_h "nn_vn_garn"         ["garn"]            nn_vn_garn,+  paradigm_h "nn_vn_huvud"        ["huvud"]           nn_vn_huvud,+  paradigm_h "nn_vn_kvantum"      ["kvantum"] $+   noun_f 0 Neutr  ([e ""], [e "et", e ""], [(tk 2,"a"),e ""], [(tk 2,"ana"),e "en"]), +  paradigm_h "nn_vn_spektrum"     ["spektrum"]        nn_vn_spektrum,+  paradigm_h "nn_vu_blinker"      ["blinker"]         nn_vu_blinker,+  paradigm_h "nn_vu_cyklamen"     ["cyklamen"] $+   noun_f 0 Utr  ([e ""], [e ""], [(id,""), (tk 2,"er")], [(id,"a"),(tk 2,"erna")]),   +  paradigm_h "nn_vu_dress"        ["dress"]           nn_vu_dress,+  paradigm_h "nn_vu_hambo"        ["hambo"]           nn_vu_hambo,+  paradigm_h "nn_vu_kaliber"      ["kaliber"]         nn_vu_kaliber,+  paradigm_h "nn_vu_playboy"      ["playboy"]         nn_vu_playboy,+  paradigm_h "nn_vu_trio"         ["trio"]            nn_vu_trio,+  paradigm_h "nn_vv_borr"         ["borr"]            nn_vv_borr,+  paradigm_h "nn_vv_test"         ["test"]            nn_vv_test,+  paradigm_h "nna_iu_dr"          ["dr"] $+   nna Utr ([e ""],[],[],[],[],[],[],[]),+  paradigm_h "nna_iv_nxn"         ["log4/log3"] $+   nna Pend ([e ""],[],[],[],[],[],[],[]),+  paradigm_h "nna_6u_m"           ["m"] $+   nna Utr ([e ""],[e "s"], [e "en"],[e "ens"], [e ""],[e "s"],[e "en"],[e "ens"]),+  paradigm_h "pm_fph_alice"       ["Alice"]           $ pm_f_alice "ph",+  paradigm_h "pm_fph_karin"       ["Karin"]           $ pm_f "ph",+  paradigm_h "pm_fph_lisa"        ["lisa"]            $ +   set_inhs ["f","ph"] . set_pos "pm" . noun_f 1 Utr  ([e "a"], [e "an"], [e "or"], [e "orna"]),   +  paradigm_h "pm_fpm_idun"        ["Idun"]            $ pm_f "pm",+  paradigm_h "pm_hph_berg"        ["Berg"]            $ pm_h "ph",+  paradigm_h "pm_hph_svensson"    ["Svensson"]        $ +   set_inhs ["h","ph"] . set_pos "pm" . noun_f 0 Utr  ([e ""], [e "en"], [(umlaut, "er")], [(umlaut,"erna")]),   +  paradigm_h "pm_mph_ansgar"      ["Ansgar"]          $ pm_m "ph",+  paradigm_h "pm_mph_bo"          ["Bo"]              $ pm_m "ph",+  paradigm_h "pm_mph_lars"        ["Lars"]            $ +   set_inhs ["m","ph"] . set_pos "pm" . noun_f 0 Utr  ([e ""], [e ""], [e "ar"], [e "arna"]),   +  paradigm_h "pm_mph_sture"       ["Sture"]           $ +   set_inhs ["m","ph"] . set_pos "pm" . noun_f 0 Utr  ([e ""], [e ""], [(dv,"ar")], [(dv,"arna")]),   +  paradigm_h "pm_mpm_oden"        ["Oden"]            $ pm_m "pm",+  paradigm_h "pm_nlf_kreml"       ["Kreml"]           $ pm_n "lf",+  paradigm_h "pm_nlg_delhi"       ["Delhi"]           $ pm_n "lg",+  paradigm_h "pm_nlg_eurasien"    ["Eurasien"]        $ pm_n "lg",+  paradigm_h "pm_nlg_göteborg"    ["Göteborg"]        $ pm_n "lg",+  paradigm_h "pm_nlp_bender"      ["Bender"]          $ pm_n "lp",+  paradigm_h "pm_nlp_sverige"     ["Sverige"]         $ pm_n "lp",+  paradigm_h "pm_nog_volvo"       ["Volvo"]           $ pm_n "og",+  paradigm_h "pm_nop_centern"     ["Centern"]         $ pm_n "op",+  paradigm_h "pm_plg_alperna"     ["Alperna"]         $ pm_p "lg",+  paradigm_h "pm_uag_saab"        ["Saab"]            $ pm_u "ag",+  paradigm_h "pm_ula_månen"       ["Månen"]           $ pm_u "la",+  paradigm_h "pm_ulg_fyris"       ["Fyris"]           $ pm_u "lg",+  paradigm_h "pm_uwb_hemsöborna"  ["Hemsöborna"]      $ pm_u "wb",+  paradigm_h "pm_uwc_faust"                   ["Faust"]           $ pm_u "wc",+  paradigm_h "pm_uwn_aftonbladet"             ["Aftonbladet"]     $ pm_u "wn",+  paradigm_h "pm_vlf_globen"                  ["Globen"]          $ pm_v "lf",+  paradigm_h "pma_nog_fn"                     ["FN"]                    $ pma_n "og",+  paradigm_h "pma_nop_cuf"                    ["CUF"]                   $ pma_n "op",+  paradigm_h "pmm_h0ph_de_saussure"           ["de Saussure"]           $ noc $ pmm_h "ph",+  paradigm_h "pmm_m0ph_bo_ek"                 ["Bo Ek"]                 $ noc $ pmm_m "ph",+  paradigm_h "pmm_n0lg_new_delhi"             ["New Delhi"]             $ noc $ pmm_n "lg",+  paradigm_h "pmm_n0lg_svarta_havet"          ["Svarta havet"]          $ pmm_n "lg",+  paradigm_h "pmm_n0lp_sri_lanka"             ["Sri Lanka"]             $ pmm_n "lp",+  paradigm_h "pmm_n0oe_göteborgs_universitet" ["Göteborgs universitet"] $ pmm_n "oe",+  paradigm_h "pmm_n0og_nordiska_rådet"        ["Nordiska rådet"]        $ pmm_n "og",+  paradigm_h "pmm_u0lg_torne_älv"             ["Torne älv"]             $ pmm_u "lg",+  paradigm_h "pmm_u0wb_det_går_an"            ["Quo vadis?"]            $ pmm_u "wb",+  paradigm_h "pmm_n0wm_ring_p1"               ["Ring P1"]           $ pmam_n "wm",+  paradigm_h "pmm_u0ec_alla_hjärtans_dag"     ["Alla hjärtans dag"] $ pmm_u "ec",+  paradigm_h "pmm_u0og_svenska_akademien"     ["Svenska Akademien"] $ pmm_u "og",+  paradigm_h "pp_i_i"                         ["i"]                   prep,+  vbm_paradigm "vbm_1ai1_laga" ["tappa sugen"],+  vbm_paradigm "vbm_1ic_laga" ["handla och vandla"],+  vbm_paradigm "vbm_1md1_laga" ["råka illa ut"],+  vbm_paradigm "vbm_1ml1_laga" ["vädra morgonluft"],+  vbm_paradigm "vbm_1mp1_laga" ["lämna över"],+  vbm_paradigm "vbm_1sp2_andas" ["inte låssas om"],+  vbm_paradigm "vbm_1mps1_laga" ["tuffa till sig"],+  vbm_paradigm "vbm_1ms1_laga" ["överila sig"],+  vbm_paradigm "vbm_1msp1_laga" ["snigla sig fram"],+  vbm_paradigm "vbm_1mzd1_laga" ["omgjorda sina länder"],+  vbm_paradigm "vbm_1sp1_andas" ["turas om"],+  vbm_paradigm "vbm_1szt1_andas" ["utandas sin sista suck"],+  vbm_paradigm "vbm_2ad1_lägga" ["lägga i dagen"],+  vbm_paradigm "vbm_2ai1_ansöka" ["släppa gäcken lös"],+  vbm_paradigm "vbm_2al1_lägga" ["lägga emellan"],+  vbm_paradigm "vbm_2al1_sätta" ["sätta p"],+  vbm_paradigm "vbm_2md1_ha" ["ha på tråden"],+  vbm_paradigm "vbm_2md1_ansöka" ["tänka på refrängen"],+  vbm_paradigm "vbm_2md1_lägga" ["lägga på hullet"],+  vbm_paradigm "vbm_2mi1_lägga" ["lägga näsan i blöt"],+  vbm_paradigm "vbm_2mi1_mysa" ["åka på en propp"],+  vbm_paradigm "vbm_2mi2_leda" ["inte skräda orden"],+  vbm_paradigm "vbm_2ml1_göra" ["göra susen"],+  vbm_paradigm "vbm_2ml1_ha" ["ha reda"],+  vbm_paradigm "vbm_2ml1_leda" ["skräda orden"],+  vbm_paradigm "vbm_2ml1_lägga" ["inlägga förtjänst"],+  vbm_paradigm "vbm_2ml1_väga" ["fylla år"],+  vbm_paradigm "vbm_2mlvs1_mysa" ["leka rommen av sig"],+  vbm_paradigm "vbm_2mp1_göra" ["göra åt"],+  vbm_paradigm "vbm_2mp1_hyra" ["höra till"],+  vbm_paradigm "vbm_2mp1_känna" ["känna till"],+  vbm_paradigm "vbm_2mp1_lägga" ["lägga ut"],+  vbm_paradigm "vbm_2mp1_mysa" ["tänka till"],+  vbm_paradigm "vbm_2mp1_sätta" ["sätta efter"],+  vbm_paradigm "vbm_2mp1_viga" ["hänga över"],+  vbm_paradigm "vbm_2mp1_väga" ["äga rum"],+  vbm_paradigm "vbm_2mps1_göra" ["göra på sig"],+  vbm_paradigm "vbm_2mps1_ha" ["ha för sig"],+  vbm_paradigm "vbm_2mps1_hyra" ["köra ihop sig"],+  vbm_paradigm "vbm_2mps1_känna" ["skämma ut sig"],+  vbm_paradigm "vbm_2mps1_mysa" ["smäcka i sig"],+  vbm_paradigm "vbm_2mps1_sätta" ["sätta i sig"],+  vbm_paradigm "vbm_2mps1_viga" ["hänga upp sig"],+  vbm_paradigm "vbm_2mps1_väga" ["ställa om sig"],+  vbm_paradigm "vbm_2ms1_ansöka" ["stöta sig"],+  vbm_paradigm "vbm_2ms1_glädja" ["glädja sig"],+  vbm_paradigm "vbm_2ms1_göra" ["tillgodogöra sig"],+  vbm_paradigm "vbm_2ms1_hyra" ["uppföra sig"],+  vbm_paradigm "vbm_2ms1_hända" ["vända sig"],+  vbm_paradigm "vbm_2ms1_känna" ["missminna sig"],+  vbm_paradigm "vbm_2ms1_leda" ["reda sig"],+  vbm_paradigm "vbm_2ms1_lyfta" ["utfästa sig"],+  vbm_paradigm "vbm_2ms1_lägga" ["vinnlägga sig"],+  vbm_paradigm "vbm_2ms1_mysa" ["vräka sig"],+  vbm_paradigm "vbm_2ms1_skilja" ["skilja sig"],+  vbm_paradigm "vbm_2ms1_säga" ["säga sig"],+  vbm_paradigm "vbm_2ms1_sätta" ["sätta sig"],+  vbm_paradigm "vbm_2ms1_viga" ["hänga sig"],+  vbm_paradigm "vbm_2ms1_väga" ["åtnöja sig"],+  vbm_paradigm "vbm_2ms1_välja" ["vänja sig"],+  vbm_paradigm "vbm_2msl1_göra" ["göra sig kvitt"],+  vbm_paradigm "vbm_2msp1_göra" ["göra sig till"],+  vbm_paradigm "vbm_2msp1_hyra" ["höra sig för"],+  vbm_paradigm "vbm_2msp1_lägga" ["lägga sig vinn"],+  vbm_paradigm "vbm_2msp1_mysa" ["tänka sig för"],+  vbm_paradigm "vbm_2msp1_sätta" ["sätta sig över"],+  vbm_paradigm "vbm_2msp1_väga" ["leva sig in"],+  vbm_paradigm "vbm_2mzd1_göra" ["göra sina lärospån"],+  vbm_paradigm "vbm_2mzd1_sätta" ["sätta sin lit"],+  vbm_paradigm "vbm_2sp1_blygas" ["följas åt"],+  vbm_paradigm "vbm_2sp1_minnas" ["kännas vid"],+  vbm_paradigm "vbm_2sp1_synas" ["hjälpas åt"],+  vbm_paradigm "vbm_3mp1_sy" ["rå om"],+  vbm_paradigm "vbm_3ms1_sy" ["ty sig"],+  vbm_paradigm "vbm_3msp1_sy" ["bry sig om"],+  vbm_paradigm "vbm_3mzd1_sy" ["så sin vildhavre"],+  vbm_paradigm "vbm_4ad1_bära" ["bära i gullstol"],+  vbm_paradigm "vbm_4ad1_falla" ["falla till föga"],+  vbm_paradigm "vbm_4ad1_ge" ["ge till känna"],+  vbm_paradigm "vbm_4ad1_gå" ["gå om intet"],+  vbm_paradigm "vbm_4ad1_komma" ["komma till skott"],+  vbm_paradigm "vbm_4ad1_se" ["se i vitögat"],+  vbm_paradigm "vbm_4ad1_ta" ["ta till vara"],+  vbm_paradigm "vbm_4al1_dricka" ["vinna segerpalmen"],+  vbm_paradigm "vbm_4al1_gå" ["gå kjortelvägen"],+  vbm_paradigm "vbm_4al1_komma" ["komma ifråga"],+  vbm_paradigm "vbm_4al1_rida" ["rida barbacka"],+  vbm_paradigm "vbm_4apl1_ta" ["ta ner skylten"],+  vbm_paradigm "vbm_4l1_slå" ["slå mynt"],+  vbm_paradigm "vbm_4md1_flyga" ["krypa till korset"],+  vbm_paradigm "vbm_4md1_gå" ["gå till väga"],+  vbm_paradigm "vbm_4ad1_hålla" ["hålla i schack"],+  vbm_paradigm "vbm_4md1_komma" ["komma till kritan"],+  vbm_paradigm "vbm_4md1_le" ["le i mjugg"],+  vbm_paradigm "vbm_4md1_ligga" ["ligga på lur"],+  vbm_paradigm "vbm_4md1_sitta" ["sitta på understol"],+  vbm_paradigm "vbm_4md1_slå" ["slå en drill"],+  vbm_paradigm "vbm_4md1_stå" ["stå till svars"],+  vbm_paradigm "vbm_4md1_ta" ["ta till orda"],+  vbm_paradigm "vbm_4md1_vina" ["skita på sig"],+  vbm_paradigm "vbm_4mi1_bära" ["bära syn för sagen"],+  vbm_paradigm "vbm_4mi1_ge" ["ge bagarbarn bröd"],+  vbm_paradigm "vbm_4mi1_gå" ["få bära hundhuvudet"],+  vbm_paradigm "vbm_4mzq1_ta" ["ta sin mats ur skolan"],+  vbm_paradigm "vbm_4mzt1_gå" ["få sina fiskar varma"],+  vbm_paradigm "vbm_vmsp1_ryckas" ["ryckas bort"],+  vbm_paradigm "vbm_4mi1_vina" ["rida ranka"],+  vbm_paradigm "vbm_4ml1_ge" ["ge vika"],+  vbm_paradigm "vbm_4ml1_gå" ["gå miste"],+  vbm_paradigm "vbm_4ml1_hålla" ["hålla stången"],+  vbm_paradigm "vbm_4ml1_komma" ["komma underfund"],+  vbm_paradigm "vbm_4ml1_ligga" ["ligga ogill"],+  vbm_paradigm "vbm_4ml1_ljuda" ["ljuta döden"],+  vbm_paradigm "vbm_4ml1_slå" ["slå vad"],+  vbm_paradigm "vbm_4ml1_stå" ["stå rycken"],+  vbm_paradigm "vbm_4ml1_ta" ["ta betäckning"],+  vbm_paradigm "vbm_4mlp1_slå" ["slå dövörat till"],+  vbm_paradigm "vbm_4mp1_bli" ["bli kvar"],+  vbm_paradigm "vbm_4mp1_bära" ["skära för"],+  vbm_paradigm "vbm_4mp1_fara" ["fara ut"],+  vbm_paradigm "vbm_4mp1_flyga" ["bryta av"],+  vbm_paradigm "vbm_4mp1_le" ["dö ut"], +  vbm_paradigm "vbm_4ms1_skjuta" ["utgjuta sig"],+  vbm_paradigm "vbm_4mp1_gå" ["gå till väga"],+  vbm_paradigm "vbm_4mp1_hålla" ["hålla upp"],+  vbm_paradigm "vbm_4mp1_komma" ["komma vid"],+  vbm_paradigm "vbm_4mp1_ryta" ["stryka med"],+  vbm_paradigm "vbm_4mp1_se" ["se ut"],+  vbm_paradigm "vbm_4mp1_sitta" ["sticka upp"],+  vbm_paradigm "vbm_4mp1_skjuta" ["skjuta över"],+  vbm_paradigm "vbm_4mp1_slå" ["slå över"],+  vbm_paradigm "vbm_4mp1_stå" ["stå ut"],+  vbm_paradigm "vbm_4mp1_ta" ["ta överbalansen"],+  vbm_paradigm "vbm_4mp1_vara" ["vara till"],+  vbm_paradigm "vbm_4mp1_vina" ["lida pin"],+  vbm_paradigm "vbm_4mpd1_ta" ["ta i med hårdhandskarna"],+  vbm_paradigm "vbm_4mpl1_ta" ["ta till storsläggan"],+  vbm_paradigm "vbm_4mps1_ge" ["ge med sig"],+  vbm_paradigm "vbm_4mps1_hålla" ["hålla i sig"],+  vbm_paradigm "vbm_4mps1_komma" ["komma ihop sig"],+  vbm_paradigm "vbm_4mps1_skjuta" ["skjuta in sig"],+  vbm_paradigm "vbm_4mps1_skåpäta" ["äta upp sig"],+  vbm_paradigm "vbm_4mps1_slå" ["slå ifrån sig"],+  vbm_paradigm "vbm_4mpzd1_slå" ["slå ned sina bopålar"],+  vbm_paradigm "vbm_4ms1_angå" ["förgå sig"],+  vbm_paradigm "vbm_4ms1_be" ["utbe sig"],+  vbm_paradigm "vbm_4ms1_bära" ["skära sig"],+  vbm_paradigm "vbm_4ms1_förhålla" ["uppehålla sig"],+  vbm_paradigm "vbm_4ms1_ge" ["hänge sig"],+  vbm_paradigm "vbm_4ms1_gråta" ["utlåta sig"],+  vbm_paradigm "vbm_4ms1_hålla" ["hålla sig"],+  vbm_paradigm "vbm_4ms1_komma" ["komma sig"],+  vbm_paradigm "vbm_4ms1_ljuda" ["ansluta sig"],+  vbm_paradigm "vbm_4ms1_ryta" ["snyta sig"],+  vbm_paradigm "vbm_4ms1_sitta" ["utspinna sig"],+  vbm_paradigm "vbm_4ms1_skåpäta" ["föräta sig"],+  vbm_paradigm "vbm_4ms1_slå" ["slå sig"],+  vbm_paradigm "vbm_4ms1_sova" ["försova sig"],+  vbm_paradigm "vbm_4ms1_stå" ["understå sig"],+  vbm_paradigm "vbm_4ms1_ta" ["åta sig"],+  vbm_paradigm "vbm_4ms1_tillåta" ["nedlåta sig"],+  vbm_paradigm "vbm_4ms1_utfalla" ["undfalla sig"],+  vbm_paradigm "vbm_4ms1_vina" ["slita sig"],+  vbm_paradigm "vbm_4msd1_ge" ["ge sig till tåls"],+  vbm_paradigm "vbm_4msd1_slå" ["slå sig till ro"],+  vbm_paradigm "vbm_4msp1_bära" ["bära sig åt"],+  vbm_paradigm "vbm_4msp1_ge" ["ge sig ut"],+  vbm_paradigm "vbm_4msp1_komma" ["komma sig upp"],+  vbm_paradigm "vbm_4msp1_slå" ["slå sig på"],+  vbm_paradigm "vbm_4msp1_stå" ["förstå sig på"],+  vbm_paradigm "vbm_4msp1_ta" ["ta sig ut"],+  vbm_paradigm "vbm_4msp1_finnas" ["finnas till"],+  vbm_paradigm "vbm_omp1_vilja" ["vilja till"],+  vbm_paradigm "vbm_oms1_vilja" ["vilja sig"],+  vbm_paradigm "vbm_val1_klä" ["trå dansen"],+  vbm_paradigm "vbm_vml1_mala" ["mala tomning"],+  vbm_paradigm "vbm_vmp1_smälta" ["smälta in"],+  vbm_paradigm "vbm_vmp1_upphäva" ["häva upp"],+  vbm_paradigm "vbm_vmps1_klä" ["klä ut sig"],+  vbm_paradigm "vbm_vmps1_smälla" ["smälla i sig"],+  vbm_paradigm "vbm_vmps1_vika" ["vika ut sig"],+  vbm_paradigm "vbm_vmps1_växa" ["växa till sig"],+  vbm_paradigm "vbm_vms1_besvärja" ["sammansvärja sig"],+  vbm_paradigm "vbm_vms1_förlöpa" ["belöpa sig"],+  vbm_paradigm "vbm_vms1_klä" ["utbre sig"],+  vbm_paradigm "vbm_vms1_tvinga" ["tilltvinga sig"],+  -- vbm_paradigm "vbm_vsp1_ryckas" ["ryckas bort"],+  vbm_paradigm "vbm_vsp1_talas" ["talas vid"],++  combine_vbm (vbm_paradigm "vbm_1ap1_laga" ["pigga upp"]) +               (paradigm_h "vbm_1ap1_laga" ["pigga upp"]             +                 (verb_vbm 0 ([e ""], [], [], [], [], [(fl, "d")]))),++  combine_vbm (vbm_paradigm "vbm_4ap1_dricka" ["sitta av"]) +               (paradigm_h "vbm_4ap1_dricka" ["sitta av"]             +                 (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1 . fl, "en")]))),++  combine_vbm (vbm_paradigm "vbm_1ap1_viga" ["slänga bort"])+              (paradigm_h "vbm_1ap1_viga" ["slänga bort"]              +               (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl, "d")]))),++  combine_vbm (vbm_paradigm "vbm_1ap1_skapa" ["tjäna av"])+              (paradigm_h "vbm_1ap1_skapa" ["tjäna av"]              +               (verb_vbm 0 ([e ""], [], [], [], [], [(fl, "d")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_ansöka" ["knäppa upp"])+                  (paradigm_h "vbm_2ap1_ansöka" ["knäppa upp"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl, "t")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_göra" ["göra ned"])+                  (paradigm_h "vbm_2ap1_göra" ["göra ned"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 3 . fl, "jord")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_hyra" ["hyra ut"])+                  (paradigm_h "vbm_2ap1_hyra" ["hyra ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl, "d")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_känna" ["skämma ut"])+                  (paradigm_h "vbm_2ap1_känna" ["skämma ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(ungeminate_m_n . tk 1 .fl,"d")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_leda" ["reda ut"])+                  (paradigm_h "vbm_2ap1_leda" ["reda ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"d")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_lyfta" ["gifta bort"])+                  (paradigm_h "vbm_2ap1_lyfta" ["gifta bort"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1.fl,"")]))),+  +  combine_vbm (vbm_paradigm "vbm_2ap1_lägga" ["lägga undan"])+                  (paradigm_h "vbm_2ap1_lägga" ["lägga undan"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "a" . tk 2 . fl,"d")]))),+   +  combine_vbm (vbm_paradigm "vbm_2ap1_säga" ["säga upp"])+                  (paradigm_h "vbm_2ap1_säga" ["säga upp"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "a" . tk 1 . fl,"d")]))),+  +  combine_vbm (vbm_paradigm "vbm_2ap1_sända" ["tända på"])+                  (paradigm_h "vbm_2ap1_sända" ["tända på"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_sätta" ["sätta av"])+                  (paradigm_h "vbm_2ap1_sätta" ["sätta av"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "a" . tk 1 . fl,"")]))),+   +  combine_vbm (vbm_paradigm "vbm_2ap1_viga" ["döma ut"])+                  (paradigm_h "vbm_2ap1_viga" ["döma ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1.fl,"d")]))),+   +  combine_vbm (vbm_paradigm "vbm_2ap1_väga" ["leva ut"])+                  (paradigm_h "vbm_2ap1_väga" ["leva ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"d")]))),+    +  combine_vbm (vbm_paradigm "vbm_3ap1_sy" ["sy in"])+                  (paradigm_h "vbm_3ap1_sy" ["sy in"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"dd")]))),+  +  combine_vbm (vbm_paradigm  "vbm_4ap1_bestå" ["stå bi"])+                  (paradigm_h "vbm_4ap1_bestå" ["stå bi"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"dd")]))),+  +  combine_vbm (vbm_paradigm "vbm_4ap1_bjuda" ["hugga ned"])+                  (paradigm_h "vbm_4ap1_bjuda" ["hugga ned"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1. fl,"en")]))),++  combine_vbm (vbm_paradigm "vbm_4ap1_bli" ["bli varse"])+                  (paradigm_h "vbm_4ap1_bli" ["bli varse"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"ven")]))),+   +  combine_vbm (vbm_paradigm "vbm_4ap1_bära" ["skära ner"])+                  (paradigm_h "vbm_4ap1_bära" ["skära ner"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1. fl,"en")]))),+     +  -- combine_vbm (vbm_paradigm "vbm_4ap1_dö" ["dö ut"])+  --                (paradigm_h "vbm_4ap1_dö" ["dö ut"] +  --                 (set_pos "vbm" . vbm_dö_ut)),+  +  combine_vbm (vbm_paradigm "vbm_4ap1_flyga" ["bryta ut"])+                  (paradigm_h "vbm_4ap1_flyga" ["bryta ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1 . fl,"en")]))),+     +  combine_vbm (vbm_paradigm "vbm_4ap1_ge" ["ge upp"])+                  (paradigm_h "vbm_4ap1_ge" ["ge upp"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "i" . fl,"ven")]))),+     +  combine_vbm (vbm_paradigm "vbm_4ap1_gå" ["gå bort"])+                  (paradigm_h "vbm_4ap1_gå" ["gå bort"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"ngen")]))),+  +  combine_vbm (vbm_paradigm "vbm_4ap1_hålla" ["hålla av"])+                  (paradigm_h "vbm_4ap1_hålla" ["hålla av"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1.fl,"en")]))),++  combine_vbm (vbm_paradigm "vbm_4ap1_komma" ["komma ihåg"])+                  (paradigm_h "vbm_4ap1_komma" ["komma ihåg"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"en")]))),+   +  combine_vbm (vbm_paradigm "vbm_4ap1_rida" ["slita ut"])+                  (paradigm_h "vbm_4ap1_rida" ["slita ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"en")]))),+     +  combine_vbm (vbm_paradigm "vbm_4ap1_se" ["se till"])+                  (paradigm_h "vbm_4ap1_se" ["se till"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"dd")]))),+ +  combine_vbm (vbm_paradigm "vbm_4ap1_skjuta" ["skjuta in"])+                  (paradigm_h "vbm_4ap1_skjuta" ["skjuta in"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl, "en")]))),+    +  combine_vbm (vbm_paradigm  "vbm_4ap1_slå" ["slå ner"])+                  (paradigm_h "vbm_4ap1_slå" ["slå ner"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "a" . fl,"gen")]))),+     +  combine_vbm (vbm_paradigm "vbm_4ap1_ta" ["dra in"])+                  (paradigm_h "vbm_4ap1_ta" ["dra in"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"gen")]))),++  combine_vbm (vbm_paradigm "vbm_4ap1_tillåta" ["låta upp"])+                  (paradigm_h "vbm_4ap1_tillåta" ["låta upp"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"en")]))),+    +  combine_vbm (vbm_paradigm "vbm_4ap1_äta" ["äta upp"])+                  (paradigm_h "vbm_4ap1_äta" ["äta upp"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"en")]))),+  +  combine_vbm (vbm_paradigm "vbm_vap1_fnysa" ["dyka upp"])+                  (paradigm_h "vbm_vap1_fnysa" ["dyka upp"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"t")]))),+  +  combine_vbm (vbm_paradigm "vbm_vap1_frysa" ["frysa ut"])+                  (paradigm_h "vbm_vap1_frysa" ["frysa ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1 . fl, "en")]))),+    +  combine_vbm (vbm_paradigm "vbm_vap1_klä" ["klä ut"])+                  (paradigm_h "vbm_vap1_klä" ["klä ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"dd")]))),+   +  combine_vbm (vbm_paradigm "vbm_vap1_koka" ["koka in"])+                  (paradigm_h "vbm_vap1_koka" ["koka in"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"t")]))),+  +  combine_vbm (vbm_paradigm "vbm_vap1_lyfta" ["smälta ihop"])+                  (paradigm_h "vbm_vap1_lyfta" ["smälta ihop"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"")]))),+   +  combine_vbm (vbm_paradigm "vbm_vap1_nypa" ["nypa av"])+                  (paradigm_h "vbm_vap1_nypa" ["nypa av"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"t")]))),+ +  combine_vbm (vbm_paradigm "vbm_vap1_smälla" ["smälla av"])+                  (paradigm_h "vbm_vap1_smälla" ["smälla av"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1 . fl,"en")]))),+ +  combine_vbm (vbm_paradigm "vbm_vap1_smälta" ["smälta samman"])+               (paradigm_h "vbm_vap1_smälta" ["smälta samman"]              +                (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1 . fl,"en")]))),+ +  combine_vbm (vbm_paradigm "vbm_vap1_strypa" ["rycka fram"])              +               (paradigm_h "vbm_vap1_strypa" ["rycka fram"]              +                (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"t")]))),+   +  combine_vbm (vbm_paradigm "vbm_vap1_tala" ["spela upp"])+               (paradigm_h "vbm_vap1_tala" ["spela upp"]              +                (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"t")]))),+   +  combine_vbm (vbm_paradigm "vbm_vap1_vika" ["vika ut"])+               (paradigm_h "vbm_vap1_vika" ["vika ut"]              +                (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"en")]))),+    +  combine_vbm (vbm_paradigm "vbm_vap1_växa" ["växa ur"])+               (paradigm_h "vbm_vap1_växa" ["växa ur"]              +                (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1 . fl,"en")]))),++  paradigm_h "nn_1u_flicka"       ["flicka"] $+   noun_compound 1 Utr ([e "a"], [e "an"], [e "or"], [e "orna"], [(ungeminate, "")],[e "e",(ungeminate,""),(ds.ungeminate,"")]),++  paradigm_h "nn_1u_barnstuga" ["barnstuga"] $+   noun_compound 1 Utr ([e "a"], [e "an"], [e "or"], [e "orna"], [e "e", e "u"],[e "e",e "u"]),++  paradigm_h "nn_vv_demo" ["demo"] $+   noun_compound 0 Pend +    ([e ""], [e "n", e "t"], [e "n",e "s",e "sar",e "r"], [e "na",e "sen",e "sarna",e "rna"],[e ""],[e ""]),+  paradigm_h "nn_2u_botten" ["botten"] $+   noun_compound 0 Utr  ([e ""], [(dvu,"en"),e ""], [(dvu, "ar")], [(dvu,"arna")],[e ""],[e ""]),   +  paradigm_h "nn_2u_nyckel" ["nyckel"] $+    noun_compound 0 Utr ([e ""], [e "n"], [(dvu,"ar"),(dv, "ar")], [(dvu,"arna"),(dv,"arna")],[e ""],[e "",(ds,"")]),   ++  paradigm_h "nn_2u_ålder" ["ålder"] $+    noun_compound 0 Utr ([e ""], [e "n"], [(dvu,"ar"),(dv, "ar")], [(dvu,"arna"),(dv,"arna")],[(ds,"")],[(ds,"")]),   +  paradigm_h "nn_2u_vinge"         ["vinge"] $+   noun_compound 0 Utr  ([e ""], [e "n"], [(tk 1,"ar")], [(tk 1, "arna")],[(ungeminate.tk 1, "")],[(ungeminate.tk 1,""),e "s",(ds. ungeminate . tk 1,"")]),   ++  paradigm_h "nn_2u_skrake" ["skrake"] $+   noun_compound 0 Utr  ([e "",(tk 1,"")], [e "n"], [(tk 1,"ar")], [(tk 1, "arna")],[(ungeminate.tk 1, "")],[(ungeminate.tk 1,""),e "s",(ds. ungeminate . tk 1,"")]),   ++  paradigm_h "nn_2u_stol"            ["stol"] $+   noun_compound 0 Utr  ([e ""], [e "en"], [e "ar"], [e "arna"],[e "",(ds,"")],[e "",(ds,"")]),   +  paradigm_h "nn_4u_linje"           ["linje"]       nn4,+  paradigm_h "nn_5n_knä"            ["knä"]         nn5_knä,+  paradigm_h "nn_6n_garage"       ["garage"] $ +   noun_compound 0 Neutr  ([e ""], [e "t"], [e ""], [e "n"],[e ""],[e ""]),   +  paradigm_h "nn_6n_segel"         ["segel"] $+   noun_compound 0 Neutr  ([e ""], [(dvu,"et")], [e ""], [(dvu,"en")],[e ""],[e "",(ds,"")]),+   +  paradigm_h "nn_6n_medel"         ["medel"] $+   noun_compound 0 Neutr  ([e ""], [(dvu,"et")], [e ""], [(dvu,"en")],[(ds,"")],[(ds,"")]),   ++  paradigm_h "nn_6u_gås"            ["gås"]            nn_6u_gås,+  paradigm_h "nn_ou_emeritus"    ["emeritus"]       nn_ou_emeritus, +  paradigm_h "nn_ou_examen"     ["examen"]         nn_ou_examen,+  paradigm_h "nn_vn_centrum"     ["centrum"]        nn_vn_centrum,+  paradigm_h "nn_vn_nomen"       ["nomen"]          nn_vn_nomen,+  paradigm_h "nn_vu_jojo"            ["jojo"]       nn_vu_jojo,+  paradigm_h "nn_vu_partner"      ["partner"]        nn_vu_partner,+  paradigm_h "nn_vv_abdomen"   ["abdomen"]       nn_vv_abdomen,+  paradigm_h "av_2_ung"          ["ung"]        av_2_ung+ ] ++ verb_paradigms++combine_vbm :: (String, [String], [String] -> Entry) -> (String, [String], [String] -> Entry) -> (String, [String], [String] -> Entry)+combine_vbm (s,xs,f) (_,_,f1) = (s,xs,\xs -> combine_tables (f xs) (f1 xs))++vbm_paradigm :: String -> [String] -> (String, [String], [String] -> Entry)+vbm_paradigm p xs = case catMaybes [Map.lookup v_id verb_map | v_id <- vids] of+                      _ | pos /='1' -> paradigm_h p xs vbm_inf+                      (f:_) -> paradigm_h p xs $ expand . clean . first_mw "vbm" (f . (:[]))+                      _     -> paradigm_h p xs vbm_inf+ where verb_map = Map.fromList [(s,f) | (s,_,f) <- verb_paradigms]+       clean = (if is_reflexive p then remove_param "s-form" else id) . remove_param "sms" . remove_param "c" . remove_param "pret_part"+       expand = (if is_poss p then expand_poss else (if is_reflexive p then expand_ref else id))+       expand_poss = expand_multiword "sin" [([],[],"min"),([],[],"din"),([],[],"sin"),([],[],"vår"),([],[],"er")] .+                     expand_multiword "sina" [([],[],"mina"),([],[],"dina"),([],[],"sina"),([],[],"våra"),([],[],"era")]+       expand_ref  = expand_multiword "sig" [([],["imper"],"mig"),([],[],"dig"),([],["imper"],"sig"),([],["imper"],"oss"),([],[],"er")]+       vids = case p of+                (v:b:m:u:k:a:rest) ->+                    case span (/= '_') rest of+                      (_,r) -> [(v:b:u:k:a:r),(v:b:u:k:'a':r),(v:b:u:k:'m':r)]+       pos = case span (/='_') (reverse p) of+               (_,(_:n:_)) -> n+       is_reflexive p = case span (/='_') (reverse p) of+                          (_,(_:s)) -> case span (/='_') s of +                                         (s',_) -> elem 's' s'+       is_poss p = case span (/='_') (reverse p) of+                     (_,(_:s)) -> case span (/='_') s of +                                    (s',_) -> elem 'z' s'++verb_paradigms :: [(String, [String], [String] -> Entry)]+verb_paradigms = [+  paradigm_h "vb_1s_gillas" ["gillas"]  $+   verb_deponens 2 ([e "as"],[e "as",e "s"],[e "ades",e "des"], [e "ats",e "ts"], []),++  paradigm_h "vb_1a_spara" ["spara"]  $ +   verb_weak 1 ([e "a"], [e "ar",e ""],[e "a",e ""],[e "ade"],[e "at"],[e "ad"]),++  paradigm_h "vb_1a_vissla" ["vissla"]  $ +   verb_weak 1 ([e "a"], [e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad"]),++  paradigm_h "vb_1a_skapa" ["skapa"]   $+   verb_weak 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad",e "t"]),++  paradigm_h "vb_1a_hitta" ["hitta"]   $+   verb_weak_compound 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad"],[e "e"]),++  paradigm_h "vb_1a_vänta" ["vänta"]   $+   verb_weak_compound 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad"],[e "", e "e"]),++  paradigm_h "vb_1a_klaga" ["klaga"]   $+   verb_weak_compound 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad"],[e "", e "o"]),++  paradigm_h "vb_1a_beundra" ["beundra"]   $+   verb_weak_compound 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad"],[]),++  paradigm_h "vb_1m_hisna" ["hisna"]   $+   verb_weak_compound 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[],[]),++  paradigm_h "vb_1m_svira" ["svira"]   $+   verb_weak_compound 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[],[e ""]),++  paradigm_h "vb_1a_ugnsbaka" ["ugnsbaka"]  $+   verb_weak 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad",e "t"]),++  paradigm_h "vb_1m_vånna" ["vånna"]  $+   verb_full 1 ([e "a"], [],[e "ar"],[e "a"], [e "ade"], [e "e"], [e "at"], []),    ++  paradigm_h "vb_1m_kackla" ["kackla"]  $+   verb_weak 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[]),++  paradigm_h "vb_1a_unna" ["unna"]  $+   verb_weak 1 ([e "a"], [e "ar"], [e "a"], [e "ade"], [e "at"], [(id,"ad"),(tk 1,"t")]),++  paradigm_h "vb_1a_häda" ["häda"]  $+   verb_weak 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad",e "d"]),++  paradigm_h "vb_4m_ljuda" ["ljuda"] $+   verb_full 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ö","")], [(vc "ö","e")],[e "it"], []),++  paradigm_h "vb_4a_fara" ["fara"]  $+   verb_full_sform_variant 1 ([e "a"], [e "e"], [e ""], [e ""], [(vc "o","")], [(vc "o","e")], [e "it"], [e "en"]),++  paradigm_h "vb_2a_leva" ["leva"]  $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "de"], [e "t", e "at"], [e "d"]),++  paradigm_h "vb_2a_stödja" ["stödja"]  $+   verb_weak_compound_sform_variant 1 ([(tk 1,"a"),e "a"], [(tk 1, "er"),(id,"er")], [(tk 1,"")], [(tk 1, "de")], [(tk 1 . dsuff "j", "tt")], [(tk 1, "d")],[(tk 1,""),e "e"]),++  paradigm_h "vb_2a_sälja" ["sälja"]  $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(vc "å".tk 1, "de")], [(vc "å".tk 1, "t")], [(vc "å" . tk 1,"d")]),++  paradigm_h "vb_2a_säga" ["säga"]  $+   verb_weak_sform_variant 1 ([(id,"a"),(tk 1, "ja")], [(id, "er"),(tk 1, "jer")], [e "",(tk 1,"j")], [(vc "a".tk 1,"de"),(vc "a".tk 1,"")], [(vc "a","t")] , [(vc "a", "d")]),++  paradigm_h "vb_2a_motsäga" ["motsäga"]  $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(vc "a". tk 1, "de")], [(vc "a", "t")], [(vc "a","d")]),++  paradigm_h "vb_2a_mista" ["mista"]  $+   verb_weak_sform_variant 1 ([e "a"],[e "er"],[e ""],[e "ade",e "e"],[e "",e "at"],[e "ad",(\s -> s +? "t","")]),++  paradigm_h "vb_2a_välja" ["välja"]  $+   let g = vct [("ä","a"),("ö","o")] . tk 1 in +   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(g,"de")], [(g, "t")], [(g,"d")]),++  paradigm_h "vb_2m_hända" ["hända"]  $+   verb_weak_sform_variant 1 ([e "a"],[e "er"],[e ""],[e "e"],[(tk 1, "t")],[]),++  paradigm_h "vb_2d_må" ["må"] +   (verb_weak 0 ([],[e ""],[],[e "tte"],[],[])),++  paradigm_h "vb_2m_gitta" ["gitta"]   +   (verb_weak 1 ([e "a"],[e "er"],[e ""], [e "e"], [e "at"], [])),    ++  paradigm_h "vb_2a_städja" ["städja"] +   (verb_weak_sform_variant 2 ([e "ja"], [e "jer",e "er"], [e ""], [(vc "a","de")],[(vc "a".tk 1,"tt")], [(vc "a","d")])),++  paradigm_h "vb_2a_genmäla" ["genmäla"] +   (verb_weak_sform_variant 1 ([e "a"],[e "er"],[e ""],[e "de",e "te"],[e "t"],[e "d"])),++  paradigm_h "vb_2m_väga" ["väga"]  +   (verb_weak_no_sform 1 ([e "a"],[e "er"],[e ""],[e "de"],[e "t"],[])),++  paradigm_h "vb_4a_bottenfrysa" ["bottenfrysa"]  +   (verb_full_no_sform 1 ([e "a"],[e "e"],[e "er"],[e ""],[e "te", (vc "ö","")],[(vc "u","e")],[(vc "u","it"),e "t"],[(vc "u","en"),e "t"])),++  paradigm_h "vb_va_frysa" ["frysa"]  +   (verb_full 1 ([e "a"],[e "e"],[e "er"],[e ""],[e "te", (vc "ö","")],[(vc "u","e")],[(vc "u","it"),e "t"],[(vc "u","en"),e "t"])),++  paradigm_h "vb_2m_höta" ["höta"] +   (verb_weak_sform_variant 1 ([e "a"],[e "ter",e "er"],[e ""],[e "te"],[e "t"],[])),++  paradigm_h "vb_2m_glädja" ["glädja"] +   (verb_weak_sform_variant 1 ([e "a"], [e "er"], [(tk 1, "")], [(vc "a" . tk 1,"de")], [(vc "a" . tk 2, "tt")], [])),++  paradigm_h "vb_2m_böra" ["böra"] +   (verb_weak_sform_variant 1 ([e "a"], [e ""], [e ""], [(vc "o", "de")], [(vc "o", "t")], [])),++  paradigm_h "vb_2a_tämja" ["tämja"] +   (verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "de"], [(id, "t"),(tk 1,"t")], [e "d"])),++  paradigm_h "vb_2a_spörja"           ["spörja"] +   (verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(vc "o" . tk 1, "de")], [(vc "o" . tk 1, "t")], [(vc "o" . tk 1,"d")])),++  paradigm_h "vb_2s_blygas" ["blygas"]  $  +    (verb_dwc 2 ["as"] ["s","es"] ["des"] ["ts"] []),++  paradigm_h "vb_3s_brås" ["brås"]  $  +    (verb_dwc 1 ["s"] ["s"] ["ddes"] ["tts"] []),++  paradigm_h "vb_2s_trivas" ["trivas"]  $ +   verb_deponens 2 ([e "as"],[(ungeminate,"s"),e "as"],[e"des"],[e "ts"],[]),++  paradigm_h "vb_2s_nöjas" ["nöjas"] $ +   (verb_dwc 2 ["as"] ["s"] ["des"] ["ts"] []),++  paradigm_h "vb_2s_minnas" ["minnas"] $ +   (verb_dwc 3 ["nas"] ["ns"] ["des"] ["ts"] []),++  paradigm_h "vb_2s_vämjas" ["vämjas"] $ +   (verb_dwc 3 ["jas"] ["jes","js"] ["jdes","des"] ["jts","ts"] []),++  paradigm_h "vb_2s_töras" ["töras"] $ +   (verb_dwc 4 ["öras","ordas"] ["örs"] ["ordes"] ["orts"] []),++  paradigm_h "vb_2s_rymmas" ["rymmas"] $ +   (verb_dwc 3 ["mas"] ["s"] ["des"] ["ts"] []),++  paradigm_h "vb_2s_idas" ["idas"] $ +   (verb_dwc 3 ["das"] ["ds","des"] ["ddes"] ["tts"] []),++  paradigm_h "vb_2s_hövas" ["hövas"] $ +   (verb_dwc 2 ["as"] ["es"] ["des"] ["ts"] []),++  paradigm_h "vb_2s_glädjas" ["glädjas"] $ +   (verb_dwc 5 ["ädjas"] ["äds","ädes"] ["addes"] ["atts"] []),++  paradigm_h "vb_2s_giftas" ["giftas"] $ +   (verb_dwc 2 ["as"] [] ["es"] ["s"] []),++  paradigm_h "vb_2s_skiljas" ["skiljas"] $ +   (verb_dwc 3 ["jas"] ["js","s","jes"] ["des"] ["ts"] []),++  paradigm_h "vb_va_vika" ["vika"]  +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "e","")], [(vc "e","e")],[e "it",e "t"], [e "en"])),++  paradigm_h "vb_va_tvinga" ["tvinga"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "ar"], [e "a"], [(id,"ade"),(vc "a","")], [(vc "u","e")],[e "at",(vc "u","it")], [e "ad",(vc "u","en")])),++  paradigm_h "vb_va_löpa" ["löpa"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(id,"te"),(vc "o","p")], [(vc "u","e")],[(id,"t"),(vc "u","it")], [(vc "u","en"),e "t"])),++  paradigm_h "vb_vm_fnysa" ["fnysa"]  +   (verb_full 1 ([e "a"], [e "e"],[e "er"], [e ""], [(id,"te"),(vc "ö","")], [(vc "ö","e")],[e "t"], [])),++  -- paradigm_h "vb_vm_tilltvinga" ["tilltvinga"] +  -- (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "ar"], [e "a"], [(id,"ade"),(vc "a","")], [(vc "a","e")],[e "at",(vc "u","it")], [])),++  paradigm_h "vb_vm_avvara" ["avvara"] +   (verb_weak_sform_variant 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "it",e "at"],[])),+ +  paradigm_h "vb_va_växa" ["växa"] +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "er"], [e "a"], [e "te"],[(vc "u", "e")],[(vc "u", "it"),(id,"t")], [(vc "u", "en")])),++  paradigm_h "vb_va_stupa" ["stupa"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "ar"], [e "a"],[(vc "ö",""),(id,"ade")], [(vc "ö","e")],[e "at"], [e "ad"])),++  paradigm_h "vb_va_lyda" ["lyda"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(id,"de"),(vc "ö","")], [(vc "ö","e")],[(tk 1,"tt")], [e "d"])),++  paradigm_h "vb_om_skola" ["skola"] +   (verb_weak_no_sform 1 ([e "a"], [(vc "a" . tk 1, ""),(vc "a","l")], [e "a"], [(vc "u", "le")], [e "at"], [])),++  paradigm_h "vb_vm_snika" ["snika"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e "a"], [(vc "e", ""),(id,"te")], [(vc "e","e")], [e "it"], [])),++  paradigm_h "vb_vm_smälla" ["smälla"] +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "a",""),(id,"de")], [(vc "u","e")],[e ""], [])),++  paradigm_h "vb_va_tälja" ["tälja"] +   (verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""],[(id,"de"),(vc "a" . tk 1,"de")], [(id,"t"),(vc "a" . tk 1,"t")], [e "d"])),++  paradigm_h "vb_va_två" ["två"] +   (verb_weak 0 ([e ""], [e "r"], [e ""], [e "dde"], [(id,"tt"),(vc "a","git")],  [e "dd"])),++  paradigm_h "vb_va_smälta" ["smälta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "a", ""),(id,"e")], [(vc "u","e")],[(vc "u","it"),(id,"")], [(vc "u","en")])),++  paradigm_h "vb_va_förmäla" ["förmäla"]  +   (verb_weak_sform_variant 1 ([e "a"],[e "er"],[e ""],[e "te",e "de"],[e "t"],[e "d"])),++  paradigm_h "vb_va_besvärja" ["besvärja"]  +   (verb_full_sform_variant 1 ([e "a",(tk 1,"a")],[e "e"],[(id,"er"),(tk 1,"")],[e ""], [(vc "o" . tk 1, ""),(id,"de")], [(vc "u" .tk 1,"e")],[(vc "u" . tk 1, "it"),(id,"t")], [e "d", (vc "u" . tk 1, "en")])),++  paradigm_h "vb_om_kunna" ["kunna"]  +   (verb_weak_no_sform 0 ([e ""],[(vc "a" . tk 2, "")],[],[(tk 2, "de")],[e "t"],[])),++  paradigm_h "vb_vm_upphäva" ["upphäva"]       +   (verb_full_sform_variant 1 ([e "a"],[e "e"],[e "er"],[e ""],[e "de",(vc "o","")],[(vc "o","e")],[e "t"],[])),++  paradigm_h "vb_vm_undvara" ["undvara"]  +   (verb_weak_sform_variant 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at",e "it"],[])),++  paradigm_h "vb_vm_strida" ["strida"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(id,"de"), (vc "e", "")], [(vc "e","e")],[(tk 1, "tt"), (id, "it")], [])),++  paradigm_h "vb_vm_sluta" ["sluta"] +   (verb_full_sform_variant 1 ([e "a"],[e "e"],[e "ar"], [e ""], [(id,"ade"),(vc "ö","")], [(vc "ö","e")],[e "at"], [])),++  paradigm_h "vb_vm_samvara" ["samvara"]  +   (verb_weak_sform_variant 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "it"],[])),++  paradigm_h "vb_vm_ryka" ["ryka"]  +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "ö",""),(id,"te")], [(vc "ö","e")],[(id,"t"),(vc "u","it")],[])),++  paradigm_h "vb_vm_nysa" ["nysa"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(id,"te"),(vc "ö","")], [(vc "ö","e")],[(id,"t"),(id,"it"),(vc "u","it")], [])),++  paradigm_h "vb_vm_kvida" ["kvida"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "e", ""),(id,"ade")], [(vc "e","e")],[e "it"], [])),++  paradigm_h "vb_vm_klinga" ["klinga"]  +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "ar"], [e "a"], [(id,"ade"),(vc "a","")], [(vc "a","e")],[e "at"], [])),++  paradigm_h "vb_va_gälla_kastrera"   ["gälla"] +   (verb_weak_sform_variant 1 ([e "a"],[e "er"],[e ""],[e "de",e "ade"],[e "t",e "at"],[e "d",e "ad"])),++  paradigm_h "vb_vm_gala" ["gala"]  +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e ""], [e ""], [(vc "o","")], [(vc "o","e")],[(id,"it"),(vc "a","t")], [])),++  paradigm_h "vb_vm_duga" ["duga"] +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ö",""),(id,"ade")], [(vc "ö", "e")],[(id,"t"),(id,"it")], [])),++  paradigm_h "vb_vm_drösa" ["drösa"]  +   (verb_weak_sform_variant 1 ([e "a"],[e "er"],[e ""],[e "te",e "ade"],[e "at",e "t"],[])),++  paradigm_h "vb_vm_drypa" ["drypa"] +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ö","")], [(vc "ö","e")],[(vc "u","it"),(id,"t")], [])),++  paradigm_h "vb_va_utlöpa" ["utlöpa"] +   (verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "te"], [e "t"], [(vc "u", "en")])),++  paradigm_h "vb_va_träda" ["träda"]  +   (verb_weak_sform_variant 1 ([e "a"], [e "er"],[e ""],[e "ade",e "de"], [(id,"at"),(tk 1,"tt")], [e "d"])),++  paradigm_h "vb_va_strypa" ["strypa"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "ö",""),(id,"te")], [(vc "ö","e")],[e "t"],[e "t"])),++  paradigm_h "vb_va_snusmala" ["snusmala"]  +   (verb_weak_sform_variant 1 ([e "a"],[e ""],[e ""],[e "de"],[e "t"],[e "d",e "en"])),++  paradigm_h "vb_va_skvätta" ["skvätta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "a",""),(id,"e")], [(vc "a","e")],[e ""], [e "ad"])),++  paradigm_h "vb_va_simma" ["simma"] +   (verb_full 1 ([e "a"], [e "e"],[e "ar"], [e "a"],[(vc "a" . ungeminate ,""),(id,"ade")], [(vc "a","e")],[(vc "u","it"), (id,"at")],[(vc "u","en"), (id,"ad")])),++  paradigm_h "vb_va_nästa" ["nästa"] +   (verb_weak 1 ([e "a"],[e "ar"],[e "a"],[e "ade",e "e"],[e "at"],[e "ad"])),++  paradigm_h "vb_va_mala" ["mala"] +   (verb_weak 1 ([e "a"],[e "er",e ""],[e ""],[e "de"],[e "t"],[e "d",e "en"])),++  paradigm_h "vb_va_kväda" ["kväda"]  +   (verb_full 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "a",""),(id,"de")], [(vc "a","e")],[e "it"], [e "en"])),++  paradigm_h "vb_va_klyva" ["klyva"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "ö","")], [(vc "ö","e")],[(vc "u","it"),e "it",e "t"], [e "en"])),++  paradigm_h "vb_va_gälda" ["gälda"]  +   (verb_full 1 ([e "a"], [e "e"],[e "ar"], [e "a"], [e "ade"] , [(vc "u","e")],[e "at"], [(vc "u", "en"),(id,"ad")])),++  paradigm_h "vb_va_förse" ["förse"] +   (verb_weak 0 ([e ""], [e "r"], [e ""],[(vc "å","g"),(id,"dde")], [e "tt"], [e "dd"])),++  paradigm_h "vb_va_förlöpa" ["förlöpa"] +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "er"], [e ""], [e "te"], [(vc "u","e")],[(vc "u","it"),(id,"t")],[(vc "u","en"), (id,"t")])),++  paradigm_h "vb_va_framtvinga" ["framtvinga"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "ar"], [e "a"], [e "ade"],[(vc "u","e")],[(vc "u","it"),(id,"at")], [(vc "u","en"),(id, "ad")])),++  paradigm_h "vb_va_tala" ["tala"]  $ +   (verb_weak_sform_variant 1 ([e "a"], [e "ar"], [e "a"], [e "ade",e "te"],[e "at",e "t"], [e "ad",e "d"])),++  paradigm_h "vb_va_bestrida" ["bestrida"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "e",""),(id,"de")], [(vc "e","e")],[(tk 1,"tt"),(id,"it")], [e "en",e "d"])),++  paradigm_h "vb_va_besluta" ["besluta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "ar"], [e "a"],[(vc "ö",""),(id,"ade")], [(vc "ö","e")],[e "at",e "it"], [e "en",e "ad"])),++  paradigm_h "vb_va_begrava" ["begrava"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "o",""),(id,"de")], [(vc "o","e")],[e "t",e "it"], [e "en",e "d"])),++  paradigm_h "vb_om_vilja" ["vilja"] +   (verb_weak_no_sform 2 ([e "ja"], [e "l"], [e "ja"], [e "le"],[(vc "e", "at")],[])),++  paradigm_h "vb_om_veta" ["veta"] +   (verb_full_no_sform 1 ([e "a"],[e "e"],[e ""],[e ""],[(vc "i". tk 1,"sste")],[], [e "at"],[])),++  paradigm_h "vb_om_måste" ["måste"] +    (verb_weak_no_sform 1 ([e "a"],[e "e"],[e "a"],[e "e"],[e ""],[])),++  paradigm_h "vb_om_heta" ["heta"] +    (verb_weak_no_sform 1 ([e "a"],[e "er"],[e ""],[e "te"],[e "at"],[])),++  paradigm_h "vb_oa_varda" ["varda"]  +    (verb_weak_no_sform 1 ([e "a"], [e "er"], [e "a"], [e "e"], [(tk 1,"t")],[(vc "o", "en")])),++  paradigm_h "vb_vs_dväljas" ["dväljas"]  $ +     (verb_deponens 3 ([e "jas"], [e "jes",e "js"],[(vc "a","des"),(id,"jdes")], [(vc "a","ts"),(id,"ts")],[])),++  paradigm_h "vb_4s_vederfaras" ["vederfaras"]  $ +     (verb_deponens 2 ([e "as"], [e "s"],[(vc "o","s")], [e "its"],[])),++  paradigm_h "vb_4s_tas" ["tas"]  $ +     (verb_deponens 1 ([e "s"], [e "s"],[(vc "o","gs")], [e "gits"],[])),++  paradigm_h "vb_4s_umgås" ["umgås"] $ +     (verb_deponens 0 ([e ""], [e ""],[(vc "i".tk 1,"cks")],[(tk 1, "tts")],[])),++  paradigm_h "vb_4s_munhuggas" ["munhuggas"]  $ +     (verb_deponens 2 ([e "as"], [e "s",e "es"],[(vc "ö","s")], [e "its"],[])),++  paradigm_h "vb_4s_bitas" ["bitas"]  $ +     (verb_deponens 2 ([e "as"], [e "s"],[(vc "e","s")], [e "its"],[])),++  paradigm_h "vb_4s_hållas" ["hållas"] $ +     (verb_deponens 2 ([e "as"], [e "s"],[(vc "ö","s")], [e "its"],[])),++  paradigm_h "vb_4s_finnas" ["finnas"]  $ +     (verb_deponens 2 ([e "as"], [e "s",e "es"],[(vc "a","s")],[(vc "u","its")],[])),++  paradigm_h "vb_4s_slåss" ["slåss"]  $ +     (verb_deponens 2 ([e "ss"], [e "ss"],[(vc "o","gs")],[(vc "a","gits")],[])),++  paradigm_h "vb_4m_svälta_1" ["svälta"]  +   (verb_full 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "a", "")], [(vc "u","e")],[(vc "u", "it")], [])),++  paradigm_h "vb_va_svälta_2" ["svälta"]  +   (verb_full 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "a", ""), e "e"], [(vc "u","e")],[(vc "u", "it")], [e ""])),++  paradigm_h "vb_4m_förslå" ["förslå"]    +   (verb_full 0 ([e ""], [e "ge"],[e "r"], [e ""],[(vc "o", "g")],[(vc "o","e")],[(vc "a","git")], [])),++  paradigm_h "vb_4a_stjäla" ["stjäla"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e ""], [e ""],[(tk 3, "al")], [(tk 3,"ule")],[(tk 3,"ulit")],[(tk 3,"ulen")])),++  paradigm_h "vb_4m_vara" ["vara"]  +    (verb_full 4 ([e "vara"], [e "vare"],[e "är"],[], [e "var"], [e "vore"], [e "varit"], [])), ++  paradigm_h "vb_4m_sova" ["sova"] +    (verb_full 1 ([e "a"],[e "e"],[e "er"],[e ""],[e ""],[e "e"],[e "it"],[])),++  --paradigm_h "vb_4a_försova" ["försova"] +  --  (verb_full 1 ([e "a"],[e "e"],[e "er"],[e ""],[e ""],[e "e"],[e "it"],[e "en"])),++  paradigm_h "vb_4m_erfara" ["erfara"] +    (verb_full 1 ([e "a"], [e "e"],[e ""], [e ""],[(vc "o", "")], [(vc "o","e")],[e "it"], [])),++  paradigm_h "vb_4a_bli" ["bli"]  vb_4a_bliva,++  paradigm_h "vb_4a_bestå" ["bestå"]     +   (verb_full 0 ([e ""], [],[e "r"], [e ""], [(vc "o", "d")], [(vc "o","de")],[e "tt"], [e "nden", e "tt"])),++  paradigm_h "vb_4a_äta" ["äta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "å", "")], [(vc "å","e")],[e "it"], [e "en"])),++  paradigm_h "vb_4a_svära" ["svära"] +   (verb_full_compound_sform_variant 1 ([e "a",e "ja"], [e "je", e "e"],[e "",e "jer"], [e ""], +               [(vc "o", "")],[(vc "u","e")],[(vc "u","it")],[(vc "u", "en")],[e ""])),++  paradigm_h "vb_4a_emotstå" ["emotstå"] +   (verb_full 0 ([e ""], [],[e "r"], [e ""],[(vc "o", "d")], [(vc "o","de")],[e "tt"], [e "nden"])),++  paradigm_h "vb_4m_sitta" ["sitta"]  +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "a", "")],  [(vc "u","e")],[(vc "u", "it")], [])),++  paradigm_h "vb_4a_be" ["be"]  +   (verb_full_compound_sform_variant 0 ([e "",e "dja",e "da"], [e "dje",e "de"],[e "r",e "djer",e "der"], [e "",e "dj",e "d"],[(vc "a", "d")], [(vc "a","de")],[e "tt"], [e "dd"],[])),++  paradigm_h "vb_4m_ryta" ["ryta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ö", "")],[(vc "u","e")],[(vc "u", "it")], [])),++  -- paradigm_h "vb_4a_ryta" ["förbryta"] +  -- (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ö", "")],[(vc "u","e")],[(vc "u", "it")], [e "t"])),++  paradigm_h "vb_4m_gråta" ["gråta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ä", "")],[(vc "ä","e")],[e "it"], [])),++  paradigm_h "vb_4m_ligga" ["ligga"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "å" . tk 1, "")],[(vc "å","e")],[(vc "e". tk 1, "at")], [])),++  paradigm_h "vb_4m_le" ["le"] +   (verb_full 0 ([e ""], [],[e "r"], [e ""],[(vc "o", "g")], [(vc "o","ge")],[e "tt"], [])),++  paradigm_h "vb_4m_bekomma" ["bekomma"]  +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [],[(vc "o" . ungeminate, "")], [(vc "o", "e")], [e "it"], [])),++  paradigm_h "vb_4m_småsvära" ["småsvära"] +   (verb_full_sform_variant 1 ([e "a", e "ja"], [e "e"],[e "",e "jer"], [e ""], [(vc "o", "")],[(vc "u","e")],[(vc "u", "it")], [])),++  paradigm_h "vb_4m_skåpäta" ["skåpäta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e ""], [e ""],[(vc "å", "")],[(vc "å","e")],[e "it"], [])),+ +  paradigm_h "vb_4m_förevara" ["förevara"] +   (verb_weak_sform_variant 1 ([e "a"], [], [], [e ""], [e "it"], [])),++  paradigm_h "vb_4a_stinga" ["stinga"]  +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [], [],[(vc "u","e")],[(vc "u","it")],[(vc "u","en")])),++  paradigm_h "vb_4a_förgäta" ["förgäta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "a","")], [(vc "a","e")],[e "it"], [e "en"])),++  --paradigm_h "vb_3m_te" ["te"] +  -- (verb_weak_no_sform 0 ([e ""], [e "r"], [e ""], [e "dde"], [e "tt"], [])),++  paradigm_h "vb_2m_ha" ["ha"]  $+   verb_weak_compound 0 ([e "",e "va"], [e "r",e "ver"], [e ""], [e "de"], [e "ft"], [],[e ""]),++  paradigm_h "vb_2m_mysa" ["mysa"] $ +   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "te"], [e "t"], []),+  paradigm_h "vb_va_nypa" ["nypa"] $ +   verb_full 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ö","")], [(vc "ö","e")],[(id,"t"),(vc "u","it")], [(id,"t"),(vc "u","en")]),+  paradigm_h "vb_0d_lyster"    ["lyster"]    $ +   verb_weak 0 ([], [e ""], [], [], [], []),+  paradigm_h "vb_0d_värdes"    ["värdes"]    $+   verb_weak 0 ([], [e ""], [], [], [], []),+  paradigm_h "vb_0d_vederböra" ["vederböra"] $+   verb_weak 0 ([e ""], [(tk 1,"")], [], [], [], []),+  paradigm_h "vb_0d_nåde"      ["nåde"]      $ +   verb_full 0 ([], [e ""],[],[], [], [], [], []), ++  paradigm_h "vb_0d_lyss"      ["lyss"]      $ +   verb_full 0 ([e ""], [],[],[e ""], [], [], [], []), ++  paradigm_h "vb_4d_vederfås"  ["vederfås"]  $ +    verb_dwc 1 [""] [] [] ["tts"] [],+   paradigm_h "vb_4d_sprätta"   ["spritta"]   $ +   verb_weak 1 ([e "a"], [e "er"], [e ""], [(vc "a","")], [], []),++  paradigm_h "vb_id_månde"     ["månde"]  $ +   verb_weak_no_sform 0 ([], [],[],[e ""], [], []), ++  paradigm_h "vb_2d_torde"     ["torde"] $+   verb_full 2 ([], [],[(vc "ö","")],[], [], [e "de"], [], []), +  paradigm_h "vb_2d_rädas"     ["rädas"]     $ +   verb_dwc 2 ["as"] ["as","s"] ["des"] [] [],+  paradigm_h "vb_1a_laga"                     ["laga"]                v1,+  paradigm_h "vb_1s_andas"                    ["andas"]               vb_1s_hoppas,+  paradigm_h "vb_2a_ansöka"                   ["ansöka"] $+    verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "te"], [e "t"], [e "t"]),+  paradigm_h "vb_2a_göra"              ["göra"]                vb_2a_göra,+  paradigm_h "vb_2a_hyra"              ["hyra"] $+   verb_weak_sform_variant 1 ([e "a"], [e ""], [e ""], [e "de"], [e "t"], [e "d"]),+  paradigm_h "vb_2a_känna"             ["känna"] $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(tk 1, "de")], [(tk 1,"t")], [(tk 1, "d")]),+  paradigm_h "vb_2a_leda"              ["leda"]  $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "de"], [(tk 1, "tt")], [e "d"]),+  paradigm_h "vb_2a_lägga"             ["lägga"]  $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(vc "a".tk 2,  "de"),(vc "a".tk 2,  "")], [(vc "a" . tk 1, "t")], [(vc "a". tk 1,"d")]),+  paradigm_h "vb_2a_sätta"             ["sätta"] $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(vc "a", "e")], [(vc "a" , "")], [(vc "a","")]),+  paradigm_h "vb_2a_viga"              ["viga"] $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "de"], [e "t"], [e "d"]),+  paradigm_h "vb_2s_synas"             ["synas"]               vb_2s_synas,+  paradigm_h "vb_4a_falla"             ["falla"] $+   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"],[e ""], [(vc "ö", "")], [(vc "ö", "e")], [e "it"], [e "en"])), +  paradigm_h "vb_4a_flyga"             ["flyga"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"],[e ""], [(vc "ö", "")], [(vc "ö", "e")], [(vc "u","it")], [(vc "u","en")])), ++  paradigm_h "vb_4a_ge"                ["ge"] $+   verb_full_sform_variant 0 ([e "", (vc "i","va")], [(vc "i","ve")], [e "r",(vc "i","ver")], [e "",(vc "i","v")], [(vc "a","v")], [(vc "å","ve")], [e "tt",(vc "i","vit")], [(vc "i", "ven")]),+  paradigm_h "vb_4a_hålla"             ["hålla"] $+   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"],[e ""], [(vc "ö", "")], [(vc "ö", "e")], [e "it"], [e "en"])), +  paradigm_h "vb_4a_komma"             ["komma"] $             vb_4a_komma,+  paradigm_h "vb_4a_rida"              ["rida"]  $              vb_4a_bita,+  paradigm_h "vb_4a_skjuta"            ["skjuta"] $+  (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(tk 3,"öt")], [(tk 3,"öte")],[e "it"], [e "en"])),+  paradigm_h "vb_4a_tillåta"           ["tillåta"]             vb_4a_låta,+  paradigm_h "vb_4a_slå"               ["slå"] $+  (verb_full 0 ([e ""], [],[e "r"],[e ""], [(vc "o","g")], [(vc "o","ge")], [(vc "a", "git")], [(vc "a","gen")])),+  paradigm_h "vb_4a_se"                ["se"] $+  (verb_full 0 ([e ""], [],[e "r"],[e ""], [(vc "å","g")], [(vc "å","ge")], [e "tt"], [e "dd"])),+  paradigm_h "vb_4a_gå"                ["gå"]  $+   (verb_full_sform_variant 0 ([e ""], [e "nge"],[e "r"],[e ""], [(vc "i", "ck")], [(vc "i", "nge")], [e "tt"], [e "ngen"])), +  paradigm_h "vb_4a_dricka"            ["dricka"]              vb_4a_vinna,++  paradigm_h "vb_4a_bära"              ["bära"]   $+  (verb_full_sform_variant 1 ([e "a"], [e "e"],[e ""], [e ""], [(vc "a","")], [(vc "u","e")],[(vc "u", "it")], [(vc "u","en")])),++  paradigm_h "vb_4m_innebära"     ["innebära"]   $+   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e ""], [e ""], [(vc "a","")], [(vc "u","e")],[(vc "u", "it")], [])),++  paradigm_h "vb_4a_ta"                ["ta"] $ vb_4a_ta,+            +  paradigm_h "vb_va_klä"                ["klä"]             +  (verb_weak 0 ([e "da",e ""], [e "r",e "der"], [e "",e "d"], [e "dde"], [e "tt"], [e "dd"])),+  paradigm_h "vb_4m_angå"              ["angå"] +  (verb_full 0 ([e ""], [e "nge"],[e "r"],[e ""], [(vc "i","ck")], [(vc "i","nge")], [e "tt"], [])),+  paradigm_h "vb_4m_stå"               ["stå"] $+  (verb_full 0 ([e ""], [],[e "r"],[e ""], [(vc "o","d")], [(vc "o","de")], [e "tt"], [])),+  paradigm_h "vb_4m_vina"              ["vina"]                vb_4m_vina,+  paradigm_h "vb_va_bringa"            ["bringa"]  vb_va_bringa,+  paradigm_h "vb_2a_lyfta"           ["lyfta"] $+    verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "e"], [e ""], [e ""]),+  paradigm_h "vb_2a_sända"         ["sända"]   vb_2a_sända,+  paradigm_h "vb_3a_sy"               ["sy"]      v3,+  paradigm_h "vb_va_koka"           ["koka"]    vb_va_koka,+  paradigm_h "vb_va_sprida"         ["sprida"]  $+   (verb_full 1 ([e "a"],[e "e"],[e "er"],[e ""], [(vc "e",""),e "de"], [(vc "e","e")],[(tk 1,"tt"),e "it"], [e "d"]))+ ]+-}
+ src/dalin/DictSw.hs view
@@ -0,0 +1,166 @@+module DictSw where++import BuildSw+import RulesSw+import TypesSw+import General+import Dictionary++swedishDict :: Dictionary+swedishDict = dictionary []++-- closedLexicon++closedLexicon :: [Entry]+closedLexicon = concat +		[+  		 prepositions,+                 adverbials,		 +   		 conjunctions,+   		 subjunctions,+   		 particles,+		 pronounsPN,+		 pronounsAdj,+		 [+		  entry artIndef,+		  entry artDef,+		  infMark "att"+		 ],+                 auxiliaryVerbs,+		 numerals +		]++pronounsPN :: [Entry]+pronounsPN = +    [+     entry pronRefl,+     pronJag "jag" "mig" "min" "mitt",+     pronJag "du"  "dig" "din" "ditt", +     pronHan "han" "honom" "hans",     +     pronHan "hon" "henne" "hennes",   +     pronJag "vi"  "oss" "vår" "vårt", +     pronJag "ni"  "er"  "er" "ert",+     pronHan "de"  "dem"  "deras", +     pronHan "den" "den" "dess", +     pronHan "det" "det" "dess",+     pronHan "vem" "vem" "vems"+    ]++pronounsAdj = +    [+     pronDylik "all",+     pronDylik "dylik",+     pronDylik "hurdan",+     pronDylik "likadan",+     pronDylik "sådan",+     pronNagon "egen" "eget" "egna",+     pronNagon "denna" "detta" "dessa",+     pronNagon "annan" "annat" "andra",+     pronNagon "ingen" "inget" "inga",+     pronNagon "vilken" "vilket" "vilka",+     pronNagon "mången" "månget" "många",+     pronNagon "någon" "något" "några"+    ]+++prepositions +     = map prep+	[+       "alltsedan",+       "apropå",+       "av",+       "bakom",+       "bland",+       "bortom",+       "bortåt",+       "brevid",+       "efter",+       "emellan",+       "emot",+       "enligt",+       "framför",+       "från",+       "för",+       "förbi",+       "före",+       "förutom",+       "genom",+       "gentemot",+       "hos",+       "härom",+       "i",+       "ifrån",+       "igenom",+       "inemot",+       "inför",+       "inklusive",+       "innan",+       "innanför",+       "inom",+       "intill",+       "invid",+       "jämte",+       "kontra",+       "kring",+       "längs",+       "med",+       "medelst",+       "mellan",+       "mot",+       "nedanför",       +       "om",+       "omkring",+       "ovan",+       "ovanför",+       "ovanpå",+       "per",+       "på",+       "runt",+       "sedan",+       "sen",+       "till",+       "trots",+       "undan",+       "under",+       "ur",+       "utan",+       "utanför",+       "utanpå", +       "utefter",+       "utför",+       "utifrån",+       "utmed",+       "utom",+       "utöver",+       "via",+       "vid",+       "visavi",+       "å", +       "åt",+       "över"+       ]++conjunctions = map conj $ words	+  "och samt respektive liksom fast men utan eller ty för så både"++subjunctions = map subj $ words+	       "att förrän innan medan sedan tills eftersom allteftersom emedan för så bara blott ifall om såvida liksom som såsom än ehuru fast fastän oaktat"++particles = map part $ words+   "emot fast in ut upp ner fram åter" -- plus prepositions++auxiliaryVerbs = map (\ (x, y, z, u) -> entry (auxVerbGen x y z u)) [+  (mkStr "vilja", mkStr "vill", mkStr "ville",mkStr "velat"),+  (mkStr "kunna", mkStr "kan",  mkStr "kunde",mkStr "kunnat"),+  (nonExist,      mkStr "måste",mkStr "måste",mkStr "måst"),+  (mkStr "skola", strings ["ska","skall"], mkStr "skulle",nonExist),+  (mkStr "böra",  mkStr "bör", mkStr "borde",mkStr "bort")+  ]++-- -- not really closed+adverbials = map adverbInv $ words +  "dessutom heller också även dock ändå alltså väl nere ute inne"++-- from numerals.Swe.gf+numerals = [] -- map numeralInv $ words "arton aderton elva ett fem femtio femton fjorton fyra fyrtio hundra nio nittio nitton sex sextio sexton sju sjuttio sjutton tio tjugo tolv tre trettio tretton tusen två åtta åttio"+
+ src/dalin/EncodeSw.hs view
@@ -0,0 +1,243 @@+module EncodeSw where++import Char+import Frontend++import qualified Data.Map as Map++sw_encodings = Map.insert "parole" (Just parole_pos,Just parole_inhs,Just parole_param) (Map.insert "SUC" (Just suc_pos,Just suc_inhs,Just suc_param) Map.empty)+parole_pos  _ = ""++parole_inhs _ = []++parole_param (pos,p,inhs) = + case pos of+   "pm" -> case words p of+             xs | elem "nom" xs -> "NP00N@0S"+             xs | elem "gen" xs -> "NP00G@0S"+             _ -> parole_param ("nn",p,inhs)+   "ab" -> case p of+             "invar" -> "RG0S"+             "pos"   -> "RGPS"+             "komp"  -> "RGCS"+             "super" -> "RGSS"+             "c"     -> "RG0C"+             "sms"   -> "RG0C"+             _ -> error $ "ab " ++ p+   "av" -> case p of+             "pos indef sg f nom"     -> "AQPUSNIS"+             "pos indef sg f gen"     -> "AQPUSGIS"+             "pos indef sg m nom"     -> "AQPUSNIS"+             "pos indef sg m gen"     -> "AQPUSGIS"+             "pos indef sg n nom"     -> "AQPNSNIS"+             "pos indef sg n gen"     -> "AQPNSNIS"+             "pos indef pl nom"       -> "AQPNSNIS"+             "pos indef pl gen"       -> "AQP0PG0S"+             "pos def sg no_masc nom" -> "AQP0SNDS"+             "pos def sg no_masc gen" -> "AQP0SGDS"+             "pos def sg masc nom"    -> "AQPMSNDS"+             "pos def sg masc gen"    -> "AQPMSGDS"+             "pos def pl nom"         -> "AQP0PN0S"+             "pos def pl gen"         -> "AQP0PG0S"+             "komp nom"               -> "AQC00N0S"+             "komp gen"               -> "AQC00G0S"+             "super indef nom"        -> "AQS0PNIS"+             "super def no_masc nom"  -> "AQS00NDS"+             "super def masc nom"     -> "AQSMSNDS"+             "super def masc gen"     -> "AQSMSGDS"+             "c"                      -> "AQC0000C"+             "sms"                    -> "AQC0000C"+             "super indef gen"        -> "AQS0PGIS"+             "super def no_masc gen"  -> "AQS00GDS"+             "invar"                  -> "AQP00N0S"+             _ -> error $ "av " ++ p+   "nn" -> case p of+            "sg indef nom" -> "NC" ++ pgender inhs ++ "SN@IS"+            "sg indef gen" -> "NC" ++ pgender inhs ++ "SG@IS"+            "sg def nom"   -> "NC" ++ pgender inhs ++ "SN@DS"+            "sg def gen"   -> "NC" ++ pgender inhs ++ "SG@DS"+            "pl indef nom" -> "NC" ++ pgender inhs ++ "PN@IS"+            "pl indef gen" -> "NC" ++ pgender inhs ++ "PG@IS"+            "pl def nom"   -> "NC" ++ pgender inhs ++ "PN@DS"+            "pl def gen"   -> "NC" ++ pgender inhs ++ "PG@DS"+            "ci"               -> "NC000@0C"+            "cm"               -> "NC000@0C"+            "sms"              -> "NC000@0C"+            _ -> error $ "nn " ++ p+   "al" ->  case p of+              "sg u" -> "D0@US@S"+              "sg n" -> "D0@NS@S"+              "pl"   -> "D0@0P@S"+   "ie" -> "CIS"+   "in" ->  "I"+   "kn" -> "CCS"+   "nl" ->  +       case p of+         "nom num u"       -> "MCUSNIS"+         "nom num n"       -> "MCNSNIS"+         "nom ord no_masc" -> "MO00N0S"+         "nom ord masc"    -> "MOMSNDS"  +         "gen num u"       -> "MC00G0S"+         "gen num n"       -> "MC00G0S"+         "gen ord no_masc" -> "MO00G0S"+         "gen ord masc"    -> "MCMSGDS"+         _                 -> "*"+   "sn" -> "CSS"+   "pp" -> "SPS"+   "pn" -> case p of+             "nom"        -> "PF@00S@S"+             "ack"        -> "PF@00O@S"+             "poss sg u"  -> "PS@US0@S"+             "poss sg n"  -> "PS@N00@S"+             "poss pl"    -> "PS@0P0@S"+             "sg u nom"   -> "PF@US0@S"+             "sg n nom"   -> "PF@NS0@S"+             "sg u gen"   -> "PS@000@S"        +             "sg n gen"   -> "PS@000@S"+             "pl nom"     -> "PF@0PS@S"+             "pl gen"     -> "PS@000@S"+             _ -> parole_param ("av",p,inhs)+   "vb" -> case unwords [p1 | p1 <- words p, not (elem p1 ["sg","pl","p1","p2","p3"])] of+             "pres ind aktiv"                -> "V@IPAS"+             "pres ind s-form"               -> "V@IPPS"              +             "pres konj aktiv"               -> "V@SPAS"              +             "pret ind aktiv"                -> "V@IIAS"               +             "pret ind s-form"               -> "V@IIPS"              +             "pret konj aktiv"               -> "V@SIAS"              +             "pret konj s-form"              -> "V@SIPS"             +             x | elem "imper" (words x)      -> "V@M0AS"        +             "inf aktiv"                     -> "V@N0AS"                 +             "inf s-form"                    -> "V@N0PS"           +             "sup aktiv"                     -> "V@IUAS"     +             "sup s-form"                    -> "V@IUPS"+             "pres_part nom"                 -> "AP000N0S"+             "pres_part gen"                 -> "AP000G0S"+             "pret_part indef m nom"         -> "AF0USNIS"+             "pret_part indef f nom"         -> "AF0USNIS"+             "pret_part indef f gen"         -> "AF0USGIS"+             "pret_part indef n nom"         -> "AF0NSNIS"+             "pret_part indef n gen"         -> "AF0NSGIS"+             "pret_part indef nom"         -> "AF00PN0S"+             "pret_part indef gen"         -> "AF00PG0S"++             "pret_part def no_masc nom"  -> "AF00SNDS"+             "pret_part def no_masc gen"  -> "AF00SGDS"+             "pret_part def masc nom"     -> "AF0MSNDS"+             "pret_part def masc gen"     -> "AF0MSGDS"+             "pret_part def nom"          -> "AF00PN0S"+             "pret_part def gen"          -> "AF00PG0S"+             "c"                             -> "V@000C"+             "sms"                           -> "V@000C"             +             "pres konj s-form"              -> "V@IPSS"             +             "pret_part indef sg n gen"      -> "AF0NSGIS"+             x -> error $ "vb " ++ x+   "aba" -> "RG0A"+   "ava" -> "AQ00000A"+   "kna" -> "CCA"+   "nna" -> "NC000@0A"+   "pma" -> "NP00N@0A"+   "ppa" -> "SPC"+   "vba" -> "V@000A"+   "vbm" -> (++ "M") $ init $ parole_param ("vb", unwords (filter (\(c:_) -> not (isDigit c)) (words p)),inhs)+   "avm" -> (++ "M") $ init $ parole_param ("av",p,inhs)+   "abm" -> (++ "M") $ init $ parole_param ("ab",p,inhs)+   "inm" -> (++ "M") $ init $ parole_param ("in",p,inhs)+   "nlm" -> (++ "M") $ init $ parole_param ("nl",p,inhs)+   "nnm" -> (++ "M") $ init $ parole_param ("nn",p,inhs)+   "pmm" -> (++ "M") $ init $ parole_param ("pm",p,inhs)+   "pnm" -> (++ "M") $ init $ parole_param ("pn",p,inhs)+   "ppm" -> (++ "M") $ init $ parole_param ("pp",p,inhs)+   _    -> "*" -- "abh" "avh" "sxc" "snm" "ssm" +++pgender ["n"] = "N"+pgender ["v"] = "0"+pgender _     = "U"++suc_pos x = maybe x id $ Map.lookup x (Map.fromList pos)+ where+  pos =+   [+    ("av","JJ"),+    ("al","DT"),+    ("kn","KN"),+    ("ie","IE"),+    ("sn","SN"),+    ("in","IN"),+    ("nl","RG"),+    ("nn","NN"),+    ("pm","PM"),+    ("pn","PN"),+    ("ab","PL"),+    ("ab","AB"),+    ("pp","PP"),+    ("vb","VB")+   ]+    +   -- ("PC","vb"),+   -- ("AN",""),+   -- ("-",""),+   -- ("UO","")+    --("DT","pn"),+    --("HD","pn"),+    --("DL",""),+    --("MAD",""),+    --("MID",""),+    --("PAD",""),+   -- ("RO","nr"),+    --("HS","pn"),+    --("HP","pn"),+    --("PS","pn"),+    -- ("HA","ab"),++suc_inhs xs =  [maybe s id (Map.lookup s (Map.fromList inhs)) | s <- xs]+ where+   inhs =[+        ("v","UTR/NEU"), -- ?+        ("n","NEU"),+        ("u","UTR")+         ]++++suc_param (pos,p,inhs) = unwords $ [ maybe s id (Map.lookup s (Map.fromList param)) | s <- words p]+ where+  param = [("inf","INF"),+           ("konj","KON"),+           ("pret","PRT"),+           ("aktiv","AKT"),+           ("s-form","SFO"),+           ("sup","SUP"),+           ("imper","IMP"),+           ("super","SUV"),+           ("komp","KOM"),+           ("ci","SMS"),+           ("cm","SMS"),+           ("pos","POS"),+           ("pret_part","PRF"),+           ("pl","PLU"),+           ("gen","GEN"),+           ("nom","NOM"),+           ("sg","SIN"),+           ("def","DEF"),+           ("masc","MAS"),+           ("indef","IND"),+           ("pres","PRS"),+           ("n","NEU"),+           ("u","UTR"),+           ("ack","OBJ"),+           ("invar","-")+        --   ("pret_part","PC PRF"),+        --   ("pres_part","PC PRF"),+           --("stark",""),+           --("svag",""),+           --("num",""),+           --("ord",""),+           --("ind",""),+           --("no_masc","")+          ]+           -- ("SIN/PLU",""),+           --    ("SUB/OBJ",""),+           --    ("SUB",""),+           -- ("IND/DEF",""),+
+ src/dalin/GenRulesSw.hs view
@@ -0,0 +1,183 @@+module GenRulesSw where++import General+import List+import qualified Data.Set as Set++type Suffixes = [((String -> String), String)]++e :: String -> ((String -> String),String)+e s = (id,s) ++apply_suffixes :: String -> Suffixes -> [String]+apply_suffixes stem xs = [f stem ++ suff | (f,suff) <- xs]++lift :: [a] -> [[a]]+lift  [] = []+lift   s = [s]++keep :: Int -> (String -> String) -> String -> String+keep n f s = f pre ++ suf+ where+  (pre,suf) = case splitAt n (reverse s) of+               (rs,rp) -> (reverse rp, reverse rs)++drop_last_vowel = dv++dsuff :: String -> String -> String+dsuff suff s + | isPrefixOf (reverse suff) (reverse s) = tk (length suff) s+ | otherwise = s++dv :: String -> String+dv w = case find_stem_vowel w of+        (seg,e,l) -> seg ++ l+++dvu :: String -> String+dvu w = case find_stem_vowel w of+          (seg,e,l) -> (ungeminate_m_n seg) ++ l++fr :: String -> String+fr s = case reverse s of+         ('f':v:_) -> s ++ "v"+         _ -> s++fv s = if (dp 2 s == "fv") then tk 1 s else s++dpe :: String -> String+dpe w = case find_stem_vowel w of+         (seg,e,l) | slast e == 'e' && length l < 2 -> seg ++ init e ++ l+         _ -> w++slast x@(_:_) = last x+slast _ = '_'++dpeu :: String -> String+dpeu w = case find_stem_vowel w of+           (seg,e,l) | slast e == 'e' && length l < 2 -> ungeminate_m_n seg ++ init e ++ l+           _ -> ungeminate_m_n w++dpl :: Char -> String -> String+dpl c s = case span (/= c) (reverse s) of+           (b,_:r) -> reverse (b ++ r)+           (b,[])  -> reverse b++drop_second_last :: String -> String+drop_second_last s = (tk 2 s) ++ (dp 1 s)++is_vowel :: Char -> Bool+is_vowel c = Set.member c vowel ++vowel = Set.fromList "aeiouyåäöAEIOUYÅÄÖ"++is_consonant :: Char -> Bool+is_consonant c = Set.member c consonant++consonant = Set.fromList "bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ"++is_voiced :: Char -> Bool+is_voiced c = Set.member c voiced++voiced = Set.fromList "bdglmnrvjBDGLMNRVJ"++if_vowel :: Char -> String -> String -> String+if_vowel c d e = if is_vowel c then d else e++drop_final_e :: String -> String+drop_final_e = dropEndIf (=='e')++ds :: String -> String+ds s =  case reverse s of+        (x:y:_) | ((is_consonant x) && y == 's') || ((is_consonant x) && y == 'x') || [y,x] == "ch" || x=='x' || x =='z' || x =='s' -> s+        [] -> []+        _   -> s +? "s"++ds_drop :: String -> String+ds_drop s = ds $ if iw s then safe_init s else s+  where iw [] = False+        iw str = is_vowel (last str)++fl :: String -> String+fl s = case words s of+         [x,y] -> y +? x+         _     -> error "Unable to flip in \"" ++ s ++ "\""++-- dropEndIf (=='s')++compound_s :: String -> [String]+compound_s s = case reverse s of+                 (x:y:_) | ((is_consonant x) && y == 's') || ((is_consonant x) && y == 'x') || [y,x] == "ch" || x=='x' || x =='z' || x=='s' -> [s]+                 [] -> []+                 _   -> [s +? "s"]++insert_second_last :: String -> Char -> String+insert_second_last s c = safe_init s ++ [c] ++ (f s)+  where f [] = []+        f str = [last str]++geminate :: String -> String+geminate s = s ++ dp 1 s++ungeminate :: String -> String+ungeminate s = case reverse s of+  'm':'m':_ -> safe_init s+  _         -> s++ungeminate_m_n :: String -> String+ungeminate_m_n s = case reverse s of+  n:m:_ | n == m && elem n "nm" -> safe_init s+  _ -> s++safe_init :: String -> String+safe_init [] = []+safe_init xs = init xs++mmn :: String -> String+mmn s = case reverse s of+         ('n':'m':'m':xs)  -> (reverse ('n':'m':xs))+         _                 -> s++--3 Umlaut+--+-- Let's conclude with something that is not easy to do on this level of generality+-- with regular expressions: +-- define first the *stem vowel* as the last vowel (or diphtong) in the stem:++find_stem_vowel :: String -> (String, String, String)+find_stem_vowel sprick = (reverse rps, reverse i, reverse kc) where+  (kc, irps) = break is_vowel $ reverse sprick+  (i,   rps) = span  is_vowel $ irps++-- vowel change+vc :: String -> String -> String+vc v sprick = +  case find_stem_vowel sprick of+    (spr,i,ck) -> spr ++ v ++ ck++vct :: [(String,String)] -> String -> String+vct xs sprick =   case find_stem_vowel sprick of+                    (spr,i,ck) -> spr ++ (v i) ++ ck+ where v i = case lookup i xs of+               Just x -> x+               Nothing -> i++++triplecons :: String -> Char -> String+triplecons s c = case reverse s of+                   (c1:c2:_) | c1 == c && c1 == c2 -> safe_init s+                   _  -> s++-- Although *umlaut* is not very very useful in Swedish, we are glad to+-- present a general rule for it:++umlaut :: String -> String+umlaut man = m ++ mkUm a ++ n where+  (m,a,n) = find_stem_vowel man+  mkUm v = case v of+    "a" -> "ä"+    "o" -> "ö"+    "å" -> "ä"+    "u" -> "y"+    _   -> v
+ src/dalin/Main.hs view
@@ -0,0 +1,54 @@+module Main where++import CommonMain+-- import DictSw+import CommandsSw+import Frontend+import Compound+import qualified Data.Set as Set+import Dictionary(Entry,set_lemma_id)+import qualified Dict.Abs as Abs+import Attr+import GenRulesSw+import TestSw+import PrintSw+import EncodeSw++main :: IO ()+main = commonMain DALIN++data DALIN = DALIN+ deriving Show++instance Language DALIN where+ morphology_header _ = "FM-DALIN 1.0\n  L. Borin & M. Forsberg, under GNU LGPL 3.0 or CC-SA 2.5 Generic"+ name         _ = "swe"+ paradigms    _ = foldr insertCommand emptyC commands+ composition  _ = Nothing --Just $ compDesc+ termParser _ ts e = add_id ts e+ sandhi_rules _ = saldo_sandhi+ testBench _    = tests+ encoding _ = sw_encodings+ lprinter     _ = print_table+ word_attr    _ = [h_attr,w_attr,wp_attr]+ +compDesc :: CompDesc+compDesc = [+ [ attr [h_attr, w_attr, wp_attr] ],+ [ attr [init_attr,wp_attr,c_attr], star [medial_attr], attr [h_attr,wp_attr,s_attr] ]+ ]++saldo_sandhi :: (String,String) -> [(String,String)]+saldo_sandhi (x,y@(c:_)) = +    case reverse x of+      (c1:c2:_) | c1 == c2 && c2 == c -> []+      (c1:_)    | is_consonant c1 && c1 == c -> [(x ++ [c],y),(x,y)]+      _                               -> [(x,y)]+saldo_sandhi x = [x]++sal_affixes :: Set.Set String+sal_affixes = Set.fromList ["en","ens","ar","ars","or","ors"]++add_id :: [Abs.Term] -> Entry -> Entry+add_id [Abs.TermC _ [(Abs.TermA (Abs.NStr s))]]  e = set_lemma_id s e+add_id _                                         e = e
+ src/dalin/NounBuildSw.hs view
@@ -0,0 +1,61 @@+module NounBuildSw where++import General+import Dictionary+import GenRulesSw+import TypesSw+import RulesSw+import Char+import Attr++substantive :: Substantive -> Genus -> Entry+substantive n g = entryI (hyphenate_compounds n) [prValue g]++noun_f :: Int -> Genus -> (Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+noun_f n g (apa,apan,apor,aporna) s = noun_compound n g (apa,apan,apor,aporna,apa,apa) s ++noun_compound_ng :: Int -> Genus -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+noun_compound_ng n g (apa,apan,apor,aporna,ap,ap2) s = substantive (missing n_f [(SF n d Gen) | n <- values, d <- values]) g +  where n_f p = (mk_substantive_v (suff apa) (suff apan) (suff apor) (suff aporna) (suff ap) (suff ap2) (suff ap)) p+        suff    = apply_suffixes (tk n s)++noun_compound :: Int -> Genus -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+noun_compound n g (apa,apan,apor,aporna,ap,ap2) s = substantive n_f g +  where n_f p = (mk_substantive_v (suff apa) (suff apan) (suff apor) (suff aporna) (suff ap) (suff ap2) (suff ap)) p+        suff    = apply_suffixes (tk n s)++noun_no_genitive :: Genus -> (Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+noun_no_genitive g (apa,apan,apor,aporna) s = substantive (missing n_f [(SF n d Gen) | n <- values, d <- values]) g +  where n_f p = (mk_subst_v (suff apa) (suff apan) (suff apor) (suff aporna) (suff apa)) p+        suff    = apply_suffixes s++nna :: Genus -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+nna g (apa,apas,apan,apans,apor,apors,aporna,apornas) s = + replace_attr wp_attr w_attr $ replace_attr h_attr w_attr $ set_pos "nna" $ substantive n_f g +  where n_f p = (mk_nna (suff apa) (suff apas) (suff apan) (suff apans) (suff apor) (suff apors) +                        (suff aporna) (suff apornas)) p+        suff          = apply_suffixes s . connect s+        connect s end = concat [[(f,(':':e)),(f,('-':e)),(f,e)]  | (f,e@(_:_)) <- end] ++ (filter (null . snd) end)+++nnac :: Genus -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+nnac g (apa,apas,apan,apans,apor,apors,aporna,apornas) s = + replace_attr wp_attr w_attr $ replace_attr h_attr w_attr $ set_pos "nna" $ substantive n_f g +  where n_f p = (mk_nna (suff apa) (suff apas) (suff apan) (suff apans) (suff apor) (suff apors) +                        (suff aporna) (suff apornas)) p+        suff          = apply_suffixes s . connect s+        connect s end = concat [[(f,(':':e)),(f,e)]  | (f,e@(_:_)) <- end] ++ (filter (null . snd) end)++noun :: Genus -> [String] -> [String] -> [String] -> [String] -> (String -> Entry)+noun g apa apan apor aporna s = nounC g apa apan apor aporna apa s ++nounC :: Genus -> [String] -> [String] -> [String] -> [String] -> [String] -> (String -> Entry)+nounC g apa apan apor aporna ap s = substantive n_f g +  where n_f p = (mk_subst_v apa' apan' apor' aporna' ap') p+        suff    = (s ++)+        apa'    = map suff apa+	apan'   = map suff apan+        apor'   = map suff apor+	aporna' = map suff aporna+	ap'     = map suff ap+
+ src/dalin/NounRulesSw.hs view
@@ -0,0 +1,105 @@+----------------------------------------------------------------------+-- |+-- Module      : NounRulesSw+-- Maintainer  : Markus Forsberg+-- Stability   : (stability)+-- Portability : (portability)+--+--+-- Swedish noun functions+-------------------------------------------------------------------------+module NounRulesSw where++import GenRulesSw+import General+import TypesSw+import Char(isDigit)++type NSg    = String+type NSgD   = String +type NPl    = String+type NPlD   = String+type NComp  = String+type NDeriv = String ++-- General Noun functions++mk_substantive :: NSg -> NSgD -> NPl -> NPlD -> NComp -> NDeriv -> Substantive+mk_substantive apa apan apor aporna ap_comp ap_deriv = + variants (mk_substantive_v (lift apa) (lift apan) (lift apor) +                     (lift aporna) (lift ap_comp) (lift ap_comp) (lift ap_deriv)) [(MedComposite,strings (compound_s ap_comp))]++mk_substantive_comp :: NSg -> NSgD -> NPl -> NPlD -> NComp -> NComp -> NDeriv -> Substantive+mk_substantive_comp apa apan apor aporna ap_comp ap_comp2 ap_deriv a = +    mk_substantive_v (lift apa) (lift apan) (lift apor) +                     (lift aporna) (lift ap_comp) (lift ap_comp2) (lift ap_deriv) a++mk_substantive_v :: [NSg] -> [NSgD] -> [NPl] -> [NPlD] -> [NComp] -> [NComp] -> [NDeriv]-> Substantive+mk_substantive_v apa apan apor aporna ap_comp ap_comp2 ap_deriv a = +        case a of+          SF n s c -> strings $ mk_case_v c $ +                       case (n,s) of+                         (Sg,Indef) -> apa+                         (Sg,Def)   -> apan+                         (Pl,Indef) -> apor+                         (Pl,Def)   -> aporna+          InitComposite    -> strings ap_comp+          MedComposite     -> strings ap_comp2+          SMS              -> nonExist+          Deriv            -> strings ap_deriv++mk_nna :: [String] -> [String] -> [String] -> [String] ->+          [String] -> [String] -> [String] -> [String] -> Substantive+mk_nna apa apas apan apans apor apors aporna apornas a = strings $+        case a of+          SF n s c -> +                       case (n,s,c) of+                         (Sg,Indef,Nom) -> apa+                         (Sg,Indef,Gen) -> apas+                         (Sg,Def,Nom)   -> apan+                         (Sg,Def,Gen)   -> apans+                         (Pl,Indef,Nom) -> apor+                         (Pl,Indef,Gen) -> apors+                         (Pl,Def,Nom)   -> aporna+                         (Pl,Def,Gen)   -> apornas+          InitComposite   -> map (++ "-") apa+          MedComposite    -> map (++ "-") apa+          SMS             -> map (++ "-") apa+          Deriv           -> map (++ "-") apa++mk_subst :: NSg -> NSgD -> NPl -> NPlD -> Substantive+mk_subst bil bilen bilar bilarna = +    mk_substantive bil bilen bilar bilarna bil bil++mk_subst_v :: [NSg] -> [NSgD] -> [NPl] -> [NPlD] -> [NComp] -> Substantive+mk_subst_v bil bilen bilar bilarna bilc = +    variants (mk_substantive_v bil bilen bilar bilarna bilc bilc bilc) [(MedComposite,strings (concat (map compound_s bilc)))]++mk_case :: Casus -> String -> String+mk_case c [] = []+mk_case c s = case c of+  Nom                          -> s+  Gen | elem (last s) "sxzSXZ" -> s+  Gen | elem (last s) "?!" || isDigit (last s) -> s ++ ":s"+  Gen                          ->  s ++ "s"++mk_case_v :: Casus -> [String] -> [String]+mk_case_v c xs = concat $ map f (filter (not.null) xs)+  where f s = case c of+               Nom                                          -> [s]+               Gen | not (null s) && elem (last s) "sxzSXZ" -> [s]+               Gen | not (null s) && (elem (last s) "!?" || isDigit (last s)) -> [s ++ ":s",s++"-s"]+               Gen                                          -> [s ++ "s"]++hyphenate_compounds :: Substantive -> Substantive+hyphenate_compounds f = compvariants [w +? "-" | w <- unStr (f InitComposite)]+                                     [w +? "-" | w <- unStr (f MedComposite)] f++-- additional compound form+compvariants :: [NComp] -> [NComp] -> Substantive -> Substantive+compvariants compi compm f = variants f [+                              (InitComposite,strings compi),+                              (MedComposite,strings compm),+                              (SMS,strings [ x | x@(_:_) <- compi,last x=='-'])+                             ] +
+ src/dalin/OtherBuildSw.hs view
@@ -0,0 +1,207 @@+module OtherBuildSw where++import General+import Dictionary+import TypesSw+import RulesSw+import GenRulesSw++-- Proper names+{-+pm_m :: String -> String -> Entry+pm_m tax s = entryI (mk_pm s) [prValue MascGen,tax] ++pm_f :: String -> String -> Entry+pm_f tax s = entryI (mk_pm s) [prValue FemGen,tax] ++pm_f_alice :: String -> String -> Entry+pm_f_alice tax s = entryI (mk_pm_alice s) [prValue FemGen,tax] ++pm_h :: String -> String -> Entry+pm_h tax s = entryI (mk_pm s) [prValue Human,tax] ++pm_w :: String -> String -> Entry+pm_w tax s = entryI (mk_pm s) [prValue PNeutr,tax] ++pm_p :: String -> String -> Entry+pm_p tax s = entryI (mk_pm s) [prValue GPl,tax] ++pm_v :: String -> String -> Entry+pm_v tax s = entryI (mk_pm s) [prValue Pend,tax] ++pm_u :: String -> String -> Entry+pm_u tax s = entryI (mk_pm s) [prValue Utr,tax]++pm_n :: String -> String -> Entry+pm_n tax s = entryI (mk_pm s) [prValue Neutr,tax]++pma_n :: String -> String -> Entry+pma_n tax s = entryI (mk_pma s) [prValue Neutr,tax]++pma_u :: String -> String -> Entry+pma_u tax s = entryI (mk_pma s) [prValue Utr,tax]++pma_h :: String -> String -> Entry+pma_h tax s = entryI (mk_pma s) [prValue Human,tax]++pma_w :: String -> String -> Entry+pma_w tax s = entryI (mk_pma s) [prValue PNeutr,tax] ++pma_m :: String -> String -> Entry+pma_m tax s = entryI (mk_pma s) [prValue PNeutr,tax] ++-- multi-word proper names++pmm_n :: String -> String -> Entry+pmm_n tax s = entryI (mk_pmm0 (words s)) [prValue Neutr,tax]++pmm_u :: String -> String -> Entry+pmm_u tax s = entryI (mk_pmm0 (words s)) [prValue Utr,tax]++pmm_h :: String -> String -> Entry+pmm_h tax s = entryI (mk_pmm0 (words s)) [prValue Human,tax]++pmm_m :: String -> String -> Entry+pmm_m tax s = entryI (mk_pmm0 (words s)) [prValue MascGen,tax] ++pmm_f :: String -> String -> Entry+pmm_f tax s = entryI (mk_pmm0 (words s)) [prValue FemGen,tax] ++pmm_v :: String -> String -> Entry+pmm_v tax s = entryI (mk_pmm0 (words s)) [prValue Pend,tax] ++pmm_p :: String -> String -> Entry+pmm_p tax s = entryI (mk_pmm0 (words s)) [prValue GPl,tax] +++pmam_m :: String -> String -> Entry+pmam_m tax s = entryI (mk_pmam0 (words s)) [prValue MascGen,tax] ++pmam_n :: String -> String -> Entry+pmam_n tax s = entryI (mk_pmam0 (words s)) [prValue Neutr,tax] +-}+-- adverbs++ab_bort :: String -> Entry+ab_bort = entry . f+ where f s AdCompI = strings [s,s+?"-"]+       f s AdSMSI  = strings [s+?"-"]+       f s _       = strings [s]++ab_i_aldrig :: String -> Entry+ab_i_aldrig = entry . ab_i_no_comp++ab_främst :: String -> Entry+ab_främst = entry . abfrämst++ab_bra :: [String] -> [String] -> [String] -> Entry+ab_bra x y z = entry $ mk_adverb x y z++ab_fint :: String -> Entry+ab_fint = entry  . abfint++ab_1_fort = entry . abfort++abm_i_till_exempel :: String -> Entry+abm_i_till_exempel till_exempel = entry $ abm till_exempel++-- compounds ++compound :: String -> Entry+compound = entry . f+ where f s CMP  = strings [s, s+?"-"]+       f s CSMS = strings [s+?"-"]++-- pronouns++pn_jag :: (Person,Numerus) -> (Suffixes, Suffixes,Suffixes,Suffixes,Suffixes) -> String -> Entry+pn_jag (p,n) (a,b,c,d,e) s = entryI (mk_pron_jag (a,b,c,d,e) s) [prValue p, prValue n]++pn_nagon :: (Suffixes, Suffixes, Suffixes) -> String -> Entry+pn_nagon (a,b,c) s = entry $ mk_pron_nagon (a,b,c) s++pn_han :: (Person,Numerus) -> (Suffixes, Suffixes, Suffixes) -> String -> Entry+pn_han (p,n) (a,b,c) s = entryI (mk_pron_han (a,b,c) s) [prValue p, prValue n]++pn_vem :: (Suffixes, Suffixes, Suffixes) -> String -> Entry+pn_vem (a,b,c) s = entry (mk_pron_han (a,b,c) s)++pn_o_den :: String -> Entry+pn_o_den = entry . mk_pn_o_den++pn_dylik :: String -> Entry+pn_dylik = entry . mk_pron_dylik++pn_interrog_inv :: String -> Entry+pn_interrog_inv = entry . (const :: Str -> InterrogInvForm -> Str) . mkStr++pn_inv :: String -> Entry+pn_inv = entry . (const :: Str -> PronInvForm -> Str) . mkStr++pnm_inv :: String -> Entry+pnm_inv = entry . (const :: Str -> PronMInvForm -> Str) . mkStr++pnm_gen :: String -> Entry+pnm_gen = entry . f+ where f s (PronMCForm Nom) = mkStr $ s+       f s (PronMCForm Gen) = mkStr $ case words s of+                                        (x:xs) -> unwords (x +? "s":xs)++pnm_gen2 :: String -> Entry+pnm_gen2 = entry . f+ where f s (PronMCForm Nom) = mkStr $ s+       f s (PronMCForm Gen) = mkStr $ case reverse (words s) of+                                        (x:xs) -> unwords (reverse (x +? "s":xs))++-- numbers++number    ss = entry . mk_number ss++number_ng ss = entry . mk_number_ng ss++nl_n_1 = entry . nln1 ++-- invariant closed classes++interj :: String -> Entry+interj = entry . (const :: Str -> InterjForm -> Str) . mkStr++interjm :: String -> Entry+interjm aja_baja = set_pos "inm" $ interj (aja_baja)++conj :: String -> Entry+conj = entry . (const :: Str -> ConjForm -> Str) . mkStr++subj :: String -> Entry+subj = entry . (const :: Str -> SubForm -> Str) . mkStr++prep :: String -> Entry+prep = entry . (const :: Str -> PartForm -> Str) . mkStr++part :: String -> Entry+part = entry . (const :: Str -> PartForm -> Str) . mkStr++inf_mark :: String -> Entry+inf_mark = entry . (const :: Str -> InfMarkForm -> Str) . mkStr++invar :: String -> String -> Entry+invar pos = set_pos pos . entry . f+ where f s AdCompI = strings [s+?"-"]+       f s AdSMSI  = strings [s+?"-"]+       f s _       = strings [s]++-- abbreviations+aba_i_dvs :: String -> Entry+aba_i_dvs = entry . (const :: Str -> ABAForm -> Str) . mkStr++al_o_en :: String -> Entry+al_o_en den = + entry $ \(ArticleForm g s) -> strings $ +                              case (g,s) of+                                (ASgUtr,Indef)   -> ["en"]+                                (ASgNeutr,Indef) -> ["ett"]+                                (APl,Indef)       -> ["ena"]+                                (ASgUtr,Def)   -> ["den"]+                                (ASgNeutr,Def) -> ["det"]+                                (APl,Def)      -> ["de","dom"]+
+ src/dalin/OtherRulesSw.hs view
@@ -0,0 +1,192 @@+----------------------------------------------------------------------+-- |+-- Module      : OtherRulesSw+-- Maintainer  : Markus Forsberg+-- Stability   : (stability)+-- Portability : (portability)+--+--+-------------------------------------------------------------------------+module OtherRulesSw where++import GenRulesSw+import General  +import TypesSw  +import AdjRulesSw(av1blek)+import NounRulesSw(mk_case,mk_case_v)++-- adverbs++no_comp :: Adverb -> Adverb+no_comp f = missing f [AdComp, AdSMS]++mk_adverb :: [String] -> [String] -> [String] -> Adverb+mk_adverb bra battre bast af = strings $+   case af of+    (AdverbForm Posit)  -> bra+    (AdverbForm Compar) -> battre+    (AdverbForm Superl) -> bast+    AdComp              -> concat [[x,x +? "-"] | x <- bra]+    AdSMS               -> [x +? "-" | x <- bra]++abfrämst :: String -> Adverb+abfrämst främst = no_comp $ mk_adverb [] [] [främst]++abfint :: String -> Adverb+abfint = adjective_to_adverb . av1blek . tk 1++abfort fort = mk_adverb [fort] [fort +? "are"] [fort +? "ast"]+++adjective_to_adverb :: Adjective -> Adverb+adjective_to_adverb adj =  +    giveValues  [adj (AF p Nom) | p <- [Pos (Strong (ASgNeutr)), +                                        Comp, Super SupStrong]]++ab_i_no_comp :: String -> AdverbInv+ab_i_no_comp s AdverbInvForm = mkStr s+ab_i_no_comp s _             = nonExist++abm :: String -> AdverbMInv+abm till_exempel _ = mkStr $ till_exempel++-- pronouns++mk_pron_jag :: (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> String -> PronPN+mk_pron_jag (jag,mig,min,mitt,mina) s c = strings $ case c of+  PNom            -> suff jag+  PAcc            -> suff mig+  PGen (ASgUtr)   -> suff min+  PGen (ASgNeutr) -> suff mitt+  PGen APl        -> suff mina+-- map (++ "a") min + where suff = apply_suffixes s++-- pron_refl = mk_pron_jag [] "sig" "sin" "sitt" `missing` [PNom]++mk_pron_han :: (Suffixes, Suffixes, Suffixes) -> String -> PronPN+mk_pron_han (han, honom, hans) s c = strings $ case c of+  PNom   -> suff han+  PAcc   -> suff honom+  PGen _ -> suff hans+ where suff = apply_suffixes s++mk_pron_nagon :: (Suffixes,Suffixes,Suffixes) -> String -> PronAdj+mk_pron_nagon (nagon,nagot,nagra) s (AP gn c) = strings $ map (mk_case c) $+    case gn of+     ASgUtr   -> suff nagon+     ASgNeutr -> suff nagot+     APl      -> suff nagra+ where suff = apply_suffixes s++mk_pn_o_den :: String -> PronAdj+mk_pn_o_den den (AP gn c) = strings $ +    case (gn,c) of+     (ASgUtr,Nom)   -> [den]+     (ASgUtr,Gen)   -> [den++"s", de++"ss"] +     (ASgNeutr,Nom) -> [de++"t"]+     (ASgNeutr,Gen) -> [de++"ss"]+     _               -> []+ where de = tk 1 den++mk_pron_dylik :: String -> PronAdj+mk_pron_dylik = mk_pron_nagon ([e ""], [e "t"], [e "a"])++-- proper names++mk_pm :: String -> (PNForm -> Str)+mk_pm s (PNForm c) = strings $ mk_case_v c [s]++mk_pm_alice :: String -> (PNForm -> Str)+mk_pm_alice s (PNForm Nom) = strings $ [s]+mk_pm_alice s (PNForm Gen) = strings $ [s,s +? "s"]++mk_pma :: String -> (PNAForm -> Str)+mk_pma s (PNAForm c) = strings $ mk_ccase c s++mk_ccase c s = case c of +                Nom -> [s]+                Gen | elem (last s) "sxzSXZ" -> [s]+                _   -> [s ++ "-s",s ++ ":s",s++"s"]++mk_pmm0 :: [String] -> (PNMForm -> Str)+mk_pmm0 xs (PNMForm c) = strings [unwords ((init xs) ++ [r]) | r <- mk_case_v c [last xs]]++mk_pmam0 :: [String] -> (PNMForm -> Str)+mk_pmam0 xs (PNMForm c) =  strings [unwords ((init xs) ++ [g]) | g <- (mk_ccase c (last xs))]++mk_number :: (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> String -> Number+mk_number (en,ett,första,förste,en_c) s (NumC) =+ let xs = apply_suffixes s en_c in +     strings $ xs ++ [x ++ "-" | x <- xs]+mk_number (en,ett,första,förste,en_c) s (NumF c o) = +  strings $ map (mk_case c) $ case o of+   Numeral         -> apply_suffixes s en+   NumeralN        -> apply_suffixes s ett+   Ordinal NoMasc  -> apply_suffixes s första+   Ordinal Sex_Masc -> apply_suffixes s förste++nln1 :: String -> Number+nln1 x1 (NumC) = mkStr [] +nln1 x1 (NumF c o) = +  mkStr $ case (o,c) of+   (Ordinal NoMasc,Nom)  -> x1 ++ ":a" +   (Ordinal NoMasc,Gen)  -> x1 ++ ":as"+   (Ordinal Sex_Masc,Nom)    -> x1 ++ ":es" +   (Ordinal Sex_Masc,Gen)    -> x1 ++ ":es" +   (_,Nom)               -> x1+   (_,Gen)               -> x1 ++ ":s"++mk_number_ng :: (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> String -> Number+mk_number_ng suffs s = missing (mk_number suffs s) [NumF Gen o | o <- values]++{-+mk_number :: String -> String -> Number+mk_number tre tredje (NumF c o) = +  mkStr $ mk_case c $ case o of+   Ordinal -> tredje+   Numeral -> tre++mk_numeral :: String -> Number+mk_numeral tre = mk_number tre []++inv_numeral :: String -> Number+inv_numeral s = missing (mk_numeral s) [NumF Gen Numeral]++inv_ordinal :: String -> Number+inv_ordinal s = missing (mk_ordinal s) [NumF Gen Ordinal]+  +mk_ordinal :: String -> Number+mk_ordinal tredje = mk_number [] tredje++nrtretton :: String -> Number+nrtretton tretton = mk_number tretton (tretton++"de")++nrtrettio :: String -> Number+nrtrettio trettio = mk_number trettio (trettio++"nde")++nrandra :: String -> Number+nrandra andra = variant (mk_number [] andra)+                 [(NumF Nom Ordinal, andre),  +                 (NumF Gen Ordinal, andre++"s")]+    where andre = tk 1 andra ++ "e"++nrfemte :: String -> Number+nrfemte femte = mk_number [] femte++nriii :: String -> Number+nriii iii (NumF Nom Numeral) = mkStr iii+nriii _   _                  = nonExist+-}++-- auxiliary verbs++aux_verb_gen :: Str -> Str -> Str -> Str -> AuxVerb+aux_verb_gen vilja vill ville velat = +    giveValues [vilja, vill, ville, velat]++aux_verb :: String -> String -> String -> String -> AuxVerb+aux_verb vilja vill ville velat = +    giveValues $ map mkStr [vilja, vill, ville, velat]++
+ src/dalin/PrintSw.hs view
@@ -0,0 +1,112 @@+module PrintSw where++import List(intersperse,nub,inits)+import Util+import Dictionary+import General+import Char+import Data.Bits ((.&.))++print_table = [("multi",multi_printer),("rdf_sb",prRDF_sb),("flat_xml",prFlatXML)]++-- | Print JSON+multi_printer :: Dictionary -> String+multi_printer = concat . nub . concat . map prOne . filter is_multi. unDict+ where prOne  (id,stem,para,cat,inhs,tbl,_) = +           [conc [p "word" x, p "head" stem, p "pos" cat, p "param" "frag", pl "inhs" inhs, p "id" id, p "p" para, p "attr" (show attr)] |  (a,(attr,s)) <- (merge tbl), str <- unStr s, length (words str) > 1, x <- map unwords $ gen (words str)]+       merge            [] = []+       merge           [x] = [x]+       merge (x@(param1,(a,s)):y@(param2,(a',s1)):xs) = +           case (number param1, number param2) of+             ((v,n1,n2),(v',n1',n2')) | v == v' && n1' > n1 -> merge ((param2,(a',mkStr (unwords (unStr s ++ unStr s1)))):xs)+             _ -> x:merge (y:xs)+       number p = case map (map (read :: String -> Int) . words . map f) (filter (isDigit.head) (words p)) of+                    [[v1,n1,n2]] -> (v1,n1,n2)+       f x+         | elem x "-:" = ' ' +         | otherwise = x+       gen :: [String] -> [[String]]+       gen []     =  []+       gen (x:xs) =  filter (\xs -> not (null xs || one xs)) (inits (x:xs)) ++ gen xs+       one [_] = True+       one _ = False+       pl s []   = quote s ++ ":" ++ "[]"+       pl s xs   = quote s ++ ":[" ++ (concat (intersperse "," (map quote xs))) ++"]"+       p s1 s2 = quote s1 ++ ":" ++ quote s2+       conc xs = '{':(concat (intersperse "," xs)) ++ "}\n"+       is_multi (_,stem,para,cat,_,_,_) = length (words stem) > 1++-- | Print RDF+prRDF_sb :: Dictionary -> String+prRDF_sb d =  unlines [+  "<?xml version='1.0' encoding='UTF-8'?>",+  "<rdf:RDF",+  "  xmlns=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"",+  "  xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"",+  "  xmlns:sb=\"http://spraakbanken.gu.se/saldo#\">",+  (concat (map pr (unDict d))),+  "</rdf:RDF>"]+ where+ pr (id,stem,para,cat,inhs,tbl,extr) =  +     concat +         [+          "   <rdf:Description rdf:about=\"http://spraakbanken.gu.se/saldo/lemma/" ++ id ++ "\">\n",+          "    <rdf:type rdf:resource=\"http://spraakbanken.gu.se/ns/saldo/lemma\"/>\n",+          "    <sb:cf>"  ++ amp stem ++ "</sb:cf>\n",+          "    <sb:p>" ++ para ++ "</sb:p>\n",+          "    <sb:pos>"   ++ cat ++ "</sb:pos>\n",+          concat ["    <sb:inhs>"  ++ i ++ "</sb:inhs>\n" | i <- inhs] ++ "   </rdf:Description>\n",+          concat [unlines ["   <rdf:Description rdf:about=\"http://spraakbanken.gu.se/saldo/lemma/" ++ id ++ "#" ++ (urlEncode p) ++ "\">",+                           "    <rdf:type rdf:resource=\"http://spraakbanken.gu.se/ns/saldo/msd\"/>",+          "    <sb:id rdf:resource=\"http://spraakbanken.gu.se/saldo/lemma/" ++ id ++ "\"/>",+          "    <sb:msd>" ++ p ++ "</sb:msd>",+          concat (intersperse "\n" ["    <sb:wf>" ++ (amp w) ++ "</sb:wf>" | w <- unStr ws]),+          "   </rdf:Description>"] | (p,(_,ws)) <- tbl, not (null (unStr ws))]+          ]+++-- | Print RDF+prFlatXML :: Dictionary -> String+prFlatXML d =  unlines [+  "<?xml version='1.0' encoding='UTF-8'?>",+  "<!-- $Id$ -->",+  "<Lexicon>",+  (concat (map pr (unDict d))),+  "</Lexicon>"]+ where+ pr (id,stem,para,cat,inhs,tbl,extr) =  +     concat +         [+          "   <LexicalEntry>\n",+          "    <eid>" ++ id ++ "</eid>\n",+          "    <gf>"  ++ amp stem ++ "</gf>\n",+          "    <p>" ++ para ++ "</p>\n",+          "    <pos>"   ++ cat ++ "</pos>\n",+          "    <inhs>" ++ (unwords inhs) ++ "</inhs>\n",+          "    <table>\n",+          concat (intersperse "\n" ["     <form><param>" ++ p ++ "</param><wf>" ++ (amp w) ++ "</wf></form>" | (p,(_,ws)) <- tbl, w <- unStr ws]),+          "\n    </table>\n",+          "   </LexicalEntry>\n"+          ]++ -- copied from Module :  HTTP+ -- Copyright :  (c) Warrick Gray 2002+ -- License   :  BSD+amp = concat . map (\c -> if c == '&' then "&amp;" else [c])+urlEncode (h:t) =+     let str = if reserved (ord h) then escape h else [h]+     in str ++ urlEncode t+urlEncode [] = []+reserved x+     | x >= ord 'a' && x <= ord 'z' = False+     | x >= ord 'A' && x <= ord 'Z' = False+     | x >= ord '0' && x <= ord '9' = False+     | x <= 0x20 || x >= 0x7F = True+     | otherwise = x `elem` map ord [';','/','?',':','@','&'+                                    ,'=','+',',','$','{','}'+                                    ,'|','\\','^','[',']','`'+                                    ,'<','>','#','%','"']+escape x = +     let y = ord x +      in [ '%', intToDigit ((y `div` 16) .&. 0xf), intToDigit (y .&. 0xf) ]+
+ src/dalin/RulesSw.hs view
@@ -0,0 +1,11 @@+module RulesSw (+                module NounRulesSw, +                module VerbRulesSw,+                module AdjRulesSw,+                module OtherRulesSw+                ) where++import NounRulesSw+import VerbRulesSw+import AdjRulesSw+import OtherRulesSw
+ src/dalin/TestGenSw.hs view
@@ -0,0 +1,134 @@+module TestGenSw where++import List+import Frontend+import Char+import Maybe++is_a_word  = isJust . tword++not_a_word = not . isJust . tword++p_pos t = takeWhile (/='_') (tpara t)++p_annotation t =  +    case dropWhile (/='_') (tpara t) of+      (_:xs) -> takeWhile (/='_') xs++p_word t = case dropWhile (/='_') (tpara t) of+             (_:xs) -> case dropWhile (/='_') xs of+                         (_:ys) -> map f ys+ where f '_' = ' '+       f x   = x++id_pos   t = f (tid t)+ where f [] = error "invalid id: " ++ (tid t)+       f ('.':'.':'.':xs) = f ('.':'.':xs)+       f ('.':'.':xs)     = takeWhile (/='.') xs+       f (x:xs) = f xs ++id_lemma t = f (tid t)+ where f [] = error "invalid id: " ++ (tid t)+       f ('.':'.':'.':xs) = '.':f ('.':'.':xs)+       f ('.':'.':xs)     = []+       f (x:xs)           = x : f xs ++norm_id_lemma t = remove_number $ reverse $ i+  where i = id_lemma t+        remove_number (x:xs) +         | isDigit x = case dropWhile isDigit xs of+                         ('_':zs@(_:_)) -> reverse zs+                         _              -> i+         | otherwise = i++head_to_lemma_id = add_underscore . symbols . unspace . thead+ where unspace s = [if (x == ' ') then '_' else x | x <- s]+       symbols = concat . map tr+       add_underscore (x:xs)+        | isDigit x || elem x "-·" = ('_':x:xs)+        | otherwise = (x:xs)+       tr c = maybe [c] id $ lookup c +               [('&',"·26"),(':',"·3A"), ('\'',"·27"), ('/',"·2F"), ('+',"·2B"), +                (',',"·2C"),('°',"·B0"), ('%',"·25"),('=',"·3D"),('?',"·3F")] ++is_multi_word t = length pos > 2 && last pos == 'm' + where pos = tcat t++is_abbr t = last (tcat t) == 'a'++is_vowel c = elem c "aeiouyåäöAEIOUYÅÄÖüÜàÀ"++is_consonant c = elem c "bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ"++traverse :: String -> (String -> Bool) -> Bool+traverse [] f = False+traverse s@(x:xs) f+ | f s       = True+ | otherwise = traverse xs f++member_str :: String -> String -> Bool+member_str pre s = traverse s (isPrefixOf pre)++decl :: TestInput -> Char -> Bool+decl t c+ | elem (tcat t) ["nn","nnm","nna"] =  (head (p_annotation t)) == c + | otherwise                        = False++conj :: TestInput -> Char -> Bool+conj t c+ | elem (tcat t) ["vb","vbm","vba"] =  (head (p_annotation t)) == c + | otherwise                        = False++param :: TestInput -> [String] -> Bool+param t xs = and [elem x (tparam t) | x <- xs]++is_no_plural :: TestInput -> Bool+is_no_plural t + | elem (tcat t) ["nn","nnm","nna"] = case (p_annotation t) of+                                        ('0':_) -> True+                                        _       -> False+ | otherwise      = False++gender :: TestInput -> Char -> Bool+gender t c+ | elem (tcat t) ["nn","nnm","nna"] = case p_annotation t of+                                        (_:x:_) -> c == x+ | otherwise                        = False++is_no_komp :: TestInput -> Bool+is_no_komp t+ | elem (tcat t) ["av","avm","ava"] = case dropWhile (/='_') (tpara t) of+                      (_:'0':'_':_) -> True+                      _             -> False+ | otherwise      = False++is_komp :: TestInput -> Bool+is_komp t+ | elem (tcat t) ["av","avm","ava"] = +     case dropWhile (/='_') (tpara t) of+       (_:x:_) | elem x "12v" -> True+       _                        -> False+ | otherwise      = False++is_no_pret_part :: TestInput -> Bool+is_no_pret_part t + | tcat t == "vb" = case p_annotation t of+                      (_:'m':_) -> True+                      _       -> False+ | otherwise      = False++is_verb_sd :: TestInput -> Bool+is_verb_sd t + | tcat t == "vb" = case p_annotation t of+                      (_:'s':_) -> True+                      (_:'d':_) -> True+                      _       -> False+ | otherwise      = False++is_pret_part :: TestInput -> Bool+is_pret_part t + | tcat t == "vb" = case p_annotation t of+                      (_:'a':_) -> True+                      _         -> False+ | otherwise      = False+
+ src/dalin/TestSw.hs view
@@ -0,0 +1,284 @@+module TestSw where++import General+import List+import Frontend+import Char+import Maybe+import TestGenSw+import qualified Data.Set as Set++tests :: (PositiveTests, NegativeTests)+tests = (pos,neg)+ where + pos = pos_gen_rules ++ pos_noun_rules ++ pos_verb_rules ++ pos_adj_rules+ neg = neg_gen_rules ++ neg_noun_rules ++ neg_verb_rules ++ neg_adj_rules++-- General rules+pos_gen_rules = [--pos_id_para, multi_word, head_lemma,+                 paradigm_pos]++neg_gen_rules = [three_of_same, symbols, mmn,sms_missing_hyphen,end_with_h]++-- Is POS in lemma id = paradigm id?+pos_id_para :: TestInput -> Result+pos_id_para t + | not ( is_a_word t) = pass+ | p_pos t == id_pos t = pass+ | otherwise           = message t "lemma_id pos - paradigm pos mismatch"++-- Have the multi words more than one word?+multi_word :: TestInput -> Result+multi_word t+ | not (is_multi_word t)                             = pass+ | length (words (thead t)) > 1                      = pass+ | otherwise                                         = message t "singleton multi word"++--  Is head == lemma id head?+head_lemma :: TestInput -> Result+head_lemma t + | not ( is_a_word t) = pass+ | elem (tid t) ["SS_433..pmm.1"]                = pass+ | norm_id_lemma t == head_to_lemma_id t         = pass+ | otherwise                                     = message t "lemma_id_head - head mismatch"++-- paradigm pos == pos?+paradigm_pos :: TestInput -> Result+paradigm_pos t+ | not ( is_a_word t) = pass+ | p_pos t == tcat t = pass+ | otherwise = message t "paradigm_pos - pos mismatch"++-- every word, with some exceptions, should contain a vowel.+contains_vowel :: TestInput -> Result+contains_vowel t+  | is_abbr t || elem (tcat t) ["nl","in"]            = pass+  | length (thead t) <= 1                             = pass+  | or [is_vowel c | c <- w t] || null (w t)          = pass+  | otherwise                                         = message t "no vowel"++-- every word, with some exceptions, should contain a consonant.+contains_consonant :: TestInput -> Result+contains_consonant t+ | not ( is_a_word t) = pass+ | is_abbr t || (tcat t) == "nl"                = pass+ | length (thead t) <= 1                        = pass+  | or [is_consonant c | c <- w t] || null (w t) = pass+ | otherwise                                    = message t "no consonant"++-- not three of same.+three_of_same :: TestInput -> Result+three_of_same t+ | is_abbr t || (tcat t) == "nl" = pass+ | traverse (w t) +    $ \s -> (case s of +              (c:c1:c2:_) | (c == c1) && (c1 == c2) -> True+              _           -> False) = message t "three of same"+ | otherwise = pass++-- no consecutive symbols.+symbols :: TestInput -> Result+symbols t+ | elem (tid t) ["HCO3-..nna.1","OH-..nna.1","e-..nna.1"] = pass+ | traverse (w t) +   $ \s -> (case s of +             (c:c1:_) | c == c1 && elem c "-:\"+." -> True+             _        -> False) = message t "consecutive symbols"+ | otherwise = pass+++-- no mmn substring.+mmn :: TestInput -> Result+mmn t+ | member_str "mmn" (w t) = message t "mmn"+ | otherwise                         = pass++-- Noun Rules+pos_noun_rules = [--decl1,decl2,decl3,decl4,decl5,decl7,missing_noun_cases,+                  paradigm_gender]++neg_noun_rules = [decl0,no_sing, gender_d,medial_compound,gender_u,gender_n]++no_sing :: TestInput -> Result+no_sing t+ | is_a_word t && (tcat t == "nn" || tcat t == "nnm") && (gender t 'p' || gender t 'd') && param t ["sg"] = message t "invalid singular"+ | otherwise = pass+++plural_def :: TestInput -> Result+plural_def t + | gender t 'u' && elem '7' (tpara t) = pass+ | is_a_word t && (tcat t == "nn") && param t ["def","pl","nom"] && +   gender t 'u' && not (isSuffixOf "na" (w t)) = message t $ "invalid definite plural"+ | is_a_word t && (tcat t == "nn") && param t ["def","pl","nom"] && +   gender t 'n' && not (isSuffixOf "a" (w t) || isSuffixOf "en" (w t)) = message t $ "invalid definite plural"+ | is_a_word t && param t ["pl"] && (isSuffixOf "aor" (w t) || isSuffixOf "aorna" (w t)) = message t $ "invalid 'a'"+ -- | is_a_word t && param t ["pl"] && (isSuffixOf "ear" (w t) || isSuffixOf "earna" (w t)) = message t $ "invalid 'e'"+ | otherwise = pass++in_declension :: TestInput -> Char -> String -> Result+in_declension t c suff+ | is_a_word t && (tcat t == "nn") && decl t c && param t ["indef","pl","nom"] && not (isSuffixOf suff (w t)) = message t $ "invalid plural in declension " ++ [c]+ | otherwise = pass++not_in_declension :: TestInput -> Char -> [String] -> Result+not_in_declension t c xs+ | is_a_word t && (tcat t == "nn") && decl t c && param t xs = message t $ "invalid \"" ++ unwords xs ++ "\" in declension " ++ [c]+ | otherwise = pass++decl1 t = in_declension t '1' "or"+decl2 t = in_declension t '2' "ar"+decl3 t = in_declension t '3' "er"+decl4 t = in_declension t '4' "r"+decl5 t = in_declension t '5' "n"+decl7 t = in_declension t '7' "s"++decl0 t + | tcat t == "nn" = not_in_declension t '0' ["pl"]+ | otherwise      = pass++gender_d t+ | is_a_word t && gender t 'd' && not (param t ["pl","def"]) = message t  "gender 'd' implies pl def"+ | otherwise                                                 = pass++gender_u t+ | elem (tpara t) ["nn_0u_praxis", "nn_0u_samverkan"] = pass+ | last (tcat t) == 'm' = pass + | is_a_word t && gender t 'u' && (param t ["sg","def","nom"]) && (last (w t) == 't') = message t  " invalid sg def form"+ | otherwise                                                   =   pass+++gender_n t+ | elem (tpara t) ["nn_6n_deponens","nn_6n_aber","nn_3n_dominion","nn_0n_gluten","nn_0u_praxis","nn_0n_bitumen"] = pass+ | last (tcat t) == 'm' = pass + | is_a_word t && gender t 'n' && (param t ["sg","def","nom"]) && (last (w t) == 'n') = message t  " invalid sg def form"+ | otherwise                                                   =   pass+++medial_compound t +  | is_a_word t && param t ["cm"] &&  last (w t) == 's' && bad_medials (w t) = message t  "invalid binding s"+  | otherwise                                        = pass+ where bad_medials = f . reverse . take 2 . reverse . init+       f [_,'x'] = True+       f [_,'z'] = True+       f ['s',x] = is_consonant x+       f ['x',x] = is_consonant x+       f _       = False++sms_missing_hyphen t+ | is_a_word t && param t ["sms"] && not (last (w t) == '-') = message t "missing hyphen in sms"+ | otherwise                                                 = pass+++-- (x:y:_) | ((is_consonant x) && y == 's') || ((is_consonant x) && y == 'x') || [y,x] == "ch" || x=='x' || x =='z' -> []+-- decli t = not_in_declension t 'i' ["gen"]++missing_noun_cases :: TestInput -> Result+missing_noun_cases t+ -- | param t ["ci"] || param t ["cm"] = pass+  | elem (tpara t) ["nna_6n_kg","nn_6u_mat"] = pass +  | not_a_word t && (tcat t == "nn" || tcat t == "nna") &&  +    elem (head (p_annotation t)) "1234567" && (not (gender t 'p' || gender t 'd')) = message t "missing noun case"+  | otherwise                                = pass++paradigm_gender :: TestInput -> Result+paradigm_gender t+ | elem (tcat t) ["nn","nna","nnm"] = if gender t (head (head (tinhs t))) then pass else message t "paradigm gender-gender mismatch"+ | otherwise = pass++--- Verb Rules+pos_verb_rules = [conj1, conj2, conj3, pret_part,konj]+neg_verb_rules = [no_pret_part, deponens,mms,end_with_h,konj_e, konj_2_es]++in_conjugation :: TestInput -> Char -> String -> String -> Result+in_conjugation t c suff suff2+ | is_a_word t && (tcat t == "vb") && conj t c && param t ["pres","ind","aktiv"] && not (isSuffixOf suff (w t))  = message t $ "invalid ending in conjugation " ++ [c]+ | is_a_word t && (tcat t == "vb") && conj t c && param t ["pret","ind","aktiv"] && not (isSuffixOf suff2 (w t)) = message t $ "invalid ending in conjugation " ++ [c]+ | otherwise = pass++conj1 t = in_conjugation t '1' "ar" "ade"+conj2 t + | elem (tid t) ["tåla..vb.1","må..vb.2"] = pass+ | otherwise = in_conjugation t '2' "r"  ""+conj3 t = in_conjugation t '3' "r"  "de"+conj4 t = in_conjugation t '4' "er" ""++konj :: TestInput -> Result+konj t+ | not_a_word t && tcat t == "vb" && (conj t '4' || conj t 'v') && param t ["konj", "aktiv"] && not (is_verb_sd t) = message t "missing konj"+ | otherwise                            = pass++konj_e :: TestInput -> Result+konj_e t+ | is_a_word t &&  tcat t == "vb" && param t ["konj", "aktiv"]  && (last (w t) /= 'e') = message t "missing 'e' on konj"+ | otherwise                            = pass++end_with_h :: TestInput -> Result+end_with_h t+ | is_a_word t && tcat t == "vb" &&  elem (dp 2 (w t)) ["ch","sh"] = pass+ | is_a_word t && tcat t == "vb" && last (w t) == 'h' = message t "word ending with h"+ | otherwise                        = pass++konj_2_es :: TestInput -> Result+konj_2_es t+ | is_a_word t && tcat t == "vb" && conj t '2' && (param t ["s-form","pres"]) && +   ((dp 2 (w t)) /= "es") && (dp 1 (tk 1 (thead t)) == "s") = message t "s-form not ending with 'es' in conj. 2"+ | otherwise                        = pass++deponens t + | param t ["pret_part"] || param t ["pres_part"] || param t ["imper"] = pass+ | is_a_word t && tcat t == "vb" = case p_annotation t of+                     (_:'s':_) | not (param t ["s-form"]) -> message t $ "invalid deponent"+                     _ -> pass+ | otherwise = pass++is_deponens t =  case p_annotation t of+                   (_:'s':_) -> True+                   _        -> False++no_pret_part :: TestInput -> Result+no_pret_part t+ | is_a_word t && is_no_pret_part t && param t ["pret_part"]  = message t "invalid participle"+ | otherwise = pass++pret_part :: TestInput -> Result+pret_part t+ | not_a_word t && is_pret_part t && param t ["pret_part"] = message t "missing participle"+ | otherwise = pass++vbm_paradigm :: TestInput -> Result+vbm_paradigm t+ | tcat t == "vbm" = +     case p_annotation t of+       (x:y:a:_) | elem x "01234ov" && elem y "asmd" && elem a "pldztq" -> pass+       _ -> message t "invalid vbm paradigm identifier"+ | otherwise = pass++-- no mms suffix.+mms :: TestInput -> Result+mms t+ | (tcat t == "vb") && isSuffixOf "mms" (w t) = message t "mms suffix"+ | otherwise                                  = pass++-- Adjective Rules+pos_adj_rules = [komp]+neg_adj_rules = [no_komp,no_genitive_avm]++no_komp :: TestInput -> Result+no_komp t+ | is_a_word t && is_no_komp t && not (null [x | x <- (tparam t), elem x ["komp","super"]]) = message t "invalid comparative"+ | otherwise                            = pass++komp :: TestInput -> Result+komp t+ | elem (tpara t) ["avm_1p1_bred","avm_1p1_akut"] && param t ["gen"] = pass+ | not_a_word t && is_komp t && not (null [x | x <- (tparam t), elem x ["komp","super"]]) = message t "missing comparative"+ | otherwise                            = pass++no_genitive_avm :: TestInput -> Result+no_genitive_avm t+ | is_a_word t && tcat t == "avm" = +     case p_annotation t of+       (_:'p':_) | elem "gen" (tparam t) -> message t "invalid genitive"+       _ -> pass+ | otherwise = pass
+ src/dalin/TypesSw.hs view
@@ -0,0 +1,686 @@+module TypesSw where++import General+import Dictionary+import Attr++-- parameter types for Swedish morphology++-- enumerated parameter types++data Genus = Fem | Masc | Neutr+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Numerus = Sg | Pl+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Species = Indef | Def+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Casus = Nom | Gen+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Sex = NoMasc | Sex_Masc+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Modus = Ind | Conj+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Vox = Act | SForm+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Grade = Posit | Compar | Superl+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Person = P1 | P2 | P3+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Person2 = P22 | P23+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param Genus where +    values = enum+    prValue g  = case g of+                     Fem     -> "f"+                     Masc    -> "m"+                     Neutr   -> "n"++instance Param Numerus where +    values = enum+    prValue Sg = "sg"+    prValue Pl = "pl"+instance Param Species where +    values = enum+    prValue Indef = "indef"+    prValue Def   = "def"+instance Param Casus   where +    values = enum+    prValue Nom = "nom"+    prValue Gen = "gen"+instance Param Sex     where +    values = enum+    prValue NoMasc   = "no_masc"+    prValue Sex_Masc = "masc"+instance Param Modus   where +    values = enum+    prValue Ind = "ind"+    prValue Conj = "konj"+instance Param Vox     where +    values = enum+    prValue Act   = "aktiv"+    prValue SForm = "s-form"+instance Param Grade   where +    values = enum+    prValue Posit = "pos"+    prValue Compar = "komp"+    prValue Superl = "super"+instance Param Person  where +    values = enum+    prValue P1 = "p1"+    prValue P2 = "p2"+    prValue P3 = "p3"+instance Param Person2  where +    values = enum+    prValue P22 = "p2"+    prValue P23 = "p3"++--- would we need something more in Haskell?++-- real parameter types: mostly hierarchical++-- substantives (= common nouns)++type Substantive = SubstForm -> Str++data SubstForm = SF Numerus Species Casus | +                 InitComposite |+                 MedComposite  |+                 SMS           | +		 Deriv+                 deriving (Eq, Ord, Show, Read)++instance Param SubstForm +  where values = [SF a b c | a <- values, b <- values, c <- values]+                   -- ++ [InitComposite,MedComposite,SMS] -- Deriv removed+	prValue (SF a b c) = unwords [prValue a, prValue b, prValue c]+        prValue InitComposite = "ci"+        prValue MedComposite  = "cm"+        prValue SMS           = "sms"+	prValue Deriv         = "deriv"++--data SubstFormA = SFA Casus+--  deriving (Eq, Ord, Show, Read)++--instance Param SubstFormA where+-- values = [SFA c | c <- values]+-- prValue (SFA c) = prValue c++data SubstM = SFM SubstForm+  deriving (Eq, Ord, Show, Read)++instance Param SubstM where+ values = [SFM t | t <- values]+ prValue (SFM t) = prValue t+++-- Compound forms++data Compound = CMP | CSMS + deriving (Eq,Ord,Show,Read)++instance Param Compound where+ values = [CMP,CSMS]+ prValue CMP  = "c"+ prValue CSMS = "sms"++-- adjectives++type Adjective = AdjForm -> Str++data GenNum = ASgUtr   |+              ASgNeutr |+              APl+  deriving (Eq, Ord, Show, Read,Enum,Bounded)++data SexNum = AxSg Sex | AxPl+  deriving (Eq, Ord, Show, Read)++data AdjFormPos =+    Strong GenNum+  | Weak   SexNum+  deriving (Eq, Ord, Show, Read)++data AdjFormSuper = SupStrong | SupWeak Sex+  deriving (Eq, Ord, Show, Read)++data AdjFormGrad =+    Pos    AdjFormPos+  | Comp  +  | Super  AdjFormSuper+  deriving (Eq, Ord, Show, Read)++data AdjForm = AF AdjFormGrad Casus | AdjComp | AdjSMS+  deriving (Eq, Ord, Show, Read)++data AdjM = AdjM AdjForm+  deriving (Eq, Ord, Show, Read)++instance Param AdjM where+ values = [AdjM t | t <- values]+ prValue (AdjM t) = prValue t++data AdjMInv = AdjMInv+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AdjMInv where+    values              = enum+    prValue (AdjMInv) = "invar"++instance Param GenNum where+  values = enum+  prValue (ASgUtr)   = "sg" ++ " " ++ prValue Fem+  prValue (ASgNeutr) = "sg" ++ " " ++ prValue Neutr+  prValue APl        = "pl"++instance Param SexNum where+  values = map AxSg values ++ [AxPl] -- needed for pronouns+  prValue (AxSg sex) = "sg" ++ " " ++ prValue sex+  prValue (AxPl)      = "pl"++instance Param AdjFormPos where +  values = map Strong values ++ map Weak values+  prValue (Strong gn) = "indef " ++ prValue gn+  prValue (Weak   sn) = "def " ++ prValue sn++instance Param AdjFormSuper where +    values = SupStrong : [SupWeak s | s <- values]+    prValue (SupStrong) = "indef"+    prValue (SupWeak s) = unwords ["def", prValue s]++instance Param AdjFormGrad where +  values = map Pos values ++ [Comp] ++ map Super values+  prValue (Pos adj) = "pos " ++ prValue adj+  prValue (Comp)    = "komp"+  prValue (Super adj) = "super " ++ prValue adj++instance Param AdjForm where +  values = [AF a c | a <- values, c <- values] -- ++ [AdjComp,AdjSMS]+  prValue (AF a c) = unwords [prValue a, prValue c]+  prValue (AdjComp) = "c"+  prValue (AdjSMS)  = "sms"++-- verbs++type Verb = VerbForm -> Str++data VFin = +   Pres Vox+ | PresPl Person Vox+ | Pret Vox+ | PretPl Person Vox+ | PresKonj Vox+ | PresKonjPl Person Vox+ | PretKonj Vox+ | Imper Person2 Vox+ | ImperPl Person Vox+  deriving (Eq, Ord, Show, Read)++data VInf =+   Inf Vox+ | Sup Vox+ | PtPres Casus+ | PtPret AdjFormPos Casus+  deriving (Eq, Ord, Show, Read)++data VerbForm = +   VF VFin+ | VI VInf+ | VComp+ | VSMS+  deriving (Eq, Ord, Show, Read)++instance Param VFin where+  values = [Pres v | v <- values] +++           [PresPl p v | p <- values, v <- values] +++           [Pret v | v <- values] +++           [PretPl p v | p <- values, v <- values] +++           [PresKonj v | v <- values] +++           [PresKonjPl p v | p <- values, v <- values] +++           [PretKonj v | v <- values] +++           [Imper p2 v | p2 <- values, v <- values] +++           [ImperPl p v | p <- values, v <- values]+  prValue (Pres v)         = unwords ["pres", "sg","ind", prValue v]+  prValue (PresPl p v)     = unwords ["pres","pl","ind",prValue p, prValue v]+  prValue (Pret v)         = unwords ["pret", "sg","ind",prValue v]+  prValue (PretPl p v)     = unwords ["pret","pl","ind",prValue p, prValue v]+  prValue (Imper p2 v)       = unwords ["imper","sg",prValue p2,prValue v]+  prValue (ImperPl p v)      = unwords ["imper","pl",prValue p, prValue v]+  prValue (PresKonj v)     = unwords ["pres","sg","konj",prValue v]+  prValue (PresKonjPl p v) = unwords ["pres","pl", "konj",prValue p, prValue v]+  prValue (PretKonj v)     = unwords ["pret","konj",prValue v]++instance Param VInf where+  values = map Inf values ++ map Sup values ++ map PtPres values ++ +           [PtPret a c | a <- values, c <- values]+  prValue (Inf v) = unwords ["inf", prValue v]+  prValue (Sup v) = unwords ["sup", prValue v]+  prValue (PtPres c)     = unwords ["pres_part",prValue c]+  prValue (PtPret adj c) = unwords ["pret_part",prValue adj, prValue c]++instance Param VerbForm where+  values = map VF values ++ map VI values -- ++ [VComp,VSMS]+  value0 = VI (Inf Act) -- to show the infinitive as dictionary form+  prValue (VF f) = prValue f+  prValue (VI f) = prValue f+  prValue (VComp) = "c"+  prValue (VSMS)  = "sms"++data VerbFormM = VM VerbForm+  deriving (Eq, Ord, Show, Read)++instance Param VerbFormM where+  values = map VM values +  value0 = VM value0 +  prValue (VM vf) = prValue vf++type VerbM = VerbFormM -> Str++comp_forms :: [VerbForm]+comp_forms = [VComp,VSMS]++passive_forms :: [VerbForm]+passive_forms = +  map VF ([Pres SForm, Pret SForm]) ++ +  map VI [Inf SForm, Sup SForm] -- ++ part_pret_forms ++ conj_forms++active_forms :: [VerbForm]+active_forms =+  map VF [Pres Act, Pret Act] ++ +  map VI [Inf Act, Sup Act] ++ part_pret_forms ++ conj_forms++part_pret_forms :: [VerbForm]+part_pret_forms = [VI (PtPret a c) | a <- values, c <- values]++part_pres_forms :: [VerbForm]+part_pres_forms = [VI (PtPres c) | c <- values] ++part_forms :: [VerbForm]+part_forms = part_pres_forms ++ part_pret_forms ++conj_forms :: [VerbForm]+conj_forms = [VF (PresKonj v) | v <- values] +++             [VF (PretKonj v) | v <- values]++positive_forms :: [AdjForm]+positive_forms = [AF (Pos a) c | a <- values, c <- values]++-- adverbs++type Adverb = AdverbForm -> Str++data AdverbForm = AdverbForm Grade | AdComp | AdSMS+  deriving (Eq, Ord, Show, Read)++instance Param AdverbForm where +			  values = [AdverbForm g | g <- values] -- ++ [AdComp,AdSMS]+			  prValue (AdverbForm g) = prValue g+                          prValue (AdComp)       = "c"+                          prValue (AdSMS)        = "sms"++-- invariant adverbs++type AdverbInv = AdverbInvForm -> Str++data AdverbInvForm = AdverbInvForm | AdCompI | AdSMSI+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AdverbInvForm where +			     values = [AdverbInvForm]+			     prValue AdverbInvForm = "invar"+                             prValue AdCompI = "c"+                             prValue AdSMSI = "sms"++type AdverbMInv = AdverbMInvForm -> Str++data AdverbMInvForm = AdverbMInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AdverbMInvForm where +			     values = enum+			     prValue _ = "invar"+++-- invariant adjectives++type AdjInv = AdjInvForm -> Str++data AdjInvForm = AdjInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AdjInvForm where +			     values = enum+			     prValue _ = "invar"++data AdjCompInvForm = AdjCompInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AdjCompInvForm where +			     values = enum+			     prValue _ = "komp"++-- invariant interrogative adverbs++type InterrogInv = InterrogInvForm -> Str++data InterrogInvForm = InterrogInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param InterrogInvForm where +			     values = enum+			     prValue _ = "invar"+++-------------------------------+-- closed classes -------------+-------------------------------++-- pronouns++type PronPN  = PronCasus   -> Str+type PronAdj = AdjPronForm -> Str++data PronCasus = PNom | PAcc | PGen GenNum+  deriving (Eq, Ord, Show, Read)++instance Param PronCasus where+  values = PNom : PAcc : map PGen values+  prValue (PNom) = "nom"+  prValue (PAcc) = "ack"+  prValue (PGen gn) = unwords ["poss", prValue gn]++data AdjPronForm = AP GenNum Casus+  deriving (Eq, Ord, Show, Read)++instance Param AdjPronForm where+  values = [AP g c | g <- values, c <- values]+  prValue (AP gn c) = unwords [prValue gn, prValue c]++type PronInv = PronInvForm -> Str++data PronInvForm = PronInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param PronInvForm where +			     values = enum+			     prValue _ = "invar"++data PronMInvForm = PronMInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param PronMInvForm where +			     values = enum+			     prValue _ = "invar"++data PronMCForm = PronMCForm Casus+ deriving (Eq, Ord, Show, Read)++instance Param PronMCForm where +    values = [PronMCForm c | c <- values]+    prValue (PronMCForm c) = prValue c++type Number = NumForm -> Str++data NumOrd = Ordinal Sex | Numeral | NumeralN+  deriving (Eq, Ord, Show, Read)++instance Param NumOrd where+    values = (Numeral:NumeralN:[Ordinal s | s <- values])+    prValue (Ordinal m) = unwords ["ord", prValue m]+    prValue Numeral     = unwords ["num", prValue Fem]+    prValue NumeralN    = unwords ["num", prValue Neutr]++data NumForm = NumF Casus NumOrd | NumC+ deriving (Eq, Ord, Show, Read)++instance Param NumForm where +  values = [NumF c o | c <- values, o <- values] ++ [NumC]+  prValue (NumF c o) = unwords [prValue c, prValue o]+  prValue (NumC) = "c"++-- invariant+data InterjForm = InterjForm +  deriving (Eq, Ord, Show, Read, Enum, Bounded)++type Interjection = InterjForm -> Str++instance Param InterjForm where +  values = enum+  prValue _ = "invar"++-- articles++type Article = ArticleForm -> Str++data ArticleForm = ArticleForm GenNum Species+ deriving(Eq,Ord,Show,Read)++instance Param ArticleForm where +   values = [ArticleForm g s | g <- values, s <- values]+   prValue (ArticleForm g s) = unwords [prValue g, prValue s]++-- auxiliary verbs++data AuxVerbForm = AuxInf | AuxPres | AuxPret | AuxSup +  deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AuxVerbForm where +    values = enum+    prValue (AuxInf)  = "inf"+    prValue (AuxPres) = "pres"+    prValue (AuxPret) = "pret"+    prValue (AuxSup)  = "sup"++type AuxVerb = AuxVerbForm -> Str++-- Prepositions++type Preposition = PrepForm -> Str++data PrepForm = PrepForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param PrepForm where +			values = enum+			prValue _ = "invar"++-- Conjunction++type Conjunction = ConjForm -> Str++data ConjForm = ConjForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param ConjForm where +			values = enum+			prValue _ = "invar"++-- Subjunction++type Subjunction = SubForm -> Str++data SubForm = SubForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param SubForm where +		       values = enum+		       prValue _ = "invar"++-- Particles++type Particle = PartForm -> Str++data PartForm = PartForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param PartForm where +			values = enum+			prValue _ = "invar"+		   +-- Infinitive mark+type InfMark = InfMarkForm -> Str++data InfMarkForm = InfMarkForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param InfMarkForm where +    values = enum+    prValue _ = "invar"++-- Proper Noun+type PN = PNForm -> Str++data PNForm = PNForm Casus+ deriving (Eq, Ord, Show, Read)++instance Param PNForm where +		      values = [PNForm c | c <- values]+		      prValue (PNForm c) = prValue c++data PNAForm = PNAForm Casus+ deriving (Eq, Ord, Show, Read)++instance Param PNAForm where +		      values = [PNAForm c | c <- values]+		      prValue (PNAForm c) = prValue c++data PNMForm = PNMForm Casus+ deriving (Eq, Ord, Show, Read)++instance Param PNMForm where +		      values = [PNMForm c | c <- values]+		      prValue (PNMForm c) = prValue c++-- Abbreviations+data ABAForm = ABAForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param ABAForm where +    values = enum+    prValue _ = "invar"++-- Dictionary instances+-- Part of Speech Declarations.+-- (Dict instances)+instance Dict SubstForm       where + category     _  = "nn"+ defaultAttr _ = h_attr+ attrException _ = [(InitComposite,init_attr),+                    (MedComposite,medial_attr),+                    (Deriv,d_attr)]++instance Dict Compound where + category     _  = "sxc"+ defaultAttr _ = c_attr+ attrException _ = [(CSMS,h_attr)]++instance Dict SubstM  where + category     _  = "nnm"+ defaultAttr _ = w_attr+ --attrException _ = [(SFM Composite,1), (SFM Deriv,2)]++-- instance Dict SubstFormA      where category _ = "nna"+instance Dict AdjForm         +    where category _ = "av"+          defaultAttr _ = w_attr+          attrException _ = [(AdjComp,c_attr),(AdjSMS,h_attr)]+instance Dict AdjM            +    where category _ = "avm"+          defaultAttr _ = w_attr+instance Dict AdjMInv         +    where category _ = "avm"+          defaultAttr _ = w_attr+instance Dict VerbForm        where +    category _ = "vb"+    dictword f = case unStr (f (VI (Inf Act))) of+                   (x:_) -> x+                   _     -> getDictWord f+    defaultAttr _ = h_attr+    attrException _ = [(VComp, c_attr),(VSMS,w_attr)]++instance Dict VerbFormM  +    where category _ = "vbm"+          defaultAttr _ = w_attr+instance Dict AdverbForm      +    where category _ = "ab"+          defaultAttr _ = h_attr+          attrException _ = [(AdComp,c_attr),(AdSMS,w_attr)]+instance Dict AdverbInvForm   +    where category _ = "ab"+          defaultAttr _ = h_attr+          attrException _ = [(AdCompI,c_attr),(AdSMSI,w_attr)]+instance Dict AdjInvForm      +    where category _ = "av"+          defaultAttr _ = h_attr+instance Dict AdjCompInvForm  +    where category _ = "av"+          defaultAttr _ = h_attr+instance Dict PronCasus       +    where category _  = "pn"+          defaultAttr _ = w_attr+instance Dict InterjForm      +    where category _  = "in"+          defaultAttr _ = w_attr+instance Dict ArticleForm     +    where category _  = "al"+          defaultAttr _ = w_attr+instance Dict AuxVerbForm     +    where category _  = "vb"+          defaultAttr _ = w_attr+instance Dict PrepForm        +    where category _  = "pr"+          defaultAttr _ = w_attr+instance Dict ConjForm        +    where category _  = "kn"+          defaultAttr _ = w_attr+instance Dict SubForm         +    where category _  = "sn"+          defaultAttr _ = w_attr+instance Dict PartForm        +    where category _  = "pp"+          defaultAttr _ = w_attr+instance Dict InfMarkForm     +    where category _  = "ie"+          defaultAttr _ = w_attr+instance Dict ABAForm         +    where category _  = "aba"+          defaultAttr _ = w_attr+instance Dict AdverbMInvForm  +    where category _  = "abm"+          defaultAttr _ = w_attr+instance Dict PNForm +    where category _  = "pm"+          defaultAttr _ = w_attr+instance Dict PNAForm         +    where category _  = "pma"+          defaultAttr _ = w_attr+instance Dict PNMForm         +    where category _  = "pmm"+          defaultAttr _ = w_attr+instance Dict PronMInvForm     +    where category _ = "pnm"+          defaultAttr _ = w_attr+instance Dict PronMCForm     +    where category _ = "pnm"+          defaultAttr _ = w_attr+instance Dict AdjPronForm     +    where category _  = "pn"+          defaultAttr _ = w_attr+instance Dict PronInvForm     +    where category _  = "pn"+          defaultAttr _ = w_attr+instance Dict NumForm         + where category _  = "nl"+       defaultAttr _ = w_attr+instance Dict InterrogInvForm +    where category _  = "pn" +          defaultAttr _ = w_attr
+ src/dalin/VerbBuildSw.hs view
@@ -0,0 +1,238 @@+module VerbBuildSw where++import General+import Dictionary+import TypesSw+import RulesSw+import GenRulesSw++verb :: Verb -> Entry+verb = entry ++verbM :: VerbM -> Entry+verbM = entry++verb_full :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_full n (finna, finne,finner, finn, fann, funne, funnit, funnen) w = + verb $ verb_prefixed n finna finner finne finn fann funne funnit funnen w ++verb_full_compound :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_full_compound n (finna, finne,finner, finn, fann, funne, funnit, funnen,finn_c) w = + verb $ verb_prefixed_compound n finna finner finne finn fann funne funnit funnen finn_c w ++verb_full_compound_sform_variant :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_full_compound_sform_variant n (finna, finne,finner, finn, fann, funne, funnit, funnen,finn_c) w = + verb $ ppvar n (verb_prefixed_compound n finna finner finne finn fann funne funnit funnen finn_c w) w ++verb_full_sform_variant :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_full_sform_variant n (finna, finne,finner, finn, fann, funne, funnit, funnen) w = + verb $ ppvar n (verb_prefixed n finna finner finne finn fann funne funnit funnen w) w++verb_full_no_sform :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_full_no_sform n (finna, finne,finner, finn, fann, funne, funnit, funnen) w = + verb $ no_passive $ verb_prefixed n finna finner finne finn fann funne funnit funnen w ++verb_weak :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_weak n (finna, finner, finn, fann, funnit, funnen) w = + verb $ verb_prefixed n finna finner [] finn fann [] funnit funnen w ++verb_weak_no_passive :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_weak_no_passive n (finna, finner, finn, fann, funnit, funnen) w = + verb $ no_vcomp $ no_part_pres $ no_passive $ verb_prefixed n finna finner [] finn fann [] funnit funnen w ++verb_weak_compound :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_weak_compound n (finna, finner, finn, fann, funnit, funnen,finn_c) w = + verb $ verb_prefixed_compound n finna finner [] finn fann [] funnit funnen finn_c w ++verb_weak_compound_sform_variant :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_weak_compound_sform_variant n (finna, finner, finn, fann, funnit, funnen,finn_c) w = + verb $ ppvar n (verb_prefixed_compound n finna finner [] finn fann [] funnit funnen finn_c w) w +++vbm_inf w = set_pos "vbm" $ verb $ only (vb1 w) [VI (Inf Act)]++verb_vbm n wfs w = (set_pos "vbm" . verb_weak_no_passive n wfs) w++verb_weak_no_sform :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_weak_no_sform n (finna, finner, finn, fann, funnit, funnen) w = + verb $ no_passive $ verb_prefixed n finna finner [] finn fann [] funnit funnen w ++verb_weak_sform_variant ::  Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_weak_sform_variant n (finna, finner, finn, fann, funnit, funnen) w = + verb $ ppvar n (verb_prefixed n finna finner [] finn fann [] funnit funnen w) w++--verb_wc :: Int -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> (String -> Entry)+--verb_wc n finna finner finn fann funnit funnen w = +-- verb $ verb_prefixed n (map e finna) (map e finner) []+--                        (map e finn) (map e fann)  []+--                        (map e funnit) (map e funnen) w++vbm_part :: Int -> (Suffixes,Suffixes) -> (String -> Entry)+vbm_part n (avbländande,avbländad) w =+   verb $ vbmpart n avbländande avbländad w++verb_dwc :: Int -> [String] -> [String] -> [String] -> [String] -> [String] -> (String -> Entry)+verb_dwc n finna finn fann funnit funnen w = + verb $ no_part_pres $ no_active $ verb_prefixed n (map e finna) [] [] +                                    (map e finn) (map e fann) [] +                                    (map e funnit) (map e funnen) w ++verb_deponens :: Int -> (Suffixes, Suffixes, Suffixes, Suffixes, Suffixes) -> (String -> Entry)+verb_deponens n (finna,finn,fann,funnit,funnen) w = + verb $ no_part_pres $ no_active $ verb_prefixed n finna [] [] finn fann [] funnit funnen w ++-- verbs :: [String] -> Verb -> [Entry]+-- verbs prefs v = map verb [\f -> strings (map (p ++) (unStr (v f))) | p <- prefs] +-- Conjugation 1++v1 :: String -> Entry+v1 = verb . vb1++-- Conjugation 2++v2 :: String -> Entry+v2 = verb . vb2++vb_2a_följa :: String -> Entry+vb_2a_följa  = verb . no_konj .vb2följa++vb_2a_sända :: String -> Entry+vb_2a_sända  = verb . no_konj .vb2sända++vb_2a_knäcka :: String -> Entry+vb_2a_knäcka = verb . no_konj .vb2knäcka++vb_2a_vända :: String -> Entry+vb_2a_vända  = verb . no_konj .vb2vända++vb_2a_dröja :: String -> Entry+vb_2a_dröja  = verb . no_konj .vb2dröja++vb_2a_göra :: String -> Entry+vb_2a_göra   = verb  . no_konj .vb2göra++-- Conjugation 3++v3 :: String -> Entry+v3 = verb . no_konj . vb3++vb_3a_klä :: String -> Entry+vb_3a_klä  = verb . no_konj . vb3klä++-- Conjugation 4++vb_4a_se :: String -> Entry+vb_4a_se    = verb  . vb4se++vb_4a_gå :: String -> Entry+vb_4a_gå    = verb  . vb4gå++vb_4a_bita :: String -> Entry+vb_4a_bita  = verb  . vb4bita++vb_4m_vina :: String -> Entry+vb_4m_vina  = verb  . vb4vina++vb_4a_krypa :: String -> Entry+vb_4a_krypa = verb  . vb4krypa++vb_4a_vinna :: String -> Entry+vb_4a_vinna = verb  . vb4vinna++vb_4a_giva :: String -> Entry+vb_4a_giva  = verb  . vb4giva++vb_4a_binda :: String -> Entry+vb_4a_binda = verb  . vb4binda++vb_4a_bliva :: String -> Entry+vb_4a_bliva = verb  . no_passive . vb4bliva++vb_4a_draga :: String -> Entry+vb_4a_draga = verb  . vb4draga++vb_4a_göra :: String -> Entry+vb_4a_göra  = verb  . vb4göra++vb_4m_stå :: String -> Entry+vb_4m_stå   = verb  . vb4stå++vb_4a_slå :: String -> Entry+vb_4a_slå   = verb  . vb4slå++vb_4a_ta :: String -> Entry+vb_4a_ta    = verb  . vb4taga++vb_4a_få :: String -> Entry+vb_4a_få    = verb  . vb4få++vb_4a_ha :: String -> Entry+vb_4a_ha    = verb  . vb4hava++vb_4a_vara :: String -> Entry+vb_4a_vara  = verb  . vb4vara++vb_4a_fara :: String -> Entry+vb_4a_fara  = verb  . vb4fara++vb_4a_komma :: String -> Entry+vb_4a_komma = verb  . vb4komma++vb_4a_äta :: String -> Entry+vb_4a_äta   = verb  . vb4äta++vb_4a_låta :: String -> Entry+vb_4a_låta  = verb  . vb4låta++vb_4a_falla :: String -> Entry+vb_4a_falla = verb  . vb4falla++vb_4a_supa :: String -> Entry+vb_4a_supa  = verb  . vb4supa++vb_4a_hålla :: String -> Entry+vb_4a_hålla = verb  . vb4hålla++-- deponent verbs++vb_1s_hoppas :: String -> Entry+vb_1s_hoppas   = verb . no_konj . vbdhoppas++vb_1s_lyckas :: String -> Entry+vb_1s_lyckas   = verb . no_konj . vbdlyckas++vb_1s_nalkas :: String -> Entry+vb_1s_nalkas   = verb . no_konj . vbdnalkas++vb_1s_färdas :: String -> Entry+vb_1s_färdas   = verb . no_konj . vbdfärdas++vb_2s_synas :: String -> Entry+vb_2s_synas    = verb . no_konj . vbdsynas++vb_4d_vederfås :: String -> Entry+vb_4d_vederfås = verb . no_konj . vbdvederfås++-- pending verbs++vb_va_koka :: String -> Entry+vb_va_koka   = verb . no_konj . vbvkoka ++vb_va_mista :: String -> Entry+vb_va_mista  = verb . no_konj . vbvmista+++-- vb_va_sprida = verb . no_konj . vbvsprida++vb_va_bringa :: String -> Entry+vb_va_bringa = verb . no_konj . vbvbringa++vb_va_tala :: String -> Entry+vb_va_tala   = verb . no_konj . vbvtala++-- verb phrases+--vbm1_p  v pr   = verbM $ \(VM p) -> mapStr (\s -> unwords [s,pr] ) ((vb1 v) p) +--vbm1_pr v pr r = verbM $ \(VM p) -> mapStr (\s -> unwords [s,pr,r] ) ((vb1 v) p)++vbm_dö_ut :: String -> Entry+vbm_dö_ut = verb . vbmdöut
+ src/dalin/VerbRulesSw.hs view
@@ -0,0 +1,396 @@+----------------------------------------------------------------------+-- |+-- Module      : VerbRulesSw+-- Maintainer  : Markus Forsberg+-- Stability   : (stability)+-- Portability : (portability)+--+--+-- Swedish verb functions+-------------------------------------------------------------------------++module VerbRulesSw where++import GenRulesSw+import NounRulesSw(mk_case)+import AdjRulesSw(mk_adj_pos)+import General+import TypesSw++infer_pret_part :: String -> AdjFormPos -> [String]+infer_pret_part bunden = mk_adj_pos [bunden] [bundet] [bundna] [bundna] where+  (bundet,bundna) = case reverse bunden of+    'd':'a':_ -> (fv (bunde) ++ "t",  bunden ++ "e")+    'n':'e':_ -> (bund  ++ "et", fv (ungeminate_m_n bund) ++ "na") -- fun-na, kom-na+    'd':'d':_ -> (fv (bund)  ++ "tt", bunden ++ "a") +    't':'t':_ -> (bunden,        bunden ++ "a")+    'd':_     -> (fv (bunde) ++ "t",  bunden ++ "a")+    _         -> (bunden,        bunden ++ "a")+  bunde = tk 1 bunden+  bund  = tk 2 bunden++ppvar :: Int -> Verb -> String -> Verb+ppvar n v s = variants_or_excepts v [(VF (Pres SForm), strings xs)]+ where ws = unStr (v (VF (Imper P22 Act)))+       variants_or_excepts = if all (=="s") (map (dp 1) ws) then excepts else variants+       xs  = [w ++ "es" | w <- ws, not (vow w || single_m w)]+       single_m x = case reverse x of+                      ('m':m:_) -> m /= 'm'+                      _         -> False+       vow [] = False+       vow w@(_:_) = is_vowel (last w) +++-- if (is_vowel (last (tk n s))) then [] else [e "es"]++mk_verb :: String -> String -> String -> String -> String -> String -> String -> String -> Verb+mk_verb finna finner finne finn fann funne funnit funnen = +    mk_verb_v (lift finna) (lift finner) (lift finne) (lift finn) (lift fann) (lift funne) +              (lift funnit) (lift funnen)++mk_verb_v :: [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> Verb+mk_verb_v finna finner finne finn fann funne funnit funnen = mk_verb_vc finna finner finne finn fann funne funnit funnen (map mk_verb_compound finna)++mk_verb_vc :: [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> Verb+mk_verb_vc finna finner finne finn fann funne funnit funnen finn_c = strings . mk_v where +  mk_v v = case v of+    VF (Pres Act)      -> finner+    VF (Pres SForm)    -> map (mk_vox SForm) finn+    VF (PresPl P1 v)   -> map (mk_vox v) finne+    VF (PresPl P2 v)   -> map (mk_vox v) [s++"n" | s <- finne]+    VF (PresPl P3 v)   -> map (mk_vox v) finna+    VF (Pret Act)      -> fann+    VF (Pret SForm)    -> map (mk_vox SForm) fann+    VF (PretPl P1 v)   -> map (mk_vox v) fann+    VF (PretPl P2 v)   -> map (mk_vox v) [s+?"en" | s <- fann]+    VF (PretPl P3 v)   -> map (mk_vox v) fann+    VF (Imper P22 v)      -> map (mk_vox v) finna+    VF (Imper P23 v)      -> map (mk_vox v) finne+    VF (ImperPl P1 v)     ->  map (mk_vox v) [(tk 1 s) ++ "om" | s <- finna]+    VF (ImperPl P2 v)     ->  map (mk_vox v) [(tk 1 s) ++ "en" | s <- finna]+    VF (ImperPl P3 v)     ->  map (mk_vox v) [(tk 1 s) ++ "e"  | s <- finna]+    VF (PresKonj v)      -> map (mk_vox v) finne+    VF (PresKonjPl P2 v)   -> map (mk_vox v) [s ++ "n" | s <- finne]+    VF (PresKonjPl _ v)    -> map (mk_vox v) finne+    VF (PretKonj v)      -> map (mk_vox v) funne+    VI (Inf v)           -> map (mk_vox v) finna+    VI (Sup v)           -> map (mk_vox v) funnit+    VI (PtPres c)        -> map (mk_case c) $+                             map (\s -> ifEndThen (=='a') s (s++"nde") (s++"ende")) finna+    VI (PtPret a c)      -> map (mk_case c) $ concat $ map (\s -> infer_pret_part s a) funnen+    VComp                -> finn_c ++ [x++"-" | x@(_:_) <- finn_c]+    VSMS                 -> [x++"-" | x@(_:_) <- finn_c]+++verb_prefixed :: Int -> Suffixes -> Suffixes -> Suffixes -> Suffixes -> +                        Suffixes -> Suffixes -> Suffixes -> Suffixes -> +                        String -> Verb+verb_prefixed n finna finner finne finn fann funne funnit funnen s = +  (mk_verb_v (suff finna) (suff finner) (suff finne) (suff finn) +             (suff fann)  (suff funne)  (suff funnit) (suff funnen))+  where suff = apply_suffixes (tk n s) -- map ((tk n s) ++)+++verb_prefixed_compound :: Int -> Suffixes -> Suffixes -> Suffixes -> Suffixes -> +                        Suffixes -> Suffixes -> Suffixes -> Suffixes -> Suffixes -> +                        String -> Verb+verb_prefixed_compound n finna finner finne finn fann funne funnit funnen finn_c s = +  (mk_verb_vc (suff finna) (suff finner) (suff finne) (suff finn) +             (suff fann)  (suff funne)  (suff funnit) (suff funnen) (suff finn_c))+  where suff = apply_suffixes (tk n s) -- map ((tk n s) ++)++vbmpart :: Int -> Suffixes -> Suffixes -> String -> Verb+vbmpart n avbländande avbländad blända_av v =+    case v of+    VI (PtPres c)   -> f c $  apply_suffixes (tk n avblända) avbländande+    VI (PtPret a c) -> f c $ concat $ map (\s -> infer_pret_part s a) $ apply_suffixes (tk n avblända) avbländad+    _                   -> nonExist+ where [blända,av] = words blända_av+       avblända    = triplecons av (head blända) ++ blända+       f c = strings . map (mk_case c)++mk_vox :: Vox -> String -> String+mk_vox v s = case v of+               Act   -> fv s+               SForm -> +                case ((remove_j . ungeminate) s) of +                  x | not_s x -> fv x ++ "s"+                  x           -> x +  where not_s [] = False+        not_s s = last s /= 's'++mk_verb_compound :: String -> String+mk_verb_compound w = case reverse w of+        ('a':lr:c:pre) | elem lr "lr" && c == 'm'       -> (reverse pre) ++ "mm" ++ "e" ++ [lr]+        ('a':lr:c:pre) | elem lr "lr" && is_consonant c && (lr /= c) -> (reverse pre) ++ (c:"e") ++ [lr]+        ('a':'m':'m':v:pre) | is_vowel v  -> (reverse pre) ++ (v:"m")+        ('a':'n':'n':v:pre) | is_vowel v  -> (reverse pre) ++ (v:"n")+        ('a':pre) | any is_vowel pre      -> fv (reverse pre)+        ('s':pre)                         -> []+        _                                 -> fv w++remove_j :: String -> String+remove_j s+ | is_j s = case tk 1 s of+              x | is_d x -> x+              _ -> s+ | otherwise       = s + where is_j [] = False+       is_j s = last s == 'j'+       is_d [] = False+       is_d s = last s == 'd'++pres_ind_passive :: String -> String -> [(VerbForm, Str)]+pres_ind_passive leka lek = [(VF (Pres SForm), strings (leks ++ lekes))] where+    lekes = [tk 1 leka ++ "es"] -- for glömmes (*glömes)+    leks  = if (dp 1 lek == "s") then [] else [((remove_j . ungeminate) lek) ++ "s"] ++pres_verb_er :: String -> String+pres_verb_er fara+  | a /= "a"                          = fara++"r"+  | a == "a" && elem (dp 1 far) ["r"] = far -- "l" removed, counter example: falla+  | otherwise                         = far ++ "er"+ where a   = dp 1 fara+       far = tk 1 fara++no_active :: Verb -> Verb+no_active v = v `missing` active_forms++no_passive :: Verb -> Verb+no_passive v = v `missing` passive_forms++no_part_pres :: Verb -> Verb+no_part_pres v = missing v part_pres_forms++no_part_pret :: Verb -> Verb+no_part_pret v = v `missing` part_pret_forms++no_konj :: Verb -> Verb+no_konj v = v `missing` conj_forms++no_vcomp :: Verb -> Verb+no_vcomp v = v `missing` comp_forms+++verb_irreg :: String -> String -> String -> String -> String -> Verb+verb_irreg finna finner fann funnit funnen = +    mk_verb finna finner finne finn fann (funn ++ "e") funnit funnen+      `excepts` if_a (pres_ind_passive finna finn) []+ where+   if_a a b = if dp 1 finna == "a" then a else b+   finn   = if_a (tk 1 finna) finna+   finne  = if_a (finn ++ "e") finn+   funn   = tk 2 funnit+   funna  = ungeminate funn +? "na"     ++verb_strong :: String -> String -> String -> Verb+verb_strong finna fann funnit = +    verb_irreg finna (pres_verb_er finna) fann funnit (tk 2 funnit ++ "en")++verb_short_long :: String -> Verb -> Verb+verb_short_long ge giva = +    giva `variant` +             ([(VF (Pres Act),  ge ++ "r"), +              (VF (Pres SForm), ge ++ "s"),+              (VF (Imper P22 Act),ge)] ++ +              [ (VI (Inf v),mk_vox v ge) | v <- values])++verb_strong_vowel :: String -> String -> String -> Verb+verb_strong_vowel a u finna = verb_strong finna fann funnit where+  (f,_,nn) = find_stem_vowel (tk 1 finna)+  fann     = ungeminate $ f ++ a ++ nn+  funnit   = f ++ u ++ nn ++ "it"++-- Conjugation 1++vb1 :: String -> Verb+vb1 hoppa =  mk_verb hoppa           (hoppa ++ "r")  (tk 1 hoppa ++ "e") hoppa +                     (hoppa ++ "de") (hoppa ++ "de") (hoppa ++ "t")      (hoppa ++ "d")++-- Conjugation 2++vb2 :: String -> Verb+vb2 leka = mk_verb leka  leker leke lek   lekde lekde lekt lekd `excepts` pres_ind_passive leka lek+ where+   stam  = tk 1 leka+   leke  = stam ++ "e"+   lek   = ungeminate stam+   lekd  = let lek = ungeminate_m_n stam in case reverse lek of+             t:v:b | elem t "dt" && not (is_vowel v) -> fv (lek)  -- sände  +             t:_   | is_voiced t -> fv (lek) ++ "d"+             _                   -> fv (lek) ++ "t" +   lekt  = let (dd,el) = span (=='d') (reverse lekd) in +             fv (reverse el) ++ replicate (length dd) 't' +   lekde = lekd ++ "e"+   leker = pres_verb_er leka++vb2följa  = vb2+vb2sända  = vb2+vb2knäcka = vb2+vb2vända  = vb2+vb2dröja  = vb2++vb2göra :: String -> Verb+vb2göra  göra = ppvar 1 (+    mk_verb göra gör (gör ++ "e") gör (gjor ++ "de") (gjor ++ "de") +            (gjor ++ "t") (gjor ++ "d")) göra+ where g = tk 3 göra+       gör   = tk 1 göra+       gjor = g ++ "jor"++-- Conjugation 3++vb3 :: String -> Verb+vb3 bo = mk_verb bo (bo ++ "r") [] bo (bo ++ "dde") (bo ++ "dde") (bo ++ "tt") (bo ++ "dd")++vb3klä = vb3++-- Conjugation 4++vb4krypa :: String -> Verb+vb4krypa s = ppvar 1 (verb_strong_vowel "ö" "y" s) s++vb4vinna :: String -> Verb+vb4vinna s = ppvar 1 (verb_strong_vowel "a" "u" s) s ++-- vbsitta = vbfinna++vb4falla :: String -> Verb+vb4falla s = ppvar 1 (verb_strong_vowel "ö" "a" s) s  ++vb4bita :: String -> Verb+vb4bita s = ppvar 1 (verb_strong_vowel "e" "i" s) s++vb4slå :: String -> Verb+vb4slå slå = (verb_strong slå (sl++"og") (sl++"agit"))+   where sl = tk 1 slå++vb4vina :: String -> Verb+vb4vina = no_part_pret . vb4bita++vb4supa :: String -> Verb+vb4supa  s = ppvar 1 (verb_strong_vowel "ö" "u" s) s++vb4komma :: String -> Verb+vb4komma s = ppvar 1 (verb_strong_vowel "o" "o" s) s++vb4fara :: String -> Verb+vb4fara s = ppvar 1 (verb_strong_vowel "o" "a" s) s++vb4låta :: String -> Verb+vb4låta s = ppvar 1 (verb_strong_vowel "ä" "å" s) s++vb4äta :: String -> Verb+vb4äta  s = ppvar 1 (verb_strong_vowel "å" "ä" s) s++vb4hålla :: String -> Verb+vb4hålla s = ppvar 1 (verb_strong_vowel "ö" "å" s) s++-- semi-productive paradigms++vb4giva :: String -> Verb+vb4giva s v = (tk 2 s) +* verb_short_long "ge" (verb_strong_vowel "a" "i" "giva") v++vb4bliva :: String -> Verb+vb4bliva s v = (tk 3 s) +* (verb_short_long (dp 3 s) (vb4bita ((dp 3 s) ++ "va")) `except`+                                                [(VF (Pret Act), (tk 1 (dp 3 s)) ++ "eve")]) v++vb4draga :: String -> Verb+vb4draga s v = (tk 3 s) +* verb_short_long "dra" (vb4fara "draga") v++vb4taga :: String -> Verb+vb4taga s v = ((\v -> (tk 2 s) +* ((verb_short_long (dp 2 s) (vb4fara (dp 2 s ++ "ga"))) v)) `except` +                                         ([(VF (Pret Act), tk  1 s ++ "oge"),(VF (Pret SForm),  tk 1 s ++ "oges")])) v++vb4binda :: String -> Verb+vb4binda s v = (tk 5 s) +* mk_verb "binda" "binder" "binda" "binda" "band" "band" "bundit" "bunden" v++vb4se :: String -> Verb+vb4se s v = (tk 2 s) +* mk_verb "se" "ser" "se" "se" "såg" "såg" "sett" "sedd" v++vb4gå :: String -> Verb+vb4gå s v = (tk 2 s) +* mk_verb "gå" "går" "gå" "gå" "gick" "ginge" "gått" "gången" v++vb4göra :: String -> Verb+vb4göra s v = (tk 4 s) +* mk_verb "göra" "gör" "göre" "gör" "gjorde" "gjorde" "gjort" "gjord" v++vb4stå :: String -> Verb+vb4stå s v = (tk 3 s) +* (mk_verb "stå" "står" "stå" "stå" "stod" "stånde" "stått" "stånden" `missing` part_pret_forms) v++vb4få :: String -> Verb+vb4få s v = (tk 2 s) +* (mk_verb "få" "får" "få" "få" "fick" "finge" "fått" [] `missing` part_pret_forms) v++vb4hava :: String -> Verb+vb4hava s v = (tk 2 s) +* +               (verb_short_long "ha" (mk_verb "hava" "haver" "have" "hav" "hade" "hade" "haft" []) +                                     `missing` part_pret_forms) v++vb4vara :: String -> Verb+vb4vara s v = (tk 4 s) +* (mk_verb "vara" "är" "vare" "var" "var" "vore" "varit" [] `missing` passive_forms) v++-- deponent verbs+vbdsynas :: String -> Verb+vbdsynas synas = missing (mk_verb synas synas synas synas (syn++"tes")  +                                  (syn++"ades") (syn++"ats") (syn++"ad"))+                          (part_pres_forms ++ active_forms)+ where syn = tk 2 synas++vbdlyckas :: String -> Verb+vbdlyckas lyckas = missing (mk_verb lyckas lyckas lyckas lyckas (lyck++"ades")  +                                  (lyck++"ades") (lyck++"ats") (lyck++"ad"))+                          (part_pres_forms ++ active_forms)+ where lyck = tk 2 lyckas++vbdhoppas :: String -> Verb+vbdhoppas hoppas = missing (vbdlyckas hoppas) part_forms+ where hopp = tk 2 hoppas++vbdnalkas :: String -> Verb+vbdnalkas nalkas = no_konj $ +  except (missing (mk_verb nalkas nalkas nalkas nalkas (nalk++"ades")  +                         (nalk++"ades") (nalk++"ats") (nalk++"ad")) active_forms)+                  [(VI (PtPres c),mk_case c (nalk++"ande")) | c <- values]+ where nalk = tk 2 nalkas++vbdfärdas :: String -> Verb+vbdfärdas färdas = except (vbdnalkas färdas) [(VI (PtPres Nom),färd++"andes")]+ where färd = tk 2 färdas++vbdvederfås vederfås (VI (Sup SForm)) = mkStr $ tk 1 vederfås ++ "tts"+vbdvederfås _ _ = nonExist++-- pending verbs+vbvkoka :: String -> Verb+vbvkoka koka = combine (vb1 koka) (vb2 koka)++vbvmista :: String -> Verb+vbvmista mista = combine (vb2 mista) (vb1 mista)++vbvbringa :: String -> Verb+vbvbringa bringa = variant (vb1 bringa) $ [(VI (Sup v), mk_vox v bragt) | v <- values] +++                                          [(VF (Pret v), mk_vox v (bragt++"e")) | v <- values]+ where bragt = tk 4 bringa ++ "agt"++vbvtala :: String -> Verb+vbvtala tala = variant (vb1 tala) $ [(VI (Sup v), mk_vox v (tal++"t")) | v <- values] +++                                          [(VF (Pret v), mk_vox v (tal++"te")) | v <- values]+ where tal = tk 1 tala++-- FIXME: should be pending+-- vbvsprida :: String -> Verb+-- vbvsprida = vb2 ++vbmdöut :: String -> Verb+vbmdöut dö_ut vf = case vf of+    VI (PtPret a c) -> mkStr $ mk_case c $ +                       case a of+                         (Strong ASgUtr)      -> utdö ++ "d"+                         (Strong ASgNeutr)    -> utdö ++ "tt"+                         (Strong APl)         -> utdö ++ "da"+                         (Weak (AxSg NoMasc)) -> utdö ++ "da"+                         (Weak (AxSg Sex_Masc))   -> utdö ++ "de"+                         (Weak AxPl)          -> utdö ++ "da"+    _               -> nonExist+ where utdö = case words dö_ut of+                [x,y] -> y +? x+                _     -> error $ "unable to flip: " ++ dö_ut
+ src/fsv/Build.hs view
@@ -0,0 +1,156 @@+module Build where++import General+import Dictionary+import Types+import Rules++-- combinators for lexicographers++noun :: NN -> Gender -> Paradigm -> Entry+noun n g = entryIP n [prValue g]++nnNeutrum s = noun s Neut+nnMasc s    = noun s Masc+nnFem s     = noun s Fem++nn_masc_biti s = nnMasc (biti_rule s) "masc_biti"++nn_masc_bryti s = nnMasc  (bryti_rule s) "masc_bryti"++nn_masc_landbo s = nnMasc  (landbo_rule s) "masc_landbo"++nn_fem_gata s = nnFem (gata_rule s) "fem_gata"++nn_fem_kyrkia s = nnFem  (kyrkia_rule s) "fem_kyrkia"++nn_fem_fru s = nnFem (fru_rule s) "fem_fru"++nn_fem_glaethi s = nnFem (glaethi_rule s) "fem_glaethi"++nn_neut_ogha s = nnNeutrum (ogha_rule s) "neut_ogha"++nn_masc_fisker s = nnMasc  (fisker_rule s) "masc_fisker"++nn_masc_aengil s = nnMasc (aengil_rule s) "masc_aengil"++nn_masc_sko s = nnMasc (sko_rule s) "masc_sko"++nn_masc_aptan s = nnMasc (aptan_rule s) "masc_aptan"++nn_masc_vaever s = nnMasc (vaever_rule s) "masc_vaever"++nn_masc_laegger s = nnMasc (laegger_rule s) "masc_laegger"++nn_masc_oeri s = nnMasc (oeri_rule s) "masc_oeri"++nn_masc_raetter s = nnMasc (raetter_rule s) "masc_raetter"++nn_masc_bondi s = nnMasc (bondi_rule s) "masc_bondi"++nn_masc_son s  =  nnMasc (son_rule s) "masc_son"++nn_masc_mather s  =  nnMasc (mather_rule s) "masc_mather"++nn_masc_foter s  =  nnMasc (foter_rule s) "masc_foter"++nn_masc_fathir s  =  nnMasc (fathir_rule s) "masc_fathir"++nn_masc_eghandi s  =  nnMasc (eghandi_rule s) "masc_eghandi"++nn_fem_agn s = nnFem (agn_rule s) "fem_agn"++nn_fem_bro s = nnFem (bro_rule s) "fem_bro"++nn_fem_gas s = nnFem (gas_rule s) "fem_gas"++nn_fem_bok s = nnFem (bok_rule s) "fem_bok"++nn_fem_ko  s = nnFem (ko_rule s) "fem_ko"++nn_fem_mothir  s = nnFem (mothir_rule s) "fem_mothir"++nn_fem_faerth s = nnFem (faerth_rule s) "fem_faerth"++nn_fem_heth s = nnFem (heth_rule s) "fem_heth"++nn_fem_aeg s = nnFem (aeg_rule s) "fem_aeg"++nn_neu_skip s = nnNeutrum (skip_rule s) "neu_skip"++nn_neu_bo s = nnNeutrum (bo_rule s) "neu_bo"++nn_neu_hovuth s = nnNeutrum (hovuth_rule s) "neu_hovuth"++nn_neu_trae s = nnNeutrum (trae_rule s) "neu_trae"++nn_neu_skaer s = nnNeutrum (skaer_rule s) "neu_skaer"++nn_neu_minne s = nnNeutrum (minne_rule s) "neu_minne"++nn_neu_aepli s = nnNeutrum (aepli_rule s) "neu_aepli"++av_blar s = entryP (blar_rule s) "blar"++av_langer s = entryP (langer_rule s) "langer"++av_helagher s =  entryP (helagher_rule s) "helagher"++ab_opta s =  entryP (opta_rule s) "opta"++ab_laenger s =  entryP (laenger_rule s) "længer"++ab_yter s =  entryP (yter_rule s) "yter"++ord_fyrsti s = entryP (ord_fyrsti_rule s) "fyrsti"++numeral :: [[String]] -> Entry+numeral xs = entryP f "numeral"+ where f :: Numeral+       f = giveValues (map strings xs)++vb_aelska s = entryP (aelska_rule s) "aelska"++vb_kraevia s = entryP (kraevia_rule s) "kraeva"++vb_foera  s = entryP (foera_rule s) "foera"++vb_liva   s = entryP (liva_rule s) "liva"++vb_vika s = entryP (vika_rule s) "vika"++vb_laesa s = entryP (laesa_rule s) "laesa"++instance Dict NN_Form where +    category _ = "nn"+    dictword f = case unStr (f (NN_C Sg Nom Indef)) of+                   (x:_) -> x+                   _     -> getDictWord f++instance Dict VerbForm where+    category _ = "vb"+    dictword f = case unStr (f (Inf Act)) of+                   (x:_) -> x+                   _     -> getDictWord f+++instance Dict NumeralForm where+    category _ = "num"++instance Dict OrdinalForm where+    category _ = "ord"++instance Dict AdjForm where+    category _ = "av"+    dictword f = case unStr (f (StrongPos Masc Sg Nom)) of+                   (x:_) -> x+                   _     -> getDictWord f++instance Dict PNForm where+    category _ = "pn"++instance Dict PPNForm where+    category _ = "pn"++instance Dict AdverbForm where+    category _ = "ab"
+ src/fsv/Commands.hs view
@@ -0,0 +1,66 @@+module Commands where++import Build+import Frontend++commands = + [+  paradigm "nn_m_biti"   ["biti"] nn_masc_biti,+  paradigm "nn_m_bryti"   ["bryti"] nn_masc_bryti,+  paradigm "nn_m_landbo"  ["landbo"] nn_masc_landbo,+  paradigm "nn_f_gata"    ["gata"]   nn_fem_gata,+  paradigm "nn_f_kyrkia"  ["kyrkia"] nn_fem_kyrkia,+  paradigm "nn_f_fru"     ["fru"]    nn_fem_fru,+  paradigm "nn_n_ogha"   ["ögha"]   nn_neut_ogha,+  paradigm "nn_f_glaethi" ["glæþi"] nn_fem_glaethi,+  -- Starka substantiv+  paradigm "nn_m_fisker" ["fisker"] nn_masc_fisker,+  paradigm "nn_m_aengil" ["ængil"] nn_masc_aengil,+  paradigm "nn_m_sko" ["sko"] nn_masc_sko,+  paradigm "nn_m_aptan" ["aptan"] nn_masc_aptan,+  paradigm "nn_m_vaever" ["væver"] nn_masc_vaever,+  paradigm "nn_m_laegger" ["lægger"] nn_masc_laegger,+  paradigm "nn_m_oeri" ["øri"] nn_masc_oeri,+  paradigm "nn_m_raetter" ["rætter"] nn_masc_raetter,+  paradigm "nn_m_bondi" ["bondi"] nn_masc_bondi,+  paradigm "nn_m_son" ["son"] nn_masc_son,+  paradigm "nn_m_mather" ["maþir"] nn_masc_mather,+  paradigm "nn_m_foter" ["foter"] nn_masc_foter,+  paradigm "nn_m_fathir" ["faþir"] nn_masc_fathir,+  paradigm "nn_m_eghandi" ["eghandi"] nn_masc_eghandi,+  paradigm "nn_f_agn" ["agn"] nn_fem_agn,+  paradigm "nn_f_bro" ["bro"] nn_fem_bro,+  paradigm "nn_f_gas" ["gas"] nn_fem_gas,+  paradigm "nn_f_bok" ["bok"] nn_fem_bok,+  paradigm "nn_f_ko" ["ko"] nn_fem_ko,+  paradigm "nn_f_mothir" ["moþir"] nn_fem_mothir,+  paradigm "nn_f_faerth" ["færþ"] nn_fem_faerth,+  paradigm "nn_f_heth" ["heþ"] nn_fem_heth,+  paradigm "nn_f_aeg" ["æg"] nn_fem_aeg,+  paradigm "nn_n_skip" ["skip"] nn_neu_skip,+  paradigm "nn_n_bo" ["bo"] nn_neu_bo,+  paradigm "nn_n_hovuth" ["hovuþ"] nn_neu_hovuth,+  paradigm "nn_n_trae" ["træ"] nn_neu_trae,+  paradigm "nn_n_skaer" ["skær"] nn_neu_skaer,+  paradigm "nn_n_minne" ["minne"] nn_neu_minne,+  paradigm "nn_n_aepli"  ["æpli"] nn_neu_aepli,++  -- Adjektiv+  paradigm "av_blar"     ["blar"]     av_blar,+  paradigm "av_langer"   ["langer"]   av_langer,+  paradigm "av_helagher" ["helagher"] av_helagher,+  -- Adverb+  paradigm "ab_opta" ["opta"] ab_opta,+  paradigm "ab_laenger" ["længer"] ab_laenger,+  paradigm "ab_yter" ["yter"] ab_yter,++  -- Verb+  paradigm "vb_aelska" ["ælska"] vb_aelska,+  paradigm "vb_kraevia" ["krævia"] vb_kraevia,+  paradigm "vb_foera" ["føra"] vb_foera,+  paradigm "vb_liva" ["liva"] vb_liva,+  paradigm "vb_vika" ["vika"] vb_vika,+  paradigm "vb_laesa" ["læsa"] vb_laesa,+  -- ordinal+  paradigm "ord_fyrsti" ["fyrsti"] ord_fyrsti+  ]
+ src/fsv/Dict.hs view
@@ -0,0 +1,76 @@+module Dict where++import Build+import Rules+import Types+import General+import Dictionary++dict :: Dictionary+dict = dictionary $ map identifier+ ([+  entry ord_annar_rule+ ] ++ num ++ pron)+ where identifier e = set_lemma_id (get_head e ++ ".." ++ get_pos e ++ ".1") e++-- Numeraler+num :: [Entry]+num = + [+  numeral +  [+   ["en","æn","in"], ["ens"],   ["enum","enom"], ["en","æn","in"],+   ["en"],           ["ennar"], ["enni","enne"], ["ena"],+   ["et","æt","it"], ["ens"],   ["enu","eno"],   ["et","æt","it"]+  ],+  numeral +  [+   ["twe","twer","twa"], ["twæggia","twiggia"],   ["twem"], ["twa"],+   ["twa","twar"],["twæggia","twiggia"], ["twem"], ["twa","twar"],+   ["tu"],["twæggia","twviggia"] ,   ["twem"],   ["tu"]+  ],+  numeral +  [+   ["þri","þrir","þre"], ["þriggia"], ["þrim","þrem"], ["þre","þrea"],+   ["þrea","þrear","þre"],["þriggia"],["þrim","þrem"], ["þrea","þrear","þre"],+   ["þry"],["þriggia"] ,   ["þrim","þrem"],   ["þry"]+  ],+  numeral +  [+   ["fiuri","fiurir","fyri","fyrir"], ["figuhura","figuhurra","fiura","fyra"], +   ["fiurum","fyrom"], ["fiura","fyra"],+   ["fiura","fiurar","fyra","fyrar"], ["figuhura","figuhurra","fiura","fyra"], +   ["fiurum","fyrom"], ["fiura","fiurar","fyra","fyrar"],+   ["fiughur"], ["figuhura","figuhurra","fiura","fyra"], +   ["fiurum","fyrom"], ["fiughur"]+  ],+  numeral +  [+   ["baþi","baþir"], ["bæggia"], ["baþum","baþom"], ["baþa"],+   ["baþa","baþar"],["bæggia"],["baþum","baþom"], ["baþa","baþar"],+   ["baþi","baþin","baþe","baþen","bæþi","bæþin"],+   ["bæggia"],["baþum","baþom"], ["baþi","baþin","baþe","baþen"]+  ]+ ]+++-- Pronomen++pron = +    [+     entry (sin_rule "sin"),+     entry (sin_rule "min"),+     entry (sin_rule "þin"),+     entry var_rule,+     entry ithar_rule,+     entry thaen_rule,+     entry thaeni_rule,+     entry hvar_rule,+     entry hvilkin_rule,+     entry nokor_rule,+     entry aengin_rule,+     entry hvaer_rule,+     entry hvarghin_rule,+     entry person_rule,+     entry hanhon_rule+    ]
+ src/fsv/Main.hs view
@@ -0,0 +1,29 @@+module Main where++import CommonMain+import Dict+import Commands+import Frontend+import Test+import PrintSw+import Dictionary(Entry,set_lemma_id)+import qualified Dict.Abs as Abs++main :: IO ()+main = commonMain Fornsvenska++data Fornsvenska = Fornsvenska+ deriving Show++instance Language Fornsvenska where+    morphology_header _ = "FM-FSV 1.0\n © L. Borin, M. Forsberg, 2010, under GNU LGPL 3.0 or CC-SA 2.5 Generic"+    name         _ = "fsv"+    lprinter     _ = print_table+    internDict   _ = dict+    paradigms    _ = foldr insertCommand emptyC commands+    termParser _ ts e = add_id ts e+    testBench _ = tests++add_id :: [Abs.Term] -> Entry -> Entry+add_id [Abs.TermC _ [(Abs.TermA (Abs.NStr s))]]  e = set_lemma_id s e+add_id _                                         e = e
+ src/fsv/PrintSw.hs view
@@ -0,0 +1,112 @@+module PrintSw where++import List(intersperse,nub,inits)+import Util+import Dictionary+import General+import Char+import Data.Bits ((.&.))++print_table = [("multi",multi_printer),("rdf_sb",prRDF_sb),("flat_xml",prFlatXML)]++-- | Print JSON+multi_printer :: Dictionary -> String+multi_printer = concat . nub . concat . map prOne . filter is_multi. unDict+ where prOne  (id,stem,para,cat,inhs,tbl,_) = +           [conc [p "word" x, p "head" stem, p "pos" cat, p "param" "frag", pl "inhs" inhs, p "id" id, p "p" para, p "attr" (show attr)] |  (a,(attr,s)) <- (merge tbl), str <- unStr s, length (words str) > 1, x <- map unwords $ gen (words str)]+       merge            [] = []+       merge           [x] = [x]+       merge (x@(param1,(a,s)):y@(param2,(a',s1)):xs) = +           case (number param1, number param2) of+             ((v,n1,n2),(v',n1',n2')) | v == v' && n1' > n1 -> merge ((param2,(a',mkStr (unwords (unStr s ++ unStr s1)))):xs)+             _ -> x:merge (y:xs)+       number p = case map (map (read :: String -> Int) . words . map f) (filter (isDigit.head) (words p)) of+                    [[v1,n1,n2]] -> (v1,n1,n2)+       f x+         | elem x "-:" = ' ' +         | otherwise = x+       gen :: [String] -> [[String]]+       gen []     =  []+       gen (x:xs) =  filter (\xs -> not (null xs || one xs)) (inits (x:xs)) ++ gen xs+       one [_] = True+       one _ = False+       pl s []   = quote s ++ ":" ++ "[]"+       pl s xs   = quote s ++ ":[" ++ (concat (intersperse "," (map quote xs))) ++"]"+       p s1 s2 = quote s1 ++ ":" ++ quote s2+       conc xs = '{':(concat (intersperse "," xs)) ++ "}\n"+       is_multi (_,stem,para,cat,_,_,_) = length (words stem) > 1++-- | Print RDF+prRDF_sb :: Dictionary -> String+prRDF_sb d =  unlines [+  "<?xml version='1.0' encoding='UTF-8'?>",+  "<rdf:RDF",+  "  xmlns=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"",+  "  xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"",+  "  xmlns:sb=\"http://spraakbanken.gu.se/saldo#\">",+  (concat (map pr (unDict d))),+  "</rdf:RDF>"]+ where+ pr (id,stem,para,cat,inhs,tbl,extr) =  +     concat +         [+          "   <rdf:Description rdf:about=\"http://spraakbanken.gu.se/saldo/lemma/" ++ id ++ "\">\n",+          "    <rdf:type rdf:resource=\"http://spraakbanken.gu.se/ns/saldo/lemma\"/>\n",+          "    <sb:cf>"  ++ amp stem ++ "</sb:cf>\n",+          "    <sb:p>" ++ para ++ "</sb:p>\n",+          "    <sb:pos>"   ++ cat ++ "</sb:pos>\n",+          concat ["    <sb:inhs>"  ++ i ++ "</sb:inhs>\n" | i <- inhs] ++ "   </rdf:Description>\n",+          concat [unlines ["   <rdf:Description rdf:about=\"http://spraakbanken.gu.se/saldo/lemma/" ++ id ++ "#" ++ (urlEncode p) ++ "\">",+                           "    <rdf:type rdf:resource=\"http://spraakbanken.gu.se/ns/saldo/msd\"/>",+          "    <sb:id rdf:resource=\"http://spraakbanken.gu.se/saldo/lemma/" ++ id ++ "\"/>",+          "    <sb:msd>" ++ p ++ "</sb:msd>",+          concat (intersperse "\n" ["    <sb:wf>" ++ (amp w) ++ "</sb:wf>" | w <- unStr ws]),+          "   </rdf:Description>"] | (p,(_,ws)) <- tbl, not (null (unStr ws))]+          ]+++-- | Print RDF+prFlatXML :: Dictionary -> String+prFlatXML d =  unlines [+  "<?xml version='1.0' encoding='UTF-8'?>",+  "<!-- $Id$ -->",+  "<Lexicon>",+  (concat (map pr (unDict d))),+  "</Lexicon>"]+ where+ pr (id,stem,para,cat,inhs,tbl,extr) =  +     concat +         [+          "   <LexicalEntry>\n",+          "    <eid>" ++ id ++ "</eid>\n",+          "    <gf>"  ++ amp stem ++ "</gf>\n",+          "    <p>" ++ para ++ "</p>\n",+          "    <pos>"   ++ cat ++ "</pos>\n",+          "    <inhs>" ++ (unwords inhs) ++ "</inhs>\n",+          "    <table>\n",+          concat (intersperse "\n" ["     <form><param>" ++ p ++ "</param><wf>" ++ (amp w) ++ "</wf></form>" | (p,(_,ws)) <- tbl, w <- unStr ws]),+          "\n    </table>\n",+          "   </LexicalEntry>\n"+          ]++ -- copied from Module :  HTTP+ -- Copyright :  (c) Warrick Gray 2002+ -- License   :  BSD+amp = concat . map (\c -> if c == '&' then "&amp;" else [c])+urlEncode (h:t) =+     let str = if reserved (ord h) then escape h else [h]+     in str ++ urlEncode t+urlEncode [] = []+reserved x+     | x >= ord 'a' && x <= ord 'z' = False+     | x >= ord 'A' && x <= ord 'Z' = False+     | x >= ord '0' && x <= ord '9' = False+     | x <= 0x20 || x >= 0x7F = True+     | otherwise = x `elem` map ord [';','/','?',':','@','&'+                                    ,'=','+',',','$','{','}'+                                    ,'|','\\','^','[',']','`'+                                    ,'<','>','#','%','"']+escape x = +     let y = ord x +      in [ '%', intToDigit ((y `div` 16) .&. 0xf), intToDigit (y .&. 0xf) ]+
+ src/fsv/Rules.hs view
@@ -0,0 +1,1377 @@+module Rules where++import General  -- language-independent functional morphology library+import Types    -- morphological parameters and word classes++-- Missing: Species.++-- Noun: Weak Declension++-- Maskulinum+species_masc :: Species -> (Number,Case) -> [String] -> Str+species_masc Indef _ xs = strings xs+species_masc Def (n,c) xs = strings $ +   case (c,n) of +    (Gen,Sg) -> [x ++ "ns"  | x <- xs]+    (Dat,Sg) -> [x ++ "num" | x <- xs]+    (_,Sg)   -> [x ++ "n"   | x <- xs]+    (Nom,Pl) -> [x ++  y    | x <- xs, y <- ["ni", "nir"]]+    (Gen,Pl) -> [x ++ "nna" | x <- xs]+    (Dat,Pl) -> [x ++ "in"  | x <- xs]+    (Ack,Pl) -> [x ++ "na"  | x <- xs]++biti_rule :: String -> NN+biti_rule biti = i_rule (tk 1 biti)++bryti_rule :: String -> NN+bryti_rule bryti = except (i_rule bryti) [(NN_C Sg Nom Indef,bryti)]++landbo_rule :: String -> NN+landbo_rule landbo (NN_C n c d) = species_masc d (n,c) $  +    case (n,c) of+     (Sg,Nom) -> [landbo, landbo++"i", landbo++"e"]+     (Pl,Nom) -> [landbo ++ suff | suff <- ["ar","r","","ær"]]+     (Pl,Dat) -> [landbo++"um", landbo++"om", landbo++"m"]+     _        -> [landbo, landbo++"a", landbo++"æ"]+      +i_rule :: String -> NN+i_rule bit (NN_C n c d) = species_masc d (n,c) $+    case (n,c) of+     (Sg,Nom) -> [bit++"i", bit++"e"]+     (Pl,Nom) -> bita_bitae ++ [bit++"ar",bit++"ær"]+     (Pl,Dat) -> [bit++"um", bit++"om"]+     _        -> bita_bitae+  where bita_bitae = [bit++"a", bit++"æ"]+        +-- Femininum+species_fem :: Species -> (Number,Case) -> [String] -> Str+species_fem Indef _ xs = strings xs+species_fem Def (n,c) xs = strings $ +   case (c,n) of +    (Nom,Sg) -> [x ++ "n"   | x <- xs]+    (Gen,Sg) -> [x ++ y     | x <- xs, y <- ["nna", "nnar"]]+    (Dat,Sg) -> [x ++ "nni" | x <- xs]+    (Ack,Sg) -> [x ++ "na"  | x <- xs]+    (Nom,Pl) -> [x ++  y    | x <- xs, y <- ["na", "nar"]] -- ?+    (Gen,Pl) -> [x ++ "nna" | x <- xs]+    (Dat,Pl) -> [x ++ "in"  | x <- xs]+    (Ack,Pl) -> [x ++ y     | x <- xs, y <- ["na", "nar"]]++gata_rule :: String -> NN+gata_rule gata (NN_C n c d) = species_fem d (n,c) $+    case (n,c) of+     (Sg,Nom) -> [gat++"a",gat++"æ"]+     (Sg,_)   -> [gat++"u",gat++"o"]+     (Pl,Gen) -> [gat++suff | suff <- ["na", "næ", "u","o"]]+     (Pl,Dat) -> [gat++"um", gat++"om"]+     (Pl,_)   -> [gat++suff | suff <- ["u", "ur", "o","or"]]+ where gat = tk 1 gata++kyrkia_rule :: String -> NN+kyrkia_rule kyrkia = excepts (gata_rule kyrkia) +                     [(NN_C Pl Gen Indef, +                       strings [kyrk++"na", kyrk++"næ", kyrk++"iu", kyrk++"io"])]+ where kyrk = tk 2 kyrkia++fru_rule :: String -> NN+fru_rule fru (NN_C n c d) = species_fem d (n,c) $ +   case (n,c) of +    (Sg,Nom) -> [fru,fru++"a", fru++"æ"]+    (Sg,_)   -> [fru,fru++"u",fru++"o"]+    (Pl,Gen) -> [fru]+    (Pl,Dat) -> [fru++suff | suff <- ["om","m","um"]]+    (Pl,_)   -> [fru++suff | suff <- ["o","or","ur","r",""]]++glaethi_rule :: String -> NN+glaethi_rule glaethi (NN_C n c d) =+   case (n,c) of+    (Sg,Nom) -> strings [glaethi++"n", glaeth++"en"]+    (Sg,Gen) -> strings [glaethi++"nna",glaethi++"nnar"]+    (Sg,Dat) -> strings [glaethi++"nni", glaeth++"enni"]+    (Sg,Ack) -> strings [glaethi++"na", glaeth++"ena"]+    _      -> nonExist+  where glaeth = tk 1 glaethi++-- Neutrum+species_neu :: Species -> (Number,Case) -> [String] -> Str+species_neu Indef _ xs = strings xs+species_neu Def (n,c) xs = strings $ +   case (c,n) of +    (Gen,Sg) -> [x ++ "ns"  | x <- xs]+    (Dat,Sg) -> [x ++ "nu" | x <- xs]+    (_,Sg)   -> [x ++ "t"  | x <- xs]+    (Gen,Pl) -> [x ++ "nna" | x <- xs]+    (_,Pl) -> [x ++ "in"  | x <- xs]++ogha_rule :: String -> NN+ogha_rule ogha (NN_C n c d) = +   species_neu d (n,c) $+     case (n,c) of+     (Sg,_)   -> [ogh++"a"  ,ogh++"æ"]      +     (Pl,Gen) -> [ogh++"na" ,ogh++"næ"]+     (Pl,Dat) -> [ogh++"um" ,ogh++"om"]+     _        -> [ogh++"un" ,ogh++"on"]+  where ogh = tk 1 ogha++-- Noun: Strong Declension++-- Masc++fisker_rule  :: String -> NN+fisker_rule  fisker (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Nom,Indef) -> [fisker]+     (Sg,Gen,Indef) -> [fisk++"s"]+     (Sg,Dat,Indef) -> [fisk ++ x | x <- ["i","e",""]]+     (Sg,Ack,Indef) -> [fisk]+     (Pl,Nom,Indef) -> [fisk ++ x | x <- ["a","ar","æ","ær"]]+     (Pl,Dat,Indef) -> [fisk ++ x | x <- ["um","om"]]+     (Pl,_,Indef)   -> [fisk ++ x | x <- ["a","æ"]]+     (Sg,Nom,Def)   -> [fisk++"rin"]+     (Sg,Gen,Def)   -> [fisk++"sins"]+     (Sg,Dat,Def)   -> [fisk ++ x | x <- ["inum","enum","num"]]+     (Sg,Ack,Def)   -> [fisk++"in"]+     (Pl,Nom,Def)   -> [fisk ++ x | x <- ["ani","anir","æni","ænir"]]+     (Pl,Dat,Def)   -> [fisk ++ x | x <- ["umin","omin"]]+     (Pl,_,Def) -> [fisk ++ x | x <- ["ana","æna"]]+ where fisk = tk 2 fisker++aengil_rule  :: String -> NN+aengil_rule  aengil (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [aengil++"s"]+     (Sg,Dat,Indef) -> [aengl ++ x | x <- ["i","e"]]+     (Sg,_,Indef)   -> [aengil]+     (Pl,Nom,Indef) -> [aengl ++ x | x <- ["a","ar","æ","ær"]]+     (Pl,Dat,Indef) -> [aengl ++ x | x <- ["um","om"]]+     (Pl,_,Indef)   -> [aengl ++ x | x <- ["a","æ"]]+     (Sg,Gen,Def)   -> [aeng++"ilsins"]+     (Sg,Dat,Def)   -> [aengl ++ x | x <- ["inum","enum"]]+     (Sg,_,Def)     -> [aeng ++ x | x <- ["lin","ilin"]]+     (Pl,Nom,Def)   -> [aengl ++ x | x <- ["ani","anir","æni","ænir"]]+     (Pl,Dat,Def)   -> [aengl ++ x | x <- ["umin","omin"]]+     (Pl,_,Def)     -> [aengl ++ x | x <- ["ana","æna"]]+ where aeng = tk 2 aengil+       aengl = aeng++"l"++sko_rule     :: String -> NN+sko_rule  sko (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [sko++"s"]+     (Sg,Nom,Indef) -> [sko, sko++ "r"]+     (Sg,_,Indef)   -> [sko]+     (Pl,Nom,Indef) -> [sko ++ x | x <- ["a","ar","ar","r"]]+     (Pl,Dat,Indef) -> [sko ++ x | x <- ["um","om","m"]]+     (Pl,_,Indef)   -> [sko,sko++"a"]+     (Sg,Nom,Def)   -> [sko ++ x | x <- ["n","in","rin","rn"]]+     (Sg,Gen,Def)   -> [sko++"sins"]+     (Sg,Dat,Def)   -> [sko ++ "num"]+     (Sg,Ack,Def)   -> [sko++ x | x <- ["in","n"]]+     (Pl,Nom,Def)   -> [sko ++ x | x <- ["ani","anir","ni","nir"]]+     (Pl,Dat,Def)   -> [sko ++ x | x <- ["umin","omin","min"]]+     (Pl,_,Def)     -> [sko ++ x | x <- ["anna","nna"]]+ +aptan_rule  :: String -> NN+aptan_rule  aptan (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef)   -> [aptan ++ "s"]+     (Sg,Dat,Indef)   -> [apt   ++ x | x <- ["ni","ne"]]+     (Sg,_,Indef)     -> [aptan]+     (Pl,Nom,Indef)   -> [apt ++ x | x <- ["na","nar","næ","nær"]]+     (Pl,Dat,Indef)   -> [apt ++ x | x <- ["num","nom"]]+     (Pl,_,Indef)     -> [apt ++ x | x <- ["na","næ"]]+     (Sg,Gen,Def)     -> [apt ++ "ansins"]+     (Sg,Dat,Def)     -> [apt ++ x | x <- ["ninum","nenum"]]+     (Sg,_,Def)       -> [apt ++ x | x <- ["nin","anin"]]+     (Pl,Nom,Def)     -> [apt ++ x | x <- ["nani","nanir","næni","nænir"]]+     (Pl,Dat,Def)     -> [apt ++ x | x <- ["numin","nomin"]]+     (Pl,Gen,Def)     -> [apt ++ x | x <- ["nanna","nænna"]]+     (Pl,Ack,Def)     -> [apt ++ x | x <- ["nana","næna"]]+ where apt = tk 2 aptan++vaever_rule  :: String -> NN+vaever_rule  vaever (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Nom,Indef) -> [vaever]+     (Sg,Gen,Indef) -> [vaef ++ "s"]+     (Sg,_,Indef)   -> [vaef]+     (Pl,Nom,Indef) -> [vaef ++ x | x <- ["ia","iar","iæ","iær"]]+     (Pl,Dat,Indef) -> [vaef ++ x | x <- ["ium","iom"]]+     (Pl,_,Indef)   -> [vaef ++ x | x <- ["ia","iæ"]]+     (Sg,Nom,Def)   -> [vae  ++ "vrin"]+     (Sg,Gen,Def)   -> [vaef ++ "sins"]+     (Sg,Dat,Def)   -> [vaef ++"num"]+     (Sg,Ack,Def)   -> [vaef ++ "in"]+     (Pl,Nom,Def)   -> [vaef ++ x | x <- ["iani","ianir","iæni","iænir"]]+     (Pl,Dat,Def)   -> [vaef ++ x | x <- ["iumin","iomin"]]+     (Pl,Gen,Def)   -> [vaef ++ x | x <- ["ianna","iænna"]]+     (Pl,Ack,Def)   -> [vaef ++ x | x <- ["iana","iæna"]]+ where vae = tk 3 vaever+       vaef = vae++"f"++laegger_rule  :: String -> NN+laegger_rule  laegger (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Nom,Indef) -> [laegger]+     (Sg,Gen,Indef) -> [laegg ++ x | x <- ["ia","iar","iæ","iær"]]+     (Sg,Dat,Indef) -> [laeg  ++ x | x <- ["gi","ge",""]]+     (Sg,Ack,Indef) -> [laeg]+     (Pl,Nom,Indef) -> [laegg ++ x | x <- ["ia","iar","iæ","iær"]]+     (Pl,Dat,Indef) -> [laegg ++ x | x <- ["ium","iom"]]+     (Pl,_,Indef)   -> [laegg ++ x | x <- ["ia","iæ"]]+     (Sg,Nom,Def)   -> [laegg ++ "rin"]+     (Sg,Gen,Def)   -> [laegg ++ "sins"]+     (Sg,Dat,Def)   -> (laeg++"num"):[laegg ++ x | x <- ["inum","enum"]]+     (Sg,Ack,Def)   -> [laeg ++ "in"]+     (Pl,Nom,Def)   -> [laegg ++ x | x <- ["iani","ianir","iæni","iænir"]]+     (Pl,Dat,Def)   -> [laegg ++ x | x <- ["iumin","iomin"]]+     (Pl,_,Def)     -> [laegg ++ x | x <- ["ianna","iænna"]]+ where laeg  = tk 3 laegger+       laegg = tk 2 laegger++oeri_rule  :: String -> NN+oeri_rule oeri (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Nom,Indef) -> [oeri,oeri++"r"]+     (Sg,Gen,Indef) -> [oeri++"s"]+     (Sg,_,Indef)   -> [oeri,oer++"e"]+     (Pl,Nom,Indef) -> [oer ++ x | x <- ["a","ar","æ","ær"]]+     (Pl,Dat,Indef) -> [oer ++ x | x <- ["um","om"]]+     (Pl,_,Indef)   -> [oer ++ x | x <- ["a","æ"]]+     (Sg,Nom,Def)   -> [oeri ++ x | x <- ["n","rn"]]+     (Sg,Gen,Def)   -> [oeri ++ "sins"]+     (Sg,Dat,Def)   -> [oer ++ x | x <- ["inum","enum"]]+     (Sg,Ack,Def)   -> [oer ++ x | x <- ["in","en"]]+     (Pl,Nom,Def)   -> [oer ++ x | x <- ["ani","anir","æni","ænir"]]+     (Pl,Dat,Def)   -> [oer ++ x | x <- ["umin","omin"]]+     (Pl,Gen,Def)   -> [oer ++ x | x <- ["anna","ænna"]]+     (Pl,Ack,Def)   -> [oer ++ x | x <- ["ana","æna"]]+ where oer = tk 1 oeri++raetter_rule  :: String -> NN+raetter_rule raetter (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Nom,Indef) -> [raetter]+     (Sg,Gen,Indef) -> (rae++"z"):[raett ++ x | x <- ["a","ar","æ","ær"]]+     (Sg,Dat,Indef) -> [raet ++ x | x <- ["ti","te",""]]+     (Sg,Ack,Indef) -> [raet]+     (Pl,Nom,Indef) -> [raett ++ x | x <- ["i","ir","e","er"]]+     (Pl,Dat,Indef) -> [raett ++ x | x <- ["um","om"]]+     (Pl,_,Indef)   -> [raett ++ x | x <- ["a","æ"]]+     (Sg,Nom,Def)   -> [raett ++ "rin"]+     (Sg,Gen,Def)   -> [raett ++ "sins", rae++"zins"]+     (Sg,Dat,Def)   -> (raet++"num"):[raett ++ x | x <- ["inum","enum"]]+     (Sg,Ack,Def)   -> [raett ++ "in"]+     (Pl,Nom,Def)   -> [raett ++ x | x <- ["ini","inir"]]+     (Pl,Dat,Def)   -> [raett ++ x | x <- ["umin","omin"]]+     (Pl,Gen,Def)   -> [raett ++ x | x <- ["anna","ænna"]]+     (Pl,Ack,Def)   -> [raett ++ x | x <- ["ina","ena"]]+ where raet  = tk 3 raetter+       raett = tk 2 raetter+       rae   = tk 4 raetter++bondi_rule   :: String -> NN+bondi_rule bondi (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Nom,Indef) -> [bondi, bond++"e"]+     (Sg,_,Indef)   -> [bond++"a", bond++"æ"]+     (Pl,Gen,Indef) -> [bond++"a", bond++"æ"]+     (Pl,Dat,Indef) -> [bond++"um", bond++"om"]+     (Pl,_,Indef)   -> [umlaut(bond)++"er"]+     (Sg,Nom,Def)   -> [bond++"in", bond++"en"]+     (Sg,Gen,Def)   -> [bond++"sins"]+     (Sg,Dat,Def)   -> [bond++"anum",bond++"ænum"]+     (Sg,Ack,Def)   -> [bond++"in"]+     (Pl,Nom,Def)   -> [umlaut(bond)++suf | suf <- ["rini","rinir"]]+     (Pl,Dat,Def)   -> [bond ++ suf | suf <- ["umin","omin"]]+     (Pl,Gen,Def)   -> [bond ++ suf | suf <- ["anna","ænna"]]+     (Pl,Ack,Def)   -> [umlaut(bond)++"rina"]+ where bond  = tk 1 bondi+++son_rule   :: String -> NN+son_rule son (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Nom,Indef) -> [son, s++"un"]+     (Sg,Gen,Indef) -> [son ++ "ar", son++"ær", sun++"ar", sun++"ær"]+     (Sg,Dat,Indef) -> [syn++"i", syn++"e",sun]+     (Sg,Ack,Indef) -> [syn, son,sun]+     (Pl,Nom,Indef) -> [syn++ suff | suff <- ["i","ir","e","er"]]+     (Pl,Gen,Indef) -> [son++"a", son++"æ", sun++"a", sun++"æ"]+     (Pl,Dat,Indef) -> [son++"um", sun++"um"]+     (Pl,Ack,Indef) -> [syn++"i",sun++"u"]+     (Sg,Nom,Def)   -> [son++"in", sun++"in"]+     (Sg,Gen,Def)   -> [son++"sins", sun++"sins"]+     (Sg,Dat,Def)   -> [syn++"inum",syn++"enum",sun++"um"]+     (Sg,Ack,Def)   -> [syn++"in", son++"in", sun++"in"]+     (Pl,Nom,Def)   -> [syn++"ini",syn++"inir", syn++"eni",syn++"enir"]+     (Pl,Gen,Def)   -> [son++"anna", son++"ænna",sun++"anna", sun++"ænna"]+     (Pl,Dat,Def)   -> [son++"umin",sun++"umin"]+     (Pl,Ack,Def)   -> [syn++"ina", sun++"una"]+ where s = tk 2 son+       sun = s ++ "un"+       syn = s ++ "yn"++mather_rule  :: String -> NN+mather_rule mather (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Nom,Indef) -> [mather, man]+     (Sg,Gen,Indef) -> [man++"z"]+     (Sg,Dat,Indef) -> [man++"ni", man++"ne"]+     (Sg,Ack,Indef) -> [man]+     (Pl,Gen,Indef) -> [man++"na", man++"næ"]+     (Pl,Dat,Indef) -> [man++"num",man++"nom"]+     (Pl,_,Indef)   -> [maen]+     (Sg,Nom,Def)   -> [math++"irin",math++"rin",man++"nin"]+     (Sg,Gen,Def)   -> [man++"zins"]+     (Sg,Dat,Def)   -> [man++"ninum",man++"nenum"]+     (Sg,Ack,Def)   -> [man++"nin"]+     (Pl,Nom,Def)   -> [maen++"ni",maen++"nir"]+     (Pl,Gen,Def)   -> [man++"nanna", man++"nænna"]+     (Pl,Dat,Def)   -> [man++"numin",man++"nomin"]+     (Pl,Ack,Def)   -> [maen++"na"]+ where math = tk 2 mather+       man  = tk 3 mather ++ "n"+       maen = tk 3 mather ++ "æn"++foter_rule   :: String -> NN+foter_rule foter (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Nom,Indef) -> [foter]+     (Sg,Gen,Indef) -> [fot++suff | suff <- ["a","ar","æ","ær"]]+     (Sg,Dat,Indef) -> [foet++"i",foet++"e",fot++"i",fot++"e"]+     (Sg,Ack,Indef) -> [fot]+     (Pl,Gen,Indef) -> [fot++"a",fot++"æ"]+     (Pl,Dat,Indef) -> [fot++"um",fot++"om"]+     (Pl,_,Indef)   -> [foet++"er"]+     (Sg,Nom,Def)   -> [fot++"rin"]+     (Sg,Gen,Def)   -> [fot++"sins"]+     (Sg,Dat,Def)   -> [foet++"inum",foet++"enum",fot++"inum",fot++"enum"]+     (Sg,Ack,Def)   -> [fot++"in"]+     (Pl,Nom,Def)   -> [foet++"rini",foet++"rinir"]+     (Pl,Gen,Def)   -> [fot++"anna", fot++"ænna"]+     (Pl,Dat,Def)   -> [fot++"umin", fot++"omin"]+     (Pl,Ack,Def)   -> [foet++"rina"]+ where fot  = tk 2 foter+       foet = umlaut fot+ +fathir_rule  :: String -> NN+fathir_rule fathir (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Nom,Indef) -> [fathir]+     (Sg,Gen,Indef) -> [fath++"ur",fath++"urs",fath++"or",fath++"ors"]+     (Sg,Dat,Indef) -> [fath++"ur",fath++"or",faeth++"er"]+     (Sg,Ack,Indef) -> [fath++"ur",fath++"or"]+     (Pl,Gen,Indef) -> [faeth++"ra",faeth++"ræ"]+     (Pl,Dat,Indef) -> [faeth++"rum",faeth++"rom"]+     (Pl,_,Indef)   -> [faeth++"er"]+     (Sg,Nom,Def)   -> [fath++"irin",fath++"rin"]+     (Sg,Gen,Def)   -> [fath++"ursins",fath++"urins",fath++"orsins",fath++"orins"]+     (Sg,Dat,Def)   -> [fath++"urnum",fath++"ornum",faeth++"ernum"]+     (Sg,Ack,Def)   -> [fath++"urin",fath++"rin"]+     (Pl,Nom,Def)   -> [faeth++"rini",faeth++"rinir"]+     (Pl,Gen,Def)   -> [faeth++"ranna",faeth++"rænna"]+     (Pl,Dat,Def)   -> [faeth++"rumin",faeth++"romin"]+     (Pl,Ack,Def)   -> [faeth++"rina"]+ where fath  = tk 2 fathir+       faeth = umlaut fath++eghandi_rule :: String -> NN+eghandi_rule eghandi (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Nom,Indef) -> [eghand++"i",eghand++"e"]+     (Sg,_,Indef)   -> [eghand++"a",eghand++"æ"]+     (Pl,Gen,Indef) -> [eghand++"a",eghand++"æ"]+     (Pl,Dat,Indef) -> [eghand++"um",eghand++"om"]+     (Pl,_,Indef)   -> [eghand++"er",eghand++"ar"]+     (Sg,Nom,Def)   -> [eghand++"in",eghand++"en"]+     (Sg,Gen,Def)   -> [eghand++"sins"]+     (Sg,Dat,Def)   -> [eghand++"anum",eghand++"ænum"]+     (Sg,Ack,Def)   -> [eghand++"in"]+     (Pl,Nom,Def)   -> [eghand++"inir",eghand++"ini"]+     (Pl,Gen,Def)   -> [eghand++"anna",eghand++"ænna"]+     (Pl,Dat,Def)   -> [eghand++"umin",eghand++"omin"]+     (Pl,Ack,Def)   -> [eghand++"ina"]+ where eghand = tk 1 eghandi++-- Fem.++agn_rule :: String -> NN+agn_rule agn (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [agn ++ x | x <- ["a","ar","æ","ær"]]+     (Sg,_,Indef)   -> [agn]+     (Pl,Dat,Indef) -> [agn ++ x | x <- ["um","om"]]+     (Pl,Gen,Indef) -> [agn ++ x | x <- ["a","æ"]]+     (Pl,_,Indef)   -> [agn ++ x | x <- ["a","ar","æ","ær"]]+     (Sg,Nom,Def)   -> [agn ++ "in"]+     (Sg,Gen,Def)   -> [agn ++ x | x <- ["inna","innar"]]+     (Sg,Dat,Def)   -> [agn ++ "inni"]+     (Sg,Ack,Def)   -> [agn ++ "ina"]+     (Pl,Gen,Def)   -> [agn ++ x | x <- ["anna","ænna"]]+     (Pl,Dat,Def)   -> [agn ++ x | x <- ["umin","omin"]]+     (Pl,_,Def)   -> [agn ++ x | x <- ["ana","anar","æna","ænar"]]++bro_rule :: String -> NN+bro_rule bro (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [bro ++ x | x <- ["a","ar","æ","ær","r",""]]+     (Sg,_,Indef)   -> [bro]+     (Pl,Dat,Indef) -> [bro ++ x | x <- ["um","om","m"]]+     (Pl,Gen,Indef) -> [bro ++ x | x <- ["a","æ",""]]+     (Pl,_,Indef)   -> [bro ++ x | x <- ["a","ar","æ","ær","r",""]]+     (Sg,Nom,Def)   -> [bro ++ x | x <- ["in", "n"]]+     (Sg,Gen,Def)   -> [bro ++ x | x <- ["inna","nna","innar","nnar"]]+     (Sg,Dat,Def)   -> [bro ++ x | x <- ["inni","nni"]]+     (Sg,Ack,Def)   -> [bro ++ x | x <- ["ina","na"]]+     (Pl,Gen,Def)   -> [bro ++ x | x <- ["anna","ænna","nna"]]+     (Pl,Dat,Def)   -> [bro ++ x | x <- ["umin","omin","min"]]+     (Pl,_,Def)     -> [bro ++ x | x <- ["ana","anar","æna","ænar","nar","rna","rnar","na","nar"]]++aeg_rule :: String -> NN+aeg_rule  aeg (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [aeg ++ suf | suf <- ["gia","giar","giæ","giær"]]+     (Sg,_,Indef)   -> [aeg]+     (Pl,Dat,Indef) -> [aeg ++ suf | suf <- ["gium","giom"]]+     (Pl,Gen,Indef) -> [aeg ++ suf | suf <- ["gia","giæ"]]+     (Pl,_,Indef)   -> [aeg ++ suf | suf <- ["gia","giar","giæ","giær"]]+     (Sg,Nom,Def)   -> [aeg ++ suf | suf <- ["gin"]]+     (Sg,Gen,Def)   -> [aeg ++ suf | suf <- ["inna","innar"]]+     (Sg,Dat,Def)   -> [aeg ++ suf | suf <- ["ginni"]]+     (Sg,Ack,Def)   -> [aeg ++ suf | suf <- ["gina"]]+     (Pl,Gen,Def)   -> [aeg ++ suf | suf <- ["gianna","giænna"]]+     (Pl,Dat,Def)   -> [aeg ++ suf | suf <- ["giumin","giomin"]]+     (Pl,_,Def)     -> [aeg ++ suf | suf <- ["iana","ianar","iæna","iænar"]]++heth_rule :: String -> NN+heth_rule  heth (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Nom,Indef) -> [heth]+     (Sg,Gen,Indef) -> [heth ++ suf | suf <- ["a","ar","æ","ær"]]+     (Sg,_,Indef)   -> [heth ++ suf | suf <- ["i","e",""]]+     (Pl,Dat,Indef) -> [heth ++ suf | suf <- ["um","om"]]+     (Pl,Gen,Indef) -> [heth ++ suf | suf <- ["a","æ"]]+     (Pl,_,Indef)   -> [heth ++ suf | suf <- ["a","ar","æ","ær"]]+     (Sg,Nom,Def)   -> [heth ++ suf | suf <- ["in"]]+     (Sg,Gen,Def)   -> [heth ++ suf | suf <- ["inna","innar"]]+     (Sg,Dat,Def)   -> [heth ++ suf | suf <- ["inni"]]+     (Sg,Ack,Def)   -> [heth ++ suf | suf <- ["ina"]]+     (Pl,Gen,Def)   -> [heth ++ suf | suf <- ["anna","ænna"]]+     (Pl,Dat,Def)   -> [heth ++ suf | suf <- ["umin","omin"]]+     (Pl,_,Def)     -> [heth ++ suf | suf <- ["ana","anar","æna","ænar"]]++faerth_rule :: String -> NN+faerth_rule  faerth (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [faerth ++ suf | suf <- ["a","ar","æ","ær"]]+     (Sg,_,Indef)   -> [faerth]+     (Pl,Dat,Indef) -> [faerth ++ suf | suf <- ["um","om"]]+     (Pl,Gen,Indef) -> [faerth ++ suf | suf <- ["a","æ"]]+     (Pl,_,Indef)   -> [faerth ++ suf | suf <- ["i","ir","e","er"]]+     (Sg,Nom,Def)   -> [faerth ++ "in"]+     (Sg,Gen,Def)   -> [faerth ++ suf | suf <- ["inna","innar"]]+     (Sg,Dat,Def)   -> [faerth ++ suf | suf <- ["inni"]]+     (Sg,Ack,Def)   -> [faerth ++ suf | suf <- ["ina"]]+     (Pl,Gen,Def)   -> [faerth ++ suf | suf <- ["anna","ænna"]]+     (Pl,Dat,Def)   -> [faerth ++ suf | suf <- ["umin","omin"]]+     (Pl,_,Def)     -> [faerth ++ suf | suf <- ["ina","inar","ena","enar"]]++gas_rule :: String -> NN+gas_rule  gas (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [gas ++ suf | suf <- ["a","ar"]]+     (Sg,_,Indef)   -> [gas]+     (Pl,Dat,Indef) -> [gas ++ suf | suf <- ["um"]]+     (Pl,Gen,Indef) -> [gas ++ suf | suf <- ["a"]]+     (Pl,_,Indef)   -> [umlaut(gas)]+     (Sg,Nom,Def)   -> [gas ++ "in"]+     (Sg,Gen,Def)   -> [gas ++ suf | suf <- ["inna","innar"]]+     (Sg,Dat,Def)   -> [gas ++ "inni"]+     (Sg,Ack,Def)   -> [gas ++ "ina"]+     (Pl,Gen,Def)   -> [gas ++ "anna"]+     (Pl,Dat,Def)   -> [gas ++ "umin"]+     (Pl,_,Def)     -> [umlaut(gas) ++ suf | suf <- ["ina","inar"]]++bok_rule :: String -> NN+bok_rule bok (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [bok++"a",bok++"ar"]+     (Sg,_,Indef)   -> [bok]+     (Pl,Gen,Indef) -> [bok++"a"]+     (Pl,Dat,Indef) -> [bok++"um",bok++"om"]+     (Pl,_,Indef)   -> [boek++"er"]+     (Sg,Nom,Def)   -> [bok++"in"]+     (Sg,Gen,Def)   -> [bok++"inna",bok++"innar"]+     (Sg,Dat,Def)   -> [bok++"inni"]+     (Sg,Ack,Def)   -> [bok++"ina"]+     (Pl,Nom,Def)   -> [boek++"enar",boek++"ena"]+     (Pl,Gen,Def)   -> [bok++"anna"]+     (Pl,Dat,Def)   -> [bok ++ suf | suf <- ["umin","omin"]]+     (Pl,Ack,Def)   -> [boek++"enar"]+ where boek = umlaut bok++ko_rule :: String -> NN+ko_rule ko (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [ko++"a",ko++"ar",ko++"r"]+     (Sg,_,Indef)   -> [ko]+     (Pl,Gen,Indef) -> [ko,ko++"a",ko++"æ"]+     (Pl,Dat,Indef) -> [ko++"um",ko++"m",ko++"om"]+     (Pl,_,Indef)   -> [koe,koe++"r",ko,ko++"r"]+     (Sg,Nom,Def)   -> [ko++"in",ko++"n"]+     (Sg,Gen,Def)   -> [ko ++ suf | suf <- ["innar","nnar", "nna", "inna"]]+     (Sg,Dat,Def)   -> [ko++"inni",ko++"nni"]+     (Sg,Ack,Def)   -> [ko++"ina", ko++"na"]+     (Pl,Gen,Def)   -> [ko++"anna"]+     (Pl,Dat,Def)   -> [ko++"umin", ko++"omin", ko++"min"]+     (Pl,_,Def)     -> [koe++"na",koe++"nar",ko++"na", ko++"nar"]+ where koe = umlaut ko++mothir_rule  :: String -> NN+mothir_rule mothir (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Nom,Indef) -> [mothir]+     (Sg,Gen,Indef) -> [moth++"ur",moth++"urs",moth++"or",moth++"ors"]+     (Sg,Dat,Indef) -> [moth++"ur",moth++"or",myth++"r"]+     (Sg,Ack,Indef) -> [moth++"ur", moth++"or"]+     (Pl,Gen,Indef) -> [moeth++"ra", moeth++"ræ"]+     (Pl,Dat,Indef) -> [moeth++"rum",moeth++"rom"]+     (Pl,_,Indef)   -> [moeth++"er"]+     (Sg,Nom,Def)   -> [moth++"irin"]+     (Sg,Gen,Def)   -> [moth ++ suf | suf <- ["urinnar","urinna","orinnar","orinna"]]+     (Sg,Dat,Def)   -> [moth++"urinni",moth++"orinni", myth ++ "rinni"]+     (Sg,Ack,Def)   -> [moth++suff | suff <- ["urina","urna", "orina", "orna"]]+     (Pl,Gen,Def)   -> [moeth++"ranna",moeth++"rænna"]+     (Pl,Dat,Def)   -> [moeth++"rumin",moeth++"romin"]+     (Pl,_,Def)     -> [moeth++"rinar",moeth++"rina"]+ where moth  = tk 2 mothir+       myth  = tk 4 mothir ++ "yþ"+       moeth = umlaut moth++-- Neut.++skip_rule  :: String -> NN+skip_rule skip (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [skip++"s"]+     (Sg,Dat,Indef) -> [skip ++ x | x <- ["i","e",""]]+     (Sg,_,Indef)   -> [skip]+     (Pl,Gen,Indef) -> [skip ++ x | x <- ["a","æ"]]+     (Pl,Dat,Indef) -> [skip ++ x | x <- ["um","om"]]+     (Pl,_,Indef)   -> [skip]+     (Sg,Gen,Def)   -> [skip++"sins"]+     (Sg,Dat,Def)   -> [skip ++ x | x <- ["inu","enu","nu"]]+     (Sg,_,Def)     -> [skip ++ "it"]+     (Pl,Dat,Def)   -> [skip ++ x | x <- ["umin","omin"]]+     (Pl,Gen,Def)   -> [skip ++ x | x <- ["anna","ænna"]]+     (Pl,_,Def)     -> [skip ++ "in"]++bo_rule  :: String -> NN+bo_rule bo (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [bo++"s"]+     (Sg,_,Indef)   -> [bo]+     (Pl,Gen,Indef) -> [bo ++ x | x <- ["a",""]]+     (Pl,Dat,Indef) -> [bo ++ "m"]+     (Pl,_,Indef)   -> [bo]+     (Sg,Gen,Def)   -> [bo++"sins"]+     (Sg,Dat,Def)   -> [bo ++ "no"]+     (Sg,_,Def)     -> [bo ++ x | x <- ["t","it"]]+     (Pl,Dat,Def)   -> [bo ++ "min"]+     (Pl,Gen,Def)   -> [bo ++ x | x <- ["anna","nna"]]+     (Pl,_,Def)     -> [bo ++ x | x <- ["in","n"]]+++hovuth_rule  :: String -> NN+hovuth_rule hovuth (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [hov++"uz", huv++"uz"]+     (Sg,Dat,Indef) -> [hof++"þe", hoef++"þi", hof++"þi"]+     (Sg,_,Indef)   -> [hov++"uþ",huv++"uþ"]+     (Pl,Gen,Indef) -> [hof++"þa",hoef++"þa"]+     (Pl,Dat,Indef) -> [hof++"þom",hof++"þum",hoef++"þum"]+     (Pl,_,Indef)   -> [hov++"uþ",huv++"uþ"]+     (Sg,Gen,Def)   -> [hov++"uzins",huv++"uzins"]+     (Sg,Dat,Def)   -> [hof++"þenu",hoef++"inu",hof++"þinu"]+     (Sg,_,Def)     -> [hov++"uþit",huv++"uþit"]+     (Pl,Gen,Def)   -> [hof++"þanna",hoef++"þanna"]+     (Pl,Dat,Def)   -> [hof++"þomin",hof++"þumin",hoef++"þumin"]+     (Pl,_,Def)     -> [hov++"uþin",huv++"uþin"]+  where hov  = tk 2 hovuth+        huv  = tk 2 hov ++ "uv"+        hof  = tk 1 hov ++ "f"+        hoef = umlaut hof++trae_rule :: String -> NN+trae_rule trae (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [trae++"s"]+     (Sg,_,Indef)   -> [trae]+     (Pl,Gen,Indef) -> [trae++"a",trae]+     (Pl,Dat,Indef) -> [trae++"um",trae++"m"]+     (Pl,_,Indef)   -> [trae]+     (Sg,Gen,Def)   -> [trae++"sins"]+     (Sg,Dat,Def)   -> [trae++"no"]+     (Sg,_,Def)     -> [trae ++ x | x <- ["t","it"]]+     (Pl,Gen,Def)   -> [trae ++ x | x <- ["anna","nna"]]+     (Pl,Dat,Def)   -> [trae++"umin",trae++"min"] +     (Pl,_,Def)     -> [trae ++ x | x <- ["in","n"]]++skaer_rule   :: String -> NN+skaer_rule skaer (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [skaer++"s"]+     (Sg,Dat,Indef) -> [skaer++"i"]+     (Sg,_,Indef)   -> [skaer]+     (Pl,Gen,Indef) -> [skaer++"ia"]+     (Pl,Dat,Indef) -> [skaer++"iom",skaer++"ium"]+     (Pl,_,Indef)   -> [skaer]+     (Sg,Gen,Def)   -> [skaer++"ins"]+     (Sg,Dat,Def)   -> [skaer++"inu"]+     (Sg,_,Def)     -> [skaer++"it"]+     (Pl,Gen,Def)   -> [skaer++"ianna"]+     (Pl,Dat,Def)   -> [skaer++"iomin",skaer++"iumin"]+     (Pl,_,Def)     -> [skaer++"in"]++minne_rule   :: String -> NN+minne_rule minne (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [minn++"is"]+     (Sg,_,Indef)   -> [minne]+     (Pl,Gen,Indef) -> [minn++"a"]+     (Pl,Dat,Indef) -> [minn++"om"]+     (Pl,_,Indef)   -> [minne]+     (Sg,Gen,Def)   -> [minn++"isins"]+     (Sg,Dat,Def)   -> [minne++"no"]+     (Sg,_,Def)     -> [minne++"t"]+     (Pl,Gen,Def)   -> [minn++"anna"]+     (Pl,Dat,Def)   -> [minn++"omin"]+     (Pl,_,Def)     -> [minne++"n"]+  where minn = tk 1 minne++aepli_rule   :: String -> NN+aepli_rule aepli (NN_C n c d) = +   strings $+    case (n,c,d) of+     (Sg,Gen,Indef) -> [aepli++"s"]+     (Sg,_,Indef)   -> [aepli]+     (Pl,Gen,Indef) -> [aepl++"a"]+     (Pl,Dat,Indef) -> [aepl++"om"]+     (Pl,_,Indef)   -> [aepli]+     (Sg,Gen,Def)   -> [aepl++"isins"]+     (Sg,Dat,Def)   -> [aepl++"inu"]+     (Sg,_,Def)     -> [aepl++"it"]+     (Pl,Nom,Def)   -> [aepl++"in"]+     (Pl,Gen,Def)   -> [aepl++"anna"]+     (Pl,Dat,Def)   -> [aepl++"umin"]+     (Pl,_,Def)     -> [aepl++"it"]+  where aepl = tk 1 aepli++-- Adjective+-- strong+{-+ helagher_rule :: String -> AV+ mither_rule   :: String -> AV + gamal_rule    :: String -> AV+ kristin_rule  :: String -> AV+-}++comparative :: (Gender,Number,Case) -> String -> [String]+comparative (g,n,c) blar = +  case (g,n,c) of+   (Fem,Sg,_)    -> [blar++"e",blar++"i"]+   (Masc,Sg,Nom) -> [blar++"e",blar++"i"]+   (_,Sg,_)      -> [blar++"e",blar++"i",blar++"a"]+   (_,Pl,Gen)    -> [blar++"a"]+   (_,Pl,Dat)      -> [blar++"e",blar++"i",blar++"om",blar++"um"]+   (_,Pl,_)      -> [blar++"e",blar++"i"]++blar_rule     :: String -> AV+blar_rule blar para =+ strings $ +  case para of+   (StrongPos g n c) -> blar_strong_rule blar (g,n,c)+   (WeakPos g n c)   -> blar_weak_rule  blar (g,n,c)+   (Comp g n c)      -> comparative (g,n,c) blar+   (Super)           -> [blar++"er"]++langer_rule     :: String -> AV+langer_rule langer para =+ strings $ +  case para of+   (StrongPos g n c) -> langer_strong_rule langer (g,n,c)+   (WeakPos g n c)   -> langer_weak_rule  langer (g,n,c)+   (Comp g n c)      -> comparative (g,n,c) (laeng ++ "r")+   (Super)           -> [laeng++"ster"]+ where lang  = tk 2 langer+       laeng = changeVowel "æ" lang++helagher_rule :: String -> AV+helagher_rule helagher para =+ strings $ +  case para of+   (StrongPos g n c) -> helagher_strong_rule helagher (g,n,c)+   (WeakPos g n c)   -> langer_weak_rule  helagher (g,n,c)+   (Comp g n c)      -> comparative (g,n,c) (helagh ++ "r")+   (Super)           -> [helagh++"ster"]+ where helagh  = tk 2 helagher++blar_strong_rule :: String -> (Gender,Number,Case) -> [String]+blar_strong_rule blar para =+ case para of+  (Masc,Sg,Nom) -> [bla++"r",bla]+  (Masc,Sg,Gen) -> [bla++"s"]+  (Masc,Sg,Dat) -> [bla++suff | suff <- ["om","m","r","ur"]]+  (Masc,Sg,Ack) -> [bla++"n"]+  (Masc,Pl,Nom)   -> [bla++suff | suff <- ["","ir","r"]]+  (Fem,Sg,Gen)  -> [bla++"r",bla]+  (Fem,Sg,Dat)  -> [bla++"e",bla]+  (Fem,Pl,Nom)    -> [bla++"r",bla]+  (Fem,Pl,Ack)    -> [bla++"r",bla]+  (Neut,Sg,Gen) -> [bla++"s"]+  (Neut,Sg,Dat) -> [bla ++ suff | suff <- ["","o","u"]]+  (Neut,Sg,_)   -> [bla++"t", bla++"tt"]+  (_,Pl,Dat)      -> [bla++suff | suff <- ["om","m","um"]]+  _               ->  [bla]+ where bla = tk 1 blar++blar_weak_rule :: String -> (Gender,Number,Case) -> [String]+blar_weak_rule blar para = + case para of+  (Masc,Sg,Nom) -> [bla++suff | suff <- ["","e","i"]]+  (Masc,Sg,_)     -> [bla]+  (Masc,Pl,_)     -> blao_blau+  (Fem,Sg,Nom)    -> [bla]+  (Fem,Sg,_)      -> blao_blau+  (Fem,Pl,_)      -> blao_blau+  (Neut,Sg,_)     -> [bla]+  (Neut,Pl,_)     -> blao_blau+ where blao_blau = [bla++suff | suff <- ["","o","u"]]+       bla       = tk 1 blar++langer_weak_rule :: String -> (Gender,Number,Case) -> [String]+langer_weak_rule langer para =+    case para of+     (Fem,Sg,Nom)    -> langa+     (Fem,_,_)       -> lango_langu+     (Masc,Sg,Nom)   -> [lang++x | x <- ["i","e"]]+     (Masc,Sg,_)     -> langa+     (Masc,Pl,_)     -> lango_langu+     (Neut,Sg,_)     -> langa+     (Neut,Pl,_)     -> lango_langu+  where lang        = tk 2 langer+        lango_langu = [lang++ x | x <- ["o","u"]]+        langa       = [lang++"a"]++langer_strong_rule :: String -> (Gender,Number,Case) -> [String]+langer_strong_rule langer para =+ case para of+  (Masc,Sg,Nom)   -> [langer]+  (Masc,Sg,Gen)   -> [lang++"s"]+  (Masc,Sg,Dat)   -> [lang++"om",lang++"um"]+  (Masc,Sg,Ack)   -> [lang++"an", lang++"æn"]+  (Masc,Pl,Nom)   -> [lang++suff | suff <- ["i","e","ir","er"]]+  (Masc,Pl,Ack)   -> [lang++"a",lang++"æ"]+  (Fem,Sg,Nom)    -> [lang]+  (Fem,Sg,Gen)    -> [lang++suff | suff <- ["a","ra","ar","rar",                                            "æ","ræ","ær","rær"]]+  (Fem,Sg,Dat)    -> [lang++suff | suff <- ["i","ri","e","re"]]+  (Fem,Sg,Ack)    -> [lang++"a", lang++"æ"]+  (Fem,Pl,Nom)    -> [lang++suff | suff <- ["a","ar","æ","ær"]]+  (Fem,Pl,Ack)    -> [lang++suff | suff <- ["a","ar","æ","ær"]]+  (Neut,Sg,Gen)   -> [lang++"s"]+  (Neut,Sg,Dat)   -> [lang++"o",lang++"u"]+  (Neut,Sg,_)     -> [lang++"t"]+  (Neut,Pl,Nom)   -> [lang]+  (Neut,Pl,Ack)   -> [lang]+  (_,Pl,Gen)      -> [lang++suff | suff <- ["a","ra","æ","ræ"]]+  (_,Pl,Dat)      -> [lang++suff | suff <- ["om","m","um"]]+ where lang = tk 2 langer++helagher_strong_rule :: String -> (Gender,Number,Case) -> [String]+helagher_strong_rule helagher para =+ case para of+  (Masc,Sg,Nom)   -> [helagher]+  (Masc,Sg,Gen)   -> [hela++"x"]+  (Masc,Sg,Dat)   -> [haelgh++"om",haelgh++"um"]+  (Masc,Sg,Ack)   -> [haelgh++"an", haelgh++"æn"]+  (Masc,Pl,Nom)   -> [haelgh++suff | suff <- ["i","e","ir","er"]]+  (Masc,Pl,Ack)   -> [haelgh++"a",haelgh++"æ"]+  (Fem,Sg,Nom)    -> [helagh]+  (Fem,Sg,Gen)    -> [haelgh++suff | suff <- ["a","ra","ar","rar",+                                              "æ","ræ","ær","rær"]]+  (Fem,Sg,Dat)    -> [haelgh++suff | suff <- ["i","ri","e","re"]]+  (Fem,Sg,Ack)    -> [haelgh++"a", haelgh++"æ"]+  (Fem,Pl,Nom)    -> [haelgh++suff | suff <- ["a","ar","æ","ær"]]+  (Fem,Pl,Ack)    -> [haelgh++suff | suff <- ["a","ar","æ","ær"]]+  (Neut,Sg,Gen)   -> [hela++"x"]+  (Neut,Sg,Dat)   -> [haelgh++"o",haelgh++"u"]+  (Neut,Sg,_)     -> [hela++"kt"]+  (Neut,Pl,Nom)   -> [helagh]+  (Neut,Pl,Ack)   -> [helagh]+  (_,Pl,Gen)      -> [haelgh++suff | suff <- ["a","ra","æ","ræ"]]+  (_,Pl,Dat)      -> [haelgh++suff | suff <- ["om","m","um"]]+ where helagh = tk 2 helagher+       hela   = tk 2 helagh+       haelgh = changeVowel "æ" (tk 1 hela) ++ "gh"++-------------------------------------------------+-- Adverb++opta_rule :: String -> Adverb+opta_rule opta (AdverbForm g) = +    mkStr $ case g of+              Posit  -> opta  +              Compar -> opta++"r"+              Superl -> opta++"st"    +++laenger_rule :: String -> Adverb+laenger_rule laenge (AdverbForm g) = +    mkStr $ case g of+              Posit  -> laenge  +              Compar -> laenge++"r"+              Superl -> (tk 1 laenge)++"st"    ++yter_rule :: String -> Adverb+yter_rule yter (AdverbForm g) = +    mkStr $ case g of+              Posit  -> yter  +              Compar -> yter++"mer"+              Superl -> yter++"st"    ++-------------------------------------------------++ord_fyrsti_rule :: String -> Ordinal+ord_fyrsti_rule  fyrsti (OrdF g n c) =+  strings $+    case (g,n,c) of+     (Masc,Sg,Nom)    -> [fyrsti]+     (Masc,Sg,_)      -> [fyrsti++"a"]+     (Fem,Sg,Nom)     -> [fyrsti++"a",fyrsti]+     (Neut,Sg,_)      -> [fyrsti++"a"]+     _                -> [fyrsti++"u"]++ord_annar_rule :: Ordinal+ord_annar_rule (OrdF g n c) =+  strings $+    case (g,n,c) of+     (Masc,Sg,Nom)    -> ["annar","annan"]+     (Masc,Sg,Gen)    -> ["annars"]+     (Masc,Sg,Ack)    -> ["annan"]+     (Masc,Sg,Dat)    -> ["aþrum","aþrom","andrum","androm"]+     (Masc,Pl,Nom)    -> ["aþri","aþrir","andri","andrir"]+     (Masc,Pl,Ack)    -> ["aþra","andra"]+     (Fem,Sg,Nom)   -> ["annur","annor"]+     (Fem,Sg,Gen)   -> ["annara","annarra", "annarar","annarrar"]+     (Fem,Sg,Dat)   -> ["annari","annarri"]+     (Fem,Sg,Ack)   -> ["aþra","andra"]+     (Fem,Pl,Nom)     -> ["aþra","andra","aþrar","andrar"]+     (Fem,Pl,Ack)     -> ["aþrar","andra","andrar"]+     (Neut,Sg,Nom)    -> ["annat"]+     (Neut,Sg,Gen)    -> ["annars"]+     (Neut,Sg,Dat)    -> ["aþru","aþro","andru","andro"]+     (Neut,Sg,Ack)    -> ["annat"]+     (Neut,Pl,Nom)    -> ["annur","annor"]+     (Neut,Pl,Ack)    -> ["annur","annor"]+     (_,Pl,Gen)       -> ["annara","annarra","andra"]+     (_,Pl,Dat)       -> ["aþrum","aþrom","andrum","androm"]++-- Pronomen++sin_rule :: String -> Pronoun+sin_rule sin (PNF g n c) = + strings $+ case (g,n,c) of+  (_,Pl,Gen)    -> [sin++"na"]+  (_,Pl,Dat)    -> [sin++"um",sin++"om"]+  (Masc,Sg,Gen) -> [sin++"s"]+  (Masc,Sg,Dat) -> [sin++"um",sin++"om"]+  (Masc,Sg,_)   -> [sin]+  (Masc,Pl,Nom) -> [sin++"i",sin++"ir"]+  (Masc,Pl,Ack) -> [sin++"a"]+  (Fem,Sg,Nom)  -> [sin]+  (Fem,Sg,Gen)  -> [sin++"na",sin++"nar"]+  (Fem,Sg,Dat)  -> [sin++"ni",sin++"ne"]+  (Fem,Sg,Ack)  -> [sin++"a"]+  (Fem,Pl,_)    -> [sin++"a",sin++"ar"]+  (Neut,Sg,Gen) -> [sin++"s"]+  (Neut,Sg,Dat) -> [sin++"u",sin++"o"]+  (Neut,Sg,_)   -> [si ++ "t"]+  (Neut,Pl,_)   -> [sin]+ where si = tk 1 sin++var_rule :: Pronoun+var_rule (PNF g n c) = + case (g,n,c) of+  (Masc,Sg,Ack) -> strings ["van", "varn"]+  (_,Pl,Gen)    -> strings ["varra"]+  (Fem,Sg,Gen)  -> strings ["varra","varrar"]+  (Neut,Sg,Nom) -> strings ["vart"]+  (Neut,Sg,Ack) -> strings ["vart"]+  _             -> sin_rule "var" (PNF g n c)++ithar_rule :: Pronoun+ithar_rule (PNF g n c) = + strings $+ case (g,n,c) of+  (_,Pl,Gen)    -> ["iþra"]+  (_,Pl,Dat)    -> ["iþrum","iþrom"]+  (Masc,Sg,Nom) -> ["iþar"]+  (Masc,Sg,Gen) -> ["iþars"]+  (Masc,Sg,Dat) -> ["iþrum","iþrom"]+  (Masc,Sg,Ack) -> ["iþan"]+  (Masc,Pl,Nom) -> ["iþri", "iþrir"]+  (Masc,Pl,Ack) -> ["iþra"]+  (Fem,Sg,Nom)  -> ["iþur"]+  (Fem,Sg,Gen)  -> ["iþra","iþrar"]+  (Fem,Sg,Dat)  -> ["iþre"]+  (Fem,Sg,Ack)  -> ["iþra"]+  (Fem,Pl,_)    -> ["iþra","iþrar"]+  (Neut,Sg,Nom) -> ["iþart"]+  (Neut,Sg,Gen) -> ["iþars"]+  (Neut,Sg,Dat) -> ["iþru","iþro"]+  (Neut,Sg,Ack) -> ["iþart"]+  (Neut,Pl,_)   -> ["iþur"]++thaen_rule :: Pronoun+thaen_rule (PNF g n c) = + strings $+ case (g,n,c) of+  (_,Pl,Gen)    -> ["þera", "þerra", "þæra", "þærra"]+  (_,Pl,Dat)    -> ["þem","þom","þøm"]+  (Masc,Sg,Nom) -> ["þæn"]+  (Masc,Sg,Gen) -> ["þæs"]+  (Masc,Sg,Dat) -> ["þem","þæm","þøm"]+  (Masc,Sg,Ack) -> ["þæn","þen"]+  (Masc,Pl,Nom) -> ["þe", "þer"]+  (Masc,Pl,Ack) -> ["þa","þe"]+  (Fem,Sg,Nom)  -> ["þe","þøn"]+  (Fem,Sg,Gen)  -> ["þera","þærra"]+  (Fem,Sg,Dat)  -> ["þeri","þere","þerre"]+  (Fem,Sg,Ack)  -> ["þa"]+  (Fem,Pl,_)    -> ["þa","þar","þæ","þær","þe","þer"]+  (Neut,Sg,Nom) -> ["þæt"]+  (Neut,Sg,Gen) -> ["þæs"]+  (Neut,Sg,Dat) -> ["þy","þi","þe"]+  (Neut,Sg,Ack) -> ["þæt"]+  (Neut,Pl,_)   -> ["þøn","þe"]++thaeni_rule :: Pronoun+thaeni_rule (PNF g n c) = + strings $+ case (g,n,c) of+  (_,Pl,Gen)    -> ["þæssa"]+  (_,Pl,Dat)    -> ["þæssum","þæmma","þænna"]+  (Masc,Sg,Nom) -> ["þænni","þænne"]+  (Masc,Sg,Gen) -> ["þæssa"]+  (Masc,Sg,Dat) -> ["þæssum","þæssom","þæmma","þænna"]+  (Masc,Sg,Ack) -> ["þænna"]+  (Masc,Pl,Nom) -> ["þæssi", "þæssir"]+  (Masc,Pl,Ack) -> ["þæssa"]+  (Fem,Sg,Nom)  -> ["þæssi","þæsse"]+  (Fem,Sg,Gen)  -> ["þæssa"]+  (Fem,Sg,Dat)  -> ["þæssi","þæsse"]+  (Fem,Sg,Ack)  -> ["þæssa","þænna"]+  (Fem,Pl,_)    -> ["þæssa","þæssar"]+  (Neut,Sg,Nom) -> ["þætta"]+  (Neut,Sg,Gen) -> ["þæssa"]+  (Neut,Sg,Dat) -> ["þæssu","þæsso"]+  (Neut,Sg,Ack) -> ["þætta"]+  (Neut,Pl,_)   -> ["þæssi","þæssin","þænne","þæsson","þæssa","þæssom"]+++hvar_rule :: Pronoun+hvar_rule (PNF g n c) = + strings $+ case (g,n,c) of+   (_,Pl,_)      -> []+   (Fem,Sg,_)    -> []+   (Masc,Sg,Nom) -> ["hva","hvar","ha","har"]+   (Masc,Sg,Gen) -> ["hvas","hvæs","hves","hvess"]+   (Masc,Sg,Dat) -> ["hvem"]+   (Masc,Sg,Ack) -> ["hvan","hvem","hven"]+   (Neut,Sg,Nom) -> ["hvat","hvadh"]+   (Neut,Sg,Gen) -> ["hvas","hvæs"]+   (Neut,Sg,Dat) -> ["hvi"]+   (Neut,Sg,Ack) -> ["hvat","hvadh"]+ +hvilkin_rule :: Pronoun+hvilkin_rule (PNF g n c) = + strings $+ case (g,n,c) of+  (_,Pl,Gen)    -> ["hvilika","hvilikra"]+  (_,Pl,Dat)    -> ["hvilikum","hvilikom"]+  (Masc,Sg,Nom) -> ["hvilikin"]+  (Masc,Sg,Gen) -> ["hvilikins"]+  (Masc,Sg,Dat) -> ["hvilikom","hvilikum"]+  (Masc,Sg,Ack) -> ["hvilikin"]+  (Masc,Pl,Nom) -> ["hviliki","hvilike"]+  (Masc,Pl,Ack) -> ["hvilika"]+  (Fem,Sg,Nom)  -> ["hvilikin"]+  (Fem,Sg,Gen)  -> ["hvilika","hvilikra"]+  (Fem,Sg,Dat)  -> ["hviliki","hvilikri","hvilike"]+  (Fem,Sg,Ack)  -> ["hvilika"]+  (Fem,Pl,_)    -> ["hvilika"]+  (Neut,Sg,Nom) -> ["hvilikit"]+  (Neut,Sg,Gen) -> ["hvilikins"]+  (Neut,Sg,Dat) -> ["hviliku","hviliko"]+  (Neut,Sg,Ack) -> ["hvilikit"]+  (Neut,Pl,_)   -> ["hvilikin"]++nokor_rule :: Pronoun+nokor_rule (PNF g n c) = + strings $+ case (g,n,c) of+  (_,Pl,Dat)     -> ["nakrom","nakvarom","nokrum","nokorum"]+  (Masc,Sg,Nom)  -> ["nakvar","nokor"]+  (Masc,Sg,Gen)  -> ["nakvars","nokors"]+  (Masc,Sg,Dat)  -> ["nakrom","nakvarom","nokrum","nokorum"]+  (Masc,Sg,Ack)  -> ["nakvan","nakvarn","nakon"]+  (Masc,Pl,Gen)  -> ["nakra","nakwara","nokra","nokora"]+  (Masc,Pl,Nom)  -> [x ++ y | x <- ["nakri","nakvari","nokri","nokori"], y <- ["","r"]]+  (Masc,Pl,Ack)  -> ["nakra","nakvara","nokra","nokora"]+  (Fem,Sg,Nom)   -> [x ++ y | x <- ["nakra","nakvara","nokra","nokora"], y <- ["","r"]]+  (Fem,Sg,Gen)   -> ["nakra","nakvara","nokra","nokora"]+  (Fem,Sg,Dat)   -> ["nakre","nakvare","nokri","nokori"]+  (Fem,Sg,Ack)   -> ["nakra","nakvara","nokra","nokora"]+  (Fem,Pl,Gen)     -> ["nakra","nakwara","nokra","nokora"]+  (Fem,Pl,_)     -> [x ++ y | x <- ["nakra","nakvara","nokra","nokora"], y <- ["","r"]]+  (Neut,Sg,Nom)  -> ["nakvat","nokot"]+  (Neut,Sg,Gen)  -> ["nakvars","nokors"]+  (Neut,Sg,Dat)  -> ["nakro","nakvaro","nokru","nokoru"]+  (Neut,Sg,Ack)  -> ["nakvat","nokot"]+  (Neut,Pl,Gen) -> ["nakra","nakwara","nakrar","nakwarar","nokra","nokora"]+  (Neut,Pl,_)    -> ["nakor","nokor"]++aengin_rule :: Pronoun+aengin_rule (PNF g n c) = + strings $+ case (g,n,c) of+  (_,Pl,Gen)    -> ["ænga","ængra"]+  (_,Pl,Dat)    -> ["ængum","ængom"]+  (Masc,Sg,Nom) -> ["ængin"]+  (Masc,Sg,Gen) -> ["ængsins"]+  (Masc,Sg,Dat) -> ["ængum","ængom"]+  (Masc,Sg,Ack) -> ["ængin"]+  (Masc,Pl,Nom) -> ["ængi","ænge"]+  (Masc,Pl,Ack) -> ["ænga"]+  (Fem,Sg,Nom)  -> ["ængin","ængon"]+  (Fem,Sg,Gen)  -> ["ænga","ænginna"]+  (Fem,Sg,Dat)  -> ["ængi","ænginni","ænge","ænginne"]+  (Fem,Sg,Ack)  -> ["ænga"]+  (Fem,Pl,_)    -> ["ænga","ængar"]+  (Neut,Sg,Nom) -> ["ænkti","ænkte","ængte","ænti","ækki"]+  (Neut,Sg,Gen) -> ["ængsings"]+  (Neut,Sg,Dat) -> ["ængu","ængo"]+  (Neut,Sg,Ack) -> ["ænkti","ænkte","ængte","ænti","ækki"]+  (Neut,Pl,_)   -> ["ængin","ængon"]+++hvaer_rule :: Pronoun+hvaer_rule (PNF g n c) = + strings $+ case (g,n,c) of+   (_,Pl,_)      -> []+   (Masc,Sg,Nom) -> ["hvar"]+   (Masc,Sg,Gen) -> ["hvars"]+   (Masc,Sg,Dat) -> ["hvarium","hvariom"]+   (Masc,Sg,Ack) -> ["hvarn"]+   (Fem,Sg,Nom) -> ["hvar","hvarium","hvarion"]+   (Fem,Sg,Gen) -> ["hvarra","hvaria"]+   (Fem,Sg,Dat) -> ["hvare","hvarre", "hvarie","hvario"]+   (Fem,Sg,Ack) -> ["hvaria"]+   (Neut,Sg,Nom) -> ["hvart"]+   (Neut,Sg,Gen) -> ["hvars"]+   (Neut,Sg,Dat) -> ["hvariu","hvario"]+   (Neut,Sg,Ack) -> ["hvart"]++hvarghin_rule :: Pronoun+hvarghin_rule (PNF g n c) = + strings $+ case (g,n,c) of+   (_,Pl,_)      -> []+   (Fem,Sg,Ack)  -> ["hvargha"]+   (Fem,_,_)     -> []+   (Masc,Sg,Nom) -> ["hvarghin"]+   (Masc,Sg,Gen) -> ["hvarghins"]+   (Masc,Sg,Dat) -> ["hvarghum","hvarghom"]+   (Masc,Sg,Ack) -> ["hvarghin"]+   (Neut,Sg,Dat) -> ["hvarghu","hvargho"]+   (Neut,Sg,Gen) -> []+   (Neut,Sg,_)   -> ["hvarki","hvarti","hvarte","hvarghit"]+++person_rule :: PPronoun+person_rule t = strings $ case t of+   (First Sing Nom)  -> ["iak","iæk","iagh"]+   (First Sing Gen)  -> ["min"]+   (First Sing Dat)  -> ["mæ","mær","mik","migh"]+   (First Sing Ack)  -> ["mik","migh"]+   (First Dual Nom)  -> ["vit"]+   (First Dual Gen)  -> ["okar","okkar"]+   (First Dual _)  -> ["oker"]+   (First Plu Nom)   -> ["vi","vir"]+   (First Plu Gen)   -> ["var","vara","varra"]+   (First Plu _)     -> ["os"]+   (Second Sing Nom) -> ["þu"]+   (Second Sing Gen) -> ["þin"]+   (Second Sing Dat) -> ["þä","þär","þik","digh"]+   (Second Sing Ack) -> ["þik","thigh","digh"]+   (Second Dual Nom) -> ["it"]+   (Second Dual Gen) -> ["ikar","ikkar"]+   (Second Dual _) -> ["iker"]+   (Second Plu Nom)  -> ["i","ir"]+   (Second Plu Gen)  -> ["iþar","iþra"]+   (Second Plu _)    -> ["iþer"]+   (Refl Sing Nom)   -> []+   (Refl Sing Gen)   -> ["sin"]+   (Refl Sing Dat)   -> ["sæ","sær","sik","sigh"]+   (Refl Sing Ack)   -> ["sik","sigh"]+   (Refl Dual Nom)   -> []+   (Refl Dual Gen)   -> ["sin"]+   (Refl Dual  _)   -> ["sæ","sær","sik"]+   (Refl Plu Nom)    -> []+   (Refl Plu Gen)    -> ["sin"]+   (Refl Plu Dat)    -> ["sæ","sær","sik"]+   (Refl Plu Ack)    -> ["sæ","sær","sik"]+++hanhon_rule :: Pronoun+hanhon_rule (PNF g n c) = + strings $+ case (g,n,c) of+   (_,Pl,_)      -> []+   (Neut,Sg,_)    -> []+   (Masc,Sg,Nom) -> ["han"]+   (Masc,Sg,Gen) -> ["hans"]+   (Masc,Sg,Dat) -> ["hanum","honum","honom"]+   (Masc,Sg,Ack) -> ["han"]+   (Fem,Sg,Nom) -> ["hon"]+   (Fem,Sg,Gen) -> ["hænna","hænnar","hænnas","hænnes"]+   (Fem,Sg,Dat) -> ["hænni","hænne"]+   (Fem,Sg,Ack) -> ["hana","hona"]++-- Verb++passivum :: Vox -> [String] -> Str+passivum p xs = + strings $ +  case p of+   Act  -> xs+   Pass -> map (++"s") xs++indicative_pl :: (Person,Modus,Vox) -> String -> Str+indicative_pl (p,m,v) stem = + passivum v $+  case (m,p) of+   (_,P1)    -> [stem ++ "um", stem ++ "om"]+   (_,P2)    -> [stem ++ "in"]+   (Ind, P3) -> [stem ++ "a"]+   (Conj,P3) -> [stem ++ suf | suf <- ["i","in","e","en"]]++imperative_pl :: Person12 -> String -> Str+imperative_pl p stem =+ strings $+  case p of +   Pers1 -> [stem ++ "um", stem ++ "om"]+   Pers2 -> [stem ++ "in"]++preteritum_ind_pl :: (Person,Vox) -> String -> Str+preteritum_ind_pl (p,v) stem =+ passivum v $+  case p of+   P1  -> [stem++"þum",stem++"þom"] +   P2  -> [stem++"þin"]+   P3  -> [stem++"þu", stem++"þo"]++preteritum_conj_pl :: (Person,Vox) -> String -> Str+preteritum_conj_pl (p,v) stem =+ passivum v $+  case p of+   P1  -> [stem++"þum",stem++"þom"] +   P2  -> [stem++"þin"]+   P3  -> [stem++"þi", stem++"þin"]++v_to_f :: String -> String+v_to_f stem+ | last stem == 'v' = init stem ++ "f"+ | otherwise        = stem+++-- svaga verb++aelska_rule :: String -> Verb+aelska_rule aelska p = +  case p of+   PresSg Ind Act   -> strings [aelska++"r",aelska]+   (PresSg Ind Pass)  -> strings [aelska ++"s"]+   (Inf v)            -> passivum v [aelska]+   (ImperSg)          -> strings [aelska]+   (ImperPl per)      -> imperative_pl      per       aelsk+   (PresPl per m v)   -> indicative_pl      (per,m,v) aelsk+   (PretInd Pl per v) -> preteritum_ind_pl  (per,v)   aelsk+   (PretConjPl per v) -> preteritum_conj_pl (per,v)  (aelsk++"a")+   (PresSg Conj v)    -> passivum v [aelsk++"i",aelsk++"e"]+   (PretInd Sg _ v)   -> passivum v [aelska++"þi"] +   (PretConjSg v)     -> passivum v [aelska++"þi", aelska++"þe"]+ where aelsk  = tk 1 aelska++kraevia_rule :: String -> Verb+kraevia_rule kraevia p =+ case p of+   (PresSg Ind Act)     -> strings    [kraev++"er"]+   (PresSg Ind Pass)    -> strings    [kraef++"s"]+   (Inf v)              -> passivum v [kraevia]+   (ImperSg)            -> strings    [kraef]+   (ImperPl Pers1)      -> strings    [kraef++"ium",kraef++"iom"]+   (ImperPl Pers2)      -> strings    [kraev++"i"]+   (PresPl P1   _ v)    -> passivum v [kraef++"ium",kraef++"iom"]+   (PresPl P2 Ind v)    -> passivum v [kraev++"i"]+   (PresPl P3 Ind v)    -> passivum v [kraef++"ia"]+   (PretInd Sg _ v)     -> passivum v [kraf++"þi"] +   (PretConjSg v)       -> passivum v [kraf++"þi", kraf++"þe"]+   (PretInd Pl per v)   -> preteritum_ind_pl (per,v) kraf+   (PretConjPl per v)   -> preteritum_conj_pl (per,v) kraf+   _                    -> aelska_rule (kraev++"a") p+ where kraev = tk 2 kraevia+       kraef = v_to_f kraev+       kraf  = case findStemVowel kraef of+                 (pre,_,suf) -> pre ++ "a" ++ suf+         +foera_rule :: String -> Verb+foera_rule foera p = + case p of+   (PresSg Ind Act)     -> strings [foer++"ir", foer++"i"]+   (PresSg Ind Pass)    -> strings [foer++"s"]+   (Inf v)              -> passivum v [foera]+   (ImperSg)            -> strings [foer]+   (PretInd Pl per v)   -> preteritum_ind_pl  (per,v) foer+   (PretConjPl per v)   -> preteritum_conj_pl (per,v) foer+   (PretInd Sg _ v)     -> passivum v [foer++"þi"]+   (PretConjSg v)       -> passivum v [foer++"þi", foer++"þe"]+   _                    -> aelska_rule foera p+ where foer = tk 1 foera++is_pret :: VerbForm -> Bool+is_pret v = elem v $+            [PretInd  n p v | v <- values, n <- values, p <- values] +++            [PretConjSg   v | v <- values]                           +++            [PretConjPl p v | v <- values, p <- values] ++is_pres :: VerbForm -> Bool+is_pres v = elem v $ +           [PresSg     m v | v <- values, m <- values] +++           [PresPl   p m v | v <- values, m <- values, p <- values] +  +liva_rule :: String -> Verb+liva_rule liva p = + case p of+   (PresSg Ind Act)  -> strings [liv++"er", liv++"ir", liv++"i"]+   (PresSg Ind Pass) -> strings [lif++"s"]+   ImperSg           -> strings [lif]+   p | is_pret p     -> foera_rule (lif++"a") p+   _                 -> foera_rule liva p+ where liv = tk 1 liva+       lif = v_to_f liv++-- starka verb++vika_rule :: String -> Verb+vika_rule vika p = +  case p of+   (PresSg Ind Act)   -> strings [vik++"er"]+   (PresSg Ind Pass)  -> strings [vik ++"s"]+   (Inf v)            -> passivum v [vika]+   (ImperSg)          -> strings [vik]+   (ImperPl per)      -> imperative_pl      per       vik+   (PresPl per m v)   -> indicative_pl      (per,m,v) vik+   (PretInd Pl P1 v)  -> passivum v  [vik++"um",vik++"om"]+   (PretInd Pl P2 v)  -> passivum v  [vik++"in"]+   (PretInd Pl P3 v)  -> passivum v  [vik++"u",vik++"o"]+   (PretConjPl P1 v)  -> passivum v  [vik++"um",vik++"om"]+   (PretConjPl P2 v)  -> passivum v  [vik++"in"]+   (PretConjPl P3 v)  -> passivum v  [vik++"i",vik++"in"]+   (PresSg Conj v)    -> passivum v [vik++"i",vik++"e"]+   (PretInd Sg P2 v)  -> passivum v [vek++"t"]+   (PretInd Sg _ v)   -> passivum v [vek]+   (PretConjSg v)     -> passivum v [vik++"i", vik++"e"]+ where vik  = tk 1 vika+       vek  = changeVowel "e" vik++laesa_rule :: String -> Verb+laesa_rule laesa p = +  case p of+   (PresSg Ind Act)   -> strings [laes]+   (PresSg Ind Pass)  -> strings [laes]+   (Inf v)            -> passivum v [laesa]+   (ImperSg)          -> strings [laes]+   (ImperPl per)      -> imperative_pl      per       laes+   (PresPl per m v)   -> indicative_pl      (per,m,v) laes+   (PretInd Pl P1 v)  -> passivum v  [las++"um",las++"om"]+   (PretInd Pl P2 v)  -> passivum v  [las++"in"]+   (PretInd Pl P3 v)  -> passivum v  [las++"u",las++"o"]+   (PretConjPl P1 v)  -> passivum v  [las++"um",las++"om"]+   (PretConjPl P2 v)  -> passivum v  [las++"in"]+   (PretConjPl P3 v)  -> passivum v  [las++"i",las++"in"]+   (PresSg Conj v)    -> passivum v [laes++"i",laes++"e"]+   (PretInd Sg P2 v)  -> passivum v [las++"ts"]+   (PretInd Sg _ v)   -> passivum v [las]+   (PretConjSg v)     -> passivum v [las++"i", las++"e"]+ where  laes  = tk 1 laesa+        las   = changeVowel "a" (tk 1 laesa)++-- Auxilary functions+-- Handles the umlaut phenomena.++isVowel :: Char -> Bool+isVowel c = elem c "aeiouyæø"+++changeVowel :: String -> String -> String+changeVowel vowel s = case findStemVowel s of+                         (spr,i,ck) -> spr ++ vowel ++ ck++-- Assumes that the stem vowel is the last vowel or diphtong in +-- the input stem.+findStemVowel :: String -> (String, String, String)+findStemVowel sprick = (reverse rps, reverse i, reverse kc) where+  (kc, irps) = break isVowel $ reverse sprick+  (i,   rps) = span  isVowel $ irps++umlaut :: String -> String+umlaut man = m ++ mkUm a ++ n where+  (m,a,n) = findStemVowel man+  mkUm v = case v of+    "a" -> "æ"+    "o" -> "ø"+    _   -> v
+ src/fsv/Test.hs view
@@ -0,0 +1,42 @@+module Test (tests) where++import List+import Frontend+import Char+import Maybe+import TestGen+import qualified Data.Set as Set++tests :: (PositiveTests, NegativeTests)+tests = (pos,neg)+ where + pos = pos_gen_rules+ neg = neg_gen_rules++-- General rules+pos_gen_rules = [contains_vowel, contains_consonant]++neg_gen_rules = [symbols]++-- every word, with some exceptions, should contain a vowel.+contains_vowel :: TestInput -> Result+contains_vowel t+  | or [is_vowel c | c <- w t] || null (w t)          = pass+  | otherwise                                         = message t "no vowel"++-- every word, with some exceptions, should contain a consonant.+contains_consonant :: TestInput -> Result+contains_consonant t+ | is_abbr t || (tcat t) == "nl"                = pass+ | or [is_consonant c | c <- w t] || null (w t) = pass+ | otherwise                                    = message t "no consonant"++-- no consecutive symbols.+symbols :: TestInput -> Result+symbols t+ | traverse (w t) +   $ \s -> (case s of +             (c:c1:_) | c == c1 && elem c "-:\"+." -> True+             _        -> False) = message t "consecutive symbols"+ | otherwise = pass+
+ src/fsv/TestGen.hs view
@@ -0,0 +1,134 @@+module TestGen where++import List+import Frontend+import Char+import Maybe++is_a_word  = isJust . tword++not_a_word = not . isJust . tword++p_pos t = takeWhile (/='_') (tpara t)++p_annotation t =  +    case dropWhile (/='_') (tpara t) of+      (_:xs) -> takeWhile (/='_') xs++p_word t = case dropWhile (/='_') (tpara t) of+             (_:xs) -> case dropWhile (/='_') xs of+                         (_:ys) -> map f ys+ where f '_' = ' '+       f x   = x++id_pos   t = f (tid t)+ where f [] = error "invalid id: " ++ (tid t)+       f ('.':'.':'.':xs) = f ('.':'.':xs)+       f ('.':'.':xs)     = takeWhile (/='.') xs+       f (x:xs) = f xs ++id_lemma t = f (tid t)+ where f [] = error "invalid id: " ++ (tid t)+       f ('.':'.':'.':xs) = '.':f ('.':'.':xs)+       f ('.':'.':xs)     = []+       f (x:xs)           = x : f xs ++norm_id_lemma t = remove_number $ reverse $ i+  where i = id_lemma t+        remove_number (x:xs) +         | isDigit x = case dropWhile isDigit xs of+                         ('_':zs@(_:_)) -> reverse zs+                         _              -> i+         | otherwise = i++head_to_lemma_id = add_underscore . symbols . unspace . thead+ where unspace s = [if (x == ' ') then '_' else x | x <- s]+       symbols = concat . map tr+       add_underscore (x:xs)+        | isDigit x || elem x "-·" = ('_':x:xs)+        | otherwise = (x:xs)+       tr c = maybe [c] id $ lookup c +               [(':',"·3A"), ('\'',"·27"), ('/',"·2F"), ('+',"·2B"), +                (',',"·2C"),('°',"·B0"), ('%',"·25"),('=',"·3D"),('?',"·3F")] ++is_multi_word t = length pos > 2 && last pos == 'm' + where pos = tcat t++is_abbr t = last (tcat t) == 'a'++is_vowel c = elem c "aeiouyåäöAEIOUYÅÄÖüÜàÀæÆøØ"++is_consonant c = elem c "bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZþ"++traverse :: String -> (String -> Bool) -> Bool+traverse [] f = False+traverse s@(x:xs) f+ | f s       = True+ | otherwise = traverse xs f++member_str :: String -> String -> Bool+member_str pre s = traverse s (isPrefixOf pre)++decl :: TestInput -> Char -> Bool+decl t c+ | elem (tcat t) ["nn","nnm","nna"] =  (head (p_annotation t)) == c + | otherwise                        = False++conj :: TestInput -> Char -> Bool+conj t c+ | elem (tcat t) ["vb","vbm","vba"] =  (head (p_annotation t)) == c + | otherwise                        = False++param :: TestInput -> [String] -> Bool+param t xs = and [elem x (tparam t) | x <- xs]++is_no_plural :: TestInput -> Bool+is_no_plural t + | elem (tcat t) ["nn","nnm","nna"] = case (p_annotation t) of+                                        ('0':_) -> True+                                        _       -> False+ | otherwise      = False++gender :: TestInput -> Char -> Bool+gender t c+ | elem (tcat t) ["nn","nnm","nna"] = case p_annotation t of+                                        (_:x:_) -> c == x+ | otherwise                        = False++is_no_komp :: TestInput -> Bool+is_no_komp t+ | elem (tcat t) ["av","avm","ava"] = case dropWhile (/='_') (tpara t) of+                      (_:'0':'_':_) -> True+                      _             -> False+ | otherwise      = False++is_komp :: TestInput -> Bool+is_komp t+ | elem (tcat t) ["av","avm","ava"] = +     case dropWhile (/='_') (tpara t) of+       (_:x:_) | elem x "12v" -> True+       _                        -> False+ | otherwise      = False++is_no_pret_part :: TestInput -> Bool+is_no_pret_part t + | tcat t == "vb" = case p_annotation t of+                      (_:'m':_) -> True+                      _       -> False+ | otherwise      = False++is_verb_sd :: TestInput -> Bool+is_verb_sd t + | tcat t == "vb" = case p_annotation t of+                      (_:'s':_) -> True+                      (_:'d':_) -> True+                      _       -> False+ | otherwise      = False++is_pret_part :: TestInput -> Bool+is_pret_part t + | tcat t == "vb" = case p_annotation t of+                      (_:'a':_) -> True+                      _         -> False+ | otherwise      = False+
+ src/fsv/Types.hs view
@@ -0,0 +1,369 @@+module Types where++import General+import Invariant++-- Noun parameters.++data Gender = Masc | Fem | Neut+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Number = Sg | Pl+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data NumberD = Sing | Dual | Plu+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Species = Indef | Def+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Case = Nom | Gen | Dat | Ack+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data NN_Form = NN_C Number Case Species+  deriving (Eq, Ord, Show, Read)++instance Param Gender   where +    values = enum+    prValue Masc = "m"+    prValue Fem = "f"+    prValue Neut = "n"+instance Param Number   where +    values = enum+    prValue Sg = "sg"+    prValue Pl = "pl"+instance Param NumberD  where +    values = enum+    prValue Sing = "sg"+    prValue Dual = "dl"+    prValue Plu  = "pl"+instance Param Species  +    where values = enum+          prValue Indef = "indef"+          prValue Def = "def"+instance Param Case     +    where values = enum+          prValue Nom = "nom" +          prValue Gen = "gen"+          prValue Dat = "dat"+          prValue Ack = "ack"++instance Param NN_Form +  where values = [NN_C a b c | c <- values, a <- values, b <- values]+	prValue (NN_C a b c) = unwords [prValue a, prValue b, prValue c]++type NN = NN_Form -> Str++data Modus = Ind | Conj+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Vox = Act | Pass+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Grade = Posit | Compar | Superl+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Person = P1 | P2 | P3+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Person12 = Pers1 | Pers2+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param Modus    where +    values = enum+    prValue Ind = "ind"+    prValue Conj = "konj"+instance Param Vox      where +    values = enum+    prValue Act  = "akt"+    prValue Pass = "pass"+instance Param Grade    where +    values = enum+    prValue Posit  = "pos"+    prValue Compar = "komp"+    prValue Superl = "super"+instance Param Person   where +    values = enum+    prValue P1 = "p1"+    prValue P2 = "p2"+    prValue P3 = "p3"+instance Param Person12 where +    values = enum+    prValue Pers1 = "p1"+    prValue Pers2 = "p2"+-- adjectives++type AV = AdjForm -> Str++data AdjForm =+  StrongPos Gender Number Case +  | WeakPos   Gender Number Case +  | Comp      Gender Number Case +  | Super +  deriving (Eq, Ord, Show, Read)++instance Param AdjForm where +  values =            +    [WeakPos   a b c | a <- values, b <- values, c <- values] +++    [StrongPos a b c | a <- values, b <- values, c <- values] +++    [Comp      a b c | a <- values, b <- values, c <- values] ++ [Super]+  prValue (WeakPos a b c)   = "pos weak "   ++ prValue a ++ " " ++ prValue b ++ " " ++ prValue c+  prValue (StrongPos a b c) = "pos strong " ++ prValue a ++ " " ++ prValue b ++ " " ++ prValue c+  prValue (Comp a b c)      = "comp "       ++ prValue a ++ " " ++ prValue b ++ " " ++ prValue c+  prValue (Super)           = "super"++type Numeral = NumeralForm -> Str++data NumeralForm = NumF Case Gender+ deriving (Show,Eq)++instance Param NumeralForm where+  values = [NumF a b | b <- values, a <- values]+  prValue (NumF c g) = prValue c ++ " " ++ prValue g+++type Ordinal = OrdinalForm -> Str++data OrdinalForm = OrdF Gender Number Case+    deriving (Show,Eq)++instance Param OrdinalForm where+  values = [OrdF a b c | a <- values, b <- values, c <- values]+  prValue (OrdF g n c) = prValue g ++ " " ++ prValue n ++ " " ++ prValue c++-- verbs++type Verb = VerbForm -> Str++data VerbForm = +   PresSg     Modus  Vox+ | PresPl     Person Modus Vox+ | PretInd    Number Person Vox+ | Inf Vox+ | PretConjSg Vox+ | PretConjPl Person Vox+ | ImperSg+ | ImperPl Person12+  deriving (Eq, Ord, Show, Read)++instance Param VerbForm where+  values = [PresSg     m v | v <- values, m <- values]              +++           [PresPl   p m v | v <- values, m <- values, p <- values] +++           [PretInd  n p v | v <- values, n <- values, p <- values] +++           [PretConjSg   v | v <- values]                           +++           [PretConjPl p v | v <- values, p <- values]              +++           [Inf v | v <- values] +++           [ImperSg] ++ +           [ImperPl p | p <- values]+  prValue (PresSg m v)      = unwords ["pres",prValue m, prValue Sg, prValue v]+  prValue (PresPl p m v)    = unwords ["pres",prValue m, prValue Pl, prValue p, prValue v]+  prValue (PretInd n p v)   = unwords ["pret",prValue Ind, prValue n, prValue p, prValue v]+  prValue (PretConjSg v)    = unwords ["pret",prValue Conj, prValue Sg,prValue v] +  prValue (PretConjPl p v)  = unwords ["pret",prValue Conj, prValue Pl,prValue p,prValue v] +  prValue (ImperSg)         = unwords ["imper",prValue Sg]+  prValue (ImperPl p)       = unwords ["imper",prValue Pl, prValue p]+  prValue (Inf v)           = unwords ["inf",prValue v]++--- Pronoun++type Pronoun = PNForm -> Str++data PNForm = PNF Gender Number Case+   deriving (Eq,Ord,Show,Read)++instance Param PNForm where+   values = [PNF g n c | g <- values, n <- values, c <- values]+   prValue (PNF g n c) = unwords [prValue g, prValue n, prValue c]++type PPronoun = PPNForm -> Str++data PPNForm = First  NumberD Case |+               Second NumberD Case |+               Refl     NumberD Case+   deriving (Eq,Ord,Show,Read)++instance Param PPNForm where+   values = [First n c | n <- values, c <- values] +++            [Second n c | n <- values, c <- values] +++            [Refl n c | n <- values, c <- values]+   prValue (First n c)  = unwords ["p1",prValue n, prValue c]+   prValue (Second n c) = unwords ["p2",prValue n, prValue c]+   prValue (Refl n c)   = unwords ["refl",prValue n, prValue c]+++type Adverb = AdverbForm -> Str++data AdverbForm = AdverbForm Grade+  deriving (Eq, Ord, Show, Read)++instance Param AdverbForm where +    values = [AdverbForm g | g <- values]+    prValue (AdverbForm g) = prValue g++{-++-- price to pay for hierarchical types: if we want to define non-passive verbs+passiveForms :: [VerbForm]+passiveForms = +  map VF (concat [[Pres m Pass, Pret m Pass] | m <- values]) ++ +  map VI [Inf Pass, Sup Pass] ++ +  partPretForms++partPretForms :: [VerbForm]+partPretForms = [VI (PtPret a c) | a <- values, c <- values]++positiveForms :: [AdjForm]+positiveForms = [AF (Pos a) c | a <- values, c <- values]++-- adverbs++-- invariant adverbs++type AdverbInv = AdverbInvForm -> Str++data AdverbInvForm = AdverbInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AdverbInvForm where +			     values = enum+			     prValue _ = invar++-- invariant interrogative adverbs++type InterrogInv = InterrogInvForm -> Str++data InterrogInvForm = InterrogInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param InterrogInvForm where +			     values = enum+			     prValue _ = invar+++-------------------------------+-- closed classes -------------+-------------------------------++-- pronouns++type PronPN  = PronCasus -> Str+type PronAdj = AdjPronForm -> Str++data PronCasus = PNom | PAcc | PGen GenNum+  deriving (Eq, Ord, Show, Read)++instance Param PronCasus where+  values = PNom : PAcc : map PGen values++data AdjPronForm = AP GenNum Casus+  deriving (Eq, Ord, Show, Read)+++instance Param AdjPronForm where+  values = [AP g c | g <- values, c <- values]++type PronInv = PronInvForm -> Str++data PronInvForm = PronInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param PronInvForm where +			     values = enum+			     prValue _ = invar+++-- invariant+data InterjForm = InterjForm +  deriving (Eq, Ord, Show, Read, Enum, Bounded)++type Interjection = InterjForm -> Str++instance Param InterjForm where +  values = enum+  prValue _ = invar++-- articles++type Article = ArticleForm -> Str++data ArticleForm = ArticleForm GenNum+ deriving(Eq,Ord,Show,Read)++instance Param ArticleForm where +   values = [ArticleForm g | g <- values]+   prValue (ArticleForm g) = prValue g++-- auxiliary verbs++data AuxVerbForm = AuxInf | AuxPres | AuxPret | AuxSup +  deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AuxVerbForm where values = enum++type AuxVerb = AuxVerbForm -> Str++-- Prepositions++type Preposition = PrepForm -> Str++data PrepForm = PrepForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param PrepForm where +			values = enum+			prValue _ = invar++-- Conjunction++type Conjunction = ConjForm -> Str++data ConjForm = ConjForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param ConjForm where +			values = enum+			prValue _ = invar++-- Subjunction++type Subjunction = SubForm -> Str++data SubForm = SubForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param SubForm where +		       values = enum+		       prValue _ = invar++-- Particles++type Particle = PartForm -> Str++data PartForm = PartForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param PartForm where +			values = enum+			prValue _ = invar+		   +-- Infinitive mark+type InfMark = InfMarkForm -> Str++data InfMarkForm = InfMarkForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param InfMarkForm where +			   values = enum+			   prValue _ = invar++-- Proper Noun+type PN = PNForm -> Str++data PNForm = PNForm Casus+ deriving (Eq, Ord, Show, Read)++instance Param PNForm where +		      values = [PNForm c | c <- values]+		      prValue (PNForm c) = prValue c++-}
+ src/lib/CTrie.hs view
@@ -0,0 +1,140 @@+----------------------------------------------------------------------+-- |+-- Module      : Dictionary+-- Maintainer  : Markus Forsberg+-- Stability   : (stability)+-- Portability : (portability)+--+-- > CVS $Date: 2006/10/15 15:54:16 $+-- > CVS $Author: markus $+-- > CVS $Revision: 1.19 $+--+-- A Trie ADT for Functional Morphology +-----------------------------------------------------------------------------+module CTrie (+              buildTrie, +              buildTrieDict, +              buildTrieDictSynt,+              buildTrieWordlist,+              trie_lookup, +              isInTrie, +              decompose+             ) where++import System.IO+import System.IO.Unsafe+import List+import Foreign.C+import Compound+import qualified Data.Set as Set +import Data.Char (isDigit)+import Monad(when)+import Dictionary(dict2fullform,dict2idlex,Dictionary,FullFormLex)++foreign import ccall "trie_lib.h build"        build     :: CString -> IO()+foreign import ccall "trie_lib.h lookup_t"     lookup_t  :: CString -> IO()+foreign import ccall "trie_lib.h start"        start     :: IO()+foreign import ccall "trie_lib.h stop"         stop      :: IO()+foreign import ccall "trie_lib.h next"         next      :: IO CString +foreign import ccall "trie_lib.h more"         more      :: IO CInt+foreign import ccall "trie_lib.h getNumber"    getNumber :: CString -> CInt+foreign import ccall "trie_lib.h in_t"         in_t      :: CString -> CInt+foreign import ccall "trie_lib.h empty"        empty     :: IO()+foreign import ccall "trie_lib.h insert_t"     insert_t  :: CString -> CString -> IO()+foreign import ccall "trie_lib.h reversed"     reversed  :: IO()+foreign import ccall "trie_lib.h no_count"     no_count  :: IO()++type Attr = Int++-----------------------------------------------------------------------+{- | Constructs a C-trie from a file containing a fullform lexicon. -}+buildTrie :: FilePath -> Bool -> Bool -> IO ()+buildTrie f cb b = do fc <- newCString f+                      when b reversed+                      build fc++{- | Constructs a C-trie from a Dictionary ADT. Note that the trie+   is not handled in Haskell. It is instead a global object in C. -}+buildTrieDict :: Bool -> Dictionary -> Bool -> IO ()+buildTrieDict cb d b = +    do empty+       when b reversed+       start+       build_it $ prLex cb $ dict2fullform d+       stop++buildTrieDictSynt :: Dictionary -> Bool -> IO ()+buildTrieDictSynt d b = +    do empty+       when b reversed+       start+       build_it $ prLex False $ (dict2fullform d) +       no_count+       build_it $ prLex False $ (dict2idlex d)+       stop++prLex :: Bool -> FullFormLex -> [(String,String)]+prLex b = concat . map prOne where+  prOne (s,ps)  = [(s,a) | a <- map prAttr ps]	+  prAttr (a,ss) = ss -- ++ prCompAttr a+  -- prCompAttr a  = if b then " [" ++ show a ++ "] " else ""++{- | Inserts the wordform-analysis pairs into the C-trie. -}+build_it :: [(String,String)] -> IO()+build_it     [] = return ()+build_it ((w1,w2):xs) = do c1 <- newCString w1+			   c2 <- newCString w2+			   insert_t c1 c2+			   build_it xs++{- |Build an undecorated trie (a simple trie). -}+buildTrieWordlist :: [String] -> Bool -> IO ()+buildTrieWordlist xs b = do empty+                            when b reversed+                            start+                            build_it (zip xs (repeat []))+			    stop++{-# INLINE trie_lookup #-}+trie_lookup :: Bool -> String -> [(Attr,String)]+trie_lookup cb = cstring2string . lookup_trie cb++lookup_trie :: Bool -> String -> [(Attr,CString)]+lookup_trie cb s = +            unsafePerformIO $+                do withCString s lookup_t+                   process+   where process = do i <- more+                      case i == 1 of+                       False -> return []+                       _  -> do cs <- next+                                xs <- process+                                let n = if cb then toInt (getNumber cs) else 0+                                return ((n,cs):xs)+         toInt = fromInteger . toInteger++{- |Is the string a member in the trie? -}+isInTrie :: String -> Bool+isInTrie s = unsafePerformIO $+              do sc <- newCString s+	         return $ in_t sc == 1++{- |Compound analysis -}+decompose :: Maybe CompDesc -> ((String,String) -> [(String,String)]) -> String -> [[(Attr,String)]]+decompose _  _ [] = []+decompose (Just f) sandhi sentence = +     map cstring2string $ deconstruct sentence f sandhi+decompose Nothing _ sentence = [[x] | x <- trie_lookup False sentence]++{- |Translates the CString:s to String:s.-}+cstring2string :: [(Attr,CString)] -> [(Attr,String)]+cstring2string = map f +  where f (a,cs) = (a,unsafePerformIO $ peekCString cs)++deconstruct :: String -> CompDesc -> ((String,String) -> [(String,String)]) -> [[(Attr,CString)]]+deconstruct [] comp _ = if done comp then [[]] else []+deconstruct s  comp sandhi  = +    [p1:rs  | (p'@(_:_),r')    <- zip (inits s) (tails s),+              (p,r) <- sandhi (p',r'),+              (p1,Just ncomp) <- [((a,str),step comp a) | (a,str) <-  lookup_trie True p],+              rs <- deconstruct r ncomp sandhi]
+ src/lib/Combine.hs view
@@ -0,0 +1,61 @@+module Combine (combine,untab) where++import System+import List++combine :: String -> String -> String+combine s1 s2 = unlines $ create_output (pp s1) (pp s2)+ where pp = filter (not.null) . map untab . lines+  +create_output :: [[String]] -> [[String]] -> [String]+create_output [] [] = []+create_output ([]:xss) ([]:yss) = "" : create_output xss yss+create_output (([x]):xss) ([_,tag]:yss) = tab [x,"#:" ++ tag] : create_output xss yss+create_output ((x:[y]):xss) ([x2,tag]:yss) = if (x == x2) then tab [x,y] : create_output xss yss else error $ "data out of sync: " ++ x ++ " " ++ x2+create_output ((x:xs):xss) ([x2,tag]:yss) =+ if (x==x2) then +  let analyses = map split_at_colon xs in+   case reduce tag analyses of+     []        ->  pr_ambi x analyses   : create_output xss yss+     [(w,t)]   -> tab [x,w ++ ":" ++ t] : create_output xss yss+     analyses' -> pr_ambi x analyses'   : create_output xss yss+ else error $ "data out of sync: " ++ x ++ " " ++ x2+create_output x y = error $ "invalid format of input data." ++ (show x ++ show y)++reduce :: String -> [(String,String)] -> [(String,String)]+reduce tag xs = reduce' xs 0+ where reduce'  [] _ = []+       reduce' [x] _ = [x]+       reduce' xs n+        | length tag < n = xs+        | otherwise = case [ (x,t) | (x,t) <- xs, safe_index tag n == safe_index t n] of+                        [] -> xs+                        ys -> reduce' ys (n+1)+       safe_index s n = if (length s > n) then Just (s !! n) else Nothing++pr_ambi :: String -> [(String,String)] -> String+pr_ambi w xs = tab $ w : (map pr (grouping [(b,a) | (a,b) <- grouping [([a],[b]) | (a,b) <- sort xs]]))+ where pr (xs,as)      = (conc_char '+' as) ++ ":" ++ (conc_char '+' xs) +       conc_char c ss = concat $ intersperse ([c]) ss+       +grouping :: (Eq a,Eq b) => [([a],[b])] -> [([a],[b])]+grouping xs = [(as,nub bs) | (as,bs) <- grouping' xs]+ where+   grouping' []  = []+   grouping' [x] = [x]+   grouping' ((i,t):(i2,t2):xs)+    | i == i2   = grouping' ((i,nub (t++t2)):xs)+    | otherwise = (i,t): grouping' ((i2,t2):xs)++split_at_colon :: String -> (String,String)+split_at_colon s = case span (/= ':') s of+          (w,(_:t)) -> (w,t)++tab :: [String] -> String+tab = concat . intersperse "\t"++untab :: String -> [String]+untab [] = []+untab xs = case span (/='\t') xs of+             (w,(_:ys)) -> w:untab ys+             (w,[]) -> [w]
+ src/lib/Command.hs view
@@ -0,0 +1,265 @@+----------------------------------------------------------------------+-- |+-- Module      : Main+-- Maintainer  : Markus Forsberg+-- Stability   : (stability)+-- Portability : (portability)+--+-- > CVS $Date: 2006/06/05 15:25:00 $+-- > CVS $Author: markus $+-- > CVS $Revision: 1.1 $+--+-----------------------------------------------------------------------------+module Command where++import System.Console.GetOpt+import Maybe(fromMaybe)+import List(isSuffixOf)+import System(getProgName)+import Dict.ErrM+import IO+import Char+import General+import Tokenize(tokens,norm)+import Dictionary+import Frontend+import List(intersperse)+import qualified Data.Map as Map +-- import Frontend++{- |Does the filename end with the suffix .dict? -}+is_dictionary :: FilePath -> Bool+is_dictionary = isSuffixOf ".dict"++{- |Does the filename end with the suffix .lexicon? -}+is_lexicon :: FilePath -> Bool+is_lexicon = isSuffixOf ".lexicon"++output :: [Flag] -> Maybe FilePath+output xs = case [f | Output f <- xs] of+             [f] -> Just f+             _   -> Nothing  ++printer :: [Flag] -> Maybe String+printer xs = +    case [p | (Print p) <- xs] of+     (x:_) -> return x+     _     -> Nothing+++apply_encoding l flags d = case [x | Encoding x <- flags] of+                             [] -> d+                             (x:_) -> case Map.lookup x (encoding l) of+                                        Nothing -> error $ "Unknown encoding: " ++ x +                                        Just t -> transform_dictionary t d++output_write :: [Flag] -> (String -> IO())+output_write xs = case output xs of+                    Nothing -> putStr      +                    Just f  -> writeFile f ++dictionary_needed :: [Flag] -> Bool+dictionary_needed [] = True+dictionary_needed xs = not $ or [elem x nodict | x <- xs]+ where nodict = Infl : Help : Version : Paradigm : [Print s | s <- ["paradigms","paradigms_compact", "paradigms_latex","paradigms_list","paradigms_plist","pos_plist","tagset", "core","extract","compound"]]++is_mode :: [Flag] -> Bool+is_mode xs = case [f | Mode f <- xs] of+               [_] -> True+               _   -> False  +++--is_fullform :: [Flag] -> Bool+--is_fullform xs = False -- case [f | Fullform f <- xs] of+                 --  [_] -> True+                 --  _   -> False  ++is_help :: [Flag] -> Bool+is_help = elem Help++is_version :: [Flag] -> Bool+is_version = elem Version++is_paradigm :: [Flag] -> Bool+is_paradigm = elem Paradigm++is_compound :: [Flag] -> Bool+is_compound xs = case [f | Compound f <- xs] of+                   [_] -> True+                   _   -> False  ++data Comp = All | Min | Max | None | Unknown+  deriving Eq++pr_comp :: Comp -> String+pr_comp c = case c of+              All      -> "all"+              Min      -> "min"+              Max      -> "max"+              None     -> "none"+              --Length n -> "minlen=" ++ show n+              Unknown  -> "unknown (defaults to all)"++get_compound :: [Flag] -> Comp+get_compound xs = case [f | Compound f <- xs] of+                    (f@("none"):_) -> None+                    (f@("all"):_) -> All+                    (f@("min"):_) -> Min+                    (f@("max"):_) -> Max+             --       (f@('m':'i':'n':'l':'e':'n':'=':n):_) | all isDigit n -> Length (read n)+                    _     -> Unknown++is_quality :: [Flag] -> Bool+is_quality xs =  case [ x | Quality x <- xs ] of+                   [_] -> True+                   _   -> False++is_undef :: [Flag] -> Bool+is_undef = elem (Quality "undef")++is_argc :: [Flag] -> Bool+is_argc =  elem (Quality "argc")++is_unused :: [Flag] -> Bool+is_unused = elem (Quality "pop") ++is_duplicated :: [Flag] -> Bool+is_duplicated = elem (Quality "dup")++--is_dict :: [Flag] -> Bool+--is_dict = elem (Quality "dict")++is_all :: [Flag] -> Bool+is_all = elem (Quality "all")+++is_test :: [Flag] -> Bool+is_test = elem (Quality "test") ++is_paradigm_test :: [Flag] -> Bool+is_paradigm_test = elem (Quality "para") +++is_net :: [Flag] -> Bool+is_net fs = not $ null [x | Net x <- fs]++get_port :: [Flag] -> Maybe Int+get_port fs =  case [x | Net x <- fs] of+                 (x:_) | all isDigit x -> return $ read x+                 _                     -> Nothing ++get_quality :: [Flag] -> String+get_quality xs =  case [ x | Quality x <- xs ] of+                     (x:_) -> x++invalid_quality :: [Flag] -> Bool+invalid_quality xs = or [not (elem x ["undef", "pop","dup","para","argc","all","test"]) | Quality x <- xs ] ++get_mode :: [Flag] -> String+get_mode xs = case [f | Mode f <- xs] of+               (f:_) -> f++is_printer :: [Flag] -> Bool+is_printer xs = case [f | Print f <- xs] of+                  [_] -> True+                  _   -> False  ++get_tokenizer :: (String -> [Tok]) -> [Flag] -> (String -> [Tok])+get_tokenizer tokf fs = case get_tokenizer_name fs of+                          "words"     -> (map W . words)+                          "lines"     -> (map tokl . lines)+                          "norm"      -> norm . lines+                          "default"   -> tokens+                          x           -> error $ "unknown tokenizer: " ++ x+ where tokl [] = BL+       tokl s  = W s++norm_tokenizer = norm . lines++invalid_tokenizer :: [Flag] -> Bool+invalid_tokenizer fs + | elem (get_tokenizer_name fs) ["words","norm", "lines","default"] = False+ | otherwise                                                = True++get_tokenizer_name :: [Flag] -> String+get_tokenizer_name fs = case [t | (Tokenizer t) <- fs] of+                         (t:_) -> t+                         _     -> "default"++is_reduce :: [Flag] -> Bool+is_reduce fs = not $ null [f | f@(Reduce _) <- fs] ++get_reduce_file ::  [Flag] -> String+get_reduce_file fs = case [f | (Reduce f) <- fs]  of+                 (f:_) -> f+++{-|Data type for the Command line arguments. -}+data Flag =  +       Help             |+       Synth            |+       Quality  String  | +       Compound  String |+       Encoding  String |+       Infl             | +       Length String    |+       DupID            |+       Paradigm         | +       Tag              |+       Reduce String    |+       Net String       | +       Version          |+       Tokenizer String | +       Mode String      |+       Print  String    |+       Output   String +        deriving (Show,Eq)++{- |Lists all possible arguments and their explainations -}    +options :: Language l => l -> [OptDescr Flag]+options l =+    [ +      Option ['i'] ["inflection"]  (NoArg Infl)                   "run inflection engine"+    , Option ['s'] ["synthesiser"] (NoArg Synth)                  "enter synthesizer mode"+    , Option ['a'] ["analysis"]    (NoArg Tag)                    "pos tagging"+    , Option ['r'] ["reduce"]      (ReqArg Reduce "TAGFILE")              "reduce ambiguity with external file"+    , Option ['c'] ["compound"]    (ReqArg Compound "COMPOUND")   "activate compound analysis (none,min,max,all)"+    , Option ['t'] ["tokenizer"]   (ReqArg Tokenizer "TOKENIZER") "select mode (default, words, lines, norm)"+    , Option ['m'] ["mode"]        (ReqArg Mode "MODE")           "select mode (fail, lexfail, nocomp, lexcomp)"+    , Option ['p'] ["printer"]     (ReqArg Print "PRINTER")       "print using PRINTER (core, paradigms, paradigms_compact, paradigms_latex, compound, tagset, words, lex, tables, extract, gf, xml, sfst, sfstlex, sfstheader, lexc, xfst, sql, hundict, hunaffix, lmf,rdf)"+    , Option ['e'] ["encoding"]     (ReqArg Encoding "ENCODING")   ("select another morphosyntactic encoding (" ++ (concat (intersperse ", " (Map.keys (encoding l)))) ++ ")")+    , Option ['q'] ["quality"]    (ReqArg Quality "QUALITY")       "run tests (all, test, dup, undef, pop, argc, para)"+    --, Option ['o'] ["output"]      (ReqArg Output "FILE")           "output printer content to FILE"+ --   , Option ['g'] ["go"]        (ReqArg Net "PORTNUMBER")         "Go online with FM server on port PORTNUMBER"+    , Option ['f'] ["find"]        (NoArg Paradigm)                "find all paradigms that predict the given word forms"+    , Option ['h'] ["help"]        (NoArg Help)                     "display this message"+    , Option ['v'] ["version"]     (NoArg Version)                  "display version information"+    ]+    +{-+outp = Output . fromMaybe "stdout"+inp  = Input  . fromMaybe "stdin"+-}++{- |Collect the valid arguments. Raises an IO error if it fails.  -} +compilerOpts :: Language l => l -> [String] -> IO ([Flag], [String])+compilerOpts l argv = +       case getOpt Permute (options l) argv of+        (o,xs,[] ) -> return  (o,xs)+        (_,_,errs)  -> +	  do head <- header+ 	     ioError (userError (concat errs ++ usageInfo head (options l)))++header :: IO String+header=  do prg <- getProgName+            return $ "Usage: " ++ prg ++ " [OPTION...] dictionary_file(s)..."++help :: Language l => l -> IO String+help l = do head <- header+   	    return $ usageInfo head (options l)++retrieve :: Language l => l -> [String] -> IO (Either String ([Flag],[FilePath]))+retrieve l xs = do res <- try (compilerOpts l xs)+                   case res of+                    Left io_err -> return $ Left $ ioeGetErrorString io_err+                    Right res   -> return $ Right res 
+ src/lib/CommonMain.hs view
@@ -0,0 +1,390 @@+module CommonMain where++import DictToDictionary+import Print+import List(intersperse,isPrefixOf,sortBy,nub)+import System(getArgs, getEnv)+import GeneralIO+import General+import IO+import qualified Data.Set as Set+import System(getProgName)+import Dictionary+import Frontend+import Char+import Dict.ErrM+import Print+import Monad+import Command+import Util+import Combine+--import Net+import qualified Data.Map as Map++-- import Tokenize+import qualified CTrie++data AnaType = +    Normal                |+    NoAnalysis            |+    AnaEval               |+    FilterLexiconNo       |+    FilterLexiconNoComp   |+    FilterLexiconComp+    +gfTypes :: Language a => a -> String+gfTypes l = "types." ++ name l ++ ".gf"++readDicts :: Language a => a -> [FilePath] -> (Bool,Bool,Bool) -> IO (Dictionary,Int)+readDicts l fs (undefcheck,argccheck,unusedcheck) = do output+                                                       readDicts' l fs+ where+  output +   | length fs > 1 = prErr $ "\nprocessing dictionaries in files: " ++ (unwords fs) +   | null fs       = prErr $ "\nno dictionary loaded"+   | otherwise     = prErr $ "\nprocessing dictionary in file " ++ (unwords fs)+  readDicts' l [] = return $ (internDict l, 0)+  readDicts' l (f:fs) = do (d,n) <- readDicts' l fs+                           res   <- parseDict l f (undefcheck,argccheck,unusedcheck)+                           case res of+                             Ok (d1,n1) -> return $ (unionDictionary d d1,n+n1)+                             Bad s      -> do prErr s+                                              return (d,n)++prStatistics :: Language a => a -> Int -> IO()+prStatistics l n =+ do let is = size (internDict l)+    prErr $ print_lang l ++ print_paradigms l ++ print_size (n+is,n,is) ++ "\n"++print_lang l = "language id: " ++ (name l) ++ "\n"++print_paradigms l = case paradigmCount l of+                     0 -> "no paradigms\n"+                     1 -> "1 paradigm\n"+                     n -> show n ++ " paradigms\n"++print_size (0,n,isz)  = "no/empty dictionary"+print_size (1,_,_)    = "1 entry"+print_size (sz,n,isz) = show nsz ++ "k entries [e: " ++ show n ++ ", i: " ++ show isz ++ "]"+  where +        nsz = fromInteger $ round (((fromInteger (toInteger sz))::Double) / 1000)++uName :: Language a => a -> String+uName l = case name l of+	   [] -> []+	   (x:xs) -> toUpper x : xs++commonMain :: Language a => a -> IO ()+commonMain l = do+  xx <- getArgs+  res <- retrieve l xx+  case res of+    Left err -> do prErr $ err+    Right (flags, []) | dictionary_needed flags+    	-> do prg <- getProgName+              prErr $ welcome l+              prErr $ "dictionary file required"+              prErr $ "Usage: " ++ prg ++ " [OPTION...] dictionary_file(s)...\n"+    Right (flags, files) -> +     if is_help flags then do s <- help l ; prText (welcome l) ; prText s else if is_version flags then prText (welcome l) else+      do prErr $ welcome l+         let undefcheck      = is_undef flags      || is_all flags+             unusedcheck     = is_unused flags     || is_all flags+             argccheck       = is_argc flags       || is_all flags+             dupcheck        = is_duplicated flags || is_all flags+             (compInf,cmode) = (is_compound flags, get_compound flags)+             tokS            = if (is_reduce flags && not (elem (get_tokenizer_name flags) ["lines","norm"])) then norm_tokenizer+                                   else (get_tokenizer (tokenizer l) flags)+         when (is_reduce flags && not (elem (get_tokenizer_name flags) ["lines","norm"])) $ prErr "Invalid tokenizer in reduce mode, changed to 'norm'"+         (d,n) <- if (dictionary_needed flags) then +                      do (dict,n1) <- readDicts l files (undefcheck,argccheck,unusedcheck)+                         return (apply_encoding l flags (dictionary_postprocessing l dict),n1)+                   else +                       return (emptyDict,0)+         case flags of+           fs | invalid_tokenizer fs -> prErr $ "unknown tokenizer: " ++ (get_tokenizer_name fs)+           fs | invalid_quality   fs -> prErr $ "unknown quality argument: " ++ (get_quality fs)+           fs | is_quality fs -> do when dupcheck   $ check_lemma_duplication d+                                    when (is_test fs || is_all fs) $ tester (testBench l) (testdata d)+                                    when (is_paradigm_test fs || is_all fs) $ +                                         do prErr "Running paradigm duplication check..."+                                            let lenw = length . concat . map words+                                            print_duplicates [(f xs, [fun xs | (p1,(ls,fun)) <- Map.toList (paradigms l), p1 /= p, lenw ls == lenw xs]) +                                                                                                  | (p,(xs,f)) <- Map.toList (paradigms l), not (Set.member p (paradigm_dup_exception l))] (dup_id_exceptions l)+--           fs | is_net fs       -> case get_port fs of+--                                     Nothing -> prErr "Invalid port"+--                                     Just n   -> do build_trie l fs d+--                                                    prStatistics l n+--                                                    server n (\s -> prAnalysis l Normal s (analysis cmode (composition l) (sandhi_rules l) s))+           fs | elem Infl     fs ->  do prErr $ "[ FM inflection mode ]"+                                        s <- imode l+                                        output_write fs s+           fs | elem Synth   fs  -> do prErr $ "[ FM synthesiser mode ]\n"+			               CTrie.buildTrieDictSynt d False+                                       prStatistics l n+                                       s <- synthesiser l+                                       output_write fs s+           fs | is_paradigm fs -> lookup_paradigm l+           fs | elem Tag fs -> do --CTrie.buildTrieDict (isComp l) d False dupcheck+                                  build_trie l fs d+                                  prStatistics l n+			          s <- posify l tokS (analysis l cmode (composition l) (sandhi_rules l))+                                  output_write fs s+           fs | is_reduce fs -> do build_trie l fs d+                                   prStatistics l n+			           s <- posify l tokS (analysis l cmode (composition l) (sandhi_rules l))+                                   s2 <- readFile (get_reduce_file fs)+                                   output_write fs $ Combine.combine s s2+           fs | is_mode fs  -> do --CTrie.buildTrieDict (isComp l) d False dupcheck+                                  build_trie l fs d+                                  prStatistics l n+			          run l tokS (analysis l cmode (composition l) (sandhi_rules l)) (get_mode fs)+           fs | is_printer fs -> +                output_write fs $+                  case printer fs of+                   (Just p) | elem p (map fst (lprinter l)) -> case lookup p (lprinter l) of+                                                                 Just p -> p d+                   (Just "core")      -> unlines (paradigmNames l)+                   (Just "paradigms")         -> prDictionary $ apply_encoding l flags (dictionary [f xs | (p,(xs,f)) <- Map.toList (paradigms l)])+                   (Just "paradigms_compact") -> prParadigmsCompact $ apply_encoding l flags (dictionary [f xs | (p,(xs,f)) <- Map.toList (paradigms l)])+                   (Just "paradigms_latex") -> prLatex $ apply_encoding l flags (dictionary [f xs | (p,(xs,f)) <- Map.toList (paradigms l)])+                   (Just "tagset")    -> prTagset l    $ apply_encoding l flags (dictionary [f xs | (p,(xs,f)) <- Map.toList (paradigms l)])+                   (Just "paradigms_list") -> "[" ++ (concat (intersperse ", " ['\"' : p ++ "\"" | (p,_) <- Map.toList (paradigms l)])) ++ "]"+                   (Just "paradigms_plist") -> unlines ["# -*- coding: utf-8 -*-",+                                                        "paradigms = '[" ++ (concat (intersperse "," ['\"' : p ++ "\"" | (p,_) <- Map.toList (paradigms l)])) ++ "]'"]+                   (Just "pos_plist") -> unlines ["# -*- coding: utf-8 -*-",+                                                  "pos = '[" ++ (concat (intersperse "," (nub ['\"' : (get_pos (f xs)) ++ "\"" | (p,(xs,f)) <- Map.toList (paradigms l)]))) ++ "]'"]+                   (Just "extract")   -> prExtract l+                   (Just "compound")  -> prCompound l+                   (Just "newlex")    -> prNewDictionary d+                   --  (Just "json")    -> prJSON d+	           (Just "lex")     -> prJSON d --prFullFormLex (dict2fullform d False)+	           (Just "tabbedlex") -> prTabbedLex d+                   (Just "webservice") -> prWebService d+                   (Just "tagtab") -> prWordTaglist d+	           (Just "words")   -> prWordlist (dict2fullform d)+	           (Just "tables")  -> prDictionary d+	           (Just "gf")      -> "-- machine-generated GF file\n\n" +++		                        "include " ++ (gfTypes l) ++ " ;\n\n" ++ +		                         (prGF d)+--	           (Just "gfr")     ->  "-- machine-generated GF file\n\n" +++--	           	                 "include " ++ (gfTypes l) ++ " ;\n\n" ++ +--	            	                   prGFRes d+    	           --(Just "latex")      -> prLatex d+	           (Just "xml")        -> prXML d+                   (Just "clex")       -> prCLEX d+                   (Just "sfst")       -> prSFST d+                   (Just "sfstheader") -> prSFSTHEAD d+                   (Just "sfstlex")    -> prSFSTLEX d+	           (Just "lexc")       -> prLEXC d+	           (Just "xfst")       -> prXFST d+                   (Just "hundict")    -> prHunDict d+                   (Just "hunaffix")   -> prHunAffix d+	           (Just "sql")        -> prSQL d+                   (Just "lmf")        -> prLMF (name l) d+                   (Just "rdf")        -> prRDF (name l) d+                   (Just  x)           -> error $ "unknown printer: " ++ x+                   Nothing              -> error $ "Internal error. This is a bug."+           fs -> do build_trie l fs d+                    prStatistics l n+		    run l tokS (analysis l cmode (composition l) (sandhi_rules l)) []++build_trie :: Language l => l -> [Flag] -> Dictionary -> IO ()+build_trie l fs d = CTrie.buildTrieDict (isComp l) d False++data Stats = Stats {+		    totalWords :: Int,+		    coveredWords :: Int+		   }++initStats :: Stats+initStats = Stats { totalWords = 0, coveredWords = 0 }++posify :: Language a => a -> (String -> [Tok]) -> (String -> [[String]]) -> IO String+posify l lexer f = do +  s' <- hGetContents stdin+  let ts  = lexer s'+  --    tss = get_sentences ts+  return $ (unlines (map anapos ts)) ++ "\n" + where +  -- printResult [] = []+  --printResult xs = unlines xs -- "{" ++ (unwords xs) ++ "}\n"+  anapos t = +   case t of+    BL     -> []+    (P s)  -> s ++ "\t" ++ s ++ ":spec" -- "(\"" ++ esc s ++ "\",spec)"+    (PD s) -> s ++ "\t" ++ s ++ ":num/spec" -- "(\"" ++ esc s ++ "\",num/spec)"+    (D s) ->  s ++ "\t" ++ s ++ ":num" --"(\"" ++ esc s ++ "\",num)"+    (W s) ->  case f s of+                [] -> s -- "(\"" ++ esc s ++ "\",)"+                xs -> s ++ "\t" ++ prResult xs -- "(\"" ++ esc s ++ "\"," ++ prResult xs ++ ")"+    (A (u,l)) -> case (f u) ++ (f l) of+                  [] -> u -- "(\"" ++ esc u ++ "\",)"+                  xs -> u ++ "\t" ++ prResult xs -- "(\"" ++ esc u ++ "\"," ++ prResult xs ++ ")"+    (AA (u,m,l)) -> case (f u) ++ (f m) ++ (f l) of+                     [] -> u -- "(\"" ++ esc u ++ "\",)"+                     xs -> u ++ "\t" ++ prResult xs -- "(\"" ++ esc u ++ "\"," ++ prResult xs ++ ")"+  prResult :: [[String]] -> String+  prResult xs  = concat $ intersperse "\t" $ filter (not.null) (map filter_analysis xs)+--  esc [] = []+--  esc ('\"':xs) = '\\':'\"':esc xs+--  esc (x:xs) = x:esc xs+  filter_analysis :: [String] -> String+  filter_analysis [s] = get_head s ++ ":" ++  (unwords $ filter (not.null) $ (get_pos s):(get_inhs s):[get_param s])+  filter_analysis _   = []+  get_head s@(x:xs)+   | isPrefixOf "id\":" s = case span (/= '\"') (drop 5 s) of+                              (r,_) -> r+   | otherwise             = get_head xs+  get_inhs s@(x:xs)+   | isPrefixOf "inhs\":" s = case span (/= ']') (drop 7 s) of+                               (r,_) -> case filter (\c -> c /= '"' && c /= ',') r of+                                          [] -> []+                                          s  | elem '*' s -> []+                                          s               -> s  +   | otherwise             = get_inhs xs+  get_pos s@(x:xs)+   | isPrefixOf "pos\":" s = case span (/= '\"') (drop 6 s) of+                               (r,_) | elem '*' r -> []+                               (r,_) -> r+   | otherwise             = get_pos xs+  get_param s@(x:xs)+   | isPrefixOf "param\":" s = case span (/= '\"') (drop 8 s) of+                               (r,_) | elem '*' r -> []+                               (r,_) -> r+   | otherwise             = get_param xs++get_sentences :: [Tok] -> [[Tok]]+get_sentences xs = gets xs []+   where gets [] s = [reverse s]+         gets (c:cs) s+          | isMajor c = (reverse (c:s)):gets cs []+          | otherwise = gets cs (c:s)++isMajor (P [c]) = elem c ".?!"+isMajor _     = False++run :: Language a => a -> (String -> [Tok]) -> (String -> [[String]]) -> String -> IO ()+run l t f "fail"      = run' l t f NoAnalysis        initStats >> return ()+run l t f "eval"      = run' l t f AnaEval initStats >> return ()+run l t f "lexfail"   = run' l t f FilterLexiconNo   initStats >> return ()+run l t f "nocomp"    = run' l t f FilterLexiconNoComp initStats >> return ()+run l t f "lexcomp"   = run' l t f FilterLexiconComp initStats >> return ()+run l t f _           = do+                          st <- run' l t f Normal initStats+		          prErr $ "Total words:   " ++ show (totalWords st)+		          prErr $ "Covered words: " ++ show (coveredWords st)++run' :: Language a => a -> (String -> [Tok]) -> (String -> [[String]]) -> AnaType -> Stats -> IO Stats+run' l tokenizer f a st = + do b <- hIsEOF stdin+    if b then return st +     else do +       s <- hGetLine stdin+       analyze l a f (tokenizer s) st >>= run' l tokenizer f a++word_tokens :: [Tok] -> [String]+word_tokens xs = [s | (W s) <- xs]++analyze :: Language a => a -> AnaType -> (String -> [[String]]) -> [Tok] -> Stats -> IO Stats+analyze _ _ _  [] st = return st+analyze l t f (s:ss) st =+   case s of+    BL    -> analyze l t f ss st+    (P s) ->   +        do case t of +	    Normal    +             -> do prText $ "{\"" ++ s ++ "\":\"-Symb-\"}"+		   analyze l t f ss st+            _ -> analyze l t f ss st+    (PD s) ->   +        do case t of +	    Normal+             -> do prText $ "{\"" ++ s ++ "\":\"-Num/Symb-\"}"+		   analyze l t f ss st+            _ -> analyze l t f ss st+    (D s) ->+        do case t of +            Normal+             -> do prText $ "{\"" ++ s ++ "\":\"-Num-\"}"+		   analyze l t f ss st+	    _ -> analyze l t f ss st+    (W s) ->  +	case f s of+        [] -> do prText $ prAnalysis l t s []+	         analyze l t f ss (st {+			             totalWords = totalWords st + 1,+			                          coveredWords = coveredWords st +			            })+        xs -> do prText $ prAnalysis l t s xs+	         analyze l t f ss (st {+			             totalWords = totalWords st + 1,+			                          coveredWords = coveredWords st + 1 +			            })+    (A (s,ls)) ->  +	case (f s) ++(f ls) of+        [] -> do prText $ prAnalysis l t s []+	         analyze l t f ss (st {+			             totalWords = totalWords st + 1,+			                          coveredWords = coveredWords st +			            })+        xs -> do prText $ prAnalysis l t s xs+	         analyze l t f ss (st {+			             totalWords = totalWords st + 1,+			                          coveredWords = coveredWords st + 1 +			            })+    (AA (s,m,ls)) ->  +	case (f s) ++ (f m) ++(f ls) of+        [] -> do prText $ prAnalysis l t s []+	         analyze l t f ss (st {+			             totalWords = totalWords st + 1,+			                          coveredWords = coveredWords st +			            })+        xs -> do prText $ prAnalysis l t s xs+	         analyze l t f ss (st {+			             totalWords = totalWords st + 1,+			                          coveredWords = coveredWords st + 1 +			            })++prText [] = return ()+prText s  = hPutStrLn stdout s++prAnalysis :: Language a => a -> AnaType -> String -> [[String]] -> String+prAnalysis l Normal   s   [] = case wordGuesser l s of+                                 (x:xs) ->  concat [concat ["{\"", s, "\":[\"-Guess-\",\n"],+                                                    prA l (map (:[]) (x:xs)),+                                                    "\n}"]+                                 []     -> concat ["{\"", s, "\":\"-Unknown-\"}"]+prAnalysis l Normal     s xs    = concat [concat ["{\"", s, "\":{\n"], prA l xs, "\n}}"]+prAnalysis _ NoAnalysis s []    = s+prAnalysis _ NoAnalysis s _       = []+-- force evaluation without printing. +prAnalysis _ AnaEval s xs + | length (["" | x <- xs,"" <- x]) == 1  = s + | otherwise                             = []+prAnalysis _ FilterLexiconNo s xs = case [ x | [x] <- xs] of+                                      (_:_) -> []+                                      _     -> s+prAnalysis _ FilterLexiconNoComp s xs  = case [x | [x] <- xs] of+                                           ys | length xs == length ys -> s+                                           _  -> [] +prAnalysis _ FilterLexiconComp s xs  = case [x | (x:y:_) <- xs] of+                                         ys | length xs == length ys -> s+                                         _  -> [] ++prA l xs =  concat $ intersperse ",\n" (map pr (annotate 1 1 (sort_length (affixes l) xs)))++annotate sn cn       [] = []+annotate sn cn ([]:xs)  =   (0,[]):annotate       sn cn xs+annotate sn cn ([x]:xs) = (sn,[x]):annotate (sn+1) cn xs+annotate sn cn (xs:ys)  =  (cn,xs):annotate sn (cn+1) ys++pr (_,[])  = []+pr (n,[x]) = "\"s_" ++ (show n) ++ "\":" ++ x+pr (n,xs) = str ++ (concat (intersperse (",\n" ++ pad) xs)) ++ "]"+   where str = "\"c_" ++ (show n) ++ "\":[" +         pad   = take (length str) (repeat ' ')+    +welcome :: Language a => a -> String+welcome l = (morphology_header l) +++            "\n includes FM 3.0 (M. Forsberg & A. Ranta, 2010, under GNU GPL)" 
+ src/lib/Compound.hs view
@@ -0,0 +1,40 @@+module Compound where++import General+import Maybe+import List(intersperse)++type CompDesc = [[CompAttr]]++data CompAttr = Star [Attr] | One [Attr]+ deriving (Eq,Show)++star :: [Attr] -> CompAttr+star = Star++attr :: [Attr] -> CompAttr+attr = One++step :: CompDesc -> Attr -> Maybe CompDesc+step xs a = case catMaybes (map st xs) of+              [] -> Nothing+              ys -> Just (concat ys)+ where st []             = Nothing+       st ((One a1):xs)  = if elem a a1 then Just [xs] else Nothing+       st ((Star a1):ys) = if elem a a1 then +                               case st ys of +                                 Nothing -> Just [((Star a1):ys)]+                                 x -> x+                            else st ys++done :: CompDesc -> Bool+done xs = elem [] xs || not (null [x | x@[Star _] <- xs])++prCompDesc :: CompDesc -> String+prCompDesc cd = "compound schema\n" +++                "---------------\n" ++ unlines [ n ++ ". " ++ l| (l,n) <- zip (map prOne cd) (map show [1..])]+ where+  prOne [] = []+  prOne (Star xs:ys) = "[" ++ concat (intersperse "|" (map show xs)) ++ "]* " ++ prOne ys+  prOne (One  xs:ys) = "[" ++ concat (intersperse "|" (map show xs)) ++ "] " ++ prOne ys+ 
+ src/lib/Dict/Abs.hs view
@@ -0,0 +1,25 @@+module Dict.Abs where++-- Haskell module generated by the BNF converter++newtype Ident = Ident String deriving (Eq,Ord,Show)+data Dictionary =+   Dict [Entry]+  deriving (Eq,Ord,Show)++data Entry =+   E Ident [Arg]+ | EA Ident [Arg] [Term]+  deriving (Eq,Ord,Show)++data Term =+   TermC Ident [Term]+ | TermA Arg+  deriving (Eq,Ord,Show)++data Arg =+   NId Ident+ | NArg Integer+ | NStr String+  deriving (Eq,Ord,Show)+
+ src/lib/Dict/ErrM.hs view
@@ -0,0 +1,26 @@+-- BNF Converter: Error Monad+-- Copyright (C) 2004  Author:  Aarne Ranta++-- This file comes with NO WARRANTY and may be used FOR ANY PURPOSE.+module Dict.ErrM where++-- the Error monad: like Maybe type with error msgs++import Control.Monad (MonadPlus(..), liftM)++data Err a = Ok a | Bad String+  deriving (Read, Show, Eq, Ord)++instance Monad Err where+  return      = Ok+  fail        = Bad+  Ok a  >>= f = f a+  Bad s >>= f = Bad s++instance Functor Err where+  fmap = liftM++instance MonadPlus Err where+  mzero = Bad "Err.mzero"+  mplus (Bad _) y = y+  mplus x       _ = x
+ src/lib/Dict/GetDict.hs view
@@ -0,0 +1,22 @@+-- automatically generated by BNF Converter+module Dict.GetDict where++import IO ( stdin, hGetContents )+import System ( getArgs, getProgName )+import Dict.Lex+import Dict.Par+import Dict.Skel+import Dict.Print+import Dict.Abs+import Dict.ErrM++getDict :: String -> Err Dictionary+getDict s = let ts = myLexer s in pDictionary ts ++getEntry :: String -> Err Entry+getEntry s = let ts = myLexer s in +              case pListEntry ts of+                Ok [x]   -> Ok x+                Ok  []   -> Bad []  +                Ok _     -> error "internal error in Dict.GetDict: multiple entries. this is a bug."+                Bad s    -> Bad s
+ src/lib/Dict/Lex.x view
@@ -0,0 +1,134 @@+-- -*- haskell -*-+-- This Alex file was machine-generated by the BNF converter+{+{-# OPTIONS -fno-warn-incomplete-patterns #-}+module Dict.Lex where+import UTF8++}+++$l = [a-zA-Z\192 - \255] # [\215 \247]    -- isolatin1 letter FIXME+$c = [A-Z\192-\221] # [\215]    -- capital isolatin1 letter FIXME+$s = [a-z\222-\255] # [\247]    -- small isolatin1 letter FIXME+$d = [0-9]                -- digit+$i = [$l $d _ \- ' \128-\255] -- identifier character+$u = [\0-\255]          -- universal: any character++@rsyms =    -- symbols and non-identifier-like reserved words+   \; | \, | \{ | \} | \( | \)++:-+"--" [.]* ; -- Toss single line comments+"{-" ([$u # \-] | \- [$u # \}])* ("-")+ "}" ; ++$white+ ;+@rsyms { tok (\p s -> PT p (TS $ share s)) }++$l $i*   { tok (\p s -> PT p (eitherResIdent (TV . share) s)) }+\" ([$u # [\" \\ \n]] | (\\ (\" | \\ | \' | n | t)))* \"{ tok (\p s -> PT p (TL $ share $ unescapeInitTail s)) }++$d+      { tok (\p s -> PT p (TI $ share s))    }+++{++tok f p s = f p s++share :: String -> String+share = decodeUTF8++data Tok =+   TS !String     -- reserved words and symbols+ | TL !String     -- string literals+ | TI !String     -- integer literals+ | TV !String     -- identifiers+ | TD !String     -- double precision float literals+ | TC !String     -- character literals++ deriving (Eq,Show,Ord)++data Token = +   PT  Posn Tok+ | Err Posn+  deriving (Eq,Show,Ord)++tokenPos (PT (Pn _ l _) _ :_) = "line " ++ show l+tokenPos (Err (Pn _ l _) :_) = "line " ++ show l+tokenPos _ = "end of file"++posLineCol (Pn _ l c) = (l,c)+mkPosToken t@(PT p _) = (posLineCol p, prToken t)++prToken t = case t of+  PT _ (TS s) -> s+  PT _ (TI s) -> s+  PT _ (TV s) -> s+  PT _ (TD s) -> s+  PT _ (TC s) -> s++  _ -> show t++data BTree = N | B String Tok BTree BTree deriving (Show)++eitherResIdent :: (String -> Tok) -> String -> Tok+eitherResIdent tv s = treeFind resWords+  where+  treeFind N = tv s+  treeFind (B a t left right) | s < a  = treeFind left+                              | s > a  = treeFind right+                              | s == a = t++resWords = N+   where b s = B s (TS s)++unescapeInitTail :: String -> String+unescapeInitTail = unesc . tail where+  unesc s = case s of+    '\\':c:cs | elem c ['\"', '\\', '\''] -> c : unesc cs+    '\\':'n':cs  -> '\n' : unesc cs+    '\\':'t':cs  -> '\t' : unesc cs+    '"':[]    -> []+    c:cs      -> c : unesc cs+    _         -> []++-------------------------------------------------------------------+-- Alex wrapper code.+-- A modified "posn" wrapper.+-------------------------------------------------------------------++data Posn = Pn !Int !Int !Int+      deriving (Eq, Show,Ord)++alexStartPos :: Posn+alexStartPos = Pn 0 1 1++alexMove :: Posn -> Char -> Posn+alexMove (Pn a l c) '\t' = Pn (a+1)  l     (((c+7) `div` 8)*8+1)+alexMove (Pn a l c) '\n' = Pn (a+1) (l+1)   1+alexMove (Pn a l c) _    = Pn (a+1)  l     (c+1)++type AlexInput = (Posn, -- current position,+               Char,     -- previous char+               String)   -- current input string++tokens :: String -> [Token]+tokens str = go (alexStartPos, '\n', str)+    where+      go :: (Posn, Char, String) -> [Token]+      go inp@(pos, _, str) =+               case alexScan inp 0 of+                AlexEOF                -> []+                AlexError (pos, _, _)  -> [Err pos]+                AlexSkip  inp' len     -> go inp'+                AlexToken inp' len act -> act pos (take len str) : (go inp')++alexGetChar :: AlexInput -> Maybe (Char,AlexInput)+alexGetChar (p, c, [])    = Nothing+alexGetChar (p, _, (c:s)) =+    let p' = alexMove p c+     in p' `seq` Just (c, (p', c, s))++alexInputPrevChar :: AlexInput -> Char+alexInputPrevChar (p, c, s) = c+}
+ src/lib/Dict/Par.y view
@@ -0,0 +1,97 @@+-- This Happy file was machine-generated by the BNF converter+{+{-# OPTIONS -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns #-}+module Dict.Par where+import Dict.Abs+import Dict.Lex+import Dict.ErrM+}++%name pDictionary Dictionary+%name pListEntry ListEntry+%name pListArg ListArg+%name pListTerm ListTerm+%name pEntry Entry+%name pTerm Term+%name pArg Arg++-- no lexer declaration+%monad { Err } { thenM } { returnM }+%tokentype { Token }++%token + ';' { PT _ (TS ";") }+ ',' { PT _ (TS ",") }+ '{' { PT _ (TS "{") }+ '}' { PT _ (TS "}") }+ '(' { PT _ (TS "(") }+ ')' { PT _ (TS ")") }++L_ident  { PT _ (TV $$) }+L_integ  { PT _ (TI $$) }+L_quoted { PT _ (TL $$) }+L_err    { _ }+++%%++Ident   :: { Ident }   : L_ident  { Ident $1 }+Integer :: { Integer } : L_integ  { (read $1) :: Integer }+String  :: { String }  : L_quoted { $1 }++Dictionary :: { Dictionary }+Dictionary : ListEntry { Dict (reverse $1) } +++ListEntry :: { [Entry] }+ListEntry : {- empty -} { [] } +  | ListEntry Entry ';' { flip (:) $1 $2 }+++ListArg :: { [Arg] }+ListArg : {- empty -} { [] } +  | ListArg Arg { flip (:) $1 $2 }+++ListTerm :: { [Term] }+ListTerm : {- empty -} { [] } +  | Term { (:[]) $1 }+  | Term ',' ListTerm { (:) $1 $3 }+++Entry :: { Entry }+Entry : Ident ListArg { E $1 (reverse $2) } +  | Ident ListArg '{' ListTerm '}' { EA $1 (reverse $2) $4 }+++Term :: { Term }+Term : Ident '(' ListTerm ')' { TermC $1 $3 } +  | Arg { TermA $1 }+++Arg :: { Arg }+Arg : Ident { NId $1 } +  | Integer { NArg $1 }+  | String { NStr $1 }++++{++returnM :: a -> Err a+returnM = return++thenM :: Err a -> (a -> Err b) -> Err b+thenM = (>>=)++happyError :: [Token] -> Err a+happyError ts =+  Bad $ "syntax error at " ++ tokenPos ts ++ +  case ts of+    [] -> []+    [Err _] -> " due to lexer error"+    _ -> " before " ++ unwords (map prToken (take 4 ts))++myLexer = tokens+}+
+ src/lib/Dict/Print.hs view
@@ -0,0 +1,119 @@+{-# OPTIONS -fno-warn-incomplete-patterns #-}+module Dict.Print where++-- pretty-printer generated by the BNF converter++import Dict.Abs+import Char++-- the top-level printing method+printTree :: Print a => a -> String+printTree = render . prt 0++type Doc = [ShowS] -> [ShowS]++doc :: ShowS -> Doc+doc = (:)++render :: Doc -> String+render d = rend 0 (map ($ "") $ d []) "" where+  rend i ss = case ss of+    "["      :ts -> showChar '[' . rend i ts+    "("      :ts -> showChar '(' . rend i ts+    "{"      :ts -> showChar '{' . new (i+1) . rend (i+1) ts+    "}" : ";":ts -> new (i-1) . space "}" . showChar ';' . new (i-1) . rend (i-1) ts+    "}"      :ts -> new (i-1) . showChar '}' . new (i-1) . rend (i-1) ts+    ";"      :ts -> showChar ';' . new i . rend i ts+    t  : "," :ts -> showString t . space "," . rend i ts+    t  : ")" :ts -> showString t . showChar ')' . rend i ts+    t  : "]" :ts -> showString t . showChar ']' . rend i ts+    t        :ts -> space t . rend i ts+    _            -> id+  new i   = showChar '\n' . replicateS (2*i) (showChar ' ') . dropWhile isSpace+  space t = showString t . (\s -> if null s then "" else (' ':s))++parenth :: Doc -> Doc+parenth ss = doc (showChar '(') . ss . doc (showChar ')')++concatS :: [ShowS] -> ShowS+concatS = foldr (.) id++concatD :: [Doc] -> Doc+concatD = foldr (.) id++replicateS :: Int -> ShowS -> ShowS+replicateS n f = concatS (replicate n f)++-- the printer class does the job+class Print a where+  prt :: Int -> a -> Doc+  prtList :: [a] -> Doc+  prtList = concatD . map (prt 0)++instance Print a => Print [a] where+  prt _ = prtList++instance Print Char where+  prt _ s = doc (showChar '\'' . mkEsc '\'' s . showChar '\'')+  prtList s = doc (showChar '"' . concatS (map (mkEsc '"') s) . showChar '"')++mkEsc :: Char -> Char -> ShowS+mkEsc q s = case s of+  _ | s == q -> showChar '\\' . showChar s+  '\\'-> showString "\\\\"+  '\n' -> showString "\\n"+  '\t' -> showString "\\t"+  _ -> showChar s++prPrec :: Int -> Int -> Doc -> Doc+prPrec i j = if j<i then parenth else id+++instance Print Integer where+  prt _ x = doc (shows x)+++instance Print Double where+  prt _ x = doc (shows x)+++instance Print Ident where+  prt _ (Ident i) = doc (showString i)++++instance Print Dictionary where+  prt i e = case e of+   Dict entrys -> prPrec i 0 (concatD [prt 0 entrys])+++instance Print Entry where+  prt i e = case e of+   E id args -> prPrec i 0 (concatD [prt 0 id , prt 0 args])+   EA id args terms -> prPrec i 0 (concatD [prt 0 id , prt 0 args , doc (showString "{") , prt 0 terms , doc (showString "}")])++  prtList es = case es of+   [] -> (concatD [])+   x:xs -> (concatD [prt 0 x , doc (showString ";") , prt 0 xs])++instance Print Term where+  prt i e = case e of+   TermC id terms -> prPrec i 0 (concatD [prt 0 id , doc (showString "(") , prt 0 terms , doc (showString ")")])+   TermA arg -> prPrec i 0 (concatD [prt 0 arg])++  prtList es = case es of+   [] -> (concatD [])+   [x] -> (concatD [prt 0 x])+   x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs])++instance Print Arg where+  prt i e = case e of+   NId id -> prPrec i 0 (concatD [prt 0 id])+   NArg n -> prPrec i 0 (concatD [prt 0 n])+   NStr str -> prPrec i 0 (concatD [prt 0 str])++  prtList es = case es of+   [] -> (concatD [])+   x:xs -> (concatD [prt 0 x , prt 0 xs])++
+ src/lib/Dict/Skel.hs view
@@ -0,0 +1,41 @@+module Dict.Skel where++-- Haskell module generated by the BNF converter++import Dict.Abs+import Dict.ErrM+type Result = Err String++failure :: Show a => a -> Result+failure x = Bad $ "Undefined case: " ++ show x++transIdent :: Ident -> Result+transIdent x = case x of+  Ident str  -> failure x+++transDictionary :: Dictionary -> Result+transDictionary x = case x of+  Dict entrys  -> failure x+++transEntry :: Entry -> Result+transEntry x = case x of+  E id args  -> failure x+  EA id args terms  -> failure x+++transTerm :: Term -> Result+transTerm x = case x of+  TermC id terms  -> failure x+  TermA arg  -> failure x+++transArg :: Arg -> Result+transArg x = case x of+  NId id  -> failure x+  NArg n  -> failure x+  NStr str  -> failure x+++
+ src/lib/DictToDictionary.hs view
@@ -0,0 +1,70 @@+module DictToDictionary where++import qualified Data.Map as Map+import qualified Data.Set as Set+import qualified Dict.Abs as Abs+import Dict.GetDict+import Dictionary+import Frontend+import IO+import Monad(when)+import System+import Dict.ErrM+import Util++-- | Parse commands.+parseCommand :: Language a => a -> ParadigmErrors -> Abs.Entry -> (Either Entry ParadigmErrors)+parseCommand l pe e =+  let  (i,args,t) = f e+       xs = [s | Abs.NStr s <- args] in +   case Map.lookup i (paradigms l) of+     Nothing -> (Right (insertParadigmError (Left i) pe))+     Just (ys,f) -> let n = length xs in+                      if (n == length ys) then+	                  (Left (g t (f xs)))+                       else+			  (Right (insertParadigmError  (Right (i,n)) pe))+ where+   f (Abs.E (Abs.Ident i) args)    = (i,args,Nothing)+   f (Abs.EA (Abs.Ident i) args t) = (i,args,Just t)+   g Nothing  e = e+   g (Just t) e = termParser l t e++-- | Reading external lexicon. Create empty lexicon if the file does not exist.+parseDict :: Language a => a -> FilePath -> (Bool,Bool,Bool) -> IO (Err (Dictionary,Int))+parseDict l f  (undefcheck,argccheck,unusedcheck) = +    do res <- catch (readdict l f (undefcheck,argccheck,unusedcheck)) +               (\_ -> do prErr ("Unable to load dictionary file: \"" ++ f ++ "\".\n")+                         exitFailure)+       case res of+         Ok (es,n) -> return $ Ok (dictionary es,n)       +         Bad s     -> return $ Bad s ++getNames                              [] = []+getNames ((Abs.E  (Abs.Ident i) _):xs)   = i:getNames xs+getNames ((Abs.EA (Abs.Ident i) _ _):xs) = i:getNames xs++-- | Read external lexicon.+readdict :: Language a => a -> FilePath -> (Bool,Bool,Bool) -> IO (Err ([Entry],Int))+readdict l f  (undefcheck,argccheck,unusedcheck) -- output_errors +        = do s <- readFile f+             case getDict s of+               Ok (Abs.Dict es) -> +                   do  when unusedcheck $ prStd $+                        case (Set.toList (Set.difference (Set.fromList (paradigmID l)) (Set.fromList (getNames es)))) of+                         [] -> "\nNo unpopulated paradigms detected!\n" +                         ys -> "\nUnpopulated paradigms detected:\n" ++ prErrorTable ys+                       process l es emptyParadigmErrors ([],0)+               Bad s            -> return (Bad s)+ where+  process l [] bad_para xs = +      do printErrors bad_para (undefcheck,argccheck)+         return (Ok xs)+  process l (e:es) bad_para xs =+	       do (bp,res) <- collect e bad_para xs+                  process l es bp res+  collect e bad_para res@(pre,n)+     = do case parseCommand l bad_para e of+            Left e   -> return (bad_para,(e:pre,n+1))+	    Right bp -> return (bp,res)+
+ src/lib/Dictionary.hs view
@@ -0,0 +1,472 @@+module Dictionary where++import General+import List (intersperse,sortBy, group,sort)+import Char+import IO+import Util+import System.IO.Unsafe (unsafePerformIO)+import qualified Data.Set as Set+import SharedString+import Dict.ErrM+import Maybe+import qualified Data.Set as Set+++-- | An instance of the Dict class provides information on how+-- | to construct an entry for a given dictionary type. In +-- | particular, it associated a word class identifier to the+-- | dictionary type.+class Param a => Dict a where+  dictword :: (a -> Str) -> String+  dictword f = getDictWord f+  category :: (a -> Str) -> String+  category = const "Undefined"+  defaultAttr :: (a -> Str) -> Attr+  defaultAttr = const noComp+  attrException :: (a -> Str) -> [(a,Attr)]+  attrException = const []++getDictWord f = +   case [x | (x:_) <- map (unStr . f) values] of+    (w:_) -> w+    _     -> "ET"++-- | The Dictionary ADT+data Dictionary       = Dict [Entry]++-- | Dictionary_Word = citation form+type Dictionary_Word  = String++-- | Part of speech+type Category         = String++-- | Untyped inherent+type Inherent         = String++-- | Untyped inflection parameter configuration+type Untyped          = String++-- | Untyped inflection table+type Inflection_Table = [(Untyped,(Attr,Str))]++-- | It is possible to add information about every word form,+-- | such as pronounciation.+type Extra            = [Str] ++-- | Paradigm identifier.+type Paradigm = String++type LemmaID = String++-- | An Entry contains all information about a word.+type Entry = (LemmaID, Dictionary_Word, Paradigm, Category, [Inherent], Inflection_Table,Extra)++-- | An Entry without the compound information.+type EntryN =  (Dictionary_Word, Category, [Inherent], [(Untyped,Str)])+++get_id :: Entry -> String+get_id (i,_,_,_,_,_,_) = i++is_equal_entry :: Entry -> Entry -> Bool+is_equal_entry e1 e2 = f e1 == f e2+ where f (_,d,_,c,inhs,infl,e) = (d,c,inhs,sort_table infl,e)+       sort_table table = [(p,(a,strings (sort (unStr s)))) | (p,(a,s)) <- table]++-- | Empty Dictionary+emptyDict :: Dictionary+emptyDict = Dict []++emptyEntry :: Entry+emptyEntry = ([],[],[],[],[],[],[])++is_empty_entry :: Entry -> Bool+is_empty_entry e = case e of +                     (_,[],_,[],[],[],[]) -> True+                     _                    -> False++is_empty_dictionary :: Dictionary -> Bool+is_empty_dictionary (Dict xs) = and $ map is_empty_entry xs++-- | Perform sharing on the strings in the Dictionary.+shareDictionary :: Dictionary -> Dictionary+shareDictionary (Dict xs) = Dict $ map shareEntry xs++-- | set paradigm id.+set_paradigm_id :: String -> Entry -> Entry+set_paradigm_id p (i,x@(_:_),_,c,y,z,w) = (i,x,p,c,y,z,w)+set_paradigm_id _                   e = e++-- | set pos.+set_pos :: String -> Entry -> Entry+set_pos pos (i,x,p,_,y,z,w) = (i,x,p,pos,y,z,w)++get_pos :: Entry -> Category+get_pos (i,x,p,pos,y,z,w) = pos++set_inhs :: [String] -> Entry -> Entry+set_inhs inhs (i,x,p,pos,_,z,w) = (i,x,p,pos,inhs,z,w)++-- | get head.+get_head :: Entry -> String +get_head (i,h,p,x,y,z,w) = h++-- | set head.+set_head :: String -> Entry -> Entry+set_head h (i,_,p,x,y,z,w) = (i,h,p,x,y,z,w)++-- | set lemma id.+set_lemma_id :: String -> Entry -> Entry+set_lemma_id i (_,x,p,pos,y,z,w) = (i,x,p,pos,y,z,w)++get_lemma_id :: Entry -> String+get_lemma_id (i,x,p,pos,y,z,w) = i+++replace_attr :: Attr -> Attr -> Entry -> Entry+replace_attr a b (i,x,p,pos,y,table,w) = (i,x,p,pos,y,table',w) + where table' = [(u,(if n == a then b else n,str)) | (u,(n,str)) <- table]++replace_param :: [(String,String)] -> Entry -> Entry+replace_param xs (i,x,p,pos,y,table,w) = (i,x,p,pos,y,table',w) + where table' = [(param_map u,s) | (u,s) <- table]+       param_map u = case lookup u xs of+                       Nothing    -> u+                       Just p_new -> p_new++-- | share an Entry+shareEntry :: Entry -> Entry+shareEntry (i,dict_word, p, cat, inhs, infl, extra) =+    (i,+     shareString dict_word, +     shareString p, +     shareString cat, +     map shareString inhs, +     shareTable infl, +     extra) + where shareTable xs = map (\(a,(p,b)) -> (shareString a,(p,shareStr b))) xs++--  [(Untyped,(Attr,Str))]+multi_words :: ([String], Entry ,[String]) -> Entry+multi_words (xs,e,ys) = e'+ where+  f  = (ps ++) . (++ ss)+  ps = unwords xs ++ (if (null xs) then "" else " ") +  ss = (if (null ys) then "" else " ") ++ unwords ys+  e' = case e of+        (id,dict_word, p, cat, inhs, infl, extra) ->+            (id,f dict_word, p, cat, inhs, +             [ (p,(a,mapStr f str)) | (p,(a,str)) <- infl], extra) ++first_mw :: Category -> (String -> Entry) -> (String -> Entry)+first_mw pos f s = + case words s of+  (x:xs) -> set_pos pos $ multi_words ([],f x,xs)+  _      -> error $ "first, invalid multiword: " ++ s++last_mw :: Category -> (String -> Entry) -> (String -> Entry)+last_mw pos f s = set_pos pos $ multi_words (xs, f l, [])+ where ws = words s+       l  = last ws+       xs = init ws++-- | create an inflection table with the compound information.+infTable :: Dict a => (a -> Str) -> Inflection_Table+infTable f = prTableAttr f (defaultAttr f) (attrException f)++-- | Translate the function encoding the extra information about the+-- | word forms to a list of strings.+extraTable ::  Dict a => (a -> Str) -> Extra+extraTable f = [s | (_,s) <- table f]+ +-- | Translate an inflection function to an Entry.+entry  :: Dict a => (a -> Str) -> Entry+entry f = entryI f [] +  +-- | Translate an inflection function with inherent information to an Entry.+entryI :: Dict a => (a -> Str) -> [Inherent] -> Entry+entryI f ihs = (entry_id f ihs [], dictword f, "", category f, ihs, infTable f,[])++entry_id :: Dict a => (a -> Str) -> [Inherent] -> Paradigm -> LemmaID+entry_id f inhs p = construct_name (dictword f) (category f) (concat (intersperse "_" inhs)) p++-- | Translate an inflection function with paradigm identifier to an Entry.+entryP  :: Dict a => (a -> Str) -> Paradigm -> Entry+entryP f p = entryIP f [] p+  +-- | Inflection function + inherent + paradigm identifier -> Entry+entryIP :: Dict a => (a -> Str) -> [Inherent] -> Paradigm -> Entry+entryIP f ihs p = (entry_id f ihs p, dictword f, p , category f, ihs, infTable f,[])++-- | Inflection function with extra information+entryWithInfo ::  Dict a => (a -> (Str,Str)) -> Entry+entryWithInfo f = entryWithInfoI f []++-- | inflection function with extra information and inherent information.+entryWithInfoI ::  Dict a => (a -> (Str,Str)) -> [Inherent] -> Entry+entryWithInfoI fun ihs = (entry_id f ihs [], dictword f, "", category f, ihs, infTable f,extraTable g)+  where f = \a -> fst (fun a)+        g = \a -> snd (fun a)+-- entryI (\a -> unionStr (f a) (unionStr (mkStr "|") (g a))) ihs++-- | inflection function with extra information and inherent information.+entryWithInfoP ::  Dict a => (a -> (Str,Str)) -> Paradigm -> Entry+entryWithInfoP f = entryWithInfoIP f [] ++-- | inflection function with extra information and inherent information+-- | and paradigm identifier. +entryWithInfoIP ::  Dict a => (a -> (Str,Str)) -> [Inherent] -> Paradigm -> Entry+entryWithInfoIP fun ihs p = (entry_id f ihs p, dictword f, p, category f, ihs, infTable f,extraTable g)+  where f = \a -> fst (fun a)+        g = \a -> snd (fun a)++-- | Create a table with compound attributes.+prTableAttr :: Param a => (a -> Str) -> Attr -> [(a,Attr)] -> [(String,(Attr,Str))]+prTableAttr t da ts = +    [(prValue a,(maybe da id (lookup a ts),s)) | (a,s) <- table t]++-- | Create a table with compound attributes when compound analysis+-- | is not used. +--prTableW :: Param a => Table a -> [(String,(Attr,Str))]+--prTableW t = [ (a,(noComp,s)) | (a,s) <- prTable t]+++-- | Transform typed table to untyped. +prTable :: Param a => Table a -> Table String+prTable = map (\ (a,b) -> (prValue a, b))++unDict :: Dictionary -> [Entry]+unDict (Dict xs) = xs++-- | Number of Entry:s in Dictionary+size :: Dictionary -> Int+size = length . unDict++-- | Number of word forms.+sizeW :: Dictionary -> Int+sizeW = sum . map sizeEntry . unDict++-- | Number of word forms in Entry.+sizeEntry :: Entry -> Int+sizeEntry (_,_,_,_,_,t,_) = length t++-- | Create a Dictionary +dictionary :: [Entry] -> Dictionary+dictionary = Dict . filter (not . is_empty_entry)++is_empty :: Dictionary -> Bool+is_empty (Dict []) = True+is_empty _         = False++-- | Concatenate two dictionaries.+unionDictionary :: Dictionary -> Dictionary -> Dictionary+unionDictionary (Dict xs) (Dict ys) = Dict $ xs ++ ys++-- | Concatenate a list of Dictionaries.+unionDictionaries :: [Dictionary] -> Dictionary+unionDictionaries = foldr unionDictionary emptyDict++-- | Remove attributes from a dictionary.+removeAttr :: Dictionary -> [EntryN]+removeAttr = map noAttr . unDict++-- | Remove attributes from Entry. Also remove extra information. +noAttr :: Entry ->  EntryN+noAttr (_,d,_,c,inh,tab,_) = (d,c,inh,[(i, s) | (i,(_,s)) <- tab])++-- | Group a dictionary into categories; reverses the entries... +classifyDict :: Dictionary -> [(Category,[Entry])]+classifyDict = foldr addNext [] . unDict+ where+  addNext entry@(_,_,_,cat,_,_,_) dict = case dict of+    (c,es) : dict' | cat == c -> (c, entry:es) : dict'+    ces    : dict'            -> ces           : addNext entry dict'+    []                        -> [(cat,[entry])]++-- | A list of the word form together with the analyses and compound attributes.+type FullFormLex = [(String,[(Attr,String)])]++-- | A fullform lexicon structured around the word identifier+dict2idlex :: Dictionary -> FullFormLex+dict2idlex (Dict es) = map entry2id es++-- | Translate Entry to a word identifier and its associated word forms.+entry2id :: Entry -> (String,[(Attr,String)])+entry2id (name, stem, para, typ, inhs, infl,_) =+    (name,[(a,concat $ "{":(jword w):jk:(jhead stem):jk :(jpos typ):+                                              (jparam par):jk:(jinhs inhs):jk:(jid name):jk:(jp para):jk:(jattr (show a)) : ["}"]) +                                                                  | (par,(a,str)) <- infl,+                                                                    w <- unStr str])++-- name = construct_name stem typ (concat (intersperse "_" inhs)) para ++testdata :: Dictionary -> [(String,String,String,String,[String],[String],String)]+testdata (Dict es) = concat $ map createTest es+ where+   createTest (id,stem,para,typ,inhs,infl,_) = [(s,stem,typ,para,words u, inhs,id) | (u,(_,str)) <- infl, s <- f (unStr str)]+   f [] = [""]+   f xs = xs++entrywords :: Entry -> (String,[String])+entrywords (_,stem, para, typ, inhs, infl,extra) = (stem, [ x | (_,(_,str)) <- infl, x <- unStr str ])++++--- | Create a fullform lexicon.+dict2fullform :: Dictionary -> FullFormLex+dict2fullform (Dict es) = concat $ map entry2full es ++entry2full :: Entry -> [(String,[(Attr,String)])]+entry2full (name, stem, para, typ, inhs, infl,_) = +  concatMap mkForm infl where+    mkForm (par,(a,str)) = +        [(s1, [(a,concat ["{",jword s1,jk,jhead stem,jk,jpos typ,jk,jparam par,jk,jinhs inhs,jk,jid name,jk,jp para,jk,jattr (show a),"}"])])+         | s1 <- unStr str]++jword :: String -> String+jword  s1 = "\"word\":" ++ pr_v s1++jhead :: String -> String+jhead  s1 = "\"head\":" ++ pr_v s1++jpos :: String -> String+jpos   s1 = "\"pos\":" ++ pr_v s1++jparam :: String -> String+jparam s1 = "\"param\":" ++ pr_v s1++jinhs :: [String] -> String+jinhs  s1 = "\"inhs\":" ++ "[" ++ (concat (intersperse ", " (map quote s1))) ++ "]"++jid :: String -> String+jid    s1 = "\"id\":" ++ pr_v s1++jp :: String -> String+jp     s1 = "\"p\":" ++ pr_v s1++jattr :: String -> String+jattr  s1 = "\"attr\":" ++ pr_v s1++jk :: String+jk = ","++pr_v :: String -> String+pr_v [] = show "*"+pr_v  v = quote v++--json_list :: String -> [String] -> String+--json_list field values = quote field ++ ":[" ++ (concat (intersperse ", " (map quote values))) ++ "]"++-- | Create word identifier.+construct_name :: String -> String -> String -> String -> String+construct_name stem typ inhs para = +  case para of+   []   -> nospace $ stem++"_"++typ++ inhs'+   para -> nospace $ stem++"_"++typ++ inhs' ++ "_" ++para+ where+  inhs'   = if null inhs then "" else "_" ++ inhs+  nospace = map (\c -> if (c==' ') then '_' else c)++type Unknowns       = Set.Set String+type WrongArguments = Set.Set (String,Int)+type ParadigmErrors = (Unknowns, WrongArguments)++emptyParadigmErrors :: ParadigmErrors+emptyParadigmErrors = (Set.empty,Set.empty)++insertParadigmError :: Either String (String,Int) -> ParadigmErrors -> ParadigmErrors+insertParadigmError (Left p) (unknowns, wa) = (Set.insert p unknowns, wa)+insertParadigmError (Right a) (us, wrong_arguments) = +    (us, Set.insert a wrong_arguments)++prErrorTable :: [String] -> String+prErrorTable ts = unlines +              [unwords [" ",pad s1 c1,pad s2 c2, pad s3 c3] | (s1,s2,s3) <- sp]+ where f1 (x,_,_) = length x+       f2 (_,x,_) = length x+       f3 (_,_,x) = length x+       c1 = maximum (map f1 sp)+       c2 = maximum (map f2 sp)+       c3 = maximum (map f3 sp)+       sp = splits ts+       pad s c = s ++ take (c - length s) (repeat ' ')+       splits []    = []+       splits [x]   = [(x,[],[])]+       splits [x,y] = [(x,y,[])]+       splits xs = case splitAt 3 xs of+                     ([x,y,z],rs) -> (x,y,z):splits rs++equal_entry :: [(String,String)] -> Entry -> Entry -> Maybe (String,String)+equal_entry tab e1 e2+  | is_equal_entry e1 e2 = if (except tab e1 e2) then Nothing else Just (pr e1, pr e2)+  | otherwise            = Nothing+ where pr (name, stem, para, typ, inhs, infl,extra) = para+       except xs  (n1, _, _, _,_,_,_) (n2, _, _, _,_,_,_) = elem (n1,n2) xs || elem (n2,n1) xs++check_duplication :: [(Entry,[Entry])] -> [(String,String)] -> [(String,String)]+check_duplication entries tab =  catMaybes $ run_check entries+  where run_check     [] = []+        run_check ((e,es):ess) = map (equal_entry tab e) es ++ run_check ess++print_duplicates :: [(Entry,[Entry])] -> [(String,String)] -> IO ()+print_duplicates ds tab = case clean (check_duplication ds tab) of+                            (x:xs) -> do prStd $ "\nPotentially identical paradigms found:"+                                         prStd $ unlines [ " " ++ p1 ++ " ~ " ++ p2 | (p1,p2) <- (x:xs)]+                            _      -> prStd "No identical paradigms found!"+ where clean [] = []+       clean ((x@(p1,p2)):xs)+        | elem (p1,p2) xs || elem (p2,p1) xs = x:clean xs+        | otherwise = clean xs++transform_dictionary (pos,inhs,param) (Dict xs) = Dict (map tr xs)+  where tr (name, stem, para, typ, is, infl,extra) = +         let infl' = [(param_f (typ,a,is),b) | (a,b) <- infl] in+            (name,stem,para,pos_f typ, inhs_f is,infl',extra)+        pos_f   = f pos+        inhs_f  = f inhs+        param_f i@(p,a,is)= case param of+                              Nothing -> a+                              Just g -> g i+        f Nothing = id+        f (Just g) = g+++map_wordforms :: (String -> String) -> Entry -> Entry+map_wordforms f (name, stem, para, typ, inhs, infl,extra) = +     (name,stem,para,typ,inhs,infl',extra)+ where infl' = [(u,(a,strings (map f (unStr ss)))) | (u,(a,ss)) <- infl]++duplicated_lemma_id :: Dictionary -> [String]+duplicated_lemma_id (Dict es) = check (map get_lemma_id es) (Set.empty,Set.empty)+  where check [] (_,b) = Set.toList b+        check (x:xs) (s,b) +          | Set.member x s = check xs (s,Set.insert x b)+          | otherwise      = check xs (Set.insert x s, b)++remove_param :: String -> Entry -> Entry+remove_param p (name, stem, para, typ, inhs, infl,extra) = +    (name, stem, para, typ, inhs, infl',extra)+ where infl' = [f (u,(a,ss)) | (u,(a,ss)) <- infl]+       f (u,(a,ss)) +         | elem p (words u) = (u,(a,nonExist))+         | otherwise = (u,(a,ss))++type Positive = [String]+type Negative = [String]++expand_multiword :: String -> [(Positive,Negative,String)] -> Entry -> Entry+expand_multiword p xs (name, stem, para, typ, inhs, infl,extra) = +    (name, stem, para, typ, inhs, infl',extra)+ where infl' = [(u,(a,strings (concat (map (f (words u) . words) (unStr ss))))) | (u,(a,ss)) <- infl]+       f us = map unwords . flatten . map (g us)+       g us x = if x == p then [ s | (pos,neg,s) <- xs, all_in pos us && (null neg || not (all_in neg us))] else [x]+       all_in     [] ys = True+       all_in (x:xs) ys = elem x ys && all_in xs ys +       flatten [] = [[]]+       flatten (x:xs) = [x':xs'  | x' <- x, xs' <- flatten xs]++combine_tables :: Entry -> Entry -> Entry+combine_tables (name, stem, para, typ, inhs, infl,extra) (_, _, _, _, _, infl1, _) = +    (name, stem, para, typ, inhs, infl',extra)+ where infl' = [(u,(a,unionStr ss ss2)) | ((u,(a,ss)),(_,(_,ss2))) <- zip infl infl1]
+ src/lib/EditDistance.hs view
@@ -0,0 +1,98 @@+module EditDistance where++import Data.Array+import List+import Char+import System+import qualified Data.Set++data Position    = Int++data Operation a = Delete      a | +		   Insert      a | +		   Replace   a a | +		   Untouched   a+  deriving (Show,Eq)++isUntouched :: Operation a -> Bool+isUntouched (Untouched _) = True+isUntouched _             = False++isOp :: Operation a -> Bool+isOp = not . isUntouched+                +-- Compares a list of strings, and gives a set of common substrings+commonSubsequences :: Ord a => [[a]] -> Data.Set.Set [a]+commonSubsequences      []  = Data.Set.empty+commonSubsequences     [x]  = Data.Set.empty+commonSubsequences (x:y:xs) = Data.Set.fromList $ traverse (commonSub x y) xs+ where traverse x []        = x+       traverse x (y:ys)    = traverse (commonSub (concat x) y) ys++-- Compares two strings, and gives a list of common substrings,+-- not necessary unique+commonSub :: Eq a => [a] -> [a] -> [[a]]+commonSub s1 s2 = collect $ snd $ editDistance s1 s2+ where collect [] = []+       collect (x:xs)+        | isUntouched x = case span isUntouched (x:xs) of+			   (us,rest) -> [c | (Untouched c) <- us] : collect rest+	| otherwise     = collect xs++-- Calculate the edit distance of two strings. +-- The result is the edit distance metrics and a list of operations.+editDistance ::  Eq a => [a] -> [a] -> (Int,[Operation a])+editDistance s1 s2 = (tab ! (l1,l2), reverse (backtrack tab (l1,l2) (s1a,s2a)))+ where l1 = length s1+       l2 = length s2+       s1a = array (0,l1) (zip [1..(l1+1)] s1)+       s2a = array (0,l2) (zip [1..(l2+1)] s2)+       tab = array ((0,0),(l1,l2)) +	      [((x,y),edit (x,y)) | x <- [0..l1], y <- [0..l2]]+       edit (x,0) = x+       edit (0,x) = x+       edit (x,y) = +	   minimum [tab ! (x-1,y)+1,          -- insertion+		    tab ! (x,y-1)+1,          -- deletion+	            tab ! (x-1,y-1)+cost x y] -- substitution+       cost x y +         | s1a ! x == s2a ! y = 0+	 | otherwise          = 2 -- substitution cost.++dot_it :: [String] -> String+dot_it (s:xs) = dot s $ map (snd . (editDistance s)) xs++-- Trace the edit distance algorithm+backtrack :: Array (Int,Int) Int -> (Int,Int) -> +	     (Array Int a,Array Int a) -> [Operation a]+backtrack tab (0,0)  _ = []+backtrack tab (0,l1) (s1,s2)  +    = [Insert (s2 ! n) | n <- reverse [1 .. l1]]+backtrack tab (l1,0) (s1,s2)  +    = [Delete (s1 ! n) | n <- reverse [1 .. l1]]+backtrack tab (x,y) (s1,s2) = if a < b && a < c then+		        (Delete (s1 ! x)) : backtrack tab (x-1,y) (s1,s2)+                       else +                        if b < c then+			 (Insert (s2 ! y)) : backtrack tab (x,y-1) (s1,s2)+			 else if c == d then+			         (Untouched (s1 ! x)): backtrack tab (x-1,y-1) (s1,s2)+			         else (Replace (s1 ! x) (s2 ! y)) : +				      backtrack tab (x-1,y-1) (s1,s2)	       + where a = tab ! (x-1,y)   -- insert+       b = tab ! (x,y-1)   -- delete+       c = tab ! (x-1,y-1) -- replace+       d = tab ! (x,y)     -- untouched++dot :: String -> [[Operation Char]] -> String+dot s xs = unlines $ ["digraph paradigm {", " rankdir=LR;", unlines (map dotify xs) ++ "}"]+ where dotify  ops   = " " ++ s ++ " -> " ++ ending ops ++ transform ops ++ " ;"+       ending ops    = [a | (Insert a ) <- ops]+       transform ops = case [(a:" -> ") ++ [b] | (Replace a b) <- ops] +++                            [(a:" -> ")  | (Delete a ) <- ops] of+                         [] -> []+                         xs -> " [label=" ++ ("\"" ++ concat (intersperse ", " xs) ++ "\"") ++ "]"++test = putStrLn $ dot_it ["smula","smulan", "smulans", "smulas", "smulor", "smulors", "smulornas", "smulorna"]++test2 = putStrLn $ dot_it ["man","mannen", "mannens", "mans", "män", "mäns", "männen", "männens"]
+ src/lib/Frontend.hs view
@@ -0,0 +1,310 @@+{-# OPTIONS_GHC -fglasgow-exts #-}++module Frontend where++import qualified Data.Set as Set+import qualified Data.Map as Map+import qualified Dict.Abs as Abs+import Dictionary+import Dict.ErrM+import Util+import Char+import System+import Print+import General+import Monad(when)+import Maybe(isJust)+import System.IO.Unsafe (unsafePerformIO)+import IO+import Tokenize+import qualified CTrie+import List(intersperse)+import EditDistance+import List+import Compound++-- Note that all Functions have default definitions, but +-- in the common case, you give, at least, definitions for "paradigms"+-- "internDict" and "composition"++type Label = String++type TestInput = (String, Dictionary_Word, Category, Paradigm, [String], [Inherent],String)++tword :: TestInput -> Maybe String+tword ("",_,_,_,_,_,_) = Nothing+tword (s,_,_,_,_,_,_) = Just s++w :: TestInput -> String+w t = case (tword t) of+           Just s -> s+           Nothing -> []++thead :: TestInput -> String+thead (_,s,_,_,_,_,_) = s++tcat :: TestInput -> String+tcat  (_,_,s,_,_,_,_) = s++tpara :: TestInput -> String+tpara (_,_,_,s,_,_,_) = s++tparam :: TestInput -> [String]+tparam (_,_,_,_,xs,_,_) = xs++tinhs :: TestInput -> [String]+tinhs (_,_,_,_,_,xs,_) = xs++tid :: TestInput -> String+tid (_,_,_,_,_,_,s) = s++type PositiveTests = [(TestInput -> Maybe String)]++type NegativeTests = [(TestInput -> Maybe String)]++type Result = Maybe String++message :: TestInput -> String -> Result+message t s = Just $ concat ["[ ", s, " ]\n    ", prw (w t), " {h:\"", pr (thead t),"\" pos:",pr (tcat t)," param:", prl (tparam t),+                             " is:",pri (tinhs t), " id:", pr (tid t), " p:", pr (tpara t),"}"]+ where prw s = case s of+                 [] -> " * "+                 x  -> quote s+       pr s = case s of+               [] -> "unknown"+               _  -> s+       pri xs = case xs of+                 [] -> "none"+                 _  -> unwords xs+       prl xs = case xs of+                 [] -> "unknown"+                 _  -> unwords xs++pass :: Maybe String+pass = Nothing++type Encoding = String++type TrPos   = String -> String++type TrInhs  = [String] -> [String]++type TrParam = (String,String,[String]) -> String++--class Show a => Language a b | a -> b where+-- | A class defined to be able to construct a language independent frontend+class Show a => Language a  where+  name              :: a -> String +  morphology_header :: a -> String +  dbaseName         :: a -> String  +  composition       :: a -> Maybe CompDesc --([General.Attr] -> Bool)+  word_attr         :: a -> [Attr]+  affixes           :: a -> Set.Set String+  env               :: a -> String +  paradigms         :: a -> Commands+  internDict        :: a -> Dictionary +  tokenizer         :: a -> String -> [General.Tok]+  wordGuesser       :: a -> String -> [String]+  termParser        :: a -> [Abs.Term] -> Entry -> Entry+  testBench         :: a -> (PositiveTests,NegativeTests)+  dup_id_exceptions :: a -> [(String,String)]+  sandhi_rules      :: a -> (String,String) -> [(String,String)]+  encoding    :: a -> Map.Map Encoding (Maybe TrPos, Maybe TrInhs, Maybe TrParam)+  lprinter :: a -> [(String,Dictionary -> String)]+  dictionary_postprocessing :: a -> Dictionary -> Dictionary+  paradigm_dup_exception :: a -> Set.Set String+  name        l = map toLower (show l)+  morphology_header l = name l+  dbaseName   l = name l ++ ".dict"+  composition l = Nothing -- noComp+  word_attr l = [0]+  affixes     l = Set.empty+  env         l = "FM_" ++ map toUpper (show l)+  encoding    _ = Map.empty+  paradigms   _ = emptyC+  internDict  _ = emptyDict  +  tokenizer   _ = tokens+  sandhi_rules _ = (:[])+  wordGuesser _ = const []+  testBench   _ = ([],[])+  dup_id_exceptions _ = []+  termParser  _ _ e = e+  lprinter _ = []+  dictionary_postprocessing _ d = d+  paradigm_dup_exception _ = Set.empty++-- | type for Command Map  +type Commands = Map.Map String ([String], [String] -> Entry) ++-- | empty Command Map+emptyC :: Commands+emptyC = Map.empty++isComp :: Language l => l -> Bool+isComp l = case composition l of+             Nothing -> False+             _       -> True++-- | add a command+insertCommand :: (String,[String],[String] -> Entry) -> Commands -> Commands+insertCommand (n,args,f) cs +  | Map.member n cs =  unsafePerformIO $ +                        do prErr $ "internal error:\nduplicated paradigm identifier in command table: " ++ n+                           return cs+  | otherwise       =  Map.insert n (args,f) cs++-- | Construct a Command Map+mkCommands :: [(String,[String],[String] -> Entry)] -> Commands+mkCommands = foldr insertCommand Map.empty++-- | Create a dictionary from the list of paradigms.+-- prParadigms :: Language a => a -> Dictionary -> String+-- prParadigms l d = prDictionary d++--unlines $ filter (not . null) $ map pr [(unwords (p:(map quote xs)), dictionary [f xs]) | (p,(xs,f)) <- Map.toList (paradigms l)]+-- where pr (s,d) +--         | is_empty_dictionary d = "" +--         | otherwise             = "{\n" ++ s ++ "\n\n" ++ prDictionary d ++ "}\n"++prTagset :: Language a => a -> Dictionary -> String+prTagset l d = collect_and_print (Set.empty,Set.empty,Set.empty) (unDict d)+ where collect_and_print :: (Set.Set String, Set.Set String, Set.Set String) -> [Entry] -> String+       collect_and_print (s,i,p) [] = concat $ ["{\n\"pos\":[",+                                                (concat (intersperse "," (map quote (Set.toList s)))),+                                                "],\n",+                                                "\"inherent\":[",+                                                (concat (intersperse "," (map quote (Set.toList i)))),+                                                "],\n",+                                                "\"param\":[",+                                                (concat (intersperse "," (map quote (Set.toList p)))),+                                                "]\n}\n"]+       collect_and_print (s,i,p) ((_,_, _ , pos, inhs, infl,_):xs) = collect_and_print (update [pos] s, update inhs i, update [t | (t,_) <- infl] p) xs+       update     [] s = s+       update (x:xs) s = update xs (Set.insert x s)++prCompound :: Language a => a -> String+prCompound l = case (composition l) of+                 Nothing -> "NONE"+                 Just x  -> prCompDesc x++prExtract :: Language a => a -> String+prExtract l = concat [pr p (entrywords (f xs)) | (p,(xs,f)) <- Map.toList (paradigms l)]+ where+  pr p ([],[]) = []+  pr p (s,xs)  +     -- do not include multi-word paradigms or numbers.+   | contains_space (s:xs) || contains_digits (s:xs) = [] +   | otherwise             = print_paradigm p (s:xs) (commonSubsequences (s:xs))+  contains_space xs = or [ elem ' ' x  | x <- xs]+  contains_digits xs = or [ any isDigit x  | x <- xs]++print_paradigm :: String -> [String] -> Set.Set String -> String+print_paradigm name xs@(x:_) set = + let vars = concat (intersperse "," (zipWith (++) (Set.toList set) (repeat ":char*"))) in +  unlines +   ["paradigm " ++ name ++ +    if null vars then "" else " [" ++ vars ++ "]",+   " = " ++ (print (transform [] x)),+   " {", (splitLines (intersperse "|" (map (print . (transform [])) (nub xs)))), " };\n"+  ]+ where print [] = []+       print ((s,b):xs)+        | b         = concat [s,if_conc xs,print xs]+        | otherwise = concat ["\"",s,"\"",if_conc xs,print xs]+       if_conc [] = []+       if_conc _  = "+"+       splitLines [] = []+       splitLines xs = case splitAt 6 xs of+                        (ys,[]) -> (" " ++ unwords ys) +                        (ys,zs) -> (" " ++ unwords ys ++ "\n") ++ splitLines zs+       transform     []  [] = []+       transform (x:xs)  [] = [(reverse (x:xs),False)]+       transform ws  (x:xs) = case [z | z <- reverse (inits (x:xs)), +				        Set.member z set] of+			       (y:_) | null ws -> (y,True):+					       transform [] (drop (length y) (x:xs))+			       (y:_) -> (reverse ws,False):(y,True): +			                       transform [] (drop (length y) (x:xs))+			       _     -> transform (x:ws) xs++lookup_paradigm :: Language l => l -> IO()+lookup_paradigm l = do s <- getContents+                       let ls = head $ filter (not.null) (lines s)+                       putStrLn $ lparadigm $ (commas ls)+   where +         trim s = unwords $ words s+         commas :: String -> [String]+         commas [] = []+         commas s = case span (/=',') s of+                    (x,[]) -> [trim x]+                    (x,(_:rest)) -> trim x:commas rest+         lparadigm :: [String] -> String+         lparadigm (x:xs) = +             case span (/=':') x of+               (x,[]) -> "[]"+               (x,(_:pos)) ->+                   let ps = [p | (p,e) <- [(p,f [x]) | (p,(_,f)) <- Map.toList (paradigms l)], get_pos e == pos,all (\w -> elem w (snd (entrywords e))) xs] in+                    concat $ "[":(intersperse ",\n" ["\"" ++ p ++ "\"" | p <- ps])++["]"]+         para = paradigms l++printErrors :: ParadigmErrors -> (Bool, Bool) -> IO()+printErrors _ (False,False) = return ()+printErrors (unknowns, wrong_arguments) (ub,wb) = +    prStd (concat +           [if ub then printUnknowns (Set.toList unknowns) else "", +            if wb then printWrongArguments (Set.toList wrong_arguments) else ""])+ where printUnknowns [] =  "No undefined paradigms detected!\n\n"+       printUnknowns xs =  +           "Undefined paradigms detected\n\n" ++ (prErrorTable xs) ++ "\n"+       printWrongArguments [] = "No argument count mismatches detected!\n"+       printWrongArguments xs =  +           "Argument count mismatches detected\n\n" +++                      (prErrorTable (map fst xs))++check_lemma_duplication :: Dictionary -> IO()+check_lemma_duplication d = prStd $+                            case duplicated_lemma_id d of+                             [] -> "No lemma id duplications detected!\n"+                             xs -> "Lemma id duplications detected\n\n" ++ +                                   (prErrorTable xs)++-- | List paradigm names+paradigmNames :: Language a => a -> [String]+paradigmNames l = [ c ++ " \"" ++ unwords args ++ "\" ;" | (c,(args,_)) <- Map.toList (paradigms l)]++paradigmID ::  Language a => a -> [String]+paradigmID l = [ c | (c,_) <- Map.toList (paradigms l)]++-- | Number of paradigms.+paradigmCount :: Language a => a -> Int+paradigmCount l = length $ Map.toList (paradigms l)++-- | Is input string a paradigm identifier?+isParadigm :: Language a => a -> String -> Bool+isParadigm l s = isJust $ Map.lookup s (paradigms l)++class App a where+    app :: a -> [String] -> Entry+    arity :: a -> Int++instance App Entry where+    app e [] = e+    app e xs = error $ "Too many arguments, got " ++ show (length xs) ++ " wanted 0"+    arity _  = 0++instance App a => App (String -> a) where+ app f ys@(x:xs) | length ys == arity f = app (f x) (xs)+                 | otherwise = error $ "Wrong number of arguments, got " ++ show (length ys) ++ " wanted " ++ show (arity f) ++ " in arguments: '" ++ (unwords ys) ++ "'"+ arity f = 1 + arity (f undefined)++-- paradigm ::  String -> (String, [String], [String] -> Entry) +paradigm :: (App a) => String -> [String] -> a -> (String, [String], [String] -> Dictionary.Entry)+paradigm id exs f = (id, exs, set_paradigm_id id . app f)++paradigm_h :: (App a) => String -> [String] -> a -> (String, [String], [String] -> Dictionary.Entry)+paradigm_h id exs f = (id, exs, \xs -> case xs of +                                         []     -> set_paradigm_id id $ app f xs+                                         (x:xs) -> set_head x $ set_paradigm_id id $ app f (x:xs))++-- paradigm_id :: (App a) => String -> [String] -> String -> a -> (String, [String], [String] -> Dictionary.Entry)+-- paradigm_id id exs p f = (id, exs, set_paradigm_id p . (app f))
+ src/lib/General.hs view
@@ -0,0 +1,220 @@+module General where++import List (isPrefixOf,union,nub)+import SharedString++-- infixr 5 +/++-- | list of word forms. +newtype Str = Str [String]   +  deriving (Show, Eq, Ord)++-- | Inflection table+type Table  a = [(a,Str)]  ++-- | Finite inflection function+type Finite a = a -> Str   ++-- | The finite parameter class  +class (Eq a, Show a) => Param a where+  values  :: [a]+  value   :: Int -> a+  value0  :: a+  prValue :: a -> String+  value n = values !! n+  value0  = value 0+  prValue = show++-- | Token type+data Tok = W String                   | +           A (String,String)          | -- dealing with ambiguous casing.+           AA (String,String, String) | -- KALLE, Kalle, kalle+	   P String                   | +           PD String                  |+           BL                         | -- blank line.+           D String+  deriving (Eq, Show)++applytok f t = case t of+                W s -> W (f s)+                A (s1,s2) -> A (f s1, f s2)+                AA (s1,s2,s3) -> AA (f s1,f s2,f s3)+                P  s          -> P (f s)+                D  s          -> D (f s)++-- | Compound forms+type Attr = Int++-- | default compound value+noComp :: Attr +noComp = 0++-- | Promote String to Str+mkStr :: String -> Str+mkStr     [] = nonExist+mkStr (x:xs) = Str [(x:xs)]++-- | Sharing of Str+shareStr :: Str -> Str+shareStr (Str xs) = Str $ map shareString xs++-- | Translate Str to [String]+unStr :: Str -> [String]+unStr (Str xs) = xs++-- | Translate a [String] to Str+strings :: [String] -> Str+strings = Str . nub . filter (not . null)++-- | Apply function to 'a' and promote the resulting String to Str.+mkStr1 :: (a -> String) -> a -> Str+mkStr1 =  (mkStr .)++-- | Apply function to all variants.+mapStr :: (String -> String) -> Str -> Str+mapStr f (Str xs) = Str (map f xs)++-- | Union of two Str+unionStr :: Str -> Str -> Str+unionStr s t = strings (unStr s `union` unStr t)++-- | Prepend a string to all variants.+(+*) :: String -> Str -> Str+s +* ss = mapStr (s++) ss++-- | Mark morpheme boundary+(+/) :: String -> String -> String+s +/ t = s ++ t -- s ++ "/" ++ t++-- | Variants listed in a string +mkStrWords :: String -> Str+mkStrWords = strings . words++-- | take all but n characters in the end of String +tk :: Int -> String -> String+tk i s = take (max 0 (length s - i)) s++-- | drop all but n character in the end of String+dp :: Int -> String -> String+dp i s = drop (max 0 (length s - i)) s++-- | Get the n:th char from the end of String +ch :: Int -> String -> String+ch n s = dp 1 (tk n s)++-- | Prevent the duplication: "mus" +? "s" = "mus"+(+?) :: String -> String -> String+s +? e = case (s,e) of+  (_:_, c:cs) | last s == c -> s ++ cs +  _ -> s ++ e++-- | Choose suffix depending on last letter of stem+ifEndThen :: (Char -> Bool) -> String -> String -> String -> String+ifEndThen cond s a b = case s of+  _:_ | cond (last s) -> a+  _ -> b++-- | Conditionally drop last letter+dropEndIf :: (Char -> Bool) -> String -> String+dropEndIf cond s = ifEndThen cond s (init s) s++-- | Apply substitution table to string. +changes :: [(String,String)] -> String -> String+changes cs s = case lookupMark s cs of+  Just (b,e) -> e ++ changes cs (drop (length b) s)+  _ -> case s of+    c:t -> c : changes cs t+    [] -> []+ where+   lookupMark _ [] = Nothing+   lookupMark st ((b,e):ms) = +     if isPrefixOf b st then Just (b,e) else lookupMark st ms++-- | Like changes, but only apply on prefix. +changePref ::  [(String,String)] -> String -> String+changePref cs t = case cs of+  (s,r) : rs | isPrefixOf s t -> r ++ drop (length s) t +             | otherwise -> changePref rs t+  _ -> t++-- | Single word form exception+except :: Param a => Finite a -> [(a,String)] -> Finite a+except f es p = case (lookup p [(a,mkStr s) | (a,s) <- es]) of+		 Nothing -> f p+		 Just s  -> s++-- | Multiple word form exception+excepts :: Param a => Finite a -> [(a,Str)] -> Finite a+excepts f es p = maybe (f p) id $ lookup p es++-- | Merge two paradigm functions.+combine :: Param a => Finite a -> Finite a -> Finite a+combine f g = \a -> unionStr (f a) (g a)++-- | Missing forms exception.+missing :: Param a => Finite a -> [a] -> Finite a+missing f as = excepts f [(a,nonExist) | a <- as]++-- | Only exception (highly degenerate).+only :: Param a => Finite a -> [a] -> Finite a+only f as = missing f [a | a <- values, notElem a as]++-- | single word form variant exception+variant :: Param a => Finite a -> [(a,String)] -> Finite a+variant f es p = case lookup p [(a,s) | (a,s) <- es] of+		  Nothing -> f p+		  Just s -> strings (s:(unStr (f p)))++-- | Multiple word form variants exception.+variants :: Param a => Finite a -> [(a,Str)] -> Finite a+variants f es p = case lookup p es of+		   Nothing -> f p+		   Just ss -> unionStr ss (f p)++-- | Missing word form +nonExist :: Str+nonExist = Str []++-- | Filter missing forms from inflection table. +existingForms :: Table a -> Table a+existingForms = filter (not . null . unStr . snd)++-- | Translate a finite function to a table. +table :: (Param a) => (a -> Str) -> Table a+table f = [(v, f v) | v <- values]++-- | Used to define Param instances. +enum :: (Enum a, Bounded a) => [a]+enum = [minBound .. maxBound]++-- | fromEnum for Param+indexVal :: (Eq a, Param a) => a -> Int+indexVal a = maybe undefined id $ lookup a $ zip values [0..]++-- | Inflection table lookup+appTable :: (Param a) => Table a -> a -> Str+appTable t a = maybe undefined id $ lookup a t ++-- | Pick the first word form+firstForm :: Param a => Table a -> Str+firstForm t = appTable t value0++--- | Create function from list of values (sensitive to order).+giveValues :: (Eq a, Param a) => [b] -> (a -> b)+giveValues bs a = bs !! indexVal a++-- | Longest common prefix for [String].+longestPrefix :: [String] -> String+longestPrefix ((c:w):ws) = +  let (cs,rs) = unzip (map (splitAt 1) ws) +  in+  if all (==[c]) cs then c:longestPrefix (w:rs) else ""+longestPrefix _ = ""++-- | Collect all word forms into a Str.+formsInTable :: Table a -> Str+formsInTable tab = strings $ concat [unStr ss | (_,ss) <- tab]++-- | Apply function to all word forms in table.+mapInTable :: (String -> String) -> Table a -> Table a+mapInTable f t = [(a, mapStr f ss) | (a,ss) <- t]
+ src/lib/GeneralIO.hs view
@@ -0,0 +1,106 @@+----------------------------------------------------------------------+-- |+-- Module      : GeneralIO+-- Maintainer  : Markus Forsberg+-- Stability   : +-- Portability : +--+-- Top-level functions: +-- * reading/writing morphology databases+-- * writing Lexicon, Tables, GF, XFST, Latex +-- * analysis/synthesis (Trie)+--+-----------------------------------------------------------------------------+module GeneralIO where++import Print+import Dict.GetDict(getEntry)+import DictToDictionary+import General+import Dictionary+import IO+import Command (Comp(..))+import qualified Data.Set as Set+import qualified Data.Map as Map+import Frontend+import List (nub,sort,intersperse)+import Maybe(fromJust)+import Char+import Dict.ErrM+import Util+import Compound+import Monad(when)+import qualified CTrie++type Stem      = String+type Id        = String++analysis :: Language a => a -> Comp -> Maybe CompDesc -> ((String,String) -> [(String,String)]) -> String -> [[String]]+analysis l mc f sandhi s =  post_filter mc $ map (map snd) $ CTrie.decompose f sandhi s+    where f' = if mc == None then Just [[One (word_attr l)]] else f++post_filter Min xs = case sort_length Set.empty xs of+                              ys@(r:_) -> let n = length r in takeWhile (\s -> length s == n) ys+                              _         -> []+post_filter Max xs = case sort_length_rev Set.empty xs of+                       ys@(r:_) -> let n = length r in takeWhile (\s -> length s == n) ys+                       _         -> []+post_filter _           xs = xs -- all, or default++++--       post_filter (Length n) xs  = filter (\s -> and (map (fun n) s)) xs+-- [x | x <- xs, and $ map (fun n) x]+--       fun n x = case words x of+--                   (x:_) -> length x >= n+--                   _     -> False++lookupId :: String -> [String]+lookupId s = nub $ [identifier xs | xs <-  map snd (CTrie.trie_lookup False s)]+   where identifier ('\"':'i':'d':'\"':':':'\"':xs) = case span (/='\"') xs of+                                                        (i,_) -> i+         identifier (x:xs) = identifier xs+         identifier []     = []++synthesiser :: Language a => a -> IO String+synthesiser l =  +    do s <- getContents+       return $ unlines $ map f (lines s)+ where f line =+        case(lookupId line) of+	 [] -> "{\"" ++ line ++ "\":\"-Unknown-\"}"+	 xs -> "{\"" ++ line ++ "\":{\n" ++ (concat  +              (concat [format x (reverse (map snd (CTrie.trie_lookup False x))) | x <- xs])) ++ "}\n"+       format :: String -> [String] -> [String]+       format s xs  =  ("\"" ++ s ++ "\":[\n") : (intersperse ",\n" xs) ++ ["\n]\n"]++imode :: Language a => a  -> IO String+imode l =  do s <- getContents+              return $ unlines $ map f (lines s)+  where f s = case getEntry s of+                Bad s -> []+                Ok  e -> +                    case parseCommand l emptyParadigmErrors e of+		      (Right _) -> []+		      (Left e)  -> unlines  ["[", +				             (concat (intersperse ",\n" (lines (prJSON (dictionary [e]))))) ++"\n]"]++tester :: (PositiveTests,NegativeTests) -> [TestInput] -> IO ()+tester (pos,neg) rs = +  do prStd $ "Testbench (" ++ show (length pos) ++ " positive tests, " ++ show (length neg) ++ " negative tests)" +     case (tester' pos rs [], tester' neg rs []) of+       ([],[]) -> prStd " All tests succeeded!\n"+       (xs,ys) -> do prStd $ (prFailed xs "positive")  ++ "\n" ++ (prFailed ys "negative")+                     prStd "\n"+ where+   prFailed [] s = " All " ++ s ++ " tests succeeded!"+   prFailed xs s = " "  ++ s ++ " tests failed... \n\n" ++ unlines [n ++ ". " ++ r ++ "\n" | (r,n) <- zip xs (map show [1..])] +   tester' :: [(TestInput -> Maybe String)] -> [TestInput] -> [String] -> [String]+   tester' _    [] xs = xs+   tester' test (s:xs) rs = tester' test xs (test_it test s rs)+   test_it :: [(TestInput -> Maybe String)] -> TestInput -> [String] -> [String]+   test_it [] _     rs = rs+   test_it (f:fs) s rs  = case f s of+                             Nothing       -> test_it fs s rs+                             Just message  -> test_it fs s (message:rs)+
+ src/lib/Invariant.hs view
@@ -0,0 +1,23 @@+module Invariant where++import General+import Dictionary++data Invariant = Invariant+  deriving (Show,Eq,Enum,Ord,Bounded)++instance Param Invariant +    where values = enum++instance Dict Invariant+    where category = const "Invariant"++invar = "Invariant"++type Invar = (Invariant -> Str)++invarEntry :: String -> Entry+invarEntry = entry . mkInvar++mkInvar :: String -> Invar+mkInvar s = const (mkStr s)
+ src/lib/Net.hs view
@@ -0,0 +1,18 @@+module Net where++import Network+import IO++server :: Int -> (String -> String) -> IO()+server n f =  withSocketsDo $ +    do s <- listenOn (PortNumber n')+       runServer s f+ where n' = fromInteger $ toInteger n++runServer :: Socket -> (String -> String) -> IO ()+runServer s f = do +  (h,_,_) <- accept s+  hSetBuffering h LineBuffering+  hGetLine h >>= \str -> hPutStrLn h (f str)+  runServer s f+
+ src/lib/Options.hs view
@@ -0,0 +1,81 @@+----------------------------------------------------------------------+-- |+-- Module      : Main+-- Maintainer  : Markus Forsberg+-- Stability   : (stability)+-- Portability : (portability)+--+-- > CVS $Date: 2006/03/03 17:22:23 $+-- > CVS $Author: markus $+-- > CVS $Revision: 1.5 $+--+-- Main file of FM backend.+-----------------------------------------------------------------------------+module Command where++import Distribution.GetOpt+import Maybe(fromMaybe)+import List(isSuffixOf)+++{- |Does the filename end with the suffix .dict? -}+is_dictionary :: FilePath -> Bool+is_dictionary = isSuffixOf ".dict"++{- |Does the filename end with the suffix .lex? -}+is_lexicon :: FilePath -> Bool+is_lexicon = isSuffixOf ".lexicon"++{- |Have an output file (-o) been given? -}+output :: [Flag] -> Maybe FilePath+output xs = case [f | Output f <- xs] of+             [f] -> Just f+             _   -> Nothing  ++fullformflag :: [Flag] -> Bool+fullformflag xs = +    case [p | p@(Print "lex") <- xs] of+     [_] -> True+     _   -> False+++{-|Data type for the Command line arguments. -}+data Flag +     = Help          | +       Version       | +       Input  String | +       Output String |+       Print  String |+       Mode   String |+       Lex    String |+       Paradigms     |+       Synth         |+       Inflect       |+       InflectB      +       deriving (Show,Eq)++{- |Lists all possible arguments and their explainations -}    +options :: [OptDescr Flag]+options =+    [ Option ['h'] ["help"]         (NoArg Help)             "display this message"+    , Option ['o'] ["output"]       (OptArg outp "FILE")     "output FILE"+    , Option ['p'] ["printer"]      (ReqArg Print "PRINTER") "Print using PRINTER"+    , Option ['t'] ["tables"]       (NoArg Paradigms)        "Print paradigms"+    , Option ['m'] ["mode"]         (ReqArg Mode "MODE")     "Analysis mode"+    , Option ['f'] ["fullform"]     (ReqArg Lex "FULLFORM")   "Input fullform lexicon"+    , Option ['i'] ["inflection"]   (NoArg Inflect)           "Inflection mode"+    , Option ['b'] ["batch"]       (NoArg InflectB)           "Inflection batch mode"+    , Option ['s'] ["synthesizer"] (NoArg Synth)             "Synthesizer mode"+    ]+    +inp,outp :: Maybe String -> Flag+outp = Output . fromMaybe "stdout"+inp  = Input  . fromMaybe "stdin"++{- |Collect the valid arguments. Raises an IO error if it fails.  -} +compilerOpts :: [String] -> ([Flag], [String])+compilerOpts argv = +       case getOpt Permute options argv of+        (o,fs,[] ) -> (o,fs)+        (_,_,errs)  -> error (usageInfo [] options)+      -- where header = "Usage: fm [OPTION...] dictionary_file(s)..."
+ src/lib/Print.hs view
@@ -0,0 +1,651 @@+module Print where++import General+import Dictionary+import List (intersperse,sort)+import IO+import Char+import Util+import Data.Bits((.&.))+import qualified Data.Set as Set+import qualified Data.Map as Map++type Ident = String++-- printing morphological objects as strings++-- | Print word forms separated with '/'+prStr :: Str -> String+prStr = concat . intersperse "/" . unStr++-- | similar prStr, but output '*' for nonExist +prAlts :: Str -> String+prAlts ss = +    case unStr ss of+     [] -> "*"+     ys -> unwords $ intersperse "/" ys++-- | Create a constant table+consTable :: Str -> Table String+consTable s = [("INVAR", s)]++-- | Create an attributed constant table+consTableW :: Str -> [(String,(Attr,Str))]+consTableW s = [("INVAR", (noComp,s))]++-- | Output a 'showed' inflection function+putFun0 :: Param a => (a -> Str) -> IO ()+putFun0 = putStr . unlines . map show . prTable . table++-- | Output an inflection function+putFun :: Param a => (a -> Str) -> IO ()+putFun = putStr . unlines . map pr . prTable . table where+  pr (a,ss) = a ++ " : " ++ prAlts ss++-- | Print a parameter value without hierarchy (= parentheses)+prFlat :: String -> String+prFlat = filter (flip notElem "()")++-- | Show all values for the first parameter+prFirstForm :: Param a => Table a -> String+prFirstForm = prStr . firstForm++-- | Show one value for the first parameter (used in dictionary)+prDictForm :: Param a => Table a -> String+prDictForm = prDictStr . firstForm++-- | Another Str printing function+prDictStr :: Str -> String+prDictStr t = case unStr t of+  s:_ -> s+  []  -> "NONE"++-- | Print dictionary without attributes.+prDictionary :: Dictionary -> String+prDictionary = concat . intersperse ("\n") . map (unlines . prOne) . unDict+ where+  prOne (id,stem,para,typ,inhs,infl,_) = +     let m     = maximum (map (length.fst) infl) + 1+         pad s = s ++ (take (m - length s) (repeat ' '))+       in+           "{" : (" paradigm : " ++ para) : (" head     : " ++ stem) : (" pos      : " ++ typ) : (" inhs     : " ++ (star (unwords inhs))) : "  {" :+                                       ["  " ++ pad (a) ++ ": " ++ star (prStr s) | (a,(_,s)) <- infl] ++ ["  }","}"]+  star [] = "*"+  star xs = xs++prParadigmsCompact :: Dictionary -> String+prParadigmsCompact = unlines . map prOne . unDict+ where+  prOne (id,stem,para,typ,inhs,infl,_) = +    unlines [concat [para, " : ", typ, " : ",stem],+             concat (intersperse " | " [prStr s| (_,(_,s)) <- infl, not (null (unStr s))])]++-- | Print Dictionary in a structured format.+prNewDictionary :: Dictionary -> String+prNewDictionary = unlines . map prOne . unDict where+  prOne (id,stem, para, typ, inhs, infl,ex) = +   concat ["{",+           prId id,+           prLemma stem "?" typ,+           prAdditional inhs,+           prTable infl,+           "};"]+  prId s = "id=\"" ++ s ++ "\""+  prLemma w para pos = concat ["lemma={word=\"", w, "\"paradigm=\"", para,+                               "\"pos=\"", pos, "\"}"]+  prAdditional as = "additional={" ++ +                    concat [concat ["inh",n,"=\"",a, "\""] | (a,n) <- zip as (map show [1..])] ++ "}" +  prTable xs =  "table={" ++ concat (map prE xs) ++ "}"+  prE (param, (attr,str)) = +      concat ["entry={param=\"", param, "\"wfs={", prWord attr str,"}}"]+  prWord attr str = concat +                    [concat ["wf={word=\"",w, +                             "\"id=", show ("w"++n), +                             "comp=", sAttr attr,"}"] | (w,n) <- zip (unStr str) (map show [1..])]+  sAttr = show . show                                    ++prWordlist :: FullFormLex -> String+prWordlist = unlines . map fst++-- | Write a fullform lexicon +prFullFormLex :: FullFormLex -> String+prFullFormLex []     = ""+prFullFormLex (x:xs) = prOne x ++ prFullFormLex xs+ where+  prOne (s,ps) = unlines [s ++ a | a <- map prAttr ps]+  prAttr (a,ss) = (':':ss) ++ prCompAttr a++prTabbedLex ::  Dictionary -> String+prTabbedLex = unlines . concat . map prOne . unDict+ where prOne (id,stem,_,wc,inhs,tbl,_) = +                -- (stem,wc,inhs,tbl) = +           [concat (intersperse "\t" [x, stem, wc, a ++ " " ++ unwords inhs, id]) | (a,(_,s)) <- tbl, not (null (unStr s)), x <- unStr s]++prWebService :: Dictionary -> String +prWebService d = unlines $ reverse $ sort $ concat $ map prOne $ unDict d+ where pr [] = []+       pr xs = " " ++ unwords xs+       prOne (id,stem,_,wc,inhs,tbl,_) = +           [concat (intersperse "\t" [x, stem, wc ++ " " ++  a ++ pr inhs]) | (a,(_,s)) <- tbl, not (null (unStr s)), x <- unStr s]++prWordTaglist :: Dictionary -> String +prWordTaglist d = unlines $ map pr $ Map.toList $ Map.fromListWith (Set.union) $ concat $ map pair  $ unDict d+    where +      pr (x,xs) = concat $ intersperse "\t" (x:(Set.toList xs))+      pair (id,stem,_,wc,inhs,tbl,_) = +          [(x, Set.singleton (wc ++ " " ++ unwords inhs ++ " " ++  a)) | (a,(_,s)) <- tbl, not (null (unStr s)), x <- unStr s, not (elem '*' a)]+      +-- pr [] = []+--       pr xs = " " ++ unwords xs+--       prOne (id,stem,_,wc,inhs,tbl,_) = +--           [concat (intersperse "\t" [x, stem, wc ++ " " ++  a ++ pr inhs]) | (a,(_,s)) <- tbl, not (null (unStr s)), x <- unStr s]++-- | Print attribute +prCompAttr :: Attr -> String+prCompAttr a = " [" ++ show a ++ "] "++-- |  Generate GF paradigm functions.+prGFRes :: Dictionary -> String+prGFRes = unlines . map prGFOper . unDict++prGFOper :: Entry -> String+prGFOper (oper',_, _, ty, inhs, tab0',_) + = begin ++ " : Str -> " ++ ty ++ " = " ++ bind ++ rec' ++ end where+  oper  = case map undot oper' of+            ('_':xs) -> xs+            xs       -> xs+  tab0 = [(a,b) | (a,(_,b)) <- tab0']+  undot '.' = '_'+  undot x = x+  begin = "oper " ++ oper+  bind  = "\\" ++ oper ++ " -> " ++ +            "\n  let " ++ +            stemv ++ " = Predef.tk " ++ show lg1 ++ " " ++ oper ++ " in"+  stem  = longestPrefix (unStr (formsInTable tab0))+  stemv = if lg == 0 then "x_" else stem ++ "_" -- to avoid clash with res words+  lg1   = length oper - lg+  lg    = length stem+  tab   = mapInTable +             (\w -> stemv ++ " + \"" ++ drop lg w ++ "\"") tab0+  rec'   = "\n {s = " ++ tbl ++ +          (if null inhs then "" else " ;\n  ") +++          concat (intersperse " ;\n  " +                    ["h" ++ show i ++ " = " ++ p | (i,p) <- zip [1..] inhs]+                 ) +++          "\n  }"+  tbl = case tab of+    [("INVAR",ss)] -> altsGF ss --- a hack to avoid one-branch tables; name-sensit.+    _ -> "table {\n" ++ +          concat (intersperse " ;\n" +                    ["    "++ a ++ " => "++ altsGFRes b | (a,b) <- tab]+                 ) +++          "\n    }"+  end   = " ;\n"++gf_param :: String -> String -- should be extended to include all reserved words+gf_param s = unwords $ map f $ words s+ where f x = if isResGF x then x ++"'" else x++-- | Print GF source code.+prGF :: Dictionary -> String+prGF dict = cats ++ (unlines (map prGFRule (unDict dict)))+ where cs = unlines ["cat " ++ gf_param c ++ ";" | c <- map fst $ classifyDict dict]+       cats = "\n" ++ cs ++ "\n\n"++prGFRule ::  Entry -> String+prGFRule (id',_, _, cat, inhs, tab',_) =+  "fun " ++ name ++ " : " ++ (gf_param cat) ++ " ;\n\n" +++  "lin " ++ name ++ " = {s = table {\n" ++ +    concat (intersperse " ;\n" +               ["  "++ a ++ " => "++ altsGF b | (a,b) <- tab]) +++          (if null inhs then "}" else " };\n  ") +++          concat (intersperse " ;\n  " +                    ["h" ++ show i ++ " = " ++ p | (i,p) <- zip [1..] inhs]+                 ) +++     "\n} ;\n"+ where tab = [(gf_param (map dash2us a),b) | (a,(_,b)) <- tab']+       dash2us '-' = '_'+       dash2us x = x+       num x = if isDigit (head x) then 'x':x else x+       name =  num $ dropWhile (== '_') $ transform_letters $ map dash2us $ dropWhile (== '_') $ undot id'+       transform_letters = concat . map trans+       trans 'å' = "aa"+       trans 'Å' = "AA"+       trans 'ä' = "ae"+       trans 'Ä' = "AE"+       trans 'à' = "a"+       trans 'á' = "a"+       trans 'é' = "e"+       trans 'è' = "e"+       trans 'ê' = "e"+       trans 'ç' = "c"+       trans 'ü' = "u"+       trans 'ø' = "oe"+       trans 'ñ' = "n"       +       trans 'Ø' = "OE"+       trans 'æ' = "ae"+       trans 'Æ' = "AE"+       trans 'ö' = "oe"+       trans 'Ö' = "OE"+       trans x   = [x]+       undot [] = []+       undot ('.':'.':xs) = '_' : undot xs +       undot     ('.':xs) = '_' : undot xs+       undot       (x:xs) = x:undot xs+++data BTree = N | B String BTree BTree deriving (Show)++isResGF :: String -> Bool+isResGF s = treeFind resWords+  where+  treeFind N = False+  treeFind (B a left right) | s < a  = treeFind left+                            | s > a  = treeFind right+                            | s == a = True++resWords = b "lincat" (b "def" (b "Type" (b "Str" (b "PType" (b "Lin" N N) N) (b "Tok" (b "Strs" N N) N)) (b "cat" (b "case" (b "abstract" N N) N) (b "data" (b "concrete" N N) N))) (b "include" (b "fun" (b "fn" (b "flags" N N) N) (b "in" (b "grammar" N N) N)) (b "interface" (b "instance" (b "incomplete" N N) N) (b "lin" (b "let" N N) N)))) (b "resource" (b "out" (b "of" (b "lintype" (b "lindef" N N) N) (b "oper" (b "open" N N) N)) (b "pattern" (b "param" (b "package" N N) N) (b "printname" (b "pre" N N) N))) (b "union" (b "table" (b "strs" (b "reuse" N N) N) (b "transfer" (b "tokenizer" N N) N)) (b "where" (b "variants" (b "var" N N) N) (b "with" N N))))+   where b s = B s ++-- | two GF modes for free variation; old for GF<0.98 +altsGF xs = case (unStr xs) of+  [x] -> prQ x+  ys -> "variants"++" {" ++ unwords (intersperse ";" (map prQ ys)) ++ "}" where+ where+   prQ s +    | any isSpace s   = "[" ++ quote s ++ "]"+    | otherwise       = quote s ++altsGFOld = show . prAlts+altsGFRes xs = case (unStr xs) of+  [x] ->  x+  ys -> "variants"++" {" ++ unwords (intersperse ";" ys) ++ "}"++type TagId = String+type XML   = String+type Struct = Bool++string :: String -> [XML]+string = (:[])++render :: [XML] -> String+render xs = unlines xs++tag :: TagId -> [XML] -> [XML]+tag t xs = (("<" ++ t ++ ">"): (map (' ':) xs)) ++ ["</" ++ t ++ ">"]++tagA :: TagId -> (String,String) -> [XML] -> [XML]+tagA t (a,b) xs = (("<" ++ t ++ " " ++ a ++ "=\"" ++ b ++ "\"" ++ ">"): (map (' ':) xs)) ++ ["</" ++ t ++ ">"]++tagAL :: TagId -> [(String,String)] -> [XML] -> [XML]+tagAL t vk xs = (("<" ++ t ++ " " ++ (unwords [a ++ "=\"" ++ b ++ "\"" | (a,b) <- vk]) ++ ">"): (map (' ':) xs)) ++ ["</" ++ t ++ ">"]++tagA1 :: TagId -> (String,String) -> XML+tagA1 t (a,b) = "<" ++ t ++ " " ++ a ++ "=\"" ++ b ++ "\"" ++ " />"++-- | Generate XML source code.+prXML :: Dictionary -> String+prXML d =  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" ++ (render (tag "dictionary" (concat (map prEntry (unDict d)))))+ where+ prEntry  (id,stem,para,cat,inhs,tbl,_) = tagAL "entry" [("head",stem), ("paradigm",para),("inhs",unwords inhs),("xml:id",id)] (prTabl tbl)+ prTabl tbl = tag "table" $ +	      concat [tagAL "form" [("param",a),("attr",show n)] (map (\s -> tagA1 "variant" ("val",s)) (unStr b)) | (a,(n,b)) <- tbl,+                                                                                                                                not (null (unStr b))]+-- | Generate XML source code.+prLMF :: String -> Dictionary -> String+prLMF l d =  unlines [+            "<LexicalResource dtdVersion=\"16\">",+            "<GlobalInformation>",+            "<feat att=\"languageCoding\" val=\"UTF-8\"/>", +            "</GlobalInformation>", +            "<Lexicon>", +            "<feat att=\"language\" val=\"" ++ l ++ "\"/>", +            unlines (concat (map pr (unDict d))),+            "</Lexicon>",+            "</LexicalResource>"]+ where+ pr (id,stem,para,cat,inhs,tbl,extr) =  ["<LexicalEntry>",+                                         "<feat att=\"POS\" val=\"" ++ cat ++ "\"/>",+                                         "<feat att=\"inherents\" val=\"" ++ (unwords inhs) ++ "\"/>",+                                         "<Lemma>",+                                         "<feat att=\"writtenForm\" val=\"" ++ stem ++ "\"/>",+                                         "</Lemma>"+                                        ]+                                      +++                                      (concat +                                     [["<WordForm>",+                                      "<feat att=\"writtenForm\" val=\"" ++ w ++ "\"/>",+                                      "<feat att=\"analysis\" val=\"" ++ t ++ "\"/>",+                                      "</WordForm>"] | (w,t) <- wfs tbl])+                                     +++                                     ["</LexicalEntry>"]+ wfs tbl = [(w,t) | (t,(_,str)) <- tbl, w <- unStr str]++-- | Print RDF+prRDF :: String -> Dictionary -> String+prRDF l d =  unlines [+  "<?xml version='1.0' encoding='UTF-8'?>",+  "<rdf:RDF",+  "  xmlns=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"",+  "  xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"",+  "  xmlns:lh=\"http://localhost/rdf-syntax#\">",+  (concat (map pr (unDict d))),+  "</rdf:RDF>"]+ where++ pr (id,stem,para,cat,inhs,tbl,extr) =  +     concat [+         unlines +         [+          "   <rdf:Description rdf:about=\"http://localhost/form/" ++ (urlEncode w) ++ "\">",+          "    <lh:id>" ++ id          ++ "</lh:id>",+          "    <lh:cf>"  ++ stem           ++ "</lh:cf>",+          "    <lh:p>" ++ para        ++ "</lh:p>",+          "    <lh:param>" ++ p              ++ "</lh:param>",+          "    <lh:pos>"   ++ cat            ++ "</lh:pos>",+          (concat ["    <lh:inhs>"  ++ i ++ "</lh:inhs>\n" | i <- inhs]) ++ "   </rdf:Description>"+         ] | (p,(_,ws)) <- tbl, w <- unStr ws +        ]+ -- copied from Module :  HTTP+ -- Copyright :  (c) Warrick Gray 2002+ -- License   :  BSD+ urlEncode (h:t) =+     let str = if reserved (ord h) then escape h else [h]+     in str ++ urlEncode t+ urlEncode [] = []+ reserved x+     | x >= ord 'a' && x <= ord 'z' = False+     | x >= ord 'A' && x <= ord 'Z' = False+     | x >= ord '0' && x <= ord '9' = False+     | x <= 0x20 || x >= 0x7F = True+     | otherwise = x `elem` map ord [';','/','?',':','@','&'+                                    ,'=','+',',','$','{','}'+                                    ,'|','\\','^','[',']','`'+                                    ,'<','>','#','%','"']+ escape x = +     let y = ord x +      in [ '%', intToDigit ((y `div` 16) .&. 0xf), intToDigit (y .&. 0xf) ]++-- | Print JSON+prJSON :: Dictionary -> String+prJSON = concat . concat . map prOne . unDict+ where prOne  (id,stem,para,cat,inhs,tbl,_) = +           [conc [p "word" x, p "head" stem, p "pos" cat, p "param" a, pl "inhs" inhs, p "id" id, p "p" para, p "attr" (show attr)] | (a,(attr,s)) <- tbl, x <- unStr s]+       pl s []   = quote s ++ ":" ++ "[]"+       pl s xs   = quote s ++ ":[" ++ (concat (intersperse "," (map quote xs))) ++"]"+       p s1 s2 = quote s1 ++ ":" ++ quote s2+       conc xs = '{':(concat (intersperse "," xs)) ++ "}\n"+       ++prCLEX :: Dictionary -> String+prCLEX = concat . concat . map prOne . unDict+ where prOne  (id,stem,para,cat,inhs,tbl,_) = +           [x ++ ":" ++ conc [p "word" x, p "head" stem, p "pos" cat, p "param" a, pl "inhs" inhs, p "id" id, p "p" para, p "attr" (show attr)] | (a,(attr,s)) <- tbl, x <- unStr s]+       pl s []   = quote s ++ ":" ++ "[]"+       pl s xs   = quote s ++ ":[" ++ (concat (intersperse "," (map quote xs))) ++"]"+       p s1 s2 = quote s1 ++ ":" ++ quote s2+       conc xs = '{':(concat (intersperse "," xs)) ++ "}\n"++prHunDict :: Dictionary -> String +prHunDict (Dict es) = unlines $ addcount $ concat $ map hunwords es+ where +  addcount xs = show (length xs) : xs+  hunwords (_,stem,para,typ,inhs,infl,_) = [{- unwords [ -} stu s {-,"st:" ++ (stu stem),"po:"++ (stu typ),"is:" ++ stu (u ++ unwords inhs)] -} | (u,(_,str)) <- infl, s <- unStr str]+  stu s = [if (c == ' ') then '_' else c | c <- s]++prHunAffix :: Dictionary -> String+prHunAffix d = unlines ["# generated by Functional Morphology",+                        "SET UTF-8",+                        "TRY aerndtislogmkpbhfjuväcöåyqxzvw"]+			+-- | Print LexC source code+prLEXC :: Dictionary -> String+prLEXC = ("LEXICON Root\n" ++) . (++ "END") . unlines . map (uncurry prLEXCRules) . classifyDict++prLEXCRules :: Ident -> [Entry] -> String+prLEXCRules cat entries = unlines $+    ("\n! category " ++ cat ++ "\n") : (map (prEntry . noAttr) entries)+  where+    prEntry (stem,_,inhs,tbl) =+      concat (map (prForm stem inhs) ([(a,unStr b) | (a,b) <- existingForms tbl]))+    prForm stem inhs (a,b) = +      concat [x ++ ":" ++ stem ++ prTags (a:inhs) ++ " # ;\n" | x <- b]+    prTags ts = +      concat ["+" ++ w | t <- ts, w <- words (prFlat t)]+    altsLEXC cs = +      unwords $ intersperse " # ;" [ s  | s <- cs] ++-- code for Xerox Finite State Tool++-- | Print XFST source code+prXFST :: Dictionary -> String+prXFST = unlines . map (uncurry prXFSTRules) . classifyDict++prXFSTRules :: Ident -> [Entry] -> String+prXFSTRules cat entries = unlines $+    ("define " ++ cat ++ " [") :+    intersperse "  |" (map (prEntry . noAttr) entries) +++    ["  ] ;"]+  where+    prEntry (stem,_,inhs,tbl) =+      concat (intersperse "  |\n" (map (prForm stem inhs) +				   ([(a,unStr b) | (a,b) <- existingForms tbl])))+    prForm stem inhs (a,b) = +      "  [ " ++ +             altsXFST b ++ " .x. " ++ +             "{" ++ stem ++ "}" ++ prTags (a:inhs) ++ " ]"+    prTags ts = +      unwords [" %+" ++ w | t <- ts, w <- words (prFlat t)]+    altsXFST cs = +      unwords $ intersperse "|" ["{" ++ s ++ "}" | s <- cs] +++-- | Print SFST head source code+prSFSTHEAD :: Dictionary -> String+prSFSTHEAD d =  "ALPHABET = " ++ alphabet ++ "\n\"input.lex\""+ where alphabet :: String+       alphabet = concat $ Set.toList $ Set.fromList (concat [ tag pos : (collect (map noAttr xs))  | (pos,xs) <- classifyDict d])+       collect [] = []+       collect ((_,_,inhs,tbl):es) = map tag (inhs ++ (concat (map (words . prFlat . fst) tbl))) ++ collect es+       tag s = "<" ++ s ++ ">"++-- | Print SFST lex source code+prSFSTLEX :: Dictionary -> String+prSFSTLEX d = case classifyDict d of+            xs -> unlines (map (uncurry prSFSTLEXRules) xs)++prSFSTLEXRules :: Ident -> [Entry] -> String+prSFSTLEXRules cat entries = +     (concat (map (prEntry . noAttr) entries)) +  where+    prEntry (stem,_,inhs,tbl) =+      unlines (concat (map (prForm stem inhs) +		      ([(a,unStr b) | (a,b) <- existingForms tbl])))+    prForm stem inhs (a,b) = +       [crossproduct  (stem ++  prTags (inhs ++[a])) c | c <- b] +    prTags ts = "<" ++ cat ++">" ++ (concat ["<" ++ w ++ ">" | t <- ts, w <- words (prFlat t)])+    zip_str [] s  = concat ["<>:" ++ pr c | c <- s]+    zip_str s  [] = concat [pr c ++ ":<>" | c <- s]+    zip_str [c1] [c2] = pr c1 ++ ":" ++ pr c2+    zip_str (c1:s1) (c2:s2)+     | c1 == c2  = c1 ++ zip_str s1 s2+     | otherwise = c1 ++ ":" ++ c2 ++ zip_str s1 s2 +    pr s+     | and (map isSpace s) = "<>"+     | otherwise           = s+    crossproduct s1 s2 = zip_str (split s1) (split s2)+    split [] = []+    split ('<':xs) = case span (/='>') xs of+                      (t,(_:xs)) -> (('<':t) ++">") : split xs+    split (':':cs) = "\\:" : split cs+    split (c:cs) = [c] : split cs+                +-- | Print SFST source code+prSFST :: Dictionary -> String+prSFST d = case classifyDict d of+            xs -> unlines (map (uncurry prSFSTRules) xs) ++ prAuto (map fst xs)+   where prAuto cs = "\n\n" ++ (unwords (intersperse "|" ["$" ++ c ++ "$" | c <- cs]))++prSFSTRules :: Ident -> [Entry] -> String+prSFSTRules cat entries = +    ("$" ++ cat ++ "$ =\\\n") +++     (concat (intersperse " |\\\n" (map (prEntry . noAttr) entries))) +  where+    prEntry (stem,_,inhs,tbl) =+      concat (intersperse " |\\\n" (concat (map (prForm stem inhs) +			       ([(a,unStr b) | (a,b) <- existingForms tbl]))))+    prForm stem inhs (a,b) = +       ["{" ++ (fix_word stem) ++ "}:{" ++ (fix_word c)  ++ "}" ++ prTags (inhs ++[a]) | c <- b] +    prTags ts = +      " <" ++ cat ++">:<> " ++ (unwords ["<" ++ w ++ ">:<>" | t <- ts, w <- words (prFlat t)])+    fix_word s = concat $ map f s+    f c = case c of+           '-' -> "\\-"+           '|' -> "\\|"+           ' ' -> "\\ "+           '.' -> "\\."+           ':' -> "\\:"+           '$' -> "\\$"+           '^' -> "\\^"+           '&' -> "\\&"+           '!' -> "\\!"+           '*' -> "\\*"+           '+' -> "\\+"+           '_' -> "\\_"+           '<' -> "\\<"+           '>' -> "\\>"+           '=' -> "\\="+           '\\' -> "\\\\"+           c   -> [c]++-- | Print latex tables+prLatex :: Dictionary -> String+prLatex d = unlines (beginLatex ++ (map prLatexTable (unDict d)) ++ endLatex) where+  beginLatex = ["\\documentclass[10pt,twocolumn]{article}",+                "\\usepackage[utf8]{inputenc}",+                "\\usepackage[T1]{fontenc}",+                 "\\begin{document}"]+  endLatex   = ["\\end{document}"]++prLatexTable :: Entry -> String+prLatexTable (id,stem,para,cat,inhs,tbl,extr) = unlines+  ["\\begin{center}\n\\begin{tabular}{|l|l|}\\hline",+  "\\multicolumn{2}{|c|}{\\textbf{" ++ (esc para) ++ "}} \\\\", +   "\\hline",+   "\\textbf{base} & " ++ (esc stem) ++ "\\\\",+   "\\hline",+   "\\textbf{pos}  & " ++ (esc cat) ++ "\\\\",+   inhs_p inhs,+  "\\hline",+  "\\textbf{inflection table} & \\\\", +   "\\hline",+  unlines [(esc a) ++ " & " ++ pr_alts (unStr b) ++ "\n\\hline" | (a,(_,b)) <- tbl, not (null (unStr b))],+  "\\end{tabular}\n\\end{center}\n\n\\vspace{0.1cm}\n"]+ where esc [] = []+       esc ('_':xs) = "\\_" ++ esc xs+       esc (x:xs)   = x:esc xs+       inhs_p [] = "\\hline"+       inhs_p xs =  "\\hline\n\\textbf{inhs} & " ++ (esc (unwords xs)) ++ "\\\\"+       pr_alts []     = "* \\\\"+       pr_alts [x]    = esc x ++ " \\\\"+       pr_alts (x:xs) = esc x ++ concat [" \\\\ \n & " ++ esc y | y <- xs] ++ " \\\\ "++wordLength = 50 :: Int+attrLength = 30 :: Int++type Schema       = String -- The database structure+type Element      = String -- the database content+type TableS       = String -- a table+type Column       = String -- a column (attribute)+type Value        = String -- a value of a column (attribute)+type DatabaseName = String ++prSqlSchema :: Dictionary-> DatabaseName -> String+prSqlSchema dict dname = +                    "\n-- The Morphology Schema.\n\n" +++		    "DROP DATABASE IF EXISTS " ++ dname ++ ";\n" +++		    "CREATE DATABASE " ++  dname ++ ";\n" +++		    "USE " ++ dname ++ ";\n\n" +++		    lexicon +++		    "GRANT ALL PRIVILEGES ON " ++ dname ++".* TO PUBLIC ; \n\n"+ +-- A instance needs to:+-- * Be put in the lexicon with a unique identifier+-- * Be put in the class schema+-- * Be put in the inherent schema++-- | Print SQL Code+prSQL :: Dictionary -> String+prSQL = (lexicon ++) . concat . map prSql . unDict+ where+  prSql (i,stem, para, cat, inh, t, _) = lexic i stem cat (expand t) para inh +  lexic i stem cat t para inh = +                 unlines [insert "LEXICON" [i,para,stem,cat,b,a,prInhs inh] | (a,b) <- t]+  prInhs [] = "-"+  prInhs xs = unwords xs+  expand t = [(a,s) | (a,(_,b)) <- t, s <- unStr b]++{-+prWordsCl ::  [(String,[((Int,String),[String])])] -> [String]+prWordsCl                  [] = []+prWordsCl ((c,((n1,w1),as1):xs):xss)+    = (insert c ([show n1,w1,show n1] ++ as1) :+       [insert c ([show n,w,show n1] ++as) | ((n,w),as) <- xs]) +++       prWordsCl xss+    +innerNumber :: [(a,[(b,[c])])] -> Int -> [(a,[((Int,b),[c])])]+innerNumber [] _ = []+innerNumber ((a,xs):xss) n = (a,number xs n) : +			     innerNumber xss (n+(length xs))+ where number xs n = zipWith f [n..] xs+       f n (s,zs) = ((n,s),zs)+-}++-----------------------------------------------------++emptyE :: Value+emptyE = "NULL"++insert :: TableS -> [Value] -> Element+insert t vs = "INSERT INTO " ++ t ++ " VALUES ('" +	      ++ (concat (intersperse "','" vs)) ++"');"++type Name           = String+type Type           = String+type TypeConstraint = String+type Constraint     = String++primaryKey :: Name -> Constraint+primaryKey n = "PRIMARY KEY (" ++ n ++ ")"++foreignKey :: Name -> (Name,Name) -> Constraint+foreignKey n (n1,n2) = "FOREIGN (" ++ n ++ ") REFERENCES " +++		       n1 ++ "(" ++ n2 ++ ")"++varchar :: Int -> Type+varchar n = "VARCHAR(" ++ show n ++ ")"++intType :: Type+intType = "INTEGER"++notNull :: TypeConstraint+notNull = "NOT NULL"++createTable :: Name -> [(Name,Type,TypeConstraint)] -> [Constraint] -> TableS+createTable n xs cs =+    "CREATE TABLE " ++ n ++ "\n(\n" +++    (concat ((intersperse ",\n" [n ++ " " ++ t ++ " " ++ tc | (n,t,tc) <- xs])))+    ++ concat (intersperse ",\n" cs) ++ ");\n\n"++lexicon :: TableS+lexicon = createTable "LEXICON" +	  [+	   ("ID", varchar wordLength, notNull),+	   ("PID", varchar wordLength, notNull),+	   ("HEAD",varchar wordLength,notNull),+	   ("POS",varchar wordLength,notNull),+	   ("WORD",varchar wordLength,notNull),+	   ("PARAM",varchar wordLength,notNull),+	   ("INHS",varchar wordLength,notNull)+          ] []+
+ src/lib/SharedString.hs view
@@ -0,0 +1,19 @@++module SharedString (shareString) where++import Data.HashTable as H+import System.IO.Unsafe (unsafePerformIO)++{-# NOINLINE stringPool #-}+stringPool :: HashTable String String+stringPool = unsafePerformIO $ new (==) hashString++{-# NOINLINE shareString #-}+shareString :: String -> String+shareString s = unsafePerformIO $ do+    mv <- H.lookup stringPool s+    case mv of+	    Just s' -> return s'+	    Nothing -> do+		       H.insert stringPool s s+		       return s
+ src/lib/Tokenize.hs view
@@ -0,0 +1,55 @@+module Tokenize (tokens, norm, isPunct, isPunctS, isNumber) where++import Char+import List+import System+import General+import qualified Data.Set as S++tokens :: String -> [General.Tok]+tokens = ana where+  ana [] = []+  ana s = case s of+    c:cs  | isSpace c -> ana cs+--    c:cs  | isDigit c -> case span (isDigit) (c:cs) of +--			  (w,rest) -> (D w) : ana rest+    p:cs  | isPunct p -> (P [p]) : ana cs  +    c:cs              -> case span (\c -> (not (isSpec c)) || (isDash c)) (c:cs) of +			  (w,rest) -> (uncap w) : ana rest+    []                -> []+  isSpec c = isSpace c || isPunct c -- || isDigit c+  isDash c = c == '-'++uncap  w -- = W $ map toLower w+   | and (map isLower w) = W w+   | sum (map (f.isUpper) w) > 1 = case map toLower w of+                                    (c:cs) -> AA (w,(toUpper c:cs),(c:cs))+   | otherwise           = A (w, map toLower w)+ where+  f False = 0+  f True  = 1++isPunct :: Char -> Bool+isPunct c = S.member c special++norm :: [String] -> [Tok]+norm = map f+ where+  f [] = BL+  f w@(c:cs) +   | isUpper c = A (w, map toLower w)+--   | all isDigit w = D w+   | all isPunct w = P w+   | all (\c -> isDigit c || isPunct c || isSpace c) w = PD w+   | otherwise = W (c:cs)++-- : - removed from special.+special = S.fromList "°§+»,.;?!\"%/()[]&={}_$#'~*<>{}"++isPunctS :: String -> Bool+isPunctS     [] = False+isPunctS  (c:_) = isPunct c++isNumber :: String -> Bool+isNumber    [] = False+isNumber  (c:_) = isDigit c
+ src/lib/Trie.hs view
@@ -0,0 +1,106 @@+-- A strict general trie for types with orderings+module Trie +    (++     Trie, ++     -- * Construction+     empty, +     fromList, fromListWith,+     insert, insertWith,++     -- * Query+     lookup, member,++     -- * Destruction+     toList++    ) where++import qualified Data.Map as Map+import Data.Maybe (fromMaybe, isJust)+import Prelude hiding (lookup)++-- The value argument couble be Maybe b, but we+-- save some memory this way+data Trie a b = Node !(Map.Map a (Trie a b))+	      | ValNode !(Map.Map a (Trie a b)) !b+-- deriving (Show)++-- | An empty trie+empty :: Trie a b+empty = Node Map.empty++-- | Construct a trie from a list of (key, value) pairs.+fromList :: Ord a => [([a], b)] -> Trie a b+fromList = fromListWith const++-- | Construct a trie from a list of (key, value) pairs+--   with a combining function for values of equals keys.+--   The order in which the elements are inserted and passed+--   to the combining function is unspecified.+fromListWith :: Ord a => (b -> b -> b) -> [([a], b)] -> Trie a b+fromListWith f = fromListWith' f id++-- | Construct a trie from a list of (key, value) pairs+--   with a combining function for values of equals keys, +--   and a construction function used the first time a key is inserted.+--   The order in which the elements are inserted and passed+--   to the combining function is unspecified.+fromListWith' :: Ord a => (b -> c -> b) -> (c -> b) -> [([a], c)] -> Trie a b+fromListWith' f g = foldl (flip (uncurry (insertWith' f g))) empty -- foldl for strictness++-- | Insert an element into a trie.+insert ::  Ord a => [a] -> b -> Trie a b -> Trie a b+insert = insertWith const++-- | Insert an element into a trie with a combining+--   function for the value of an existing key equal to+--   the given one.+insertWith :: Ord a => (b -> b -> b) -- ^ The first argument is the existing value,+	                             --   the second is the new value.+	   -> [a] -> b -> Trie a b -> Trie a b+insertWith f = insertWith' f id+++-- | Insert an element into a trie with a combining+--   function for the value of an existing key equal to+--   the given one, and a construction function used the+--   first time a key is inserted.+insertWith' :: Ord a => (b -> c -> b) -- ^ The first argument is the existing value,+	                              --   the second is the new value.+    -> (c -> b) -- ^ Used to transform the input value to a value+                --   in the map if there is no existing value.+    -> [a] -> c -> Trie a b -> Trie a b+insertWith' f g cs y = insertWith_ cs+    where +    insertWith_ []     (Node m)      = ValNode m (g y)+    insertWith_ []     (ValNode m v) = ValNode m (f v y)+    insertWith_ (c:cs) t             = updateMap h t+	where h m = Map.insert c (insertWith_ cs t) m+		  where t = fromMaybe empty (Map.lookup c m)+    updateMap h (Node m)      = Node (h m)+    updateMap h (ValNode m v) = ValNode (h m) v++-- | Lookup a key in a trie.+lookup :: (Monad m, Ord a) => [a] -> Trie a b -> m b+lookup []     (Node _)      = fail "Not found"+lookup []     (ValNode _ v) = return v+lookup (c:cs) t             = case Map.lookup c (getMap t) of+			           Nothing -> fail "Not found"+				   Just t -> lookup cs t+    where getMap (Node m)      = m+	  getMap (ValNode m _) = m++-- | Check if a key is in a trie.+member :: Ord a => [a] -> Trie a b -> Bool+member k tr = isJust (lookup k tr)++-- | Get the (key,value) pairs from a trie.+--   The results are ordered by key.+toList :: Trie a b -> [([a],b)]+toList t = collapse t []+    where +    collapse (Node m)      xs = rest m xs+    collapse (ValNode m v) xs = (reverse xs, v) : rest m xs+    rest m xs = concat [collapse tr (c:xs) | (c,tr) <- Map.toList m]
+ src/lib/UTF8.hs view
@@ -0,0 +1,48 @@+----------------------------------------------------------------------+-- |+-- Module      : UTF8+-- Maintainer  : AR+-- Stability   : (stable)+-- Portability : (portable)+--+-- > CVS $Date: 2006/10/10 13:21:52 $ +-- > CVS $Author: markus $+-- > CVS $Revision: 1.2 $+--+-- From the Char module supplied with HBC.+-- code by Thomas Hallgren (Jul 10 1999)+-----------------------------------------------------------------------------++module UTF8 (decodeUTF8, encodeUTF8) where++-- | Take a Unicode string and encode it as a string+-- with the UTF8 method.+decodeUTF8 :: String -> String+decodeUTF8 "" = ""+decodeUTF8 (c:cs) | c < '\x80' = c : decodeUTF8 cs+decodeUTF8 (c:c':cs) | '\xc0' <= c  && c  <= '\xdf' && +		      '\x80' <= c' && c' <= '\xbf' =+	toEnum ((fromEnum c `mod` 0x20) * 0x40 + fromEnum c' `mod` 0x40) : decodeUTF8 cs+decodeUTF8 (c:c':c'':cs) | '\xe0' <= c   && c   <= '\xef' && +		          '\x80' <= c'  && c'  <= '\xbf' &&+		          '\x80' <= c'' && c'' <= '\xbf' =+	toEnum ((fromEnum c `mod` 0x10 * 0x1000) + (fromEnum c' `mod` 0x40) * 0x40 + fromEnum c'' `mod` 0x40) : decodeUTF8 cs+decodeUTF8 s = s ---- AR workaround 22/6/2006+----decodeUTF8 _ = error "UniChar.decodeUTF8: bad data"++encodeUTF8 :: String -> String+encodeUTF8 "" = ""+encodeUTF8 (c:cs) =+	if c > '\x0000' && c < '\x0080' then+	    c : encodeUTF8 cs+	else if c < toEnum 0x0800 then+	    let i = fromEnum c+	    in  toEnum (0xc0 + i `div` 0x40) : +	        toEnum (0x80 + i `mod` 0x40) : +		encodeUTF8 cs+	else+	    let i = fromEnum c+	    in  toEnum (0xe0 + i `div` 0x1000) : +	        toEnum (0x80 + (i `mod` 0x1000) `div` 0x40) : +		toEnum (0x80 + i `mod` 0x40) : +		encodeUTF8 cs
+ src/lib/Util.hs view
@@ -0,0 +1,46 @@+module Util where++import List+import IO+import qualified Data.Set as Set++quote :: String -> String+quote s = ('\"':quot s)+ where quot    [] = "\""+       quot ('\"':xs) = '\\':'\"':quot xs+       quot (x:xs)  = x:quot xs++splitWith :: Eq a => a -> [a] -> Maybe ([a],[a])+splitWith a xs = +    case (span (/=a) xs) of+      (as,(_:bs)) -> return (as,bs)+      _           -> Nothing++splitList :: Eq a => a -> [a] -> [[a]]+splitList a [] = []+-- splitList ++-- | Print to stderr.+prErr :: String -> IO()+prErr s =  hPutStr stderr (s ++ "\n")++prStd :: String -> IO()+prStd s = hPutStr stdout (s ++ "\n")++sort_length l = sortBy f+ where  check xs = or [Set.member s l | s <- xs]+        f x y = case (length x, length y) of+                 (n1,n2) | check x && not (check y) -> LT+                         | not (check x) && check y -> GT+                         | n1 < n2 -> LT+                         | n1 > n2 -> GT+                 _                 -> EQ++sort_length_rev l = sortBy f+ where check xs = or [Set.member s l | s <- xs]+       f x y = case (length x, length y) of+                 (n1,n2) | check x && not (check y) -> GT+                       | not (check x) && check y -> LT+                       | n1 < n2 -> GT+                       | n1 > n2 -> LT+                 _               -> EQ
+ src/lib/rts.c view
@@ -0,0 +1,1 @@+char *ghc_rts_opts = "-K30M -M2048M";
+ src/lib/trie_lib.c view
@@ -0,0 +1,366 @@+/*+  A Trie ADT for insertion and traversal.+  Copyright (C) 2004  Author: Markus Forsberg+  +  Please send bug reports to: markus@cs.chalmers.se++  This program is free software; you can redistribute it and/or modify+  it under the terms of the GNU General Public License as published by+  the Free Software Foundation; either version 2 of the License, or+  (at your option) any later version.+  +  This program is distributed in the hope that it will be useful,+  but WITHOUT ANY WARRANTY; without even the implied warranty of+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+  GNU General Public License for more deails.+  +  You should have received a copy of the GNU General Public License+  along with this program; if not, write to the Free Software+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA+*/++#include <stdlib.h>+#include <stdio.h>+#include <string.h>+#include <time.h>+#include <ctype.h>+#include <math.h>+#include "trie_lib.h"+#include <string.h>++/************************ Defines **************************************/+#define MAXLINE 1000+#define ACCEPT_ZERO 1+#define DELIMITER ':'+#define DOT 10000+/*******************************************************/++Trie   global_trie = NULL; ++Values global_value= NULL;+int global_count = 0;+int global_uniq_count = 0;+// int global_transitions = 0;+time_t global_t1 ;+bool global_reversed  = false ;+bool global_countable = true ;++/*******************************************************/++/* LOCAL */+Values addValue(Values val,  const char* s){+  Values n_val    = (Values) malloc(sizeof(Values)) ;+  n_val -> string = s   ;+  n_val -> next   = val ;+  return n_val ;+}++/* EXPORT */++int getNumber(const char* str){+  int pos;+ +  for(pos = 0 ; pos < strlen(str); pos++){+    if(str[pos] == '\"' && isdigit (str[pos+1]))+       break;+  }+    size_t size   = strspn(&str[pos+1],"1234567890") ;+    char* number = malloc(sizeof(char)*size);+    memcpy(number,&str[pos+1],size);+    return atoi(number);+}++/*+int getNumber(const char* str){+  char* tmp; +  strcpy(tmp,str);+  tmp = strreverse(tmp) ;+  tmp = strchr(tmp,'\"');+  size_t size  = strspn(++tmp,"1234567890");+  char*  tmp2  = malloc(sizeof(char)*size);+  memcpy(tmp2, tmp, size);+  tmp = strreverse(tmp2) ;+  return atoi(tmp2);+}+*/++/*  public domain by Bob Stout */+char *strreverse(char *str)+{+      char *p1, *p2;++      if (! str || ! *str)+            return str;+      for (p1 = str, p2 = str + strlen(str) - 1; p2 > p1; ++p1, --p2)+      {+            *p1 ^= *p2;+            *p2 ^= *p1;+            *p1 ^= *p2;+      }+      return str;+}++++/* EXPORT */+char* next(){+    char* result ;+  if(more()) {+    result       = (char*) global_value -> string ;+    global_value = global_value -> next ;+    return result ;+  }+  else return "";+}++/* EXPORT */+bool more(){+  return global_value != NULL;+}++/*****************  List functions *************************************/++/* LOCAL */+List addList(List list, Trie trie, char c){+  List new = malloc(sizeof(List));+  new -> c = c;+  new -> trie = trie;+  new -> next = list;+  return new;+}++/* LOCAL */+Trie lookupList(List list, char cl){+  List list_traversal = list;+  while(1){+    if(list_traversal == NULL){+      return NULL;+    }+    else{+      if((list_traversal -> c) == cl)+	return list_traversal -> trie;+      else+	list_traversal = list_traversal -> next;+    }+  }+}++/*****************  Trie functions *************************************/++/* LOCAL */+Trie newTrie(){+  Trie trie;+  trie = (Trie) malloc(sizeof(Trie));+  trie -> list = NULL;+  trie -> value = NULL;+  return trie;+}++/* LOCAL */+Trie add(Trie trie, char c){+  List l;+  Trie t = lookupList(trie -> list,c);+  if (t != NULL) return t;+  else{+    // global_transitions++ ;+    t = newTrie();+    l = addList(trie -> list,t,c);+    trie -> list = l;+    return t;+  }+}++/* LOCAL */+Trie move(Trie trie, char c){+  return lookupList(trie -> list,c);+}++void reversed(){+  global_reversed = true ;+}++void no_count(){+  global_countable = false ;+}++/* LOCAL */+void insert(Trie trie, const char *word,const char* result){+  Trie traversal_ptr;+  char *result_copy;+  int index;+  bool b = false;++  result_copy = malloc(sizeof(char)*(strlen(result)+1));+  strcpy(result_copy,result);++  traversal_ptr = trie;++  if(global_reversed){+    for(index=strlen(word) ; index >= 0 ; index--){+      traversal_ptr = add(traversal_ptr,word[index]);+    }+  }+  else{+    for(index=0 ; index < strlen(word) ; index++){+      traversal_ptr = add(traversal_ptr,word[index]);+    }+  }++  if (traversal_ptr -> value == NULL) /* no previous value at node */ +   if(global_countable)  +    global_uniq_count++;+  traversal_ptr -> value = addValue(traversal_ptr -> value,result_copy);+  if(global_countable)+    global_count++ ;+  if(global_count % DOT == 0) +    fprintf(stderr,".");+}++/* GLOBAL */+void insert_t(const char *word, const char* result){+  insert(global_trie, word, result) ;+}++/* LOCAL */+Values accept(Trie trie, const char *word){+  Trie traversal_ptr = trie;+  int index;+  /* Traverse the word */+  if(global_reversed){+    for(index=strlen(word) ; index >= 0 ; index--){+      traversal_ptr = move(traversal_ptr, word[index]);+      if(traversal_ptr == NULL) +	return NULL;+    }+  }+  else{+    for(index=0 ; index < strlen(word) ; index++){+      traversal_ptr = move(traversal_ptr, word[index]);+      if(traversal_ptr == NULL) +	return NULL;+    }+  }+  /* Final state reached */+  return traversal_ptr -> value;+}++/************* File operations ************************************/++/* LOCAL: Splits a line into two, with the delimiter DELIMITER */+int split(const char *line, char *fst, char *snd){+  int i;+  char*tmp;+  tmp = strchr(line,DELIMITER);+  tmp++;+  strcpy(snd,tmp);+  for(i=0; i <= MAXLINE ; i++){+    if(line[i] != DELIMITER)+      fst[i] = line[i];+    else+      if(line[i+1] == '{')+        {+          fst[i] = '\0';+          return 1;+        }+  }+  return 0;+}++/* EXPORT */+void empty(){+  global_trie = newTrie();+}++void start(){+  // if(global_reversed)+  //   fprintf(stderr, "reversed ");+  fprintf(stderr, "computing ['.': 10k word forms]: ");+  time(&global_t1);+}++void stop(){+  time_t t2;+  time(&t2);+  if(global_count < 1000000){+    fprintf(stderr,"\n\n%dk word forms ", global_count/1000);+  }+  else{+    fprintf(stderr,"\n\n%.2fM word forms ", global_count/1000000.0);+  }+  fprintf(stderr,"[c: %d, u: %d]\n", global_count,global_uniq_count);+  // fprintf(stderr,"Trie size (transitions): %.2e\n", (double)global_transitions);+  fprintf(stderr,"compile time: %.2f seconds\n", difftime(t2,global_t1));+}++/* EXPORT */+void build(const char *filename){+  FILE *file_ptr;+  char line[MAXLINE];+  char fst[MAXLINE];+  char snd[MAXLINE];+  char* status;+  char* p;+  start();+  // fprintf(stderr,"Lexicon file: %s\n", filename);+  global_trie = newTrie();+  file_ptr = fopen(filename,"r");+  while(1){    +    status = fgets(line, MAXLINE,file_ptr);+    if(status == NULL)+      break;+    if ((p = strchr(line, '\n')) != NULL)+      *p = '\0';+    if(split(line,fst,snd))+      if(strlen(snd) > 0 || ACCEPT_ZERO)+        insert(global_trie,fst,snd) ;+  }+  stop();+}++/* EXPORT */+void lookup_t(const char* word){+  global_value = accept(global_trie,word);+}++/* EXPORT */+bool in_t(const char* word){+  Values val;  +  val = accept(global_trie,word);+  return val != NULL;+}++/* UNALLOCATE Memory */++/* LOCAL */+void freeValues(Values val){+  if(val == NULL)+    return;+  freeValues(val -> next);+  free(val);+}+++void freeTrie(Trie trie) ;++/* LOCAL */+void freeList(List list){+  if(list == NULL)+    return;+  freeTrie(list -> trie);+  freeList(list -> next);+}++/* LOCAL */+void freeTrie(Trie trie){+  if(trie == NULL)+    return;+  freeValues(trie -> value);+  freeList(trie -> list);+  free(trie);+}++/* EXPORT */+void free_trie(){+  freeTrie(global_trie);+  freeValues(global_value);+}
+ src/lib/trie_lib.h view
@@ -0,0 +1,59 @@+#ifndef _TRIELIB+#define _TRIELIB+++#include<stdbool.h>++/************************* Types ***************************************/+typedef struct {+  const char* string;+  void *next;+} Value_Struct;++typedef Value_Struct* Values ;++typedef struct {+  Values value;+  void*  list;+} Trie_Struct;++typedef Trie_Struct* Trie;++typedef struct List_el {+  char c;+  Trie trie;+  struct List_el *next;+} List_Struct;++typedef List_Struct* List ; +++void build(const char *filename);++char *strreverse(char *str);++void reversed();++void no_count();++void lookup_t(const char* word);++char* next();++bool in_t(const char* word);++void insert_t(const char* word, const char* result);++void empty();++bool more();++int getNumber(const char* word);++void start();++void stop();++void free_trie();++#endif
+ src/saldo/AdjBuildSw.hs view
@@ -0,0 +1,119 @@+module AdjBuildSw where++import General+import Dictionary+import TypesSw+import RulesSw+import GenRulesSw++adjective :: Adjective -> Entry+adjective = entry++adj :: Int -> (Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes) -> (String -> Entry)+adj n (liten,litet,lilla,sma,mindre,minst,minsta) s = adjective $ +    adjective_prefixed n liten litet lilla sma mindre minst minsta s        ++adjc :: Int -> (Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes,Suffixes) -> (String -> Entry)+adjc n (liten,litet,lilla,sma,mindre,minst,minsta,småc) s = adjective $ +    excepts (adjective_prefixed n liten litet lilla sma mindre minst minsta s) [(AdjComp,strings $ concat [[x,x+?"-"] | x <- apply_suffixes (tk n s) småc]),+                                                                                (AdjSMS,strings $ [x+?"-" | x <- apply_suffixes (tk n s) småc])+                                                                               ]++adj_no_genitive_c :: Int -> (Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes,Suffixes) -> (String -> Entry)+adj_no_genitive_c n (liten,litet,lilla,sma,mindre,minst,minsta,småc) s = adjective $ no_genitive $+    excepts (adjective_prefixed n liten litet lilla sma mindre minst minsta s) [(AdjComp,strings $ concat [[x,x+?"-"] | x <- apply_suffixes (tk n s) småc]),+                                                                                (AdjSMS,strings $ [x+?"-" | x <- apply_suffixes (tk n s) småc])+                                                                               ]++adj_no_genitive :: Int -> (Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes) -> (String -> Entry)+adj_no_genitive n (liten,litet,lilla,sma,mindre,minst,minsta) s = adjective $ +    no_genitive $ adjective_prefixed n liten litet lilla sma mindre minst minsta s        ++adj_no_masc :: Int -> (Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes, Suffixes) -> (String -> Entry)+adj_no_masc n (liten,litet,lilla,sma,mindre,minst,minsta) s = adjective $ +    no_masc $ adjective_prefixed n liten litet lilla sma mindre minst minsta s        +++-- adjective 0+-- av_0  liten litet lilla sma = adjective $ av0 liten litet lilla sma++av_0_kronisk :: String -> Entry+av_0_kronisk = adjective . av0kronisk++av_0_konstlad :: String -> Entry+av_0_konstlad = adjective . av0konstlad++av_0_gängse :: String -> Entry+av_0_gängse = adjective . av0gängse++av_0_lastgammal :: String -> Entry+av_0_lastgammal = adjective . av0lastgammal ++av_0_medelstor :: String -> Entry+av_0_medelstor  = adjective . av0medelstor+++-- adjective 1++av_1_blek :: String -> Entry+av_1_blek = adjective . av1blek++av_1_blek_ng :: String -> Entry+av_1_blek_ng = adjective . no_genitive . av1blek++av_1_fri :: String -> Entry+av_1_fri = adjective . av1fri++av_1_lätt :: String -> Entry+av_1_lätt = adjective . av1lätt++av_1_glad :: String -> Entry+av_1_glad = adjective . av1glad++av_1_högljudd :: String -> Entry+av_1_högljudd = adjective . av1högljudd++av_1_hård :: String -> Entry+av_1_hård = adjective . av1hård++av_1_tunn :: String -> Entry+av_1_tunn = adjective . av1tunn++av_1_ensam :: String -> Entry+av_1_ensam = adjective . av1ensam++av_1_vacker :: String -> Entry+av_1_vacker = adjective . av1vacker++av_1_angelägen :: String -> Entry+av_1_angelägen = adjective . av1angelägen++av_1_ringa :: String -> Entry+av_1_ringa = adjective . av1ringa++av_1_akut :: String -> Entry+av_1_akut = adjective . av1akut++av_1_lat :: String -> Entry+av_1_lat = adjective . av1lat+++-- adjective 2++av_2_ung :: String -> Entry+av_2_ung = adjective . av2ung++av_2k_yttre :: String -> Entry+av_2k_yttre = adjective . av2yttre++-- uninflected adjective++av_i_diverse :: String -> Entry+av_i_diverse = entry . (const :: Str -> AdjInvForm -> Str) . mkStr ++av_ik_aktre :: String -> Entry+av_ik_aktre = entry . (const :: Str -> AdjCompInvForm -> Str) . mkStr++-- invariant multi-words adjectives+avm_i :: String -> Entry+avm_i = entry . (const :: Str -> AdjMInv -> Str) . mkStr
+ src/saldo/AdjRulesSw.hs view
@@ -0,0 +1,157 @@+----------------------------------------------------------------------+-- |+-- Module      : AdjRulesSw+-- Maintainer  : Markus Forsberg+-- Stability   : (stability)+-- Portability : (portability)+--+-- Swedish adjective functions+-------------------------------------------------------------------------+module AdjRulesSw where++import TypesSw+import General+import NounRulesSw(mk_case)+import GenRulesSw+import List(nub)++no_neutrum :: Adjective -> Adjective+no_neutrum f = missing f [(AF (Pos (Strong ASgNeutr))  c) | c <- values]++no_genitive :: Adjective -> Adjective+no_genitive f = missing f [(AF v Gen) | v <- values]++no_masc :: Adjective -> Adjective+no_masc f = missing f $ [AF (Pos (Weak (AxSg Masc))) v | v <- values] ++ [AF (Super (SupWeak Masc)) v | v <- values]++mk_adj_pos :: [String] -> [String] -> [String] -> [String] -> AdjFormPos -> [String]+mk_adj_pos liten litet lilla sma a = case a of+  Strong gn  -> case gn of+    ASgUtr   -> liten+    ASgNeutr -> litet+    APl      -> sma+  Weak sn -> case sn of+    AxSg g -> giveValues [lilla, lille] g+    AxPl -> sma+ where+   lille = let x = map (\s -> if (last s == 'a') then tk 1 s else s) lilla in +           -- avoid bra -> bre, få -> fe+             if (and (map (any is_vowel) x)) then nub (map (+?"e") x) else lilla++mk_adjective :: String -> String -> String -> String -> String -> String -> String -> Adjective+mk_adjective liten litet lilla sma mindre minst minsta = +    mk_adjective_v [liten] [litet] [lilla] [sma] [mindre] [minst] [minsta]++mk_adjective_v :: [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> Adjective+mk_adjective_v liten litet lilla sma mindre minst minsta AdjComp = strings $ concat [[x,x +? "-"] | x@(_:_) <- liten]+mk_adjective_v liten litet lilla sma mindre minst minsta AdjSMS  = strings $ [x +? "-" | x@(_:_) <- liten]+mk_adjective_v liten litet lilla sma mindre minst minsta (AF a c) = +  strings $ map (mk_case c) $ case a of+    Pos p   -> mk_adj_pos liten litet lilla sma p+    Comp    -> mindre +    Super s -> giveValues [minst, minsta,minste] s+ where minste = let x = map  (\s -> if (last s == 'a') then tk 1 s else s) minsta in +                 if +                     (and (map (any is_vowel) x)) then nub (map (+?"e") x) else []++adjective_prefixed :: Int -> Suffixes -> Suffixes -> Suffixes -> Suffixes -> +                             Suffixes -> Suffixes -> Suffixes -> String -> Adjective+adjective_prefixed n liten litet lilla sma mindre minst minsta s = +     mk_adjective_v (f liten) (f litet) (f lilla) (f sma) (f mindre) (f minst) (f minsta)+  where f = apply_suffixes (tk n s) -- map ((tk n s) ++)++extract_positive ::  Adjective -> AdjFormPos -> Str+extract_positive adj a = adj (AF (Pos a) Nom)++no_compare :: Adjective -> Adjective+no_compare a = a `only` positive_forms++adj_irreg :: String -> String -> String -> String -> Adjective+adj_irreg god gott battre bast = mk_adjective god gott (god ++ "a") (god ++ "a") battre bast (bast ++ "a")++adj_irreg3 :: String -> String -> String -> Adjective+adj_irreg3 ung yngre yngst = adj_irreg ung (ung ++ "t") yngre yngst++adj_almost_reg :: String -> String -> String -> Adjective+adj_almost_reg ljummen ljummet ljumma = mk_adjective ljummen ljummet ljumma ljumma (ljumma ++ "re") (ljumma ++ "st") (ljumma ++ "ste")++-- adjective 0+av0 :: String -> String -> String -> String -> Adjective+av0 liten litet lilla sma+    = no_compare $ mk_adjective liten litet lilla sma [] [] []++av0kronisk :: String -> Adjective+av0kronisk kronisk = adj_almost_reg kronisk (kronisk ++ "t") (kronisk ++ "a") `only` positive_forms++av0konstlad :: String -> Adjective+av0konstlad konstlad = adj_almost_reg konstlad (konstla ++ "t") (konstlad ++ "e") `only` positive_forms+ where konstla =tk 1 konstlad++av0gängse :: String -> Adjective+av0gängse = no_compare . const . mkStr++av0lastgammal :: String -> Adjective+av0lastgammal lastgammal = no_compare $ +       adj_almost_reg lastgammal (lastgammal ++ "t") (lastgamla) + where lastgamla =  (ungeminate (tk 2 lastgammal)) ++ "la"++av0medelstor :: String -> Adjective+av0medelstor medelstor = no_compare $ +  adj_almost_reg medelstor (medelstor ++ "t") (medelstor++"a")++-- adjective 1+av1blek :: String -> Adjective+av1blek blek = adj_almost_reg blek (blek ++ "t") (blek ++ "a")++av1fri :: String -> Adjective+av1fri fri = adj_almost_reg fri (fri ++ "tt") (fri ++ "a")++av1lätt :: String -> Adjective+av1lätt lätt = adj_almost_reg lätt lätt (lätt  ++ "a")++av1glad :: String -> Adjective+av1glad glad = adj_almost_reg glad (tk 1 glad  ++  "tt") (glad ++ "a")++av1högljudd :: String -> Adjective+av1högljudd högljudd = adj_almost_reg högljudd (höglju ++  "tt") (högljudd  ++ "a")+ where höglju = case reverse högljudd of+                 (c:c1:_) | c == c1 -> tk 2 högljudd+                 _                  -> tk 1 högljudd++av1hård :: String -> Adjective+av1hård hård = adj_almost_reg hård (tk 1 hård ++ "t")  (hård ++ "a")++av1tunn :: String -> Adjective+av1tunn tunn = adj_almost_reg tunn (tk 1 tunn ++ "t")  (tunn ++ "a")++av1ensam :: String -> Adjective+av1ensam ensam = mk_adjective ensam (ensam++"t") (ensam++ma) (ensam++ma) (ensam++ma ++ "re") (ensam++ ma ++ "st") (ensam++ma++"ste")+ where ma = [last ensam] ++ "a"++av1vacker :: String -> Adjective+av1vacker vacker = adj_almost_reg vacker vackert (mmn (drop_last_vowel vacker) ++ "a")+  where vackert = ifEndThen (== 'n') vacker (tk 1 vacker ++"t") (vacker++"t")++av1angelägen :: String -> Adjective+av1angelägen angelägen = adj_almost_reg angelägen (angeläg ++ "et") ((ungeminate angeläg) +? "na")+ where angeläg = tk 2 angelägen++av1ringa :: String -> Adjective+av1ringa ringa  = adj_almost_reg ringa ringa ringa++av1akut :: String -> Adjective+av1akut akut = adj_almost_reg akut (aku ++ "t") (akut ++ "a")+ where aku = tk 1 akut++av1lat :: String -> Adjective+av1lat lat = no_neutrum (av1akut lat)++-- adjective 2+av2ung :: String -> Adjective+av2ung ung = adj_irreg3 ung (yng++"re") (yng++"st")+  where yng = umlaut ung++av2yttre :: String -> Adjective+av2yttre yttre = missing (adj_irreg3 [] yttre ytterst) [ a | a@(AF (Pos _) _) <- values]+ where ytterst = (tk 2 yttre ++ "er") ++ "st"+
+ src/saldo/Attr.hs view
@@ -0,0 +1,27 @@+module Attr where++import General(Attr)++h_attr :: Attr+h_attr  = 0 ++init_attr :: Attr+init_attr  = 1++medial_attr :: Attr+medial_attr = 2++w_attr :: Attr+w_attr  = 3 ++wp_attr :: Attr+wp_attr = 4++d_attr :: Attr+d_attr  = 5++c_attr :: Attr+c_attr = 6++s_attr :: Attr+s_attr = 7
+ src/saldo/BuildSw.hs view
@@ -0,0 +1,12 @@+module BuildSw (+                module NounBuildSw,+                module AdjBuildSw,+                module VerbBuildSw,+                module OtherBuildSw+               ) where++import NounBuildSw+import AdjBuildSw+import VerbBuildSw+import OtherBuildSw+
+ src/saldo/CommandsSw.hs view
@@ -0,0 +1,2630 @@++module CommandsSw where++import BuildSw+import Frontend+import TypesSw+import GenRulesSw+import General+import Dictionary+import Attr+import Maybe(catMaybes)+import qualified Data.Map as Map++commands :: [(String, [String], [String] -> Entry)]+commands = sal ++ sal_tail++suffix :: Int -> Entry -> String ->Entry+suffix n e s = map_wordforms ((tk n s)++) e++unDEFINED :: String -> Entry+unDEFINED _ = emptyEntry++noc :: (String -> Entry) -> (String -> Entry)+noc f = \s -> remove_param "sms" $ remove_param "ci" $ remove_param "cm" $ f s++sal_tail :: [(String, [String], [String] -> Entry)]+sal_tail =+ [+  paradigm_h "pm_fph_kleopatra"              ["Kleopatra"]            $ pm_f "ph",+  paradigm_h "pm_uls_storgatan"              ["Storgatan"]            $ pm_u "ls",+  paradigm_h "pm_ulf_centralen"              ["Centralen"]            $ pm_u "lf",+  paradigm_h "pm_noe_harvard"                ["Harvard"]              $ pm_n "oe",+  paradigm_h "pm_utz_bambara"                ["Bambara"]              $ pm_u "tz",+  paradigm_h "pm_vlg_nordsjön"               ["Nordsjön"]             $ pm_v "lg",+  paradigm_h "pm_uoc_operan"                 ["Operan"]               $ pm_u "oc",+  paradigm_h "pm_ueh_upplysningen"           ["Upplysningen"]         $ pm_u "eh",+  paradigm_h "pm_uaa_viggen"                 ["Viggen"]               $ pm_u "aa",+  paradigm_h "pm_naw_titanic"                ["Titanic"]              $ pm_n "aw",+  paradigm_h "pm_upm_audhumbla"              ["Audhumbla"]            $ pm_u "pm",+  paradigm_h "pm_uog_polisen"                ["Polisen"]              $ pm_u "og",+  paradigm_h "pm_uaa_camel"                  ["Camel"]                $ pm_u "aa",+  paradigm_h "pm_poc_hepstars"               ["Hepstars"]             $ pm_p "oc",+  -- paradigm_h "pm_naa_keso"                   ["Keso"]                 $ pm_n "aa",+  paradigm_h "pm_nac_saldo"                  ["SALDO"]                $ pm_n "ac",+  paradigm_h "pm_upa_brunte"                 ["Brunte"]               $ pm_u "pa",+  paradigm_h "pm_uop_landsorganisationen"    ["Landsorganisationen"]  $ pm_u "op",+  paradigm_h "pm_uoe_kursverksamheten"       ["Kursverksamheten"]     $ pm_u "oe",+  paradigm_h "pm_uap_vasaorden"              ["Vasaorden"]            $ pm_u "ap",+  paradigm_h "pm_nwm_aktuellt"               ["Aktuellt"]             $ pm_n "wm",+  paradigm_h "pm_nop_efta"                   ["EFTA"]                 $ pm_n "op",+  paradigm_h "pm_nog_skatteverket"           ["Skatteverket"]         $ pm_n "og",+  paradigm_h "pm_nog_knesset"                ["Knesset"]              $ pm_n "og",+  paradigm_h "pm_nog_interpol"               ["Interpol"]             $ pm_n "og",+  paradigm_h "pm_noc_musikforum"             ["Musikforum"]           $ pm_n "oc",+  paradigm_h "pm_nla_solsystemet"            ["Solsystemet"]          $ pm_n "la",+  paradigm_h "pm_hph_af"                     ["AF"]                   $ pm_h "ph",+  paradigm_h "pm_fph_barbro"                 ["Barbro"]               $ pm_f "ph",+  paradigm_h "pm_uwa_monalisa"               ["Monalisa"]             $ pm_u "wa",+  paradigm_h "pm_upc_ttaps-gruppen"          ["TTAPS-gruppen"]        $ pm_u "pc",+  paradigm_h "pm_uop_atlantpakten"           ["Atlantpakten"]         $ pm_u "op",+  paradigm_h "pm_uae_keso"                   ["Keso"]                 $ pm_u "ae",+  paradigm_h "pm_nwp_charta77"               ["Charta77"]             $ pm_n "wp",+  paradigm_h "pm_nos_gais"                   ["Gais"]                 $ pm_n "os",+  paradigm_h "pm_noa_finnair"                ["Finnair"]              $ pm_n "oa",+  paradigm_h "pm_nes_vasaloppet"             ["Vasaloppet"]           $ pm_n "es",+  paradigm_h "pm_nap_nobelpriset"            ["Nobelpriset"]          $ pm_n "ap",+  -- paradigm_h "pm_naa_camel"                  ["Camel"]                $ pm_n "aa",+  paradigm_h "pm_fpm_maria"                  ["Maria"]                $ +   set_inhs ["f","pm"] . set_pos "pm" . noun_f 1 Utr  ([e "a"], [e "an"], [e "or"], [e "orna"]),   +  paradigm_h "pma_woc_od"                    ["OD"]                   $ pma_w "oc",+  paradigm_h "pma_nwb_blm"                   ["FoF"]                  $ pma_n "wb",+  paradigm_h "pma_nom_svt"                   ["BBC"]                  $ pma_n "om",+  paradigm_h "pma_nos_gsk"                   ["GSK"]                  $ pma_n "os",+  paradigm_h "pma_nog_ab"                    ["AB"]                   $ pma_n "og",+  paradigm_h "pma_noa_sas"                   ["SAS"]                  $ pma_n "oa",+  paradigm_h "pma_nam_thx"                   ["THX"]                  $ pma_n "am",+  paradigm_h "pma_naf_jas"                   ["JAS"]                  $ pma_n "af",+  paradigm_h "pma_naa_lep"                   ["LEP"]                  $ pma_n "aa",+  paradigm_h "pma_mph_jr"                    ["Jr"]                   $ pma_m "ph",+  paradigm_h "pma_hph_nn"                    ["N.N."]                 $ pma_h "ph",+  paradigm_h "pma_noe_gu"                    ["GU"]                   $ pma_n "oe",+  paradigm_h "pma_nlp_eu"                    ["EU"]                   $ pma_n "lp",+  paradigm_h "pma_uwn_dn"                    ["DN"]                   $ pma_u "wn",+  paradigm_h "pma_ntm_cp"                    ["cp"]                   $ pma_n "tm",+  paradigm_h "pma_mpm_st"                    ["St"]                   $ pma_m "pm",+  paradigm_h "pmm_n0eh_andra_världskriget"   ["Andra världskriget"]   $ pmm_n "eh",+  paradigm_h "pmm_u0wc_fröken_julie"         ["Fröken Julie"]         $ pmm_u "wc",+  paradigm_h "pmm_u0la_stora_björnen"        ["Stora björnen"]        $ pmm_u "la",+  paradigm_h "pmm_n0op_grön_ungdom"          ["Grön ungdom"]          $ pmm_n "op",+  paradigm_h "pmm_u0tb_betula_alba"          ["betula alba"]          $ pmm_u "tb",+  paradigm_h "pmm_m0ph_birger_jarl"          ["Birger Jarl"]          $ pmm_m "ph",+  paradigm_h "pmm_u0oe_svenska_institutionen" ["Svenska institutionen"] $ pmm_u "oe",+  paradigm_h "pmm_u0aa_koh_i_noor"           ["Koh i noor"]           $ pmm_u "aa",+  paradigm_h "pmm_m0ph_per_olov"             ["Per Olov"]             $ pmm_m "ph",+  paradigm_h "pmm_m0ph_karl_den_tolfte"      ["Karl den tolfte"]      $ pmm_m "ph",+  paradigm_h "pmm_m0ph_el_greco"             ["el greco"]             $ pmm_m "ph",+  paradigm_h "pmm_f0pm_jungfru_maria"        ["jungfru Maria"]        $ pmm_f "pm",+  paradigm_h "pmm_n0lf_vita_huset"           ["Vita huset"]           $ pmm_n "lf",+  paradigm_h "pmm_m0ph_karl_xii"             ["Karl xii"]             $ pmam_m "ph",+  paradigm_h "pmm_h0ph_jonsson_lind"         ["Jonsson Lind"]         $ pmm_h "ph",+  paradigm_h "pmm_u0tm_parkinsons_sjukdom"   ["Parkinsons sjukdom"]   $ pmm_u "tm",+  paradigm_h "pmm_u0op_nysvenska_rörelsen"   ["Nysvenska rörelsen"]   $ pmm_u "op",+  paradigm_h "pmm_u0ls_lilla_nygatan"        ["Lilla Nygatan"]        $ pmm_u "ls",+  paradigm_h "pmm_u0en_big_bang"             ["Big Bang"]             $ pmm_u "en",+  paradigm_h "pmm_u0aw_cutty_sark"           ["Cutty Sark"]           $ pmm_u "aw",+  paradigm_h "pmm_n0oc_ebba_grön"            ["Ebba Grön"]            $ pmm_n "oc",+  paradigm_h "pmm_m0pm_john_blund"           ["John Blund"]           $ pmm_m "pm",+  paradigm_h "pmm_m0ph_adam_av_bremen"       ["Adam av Bremen"]       $ pmm_m "ph",+  paradigm_h "pmm_v0lf_notre_dame"           ["Notre Dame"]           $ pmm_v "lf",+  paradigm_h "pmm_u0wn_dagens_nyheter"       ["Dagens nyheter"]       $ pmm_u "wn",+  paradigm_h "pmm_u0es_davis_cup"            ["Davis cup"]              $ pmm_u "es",+  paradigm_h "pmm_u0er_marie_bebådelse"      ["Marie bebådelse"]        $ pmm_u "er",+  paradigm_h "pmm_u0eh_franska_revolutionen" ["Franska Revolutionen"]   $ pmm_u "eh",+  paradigm_h "pmm_u0ag_rolls_royce"          ["Rolls Royce"]            $ pmm_u "ag",+  paradigm_h "pmm_p0ph_bröderna_grimm"         ["Bröderna Grimm"]         $ pmm_p "ph",+  paradigm_h "pmm_m0ph_plinius_d_y"           ["Plinius d y"]           $ pmam_m "pa",+  paradigm_h "pmm_m0pa_pelle_svanslös"        ["Pelle Svanslös"]        $ pmm_m "pa",+  paradigm_h "pmm_f0ph_eva_ek"                ["Eva Ek"]                $ pmm_f "ph",+  paradigm_h "pmm_uatm_multipel_skleros"      ["multipel skleros"]      $ pmm_u "tm",+  paradigm_h "pmm_uatm_cerebral_pares"        ["cerebral pares"]        $ pmm_u "tm",+  paradigm_h "pmm_pcpm_hugin_och_munin"       ["Hugin och Munin"]       $ pmm_p "pm",+  paradigm_h "pmm_f1pm_jungfrun_från_orleans" ["Jungfrun från Orleans"] $ pmm_f "pm",+  paradigm_h "pmm_nu0wn_svenska_dagbladet"    ["Svenska Dagbladet"]     $ pmm_n "wn",+  paradigm_h "pmm_nu0wn_svenskt_associationslexikon"    ["Svenskt associationslexikon"]     $ pmm_n "wn",+  paradigm_h "ab_2_bra"                  ["bra"] $ suffix 3 (ab_bra ["bra"] ["bättre"] ["bäst"]),+  paradigm_h "ab_2_nära"                 ["nära"] $ +   suffix 4 (ab_bra ["nära"] ["närmare", "närmre"] ["närmast", "närmst"]),+  paradigm_h "ab_2_mycket"               ["mycket"] $ suffix 6 (ab_bra ["mycket"] ["mer","mera"] ["mest"]),+  paradigm_h "ab_2_länge"                ["länge"] $ suffix 5 (ab_bra ["länge"] ["längre"] ["längst"]),+  paradigm_h "ab_2_illa"                 ["illa"] $ +    suffix 4 (ab_bra ["illa"] ["sämre","värre"] ["sämst","värst"]),+  paradigm_h "ab_2_gärna"                ["gärna"] $ suffix 5 (ab_bra ["gärna"] ["hellre"] ["helst"]),+  paradigm_h "ab_2_föga"                 ["föga"]  $ suffix 4 (ab_bra ["föga"] ["mindre"] ["minst"]),+  paradigm_h "ab_ik_vidare"              ["vidare"] $+    suffix 1 (ab_comp [] ["e"] [] ["e"]),+  paradigm_h "ab_2_lite"              ["lite"] $+     suffix 4 (ab_bra ["lite"] ["mindre"] ["minst"]),+  paradigm_h "ie_i_att"                  ["att"]            inf_mark,+  paradigm_h "sn_i_om"                   ["om"]             subj,+  paradigm_h "abh_i_ledes" ["ledes"] $ +   replace_attr w_attr s_attr . set_pos "abh" . ab_bort,  +  paradigm_h "avh_1_aktig" ["aktig"] $ +   replace_attr w_attr s_attr . set_pos "avh" . av_1_blek,+  paradigm_h "avh_1_bent" ["bent"] $ +   replace_attr w_attr s_attr . set_pos "avh" . av_1_akut,+  paradigm_h "avh_0_artad" ["artad"] $ +   replace_attr w_attr s_attr . set_pos "avh" . av_0_konstlad,+  paradigm_h "avh_0_buren" ["buren"] $ +   replace_attr w_attr s_attr . set_pos "avh" .+    adj 2 ([e "en"], [e "et"], [e "na"], [e "na"], [], [], []),+  paradigm_h "nnh_4u_bo" ["bo"] $ +   replace_attr w_attr s_attr . set_pos "nnh" . nn4,+  paradigm_h "nnh_2u_siding" ["siding"] $ +   replace_attr w_attr s_attr . set_pos "nnh" . +    noun_compound 0 Utr ([e ""], [e "en"], [e "ar"], [e "arna"], [(ds, "")],[(ds, "")]),+  paradigm_h "nnh_6u_tonnare" ["tonnare"] $ +   replace_attr w_attr s_attr . set_pos "nnh" .    +    noun_compound 0 Utr ([e ""], [e "n"], [e ""], [(tk 1, "na")],[(tk 1, "")],[(ds_drop,"")]), ++  paradigm_h "nnh_dn_snåret" ["snåret"] $ +   replace_attr w_attr s_attr . set_pos "nnh" . +    noun_f 0 Neutr  ([], [e ""], [], []),++  paradigm_h "nnh_du_årsåldern" ["årsåldern"] $ +   replace_attr w_attr s_attr . set_pos "nnh" . +    noun_f 0 Utr  ([], [e ""], [], []),++  paradigm_h "nn_3n_parti"     ["parti"]       nn3_parti,+  paradigm_h "nn_3u_fiber"     ["fiber"] $+   noun_compound 0 Utr ([e ""], [e "n"], [(dvu,"er")], [(dvu,"erna")],[e ""],[e "", (ds,"")]),   +  paradigm_h "nn_3u_tand"      ["tand"]        nn3_tand,+  paradigm_h "nn_3u_film"      ["film"] $+             noun_compound 0 Utr ([e ""], [e "en"], [e "er"], [e "erna"],[e ""],[e "", (ds,"")]),   ++  paradigm_h "nn_3u_bygd"      ["bygd"] $+             noun_compound 0 Utr ([e ""], [e "en"], [e "er"], [e "erna"],[e "",e "e"],[e "e", (ds,"")]),   ++  paradigm_h "nn_3u_plan"      ["plan"] $+             noun_compound 0 Utr ([e ""], [e "en"], [e "er"], [e "erna"],[e ""],[e "e",e "", (ds,"")]),   ++  paradigm_h "nn_3u_akademi"   ["akademi"] $+   noun_compound 0 Utr ([e ""], [e "n",e "en"], [e "er"], [e "erna"],[e ""],[e ""]),   ++  paradigm_h "nn_dn_rubbet"   ["rubbet"] $+   noun_compound 0 Neutr  ([], [e ""], [], [],[],[]),   ++  paradigm_h "nn_dp_tropikerna"   ["tropikerna"] $+   noun_compound 0 GPl ([], [], [], [e ""],[],[]),   ++  paradigm_h "nn_du_stampen"   ["stampen"] $+   noun_compound 0 Utr ([], [e ""], [], [],[],[]),   ++  paradigm_h "nn_np_ordalag"   ["ordalag"] $+   noun_f 0 GPl ([], [], [e ""], [e "en"]),   ++  paradigm_h "nn_rp_benvärmare"   ["benvärmare"] $+   noun_f 0 GPl ([], [], [e ""], [(tk 1, "na")]),   ++  paradigm_h "nn_rp_griller"   ["griller"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[],[]),   ++  paradigm_h "nn_rp_inälvor"   ["inälvor"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(ds . tk 2,"")],[(ds . tk 2,"")]),   ++  paradigm_h "nn_rp_johannesnycklar"   ["johannesnycklar"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(tk 3,"el"),(tk 3,"els")],[(tk 3,"el"),(tk 3,"els")]),   ++  paradigm_h "nn_rp_kläder"   ["kläder"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(tk 2,""),(ds . tk 2,""),(tk 2,"es")],[(tk 2,""),(ds . tk 2,""),(tk 2,"es")]),   +  paradigm_h "nn_rp_kråkfötter"   ["kråkfötter"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(ds . vc "o" . tk 3,"")], [(ds . vc "o" . tk 3,"")]),   ++  paradigm_h "nn_rp_paltor"   ["paltor"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(tk 2,"")],[(tk 2,""),(ds . tk 2,"")]),   ++  paradigm_h "nn_rp_specerier"   ["specerier"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(tk 2,"")],[(tk 2,"")]),   ++  paradigm_h "nn_rp_stadgar"   ["stadgar"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(tk 2,"e")],[(tk 2,"e")]),   ++  paradigm_h "nn_rp_svear"   ["svear"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(tk 1,"")],[(tk 1,"")]),   ++  paradigm_h "nn_rp_underkläder"   ["underkläder"] $+   noun_compound 0 GPl ([], [], [e ""], [e "na"],[(ds . tk 2,""),(tk 2,"es")],[(ds . tk 2,""),(tk 2,"es")]),   ++  paradigm_h "pn_o_sån" ["sån"] $ +    pn_nagon ([e "",(tk 1,"dan")],[e "t",(tk 1,"dant")],[e "a",(tk 1,"dana")]),++  paradigm_h "pn_o_all" ["all"] $ +    pn_nagon ([e ""],[e "t"],[e "a"]),++  paradigm_h "pn_o_varsin" ["varsin"] $ +    pn_nagon ([e ""],[(tk 1,"tt")],[e "a"]),++  paradigm_h "pn_o_vem" ["vem"] $ +    pn_vem ([e ""],[e ""],[e "s"]),++  paradigm_h "pn_o_varandra" ["varandra"] $ +    pn_vem ([],[e ""],[e "s"]),++  paradigm_h "pn_o_man" ["man"] $ +   pn_han (P3,Sg) ([e ""],[(tk 3,"en")],[(tk 3, "ens")]),+    +  paradigm_h "pn_i_vars" ["vars"] $ pn_inv,++  paradigm_h "pn_o_sig" ["sig"] $+    pn_jag (P3,Sg) ([],[e "",(tk 2,"ej")],[(tk 1,"n")],[(tk 1,"tt")],[(tk 1,"na")]),++  paradigm_h "pn_o_ingen"             ["ingen"] $+   pn_nagon ([e ""],[(tk 1,"t")],[(tk 2,"a")]),++  paradigm_h "pn_o_den"               ["den"]   $+   pn_o_den, +  paradigm_h "pn_o_någon"             ["någon"] $+   pn_nagon ([e "", (tk 3,"n")],[(tk 1,"t"), (tk 3,"t")],[(tk 2,"ra")]),+ paradigm_h "pn_o_ingendera"        ["ingendera"] $+    pn_nagon ([e ""],[(tk 5,"tdera")],[(tk 6,"adera")]),+  paradigm_h "pn_o_vi"                ["vi"] $+    pn_jag  (P1,Pl) ([e ""],[(tk 2, "oss")],[(tk 2,"vår"),(tk 2,"våran")],[(tk 2,"vårt"),(tk 2,"vårat")],[(tk 2,"våra")]),+  paradigm_h "pn_o_de"                ["de"] $+   pn_han (P3,Pl) ([e "",(vc "o","m")],[(id,"m"),(vc "o","m")],[e "ras"]),+  paradigm_h "pn_o_varenda"           ["varenda"] $+   pn_nagon ([e "",(tk 1,"e")], [(tk 4, "tenda")],[]),+  paradigm_h "pn_o_vardera"           ["vardera"] $+   pn_nagon ([e ""], [(tk 4, "tdera")],[]),+  paradigm_h "pn_o_varannan"          ["varannan"] $+   pn_nagon ([e ""],[(tk 5,"tannat")],[]),+  paradigm_h "pn_o_var"               ["var"] $+   pn_nagon ([e ""],[e "t"],[]),+  paradigm_h "pn_o_samma"             ["samma"] $+   pn_nagon ([e "",(tk 1,"e")],[e ""],[e ""]),+  paradigm_h "pn_o_ni"                ["ni"] $+    pn_jag  (P2,Pl) ([e ""],[(tk 2, "er")],[(tk 2,"er"),(tk 2, "eran")],[(tk 2,"ert"),(tk 2,"erat")],[(tk 2,"era")]),+  paradigm_h "pn_o_jag"               ["jag"] $+    pn_jag  (P1,Sg) ([e ""],[(tk 3, "mig"),(tk 3,"mej")],[(tk 3,"min")],[(tk 3,"mitt")],[(tk 3,"mina")]),+  paradigm_h "pn_o_högstdensamme"     ["högstdensamme"] $+   pn_nagon ([e ""],[(tk 6,"tsamma")],[(tk 6,"samma")]),+  paradigm_h "pn_o_hon"               ["hon"] $+   pn_han (P3,Sg) ([e ""],[(vc "e","ne")],[(tk 2,"ennes")]),+  paradigm_h "pn_o_han"               ["han"] $+   pn_han (P3,Sg) ([e ""], [(vc "o","om")], [e "s"]),+  paradigm_h "pn_o_endera"            ["endera"] $+   pn_nagon ([e ""],[(tk 5,"ttdera")],[]),+  paradigm_h "pn_o_du"                ["du"] $+    pn_jag  (P2,Sg) ([e ""],[(tk 1, "ig"),(tk 1,"ej")],[(tk 1,"in")],[(tk 1,"itt")],[(tk 1,"ina")]),+  paradigm_h "pn_o_densamma"          ["densamma"] $+    pn_nagon ([e "",(tk 1,"e")],[(tk 6,"tsamma")],[(tk 6,"samma")]),+  paradigm_h "pn_o_denna"             ["denna"] $+   pn_nagon ([e "",(tk 1,"e")],[(tk 3,"tta")],[(tk 3,"ssa")]),+  paradigm_h "pn_o_annan"             ["annan"] $+   pn_nagon ([e ""],[(tk 1,"t")],[(tk 3,"dra")]),+  -- paradigm_h "al_o_den"               ["den"]               al_o_den,+  paradigm_h "nn_vu_mixer" ["mixer"]  $         +   noun_f 0 Utr  ([e ""], [e "n"], [(id,""), (dv,"ar"),(id,"s")], [(id,"na"), (dv,"arna"),e "sarna"]),   ++  paradigm_h "nn_vu_latte" ["latte"]  $         +   noun_compound 0 Utr  ([e ""], [e "n"], [e "", (tk 1,"ar"),e "s"], [e "na", (tk 1,"arna"),e "sarna"],[e ""],[e ""]),   ++  paradigm_h "nn_vn_medium" ["medium"]  $     +   noun_compound 0 Neutr  ([e ""], [(tk 2,"et")], [(tk 2,"er"),(tk 2,"a")], [(tk 2,"erna"),(tk 2,"ana")],[(tk 2,"e"),e ""],[(tk 2,"e"),e ""]),++  paradigm_h "nn_ou_bekant" ["bekant"]   $     +    noun Utr [""] ["en"] ["er","a"] ["erna"],++  paradigm_h "nn_on_memorandum" ["memorandum"]  $  +   noun_f 0 Neutr ([e ""], [e "", e "et"], [(tk 2, "a")], [(tk 2,"ana")]),++  paradigm_h "nn_1u_åder" ["åder"]    $       +   noun_compound 0 Utr ([e "",(dv,"a")], [e "n",(dv,"an")], [(dv,"or")], [(dv,"orna")],[e ""],[(dv,"e"), e ""]),++  paradigm_h "nn_1u_gata" ["gata"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(ungeminate.tk 1,""),(ungeminate.tk 1,"u")],[(ungeminate.tk 1,""),(ungeminate.tk 1,"u")]),++  paradigm_h "nn_1u_mamma" ["mamma"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(tk 1,"a")],[(tk 1,"e"),(tk 1,"a")]),++  -- paradigm_h "nn_1u_dagmamma" ["dagmamma"]    $       +  -- noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(tk 1,"e"),(tk 1,"a")],[(tk 1,"e"),(tk 1,"a")]),++  paradigm_h "nn_1u_människa" ["människa"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(ungeminate.tk 1,"o")],[(ungeminate.tk 1,"o")]),++  paradigm_h "nn_1u_kamera" ["kamera"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [e ""],[e ""]),++  paradigm_h "nn_1u_olja" ["olja"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(tk 1, "e")],[(tk 1, "e")]),++  paradigm_h "nn_1u_baksida" ["baksida"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(tk 1, "e"),(tk 1,"es")],[(tk 1, "e"),(tk 1,"es")]),++  paradigm_h "nn_1u_sida" ["sida"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(ungeminate.tk 1, ""),(tk 1,"o")],[(tk 1, "e"),(tk 1,"es")]),++  paradigm_h "nn_1u_folksaga" ["folksaga"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")], [(tk 1, "e"),(tk 1,"o")],[(tk 1, "e"),(tk 1,"o")]),++  paradigm_h "nn_1u_kyrka" ["kyrka"]    $       +   noun_compound 1 Utr ([e "a"], [e "an"], [e "or"], [e "orna"], [(ungeminate,""),e "o"],[(ungeminate,""),e "o",(ds, ""),e "e"]),++  paradigm_h "nn_2u_mening" ["mening"]    $       +   noun_compound 0 Utr ([e ""], [e "en"], [e "ar"], [e "arna"], [(ds, "")],[(ds, "")]),++  paradigm_h "nn_3u_salong" ["salong"]    $       +   noun_compound 0 Utr ([e ""], [e "en"], [e "er"], [e "erna"], [(ds, "")],[(ds, "")]),++  paradigm_h "nn_5n_dike" ["dike"]    $       +   noun_compound 0 Neutr ([e ""], [e "t"], [e "n"], [e "na"], [(ds, "")],[(ds, "")]),++  paradigm_h "nn_5n_hjärta" ["hjärta"]    $       +   noun_compound 0 Neutr ([e ""], [e "t"], [e "n"], [e "na"], [(tk 1, "")],[(tk 1, ""),(ds.tk 1,"")]),++  paradigm_h "nn_5n_saldo" ["saldo"]    $       +   noun_compound 0 Neutr ([e ""], [e "t"], [e "n"], [e "na"], [e ""],[e ""]),++  paradigm_h "nn_6n_departement" ["departement"]    $       +   noun_compound 0 Neutr ([e ""], [e "et"], [e "en"], [e "ena"], [(ds, "")],[(ds, "")]),++  paradigm_h "nn_0u_svenska" ["svenska"]    $       +   noun_compound 0 Utr ([e ""], [e "n"], [], [], [(tk 1,"a"),(tk 1,"")],[(tk 1,"a"),(tk 1,"")]),++  paradigm_h "nn_vu_kart" ["kart"]   $       +   noun Utr [""] ["en"] ["ar",""] ["arna","en"],++  paradigm_h "nn_vn_mirakel" ["mirakel"]   $      +   noun_f 0 Neutr ([e ""], [(dv,"et")], [(id,""),(dv,"er")], +                          [(dv,"en"), (dv,"erna")]),++  paradigm_h "nn_0v_trim" ["trim"]  $  +   noun_f 0 Pend  ([e ""], [(geminate,"en"), (geminate,"et")], [], []),++  paradigm_h "nn_0v_blod" ["blod"]  $  +   noun_compound 0 Pend  ([e ""], [e "en", e "et"], [], [],[e "",(ds,"")],[e "",(ds,"")]),++ paradigm_h "nn_0v_saffran" ["saffran"]  $  +   noun_compound 0 Pend  ([e ""], [e "en", e "et"], [], [],[(ds,"")],[(ds,"")]),++  paradigm_h "nn_0v_gin" ["gin"]  $  +   noun_compound 0 Pend  ([e ""], [e "en", e "et"], [], [],[e ""],[e "",(ds,"")]),++  paradigm_h "nn_0v_tö" ["tö"]  $  +   noun_f 0 Pend  ([e ""], [e "et", e "n", e "t"], [], []),++  paradigm_h "nn_0n_bitumen" ["bitumen"]  $+   noun_f 0 Neutr ([e ""], [(id, ""),(vc "i", "et")], [], []),++  paradigm_h "nn_vn_lexikon" ["lexikon"]  $      +   noun_f 0 Neutr ([e ""], [e "et"], [(id,""),(tk 2,"a")], [e "en"]),++  paradigm_h "nn_2u_slarver" ["slarver"]  $    +   noun_f 0 Utr ([e ""], [e "n"], [(dvu,"ar"),(tk 2,"ar")], [(dvu,"arna"), (tk 2,"arna")]),++  paradigm_h "nn_2u_bräken" ["bräken"]  $    +   noun_f 0 Utr ([e ""], [e "", (dv, "en")], [(dv,"ar")], [(dv,"arna")]),++  paradigm_h "nn_2u_himmel" ["himmel"]  $     +   noun_f 0 Utr ([e ""], [(tk 3,"len"), (id,"en"),(id,"n")], [(tk 3, "lar")], [(tk 3, "larna")]),++  paradigm_h "nn_4n_fängelse" ["fängelse"]  $    +   noun Neutr [""] ["t"] ["r"] ["rna"],++  paradigm_h "nn_2u_dag" ["dag"]  $      +   noun_f 0 Utr ([e ""], [(id,"en"),(tk 1,"n")], [(id,"ar"),(tk 1,"r")], [(id,"arna"),(tk 1,"rna")]),++  paradigm_h "nn_vu_ponny" ["ponny"]  $      +   noun_f 0 Utr ([e ""], [e "n"], [(tk 1, "ier"),(tk 1,"ies"),(id,"er"), e "sar"], [(tk 1,"ierna"), e "erna",(tk 1,"iesarna"), e "sarna"]),++  paradigm_h "nn_vu_kollega" ["kollega"]  $      +   noun_f 0 Utr ([e ""], [e "n"], [(tk 1,"er"),(tk 1,"or")], [(tk 1,"erna"),(tk 1,"orna")]),++  paradigm_h "nn_vn_kolli" ["kolli"]  $       +   noun Neutr [""] ["t"] ["","n"] ["na"],++  paradigm_h "nn_6u_tum" ["tum"]  $        +   noun Utr [""] ["men"] [""] ["men"],++  paradigm_h "nn_6n_universum" ["universum"]  $    +   noun Neutr [""] ["", "et"] [""] ["en"],++  paradigm_h "nn_0n_gluten" ["gluten"]  $ +   noun_compound 0 Neutr ([e ""], [e "et",e ""],[],[],[e ""],[e ""]),++  paradigm_h "nn_vu_yard" ["yard"]  $        +   noun Utr [""] ["en"] ["","s"] ["en","sen"],++  paradigm_h "nn_vu_svan" ["svan"]  $         +   noun Utr [""] ["en"] ["ar","or"] ["arna","orna"],++  paradigm_h "nn_vn_tema" ["tema"]  $          +   noun Neutr [""] ["t"] ["n","ta"] ["na","tana"],++  -- paradigm_h "nn_vn_perfektum" ["perfektum"]  $     +  -- noun_f 0 Neutr ([e ""],[e "et"],[e "", (tk 2,"er")], [e "en",(tk 2,"erna")]),++  paradigm_h "nn_vn_maximum" ["maximum"]  $      +   noun_f 0 Neutr ([e ""], [e "",e "et",(tk 2, "et")], [(id,""),(tk 2,"a")],[(tk 2,"ana"),(id,"en")]),++  paradigm_h "nn_vn_frö" ["frö"]  $         +   noun Neutr [""] ["et","t"] ["er","n"] ["erna","na","en"],++  paradigm_h "nn_3u_materia" ["materia"]  $      +   noun_f 0 Utr ([e ""], [e "n"], [(tk 1,"er")], [(tk 1,"erna")]),++  paradigm_h "nn_0n_delirium" ["delirium"]  $+   noun_f 0 Neutr ([e ""],[(tk 2, "et")],[],[]),++  -- paradigm_h "nn_vv_fossil" ["fossil"]  $+  -- noun Pend [""] ["en","et"] ["er",""] ["erna","en"],++  paradigm_h "nn_vv_libretto" ["libretto"]  $+   noun Pend [""] ["n","t"] ["r","n"] ["rna","na"],++  paradigm_h "nn_vu_safari" ["safari"]  $+   noun Utr [""] ["n"] ["er","s"] ["erna","sarna"],++  paradigm_h "nn_vu_bungalow" ["bungalow"]  $+   noun Utr [""] ["en"] ["er","s"] ["erna"],++   paradigm_h "nn_ip_honoratiores" ["honoratiores"]  $+   noun_no_genitive GPl ([],[],[e ""],[]),++  paradigm_h "nn_7u_lady" ["lady"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 1,"ies")],[(tk 1,"ies"),(tk 1,"iesarna")]),++  paradigm_h "nn_6v_kvitten" ["kvitten"]  $+   noun Pend [""] [""] [""] ["a"],++  paradigm_h "nn_vv_franska" ["franska"]  $+   noun_f 0 Pend ([e ""],[e "n",e "t"],[(id,""),(tk 1,"or")], [e "na",(tk 1,"orna")]),++  paradigm_h "nn_4v_folie" ["folie"]  $+   noun Pend [""] ["n","t"] ["r"] ["rna"],++  paradigm_h "nn_3u_donjuan" ["donjuan"]  $+   noun Utr [""] [""] ["er"] ["erna"],++  paradigm_h "nn_2v_finger" ["finger"]  $+   noun_f 0 Pend ([e ""], [(dv,"et"),(id,"n")], [(dv,"ar")],[(dv,"arna")]),++  paradigm_h "nn_2u_biceps" ["biceps"]  $+   noun Utr [""] ["", "en"] ["ar"] ["arna"],++  paradigm_h "nn_1u_ultima" ["ultima"]  $+   noun_f 0 Utr ([e ""], [e "", e "n"], [(tk 1,"or")], [(tk 1,"orna")]),           ++  paradigm_h "nn_0n_opium" ["opium"]  $+   noun_compound 0 Neutr ([e ""], [(tk 2,"et"),(id,"et")],[],[],[e ""],[e ""]),++  paradigm_h "nn_vv_skogsrå" ["skogsrå"]  $+   noun Pend [""] ["et","t","n"] ["r","n"] ["rna","na"],++  paradigm_h "nn_vv_prisma" ["prisma"]  $+   noun_f 0 Pend ([e ""], [e "n",e "t"], [(tk 1, "or"),(tk 1,"er")], [(tk 1,"orna"),(tk 1,"erna")]),++  paradigm_h "nn_vv_hult" ["hult"]   $+   noun Pend [""] ["et","en"] ["","ar","er"] ["en","arna","erna"],++  paradigm_h "nn_vu_spaniel" ["spaniel"]   $   +   noun Utr [""] ["n"] ["ar","s"] ["arna"],++  paradigm_h "nn_vu_litteraturkanon" ["litteraturkanon"]  $+   noun Utr [""] ["en",""] ["er",""] ["erna"],++  paradigm_h "nn_vu_igloo" ["igloo"]  $+   noun_compound 0 Utr ([e ""], [e "n"], [e "r",e "er",e "s", e "sar"],[e "rna",e "erna",e "sarna"],[e ""],[e ""]),++  paradigm_h "nn_vn_alfa_io" ["i"]  $+   set_pos "nn" . nna Neutr ([e ""],[e "s"], [e "t", e "et"],[e "ts", e "ets"],[e "n", e ""],[e "ns",e "s"],[e "na",e "en"],[e "nas",e "ens"]),++  paradigm_h "nn_6n_deponens" ["deponens"]  $+   noun Neutr [""] [""] [""] ["en"],++  paradigm_h "nn_6n_andeväsen" ["andeväsen"]  $+   noun Neutr [""] ["det"] [""] ["a"],++  paradigm_h "nn_5n_altare" ["altare"]  $+   noun_compound 1 Neutr ([e "e"], [e "et"], [e "en"], [e "na"],[e ""],[e ""]),++  paradigm_h "nn_3u_geranium" ["geranium"]  $+   noun_f 0 Utr ([e ""],[(tk 2,"en")],[(tk 2,"er")],[(tk 2,"erna")]),++  -- paradigm_h "nn_1u_toffel" ["toffel"]  $+  -- noun_compound 0 Utr ([e ""], [e "n"],[(dvu,"or")],[(dvu,"orna")],[e ""],[e ""]),++  paradigm_h "nn_1u_tavla" ["tavla"]  $+   noun_compound 0 Utr ([e ""], [e "n"],[(dv,"or")],[(dv,"orna")],[((\s -> insert_second_last s 'e') . tk 1,"")],[((\s -> insert_second_last s 'e') . tk 1,""),(tk 1,"e")]),++  paradigm_h "nn_1u_stamtavla" ["stamtavla"]  $+   noun_compound 0 Utr ([e ""], [e "n"],[(dv,"or")],[(dv,"orna")],[((\s -> insert_second_last s 'e') . tk 1,""),(tk 1,"e")],[((\s -> insert_second_last s 'e') . tk 1,""),(tk 1,"e")]),++  paradigm_h "nn_0v_dregel" ["dregel"]  $+   noun_compound 0 Pend ([e ""],[(id,"n"), (dvu,"et")], [], [],[e ""],[e ""]),++--  paradigm_h "nn_0u_koppar" ["koppar"]  $+--   noun_compound 0 Utr ([e ""], [e "en", e "n"],[],[],[e ""],[e ""]),++  paradigm_h "nn_vv_paraply" ["paraply"]  $+   noun Pend [""] ["et","t","n"] ["er","n"] ["erna","na"],++  paradigm_h "nn_vv_etage" ["etage"]  $+   noun Pend [""] ["t","n"] ["r",""] ["rna","n"],++  paradigm_h "nn_vv_chiffer" ["chiffer"]  $+   noun_f 0 Pend ([e ""],[(dv,"et"),(id,"n")],[(id,""),(dv,"er")],[(dv,"en"),(dv,"erna")]),++  paradigm_h "nn_vv_bolster" ["bolster"]  $+   noun_f 0 Pend ([e ""],[(dv,"et"),(id,"n")],[(id,""),(dv,"ar")],[(dv,"arna"), (dv,"en"),(id,"na")]),++  paradigm_h "nn_vu_teve" ["teve"]  $+   noun Utr [""] ["n"] ["","ar"] ["na","arna"],++  paradigm_h "nn_vu_rhododendron" ["rhododendron"]  $+   noun_f 0 Utr ([e ""], [e "en"], [e "",(tk 2, "er")], [(tk 2, "erna")]),++  paradigm_h "nn_vu_kofot" ["kofot"]  $+   noun_f 0 Utr ([e ""], [e "en"],[(id,"ar"),(umlaut . geminate,"er")],[(id,"arna"),(umlaut . geminate,"erna")]),++  paradigm_h "nn_vu_jourhavande" ["jourhavande"]  $+   noun Utr [""] ["n"] ["","n"] ["na"],++  paradigm_h "nn_vu_jockey" ["jockey"]  $+   noun_compound 0 Utr ([e ""],[e "n",e "en"],[e "ar",e "er",e "s",e "sar"],[e "arna",e "erna",e "sarna"],[e ""],[e ""]),++  paradigm_h "nn_vu_grej" ["grej"]  $+   noun Utr [""] ["en"] ["er","or"] ["erna","orna"],++  paradigm_h "nn_vu_drive" ["drive"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 1,"ar"),(id,"s")],[(tk 1,"arna")]),++  paradigm_h "nn_vu_cello" ["cello"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(id,"r"),(tk 1,"i")],[(tk 1,"orna")]),++  paradigm_h "nn_vn_trauma" ["trauma"]  $+   noun_f 0 Neutr ([e ""], [e "t"],[(id,"n"),(tk 1,"er")],[e "na",(tk 1,"erna")]),++  paradigm_h "nn_vn_stall" ["stall"]  $+   noun Neutr [""] ["et"] ["","ar"] ["en","arna"],++  paradigm_h "nn_vn_pi" ["pi"]  $+   noun Neutr [""] ["et","t"] ["","n"] ["na","en"],++  paradigm_h "nn_vn_paper" ["paper"]  $+   noun Neutr [""] ["et"] ["s",""] ["en"],++  paradigm_h "nn_vn_panorama" ["panorama"]  $+   noun_f 0 Neutr ([e ""], [e "t"],[(id,"n"),(tk 1,"or")],[e "na",(tk 1,"orna")]),++  paradigm_h "nn_vn_logi" ["logi"]  $+   noun Neutr [""] ["et","t"] ["er","n"] ["erna","na"],++  paradigm_h "nn_ou_medikus" ["medikus"]  $+   noun_f 0 Utr ([e ""], [e "",e "en"],[(tk 3,"ci")], [(tk 3,"cina")]),++  paradigm_h "nn_6v_årder" ["årder"]  $+   noun_f 0 Pend ([e ""],[(dv,"et"),(id,"n")], [e ""],[(dv,"en"),(id,"na")]),++  paradigm_h "nn_6v_hästskosöm" ["hästskosöm"]  $+   noun_f 0 Pend ([e ""], [(geminate,"et"),(geminate,"en")], [e ""], [(geminate,"en")]),++  paradigm_h "nn_6u_bror" ["bror"]   $+   noun_compound 0 Utr ([e ""],[(tk 1,"dern"),(id,"n")], [(umlaut . tk 1, "der")], [(umlaut . tk 1, "derna")],[e "",(ds,"")],[e "",(ds,"")]),++  paradigm_h "nn_6n_pansar" ["pansar"]  $+   noun_compound 0 Neutr ([e ""],[e "et"],[e ""],[e "na",e "en"],[e ""],[e ""]),++  paradigm_h "nn_3n_center" ["center"]  $+   noun_f 0 Neutr ([e ""],[(dv,"et")],[(dv,"er")],[(dv,"erna")]),++  paradigm_h "nn_6n_ankare" ["ankare"]  $+   noun_compound 0 Neutr ([e ""], [e "t"], [e "",e "n"],[(tk 1,"na")],[(tk 1,"")],[(tk 1,"")]),++  paradigm_h "nn_3v_plasma" ["plasma"]  $+   noun_f 0 Pend ([e ""], [e "t", e "n"],[(tk 1,"er")],[(tk 1,"erna")]),++  paradigm_h "nn_3u_papyrus" ["papyrus"]  $+   noun_f 0 Utr ([e ""],[(tk 2,"en"), (id,"en")],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_3n_alluvium" ["alluvium"]  $+   noun_f 0 Neutr ([e ""],[(id,"et"),(tk 2, "et")],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_3n_alkali" ["alkali"]  $+   noun Neutr [""] ["t"] ["er"] ["erna"],++  paradigm_h "nn_3n_gift" ["gift"] $+   noun_compound 0 Neutr ([e ""],[e "et"],[e "er"],[e "erna"],[e ""],[e "",(ds,"")]),++  paradigm_h "nn_3n_histamin" ["histamin"]  $+   noun_compound 0 Neutr ([e ""],[e "et"],[e "er"],[e "erna"],[e ""],[e ""]),++  paradigm_h "nn_3n_portvin" ["portvin"]  $+   noun_compound 0 Neutr ([e ""],[e "et"],[e "er"],[e "erna"],[(ds,"")],[(ds,"")]),++  paradigm_h "nn_3u_tid" ["tid"]  $+   noun_compound 0 Utr ([e ""],[e "en"],[e "er"],[e "erna"],[e "",(ds,"")],[e "",(ds,"")]),++  paradigm_h "nn_2v_skit" ["skit"]  $+   noun Pend [""] ["en","et"] ["ar"] ["arna"],++  paradigm_h "nn_2u_toddy" ["toddy"]  $+   noun_f 0 Utr ([e ""],[e "n"],[e "ar", (tk 1, "ar")],[e "arna", (tk 1,"arna")]),++  paradigm_h "nn_0u_praxis" ["praxis"]  $+   noun Utr [""] ["en",""] [] [],++  paradigm_h "nn_vv_stimulus" ["stimulus"]  $+   noun_f 0 Pend ([e ""], [e "", e "en", e "et"],[(id ,""),(tk 2,"i")], [e "en",(tk 2, "ina")]),++  paradigm_h "nn_vv_rå_gång" ["rå"]  $+   noun Pend [""] ["n","et","t"] ["r"] ["rna"],++  paradigm_h "nn_vv_ringfinger" ["ringfinger"]  $+   noun_f 0 Pend ([e ""],[(dv,"et"),(id,"n")], [(dv,"ar"),(id,"")], [(dv,"arna")]),++  paradigm_h "nn_vv_ordal" ["ordal"]  $+   noun Pend [""] ["et","en"] ["","ier"] ["ierna"],++  paradigm_h "nn_vv_halvankare" ["halvankare"]  $+   noun_f 0 Pend ([e ""], [e "t",e "n"], [e "",e "n"],[(tk 1, "na")]),++  paradigm_h "nn_vu_western" ["western"]  $     +   noun_f 0 Utr ([e ""],[e ""],[e "",e "s"],[e "a"]),++  paradigm_h "nn_vu_torso" ["torso"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 1,"er"),(id,"er"),(id,"r")], [(tk 1,"erna"),(id,"erna"),(id,"rna")]),++  paradigm_h "nn_vu_spång" ["spång"]  $+   noun_f 0 Utr ([e ""], [e "en"],[(id,"ar"),(vc "ä","er")], [(id,"arna"),(vc "ä","erna")]),++  -- paradigm_h "nn_vu_spann" ["spann"]  $+  -- noun_f 0 Utr ([e ""], [e "en"],[(id,"ar"),(vc "ä","er")],[(id,"arna"),(vc "ä", "erna")]),++  paradigm_h "nn_vu_scarf" ["scarf"]  $+   noun_f 0 Utr ([e ""], [e "en"],[(id,"ar"),(tk 1,"ves")],[(id,"arna"),(tk 1,"vesen")]),++  paradigm_h "nn_vu_rubel" ["rubel"]  $+   noun_f 0 Utr ([e ""], [e "n"],[e "",(dvu,"er")],[(dvu,"erna")]),++  paradigm_h "nn_vu_ro" ["ro"]   $+   noun Utr [""] ["n"] ["n","r"] ["na","rna"],++  paradigm_h "nn_vu_promovend" ["promovend"]  $+   noun Utr [""] ["en"] ["er","i"] ["erna","ina"],++  paradigm_h "nn_vu_preses" ["preses"]  $+   noun_f 0 Utr ([e ""], [e ""],[(tk 2, "ides"),(id,"ar")], [e "arna"]),++  paradigm_h "nn_vu_paria" ["paria"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(id,"s"),(tk 1,"or")],[(tk 1,"orna")]),++  paradigm_h "nn_vu_mikron" ["mikron"]  $+   noun Utr [""] ["en"] ["er",""] ["erna","en"],++  paradigm_h "nn_vu_lama" ["lama"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 1,"or"),(id,"er")],[(tk 1,"orna"),(id,"erna")]),++  paradigm_h "nn_vu_glass" ["glass"]  $+   noun Utr [""] ["en"] ["ar","er",""] ["arna","erna"],++  paradigm_h "nn_vu_gladiolus" ["gladiolus"]  $+   noun_f 0 Utr ([e ""], [e "en"],[(id,""),(tk 2,"er"),(id,"ar")], [(tk 2,"erna"),(id,"arna")]),++  paradigm_h "nn_vu_baby" ["baby"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(id,"ar"),(id,"er"),(tk 1,"ies")], [e "arna",e "erna",(tk 1,"iesarna")]),++  paradigm_h "nn_vu_albino" ["albino"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 1,"er"),(id,"s")],[(tk 1,"erna"),(id,"sarna")]),++  paradigm_h "nn_vn_stånd" ["stånd"]  $+   noun_f 0 Neutr ([e ""], [e "et"],[(id,""),(vc "ä","er")],[(id,"en"),(vc "ä","erna")]),++  paradigm_h "nn_vn_solo" ["solo"]  $+   noun_f 0 Neutr ([e ""], [e "t"],[(id,"n"),(tk 1,"i")], [e "na"]),++  paradigm_h "nn_vn_serum" ["serum"]  $+   noun_f 0 Neutr ([e ""], [e "",e "et"],[(id,""),(tk 2,"a")], [(tk 2,"ana"),e "en"]),++  -- paradigm_h "nn_vn_scenario" ["scenario"]  $+  -- noun_f 0 Neutr ([e ""], [e "t"],[(id,"n"),(tk 1,"er")],[(id,"na"),(tk 1,"erna")]),++  paradigm_h "nn_vn_rö" ["rö"]  $+   noun Neutr [""] ["t","et"] ["","n"] ["na"],++  paradigm_h "nn_vn_rekviem" ["rekviem"]  $+   noun_f 0 Neutr ([e ""],[(id,""),(tk 1,"t"),(tk 1,"met")],[(id,""),(tk 1,"r")],[(id,"en"),(tk 1,"rna")]),++  paradigm_h "nn_vn_omen" ["omen"]  $+   noun_f 0 Neutr ([e ""],[(id,"et"),(tk 2,"inet")],[(id,""),(tk 2,"ina")],[(id,"en")]),++  paradigm_h "nn_vn_mineral" ["mineral"]  $+   noun Neutr [""] ["et"] ["er", "ier"] ["erna","ierna"],++  paradigm_h "nn_vn_lim" ["lim"]  $+   noun Neutr [""] ["met"] ["", "mer"] ["men","merna"],++  paradigm_h "nn_vn_kompositum" ["kompositum"]  $+   noun_f 0 Neutr ([e ""],[(id,""),(tk 2,"et")],[(tk 2,"a"), (tk 2,"er")], [(tk 2,"erna")]),++  paradigm_h "nn_vn_ja" ["ja"]  $+   noun Neutr [""] ["et","t"] ["n", ""] ["na"],++  paradigm_h "nn_vn_härad" ["härad"]  $+   noun Neutr [""] ["et"] ["", "er","en"] ["ena","erna"],++  paradigm_h "nn_vn_gag" ["gag"]  $+   (noun Neutr [""] ["et"] ["s", ""] ["sen","en"]),++  paradigm_h "nn_vn_gage" ["gage"]  $+   noun_compound 0 Neutr ([e ""],[e "t"],[e "",e "r"],[e "n",e "rna"],[e ""],[e ""]),++  paradigm_h "nn_vn_apropå" ["apropå"]   $       +   noun Neutr [""] ["t"] ["n","er"] ["na","erna"],++  paradigm_h "nn_vn_alfa_z" ["z"]  $+   set_pos "nn" . nna Neutr ([e ""],[e "s"], [e "t"],[e "ts"],[e "n", e ""],[e "ns",e "s"],[e "na"],[e "nas"]),++  paradigm_h "nn_vn_ackordion" ["ackordion"]  $+   noun_f 0 Neutr ([e ""],[(id,"et"),(tk 2,"et")],[(id,""),(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_ov_styck" ["styck"]  $+   noun_compound 0 Pend ([e "",e "en",e "na"],[e "en",e "et"],[e "", e "en",e "na"],[e "ena"],[e ""],[e ""]),++  paradigm_h "nn_ov_diktamen" ["diktamen"]  $+   noun_f 0 Pend ([e ""], [e ""],[(tk 2,"ina")], [(tk 2,"ina")]),++  paradigm_h "nn_ou_putto" ["putto"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 1,"i")], [(tk 1,"ina")]),++  paradigm_h "nn_ou_penny" ["penny"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(tk 2,"ce"),(tk 1,"ies")], [(tk 2,"cen"),(tk 1,"iesarna")]),++  paradigm_h "nn_ou_mekanikus" ["mekanikus"]  $+   noun_f 0 Utr ([e ""], [e "en"],[(tk 3,"ci")], [(tk 3,"cina")]),++  -- paradigm_h "nn_on_slusshuvud" ["slusshuvud"]  $+  -- noun Neutr [""] ["et"] ["en",""] ["ena"],++  paradigm_h "nn_on_gravamen" ["gravamen"]  $+   noun_f 0 Neutr ([e ""], [e "et"],[(tk 2,"ina")], []),++  paradigm_h "nn_7u_slogan" ["slogan"]  $+   noun Utr [""] ["","en"] ["s"] ["sen"],++  paradigm_h "nn_vu_romkom" ["romkom"]  $+   noun_compound 0 Utr ([e ""],[e "en",e "men"],[e "s", e "mar"],[e "sen",e "marna"],[e ""],[e ""]),++  paradigm_h "nn_vu_tortilla" ["tortilla"]  $+   noun_compound 1 Utr ([e "a"],[e "an"],[e "or", e "as"],[e "orna",e "asen",e "asena",e "asarna"],[e "a"],[e "a"]),++  paradigm_h "nn_7u_cashew" ["cashew"]  $+   noun_compound 0 Utr ([e ""],[e "en",e "n"],[e "s"],[e "sen"],[e ""],[e ""]),++  paradigm_h "nn_7n_skinhead" ["skinhead"]  $+   noun Neutr [""] ["et"] ["s"] ["sen"],++  paradigm_h "nn_6v_modus" ["modus"]  $+   noun Pend [""] ["","et"] [""] ["en"],++  paradigm_h "nn_6v_data" ["data"]  $+   noun_compound 0 Pend ([e ""],[e "n",e "t"],[e ""],[e "na"],[e ""],[e ""]),++  paradigm_h "nn_6u_man" ["man"]   $+   noun_f 0 Utr ([e ""], [e "nen"], [(umlaut,""),(id,""),(id,"nar")],[(umlaut,"nen"),(id,"narna")]),++  paradigm_h "nn_6u_iktus" ["iktus"]  $+   noun Utr [""] ["en", ""] [""] ["en"],++  paradigm_h "nn_6n_interregnum" ["interregnum"]  $+   noun_f 0 Neutr ([e ""], [e "et",e ""], [e ""], [e "en"]),++  paradigm_h "nn_5n_ri" ["ri"]  $+   noun Neutr [""] ["et"] ["n"] ["en","na"],++  paradigm_h "nn_3v_gelé" ["gelé"]  $+   noun_compound 0 Pend ([e ""],[e "n",e "t",e "et"],[e "er"],[e "erna"],[e ""],[e ""]),++  paradigm_h "nn_3u_fotnot" ["fotnot"]  $+   noun_f 0 Utr ([e ""], [e "en"], [(id,"er"),(vc "ö","ter")],[(id,"erna"),(vc "ö","terna")]),++  paradigm_h "nn_3u_farao" ["farao"]  $+   noun Utr [""] ["","n"] ["ner"] ["nerna"],++  paradigm_h "nn_3u_eforus" ["eforus"]  $+   noun_f 0 Utr ([e ""], [e ""],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_3n_seminarium" ["seminarium"]  $+   noun_f 0 Neutr ([e ""], [e "et",(tk 2, "et")],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_3n_futurum" ["futurum"]  $+   noun_f 0 Neutr ([e ""], [e "",e "et"],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_3n_dominion" ["dominion"]  $+   noun_f 0 Neutr ([e ""], [e ""],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_3v_aktivum" ["aktivum"]  $+   noun_f 0 Pend ([(tk 2,""), e ""],[(tk 2,"et"),(tk 2,"en"),(id,"et"),(id,"")],[(tk 2,"er")],[(tk 2,"erna")]),++  paradigm_h "nn_2u_stygger" ["stygger"]  $+   noun_f 0 Utr ([e ""],[(id,"n"),(tk 1,"n")],[(tk 2,"ar")],[(tk 2,"arna")]),++  paradigm_h "nn_2u_förmiddag" ["förmiddag"]  $ +   noun_f 0 Utr ([e ""],[(id,"en"),(tk 1,"n")],[(id,"ar")],[(id,"arna")]),++  paradigm_h "nn_2u_andur" ["andur"]  $+   noun_f 0 Utr ([e ""], [e "en",e "n"],[(dvu,"ar")],[(dvu,"arna")]),++  paradigm_h "nn_1v_antibiotika" ["antibiotika"]  $+   noun_f 0 Pend ([e ""], [e "n",e "t"],[(tk 1,"or")],[(tk 1,"orna")]),++  paradigm_h "nn_0v_status" ["status"]  $+   noun Pend [""] ["","en"] [] [],++  paradigm_h "nn_0v_hysteri" ["hysteri"]  $+   noun Pend [""] ["n","en","et","t"] [] [],++  paradigm_h "nn_0v_facit" ["facit"]  $+   noun_f 0 Pend ([e ""],[e ""],[],[]),++  paradigm_h "nn_0u_makadam" ["makadam"]  $+   noun_f 0 Utr ([e ""], [(geminate,"en"),(id,"en")], [], []),++  paradigm_h "nn_0u_aorta" ["aorta"]  $+   noun Utr [""] ["","n"] [] [],++  paradigm_h "nn_0n_karborundum" ["karborundum"]  $+   noun Neutr [""] ["","et"] [] [],++  paradigm_h "nn_0n_kammarkollegium" ["kammarkollegium"]  $+   noun_f 0 Neutr ([e ""],[e "",(tk 2,"et")],[],[]),++  paradigm_h "nn_0n_gehenna" ["gehenna"]   $+   noun Neutr [""] ["","t"] [] [],++  paradigm_h "nn_2u_bövel" ["bövel"]  $+   noun_f 0 Utr ([e ""],[e "n",e "en"],[(dvu,"ar")],[(dvu,"arna")]),++  paradigm_h "av_0s_ypperst" ["ypperst"]  $ +   adj 0 ([], [], [], [], [], [e ""], [e "a"]), ++  paradigm_h "av_0_korkad"            ["korkad"]         av_0_konstlad,+  paradigm_h "av_1_enkel"             ["enkel"]          av_1_vacker,+  paradigm_h "av_in_lurt"             ["lurt"]          $ +             replace_param [("invar","pos indef sg n nom")] . av_i_diverse,+  paradigm_h "av_id_norra"            ["norra"] $ +             replace_param [("invar","pos def sg no_masc nom")] . av_i_diverse,+  paradigm_h "av_im_bemälde"          ["bemälde"] $+             replace_param [("invar","pos def sg masc nom")] . av_i_diverse,+  paradigm_h "av_ik_smärre"           ["smärre"] +   $ adj 0 ([], [], [], [], [e ""], [], []), +  paradigm_h "avm_io0_diverse"        ["bevänt med"]   $ noc $ avm_i,+  paradigm_h "avm_ix0_diverse"        ["allena saliggörande"]   $ noc $ avm_i,+  paradigm_h "avm_ia0_diverse"        ["före detta"]   $ noc $ avm_i,+  paradigm_h "avm_ip0_diverse"        ["idel öra"]     $ noc $ avm_i,+  paradigm_h "avm_is20_utom_sig"        ["utom sig"]     $ noc $ avm_i,+  -- paradigm_h "av_0_skriftlärd"        ["skriftlärd"]      av_0_konstlad,++  paradigm_h "av_0_höger" ["höger"] +   (adj 2 ([e "er"], [e "er"], [e "ra"], [e "ra"], [], [], [])), ++  -- paradigm_h "av_0_världsbäst" ["världsbäst"]  +  -- (adj 0 ([e ""], [e ""], [e "a"], [e "a"], [], [], [])), ++  paradigm_h "av_0_vareviga" ["vareviga"] +   (adj 0 ([(tk 1, "")], [(tk 5, "teviga")], [], [],[], [], [])), ++  paradigm_h "av_0_sankt" ["sankt"] +   (adj 0 ([e ""], [e ""], [e "a"], [e "a"], [], [], [])), ++  paradigm_h "av_0_pytteliten" ["pytteliten"] +   (adjc 5 ([e "liten"], [e "litet"], [e "lilla"], [e "små"], [], [], [],[e "små"])), ++  -- paradigm_h "av_0_blott" ["blott"]   +  -- (adj 0 ([e ""], [e ""], [e "a"], [e "a"], [], [], [])), ++  paradigm_h "av_0s_innersta" ["innersta"] $ +   (adj 0 ([], [], [], [], [], [e ""], [])), ++  -- paradigm_h "av_0p_samtliga" ["samtliga"] +  -- (adj 0 ([], [], [], [e ""], [], [], [])), ++  paradigm_h "av_0d_nästa" ["nästa"] +   (adj 0 ([], [], [e ""], [], [], [], [])), ++  paradigm_h "av_0d_enda" ["enda"] +   (adj 0 ([], [], [e ""], [], [], [], [])), ++  paradigm_h "av_v_ond" ["ond"]  +   (adj 0 ([e ""],[(tk 1,"t")], [e "a"], [e "a"], [(id,"are"), (tk 3, "värre")], [(id,"ast"), (tk 3, "värst")], [(id,"aste"),(tk 3, "värsta")])), ++  paradigm_h "av_v_god" ["god"] +   (adj 0 ([e ""],[(tk 1,"tt")], [e "a"], [e "a"],[(id,"are"),(tk 3, "bättre")], [(id,"ast"),(tk 3,"bäst")],[(id,"aste"),(tk 3, "bästa")])), ++  paradigm_h "av_2_gammal" ["gammal"] +   (adj 6 ([e "gammal"], [e "gammalt"], [e "gamla"], [e "gamla"], [e "äldre"], [e "äldst"], [e "äldsta"])), ++   paradigm_h "av_2_bra" ["bra"] +   (adj 2 ([e "ra"], [e "ra"], [e "ra"], [e "ra"], [e "ättre"], [e "äst"], [e "ästa"])), ++  paradigm_h "av_v_nära" ["nära"]  +   (adj 1 ([e "a"], [e "a"], [e "a"], [e "a"], [e "mare",e "mre"], [e "mast",e "mst"], [e "masta",e "msta"])), ++  paradigm_h "av_v_förnäm" ["förnäm"] +    (adj 0 ([e ""], [e "t"], [e "a"], [e "a"], [e "are"], [e "st",e "ast"], [e "sta",e "asta"])), ++  paradigm_h "av_v_dålig" ["dålig"] +    (adj 0 ([e ""], [e "t"], [e "a"], [e "a"], [(tk 5,"sämre"), e "are"], [(tk 5,"sämst"),e "ast"], [(tk 5,"sämsta"), e "aste"])), ++  paradigm_h "av_2k_bakre" ["bakre"] +    (adj 2 ([], [], [], [], [e "re"], [e "ersta"], [e "ersta"])), ++  paradigm_h "pn_o_mycken" ["mycken"] $ set_pos "pn" . +     (adj 5 ([e "ycken"], [e "ycket"], [e "yckna"], [e "yckna"], [e "er",e "era"], [e "est"], [e "esta"])), ++  paradigm_h "pn_o_mången" ["mången"] $ set_pos "pn" . +    (adj_no_masc 0 ([e ""], [(tk 2, "t"),(tk 1, "t")], [(tk 2,"a")], [(tk 2,"a")], [(tk 6,"fler"),(tk 6,"flera")], [(tk 6, "flest")], [(tk 6,"flesta")])), ++  paradigm_h "av_2_liten" ["liten"]  +    (adjc 5 ([e "liten"], [e "litet"], [e "lilla"], [e "små"], [e "mindre"], [e "minst"], [e "minsta"],[e "små"])), ++  paradigm_h "av_2_få" ["få"] +    (adj 0 ([e ""], [e ""], [e ""], [e ""],[(umlaut, "rre")], [(umlaut,"rst")], [(umlaut,"rsta")])), ++  paradigm_h "av_1_orange" ["orange"] +    (adj 1 ([e "e"], [e "e", e "t", e "et"], [e "a", e "e", e "ea"], [e "a", e "e", e "ea"], [e "are", e "eare"], [e "ast",e "east"], [e "aste", e "easte"])), ++  paradigm_h "av_1_gratis" ["gratis"] +    (adj 0 ([e ""], [e "", e "t"], [e "", e "a"], [e "", e "a"], [e "are"], [e "ast"], [e "aste"])), ++  paradigm_h "av_1_knall" ["knall"] +    (adj 0 ([e ""], [e ""], [e "a"], [e "a"], [e "are"], [e "ast"], [e "aste"])), ++  paradigm_h "av_1_camp" ["camp"]  +    (adj 0 ([e ""], [e ""], [e "a"], [e "a"], [e "are"], [e "ast"], [e "aste"])), ++  paradigm_h "av_1_beige" ["beige"] +    (adj 0 ([e ""], [e "t"], [e "",e "a"], [e "",e "a"], +            [e "are"], [e "ast"], [e "aste"])), ++  paradigm_h "av_1_ball" ["ball"]  $+    adj 0 ([e ""], [e "",e "t"], [e "a"], [e "a"], [e "are"], [e "ast"], [e "aste"]), ++  paradigm_h "nnm_vv0_libretto" ["allt i allo"]  $+   noc $ +    last_mw "nnm" ((noun Pend [""] ["n","t"] ["r","n"] ["rna","na"])),++ paradigm_h "nnm_vu0_kaffe_latte" ["kaffe latte"]  $+   noc $ +    last_mw "nnm" (noun_compound 0 Utr  ([e ""], [e "n"], [e "", (tk 1,"ar"),e "s", e "r"], [e "na", (tk 1,"arna"),e "sarna", e "rna"],[e ""],[e ""])),++  paradigm_h "nnm_vv0_hult" ["bäst före-datum"]   $+   noc $ last_mw "nnm" (noun Pend [""] ["et","en"] ["","ar","er"] ["en","arna","erna"]),++  paradigm_h "nnm_0v_manna" ["lingua franca"] $+   noc $ last_mw "nnm" (noun_f 0 Pend ([e ""],[e "n", e "t"],[],[])),++  paradigm_h "nnm_du0_stampen" ["gordiska knuten"] $+   noc $ last_mw "nnm" (noun_f 0 Utr ([],[e ""],[],[])),++  paradigm_h "nnm_vu0_mikron" ["grand danois"] $+   noc $ last_mw "nnm" (noun Utr [""] ["en"] ["er",""] ["erna"]),++  paradigm_h "nnm_vu0_trio" ["femme fatale"] $+   noc $ last_mw "nnm" (noun Utr [""] ["n"] ["r","s"] ["rna"]),++  paradigm_h "nnm_vu0_bungalow" ["spin off"] $+   noc $ last_mw "nnm" (noun Utr [""] ["en"] ["er","s"] ["erna","sen"]),++  paradigm_h "nnm_vv0_pain_riche" ["pain riche"] $+   noc $ last_mw "nnm" (noun Pend [""] ["n","t"] ["r",""] ["rna","na"]),++  paradigm_h "nnm_vv0_deja_vu" ["déjá vu"]   $+   noc $ last_mw "nnm" (noun Pend [""] ["n","t"] ["r","n"] ["rna","na"]),++  paradigm_h "nnm_rp0_griller" ["scampi fritti"] $+   noc $ last_mw "nnm" (noun_f 0 GPl ([], [], [e ""], [e "na"])),   ++  paradigm_h "nnm_vn0_alfa_z" ["ettstrukna c"]  $+   noc $ last_mw "nnm" (nna Neutr ([e ""],[e "s"], [e "t"],[e "ts"],[],[],[],[])),++  paradigm_h "nnm_su0_pojke" ["dödens lammunge"] $+   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""], [], [(drop_final_e,"ar")], [])),++  paradigm_h "nnm_su0_tro" ["janssons frestelse"] $+   noc $ last_mw "nnm" (noun Utr [""] ["n"] [] []),++   paradigm_h "nnm_7u0_hit" ["negro spiritual"]  $+   noc $ last_mw "nnm" (noun Utr [""] ["en"] ["s"] ["sen"]),  ++  paradigm_h "nnm_7n0_skinhead" ["practical joke"]  $+   noc $ last_mw "nnm" (noun Neutr [""] ["t"] ["s"] ["sen"]),  ++  paradigm_h "nnm_6u0_yen" ["pol mag"]  $ +   noc $ last_mw "nnm" (noun Utr [""] ["en"] [""] ["en"]),  ++  paradigm_h "nnm_6n0_blad" ["flygande tefat"]  $+   noc $ last_mw "nnm" (noun Neutr [""] ["et"] [""] ["en"]),  ++  paradigm_h "nnm_6n1_blad" ["äss i rockärmen"]  $+   noc $ first_mw "nnm" (noun Neutr [""] ["et"] [""] ["en"]),  ++  paradigm_h "nnm_5n0_ansikte" ["da capo"]  $+   noc $ last_mw "nnm" (noun Neutr [""] ["t"] ["n"] ["na"]),  ++  paradigm_h "nnm_ip0_honoratiores" ["lika goda kålsupare"]  $+   noc $ last_mw "nnm" (noun_no_genitive GPl ([],[],[e ""], [])),  ++  paradigm_h "nnm_3u0_film" ["medicine kandidat"]  $+   noc $ last_mw "nnm" (noun Utr [""] ["en"] ["er"] ["erna"]),  ++  paradigm_h "nnm_3n0_parti" ["12 V-batteri"]  $+   noc $ last_mw "nnm" (noun Neutr [""] ["et"] ["er"] ["erna"]),  ++ paradigm_h "nnm_3u1_film" ["dans på rosor"]  $+   noc $ first_mw "nnm" (noun Utr [""] ["en"] ["er"] ["erna"]),  ++  paradigm_h "nnm_2u0_stol" ["vinst- och förlusträkning"]  $ +   noc $ last_mw "nnm" (noun Utr [""] ["en"] ["ar"] ["arna"]),  ++  paradigm_h "nnm_2u0_dag" ["bäst före-dag"]  $ +   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""], [(id,"en"),(tk 1,"n")], [(id,"ar"),(tk 1,"r")], [(id,"arna"),(tk 1,"rna")])),++  paradigm_h "nnm_2u0_nyckel" ["golden retriever"]  $ +   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "n"], [(dvu,"ar")], [(dvu,"arna")])),  ++  paradigm_h "nnm_rp1_vägnar" ["fjärilar i magen"]  $ +   noc $ first_mw "nnm" (noun_compound 0 GPl ([],[], [e ""], [e "na"],[],[])),  ++  paradigm_h "nnm_1u0_flicka" ["mul- och klövsjuka"]  $ +   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "n"], [(tk 1,"or")], [(tk 1,"orna")])),  ++  paradigm_h "nnm_0u0_hin" ["hin håle"]  $+    noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[], [], [])),  ++  paradigm_h "nnm_0u0_frid" ["rhode islandsås"]  $ +   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "en"], [], [])),  ++  paradigm_h "nnm_np0_ordalag" ["nordiska språk"]  $ +   noc $ last_mw "nnm" (noun_f 0 GPl ([],[], [e ""], [e "en"])),  ++  paradigm_h "nnm_4u0_linje" ["eau de cologne"]  $+   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "n"], [e "r"], [e "rna"])),  ++  paradigm_h "nnm_2u1_stol" ["ulv i fårakläder"]  $ +   noc $ first_mw "nnm" (noun_compound 0 Utr ([e ""],[e "en"], [e "ar"], [e "arna"],[],[])),  ++  paradigm_h "nnm_2u0_pojke" ["vandrande pinne"]  $ +   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "n"], [(drop_final_e,"ar")], [(drop_final_e,"arna")])),  ++  paradigm_h "nnm_rp0_kalla_kårar" ["kalla kårar"]  $+   noc $ last_mw "nnm" (noun_f 0 GPl ([],[], [e ""], [e "na"])),++  paradigm_h "nnm_1u1_flicka" ["fnurra på tråden"]  $ +   noc $ first_mw "nnm" (noun_compound 0 Utr ([e ""],[e "n"], [(tk 1,"or")], [(tk 1,"orna")],[],[])),  +  paradigm_h "nnm_0u0_tro" ["cherry brandy"]  $ +   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "n"], [], [])),++  paradigm_h "nnm_0u0_antimateria" ["idé- och lärdomshistoria"]  $+   noc $ last_mw "nnm" (noun_f 0 Utr ([e ""],[e "n", (tk 1,"en")], [], [])),++  paradigm_h "nnm_in0_vaj" ["berått mod"]  $+   noc $ last_mw "nnm" (noun_no_genitive Neutr ([e ""],[], [], [])),++  paradigm_h "nnm_iu0_vift" ["gilla gång"]  $+   noc $ last_mw "nnm" (noun_no_genitive Utr ([e ""],[], [], [])),++  paradigm_h "nnm_dn0_rubbet" ["rubbet"] $+   noc $ last_mw "nnm" (noun_compound 0 Neutr ([],[e ""], [], [],[],[])),++  paradigm_h "nna_0v_pcb"  ["pcb"]  $ +   nna Pend ([e ""],[e "s"], [e "n", e "en",e "t",e "et"],[e "ns", e "ens",e "ts", e "ets"],[],[],[],[]),++  paradigm_h "nna_vu_dvd"  ["dvd"]  $ +   nnac Utr ([e ""],[e "s"], [e "n"],[e "ns"],[e "ar",e "er"],[e "ars",e "ers"],[e "arna",e "erna"],[e "arnas",e "ernas"]),++  paradigm_h "nna_0n_hk"  ["hk"]  $ +   nna Neutr ([e ""],[e "s"], [],[],[],[],[],[]),++  paradigm_h "nna_0u_jo"  ["jo"]  $ +   nna Utr ([e ""],[e "s"], [],[],[],[],[],[]),++  paradigm_h "nna_vv_dna"  ["dna"]  $ +   nna Pend ([e ""],[e "s"], +             [e "n", e "t"],[e "ns",e "ts"],+             [e "",e "er"],[e "s",e "ers"],+             [e "na",e "erna"],[e "nas",e "ernas"]+            ),+  paradigm_h "nna_6n_kg"   ["kg"]  $ +   nna Neutr ([e ""],[e "s"], [],[], [e ""], [e "s"], [], []),+  paradigm_h "nna_6u_lp"   ["lp"]  $ +   nna Utr ([e ""],[e "s"], [e "n"],[e "ns"],+            [e ""],[e "s"],[e "na"],[e "nas"]),+   paradigm_h "nna_in_ex"   ["ex"]  $ +   nna Neutr ([e ""],[],[],[],[],[],[],[]),+   paradigm_h "nna_6n_ekg"  ["ekg"]  $+   nna Neutr ([e ""],[e "s"], [e "t"],[e "ts"],+            [e "",e "n"],[e "s",e "ns"],[e "na"],[e "nas"]),+  paradigm_h "nna_vn_wc"   ["wc"]  $ +   nna Neutr ([e ""],[e "s"], +             [e "t"],[e "ts"],+             [e "",e "n"],[e "s",e "ns"],+             [e "en",e "na"],[e "ens",e "nas"]+            ),+  paradigm_h "nna_6v_pm"   ["pm"]  $ +   nna Pend ([e ""],[e "s"], +             [e "en", e "et"],[e "ens",e "ets"],+             [e ""],[e "s"],+             [e "na"],[e "nas"]+            ),+  paradigm_h "nna_2u_bh"   ["bh"]  $ +   nna Utr ([e ""],[e "s"], +            [e "en",e "n"],[e "ens", e "ns"],+            [e "ar"],[e "ars"],+            [e "arna"],[e "arnas"]+           ),++  paradigm_h "avm_0p0_gul" ["rangen stridig"]  $ +     noc $ last_mw "avm" $ av_1_blek_ng,+  paradigm_h "avm_0a0_diverse" ["ute efter"] $ +     noc $ last_mw "avm" av_i_diverse,+  paradigm_h "avm_0a0_korkad" ["så kallad"]  $ +     noc $ last_mw "avm" (adj 0 ([e ""], [(tk 1,"t")], [e "e"], [e "e"], [], [], [])),+  paradigm_h "avm_0x0_bred" ["naggande god"]  $ +     noc $ last_mw "avm" (adj 0 ([e ""], [(tk 1,"tt")], [e "e"], [e "e"], [], [], [])),+  paradigm_h "avm_0x0_gul" ["Gudi behaglig"]  $ +     noc $ last_mw "avm" (adj 0 ([e ""], [e "t"], [e "e"], [e "e"], [], [], [])),+  paradigm_h "avm_0x0_korkad" ["fly förbannad"]  $ +     noc $ last_mw "avm" (adj 0 ([e ""], [(tk 1, "t")], [e "e"], [e "e"], [], [], [])),+  paradigm_h "avm_0x0_utbrunnen" ["inte oäven"]  $ +     noc $ last_mw "avm" (adj 0 ([e ""], [(tk 1, "t")], [(tk 1,"e")], [(tk 1, "e")], [], [], [])),++  paradigm_h "avm_0p1_gul" ["hal som en ål"]  $ +     noc $ first_mw "avm" (adj_no_genitive_c 0 ([e ""], [e "t"], [], [], [], [], [],[])),+  paradigm_h "avm_0p1_brydd" ["stadd i"]  $ +     noc $ first_mw "avm" (adj_no_genitive_c 0 ([e ""], [(tk 2,"tt")], [], [], [], [], [],[])),+  paradigm_h "avm_0p0_diverse" ["ute efter"]  $ +     noc $ last_mw "avm" av_i_diverse,+  paradigm_h "avm_1p1_bred" ["glad i"]  $ +     noc $ first_mw "avm" (adj_no_genitive_c 0 ([e ""], [(tk 1,"tt")], [], [], [e "are"], [e "ast"], [e "aste"],[])),++  paradigm_h "avm_1p1_akut" ["fäst vid"]  $ +   noc $ first_mw "avm" (adj_no_genitive_c 0 ([e ""], [e ""], [], [], [e "are"], [e "ast"], [e "aste"],[])),+++  paradigm_h "avm_1x0_akut" ["politiskt korrekt"]  $ +   noc $ last_mw "avm" (adj 0 ([e ""], [e ""], [e "e"], [e "e"], [], [], [])),++  paradigm_h "avm_1x0_gul" ["gudi behaglig"]  $ +   noc $ last_mw "avm" (adj 0 ([e ""], [e "t"], [e "e"], [e "e"], [], [], [])),++  paradigm_h "avm_1p1_gul" ["lös i magen"]  $ +   noc $ first_mw "avm" (adj_no_genitive_c 0 ([e ""], [e ""], [], [], [e "are"], [e "ast"], [e "aste"],[])),++  paradigm_h "al_o_en" ["en"] $ al_o_en,+  paradigm_h "nn_0n_hindi" ["hindi"]  $+   noun_compound 0 Neutr ([e ""], [],[],[],[e ""],[e ""]),+  paradigm_h "nn_0n_kol-14" ["kol-14"] $ +   nn_kol_14,+  paradigm_h "nn_0u_hin" ["hin"]    $+   noun_f 0 Utr ([e ""], [],[],[]),+  paradigm_h "nn_0u_boskap" ["boskap"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[],[],[(ds,"")],[(ds,"")]),++  paradigm_h "nn_0u_brödsäd" ["brödsäd"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[],[],[(ds,""),e "es"],[(ds,""), e "es"]),++  -- paradigm_h "nn_0u_filmjölk" ["filmjölk"]    $+  --  noun_compound 0 Utr ([e ""], [e "en"],[],[],[e "",(ds,"")],[e "", (ds,"")]),++  paradigm_h "nn_0u_månsing" ["månsing"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[],[],[e ""],[e ""]),++  paradigm_h "nn_0u_kärnkraft" ["kärnkraft"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[],[],[e "",(ds,"")],[e "",(ds,"")]),++  paradigm_h "nn_6u_mat" ["mat"]    $+   noun_compound_ng 0 Utr ([e ""], [],[e ""],[],[],[]),++  paradigm_h "nn_0u_mjölk" ["mjölk"]    $+    noun_compound 0 Utr ([e ""], [e "en"],[],[],[e ""],[e "",(ds,"")]),++  paradigm_h "nn_0u_säd" ["säd"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[],[],[e "", e "es"],[e "es",(ds,"")]),++  paradigm_h "nn_2u_sten" ["sten"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[e "ar"],[e "arna"],[e ""],[e "",(ds,"")]),++  paradigm_h "nn_2u_herde" ["herde"]    $+   noun_compound 1 Utr ([e "e"], [e "en"],[e "ar"],[e "arna"],[e "e",e "a"],[e "a",e "e",e "es"]),++  paradigm_h "nn_2u_hjälte" ["hjälte"]    $+   noun_compound 1 Utr ([e "e"], [e "en"],[e "ar"],[e "arna"],[e "e"],[e "e", e "es"]),++  paradigm_h "nn_2u_pojke" ["pojke"]    $+   noun_compound 1 Utr ([e "e"], [e "en"],[e "ar"],[e "arna"],[(ungeminate,"")],[(ds . ungeminate,"")]),++  paradigm_h "nn_2u_ormbunke" ["ormbunke"]    $+   noun_compound 1 Utr ([e "e"], [e "en"],[e "ar"],[e "arna"],[(ungeminate,""),(ds . ungeminate,""),e "e",e "es"],[(ungeminate,""),(ds . ungeminate,""),e "e",e "es"]),++  paradigm_h "nn_2u_ängel" ["ängel"]    $+   noun_compound 0 Utr ([e ""], [e "n"],[(dvu, "ar")],[(dvu,"arna")],[e "",(dv,"a")],[e "",(ds,""),(dv,"a")]),++  paradigm_h "nn_3u_karbid" ["karbid"]    $+   noun_compound 0 Utr ([e ""], [e "en"],[e "er"],[e "erna"],[e ""],[e ""]),++  paradigm_h "nn_ou_deputerad" ["deputerad"]  $ +   noun_f 0 Utr ([e ""], [e "en"],[e "e"],[e "ena"]),+  paradigm_h "nn_6u_yen" ["yen"]    $ +   noun_f 0 Utr ([e ""], [e "en"],[e ""],[e "en"]),+  paradigm_h "nn_vu_bagis" ["bagis"]  $ +   noun_f 0 Utr ([e ""], [e "en"],[e "",e "ar"],[e "en",e "arna"]),+  paradigm_h "nn_vu_order" ["order"]  $+   noun_f 0 Utr ([e ""], [e "n"],[(id,""),(mmr.dv,"ar")],[e "na", (mmr.dv,"arna")]), +  paradigm_h "nn_vu_minut" ["minut"]  $ +   noun_f 0 Utr ([e ""], [e "en"],[e "er",e "rar"],[e "erna",e "rarna"]),+  paradigm_h "av_0_uppsutten" ["uppsutten"] $ +   (adj 2 ([e "en"], [e "et"], [e "na"], [e "na"], [], [], [])), +  paradigm_h "av_0_uppvikt" ["uppvikt"] $ +   (adj 0 ([e ""], [e ""], [e "a"], [e "a"], [], [], [])), +  paradigm_h "av_v_trång" ["trång"] $ +   (adj 0 ([e ""], [e "t"], [e "a"], [e "a"], [(vc "ä","re"),(id,"are")], +           [(vc "ä","st"),(id,"ast")], [(vc "ä","ste"),(id,"aste")])), +  paradigm_h "pnm_x1_inte_ett_dugg" ["inte småpotatis"]  $ pnm_inv,+  paradigm_h "pnm_x1_vad_än" ["vad än"]  $ pnm_inv,+  paradigm_h "pnm_i_ditt_och_datt" ["ditt och datt"]  $ pnm_inv,+  paradigm_h "pnm_o_vem_som_helst" ["vem som helst"]  $ pnm_gen,+  paradigm_h "pnm_o_en_annan" ["en annan"]  $ pnm_gen2,++  paradigm_h "pnm_o_den_här" ["den här"] pnm_o_den_här,++  paradigm_h "nnm_6na_segel" ["kort varsel"] $ noc $ nnm_6na_kort_varsel,+  paradigm_h "nnm_6na_glykemiskt_index" ["glykemiskt index"] $ noc $ nnm_6na_glykemiskt_index,+  paradigm_h "nnm_6ua_gås"   ["oplockad gås"]  $ noc $ nnm_6ua_oplockad_gås,+  paradigm_h "nnm_6ua_kikare" ["svensk mästare"] $ noc $ nnm_6ua_svensk_mästare,+  paradigm_h "nnm_6na_välsmort_munläder" ["välsmort munläder"] $ noc $ nnm_6na_välsmort_munläder,++  paradigm_h "nnm_0ua_god_ton"           ["god ton"]  $ noc $ nnm_0ua_frid,+  paradigm_h "nnm_3ua_fransysk_visit" ["fransysk visit "]  $ noc $ nnm_3ua_film,+  paradigm_h "nnm_3ua_enarmad_bandit" ["enarmad bandit"]  $ noc $ nnm_3ua_enarmad_bandit,+  paradigm_h "nnm_1ua_svart_låda" ["svart låda"]  $ noc $ nnm_1ua_svart_låda,+  paradigm_h "nnm_3ua_rolig_historia" ["rolig historia"]  $ noc $ nnm_3ua_rolig_historia,+  paradigm_h "nnm_2ua_pojke" ["finsk pinne"] $ noc $ nnm_2ua_pojke,+  paradigm_h "nnm_2ua_naken_blankning" ["naken blankning"] $ noc $ nnm_2ua_naken_blankning,+  paradigm_h "nnm_dpc_göranden_och_låtanden" ["göranden och låtanden"]  $ noc $ nnm_5pc_göranden_och_låtanden,+  paradigm_h "nnm_0n0_fait_accompli" ["fait accompli"] $+    noc $ last_mw "nnm" (noun_f 0 Neutr ([e ""], [],[],[])),+  paradigm_h "nnm_0na_syre"     ["fritt vivre"]     $ noc $ nnm_0na_fritt_vivre,+  paradigm_h "nnm_2ua_stol"            ["varm korv"]       $ noc $ nnm_2ua_stol,+  paradigm_h "nnm_npc_kreti_och_pleti" ["kreti och pleti"] $ noc $ nnm_gpc_kreti_och_pleti,+  paradigm_h "ava_i_kungl"         ["Kungl."]        $ invar "ava",+  paradigm_h "vba_ia_jfr"          ["jfr"]           $ invar "vba",+  paradigm_h "ppa_i_pga"           ["pga"]           $ invar "ppa",+  paradigm_h "ppm_i_a_la"          ["a la"]          $ noc $ invar "ppm",+  paradigm_h "ppm_x1_för_skull"    ["för vidkommande"] $ noc $ invar "ppm",+  paradigm_h "kna_i_o"             ["o"]             $ invar "kna",+  paradigm_h "snm_i_efter_det_att" ["efter det att"] $ noc $ invar "snm",+  paradigm_h "ssm_d2_svinhugg_går_igen" ["svinhugg går igen"] $ noc $ invar "ssm",+  paradigm_h "ssm_i1_märk_väl"          ["märk väl"]          $ noc $ invar "ssm",+  paradigm_h "ssm_d2_saken_är_biff"     ["saken är biff"]     $ noc $ invar "ssm",+  paradigm_h "nlm_gi_tusen_sinom_tusen" ["tusen sinom tusen"] $ noc $ invar "nlm"+ ]++sal :: [(String, [String], [String] -> Entry)]+sal =+ [+  paradigm_h "mxc_i_dygnetrunt"   ["dygnetrunt"]      (set_pos "mxc" . compound),+  paradigm_h "sxc_i_justitie"      ["justitie"]        compound,+  paradigm_h "ab_1_fort"          ["fort"]            ab_1_fort,+  paradigm_h "ab_i_bort"          ["bort"]            ab_bort,++  paradigm_h "ab_i_aldrig"        ["aldrig"]          ab_i_aldrig,+  paradigm_h "ab_is_främst"       ["främst"]          ab_främst,++  paradigm_h "aba_i_dvs"          ["dvs"]             aba_i_dvs,+  paradigm_h "abm_i_till_exempel" ["till exempel"]    abm_i_till_exempel,+  paradigm_h "abm_u2_bakom_någons_rygg" ["bakom någons rygg"]    abm_i_till_exempel,+  paradigm_h "abm_x1_var_än"      ["hur än"]         abm_i_till_exempel,+  paradigm_h "av_0_lastgammal"    ["lastgammal"]      av_0_lastgammal,+  paradigm_h "av_0_medelstor"     ["medelstor"]       av_0_medelstor,+  paradigm_h "av_1_akut"          ["akut"]            av_1_akut,+  paradigm_h "av_1_blå"           ["blå"]   $+   (adj 0 ([e ""], [e "tt"], [e "a",e ""], [e "a",e ""], [e "are"], [e "ast"], [e "aste"])), ++  paradigm_h "av_1_bred"          ["bred"]            av_1_glad,+  paradigm_h "av_1_brydd"         ["brydd"]           av_1_högljudd,+  -- paradigm_h "av_1_grann"         ["grann"]           av_1_tunn,+  paradigm_h "av_1_gul"           ["gul"]             av_1_blek,        +  paradigm_h "av_1_lat"           ["lat"]             av_1_lat,+  paradigm_h "av_1_ny"            ["ny"]              av_1_fri,+  paradigm_h "av_1_rund"          ["rund"]            av_1_hård,+  paradigm_h "av_1_stum"          ["stum"]            av_1_ensam,+  paradigm_h "av_1_utbrunnen"     ["utbrunnen"]       av_1_angelägen,+  paradigm_h "av_i_diverse"       ["diverse"]         av_i_diverse,+  paradigm_h "in_i_aj"            ["aj"]              interj,+  paradigm_h "inm_i_aja_baja"     ["aja baja"]        interjm,+  paradigm_h "kn_i_och"           ["och"]             conj,+  paradigm_h "knm_x_ju_ju" ["både och"] $ set_pos "knm" . conj,+  +  paradigm_h "nl_g_halvannan"     ["halvannan"] $+   number ([e ""],[(tk 5,"tannat")],[],[],[e ""]),+  paradigm_h "nl_g_tu"            ["tu"] $+   number ([e ""],[e ""],[],[],[e ""]),+  paradigm_h "nl_g_tvenne"            ["tvenne"] $+   number ([e ""],[e ""],[],[],[]),+  paradigm_h "nl_i_i"             ["i"] $+   number_ng ([e ""],[e ""],[],[],[]),+  paradigm_h "nl_n_1"             ["1"] nl_n_1, +  paradigm_h "nl_n_elva"          ["elva"] $+   number ([e ""],[e ""],[(tk 2, "fte")],[(tk 2, "fte")],[e "",(tk 2, "fte")]),+  paradigm_h "nl_n_en"            ["en"] $+   number ([e ""],[(tk 1, "tt")],[(tk 2, "första")],[(tk 2, "förste")],[e "", (tk 1, "tt"),(tk 2, "första"),(tk 2, "förste")]),+  paradigm_h "nl_n_fem"           ["fem"] $+   number ([e ""],[e ""],[e "te"],[e "te"],[e "",e "te"]),+  paradigm_h "nl_n_fyra"          ["fyra"] $+   number ([e ""],[e ""],[(tk 3, "järde")],[(tk 3,"järde")],[e "",(tk 3,"järde")]),+  paradigm_h "nl_n_hundra"        ["hundra"] $+   number ([e ""],[e ""],[e "de"],[e "de"],[e "",e "de"]),+  paradigm_h "nl_n_sex"           ["sex"] $+    number ([e ""],[e ""],[(tk 2, "jätte")],[(tk 2,"jätte")],[e "", (tk 2,"jätte")]),+  paradigm_h "nl_n_tio"           ["tio"] $+   number ([e ""],[e ""],[e "nde"],[e "nde"],[e "", e "nde"]),+  paradigm_h "nl_n_tolv"          ["tolv"] $+   number ([e ""],[e ""],[(tk 1, "fte")],[(tk 1, "fte")],[e "", (tk 1,"fte")]),+  paradigm_h "nl_n_tre"           ["tre"] $+   number ([e ""],[e ""],[e "dje"],[e "dje"],[e "", e "dje"]),+  paradigm_h "nl_n_två"           ["två"] $+   number ([e ""],[e ""],[(tk 3, "andra")],[(tk 3, "andre")],[e "",(tk 3, "andra"),(tk 3,"andre")]),+  paradigm_h "nl_n_åtta"          ["åtta"] $+   number ([e ""],[e ""],[(tk 1, "onde")],[(tk 1, "onde")],[e "",(tk 1, "onde")]),+  paradigm_h "nn_0u_tro"          ["tro"] $+   noun_compound 0 Utr ([e ""], [e "n"], [], [],[(ds,"")],[(ds,"")]),  +  paradigm_h "nn_0u_radar" ["radar"] $+   noun_compound 0 Utr ([e ""], [e "n"], [], [],[e ""],[e ""]),  ++  paradigm_h "nn_0u_hemsjuka" ["hemsjuka"] $+   noun_compound 0 Utr ([e ""], [e "n"], [], [],[(tk 1, "e"),(ds,"")],[(tk 1,"e"),(ds,"")]),++  paradigm_h "nn_1u_skyltdocka" ["skyltdocka"] $+   noun_compound 1 Utr ([e "a"], [e "an"], [e "or"], [e "orna"],[e "",e "e",(ds,"")],[e "",e "e",(ds,"")]),++  paradigm_h "nn_0u_saltsyra" ["saltsyra"] $+   noun_compound 0 Utr ([e ""], [e "n"], [], [],[(tk 1, "e"),e ""],[(tk 1,"e"),e ""]),+  +  paradigm_h "nn_1u_aminosyra" ["aminosyra"] $+   noun_compound 0 Utr ([e ""], [e "n"], [(tk 1,"or")], [(tk 1,"orna")],[(tk 1, "e"),e ""],[(tk 1,"e"),e ""]),++  paradigm_h "nn_0u_tjockolja" ["tjockolja"] $+   noun_compound 0 Utr ([e ""], [e "n"], [], [],[(tk 1, "e")],[(tk 1,"e")]),++  paradigm_h "nn_0n_babbel"       ["babbel"] $+   noun_compound 0 Neutr ([e ""], [(dvu,"et")], [], [],[e ""],[e ""]),  +   paradigm_h "nn_0n_cesium"       ["cesium"] $+   noun_compound 0 Neutr ([e ""], [(tk 2,"et"),e "et", e ""], [], [],[e ""],[e ""]),  +  paradigm_h "nn_0n_dalt"         ["dalt"] $+   noun_compound 0 Neutr ([e ""], [e "et"], [], [],[e ""],[e "", (ds, "")]),+  paradigm_h "nn_0n_koksalt" ["koksalt"] $+   noun_compound 0 Neutr ([e ""], [e "et"], [], [],[e "",(ds,"")],[e "",(ds,"")]),++  -- paradigm_h "nn_0n_landt" ["land"] $+  -- noun_compound 0 Neutr ([e ""], [e "et"], [], [],[(tk 1, "t")],[(tk 1, "t")]),++  paradigm_h "nn_0n_latin" ["latin"] $+   noun_compound 0 Neutr ([e ""], [e "et"], [], [],[e ""],[e ""]),++  paradigm_h "nn_0n_ansvar" ["ansvar"] $+   noun_compound 0 Neutr ([e ""], [e "et"], [], [],[(ds,"")],[(ds, "")]),++  paradigm_h "nn_0u_hälsa" ["hälsa"] $+   noun_compound 0 Utr ([e ""], [e "n"], [], [],[(tk 1, "o")],[(tk 1, "o"), (tk 1,"e")]),++  paradigm_h "nn_0n_oväsen" ["oväsen"] nn_0n_oväsen,+  paradigm_h "nn_0n_toapapper" ["toapapper"] $+   noun_f 0 Neutr ([e ""],[(dv, "et"),e "et"], [], []),  +  paradigm_h "nn_0n_raseri"       ["raseri"] $+   noun_compound 0 Neutr ([e ""],[e "et", e "t"], [], [],[e ""],[e ""]),  +  paradigm_h "nn_0n_skum"         ["skum"]          nn_0n_skum,+  paradigm_h "nn_0n_syre"         ["syre"]          nn_0n_kaffe,+  paradigm_h "nn_0u_akribi"       ["akribi"] $+ noun_compound 0 Utr ([e ""],[e "n", e "en"], [], [],[e ""],[e ""]),  +  paradigm_h "nn_0u_antimateria"  ["antimateria"] $+   noun_f 0 Utr ([e ""], [e "n",(tk 1, "en")], [], []),  +  paradigm_h "nn_0u_samverkan"    ["samverkan"]   $+   noun_compound 0 Utr ([e ""], [e ""], [], [],[(ds, "")],[(ds,"")]),++  paradigm_h "nn_0u_skam"         ["skam"]          nn_0u_skam,+  paradigm_h "nn_0v_bikarbonat"   ["bikarbonat"] $+   noun_compound 0 Pend ([e ""], [e "en", e "et"], [], [],[e ""],[e ""]),+  paradigm_h "nn_0v_manna"        ["manna"]         nn_0v_manna,+  paradigm_h "nn_1u_ros"          ["ros"] $+   noun_compound 0 Utr ([e ""], [e "en"], [e "or"], [e "orna"], [e ""], [(ds,"")]),   +  paradigm_h "nn_2u_afton"        ["afton"] $+   noun_compound 0 Utr ([e ""], [e "en"], [(dv, "ar")], [(dv, "arna")],[e ""],[e "", (ds,"")]),   +  paradigm_h "nn_2u_bro"          ["bro"]           nn2,+  paradigm_h "nn_2u_dotter"       ["dotter"]          nn2_dotter,+  paradigm_h "nn_2u_fordran"      ["fordran"] $+   noun_compound 0 Utr ([e ""], [e ""], [(tk 2, "ingar")], [(tk 2, "ingarna")],[(ds,"")],[(ds,"")]),   +  paradigm_h "nn_2u_bokanmälan"   ["bokanmälan"] $+   noun_compound 0 Utr ([e ""], [e ""], [(tk 2, "ningar")], [(tk 2, "ningarna")],[(ds,"")],[(ds,"")]),   +  paradigm_h "nn_2u_fröken"       ["fröken"]          nn2_öken,+  paradigm_h "nn_2u_karl"         ["karl"]  $+   noun_f 0 Utr ([e ""], [e "n",e "en"], [e "ar"], [e "arna"]),  +  paradigm_h "nn_2u_mor"        ["mor"] nn2_moder,+  paradigm_h "nn_2u_morgon"       ["morgon"] $+   noun_f 0 Utr ([e ""], [e "en"], [(dv,"ar"),(tk 3,"nar")], [(dv,"arna"),(tk 3,"narna")]),  +  paradigm_h "nn_2u_mun"          ["mun"]             nn2_kam,+  paradigm_h "nn_3n_land"         ["land"] $+   noun_compound 0 Neutr ([e ""], [e "et"], [(vc "ä", "er")], [(vc "ä", "erna")],[(ds,"")],[(ds,"")]),   +  paradigm_h "nn_3n_stadium"       ["stadium"] $+             let f s = if (last s) == 'e' then s++"i" else s++"e" in+             noun_compound 2 Neutr ([e "um"], [e "et"], [e  "er"], [e "erna"],[(f,"")],[(f,"")]),+--         nn3_museum,+  paradigm_h "nn_3u_bok"          ["bok"]             nn3_bok,+  paradigm_h "nn_3u_fot"          ["fot"]             nn3_fot,+  paradigm_h "nn_3u_bockfot"      ["bockfot"]         nn3_bockfot,+  paradigm_h "nn_3u_historia"     ["historia"] $+   noun_f 0 Utr ([e ""], [(tk 1,"en"),e "n"], [(tk 1, "er")], [(tk 1 ,"erna")]),  +  paradigm_h "nn_3u_kavaljer"     ["kavaljer"]  $+   noun_compound 0 Utr ([e ""], [e "en", e "n"], [e "er"], [e "erna"],[e ""],[e "",(ds,"")]),  +  paradigm_h "nn_3u_motor"        ["motor"] $+   noun_compound 0 Utr ([e ""], [e "n"], [e "er"], [e "erna"],[e ""],[e ""]),  +  paradigm_h "nn_3u_son"          ["son"] $+   (noun_f 0 Utr ([e ""], [e "en"], [(vc "ö","er")], [(vc "ö","erna")])),  +  paradigm_h "nn_3u_stad"         ["stad"] $+   (noun_compound 0 Utr ([e ""], [e "en",(tk 1,"n")], [(vc "ä","er")], [(vc "ä","erna")],[(ds,"")],[(ds,"")])),  +  paradigm_h "nn_3u_tång"         ["tång"] $+   (noun_f 0 Utr ([e ""], [e "en"], [(vc "ä","er")], [(vc "ä","erna")])),  +  paradigm_h "nn_3u_vän"          ["vän"]             nn3_vän,+  paradigm_h "nn_3v_flanell"      ["flanell"]         nn3_flanell,+  paradigm_h "nn_4u_bonde"        ["bonde"]           nn4_bonde,+  paradigm_h "nn_5n_ansikte"      ["ansikte"] $+   noun_compound 0 Neutr ([e ""], [e "t"], [e "n"], [e "na"],[(ds_drop, "")],[(ds_drop,"")]),   +  paradigm_h "nn_5n_bo"           ["bo"] $+   (noun_f 0 Neutr ([e ""], [e "t", e "et"], [e "n"], [e "en",e "na"])), +  paradigm_h "nn_5v_libido"           ["libido"] $+   noun_compound 0 Pend ([e ""], [e "n", e "t"], [e "n"], [e "na"],[e ""],[e ""]),   +  paradigm_h "nn_5u_anhållan"      ["anhållan"]         nn5_anmodan,+  paradigm_h "nn_6n_aber"         ["aber"] $+   (noun_f 0 Neutr ([e ""], [e "", (dv,"et"), e "et"], [e ""], [(dv, "en"),e "en"])),  +  paradigm_h "nn_6n_blad"         ["blad"] $+    noun_compound 0 Neutr ([e ""], [e "et"], [e ""], [e "en"],[e ""],[e "", (ds,"")]),   +  paradigm_h "nn_6n_system"         ["system"] $+    noun_compound 0 Neutr ([e ""], [e "et"], [e ""], [e "en"],[e ""],[e ""]),   +  paradigm_h "nn_6n_bord"         ["bord"] $+    noun_compound 0 Neutr ([e ""], [e "et"], [e ""], [e "en"],[e "",(ds,"")],[e "", (ds,"")]),   +  paradigm_h "nn_6n_foder"        ["foder"] $+    noun_compound 0 Neutr ([e ""], [(dvu, "et")], [e ""], [(dvu,"en"),e "na"],[e ""],[e ""]),   +  paradigm_h "nn_6n_frx"          ["f"]  $+     set_pos "nn" . nna Neutr ([e ""],[e "s"], [e "et"],[e "ets"],[e ""],[e "s"],[e "en"],[e "ens"]),+  paradigm_h "nn_6n_papper"       ["papper"] $+   (noun_compound 0 Neutr ([e ""], [(id,"et"),(dv,"et")], [(id,"")], [e "en", e "na", (dv,"en")],[e ""],[(ds,"")])),  +  paradigm_h "nn_6n_rum"          ["rum"]  $  +             noun_compound 0 Neutr ([e ""], [(geminate,"et")], [e ""], [(geminate,"en")],[(ds,"")],[(ds, "")]),  +  paradigm_h "nn_6n_program"     ["program"]  $  +             noun_compound 0 Neutr ([e ""], [(geminate, "et")], [e ""], [(geminate,"en")],[e ""],[e  ""]),  +-- nn6_program,+++  paradigm_h "nn_6n_träd"         ["träd"] $+   (noun_f 0 Neutr ([e ""], [e "et"], [(id,""),(tk 1, "n")], [(id,"en"),(tk 1, "na")])),  +  paradigm_h "nn_6u_akademiker"   ["akademiker"]      nn6_akademiker,+  paradigm_h "nn_6u_vapenbroder" ["vapenbroder"]          nn_6u_broder,+  paradigm_h "nn_6u_anfader"        ["anfader"] $+   (noun_compound 0 Utr ([e ""], [e "n"], [(vc "ä" . tk 2, "er")],[(vc "ä" . tk 2,"erna")],[e "",(ds,"")],[e "",(ds,"")])),  +  paradigm_h "nn_6u_far"        ["far"] $+   (noun_compound 0 Utr ([e "",(tk 1,"der")], [(tk 1, "dern")], [(vc "ä" . tk 1, "der")],[(vc "ä" . tk 1,"derna")],[e "",(ds,""),(tk 1,"der"),(ds.tk 1,"der")],[e "",(ds,""),(tk 1,"der"),(ds.tk 1,"der")])),  +  paradigm_h "nn_6u_kammare"      ["kammare"] $+   (noun_compound 0 Utr ([e ""], [e "n"], [(tk 4,"rar"),(id,"")], [(tk 4,"rarna")],[(tk 1,"")],[(tk 1,"")])),  +  paradigm_h "nn_6u_kikare"       ["kikare"]  $+   noun_compound 0 Utr ([e ""], [e "n"], [e ""], [(tk 1, "na")],[(tk 1, "")],[(tk 1,"")]),   +  paradigm_h "nn_6u_mus"          ["mus"]             nn_6u_mus,+  paradigm_h "nn_6u_vaktman"      ["vaktman"]         nn_6u_vaktman,+  paradigm_h "nn_6v_borst"        ["borst"]           nn_6v_borst,+  paradigm_h "nn_7u_hit"          ["hit"] $+   noun_f 0 Utr ([e ""], [e "en"], [e "s"],[e "sen", e "sarna"]),  +  paradigm_h "nn_7u_ranger"      ["ranger"] $+   (noun_f 0 Utr ([e ""], [e "n"], [e "s"], [e "sen", e "sarna"])),  +  paradigm_h "nn_in_vaj"          ["vaj"]             nn_in_vaj,+  paradigm_h "nn_iu_vank"         ["vank"]            nn_iu_avvaktan,+  paradigm_h "nn_iv_hum"          ["hum"]             nn_iv_hum,+  paradigm_h "nn_on_öga"          ["öga"]       +   (noun_compound 0 Neutr ([e ""], [e "t"], [(tk 1,"on")], [(tk 1,"onen")],[(tk 1,"on")],[(tk 1,"on")])),  +  paradigm_h "nn_ou_officer"      ["officer"]         nn_ou_officer,+  paradigm_h "nn_vn_alfa_abc"     ["a"]  $+   replace_attr wp_attr w_attr . replace_attr h_attr w_attr . nn_vn_alfa_abc,+  paradigm_h "nn_vn_garn"         ["garn"]            nn_vn_garn,+  paradigm_h "nn_vn_huvud"        ["huvud"]           nn_vn_huvud,+  paradigm_h "nn_vn_kvantum"      ["kvantum"] $+   noun_f 0 Neutr  ([e ""], [e "et", e ""], [(tk 2,"a"),e ""], [(tk 2,"ana"),e "en"]), +  paradigm_h "nn_vn_spektrum"     ["spektrum"]        nn_vn_spektrum,+  paradigm_h "nn_vu_blinker"      ["blinker"]         nn_vu_blinker,+  paradigm_h "nn_vu_cyklamen"     ["cyklamen"] $+   noun_f 0 Utr  ([e ""], [e ""], [(id,""), (tk 2,"er")], [(id,"a"),(tk 2,"erna")]),   +  paradigm_h "nn_vu_dress"        ["dress"]           nn_vu_dress,+  paradigm_h "nn_vu_hambo"        ["hambo"]           nn_vu_hambo,+  paradigm_h "nn_vu_kaliber"      ["kaliber"]         nn_vu_kaliber,+  paradigm_h "nn_vu_playboy"      ["playboy"]         nn_vu_playboy,+  paradigm_h "nn_vu_trio"         ["trio"]            nn_vu_trio,+  paradigm_h "nn_vv_borr"         ["borr"]            nn_vv_borr,+  paradigm_h "nn_vv_test"         ["test"]            nn_vv_test,+  paradigm_h "nna_iu_dr"          ["dr"] $+   nna Utr ([e ""],[],[],[],[],[],[],[]),+  paradigm_h "nna_iv_nxn"         ["log4/log3"] $+   nna Pend ([e ""],[],[],[],[],[],[],[]),+  paradigm_h "nna_6u_m"           ["m"] $+   nna Utr ([e ""],[e "s"], [e "en"],[e "ens"], [e ""],[e "s"],[e "en"],[e "ens"]),+  paradigm_h "pm_fph_alice"       ["Alice"]           $ pm_f_alice "ph",+  paradigm_h "pm_fph_karin"       ["Karin"]           $ pm_f "ph",+  paradigm_h "pm_fph_lisa"        ["lisa"]            $ +   set_inhs ["f","ph"] . set_pos "pm" . noun_f 1 Utr  ([e "a"], [e "an"], [e "or"], [e "orna"]),   +  paradigm_h "pm_fpm_idun"        ["Idun"]            $ pm_f "pm",+  paradigm_h "pm_hph_berg"        ["Berg"]            $ pm_h "ph",+  paradigm_h "pm_hph_svensson"    ["Svensson"]        $ +   set_inhs ["h","ph"] . set_pos "pm" . noun_f 0 Utr  ([e ""], [e "en"], [(umlaut, "er")], [(umlaut,"erna")]),   +  paradigm_h "pm_mph_ansgar"      ["Ansgar"]          $ pm_m "ph",+  paradigm_h "pm_mph_bo"          ["Bo"]              $ pm_m "ph",+  paradigm_h "pm_mph_lars"        ["Lars"]            $ +   set_inhs ["m","ph"] . set_pos "pm" . noun_f 0 Utr  ([e ""], [e ""], [e "ar"], [e "arna"]),   +  paradigm_h "pm_mph_sture"       ["Sture"]           $ +   set_inhs ["m","ph"] . set_pos "pm" . noun_f 0 Utr  ([e ""], [e ""], [(dv,"ar")], [(dv,"arna")]),   +  paradigm_h "pm_mpm_oden"        ["Oden"]            $ pm_m "pm",+  paradigm_h "pm_nlf_kreml"       ["Kreml"]           $ pm_n "lf",+  paradigm_h "pm_nlg_delhi"       ["Delhi"]           $ pm_n "lg",+  paradigm_h "pm_nlg_eurasien"    ["Eurasien"]        $ pm_n "lg",+  paradigm_h "pm_nlg_göteborg"    ["Göteborg"]        $ pm_n "lg",+  paradigm_h "pm_nlp_bender"      ["Bender"]          $ pm_n "lp",+  paradigm_h "pm_nlp_sverige"     ["Sverige"]         $ pm_n "lp",+  paradigm_h "pm_nog_volvo"       ["Volvo"]           $ pm_n "og",+  paradigm_h "pm_nop_centern"     ["Centern"]         $ pm_n "op",+  paradigm_h "pm_plg_alperna"     ["Alperna"]         $ pm_p "lg",+  paradigm_h "pm_uag_saab"        ["Saab"]            $ pm_u "ag",+  paradigm_h "pm_ula_månen"       ["Månen"]           $ pm_u "la",+  paradigm_h "pm_ulg_fyris"       ["Fyris"]           $ pm_u "lg",+  paradigm_h "pm_uwb_hemsöborna"  ["Hemsöborna"]      $ pm_u "wb",+  paradigm_h "pm_uwc_faust"                   ["Faust"]           $ pm_u "wc",+  paradigm_h "pm_uwn_aftonbladet"             ["Aftonbladet"]     $ pm_u "wn",+  paradigm_h "pm_vlf_globen"                  ["Globen"]          $ pm_v "lf",+  paradigm_h "pma_nog_fn"                     ["FN"]                    $ pma_n "og",+  paradigm_h "pma_nop_cuf"                    ["CUF"]                   $ pma_n "op",+  paradigm_h "pmm_h0ph_de_saussure"           ["de Saussure"]           $ noc $ pmm_h "ph",+  paradigm_h "pmm_m0ph_bo_ek"                 ["Bo Ek"]                 $ noc $ pmm_m "ph",+  paradigm_h "pmm_n0lg_new_delhi"             ["New Delhi"]             $ noc $ pmm_n "lg",+  paradigm_h "pmm_n0lg_svarta_havet"          ["Svarta havet"]          $ pmm_n "lg",+  paradigm_h "pmm_n0lp_sri_lanka"             ["Sri Lanka"]             $ pmm_n "lp",+  paradigm_h "pmm_n0oe_göteborgs_universitet" ["Göteborgs universitet"] $ pmm_n "oe",+  paradigm_h "pmm_n0og_nordiska_rådet"        ["Nordiska rådet"]        $ pmm_n "og",+  paradigm_h "pmm_u0lg_torne_älv"             ["Torne älv"]             $ pmm_u "lg",+  paradigm_h "pmm_u0wb_det_går_an"            ["Quo vadis?"]            $ pmm_u "wb",+  paradigm_h "pmm_n0wm_ring_p1"               ["Ring P1"]           $ pmam_n "wm",+  paradigm_h "pmm_u0ec_alla_hjärtans_dag"     ["Alla hjärtans dag"] $ pmm_u "ec",+  paradigm_h "pmm_u0og_svenska_akademien"     ["Svenska Akademien"] $ pmm_u "og",+  paradigm_h "pp_i_i"                         ["i"]                   prep,+  -- vbm_paradigm "vbm_1ai1_laga" ["tappa sugen"],++  vbm_paradigm "vbm_2ad1_viga" ["höja till skyarna"],     ++  vbm_paradigm "vbm_1ad1_laga" ["jämna med marken"],     +  vbm_paradigm "vbm_2md1_hyra" ["föra bakom ljuset"],     +  vbm_paradigm "vbm_2msl1_lägga" ["lägga sig platt"],     +  vbm_paradigm "vbm_4ad1_rida" ["skrida till verket"],     +  vbm_paradigm "vbm_4ma1_komma" ["komma undan"],     +  vbm_paradigm "vbm_4mds1_dra" ["dra öronen åt sig"],     +  vbm_paradigm "vbm_4ml1_tillåta" ["låta bli"],     +  vbm_paradigm "vbm_4ms1_dra" ["dra sig"],     +  vbm_paradigm "vbm_4mt1_gå" ["gå sin gilla gång"],     ++  vbm_paradigm "vbm_2ms1_sälja" ["sälja sig"],++  vbm_paradigm "vbm_2mt1_göra" ["göra slag i saken"],+  vbm_paradigm "vbm_4al1_ta" ["ta sönder"],+  vbm_paradigm "vbm_4at1_ta" ["ta på bar gärning"],+  vbm_paradigm "vbm_vms1_besluta" ["besluta sig"],                          ++  vbm_paradigm "vbm_2ml1_ansöka" ["väcka uppmärksamhet"],+  vbm_paradigm "vbm_4md1_hålla" ["hålla låg profil"],+  vbm_paradigm "vbm_4mt1_hålla" ["hålla en låg profil"],++  vbm_paradigm "vbm_1ic_laga" ["handla och vandla"],+  vbm_paradigm "vbm_4mpl1_ge" ["ge upp andan"],+  vbm_paradigm "vbm_1mpt1_laga" ["surfa in på en räkmacka"],+  vbm_paradigm "vbm_1mq1_laga"  ["trampa på en öm tå"],+  vbm_paradigm "vbm_1mst1_laga" ["visa sig på styva linan"],+  vbm_paradigm "vbm_1md1_laga" ["råka illa ut"],+  vbm_paradigm "vbm_1md1_ansöka" ["klippa med ögonen"],+  vbm_paradigm "vbm_2md1_viga" ["ställa till svars"],+  vbm_paradigm "vbm_1ml1_laga" ["vädra morgonluft"],+  vbm_paradigm "vbm_1mp1_laga" ["lämna över"],+  vbm_paradigm "vbm_1sp2_andas" ["inte låssas om"],+  vbm_paradigm "vbm_1mps1_laga" ["tuffa till sig"],+  vbm_paradigm "vbm_1ms1_laga" ["överila sig"],+  vbm_paradigm "vbm_1msp1_laga" ["snigla sig fram"],+  vbm_paradigm "vbm_1mzd1_laga" ["omgjorda sina länder"],+  vbm_paradigm "vbm_1sp1_andas" ["turas om"],+  vbm_paradigm "vbm_1szt1_andas" ["utandas sin sista suck"],+  vbm_paradigm "vbm_2ad1_lägga" ["lägga i dagen"],+  vbm_paradigm "vbm_2ai1_ansöka" ["släppa gäcken lös"],+  vbm_paradigm "vbm_2al1_lägga" ["lägga emellan"],+  vbm_paradigm "vbm_2al1_sätta" ["sätta p"],+  vbm_paradigm "vbm_2md1_ha" ["ha på tråden"],+  vbm_paradigm "vbm_2md1_ansöka" ["tänka på refrängen"],+  vbm_paradigm "vbm_2md1_lägga" ["lägga på hullet"],+  vbm_paradigm "vbm_2mi1_lägga" ["lägga näsan i blöt"],+  --vbm_paradigm "vbm_2mi1_mysa" ["åka på en propp"],+  vbm_paradigm "vbm_2mi2_leda" ["inte skräda orden"],+  vbm_paradigm "vbm_2ml1_göra" ["göra susen"],+  vbm_paradigm "vbm_2ml1_ha" ["ha reda"],+  vbm_paradigm "vbm_2ml1_leda" ["skräda orden"],+  vbm_paradigm "vbm_2ml1_lägga" ["inlägga förtjänst"],+  --vbm_paradigm "vbm_2ml1_väga" ["fylla år"],+  --vbm_paradigm "vbm_2mlvs1_mysa" ["leka rommen av sig"],+  vbm_paradigm "vbm_2mp1_göra" ["göra åt"],+  vbm_paradigm "vbm_2mp1_hyra" ["höra till"],+  vbm_paradigm "vbm_2mp1_känna" ["känna till"],+  vbm_paradigm "vbm_2mp1_lägga" ["lägga ut"],+  -- vbm_paradigm "vbm_2mp1_mysa" ["tänka till"],+  vbm_paradigm "vbm_2mp1_sätta" ["sätta efter"],+  vbm_paradigm "vbm_2mp1_viga" ["hänga över"],+  vbm_paradigm "vbm_1mt1_laga" ["ana ugglor i mossen"],+  vbm_paradigm "vbm_1mvud1_laga" ["dansa efter någons pipa"],+  vbm_paradigm "vbm_1mvzd1_laga" ["peta i sin mat"],+  vbm_paradigm "vbm_2mi1_ansöka" ["åka på en propp"],+  vbm_paradigm "vbm_2ml1_viga" ["bygga broar"],+  vbm_paradigm "vbm_2mld1_viga" ["bygga bo i huvudet"],+  vbm_paradigm "vbm_2mlvs1_ansöka" ["leka rommen av sig"],+  vbm_paradigm "vbm_2mp1_ansöka" ["blåsa upp"],+  vbm_paradigm "vbm_2mps1_ansöka" ["smäcka i sig"],+  vbm_paradigm "vbm_2mrf1_hyra" ["begära någons huvud på ett fat"],+  vbm_paradigm "vbm_2msp1_ansöka" ["tänka sig för"],+  vbm_paradigm "vbm_2msp1_viga" ["ställa sig in"],+  vbm_paradigm "vbm_4md1_angå" ["få på moppe"],+  vbm_paradigm "vbm_4mi1_angå" ["få bära hundhuvudet"],+  vbm_paradigm "vbm_4ml1_angå" ["få bukt"],+  vbm_paradigm "vbm_4ml1_rida" ["knipa käft"],+  vbm_paradigm "vbm_4ml1_ryta" ["stryka flagg"],+  vbm_paradigm "vbm_4mpd1_gå" ["gå in i väggen"],+  vbm_paradigm "vbm_4mvrd1_gå" ["gå i någons ledband"],    +  vbm_paradigm "vbm_4mzt1_angå" ["få sina fiskar varma"],++  --vbm_paradigm "vbm_2mp1_väga" ["äga rum"],+  vbm_paradigm "vbm_2mps1_göra" ["göra på sig"],+  vbm_paradigm "vbm_2mps1_ha" ["ha för sig"],+  vbm_paradigm "vbm_2mps1_hyra" ["köra ihop sig"],+  vbm_paradigm "vbm_2mps1_känna" ["skämma ut sig"],+  --vbm_paradigm "vbm_2mps1_mysa" ["smäcka i sig"],+  vbm_paradigm "vbm_2mps1_sätta" ["sätta i sig"],+  vbm_paradigm "vbm_2mps1_viga" ["hänga upp sig"],+  -- vbm_paradigm "vbm_2mps1_väga" ["ställa om sig"],+  vbm_paradigm "vbm_2ms1_ansöka" ["stöta sig"],+  vbm_paradigm "vbm_2ms1_glädja" ["glädja sig"],+  vbm_paradigm "vbm_2ms1_göra" ["tillgodogöra sig"],+  vbm_paradigm "vbm_2ms1_hyra" ["uppföra sig"],+  vbm_paradigm "vbm_2ms1_hända" ["vända sig"],+  vbm_paradigm "vbm_2ms1_känna" ["missminna sig"],+  vbm_paradigm "vbm_2ms1_leda" ["reda sig"],+  vbm_paradigm "vbm_2ms1_lyfta" ["utfästa sig"],+  vbm_paradigm "vbm_2ms1_lägga" ["vinnlägga sig"],+  --vbm_paradigm "vbm_2ms1_mysa" ["vräka sig"],+  vbm_paradigm "vbm_2ms1_skilja" ["skilja sig"],+  vbm_paradigm "vbm_2ms1_säga" ["säga sig"],+  vbm_paradigm "vbm_2ms1_sätta" ["sätta sig"],+  vbm_paradigm "vbm_2ms1_viga" ["hänga sig"],+  --vbm_paradigm "vbm_2ms1_väga" ["åtnöja sig"],+  vbm_paradigm "vbm_2ms1_välja" ["vänja sig"],+  vbm_paradigm "vbm_2msl1_göra" ["göra sig kvitt"],+  vbm_paradigm "vbm_2msp1_göra" ["göra sig till"],+  vbm_paradigm "vbm_2msp1_hyra" ["höra sig för"],+  vbm_paradigm "vbm_2msp1_lägga" ["lägga sig vinn"],+  --vbm_paradigm "vbm_2msp1_mysa" ["tänka sig för"],+  vbm_paradigm "vbm_2msp1_sätta" ["sätta sig över"],+  --vbm_paradigm "vbm_2msp1_väga" ["leva sig in"],+  vbm_paradigm "vbm_2mzd1_göra" ["göra sina lärospån"],+  vbm_paradigm "vbm_2mzd1_sätta" ["sätta sin lit"],+  vbm_paradigm "vbm_2sp1_blygas" ["följas åt"],+  vbm_paradigm "vbm_2sp1_minnas" ["kännas vid"],+  vbm_paradigm "vbm_2sp1_synas" ["hjälpas åt"],+  vbm_paradigm "vbm_3mp1_sy" ["rå om"],+  vbm_paradigm "vbm_3ms1_sy" ["ty sig"],+  vbm_paradigm "vbm_3msp1_sy" ["bry sig om"],+  vbm_paradigm "vbm_3mzd1_sy" ["så sin vildhavre"],+  vbm_paradigm "vbm_4ad1_bära" ["bära i gullstol"],+  vbm_paradigm "vbm_4ad1_falla" ["falla till föga"],+  vbm_paradigm "vbm_4ad1_ge" ["ge till känna"],+  vbm_paradigm "vbm_4ad1_gå" ["gå om intet"],+  vbm_paradigm "vbm_4ad1_komma" ["komma till skott"],+  vbm_paradigm "vbm_4ad1_se" ["se i vitögat"],+  vbm_paradigm "vbm_4ad1_ta" ["ta till vara"],+  vbm_paradigm "vbm_4al1_dricka" ["vinna segerpalmen"],++  vbm_paradigm "vbm_4al1_ge" ["ge tillkänna"],+  -- vbm_paradigm "vbm_4al1_gå" ["gå omintet"],+  vbm_paradigm "vbm_4md1_ge" ["ge till spillo"],++  -- vbm_paradigm "vbm_4al1_gå" ["gå kjortelvägen"],+  vbm_paradigm "vbm_4al1_komma" ["komma ifråga"],+  vbm_paradigm "vbm_4al1_rida" ["rida barbacka"],+  vbm_paradigm "vbm_4l1_slå" ["slå mynt"],+  vbm_paradigm "vbm_4md1_flyga" ["krypa till korset"],+  vbm_paradigm "vbm_4md1_gå" ["gå till väga"],+  vbm_paradigm "vbm_4ad1_hålla" ["hålla i schack"],+  vbm_paradigm "vbm_4md1_komma" ["komma till kritan"],+  vbm_paradigm "vbm_4md1_le" ["le i mjugg"],+  vbm_paradigm "vbm_4md1_ligga" ["ligga på lur"],+  vbm_paradigm "vbm_4md1_sitta" ["sitta på understol"],+  vbm_paradigm "vbm_4md1_slå" ["slå en drill"],+  vbm_paradigm "vbm_4md1_stå" ["stå till svars"],+  vbm_paradigm "vbm_4md1_ta" ["ta till orda"],+  vbm_paradigm "vbm_4md1_vina" ["skita på sig"],+  vbm_paradigm "vbm_4mi1_bära" ["bära syn för sagen"],+  vbm_paradigm "vbm_4mi1_ge" ["ge bagarbarn bröd"],+  --vbm_paradigm "vbm_4mi1_gå" ["få bära hundhuvudet"],+  vbm_paradigm "vbm_4mzq1_ta" ["ta sin mats ur skolan"],+  --vbm_paradigm "vbm_4mzt1_gå" ["få sina fiskar varma"],+  vbm_paradigm "vbm_vmsp1_ryckas" ["ryckas bort"],+  vbm_paradigm "vbm_4mi1_vina" ["rida ranka"],+  vbm_paradigm "vbm_4ml1_ge" ["ge vika"],+  vbm_paradigm "vbm_4ml1_gå" ["gå miste"],+  vbm_paradigm "vbm_4ml1_hålla" ["hålla stången"],+  vbm_paradigm "vbm_4ml1_komma" ["komma underfund"],+  vbm_paradigm "vbm_4ml1_ligga" ["ligga ogill"],+  vbm_paradigm "vbm_4ml1_ljuda" ["ljuta döden"],+  vbm_paradigm "vbm_4ml1_slå" ["slå vad"],+  vbm_paradigm "vbm_4ml1_stå" ["stå rycken"],+  vbm_paradigm "vbm_4ml1_ta" ["ta betäckning"],+  vbm_paradigm "vbm_4mlp1_slå" ["slå dövörat till"],+  vbm_paradigm "vbm_4mp1_bli" ["bli kvar"],+  vbm_paradigm "vbm_4mp1_bära" ["skära för"],+  vbm_paradigm "vbm_4mp1_fara" ["fara ut"],+  vbm_paradigm "vbm_4mp1_flyga" ["bryta av"],+  vbm_paradigm "vbm_4mp1_le" ["dö ut"], +  vbm_paradigm "vbm_4ms1_skjuta" ["utgjuta sig"],+  vbm_paradigm "vbm_4mp1_gå" ["gå till väga"],+  vbm_paradigm "vbm_4mp1_hålla" ["hålla upp"],+  vbm_paradigm "vbm_4mp1_komma" ["komma vid"],+  vbm_paradigm "vbm_4mp1_ryta" ["stryka med"],+  vbm_paradigm "vbm_4mp1_se" ["se ut"],+  vbm_paradigm "vbm_4mp1_sitta" ["sticka upp"],+  vbm_paradigm "vbm_4mp1_skjuta" ["skjuta över"],+  vbm_paradigm "vbm_4mp1_slå" ["slå över"],+  vbm_paradigm "vbm_4mp1_stå" ["stå ut"],+  vbm_paradigm "vbm_4mp1_ta" ["ta överbalansen"],+  vbm_paradigm "vbm_4mp1_vara" ["vara till"],+  vbm_paradigm "vbm_4mp1_vina" ["lida pin"],+  vbm_paradigm "vbm_4mpd1_ta" ["ta i med hårdhandskarna"],+  vbm_paradigm "vbm_4mpl1_ta" ["ta till storsläggan"],+  vbm_paradigm "vbm_4mps1_ge" ["ge med sig"],+  vbm_paradigm "vbm_4mps1_hålla" ["hålla i sig"],+  vbm_paradigm "vbm_4mps1_komma" ["komma ihop sig"],+  vbm_paradigm "vbm_4mps1_skjuta" ["skjuta in sig"],+  vbm_paradigm "vbm_4mps1_skåpäta" ["äta upp sig"],+  vbm_paradigm "vbm_4mps1_slå" ["slå ifrån sig"],+  vbm_paradigm "vbm_4mpzd1_slå" ["slå ned sina bopålar"],+  vbm_paradigm "vbm_4ms1_angå" ["förgå sig"],+  vbm_paradigm "vbm_4ms1_be" ["utbe sig"],+  vbm_paradigm "vbm_4ms1_bära" ["skära sig"],+  vbm_paradigm "vbm_4ms1_förhålla" ["uppehålla sig"],+  vbm_paradigm "vbm_4ms1_ge" ["hänge sig"],+  vbm_paradigm "vbm_4ms1_gråta" ["utlåta sig"],+  vbm_paradigm "vbm_4ms1_hålla" ["hålla sig"],+  vbm_paradigm "vbm_4ms1_komma" ["komma sig"],+  vbm_paradigm "vbm_4ms1_ljuda" ["ansluta sig"],+  vbm_paradigm "vbm_4ms1_ryta" ["snyta sig"],+  vbm_paradigm "vbm_4ms1_sitta" ["utspinna sig"],+  vbm_paradigm "vbm_4ms1_skåpäta" ["föräta sig"],+  vbm_paradigm "vbm_4ms1_slå" ["slå sig"],+  vbm_paradigm "vbm_4ms1_sova" ["försova sig"],+  vbm_paradigm "vbm_4ms1_stå" ["understå sig"],+  vbm_paradigm "vbm_4ms1_ta" ["åta sig"],+  vbm_paradigm "vbm_4ms1_tillåta" ["nedlåta sig"],+  vbm_paradigm "vbm_4ms1_utfalla" ["undfalla sig"],+  vbm_paradigm "vbm_4ms1_vina" ["slita sig"],+  vbm_paradigm "vbm_4msd1_ge" ["ge sig till tåls"],+  vbm_paradigm "vbm_4msd1_slå" ["slå sig till ro"],+  vbm_paradigm "vbm_4msp1_bära" ["bära sig åt"],+  vbm_paradigm "vbm_4msp1_ge" ["ge sig ut"],+  vbm_paradigm "vbm_4msp1_komma" ["komma sig upp"],+  vbm_paradigm "vbm_4msp1_slå" ["slå sig på"],+  vbm_paradigm "vbm_4msp1_stå" ["förstå sig på"],+  vbm_paradigm "vbm_4msp1_ta" ["ta sig ut"],+  vbm_paradigm "vbm_4msp1_finnas" ["finnas till"],+  vbm_paradigm "vbm_omp1_vilja" ["vilja till"],+  vbm_paradigm "vbm_omp1_veta" ["veta av"],+  vbm_paradigm "vbm_oms1_vilja" ["vilja sig"],+  vbm_paradigm "vbm_val1_klä" ["trå dansen"],+  vbm_paradigm "vbm_vad1_bringa" ["bringa till världen"],+  vbm_paradigm "vbm_vml1_mala" ["mala tomning"],+  vbm_paradigm "vbm_vmp1_smälta" ["smälta in"],+  vbm_paradigm "vbm_vmp1_upphäva" ["häva upp"],+  vbm_paradigm "vbm_vmps1_klä" ["klä ut sig"],+  vbm_paradigm "vbm_vmps1_smälla" ["smälla i sig"],+  vbm_paradigm "vbm_vmps1_vika" ["vika ut sig"],+  vbm_paradigm "vbm_vmps1_växa" ["växa till sig"],+  vbm_paradigm "vbm_vms1_besvärja" ["sammansvärja sig"],+  vbm_paradigm "vbm_vms1_förlöpa" ["belöpa sig"],+  vbm_paradigm "vbm_vms1_klä" ["utbre sig"],+  vbm_paradigm "vbm_vms1_tvinga" ["tilltvinga sig"],+  -- vbm_paradigm "vbm_vsp1_ryckas" ["ryckas bort"],+  vbm_paradigm "vbm_vsp1_talas" ["talas vid"],++  vbm_paradigm "vbm_4apl1_ta" ["ta ner skylten"],++  combine_vbm (vbm_paradigm "vbm_4ap1_falla" ["falla bort"])+               (paradigm_h  "vbm_4ap1_falla" ["falla bort"]+                 (verb_vbm 0 ([e ""], [], [], [], [],  [(tk 1 . fl, "en")]))),++  combine_vbm (vbm_paradigm "vbm_4ap1_sitta" ["sticka ner"])+               (paradigm_h  "vbm_4ap1_sitta" ["sticka ner"]+                 (verb_vbm 0 ([e ""], [], [], [], [],  [(vc "u" . tk 1 . fl, "en")]))),++  combine_vbm (vbm_paradigm "vbm_1ap1_laga" ["pigga upp"]) +               (paradigm_h "vbm_1ap1_laga" ["pigga upp"]             +                 (verb_vbm 0 ([e ""], [], [], [], [], [(fl, "d")]))),++  combine_vbm (vbm_paradigm "vbm_4ap1_dricka" ["sitta av"]) +               (paradigm_h "vbm_4ap1_dricka" ["sitta av"]             +                 (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1 . fl, "en")]))),++  combine_vbm (vbm_paradigm "vbm_1ap1_viga" ["slänga bort"])+              (paradigm_h "vbm_1ap1_viga" ["slänga bort"]              +               (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl, "d")]))),++  combine_vbm (vbm_paradigm "vbm_1ap1_skapa" ["tjäna av"])+              (paradigm_h "vbm_1ap1_skapa" ["tjäna av"]              +               (verb_vbm 0 ([e ""], [], [], [], [], [(fl, "d")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_ansöka" ["knäppa upp"])+                  (paradigm_h "vbm_2ap1_ansöka" ["knäppa upp"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl, "t")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_göra" ["göra ned"])+                  (paradigm_h "vbm_2ap1_göra" ["göra ned"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 3 . fl, "jord")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_hyra" ["hyra ut"])+                  (paradigm_h "vbm_2ap1_hyra" ["hyra ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl, "d")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_känna" ["skämma ut"])+                  (paradigm_h "vbm_2ap1_känna" ["skämma ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(ungeminate_m_n . tk 1 .fl,"d")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_leda" ["reda ut"])+                  (paradigm_h "vbm_2ap1_leda" ["reda ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"d")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_lyfta" ["gifta bort"])+                  (paradigm_h "vbm_2ap1_lyfta" ["gifta bort"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1.fl,"")]))),+  +  combine_vbm (vbm_paradigm "vbm_2ap1_lägga" ["lägga undan"])+                  (paradigm_h "vbm_2ap1_lägga" ["lägga undan"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "a" . tk 2 . fl,"d")]))),+   +  combine_vbm (vbm_paradigm "vbm_2ap1_säga" ["säga upp"])+                  (paradigm_h "vbm_2ap1_säga" ["säga upp"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "a" . tk 1 . fl,"d")]))),+  +  combine_vbm (vbm_paradigm "vbm_2ap1_sända" ["tända på"])+                  (paradigm_h "vbm_2ap1_sända" ["tända på"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"")]))),++  combine_vbm (vbm_paradigm "vbm_2ap1_sätta" ["sätta av"])+                  (paradigm_h "vbm_2ap1_sätta" ["sätta av"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "a" . tk 1 . fl,"")]))),+   +  combine_vbm (vbm_paradigm "vbm_2ap1_viga" ["döma ut"])+                  (paradigm_h "vbm_2ap1_viga" ["döma ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1.fl,"d")]))),+   +  --- combine_vbm (vbm_paradigm "vbm_2ap1_väga" ["leva ut"])+  ---                (paradigm_h "vbm_2ap1_väga" ["leva ut"]              +  ---                 (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"d")]))),+    +  combine_vbm (vbm_paradigm "vbm_3ap1_sy" ["sy in"])+                  (paradigm_h "vbm_3ap1_sy" ["sy in"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"dd")]))),+  +  combine_vbm (vbm_paradigm  "vbm_4ap1_bestå" ["stå bi"])+                  (paradigm_h "vbm_4ap1_bestå" ["stå bi"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"dd")]))),+  +  combine_vbm (vbm_paradigm "vbm_4ap1_bjuda" ["hugga ned"])+                  (paradigm_h "vbm_4ap1_bjuda" ["hugga ned"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1. fl,"en")]))),++  combine_vbm (vbm_paradigm "vbm_4ap1_bli" ["bli varse"])+                  (paradigm_h "vbm_4ap1_bli" ["bli varse"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"ven")]))),+   +  combine_vbm (vbm_paradigm "vbm_4ap1_bära" ["skära ner"])+                  (paradigm_h "vbm_4ap1_bära" ["skära ner"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1. fl,"en")]))),+     +  -- combine_vbm (vbm_paradigm "vbm_4ap1_dö" ["dö ut"])+  --                (paradigm_h "vbm_4ap1_dö" ["dö ut"] +  --                 (set_pos "vbm" . vbm_dö_ut)),+  +  combine_vbm (vbm_paradigm "vbm_4ap1_flyga" ["bryta ut"])+                  (paradigm_h "vbm_4ap1_flyga" ["bryta ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1 . fl,"en")]))),+     +  combine_vbm (vbm_paradigm "vbm_4ap1_ge" ["ge upp"])+                  (paradigm_h "vbm_4ap1_ge" ["ge upp"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "i" . fl,"ven")]))),+     +  combine_vbm (vbm_paradigm "vbm_4ap1_gå" ["gå bort"])+                  (paradigm_h "vbm_4ap1_gå" ["gå bort"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"ngen")]))),+  +  combine_vbm (vbm_paradigm "vbm_4ap1_hålla" ["hålla av"])+                  (paradigm_h "vbm_4ap1_hålla" ["hålla av"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1.fl,"en")]))),++  combine_vbm (vbm_paradigm "vbm_4ap1_komma" ["komma ihåg"])+                  (paradigm_h "vbm_4ap1_komma" ["komma ihåg"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"en")]))),+   +  combine_vbm (vbm_paradigm "vbm_4ap1_rida" ["slita ut"])+                  (paradigm_h "vbm_4ap1_rida" ["slita ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"en")]))),+     +  combine_vbm (vbm_paradigm "vbm_4ap1_se" ["se till"])+                  (paradigm_h "vbm_4ap1_se" ["se till"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"dd")]))),+ +  combine_vbm (vbm_paradigm "vbm_4ap1_skjuta" ["skjuta in"])+                  (paradigm_h "vbm_4ap1_skjuta" ["skjuta in"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl, "en")]))),+    +  combine_vbm (vbm_paradigm  "vbm_4ap1_slå" ["slå ner"])+                  (paradigm_h "vbm_4ap1_slå" ["slå ner"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "a" . fl,"gen")]))),+     +  combine_vbm (vbm_paradigm "vbm_4ap1_ta" ["dra in"])+                  (paradigm_h "vbm_4ap1_ta" ["dra in"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"gen")]))),++  combine_vbm (vbm_paradigm "vbm_4ap1_tillåta" ["låta upp"])+                  (paradigm_h "vbm_4ap1_tillåta" ["låta upp"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"en")]))),+    +  combine_vbm (vbm_paradigm "vbm_4ap1_äta" ["äta upp"])+                  (paradigm_h "vbm_4ap1_äta" ["äta upp"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"en")]))),+  +  combine_vbm (vbm_paradigm "vbm_vap1_fnysa" ["dyka upp"])+                  (paradigm_h "vbm_vap1_fnysa" ["dyka upp"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"t")]))),+  +  combine_vbm (vbm_paradigm "vbm_vap1_frysa" ["frysa ut"])+                  (paradigm_h "vbm_vap1_frysa" ["frysa ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1 . fl, "en")]))),+    +  combine_vbm (vbm_paradigm "vbm_vap1_klä" ["klä ut"])+                  (paradigm_h "vbm_vap1_klä" ["klä ut"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(fl,"dd")]))),+   +  combine_vbm (vbm_paradigm "vbm_vap1_koka" ["koka in"])+                  (paradigm_h "vbm_vap1_koka" ["koka in"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"t")]))),+  +  combine_vbm (vbm_paradigm "vbm_vap1_lyfta" ["smälta ihop"])+                  (paradigm_h "vbm_vap1_lyfta" ["smälta ihop"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"")]))),+   +  combine_vbm (vbm_paradigm "vbm_vap1_nypa" ["nypa av"])+                  (paradigm_h "vbm_vap1_nypa" ["nypa av"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"t")]))),+ +  combine_vbm (vbm_paradigm "vbm_vap1_smälla" ["smälla av"])+                  (paradigm_h "vbm_vap1_smälla" ["smälla av"]              +                   (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1 . fl,"en")]))),+ +  combine_vbm (vbm_paradigm "vbm_vap1_smälta" ["smälta samman"])+               (paradigm_h "vbm_vap1_smälta" ["smälta samman"]              +                (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1 . fl,"en")]))),+ +  combine_vbm (vbm_paradigm "vbm_vap1_strypa" ["rycka fram"])              +               (paradigm_h "vbm_vap1_strypa" ["rycka fram"]              +                (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"t")]))),+   +  combine_vbm (vbm_paradigm "vbm_vap1_tala" ["spela upp"])+               (paradigm_h "vbm_vap1_tala" ["spela upp"]              +                (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"t")]))),+   +  combine_vbm (vbm_paradigm "vbm_vap1_vika" ["vika ut"])+               (paradigm_h "vbm_vap1_vika" ["vika ut"]              +                (verb_vbm 0 ([e ""], [], [], [], [], [(tk 1 . fl,"en")]))),+    +  combine_vbm (vbm_paradigm "vbm_vap1_växa" ["växa ur"])+               (paradigm_h "vbm_vap1_växa" ["växa ur"]              +                (verb_vbm 0 ([e ""], [], [], [], [], [(vc "u" . tk 1 . fl,"en")]))),++  paradigm_h "nn_1u_flicka"       ["flicka"] $+   noun_compound 1 Utr ([e "a"], [e "an"], [e "or"], [e "orna"], [(ungeminate, "")],[e "e",(ungeminate,""),(ds.ungeminate,"")]),++  paradigm_h "nn_1u_barnstuga" ["barnstuga"] $+   noun_compound 1 Utr ([e "a"], [e "an"], [e "or"], [e "orna"], [e "e", e "u"],[e "e",e "u"]),++  paradigm_h "nn_vv_demo" ["demo"] $+   noun_compound 0 Pend +    ([e ""], [e "n", e "t"], [e "n",e "s",e "sar",e "r", e ""], [e "na",e "sen",e "sarna",e "rna", e "n"],[e ""],[e ""]),++  paradigm_h "nn_2u_botten" ["botten"] $+   noun_compound 0 Utr  ([e ""], [(dvu,"en"),e ""], [(dvu, "ar")], [(dvu,"arna")],[e ""],[e ""]),   +  paradigm_h "nn_2u_nyckel" ["nyckel"] $+    noun_compound 0 Utr ([e ""], [e "n"], [(mmr.dvu,"ar"),(mmr.dv, "ar")], [(mmr.dvu,"arna"),(mmr.dv,"arna")],[e ""],[e "",(ds,"")]),   ++  paradigm_h "nn_2u_ålder" ["ålder"] $+    noun_compound 0 Utr ([e ""], [e "n"], [(dvu,"ar"),(dv, "ar")], [(dvu,"arna"),(dv,"arna")],[(ds,"")],[(ds,"")]),   +  paradigm_h "nn_2u_vinge"         ["vinge"] $+   noun_compound 0 Utr  ([e ""], [e "n"], [(tk 1,"ar")], [(tk 1, "arna")],[(ungeminate.tk 1, "")],[(ungeminate.tk 1,""),e "s",(ds. ungeminate . tk 1,"")]),   ++  paradigm_h "nn_2u_skrake" ["skrake"] $+   noun_compound 0 Utr  ([e "",(tk 1,"")], [e "n"], [(tk 1,"ar")], [(tk 1, "arna")],[(ungeminate.tk 1, "")],[(ungeminate.tk 1,""),e "s",(ds. ungeminate . tk 1,"")]),   ++  paradigm_h "nn_2u_stol"            ["stol"] $+   noun_compound 0 Utr  ([e ""], [e "en"], [e "ar"], [e "arna"],[e "",(ds,"")],[e "",(ds,"")]),   +  paradigm_h "nn_4u_linje"           ["linje"]       nn4,+  paradigm_h "nn_5n_knä"            ["knä"]         nn5_knä,+  paradigm_h "nn_6n_garage"       ["garage"] $ +   noun_compound 0 Neutr  ([e ""], [e "t"], [e ""], [e "n"],[e ""],[e ""]),   +  paradigm_h "nn_6n_segel"         ["segel"] $+   noun_compound 0 Neutr  ([e ""], [(dvu,"et")], [e ""], [(dvu,"en")],[e ""],[e "",(ds,"")]),+   +  paradigm_h "nn_6n_medel"         ["medel"] $+   noun_compound 0 Neutr  ([e ""], [(dvu,"et")], [e ""], [(dvu,"en")],[(ds,"")],[(ds,"")]),   ++  paradigm_h "nn_6u_gås"            ["gås"]            nn_6u_gås,+  paradigm_h "nn_ou_emeritus"    ["emeritus"]       nn_ou_emeritus, +  paradigm_h "nn_ou_examen"     ["examen"]         nn_ou_examen,+  paradigm_h "nn_vn_centrum"     ["centrum"]        nn_vn_centrum,+  paradigm_h "nn_vn_nomen"       ["nomen"]          nn_vn_nomen,+  paradigm_h "nn_vu_jojo"            ["jojo"]       nn_vu_jojo,+  paradigm_h "nn_vu_partner"      ["partner"]        nn_vu_partner,+  paradigm_h "nn_vv_abdomen"   ["abdomen"]       nn_vv_abdomen,+  paradigm_h "av_2_ung"          ["ung"]        av_2_ung+ ] ++ verb_paradigms++combine_vbm :: (String, [String], [String] -> Entry) -> (String, [String], [String] -> Entry) -> (String, [String], [String] -> Entry)+combine_vbm (s,xs,f) (_,_,f1) = (s,xs,\xs -> combine_tables (f xs) (f1 xs))++vbm_paradigm :: String -> [String] -> (String, [String], [String] -> Entry)+vbm_paradigm p xs = case catMaybes [Map.lookup v_id verb_map | v_id <- vids] of+                      _ | pos /='1' -> paradigm_h p xs vbm_inf+                      (f:_) -> paradigm_h p xs $ expand . clean . first_mw "vbm" (f . (:[]))+                      _     -> paradigm_h p xs vbm_inf+ where verb_map = Map.fromList [(s,f) | (s,_,f) <- verb_paradigms]+       clean = (if is_reflexive p then remove_param "s-form" else id) . remove_param "sms" . remove_param "c" +               . (if has_pret_part then id else remove_param "pret_part")+       expand = (if is_poss p then expand_poss else (if is_reflexive p then expand_ref else id))+       expand_poss = expand_multiword "sin" [([],[],"min"),([],[],"din"),([],[],"sin"),([],[],"vår"),([],[],"er")] .+                     expand_multiword "sina" [([],[],"mina"),([],[],"dina"),([],[],"sina"),([],[],"våra"),([],[],"era")]+       expand_ref  = expand_multiword "sig" [([],["imper"],"mig"),([],[],"dig"),([],["imper"],"sig"),([],["imper"],"oss"),([],[],"er")]+       vids = case p of+                (v:b:m:u:k:a:rest) ->+                    case span (/= '_') rest of+                      (_,r) -> [(v:b:u:k:a:r),(v:b:u:k:'a':r),(v:b:u:k:'m':r)]+       has_pret_part = case p of+                         (v:b:m:u:k:a:d:rest) -> elem [a,d] ["ad", "at","aq"]+       pos = case span (/='_') (reverse p) of+               (_,(_:n:_)) -> n+       is_reflexive p = case span (/='_') (reverse p) of+                          (_,(_:s)) -> case span (/='_') s of +                                         (s',_) -> elem 's' s'+       is_poss p = case span (/='_') (reverse p) of+                     (_,(_:s)) -> case span (/='_') s of +                                    (s',_) -> elem 'z' s'++verb_paradigms :: [(String, [String], [String] -> Entry)]+verb_paradigms = [+  paradigm_h "vb_1s_gillas" ["gillas"]  $+   verb_deponens 2 ([e "as"],[e "as",e "s"],[e "ades",e "des"], [e "ats",e "ts"], []),++  paradigm_h "vb_1a_spara" ["spara"]  $ +   verb_weak 1 ([e "a"], [e "ar",e ""],[e "a",e ""],[e "ade"],[e "at"],[e "ad"]),++  paradigm_h "vb_1a_vissla" ["vissla"]  $ +   verb_weak 1 ([e "a"], [e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad"]),++  paradigm_h "vb_1a_skapa" ["skapa"]   $+   verb_weak 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad",e "t"]),++  paradigm_h "vb_1a_hitta" ["hitta"]   $+   verb_weak_compound 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad"],[e "e"]),++  paradigm_h "vb_1a_vänta" ["vänta"]   $+   verb_weak_compound 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad"],[e "", e "e"]),++  paradigm_h "vb_1a_klaga" ["klaga"]   $+   verb_weak_compound 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad"],[e "", e "o"]),++  paradigm_h "vb_1a_beundra" ["beundra"]   $+   verb_weak_compound 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad"],[]),++  paradigm_h "vb_1m_hisna" ["hisna"]   $+   verb_weak_compound 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[],[]),++  paradigm_h "vb_1m_svira" ["svira"]   $+   verb_weak_compound 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[],[e ""]),+  paradigm_h "vb_1m_existera" ["existera"]   $+   verb_weak_compound 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[],[]),++  paradigm_h "vb_1a_ugnsbaka" ["ugnsbaka"]  $+   verb_weak 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad",e "t"]),++  paradigm_h "vb_1m_vånna" ["vånna"]  $+   verb_full 1 ([e "a"], [],[e "ar"],[e "a"], [e "ade"], [e "e"], [e "at"], []),    ++  paradigm_h "vb_1m_kackla" ["kackla"]  $+   verb_weak 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[]),++  paradigm_h "vb_1a_unna" ["unna"]  $+   verb_weak 1 ([e "a"], [e "ar"], [e "a"], [e "ade"], [e "at"], [(id,"ad"),(tk 1,"t")]),++  paradigm_h "vb_1a_häda" ["häda"]  $+   verb_weak 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at"],[e "ad",e "d"]),++  paradigm_h "vb_4m_ljuda" ["ljuda"] $+   verb_full 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ö","")], [(vc "ö","e")],[e "it"], []),++  paradigm_h "vb_4a_fara" ["fara"]  $+   verb_full_sform_variant 1 ([e "a"], [e "e"], [e ""], [e ""], [(vc "o","")], [(vc "o","e")], [e "it"], [e "en"]),++  paradigm_h "vb_2a_leva" ["leva"]  $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "de"], [e "t", e "at"], [e "d"]),++  paradigm_h "vb_2a_stödja" ["stödja"]  $+   verb_weak_compound_sform_variant 1 ([(tk 1,"a"),e "a"], [(tk 1, "er"),(id,"er")], [(tk 1,"")], [(tk 1, "de")], [(tk 1 . dsuff "j", "tt")], [(tk 1, "d")],[(tk 1,""),e "e"]),++  paradigm_h "vb_2a_sälja" ["sälja"]  $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(vc "å".tk 1, "de")], [(vc "å".tk 1, "t")], [(vc "å" . tk 1,"d")]),++  paradigm_h "vb_2a_säga" ["säga"]  $+   verb_weak_sform_variant 1 ([(id,"a"),(tk 1, "ja")], [(id, "er"),(tk 1, "jer")], [e "",(tk 1,"j")], [(vc "a".tk 1,"de"),(vc "a".tk 1,"")], [(vc "a","t")] , [(vc "a", "d")]),++  paradigm_h "vb_2a_motsäga" ["motsäga"]  $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(vc "a". tk 1, "de")], [(vc "a", "t")], [(vc "a","d")]),++  paradigm_h "vb_2a_mista" ["mista"]  $+   verb_weak_sform_variant 1 ([e "a"],[e "er"],[e ""],[e "ade",e "e"],[e "",e "at"],[e "ad",(\s -> s +? "t","")]),++  paradigm_h "vb_2a_välja" ["välja"]  $+   let g = vct [("ä","a"),("ö","o")] . tk 1 in +   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(g,"de")], [(g, "t")], [(g,"d")]),++  paradigm_h "vb_2m_hända" ["hända"]  $+   verb_weak_sform_variant 1 ([e "a"],[e "er"],[e ""],[e "e"],[(tk 1, "t")],[]),++  paradigm_h "vb_2d_må" ["må"] +   (verb_weak 0 ([],[e ""],[],[e "tte"],[],[])),++  paradigm_h "vb_2m_gitta" ["gitta"]   +   (verb_weak 1 ([e "a"],[e "er"],[e ""], [e "e"], [e "at"], [])),    ++  paradigm_h "vb_2a_städja" ["städja"] +   (verb_weak_sform_variant 2 ([e "ja"], [e "jer",e "er"], [e ""], [(vc "a","de")],[(vc "a".tk 1,"tt")], [(vc "a","d")])),++  paradigm_h "vb_2a_genmäla" ["genmäla"] +   (verb_weak_sform_variant 1 ([e "a"],[e "er"],[e ""],[e "de",e "te"],[e "t"],[e "d"])),++  paradigm_h "vb_2m_väga" ["väga"]  +   (verb_weak_no_sform 1 ([e "a"],[e "er"],[e ""],[e "de"],[e "t"],[])),++  paradigm_h "vb_4a_bottenfrysa" ["bottenfrysa"]  +   (verb_full_no_sform 1 ([e "a"],[e "e"],[e "er"],[e ""],[e "te", (vc "ö","")],[(vc "u","e")],[(vc "u","it"),e "t"],[(vc "u","en"),e "t"])),++  paradigm_h "vb_va_frysa" ["frysa"]  +   (verb_full 1 ([e "a"],[e "e"],[e "er"],[e ""],[e "te", (vc "ö","")],[(vc "u","e")],[(vc "u","it"),e "t"],[(vc "u","en"),e "t"])),++  paradigm_h "vb_2m_höta" ["höta"] +   (verb_weak_sform_variant 1 ([e "a"],[e "ter",e "er"],[e ""],[e "te"],[e "t"],[])),++  paradigm_h "vb_2m_glädja" ["glädja"] +   (verb_weak_sform_variant 1 ([e "a"], [e "er"], [(tk 1, "")], [(vc "a" . tk 1,"de")], [(vc "a" . tk 2, "tt")], [])),++  paradigm_h "vb_2m_böra" ["böra"] +   (verb_weak_sform_variant 1 ([e "a"], [e ""], [e ""], [(vc "o", "de")], [(vc "o", "t")], [])),++  paradigm_h "vb_2a_tämja" ["tämja"] +   (verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "de"], [(id, "t"),(tk 1,"t")], [e "d"])),++  paradigm_h "vb_2a_spörja"           ["spörja"] +   (verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(vc "o" . tk 1, "de")], [(vc "o" . tk 1, "t")], [(vc "o" . tk 1,"d")])),++  paradigm_h "vb_2s_blygas" ["blygas"]  $  +    (verb_dwc 2 ["as"] ["s","es"] ["des"] ["ts"] []),++  paradigm_h "vb_3s_brås" ["brås"]  $  +    (verb_dwc 1 ["s"] ["s"] ["ddes"] ["tts"] []),++  paradigm_h "vb_2s_trivas" ["trivas"]  $ +   verb_deponens 2 ([e "as"],[(ungeminate,"s"),e "as"],[e"des"],[e "ts"],[]),++  paradigm_h "vb_2s_nöjas" ["nöjas"] $ +   (verb_dwc 2 ["as"] ["s"] ["des"] ["ts"] []),++  paradigm_h "vb_2s_minnas" ["minnas"] $ +   (verb_dwc 3 ["nas"] ["ns"] ["des"] ["ts"] []),++  paradigm_h "vb_2s_vämjas" ["vämjas"] $ +   (verb_dwc 3 ["jas"] ["jes","js"] ["jdes","des"] ["jts","ts"] []),++  paradigm_h "vb_2s_töras" ["töras"] $ +   (verb_dwc 4 ["öras","ordas"] ["örs"] ["ordes"] ["orts"] []),++  paradigm_h "vb_2s_rymmas" ["rymmas"] $ +   (verb_dwc 3 ["mas"] ["s"] ["des"] ["ts"] []),++  paradigm_h "vb_2s_idas" ["idas"] $ +   (verb_dwc 3 ["das"] ["ds","des"] ["ddes"] ["dats","tts"] []),++  paradigm_h "vb_2s_hövas" ["hövas"] $ +   (verb_dwc 2 ["as"] ["es"] ["des"] ["ts"] []),++  paradigm_h "vb_2s_glädjas" ["glädjas"] $ +   (verb_dwc 5 ["ädjas"] ["äds","ädes"] ["addes"] ["atts"] []),++  paradigm_h "vb_2s_giftas" ["giftas"] $ +   (verb_dwc 2 ["as"] [] ["es"] ["s"] []),++  paradigm_h "vb_2s_skiljas" ["skiljas"] $ +   (verb_dwc 3 ["jas"] ["js","s","jes"] ["des"] ["ts"] []),++  paradigm_h "vb_va_vika" ["vika"]  +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "e","")], [(vc "e","e")],[e "it",e "t"], [e "en"])),++  paradigm_h "vb_va_tvinga" ["tvinga"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "ar"], [e "a"], [(id,"ade"),(vc "a","")], [(vc "u","e")],[e "at",(vc "u","it")], [e "ad",(vc "u","en")])),++  paradigm_h "vb_va_löpa" ["löpa"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(id,"te"),(vc "o","p")], [(vc "u","e")],[(id,"t"),(vc "u","it")], [(vc "u","en"),e "t"])),++  paradigm_h "vb_vm_fnysa" ["fnysa"]  +   (verb_full 1 ([e "a"], [e "e"],[e "er"], [e ""], [(id,"te"),(vc "ö","")], [(vc "ö","e")],[e "t"], [])),++  -- paradigm_h "vb_vm_tilltvinga" ["tilltvinga"] +  -- (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "ar"], [e "a"], [(id,"ade"),(vc "a","")], [(vc "a","e")],[e "at",(vc "u","it")], [])),++  paradigm_h "vb_vm_avvara" ["avvara"] +   (verb_weak_sform_variant 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "it",e "at"],[])),+ +  paradigm_h "vb_va_växa" ["växa"] +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "er"], [e "a"], [e "te"],[(vc "u", "e")],[(vc "u", "it"),(id,"t")], [(vc "u", "en")])),++  paradigm_h "vb_va_stupa" ["stupa"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "ar"], [e "a"],[(vc "ö",""),(id,"ade")], [(vc "ö","e")],[e "at"], [e "ad"])),++  paradigm_h "vb_va_lyda" ["lyda"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(id,"de"),(vc "ö","")], [(vc "ö","e")],[(tk 1,"tt")], [e "d"])),++  paradigm_h "vb_om_skola" ["skola"] +   (verb_weak_no_sform 1 ([e "a"], [(vc "a" . tk 1, ""),(vc "a","l")], [e "a"], [(vc "u", "le")], [e "at"], [])),++  paradigm_h "vb_vm_snika" ["snika"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e "a"], [(vc "e", ""),(id,"te")], [(vc "e","e")], [e "it"], [])),++  paradigm_h "vb_vm_smälla" ["smälla"] +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "a",""),(id,"de")], [(vc "u","e")],[e ""], [])),++  paradigm_h "vb_va_tälja" ["tälja"] +   (verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""],[(id,"de"),(vc "a" . tk 1,"de")], [(id,"t"),(vc "a" . tk 1,"t")], [e "d"])),++  paradigm_h "vb_va_två" ["två"] +   (verb_weak 0 ([e ""], [e "r"], [e ""], [e "dde"], [(id,"tt"),(vc "a","git")],  [e "dd"])),++  paradigm_h "vb_va_smälta" ["smälta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "a", ""),(id,"e")], [(vc "u","e")],[(vc "u","it"),(id,"")], [(vc "u","en")])),++  paradigm_h "vb_va_förmäla" ["förmäla"]  +   (verb_weak_sform_variant 1 ([e "a"],[e "er"],[e ""],[e "te",e "de"],[e "t"],[e "d"])),++  paradigm_h "vb_va_besvärja" ["besvärja"]  +   (verb_full_sform_variant 1 ([e "a",(tk 1,"a")],[e "e"],[(id,"er"),(tk 1,"")],[e ""], [(vc "o" . tk 1, ""),(id,"de")], [(vc "u" .tk 1,"e")],[(vc "u" . tk 1, "it"),(id,"t")], [e "d", (vc "u" . tk 1, "en")])),++  paradigm_h "vb_om_kunna" ["kunna"]  +   (verb_weak_no_sform 0 ([e ""],[(vc "a" . tk 2, "")],[],[(tk 2, "de")],[e "t"],[])),++  paradigm_h "vb_vm_upphäva" ["upphäva"]       +   (verb_full_sform_variant 1 ([e "a"],[e "e"],[e "er"],[e ""],[e "de",(vc "o","")],[(vc "o","e")],[e "t"],[])),++  paradigm_h "vb_vm_undvara" ["undvara"]  +   (verb_weak_sform_variant 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "at",e "it"],[])),++  paradigm_h "vb_vm_strida" ["strida"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(id,"de"), (vc "e", "")], [(vc "e","e")],[(tk 1, "tt"), (id, "it")], [])),++  paradigm_h "vb_vm_sluta" ["sluta"] +   (verb_full_sform_variant 1 ([e "a"],[e "e"],[e "ar"], [e ""], [(id,"ade"),(vc "ö","")], [(vc "ö","e")],[e "at"], [])),++  paradigm_h "vb_vm_samvara" ["samvara"]  +   (verb_weak_sform_variant 1 ([e "a"],[e "ar"],[e "a"],[e "ade"],[e "it"],[])),++  paradigm_h "vb_vm_ryka" ["ryka"]  +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "ö",""),(id,"te")], [(vc "ö","e")],[(id,"t"),(vc "u","it")],[])),++  paradigm_h "vb_vm_nysa" ["nysa"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(id,"te"),(vc "ö","")], [(vc "ö","e")],[(id,"t"),(id,"it"),(vc "u","it")], [])),++  paradigm_h "vb_vm_kvida" ["kvida"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "e", ""),(id,"ade")], [(vc "e","e")],[e "it"], [])),++  paradigm_h "vb_vm_klinga" ["klinga"]  +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "ar"], [e "a"], [(id,"ade"),(vc "a","")], [(vc "a","e")],[e "at"], [])),++  paradigm_h "vb_va_gälla_kastrera"   ["gälla"] +   (verb_weak_sform_variant 1 ([e "a"],[e "er"],[e ""],[e "de",e "ade"],[e "t",e "at"],[e "d",e "ad"])),++  paradigm_h "vb_vm_gala" ["gala"]  +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e ""], [e ""], [(vc "o","")], [(vc "o","e")],[(id,"it"),(vc "a","t")], [])),++  paradigm_h "vb_vm_duga" ["duga"] +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ö",""),(id,"ade")], [(vc "ö", "e")],[(id,"t"),(id,"it")], [])),++  paradigm_h "vb_vm_drösa" ["drösa"]  +   (verb_weak_sform_variant 1 ([e "a"],[e "er"],[e ""],[e "te",e "ade"],[e "at",e "t"],[])),++  paradigm_h "vb_vm_drypa" ["drypa"] +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ö","")], [(vc "ö","e")],[(vc "u","it"),(id,"t")], [])),++  paradigm_h "vb_va_utlöpa" ["utlöpa"] +   (verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "te"], [e "t"], [(vc "u", "en")])),++  paradigm_h "vb_va_träda" ["träda"]  +   (verb_weak_sform_variant 1 ([e "a"], [e "er"],[e ""],[e "ade",e "de"], [(id,"at"),(tk 1,"tt")], [e "d"])),++  paradigm_h "vb_va_strypa" ["strypa"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "ö",""),(id,"te")], [(vc "ö","e")],[e "t"],[e "t"])),++  paradigm_h "vb_va_snusmala" ["snusmala"]  +   (verb_weak_sform_variant 1 ([e "a"],[e ""],[e ""],[e "de"],[e "t"],[e "d",e "en"])),++  paradigm_h "vb_va_skvätta" ["skvätta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "a",""),(id,"e")], [(vc "a","e")],[e ""], [e "ad"])),++  paradigm_h "vb_va_simma" ["simma"] +   (verb_full 1 ([e "a"], [e "e"],[e "ar"], [e "a"],[(vc "a" . ungeminate ,""),(id,"ade")], [(vc "a","e")],[(vc "u","it"), (id,"at")],[(vc "u","en"), (id,"ad")])),++  paradigm_h "vb_va_nästa" ["nästa"] +   (verb_weak 1 ([e "a"],[e "ar"],[e "a"],[e "ade",e "e"],[e "at"],[e "ad"])),++  paradigm_h "vb_va_mala" ["mala"] +   (verb_weak 1 ([e "a"],[e "er",e ""],[e ""],[e "de"],[e "t"],[e "d",e "en"])),++  paradigm_h "vb_va_kväda" ["kväda"]  +   (verb_full 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "a",""),(id,"de")], [(vc "a","e")],[e "it"], [e "en"])),++  paradigm_h "vb_va_klyva" ["klyva"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "ö","")], [(vc "ö","e")],[(vc "u","it"),e "it",e "t"], [e "en"])),++  paradigm_h "vb_va_gälda" ["gälda"]  +   (verb_full 1 ([e "a"], [e "e"],[e "ar"], [e "a"], [e "ade"] , [(vc "u","e")],[e "at"], [(vc "u", "en"),(id,"ad")])),++  paradigm_h "vb_va_förse" ["förse"] +   (verb_weak 0 ([e ""], [e "r"], [e ""],[(vc "å","g"),(id,"dde")], [e "tt"], [e "dd"])),++  paradigm_h "vb_va_förlöpa" ["förlöpa"] +   (verb_full_no_sform 1 ([e "a"], [e "e"],[e "er"], [e ""], [e "te"], [(vc "u","e")],[(vc "u","it"),(id,"t")],[(vc "u","en"), (id,"t")])),++  paradigm_h "vb_va_framtvinga" ["framtvinga"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "ar"], [e "a"], [e "ade"],[(vc "u","e")],[(vc "u","it"),(id,"at")], [(vc "u","en"),(id, "ad")])),++  paradigm_h "vb_va_tala" ["tala"]  $ +   (verb_weak_sform_variant 1 ([e "a"], [e "ar"], [e "a"], [e "ade",e "te"],[e "at",e "t"], [e "ad",e "d"])),++  paradigm_h "vb_va_bestrida" ["bestrida"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "e",""),(id,"de")], [(vc "e","e")],[(tk 1,"tt"),(id,"it")], [e "en",e "d"])),++  paradigm_h "vb_va_besluta" ["besluta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "ar"], [e "a"],[(vc "ö",""),(id,"ade")], [(vc "ö","e")],[e "at",e "it"], [e "en",e "ad"])),++  paradigm_h "vb_va_begrava" ["begrava"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "o",""),(id,"de")], [(vc "o","e")],[e "t",e "it"], [e "en",e "d"])),++  paradigm_h "vb_om_vilja" ["vilja"] +   (verb_weak_no_sform 2 ([e "ja"], [e "l"], [e "ja"], [e "le"],[(vc "e", "at")],[])),++  paradigm_h "vb_om_veta" ["veta"] +   (verb_full_no_sform 1 ([e "a"],[e "e"],[e ""],[e ""],[(vc "i". tk 1,"sste")],[], [e "at"],[])),++  paradigm_h "vb_om_måste" ["måste"] +    (verb_weak_no_sform 1 ([e "a"],[e "e"],[e "a"],[e "e"],[e ""],[])),++  paradigm_h "vb_om_heta" ["heta"] +    (verb_weak_no_sform 1 ([e "a"],[e "er"],[e ""],[e "te"],[e "at"],[])),++  paradigm_h "vb_oa_varda" ["varda"]  +    (verb_weak_no_sform 1 ([e "a"], [e "er"], [e "a"], [e "e"], [(tk 1,"t")],[(vc "o", "en")])),++  paradigm_h "vb_vs_dväljas" ["dväljas"]  $ +     (verb_deponens 3 ([e "jas"], [e "jes",e "js"],[(vc "a","des"),(id,"jdes")], [(vc "a","ts"),(id,"ts")],[])),++  paradigm_h "vb_4s_vederfaras" ["vederfaras"]  $ +     (verb_deponens 2 ([e "as"], [e "s"],[(vc "o","s")], [e "its"],[])),++  paradigm_h "vb_4s_tas" ["tas"]  $ +     (verb_deponens 1 ([e "s"], [e "s"],[(vc "o","gs")], [e "gits"],[])),++  paradigm_h "vb_4s_umgås" ["umgås"] $ +     (verb_deponens 0 ([e ""], [e ""],[(vc "i".tk 1,"cks")],[(tk 1, "tts")],[])),++  paradigm_h "vb_4s_munhuggas" ["munhuggas"]  $ +     (verb_deponens 2 ([e "as"], [e "s",e "es"],[(vc "ö","s")], [e "its"],[])),++  paradigm_h "vb_4s_bitas" ["bitas"]  $ +     (verb_deponens 2 ([e "as"], [e "s"],[(vc "e","s")], [e "its"],[])),++  paradigm_h "vb_4s_hållas" ["hållas"] $ +     (verb_deponens 2 ([e "as"], [e "s"],[(vc "ö","s")], [e "its"],[])),++  paradigm_h "vb_4s_finnas" ["finnas"]  $ +     (verb_deponens 2 ([e "as"], [e "s",e "es"],[(vc "a","s")],[(vc "u","its")],[])),++  paradigm_h "vb_4s_slåss" ["slåss"]  $ +     (verb_deponens 2 ([e "ss"], [e "ss"],[(vc "o","gs")],[(vc "a","gits")],[])),++  paradigm_h "vb_4m_svälta_1" ["svälta"]  +   (verb_full 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "a", "")], [(vc "u","e")],[(vc "u", "it")], [])),++  paradigm_h "vb_va_svälta_2" ["svälta"]  +   (verb_full 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "a", ""), e "e"], [(vc "u","e")],[(vc "u", "it")], [e ""])),++  paradigm_h "vb_4m_förslå" ["förslå"]    +   (verb_full 0 ([e ""], [e "ge"],[e "r"], [e ""],[(vc "o", "g")],[(vc "o","e")],[(vc "a","git")], [])),++  paradigm_h "vb_4a_stjäla" ["stjäla"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e ""], [e ""],[(tk 3, "al")], [(tk 3,"ule")],[(tk 3,"ulit")],[(tk 3,"ulen")])),++  paradigm_h "vb_4m_vara" ["vara"]  +    (verb_full 4 ([e "vara"], [e "vare"],[e "är"],[], [e "var"], [e "vore"], [e "varit"], [])), ++  paradigm_h "vb_4m_sova" ["sova"] +    (verb_full 1 ([e "a"],[e "e"],[e "er"],[e ""],[e ""],[e "e"],[e "it"],[])),++  --paradigm_h "vb_4a_försova" ["försova"] +  --  (verb_full 1 ([e "a"],[e "e"],[e "er"],[e ""],[e ""],[e "e"],[e "it"],[e "en"])),++  paradigm_h "vb_4m_erfara" ["erfara"] +    (verb_full 1 ([e "a"], [e "e"],[e ""], [e ""],[(vc "o", "")], [(vc "o","e")],[e "it"], [])),++  paradigm_h "vb_4a_bli" ["bli"]  vb_4a_bliva,++  paradigm_h "vb_4a_bestå" ["bestå"]     +   (verb_full 0 ([e ""], [],[e "r"], [e ""], [(vc "o", "d")], [(vc "o","de")],[e "tt"], [e "nden", e "tt"])),++  paradigm_h "vb_4a_äta" ["äta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "å", "")], [(vc "å","e")],[e "it"], [e "en"])),++  paradigm_h "vb_4a_svära" ["svära"] +   (verb_full_compound_sform_variant 1 ([e "a",e "ja"], [e "je", e "e"],[e "",e "jer"], [e ""], +               [(vc "o", "")],[(vc "u","e")],[(vc "u","it")],[(vc "u", "en")],[e ""])),++  paradigm_h "vb_4a_emotstå" ["emotstå"] +   (verb_full 0 ([e ""], [],[e "r"], [e ""],[(vc "o", "d")], [(vc "o","de")],[e "tt"], [e "nden"])),++  paradigm_h "vb_4m_sitta" ["sitta"]  +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "a", "")],  [(vc "u","e")],[(vc "u", "it")], [])),++  paradigm_h "vb_4a_be" ["be"]  +   (verb_full_compound_sform_variant 0 ([e "",e "dja",e "da"], [e "dje",e "de"],[e "r",e "djer",e "der"], [e "",e "dj",e "d"],[(vc "a", "d")], [(vc "a","de")],[e "tt"], [e "dd"],[])),++  paradigm_h "vb_4m_ryta" ["ryta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ö", "")],[(vc "u","e")],[(vc "u", "it")], [])),++  -- paradigm_h "vb_4a_ryta" ["förbryta"] +  -- (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ö", "")],[(vc "u","e")],[(vc "u", "it")], [e "t"])),++  paradigm_h "vb_4m_gråta" ["gråta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ä", "")],[(vc "ä","e")],[e "it"], [])),++  paradigm_h "vb_4m_ligga" ["ligga"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "å" . tk 1, "")],[(vc "å","e")],[(vc "e". tk 1, "at")], [])),++  paradigm_h "vb_4m_le" ["le"] +   (verb_full 0 ([e ""], [],[e "r"], [e ""],[(vc "o", "g")], [(vc "o","ge")],[e "tt"], [])),++  paradigm_h "vb_4m_bekomma" ["bekomma"]  +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [],[(vc "o" . ungeminate, "")], [(vc "o", "e")], [e "it"], [])),++  paradigm_h "vb_4m_småsvära" ["småsvära"] +   (verb_full_sform_variant 1 ([e "a", e "ja"], [e "e"],[e "",e "jer"], [e ""], [(vc "o", "")],[(vc "u","e")],[(vc "u", "it")], [])),++  paradigm_h "vb_4m_skåpäta" ["skåpäta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e ""], [e ""],[(vc "å", "")],[(vc "å","e")],[e "it"], [])),+ +  paradigm_h "vb_4m_förevara" ["förevara"] +   (verb_weak_sform_variant 1 ([e "a"], [], [], [e ""], [e "it"], [])),++  paradigm_h "vb_4a_stinga" ["stinga"]  +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [], [],[(vc "u","e")],[(vc "u","it")],[(vc "u","en")])),++  paradigm_h "vb_4a_förgäta" ["förgäta"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""],[(vc "a","")], [(vc "a","e")],[e "it"], [e "en"])),++  --paradigm_h "vb_3m_te" ["te"] +  -- (verb_weak_no_sform 0 ([e ""], [e "r"], [e ""], [e "dde"], [e "tt"], [])),++  paradigm_h "vb_2m_ha" ["ha"]  $+   verb_weak_compound 0 ([e "",e "va"], [e "r",e "ver"], [e ""], [e "de"], [e "ft"], [],[e ""]),++  paradigm_h "vb_2m_mysa" ["mysa"] $ +   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(ungeminate_m_n, "te")], [(ungeminate_m_n, "t")], []),+  paradigm_h "vb_va_nypa" ["nypa"] $ +   verb_full 1 ([e "a"], [e "e"],[e "er"], [e ""], [(vc "ö","")], [(vc "ö","e")],[(id,"t"),(vc "u","it")], [(id,"t"),(vc "u","en")]),+  paradigm_h "vb_0d_lyster"    ["lyster"]    $ +   verb_weak 0 ([], [e ""], [], [], [], []),+  paradigm_h "vb_0d_värdes"    ["värdes"]    $+   verb_weak 0 ([], [e ""], [], [], [], []),+  paradigm_h "vb_0d_vederböra" ["vederböra"] $+   verb_weak 0 ([e ""], [(tk 1,"")], [], [], [], []),+  paradigm_h "vb_0d_nåde"      ["nåde"]      $ +   verb_full 0 ([], [e ""],[],[], [], [], [], []), ++  paradigm_h "vb_0d_lyss"      ["lyss"]      $ +   verb_full 0 ([e ""], [],[],[e ""], [], [], [], []), ++  paradigm_h "vb_4d_vederfås"  ["vederfås"]  $ +    verb_dwc 1 [""] [] [] ["tts"] [],+  -- paradigm_h "vb_4d_sprätta"   ["spritta"]   $ +  -- verb_weak 1 ([e "a"], [e "er"], [e ""], [(vc "a","")], [], []),++  paradigm_h "vb_id_månde"     ["månde"]  $ +   verb_weak_no_sform 0 ([], [],[],[e ""], [], []), ++  paradigm_h "vb_2d_torde"     ["torde"] $+   verb_full 2 ([], [],[(vc "ö","")],[], [], [e "de"], [], []), +  paradigm_h "vb_2d_rädas"     ["rädas"]     $ +   verb_dwc 2 ["as"] ["as","s"] ["des"] [] [],+  paradigm_h "vb_1a_laga"                     ["laga"]                v1,+  paradigm_h "vb_1s_andas"                    ["andas"]               vb_1s_hoppas,+  paradigm_h "vb_2a_ansöka"                   ["ansöka"] $+    verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(ungeminate_m_n, "te")], [(ungeminate_m_n, "t")], [(ungeminate_m_n, "t")]),+  paradigm_h "vb_2a_göra"              ["göra"]                vb_2a_göra,+  paradigm_h "vb_2a_hyra"              ["hyra"] $+   verb_weak_sform_variant 1 ([e "a"], [e ""], [e ""], [e "de"], [e "t"], [e "d"]),+  paradigm_h "vb_2a_känna"             ["känna"] $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(tk 1, "de")], [(tk 1,"t")], [(tk 1, "d")]),+  paradigm_h "vb_2a_leda"              ["leda"]  $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "de"], [(tk 1, "tt")], [e "d"]),+  paradigm_h "vb_2a_lägga"             ["lägga"]  $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(vc "a".tk 2,  "de"),(vc "a".tk 2,  "")], [(vc "a" . tk 1, "t")], [(vc "a". tk 1,"d")]),+  paradigm_h "vb_2a_sätta"             ["sätta"] $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [(vc "a", "e")], [(vc "a" , "")], [(vc "a","")]),+  paradigm_h "vb_2a_viga"              ["viga"] $+   verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "de"], [e "t"], [e "d"]),+  paradigm_h "vb_2s_synas"             ["synas"]               vb_2s_synas,+  paradigm_h "vb_4a_falla"             ["falla"] $+   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"],[e ""], [(vc "ö", "")], [(vc "ö", "e")], [e "it"], [e "en"])), +  paradigm_h "vb_4a_flyga"             ["flyga"] +   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"],[e ""], [(vc "ö", "")], [(vc "ö", "e")], [(vc "u","it")], [(vc "u","en")])), ++  paradigm_h "vb_4a_ge"                ["ge"] $+   verb_full_sform_variant 0 ([e "", (vc "i","va")], [(vc "i","ve")], [e "r",(vc "i","ver")], [e "",(vc "i","v")], [(vc "a","v")], [(vc "å","ve")], [e "tt",(vc "i","vit")], [(vc "i", "ven")]),+  paradigm_h "vb_4a_hålla"             ["hålla"] $+   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"],[e ""], [(vc "ö", "")], [(vc "ö", "e")], [e "it"], [e "en"])), +  paradigm_h "vb_4a_komma"             ["komma"] $             vb_4a_komma,+  paradigm_h "vb_4a_rida"              ["rida"]  $              vb_4a_bita,+  paradigm_h "vb_4a_skjuta"            ["skjuta"] $+  (verb_full_sform_variant 1 ([e "a"], [e "e"],[e "er"], [e ""], [(tk 3,"öt")], [(tk 3,"öte")],[e "it"], [e "en"])),+  paradigm_h "vb_4a_tillåta"           ["tillåta"]             vb_4a_låta,+  paradigm_h "vb_4a_slå"               ["slå"] $+  (verb_full 0 ([e ""], [],[e "r"],[e ""], [(vc "o","g")], [(vc "o","ge")], [(vc "a", "git")], [(vc "a","gen")])),+  paradigm_h "vb_4a_se"                ["se"] $+  (verb_full 0 ([e ""], [],[e "r"],[e ""], [(vc "å","g")], [(vc "å","ge")], [e "tt"], [e "dd"])),+  paradigm_h "vb_4a_gå"                ["gå"]  $+   (verb_full_sform_variant 0 ([e ""], [e "nge"],[e "r"],[e ""], [(vc "i", "ck")], [(vc "i", "nge")], [e "tt"], [e "ngen"])), +  paradigm_h "vb_4a_dricka"            ["dricka"]              vb_4a_vinna,++  paradigm_h "vb_4a_bära"              ["bära"]   $+  (verb_full_sform_variant 1 ([e "a"], [e "e"],[e ""], [e ""], [(vc "a","")], [(vc "u","e")],[(vc "u", "it")], [(vc "u","en")])),++  paradigm_h "vb_4m_innebära"     ["innebära"]   $+   (verb_full_sform_variant 1 ([e "a"], [e "e"],[e ""], [e ""], [(vc "a","")], [(vc "u","e")],[(vc "u", "it")], [])),++  paradigm_h "vb_4a_ta"                ["ta"] $ vb_4a_ta,+            +  paradigm_h "vb_va_klä"                ["klä"]             +  (verb_weak 0 ([e "da",e ""], [e "r",e "der"], [e "",e "d"], [e "dde"], [e "tt"], [e "dd"])),+  paradigm_h "vb_4m_angå"              ["angå"] +  (verb_full 0 ([e ""], [],[e "r"],[e ""], [(vc "i","ck")], [(vc "i","nge")], [e "tt"], [])),+  paradigm_h "vb_4m_stå"               ["stå"] $+  (verb_full 0 ([e ""], [],[e "r"],[e ""], [(vc "o","d")], [(vc "o","de")], [e "tt"], [])),+  paradigm_h "vb_4m_vina"              ["vina"]                vb_4m_vina,+  paradigm_h "vb_va_bringa"            ["bringa"]  vb_va_bringa,+  paradigm_h "vb_2a_lyfta"           ["lyfta"] $+    verb_weak_sform_variant 1 ([e "a"], [e "er"], [e ""], [e "e"], [e ""], [e ""]),+  paradigm_h "vb_2a_sända"         ["sända"]   vb_2a_sända,+  paradigm_h "vb_3a_sy"               ["sy"]      v3,+  paradigm_h "vb_va_koka"           ["koka"]    vb_va_koka,+  paradigm_h "vb_va_sprida"         ["sprida"]  $+   (verb_full 1 ([e "a"],[e "e"],[e "er"],[e ""], [(vc "e",""),e "de"], [(vc "e","e")],[(tk 1,"tt"),e "it"], [e "d"]))+ ]
+ src/saldo/DictSw.hs view
@@ -0,0 +1,166 @@+module DictSw where++import BuildSw+import RulesSw+import TypesSw+import General+import Dictionary++swedishDict :: Dictionary+swedishDict = dictionary []++-- closedLexicon++closedLexicon :: [Entry]+closedLexicon = concat +		[+  		 prepositions,+                 adverbials,		 +   		 conjunctions,+   		 subjunctions,+   		 particles,+		 pronounsPN,+		 pronounsAdj,+		 [+		  entry artIndef,+		  entry artDef,+		  infMark "att"+		 ],+                 auxiliaryVerbs,+		 numerals +		]++pronounsPN :: [Entry]+pronounsPN = +    [+     entry pronRefl,+     pronJag "jag" "mig" "min" "mitt",+     pronJag "du"  "dig" "din" "ditt", +     pronHan "han" "honom" "hans",     +     pronHan "hon" "henne" "hennes",   +     pronJag "vi"  "oss" "vår" "vårt", +     pronJag "ni"  "er"  "er" "ert",+     pronHan "de"  "dem"  "deras", +     pronHan "den" "den" "dess", +     pronHan "det" "det" "dess",+     pronHan "vem" "vem" "vems"+    ]++pronounsAdj = +    [+     pronDylik "all",+     pronDylik "dylik",+     pronDylik "hurdan",+     pronDylik "likadan",+     pronDylik "sådan",+     pronNagon "egen" "eget" "egna",+     pronNagon "denna" "detta" "dessa",+     pronNagon "annan" "annat" "andra",+     pronNagon "ingen" "inget" "inga",+     pronNagon "vilken" "vilket" "vilka",+     pronNagon "mången" "månget" "många",+     pronNagon "någon" "något" "några"+    ]+++prepositions +     = map prep+	[+       "alltsedan",+       "apropå",+       "av",+       "bakom",+       "bland",+       "bortom",+       "bortåt",+       "brevid",+       "efter",+       "emellan",+       "emot",+       "enligt",+       "framför",+       "från",+       "för",+       "förbi",+       "före",+       "förutom",+       "genom",+       "gentemot",+       "hos",+       "härom",+       "i",+       "ifrån",+       "igenom",+       "inemot",+       "inför",+       "inklusive",+       "innan",+       "innanför",+       "inom",+       "intill",+       "invid",+       "jämte",+       "kontra",+       "kring",+       "längs",+       "med",+       "medelst",+       "mellan",+       "mot",+       "nedanför",       +       "om",+       "omkring",+       "ovan",+       "ovanför",+       "ovanpå",+       "per",+       "på",+       "runt",+       "sedan",+       "sen",+       "till",+       "trots",+       "undan",+       "under",+       "ur",+       "utan",+       "utanför",+       "utanpå", +       "utefter",+       "utför",+       "utifrån",+       "utmed",+       "utom",+       "utöver",+       "via",+       "vid",+       "visavi",+       "å", +       "åt",+       "över"+       ]++conjunctions = map conj $ words	+  "och samt respektive liksom fast men utan eller ty för så både"++subjunctions = map subj $ words+	       "att förrän innan medan sedan tills eftersom allteftersom emedan för så bara blott ifall om såvida liksom som såsom än ehuru fast fastän oaktat"++particles = map part $ words+   "emot fast in ut upp ner fram åter" -- plus prepositions++auxiliaryVerbs = map (\ (x, y, z, u) -> entry (auxVerbGen x y z u)) [+  (mkStr "vilja", mkStr "vill", mkStr "ville",mkStr "velat"),+  (mkStr "kunna", mkStr "kan",  mkStr "kunde",mkStr "kunnat"),+  (nonExist,      mkStr "måste",mkStr "måste",mkStr "måst"),+  (mkStr "skola", strings ["ska","skall"], mkStr "skulle",nonExist),+  (mkStr "böra",  mkStr "bör", mkStr "borde",mkStr "bort")+  ]++-- -- not really closed+adverbials = map adverbInv $ words +  "dessutom heller också även dock ändå alltså väl nere ute inne"++-- from numerals.Swe.gf+numerals = [] -- map numeralInv $ words "arton aderton elva ett fem femtio femton fjorton fyra fyrtio hundra nio nittio nitton sex sextio sexton sju sjuttio sjutton tio tjugo tolv tre trettio tretton tusen två åtta åttio"+
+ src/saldo/EncodeSw.hs view
@@ -0,0 +1,245 @@+module EncodeSw where++import Char+import Frontend++import qualified Data.Map as Map++sw_encodings = Map.insert "parole" (Just parole_pos,Just parole_inhs,Just parole_param) (Map.insert "SUC" (Just suc_pos,Just suc_inhs,Just suc_param) Map.empty)++parole_pos  _ = ""++parole_inhs _ = []++parole_param (pos,p,inhs) = + case pos of+   "pm" -> case words p of+             xs | elem "nom" xs -> "NP00N@0S"+             xs | elem "gen" xs -> "NP00G@0S"+             _ -> parole_param ("nn",p,inhs)+   "ab" -> case p of+             "invar" -> "RG0S"+             "pos"   -> "RGPS"+             "komp"  -> "RGCS"+             "super" -> "RGSS"+             "c"     -> "RG0C"+             "sms"   -> "RG0C"+             _ -> error $ "ab " ++ p+   "av" -> case p of+             "pos indef sg u nom"     -> "AQPUSNIS"+             "pos indef sg u gen"     -> "AQPUSGIS"+             "pos indef sg n nom"     -> "AQPNSNIS"+             "pos indef sg n gen"     -> "AQPNSNIS"+             "pos indef pl nom"       -> "AQPNSNIS"+             "pos indef pl gen"       -> "AQP0PG0S"+             "pos def sg no_masc nom" -> "AQP0SNDS"+             "pos def sg no_masc gen" -> "AQP0SGDS"+             "pos def sg masc nom"    -> "AQPMSNDS"+             "pos def sg masc gen"    -> "AQPMSGDS"+             "pos def pl nom"         -> "AQP0PN0S"+             "pos def pl gen"         -> "AQP0PG0S"+             "komp nom"               -> "AQC00N0S"+             "komp gen"               -> "AQC00G0S"+             "super indef nom"        -> "AQS0PNIS"+             "super def no_masc nom"  -> "AQS00NDS"+             "super def masc nom"     -> "AQSMSNDS"+             "super def masc gen"     -> "AQSMSGDS"+             "c"                      -> "AQC0000C"+             "sms"                    -> "AQC0000C"+             "super indef gen"        -> "AQS0PGIS"+             "super def no_masc gen"  -> "AQS00GDS"+             "invar"                  -> "AQP00N0S"+             _ -> error $ "av " ++ p+   "nn" -> case p of+            "sg indef nom" -> "NC" ++ pgender inhs ++ "SN@IS"+            "sg indef gen" -> "NC" ++ pgender inhs ++ "SG@IS"+            "sg def nom"   -> "NC" ++ pgender inhs ++ "SN@DS"+            "sg def gen"   -> "NC" ++ pgender inhs ++ "SG@DS"+            "pl indef nom" -> "NC" ++ pgender inhs ++ "PN@IS"+            "pl indef gen" -> "NC" ++ pgender inhs ++ "PG@IS"+            "pl def nom"   -> "NC" ++ pgender inhs ++ "PN@DS"+            "pl def gen"   -> "NC" ++ pgender inhs ++ "PG@DS"+            "ci"               -> "NC000@0C"+            "cm"               -> "NC000@0C"+            "sms"              -> "NC000@0C"+            _ -> error $ "nn " ++ p+   "al" ->  case p of+              "sg u indef" -> "DI@US@S"+              "sg n indef" -> "DI@NS@S"+              "sg u def" -> "DF@US@S"+              "sg n def" -> "DF@NS@S"+              "pl indef"   -> "DI@0P@S"+              "pl def"   -> "DF@0P@S"+              _ -> error $ "al " ++ p+   "ie" -> "CIS"+   "in" ->  "I"+   "kn" -> "CCS"+   "nl" ->  +       case p of+         "nom num u"       -> "MCUSNIS"+         "nom num n"       -> "MCNSNIS"+         "nom ord no_masc" -> "MO00N0S"+         "nom ord masc"    -> "MOMSNDS"  +         "gen num u"       -> "MC00G0S"+         "gen num n"       -> "MC00G0S"+         "gen ord no_masc" -> "MO00G0S"+         "gen ord masc"    -> "MCMSGDS"+         _                 -> "*"+   "sn" -> "CSS"+   "pp" -> "SPS"+   "pn" -> case p of+             "nom"        -> "PF@00S@S"+             "ack"        -> "PF@00O@S"+             "poss sg u"  -> "PS@US0@S"+             "poss sg n"  -> "PS@N00@S"+             "poss pl"    -> "PS@0P0@S"+             "sg u nom"   -> "PF@US0@S"+             "sg n nom"   -> "PF@NS0@S"+             "sg u gen"   -> "PS@000@S"        +             "sg n gen"   -> "PS@000@S"+             "pl nom"     -> "PF@0PS@S"+             "pl gen"     -> "PS@000@S"+             _ -> parole_param ("av",p,inhs)+   "vb" -> case p of+             "pres ind aktiv"                -> "V@IPAS"+             "pres ind s-form"               -> "V@IPPS"              +             "pres konj aktiv"               -> "V@SPAS"              +             "pret ind aktiv"                -> "V@IIAS"               +             "pret ind s-form"               -> "V@IIPS"              +             "pret konj aktiv"               -> "V@SIAS"              +             "pret konj s-form"              -> "V@SIPS"             +             "imper"                         -> "V@M0AS"                       +             "inf aktiv"                     -> "V@N0AS"                 +             "inf s-form"                    -> "V@N0PS"           +             "sup aktiv"                     -> "V@IUAS"     +             "sup s-form"                    -> "V@IUPS"+             "pres_part nom"                 -> "AP000N0S"+             "pres_part gen"                 -> "AP000G0S"+             "pret_part indef sg u nom"      -> "AF0USNIS"+             "pret_part indef sg u gen"      -> "AF0USGIS"+             "pret_part indef sg n nom"      -> "AF0NSNIS"+             "pret_part indef pl nom"        -> "AF00PN0S"+             "pret_part indef pl gen"        -> "AF00PG0S"+             "pret_part def sg no_masc nom"  -> "AF00SNDS"+             "pret_part def sg no_masc gen"  -> "AF00SGDS"+             "pret_part def sg masc nom"     -> "AF0MSNDS"+             "pret_part def sg masc gen"     -> "AF0MSGDS"+             "pret_part def pl nom"          -> "AF00PN0S"+             "pret_part def pl gen"          -> "AF00PG0S"+             "c"                             -> "V@000C"+             "sms"                           -> "V@000C"             +             "pres konj s-form"              -> "V@IPSS"             +             "pret_part indef sg n gen"      -> "AF0NSGIS"+             _ -> error $ "vb " ++ p+   "aba" -> "RG0A"+   "ava" -> "AQ00000A"+   "kna" -> "CCA"+   "nna" -> "NC000@0A"+   "pma" -> "NP00N@0A"+   "ppa" -> "SPC"+   "vba" -> "V@000A"+   "vbm" -> (++ "M") $ init $ parole_param ("vb", filt p,inhs)+   "avm" -> (++ "M") $ init $ parole_param ("av",filt p,inhs)+   "abm" -> (++ "M") $ init $ parole_param ("ab",filt p,inhs)+   "inm" -> (++ "M") $ init $ parole_param ("in",filt p,inhs)+   "nlm" -> (++ "M") $ init $ parole_param ("nl",filt p,inhs)+   "nnm" -> (++ "M") $ init $ parole_param ("nn",filt p,inhs)+   "pmm" -> (++ "M") $ init $ parole_param ("pm",filt p,inhs)+   -- "pnm" -> (++ "M") $ init $ parole_param ("pn",filt p,inhs)+   "ppm" -> (++ "M") $ init $ parole_param ("pp",filt p,inhs)+   _    -> "*" -- "abh" "avh" "sxc" "snm" "ssm" + where filt x = unwords (filter (\(c:_) -> not (isDigit c)) (words x))++++pgender ["n"] = "N"+pgender ["v"] = "0"+pgender _     = "U"++suc_pos x = maybe x id $ Map.lookup x (Map.fromList pos)+ where+  pos =+   [+    ("av","JJ"),+    ("al","DT"),+    ("kn","KN"),+    ("ie","IE"),+    ("sn","SN"),+    ("in","IN"),+    ("nl","RG"),+    ("nn","NN"),+    ("pm","PM"),+    ("pn","PN"),+    ("ab","PL"),+    ("ab","AB"),+    ("pp","PP"),+    ("vb","VB")+   ]+    +   -- ("PC","vb"),+   -- ("AN",""),+   -- ("-",""),+   -- ("UO","")+    --("DT","pn"),+    --("HD","pn"),+    --("DL",""),+    --("MAD",""),+    --("MID",""),+    --("PAD",""),+   -- ("RO","nr"),+    --("HS","pn"),+    --("HP","pn"),+    --("PS","pn"),+    -- ("HA","ab"),++suc_inhs xs =  [maybe s id (Map.lookup s (Map.fromList inhs)) | s <- xs]+ where+   inhs =[+        ("v","UTR/NEU"), -- ?+        ("n","NEU"),+        ("u","UTR")+         ]++++suc_param (pos,p,inhs) = unwords $ [ maybe s id (Map.lookup s (Map.fromList param)) | s <- words p]+ where+  param = [("inf","INF"),+           ("konj","KON"),+           ("pret","PRT"),+           ("aktiv","AKT"),+           ("s-form","SFO"),+           ("sup","SUP"),+           ("imper","IMP"),+           ("super","SUV"),+           ("komp","KOM"),+           ("ci","SMS"),+           ("cm","SMS"),+           ("pos","POS"),+           ("pret_part","PRF"),+           ("pl","PLU"),+           ("gen","GEN"),+           ("nom","NOM"),+           ("sg","SIN"),+           ("def","DEF"),+           ("masc","MAS"),+           ("indef","IND"),+           ("pres","PRS"),+           ("n","NEU"),+           ("u","UTR"),+           ("ack","OBJ"),+           ("invar","-")+        --   ("pret_part","PC PRF"),+        --   ("pres_part","PC PRF"),+           --("stark",""),+           --("svag",""),+           --("num",""),+           --("ord",""),+           --("ind",""),+           --("no_masc","")+          ]+           -- ("SIN/PLU",""),+           --    ("SUB/OBJ",""),+           --    ("SUB",""),+           -- ("IND/DEF",""),+
+ src/saldo/GenRulesSw.hs view
@@ -0,0 +1,219 @@+----------------------------------------------------------------------+-- |+-- Module      : GenRulesSw+-- Maintainer  : Markus Forsberg+-- Stability   : (stability)+-- Portability : (portability)+--+--+-- General functions for Swedish+-------------------------------------------------------------------------+module GenRulesSw (+		   e, apply_suffixes, Suffixes,+                   dv, dvu,keep,dsuff,+                   drop_last_vowel,+                   ds,ds_drop,fl,+                     compound_s,+                   -- drop_last_vowel,+                    lift,+                    is_vowel,+                    is_voiced,+                    if_vowel,+                    is_consonant,+                    drop_final_e,+                    ungeminate,+                    ungeminate_m_n,+                    verb_ungeminate,+                    verb_ungeminate_m_n,+                    drop_second_last,+                    insert_second_last,+                    geminate,+                    find_stem_vowel,+                    vc,vct,+                    dpl,+                    mmn,mmr,+                    triplecons,+                    umlaut+                  ) where++import General+import List+import qualified Data.Set as Set++type Suffixes = [((String -> String), String)]++e :: String -> ((String -> String),String)+e s = (id,s) ++apply_suffixes :: String -> Suffixes -> [String]+apply_suffixes stem xs = [f stem ++ suff | (f,suff) <- xs]++lift :: [a] -> [[a]]+lift  [] = []+lift   s = [s]++keep :: Int -> (String -> String) -> String -> String+keep n f s = f pre ++ suf+ where+  (pre,suf) = case splitAt n (reverse s) of+               (rs,rp) -> (reverse rp, reverse rs)++drop_last_vowel = dv++dsuff :: String -> String -> String+dsuff suff s + | isPrefixOf (reverse suff) (reverse s) = tk (length suff) s+ | otherwise = s++dv :: String -> String+dv w = case find_stem_vowel w of+        (seg,e,l) -> seg ++ l+++dvu :: String -> String+dvu w = case find_stem_vowel w of+          (seg,e,l) -> (ungeminate_m_n seg) ++ l++dpl :: Char -> String -> String+dpl c s = case span (/= c) (reverse s) of+           (b,_:r) -> reverse (b ++ r)+           (b,[])  -> reverse b++drop_second_last :: String -> String+drop_second_last s = (tk 2 s) ++ (dp 1 s)++is_vowel :: Char -> Bool+is_vowel c = Set.member c vowel ++vowel = Set.fromList "aeiouyåäöAEIOUYÅÄÖ"++is_consonant :: Char -> Bool+is_consonant c = Set.member c consonant++consonant = Set.fromList "bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ"++is_voiced :: Char -> Bool+is_voiced c = Set.member c voiced++voiced = Set.fromList "bdglmnrvjBDGLMNRVJ"++if_vowel :: Char -> String -> String -> String+if_vowel c d e = if is_vowel c then d else e++drop_final_e :: String -> String+drop_final_e = dropEndIf (=='e')++ds :: String -> String+ds s =  case reverse s of+        (x:y:_) | ((is_consonant x) && y == 's') || ((is_consonant x) && y == 'x') || [y,x] == "ch" || x=='x' || x =='z' || x =='s' -> s+        [] -> []+        _   -> s +? "s"++ds_drop :: String -> String+ds_drop s = ds $ if iw s then safe_init s else s+  where iw [] = False+        iw str = is_vowel (last str)++fl :: String -> String+fl s = case words s of+         [x,y] -> y +? x+         _     -> s ++-- dropEndIf (=='s')++compound_s :: String -> [String]+compound_s s = case reverse s of+                 (x:y:_) | ((is_consonant x) && y == 's') || ((is_consonant x) && y == 'x') || [y,x] == "ch" || x=='x' || x =='z' || x=='s' -> [s]+                 [] -> []+                 _   -> [s +? "s"]++insert_second_last :: String -> Char -> String+insert_second_last s c = safe_init s ++ [c] ++ (f s)+  where f [] = []+        f str = [last str]++geminate :: String -> String+geminate s = s ++ dp 1 s++ungeminate :: String -> String+ungeminate s = case reverse s of+  'm':'m':_ -> safe_init s+  's':'m':'m':_ -> safe_init (safe_init s) ++ "s"+  _ -> s++verb_ungeminate :: String -> String+verb_ungeminate s = case reverse s of+  'd':'m':'m':_ -> safe_init (safe_init s) ++ "d" -- participle+  't':'m':'m':_ -> safe_init (safe_init s) ++ "t" +  'e':'d':'m':'m':_ -> (safe_init (safe_init (safe_init s))) ++ "de" +  _         -> ungeminate s++verb_ungeminate_m_n :: String -> String+verb_ungeminate_m_n s = case reverse s of+  'd':'m':'m':_ -> safe_init (safe_init s) ++ "d" -- participle+  't':'m':'m':_ -> safe_init (safe_init s) ++ "t" +  'e':'d':'m':'m':_ -> (safe_init (safe_init (safe_init s))) ++ "de" +  _         -> (ungeminate_m_n s)++ungeminate_m_n :: String -> String+ungeminate_m_n s = case reverse s of+  n:m:_ | n == m && elem n "nm" -> safe_init s+  _ -> s++safe_init :: String -> String+safe_init [] = []+safe_init xs = init xs++mmn :: String -> String+mmn s = case reverse s of+         ('n':'m':'m':xs)  -> (reverse ('n':'m':xs))+         _                 -> s++mmr :: String -> String+mmr s = case reverse s of+         ('r':'m':'m':xs)  -> (reverse ('r':'m':xs))+         _                 -> s++--3 Umlaut+--+-- Let's conclude with something that is not easy to do on this level of generality+-- with regular expressions: +-- define first the *stem vowel* as the last vowel (or diphtong) in the stem:++find_stem_vowel :: String -> (String, String, String)+find_stem_vowel sprick = (reverse rps, reverse i, reverse kc) where+  (kc, irps) = break is_vowel $ reverse sprick+  (i,   rps) = span  is_vowel $ irps++-- vowel change+vc :: String -> String -> String+vc v sprick = +  case find_stem_vowel sprick of+    (spr,i,ck) -> spr ++ v ++ ck++vct :: [(String,String)] -> String -> String+vct xs sprick =   case find_stem_vowel sprick of+                    (spr,i,ck) -> spr ++ (v i) ++ ck+ where v i = case lookup i xs of+               Just x -> x+               Nothing -> i++++triplecons :: String -> Char -> String+triplecons s c = case reverse s of+                   (c1:c2:_) | c1 == c && c1 == c2 -> safe_init s+                   _  -> s++-- Although *umlaut* is not very very useful in Swedish, we are glad to+-- present a general rule for it:++umlaut :: String -> String+umlaut man = m ++ mkUm a ++ n where+  (m,a,n) = find_stem_vowel man+  mkUm v = case v of+    "a" -> "ä"+    "o" -> "ö"+    "å" -> "ä"+    "u" -> "y"+    _   -> v
+ src/saldo/Main.hs view
@@ -0,0 +1,71 @@+module Main where++import CommonMain+-- import DictSw+import CommandsSw+import Frontend+import TestSw+import Compound+import Multiwords+import qualified Data.Set as Set+import Dictionary(Entry,set_lemma_id)+import qualified Dict.Abs as Abs+import EncodeSw+import Attr+import PrintSw+import GenRulesSw++main :: IO ()+main = commonMain SAL++data SAL = SAL+ deriving Show++instance Language SAL where+ morphology_header _ = "FM-SALDO 2.0\n  L. Borin, M. Forsberg & A. Ranta, 2010, under GNU LGPL 3.0 or CC-SA 2.5 Generic"+ name         _ = "swe"+-- internDict   _ = swedishDict+ paradigms    _ = foldr insertCommand emptyC commands+ composition  _ = Just $ compDesc+ testBench _ = tests+ dup_id_exceptions _ = sal_id_exceptions+ encoding _ = sw_encodings+ termParser _ ts e = add_id ts e+ affixes _ = sal_affixes+ sandhi_rules _ = saldo_sandhi+ word_attr    _ = [h_attr,w_attr,wp_attr]+ lprinter     _ = print_table+ dictionary_postprocessing _ = multiwords+ paradigm_dup_exception _ = Set.fromList ["av_1_akut",+                                          "vbm_1ic_laga","vbm_1sp2_andas","vbm_2mi2_leda","vbm_2ms1_skilja", -- unimplemented+                                          "vbm_4ms1_förhålla","vbm_4ms1_utfalla","vbm_4msp1_finnas","vbm_vmsp1_ryckas","vbm_vsp1_talas",+                                          "vbm_2mps1_göra","vbm_2mps1_väga","vbm_1mps1_laga","vbm_2mps1_hyra","vbm_2mps1_mysa",+                                          "vbm_2mps1_sätta","vbm_4mps1_ge","vbm_4mps1_slå","vbm_4mps1_komma"+                                         ]++compDesc :: CompDesc+compDesc = [+ [ attr [h_attr, w_attr, wp_attr] ],+ [ attr [init_attr,wp_attr,c_attr], star [medial_attr], attr [h_attr,wp_attr,s_attr] ]+ ]++saldo_sandhi :: (String,String) -> [(String,String)]+saldo_sandhi (x,y@(c:_)) = +    case reverse x of+      (c1:c2:_) | c1 == c2 && c2 == c -> []+      (c1:_)    | is_consonant c1 && c1 == c -> [(x ++ [c],y),(x,y)]+      _                               -> [(x,y)]+saldo_sandhi x = [x]++sal_affixes :: Set.Set String+sal_affixes = Set.fromList ["en","ens","ar","ars","or","ors"]++ -- wordGuesser  _ = test++-- test s+--  | last s == 'x' = ["A strange word"]+--  | otherwise     = []++add_id :: [Abs.Term] -> Entry -> Entry+add_id [Abs.TermC _ [(Abs.TermA (Abs.NStr s))]]  e = set_lemma_id s e+add_id _                                         e = e
+ src/saldo/Multiwords.hs view
@@ -0,0 +1,24 @@+module Multiwords where++import Frontend+import Dictionary+import List+import General+import Attr++multiwords :: Dictionary -> Dictionary+multiwords = dictionary . map process_entry . unDict+ where process_entry (id,stem,para,cat,inhs,tbl,e) = +           (id,stem,para,cat,inhs,+              if (length (words stem) > 1) then split_multiwords tbl else tbl,e) +       split_multiwords tbl = concat [frag_seq param a pos mw | (param,(a,str)) <- tbl, +                                                               (mw,pos) <- zip (unStr str) [1..]]+       hole = Nothing+       frag_seq param a var s =+           let ws  = words s+               wsl = length ws+               f n = case hole of+                       Nothing -> ""+                       Just position -> if n < position then "pre" else "post"+            in [(unwords $ filter (not.null) [param,f n, show var ++ ":" ++ show n ++ "-" ++ show wsl],+                 (w_attr,mkStr fragment)) | (n,fragment) <- zip [1..] ws]
+ src/saldo/NounBuildSw.hs view
@@ -0,0 +1,785 @@+module NounBuildSw where++import General+import Dictionary+import GenRulesSw+import TypesSw+import RulesSw+import Char+import Attr++substantive :: Substantive -> Genus -> Entry+substantive n g = entryI ((hyphenate_compounds.geminator) n) [prValue g]++substUtrum :: Substantive -> Entry+substUtrum s = substantive s Utr++substNeutrum :: Substantive -> Entry+substNeutrum s = substantive s Neutr++substPl :: Substantive -> Entry+substPl s = substantive s GPl++substDPl :: Substantive -> Entry+substDPl s = substantive s GDPl++substVack :: Substantive -> Entry+substVack s = substantive s Pend++substMasc :: Substantive -> Entry+substMasc s = substantive s Utr++noun_f :: Int -> Genus -> (Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+noun_f n g (apa,apan,apor,aporna) s = noun_compound n g (apa,apan,apor,aporna,apa,apa) s ++noun_compound_ng :: Int -> Genus -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+noun_compound_ng n g (apa,apan,apor,aporna,ap,ap2) s = substantive (missing n_f [(SF n d Gen) | n <- values, d <- values]) g +  where n_f p = (mk_substantive_v (suff apa) (suff apan) (suff apor) (suff aporna) (suff ap) (suff ap2) (suff ap)) p+        suff    = apply_suffixes (tk n s)++noun_compound :: Int -> Genus -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+noun_compound n g (apa,apan,apor,aporna,ap,ap2) s = substantive n_f g +  where n_f p = (mk_substantive_v (suff apa) (suff apan) (suff apor) (suff aporna) (suff ap) (suff ap2) (suff ap)) p+        suff    = apply_suffixes (tk n s)++noun_no_genitive :: Genus -> (Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+noun_no_genitive g (apa,apan,apor,aporna) s = substantive (missing n_f [(SF n d Gen) | n <- values, d <- values]) g +  where n_f p = (mk_subst_v (suff apa) (suff apan) (suff apor) (suff aporna) (suff apa)) p+        suff    = apply_suffixes s++nna :: Genus -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+nna g (apa,apas,apan,apans,apor,apors,aporna,apornas) s = + replace_attr wp_attr w_attr $ replace_attr h_attr w_attr $ set_pos "nna" $ substantive n_f g +  where n_f p = (mk_nna (suff apa) (suff apas) (suff apan) (suff apans) (suff apor) (suff apors) +                        (suff aporna) (suff apornas)) p+        suff          = apply_suffixes s . connect s+        connect s end = concat [[(f,(':':e)),(f,('-':e)),(f,e)]  | (f,e@(_:_)) <- end] ++ (filter (null . snd) end)+++nnac :: Genus -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+nnac g (apa,apas,apan,apans,apor,apors,aporna,apornas) s = + replace_attr wp_attr w_attr $ replace_attr h_attr w_attr $ set_pos "nna" $ substantive n_f g +  where n_f p = (mk_nna (suff apa) (suff apas) (suff apan) (suff apans) (suff apor) (suff apors) +                        (suff aporna) (suff apornas)) p+        suff          = apply_suffixes s . connect s+        connect s end = concat [[(f,(':':e)),(f,e)]  | (f,e@(_:_)) <- end] ++ (filter (null . snd) end)++noun :: Genus -> [String] -> [String] -> [String] -> [String] -> (String -> Entry)+noun g apa apan apor aporna s = nounC g apa apan apor aporna apa s ++nounC :: Genus -> [String] -> [String] -> [String] -> [String] -> [String] -> (String -> Entry)+nounC g apa apan apor aporna ap s = substantive n_f g +  where n_f p = (mk_subst_v apa' apan' apor' aporna' ap') p+        suff    = (s ++)+        apa'    = map suff apa+	apan'   = map suff apan+        apor'   = map suff apor+	aporna' = map suff aporna+	ap'     = map suff ap++-- Declension 1+nn1 :: String -> Entry+nn1 = substUtrum . RulesSw.nn1++nn1_flicka :: String -> Entry+nn1_flicka = substUtrum . nn1flicka++nn1_kyrka :: String -> Entry+nn1_kyrka = substUtrum . nn1kyrka++nn1_gata :: String -> Entry+nn1_gata = substUtrum . nn1gata++nn1_olja :: String -> Entry+nn1_olja = substUtrum . nn1olja++nn1_mamma :: String -> Entry+nn1_mamma = substUtrum . nn1mamma++nn1_siffra :: String -> Entry+nn1_siffra = substUtrum . nn1siffra++nn1_dimma :: String -> Entry+nn1_dimma = substUtrum . nn1dimma++nn1_sopor :: String -> Entry+nn1_sopor = substPl . nn1sopor++nn1_faggorna :: String -> Entry+nn1_faggorna = substDPl . nn1faggorna++-- declension 2+nn2 :: String -> Entry+nn2 = substUtrum . RulesSw.nn2++nn2_toker :: String -> Entry+nn2_toker = substUtrum . nn2toker++nn2_herre :: String -> Entry+nn2_herre = substUtrum . nn2herre++nn2_vers :: String -> Entry+nn2_vers = substUtrum . nn2vers++nn2_manöver :: String -> Entry+nn2_manöver = substUtrum . nn2manöver++nn2_nyckel :: String -> Entry+nn2_nyckel = substUtrum . nn2nyckel++nn2_öken :: String -> Entry+nn2_öken = substUtrum . nn2öken++nn2_hummer :: String -> Entry+nn2_hummer = substUtrum . nn2hummer++nn2_kam :: String -> Entry+nn2_kam = substUtrum . nn2kam++nn2_vägnar :: String -> Entry+nn2_vägnar = substPl . nn2vägnar++nn2_stadgar :: String -> Entry+nn2_stadgar = substPl . nn2stadgar++nn2_själ :: String -> Entry+nn2_själ = substUtrum . nn2själ++nn2_brud :: String -> Entry+nn2_brud = substUtrum . nn2brud++nn2_jord :: String -> Entry+nn2_jord = substUtrum . nn2jord++nn2_hjälte :: String -> Entry+nn2_hjälte = substUtrum . nn2hjälte++nn2_herde :: String -> Entry+nn2_herde = substUtrum . nn2herde++nn2_by :: String -> Entry+nn2_by = substUtrum . nn2by++nn2_fågel :: String -> Entry+nn2_fågel = substUtrum . nn2fågel++nn2_lem :: String -> Entry+nn2_lem = substUtrum . nn2lem++nn2_moder :: String -> Entry+nn2_moder = substUtrum . nn2mor++nn2_dotter :: String -> Entry+nn2_dotter = substUtrum . nn2dotter++nn2_fordran :: String -> Entry+nn2_fordran = substUtrum . nn2fordran++nn2_verkan :: String -> Entry+nn2_verkan  = substUtrum . nn2verkan++-- Declension 3+ :: String -> Entry+nn3 = substUtrum . RulesSw.nn3++nn3_flanell :: String -> Entry+nn3_flanell = substVack  . nn3flanell++nn3_gäst :: String -> Entry+nn3_gäst = substUtrum . nn3gäst++nn3_bygd :: String -> Entry+nn3_bygd = substUtrum . nn3bygd++nn3_hävd :: String -> Entry+nn3_hävd = substUtrum . nn3hävd++nn3_kastanj :: String -> Entry+nn3_kastanj = substUtrum . nn3kastanj++nn3_akademi :: String -> Entry+nn3_akademi = substUtrum . nn3akademi ++nn3_paraply :: String -> Entry+nn3_paraply = substVack . nn3paraply++nn3_hobby :: String -> Entry+nn3_hobby = substUtrum . nn3hobby++nn3_vin :: String -> Entry+nn3_vin = substNeutrum . nn3vin++nn3_paket :: String -> Entry+nn3_paket = substVack . nn3paket++nn3_element :: String -> Entry+nn3_element = substVack . nn3element ++nn3_fiber :: String -> Entry+nn3_fiber = substUtrum . nn3fiber++nn3_kläder :: String -> Entry+nn3_kläder = substPl . nn3kläder++nn3_kliche :: String -> Entry+nn3_kliche = substUtrum . nn3kliche ++nn3_musa :: String -> Entry+nn3_musa = substUtrum . nn3musa++nn3_gladiolus :: String -> Entry+nn3_gladiolus  = substUtrum . nn3gladiolus++nn3_tand :: String -> Entry+nn3_tand = substUtrum . nn3tand++nn3_land :: String -> Entry+nn3_land = substNeutrum . nn3land++nn3_motor :: String -> Entry+nn3_motor = substUtrum . nn3motor++nn3_parti :: String -> Entry+nn3_parti = substNeutrum . nn3parti++nn3_poesi :: String -> Entry+nn3_poesi = substUtrum . nn3poesi++nn3_museum :: String -> Entry+nn3_museum = substNeutrum . nn3museum++nn3_bok :: String -> Entry+nn3_bok = substUtrum . nn3bok ++nn3_fot :: String -> Entry+nn3_fot = substUtrum . nn3fot++nn3_bockfot :: String -> Entry+nn3_bockfot = substUtrum . nn3bockfot++++nn3_vän :: String -> Entry+nn3_vän = substUtrum . nn3vän++-- Declension 4++nn4 :: String -> Entry+nn4 = substUtrum . RulesSw.nn4++nn4_studio :: String -> Entry+nn4_studio = substUtrum . nn4studio++nn_vu_ampere :: String -> Entry+nn_vu_ampere = substUtrum . nn4ampere         ++nn4_bonde :: String -> Entry+nn4_bonde = substUtrum . nn4bonde+++-- Declension 5++nn5 :: String -> Entry+nn5 = substNeutrum . RulesSw.nn5++nn5_party :: String -> Entry+nn5_party = substNeutrum . nn5party++nn5_äpple :: String -> Entry+nn5_äpple = substNeutrum . nn5äpple++nn5_piano :: String -> Entry+nn5_piano = substNeutrum . RulesSw.nn5++nn5_arbete :: String -> Entry+nn5_arbete = substNeutrum . nn5arbete++nn5_samhälle :: String -> Entry+nn5_samhälle  = substNeutrum . nn5samhälle++nn5_knä :: String -> Entry+nn5_knä = substNeutrum . nn5knä++nn5_bi :: String -> Entry+nn5_bi = substNeutrum . nn5bi++nn5_frö :: String -> Entry+nn5_frö = substNeutrum . nn5frö++nn5_abc :: String -> Entry+nn5_abc = substNeutrum . nn5abc++nn5_anmodan :: String -> Entry+nn5_anmodan = substUtrum   . nn5anmodan++-- Declension 6++vs_ordförande :: String -> Entry+vs_ordförande  = substUtrum . nn6ordförande++nn6_lager :: String -> Entry+nn6_lager = substNeutrum . nn6lager++nn6_nummer :: String -> Entry+nn6_nummer = substNeutrum . nn6nummer++nn6_segel :: String -> Entry+nn6_segel = substNeutrum . nn6lager++nn6 :: String -> Entry+nn6 = substNeutrum . RulesSw.nn6++nn6_barn :: String -> Entry+nn6_barn = substNeutrum . nn6barn++nn6_arv :: String -> Entry+nn6_arv = substNeutrum . nn6arv++nn6_mil :: String -> Entry+nn6_mil = substUtrum . nn6mil++nn6_garage :: String -> Entry+nn6_garage = substNeutrum . nn6garage++nn6_klientel :: String -> Entry+nn6_klientel = substVack . nn6klientel++nn6_akademiker :: String -> Entry+nn6_akademiker = substUtrum . nn6akademiker++nn6_papper :: String -> Entry+nn6_papper = substNeutrum . nn6papper++nn6_program :: String -> Entry+nn6_program = substNeutrum . nn6program++nn6_kikare :: String -> Entry+nn6_kikare = substUtrum . nn6kikare++nn_6u_gås :: String -> Entry+nn_6u_gås = substUtrum . nn6gås            ++nn_6n_manus :: String -> Entry+nn_6n_manus = substNeutrum . nn6manus ++nn_6u_fader :: String -> Entry+nn_6u_fader = substUtrum . nn6far++--nn_6n_frx :: String -> Entry+--nn_6n_frx = substNeutrum . nn6frx++nn_6p_ordalag :: String -> Entry+nn_6p_ordalag = substPl . nn6ordalag++nn_6u_broder :: String -> Entry+nn_6u_broder = substUtrum . nn6broder++nn_6u_mus :: String -> Entry+nn_6u_mus = substUtrum . nn6mus++nn_6u_vaktman :: String -> Entry+nn_6u_vaktman  = substUtrum . nn6vaktman++nn_6v_borst :: String -> Entry+nn_6v_borst = substVack . nn6borst++-- Declension 7++nn_7u_musical :: String -> Entry+nn_7u_musical = substUtrum . nn7musical        ++nn_7p_jeans :: String -> Entry+nn_7p_jeans = substPl . no_singular . nn7musical          ++-- pending nouns++nn_vv_trall :: String -> Entry+nn_vv_trall = substVack . nnvtrall++nn_vu_behå :: String -> Entry+nn_vu_behå = substUtrum . nnvbehå++nn_vu_jojo :: String -> Entry+nn_vu_jojo = substUtrum . nnvjojo++nn_vn_kansli :: String -> Entry+nn_vn_kansli = substNeutrum . nnvkansli++nn_vn_faktum :: String -> Entry+nn_vn_faktum = substNeutrum . nnvfaktum  ++nn_vn_distikon :: String -> Entry+nn_vn_distikon = substNeutrum . nnvdistikon ++nn_vv_abdomen :: String -> Entry+nn_vv_abdomen = substVack . nnvabdomen++nn_vn_nomen :: String -> Entry+nn_vn_nomen = substNeutrum . nnvnomen++nn_vn_understatement :: String -> Entry+nn_vn_understatement = substNeutrum . nnvunderstatement ++nn_vu_franc :: String -> Entry+nn_vu_franc = substUtrum . nnvfranc          ++nn_vu_cocktail :: String -> Entry+nn_vu_cocktail = substUtrum . nnvcocktail       ++nn_vu_gangster :: String -> Entry+nn_vu_gangster = substUtrum . nnvgangster       ++nn_vu_partner :: String -> Entry+nn_vu_partner = substUtrum . nnvpartner        ++nn_vu_sandwich :: String -> Entry+nn_vu_sandwich = substUtrum . nnvsandwich       ++nn_vn_centrum :: String -> Entry+nn_vn_centrum = substNeutrum . nnvcentrum        ++nn_vn_tempo :: String -> Entry+nn_vn_tempo = substNeutrum . nnvtempo          ++nn_vp_antecedentia :: String -> Entry+nn_vp_antecedentia = substPl . nnvantecedentia   ++nn_vn_alfa_abc :: String -> Entry+nn_vn_alfa_abc = substNeutrum . nnvabc++nn_vn_garn :: String -> Entry+nn_vn_garn = substNeutrum . nnvgarn++nn_vn_huvud :: String -> Entry+nn_vn_huvud = substNeutrum . nnvhuvud++nn_vn_kvantum :: String -> Entry+nn_vn_kvantum = substNeutrum . nnvkvantum++nn_vn_spektrum :: String -> Entry+nn_vn_spektrum = substNeutrum . nnvspektrum++nn_vu_blinker :: String -> Entry+nn_vu_blinker = substUtrum . nnvblinker++nn_vu_dress :: String -> Entry+nn_vu_dress = substUtrum . nnvdress++nn_vu_hambo :: String -> Entry+nn_vu_hambo = substUtrum . nnvhambo++nn_vu_kaliber :: String -> Entry+nn_vu_kaliber = substUtrum . nnvkaliber++nn_vu_klammer :: String -> Entry+nn_vu_klammer = substUtrum . nnvklammer++nn_vu_playboy :: String -> Entry+nn_vu_playboy = substUtrum . nnvplayboy++nn_vu_roller :: String -> Entry+nn_vu_roller = substUtrum . nnvroller++nn_vu_trio :: String -> Entry+nn_vu_trio = substUtrum . nnvtrio++nn_vv_borr :: String -> Entry+nn_vv_borr = substVack . nnvborr++nn_vv_test :: String -> Entry+nn_vv_test = substVack . nnvtest++-- irregular nouns++nn_on_narkotikum :: String -> Entry+nn_on_narkotikum = substNeutrum . nnonarkotikum++nn_ou_examen :: String -> Entry+nn_ou_examen = substUtrum . nnoexamen++nn_ou_emeritus :: String -> Entry+nn_ou_emeritus = substUtrum . nnoemeritus       ++nn_ou_fullmäktig :: String -> Entry+nn_ou_fullmäktig = substUtrum . nnofullmäktig     +++-- nn_op_prestanda = substPl . nnoprestanda      ++nn_on_öga :: String -> Entry+nn_on_öga = substNeutrum . nnoöga++nn_op_data :: String -> Entry+nn_op_data = substPl . nnodata++nn_ou_officer :: String -> Entry+nn_ou_officer = substUtrum . nnoofficer++-- no plural++nn_0u_mjölk :: String -> Entry+nn_0u_mjölk = substUtrum . nn0 ++nn_0n_oväsen :: String -> Entry+nn_0n_oväsen = substNeutrum . nn0oväsen         ++nn_0u_tröst :: String -> Entry+nn_0u_tröst = substUtrum . nn0tröst          ++nn_0u_adel :: String -> Entry+nn_0u_adel = substUtrum . nn0adel           ++nn_0u_början :: String -> Entry+nn_0u_början = substUtrum . nn0början++nn_0n_skum :: String -> Entry+nn_0n_skum = substNeutrum . nn0skum         ++nn_0u_skam :: String -> Entry+nn_0u_skam = substUtrum . nn0skam++nn_0v_uran :: String -> Entry+nn_0v_uran = substVack . nn0uran           ++nn_0u_fåfänga :: String -> Entry+nn_0u_fåfänga = substUtrum . nn0adel        ++nn_0u_biologi :: String -> Entry+nn_0u_biologi = substUtrum . nn0biologi        ++nn_0u_brådska :: String -> Entry+nn_0u_brådska = substUtrum . nn0brådska        ++nn_0n_smör :: String -> Entry+nn_0n_smör = substNeutrum . nn0smör           ++nn_0n_kaffe :: String -> Entry+nn_0n_kaffe = substNeutrum . nn0kaffe          ++nn_0n_socker :: String -> Entry+nn_0n_socker = substNeutrum . nn0socker         ++nn_0n_aktinium :: String -> Entry+nn_0n_aktinium  = substNeutrum . nn0aktinium       ++nn_0u_samverkan :: String -> Entry+nn_0u_samverkan = substUtrum . nn0januari++nn_0v_manna :: String -> Entry+nn_0v_manna = substVack . nn0manna        ++nn_0v_januari :: String -> Entry+nn_0v_januari = substVack . nn0januari        ++-- definite nouns+nn_du_kneken :: String -> Entry+nn_du_kneken = substUtrum   . nndkneken         ++nn_dn_brådrasket :: String -> Entry+nn_dn_brådrasket = substNeutrum . nndbrådrasket     ++-- no inflection+nn_in_vaj :: String -> Entry+nn_in_vaj = substNeutrum . nni++nn_iu_avvaktan :: String -> Entry+nn_iu_avvaktan = substUtrum . nni++nn_iu_bror :: String -> Entry+nn_iu_bror = substUtrum . nni++nn_iv_hum :: String -> Entry+nn_iv_hum = substVack . nni_ns++-- genitive inflection+nn_gu_februari :: String -> Entry+nn_gu_februari = substUtrum   . nngfebruari++nn_kol_14 :: String -> Entry+nn_kol_14 = substNeutrum . nnkol14++-- multi-words abbreviation invar+-- nna_u :: String -> Entry+-- nna_u s =  entryI (nnai s) [prValue Utr]++-- nna_v :: String -> Entry+-- nna_v s =  entryI (nnai s) [prValue Pend]++-- nna_gu :: String -> Entry+-- nna_gu s = entryI (nnga s) [prValue Utr]++-- multi-words ++substM :: (SubstM -> Str) -> Genus -> Entry+substM n g = entryI n [prValue g]++substMUtrum :: (SubstM -> Str) -> Entry+substMUtrum s = substM s Utr++substMNeutrum :: (SubstM -> Str) -> Entry+substMNeutrum s = substM s Neutr++substMPl :: (SubstM -> Str) -> Entry+substMPl s = substM s GPl++substMDPl :: (SubstM -> Str) -> Entry+substMDPl s = substM s GDPl++substMVack :: (SubstM -> Str) -> Entry+substMVack s = substM s Pend++substMMasc :: (SubstM -> Str) -> Entry+substMMasc s = substM s Utr++-- definite++nnm_du0_vippen :: String -> Entry+nnm_du0_vippen = substMUtrum . nnmdu . words++-- genitive+nnm_gn0_alter_ego :: String -> Entry+nnm_gn0_alter_ego = substMNeutrum . nnmg . words++nnm_gu0_best_man :: String -> Entry+nnm_gu0_best_man = substMUtrum . nnmg . words++-- invariant++noun_m :: Genus -> String -> String -> String -> String  -> Entry+noun_m g s1 s2 s3 s4 = set_pos "nnm" $ nounC g [s1] [s2] [s3] [s4] [] []++nnm_iu0_avvaktan :: String -> Entry+nnm_iu0_avvaktan = substMUtrum . nnmi . words++cat :: [String] -> (String,String) -> String+cat xs (a,w) = unwords (reverse xs ++ [a,w])++nnm_6na_kort_varsel :: String -> Entry+nnm_6na_kort_varsel s = noun_m Neutr (cat xs (adj,w)) (cat xs (adj++"a",(dv w ++ "et")))+                        (cat xs (adj++"a",w)) (cat xs (adj++"a",(dv w ++ "en")))+  where (w:adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])++nnm_6na_glykemiskt_index :: String -> Entry+nnm_6na_glykemiskt_index s = noun_m Neutr (cat xs (adj,w)) (cat xs (glykemisk ++"a",(dv w ++ "et")))+                        (cat xs (glykemisk++"a",w)) (cat xs (glykemisk++"a",(dv w ++ "en")))+  where glykemisk = tk 1 adj+        (w:adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])++nnm_6ua_oplockad_gås :: String -> Entry+nnm_6ua_oplockad_gås s = noun_m Utr (cat xs (adj,w)) (cat xs (adj++"e",w ++ "en"))+                        (cat xs (adj++"e",(vc "ä" w) ++ "s")) +                        (cat xs (adj++"e",(vc "ä" w) ++ "sen"))+  where (w:adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])+++nnm_6ua_svensk_mästare :: String -> Entry+nnm_6ua_svensk_mästare s +    = noun_m Utr (cat xs (adj,w)) +                 (cat xs (adj++"a",w ++ "n"))+                 (cat xs (adj++"a",w)) +                 (cat xs (adj++"a",(tk 1 w) ++ "na"))+  where (w:adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])++nnm_6na_välsmort_munläder :: String -> Entry+nnm_6na_välsmort_munläder s +    = noun_m Neutr (cat xs (adj++"t",w)) +                 (cat xs (adj++"da",w ++ "n"))+                 (cat xs (adj++"da",w)) +                 (cat xs (adj++"da",w ++ "na"))+  where +    adj = tk 1 adj'+    (w:adj':xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])+++nnm_0ua_frid :: String -> Entry+nnm_0ua_frid s = noun_m Utr (cat xs (adj,w)) (cat xs (adj++"a",(w ++ "en"))) [] []+  where (w:adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])++nnm_3ua_film :: String -> Entry+nnm_3ua_film s =  noun_m Utr (cat xs (adj,w)) (cat xs (adj++"a",w ++ "en"))+                        (cat xs (adj++"a",w++"er")) (cat xs (adj++"a",w ++ "erna")) +  where (w:adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])++nnm_3ua_enarmad_bandit :: String -> Entry+nnm_3ua_enarmad_bandit s =  noun_m Utr (cat xs (adj,w)) (cat xs (adj++"e",w ++ "en"))+                        (cat xs (adj++"e",w++"er")) (cat xs (adj++"e",w ++ "erna")) +  where (w:adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])++nnm_1ua_svart_låda :: String -> Entry+nnm_1ua_svart_låda s =  noun_m Utr (cat xs (adj,w++"a")) (cat xs (adj++"a",w ++ "an"))+                        (cat xs (adj++"a",w++"or")) (cat xs (adj++"a",w ++ "orna")) +  where (w':adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])+        w = tk 1 w'++nnm_3ua_rolig_historia :: String -> Entry+nnm_3ua_rolig_historia s =  noun_m Utr (cat xs (adj,w++"a")) (cat xs (adj++"a",w ++ "an"))+                        (cat xs (adj++"a",w++"er")) (cat xs (adj++"a",w ++ "erna")) +  where (w':adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])+        w = tk 1 w'++nnm_2ua_pojke :: String -> Entry+nnm_2ua_pojke s = noun_m Utr (cat xs (adj,w)) (cat xs (adj++"a",(dv w ++ "en")))+                        (cat xs (adj++"a",(dv w ++ "ar"))) (cat xs (adj++"a",(dv w ++ "arna"))) +  where (w:adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])++nnm_2ua_stol :: String -> Entry+nnm_2ua_stol s = noun_m Utr (cat xs (adj,w)) (cat xs (adj++"a",(dv w ++ "en")))+                        (cat xs (adj++"a",w++"ar")) (cat xs (adj++"a",w ++ "arna")) +  where (w:adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])++nnm_2ua_naken_blankning :: String -> Entry+nnm_2ua_naken_blankning s = +    noun_m Utr (cat xs (adj,w)) (cat xs ((dv adj)++"a",(w ++ "en")))+               (cat xs ((dv adj)++"a",w++"ar")) (cat xs ((dv adj)++"a",w ++ "arna")) +  where (w:adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])++nnm_0na_fritt_vivre :: String -> Entry+nnm_0na_fritt_vivre s =  noun_m Neutr (cat xs (adj,w)) (cat xs ((tk  2 adj)++"a",(w ++ "t"))) [] [] +  where (w:adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])++nnm_gv_modus_vivendi :: String -> Entry+nnm_gv_modus_vivendi s =  noun_m Pend (cat xs (adj,w)) [] [] [] +  where (w:adj:xs) = case reverse $ words s of+                       (x:y:z) -> (x:y:z)+                       _       -> ([]:[]:[[]])++nnm_5pc_göranden_och_låtanden :: String -> Entry+nnm_5pc_göranden_och_låtanden s =  noun_m GPl [] [] +                        (unwords [w1,och,w2]) (unwords [w1++"a",och,w2++"a"]) +  where (w1:och:[w2]) =  case words s of+                           (x:y:[z]) -> (x:y:[z])+                           _       -> [[],[],[]]++nnm_gpc_kreti_och_pleti :: String -> Entry+nnm_gpc_kreti_och_pleti s =  noun_m GPl [] [] (unwords [w1,och,w2])  []+  where (w1:och:[w2]) = case words s of+                       (x:y:[z]) -> (x:y:[z])+                       _       -> [[],[],[]]
+ src/saldo/NounRulesSw.hs view
@@ -0,0 +1,828 @@+----------------------------------------------------------------------+-- |+-- Module      : NounRulesSw+-- Maintainer  : Markus Forsberg+-- Stability   : (stability)+-- Portability : (portability)+--+--+-- Swedish noun functions+-------------------------------------------------------------------------+module NounRulesSw where++import GenRulesSw+import General+import TypesSw+import Char(isDigit)+import List++type NSg    = String+type NSgD   = String +type NPl    = String+type NPlD   = String+type NComp  = String+type NDeriv = String ++-- General Noun functions++mk_substantive :: NSg -> NSgD -> NPl -> NPlD -> NComp -> NDeriv -> Substantive+mk_substantive apa apan apor aporna ap_comp ap_deriv = + variants (mk_substantive_v (lift apa) (lift apan) (lift apor) +                     (lift aporna) (lift ap_comp) (lift ap_comp) (lift ap_deriv)) [(MedComposite,strings (compound_s ap_comp))]++mk_substantive_comp :: NSg -> NSgD -> NPl -> NPlD -> NComp -> NComp -> NDeriv -> Substantive+mk_substantive_comp apa apan apor aporna ap_comp ap_comp2 ap_deriv a = +    mk_substantive_v (lift apa) (lift apan) (lift apor) +                     (lift aporna) (lift ap_comp) (lift ap_comp2) (lift ap_deriv) a++mk_substantive_v :: [NSg] -> [NSgD] -> [NPl] -> [NPlD] -> [NComp] -> [NComp] -> [NDeriv]-> Substantive+mk_substantive_v apa apan apor aporna ap_comp ap_comp2 ap_deriv a = +        case a of+          SF n s c -> strings $ mk_case_v c $ +                       case (n,s) of+                         (Sg,Indef) -> apa+                         (Sg,Def)   -> apan+                         (Pl,Indef) -> apor+                         (Pl,Def)   -> aporna+          InitComposite    -> strings ap_comp+          MedComposite     -> strings ap_comp2+          SMS              -> nonExist+          Deriv            -> strings ap_deriv++mk_nna :: [String] -> [String] -> [String] -> [String] ->+          [String] -> [String] -> [String] -> [String] -> Substantive+mk_nna apa apas apan apans apor apors aporna apornas a = strings $+        case a of+          SF n s c -> +                       case (n,s,c) of+                         (Sg,Indef,Nom) -> apa+                         (Sg,Indef,Gen) -> apas+                         (Sg,Def,Nom)   -> apan+                         (Sg,Def,Gen)   -> apans+                         (Pl,Indef,Nom) -> apor+                         (Pl,Indef,Gen) -> apors+                         (Pl,Def,Nom)   -> aporna+                         (Pl,Def,Gen)   -> apornas+          InitComposite   -> map (++ "-") apa+          MedComposite    -> map (++ "-") apa+          SMS             -> map (++ "-") apa+          Deriv           -> map (++ "-") apa++mk_subst :: NSg -> NSgD -> NPl -> NPlD -> Substantive+mk_subst bil bilen bilar bilarna = +    mk_substantive bil bilen bilar bilarna bil bil++mk_subst_v :: [NSg] -> [NSgD] -> [NPl] -> [NPlD] -> [NComp] -> Substantive+mk_subst_v bil bilen bilar bilarna bilc = +    variants (mk_substantive_v bil bilen bilar bilarna bilc bilc bilc) [(MedComposite,strings (concat (map compound_s bilc)))]++mk_case :: Casus -> String -> String+mk_case c [] = []+mk_case c s = case c of+  Nom                          -> s+  Gen | elem (last s) "sxzSXZ" -> s+  Gen | elem (last s) "?!" || isDigit (last s) -> s ++ ":s"+  Gen                          ->  s ++ "s"++mk_case_v :: Casus -> [String] -> [String]+mk_case_v c xs = concat $ map f (filter (not.null) xs)+  where f s = case c of+               Nom                                          -> [s]+               Gen | not (null s) && elem (last s) "sxzSXZ" -> [s]+               Gen | not (null s) && (elem (last s) "!?" || isDigit (last s)) -> [s ++ ":s",s++"-s"]+               Gen                                          -> [s ++ "s"]++hyphenate_compounds :: Substantive -> Substantive+hyphenate_compounds f = compvariants [w +? "-" | w <- unStr (f InitComposite)]+                                     [w +? "-" | w <- unStr (f MedComposite)] f+                                     +geminator :: Substantive -> Substantive+geminator f + | and [isSuffixOf "mm" w | w <- unStr (f (SF Sg Indef Nom))] = f+ | otherwise = compexcept' [ungeminate w  | w <- unStr (f InitComposite)] [ungeminate w | w <- unStr (f MedComposite)] f++-- additional compound form+compvariants :: [NComp] -> [NComp] -> Substantive -> Substantive+compvariants compi compm f = variants f [+                              (InitComposite,strings compi),+                              (MedComposite,strings compm),+                              (SMS,strings [ x | x@(_:_) <- compi,last x=='-'])+                             ] ++compvariant :: [NComp] -> Substantive -> Substantive+compvariant compi f = variants f [(InitComposite,strings compi), (MedComposite,strings (concat [compound_s w | w <- compi]))]++-- replace compound form+compexcept ::  [NComp] -> Substantive -> Substantive+compexcept compi f = excepts f [(InitComposite,strings compi), (MedComposite,strings (concat [compound_s w | w <- compi]))]++compexcept' ::  [NComp] -> [NComp] -> Substantive -> Substantive+compexcept' compi compm f = excepts f [(InitComposite,strings compi), (MedComposite,strings compm)]++compderivexcept :: [NComp] -> [NDeriv] -> Substantive -> Substantive +compderivexcept comp deriv f = excepts (compexcept comp f) [(Deriv,strings deriv)]++--- variants+sgdefvariants :: [NSgD] -> Substantive -> Substantive+sgdefvariants nom_s finite_f = +    variants finite_f [(SF Sg Def Nom, strings nom_s), (SF Sg Def Gen, strings (map (mk_case Gen) nom_s))]++sgindefvariants :: [NSg] -> Substantive -> Substantive+sgindefvariants nom_s finite_f = +    variants finite_f [(SF Sg Indef Nom, strings nom_s), (SF Sg Indef Gen, strings (map (mk_case Gen) nom_s))]++pldefvariants :: [NPlD] -> Substantive -> Substantive+pldefvariants nom_s finite_f = +    variants finite_f [(SF Pl Def Nom, strings nom_s), (SF Pl Def Gen, strings (map (mk_case Gen) nom_s))]++plindefvariants :: [NPl] -> Substantive -> Substantive+plindefvariants nom_s finite_f = +    variants finite_f [(SF Pl Indef Nom, strings nom_s), (SF Pl Indef Gen, strings (map (mk_case Gen) nom_s))]++-- excepts+sgdefexcepts :: [NSgD] -> Substantive -> Substantive+sgdefexcepts nom_s finite_f  = +    excepts finite_f [(SF Sg Def Nom, strings nom_s), (SF Sg Def Gen, strings (map (mk_case Gen) nom_s))]++sgindefexcepts :: [NSg] -> Substantive -> Substantive+sgindefexcepts nom_s finite_f = +    excepts finite_f [(SF Sg Indef Nom, strings nom_s), (SF Sg Indef Gen, strings (map (mk_case Gen) nom_s))]++pldefexcepts :: [NPlD] -> Substantive -> Substantive+pldefexcepts nom_s finite_f = +    excepts finite_f [(SF Pl Def Nom, strings nom_s), (SF Pl Def Gen, strings (map (mk_case Gen) nom_s))]++plindefexcepts :: [NPl] -> Substantive -> Substantive+plindefexcepts nom_s finite_f = +    excepts finite_f [(SF Pl Indef Nom, strings nom_s), (SF Pl Indef Gen, strings (map (mk_case Gen) nom_s))]++sgvariants :: [NSg] -> [NSgD] -> Substantive -> Substantive+sgvariants sg sget f = sgdefvariants sget (sgindefvariants sg f) ++plvariants :: [NPl] -> [NPlD] -> Substantive -> Substantive+plvariants pl plet f = pldefvariants plet (plindefvariants pl f) ++plexcepts :: [NPl] -> [NPlD] -> Substantive -> Substantive+plexcepts pl plet f = pldefexcepts plet (plindefexcepts pl f) +    +no_plural :: Substantive -> Substantive+no_plural v = v `only` [SF Sg s c | s <- values, c <- values]++no_singular :: Substantive -> Substantive+no_singular v = v `only` [SF Pl s c | s <- values, c <- values]++onlyPlD :: Substantive -> Substantive+onlyPlD v = v `only` [SF Pl Def c | c <- values]++-- Declension 1+nn1 :: String -> Substantive+nn1 apa = mk_substantive apa (ifEndThen (=='a') apa (apa ++ "n") (apa ++ "en")) apor (apor ++ "na") [] []+ where ap   = dropEndIf (=='a') apa+       apor = ap ++ "or"++nn1flicka :: String -> Substantive+nn1flicka flicka = -- compvariants [tk 1 flicka ++ "e"]  $ +                   nn1 flicka +                  +nn1kyrka :: String -> Substantive+nn1kyrka kyrka = compvariant [tk 1 kyrka ++ "o"] (nn1 kyrka) ++nn1gata :: String -> Substantive+nn1gata gata = compvariant [tk 1 gata ++ "u"] (nn1 gata) ++nn1olja :: String -> Substantive+nn1olja olja = compexcept [tk 1 olja ++ "e"] (nn1 olja) ++nn1mamma :: String -> Substantive+nn1mamma mamma = compexcept [mamma] (nn1 mamma) ++nn1siffra :: String -> Substantive+nn1siffra siffra = compexcept [insert_second_last (tk 1 siffra) 'e'] +                               (nn1 siffra) ++nn1dimma :: String -> Substantive+nn1dimma dimma   = compexcept [tk 2 dimma] (nn1 dimma) ++nn1sopor :: String -> Substantive+nn1sopor sopor = no_singular $ nn1 $ tk 2 sopor++nn1faggorna :: String -> Substantive+nn1faggorna faggorna = onlyPlD $ nn1 $ tk 4 faggorna++-- Declension 2++nn2 :: String -> Substantive+nn2 pojke = mk_substantive pojke pojken (pojk ++ "ar") (pojk ++ "arna") pojk pojk+ where pojk   = drop_final_e pojke+       pojken = pojke ++ if_vowel (last pojke) "n" "en" + +-- ungeminate +nn2nyckel :: String -> Substantive+nn2nyckel nyckel = mk_substantive nyckel (nyckel ++"n") (nyckl ++"ar") (nyckl ++"arna") nyckel nyckl+ where nyckl = drop_last_vowel nyckel++nn2öken :: String -> Substantive+nn2öken öken = mk_subst öken (ökn ++"en") (ökn ++"ar") (ökn ++"arna") + where ökn = drop_last_vowel öken++nn2hummer :: String -> Substantive+nn2hummer hummer = mk_subst hummer (hummer ++"n") (humr ++"ar") (humr ++"arna")+ where humr = drop_second_last $ drop_last_vowel $ hummer++nn2kam :: String -> Substantive+nn2kam kam = mk_subst kam (kamm ++"en") (kamm ++"ar") (kamm ++"arna")+    where kamm = geminate kam++nn2pengar :: String -> Substantive+nn2pengar pengar = mk_subst [] [] (pengar) (pengar ++"na")++nn2mor :: String -> Substantive+nn2mor mor_or_moder = compvariants [moder++"s",mor,mor++"s"] [mor,mor++"s"] $ sgindefvariants [moder] $+ mk_substantive mor (moder ++"n") (moedr ++"ar") (moedr ++"arna") moder moder+    where (mor,moder)   = +              if (dp 3 mor_or_moder) == "der" then (tk 3 mor_or_moder ++ "r",+                                                    mor_or_moder)+               else+                   (mor_or_moder, tk 1 mor_or_moder ++ "der")+          moedr = umlaut $ drop_last_vowel moder++nn2dotter :: String -> Substantive+nn2dotter dotter = mk_substantive dotter (dotter ++"n") (döttr ++"ar") (döttr ++"arna") dotter []+ where döttr = umlaut $ drop_last_vowel dotter++nn2fordran :: String -> Substantive+nn2fordran fordran = mk_substantive fordran fordran fordringar (fordringar ++"na") fordran []+ where fordringar = tk 2 fordran ++ "ingar"++nn2verkan :: String -> Substantive+nn2verkan verkan = mk_substantive verkan verkan verkningar (verkningar ++"na") verkan []+ where verkningar = tk 2 verkan ++ "ningar"++nn2toker :: String -> Substantive+nn2toker tok = sgindefvariants  [tok++"er"] (nn2 tok) ++nn2herre :: String -> Substantive+nn2herre herre = sgdefvariants [herre++"n"] (nn2 herre) ++nn2vers :: String -> Substantive+nn2vers vers =  combine (NounRulesSw.nn2 vers) (NounRulesSw.nn3 vers)++nn2manöver :: String -> Substantive+nn2manöver manöver = combine (nn2nyckel manöver) +                             (no_singular (nn3 (drop_last_vowel manöver)))++nn2själ :: String -> Substantive+nn2själ själ = compvariant [själ++"a"] (nn2 själ) ++nn2brud :: String -> Substantive+nn2brud brud = compvariant [brud++"e"] (nn2 brud) ++nn2jord :: String -> Substantive+nn2jord jord = compvariant [jord++"e",jord++"a"] (nn2 jord) ++nn2hjälte :: String -> Substantive+nn2hjälte hjälte = compexcept  [hjälte] (nn2 hjälte)++nn2herde :: String -> Substantive+nn2herde herde = compexcept [herd++"e", herd++"a"] (nn2 herde) + where herd = tk 1 herde++nn2by :: String -> Substantive+nn2by by = compvariant [by++"a"] (nn2 by) ++nn2fågel :: String -> Substantive+nn2fågel fågel = compvariant [(drop_last_vowel fågel)++"a"] (nn2nyckel fågel) ++nn2lem :: String -> Substantive+nn2lem lem = compvariant [(geminate lem)++"a"] (nn2kam lem) ++nn2vägnar :: String -> Substantive+nn2vägnar vägnar = no_singular $ nn2 (tk 2 vägnar)++nn2stadgar :: String -> Substantive+nn2stadgar stadgar = compvariant [(tk 2 stadgar)++"e"] (nn2vägnar stadgar) ++-- Declension 3 +nn3 :: String -> Substantive+nn3 sak = mk_subst sak (sak ++ "en") (sak ++ "er") (sak++"erna") ++nn3vin :: String -> Substantive+nn3vin vin = mk_subst vin (vin ++ "et") (vin ++ "er") (vin ++ "erna") ++nn3gäst :: String -> Substantive+nn3gäst gäst = compvariant [gäst++"a"] (nn3 gäst) ++nn3bygd :: String -> Substantive+nn3bygd bygd = compvariant [bygd++"e"] (nn3 bygd) ++nn3hävd :: String -> Substantive+nn3hävd hävd = compvariant [hävd++"e",hävd++"a"] (nn3 hävd) ++nn3motor :: String -> Substantive+nn3motor motor =  mk_subst motor           (motor ++ "n") +                           (motor ++ "er") (motor ++ "erna") ++nn3parti :: String -> Substantive+nn3parti parti = sgdefvariants [parti++"t"] (nn3vin parti) ++nn3poesi :: String -> Substantive+nn3poesi poesi = sgdefvariants [poesi++"en"] (nn3motor poesi) ++nn3musa :: String -> Substantive+nn3musa musa = mk_subst musa (musa ++ "n") (mus ++ "er") (mus ++ "erna")+ where mus = tk 1 musa++nn3museum :: String -> Substantive+nn3museum museum = mk_subst museum         (muse ++ "et") +                            (muse ++ "er") (muse ++ "erna") + where muse = tk 2 museum++nn3gladiolus :: String -> Substantive+nn3gladiolus gladiolus = mk_subst gladiolus    (gladiolus ++ "en")  +                             (gladiol ++ "er") (gladiol ++ "erna") + where gladiol = tk 2 gladiolus++nn3fiber :: String -> Substantive+nn3fiber fiber = mk_substantive fiber (fiber++"n") (fibr ++ "er") (fibr ++ "erna") fiber fibr+ where fibr = drop_last_vowel fiber++nn3tand :: String -> Substantive+nn3tand tand = mk_subst tand (tand++"en") (tänd ++ "er") (tänd ++ "erna") + where tänd = umlaut tand++nn3land :: String -> Substantive+nn3land land = mk_subst land (land++"et") (länd ++ "er") (länd ++ "erna") + where länd = umlaut land++nn3paraply :: String -> Substantive+nn3paraply paraply = sgdefvariants [paraply++"t",paraply++"n"] (nn3vin paraply) ++nn3hobby :: String -> Substantive+nn3hobby hobby = plindefvariants  [(tk 1 hobby)++"ies"] (nn3 hobby ) ++nn3kastanj :: String -> Substantive+nn3kastanj kastanj = sgindefvariants  [kastanj++"e"] (nn3 kastanj)++nn3akademi :: String -> Substantive+nn3akademi akademi = sgdefvariants  [akademi] (nn3 akademi)++nn3paket :: String -> Substantive+nn3paket paket = combine (nn3 paket) (nn5 paket)++nn3element :: String -> Substantive+nn3element element = combine (nn3vin element) (nn5 element)++nn3kläder :: String -> Substantive+nn3kläder = no_singular . nn3 . tk 2++nn3kliche :: String -> Substantive+nn3kliche kliche = combine (nn3motor kliche) (no_singular (nn3 (tk 1 kliche ++ "e")))++nn3bok :: String -> Substantive+nn3bok bok = mk_subst bok (bok ++"en") (böcker) (böcker++"na") + where böcker = umlaut (tk 1 bok) ++ "cker"++nn3fot :: String -> Substantive+nn3fot fot = mk_subst fot (fot ++"en") (fötter) (fötter++"na") + where fötter = umlaut (geminate fot) ++ "er"++nn3bockfot :: String -> Substantive+nn3bockfot fot = compexcept' [fot,fot+?"s"] [fot,fot+?"s"] (mk_subst fot (fot ++"en") (fötter) (fötter++"na")) + where fötter = umlaut (geminate fot) ++ "er"++nn3vän :: String -> Substantive+nn3vän vän = mk_subst vän (vänn ++"en") (vänn ++"er") (vänn ++"erna") +    where vänn = vän ++ [last vän]++nn3flanell :: String -> Substantive+nn3flanell flanell = sgdefvariants  [flanell++"et"] (nn3 flanell)++-- Declension 4+nn4 :: String -> Substantive+nn4 linje = mk_subst linje (linje ++ "n") (linje ++ "r") (linje++"rna") ++nn4studio :: String -> Substantive+nn4studio studio = plindefvariants [studio++"s"] (nn4 studio) ++nn4ampere :: String -> Substantive         +nn4ampere ampere = plvariants [ampere] [ampere++"n"] (nn4 ampere) ++nn4bonde :: String -> Substantive+nn4bonde bonde = compvariant [bond] $ mk_substantive bonde (bonde ++ "n") (bönd ++ "er") (bönd++"erna") bonde bond+   where bond = tk 1 bonde+         bönd = umlaut bond++-- Declension 5+nn5 :: String -> Substantive+nn5 rike = mk_subst rike (rike++et) (rike++en) (rike++ena) +  where et  = if_vowel (last rike) "t" "et"+        en  = if_vowel (last rike) "n" "en"+        ena = if_vowel (last rike) "na" "ena"++nn5knä :: String -> Substantive+nn5knä knä = sgdefvariants [knä++"et"] (nn5 knä) ++nn5äpple :: String -> Substantive+nn5äpple äpple = compexcept [insert_second_last (tk 1 äpple) 'e'] (nn5 äpple) ++nn5samhälle :: String -> Substantive+nn5samhälle samhälle = compvariant [tk 1 samhälle] (nn5 samhälle) ++nn5arbete :: String -> Substantive+nn5arbete arbete =  compderivexcept [arbet] [] (nn5 arbete) + where arbet = tk 1 arbete++nn5bi :: String -> Substantive+nn5bi bi = pldefvariants [bi++"en"] +           (except (nn5 bi) [(SF Sg Def c, mk_case c (bi++"et")) | c <- values])  ++nn5frö :: String -> Substantive+nn5frö frö = pldefvariants [frö++"en"] $ sgdefvariants [frö++"et"] (nn5 frö) ++nn5party :: String -> Substantive +nn5party party = plindefvariants [tk 1 party ++ "ies"] (nn5 party) ++nn5abc :: String -> Substantive+nn5abc abc nf = strings $ case nf of+    (SF Sg  Indef Nom) -> [abc]+    (SF Sg Indef Gen) -> [abc ++ ":s",abc++"-s"]+    (SF Sg Def   Nom) -> [abc ++ "-et", abc++"-t",abc ++ ":et", abc++":t"]+    (SF Sg Def   Gen) -> [abc ++ "-ets", abc++"-ts",abc ++ ":ets", abc++":ts"]+    (SF Pl Indef Nom) -> [abc ++ ":n",abc++"-n"]+    (SF Pl Indef Gen) -> [abc ++ ":ns",abc++"-ns"]+    (SF Pl Def   Nom) -> [abc++"-na",abc++":na"]+    (SF Pl Def   Gen) -> [abc++"-nas",abc++":nas"]+    InitComposite         -> [abc++"-"]+    MedComposite         -> [abc++"-"]+    SMS               -> [abc++"-"]+    Deriv             -> [abc]++nnkol14 :: String -> Substantive +nnkol14 kol14 n = strings $ case n of+                             (SF Sg Indef Nom) -> [kol14]+                             (SF Sg Indef Gen) -> [kol14++"-s",kol14++":s"]+                             InitComposite         -> [kol14++"-"]+                             MedComposite         -> [kol14++"-"]+                             _                 -> []++nn5anmodan :: String -> Substantive+nn5anmodan anmodan = mk_subst anmodan anmodan anmodanden (anmodanden++"a")+ where anmodanden = anmodan++"den"+ +-- Declension 6+nn6 :: String -> Substantive+nn6 lik = mk_subst lik (lik ++ "et") lik (lik ++ "en")++nn6barn :: String -> Substantive+nn6barn barn = compvariant [barn++"a"] (nn6 barn) ++nn6arv :: String -> Substantive+nn6arv arv = compvariant  [arv++"e"] (nn6 arv)++nn6mil :: String -> Substantive+nn6mil mil = mk_subst mil (mil ++ "en") mil (mil ++ "en")++nn6broder :: String -> Substantive+nn6broder broder = compvariants [broder++"s"] [] $ mk_subst broder (broder ++ "n") (bröd++"er") (bröd ++ "erna")+ where bröd = umlaut brod+       brod = tk 2 broder++nn6akademiker :: String -> Substantive+nn6akademiker akademiker = + mk_subst akademiker (akademiker ++ "n") akademiker (akademiker ++ "na") ++nn6lager :: String -> Substantive+nn6lager lager = pldefvariants  [lager++"na"] +                  (mk_substantive lager (lagr ++"et") (lager) (lagr ++"en") lager lagr)+  where lagr = ungeminate (tk 2 lager) ++ [last lager]++nn6nummer :: String -> Substantive+nn6nummer nummer = pldefvariants [nummer++"na"] +                    (mk_substantive nummer (numr ++"et") (nummer) (numr ++"en") nummer numr)+  where numr = drop_second_last $ drop_last_vowel $ nummer++nn6garage :: String -> Substantive+nn6garage garage = mk_subst garage (garage ++ "t") garage (garage ++ "n") ++nn6manus :: String -> Substantive+nn6manus manus = sgdefvariants [manus]  (nn6 manus) ++nn6gås :: String -> Substantive            +nn6gås gås = mk_subst gås (gås++"en") gäss (gäss++"en") + where gäss = (vc "ä" gås) ++"s"++nn6ordförande :: String -> Substantive+nn6ordförande ordförande = plindefvariants  [ordförande++"n"] (nn6akademiker ordförande)++nn6far :: String -> Substantive+nn6far far_or_fader = nn2mor far `except` [(SF Pl d c, mkPl d c) | d <- values, c <- values]+  where far = if (dp 3 far_or_fader == "der") then tk 3 far_or_fader ++"r" else+                  far_or_fader+        mkPl d c = mk_case c $+              case d of+                Indef -> (umlaut (tk 1 far)) ++ "der"+                _     -> (umlaut (tk 1 far)) ++ "derna"++nn6papper :: String -> Substantive+nn6papper papper = mk_substantive papper (pappr ++ "et") papper (pappr ++ "en") papper pappr+ where pappr = drop_last_vowel papper ++nn6kikare :: String -> Substantive+nn6kikare kikare = mk_substantive kikare (kikare ++ "n") kikare (kikar ++ "na") kikar kikar+ where kikar = tk 1 kikare++nn6program :: String -> Substantive+nn6program program = mk_subst program (programm ++"et") program (programm ++"en") +    where programm = program ++ [last program]++nn6mus :: String -> Substantive+nn6mus mus = mk_subst mus (mus ++"en") möss (möss ++"en") +    where möss = vc "ö" $ geminate mus++nn6vaktman :: String -> Substantive+nn6vaktman man = mk_subst man (mann ++"en") män (männ ++"en") +    where män   = umlaut man+          männ  = geminate män+          mann  = geminate man++nn6borst :: String -> Substantive+nn6borst borst = sgdefvariants  [borst++"en"] (nn6 borst)++nn6klientel :: String -> Substantive+nn6klientel klientel = combine (nn6 klientel) (nn6mil klientel)++--nn6frx :: String -> Substantive+--nn6frx f = mk_substantive_v [f] [f ++"-et",f ++":et",f++"-t",f++":t"] [f++"-en",f++":en",f++"-n",f++":n"] +--                                [f++"-ena",f++":ena",f++"-na",f++":na"] [f++"-"] [f++"-"] []++nn6ordalag :: String -> Substantive+nn6ordalag ordalag = no_singular (nn6 ordalag)++-- Declension 7++nn7musical :: String -> Substantive        +nn7musical musical = pldefvariants [musical +? "sarna"] (mk_subst musical (musical+?"en") (musical +? "s") (musical +? "sen"))++-- nn7jeans :: String -> Substantive          +-- nn7jeans jeans = nn7musical++-- no plural+nn0 :: String -> Substantive+nn0 mjölk = mk_subst mjölk (mjölk++"en") [] [] ++nn0oväsen :: String -> Substantive+nn0oväsen oväsen = sgdefexcepts  [oväsen++"det",oväsen++"et"] (nn0 oväsen)++nn0tröst :: String -> Substantive          +nn0tröst tröst = compvariant  [tröst++"e"] (nn0 tröst)++nn0adel :: String -> Substantive           +nn0adel adel = sgdefexcepts  [adel++"n"] (nn0 adel)++nn0skum :: String -> Substantive+nn0skum skum = sgdefexcepts  [skumm++"et"] (nn0 skum)+ where skumm = geminate skum++nn0skam :: String -> Substantive+nn0skam skam = sgdefexcepts [skamm++"en"] (nn0 skam) + where skamm = geminate skam++nn0manna :: String -> Substantive+nn0manna manna = sgdefexcepts [manna++"n", manna++"t"] (nn0 manna) ++nn0början :: String -> Substantive         +nn0början början = mk_substantive början början [] [] [] []++nn0uran :: String -> Substantive           +nn0uran uran = sgdefvariants  [uran++"et"] (nn0 uran)++-- nn0fåfänga  :: String -> Substantive       +-- nn0fåfänga  = nn0adel  ++nn0biologi :: String -> Substantive        +nn0biologi biologi = sgdefvariants  [biologi++"en"]  (nn0adel biologi)++nn0brådska :: String -> Substantive        +nn0brådska brådska = compexcept  [brådske] (nn0adel brådska)+ where brådske = (tk 1 brådska) ++ "e"++nn0smör :: String -> Substantive           +nn0smör smör = sgdefexcepts [smör++"et"] (nn0 smör) ++nn0kaffe :: String -> Substantive          +nn0kaffe kaffe = sgdefexcepts  [kaffe++"t"] (nn0 kaffe)++nn0socker :: String -> Substantive        +nn0socker socker = sgdefexcepts  [drop_last_vowel socker ++ "et"] (nn0 socker)++nn0januari :: String -> Substantive        +nn0januari januari = mk_substantive januari januari [] [] januari []++nn0aktinium :: String -> Substantive      +nn0aktinium aktinium = sgdefexcepts [aktinium, aktinium++"et"] (nn0 aktinium) ++-- pending declension+nnvkansli :: String -> Substantive+nnvkansli kansli = pldefvariants [kansli++"en"] (combine (nn3parti kansli) (nn6akademiker kansli)) ++nnvfaktum :: String -> Substantive+nnvfaktum faktum = plvariants [fakt++"a"] [fakt++"a"] $+                    sgdefvariants [faktum] (nn6mil faktum) + where fakt = tk 2 faktum++nnvdistikon :: String -> Substantive+nnvdistikon distikon = plvariants  [distik++"a"] [distik++"a"] (nn6 distikon)+ where distik = tk 2 distikon++nnvabdomen :: String -> Substantive+nnvabdomen abdomen = plvariants  [abdom++"ina"] [abdom++"ina"] (mk_substantive abdomen abdomen abdomen abdomen abdomen abdomen)+ where abdom = tk 2 abdomen++nnvnomen :: String -> Substantive+nnvnomen nomen = plvariants [nom++"ina"] [nom++"ina"] (mk_substantive nomen (nomen++"et") nomen (nomen++"en") nomen nomen) + where nom = tk 2 nomen++nnvunderstatement :: String -> Substantive+nnvunderstatement understatement = + plvariants [understatement++"s"] [understatement++"sen"] (nn6 understatement) + +nnvfranc :: String -> Substantive          +nnvfranc franc = pldefvariants  [franc++"en"] (nnvunderstatement franc)++nnvcocktail :: String -> Substantive       +nnvcocktail cocktail = plvariants [cocktail++"ar"] [cocktail++"arna"]+                                  (nn7musical cocktail) +             +nnvgangster :: String -> Substantive       +nnvgangster gangster = combine s_f ar_f+ where s_f     = mk_subst gangster (gangster++"n") (gangster++"s") (gangster++"sen")+       ar_f    = mk_subst gangster (gangster++"n") (gangstr++"ar") (gangstr++"arna")+       gangstr = drop_last_vowel gangster++nnvpartner :: String -> Substantive        +nnvpartner partner = plvariants  [partner] [partner ++"na",partner ++"sarna"]  $+    mk_subst partner (partner++"n") (partner++"s") (partner++"sen")+  -- $ (nn7musical partner)++nnvcentrum :: String -> Substantive        +nnvcentrum centrum = plvariants [centr++"a", centr++"er"]  +                                [centr++"ana", centr++"erna"] $+                                 sgdefvariants [centr++"et",centrum] um_f +  where um_f  =  mk_subst centrum (centrum++"et") centrum (centrum++"en") +        centr = tk 2 centrum++nnvtempo :: String -> Substantive          +nnvtempo tempo = mk_subst tempo tempo tempo (tempo++"na")++nnvantecedentia  :: String -> Substantive  +nnvantecedentia antecedentia = plvariants [antecedenti++"er"] [antecedenti++"erna"] (mk_subst [] [] antecedentia antecedentia)+                                         +  where antecedenti = tk 1 antecedentia++nnvtrall :: String -> Substantive+nnvtrall trall = combine (nn2 trall) (nn5 trall)++nnvbehå :: String -> Substantive+nnvbehå behå = combine (nn2 behå) (nn6akademiker behå)++nnvjojo :: String -> Substantive+nnvjojo jojo = combine (nn2 jojo) (nn4 jojo)++nnvsandwich :: String -> Substantive       +nnvsandwich sandwich = plvariants [sandwich++"es"] [sandwich++"esen"]+                                  (nn3 sandwich) ++nnvabc :: String -> Substantive+nnvabc = nn5abc++nnvgarn :: String -> Substantive+nnvgarn garn = combine (nn3vin garn) (nn6 garn)++nnvhuvud :: String -> Substantive+nnvhuvud huvud =  plindefvariants [huvud++"en"]+                   (mk_subst huvud (huvud++"et") huvud (huvud++"ena"))+                  +nnvkvantum :: String -> Substantive+nnvkvantum =  nnvcentrum++nnvspektrum :: String -> Substantive+nnvspektrum spektrum = plvariants [spektrum,spektr++"a"] +                                  [spektrum++"en", spektr++"ana"] $+    sgdefvariants [spektr++"et", spektrum++"et"] $+       mk_subst spektrum spektrum (spektr++"er") (spektr++"ena") + where spektr = tk 2 spektrum++nnvblinker :: String -> Substantive+nnvblinker blinker = plvariants [blinker++"s"] [blinker++"sen",blinker++"sarna"] $+                     mk_subst blinker (blinker++"n") +                             (blinkr++"ar") (blinkr++"arna") + where blinkr = mmr (drop_last_vowel blinker)++nnvdress :: String -> Substantive+nnvdress dress = plvariants [dress++"er"] [dress++"erna"] $ +                 mk_subst dress (dress++"en") (dress++"ar") (dress++"arna")++nnvhambo :: String -> Substantive+nnvhambo hambo = plvariants [hambo++"r"] [hambo++"rna"] $+          mk_subst hambo (hambo++"n") (hambo++"er") (hambo++"erna")++nnvkaliber :: String -> Substantive+nnvkaliber kaliber = plvariants [kalibr++"er"] [kalibr++"erna"] $ +                       mk_subst kaliber        (kaliber++"n") +                               (kalibr++"ar") (kalibr++"arna")+ where kalibr = drop_last_vowel kaliber++nnvklammer :: String -> Substantive+nnvklammer klammer = plvariants [klamr ++ "ar"] [klamr++"arna"] $+               mk_subst klammer (klammer++"n") klammer (klammer++"na")+ where klamr = ungeminate (tk 2 klammer) ++ dp 1 klammer++nnvplayboy :: String -> Substantive+nnvplayboy playboy = plvariants [playboy++"s"] [playboy++"sen",playboy++"sarna"] $+    mk_subst playboy (playboy++"en") (playboy++"ar") (playboy++"arna")+                                    +nnvroller :: String -> Substantive+nnvroller roller =  plvariants [rollr++"ar"] [rollr++"arna"] $+    mk_subst roller (roller++"n") (roller) (roller++"na")+ where rollr = drop_last_vowel roller++nnvtrio :: String -> Substantive+nnvtrio trio = plvariants [trio++"s"] [trio++"sen"] $+    mk_subst trio (trio++"n") (trio++"r") (trio++"rna")++nnvborr :: String -> Substantive+nnvborr borr = combine (nn2 borr) (nn6 borr)++nnvtest :: String -> Substantive+nnvtest test = combine (nn3 test) (nn6 test)++-- irregular nouns+nnonarkotikum :: String -> Substantive+nnonarkotikum narkotikum = sgvariants [narkotik++"a"] [narkotik++"an"] $+                           (mk_subst narkotikum (narkotikum++"et") +                                     (narkotik++"a") (narkotik++"a")) + where narkotik = tk 2 narkotikum++nnoexamen :: String -> Substantive+nnoexamen examen =  mk_subst examen examen (exam++"ina") (exam++"ina")+  where exam = tk 2 examen++nnoemeritus :: String -> Substantive       +nnoemeritus emeritus = mk_subst emeritus emeritus emeriti  (emeriti++"na") + where emeriti = tk 2 emeritus ++ "i"++nnofullmäktig :: String -> Substantive     +nnofullmäktig fullmäktig = mk_subst fullmäktig (fullmäktig++"en") (fullmäktig++"e") (fullmäktig++"e")++-- nnoprestanda :: String -> Substantive      +-- nnoprestanda prestanda = mk_substantive prestanda prestanda [] [] prestanda prestanda++nnoöga  :: String -> Substantive+nnoöga öga = mk_subst öga (öga++"t") ögon (ögon++"en")+ where ögon = tk 1 öga ++ "on"++nnodata :: String  -> Substantive+nnodata data_ = mk_subst [] [] (data_) (data_++"n")++nnoofficer :: String -> Substantive+nnoofficer officer = sgdefvariants [officer++"n"] (mk_subst officer (officer++"en") (officer++"are") (officer++"arna")) ++-- definite noun+nndkneken  :: String -> Substantive        +nndkneken  kneken = mk_subst [] kneken [] [] ++nndbrådrasket :: String -> Substantive     +nndbrådrasket brådrasket = mk_subst [] brådrasket [] [] ++-- no inflection++nni :: String -> Substantive+nni w = missing (nngfebruari w) [SF Sg Indef Gen]++nni_ns :: String -> Substantive+nni_ns w = compexcept' [w] [w] (missing (nngfebruari w) [SF Sg Indef Gen])++-- genitive inflection++nngfebruari :: String -> Substantive+nngfebruari februari = mk_subst februari [] [] []++-- multi-words +nnm0 f xs (SFM t) = mapStr (rs++)  (f lw t)+ where lw = last xs+       rs = unwords (init xs) ++ " "++-- definite++nnmdu ::[String] -> (SubstM -> Str)+nnmdu = nnm0 (\w -> missing (nndkneken w) [InitComposite,MedComposite])++nnmdn ::[String] -> (SubstM -> Str)+nnmdn = nnm0 (\w -> missing (nndbrådrasket w) [InitComposite, MedComposite])++nnmg :: [String] -> (SubstM -> Str)+nnmg = nnm0 (\w -> missing (nngfebruari w) [InitComposite, MedComposite])++nnmi :: [String] -> (SubstM -> Str)+nnmi = nnm0 (\w -> missing (nni w) [InitComposite, MedComposite])+
+ src/saldo/OtherBuildSw.hs view
@@ -0,0 +1,213 @@+module OtherBuildSw where++import General+import Dictionary+import TypesSw+import RulesSw+import GenRulesSw++-- Proper names++pm_m :: String -> String -> Entry+pm_m tax s = entryI (mk_pm s) [prValue MascGen,tax] ++pm_f :: String -> String -> Entry+pm_f tax s = entryI (mk_pm s) [prValue FemGen,tax] ++pm_f_alice :: String -> String -> Entry+pm_f_alice tax s = entryI (mk_pm_alice s) [prValue FemGen,tax] ++pm_h :: String -> String -> Entry+pm_h tax s = entryI (mk_pm s) [prValue Human,tax] ++pm_w :: String -> String -> Entry+pm_w tax s = entryI (mk_pm s) [prValue PNeutr,tax] ++pm_p :: String -> String -> Entry+pm_p tax s = entryI (mk_pm s) [prValue GPl,tax] ++pm_v :: String -> String -> Entry+pm_v tax s = entryI (mk_pm s) [prValue Pend,tax] ++pm_u :: String -> String -> Entry+pm_u tax s = entryI (mk_pm s) [prValue Utr,tax]++pm_n :: String -> String -> Entry+pm_n tax s = entryI (mk_pm s) [prValue Neutr,tax]++pma_n :: String -> String -> Entry+pma_n tax s = entryI (mk_pma s) [prValue Neutr,tax]++pma_u :: String -> String -> Entry+pma_u tax s = entryI (mk_pma s) [prValue Utr,tax]++pma_h :: String -> String -> Entry+pma_h tax s = entryI (mk_pma s) [prValue Human,tax]++pma_w :: String -> String -> Entry+pma_w tax s = entryI (mk_pma s) [prValue PNeutr,tax] ++pma_m :: String -> String -> Entry+pma_m tax s = entryI (mk_pma s) [prValue PNeutr,tax] ++-- multi-word proper names++pmm_n :: String -> String -> Entry+pmm_n tax s = entryI (mk_pmm0 (words s)) [prValue Neutr,tax]++pmm_u :: String -> String -> Entry+pmm_u tax s = entryI (mk_pmm0 (words s)) [prValue Utr,tax]++pmm_h :: String -> String -> Entry+pmm_h tax s = entryI (mk_pmm0 (words s)) [prValue Human,tax]++pmm_m :: String -> String -> Entry+pmm_m tax s = entryI (mk_pmm0 (words s)) [prValue MascGen,tax] ++pmm_f :: String -> String -> Entry+pmm_f tax s = entryI (mk_pmm0 (words s)) [prValue FemGen,tax] ++pmm_v :: String -> String -> Entry+pmm_v tax s = entryI (mk_pmm0 (words s)) [prValue Pend,tax] ++pmm_p :: String -> String -> Entry+pmm_p tax s = entryI (mk_pmm0 (words s)) [prValue GPl,tax] +++pmam_m :: String -> String -> Entry+pmam_m tax s = entryI (mk_pmam0 (words s)) [prValue MascGen,tax] ++pmam_n :: String -> String -> Entry+pmam_n tax s = entryI (mk_pmam0 (words s)) [prValue Neutr,tax] ++-- adverbs++ab_bort :: String -> Entry+ab_bort = entry . f+ where f s AdCompI = strings [s,s+?"-"]+       f s AdSMSI  = strings [s+?"-"]+       f s _       = strings [s]++ab_i_aldrig :: String -> Entry+ab_i_aldrig = entry . ab_i_no_comp++ab_främst :: String -> Entry+ab_främst = entry . abfrämst++ab_bra :: [String] -> [String] -> [String] -> Entry+ab_bra x y z = entry $ mk_adverb x y z++ab_comp :: [String] -> [String] -> [String] -> [String] -> Entry+ab_comp x y z w = entry $ mk_adverb_c x y z w++ab_fint :: String -> Entry+ab_fint = entry  . abfint++ab_1_fort = entry . abfort++abm_i_till_exempel :: String -> Entry+abm_i_till_exempel till_exempel = entry $ abm till_exempel++-- compounds ++compound :: String -> Entry+compound = entry . f+ where f s CMP  = strings [s, s+?"-"]+       f s CSMS = strings [s+?"-"]++-- pronouns++pn_jag :: (Person,Numerus) -> (Suffixes, Suffixes,Suffixes,Suffixes,Suffixes) -> String -> Entry+pn_jag (p,n) (a,b,c,d,e) s = entryI (mk_pron_jag (a,b,c,d,e) s) [prValue p, prValue n]++pn_nagon :: (Suffixes, Suffixes, Suffixes) -> String -> Entry+pn_nagon (a,b,c) s = entry $ mk_pron_nagon (a,b,c) s++pn_han :: (Person,Numerus) -> (Suffixes, Suffixes, Suffixes) -> String -> Entry+pn_han (p,n) (a,b,c) s = entryI (mk_pron_han (a,b,c) s) [prValue p, prValue n]++pn_vem :: (Suffixes, Suffixes, Suffixes) -> String -> Entry+pn_vem (a,b,c) s = entry (mk_pron_han (a,b,c) s)++pn_o_den :: String -> Entry+pn_o_den = entry . mk_pn_o_den++pn_dylik :: String -> Entry+pn_dylik = entry . mk_pron_dylik++pn_interrog_inv :: String -> Entry+pn_interrog_inv = entry . (const :: Str -> InterrogInvForm -> Str) . mkStr++pn_inv :: String -> Entry+pn_inv = entry . (const :: Str -> PronInvForm -> Str) . mkStr++pnm_inv :: String -> Entry+pnm_inv = entry . (const :: Str -> PronMInvForm -> Str) . mkStr++pnm_gen :: String -> Entry+pnm_gen = entry . f+ where f s (PronMCForm Nom) = mkStr $ s+       f s (PronMCForm Gen) = mkStr $ case words s of+                                        (x:xs) -> unwords (x +? "s":xs)++pnm_o_den_här :: String -> Entry+pnm_o_den_här =  set_pos "pnm" . entry . pnm_o_den_här_rule++pnm_gen2 :: String -> Entry+pnm_gen2 = entry . f+ where f s (PronMCForm Nom) = mkStr $ s+       f s (PronMCForm Gen) = mkStr $ case reverse (words s) of+                                        (x:xs) -> unwords (reverse (x +? "s":xs))++-- numbers++number    ss = entry . mk_number ss++number_ng ss = entry . mk_number_ng ss++nl_n_1 = entry . nln1 ++-- invariant closed classes++interj :: String -> Entry+interj = entry . (const :: Str -> InterjForm -> Str) . mkStr++interjm :: String -> Entry+interjm aja_baja = set_pos "inm" $ interj (aja_baja)++conj :: String -> Entry+conj = entry . (const :: Str -> ConjForm -> Str) . mkStr++subj :: String -> Entry+subj = entry . (const :: Str -> SubForm -> Str) . mkStr++prep :: String -> Entry+prep = entry . (const :: Str -> PartForm -> Str) . mkStr++part :: String -> Entry+part = entry . (const :: Str -> PartForm -> Str) . mkStr++inf_mark :: String -> Entry+inf_mark = entry . (const :: Str -> InfMarkForm -> Str) . mkStr++invar :: String -> String -> Entry+invar pos = set_pos pos . entry . f+ where f s AdCompI = strings [s+?"-"]+       f s AdSMSI  = strings [s+?"-"]+       f s _       = strings [s]++-- abbreviations+aba_i_dvs :: String -> Entry+aba_i_dvs = entry . (const :: Str -> ABAForm -> Str) . mkStr++al_o_en :: String -> Entry+al_o_en den = + entry $ \(ArticleForm g s) -> strings $ +                              case (g,s) of+                                (ASgUtr,Indef)   -> ["en"]+                                (ASgNeutr,Indef) -> ["ett"]+                                (APl,Indef)       -> ["ena"]+                                (ASgUtr,Def)   -> ["den"]+                                (ASgNeutr,Def) -> ["det"]+                                (APl,Def)      -> ["de","dom"]+
+ src/saldo/OtherParadigms.hs view
@@ -0,0 +1,568 @@+module OtherParadigms where++hellberg =+ [+  paradigm "nn_1u_flicka"    ["flicka"]     nn1_flicka,+  paradigm "nn_1u_kyrka"     ["kyrka"]      nn1_kyrka,+  paradigm "nn_1u_gata"      ["gata"]       nn1_gata,+  paradigm "nn_1u_olja"      ["olja"]       nn1_olja,+  paradigm "nn_1u_mamma"     ["mamma"]      nn1_mamma,+  paradigm "nn_1u_siffra"    ["siffra"]     nn1_siffra,+  paradigm "nn_1u_dimma"     ["dimma"]      nn1_dimma,  +  paradigm "nn_1p_sopor"     ["sopor"]      nn1_sopor,+  paradigm "nn_1d_faggorna"  ["faggorna"]  nn1_faggorna,+  paradigm "nn_2u_stol"      ["stol"]       nn2,+  paradigm "nn_2u_själ"      ["själ"]       nn2_själ,+  paradigm "nn_2u_brud"      ["brud"]       nn2_brud,+  paradigm "nn_2u_jord"      ["jord"]       nn2_jord,+  paradigm "nn_2u_toker"     ["tok"]        nn2_toker, +  paradigm "nn_2u_gosse"     ["gosse"]      nn2,+  paradigm "nn_2u_hjälte"    ["hjälte"]    nn2_hjälte,+  paradigm "nn_2u_herde"     ["herde"]      nn2_herde,+  paradigm "nn_2u_fru"       ["fru"]        nn2,+  paradigm "nn_2u_by"        ["by"]         nn2_by,+  paradigm "nn_2u_nyckel"    ["nyckel"]     nn2_nyckel,+  paradigm "nn_2u_öken"      ["öken"]       nn2_öken,+  paradigm "nn_2u_botten"    ["botten"]     nn2_öken,+  paradigm "nn_2u_fågel"     ["fågel"]     nn2_fågel,+  paradigm "nn_2u_hummer"    ["hummer"]     nn2_hummer,+  paradigm "nn_2u_kam"       ["kam"]        nn2_kam,+  paradigm "nn_2u_lem"       ["lem"]        nn2_lem,+  paradigm "nn_2u_pojke"     ["pojke"]      nn2,+  paradigm "nn_2u_herre"     ["herre"]      nn2_herre,+  paradigm "nn_vu_vers"      ["vers"]      nn2_vers,+  paradigm "nn_vu_manöver"   ["manöver"]    nn2_manöver,+  paradigm "nn_2p_vägnar"    ["vägnar"]     nn2_vägnar,+  paradigm "nn_2p_stadgar"   ["stadgar"]   nn2_stadgar,+  paradigm "nn_vv_trall"     ["trall"]      nn_vv_trall,+  paradigm "nn_vu_behå"      ["behå"]       nn_vu_behå,+  paradigm "nn_vu_jojo"      ["jojo"]       nn_vu_jojo,+  paradigm "nn_3u_film"      ["film"]       nn3,+  paradigm "nn_3u_gäst"      ["gäst"]        nn3_gäst,+  paradigm "nn_3u_bygd"      ["bygd"]        nn3_bygd,+  paradigm "nn_3u_hävd"      ["hävd"]        nn3_hävd,+  paradigm "nn_3n_vin"       ["vin"]         nn3_vin,+  paradigm "nn_3n_parti"     ["parti"]       nn3_parti,+  paradigm "nn_3n_decennium" ["decennium"]   nn3_museum,+  paradigm "nn_3u_nivå"      ["nivå"]        nn3_motor,+  paradigm "nn_3u_kliché"    ["kliché"]      nn3_kliche,+  paradigm "nn_3u_fiber"     ["fiber"]       nn3_fiber,+  paradigm "nn_vu_kastanj"   ["kastanj"]     nn3_kastanj,+  paradigm "nn_3u_akademi"   ["akademi"]     nn3_akademi,+  paradigm "nn_3v_paraply"   ["paraply"]     nn3_paraply,+  paradigm "nn_3u_musa"      ["musa"]        nn3_musa,+  paradigm "nn_vv_paket"     ["paket"]       nn3_paket,+  paradigm "nn_vn_element"   ["element"]     nn3_element,+  paradigm "nn_vu_hobby"     ["hobby"]       nn3_hobby,+  paradigm "nn_3u_gladiolus" ["gladiolus"]   nn3_gladiolus,+  paradigm "nn_vu_studio"    ["studio"]      nn4,+  paradigm "nn_3p_kläder"    ["kläder"]      nn3_kläder,+  paradigm "nn_4p_choser"    ["choser"]      nn3_kläder,+  paradigm "nn_3u_tand"      ["tand"]        nn3_tand,+  paradigm "nn_vn_kansli"    ["kansli"]      nn_vn_kansli,+  paradigm "nn_4u_linje"     ["linje"]       nn4,+  paradigm "nn_4u_sko"       ["sko"]         nn4,+  paradigm "nn_5n_samhälle"  ["samhälle"]     nn5_samhälle,+  paradigm "nn_5n_piano"     ["piano"]      nn5_piano,+  paradigm "nn_5n_arbete"    ["arbete"]      nn5_arbete,+  paradigm "nn_5n_äpple"     ["äpple"]       nn5_äpple,+  paradigm "nn_5n_knä"       ["knä"]         nn5_knä,+  paradigm "nn_5n_bi"        ["bi"]          nn5_bi,+  paradigm "nn_5n_frö"       ["frö"]         nn5_frö,+  paradigm "nn_vn_party"     ["party"]       nn5_party,+  paradigm "nn_5n_område"     ["område"]     nn5_äpple,+  paradigm "nn_5n_abc"        ["abc"]        nn5_abc,+  paradigm "nn_6n_bord"      ["bord"]        nn6,+  paradigm "nn_6n_barn"      ["barn"]         nn6_barn,+  paradigm "nn_6n_arv"       ["arv"]         nn6_arv,+  paradigm "nn_6u_order"      ["order"]      nn6_akademiker,+  paradigm "nn_6u_kypare"     ["kypare"]     nn6_kikare,+  paradigm "nn_vu_ordförande" ["ordförande"]  vs_ordförande,+  paradigm "nn_6u_mil"        ["mil"]         nn6_mil,+  paradigm "nn_6n_garage"     ["garage"]      nn6_garage,+  paradigm "nn_6v_klientel"   ["klientel"]    nn6_klientel,+  paradigm "nn_6n_segel"      ["segel"]       nn6_segel,+  paradigm "nn_6n_fönster"    ["fönster"]     nn6_lager,+  paradigm "nn_6n_nummer"     ["nummer"]      nn6_nummer,+  paradigm "nn_6n_program"    ["program"]     nn6_program,+  paradigm "nn_6n_manus"          ["manus"]          nn_6n_manus,+  paradigm "nn_vn_faktum"         ["faktum"]         nn_vn_faktum,+  paradigm "nn_vn_distikon"       ["distikon"]       nn_vn_distikon,+  paradigm "nn_vv_abdomen"       ["abdomen"]       nn_vv_abdomen,+  paradigm "nn_vn_nomen"          ["nomen"]          nn_vn_nomen,+  paradigm "nn_vu_ampere"         ["ampere"]         nn_vu_ampere,+  paradigm "nn_vn_understatement" ["understatement"]  nn_vn_understatement,+  paradigm "nn_vu_franc"          ["franc"]          nn_vu_franc,+  paradigm "nn_6u_gås"            ["gås"]            nn_6u_gås,+  paradigm "nn_7u_musical"        ["musical"]        nn_7u_musical,+  paradigm "nn_vu_cocktail"       ["cocktail"]       nn_vu_cocktail,+  paradigm "nn_vu_gangster"       ["gangster"]       nn_vu_gangster,+  paradigm "nn_vu_partner"        ["partner"]        nn_vu_partner,+  paradigm "nn_vu_sandwich"       ["sandwich"]       nn_vu_sandwich,+  paradigm "nn_on_narkotikum"     ["narkotikum"]     nn_on_narkotikum,+  paradigm "nn_ou_examen"         ["examen"]         nn_ou_examen,+  paradigm "nn_vn_centrum"        ["centrum"]        nn_vn_centrum,+  paradigm "nn_ou_emeritus"       ["emeritus"]       nn_ou_emeritus,+  paradigm "nn_vn_tempo"          ["tempo"]          nn_vn_tempo,+  paradigm "nn_ou_fullmäktig"     ["fullmäktig"]     nn_ou_fullmäktig,+  paradigm "nn_0u_mjölk"          ["mjölk"]          nn_0u_mjölk,+  paradigm "nn_0u_tröst"          ["tröst"]          nn_0u_tröst,+  paradigm "nn_0u_adel"           ["adel"]           nn_0u_adel,+  paradigm "nn_0u_början"         ["början"]         nn_0u_början,+  paradigm "nn_0v_uran"           ["uran"]           nn_0v_uran,+  paradigm "nn_0u_fåfänga"        ["fåfänga"]        nn_0u_fåfänga,+  paradigm "nn_0u_biologi"        ["biologi"]        nn_0u_biologi,+  paradigm "nn_0u_brådska"        ["brådska"]        nn_0u_brådska,+  paradigm "nn_0n_smör"           ["smör"]           nn_0n_smör,+  paradigm "nn_0n_kaffe"          ["kaffe"]          nn_0n_kaffe,+  paradigm "nn_0n_socker"         ["socker"]         nn_0n_socker,+  paradigm "nn_0n_aktinium"       ["aktinium"]       nn_0n_aktinium,+  paradigm "nn_0v_januari"        ["januari"]        nn_0v_januari,+  paradigm "nn_du_kneken"         ["kneken"]         nn_du_kneken,+  paradigm "nn_dn_brådrasket"     ["brådrasket"]     nn_dn_brådrasket,+  paradigm "nn_7p_jeans"          ["jeans"]          nn_7p_jeans,+  paradigm "nn_vp_antecedentia"   ["antecedentia"]    nn_vp_antecedentia,+  paradigm "av_0_kronisk"   ["kronisk"]    av_0_kronisk,+  paradigm "av_0_konstlad"  ["konstlad"]   av_0_konstlad,+  paradigm "av_0_gängse"    ["gängse"]     av_0_gängse,+  paradigm "av_1_blek"      ["blek"]       av_1_blek,+  paradigm "av_1_fri"       ["fri"]        av_1_fri,+  paradigm "av_1_lätt"      ["lätt"]       av_1_lätt,+  paradigm "av_1_glad"      ["glad"]       av_1_glad,+  paradigm "av_1_högljudd"  ["högljudd"]   av_1_högljudd,+  paradigm "av_1_hård"      ["hård"]       av_1_hård,+  paradigm "av_1_tunn"      ["tunn"]       av_1_tunn,+  paradigm "av_1_ensam"     ["ensam"]      av_1_ensam,+  paradigm "av_1_vacker"    ["vacker"]     av_1_vacker,+  paradigm "av_1_angelägen" ["angelägen"]  av_1_angelägen,+  paradigm "av_1_ringa"     ["ringa"]      av_1_ringa,+  paradigm "av_2_ung"       ["ung"]        av_2_ung,+  paradigm "av_2k_yttre"    ["yttre"]      av_2k_yttre,+  paradigm "vb_1a_älska"   ["älska"]   v1,+  paradigm "vb_1a_hitta"   ["hitta"]   v1,+  paradigm "vb_1a_vänta"   ["vänta"]   v1, +  paradigm "vb_1a_klaga"   ["klaga"]   v1,+  paradigm "vb_1a_hämma"   ["hämma"]   v1,+  paradigm "vb_1a_vissla"  ["vissla"]  v1,+  paradigm "vb_1a_samla"   ["samla"]   v1,+  paradigm "vb_1a_ändra"   ["ändra"]   v1,+  paradigm "vb_2a_stänga"  ["stänga"]  v2,+  paradigm "vb_2a_stämma"  ["stämma"]  v2,+  paradigm "vb_2a_tända"   ["tända"]   v2,+  paradigm "vb_2a_tyda"    ["tyda"]    v2,+  paradigm "vb_2a_föra"    ["föra"]    v2,+  paradigm "vb_2a_söka"    ["söka"]    v2,+  paradigm "vb_2a_lyfta"   ["lyfta"]   v2,+--  paradigm "vb_2a_välja"   ["välja"]   v2,+  paradigm "vb_2a_följa"   ["följa"]   vb_2a_följa,+  paradigm "vb_2a_sända"   ["sända"]   vb_2a_sända,+  paradigm "vb_2a_knäcka"  ["knäcka"]  vb_2a_knäcka,+  paradigm "vb_2a_vända"   ["vända"]   vb_2a_vända,+  paradigm "vb_2a_dröja"   ["dröja"]   vb_2a_dröja,+  paradigm "vb_3a_sy"      ["sy"]      v3,+  paradigm "vb_3a_klä"     ["klä"]     vb_3a_klä,+  paradigm "vb_4a_se"      ["se"]      vb_4a_se,+  paradigm "vb_4a_gå"      ["gå"]      vb_4a_gå,+  paradigm "vb_4a_bita"    ["bita"]    vb_4a_bita,+  paradigm "vb_4a_krypa"   ["krypa"]   vb_4a_krypa,+  paradigm "vb_4a_vinna"   ["vinna"]   vb_4a_vinna,+  paradigm "vb_4a_riva"    ["riva"]    vb_4a_bita,+  paradigm "vb_4a_binda"   ["binda"]   vb_4a_vinna,+  paradigm "vb_4a_dricka"  ["dricka"]  vb_4a_vinna,+  paradigm "vb_4a_bära"    ["bära"]    vb_4a_vinna,+  paradigm "vb_4a_sitta"   ["sitta"]   vb_4a_vinna,+  paradigm "vb_1s_brottas" ["brottas"]  vb_1s_hoppas,+  paradigm "vb_1s_lyckas"  ["lyckas"]   vb_1s_lyckas,+  paradigm "vb_1s_nalkas"  ["nalkas"]   vb_1s_nalkas,+  paradigm "vb_1s_färdas"  ["färdas"]   vb_1s_färdas,+  paradigm "vb_va_koka"    ["koka"]    vb_va_koka,+  paradigm "vb_va_mista"   ["mista"]   vb_va_mista,+  paradigm "vb_va_sprida"  ["sprida"]  vb_va_sprida,+  paradigm "nl_g_tre"     ["tre"]     number_numeral,+  paradigm "nl_o_tredje"  ["tredje"]  number_ordinal,+  paradigm "nl_g_tretton" ["tretton"] number_tretton,+  paradigm "nl_g_trettio" ["trettio"] number_trettio,+  paradigm "nl_o_andra"   ["andra"]   number_andra+ ]++-- garbage bin+  --  paradigm "nn_op_prestanda"      ["prestanda"]      nn_op_prestanda,+ -- paradigm "nnn_0n_kaos" ["kaos"]  $+ --  noun Neutr [""] ["et"] [] [],++  -- vbm+{-+  paradigm "vbm_1msp1_laga"         ["laga"]           defined_but_empty,+  paradigm "vbm_1msv1_laga"         ["laga"]           defined_but_empty,+  paradigm "vbm_1md1_laga"          ["laga"]           defined_but_empty,+  paradigm "vbm_4mp1_vara"          ["vara"]           defined_but_empty,+  paradigm "vbm_2ms1_hända"         ["hända"]          defined_but_empty,+  paradigm "vbm_1mp2_laga"          ["laga"]           defined_but_empty,+  paradigm "vbm_oms1_vilja"         ["vilja"]          defined_but_empty,+  paradigm "vbm_omp1_vilja"         ["vilja"]          defined_but_empty,+  paradigm "vbm_2ms1_välja"         ["välja"]          defined_but_empty,+  paradigm "vbm_1szt1_laga"         ["laga"]           defined_but_empty,+  paradigm "vbm_1mzd1_laga"         ["laga"]           defined_but_empty,+  paradigm "vbm_1mpv1_laga"         ["laga"]           defined_but_empty,+  paradigm "vbm_1mlv1_laga"         ["laga"]           defined_but_empty,+  paradigm "vbm_1ic_laga"           ["laga"]           defined_but_empty,+  paradigm "vbm_1ai1_laga"          ["laga"]           defined_but_empty,+  paradigm "vbm_1sp1_andas"         ["andas"]          defined_but_empty,+  paradigm "vbm_2ai1_ansöka"        ["ansöka"]         defined_but_empty,+  paradigm "vbm_2al1_breda"         ["breda"]          defined_but_empty,+  paradigm "vbm_2al1_lägga"         ["lägga"]          defined_but_empty,+  paradigm "vbm_2al1_sätta"         ["sätta"]          defined_but_empty,+  paradigm "vbm_2alv1_sätta"        ["sätta"]          defined_but_empty,+  paradigm "vbm_2ap1_ansöka"        ["ansöka"]         defined_but_empty,+  paradigm "vbm_2ap1_breda"         ["breda"]          defined_but_empty,+  paradigm "vbm_2ap1_göra"          ["göra"]           defined_but_empty,+  paradigm "vbm_2ap1_hyra"          ["hyra"]           defined_but_empty,+  paradigm "vbm_2ap1_känna"         ["känna"]          defined_but_empty,+  paradigm "vbm_2ap1_lyfta"         ["lyfta"]          defined_but_empty,+  paradigm "vbm_2ap1_lägga"         ["lägga"]          defined_but_empty,+  paradigm "vbm_2ap1_säga"          ["säga"]           defined_but_empty,+  paradigm "vbm_2ap1_sända"         ["sända"]          defined_but_empty,+  paradigm "vbm_2ap1_sätta"         ["sätta"]          defined_but_empty,+  paradigm "vbm_2ap1_viga"          ["viga"]           defined_but_empty,+  paradigm "vbm_2av1_sända"         ["sända"]          defined_but_empty,+  paradigm "vbm_2av1_viga"          ["viga"]           defined_but_empty,+  paradigm "vbm_2md1_ha"            ["ha"]             defined_but_empty,+  paradigm "vbm_2md1_lägga"         ["lägga"]          defined_but_empty,+  paradigm "vbm_2mi1_lägga"         ["lägga"]          defined_but_empty,+  paradigm "vbm_2mi1_tillväxa"      ["tillväxa"]       defined_but_empty,+  paradigm "vbm_2mi2_leda"          ["leda"]           defined_but_empty,+  paradigm "vbm_2ml1_göra"          ["göra"]           defined_but_empty,+  paradigm "vbm_2ml1_leda"          ["leda"]           defined_but_empty,+  paradigm "vbm_2ml1_lägga"         ["lägga"]          defined_but_empty,+  paradigm "vbm_2ml1_väga"          ["väga"]           defined_but_empty,+  paradigm "vbm_2mlv1_ha"           ["ha"]             defined_but_empty,+  paradigm "vbm_2mlvs1_tillväxa"    ["tillväxa"]       defined_but_empty,+  paradigm "vbm_2mp1_göra"          ["göra"]           defined_but_empty,+  paradigm "vbm_2mp1_hyra"          ["hyra"]           defined_but_empty,+  paradigm "vbm_2mp1_känna"         ["känna"]          defined_but_empty,+  paradigm "vbm_2mp1_leda"          ["leda"]           defined_but_empty,+  paradigm "vbm_2mp1_lägga"         ["lägga"]          defined_but_empty,+  paradigm "vbm_2mp1_sätta"         ["sätta"]          defined_but_empty,+  paradigm "vbm_2mp1_tillväxa"      ["tillväxa"]       defined_but_empty,+  paradigm "vbm_2mp1_viga"          ["viga"]           defined_but_empty,+  paradigm "vbm_2mp1_väga"          ["väga"]           defined_but_empty,+  paradigm "vbm_2mps1_breda"        ["breda"]          defined_but_empty,+  paradigm "vbm_2mps1_göra"         ["göra"]           defined_but_empty,+  paradigm "vbm_2mps1_ha"           ["ha"]             defined_but_empty,+  paradigm "vbm_2mps1_hyra"         ["hyra"]           defined_but_empty,+  paradigm "vbm_2mps1_känna"        ["känna"]          defined_but_empty,+  paradigm "vbm_2mps1_sätta"        ["sätta"]          defined_but_empty,+  paradigm "vbm_2mps1_tillväxa"     ["tillväxa"]       defined_but_empty,+  paradigm "vbm_2mps1_viga"         ["viga"]           defined_but_empty,+  paradigm "vbm_2mps1_väga"         ["väga"]           defined_but_empty,+  paradigm "vbm_2mpsv1_väga"        ["väga"]           defined_but_empty,+  paradigm "vbm_2mpv1_göra"         ["göra"]           defined_but_empty,+  paradigm "vbm_2mpv1_lägga"        ["lägga"]          defined_but_empty,+  paradigm "vbm_2mpv1_väga"         ["väga"]           defined_but_empty,+  paradigm "vbm_2ms1_ansöka"        ["ansöka"]         defined_but_empty,+  paradigm "vbm_2ms1_breda"         ["breda"]          defined_but_empty,+  paradigm "vbm_2ms1_glädja"        ["glädja"]         defined_but_empty,+  paradigm "vbm_2ms1_göra"          ["göra"]           defined_but_empty,+  paradigm "vbm_2ms1_hyra"          ["hyra"]           defined_but_empty,+  paradigm "vbm_2ms1_känna"         ["känna"]          defined_but_empty,+  paradigm "vbm_2ms1_leda"          ["leda"]           defined_but_empty,+  paradigm "vbm_2ms1_lyfta"         ["lyfta"]          defined_but_empty,+  paradigm "vbm_2ms1_lägga"         ["lägga"]          defined_but_empty,+  paradigm "vbm_2ms1_skilja"        ["skilja"]         defined_but_empty,+  paradigm "vbm_2ms1_säga"          ["säga"]           defined_but_empty,+  paradigm "vbm_2ms1_sätta"         ["sätta"]          defined_but_empty,+  paradigm "vbm_2ms1_tillväxa"      ["tillväxa"]       defined_but_empty,+  paradigm "vbm_2ms1_viga"          ["viga"]           defined_but_empty,+  paradigm "vbm_2ms1_väga"          ["väga"]           defined_but_empty,+  paradigm "vbm_2msl1_göra"         ["göra"]           defined_but_empty,+  paradigm "vbm_2msp1_göra"         ["göra"]           defined_but_empty,+  paradigm "vbm_2msp1_hyra"         ["hyra"]           defined_but_empty,+  paradigm "vbm_2msp1_lägga"        ["lägga"]          defined_but_empty,+  paradigm "vbm_2msp1_sätta"        ["sätta"]          defined_but_empty,+  paradigm "vbm_2msp1_tillväxa"     ["tillväxa"]       defined_but_empty,+  paradigm "vbm_2msp1_väga"         ["väga"]           defined_but_empty,+  paradigm "vbm_2mspv1_göra"        ["göra"]           defined_but_empty,+  paradigm "vbm_2mspv1_lägga"       ["lägga"]          defined_but_empty,+  paradigm "vbm_2msv1_väga"         ["väga"]           defined_but_empty,+  paradigm "vbm_2mv1_känna"         ["känna"]          defined_but_empty,+  paradigm "vbm_2mv1_leda"          ["leda"]           defined_but_empty,+  paradigm "vbm_2mv1_viga"          ["viga"]           defined_but_empty,+  paradigm "vbm_2mzd1_göra"         ["göra"]           defined_but_empty,+  paradigm "vbm_2mzdv1_sätta"       ["sätta"]          defined_but_empty,+  paradigm "vbm_2sp1_blygas"        ["blygas"]         defined_but_empty,+  paradigm "vbm_2sp1_minnas"        ["minnas"]         defined_but_empty,+  paradigm "vbm_2sp1_synas"         ["synas"]          defined_but_empty,+  paradigm "vbm_3ap1_sy"            ["sy"]             defined_but_empty,+  paradigm "vbm_3mp1_sy"            ["sy"]             defined_but_empty,+  paradigm "vbm_3ms1_sy"            ["sy"]             defined_but_empty,+  paradigm "vbm_3msp1_sy"           ["sy"]             defined_but_empty,+  paradigm "vbm_3mzd1_sy"           ["sy"]             defined_but_empty,+  paradigm "vbm_3sv1_brås"          ["brås"]           defined_but_empty,+  paradigm "vbm_41_ge"              ["ge"]             defined_but_empty,+  paradigm "vbm_4ad1_bära"          ["bära"]           defined_but_empty,+  paradigm "vbm_4ad1_falla"         ["falla"]          defined_but_empty,+  paradigm "vbm_4ad1_ge"            ["ge"]             defined_but_empty,+  paradigm "vbm_4ad1_gå"            ["gå"]             defined_but_empty,+  paradigm "vbm_4ad1_komma"         ["komma"]          defined_but_empty,+  paradigm "vbm_4ad1_se"            ["se"]             defined_but_empty,+  paradigm "vbm_4ad1_ta"            ["ta"]             defined_but_empty,+  paradigm "vbm_4al1_dricka"        ["dricka"]         defined_but_empty,+  paradigm "vbm_4al1_gå"            ["gå"]             defined_but_empty,+  paradigm "vbm_4al1_komma"         ["komma"]          defined_but_empty,+  paradigm "vbm_4al1_rida"          ["rida"]           defined_but_empty,+  paradigm "vbm_4ap1_bestå"         ["bestå"]          defined_but_empty,+  paradigm "vbm_4ap1_bjuda"         ["bjuda"]          defined_but_empty,+  paradigm "vbm_4ap1_bliva"         ["bliva"]          defined_but_empty,+  paradigm "vbm_4ap1_bryta"         ["bryta"]          defined_but_empty,+  paradigm "vbm_4ap1_bära"          ["bära"]           defined_but_empty,+  paradigm "vbm_4ap1_dö"            ["dö"]             defined_but_empty,+  paradigm "vbm_4ap1_flyga"         ["flyga"]          defined_but_empty,+  paradigm "vbm_4ap1_ge"            ["ge"]             defined_but_empty,+  paradigm "vbm_4ap1_gå"            ["gå"]             defined_but_empty,+  paradigm "vbm_4ap1_hålla"         ["hålla"]          defined_but_empty,+  paradigm "vbm_4ap1_komma"         ["komma"]          defined_but_empty,+  paradigm "vbm_4ap1_rida"          ["rida"]           defined_but_empty,+  paradigm "vbm_4ap1_se"            ["se"]             defined_but_empty,+  paradigm "vbm_4ap1_skjuta"        ["skjuta"]         defined_but_empty,+  paradigm "vbm_4ap1_slå"           ["slå"]            defined_but_empty,+  paradigm "vbm_4ap1_ta"            ["ta"]             defined_but_empty,+  paradigm "vbm_4ap1_tillåta"       ["tillåta"]        defined_but_empty,+  paradigm "vbm_4ap1_äta"           ["äta"]            defined_but_empty,+  paradigm "vbm_4apl1_ta"           ["ta"]             defined_but_empty,+  paradigm "vbm_4apv1_rida"         ["rida"]           defined_but_empty,+  paradigm "vbm_4av1_gå"            ["gå"]             defined_but_empty,+  paradigm "vbm_4av1_hålla"         ["hålla"]          defined_but_empty,+  paradigm "vbm_4av1_rida"          ["rida"]           defined_but_empty,+  paradigm "vbm_4lv1_slå"           ["slå"]            defined_but_empty,+  paradigm "vbm_4md1_fnysa"         ["fnysa"]          defined_but_empty,+  paradigm "vbm_4md1_gå"            ["gå"]             defined_but_empty,+  paradigm "vbm_4md1_hålla"         ["hålla"]          defined_but_empty,+  paradigm "vbm_4md1_komma"         ["komma"]          defined_but_empty,+  paradigm "vbm_4md1_le"            ["le"]             defined_but_empty,+  paradigm "vbm_4md1_ligga"         ["ligga"]          defined_but_empty,+  paradigm "vbm_4md1_sitta"         ["sitta"]          defined_but_empty,+  paradigm "vbm_4md1_slå"           ["slå"]            defined_but_empty,+  paradigm "vbm_4md1_stå"           ["stå"]            defined_but_empty,+  paradigm "vbm_4md1_ta"            ["ta"]             defined_but_empty,+  paradigm "vbm_4md1_vina"          ["vina"]           defined_but_empty,+  paradigm "vbm_4mi1_bära"          ["bära"]           defined_but_empty,+  paradigm "vbm_4mi1_ge"            ["ge"]             defined_but_empty,+  paradigm "vbm_4mi1_gå"            ["gå"]             defined_but_empty,+  paradigm "vbm_4mi1_hålla"         ["hålla"]          defined_but_empty,+  paradigm "vbm_4mi1_ta"            ["ta"]             defined_but_empty,+  paradigm "vbm_4mi1_vina"          ["vina"]           defined_but_empty,+  paradigm "vbm_4ml1_ge"            ["ge"]             defined_but_empty,+  paradigm "vbm_4ml1_gå"            ["gå"]             defined_but_empty,+  paradigm "vbm_4ml1_hålla"         ["hålla"]          defined_but_empty,+  paradigm "vbm_4ml1_ligga"         ["ligga"]          defined_but_empty,+  paradigm "vbm_4ml1_ljuda"         ["ljuda"]          defined_but_empty,+  paradigm "vbm_4ml1_slå"           ["slå"]            defined_but_empty,+  paradigm "vbm_4ml1_stå"           ["stå"]            defined_but_empty,+  paradigm "vbm_4ml1_ta"            ["ta"]             defined_but_empty,+  paradigm "vbm_4mlv1_gå"           ["gå"]             defined_but_empty,+  paradigm "vbm_4mlv1_komma"        ["komma"]          defined_but_empty,+  paradigm "vbm_4mp1_bliva"         ["bliva"]          defined_but_empty,+  paradigm "vbm_4mp1_bära"          ["bära"]           defined_but_empty,+  paradigm "vbm_4mp1_fara"          ["fara"]           defined_but_empty,+  paradigm "vbm_4mp1_gå"            ["gå"]             defined_but_empty,+  paradigm "vbm_4mp1_hålla"         ["hålla"]          defined_but_empty,+  paradigm "vbm_4mp1_komma"         ["komma"]          defined_but_empty,+  paradigm "vbm_4mp1_ryta"          ["ryta"]           defined_but_empty,+  paradigm "vbm_4mp1_se"            ["se"]             defined_but_empty,+  paradigm "vbm_4mp1_sitta"         ["sitta"]          defined_but_empty,+  paradigm "vbm_4mp1_skjuta"        ["skjuta"]         defined_but_empty,+  paradigm "vbm_4mp1_slå"           ["slå"]            defined_but_empty,+  paradigm "vbm_4mp1_stå"           ["stå"]            defined_but_empty,+  paradigm "vbm_4mp1_ta"            ["ta"]             defined_but_empty,+  paradigm "vbm_4mp1_vina"          ["vina"]           defined_but_empty,+  paradigm "vbm_4mpd1_ta"           ["ta"]             defined_but_empty,+  paradigm "vbm_4mpl1_ta"           ["ta"]             defined_but_empty,+  paradigm "vbm_4mps1_ge"           ["ge"]             defined_but_empty,+  paradigm "vbm_4mps1_hålla"        ["hålla"]          defined_but_empty,+  paradigm "vbm_4mps1_komma"        ["komma"]          defined_but_empty,+  paradigm "vbm_4mps1_skjuta"       ["skjuta"]         defined_but_empty,+  paradigm "vbm_4mps1_skåpäta"      ["skåpäta"]        defined_but_empty,+  paradigm "vbm_4mps1_slå"          ["slå"]            defined_but_empty,+  paradigm "vbm_4mpv1_hålla"        ["hålla"]          defined_but_empty,+  paradigm "vbm_4mpv1_slå"          ["slå"]            defined_but_empty,+  paradigm "vbm_4mpv1_ta"           ["ta"]             defined_but_empty,+  paradigm "vbm_4mpv1_vara"         ["vara"]           defined_but_empty,+  paradigm "vbm_4mpzd1_slå"         ["slå"]            defined_but_empty,+  paradigm "vbm_4ms1_angå"          ["angå"]           defined_but_empty,+  paradigm "vbm_4ms1_be"            ["be"]             defined_but_empty,+  paradigm "vbm_4ms1_bära"          ["bära"]           defined_but_empty,+  paradigm "vbm_4ms1_förhålla"      ["förhålla"]       defined_but_empty,+  paradigm "vbm_4ms1_ge"            ["ge"]             defined_but_empty,+  paradigm "vbm_4ms1_gråta"         ["gråta"]          defined_but_empty,+  paradigm "vbm_4ms1_hålla"         ["hålla"]          defined_but_empty,+  paradigm "vbm_4ms1_komma"         ["komma"]          defined_but_empty,+  paradigm "vbm_4ms1_ljuda"         ["ljuda"]          defined_but_empty,+  paradigm "vbm_4ms1_ryta"          ["ryta"]           defined_but_empty,+  paradigm "vbm_4ms1_sitta"         ["sitta"]          defined_but_empty,+  paradigm "vbm_4ms1_skåpäta"       ["skåpäta"]        defined_but_empty,+  paradigm "vbm_4ms1_slå"           ["slå"]            defined_but_empty,+  paradigm "vbm_4ms1_sova"          ["sova"]           defined_but_empty,+  paradigm "vbm_4ms1_stå"           ["stå"]            defined_but_empty,+  paradigm "vbm_4ms1_ta"            ["ta"]             defined_but_empty,+  paradigm "vbm_4ms1_tillåta"       ["tillåta"]        defined_but_empty,+  paradigm "vbm_4ms1_utfalla"       ["utfalla"]        defined_but_empty,+  paradigm "vbm_4ms1_vina"          ["vina"]           defined_but_empty,+  paradigm "vbm_4msd1_ge"           ["ge"]             defined_but_empty,+  paradigm "vbm_4msd1_slå"          ["slå"]            defined_but_empty,+  paradigm "vbm_4msp1_bära"         ["bära"]           defined_but_empty,+  paradigm "vbm_4msp1_ge"           ["ge"]             defined_but_empty,+  paradigm "vbm_4msp1_komma"        ["komma"]          defined_but_empty,+  paradigm "vbm_4msp1_slå"          ["slå"]            defined_but_empty,+  paradigm "vbm_4msp1_stå"          ["stå"]            defined_but_empty,+  paradigm "vbm_4mspv1_ge"          ["ge"]             defined_but_empty,+  paradigm "vbm_4msv1_ge"           ["ge"]             defined_but_empty,+  paradigm "vbm_4mv1_fnysa"         ["fnysa"]          defined_but_empty,+  paradigm "vbm_4mv1_hålla"         ["hålla"]          defined_but_empty,+  paradigm "vbm_4mv1_stå"           ["stå"]            defined_but_empty,+  paradigm "vbm_4mv1_vina"          ["vina"]           defined_but_empty,+  paradigm "vbm_4sp1_stickas"       ["stickas"]        defined_but_empty,+  paradigm "vbm_4sv1_ta"            ["ta"]             defined_but_empty,+  paradigm "vbm_4sv1_tas"           ["tas"]            defined_but_empty,+  paradigm "vbm_vap1_koka"          ["koka"]           defined_but_empty,+  paradigm "vbm_vap1_nypa"          ["nypa"]           defined_but_empty,+  paradigm "vbm_vap1_strypa"        ["strypa"]         defined_but_empty,+  paradigm "vbm_vap1_vika"          ["vika"]           defined_but_empty,+  paradigm "vbm_vap1_växa"          ["växa"]           defined_but_empty,+  paradigm "vbm_vml1_mala"          ["mala"]           defined_but_empty,+  paradigm "vbm_vmp1_fnysa"         ["fnysa"]          defined_but_empty,+  paradigm "vbm_vmp1_lyfta"         ["lyfta"]          defined_but_empty,+  paradigm "vbm_vmp1_smälla"        ["smälla"]         defined_but_empty,+  paradigm "vbm_vmp1_smälta"        ["smälta"]         defined_but_empty,+  paradigm "vbm_vmp1_upphäva"       ["upphäva"]        defined_but_empty,+  paradigm "vbm_vmps1_smälla"       ["smälla"]         defined_but_empty,+  paradigm "vbm_vmps1_växa"         ["växa"]           defined_but_empty,+  paradigm "vbm_vms1_besvärja"      ["besvärja"]       defined_but_empty,+  paradigm "vbm_vms1_förlöpa"       ["förlöpa"]        defined_but_empty,+  paradigm "vbm_vms1_tvinga"        ["tvinga"]         defined_but_empty,+  paradigm "vbm_vsp1_ryckas"        ["ryckas"]         defined_but_empty,+  paradigm "vbm_vsv1_talas"         ["talas"]          defined_but_empty,+  -- f words+  paradigm "nnf_pd_tygen"           ["tygen"]          defined_but_empty,+  paradigm "nnf_iu_syne"            ["syne"]           defined_but_empty,+  paradigm "avf_id_rama"            ["rama"]           defined_but_empty,+  paradigm "nnf_iu_hank"            ["hank"]           defined_but_empty,+  paradigm "nnf_iu_avvaktan"        ["avvaktan"]       defined_but_empty,+  paradigm "nnf_ip_låtanden"        ["låtanden"]       defined_but_empty,+  paradigm "avf_iu_stången"         ["stången"]        defined_but_empty,+  paradigm "avf_in_påskrivet"       ["påskrivet"]      defined_but_empty,+  paradigm "avf_i_kok"              ["kok"]            defined_but_empty,+-}++{-+  paradigm "vbm_1ml1_laga"           ["ana oråd"]            defined_but_empty,+  paradigm "vbm_1mp1_laga"           ["apa efter"]           defined_but_empty,+  paradigm "vbm_1mps1_laga"          ["bälga i sig"]         defined_but_empty,+  paradigm "vbm_1ms1_laga"           ["arta sig"]            defined_but_empty,+  paradigm "vbm_1mv1_laga"           ["fasa för"]            defined_but_empty+-}++--  paradigm "nnf_dn_rasket"      ["rasket"]          defined_but_empty,+--  paradigm "nnf_du_vippen"      ["vippen"]          defined_but_empty,+--  paradigm "nnp_3p_griller"     ["griller"]         defined_but_empty,++  -- paradigm "avp_ik_bättre" ["bättre"] $ unDEFINED,+  -- paradigm "ava_i_kungl" ["kungl"] $ unDEFINED  +  -- paradigm "pc_4_förklädd" ["förklädd"] $ unDEFINED,+  -- paradigm "pca_i_k" ["k"] $ unDEFINED,+  -- paradigm "nn_op_prestanda" ["prestanda"] $ unDEFINED,+  -- paradigm "nn_vv_fakta" ["fakta"]  defined_but_empty,+  -- paradigm "pc_1_avskräckande" ["avskräckande"] $ unDEFINED,+  -- paradigm "pc_3_försenad" ["försenad"] $ unDEFINED,+  -- paradigm "pc_3_rökt" ["rökt"] $ unDEFINED,+  -- paradigm "pc_4_anställd" ["anställd"] $ unDEFINED,+  -- paradigm "pc_4_hemfallen" ["hemfallen"] $ unDEFINED,+   --congruence last_mw "nnm" (noun Utr [""] ["en"] ["er"] ["erna"]),  +  -- ha & hava ++--  paradigm "nnp_2u_moder" ["moder"]  $ defined_but_empty,+--  paradigm "vbp_om_skola" ["skola"]  $ defined_but_empty,+++-- paradigm "pn_o_din"               ["din"]  $+-- pn_nagon (s [""],[(tk 1,"tt")],s ["a"]),+-- paradigm "pn_o_våran"             ["våran"]             pn_inv,+-- paradigm "pn_d_inget"             ["inget"]             pn_inv,+-- paradigm "pn_o_sin"               ["sin"]               pn_inv,+-- paradigm "pn_o_min"               ["min"]               pn_inv,+-- +--  paradigm "av_2_trång" ["trång"] +--    (adj 0 (s [""], s ["t"], s ["a"], s ["a"], [(vc "ä", "re"),(id,"are")], [(vc "ä", "st"),(id,"ast")], [(vc "ä", "st"),(id,"ast")])), +--  paradigm "av_2_lång" ["lång"]    +--     (adj 0 (s [""], s ["t"], s ["a"], s ["a"],[(umlaut,"re")],[(umlaut,"st")], [(umlaut,"ste")])), +--  paradigm "av_2_låg" ["låg"] +--     (adj 0 (s [""], s ["t"], s ["a"], s ["a"],[(umlaut,"re")],[(umlaut,"st")], [(umlaut,"ste")])), +--  paradigm "av_1_ljus" ["ljus"] +--   (adj 0 (s [""], s ["t"], s ["a"], s ["a"], s ["are"], s ["ast"], s ["aste"])), +--  paradigm "av_2_grov" ["grov"] +--   (adj 0 (s [""], s ["t"], s ["a"], s ["a"], [(umlaut,"re")],[(umlaut,"st")],[(umlaut,"ste")])), +--  paradigm "av_2_stor" ["stor"] +--   (adj 0 (s [""], s ["t"], s ["a"], s ["a"], [(umlaut,"re")],[(umlaut,"st")],[(umlaut,"ste")])), +--  paradigm "av_2_hög" ["hög"] +--   (adj 0 (s [""], s ["t"], s ["a"], s ["a"], s ["re"], s ["st"],[(umlaut,"ste")])), +--   paradigm "vb_4m_bli" ["bli"] +--   (verb_wcf 0 (s ["","va"], s ["r","ver"], s [""],[(vc "e", "v")], s ["vit"], [])),+--  paradigm "vb_2a_svälja" ["svälja"] +--   (verb_wcf 1 (s ["a"], s ["er"], s [""], [(vc "a". tk 1, "de")], [(vc "a" . tk 1, "t")], [(vc "a" . tk 1,"d")])),+--  paradigm "vb_2m_tillväxa" ["tillväxa"]  +--   (verb_wc 1 ["a"] ["er"] ["a"] ["te"] ["t"] []),+--  paradigm "vb_2m_hava" ["hava"] +--   (verb_wc 2 ["va"] ["r","ver"] ["v",""] ["de"] ["ft"] []),+--  paradigm "vb_2m_kvälja" ["kvälja"]  $+--   verb_wcf 1 (s ["a"], s ["er"], s [""], [(vc "a".tk 1, "de")], [(vc "a".tk 1, "t")], []),+--  paradigm "vb_2a_skilja" ["skilja"]  $+--   verb_wcf 1 (s ["a"], s ["er"], s [""], [(tk 1,"de")], [(tk 1,"t")], [(tk 1, "d")]),+--  paradigm "vb_2a_smörja" ["smörja"]  $+--   verb_wcf 1 (s ["a"], s ["er"], s [""], [(vc "o" . tk 1, "de")], [(vc "o".tk 1,"t")], [(vc "o" . tk 1, "d")]),+--  paradigm "vb_1a_bussa" ["bussa"]  $+--   verb_wc 1 ["a"] ["ar"] ["a", ""] ["ade"] ["at"] ["ad","t"],+--  paradigm "nn_0n_spad" ["spad"]   $+--   noun_f Neutr (s [""],[(tk 1,"t"),(id,"et")], [], []),+--  paradigm "nn_2u_furste" ["furste"]  $+--   noun_f Utr (s [""], s ["n"],[(tk 1,"ar")],[(tk 1,"arna")]),+--  paradigm "nn_2u_bemärkelsedag" ["bemärkelsedag"]  $+--   noun_f Utr (s [""],[(id,"en"),(tk 1,"n")],[(id,"ar"),(tk 1,"r")],[(id,"arna"),(tk 1,"rna")]),+-- paradigm "nn_5n_hjärta" ["hjärta"]  $+--   noun Neutr [""] ["t"] ["n"] ["na"],+--  paradigm "nn_6p_studiemedel" ["studiemedel"]  $+--   noun GPl [] [] [""] ["na"],+--  paradigm "nn_6n_mygg" ["mygg"]  $+--   noun Neutr [""] ["et"] [""] ["en"],+--  paradigm "nn_6u_kejsare" ["kejsare"]  $+--   noun_f Utr (s [""],[(id,"n"),(tk 1,"n")], s [""],[(tk 1,"na")]),+--  paradigm "nn_2u_sommar" ["sommar"]  $+--   noun_f Utr (s [""], s ["en","n"],[(ungeminate . tk 2, "rar")], [(ungeminate . tk 2,"rarna")]),+--  paradigm "nn_2u_sjö" ["sjö"]   $+--   noun Utr [""] ["n"] ["ar"] ["arna"],+--  paradigm "nn_2u_vinter" ["vinter"]  $+--   noun_f Utr (s [""], s ["n"],[(dv,"ar")],[(dv,"arna")]),+--  paradigm "nn_2u_gud" ["gud"]  $+--   noun Utr [""] ["en"] ["ar"] ["arna"],+--  paradigm "nn_3u_syn" ["syn"]  $+--   noun Utr [""] ["en"] ["er"] ["erna"],+--  paradigm "nn_6n_ord" ["ord"]  $+--   noun Neutr [""] ["et"] [""] ["en"],+--  paradigm "nn_6n_drivankare" ["drivankare"]  $     +--   noun_f Neutr (s [""], s ["t"], s ["","n"], [(tk 1,"na")]),+--  paradigm "nn_3u_rätt" ["rätt"]  $      +--   noun Utr [""] ["en"] ["er"] ["erna"],+--  paradigm "nn_0n_mörker" ["mörker"]  $       +--   noun_f Neutr (s [""], [(dv,"et")],[],[]),+ -- paradigm "pmm_u0og_högsta_domstolen"     ["högsta domstolen"]     $ pmm_u "og",+--  paradigm "av_1_underdånig" ["underdånig"]    +--    (adj 0 (s [""], s ["t"], s ["a"], s ["a"], s ["are"], s ["ast","st"], s ["aste","ste"])), +--  paradigm "av_1_rätt" ["rätt"] +--    (adj 0 (s [""], s [""], s ["a"], s ["a"], [], [], [])), + -- paradigm "vb_2a_breda"                    ["breda"]               v2,+--  paradigm "pn_o_er"                        ["er"]                  pn_dylik,+--  paradigm "vb_4a_dra"               ["dra"]                 vb_4a_draga,+-- paradigm "nn_vu_klammer"      ["klammer"]         nn_vu_klammer,+-- paradigm "nn_vu_roller"       ["roller"]          nn_vu_roller,+-- paradigm "nn_6u_bagis"        ["bagis"]           nn6_mil,+-- paradigm "nn_6u_hertz"        ["hertz"]           nn6_mil,+-- paradigm "nn_6n_hus"          ["hus"]             nn6,+--  paradigm "nnm_0na_kort_varsel" ["kort varsel"]  $ unDEFINED,
+ src/saldo/OtherRulesSw.hs view
@@ -0,0 +1,212 @@+----------------------------------------------------------------------+-- |+-- Module      : OtherRulesSw+-- Maintainer  : Markus Forsberg+-- Stability   : (stability)+-- Portability : (portability)+--+--+-------------------------------------------------------------------------+module OtherRulesSw where++import GenRulesSw+import General  +import TypesSw  +import AdjRulesSw(av1blek)+import NounRulesSw(mk_case,mk_case_v)++-- adverbs++no_comp :: Adverb -> Adverb+no_comp f = missing f [AdComp, AdSMS]++mk_adverb :: [String] -> [String] -> [String] -> Adverb+mk_adverb bra battre bast af = strings $+   case af of+    (AdverbForm Posit)  -> bra+    (AdverbForm Compar) -> battre+    (AdverbForm Superl) -> bast+    AdComp              -> concat [[x,x +? "-"] | x <- bra]+    AdSMS               -> [x +? "-" | x <- bra]++mk_adverb_c :: [String] -> [String] -> [String] -> [String] -> Adverb+mk_adverb_c bra battre bast comp af = strings $+   case af of+    (AdverbForm Posit)  -> bra+    (AdverbForm Compar) -> battre+    (AdverbForm Superl) -> bast+    AdComp              -> concat [[x,x +? "-"] | x <- comp]+    AdSMS               -> [x +? "-" | x <- comp]++abfrämst :: String -> Adverb+abfrämst främst = no_comp $ mk_adverb [] [] [främst]++abfint :: String -> Adverb+abfint = adjective_to_adverb . av1blek . tk 1++abfort fort = mk_adverb [fort] [fort +? "are"] [fort +? "ast"]+++adjective_to_adverb :: Adjective -> Adverb+adjective_to_adverb adj =  +    giveValues  [adj (AF p Nom) | p <- [Pos (Strong (ASgNeutr)), +                                        Comp, Super SupStrong]]++ab_i_no_comp :: String -> AdverbInv+ab_i_no_comp s AdverbInvForm = mkStr s+ab_i_no_comp s _             = nonExist++abm :: String -> AdverbMInv+abm till_exempel _ = mkStr $ till_exempel++-- pronouns++mk_pron_jag :: (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> String -> PronPN+mk_pron_jag (jag,mig,min,mitt,mina) s c = strings $ case c of+  PNom            -> suff jag+  PAcc            -> suff mig+  PGen (ASgUtr)   -> suff min+  PGen (ASgNeutr) -> suff mitt+  PGen APl        -> suff mina+-- map (++ "a") min + where suff = apply_suffixes s++-- pron_refl = mk_pron_jag [] "sig" "sin" "sitt" `missing` [PNom]++mk_pron_han :: (Suffixes, Suffixes, Suffixes) -> String -> PronPN+mk_pron_han (han, honom, hans) s c = strings $ case c of+  PNom   -> suff han+  PAcc   -> suff honom+  PGen _ -> suff hans+ where suff = apply_suffixes s++mk_pron_nagon :: (Suffixes,Suffixes,Suffixes) -> String -> PronAdj+mk_pron_nagon (nagon,nagot,nagra) s (AP gn c) = strings $ map (mk_case c) $+    case gn of+     ASgUtr   -> suff nagon+     ASgNeutr -> suff nagot+     APl      -> suff nagra+ where suff = apply_suffixes s++pnm_o_den_här_rule :: String -> PronAdj+pnm_o_den_här_rule den_här (AP gn c) = +    case (gn,c) of+      (ASgUtr,Nom)   -> mkStr $ unwords [de++"n",här]+      (ASgNeutr,Nom) -> mkStr $ unwords [de++"t",här]+      (APl,Nom)      -> mkStr $ unwords [de,här]+      _ -> nonExist+ where (de,här) = case words den_här of+                    [den,här] -> (tk 1 den, här)+                    _         -> ([],[])++mk_pn_o_den :: String -> PronAdj+mk_pn_o_den den (AP gn c) = strings $ +    case (gn,c) of+     (ASgUtr,Nom)   -> [den]+     (ASgUtr,Gen)   -> [den++"s", de++"ss"] +     (ASgNeutr,Nom) -> [de++"t"]+     (ASgNeutr,Gen) -> [de++"ss"]+     _               -> []+ where de = tk 1 den++mk_pron_dylik :: String -> PronAdj+mk_pron_dylik = mk_pron_nagon ([e ""], [e "t"], [e "a"])++-- proper names++mk_pm :: String -> (PNForm -> Str)+mk_pm s (PNForm c) = strings $ mk_case_v c [s]++mk_pm_alice :: String -> (PNForm -> Str)+mk_pm_alice s (PNForm Nom) = strings $ [s]+mk_pm_alice s (PNForm Gen) = strings $ [s,s +? "s"]++mk_pma :: String -> (PNAForm -> Str)+mk_pma s (PNAForm c) = strings $ mk_ccase c s++mk_ccase c s = case c of +                Nom -> [s]+                Gen | elem (last s) "sxzSXZ" -> [s]+                _   -> [s ++ "-s",s ++ ":s",s++"s"]++mk_pmm0 :: [String] -> (PNMForm -> Str)+mk_pmm0 xs (PNMForm c) = strings [unwords ((init xs) ++ [r]) | r <- mk_case_v c [last xs]]++mk_pmam0 :: [String] -> (PNMForm -> Str)+mk_pmam0 xs (PNMForm c) =  strings [unwords ((init xs) ++ [g]) | g <- (mk_ccase c (last xs))]++mk_number :: (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> String -> Number+mk_number (en,ett,första,förste,en_c) s (NumC) =+ let xs = apply_suffixes s en_c in +     strings $ xs ++ [x ++ "-" | x <- xs]+mk_number (en,ett,första,förste,en_c) s (NumF c o) = +  strings $ map (mk_case c) $ case o of+   Numeral         -> apply_suffixes s en+   NumeralN        -> apply_suffixes s ett+   Ordinal NoMasc  -> apply_suffixes s första+   Ordinal Masc    -> apply_suffixes s förste++nln1 :: String -> Number+nln1 x1 (NumC) = mkStr [] +nln1 x1 (NumF c o) = +  mkStr $ case (o,c) of+   (Ordinal NoMasc,Nom)  -> x1 ++ ":a" +   (Ordinal NoMasc,Gen)  -> x1 ++ ":as"+   (Ordinal Masc,Nom)    -> x1 ++ ":es" +   (Ordinal Masc,Gen)    -> x1 ++ ":es" +   (_,Nom)               -> x1+   (_,Gen)               -> x1 ++ ":s"++mk_number_ng :: (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> String -> Number+mk_number_ng suffs s = missing (mk_number suffs s) [NumF Gen o | o <- values]++{-+mk_number :: String -> String -> Number+mk_number tre tredje (NumF c o) = +  mkStr $ mk_case c $ case o of+   Ordinal -> tredje+   Numeral -> tre++mk_numeral :: String -> Number+mk_numeral tre = mk_number tre []++inv_numeral :: String -> Number+inv_numeral s = missing (mk_numeral s) [NumF Gen Numeral]++inv_ordinal :: String -> Number+inv_ordinal s = missing (mk_ordinal s) [NumF Gen Ordinal]+  +mk_ordinal :: String -> Number+mk_ordinal tredje = mk_number [] tredje++nrtretton :: String -> Number+nrtretton tretton = mk_number tretton (tretton++"de")++nrtrettio :: String -> Number+nrtrettio trettio = mk_number trettio (trettio++"nde")++nrandra :: String -> Number+nrandra andra = variant (mk_number [] andra)+                 [(NumF Nom Ordinal, andre),  +                 (NumF Gen Ordinal, andre++"s")]+    where andre = tk 1 andra ++ "e"++nrfemte :: String -> Number+nrfemte femte = mk_number [] femte++nriii :: String -> Number+nriii iii (NumF Nom Numeral) = mkStr iii+nriii _   _                  = nonExist+-}++-- auxiliary verbs++aux_verb_gen :: Str -> Str -> Str -> Str -> AuxVerb+aux_verb_gen vilja vill ville velat = +    giveValues [vilja, vill, ville, velat]++aux_verb :: String -> String -> String -> String -> AuxVerb+aux_verb vilja vill ville velat = +    giveValues $ map mkStr [vilja, vill, ville, velat]++
+ src/saldo/PrintSw.hs view
@@ -0,0 +1,115 @@+module PrintSw where++import List(intersperse,nub,inits)+import Util+import Dictionary+import General+import Char+import Data.Bits ((.&.))++print_table = [("multi",multi_printer),("rdf_sb",prRDF_sb),("flat_xml",prFlatXML)]++multi_printer :: Dictionary -> String+multi_printer = concat . nub . map prOne . multi+ where prOne (x,stem,cat,inhs,id,para,attr) = conc [p "word" x, p "head" stem, p "pos" cat, p "param" "frag", pl "inhs" inhs, p "id" id, p "p" para, p "attr" attr]+       pl s []   = quote s ++ ":" ++ "[]"+       pl s xs   = quote s ++ ":[" ++ (concat (intersperse "," (map quote xs))) ++"]"+       p s1 s2 = quote s1 ++ ":" ++ quote s2+       conc xs = '{':(concat (intersperse "," xs)) ++ "}\n"++multi = concat . map prOne . filter is_multi. unDict+ where prOne  (id,stem,para,cat,inhs,tbl,_) = +           [(x,stem, cat, inhs, id, para, (show attr)) |  (a,(attr,s)) <- (merge tbl), str <- unStr s, length (words str) > 1, x <- map unwords $ gen (words str)]+       merge            [] = []+       merge           [x] = [x]+       merge (x@(param1,(a,s)):y@(param2,(a',s1)):xs) = +           case (number param1, number param2) of+             ((v,n1,n2),(v',n1',n2')) | v == v' && n1' > n1 -> merge ((param2,(a',mkStr (unwords (unStr s ++ unStr s1)))):xs)+             _ -> x:merge (y:xs)+       number p = case map (map (read :: String -> Int) . words . map f) (filter (isDigit.head) (words p)) of+                    [[v1,n1,n2]] -> (v1,n1,n2)+       f x+         | elem x "-:" = ' ' +         | otherwise = x+       gen :: [String] -> [[String]]+       gen []     =  []+       gen (x:xs) =  filter (\xs -> not (null xs || one xs)) (inits (x:xs)) ++ gen xs+       one [_] = True+       one _ = False+       is_multi (_,stem,para,cat,_,_,_) = length (words stem) > 1 ++-- | Print RDF+prRDF_sb :: Dictionary -> String+prRDF_sb d =  unlines [+  "<?xml version='1.0' encoding='UTF-8'?>",+  "<rdf:RDF",+  "  xmlns=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"",+  "  xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"",+  "  xmlns:sb=\"http://spraakbanken.gu.se/saldo#\">",+  (concat (map pr (unDict d))),+  "</rdf:RDF>"]+ where+ pr (id,stem,para,cat,inhs,tbl,extr) =  +     concat +         [+          "   <rdf:Description rdf:about=\"http://spraakbanken.gu.se/saldo/lemma/" ++ id ++ "\">\n",+          "    <rdf:type rdf:resource=\"http://spraakbanken.gu.se/ns/saldo/lemma\"/>\n",+          "    <sb:cf>"  ++ amp stem ++ "</sb:cf>\n",+          "    <sb:p>" ++ para ++ "</sb:p>\n",+          "    <sb:pos>"   ++ cat ++ "</sb:pos>\n",+          concat ["    <sb:inhs>"  ++ i ++ "</sb:inhs>\n" | i <- inhs] ++ "   </rdf:Description>\n",+          concat [unlines ["   <rdf:Description rdf:about=\"http://spraakbanken.gu.se/saldo/lemma/" ++ id ++ "#" ++ (urlEncode p) ++ "\">",+                           "    <rdf:type rdf:resource=\"http://spraakbanken.gu.se/ns/saldo/msd\"/>",+          "    <sb:id rdf:resource=\"http://spraakbanken.gu.se/saldo/lemma/" ++ id ++ "\"/>",+          "    <sb:msd>" ++ p ++ "</sb:msd>",+          concat (intersperse "\n" ["    <sb:wf>" ++ (amp w) ++ "</sb:wf>" | w <- unStr ws]),+          "   </rdf:Description>"] | (p,(_,ws)) <- tbl, not (null (unStr ws))]+          ]+++-- | Print RDF+prFlatXML :: Dictionary -> String+prFlatXML d =  unlines [+  "<?xml version='1.0' encoding='UTF-8'?>",+  "<!-- $Id$ -->",+  "<Lexicon>",+  (concat (map pr (unDict d))),+  "</Lexicon>"]+ where+ pr e@(id,stem,para,cat,inhs,tbl,extr) =  +     concat +         [+          "   <LexicalEntry>\n",+          "    <lem>" ++ id ++ "</lem>\n",+          "    <gf>"  ++ amp stem ++ "</gf>\n",+          "    <p>" ++ para ++ "</p>\n",+          "    <pos>"   ++ cat ++ "</pos>\n",+          "    <inhs>" ++ (unwords inhs) ++ "</inhs>\n",+          "    <table>\n",+          concat (intersperse "\n" ["     <form><param>" ++ p ++ "</param><wf>" ++ (amp w) ++ "</wf></form>" | (p,(_,ws)) <- tbl, w <- unStr ws]) ++ "\n",+          concat (intersperse "\n" ["     <form><param>frag</param><wf>" ++ (amp w) ++ "</wf></form>" | (w,_, _, _, _, _, _) <- multi (dictionary [e])]),+          "\n    </table>\n",+          "   </LexicalEntry>\n"+          ]++ -- copied from Module :  HTTP+ -- Copyright :  (c) Warrick Gray 2002+ -- License   :  BSD+amp = concat . map (\c -> if c == '&' then "&amp;" else [c])+urlEncode (h:t) =+     let str = if reserved (ord h) then escape h else [h]+     in str ++ urlEncode t+urlEncode [] = []+reserved x+     | x >= ord 'a' && x <= ord 'z' = False+     | x >= ord 'A' && x <= ord 'Z' = False+     | x >= ord '0' && x <= ord '9' = False+     | x <= 0x20 || x >= 0x7F = True+     | otherwise = x `elem` map ord [';','/','?',':','@','&'+                                    ,'=','+',',','$','{','}'+                                    ,'|','\\','^','[',']','`'+                                    ,'<','>','#','%','"']+escape x = +     let y = ord x +      in [ '%', intToDigit ((y `div` 16) .&. 0xf), intToDigit (y .&. 0xf) ]+
+ src/saldo/RulesSw.hs view
@@ -0,0 +1,11 @@+module RulesSw (+                module NounRulesSw, +                module VerbRulesSw,+                module AdjRulesSw,+                module OtherRulesSw+                ) where++import NounRulesSw+import VerbRulesSw+import AdjRulesSw+import OtherRulesSw
+ src/saldo/TestGenSw.hs view
@@ -0,0 +1,134 @@+module TestGenSw where++import List+import Frontend+import Char+import Maybe++is_a_word  = isJust . tword++not_a_word = not . isJust . tword++p_pos t = takeWhile (/='_') (tpara t)++p_annotation t =  +    case dropWhile (/='_') (tpara t) of+      (_:xs) -> takeWhile (/='_') xs++p_word t = case dropWhile (/='_') (tpara t) of+             (_:xs) -> case dropWhile (/='_') xs of+                         (_:ys) -> map f ys+ where f '_' = ' '+       f x   = x++id_pos   t = f (tid t)+ where f [] = [] -- "invalid id: " ++ (tid t)+       f ('.':'.':'.':xs) = f ('.':'.':xs)+       f ('.':'.':xs)     = takeWhile (/='.') xs+       f (x:xs) = f xs ++id_lemma t = f (tid t)+ where f [] = [] -- error "invalid id: " ++ (tid t)+       f ('.':'.':'.':xs) = '.':f ('.':'.':xs)+       f ('.':'.':xs)     = []+       f (x:xs)           = x : f xs ++norm_id_lemma t = remove_number $ reverse $ i+  where i = id_lemma t+        remove_number (x:xs) +         | isDigit x = case dropWhile isDigit xs of+                         ('_':zs@(_:_)) -> reverse zs+                         _              -> i+         | otherwise = i++head_to_lemma_id = add_underscore . symbols . unspace . thead+ where unspace s = [if (x == ' ') then '_' else x | x <- s]+       symbols = concat . map tr+       add_underscore (x:xs)+        | isDigit x || elem x "-·" = ('_':x:xs)+        | otherwise = (x:xs)+       tr c = maybe [c] id $ lookup c +               [('&',"·26"),(':',"·3A"), ('\'',"·27"), ('/',"·2F"), ('+',"·2B"), +                (',',"·2C"),('°',"·B0"), ('%',"·25"),('=',"·3D"),('?',"·3F")] ++is_multi_word t = length pos > 2 && last pos == 'm' + where pos = tcat t++is_abbr t = last (tcat t) == 'a'++is_vowel c = elem c "aeiouyåäöAEIOUYÅÄÖüÜàÀ"++is_consonant c = elem c "bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ"++traverse :: String -> (String -> Bool) -> Bool+traverse [] f = False+traverse s@(x:xs) f+ | f s       = True+ | otherwise = traverse xs f++member_str :: String -> String -> Bool+member_str pre s = traverse s (isPrefixOf pre)++decl :: TestInput -> Char -> Bool+decl t c+ | elem (tcat t) ["nn","nnm","nna"] =  (head (p_annotation t)) == c + | otherwise                        = False++conj :: TestInput -> Char -> Bool+conj t c+ | elem (tcat t) ["vb","vbm","vba"] =  (head (p_annotation t)) == c + | otherwise                        = False++param :: TestInput -> [String] -> Bool+param t xs = and [elem x (tparam t) | x <- xs]++is_no_plural :: TestInput -> Bool+is_no_plural t + | elem (tcat t) ["nn","nnm","nna"] = case (p_annotation t) of+                                        ('0':_) -> True+                                        _       -> False+ | otherwise      = False++gender :: TestInput -> Char -> Bool+gender t c+ | elem (tcat t) ["nn","nnm","nna"] = case p_annotation t of+                                        (_:x:_) -> c == x+ | otherwise                        = False++is_no_komp :: TestInput -> Bool+is_no_komp t+ | elem (tcat t) ["av","avm","ava"] = case dropWhile (/='_') (tpara t) of+                      (_:'0':'_':_) -> True+                      _             -> False+ | otherwise      = False++is_komp :: TestInput -> Bool+is_komp t+ | elem (tcat t) ["av","avm","ava"] = +     case dropWhile (/='_') (tpara t) of+       (_:x:_) | elem x "12v" -> True+       _                        -> False+ | otherwise      = False++is_no_pret_part :: TestInput -> Bool+is_no_pret_part t + | tcat t == "vb" = case p_annotation t of+                      (_:'m':_) -> True+                      _       -> False+ | otherwise      = False++is_verb_sd :: TestInput -> Bool+is_verb_sd t + | tcat t == "vb" = case p_annotation t of+                      (_:'s':_) -> True+                      (_:'d':_) -> True+                      _       -> False+ | otherwise      = False++is_pret_part :: TestInput -> Bool+is_pret_part t + | tcat t == "vb" = case p_annotation t of+                      (_:'a':_) -> True+                      _         -> False+ | otherwise      = False+
+ src/saldo/TestSw.hs view
@@ -0,0 +1,330 @@+module TestSw (sal_id_exceptions, tests) where++import General+import List+import Frontend+import Char+import Maybe+import TestGenSw+import qualified Data.Set as Set+++sal_id_exceptions :: [(String,String)]+sal_id_exceptions = [("lova_2..vb.1","lova_1..vb.1"),+                     ("kola_2..vb.1","kola_1..vb.1"),+                     ("förslag_2..nn.1","förslag_1..nn.1"),+                     ("förlag_2..nn.1","förlag_1..nn.1"),+                     ("fris_2..nn.1","fris_1..nn.1"),+                     ("bildrulle_2..nn.1","bildrulle_1..nn.1"),+                     ("jaja_2..in.1","jaja_1..in.1"),+                     ("oskyld_2..av.1","oskyld_1..av.1"),+                    ("väl_2..ab.1","väl_1..ab.1"),+                    ("förut_2..ab.1","förut_1..ab.1"),+                     ("förklistra_2..vb.1","förklistra_1..vb.1"),+                     ("förklistring_2..nn.1","förklistring_1..nn.1")+                    ]++tests :: (PositiveTests, NegativeTests)+tests = (pos,neg)+ where + pos = pos_gen_rules ++ pos_noun_rules ++ pos_verb_rules ++ pos_adj_rules+ neg = neg_gen_rules ++ neg_noun_rules ++ neg_verb_rules ++ neg_adj_rules++-- General rules+pos_gen_rules = [pos_id_para, multi_word, head_lemma,paradigm_pos]++neg_gen_rules = [three_of_same, symbols, mmn,mmr,nnt,sms_missing_hyphen,end_with_h]++-- Is POS in lemma id = paradigm id?+pos_id_para :: TestInput -> Result+pos_id_para t + | not ( is_a_word t) = pass+ | p_pos t == id_pos t = pass+ | otherwise           = message t "lemma_id pos - paradigm pos mismatch"+ +-- Have the multi words more than one word?+multi_word :: TestInput -> Result+multi_word t+ | not (is_multi_word t)                             = pass+ | length (words (thead t)) > 1                      = pass+ | otherwise                                         = message t "singleton multi word"++--  Is head == lemma id head?+head_lemma :: TestInput -> Result+head_lemma t + | not ( is_a_word t) = pass+ | elem (tid t) ["SS_433..pmm.1"]                = pass+ | isDigit (last (thead t))                      = pass+ | norm_id_lemma t == head_to_lemma_id t         = pass+ | otherwise                                     = message t "lemma_id_head - head mismatch"++-- paradigm pos == pos?+paradigm_pos :: TestInput -> Result+paradigm_pos t+ | not ( is_a_word t) = pass+ | p_pos t == tcat t = pass+ | otherwise = message t "paradigm_pos - pos mismatch"++-- every word, with some exceptions, should contain a vowel.+contains_vowel :: TestInput -> Result+contains_vowel t+  | is_abbr t || elem (tcat t) ["nl","in"]            = pass+  | Set.member (tid t) exception                      = pass+  | length (thead t) <= 1                             = pass+  | or [is_vowel c | c <- w t] || null (w t)          = pass+  | otherwise                                         = message t "no vowel"+ where exception = Set.fromList ["cp..av.1","_-273_·B0C..nnm.1", "MP3..nn.1","mp3..nn.1", "T9..nn.1","_1984..pm.1", "SS_433..pmm.1","f_n..abm.1","m_m..abm.1", "s_k..avm.1","m._fl...abm.1","f._Kr...abm.1","f._d...avm.1","f_Kr..abm.1"]++-- every word, with some exceptions, should contain a consonant.+contains_consonant :: TestInput -> Result+contains_consonant t+ | not ( is_a_word t) = pass+ | is_abbr t || (tcat t) == "nl"                = pass+ | length (thead t) <= 1                        = pass+ | elem (tid t) ["Io..pm.1","_1984..pm.1"]      = pass+ | or [is_consonant c | c <- w t] || null (w t) = pass+ | otherwise                                    = message t "no consonant"++-- not three of same.+three_of_same :: TestInput -> Result+three_of_same t+ | elem (tid t) ["Gustav_III..pmm.1"] = pass+ | is_abbr t || (tcat t) == "nl" = pass+ | traverse (w t) +    $ \s -> (case s of +              (c:c1:c2:_) | (c == c1) && (c1 == c2) && not (isDigit c) -> True+              _           -> False) = message t "three of same"+ | otherwise = pass++-- no consecutive symbols.+symbols :: TestInput -> Result+symbols t+ | elem (tid t) ["HCO3-..nna.1","OH-..nna.1","e-..nna.1"] = pass+ | traverse (w t) +   $ \s -> (case s of +             (c:c1:_) | c == c1 && elem c "-:\"+." -> True+             _        -> False) = message t "consecutive symbols"+ | otherwise = pass+++-- no mmn substring.+mmn :: TestInput -> Result+mmn t+ | member_str "mmn" (w t) = message t "found 'mmn' substring"+ | otherwise                         = pass++-- no mmr substring.+mmr :: TestInput -> Result+mmr t+ | member_str "mmr" (w t) = message t "found 'mmr' substring"+ | otherwise                         = pass+++nnt :: TestInput -> Result+nnt t+ | isSuffixOf "nnt" (w t) = message t "found 'nnt' suffix"+ | isSuffixOf "nnte" (w t) = message t "found 'nnte' suffix"+ | otherwise                         = pass++-- Noun Rules+pos_noun_rules = [decl1,decl2,decl3,decl4,decl5,decl7,missing_noun_cases,paradigm_gender,plural_def]++neg_noun_rules = [decl0,no_sing, gender_d,medial_compound,gender_u,gender_n]++no_sing :: TestInput -> Result+no_sing t+ | is_a_word t && (tcat t == "nn" || tcat t == "nnm") && (gender t 'p' || gender t 'd') && param t ["sg"] = message t "invalid singular"+ | otherwise = pass+++plural_def :: TestInput -> Result+plural_def t + | gender t 'u' && elem '7' (tpara t) = pass+ | Set.member (tpara t) (Set.fromList ["nn_6n_frx", "nn_vu_scarf", "nn_6u_gås","nn_6u_mus","nn_6u_man","nn_6u_vaktman","nn_vu_trio","nn_vu_yard","nn_6u_tum","nn_6u_iktus","nn_vu_romkom","nn_vu_tortilla",+                                       "nn_vu_promovend", "nn_ou_emeritus", "nn_vu_playboy","nn_vu_partner","nn_vu_blinker","nn_6u_yen",+                                       "nn_ou_penny","nn_vu_bagis","nn_vu_glass","nn_vu_mikron","nn_vu_kart"]) = pass + | is_a_word t && (tcat t == "nn") && param t ["def","pl","nom"] && +   gender t 'u' && not (isSuffixOf "na" (w t)) = message t $ "invalid definite plural"+ | is_a_word t && (tcat t == "nn") && param t ["def","pl","nom"] && +   gender t 'n' && not (isSuffixOf "a" (w t) || isSuffixOf "en" (w t)) = message t $ "invalid definite plural"+ | is_a_word t && param t ["pl"] && (isSuffixOf "aor" (w t) || isSuffixOf "aorna" (w t)) = message t $ "invalid 'a'"+ -- | is_a_word t && param t ["pl"] && (isSuffixOf "ear" (w t) || isSuffixOf "earna" (w t)) = message t $ "invalid 'e'"+ | otherwise = pass++in_declension :: TestInput -> Char -> String -> Result+in_declension t c suff+ | is_a_word t && (tcat t == "nn") && decl t c && param t ["indef","pl","nom"] && not (isSuffixOf suff (w t)) = message t $ "invalid plural in declension " ++ [c]+ | otherwise = pass++not_in_declension :: TestInput -> Char -> [String] -> Result+not_in_declension t c xs+ | is_a_word t && (tcat t == "nn") && decl t c && param t xs = message t $ "invalid \"" ++ unwords xs ++ "\" in declension " ++ [c]+ | otherwise = pass++decl1 t = in_declension t '1' "or"+decl2 t = in_declension t '2' "ar"+decl3 t = in_declension t '3' "er"+decl4 t = in_declension t '4' "r"+decl5 t = in_declension t '5' "n"+decl7 t = in_declension t '7' "s"++decl0 t + | tcat t == "nn" = not_in_declension t '0' ["pl"]+ | otherwise      = pass++gender_d t+ | is_a_word t && gender t 'd' && not (param t ["pl","def"]) = message t  "gender 'd' implies pl def"+ | otherwise                                                 = pass++gender_u t+ | elem (tpara t) ["nn_0u_praxis", "nn_0u_samverkan"] = pass+ | last (tcat t) == 'm' = pass + | is_a_word t && gender t 'u' && (param t ["sg","def","nom"]) && (last (w t) == 't') = message t  " invalid sg def form"+ | otherwise                                                   =   pass+++gender_n t+ | elem (tpara t) ["nn_6n_deponens","nn_6n_aber","nn_3n_dominion","nn_0n_gluten","nn_0u_praxis","nn_0n_bitumen"] = pass+ | last (tcat t) == 'm' = pass + | is_a_word t && gender t 'n' && (param t ["sg","def","nom"]) && (last (w t) == 'n') = message t  " invalid sg def form"+ | otherwise                                                   =   pass+++medial_compound t +  | is_a_word t && param t ["cm"] &&  last (w t) == 's' && bad_medials (w t) = message t  "invalid binding s"+  | otherwise                                        = pass+ where bad_medials = f . reverse . take 2 . reverse . init+       f [_,'x'] = True+       f [_,'z'] = True+       f ['s',x] = is_consonant x+       f ['x',x] = is_consonant x+       f _       = False++sms_missing_hyphen t+ | is_a_word t && param t ["sms"] && not (last (w t) == '-') = message t "missing hyphen in sms"+ | otherwise                                                 = pass+++-- (x:y:_) | ((is_consonant x) && y == 's') || ((is_consonant x) && y == 'x') || [y,x] == "ch" || x=='x' || x =='z' -> []+-- decli t = not_in_declension t 'i' ["gen"]++missing_noun_cases :: TestInput -> Result+missing_noun_cases t+ -- | param t ["ci"] || param t ["cm"] = pass+  | elem (tpara t) ["nna_6n_kg","nn_6u_mat"] = pass +  | not_a_word t && (tcat t == "nn" || tcat t == "nna") &&  +    elem (head (p_annotation t)) "1234567" && (not (gender t 'p' || gender t 'd')) = message t "missing noun case"+  | otherwise                                = pass++paradigm_gender :: TestInput -> Result+paradigm_gender t+ | elem (tcat t) ["nn","nna","nnm"] = if gender t (head (head (tinhs t))) then pass else message t "paradigm gender-gender mismatch"+ | otherwise = pass++--- Verb Rules+pos_verb_rules = [conj1, conj2, conj3, pret_part,konj]+neg_verb_rules = [no_pret_part, deponens,mms,end_with_h,konj_e, konj_2_es,verb_ending]++in_conjugation :: TestInput -> Char -> String -> String -> Result+in_conjugation t c suff suff2+ | is_a_word t && (tcat t == "vb") && conj t c && param t ["pres","ind","aktiv"] && not (isSuffixOf suff (w t))  = message t $ "invalid ending in conjugation " ++ [c]+ | is_a_word t && (tcat t == "vb") && conj t c && param t ["pret","ind","aktiv"] && not (isSuffixOf suff2 (w t)) = message t $ "invalid ending in conjugation " ++ [c]+ | otherwise = pass++conj1 t = in_conjugation t '1' "ar" "ade"+conj2 t + | elem (tid t) ["tåla..vb.1","må..vb.2"] = pass+ | otherwise = in_conjugation t '2' "r"  ""+conj3 t = in_conjugation t '3' "r"  "de"+conj4 t = in_conjugation t '4' "er" ""++konj :: TestInput -> Result+konj t+ | Set.member (tpara t) (Set.fromList ["vb_4m_förevara","vb_4m_angå","vb_4m_le","vb_4m_stå","vb_vm_undvara","vb_vm_samvara",+                                       "vb_va_gälla_kastrera",+                                       "vb_vm_drösa","vb_va_utlöpa","vb_va_träda","vb_va_snusmala","vb_va_nästa","vb_va_mala",+                                       "vb_4a_slå","vb_4a_se","vb_4a_emotstå","vb_4a_bestå","vb_va_förse","vb_vm_avvara", "vb_va_tälja",+                                      "vb_va_två","vb_va_förmäla","vb_va_tala","vb_va_koka","vb_va_klä","vb_va_bringa"]) = pass+ | not_a_word t && tcat t == "vb" && (conj t '4' || conj t 'v') && param t ["konj", "aktiv"] && not (is_verb_sd t) = message t "missing konj"+ | otherwise                            = pass++konj_e :: TestInput -> Result+konj_e t+ | is_a_word t &&  tcat t == "vb" && param t ["konj", "aktiv"]  && (last (w t) /= 'e') = message t "missing 'e' on konj"+ | otherwise                            = pass++end_with_h :: TestInput -> Result+end_with_h t+ | is_a_word t && tcat t == "vb" &&  elem (dp 2 (w t)) ["ch","sh"] = pass+ | is_a_word t && tcat t == "vb" && last (w t) == 'h' = message t "word ending with h"+ | otherwise                        = pass++verb_ending :: TestInput -> Result+verb_ending t+ | tpara t == "vb_0d_lyster" = pass + | is_a_word t && tcat t == "vb" &&  not (is_vowel (last (thead t)) || (last (thead t)) == 's') = message t "verb baseform not ending with vowel or 's'"+ | otherwise                        = pass++konj_2_es :: TestInput -> Result+konj_2_es t+ | is_a_word t && tcat t == "vb" && conj t '2' && (param t ["s-form","pres"]) && +   ((dp 2 (w t)) /= "es") && (dp 1 (tk 1 (thead t)) == "s") = message t "s-form not ending with 'es' in conj. 2"+ | otherwise                        = pass++deponens t + | param t ["pret_part"] || param t ["pres_part"] || param t ["imper"] = pass+ | is_a_word t && tcat t == "vb" = case p_annotation t of+                     (_:'s':_) | not (param t ["s-form"]) -> message t $ "invalid deponent"+                     _ -> pass+ | otherwise = pass++is_deponens t =  case p_annotation t of+                   (_:'s':_) -> True+                   _        -> False++no_pret_part :: TestInput -> Result+no_pret_part t+ | is_a_word t && is_no_pret_part t && param t ["pret_part"]  = message t "invalid participle"+ | otherwise = pass++pret_part :: TestInput -> Result+pret_part t+ | not_a_word t && is_pret_part t && param t ["pret_part"] = message t "missing participle"+ | otherwise = pass++vbm_paradigm :: TestInput -> Result+vbm_paradigm t+ | tcat t == "vbm" = +     case p_annotation t of+       (x:y:a:_) | elem x "01234ov" && elem y "asmd" && elem a "pldztq" -> pass+       _ -> message t "invalid vbm paradigm identifier"+ | otherwise = pass++-- no mms suffix.+mms :: TestInput -> Result+mms t+ | (tcat t == "vb") && isSuffixOf "mms" (w t) = message t "mms suffix"+ | otherwise                                  = pass++-- Adjective Rules+pos_adj_rules = [komp]+neg_adj_rules = [no_komp,no_genitive_avm]++no_komp :: TestInput -> Result+no_komp t+ | is_a_word t && is_no_komp t && not (null [x | x <- (tparam t), elem x ["komp","super"]]) = message t "invalid comparative"+ | otherwise                            = pass++komp :: TestInput -> Result+komp t+ | elem (tpara t) ["avm_1p1_bred","avm_1p1_akut"] && param t ["gen"] = pass+ | not_a_word t && is_komp t && not (null [x | x <- (tparam t), elem x ["komp","super"]]) = message t "missing comparative"+ | otherwise                            = pass++no_genitive_avm :: TestInput -> Result+no_genitive_avm t+ | is_a_word t && tcat t == "avm" = +     case p_annotation t of+       (_:'p':_) | elem "gen" (tparam t) -> message t "invalid genitive"+       _ -> pass+ | otherwise = pass
+ src/saldo/TypesSw.hs view
@@ -0,0 +1,668 @@+module TypesSw where++import General+import Dictionary+import Attr++-- parameter types for Swedish morphology++-- enumerated parameter types++data Genus = Utr | Neutr | GPl | GDPl | Pend | MascGen | FemGen | Human | PNeutr+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Numerus = Sg | Pl+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Species = Indef | Def+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Casus = Nom | Gen+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Sex = NoMasc | Masc+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Modus = Ind | Conj+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Vox = Act | SForm+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Grade = Posit | Compar | Superl+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++data Person = P1 | P2 | P3+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param Genus where +    values = enum+    prValue g  = case g of+                     Utr     -> "u"+                     Neutr   -> "n"+                     GPl     -> "p"+                     GDPl    -> "d"+                     Pend    -> "v"+                     MascGen -> "m"+                     Human   -> "h"+                     FemGen  -> "f"+                     PNeutr  -> "w"++instance Param Numerus where +    values = enum+    prValue Sg = "sg"+    prValue Pl = "pl"+instance Param Species where +    values = enum+    prValue Indef = "indef"+    prValue Def   = "def"+instance Param Casus   where +    values = enum+    prValue Nom = "nom"+    prValue Gen = "gen"+instance Param Sex     where +    values = enum+    prValue NoMasc = "no_masc"+    prValue Masc   = "masc"+instance Param Modus   where +    values = enum+    prValue Ind = "ind"+    prValue Conj = "konj"+instance Param Vox     where +    values = enum+    prValue Act   = "aktiv"+    prValue SForm = "s-form"+instance Param Grade   where +    values = enum+    prValue Posit = "pos"+    prValue Compar = "komp"+    prValue Superl = "super"+instance Param Person  where +    values = enum+    prValue P1 = "p1"+    prValue P2 = "p2"+    prValue P3 = "p3"+--- would we need something more in Haskell?++-- real parameter types: mostly hierarchical++-- substantives (= common nouns)++type Substantive = SubstForm -> Str++data SubstForm = SF Numerus Species Casus | +                 InitComposite |+                 MedComposite  |+                 SMS           | +		 Deriv+                 deriving (Eq, Ord, Show, Read)++instance Param SubstForm +  where values = [SF a b c | a <- values, b <- values, c <- values]+                   ++ [InitComposite,MedComposite,SMS] -- Deriv removed+	prValue (SF a b c) = unwords [prValue a, prValue b, prValue c]+        prValue InitComposite = "ci"+        prValue MedComposite  = "cm"+        prValue SMS           = "sms"+	prValue Deriv         = "deriv"++--data SubstFormA = SFA Casus+--  deriving (Eq, Ord, Show, Read)++--instance Param SubstFormA where+-- values = [SFA c | c <- values]+-- prValue (SFA c) = prValue c++data SubstM = SFM SubstForm+  deriving (Eq, Ord, Show, Read)++instance Param SubstM where+ values = [SFM t | t <- values]+ prValue (SFM t) = prValue t+++-- Compound forms++data Compound = CMP | CSMS + deriving (Eq,Ord,Show,Read)++instance Param Compound where+ values = [CMP,CSMS]+ prValue CMP  = "c"+ prValue CSMS = "sms"++-- adjectives++type Adjective = AdjForm -> Str++data GenNum = ASgUtr   |+              ASgNeutr |+              APl+  deriving (Eq, Ord, Show, Read,Enum,Bounded)++data SexNum = AxSg Sex | AxPl+  deriving (Eq, Ord, Show, Read)++data AdjFormPos =+    Strong GenNum+  | Weak   SexNum+  deriving (Eq, Ord, Show, Read)++data AdjFormSuper = SupStrong | SupWeak Sex+  deriving (Eq, Ord, Show, Read)++data AdjFormGrad =+    Pos    AdjFormPos+  | Comp  +  | Super  AdjFormSuper+  deriving (Eq, Ord, Show, Read)++data AdjForm = AF AdjFormGrad Casus | AdjComp | AdjSMS+  deriving (Eq, Ord, Show, Read)++data AdjM = AdjM AdjForm+  deriving (Eq, Ord, Show, Read)++instance Param AdjM where+ values = [AdjM t | t <- values]+ prValue (AdjM t) = prValue t++data AdjMInv = AdjMInv+  deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AdjMInv where+    values              = enum+    prValue (AdjMInv) = "invar"++instance Param GenNum where+  values = enum+  prValue (ASgUtr)   = "sg" ++ " " ++ prValue Utr+  prValue (ASgNeutr) = "sg" ++ " " ++ prValue Neutr+  prValue APl        = "pl"++instance Param SexNum where+  values = map AxSg values ++ [AxPl] -- needed for pronouns+  prValue (AxSg sex) = "sg" ++ " " ++ prValue sex+  prValue (AxPl)      = "pl"++instance Param AdjFormPos where +  values = map Strong values ++ map Weak values+  prValue (Strong gn) = "indef " ++ prValue gn+  prValue (Weak   sn) = "def " ++ prValue sn++instance Param AdjFormSuper where +    values = SupStrong : [SupWeak s | s <- values]+    prValue (SupStrong) = "indef"+    prValue (SupWeak s) = unwords ["def", prValue s]++instance Param AdjFormGrad where +  values = map Pos values ++ [Comp] ++ map Super values+  prValue (Pos adj) = "pos " ++ prValue adj+  prValue (Comp)    = "komp"+  prValue (Super adj) = "super " ++ prValue adj++instance Param AdjForm where +  values = [AF a c | a <- values, c <- values] ++ [AdjComp,AdjSMS]+  prValue (AF a c) = unwords [prValue a, prValue c]+  prValue (AdjComp) = "c"+  prValue (AdjSMS)  = "sms"++-- verbs++type Verb = VerbForm -> Str++data VFin = +   Pres Modus Vox+ | Pret Modus Vox+ | Imper          --- no passive+  deriving (Eq, Ord, Show, Read)++data VInf =+   Inf Vox+ | Sup Vox+ | PtPres Casus+ | PtPret AdjFormPos Casus+  deriving (Eq, Ord, Show, Read)++data VerbForm = +   VF VFin+ | VI VInf+ | VComp+ | VSMS+  deriving (Eq, Ord, Show, Read)++instance Param VFin where+  values = map (uncurry Pres) mvs ++ map (uncurry Pret) mvs ++ [Imper] where+    mvs = [(m,v) | m <- values, v<- values]+  prValue (Pres m v) = unwords ["pres",prValue m, prValue v]+  prValue (Pret m v) = unwords ["pret",prValue m, prValue v]+  prValue (Imper) = "imper"++instance Param VInf where+  values = map Inf values ++ map Sup values ++ map PtPres values ++ +           [PtPret a c | a <- values, c <- values]+  prValue (Inf v) = unwords ["inf", prValue v]+  prValue (Sup v) = unwords ["sup", prValue v]+  prValue (PtPres c)     = unwords ["pres_part",prValue c]+  prValue (PtPret adj c) = unwords ["pret_part",prValue adj, prValue c]++instance Param VerbForm where+  values = map VF values ++ map VI values ++ [VComp,VSMS]+  value0 = VI (Inf Act) -- to show the infinitive as dictionary form+  prValue (VF f) = prValue f+  prValue (VI f) = prValue f+  prValue (VComp) = "c"+  prValue (VSMS)  = "sms"++data VerbFormM = VM VerbForm+  deriving (Eq, Ord, Show, Read)++instance Param VerbFormM where+  values = map VM values +  value0 = VM value0 +  prValue (VM vf) = prValue vf++type VerbM = VerbFormM -> Str++comp_forms :: [VerbForm]+comp_forms = [VComp,VSMS]++passive_forms :: [VerbForm]+passive_forms = +  map VF (concat [[Pres m SForm, Pret m SForm] | m <- values]) ++ +  map VI [Inf SForm, Sup SForm] -- ++ part_pret_forms ++ conj_forms++active_forms :: [VerbForm]+active_forms =+  map VF (concat [[Pres m Act, Pret m Act] | m <- values]) ++ +  map VI [Inf Act, Sup Act] ++ part_pret_forms ++ conj_forms++part_pret_forms :: [VerbForm]+part_pret_forms = [VI (PtPret a c) | a <- values, c <- values]++part_pres_forms :: [VerbForm]+part_pres_forms = [VI (PtPres c) | c <- values] ++part_forms :: [VerbForm]+part_forms = part_pres_forms ++ part_pret_forms ++conj_forms :: [VerbForm]+conj_forms = [VF (Pres Conj v) | v <- values] +++            [VF (Pret Conj v) | v <- values]++positive_forms :: [AdjForm]+positive_forms = [AF (Pos a) c | a <- values, c <- values]++-- adverbs++type Adverb = AdverbForm -> Str++data AdverbForm = AdverbForm Grade | AdComp | AdSMS+  deriving (Eq, Ord, Show, Read)++instance Param AdverbForm where +			  values = [AdverbForm g | g <- values] ++ [AdComp,AdSMS]+			  prValue (AdverbForm g) = prValue g+                          prValue (AdComp)       = "c"+                          prValue (AdSMS)        = "sms"++-- invariant adverbs++type AdverbInv = AdverbInvForm -> Str++data AdverbInvForm = AdverbInvForm | AdCompI | AdSMSI+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AdverbInvForm where +			     values = enum+			     prValue AdverbInvForm = "invar"+                             prValue AdCompI = "c"+                             prValue AdSMSI = "sms"++type AdverbMInv = AdverbMInvForm -> Str++data AdverbMInvForm = AdverbMInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AdverbMInvForm where +			     values = enum+			     prValue _ = "invar"+++-- invariant adjectives++type AdjInv = AdjInvForm -> Str++data AdjInvForm = AdjInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AdjInvForm where +			     values = enum+			     prValue _ = "invar"++data AdjCompInvForm = AdjCompInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AdjCompInvForm where +			     values = enum+			     prValue _ = "komp"++-- invariant interrogative adverbs++type InterrogInv = InterrogInvForm -> Str++data InterrogInvForm = InterrogInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param InterrogInvForm where +			     values = enum+			     prValue _ = "invar"+++-------------------------------+-- closed classes -------------+-------------------------------++-- pronouns++type PronPN  = PronCasus   -> Str+type PronAdj = AdjPronForm -> Str++data PronCasus = PNom | PAcc | PGen GenNum+  deriving (Eq, Ord, Show, Read)++instance Param PronCasus where+  values = PNom : PAcc : map PGen values+  prValue (PNom) = "nom"+  prValue (PAcc) = "ack"+  prValue (PGen gn) = unwords ["poss", prValue gn]+++++data AdjPronForm = AP GenNum Casus+  deriving (Eq, Ord, Show, Read)++instance Param AdjPronForm where+  values = [AP g c | g <- values, c <- values]+  prValue (AP gn c) = unwords [prValue gn, prValue c]++type PronInv = PronInvForm -> Str++data PronInvForm = PronInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param PronInvForm where +			     values = enum+			     prValue _ = "invar"++data PronMInvForm = PronMInvForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param PronMInvForm where +			     values = enum+			     prValue _ = "invar"++data PronMCForm = PronMCForm Casus+ deriving (Eq, Ord, Show, Read)++instance Param PronMCForm where +    values = [PronMCForm c | c <- values]+    prValue (PronMCForm c) = prValue c++type Number = NumForm -> Str++data NumOrd = Ordinal Sex | Numeral | NumeralN+  deriving (Eq, Ord, Show, Read)++instance Param NumOrd where+    values = (Numeral:NumeralN:[Ordinal s | s <- values])+    prValue (Ordinal m) = unwords ["ord", prValue m]+    prValue Numeral     = unwords ["num", prValue Utr]+    prValue NumeralN    = unwords ["num", prValue Neutr]++data NumForm = NumF Casus NumOrd | NumC+ deriving (Eq, Ord, Show, Read)++instance Param NumForm where +  values = [NumF c o | c <- values, o <- values] ++ [NumC]+  prValue (NumF c o) = unwords [prValue c, prValue o]+  prValue (NumC) = "c"++-- invariant+data InterjForm = InterjForm +  deriving (Eq, Ord, Show, Read, Enum, Bounded)++type Interjection = InterjForm -> Str++instance Param InterjForm where +  values = enum+  prValue _ = "invar"++-- articles++type Article = ArticleForm -> Str++data ArticleForm = ArticleForm GenNum Species+ deriving(Eq,Ord,Show,Read)++instance Param ArticleForm where +   values = [ArticleForm g s | g <- values, s <- values]+   prValue (ArticleForm g s) = unwords [prValue g, prValue s]++-- auxiliary verbs++data AuxVerbForm = AuxInf | AuxPres | AuxPret | AuxSup +  deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param AuxVerbForm where +    values = enum+    prValue (AuxInf)  = "inf"+    prValue (AuxPres) = "pres"+    prValue (AuxPret) = "pret"+    prValue (AuxSup)  = "sup"++type AuxVerb = AuxVerbForm -> Str++-- Prepositions++type Preposition = PrepForm -> Str++data PrepForm = PrepForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param PrepForm where +			values = enum+			prValue _ = "invar"++-- Conjunction++type Conjunction = ConjForm -> Str++data ConjForm = ConjForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param ConjForm where +			values = enum+			prValue _ = "invar"++-- Subjunction++type Subjunction = SubForm -> Str++data SubForm = SubForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param SubForm where +		       values = enum+		       prValue _ = "invar"++-- Particles++type Particle = PartForm -> Str++data PartForm = PartForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param PartForm where +			values = enum+			prValue _ = "invar"+		   +-- Infinitive mark+type InfMark = InfMarkForm -> Str++data InfMarkForm = InfMarkForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param InfMarkForm where +    values = enum+    prValue _ = "invar"++-- Proper Noun+type PN = PNForm -> Str++data PNForm = PNForm Casus+ deriving (Eq, Ord, Show, Read)++instance Param PNForm where +		      values = [PNForm c | c <- values]+		      prValue (PNForm c) = prValue c++data PNAForm = PNAForm Casus+ deriving (Eq, Ord, Show, Read)++instance Param PNAForm where +		      values = [PNAForm c | c <- values]+		      prValue (PNAForm c) = prValue c++data PNMForm = PNMForm Casus+ deriving (Eq, Ord, Show, Read)++instance Param PNMForm where +		      values = [PNMForm c | c <- values]+		      prValue (PNMForm c) = prValue c++-- Abbreviations+data ABAForm = ABAForm+ deriving (Eq, Ord, Show, Read, Enum, Bounded)++instance Param ABAForm where +    values = enum+    prValue _ = "invar"++-- Dictionary instances+-- Part of Speech Declarations.+-- (Dict instances)+instance Dict SubstForm       where + category     _  = "nn"+ defaultAttr _ = h_attr+ attrException _ = [(InitComposite,init_attr),+                    (MedComposite,medial_attr),+                    (Deriv,d_attr)]++instance Dict Compound where + category     _  = "sxc"+ defaultAttr _ = c_attr+ attrException _ = [(CSMS,h_attr)]++instance Dict SubstM  where + category     _  = "nnm"+ defaultAttr _ = w_attr+ --attrException _ = [(SFM Composite,1), (SFM Deriv,2)]++-- instance Dict SubstFormA      where category _ = "nna"+instance Dict AdjForm         +    where category _ = "av"+          defaultAttr _ = w_attr+          attrException _ = [(AdjComp,c_attr),(AdjSMS,h_attr)]+instance Dict AdjM            +    where category _ = "avm"+          defaultAttr _ = w_attr+instance Dict AdjMInv         +    where category _ = "avm"+          defaultAttr _ = w_attr+instance Dict VerbForm        where +    category _ = "vb"+    dictword f = case unStr (f (VI (Inf Act))) of+                   (x:_) -> x+                   _     -> getDictWord f+    defaultAttr _ = h_attr+    attrException _ = [(VComp, c_attr),(VSMS,w_attr)]++instance Dict VerbFormM  +    where category _ = "vbm"+          defaultAttr _ = w_attr+instance Dict AdverbForm      +    where category _ = "ab"+          defaultAttr _ = h_attr+          attrException _ = [(AdComp,c_attr),(AdSMS,w_attr)]+instance Dict AdverbInvForm   +    where category _ = "ab"+          defaultAttr _ = h_attr+          attrException _ = [(AdCompI,c_attr),(AdSMSI,w_attr)]+instance Dict AdjInvForm      +    where category _ = "av"+          defaultAttr _ = h_attr+instance Dict AdjCompInvForm  +    where category _ = "av"+          defaultAttr _ = h_attr+instance Dict PronCasus       +    where category _  = "pn"+          defaultAttr _ = w_attr+instance Dict InterjForm      +    where category _  = "in"+          defaultAttr _ = w_attr+instance Dict ArticleForm     +    where category _  = "al"+          defaultAttr _ = w_attr+instance Dict AuxVerbForm     +    where category _  = "vb"+          defaultAttr _ = w_attr+instance Dict PrepForm        +    where category _  = "pr"+          defaultAttr _ = w_attr+instance Dict ConjForm        +    where category _  = "kn"+          defaultAttr _ = w_attr+instance Dict SubForm         +    where category _  = "sn"+          defaultAttr _ = w_attr+instance Dict PartForm        +    where category _  = "pp"+          defaultAttr _ = w_attr+instance Dict InfMarkForm     +    where category _  = "ie"+          defaultAttr _ = w_attr+instance Dict ABAForm         +    where category _  = "aba"+          defaultAttr _ = w_attr+instance Dict AdverbMInvForm  +    where category _  = "abm"+          defaultAttr _ = w_attr+instance Dict PNForm +    where category _  = "pm"+          defaultAttr _ = w_attr+instance Dict PNAForm         +    where category _  = "pma"+          defaultAttr _ = w_attr+instance Dict PNMForm         +    where category _  = "pmm"+          defaultAttr _ = w_attr+instance Dict PronMInvForm     +    where category _ = "pnm"+          defaultAttr _ = w_attr+instance Dict PronMCForm     +    where category _ = "pnm"+          defaultAttr _ = w_attr+instance Dict AdjPronForm     +    where category _  = "pn"+          defaultAttr _ = w_attr+instance Dict PronInvForm     +    where category _  = "pn"+          defaultAttr _ = w_attr+instance Dict NumForm         + where category _  = "nl"+       defaultAttr _ = w_attr+instance Dict InterrogInvForm +    where category _  = "pn" +          defaultAttr _ = w_attr
+ src/saldo/VerbBuildSw.hs view
@@ -0,0 +1,238 @@+module VerbBuildSw where++import General+import Dictionary+import TypesSw+import RulesSw+import GenRulesSw++verb :: Verb -> Entry+verb = entry ++verbM :: VerbM -> Entry+verbM = entry++verb_full :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_full n (finna, finne,finner, finn, fann, funne, funnit, funnen) w = + verb $ verb_prefixed n finna finner finne finn fann funne funnit funnen w ++verb_full_compound :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_full_compound n (finna, finne,finner, finn, fann, funne, funnit, funnen,finn_c) w = + verb $ verb_prefixed_compound n finna finner finne finn fann funne funnit funnen finn_c w ++verb_full_compound_sform_variant :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_full_compound_sform_variant n (finna, finne,finner, finn, fann, funne, funnit, funnen,finn_c) w = + verb $ ppvar n (verb_prefixed_compound n finna finner finne finn fann funne funnit funnen finn_c w) w ++verb_full_sform_variant :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_full_sform_variant n (finna, finne,finner, finn, fann, funne, funnit, funnen) w = + verb $ ppvar n (verb_prefixed n finna finner finne finn fann funne funnit funnen w) w++verb_full_no_sform :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_full_no_sform n (finna, finne,finner, finn, fann, funne, funnit, funnen) w = + verb $ no_passive $ verb_prefixed n finna finner finne finn fann funne funnit funnen w ++verb_weak :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_weak n (finna, finner, finn, fann, funnit, funnen) w = + verb $ verb_prefixed n finna finner [] finn fann [] funnit funnen w ++verb_weak_no_passive :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_weak_no_passive n (finna, finner, finn, fann, funnit, funnen) w = + verb $ no_vcomp $ no_part_pres $ no_passive $ verb_prefixed n finna finner [] finn fann [] funnit funnen w ++verb_weak_compound :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_weak_compound n (finna, finner, finn, fann, funnit, funnen,finn_c) w = + verb $ verb_prefixed_compound n finna finner [] finn fann [] funnit funnen finn_c w ++verb_weak_compound_sform_variant :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_weak_compound_sform_variant n (finna, finner, finn, fann, funnit, funnen,finn_c) w = + verb $ ppvar n (verb_prefixed_compound n finna finner [] finn fann [] funnit funnen finn_c w) w +++vbm_inf w = set_pos "vbm" $ verb $ only (vb1 w) [VI (Inf Act)]++verb_vbm n wfs w = (set_pos "vbm" . verb_weak_no_passive n wfs) w++verb_weak_no_sform :: Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_weak_no_sform n (finna, finner, finn, fann, funnit, funnen) w = + verb $ no_passive $ verb_prefixed n finna finner [] finn fann [] funnit funnen w ++verb_weak_sform_variant ::  Int -> (Suffixes,Suffixes,Suffixes,Suffixes,Suffixes,Suffixes) -> (String -> Entry)+verb_weak_sform_variant n (finna, finner, finn, fann, funnit, funnen) w = + verb $ ppvar n (verb_prefixed n finna finner [] finn fann [] funnit funnen w) w++--verb_wc :: Int -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> (String -> Entry)+--verb_wc n finna finner finn fann funnit funnen w = +-- verb $ verb_prefixed n (map e finna) (map e finner) []+--                        (map e finn) (map e fann)  []+--                        (map e funnit) (map e funnen) w++vbm_part :: Int -> (Suffixes,Suffixes) -> (String -> Entry)+vbm_part n (avbländande,avbländad) w =+   verb $ vbmpart n avbländande avbländad w++verb_dwc :: Int -> [String] -> [String] -> [String] -> [String] -> [String] -> (String -> Entry)+verb_dwc n finna finn fann funnit funnen w = + verb $ no_part_pres $ no_active $ verb_prefixed n (map e finna) [] [] +                                    (map e finn) (map e fann) [] +                                    (map e funnit) (map e funnen) w ++verb_deponens :: Int -> (Suffixes, Suffixes, Suffixes, Suffixes, Suffixes) -> (String -> Entry)+verb_deponens n (finna,finn,fann,funnit,funnen) w = + verb $ no_part_pres $ no_active $ verb_prefixed n finna [] [] finn fann [] funnit funnen w ++-- verbs :: [String] -> Verb -> [Entry]+-- verbs prefs v = map verb [\f -> strings (map (p ++) (unStr (v f))) | p <- prefs] +-- Conjugation 1++v1 :: String -> Entry+v1 = verb . no_konj . vb1++-- Conjugation 2++v2 :: String -> Entry+v2 = verb . no_konj .vb2++vb_2a_följa :: String -> Entry+vb_2a_följa  = verb . no_konj .vb2följa++vb_2a_sända :: String -> Entry+vb_2a_sända  = verb . no_konj .vb2sända++vb_2a_knäcka :: String -> Entry+vb_2a_knäcka = verb . no_konj .vb2knäcka++vb_2a_vända :: String -> Entry+vb_2a_vända  = verb . no_konj .vb2vända++vb_2a_dröja :: String -> Entry+vb_2a_dröja  = verb . no_konj .vb2dröja++vb_2a_göra :: String -> Entry+vb_2a_göra   = verb  . no_konj .vb2göra++-- Conjugation 3++v3 :: String -> Entry+v3 = verb . no_konj . vb3++vb_3a_klä :: String -> Entry+vb_3a_klä  = verb . no_konj . vb3klä++-- Conjugation 4++vb_4a_se :: String -> Entry+vb_4a_se    = verb  . vb4se++vb_4a_gå :: String -> Entry+vb_4a_gå    = verb  . vb4gå++vb_4a_bita :: String -> Entry+vb_4a_bita  = verb  . vb4bita++vb_4m_vina :: String -> Entry+vb_4m_vina  = verb  . vb4vina++vb_4a_krypa :: String -> Entry+vb_4a_krypa = verb  . vb4krypa++vb_4a_vinna :: String -> Entry+vb_4a_vinna = verb  . vb4vinna++vb_4a_giva :: String -> Entry+vb_4a_giva  = verb  . vb4giva++vb_4a_binda :: String -> Entry+vb_4a_binda = verb  . vb4binda++vb_4a_bliva :: String -> Entry+vb_4a_bliva = verb  . no_passive . vb4bliva++vb_4a_draga :: String -> Entry+vb_4a_draga = verb  . vb4draga++vb_4a_göra :: String -> Entry+vb_4a_göra  = verb  . vb4göra++vb_4m_stå :: String -> Entry+vb_4m_stå   = verb  . vb4stå++vb_4a_slå :: String -> Entry+vb_4a_slå   = verb  . vb4slå++vb_4a_ta :: String -> Entry+vb_4a_ta    = verb  . vb4taga++vb_4a_få :: String -> Entry+vb_4a_få    = verb  . vb4få++vb_4a_ha :: String -> Entry+vb_4a_ha    = verb  . vb4hava++vb_4a_vara :: String -> Entry+vb_4a_vara  = verb  . vb4vara++vb_4a_fara :: String -> Entry+vb_4a_fara  = verb  . vb4fara++vb_4a_komma :: String -> Entry+vb_4a_komma = verb  . vb4komma++vb_4a_äta :: String -> Entry+vb_4a_äta   = verb  . vb4äta++vb_4a_låta :: String -> Entry+vb_4a_låta  = verb  . vb4låta++vb_4a_falla :: String -> Entry+vb_4a_falla = verb  . vb4falla++vb_4a_supa :: String -> Entry+vb_4a_supa  = verb  . vb4supa++vb_4a_hålla :: String -> Entry+vb_4a_hålla = verb  . vb4hålla++-- deponent verbs++vb_1s_hoppas :: String -> Entry+vb_1s_hoppas   = verb . no_konj . vbdhoppas++vb_1s_lyckas :: String -> Entry+vb_1s_lyckas   = verb . no_konj . vbdlyckas++vb_1s_nalkas :: String -> Entry+vb_1s_nalkas   = verb . no_konj . vbdnalkas++vb_1s_färdas :: String -> Entry+vb_1s_färdas   = verb . no_konj . vbdfärdas++vb_2s_synas :: String -> Entry+vb_2s_synas    = verb . no_konj . vbdsynas++vb_4d_vederfås :: String -> Entry+vb_4d_vederfås = verb . no_konj . vbdvederfås++-- pending verbs++vb_va_koka :: String -> Entry+vb_va_koka   = verb . no_konj . vbvkoka ++vb_va_mista :: String -> Entry+vb_va_mista  = verb . no_konj . vbvmista+++-- vb_va_sprida = verb . no_konj . vbvsprida++vb_va_bringa :: String -> Entry+vb_va_bringa = verb . no_konj . vbvbringa++vb_va_tala :: String -> Entry+vb_va_tala   = verb . no_konj . vbvtala++-- verb phrases+--vbm1_p  v pr   = verbM $ \(VM p) -> mapStr (\s -> unwords [s,pr] ) ((vb1 v) p) +--vbm1_pr v pr r = verbM $ \(VM p) -> mapStr (\s -> unwords [s,pr,r] ) ((vb1 v) p)++vbm_dö_ut :: String -> Entry+vbm_dö_ut = verb . vbmdöut
+ src/saldo/VerbRulesSw.hs view
@@ -0,0 +1,386 @@+----------------------------------------------------------------------+-- |+-- Module      : VerbRulesSw+-- Maintainer  : Markus Forsberg+-- Stability   : (stability)+-- Portability : (portability)+--+--+-- Swedish verb functions+-------------------------------------------------------------------------++module VerbRulesSw where++import GenRulesSw+import NounRulesSw(mk_case)+import AdjRulesSw(mk_adj_pos)+import General+import TypesSw++infer_pret_part :: String -> AdjFormPos -> [String]+infer_pret_part bunden' = mk_adj_pos [bunden] [bundet] [bundna] [bundna] where+  (bundet,bundna) = case reverse bunden of+    'd':'a':_ -> (bunde ++ "t",  bunden ++ "e")+    'n':'e':_ -> (bund  ++ "et", verb_ungeminate_m_n bund ++ "na") -- fun-na, kom-na+    'd':'d':_ -> (bund  ++ "tt", bunden ++ "a") +    't':'t':_ -> (bunden,        bunden ++ "a")+    'd':_     -> (bunde ++ "t",  bunden ++ "a")+    _         -> (bunden,        bunden ++ "a")+  bunden = verb_ungeminate bunden'+  bunde = verb_ungeminate $ tk 1 bunden+  bund  = verb_ungeminate $ tk 2 bunden+  +ppvar :: Int -> Verb -> String -> Verb+ppvar n v s = variants_or_excepts v [(VF (Pres Ind SForm), strings xs)]+ where ws = unStr (v (VF Imper))+       variants_or_excepts = if all (=="s") (map (dp 1) ws) then excepts else variants+       xs  = [w ++ "es" | w <- ws, not (vow w || single_m w)]+       single_m x = case reverse x of+                      ('m':m:_) -> m /= 'm'+                      _         -> False+       vow [] = False+       vow w@(_:_) = is_vowel (last w) +++-- if (is_vowel (last (tk n s))) then [] else [e "es"]++mk_verb :: String -> String -> String -> String -> String -> String -> String -> String -> Verb+mk_verb finna finner finne finn fann funne funnit funnen = +    mk_verb_v (lift finna) (lift finner) (lift finne) (lift finn) (lift fann) (lift funne) +              (lift funnit) (lift funnen)++mk_verb_v :: [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> Verb+mk_verb_v finna finner finne finn fann funne funnit funnen = mk_verb_vc finna finner finne finn fann funne funnit funnen (map mk_verb_compound finna)++mk_verb_vc :: [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> Verb+mk_verb_vc finna finner finne finn fann funne funnit funnen finn_c = strings . mk_v where +  mk_v v = case v of+    VF (Pres Ind  Act)   -> finner+    VF (Pres Ind SForm)  -> map (mk_vox SForm) finn -- [s +? "s" | s@(_:_) <- map (remove_j . verb_ungeminate) finn]+    VF (Pres Conj v)     -> map (mk_vox v.verb_ungeminate) finne+    VF (Pret Ind  Act)   -> map verb_ungeminate fann+    VF (Pret Conj Act)   -> map verb_ungeminate funne+    VF (Pret m SForm)    -> map (mk_vox SForm) $ mk_v (VF (Pret m Act)) -- +? "s" --- frös - frös ?+    VF Imper             -> map verb_ungeminate finn+    VI (Inf v)           -> map (mk_vox v.verb_ungeminate) finna+    VI (Sup v)           -> map (mk_vox v.verb_ungeminate) funnit+    VI (PtPres c)        -> map (mk_case c) $+                             map (\s -> ifEndThen (=='a') s (s++"nde") (s++"ende")) finna+    VI (PtPret a c)      -> map (mk_case c) $ concat $ map (\s -> infer_pret_part s a) funnen+    VComp                -> [verb_ungeminate w  | w <- finn_c] ++ [(verb_ungeminate x) ++"-" | x@(_:_) <- finn_c]+    VSMS                 -> [(verb_ungeminate x)++"-" | x@(_:_) <- finn_c]++verb_prefixed :: Int -> Suffixes -> Suffixes -> Suffixes -> Suffixes -> +                        Suffixes -> Suffixes -> Suffixes -> Suffixes -> +                        String -> Verb+verb_prefixed n finna finner finne finn fann funne funnit funnen s = +  (mk_verb_v (suff finna) (suff finner) (suff finne) (suff finn) +             (suff fann)  (suff funne)  (suff funnit) (suff funnen))+  where suff = apply_suffixes (tk n s) -- map ((tk n s) ++)+++verb_prefixed_compound :: Int -> Suffixes -> Suffixes -> Suffixes -> Suffixes -> +                        Suffixes -> Suffixes -> Suffixes -> Suffixes -> Suffixes -> +                        String -> Verb+verb_prefixed_compound n finna finner finne finn fann funne funnit funnen finn_c s = +  (mk_verb_vc (suff finna) (suff finner) (suff finne) (suff finn) +             (suff fann)  (suff funne)  (suff funnit) (suff funnen) (suff finn_c))+  where suff = apply_suffixes (tk n s) -- map ((tk n s) ++)++vbmpart :: Int -> Suffixes -> Suffixes -> String -> Verb+vbmpart n avbländande avbländad blända_av v =+    case v of+    VI (PtPres c)   -> f c $  apply_suffixes (tk n avblända) avbländande+    VI (PtPret a c) -> f c $ concat $ map (\s -> infer_pret_part s a) $ apply_suffixes (tk n avblända) avbländad+    _                   -> nonExist+ where [blända,av] = words blända_av+       avblända    = triplecons av (head blända) ++ blända+       f c = strings . map (mk_case c)++mk_vox :: Vox -> String -> String+mk_vox v s = case v of+               Act   -> s+               SForm -> +                case ((remove_j . verb_ungeminate_m_n) s) of +                  x | not_s x -> x ++ "s"+                  x           -> x +  where not_s [] = False+        not_s s = last s /= 's'++mk_verb_compound :: String -> String+mk_verb_compound w = case reverse w of+        ('a':lr:c:pre) | elem lr "lr" && c == 'm'       -> (reverse pre) ++ "mm" ++ "e" ++ [lr]+        ('a':lr:c:pre) | elem lr "lr" && is_consonant c && (lr /= c) -> (reverse pre) ++ (c:"e") ++ [lr]+        ('a':'m':'m':v:pre) | is_vowel v  -> (reverse pre) ++ (v:"m")+        ('a':'n':'n':v:pre) | is_vowel v  -> (reverse pre) ++ (v:"n")+        ('a':pre) | any is_vowel pre      -> (reverse pre)+        ('s':pre)                         -> []+        _                                 -> w++remove_j :: String -> String+remove_j s+ | is_j s = case tk 1 s of+              x | is_d x -> x+              _ -> s+ | otherwise       = s + where is_j [] = False+       is_j s = last s == 'j'+       is_d [] = False+       is_d s = last s == 'd'++pres_ind_passive :: String -> String -> [(VerbForm, Str)]+pres_ind_passive leka lek = [(VF (Pres Ind SForm), strings (leks ++ lekes))] where+    lekes = [tk 1 leka ++ "es"] -- for glömmes (*glömes)+    leks  = if (dp 1 lek == "s") then [] else [((remove_j . verb_ungeminate) lek) ++ "s"] ++pres_verb_er :: String -> String+pres_verb_er fara+  | a /= "a"                          = fara++"r"+  | a == "a" && elem (dp 1 far) ["r"] = far -- "l" removed, counter example: falla+  | otherwise                         = far ++ "er"+ where a   = dp 1 fara+       far = tk 1 fara++no_active :: Verb -> Verb+no_active v = v `missing` active_forms++no_passive :: Verb -> Verb+no_passive v = v `missing` passive_forms++no_part_pres :: Verb -> Verb+no_part_pres v = missing v part_pres_forms++no_part_pret :: Verb -> Verb+no_part_pret v = v `missing` part_pret_forms++no_konj :: Verb -> Verb+no_konj v = v `missing` conj_forms++no_vcomp :: Verb -> Verb+no_vcomp v = v `missing` comp_forms+++verb_irreg :: String -> String -> String -> String -> String -> Verb+verb_irreg finna finner fann funnit funnen = +    mk_verb finna finner finne finn fann (funn ++ "e") funnit funnen+      `excepts` if_a (pres_ind_passive finna finn) []+ where+   if_a a b = if dp 1 finna == "a" then a else b+   finn   = if_a (tk 1 finna) finna+   finne  = if_a (finn ++ "e") finn+   funn   = tk 2 funnit+   funna  = verb_ungeminate funn +? "na"     ++verb_strong :: String -> String -> String -> Verb+verb_strong finna fann funnit = +    verb_irreg finna (pres_verb_er finna) fann funnit (tk 2 funnit ++ "en")++verb_short_long :: String -> Verb -> Verb+verb_short_long ge giva = +    giva `variant` +             ([(VF (Pres Ind Act),  ge ++ "r"), +              (VF (Pres Ind SForm), ge ++ "s"),+              (VF Imper,ge)] ++ +              [ (VI (Inf v),mk_vox v ge) | v <- values])++verb_strong_vowel :: String -> String -> String -> Verb+verb_strong_vowel a u finna = verb_strong finna fann funnit where+  (f,_,nn) = find_stem_vowel (tk 1 finna)+  fann     = verb_ungeminate $ f ++ a ++ nn+  funnit   = f ++ u ++ nn ++ "it"++-- Conjugation 1++vb1 :: String -> Verb+vb1 hoppa =  mk_verb hoppa           (hoppa ++ "r")  (tk 1 hoppa ++ "e") hoppa +                     (hoppa ++ "de") (hoppa ++ "de") (hoppa ++ "t")      (hoppa ++ "d")++-- Conjugation 2++vb2 :: String -> Verb+vb2 leka = mk_verb leka  leker leke lek   lekde lekde lekt lekd `excepts` pres_ind_passive leka lek+ where+   stam  = tk 1 leka+   leke  = stam ++ "e"+   lek   = verb_ungeminate stam+   lekd  = let lek = verb_ungeminate_m_n stam in case reverse lek of+             t:v:b | elem t "dt" && not (is_vowel v) -> lek   -- sände  +             t:_   | is_voiced t -> lek ++ "d"+             _                   -> lek ++ "t" +   lekt  = let (dd,el) = span (=='d') (reverse lekd) in +             reverse el ++ replicate (length dd) 't' +   lekde = lekd ++ "e"+   leker = pres_verb_er leka++vb2följa  = vb2+vb2sända  = vb2+vb2knäcka = vb2+vb2vända  = vb2+vb2dröja  = vb2++vb2göra :: String -> Verb+vb2göra  göra = ppvar 1 (+    mk_verb göra gör (gör ++ "e") gör (gjor ++ "de") (gjor ++ "de") +            (gjor ++ "t") (gjor ++ "d")) göra+ where g = tk 3 göra+       gör   = tk 1 göra+       gjor = g ++ "jor"++-- Conjugation 3++vb3 :: String -> Verb+vb3 bo = mk_verb bo (bo ++ "r") [] bo (bo ++ "dde") (bo ++ "dde") (bo ++ "tt") (bo ++ "dd")++vb3klä = vb3++-- Conjugation 4++vb4krypa :: String -> Verb+vb4krypa s = ppvar 1 (verb_strong_vowel "ö" "y" s) s++vb4vinna :: String -> Verb+vb4vinna s = ppvar 1 (verb_strong_vowel "a" "u" s) s ++-- vbsitta = vbfinna++vb4falla :: String -> Verb+vb4falla s = ppvar 1 (verb_strong_vowel "ö" "a" s) s  ++vb4bita :: String -> Verb+vb4bita s = ppvar 1 (verb_strong_vowel "e" "i" s) s++vb4slå :: String -> Verb+vb4slå slå = (verb_strong slå (sl++"og") (sl++"agit"))+   where sl = tk 1 slå++vb4vina :: String -> Verb+vb4vina = no_part_pret . vb4bita++vb4supa :: String -> Verb+vb4supa  s = ppvar 1 (verb_strong_vowel "ö" "u" s) s++vb4komma :: String -> Verb+vb4komma s = ppvar 1 (verb_strong_vowel "o" "o" s) s++vb4fara :: String -> Verb+vb4fara s = ppvar 1 (verb_strong_vowel "o" "a" s) s++vb4låta :: String -> Verb+vb4låta s = ppvar 1 (verb_strong_vowel "ä" "å" s) s++vb4äta :: String -> Verb+vb4äta  s = ppvar 1 (verb_strong_vowel "å" "ä" s) s++vb4hålla :: String -> Verb+vb4hålla s = ppvar 1 (verb_strong_vowel "ö" "å" s) s++-- semi-productive paradigms++vb4giva :: String -> Verb+vb4giva s v = (tk 2 s) +* verb_short_long "ge" (verb_strong_vowel "a" "i" "giva") v++vb4bliva :: String -> Verb+vb4bliva s v = (tk 3 s) +* (verb_short_long (dp 3 s) (vb4bita ((dp 3 s) ++ "va")) `except`+                                                [(VF (Pret Conj Act), (tk 1 (dp 3 s)) ++ "eve")]) v++vb4draga :: String -> Verb+vb4draga s v = (tk 3 s) +* verb_short_long "dra" (vb4fara "draga") v++vb4taga :: String -> Verb+vb4taga s v = ((\v -> (tk 2 s) +* ((verb_short_long (dp 2 s) (vb4fara (dp 2 s ++ "ga"))) v)) `except` +                                         ([(VF (Pret Conj Act), tk  1 s ++ "oge"),(VF (Pret Conj SForm),  tk 1 s ++ "oges")])) v++vb4binda :: String -> Verb+vb4binda s v = (tk 5 s) +* mk_verb "binda" "binder" "binda" "binda" "band" "band" "bundit" "bunden" v++vb4se :: String -> Verb+vb4se s v = (tk 2 s) +* mk_verb "se" "ser" "se" "se" "såg" "såg" "sett" "sedd" v++vb4gå :: String -> Verb+vb4gå s v = (tk 2 s) +* mk_verb "gå" "går" "gå" "gå" "gick" "ginge" "gått" "gången" v++vb4göra :: String -> Verb+vb4göra s v = (tk 4 s) +* mk_verb "göra" "gör" "göre" "gör" "gjorde" "gjorde" "gjort" "gjord" v++vb4stå :: String -> Verb+vb4stå s v = (tk 3 s) +* (mk_verb "stå" "står" "stå" "stå" "stod" "stånde" "stått" "stånden" `missing` part_pret_forms) v++vb4få :: String -> Verb+vb4få s v = (tk 2 s) +* (mk_verb "få" "får" "få" "få" "fick" "finge" "fått" [] `missing` part_pret_forms) v++vb4hava :: String -> Verb+vb4hava s v = (tk 2 s) +* +               (verb_short_long "ha" (mk_verb "hava" "haver" "have" "hav" "hade" "hade" "haft" []) +                                     `missing` part_pret_forms) v++vb4vara :: String -> Verb+vb4vara s v = (tk 4 s) +* (mk_verb "vara" "är" "vare" "var" "var" "vore" "varit" [] `missing` passive_forms) v++-- deponent verbs+vbdsynas :: String -> Verb+vbdsynas synas = missing (mk_verb synas synas synas synas (syn++"tes")  +                                  (syn++"ades") (syn++"ats") (syn++"ad"))+                          (part_pres_forms ++ active_forms)+ where syn = tk 2 synas++vbdlyckas :: String -> Verb+vbdlyckas lyckas = missing (mk_verb lyckas lyckas lyckas lyckas (lyck++"ades")  +                                  (lyck++"ades") (lyck++"ats") (lyck++"ad"))+                          (part_pres_forms ++ active_forms)+ where lyck = tk 2 lyckas++vbdhoppas :: String -> Verb+vbdhoppas hoppas = missing (vbdlyckas hoppas) part_forms+ where hopp = tk 2 hoppas++vbdnalkas :: String -> Verb+vbdnalkas nalkas = no_konj $ +  except (missing (mk_verb nalkas nalkas nalkas nalkas (nalk++"ades")  +                         (nalk++"ades") (nalk++"ats") (nalk++"ad")) active_forms)+                  [(VI (PtPres c),mk_case c (nalk++"ande")) | c <- values]+ where nalk = tk 2 nalkas++vbdfärdas :: String -> Verb+vbdfärdas färdas = except (vbdnalkas färdas) [(VI (PtPres Nom),färd++"andes")]+ where färd = tk 2 färdas++vbdvederfås vederfås (VI (Sup SForm)) = mkStr $ tk 1 vederfås ++ "tts"+vbdvederfås _ _ = nonExist++-- pending verbs+vbvkoka :: String -> Verb+vbvkoka koka = combine (vb1 koka) (vb2 koka)++vbvmista :: String -> Verb+vbvmista mista = combine (vb2 mista) (vb1 mista)++vbvbringa :: String -> Verb+vbvbringa bringa = variant (vb1 bringa) $ [(VI (Sup v), mk_vox v bragt) | v <- values] +++                                          [(VF (Pret m v), mk_vox v (bragt++"e")) | m <- values,+                                                                                    v <- values]+ where bragt = tk 4 bringa ++ "agt"++vbvtala :: String -> Verb+vbvtala tala = variant (vb1 tala) $ [(VI (Sup v), mk_vox v (tal++"t")) | v <- values] +++                                          [(VF (Pret m v), mk_vox v (tal++"te")) | m <- values,+                                                                                   v <- values]+ where tal = tk 1 tala++-- FIXME: should be pending+-- vbvsprida :: String -> Verb+-- vbvsprida = vb2 ++vbmdöut :: String -> Verb+vbmdöut dö_ut vf = case vf of+    VI (PtPret a c) -> mkStr $ mk_case c $ +                       case a of+                         (Strong ASgUtr)      -> utdö ++ "d"+                         (Strong ASgNeutr)    -> utdö ++ "tt"+                         (Strong APl)         -> utdö ++ "da"+                         (Weak (AxSg NoMasc)) -> utdö ++ "da"+                         (Weak (AxSg Masc))   -> utdö ++ "de"+                         (Weak AxPl)          -> utdö ++ "da"+    _               -> nonExist+ where utdö = case words dö_ut of+                [x,y] -> y +? x+                _     -> error $ "unable to flip: " ++ dö_ut