| 1 | /* OTGrammar_ex_NoCoda.cpp |
| 2 | * |
| 3 | * Copyright (C) 1997-2005,2007,2009,2011,2012,2015-2020 Paul Boersma |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This code is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 | * See the GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #include "OTGrammar.h"cxx . . $ `<file>/gram/OTGrammar.h`/ |
| 20 | |
| 21 | autoOTGrammarcxx . . $ autoOTGrammar# OTGrammar_create_NoCoda_grammarcxx . . $ OTGrammar_create_NoCoda_grammar(7ca07e509e4e6648). () { |
| 22 | try { |
| 23 | OTGrammarCandidatecxx . . $ OTGrammarCandidate# candidate; |
| 24 | OTGrammarTableaucxx . . $ OTGrammarTableau# tableau; |
| 25 | OTGrammarConstraintcxx . . $ OTGrammarConstraint# constraint; |
| 26 | autoOTGrammarcxx . . $ autoOTGrammar# me = Thing_newcxx . . $ `sys/Thing.h:514:9`! (OTGrammar); |
| 27 | mycxx . . $ `melder/melder.h:44:9`! constraintscxx . . $ structOTGrammar#constraints. =cxx . . $ autovector#`operator=`(f4f0443dbfdd1e40). newvectorzerocxx . . $ newvectorzero(d6d5973469733409). <structOTGrammarConstraintcxx . . $ structOTGrammarConstraint#> (mycxx . . $ `melder/melder.h:44:9`! numberOfConstraintscxx . . $ structOTGrammar#numberOfConstraints. = 2); |
| 28 | constraint = & mycxx . . $ `melder/melder.h:44:9`! constraintscxx . . $ structOTGrammar#constraints. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).1]; |
| 29 | constraint -> namecxx . . $ structOTGrammarConstraint#name. =cxx . . $ _autostring#`operator=`(f562943cbc4bcf37). Melder_dupcxx . . $ Melder_dup(87bf156b1f548402). (U"N\\s{O}C\\s{ODA}"); |
| 30 | constraint -> rankingcxx . . $ structOTGrammarConstraint#ranking. = 100.0; |
| 31 | constraint -> plasticitycxx . . $ structOTGrammarConstraint#plasticity. = 1.0; |
| 32 | constraint = & mycxx . . $ `melder/melder.h:44:9`! constraintscxx . . $ structOTGrammar#constraints. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).2]; |
| 33 | constraint -> namecxx . . $ structOTGrammarConstraint#name. =cxx . . $ _autostring#`operator=`(f562943cbc4bcf37). Melder_dupcxx . . $ Melder_dup(87bf156b1f548402). (U"P\\s{ARSE}"); |
| 34 | constraint -> rankingcxx . . $ structOTGrammarConstraint#ranking. = 90.0; |
| 35 | constraint -> plasticitycxx . . $ structOTGrammarConstraint#plasticity. = 1.0; |
| 36 | mycxx . . $ `melder/melder.h:44:9`! tableauscxx . . $ structOTGrammar#tableaus. =cxx . . $ autovector#`operator=`(f4f0443dbfdd1e40). newvectorzerocxx . . $ newvectorzero(d6d5973469733409). <structOTGrammarTableaucxx . . $ structOTGrammarTableau#> (mycxx . . $ `melder/melder.h:44:9`! numberOfTableauscxx . . $ structOTGrammar#numberOfTableaus. = 2); |
| 37 | tableau = & mycxx . . $ `melder/melder.h:44:9`! tableauscxx . . $ structOTGrammar#tableaus. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).1]; |
| 38 | tableau -> inputcxx . . $ structOTGrammarTableau#input. =cxx . . $ _autostring#`operator=`(f562943cbc4bcf37). Melder_dupcxx . . $ Melder_dup(87bf156b1f548402). (U"pat"); |
| 39 | tableau -> candidatescxx . . $ structOTGrammarTableau#candidates. =cxx . . $ autovector#`operator=`(f4f0443dbfdd1e40). newvectorzerocxx . . $ newvectorzero(d6d5973469733409). <structOTGrammarCandidatecxx . . $ structOTGrammarCandidate#> (tableau -> numberOfCandidatescxx . . $ structOTGrammarTableau#numberOfCandidates. = 2); |
| 40 | candidate = & tableau -> candidatescxx . . $ structOTGrammarTableau#candidates. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).1]; |
| 41 | candidate -> outputcxx . . $ structOTGrammarCandidate#output. =cxx . . $ _autostring#`operator=`(f562943cbc4bcf37). Melder_dupcxx . . $ Melder_dup(87bf156b1f548402). (U"pa"); |
| 42 | candidate -> markscxx . . $ structOTGrammarCandidate#marks. =cxx . . $ autovector#`operator=`(f4f0443dbfdd1e40). zero_INTVECcxx . . $ zero_INTVEC(dab5d3ef28d6a25). (candidate -> numberOfConstraintscxx . . $ structOTGrammarCandidate#numberOfConstraints. = 2); |
| 43 | candidate -> markscxx . . $ structOTGrammarCandidate#marks. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).2] = 1; |
| 44 | candidate = & tableau -> candidatescxx . . $ structOTGrammarTableau#candidates. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).2]; |
| 45 | candidate -> outputcxx . . $ structOTGrammarCandidate#output. =cxx . . $ _autostring#`operator=`(f562943cbc4bcf37). Melder_dupcxx . . $ Melder_dup(87bf156b1f548402). (U"pat"); |
| 46 | candidate -> markscxx . . $ structOTGrammarCandidate#marks. =cxx . . $ autovector#`operator=`(f4f0443dbfdd1e40). zero_INTVECcxx . . $ zero_INTVEC(dab5d3ef28d6a25). (candidate -> numberOfConstraintscxx . . $ structOTGrammarCandidate#numberOfConstraints. = 2); |
| 47 | candidate -> markscxx . . $ structOTGrammarCandidate#marks. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).1] = 1; |
| 48 | tableau = & mycxx . . $ `melder/melder.h:44:9`! tableauscxx . . $ structOTGrammar#tableaus. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).2]; |
| 49 | tableau -> inputcxx . . $ structOTGrammarTableau#input. =cxx . . $ _autostring#`operator=`(f562943cbc4bcf37). Melder_dupcxx . . $ Melder_dup(87bf156b1f548402). (U"pa"); |
| 50 | tableau -> candidatescxx . . $ structOTGrammarTableau#candidates. =cxx . . $ autovector#`operator=`(f4f0443dbfdd1e40). newvectorzerocxx . . $ newvectorzero(d6d5973469733409). <structOTGrammarCandidatecxx . . $ structOTGrammarCandidate#> (tableau -> numberOfCandidatescxx . . $ structOTGrammarTableau#numberOfCandidates. = 1); |
| 51 | candidate = & tableau -> candidatescxx . . $ structOTGrammarTableau#candidates. [cxx . . $ autovector#`operator[]`(8a4599b8835d1ce1).1]; |
| 52 | candidate -> outputcxx . . $ structOTGrammarCandidate#output. =cxx . . $ _autostring#`operator=`(f562943cbc4bcf37). Melder_dupcxx . . $ Melder_dup(87bf156b1f548402). (U"pa"); |
| 53 | candidate -> markscxx . . $ structOTGrammarCandidate#marks. =cxx . . $ autovector#`operator=`(f4f0443dbfdd1e40). zero_INTVECcxx . . $ zero_INTVEC(dab5d3ef28d6a25). (candidate -> numberOfConstraintscxx . . $ structOTGrammarCandidate#numberOfConstraints. = 2); |
| 54 | OTGrammar_checkIndexcxx . . $ OTGrammar_checkIndex(17bef8f582790df). (me.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).()); |
| 55 | OTGrammar_newDisharmoniescxx . . $ OTGrammar_newDisharmonies(ebbb2d2a494dd028). (me.getcxx . . $ autoSomeThing#get(34d6acfd341ba7ab).(), 0.0); |
| 56 | return mecxx . . $ autoSomeThing#autoSomeThing(b79141a71f7bc86f).; |
| 57 | } catch (MelderErrorcxx . . $ MelderError#) { |
| 58 | Melder_throwcxx . . $ `melder/melder_error.h:77:9`! (U"NoCoda grammar not created."); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | /* End of file OTGrammar_ex_NoCoda.cpp */ |