Safe Haskell | None |
---|---|
Language | Haskell98 |
Observation schema blocks for Concraft.
Synopsis
- type Ob = ([Int], Text)
- type Ox a = Ox Text a
- type Schema w t a = Sent w t -> EdgeID -> Ox a
- void :: a -> Schema w t a
- sequenceS_ :: [Sent w t -> a -> Ox b] -> Sent w t -> a -> Ox ()
- schematize :: Schema w t a -> Sent w t -> DAG () [Ob]
- data Body a = Body {}
- type Entry a = Maybe (Body a)
- entry :: [Int] -> Entry ()
- entryWith :: a -> [Int] -> Entry a
- data SchemaConf = SchemaConf {}
- nullConf :: SchemaConf
- fromConf :: Word w => SchemaConf -> Schema w t ()
- type Block w t a = Sent w t -> [EdgeID] -> Ox a
- fromBlock :: Word w => Block w t a -> [Int] -> Bool -> Schema w t a
- orthB :: Word w => Block w t ()
- lowOrthB :: Word w => Block w t ()
- lowPrefixesB :: Word w => [Int] -> Block w t ()
- lowSuffixesB :: Word w => [Int] -> Block w t ()
- knownB :: Word w => Block w t ()
- shapeB :: Word w => Block w t ()
- packedB :: Word w => Block w t ()
- begPackedB :: Word w => Block w t ()
Types
type Ob = ([Int], Text) Source #
An observation consist of an index (of list type) and an actual observation value.
type Schema w t a = Sent w t -> EdgeID -> Ox a Source #
A schema is a block of the Ox computation performed within the context of the sentence and the absolute sentence position.
sequenceS_ :: [Sent w t -> a -> Ox b] -> Sent w t -> a -> Ox () Source #
Sequence the list of schemas (or blocks) and discard individual values.
Usage
schematize :: Schema w t a -> Sent w t -> DAG () [Ob] Source #
Use the schema to extract observations from the sentence.
Configuration
Body of configuration entry.
data SchemaConf Source #
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.
SchemaConf | |
|
Instances
Show SchemaConf Source # | |
Defined in NLP.Concraft.DAG.Schema showsPrec :: Int -> SchemaConf -> ShowS # show :: SchemaConf -> String # showList :: [SchemaConf] -> ShowS # | |
Binary SchemaConf Source # | |
Defined in NLP.Concraft.DAG.Schema |
nullConf :: SchemaConf Source #
Null configuration of the observation schema.
fromConf :: Word w => SchemaConf -> Schema w t () Source #
Build the schema based on the configuration.
Schema blocks
type Block w t a = Sent w t -> [EdgeID] -> Ox a Source #
A block is a chunk of the Ox computation performed within the context of the sentence and the list of absolute sentence positions.
fromBlock :: Word w => Block w t a -> [Int] -> Bool -> Schema w t a Source #
Transform a block to a schema depending on * A list of relative sentence positions, * A boolean value; if true, the block computation will be performed only on positions where an OOV word resides.
lowPrefixesB :: Word w => [Int] -> Block w t () Source #
List of lowercased prefixes of given lengths.
lowSuffixesB :: Word w => [Int] -> Block w t () Source #
List of lowercased suffixes of given lengths.
begPackedB :: Word w => Block w t () Source #
Packed shape of the word.