Created
October 23, 2017 00:17
-
-
Save watzon/dcb97d0f17626676a0a379e449d96d1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "json" | |
module Types | |
class Result | |
JSON.mapping( | |
metadata: ResultMetadata, | |
results: Array(Word), | |
) | |
end | |
class ResultMetadata | |
JSON.mapping( | |
provider: String | |
) | |
end | |
class Word | |
JSON.mapping( | |
id: String, | |
language: String, | |
lexicalEntries: Array(LexicalEntry), | |
type: String, | |
word: String, | |
) | |
end | |
class LexicalEntry | |
JSON.mapping( | |
entries: Array(Entry), | |
language: String, | |
lexicalCategory: String, | |
pronunciations: Array(Pronunciation), | |
text: String, | |
) | |
end | |
class Entry | |
JSON.mapping( | |
etymologies: Array(String), | |
grammaticalFeatures: Array(GrammaticalFeature), | |
homographNumber: String, | |
senses: Array(Sense), | |
variantForms: Array(VariantForm), | |
) | |
end | |
class GrammaticalFeature | |
JSON.mapping( | |
text: String, | |
type: String, | |
) | |
end | |
class Sense | |
JSON.mapping( | |
definitions: Array(String), | |
domains: String, | |
id: String, | |
) | |
end | |
class VariantForm | |
JSON.mapping( | |
text: String, | |
) | |
end | |
class Pronunciation | |
JSON.mapping( | |
audioFile: String, | |
dialects: Array(String), | |
phoneticNotation: String, | |
phoneticSpelling: String, | |
) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment