nlp

package
v0.0.0-...-9c641cd Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UKB_RELATION_FILE = 1 + iota
	UKB_REX_WNPOS
	UKB_PR_PARAMS
)
View Source
const (
	DB_MAP = iota
	DB_PREFTREE
)
View Source
const (
	DICTIONARY_INDEX = 1 + iota
	DICTIONARY_LEMMA_PREF
	DICTIONARY_POS_PREF
	DICTIONARY_ENTRIES
)
View Source
const (
	TAG_DIVIDER   = "|"
	LEMMA_DIVIDER = " "
)
View Source
const (
	DOCUMENT_SCOPE = iota
	SENTENCE_SCOPE
	ND_SCOPE
	SENTENCE_BIND
)
View Source
const (
	MOD_CONFIG = 1 + iota
	MOD_TAG_SET
	MOD_TOKENIZER
	MOD_SPLITTER
	MOD_ACCENT_DEFAULT
	MOD_ACCENT_ES
	MOD_AFFIX
	MOD_PROBABILITY
	MOD_DICTIONARY
	MOD_PUNTS
	MOD_HMM
	MOD_LOCUTIONS
	MOD_LANGUAGE
	MOD_NER
	MOD_GRAMMAR
	MOD_CHART
)
View Source
const (
	GRAMMAR_CATEGORY = 1 + iota
	GRAMMAR_FORM
	GRAMMAR_LEMMA
	GRAMMAR_COMMENT
	GRAMMAR_HEAD
	GRAMMAR_ARROW
	GRAMMAR_BAR
	GRAMMAR_COMMA
	GRAMMAR_DOT
	GRAMMAR_FLAT
	GRAMMAR_HIDDEN
	GRAMMAR_NOTOP
	GRAMMAR_ONLYTOP
	GRAMMAR_PRIOR
	GRAMMAR_START
	GRAMMAR_FILENAME
)
View Source
const (
	UNIGRAM = 1 + iota
	BIGRAM
	TRIGRAM
	INITIAL
	WORD
	SMOOTHING
	FORBIDDEN
	TAGSET
)
View Source
const (
	LOCUTIONS_ST_P = 1 + iota
	LOCUTIONS_ST_M
	LOCUTIONS_ST_STOP
)
View Source
const (
	LOCUTIONS_TK_pref = 1 + iota
	LOCUTIONS_TK_mw
	LOCUTIONS_TK_prefL
	LOCUTIONS_TK_mwL
	LOCUTIONS_TK_prefP
	LOCUTIONS_TK_mwP
	LOCUTIONS_TK_other
)
View Source
const (
	LOCUTIONS_TAGSET = 1 + iota
	LOCUTIONS_MULTIWORDS
	LOCUTIONS_ONLYSELECTED
)
View Source
const (
	NER_NE_TAG = 1 + iota
	NER_TITLE_LIMIT
	NER_AC_TITLE_LIMIT
	NER_SPLIT_MW
)
View Source
const (
	NP_NER_TYPE = 1 + iota
	NP_FUNCTION
	NP_SPECIAL
	NP_NAMES
	NP_NE_IGNORE
	NP_REX_NOUNADJ
	NP_REX_CLOSED
	NP_REX_DATNUMPUNT
	NP_AFFIXES
)
View Source
const (
	NP_RE_NA  = "^(NC|AQ)"
	NP_RE_DNP = "^[FWZ]"
	NP_RE_CLO = "^[DSC]"
)
View Source
const (
	NP_ST_IN = 1 + iota
	NP_ST_NP
	NP_ST_FUN
	NP_ST_PREF
	NP_ST_SUF
	NP_ST_STOP
)
View Source
const (
	NP_TK_sUnkUpp = 1 + iota
	NP_TK_sNounUpp
	NP_TK_mUpper
	NP_TK_mFun
	NP_TK_mPref
	NP_TK_mSuf
	NP_TK_other
)
View Source
const (
	PANIC   = factorlog.PANIC
	FATAL   = factorlog.FATAL
	ERROR   = factorlog.ERROR
	WARN    = factorlog.WARN
	DEBUG   = factorlog.DEBUG
	INFO    = factorlog.INFO
	VERBOSE = factorlog.TRACE

	TAG_NP = "NP"
)
View Source
const (
	PROBABILITY_SINGLE_TAG = 1 + iota
	PROBABILITY_CLASS_TAG
	PROBABILITY_FORM_TAG
	PROBABILITY_UNKNOWN
	PROBABILITY_THEETA
	PROBABILITY_SUFFIXES
	PROBABILITY_SUFF_BIASS
	PROBABILITY_LAMBDA_LEX
	PROBABILITY_LAMBDA_CLASS
	PROBABILITY_TAGSET
)
View Source
const (
	SEMDB_WN_POS_MAP = 1 + iota
	SEMDB_DATA_FILES
)
View Source
const (
	SPLITTER_GENERAL = 1 + iota
	SPLITTER_MARKERS
	SPLITTER_SENT_END
	SPLITTER_SENT_START
)
View Source
const (
	SUF  = 0
	PREF = 1
)
View Source
const (
	DIRECT_TRANSLATIONS = 1 + iota
	DECOMPOSITION_RULES
)
View Source
const (
	TOKENIZER_MACROS = 1 + iota
	TOKENIZER_REGEXPS
	TOKENIZER_ABBREV
)
View Source
const (
	UPPER_NONE = iota
	UPPER_ALL
	UPPER_1ST
)
View Source
const AUTOMAT_MAX_STATES = 100
View Source
const AUTOMAT_MAX_TOKENS = 50
View Source
const FORCE_NONE = 0
View Source
const FORCE_RETOK = 1
View Source
const FORCE_TAGGER = 1
View Source
const GRAMMAR_DEFGOV = 0
View Source
const GRAMMAR_NOGOV = 99999
View Source
const NER_TYPE = 1
View Source
const PUNTS_OTHER = "<Other>"
View Source
const RE_WNP = "^[NARV]"
View Source
const SAME = 100
View Source
const SENSES_DUP_ANALYSIS = 1
View Source
const TRELLIS_ZERO_logprob = -math.MaxFloat64
View Source
const UNOBS_INITIAL_STATE = "0.x"
View Source
const UNOBS_WORD = "<UNOBSERVED_WORD>"
View Source
const VERTEX_NOT_FOUND = -1
View Source
const VERY_LONG = 1000

Variables

Functions

func AllCaps

func AllCaps(s string) bool

func Array2List

func Array2List(a []interface{}) *list.List

func ArrayFloatInit

func ArrayFloatInit(l int, def float64) []float64

func ArrayFloatSwap

func ArrayFloatSwap(a1 []float64, a2 []float64)

func CRASH

func CRASH(msg string, modname int64)

func Capitalization

func Capitalization(s string) int

func Capitalize

func Capitalize(form string, caps int, init bool) string

func CreateStringWithChar

func CreateStringWithChar(n int, c string) string

func EmptyFunc

func EmptyFunc(i interface{})

func FloatPairsArray2List

func FloatPairsArray2List(a FloatPairsArray) *list.List

func HasLowercase

func HasLowercase(s string) bool

func If

func If(cond bool, trueRes interface{}, falseRes interface{}) interface{}

func IntPairsArray2List

func IntPairsArray2List(a IntPairsArray) *list.List

func IsCapitalized

func IsCapitalized(s string) bool

func List2Array

func List2Array(l *list.List) []interface{}

func ListSwap

func ListSwap(ls1 *list.List, ls2 *list.List)

func MultiIndex

func MultiIndex(s string, i string) int

func NewEmptySufRule

func NewEmptySufRule() *sufrule

func NewSufRuleFromRexEx

func NewSufRuleFromRexEx(c string) *sufrule

func NewSufRuleFromSufRule

func NewSufRuleFromSufRule(c *sufrule) *sufrule

func RegExHasSuffix

func RegExHasSuffix(re *regexp.Regexp, s string) []string

func Split

func Split(s string, sep string) []string

func StrArray2StrList

func StrArray2StrList(a []string) *list.List

func StrList2StrArray

func StrList2StrArray(l *list.List) []string

func StringsAppend

func StringsAppend(str ...string) string

func Substr

func Substr(s string, b int, l int) string

func TRACE

func TRACE(lv int, msg string, modname int64)

func WARNING

func WARNING(msg string, modname int64)

func WhiteSpace

func WhiteSpace(c uint8) bool

Types

type Accent

type Accent struct {
	// contains filtered or unexported fields
}

func NewAccent

func NewAccent(lang string) *Accent

Create the appropriate accents module (according to received options), and create a wrapper to access it.

func (*Accent) FixAccentutation

func (this *Accent) FixAccentutation(candidates *set.Set, suf *sufrule)

Wrapper methods: just call the wrapped accents module.

type AccentsDefault

type AccentsDefault struct {
}

func NewAccetsDefault

func NewAccetsDefault() *AccentsDefault

func (*AccentsDefault) FixAccentuation

func (this *AccentsDefault) FixAccentuation(candidates *set.Set, suf *sufrule)

type AccentsES

type AccentsES struct {
	// contains filtered or unexported fields
}

func NewAccentsES

func NewAccentsES() *AccentsES

func (*AccentsES) FixAccentuation

func (this *AccentsES) FixAccentuation(candidates *set.Set, suf *sufrule)

type AccentsModule

type AccentsModule interface {
	FixAccentuation(*set.Set, *sufrule)
}

type Affixes

type Affixes struct {
	ExistingLength [2]*set.Set
	Longest        [2]int
	// contains filtered or unexported fields
}

func NewAffixes

func NewAffixes(sufFile string) *Affixes

func (*Affixes) ApplyRule

func (this *Affixes) ApplyRule(r string, la *list.List, aff string, suf *sufrule, wd *Word, dic *Dictionary)

func (*Affixes) CheckRetokenizable

func (this *Affixes) CheckRetokenizable(suf *sufrule, form string, lem string, tag string, dic *Dictionary, rtk *list.List, caps int)

func (*Affixes) GenerateRoots

func (this *Affixes) GenerateRoots(kind int, suf *sufrule, rt string) *set.Set

func (*Affixes) SearchRootsList

func (this *Affixes) SearchRootsList(roots *set.Set, aff string, suf *sufrule, wd *Word, dic *Dictionary)

type Analysis

type Analysis struct {
	User []string
	// contains filtered or unexported fields
}

func NewAnalysis

func NewAnalysis(lemma string, tag string) *Analysis

func NewAnalysisFromAnalysis

func NewAnalysisFromAnalysis(a *Analysis) *Analysis

func (Analysis) String

func (this Analysis) String() string

func (*Analysis) Tag

func (this *Analysis) Tag() string

type Automat

type Automat struct {
	// contains filtered or unexported fields
}

type AutomatStatus

type AutomatStatus struct {
	// contains filtered or unexported fields
}

type Bigram

type Bigram struct {
	First  string
	Second string
}

func (*Bigram) Key

func (this *Bigram) Key() interface{}

type CSRKB

type CSRKB struct {
	// contains filtered or unexported fields
}

func NewCSRKB

func NewCSRKB(kbFile string, nit int, thr float64, damp float64) *CSRKB

type Chart

type Chart struct {
	// contains filtered or unexported fields
}

func NewChart

func NewChart(gram *Grammar) *Chart

type ChartParser

type ChartParser struct {
	// contains filtered or unexported fields
}

func NewChartParser

func NewChartParser(gram *Grammar) *ChartParser

func (*ChartParser) Analyze

func (this *ChartParser) Analyze(s *Sentence)

type Compound

type Compound struct {
	// contains filtered or unexported fields
}

type ConfigFile

type ConfigFile struct {
	SECTION_NONE    int
	SECTION_UNKNOWN int
	// contains filtered or unexported fields
}

func NewConfigFile

func NewConfigFile(skip bool, comment string) ConfigFile

func (*ConfigFile) AddSection

func (this *ConfigFile) AddSection(key string, section int)

func (*ConfigFile) AtSectionStart

func (this *ConfigFile) AtSectionStart() bool

func (*ConfigFile) GetContentLine

func (this *ConfigFile) GetContentLine(line *string) bool

func (*ConfigFile) GetLineNum

func (this *ConfigFile) GetLineNum() int

func (*ConfigFile) GetSection

func (this *ConfigFile) GetSection() int

func (*ConfigFile) IsCloseSection

func (this *ConfigFile) IsCloseSection(s string) bool

func (*ConfigFile) IsComment

func (this *ConfigFile) IsComment(s string) bool

func (*ConfigFile) IsOpenSection

func (this *ConfigFile) IsOpenSection(s string) bool

func (*ConfigFile) Open

func (this *ConfigFile) Open(filename string) bool

func (*ConfigFile) PrintSections

func (this *ConfigFile) PrintSections()

type Crawler

type Crawler struct {
	// contains filtered or unexported fields
}

func NewDefaultCrawler

func NewDefaultCrawler() *Crawler

func (*Crawler) Analyze

func (this *Crawler) Analyze(url string) *goose.Article

type Database

type Database struct {
	DBType int
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(t int) *Database

func NewDatabaseFromFile

func NewDatabaseFromFile(dbFile string) *Database

type Dictionary

type Dictionary struct {
	InverseDic             bool
	RetokenizeContractions bool
	AffixAnalysis          bool
	CompoundAnalysis       bool
	// contains filtered or unexported fields
}

func NewDictionary

func NewDictionary(Lang string, dicFile string, sufFile string, compFile string, invDic bool, retok bool) *Dictionary

func (*Dictionary) Analyze

func (this *Dictionary) Analyze(se *Sentence)

func (*Dictionary) AnnotateWord

func (this *Dictionary) AnnotateWord(w *Word, lw *list.List, override bool) bool

func (*Dictionary) CheckContracted

func (this *Dictionary) CheckContracted(form string, lem string, tag string, lw *list.List) bool

func (*Dictionary) CompactData

func (this *Dictionary) CompactData(lems *list.List) string

func (*Dictionary) ParseDictEntry

func (this *Dictionary) ParseDictEntry(data string, lems *list.List) bool

func (*Dictionary) SearchForm

func (this *Dictionary) SearchForm(s string, la *list.List)

func (*Dictionary) SortList

func (this *Dictionary) SortList(ls *list.List, pref map[string]string)

type Disambiguator

type Disambiguator struct {
	// contains filtered or unexported fields
}

func NewDisambiguator

func NewDisambiguator(disFile string) *Disambiguator

func (*Disambiguator) Analyze

func (this *Disambiguator) Analyze(ss *list.List)

type Edge

type Edge struct {
	*Rule
	// contains filtered or unexported fields
}

func NewEdge

func NewEdge() *Edge

func NewEdgeFromEdge

func NewEdgeFromEdge(edge *Edge) *Edge

func NewEdgeFromString

func NewEdgeFromString(s string, ls *list.List, pgov int) *Edge

func (*Edge) String

func (this *Edge) String() string

type Element

type Element struct {
	// contains filtered or unexported fields
}

func NewElement

func NewElement(state *Bigram, kbest int, prob float64) *Element

func (*Element) Less

func (this *Element) Less(i llrb.Item) bool

type FloatPair

type FloatPair struct {
	// contains filtered or unexported fields
}

func List2FloatPairsArray

func List2FloatPairsArray(ls *list.List) []FloatPair

type FloatPairsArray

type FloatPairsArray []FloatPair

func (FloatPairsArray) Len

func (a FloatPairsArray) Len() int

func (FloatPairsArray) Less

func (a FloatPairsArray) Less(i, j int) bool

func (FloatPairsArray) Swap

func (a FloatPairsArray) Swap(i, j int)

type Grammar

type Grammar struct {
	RulesMap

	NOGOV  int
	DEFGOV int
	// contains filtered or unexported fields
}

func NewGrammar

func NewGrammar(fname string) *Grammar

type HMMTagger

type HMMTagger struct {
	POSTagger
	Tags      *TagSet
	PTag      map[string]float64
	PBg       Map
	PTrg      map[string]float64
	PInitial  Map
	PWord     map[string]float64
	Forbidden map[string][]string
	// contains filtered or unexported fields
}

func NewHMMTagger

func NewHMMTagger(hmmFile string, rtk bool, force int, kb int) *HMMTagger

func (*HMMTagger) Analyze

func (this *HMMTagger) Analyze(s *Sentence)

func (*HMMTagger) FindStates

func (this *HMMTagger) FindStates(sent *Sentence) *list.List

func (*HMMTagger) ProbA_log

func (this *HMMTagger) ProbA_log(state_i *Bigram, state_j *Bigram, w *list.Element) float64

func (*HMMTagger) ProbB_log

func (this *HMMTagger) ProbB_log(state_i *Bigram, obs *Word) float64

func (*HMMTagger) ProbPi_log

func (this *HMMTagger) ProbPi_log(state_i *Bigram) float64

func (*HMMTagger) SequenceProb_log

func (this *HMMTagger) SequenceProb_log(se Sentence, k int) float64

type IMap

type IMap map[int]MPair

func NewIMap

func NewIMap() IMap

func (IMap) Delete

func (m IMap) Delete(key Inter)

func (IMap) Do

func (m IMap) Do(f func(key interface{}, value interface{}))

func (IMap) Get

func (m IMap) Get(key Inter) (interface{}, bool)

func (IMap) Insert

func (m IMap) Insert(key Inter, value interface{})

func (IMap) Len

func (m IMap) Len() int

type IntPair

type IntPair struct {
	// contains filtered or unexported fields
}

func List2IntPairsArray

func List2IntPairsArray(ls *list.List) []IntPair

type IntPairsArray

type IntPairsArray []IntPair

func (IntPairsArray) Len

func (a IntPairsArray) Len() int

func (IntPairsArray) Less

func (a IntPairsArray) Less(i, j int) bool

func (IntPairsArray) Swap

func (a IntPairsArray) Swap(i, j int)

type Inter

type Inter interface {
	Int() int
}

type Keyer

type Keyer interface {
	Key() interface{}
}

type Lexer

type Lexer struct {
	// contains filtered or unexported fields
}

func NewLexer

func NewLexer(rs []*Pair) *Lexer

type List

type List struct {
	// contains filtered or unexported fields
}

func NewList

func NewList() *List

type ListRec

type ListRec struct {
	*ListRecBase
}

func NewListRec

func NewListRec(s rune) *ListRec

func NewListRecData

func NewListRecData(s rune) *ListRec

func NewListRecEnd

func NewListRecEnd(s rune) *ListRec

type ListRecBase

type ListRecBase struct {
	// contains filtered or unexported fields
}

func NewListRecBase

func NewListRecBase(s rune) *ListRecBase

type ListRecData

type ListRecData struct {
	*ListRecBase
	// contains filtered or unexported fields
}

type ListRecEnd

type ListRecEnd struct {
	*ListRecBase
}

type LocutionStatus

type LocutionStatus struct {
	AutomatStatus
	// contains filtered or unexported fields
}

func NewLocutionStatus

func NewLocutionStatus() *LocutionStatus

type Locutions

type Locutions struct {
	Automat

	Tags *TagSet
	// contains filtered or unexported fields
}

func NewLocutions

func NewLocutions(locFile string) *Locutions

func (*Locutions) BuildMultiword

func (this *Locutions) BuildMultiword(se *Sentence, start *list.Element, end *list.Element, fs int, built *bool, st *LocutionStatus) *list.Element

func (*Locutions) ComputeToken

func (this *Locutions) ComputeToken(state int, j *list.Element, se *Sentence) int

func (*Locutions) ResetActions

func (this *Locutions) ResetActions(st *LocutionStatus)

func (*Locutions) SetMultiwordAnalysis

func (this *Locutions) SetMultiwordAnalysis(i *Word, fstate int, st *LocutionStatus)

func (*Locutions) ValidMultiWord

func (this *Locutions) ValidMultiWord(w *Word, st *LocutionStatus) bool

type MITIE

type MITIE struct {
	// contains filtered or unexported fields
}

func NewMITIE

func NewMITIE(filepath string) *MITIE

func (*MITIE) Process

func (this *MITIE) Process(body string) *list.List

func (*MITIE) Release

func (this *MITIE) Release()

type MPair

type MPair struct {
	Key   interface{}
	Value interface{}
}

type Maco

type Maco struct {
	MultiwordsDetection, NumbersDetection, PunctuationDetection, DatesDetection, QuantitiesDetection, DictionarySearch, ProbabilityAssignment, UserMap, NERecognition bool
	// contains filtered or unexported fields
}

func NewMaco

func NewMaco(opts *MacoOptions) *Maco

func (*Maco) Analyze

func (this *Maco) Analyze(s *Sentence)

type MacoOptions

type MacoOptions struct {
	Lang                                                                                                                              string
	LocutionsFile, QuantitiesFile, AffixFile, CompoundFile, DictionaryFile, ProbabilityFile, NPdataFile, PunctuationFile, UserMapFile string
	Decimal, Thousand                                                                                                                 string
	ProbabilityThreshold                                                                                                              float64
	InverseDict, RetokContractions                                                                                                    bool
}

func NewMacoOptions

func NewMacoOptions(lang string) *MacoOptions

func (*MacoOptions) SetDataFiles

func (this *MacoOptions) SetDataFiles(usr, pun, dic, aff, comp, loc, nps, qty, prb string)

func (*MacoOptions) SetInverseDict

func (this *MacoOptions) SetInverseDict(b bool)

func (*MacoOptions) SetNumericalPoint

func (this *MacoOptions) SetNumericalPoint(dec string, tho string)

func (*MacoOptions) SetRetokContractions

func (this *MacoOptions) SetRetokContractions(b bool)

func (*MacoOptions) SetThreshold

func (this *MacoOptions) SetThreshold(t float64)

type Map

type Map map[string]interface{}

func (Map) Delete

func (m Map) Delete(k interface{})

func (Map) Do

func (m Map) Do(f func(key interface{}, value interface{}))

func (Map) Get

func (m Map) Get(k interface{}) (interface{}, bool)

func (Map) Insert

func (m Map) Insert(k interface{}, v interface{})

func (Map) Len

func (m Map) Len() int

type NER

type NER struct {
	// contains filtered or unexported fields
}

func NewNER

func NewNER(npFile string) *NER

type NERModule

type NERModule struct {
	Automat
	TitleLength        int
	AllCapsTitleLength int
	NETag              string
	// contains filtered or unexported fields
}

func NewNERModule

func NewNERModule(npFile string) *NERModule

func (*NERModule) BuildMultiword

func (this *NERModule) BuildMultiword(se *Sentence, start *list.Element, end *list.Element, fs int, built *bool, st *NERStatus) *list.Element

func (*NERModule) ComputeToken

func (this *NERModule) ComputeToken(p int, i *list.Element, se *Sentence) int

func (*NERModule) ResetActions

func (this *NERModule) ResetActions(st *NERStatus)

func (*NERModule) SetMultiwordAnalysis

func (this *NERModule) SetMultiwordAnalysis(w *Word, fstate int, st *NERStatus)

func (*NERModule) ValidMultiWord

func (this *NERModule) ValidMultiWord(w *Word, st *NERStatus) bool

type NERStatus

type NERStatus struct {
	AutomatStatus
	// contains filtered or unexported fields
}

func NewNERStatus

func NewNERStatus() *NERStatus

type NLPEngine

type NLPEngine struct {
	WordNet *wordnet.WN
	// contains filtered or unexported fields
}

func NewNLPEngine

func NewNLPEngine(options *NLPOptions) *NLPEngine

func (*NLPEngine) PrintList

func (this *NLPEngine) PrintList(document *models.DocumentEntity)

func (*NLPEngine) PrintTree

func (this *NLPEngine) PrintTree(document *models.DocumentEntity)

func (*NLPEngine) Workflow

func (this *NLPEngine) Workflow(document *models.DocumentEntity, output chan *models.DocumentEntity)

type NLPOptions

type NLPOptions struct {
	Severity          factorlog.Severity
	DataPath          string
	Lang              string
	TokenizerFile     string
	SplitterFile      string
	MorfoOptions      *MacoOptions
	TaggerFile        string
	ShallowParserFile string
	SenseFile         string
	UKBFile           string
	DisambiguatorFile string
	Status            func()
}

func NewNLPOptions

func NewNLPOptions(dataPath string, lang string, f func()) *NLPOptions

type NP

type NP struct {
	*NERModule

	RENounAdj      *regexp.Regexp
	REClosed       *regexp.Regexp
	REDateNumPunct *regexp.Regexp
	// contains filtered or unexported fields
}

func NewNP

func NewNP(npFile string) *NP

func (*NP) ComputeToken

func (this *NP) ComputeToken(state int, j *list.Element, se *Sentence) int

func (*NP) ResetActions

func (this *NP) ResetActions(st *NERStatus)

func (*NP) SetMultiWordAnalysis

func (this *NP) SetMultiWordAnalysis(i *list.Element, fstate int, st *NERStatus)

func (*NP) StateActions

func (this *NP) StateActions(origin int, state int, token int, j *list.Element, st *NERStatus)

type Node

type Node struct {
	// contains filtered or unexported fields
}

func NewNode

func NewNode() *Node

func NewNodeFromLabel

func NewNodeFromLabel(label string) *Node

type Output

type Output struct{}

func (Output) PrintTree

func (this Output) PrintTree(output *string, n *ParseTreeIterator, depth int)

type POSTAGGER

type POSTAGGER interface {
	// contains filtered or unexported methods
}

type POSTagger

type POSTagger struct {
	// contains filtered or unexported fields
}

func NewPosTagger

func NewPosTagger(r bool, f int) *POSTagger

type Pair

type Pair struct {
	// contains filtered or unexported fields
}

type ParseTree

type ParseTree struct {
	// contains filtered or unexported fields
}

func NewEmptyParseTree

func NewEmptyParseTree() *ParseTree

func NewOneNodeParseTree

func NewOneNodeParseTree(info interface{}) *ParseTree

func NewParseTreeFromParseTree

func NewParseTreeFromParseTree(t *ParseTree) *ParseTree

func (*ParseTree) Clear

func (this *ParseTree) Clear()

func (*ParseTree) Clone

func (this *ParseTree) Clone(t *ParseTree)

func (*ParseTree) Empty

func (this *ParseTree) Empty() bool

func (*ParseTree) GetInfo

func (this *ParseTree) GetInfo() interface{}

type ParseTreeIterator

type ParseTreeIterator struct {
	// contains filtered or unexported fields
}

func NewEmptyParseTreeIterator

func NewEmptyParseTreeIterator() *ParseTreeIterator

func NewParseTreeIteratorFromParseTree

func NewParseTreeIteratorFromParseTree(t *ParseTree) *ParseTreeIterator

func NewParseTreeIteratorFromParseTreeIterator

func NewParseTreeIteratorFromParseTreeIterator(o *ParseTreeIterator) *ParseTreeIterator

func (*ParseTreeIterator) MinusMinus

func (this *ParseTreeIterator) MinusMinus() *ParseTreeIterator

func (*ParseTreeIterator) PlusPlus

func (this *ParseTreeIterator) PlusPlus() *ParseTreeIterator

type Pattern

type Pattern struct {
	// contains filtered or unexported fields
}

type PosMapRule

type PosMapRule struct {
	// contains filtered or unexported fields
}

type PrefTree

type PrefTree struct {
	DELIM_LEN int
	// contains filtered or unexported fields
}

func NewPrefTree

func NewPrefTree() *PrefTree

type Probability

type Probability struct {
	ProbabilityThreshold  float64
	Tags                  *TagSet
	BiassSuffixes         float64
	LidstoneLambdaLexical float64
	LidstoneLambdaClass   float64
	// contains filtered or unexported fields
}

func NewProbability

func NewProbability(probFile string, Threashold float64) *Probability

func (*Probability) Analyze

func (this *Probability) Analyze(se *Sentence)

func (*Probability) AnnotateWord

func (this *Probability) AnnotateWord(w *Word)

type ProcessorStatus

type ProcessorStatus struct {
}

type Punts

type Punts struct {
	*Database
	// contains filtered or unexported fields
}

func NewPunts

func NewPunts(puntFile string) *Punts

type Rule

type Rule struct {
	// contains filtered or unexported fields
}

func NewRule

func NewRule() *Rule

func NewRuleFromRule

func NewRuleFromRule(r *Rule) *Rule

func NewRuleFromString

func NewRuleFromString(s string, ls *list.List, p int) *Rule

type RulesMap

type RulesMap map[string]*list.List

type SMap

type SMap map[string]MPair

func NewSMap

func NewSMap() SMap

func (SMap) Delete

func (m SMap) Delete(key Stringer)

func (SMap) Do

func (m SMap) Do(f func(key interface{}, value interface{}))

func (SMap) Get

func (m SMap) Get(key Stringer) (interface{}, bool)

func (SMap) Insert

func (m SMap) Insert(key Stringer, value interface{})

func (SMap) Len

func (m SMap) Len() int

type SemanticDB

type SemanticDB struct {
	// contains filtered or unexported fields
}

func NewSemanticDB

func NewSemanticDB(wsdFile string) *SemanticDB

type SenseInfo

type SenseInfo struct {
	// contains filtered or unexported fields
}

func NewSenseInfo

func NewSenseInfo(syn string, data string) *SenseInfo

type Senses

type Senses struct {
	// contains filtered or unexported fields
}

func NewSenses

func NewSenses(wsdFile string) *Senses

func (*Senses) Analyze

func (this *Senses) Analyze(sentence *Sentence)

type Sentence

type Sentence struct {
	*list.List
	// contains filtered or unexported fields
}

func NewSentence

func NewSentence() *Sentence

type Splitter

type Splitter struct {
	SPLIT_AllowBetweenMarkers bool
	SPLIT_MaxWords            int64
	// contains filtered or unexported fields
}

func NewSplitter

func NewSplitter(splitterFile string) *Splitter

func (*Splitter) CloseSession

func (this *Splitter) CloseSession(ses *SplitterStatus)

func (*Splitter) OpenSession

func (this *Splitter) OpenSession() *SplitterStatus

func (*Splitter) Split

func (this *Splitter) Split(st *SplitterStatus, v *list.List, flush bool, ls *list.List)

type SplitterStatus

type SplitterStatus struct {
	BetweenMark  bool
	NoSplitCount int
	MarkType     *list.List
	MarkForm     *list.List
	// contains filtered or unexported fields
}

type Stringer

type Stringer interface {
	String() string
}

type Synset

type Synset struct {
	// contains filtered or unexported fields
}

func NewSynset

func NewSynset(scope int, lemma string, wnid string, pos float64, neg float64, domain string, score int, gloss string) *Synset

type TagSet

type TagSet struct {
	PAIR_SEP string
	MSD_SEP  string
	// contains filtered or unexported fields
}

func NewTagset

func NewTagset(ftagset string) *TagSet

func (TagSet) GetShortTag

func (this TagSet) GetShortTag(tag string) string

type Tokenizer

type Tokenizer struct {
	// contains filtered or unexported fields
}

func NewTokenizer

func NewTokenizer(tokenizerFile string) *Tokenizer

func (*Tokenizer) Tokenize

func (this *Tokenizer) Tokenize(p string, offset int, v *list.List)

type Trellis

type Trellis struct {
	ZERO_logprob float64
	InitState    *Bigram
	EndState     *Bigram
	// contains filtered or unexported fields
}

func NewTrellis

func NewTrellis(T int, kb int) *Trellis

type UKB

type UKB struct {
	RE_wnpos *regexp.Regexp
	// contains filtered or unexported fields
}

func NewUKB

func NewUKB(wsdFile string) *UKB

func (*UKB) Analyze

func (this *UKB) Analyze(ls *list.List)

type Word

type Word struct {
	*list.List

	SELECTED   int
	UNSELECTED int
	ALL        int
	// contains filtered or unexported fields
}

func NewMultiword

func NewMultiword(f string, a *list.List) *Word

func NewWord

func NewWord() *Word

func NewWordFromLemma

func NewWordFromLemma(f string) *Word

func (*Word) FormTag

func (this *Word) FormTag() string

func (Word) String

func (this Word) String() string

type WordConstIterator

type WordConstIterator struct {
	*list.Element
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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