Advertisement
wtmhahagd

language lists

Jun 15th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. MODELS.
  2. Language:
  3. string: code
  4. string: name
  5. array: word variants
  6. array: phonetic variants
  7.  
  8. helper methods: has word variants, has phonetic variants
  9. add to session: which word variant? which phonetic variant?
  10.  
  11. Entry:
  12. string: word
  13. array of strings: word variants
  14. string: phonetic
  15. array of strings: phonetic variants
  16. reference to a Language (language that the word is in)
  17. reference to a PartOfSpeech
  18. JSON: lang-and-pos-specific data
  19. string: critical data
  20.  
  21. PartOfSpeech:
  22. string: name
  23. reference to a Language
  24. hash of properties:
  25. {
  26. name: "gender",
  27. values: [ "m", "f", "n" ],
  28. required: true
  29. }
  30.  
  31. TargetLanguageDetails:
  32. reference to a Word
  33. reference to a Language (that these details are written in)
  34. text field: definitions
  35. text field: notes
  36.  
  37. GrammaticalTerm:
  38. reference to a Language
  39. string: internal term
  40.  
  41. GrammaticalTermTranslation:
  42. reference to a Language
  43. reference to a GrammaticalTerm
  44. string: translation
  45.  
  46. ============
  47.  
  48. have a list of required fields for each lang-pos combo (in a certain order) plus whether they need to be localized
  49.  
  50. on updating / creating:
  51. validate the JSON.
  52. make sure the JSON has exactly the right required fields
  53. make sure that for any fields that should be restricted to certain values, those values are ok
  54.  
  55. validate the grammatical terms in {} for TargetLanguageDetails notes and critical data of Entries
  56.  
  57. on viewing:
  58. display the fields in order
  59. localize GrammaticalTerms
  60.  
  61. cron checks:
  62. - does every grammaticalterm have a translation?
  63. - if the main target language's notes etc. have been updated, have the other target languages' notes been updated too?
  64.  
  65. ============
  66. UNIT TESTS.
  67.  
  68. Language:
  69. language code should be present
  70. language code should be exactly two characters
  71. language code should be unique
  72. language name should be present
  73.  
  74. arrays should be either empty or >2 in length
  75.  
  76. test the helper methods
  77.  
  78. Entry:
  79. language, pos should be non empty
  80. if language has word variants, word variants should be non empty and word should be empty
  81. word variants length should be the same as language's word variants array
  82. if language does not have word variants, word should be non empty and word variants should be empty
  83. (repeat for phonetic variants)
  84.  
  85. for each property in property hash:
  86. property should be present as key in POS property hash
  87. if POS property hash has list of acceptable values, then property value should be in that list
  88. value should not be empty
  89. all required properties from POS property hash should be in the property hash
  90.  
  91.  
  92. PartOfSpeech:
  93. all fields should be present
  94. name should be unique within PartsOfSpeech with same language
  95. everything in hash should have name and required keys
  96.  
  97. TargetLanguageDetails:
  98. Word and Language references should be present
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement