types

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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ROOT_TOKEN = "ROOT"
	ROOT_LABEL = "ROOT"
)
View Source
const (
	SEPARATOR = ";"
)

Variables

View Source
var (
	Main_POS map[string]bool
	MDParams map[string]MDParam = map[string]MDParam{
		"Form":                            Form,
		"Form_Prop":                       Form_Prop,
		"POS":                             POS,
		"POS_Prop":                        POS_Prop,
		"Form_POS_Prop":                   Form_POS_Prop,
		"Form_Lemma_POS_Prop":             Form_Lemma_POS_Prop,
		"Form_POS":                        Form_POS,
		"Funcs_Main_POS_Both_Prop":        Funcs_Main_POS_Both_Prop,
		"Funcs_Main_POS_Both_Prop_Clitic": Funcs_Main_POS_Both_Prop_Clitic,
		"Funcs_Main_POS_Both_Prop_WLemma": Funcs_Main_POS_Both_Prop_WLemma,
		"Funcs_Main_POS":                  Funcs_Main_POS,
		"Funcs_Main_POS_Prop":             Funcs_Main_POS_Prop,
	}
	AllParamFuncNames string
)

Functions

func Form

func Form(m *EMorpheme) string

func Form_Lemma_POS_Prop

func Form_Lemma_POS_Prop(m *EMorpheme) string

func Form_POS

func Form_POS(m *EMorpheme) string

func Form_POS_Prop

func Form_POS_Prop(m *EMorpheme) string

func Form_Prop

func Form_Prop(m *EMorpheme) string

func Funcs_All_WLemma

func Funcs_All_WLemma(m *EMorpheme) string

func Funcs_Lemma_Main_POS

func Funcs_Lemma_Main_POS(m *EMorpheme) string

func Funcs_Main_POS

func Funcs_Main_POS(m *EMorpheme) string

func Funcs_Main_POS_Both_Prop

func Funcs_Main_POS_Both_Prop(m *EMorpheme) string

func Funcs_Main_POS_Both_Prop_Clitic added in v1.2.0

func Funcs_Main_POS_Both_Prop_Clitic(m *EMorpheme) string

func Funcs_Main_POS_Both_Prop_WLemma

func Funcs_Main_POS_Both_Prop_WLemma(m *EMorpheme) string

func Funcs_Main_POS_No_Prop

func Funcs_Main_POS_No_Prop(m *EMorpheme) string

func Funcs_Main_POS_Prop

func Funcs_Main_POS_Prop(m *EMorpheme) string

func InitOpenParamFamily

func InitOpenParamFamily(pType string)

func InitOpenParamTypes

func InitOpenParamTypes(Main_POS_Types []string)

func Lemma

func Lemma(m *EMorpheme) string

func Lemma_POS_Prop

func Lemma_POS_Prop(m *EMorpheme) string

func POS

func POS(m *EMorpheme) string

func POS_Prop

func POS_Prop(m *EMorpheme) string

func ProjectSpellout

func ProjectSpellout(s Spellout, f MDParam) string

Types

type AmbLemma

type AmbLemma struct {
	Token    int
	Lemmas   []string
	PrevGold []string
}

type AmbMorphs

type AmbMorphs []*AmbLemma

type BasicETaggedSentence

type BasicETaggedSentence []EnumTaggedToken

func (BasicETaggedSentence) EnumTaggedTokens

func (b BasicETaggedSentence) EnumTaggedTokens() []EnumTaggedToken

func (BasicETaggedSentence) Equal

func (b BasicETaggedSentence) Equal(otherEq util.Equaler) bool

func (BasicETaggedSentence) TaggedTokens

func (b BasicETaggedSentence) TaggedTokens() []TaggedToken

func (BasicETaggedSentence) Tokens

func (b BasicETaggedSentence) Tokens() []string

type BasicMorphemes

type BasicMorphemes []*Morpheme

func (*BasicMorphemes) Equal

func (m *BasicMorphemes) Equal(others BasicMorphemes) bool

func (*BasicMorphemes) Union

func (m *BasicMorphemes) Union(others BasicMorphemes)

type BasicSentence

type BasicSentence []Token

func (BasicSentence) Equal

func (b BasicSentence) Equal(other interface{}) bool

func (BasicSentence) Joined

func (b BasicSentence) Joined(sep string) string

func (BasicSentence) Tokens

func (b BasicSentence) Tokens() []string

type BasicTaggedSentence

type BasicTaggedSentence []TaggedToken

func (BasicTaggedSentence) Equal

func (b BasicTaggedSentence) Equal(otherEq util.Equaler) bool

func (BasicTaggedSentence) TaggedTokens

func (b BasicTaggedSentence) TaggedTokens() []TaggedToken

func (BasicTaggedSentence) Tokens

func (b BasicTaggedSentence) Tokens() []string

type DepArc

type DepArc interface {
	graph.DirectedEdge
	GetModifier() int
	GetHead() int
	String() string
}

type DepNode

type DepNode interface {
	graph.Vertex
	String() string
}

type DepRel

type DepRel string

func (DepRel) String

func (d DepRel) String() string

type DependencyGraph

type DependencyGraph interface {
	graph.DirectedGraph
	GetNode(int) DepNode
	GetArc(int) DepArc
	NumberOfNodes() int
	NumberOfArcs() int
	Equal(otherEq util.Equaler) bool
	Sentence() Sentence
	TaggedSentence() TaggedSentence
}

type DisAmbLemma

type DisAmbLemma struct {
	Token     int
	GoldMorph int
	CPOS      string
	Lemma     string
}

type DisAmbMorphs

type DisAmbMorphs []*DisAmbLemma

type EMorpheme

type EMorpheme struct {
	Morpheme
	EForm, ELemma    int
	EFCPOS, EPOS     int
	EFeatures        int
	EMHost, EMSuffix int
}

func NewRootMorpheme

func NewRootMorpheme() *EMorpheme

func (*EMorpheme) Copy

func (m *EMorpheme) Copy() *EMorpheme

func (*EMorpheme) Equal

func (m *EMorpheme) Equal(otherEq util.Equaler) bool

type EnumSentence

type EnumSentence interface {
	util.Equaler
	Tokens() []EnumToken
}

type EnumTaggedSentence

type EnumTaggedSentence interface {
	TaggedSentence
	EnumTaggedTokens() []EnumTaggedToken
}

type EnumTaggedToken

type EnumTaggedToken struct {
	TaggedToken
	EToken, ELemma, EPOS, ETPOS, EMHost, EMSuffix int
}

type EnumToken

type EnumToken struct {
	Token Token
	Enum  int
}

type Labeled

type Labeled interface {
	GetLabeledArc(int) LabeledDepArc
}

type LabeledDepArc

type LabeledDepArc interface {
	DepArc
	GetRelation() DepRel
}

type LabeledDependencyGraph

type LabeledDependencyGraph interface {
	DependencyGraph
	Labeled
}

type Lattice

type Lattice struct {
	Token           Token
	Morphemes       Morphemes
	Spellouts       Spellouts
	Next            map[int][]int
	BottomId, TopId int
}

func NewRootLattice

func NewRootLattice() Lattice

func (*Lattice) Add

func (l *Lattice) Add(morphs BasicMorphemes, start, end, numToken int)

func (*Lattice) AddAnalysis

func (l *Lattice) AddAnalysis(prefix BasicMorphemes, hosts []BasicMorphemes, numToken int)

func (*Lattice) AllFusedFrom

func (l *Lattice) AllFusedFrom(from int) []string

func (*Lattice) Bottom

func (l *Lattice) Bottom() int

func (*Lattice) BridgeMissingMorphemes

func (l *Lattice) BridgeMissingMorphemes()

func (*Lattice) BumpAll

func (l *Lattice) BumpAll(diff int)

func (*Lattice) BumpTop

func (l *Lattice) BumpTop(from, to int, upTo int)

func (*Lattice) GenNexts

func (l *Lattice) GenNexts(panicMismatch bool)

func (*Lattice) GenSpellouts

func (l *Lattice) GenSpellouts()

func (*Lattice) GenToken

func (l *Lattice) GenToken()

func (*Lattice) GetDirectedEdge

func (l *Lattice) GetDirectedEdge(i int) graph.DirectedEdge

func (*Lattice) GetEdge

func (l *Lattice) GetEdge(i int) graph.Edge

func (*Lattice) GetEdges

func (l *Lattice) GetEdges() []int

func (*Lattice) GetVertex

func (l *Lattice) GetVertex(i int) graph.Vertex

func (*Lattice) GetVertices

func (l *Lattice) GetVertices() []int

func (*Lattice) Inf

func (l *Lattice) Inf(i, j int) int

untested..

func (*Lattice) InfuseMorph

func (l *Lattice) InfuseMorph(morph *EMorpheme, from, to int, genSpellout bool)

func (*Lattice) IsVarLen

func (l *Lattice) IsVarLen() bool

func (*Lattice) MaxPathLen

func (l *Lattice) MaxPathLen() int

func (*Lattice) MorphsOnGold

func (l *Lattice) MorphsOnGold(other *Lattice) Morphemes

func (*Lattice) NumberOfEdges

func (l *Lattice) NumberOfEdges() int

func (*Lattice) NumberOfVertices

func (l *Lattice) NumberOfVertices() int

func (*Lattice) Optimize

func (l *Lattice) Optimize()

func (*Lattice) Path

func (l *Lattice) Path(i int) Spellout

func (*Lattice) Prefixes

func (l *Lattice) Prefixes(n int) []interface{}

func (*Lattice) Signature

func (l *Lattice) Signature() string

func (*Lattice) SortMorphemes

func (l *Lattice) SortMorphemes()

func (*Lattice) Suffixes

func (l *Lattice) Suffixes(n int) []interface{}

func (*Lattice) Sup

func (l *Lattice) Sup(i, j int) int

untested..

func (*Lattice) Top

func (l *Lattice) Top() int

func (*Lattice) UnionPath

func (l *Lattice) UnionPath(other *Lattice)

func (*Lattice) YieldPaths

func (l *Lattice) YieldPaths() chan Path

type LatticeSentence

type LatticeSentence []Lattice

func (LatticeSentence) Equal

func (ls LatticeSentence) Equal(otherEq util.Equaler) bool

func (LatticeSentence) FindFixDisHost

func (ls LatticeSentence) FindFixDisHost(gold Mappings, pf MDParam) []*UpdateMorph

func (LatticeSentence) FindGoldAmbMorphs

func (ls LatticeSentence) FindGoldAmbMorphs(gold Mappings, pf MDParam) AmbMorphs

func (LatticeSentence) FindGoldDisAmbMorphs

func (ls LatticeSentence) FindGoldDisAmbMorphs(gold Mappings, mdParam MDParam) DisAmbMorphs

func (LatticeSentence) TaggedSentence added in v1.1.0

func (ls LatticeSentence) TaggedSentence() TaggedSentence

func (LatticeSentence) Tokens

func (ls LatticeSentence) Tokens() []string

type MDParam

type MDParam func(m *EMorpheme) string

type Mapping

type Mapping struct {
	Token    Token
	Spellout Spellout
}

func (*Mapping) Equal

func (m *Mapping) Equal(other *Mapping) bool

func (*Mapping) String

func (m *Mapping) String() string

type Mappings

type Mappings []*Mapping

func (Mappings) Equal

func (ms Mappings) Equal(otherEq util.Equaler) bool

func (Mappings) Index

func (ms Mappings) Index(i int) (int, bool)

type MorphDependencyGraph

type MorphDependencyGraph interface {
	LabeledDependencyGraph
	GetMappings() Mappings
	GetMorpheme(int) *EMorpheme
}

type Morpheme

type Morpheme struct {
	graph.BasicDirectedEdge
	Form       string
	Lemma      string
	CPOS       string
	POS        string
	Features   map[string]string
	TokenID    int
	FeatureStr string
}

func (*Morpheme) Copy

func (m *Morpheme) Copy() *Morpheme

func (*Morpheme) EMorpheme

func (m *Morpheme) EMorpheme() *EMorpheme

func (*Morpheme) Equal

func (m *Morpheme) Equal(otherEq util.Equaler) bool

func (*Morpheme) From

func (m *Morpheme) From() int

func (*Morpheme) ID

func (m *Morpheme) ID() int

func (*Morpheme) String

func (m *Morpheme) String() string

func (*Morpheme) StringNoLemma

func (m *Morpheme) StringNoLemma() string

func (*Morpheme) To

func (m *Morpheme) To() int

type Morphemes

type Morphemes []*EMorpheme

func (Morphemes) AsBasic

func (m Morphemes) AsBasic() BasicMorphemes

func (Morphemes) Index

func (m Morphemes) Index(index int) (int, bool)

func (Morphemes) Len

func (m Morphemes) Len() int

func (Morphemes) Less

func (m Morphemes) Less(i, j int) bool

func (*Morphemes) Merge

func (m *Morphemes) Merge(new *EMorpheme)

func (Morphemes) Standalone

func (m Morphemes) Standalone() BasicMorphemes

func (Morphemes) Swap

func (m Morphemes) Swap(i, j int)

type Path

type Path int

type Sentence

type Sentence interface {
	util.Equaler
	Tokens() []string
}

type Spellout

type Spellout Morphemes

func (Spellout) AsString

func (s Spellout) AsString() string

func (Spellout) Compare

func (s Spellout) Compare(other Spellout, paramFuncName string) (TP, TN, FP, FN int)

func (Spellout) Equal

func (s Spellout) Equal(other Spellout) bool

func (Spellout) EqualCompare

func (s Spellout) EqualCompare(other Spellout, paramFuncName string) bool

func (Spellout) String

func (s Spellout) String() string

type Spellouts

type Spellouts []Spellout

func (Spellouts) Find

func (s Spellouts) Find(other Spellout) (int, bool)

func (Spellouts) Intersect

func (s Spellouts) Intersect(other Spellouts, paramFunc string, startNode int) Spellouts

func (Spellouts) Len

func (s Spellouts) Len() int

func (Spellouts) Less

func (s Spellouts) Less(i, j int) bool

func (*Spellouts) Merge

func (s *Spellouts) Merge(new Spellout, startNode int)

Adds a new spellout only if it doesn't already exist

func (Spellouts) Swap

func (s Spellouts) Swap(i, j int)

func (Spellouts) UniqueMorphemes

func (s Spellouts) UniqueMorphemes() Morphemes

type TaggedSentence

type TaggedSentence interface {
	Sentence
	TaggedTokens() []TaggedToken
}

type TaggedToken

type TaggedToken struct {
	Token, Lemma, POS string
}

type Token

type Token string

func (Token) Prefixes

func (t Token) Prefixes(n int) []interface{}

func (Token) Signature

func (t Token) Signature() string

func (Token) Suffixes

func (t Token) Suffixes(n int) []interface{}

type UpdateMorph

type UpdateMorph struct {
	Type          string
	Tok, From, To int
}

Jump to

Keyboard shortcuts

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