chatter-0.8.0.1: A library of simple NLP algorithms.

Safe HaskellNone

NLP.Types.Tags

Synopsis

Documentation

class (Ord a, Eq a, Read a, Show a, Generic a, Serialize a) => NERTag a whereSource

The class of named entity sets. This typeclass can be defined entirely in terms of the required class constraints.

Methods

fromNERTag :: a -> TextSource

parseNERTag :: Text -> Either Error aSource

Instances

class (Ord a, Eq a, Read a, Show a, Generic a, Serialize a) => ChunkTag a whereSource

The class of things that can be regarded as chunks; Chunk tags are much like POS tags, but should not be confused. Generally, chunks distinguish between different phrasal categories (e.g.; Noun Phrases, Verb Phrases, Prepositional Phrases, etc..)

Methods

fromChunk :: a -> TextSource

parseChunk :: Text -> Either Error aSource

notChunk :: aSource

class (Ord a, Eq a, Read a, Show a, Generic a, Serialize a) => Tag a whereSource

The class of POS Tags.

We use a typeclass here because POS tags just need a few things in excess of equality (they also need to be serializable and human readable). Passing around all the constraints everywhere becomes a hassle, and it's handy to have a uniform interface to the diferent kinds of tag types.

This typeclass also allows for corpus-specific tags to be distinguished; They have different semantics, so they should not be merged. That said, if you wish to create a unifying POS Tag set, and mappings into that set, you can use the type system to ensure that that is done correctly.

This may get renamed to POSTag at some later date.

Methods

fromTag :: a -> TextSource

parseTag :: Text -> aSource

tagUNK :: aSource

tagTerm :: a -> TextSource

startTag :: aSource

endTag :: aSource

isDt :: a -> BoolSource

Check if a tag is a determiner tag.

Instances

Tag RawTag

Tag instance for unknown tagsets.

Tag Tag 
Tag Tag 

newtype RawChunk Source

A fall-back ChunkTag instance, analogous to RawTag

Constructors

RawChunk Text 

newtype RawTag Source

A fallback POS tag instance.

Constructors

RawTag Text 

Instances

Eq RawTag 
Ord RawTag 
Read RawTag 
Show RawTag 
Generic RawTag 
Arbitrary RawTag 
Serialize RawTag 
Tag RawTag

Tag instance for unknown tagsets.