class EditDistance

This class can be used to compute the "edit distance" between two sequences.

Inheritance:


Public Fields

[more]real accuracy
the total edit distance between two sequences
[more]int n_insert
the number of insertions (weighted by their cost)
[more]int n_delete
the number of deletions (weighted by their cost)
[more]int n_subst
the number of substitutions (weighted by their cost)
[more]int n_seq
the number of sequences measured (used to normalize dist by n_seq)
[more]int insert_cost
the cost of one insertion
[more]int delete_cost
the cost of one deletion
[more]int subst_cost
the cost of one substitution
[more]int* obtained
the obtained sequence
[more]int obt_size
the size of the obtained sequence
[more]int* desired
the desired sequence
[more]int des_size
the size of the desired sequence
[more]int** confusion
the confusion matrix itself
[more]int n_confusion
the number of symbols
[more]int* conf_ins
insertions and deletions
[more]bool is_confusion
do we want a confusion matrix?

Public Methods

[more] EditDistance(bool is_confusion_=false)
[more]virtual void setCosts(int i_cost, int d_cost, int s_cost)
sets the different costs
[more]virtual void distance(int* obtained, int obt_size, int* desired, int des_size)
computes the edit distance between obtained and desired
[more]virtual void add(EditDistance* d)
accumulates the distances of the current object and the given object
[more]virtual void print(XFile* f)
prints the edit distance and optionally the sequences
[more]virtual void printRatio(XFile* f)
prints the edit distance ratio (divided by the number of sequnces) and optionally the obtained and desired sequences


Inherited from Object:

Public Fields

oAllocator* allocator

Public Methods

ovoid addOption(const char* name, int size, void* ptr, const char* help="")
ovoid addIOption(const char* name, int* ptr, int init_value, const char* help="")
ovoid addROption(const char* name, real* ptr, real init_value, const char* help="")
ovoid addBOption(const char* name, bool* ptr, bool init_value, const char* help="")
ovoid addOOption(const char* name, Object** ptr, Object* init_value, const char* help="")
ovoid setOption(const char* name, void* ptr)
ovoid setIOption(const char* name, int option)
ovoid setROption(const char* name, real option)
ovoid setBOption(const char* name, bool option)
ovoid setOOption(const char* name, Object* option)
ovirtual void loadXFile(XFile* file)
ovirtual void saveXFile(XFile* file)
ovoid load(const char* filename)
ovoid save(const char* filename)
ovoid* operator new(size_t size, Allocator* allocator_=NULL)
ovoid* operator new(size_t size, Allocator* allocator_, void* ptr_)
ovoid operator delete(void* ptr)


Documentation

This class can be used to compute the "edit distance" between two sequences. It computes the number of insertions, deletions and substitutions. The overall distance is the sum of these numbers weighted by their cost (which are intergers equal to 1 by default).

oreal accuracy
the total edit distance between two sequences

oint n_insert
the number of insertions (weighted by their cost)

oint n_delete
the number of deletions (weighted by their cost)

oint n_subst
the number of substitutions (weighted by their cost)

oint n_seq
the number of sequences measured (used to normalize dist by n_seq)

oint insert_cost
the cost of one insertion

oint delete_cost
the cost of one deletion

oint subst_cost
the cost of one substitution

oint* obtained
the obtained sequence

oint obt_size
the size of the obtained sequence

oint* desired
the desired sequence

oint des_size
the size of the desired sequence

oint** confusion
the confusion matrix itself

oint n_confusion
the number of symbols

oint* conf_ins
insertions and deletions

obool is_confusion
do we want a confusion matrix?

o EditDistance(bool is_confusion_=false)

ovirtual void setCosts(int i_cost, int d_cost, int s_cost)
sets the different costs

ovirtual void distance(int* obtained, int obt_size, int* desired, int des_size)
computes the edit distance between obtained and desired

ovirtual void add(EditDistance* d)
accumulates the distances of the current object and the given object

ovirtual void print(XFile* f)
prints the edit distance and optionally the sequences

ovirtual void printRatio(XFile* f)
prints the edit distance ratio (divided by the number of sequnces) and optionally the obtained and desired sequences


This class has no child classes.
Author:
Samy Bengio (bengio@idiap.ch)

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.