OTGrammar_def.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* OTGrammar_def.h
  2. *
  3. * Copyright (C) 1997-2011,2015-2018 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. #define ooSTRUCT OTGrammarConstraint
  19. oo_DEFINE_STRUCT (OTGrammarConstraint)
  20. oo_STRING (name)
  21. oo_DOUBLE (ranking)
  22. oo_DOUBLE (disharmony)
  23. oo_FROM (2)
  24. oo_DOUBLE (plasticity)
  25. oo_ENDFROM
  26. #if oo_READING
  27. oo_VERSION_UNTIL (2)
  28. our plasticity = 1.0;
  29. oo_VERSION_END
  30. #endif
  31. #if ! oo_READING && ! oo_WRITING
  32. oo_BOOLEAN (tiedToTheLeft)
  33. oo_BOOLEAN (tiedToTheRight)
  34. #endif
  35. oo_END_STRUCT (OTGrammarConstraint)
  36. #undef ooSTRUCT
  37. #define ooSTRUCT OTGrammarFixedRanking
  38. oo_DEFINE_STRUCT (OTGrammarFixedRanking)
  39. oo_INTEGER (higher)
  40. oo_INTEGER (lower)
  41. oo_END_STRUCT (OTGrammarFixedRanking)
  42. #undef ooSTRUCT
  43. #define ooSTRUCT OTGrammarCandidate
  44. oo_DEFINE_STRUCT (OTGrammarCandidate)
  45. oo_STRING (output)
  46. oo_INTEGER (numberOfConstraints)
  47. oo_INTVEC16 (marks, numberOfConstraints)
  48. #if ! oo_READING && ! oo_WRITING
  49. oo_DOUBLE (harmony)
  50. oo_DOUBLE (probability)
  51. oo_INTEGER (numberOfPotentialPartialOutputsMatching)
  52. oo_BOOLEAN_VECTOR (partialOutputMatches, numberOfPotentialPartialOutputsMatching)
  53. #endif
  54. oo_END_STRUCT (OTGrammarCandidate)
  55. #undef ooSTRUCT
  56. #define ooSTRUCT OTGrammarTableau
  57. oo_DEFINE_STRUCT (OTGrammarTableau)
  58. oo_STRING (input)
  59. oo_INTEGER (numberOfCandidates)
  60. oo_STRUCT_VECTOR (OTGrammarCandidate, candidates, numberOfCandidates)
  61. oo_END_STRUCT (OTGrammarTableau)
  62. #undef ooSTRUCT
  63. #define ooSTRUCT OTGrammar
  64. oo_DEFINE_CLASS (OTGrammar, Daata)
  65. oo_FROM (1)
  66. oo_ENUM (kOTGrammar_decisionStrategy, decisionStrategy)
  67. oo_ENDFROM
  68. oo_FROM (2)
  69. oo_DOUBLE (leak)
  70. oo_ENDFROM
  71. oo_INTEGER (numberOfConstraints)
  72. oo_STRUCT_VECTOR (OTGrammarConstraint, constraints, numberOfConstraints)
  73. oo_INTEGER_VECTOR (index, numberOfConstraints) // not read or written in text files
  74. oo_INTEGER (numberOfFixedRankings)
  75. oo_STRUCT_VECTOR (OTGrammarFixedRanking, fixedRankings, numberOfFixedRankings)
  76. oo_INTEGER (numberOfTableaus)
  77. oo_STRUCT_VECTOR (OTGrammarTableau, tableaus, numberOfTableaus)
  78. #if oo_READING
  79. OTGrammar_sort (this);
  80. #endif
  81. #if oo_DECLARING
  82. void v_info ()
  83. override;
  84. #endif
  85. oo_END_CLASS (OTGrammar)
  86. #undef ooSTRUCT
  87. /* End of file OTGrammar_def.h */