Skip to content
Snippets Groups Projects
Commit bb3b9a16 authored by Alice Brenon's avatar Alice Brenon
Browse files

Rename 'dico' to something more meaningful

parent 3ea7287e
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ module Text.Takkyuu.French (
import Data.Char (isSpace, toLower)
import qualified Data.Map as Map (fromList)
import qualified Data.Set as Set (fromList)
import Text.Takkyuu (Game, Label(..), Labeled(..), dico, fuzz, labelizer, rules)
import Text.Takkyuu (Game, Label(..), Labeled(..), fuzz, lookupTable, labelizer, rules)
data POS =
Determiner
......@@ -43,7 +43,7 @@ typo :: Functor m => Game Char Char m
typo = fuzz $ Set.fromList ["bh"]
french:: Functor m => Game Char String m
french = dico toLower isSpace $ Set.fromList ["le", "la", "chat", "lait", "marché"]
french = lookupTable toLower isSpace $ Set.fromList ["le", "la", "chat", "lait", "marché"]
tag :: Functor m => Game String LabeledWord m
tag = labelizer (fmap toLower) $ Map.fromList [
......
module Text.Takkyuu.NLP (
Label(..)
, Labeled(..)
, dico
, fuzz
, lookupTable
, labelizer
, rules
) where
......@@ -25,8 +25,8 @@ fuzz classes = accept expand back
) tmp0 l
) Map.empty classes
dico :: (Functor m, Eq k, Ord k) => (a -> k) -> (k -> Bool) -> Set [k] -> Game a [a] m
dico projector _ vocabulary = start
lookupTable :: (Functor m, Eq k, Ord k) => (a -> k) -> (k -> Bool) -> Set [k] -> Game a [a] m
lookupTable projector _ vocabulary = start
where
start = Opponent $ continueFrom ([], [vocabulary])
continueFrom currentState@(stack, candidatesStack) (Here a) =
......@@ -68,4 +68,4 @@ labelizer projector labels = accept outputLabels back
oneOf $ maybe [Labeled a Unknown] (Labeled a . Label <$>) possibleLabels
rules :: (Functor m, Ord k) => (a -> k) -> Set [k] -> Game a [a] m
rules projector = dico projector undefined
rules projector = lookupTable projector undefined
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment