本文整理汇总了C++中lem::UCString::length方法的典型用法代码示例。如果您正苦于以下问题:C++ UCString::length方法的具体用法?C++ UCString::length怎么用?C++ UCString::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lem::UCString
的用法示例。
在下文中一共展示了UCString::length方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSuffix
lem::UCString Lemmatizator::GetSuffix( const lem::UCString & word ) const
{
LEM_CHECKIT_Z( !word.empty() );
lem::UCString uword(word);
uword.to_lower();
if( word.length()==7 && uword==L"~~end~~" )
return word;
else if( word.length()==9 && uword==L"~~begin~~" )
return word;
else if( word.length()<=model_suffix_len )
return uword;
else
return lem::UCString(L'~')+lem::right( uword, model_suffix_len );
}
示例2:
void Lemmatizator::EncodeWord1( const lem::UCString & u, lem::CString & a ) const
{
for( int i=0; i<u.length(); ++i )
{
std::map<wchar_t,int>::const_iterator it = wchar2i.find(u[i]);
if( it==wchar2i.end() )
a.ptr()[i] = (char)0xff;
else
a.ptr()[i] = it->second;
}
a.ptr()[ u.length() ] = 0;
a.calc_hash();
return;
}
示例3: BuildKey
SG_EntryGroup::KEY SG_EntryGroup::BuildKey( const lem::UCString &str )
{
switch( str.length() )
{
case 1: return KEY( str.front(), 0, 0 );
case 2: return KEY( str.front(), str[1], 0 );
default: return KEY( str.front(), str[1], str[2] );
}
}
示例4: CString
const lem::CString lem::to_ascii( const lem::UCString &str, const CodeConverter *cp )
{
if( str.empty() )
return CString();
lem::CString ascii;
lem_unicode_to_ascii( ascii.ptr(), str.c_str(), cp ? cp : &lem::UI::get_UI().GetSessionCp() );
ascii.ptr()[str.length()] = 0;
ascii.calc_hash();
return ascii;
}