Documentation ¶
Index ¶
- Variables
- func EditType(e Edit, data map[string]interface{}) float64
- func EqEquivTermDistance(e Edit, data map[string]interface{}) float64
- func GetWordID(source, id string) string
- func LemmaDistance(e Edit, data map[string]interface{}) float64
- func LexicalSimilarity(e Edit, data map[string]interface{}) float64
- func LoadScholie(path string) (*trie.Trie, error)
- func LoadScholieDict(path string) (map[string][]string, error)
- func LoadVoc(path string, dictName string) (map[string][]string, error)
- func MaxDistance(e Edit, data map[string]interface{}) float64
- func NewGreekAligner() *greekAligner
- func Phi(a *Alignment, fs []Feature, data map[string]interface{}) vectors.Vector
- func RemovePunctuation(s string) string
- func ResetCache()
- func ScholieDistance(e Edit, sch map[string]interface{}) float64
- func ScholieDistanceExact(e Edit, sch map[string]interface{}) float64
- func ScoreAccuracy(a, b *Alignment, fs []Feature, w []float64, data map[string]interface{}) float64
- func TagDistance(e Edit, data map[string]interface{}) float64
- func TextualDistance(e Edit, data map[string]interface{}) float64
- func VocDistance(e Edit, data map[string]interface{}) float64
- type Aligner
- type Alignment
- func (a *Alignment) Add(es ...Edit)
- func (a *Alignment) Align(ar Aligner, fs []Feature, ws []float64, subseqLen int, ...) (*Alignment, error)
- func (a *Alignment) EditsAccuracy(std *Alignment) float64
- func (a *Alignment) Score(fs []Feature, ws []float64, data map[string]interface{}) float64
- func (a *Alignment) String() string
- func (a *Alignment) ToJSONEdits() (map[string]JSONEdit, map[string]JSONEdit)
- type DB
- type Del
- type Edit
- type Eq
- type Feature
- type Ins
- type JSONEdit
- type JSONEditer
- type Problem
- type Scholie
- type Sub
- type Word
- type WordsBag
Constants ¶
This section is empty.
Variables ¶
var AdditionalData map[string]interface{}
AdditionalData store information useful when computing features
Functions ¶
func EqEquivTermDistance ¶
EqEquivTermDistance computes the distance based on greek equivalent terms
func LemmaDistance ¶
LemmaDistance computes the distance based on the word lemma
func LexicalSimilarity ¶
LexicalSimilarity computes the distance based on the word text
func LoadScholie ¶
LoadScholie gets the data from the available scholies
func LoadScholieDict ¶
LoadScholieDict gets the data from the available scholies
func MaxDistance ¶
MaxDistance combines the distances of the other features
func ScholieDistance ¶
ScholieDistance computes the distance based onscholie
func ScholieDistanceExact ¶
ScholieDistanceExact computes the distance based onscholie
func ScoreAccuracy ¶
ScoreAccuracy checks the ratio of edits considering their score
func TagDistance ¶
TagDistance computes the distance based on the word tag
func TextualDistance ¶
TextualDistance is the max between LE=exical and Lemma similarity
func VocDistance ¶
VocDistance computes the distance based on vocabulary data
Types ¶
type Aligner ¶
type Aligner interface {
// contains filtered or unexported methods
}
Aligner is the interface that computes the next step of an alignment
type Alignment ¶
type Alignment struct {
// contains filtered or unexported fields
}
Alignment represents a words alignment
func MergeAlignments ¶
func NewFromEdits ¶
NewFromEdits creates an aligment from edits
func NewFromWordBags ¶
NewFromWordBags creates an aligment from two word bags
func (*Alignment) Align ¶
func (a *Alignment) Align(ar Aligner, fs []Feature, ws []float64, subseqLen int, data map[string]interface{}) (*Alignment, error)
Align computes the alignement using an aligner
func (*Alignment) EditsAccuracy ¶
EditsAccuracy checks the ratio of edits in a that are also in std (the "correct" version)
type Del ¶
type Del struct {
W Word
}
Del is the delition edit
func (*Del) ToJSONEdit ¶
type Edit ¶
type Edit interface { fmt.Stringer Score(fs []Feature, ws []float64, data map[string]interface{}) float64 GetProblemID() string }
Edit is the edits interface
type Ins ¶
type Ins struct {
W Word
}
Ins is the insertion edit
func (*Ins) ToJSONEdit ¶
type JSONEdit ¶
type JSONEdit struct { Type string `json:"type"` Source []string `json:"source,omitempty"` Target []string `json:"target,omitempty"` }
JSONEdit represents the JSON format of an edit