Advertisement
JoelSjogren

Untitled

Sep 5th, 2017
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. module Korean where
  2.  
  3. open import Data.String
  4.  
  5. data Language : Set
  6. data Country : Set
  7. data Citizen : Set
  8. data Noun : Set
  9.  
  10. data Language where
  11. _어 : Country → Language
  12.  
  13. data Country where
  14. 한국 : Country
  15.  
  16. data Citizen where
  17. _인 : Country → Citizen
  18.  
  19. 한국어 : Language
  20. 한국어 = 한국 어
  21.  
  22. data Noun where
  23. [_]₀ : Language → Noun
  24. [_]₁ : Country → Noun
  25. [_]₂ : Citizen → Noun
  26. 학교 : Noun
  27. 도시 : Noun
  28. 이름 : Noun
  29.  
  30. data Thing : Set where
  31. 이 : Noun → Thing
  32. [_] : Noun → Thing
  33. 저 : Thing
  34. 나 : Thing
  35.  
  36. data Place : Set where
  37. _에 : Thing → Place
  38. _에서 : Thing → Place
  39.  
  40. 한국에 = [ [ 한국 ]₁ ] 에
  41. 한국어에 = [ [ 한국 어 ]₀ ] 에
  42.  
  43. 학교에서 : Place
  44. 학교에서 = [ 학교 ] 에서
  45.  
  46. 한국인 : Citizen
  47. 한국인 = 한국 인
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. module English where
  56.  
  57. open import Data.String
  58.  
  59. data Language : Set
  60. data Country : Set
  61. data Citizen : Set
  62. data Noun : Set
  63.  
  64. data Language where
  65. _n/ish : Country → Language
  66.  
  67. data Country where
  68. Korea : Country
  69.  
  70. data Citizen where
  71. _n : Country → Citizen
  72.  
  73. data Noun where
  74. [_]₀ : Language → Noun
  75. [_]₁ : Country → Noun
  76. [_]₂ : Citizen → Noun
  77. school : Noun
  78. city : Noun
  79. name : Noun
  80.  
  81. data Thing : Set where
  82. this : Noun → Thing
  83. a : Noun → Thing
  84. the : Noun → Thing
  85. a/the/pl : Noun → Thing
  86. I : Thing
  87.  
  88. data Place : Set where
  89. in/at : Thing → Place
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96. module Translate where
  97.  
  98. open import Data.String
  99.  
  100. open import Korean as Ko
  101. open import English as En
  102.  
  103. country : Ko.Country → En.Country
  104. country 한국 = Korea
  105.  
  106. noun : Ko.Noun -> En.Noun
  107. noun [ x 어 ]₀ = [ (country x) n/ish ]₀
  108. noun [ x ]₁ = [ country x ]₁
  109. noun [ x 인 ]₂ = [ (country x) n ]₂
  110. noun 학교 = school
  111. noun 도시 = city
  112. noun 이름 = name
  113. --noun (이 x) = this (noun x)
  114.  
  115. thing : Ko.Thing → En.Thing
  116. thing (이 x) = this (noun x)
  117. thing [ x ] = a/the/pl (noun x)
  118. thing 저 = I
  119. thing 나 = I
  120.  
  121. place : Ko.Place → En.Place
  122. place (x 에) = in/at thing x
  123. place (x 에서) = in/at thing x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement