forked from GitHub/gf-core
now by default the app shows glosses for the words for which we have something. this requires one more step in the App compilation which is described in the README
This commit is contained in:
19
src/ui/android/glosses.hs
Normal file
19
src/ui/android/glosses.hs
Normal file
@@ -0,0 +1,19 @@
|
||||
import SG
|
||||
|
||||
main = do
|
||||
ls <- fmap lines $ readFile "../../../lib/src/translator/Dictionary.gf"
|
||||
writeFile "assets/glosses.txt" (unlines ["<"++fn++",gloss,"++show gloss++">" | Just (fn,gloss) <- map gloss ls])
|
||||
|
||||
gloss l =
|
||||
case words l of
|
||||
("fun":fn:_) -> case dropWhile (/='\t') l of
|
||||
'\t':l -> Just (fn,l)
|
||||
_ -> Nothing
|
||||
_ -> Nothing
|
||||
|
||||
test = do
|
||||
db <- openSG "semantics.db"
|
||||
ls <- fmap lines $ readFile "assets/glosses.txt"
|
||||
inTransaction db $
|
||||
sequence_ [insertTriple db s p o | Just (s,p,o) <- map readTriple ls]
|
||||
closeSG db
|
||||
Reference in New Issue
Block a user