Safe Haskell | None |
---|
Observation schema blocks for Nerf.
- type Ox a = Ox Word Text a
- type Schema a = Vector Word -> Int -> Ox a
- void :: a -> Schema a
- sequenceS_ :: [Schema a] -> Schema ()
- schematize :: Schema a -> [Word] -> Sent Ob
- data SchemaCfg = SchemaCfg {}
- defaultCfg :: FilePath -> IO SchemaCfg
- fromCfg :: SchemaCfg -> Schema ()
- type Block a = Vector Word -> [Int] -> Ox a
- fromBlock :: Block a -> [Int] -> Schema a
- orthS :: Block ()
- lemmaS :: Block ()
- shapeS :: Block ()
- shapePairS :: Block ()
- suffixS :: Block ()
- searchS :: NeDict -> Block ()
Schema
type Schema a = Vector Word -> Int -> Ox aSource
A schema is a block of the Ox computation performed within the context of the sentence and the absolute sentence position.
sequenceS_ :: [Schema a] -> Schema ()Source
Sequence the list of schemas and discard individual values.
Using the schema
schematize :: Schema a -> [Word] -> Sent ObSource
Use the schema to extract observations from the sentence.
Building schema
From config
Configuration of the schema. All configuration elements specify the
range over which a particular observation type should be taken on account.
For example, the [-1, 0, 2]
range means that observations of particular
type will be extracted with respect to previous (k - 1
), current (k
)
and after the next (k + 2
) positions when identifying the observation
set for position k
in the input sentence.
Default configuration for Nerf observation schema.
Schema blocks
type Block a = Vector Word -> [Int] -> Ox aSource
A block is a chunk of the Ox computation performed within the context of the sentence and the list of absolute sentence positions.
fromBlock :: Block a -> [Int] -> Schema aSource
Transform the block to the schema dependent on the list of relative sentence positions.
Orthographic observations determined with respect to the list of relative positions.
Shape and packed shape determined with respect to the list of relative positions.
shapePairS :: Block ()Source
Shape pairs determined with respect to the list of relative positions.
Several suffixes determined with respect to the list of relative positions.