tcflib.tagsets package

tcflib.tagsets.base module

This module provides an API for common linguistic tagsets as used in TCF.

class tcflib.tagsets.base.TagBase[source]

Bases: object

Base class for Tags.

is_a(tag)[source]

Tests if the tag is the same or a child of the given tag.

Parameters:tag – The tag to compare to.
class tcflib.tagsets.base.TagSetBase[source]

Bases: object

Base class for TagSets.

find_tag(name=None, pid=None)[source]

Finds a tag by name or PID.

Either pass name or pid, but not both.

find_all_tags()[source]

Returns all tags in the tagset.

class tcflib.tagsets.base.ISOcatTag[source]

Bases: tcflib.tagsets.base.TagBase, lxml.etree.ElementBase

Base class for ISOcat Tags.

is_a(tag)[source]

Tests if the tag is the same or a child of the given tag.

Parameters:tag – The tag to compare to.
find_super()[source]

Returns the parent tag (or None).

find_all_super()[source]

Returns a list of all ancestor tags.

find_top()[source]

Returns the top-most ancestor tag (or self).

class tcflib.tagsets.base.ISOcatTagSet[source]

Bases: tcflib.tagsets.base.TagSetBase

Base class for ISOcat TagSets.

tag_class

alias of ISOcatTag

find_tag(name=None, pid=None)[source]

Finds a tag by name or PID.

Either pass name or pid, but not both.

find_all_tags(profile)[source]

Returns all tags in the tagset.

class tcflib.tagsets.base.MappingTag[source]

Bases: tcflib.tagsets.base.ISOcatTag

A Tag that maps names to ISOcat pids.

See the MappingTagSet for description.

class tcflib.tagsets.base.MappingTagSet[source]

Bases: tcflib.tagsets.base.ISOcatTagSet

A TagSet that maps names to ISOcat pids.

This base class can be used to create TagSets with name aliases for ISOcat TagSets. This way, arbitrary TagSets can be modeled onto ISOcat, getting e.g. hierarchy information from ISOcat while using established names.

tag_class

alias of MappingTag

find_tag(name=None, pid=None)[source]

Finds a tag by name or PID.

Either pass name or pid, but not both.

class tcflib.tagsets.base.POSTagBase[source]

Bases: tcflib.tagsets.base.ISOcatTag

Base class for ISOcat Part-of-Speech-Tags.

is_closed

If the tag is defined as a closed word class.

class tcflib.tagsets.base.POSTagSetBase[source]

Bases: tcflib.tagsets.base.ISOcatTagSet

Base class for ISOcat Part-of-Speech-TagSets.

tcflib.tagsets.base.register_tagset(tagset_class)[source]

Register a TagSet class.

Registered TagSets can be looked up by their name.

tcflib.tagsets.base.TagSet(name)[source]

Return a TagSet instance for a given name.

tcflib.tagsets.dc1345 module

A POS tagset based on ISOcat DC-1345.

class tcflib.tagsets.dc1345.POSTag[source]

Bases: tcflib.tagsets.base.POSTagBase

class tcflib.tagsets.dc1345.POSTagSet[source]

Bases: tcflib.tagsets.base.POSTagSetBase

tag_class

alias of POSTag

tcflib.tagsets.stein module

The Stein tagset mapped onto ISOcat DC-1345.

class tcflib.tagsets.stein.SteinTag[source]

Bases: tcflib.tagsets.base.MappingTag, tcflib.tagsets.dc1345.POSTag

class tcflib.tagsets.stein.SteinTagSet[source]

Bases: tcflib.tagsets.base.MappingTagSet, tcflib.tagsets.dc1345.POSTagSet

tag_class

alias of SteinTag

tcflib.tagsets.stts module

The STTS tagset mapped onto ISOcat DC-1345.

class tcflib.tagsets.stts.STTag[source]

Bases: tcflib.tagsets.base.MappingTag, tcflib.tagsets.dc1345.POSTag

class tcflib.tagsets.stts.STTagSet[source]

Bases: tcflib.tagsets.base.MappingTagSet, tcflib.tagsets.dc1345.POSTagSet

tag_class

alias of STTag