Documentation
¶
Index ¶
- Constants
- func Open(conf *DBConf) (*sql.DB, error)
- func RunPg(corpusID, vertPath string, coOccSpan int, conf *SyntaxProps, db *sql.DB) error
- type CTItem
- type Candidate
- type CoOccTable
- type CoTItem
- type CoVertProcessor
- type CollDatabase
- func (cdb *CollDatabase) GetCollCandidatesOfChild(lemma, upos, deprel string, minFreq int) ([]*Candidate, error)
- func (cdb *CollDatabase) GetCollCandidatesOfParent(lemma, upos, deprel string, minFreq int) ([]*Candidate, error)
- func (cdb *CollDatabase) GetFreq(lemma, upos, pLemma, pUpos, deprel string) (int64, error)
- func (cdb *CollDatabase) InitializeDB(db *sql.DB, force bool) error
- func (cdb *CollDatabase) TableName() string
- func (cdb *CollDatabase) TestTableReady() error
- type CorporaConf
- type CorpusProps
- type CounterTable
- type DBConf
- type FreqDistrib
- type FreqDistribItem
- type FreqDistribItemList
- type FyItem
- type FyTable
- type PosAttrProps
- type SyntaxProps
- type VertProcessor
- type Word
Constants ¶
View Source
const (
CandidatesFreqLimit = 1
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CoOccTable ¶ added in v0.0.4
func (CoOccTable) Add ¶ added in v0.0.4
func (table CoOccTable) Add(lemma, upos, coLemma, coUpos string, val int64)
func (CoOccTable) Has ¶ added in v0.0.4
func (table CoOccTable) Has(lemma, upos, coLemma, coUpos string) bool
type CoVertProcessor ¶ added in v0.0.4
type CoVertProcessor struct {
Span int
Window [][2]string
CoOccTable CoOccTable
TokenCounts FyTable
// contains filtered or unexported fields
}
func (*CoVertProcessor) ProcStruct ¶ added in v0.0.4
func (*CoVertProcessor) ProcStructClose ¶ added in v0.0.4
func (cvp *CoVertProcessor) ProcStructClose(strc *vertigo.StructureClose, line int, err error) error
type CollDatabase ¶
type CollDatabase struct {
// contains filtered or unexported fields
}
CollDatabase note: the lifecycle of the instance is "per request"
func NewCollDatabase ¶
func NewCollDatabase(db *sql.DB, corpusID string) *CollDatabase
func (*CollDatabase) GetCollCandidatesOfChild ¶ added in v0.0.2
func (cdb *CollDatabase) GetCollCandidatesOfChild(lemma, upos, deprel string, minFreq int) ([]*Candidate, error)
GetCollCandidatesOfChild provides collocation candidates of a child
func (*CollDatabase) GetCollCandidatesOfParent ¶ added in v0.0.2
func (cdb *CollDatabase) GetCollCandidatesOfParent(lemma, upos, deprel string, minFreq int) ([]*Candidate, error)
GetCollCandidatesOfParent provides collocation candidates of a parent
func (*CollDatabase) GetFreq ¶
func (cdb *CollDatabase) GetFreq(lemma, upos, pLemma, pUpos, deprel string) (int64, error)
func (*CollDatabase) InitializeDB ¶ added in v0.0.2
func (cdb *CollDatabase) InitializeDB(db *sql.DB, force bool) error
func (*CollDatabase) TableName ¶ added in v0.0.2
func (cdb *CollDatabase) TableName() string
func (*CollDatabase) TestTableReady ¶ added in v0.0.2
func (cdb *CollDatabase) TestTableReady() error
type CorporaConf ¶
type CorporaConf []*CorpusProps
func (CorporaConf) GetCorpusProps ¶
func (cp CorporaConf) GetCorpusProps(corpusID string) *CorpusProps
type CorpusProps ¶
type CorpusProps struct {
Name string `json:"name"`
Size int64 `json:"size"`
// HasMaterializedViews if true then scollex will use queries
// targeting those views for the corpus to provide better performance.
// This is highly recommended (see scripts/schema.sql for
// the views' definitions)
HasMaterializedViews bool `json:"hasMaterializedViews"`
Syntax SyntaxProps `json:"syntax"`
}
func (*CorpusProps) ValidateAndDefaults ¶
func (conf *CorpusProps) ValidateAndDefaults(confContext string) error
type CounterTable ¶
func (CounterTable) Add ¶
func (table CounterTable) Add(lemma, upos, pLemma, pUpos, deprel string, val int64)
type FreqDistrib ¶
type FreqDistrib struct {
// CorpusSize is always equal to the whole corpus size
// (even if we work with a subcorpus)
CorpusSize int64 `json:"corpusSize"`
Freqs FreqDistribItemList `json:"freqs"`
// ExamplesQueryTpl provides a (CQL) query template
// for obtaining examples matching words from the `Freqs`
// atribute (one by one).
ExamplesQueryTpl string `json:"examplesQueryTpl"`
Error string `json:"error"`
}
type FreqDistribItem ¶
type FreqDistribItemList ¶
type FreqDistribItemList []*FreqDistribItem
func (FreqDistribItemList) Cut ¶
func (flist FreqDistribItemList) Cut(maxItems int) FreqDistribItemList
type PosAttrProps ¶
type SyntaxProps ¶
type SyntaxProps struct {
// ParentIdxAttr specifies a positional attribute providing
// information about relative position of a parent token.
ParentIdxAttr PosAttrProps `json:"parentIdxAttr"`
// LemmaAttr - an attribute specifying lemma
// (in intercorp_v13ud: `lemma`)
LemmaAttr PosAttrProps `json:"lemmaAttr"`
// ParLemmaAttr - an attribute specifying lemma in parent
// (in intercorp_v13ud: `p_lemma`)
ParLemmaAttr PosAttrProps `json:"parLemmaAttr"`
// PosAttr - an attr specifying part of speech
// (in intercorp_v13ud: `upos`)
PosAttr PosAttrProps `json:"posAttr"`
// ParPosAttr - an attr specifying part of speech in parent
// (in intercorp_v13ud: `p_upos`)
ParPosAttr PosAttrProps `json:"parPosAttr"`
// (in intercorp_v13ud: `deprel`)
FuncAttr PosAttrProps `json:"funcAttr"`
// (in intercorp_v13ud: `NOUN`)
NounValue string `json:"nounPosValue"`
// (in intercorp_v13ud: `VERB`)
VerbValue string `json:"verbPosValue"`
// (in intercorp_v13ud: `nmod`)
NounModifiedValue string `json:"nounModifiedValue"`
// (in intercorp_v13ud: `nsubj`)
NounSubjectValue string `json:"nounSubjectValue"`
// (in intercorp_v13ud: `obj|iobj`)
NounObjectValue string `json:"nounObjectValue"`
}
func (*SyntaxProps) ValidateAndDefaults ¶
func (conf *SyntaxProps) ValidateAndDefaults(confContext string) error
type VertProcessor ¶
type VertProcessor struct {
DeprelCol int
DeprelTypes []string
Table CounterTable
ParentCounts FyTable
ChildCounts FyTable
// contains filtered or unexported fields
}
func (*VertProcessor) ProcStruct ¶
func (*VertProcessor) ProcStructClose ¶
func (vp *VertProcessor) ProcStructClose(strc *vertigo.StructureClose, line int, err error) error
Click to show internal directories.
Click to hide internal directories.