Safe Haskell | None |
---|---|
Language | Haskell2010 |
Database.Translation
Synopsis
- type WordAndLang = (Word, Language)
- type WordDescription = (Entity Word, [Language], [WordTranslation], [WordSource])
- type WordSource = (WordAndLang, [WordTranslation])
- type WordTranslation = (Translation, Language, Maybe Word)
- addTranslationFromAlt :: (MonadIO m, MonadLogger m) => WordText -> PartOfSpeech -> LanguageName -> LanguageName -> Text -> Maybe Comment -> AppT m (Maybe (Key Translation))
- addTranslationFromTo :: (MonadIO m, MonadLogger m) => WordText -> PartOfSpeech -> LanguageName -> WordText -> PartOfSpeech -> LanguageName -> Maybe Comment -> AppT m (Maybe (Key Translation))
- getFullWordDescription :: MonadIO m => [Entity Word] -> AppT m [WordDescription]
- translateWord :: MonadIO m => Text -> AppT m [WordDescription]
Documentation
type WordAndLang = (Word, Language) Source #
type WordDescription = (Entity Word, [Language], [WordTranslation], [WordSource]) Source #
type WordSource = (WordAndLang, [WordTranslation]) Source #
type WordTranslation = (Translation, Language, Maybe Word) Source #
addTranslationFromAlt Source #
Arguments
:: (MonadIO m, MonadLogger m) | |
=> WordText |
|
-> PartOfSpeech |
|
-> LanguageName |
|
-> LanguageName |
|
-> Text |
|
-> Maybe Comment | |
-> AppT m (Maybe (Key Translation)) |
The addTranslationFromAlt
function inserts new translation not to a word.
>>>
runSQLAction $ addTranslationFromAlt "bhrentos" Noun Titan English "animal horned" Nothing
Just (TranslationKey {unTranslationKey = SqlBackendKey {unSqlBackendKey = 19980}})
Arguments
:: (MonadIO m, MonadLogger m) | |
=> WordText |
|
-> PartOfSpeech |
|
-> LanguageName |
|
-> WordText |
|
-> PartOfSpeech |
|
-> LanguageName |
|
-> Maybe Comment | |
-> AppT m (Maybe (Key Translation)) |
|
The addTranslationFromTo
function inserts new translation to a existing word.
>>>
runSQLAction $ addTranslationFromTo "kibil" Noun Khuzdûl "silver" Noun English (Just "metal")
Just (TranslationKey {unTranslationKey = SqlBackendKey {unSqlBackendKey = 19980}})
getFullWordDescription :: MonadIO m => [Entity Word] -> AppT m [WordDescription] Source #
translateWord :: MonadIO m => Text -> AppT m [WordDescription] Source #