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

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

?? simtexth.cpp

?? Trolltech公司發布的基于C++圖形開發環境
?? CPP
字號:
/************************************************************************ Copyright (C) 2000-2002 Trolltech AS.  All rights reserved.**** This file is part of Qt Linguist.**** This file may be distributed and/or modified under the terms of the** GNU General Public License version 2 as published by the Free Software** Foundation and appearing in the file LICENSE.GPL included in the** packaging of this file.**** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition** licenses may use this file in accordance with the Qt Commercial License** Agreement provided with the Software.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.**** See http://www.trolltech.com/gpl/ for GPL licensing information.** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for**   information about Qt Commercial License Agreements.**** Contact info@trolltech.com if any conditions of this licensing are** not clear to you.************************************************************************/#include "simtexth.h"#include <metatranslator.h>#include <qcstring.h>#include <qdict.h>#include <qmap.h>#include <qstring.h>#include <qstringlist.h>#include <qvaluelist.h>#include <string.h>typedef QValueList<MetaTranslatorMessage> TML;/*  How similar are two texts?  The approach used here relies on co-occurrence  matrices and is very efficient.  Let's see with an example: how similar are "here" and "hither"?  The  co-occurrence matrix M for "here" is M[h,e] = 1, M[e,r] = 1, M[r,e] = 1, and 0  elsewhere; the matrix N for "hither" is N[h,i] = 1, N[i,t] = 1, ...,  N[h,e] = 1, N[e,r] = 1, and 0 elsewhere.  The union U of both matrices is the  matrix U[i,j] = max { M[i,j], N[i,j] }, and the intersection V is  V[i,j] = min { M[i,j], N[i,j] }.  The score for a pair of texts is      score = (sum of V[i,j] over all i, j) / (sum of U[i,j] over all i, j),  a formula suggested by Arnt Gulbrandsen.  Here we have      score = 2 / 6,  or one third.  The implementation differs from this in a few details.  Most importantly,  repetitions are ignored; for input "xxx", M[x,x] equals 1, not 2.*//*  Every character is assigned to one of 20 buckets so that the co-occurrence  matrix requires only 20 * 20 = 400 bits, not 256 * 256 = 65536 bits or even  more if we want the whole Unicode.  Which character falls in which bucket is  arbitrary.  The second half of the table is a replica of the first half, because of  laziness.*/static const int indexOf[256] = {    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,//      !   "   #   $   %   &   '   (   )   *   +   ,   -   .   /    0,  2,  6,  7,  10, 12, 15, 19, 2,  6,  7,  10, 12, 15, 19, 0,//  0   1   2   3   4   5   6   7   8   9   :   ;   <   =   >   ?    1,  3,  4,  5,  8,  9,  11, 13, 14, 16, 2,  6,  7,  10, 12, 15,//  @   A   B   C   D   E   F   G   H   I   J   K   L   M   N   O    0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  6,  10, 11, 12, 13, 14,//  P   Q   R   S   T   U   V   W   X   Y   Z   [   \   ]   ^   _    15, 12, 16, 17, 18, 19, 2,  10, 15, 7,  19, 2,  6,  7,  10, 0,//  `   a   b   c   d   e   f   g   h   i   j   k   l   m   n   o    0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  6,  10, 11, 12, 13, 14,//  p   q   r   s   t   u   v   w   x   y   z   {   |   }   ~    15, 12, 16, 17, 18, 19, 2,  10, 15, 7,  19, 2,  6,  7,  10, 0,    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,    0,  2,  6,  7,  10, 12, 15, 19, 2,  6,  7,  10, 12, 15, 19, 0,    1,  3,  4,  5,  8,  9,  11, 13, 14, 16, 2,  6,  7,  10, 12, 15,    0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  6,  10, 11, 12, 13, 14,    15, 12, 16, 17, 18, 19, 2,  10, 15, 7,  19, 2,  6,  7,  10, 0,    0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  6,  10, 11, 12, 13, 14,    15, 12, 16, 17, 18, 19, 2,  10, 15, 7,  19, 2,  6,  7,  10, 0};/*  The entry bitCount[i] (for i between 0 and 255) is the number of bits used to  represent i in binary.*/static const int bitCount[256] = {    0,  1,  1,  2,  1,  2,  2,  3,  1,  2,  2,  3,  2,  3,  3,  4,    1,  2,  2,  3,  2,  3,  3,  4,  2,  3,  3,  4,  3,  4,  4,  5,    1,  2,  2,  3,  2,  3,  3,  4,  2,  3,  3,  4,  3,  4,  4,  5,    2,  3,  3,  4,  3,  4,  4,  5,  3,  4,  4,  5,  4,  5,  5,  6,    1,  2,  2,  3,  2,  3,  3,  4,  2,  3,  3,  4,  3,  4,  4,  5,    2,  3,  3,  4,  3,  4,  4,  5,  3,  4,  4,  5,  4,  5,  5,  6,    2,  3,  3,  4,  3,  4,  4,  5,  3,  4,  4,  5,  4,  5,  5,  6,    3,  4,  4,  5,  4,  5,  5,  6,  4,  5,  5,  6,  5,  6,  6,  7,    1,  2,  2,  3,  2,  3,  3,  4,  2,  3,  3,  4,  3,  4,  4,  5,    2,  3,  3,  4,  3,  4,  4,  5,  3,  4,  4,  5,  4,  5,  5,  6,    2,  3,  3,  4,  3,  4,  4,  5,  3,  4,  4,  5,  4,  5,  5,  6,    3,  4,  4,  5,  4,  5,  5,  6,  4,  5,  5,  6,  5,  6,  6,  7,    2,  3,  3,  4,  3,  4,  4,  5,  3,  4,  4,  5,  4,  5,  5,  6,    3,  4,  4,  5,  4,  5,  5,  6,  4,  5,  5,  6,  5,  6,  6,  7,    3,  4,  4,  5,  4,  5,  5,  6,  4,  5,  5,  6,  5,  6,  6,  7,    4,  5,  5,  6,  5,  6,  6,  7,  5,  6,  6,  7,  6,  7,  7,  8};struct CoMatrix{    /*      The matrix has 20 * 20 = 400 entries.  This requires 50 bytes, or 13      words.  Some operations are performed on words for more efficiency.    */    union {	Q_UINT8 b[52];	Q_UINT32 w[13];    };    CoMatrix() { memset( b, 0, 52 ); }    CoMatrix( const char *text ) {	char c = '\0', d;	memset( b, 0, 52 );	/*	  The Knuth books are not in the office only for show; they help make	  loops 30% faster and 20% as readable.	*/	while ( (d = *text) != '\0' ) {	    setCoocc( c, d );	    if ( (c = *++text) != '\0' ) {		setCoocc( d, c );		text++;	    }	}    }    void setCoocc( char c, char d ) {	int k = indexOf[(uchar) c] + 20 * indexOf[(uchar) d];	b[k >> 3] |= k & 0x7;    }    int worth() const {	int w = 0;	for ( int i = 0; i < 50; i++ )	    w += bitCount[b[i]];	return w;    }};static inline CoMatrix reunion( const CoMatrix& m, const CoMatrix& n ){    CoMatrix p;    for ( int i = 0; i < 13; i++ )	p.w[i] = m.w[i] | n.w[i];    return p;}static inline CoMatrix intersection( const CoMatrix& m, const CoMatrix& n ){    CoMatrix p;    for ( int i = 0; i < 13; i++ )	p.w[i] = m.w[i] & n.w[i];    return p;}CandidateList similarTextHeuristicCandidates( const MetaTranslator *tor,					    const char *text,					    int maxCandidates ){    QValueList<int> scores;    CandidateList candidates;    CoMatrix cmTarget( text );    int targetLen = qstrlen( text );    TML all = tor->translatedMessages();    TML::Iterator it;    for ( it = all.begin(); it != all.end(); ++it ) {	if ( (*it).type() == MetaTranslatorMessage::Unfinished ||	     (*it).translation().isEmpty() )	    continue;	QString s = tor->toUnicode( (*it).sourceText(), (*it).utf8() );	CoMatrix cm( s.latin1() );	int delta = QABS( (int) s.length() - targetLen );	/*	  Here is the score formula. A comment above contains a	  discussion on a similar (but simpler) formula.	*/	int score = ( (intersection(cm, cmTarget).worth() + 1) << 10 ) /		    ( reunion(cm, cmTarget).worth() + (delta << 1) + 1 );	if ( (int) candidates.count() == maxCandidates &&	     score > scores[maxCandidates - 1] )	    candidates.remove( candidates.last() );	if ( (int) candidates.count() < maxCandidates && score >= 190 ) {	    Candidate cand( s, (*it).translation() );	    int i;	    for ( i = 0; i < (int) candidates.count(); i++ ) {		if ( score >= scores[i] ) {		    if ( score == scores[i] ) {			if ( candidates[i] == cand )			    goto continue_outer_loop;		    } else {			break;		    }		}	    }	    scores.insert( scores.at(i), score );	    candidates.insert( candidates.at(i), cand );	}    continue_outer_loop:	;    }    return candidates;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久亚洲精华液精华液精华液 | 97超碰欧美中文字幕| 972aa.com艺术欧美| 91精品国产91久久综合桃花| 国产精品美女久久久久久久 | 亚洲国产cao| 国产成人免费视频| 91精品中文字幕一区二区三区| 国产精品久久三| 狠狠狠色丁香婷婷综合久久五月| 欧美亚洲国产一卡| 亚洲视频在线一区二区| 不卡的av网站| 国产欧美精品一区aⅴ影院 | 亚洲国产电影在线观看| 另类综合日韩欧美亚洲| 欧美人妖巨大在线| 尤物av一区二区| 91在线精品一区二区三区| 国产三级精品视频| 激情综合色综合久久综合| 欧美一区二区三区在线观看| 亚洲第一成年网| 在线观看不卡视频| 亚洲欧美激情小说另类| 91丨国产丨九色丨pron| 中文字幕在线观看一区二区| 成+人+亚洲+综合天堂| 久久久精品日韩欧美| 韩国v欧美v亚洲v日本v| 国产亚洲一二三区| 成人丝袜高跟foot| 国产精品美女久久久久久久久| 国产·精品毛片| 国产精品夫妻自拍| yourporn久久国产精品| 中文字幕五月欧美| 国产精品久久网站| 丁香激情综合国产| 日本一区二区三区视频视频| 丰满岳乱妇一区二区三区| 久久久久久亚洲综合| 国产成人精品www牛牛影视| 久久网站最新地址| 国产久卡久卡久卡久卡视频精品| 2欧美一区二区三区在线观看视频| 国产精品1024久久| 自拍偷在线精品自拍偷无码专区| kk眼镜猥琐国模调教系列一区二区| 亚洲少妇30p| 欧美精品色综合| 久久成人精品无人区| 久久精品视频一区二区三区| proumb性欧美在线观看| 亚洲成av人片在www色猫咪| 欧美岛国在线观看| 成人黄动漫网站免费app| 一区二区三区精密机械公司| 91精品国产欧美一区二区18| 国产精品18久久久久久久久久久久 | 亚洲日穴在线视频| 欧美日韩你懂得| 国产v日产∨综合v精品视频| 亚洲激情av在线| 欧美成人高清电影在线| 99这里只有久久精品视频| 视频一区视频二区中文| 欧美精彩视频一区二区三区| 欧美三级电影在线看| 裸体在线国模精品偷拍| 亚洲欧美韩国综合色| 日韩欧美精品在线视频| 日本韩国欧美在线| 国产乱码精品一区二区三区忘忧草| 亚洲黄色录像片| 久久夜色精品一区| 欧美日韩二区三区| 99视频超级精品| 国产一区二区美女诱惑| 亚洲国产sm捆绑调教视频| 国产精品美女久久久久久久| 日韩精品一区二区三区在线观看| 99久久精品情趣| 国产九色sp调教91| 蜜臀va亚洲va欧美va天堂| 亚洲一区在线免费观看| 国产精品日产欧美久久久久| 日韩欧美一二三| 欧美色网站导航| 成人丝袜高跟foot| 国产精品亚洲人在线观看| 麻豆91在线观看| 亚洲sss视频在线视频| 综合精品久久久| 国产女同性恋一区二区| 欧美精品一区二区三区视频| 欧美日韩精品欧美日韩精品| 91网上在线视频| 99免费精品在线观看| 国产精品影视网| 国产精品一二三区在线| 狠狠色综合日日| 韩国女主播成人在线观看| 免费在线观看日韩欧美| 亚洲成av人影院| 天天av天天翘天天综合网| 一区二区三区在线播放| 亚洲婷婷国产精品电影人久久| 国产亚洲人成网站| 久久人人爽人人爽| 久久综合国产精品| 欧美精品一区二区蜜臀亚洲| 精品理论电影在线| 欧美大片顶级少妇| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 欧美精选在线播放| 欧美精品一级二级| 日韩一区二区三| 日韩欧美中文字幕精品| 久久综合网色—综合色88| www久久精品| 中文字幕不卡的av| 日韩理论在线观看| 午夜久久电影网| 精品午夜久久福利影院| 国产成人综合亚洲91猫咪| 成人福利视频在线看| 91碰在线视频| 欧美久久久久久蜜桃| 亚洲精品在线网站| 中文字幕久久午夜不卡| 一区二区三区在线视频免费观看| 亚洲在线视频免费观看| 毛片基地黄久久久久久天堂| 国产麻豆精品在线| 色综合视频在线观看| 欧美狂野另类xxxxoooo| www精品美女久久久tv| 中文字幕在线观看一区| 午夜精品久久久久久| 国产在线播精品第三| 91丨porny丨最新| 91精品国产综合久久香蕉麻豆 | 欧美日本精品一区二区三区| 欧美精品丝袜中出| 久久综合九色欧美综合狠狠| 欧美国产成人在线| 一区二区三区在线播放| 日本女人一区二区三区| 国产精品自拍毛片| 色综合av在线| 欧美精选一区二区| 国产亚洲欧美激情| 亚洲影视在线观看| 久草热8精品视频在线观看| 成人免费视频播放| 欧美系列在线观看| 精品国内片67194| 国产精品国产三级国产aⅴ原创 | 亚洲色图视频网站| 日本美女一区二区| 白白色 亚洲乱淫| 欧美一级高清片| 国产精品九色蝌蚪自拍| 偷拍日韩校园综合在线| 国产精品亚洲视频| 欧美高清激情brazzers| 国产亚洲欧美色| 天堂影院一区二区| 成人激情校园春色| 91精品国产aⅴ一区二区| 国产精品欧美久久久久一区二区| 亚洲一区二区av电影| 国产精品一区二区91| 欧美三级日韩三级| 欧美国产乱子伦| 99re6这里只有精品视频在线观看| 九色综合狠狠综合久久| 97se亚洲国产综合自在线不卡| 日韩一区二区在线观看| 亚洲同性同志一二三专区| 麻豆91免费观看| 欧美日韩一区视频| 一区二区中文视频| 激情av综合网| 在线播放视频一区| 亚洲精品va在线观看| 成人午夜视频在线观看| 欧美r级电影在线观看| 五月综合激情网| 欧洲亚洲国产日韩| 中文字幕五月欧美| 国产精品一区二区三区网站| 欧美日本在线播放| 一区二区三区蜜桃网| 99麻豆久久久国产精品免费| 日本一区二区三区dvd视频在线| 麻豆91在线看| 69堂成人精品免费视频| 天堂久久久久va久久久久|