From 4bd0ea1136ca61a12e5079baca7f7129ca89d133 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 7 Jul 2024 18:12:09 +0200 Subject: Some extra mappings These are conspicuously absent from the word list --- database-extra.csv | 3 +++ process-database.hs | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 database-extra.csv diff --git a/database-extra.csv b/database-extra.csv new file mode 100644 index 0000000..b7ddd15 --- /dev/null +++ b/database-extra.csv @@ -0,0 +1,3 @@ +lexeme,orthography,reading,PoS,corrfreq +車,車,クルマ,,13334 +自転車,自転車,ジテンシャ,,1180 diff --git a/process-database.hs b/process-database.hs index bfbd4b7..a9eb97c 100755 --- a/process-database.hs +++ b/process-database.hs @@ -152,12 +152,16 @@ main :: IO () main = do (csvfname, outfname) <- getArgs >>= \case [csvfname, outfname] -> return (csvfname, outfname) - _ -> die "Usage: process-database " + _ -> die "Usage: process-database \n\ + \Additionally reads and ." (hira2kata, kata2id, nIDs) <- readTable <$> readFile "table.txt" let any2id = Map.map (kata2id Map.!) hira2kata <> kata2id - rows <- concatMap (normalise any2id) . tail . readCSV <$> readFile csvfname + rows <- do + rows1 <- tail . readCSV <$> readFile csvfname + rows2 <- tail . readCSV <$> readFile "database-extra.csv" + return (concatMap (normalise any2id) (rows1 ++ rows2)) let trie = makeTrie 0 rows -- print trie -- cgit v1.2.3-70-g09d2