conll

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FIELD_SEPARATOR      = '\t'
	NUM_FIELDS           = 10
	FEATURES_SEPARATOR   = "|"
	FEATURE_SEPARATOR    = "="
	FEATURE_CONCAT_DELIM = ","
)

Variables

View Source
var (
	WORD_TYPE    = "form"
	IGNORE_LEMMA bool
)

Functions

func Conll2Graph

func Conll2Graph(sent Sentence, eWord, ePOS, eWPOS, eRel, eMHost, eMSuffix *util.EnumSet) nlp.LabeledDependencyGraph

func Conll2GraphCorpus

func Conll2GraphCorpus(corpus []Sentence, eWord, ePOS, eWPOS, eRel, eMHost, eMSuffix *util.EnumSet) []interface{}

func FormatFeatures

func FormatFeatures(feat map[string]string) string

func GetMorphProperties

func GetMorphProperties(node *transition.TaggedDepNode, eMHost, eMSuffix *util.EnumSet) string

func Graph2ConllCorpus

func Graph2ConllCorpus(corpus []interface{}, eMHost, eMSuffix *util.EnumSet) []interface{}

func MorphGraph2ConllCorpus

func MorphGraph2ConllCorpus(corpus []interface{}) []interface{}

func ParseInt

func ParseInt(value string) (int, error)

func ParseString

func ParseString(value string) string

func Write

func Write(writer io.Writer, sents []interface{})

func WriteFile

func WriteFile(filename string, sents []interface{}) error

Types

type Features

type Features map[string]string

func ParseFeatures

func ParseFeatures(featuresStr string) (Features, error)

func (Features) MorphHost

func (f Features) MorphHost() string

func (Features) MorphSuffix

func (f Features) MorphSuffix() string

func (Features) String

func (f Features) String() string

type Row

type Row struct {
	ID      int
	Form    string
	Lemma   string
	CPosTag string
	PosTag  string
	Feats   Features
	FeatStr string
	Head    int
	DepRel  string
}

A Row is a single parsed row of a conll data set *Commented fields are not in use

func ParseRow

func ParseRow(record []string) (Row, error)

func (Row) String

func (r Row) String() string

type Sentence

type Sentence map[int]Row

A Sentence is a map of Rows using their ids

func Graph2Conll

func Graph2Conll(graph nlp.LabeledDependencyGraph, eMHost, eMSuffix *util.EnumSet) Sentence

func MorphGraph2Conll

func MorphGraph2Conll(graph nlp.MorphDependencyGraph) Sentence

func ReadFile

func ReadFile(filename string, limit int) ([]Sentence, error)

type Sentences

type Sentences []Sentence

func Read

func Read(reader io.Reader, limit int) (Sentences, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL