亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? distance.cpp

?? 可自動識別自然語言,句子匹配等功能,達到人工智能識別
?? CPP
字號:
/////////////////////////////////////////////////////////////////////////////////////////////////
//
// Levenshtein Distance
// @author: Gonzales Cenelia
// homepage: www.ai-search.4t.com
//
// The "Levenshtein distance" is a measure of the similarity between two strings,
// this algorithm is also refered to as "edit distance". The "Levenshtein distance"
// was named after the russian scientist "Vladimir Levenshtein", who has discovered
// it back in 1965. The smaller the distance between two strings, the closer are
// these strings syntacticaly. The "Levenshtein distance" is computed by
// calculating the minimum number of operations that has to be made to transform
// one string to another one,usualy this operations are: replace,insert or delete a character
// example: we can change the word: "mathematics" to "mathematician" by changing one character
// and by inserting two more characters at the end.(we can replace "s" by "i" and 
// also insert "a" and "n" after that). The total number of operations that was needed in this
// case to change "mathematics" to "mathematician" was 3 operations and since it is
// also the smallest number of operation that can be use to transform one of this strings
// to the other one, that value is also a measure of the "Levenshtein distance" between
// these two strings. 
// There has been many application of the "Levenshtein distance", here is a few of them: 
// Spell Checking, Speech Recognition, Pattern Recognition etc. //****************
//
//****************************************************************************
#include "distance.h"


// finds the minimum of tree integers
int _min(int a, int b, int c) {
	return min(min(a, b), c);
}

// allocates a 2D array of integers
int **create_matrix(int Row, int Col) {
	int **array = new int*[Row];
	for(int i = 0; i < Row; ++i) {
		array[i] = new int[Col];
	}
	return array;
}

// deallocates memory
int **delete_matrix(int **array, int Row, int Col) {
	for(int i = 0; i < Row; ++i) {
		delete array[i];
	}
	delete [] array;
	return array;
}

// computes the Levenshtein distance between two strings
// "x" represent the pattern and "y" represent the text
// "m" is the pattern length and "n" is the text length
int LD(const char *x, unsigned int m, const char *y, unsigned int n) {
	// if the length of the second string is zero
	// then the distance between the two strings will
	// be equal to the length of the first string
	// and vis-versa
	// if the length of both strings is equal to zero
	// then the distance between this two strings will
	// simply be zero
	if (n == 0) {
		return m;
	} 
	else if (m == 0) {
		return n;
	}

	// creating a matrix of m+1 rows and n+1 columns
	int **matrix = create_matrix(m + 1, n + 1);

	// initialising the first row of the matrix
	for(unsigned int i = 0; i <= n; ++i) {
		matrix[0][i] = i; 
	}

	// initialising the first column of the matrix
	for(i = 0; i <= m; ++i) {
		matrix[i][0] = i; 
	}

	// complementary variables for computing the "Levenshtein distance"
	unsigned int above_cell, left_cell, diagonal_cell, cost;

	// starting the main process for computing 
	// the distance between the two strings "x" and "y"
	for(i = 1; i <= m; ++i) {
		for(unsigned int j = 1; j <= n; ++j) {
			// if the current two characters
			// of both strings are the same
			// then, the corresponding cost value
			// will be zero,otherwise it will be 1
			if (x[i-1] == y[j-1]) {
				cost = 0;
			} 
			else {
				cost = 1;
			}
			// current cell of the matrix: matrix[i][j]

			// finds the above cell to the current cell
			above_cell = matrix[i-1][j];

			// finds the left cell to the current cell
			left_cell = matrix[i][j-1];

			// finds the diagonally above cell to the current cell
			diagonal_cell = matrix[i-1][j-1];

			// computes the current value of the "edit distance" and place
			// the result into the current matrix cell
			matrix[i][j] = _min(above_cell + 1, left_cell + 1, diagonal_cell + cost);
		}
	}
	// placing the final result into a variable
	unsigned int result = matrix[m][n];
	// freeing memory that has been used
	// for the "matrix variable"
	delete_matrix(matrix, m + 1, n + 1);
	// returning result of the search
	return result;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久免费视频一区| 亚洲人成精品久久久久久| 欧美午夜视频网站| 欧美综合一区二区| 欧美伊人久久大香线蕉综合69| 91丝袜高跟美女视频| 一本一道久久a久久精品| 91蝌蚪porny九色| 91成人看片片| 欧美日韩一级二级三级| 欧美一级视频精品观看| 欧美一区二区三区在线观看视频| 日韩午夜激情av| 久久综合成人精品亚洲另类欧美 | 欧美精品一区二区三区蜜桃| 日韩免费观看高清完整版在线观看| 日韩精品自拍偷拍| 国产免费久久精品| 一区二区三区.www| 日本中文字幕一区二区视频| 国产真实乱对白精彩久久| 99re这里只有精品视频首页| 欧美日韩精品一区视频| 日韩欧美亚洲另类制服综合在线| 国产日本欧洲亚洲| 亚洲电影激情视频网站| 国产福利一区二区| 在线亚洲一区二区| 精品国产污网站| 亚洲欧美日本韩国| 国产一区二区精品久久91| 欧美伊人精品成人久久综合97| 日韩欧美一区二区在线视频| 国产精品久久久久国产精品日日 | 精品国产网站在线观看| 亚洲美女视频一区| 国产美女av一区二区三区| 色婷婷亚洲综合| 久久久久久影视| 亚洲一区二区黄色| 成人妖精视频yjsp地址| 337p亚洲精品色噜噜狠狠| 国产精品丝袜一区| 久久国产精品99久久久久久老狼| 91丨九色porny丨蝌蚪| 久久久久久亚洲综合| 午夜精彩视频在线观看不卡| 成人激情视频网站| 日韩欧美综合一区| 五月天精品一区二区三区| 99热精品一区二区| 久久久噜噜噜久久中文字幕色伊伊 | 欧美日韩国产高清一区二区| 中文字幕欧美三区| 国产成人精品一区二| 日韩一区二区影院| 亚洲成在人线在线播放| 91久久香蕉国产日韩欧美9色| 国产午夜精品一区二区三区视频| 捆绑调教一区二区三区| 欧美日韩一级视频| 亚洲成人动漫一区| 欧美在线免费观看视频| 亚洲欧美日韩国产综合| aaa国产一区| 国产精品久久一卡二卡| 不卡的av中国片| 国产精品久久久久永久免费观看| 国产激情偷乱视频一区二区三区| 欧美xxxx在线观看| 国产在线播放一区二区三区| 26uuu精品一区二区| 国内成+人亚洲+欧美+综合在线| 7777精品伊人久久久大香线蕉| 丝袜美腿亚洲一区| 欧美一区二区精品在线| 蜜臀av性久久久久蜜臀aⅴ | 亚洲精品乱码久久久久久久久 | 国产一区二区三区国产| 久久噜噜亚洲综合| 成人午夜视频网站| 日韩伦理av电影| 在线观看中文字幕不卡| 亚洲超碰精品一区二区| 日韩女优电影在线观看| 国产大片一区二区| 亚洲人成精品久久久久| 欧美精品色一区二区三区| 日韩精品亚洲专区| 精品日韩av一区二区| 国产成人亚洲精品青草天美| 亚洲欧洲成人精品av97| 在线视频欧美精品| 久草热8精品视频在线观看| 国产清纯白嫩初高生在线观看91 | a在线播放不卡| 亚洲精品一卡二卡| 欧美一级午夜免费电影| 成人午夜电影小说| 一片黄亚洲嫩模| 欧美大片顶级少妇| 97精品国产露脸对白| 日本强好片久久久久久aaa| 久久九九全国免费| 欧美日韩久久久| 国产成人a级片| 三级一区在线视频先锋| 国产精品―色哟哟| 91精品在线一区二区| 国产成人高清在线| 天天综合日日夜夜精品| 国产欧美一区二区精品秋霞影院 | 久久久久久免费| 欧美天堂一区二区三区| 丁香桃色午夜亚洲一区二区三区| 亚洲成人福利片| 亚洲视频一区二区免费在线观看 | 综合色中文字幕| 欧美电视剧免费观看| 欧美性色综合网| 国产成人综合网| 蜜桃一区二区三区四区| 亚洲一区二区三区激情| 国产精品国产三级国产| 精品国产乱码久久| 欧美一卡2卡3卡4卡| 在线观看亚洲精品视频| www.欧美日韩| 丁香五精品蜜臀久久久久99网站| 蜜臀va亚洲va欧美va天堂| 亚洲国产毛片aaaaa无费看| 国产精品黄色在线观看| 久久综合国产精品| 日韩美女视频在线| 日韩欧美一级二级三级久久久| 欧美性大战久久久久久久 | 日韩电影在线免费观看| 国产精品免费网站在线观看| 精品成人在线观看| 日韩免费电影网站| 91精品国产福利| 欧美一区二区观看视频| 4438x成人网最大色成网站| 精品视频1区2区3区| 欧美性生活大片视频| 91精品福利在线| 日本高清免费不卡视频| 在线日韩av片| 91国内精品野花午夜精品| 色999日韩国产欧美一区二区| gogo大胆日本视频一区| 99亚偷拍自图区亚洲| 91一区二区三区在线观看| 99久久亚洲一区二区三区青草| 成人爽a毛片一区二区免费| 成人av免费在线观看| 色综合天天综合狠狠| 日本久久一区二区| 欧美日韩精品一区二区三区 | 久久亚洲春色中文字幕久久久| 精品国一区二区三区| 久久综合九色综合97婷婷女人 | 日韩欧美一区二区免费| 久久综合国产精品| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 国产乱人伦偷精品视频免下载| 国产激情视频一区二区在线观看| 高清国产一区二区三区| 91啪亚洲精品| 欧美久久一二三四区| 亚洲精品在线免费观看视频| 国产亚洲视频系列| 亚洲日本电影在线| 日韩高清在线电影| 国产91丝袜在线18| 欧美影片第一页| 精品国产3级a| 一区二区三区久久| 久久精品99国产精品| 成av人片一区二区| 欧美一区二区三区性视频| 国产亚洲欧美色| 无吗不卡中文字幕| 成人午夜大片免费观看| 欧美日韩精品一区二区天天拍小说 | 欧美日韩午夜在线视频| 精品成人在线观看| 亚洲国产综合在线| 国产精品99久久久| 欧美片网站yy| 国产精品黄色在线观看| 蜜臀av一区二区三区| 色综合天天综合网国产成人综合天| 在线电影国产精品| 综合av第一页| 国产精选一区二区三区| 欧美一卡在线观看| 亚洲欧美日韩在线播放| 国产精品一二三区在线| 9191精品国产综合久久久久久|