Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- randomFlip :: (Ord a, Random a, RandomGen b, Fractional a) => a -> b -> (Bool, b)
- createData :: (Probability p, MonadLog (WithSeverity String) m) => Params p -> Vector (Char, Bool) -> m (Locations Char, Set Int)
- randomizeLocations :: Double -> Locations elem -> StdGen -> (Locations elem, StdGen)
- updateLocations :: MonadState (SamplingState elem) m => elem -> Set Int -> Set Int -> m ()
- updateLocations' :: elem -> Locations elem -> Set Int -> Set Int -> Locations elem
- nonConflicting :: MonadLog (WithSeverity String) m => (Int, (Int, Int)) -> Set (Int, (Int, Int)) -> Set (Int, (Int, Int)) -> m (Set Int, Set Int)
- wordsToSites :: (Probability p, MonadState (SamplingState elem) m, MonadReader (Params p) m, MonadLog (WithSeverity String) m, Show elem, Ord elem, PrintfArg elem) => Int -> Lookup elem -> Lookup elem -> Morph elem -> Morph elem -> m (Set Int, Set Int)
- siteToWords :: (Show elem, MonadLog (WithSeverity String) m, MonadState (SamplingState elem) m) => Int -> m (Morph elem, Morph elem)
- formatWord :: [Location Char] -> String
- showLexicon :: Locations Char -> [String]
- initReverseLookup :: Eq elem => Lookup elem -> Lookup elem -> Map Int (Morph elem, Morph elem)
Documentation
randomFlip :: (Ord a, Random a, RandomGen b, Fractional a) => a -> b -> (Bool, b) Source #
createData :: (Probability p, MonadLog (WithSeverity String) m) => Params p -> Vector (Char, Bool) -> m (Locations Char, Set Int) Source #
randomizeLocations :: Double -> Locations elem -> StdGen -> (Locations elem, StdGen) Source #
Switch each potential morpheme boundary (i.e. intra-word indices) to True or False
updateLocations :: MonadState (SamplingState elem) m => elem -> Set Int -> Set Int -> m () Source #
nonConflicting :: MonadLog (WithSeverity String) m => (Int, (Int, Int)) -> Set (Int, (Int, Int)) -> Set (Int, (Int, Int)) -> m (Set Int, Set Int) Source #
For sites with matching type, return a subset that don't conflict
wordsToSites :: (Probability p, MonadState (SamplingState elem) m, MonadReader (Params p) m, MonadLog (WithSeverity String) m, Show elem, Ord elem, PrintfArg elem) => Int -> Lookup elem -> Lookup elem -> Morph elem -> Morph elem -> m (Set Int, Set Int) Source #
For two words, return all compatible sites
siteToWords :: (Show elem, MonadLog (WithSeverity String) m, MonadState (SamplingState elem) m) => Int -> m (Morph elem, Morph elem) Source #
Find the two words implied by a boundary at the given site
initReverseLookup :: Eq elem => Lookup elem -> Lookup elem -> Map Int (Morph elem, Morph elem) Source #
Turn a sequence of values into a sequence of locations sequenceToLocations :: [elem] -> Locations elem sequenceToLocations xs = Vector.fromList $ nonFinal ++ [final] where xs' = init xs nonFinal = map (x -> Location x False False) xs' x = last xs final = Location x True True True