UnityMol  1.0.25beta
Autocompletion Class Reference
Inheritance diagram for Autocompletion:

Static Public Member Functions

static List< int > AutoCompleteText (string input, string[] source, int maxShownCount=5, float levenshteinDistance=0.5f)
 A textField to popup a matching popup, based on developers input values. More...
 
static int LevenshteinDistance< T > (IEnumerable< T > lhs, IEnumerable< T > rhs)
 Computes the Levenshtein Edit Distance between two enumerables. More...
 

Public Attributes

TMP_InputField inf
 
RawImage img
 

Member Function Documentation

◆ AutoCompleteText()

static List<int> Autocompletion.AutoCompleteText ( string  input,
string []  source,
int  maxShownCount = 5,
float  levenshteinDistance = 0.5f 
)
static

A textField to popup a matching popup, based on developers input values.

Parameters
inputstring input.
sourcethe data of all possible values (string).
maxShownCountthe amount to display result.
levenshteinDistancevalue between 0f ~ 1f,
  • more then 0f will enable the fuzzy matching
  • 1f = anything thing is okay.
  • 0f = require full match to the reference
  • recommend 0.4f ~ 0.7f
Returns
A list of compatible string ids in source.

◆ LevenshteinDistance< T >()

static int Autocompletion.LevenshteinDistance< T > ( IEnumerable< T >  lhs,
IEnumerable< T >  rhs 
)
static

Computes the Levenshtein Edit Distance between two enumerables.

Template Parameters
TThe type of the items in the enumerables.
Parameters
lhsThe first enumerable.
rhsThe second enumerable.
Returns
The edit distance.

https://blogs.msdn.microsoft.com/toub/2006/05/05/generic-levenshtein-edit-distance-with-c/

Type Constraints
T :System.IEquatable<T> 

Member Data Documentation

◆ img

RawImage Autocompletion.img

◆ inf

TMP_InputField Autocompletion.inf

The documentation for this class was generated from the following file: