#include <AbstractString.h>
Inheritance diagram for AbstractStringFeature:
Public Types | |
enum | ComparatorType { None, Levenshtein } |
Public Member Functions | |
virtual double | getPosition () const |
virtual double | getDistance (Feature *f) const |
virtual void | moveTowards (Feature *f, double factor) |
virtual string | serialize () const |
virtual void | unserialize (string value) |
virtual featureparams | write () const |
virtual void | read (featureparams *param) |
virtual Feature * | clone () const |
virtual void | aggregate (aggregatelist samples) |
virtual FeatureType | getType () const |
virtual const string | getName () const |
const string & | getVal () const |
const unsigned long | getCodeVal () const |
const stringcode * | getCode () |
virtual string | toString () const |
Protected Member Functions | |
AbstractStringFeature (ComparatorType comp, stringcode *code, long *maxlen) | |
AbstractStringFeature (ComparatorType comp, stringcode *code, long *maxlen, const string &name) | |
unsigned long | getCodeForName (const string &name) |
Protected Attributes | |
long * | maxlength |
stringcode * | code |
char * | position |
unsigned long | codeval |
Related Functions | |
(Note that these are not member functions.) | |
static long | levenshtein (char **x, const char *t, double *factor) |
A feature of type nominal which has character strings as values. For comparing values of this feature, either the normal string comparion with the number of different characters (Manhattan distance) or the Levenshtein distance can be used.
|
The distance metric to use |
|
Feature constructor This constructor initializes the feature as prototypes value. For creating a specific sample of a feature, the sample constructor should be used.
|
|
Sample constructor This constructor initializes the feature with a specific value and should thus be used for samples.
|
|
Aggregate a sample values from other sources
Implements Feature. |
|
Clone a feature A feature must be able to clone itself. This is typically implemented with a copy constructor, but should return a new object. Implements Feature. Reimplemented in AbstractStringListFeature. |
|
Get a code value for a given string A helper function to return the respective code for a given string. If the string is encountered the first time a new code is allocated.
|
|
Implements Feature. Reimplemented in AbstractStringListFeature. |
|
Query a features name
Implements Feature. Reimplemented in AbstractStringListFeature, ActiveWindowFeature, BluetoothPeersFeature, GSMCellFeature, SystemCommandStringListFeature, WlanActiveEssidFeature, WlanActiveMacAddressFeature, and WlanPeersFeature. |
|
Query a features position
Implements Feature. Reimplemented in AbstractStringListFeature. |
|
Query a features type
Implements Feature. |
|
Query the string values
|
|
Implements Feature. Reimplemented in AbstractStringListFeature. |
|
Load feature from persistant data Initializes the persistant feature data from the given representation.
Implements PersistantFeature. |
|
Serialize a samples data to a string
Implements Feature. Reimplemented in AbstractStringListFeature. |
|
Get feature as string
Implements Feature. Reimplemented in AbstractStringListFeature, ActiveWindowFeature, BluetoothPeersFeature, GSMCellFeature, SystemCommandStringListFeature, WlanActiveEssidFeature, WlanActiveMacAddressFeature, and WlanPeersFeature. |
|
Unserialize a samples data from a string
Implements Feature. Reimplemented in AbstractStringListFeature. |
|
Externalize feature
Implements PersistantFeature. |
|
Modified Levenshtein algorithm This function implements a slightly modified version of the Levenshtein algorithm to not only calculate the distance of two strings but also modify the string x towards the string t with the propability factor. In other words, every transformation operation found by the algorithm is performed on the string x with the propability factor.
|
|
A reference to the static, persistant code table of strings seen so far. |
|
The coded value of the feature
|
|
A reference to the static, persistant maximum length of strings seen so far. |
|
Only for internal usage in moveTowards and getDistance. |