本文整理汇总了C++中FSXSTRING::Left方法的典型用法代码示例。如果您正苦于以下问题:C++ FSXSTRING::Left方法的具体用法?C++ FSXSTRING::Left怎么用?C++ FSXSTRING::Left使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FSXSTRING
的用法示例。
在下文中一共展示了FSXSTRING::Left方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: return
/*
* return minimaalne tyvepikkus, mida on m�tet otsida
*/
int MORF0::minipik(FSXSTRING *ty)
{
FSXSTRING ttt;
int pik=2;
ttt = (const FSxCHAR *)(ty->Left(3));
if ( ttt == FSxSTR("alu") || ttt == FSxSTR("ude") || ttt == FSxSTR("pan") )
pik = 4;
else
{
ttt = (const FSxCHAR *)(ttt.Left(2));
if ( ( (dctLoend[9])[(FSxCHAR *)(const FSxCHAR *)ttt] ) == -1 )
pik = 3;
}
return(pik);
}
示例2: if
bool ETMRFAS::Gene2Detailne( // -1==siiber; 0==ok
MRFTULEMUSED *pValja,
MRFTULEMUSED *pMrfTul,
const FSXSTRING *pnaidis,
const FSXSTRING *pGeneLiik,
const FSXSTRING *pGeneVormid,
const FSXSTRING *pGeneKigi)
{
char algv_lopp;
int algv_vorm;
int viimne;
FSXSTRING gene_liik = KOIK_LIIGID; // igaks juhuks
FSXSTRING genetud_tyvi, gene_t1, gene_t2, ette, kigi;
int i, sgn=0, k1, k2;
bool r;
FSxCHAR vi;
if (pMrfTul->Get_vormid(FSxSTR("sg n,")) != -1)
sgn = 1; // analyyside hulgas leidub sg n
i = pMrfTul->Get_vormid(FSxSTR("ma,"));
if (i != -1 && pMrfTul->Get_vormid(FSxSTR("tama,")) != i)
sgn = 1; // analyyside hulgas leidub ma
if (*pGeneLiik == FSxSTR("*"))
gene_liik = KOIK_LIIGID;
else
gene_liik = (const FSxCHAR*)*pGeneLiik;
// vt kõiki algvorme
//
kigi = FSxSTR("");
for (i=0; i < pMrfTul->idxLast; i++)
{
if (gene_liik.Find((*pMrfTul)[i]->sl) == -1)
continue; // polnud sobiv sõnaliik
if ((*pMrfTul)[i]->vormid.Find(FSxSTR("?")) != -1 || (*pMrfTul)[i]->vormid.Find(FSxSTR(",")) == -1) // muutumatu s�na
{
if (sgn == 0 || // analüüside hulgas polegi käänduvat sõna või ...
pGeneVormid->GetLength() == 0 || // tahetaksegi muutumatut sõna
pGeneVormid->Find(FSxSTR("sg n")) >=0 ) // käsitaksegi ainsuse nimetavat
{ // et enne //_*_ // et //_*_ // ja enne //_*_ sg n, // enne //_*_ sg g, // oleks kooskõlas
genetud_tyvi = pMrfTul->rec[i]->tyvi;
genetud_tyvi.Remove((FSxCHAR)'_');
genetud_tyvi.Remove((FSxCHAR)'=');
genetud_tyvi.Remove((FSxCHAR)'+');
vi = genetud_tyvi[genetud_tyvi.GetLength()-1];
if (pGeneKigi->GetLength()>0)
{
if (!TaheHulgad::OnHelitu(vi))
kigi = FSxSTR("gi");
else
kigi = FSxSTR("ki");
}
pValja->Add(
(const FSxCHAR *)genetud_tyvi,
FSxSTR(""), // 0-l�pu puhul 0 ei lisa
(const FSxCHAR *)kigi, //
(*pMrfTul)[i]->sl,
(*pMrfTul)[i]->vormid);
continue;
}
}
if ( (*pMrfTul)[i]->vormid.Find(FSxSTR("sg n,"))!= -1 )
{
sgn=1; //* on leitud lihtsaim algvorm *
algv_lopp = null_lopp;
algv_vorm = sg_n;
}
else if ((*pMrfTul)[i]->vormid.Left(3) == FSxSTR("ma,"))
{
sgn=1; //* on leitud lihtsaim algvorm *
algv_lopp = lopp_ma;
algv_vorm = ma;
}
else if ( omastavanr(&((*pMrfTul)[i]->tyvi)) != -1 )
{
sgn=1; //* on leitud lihtsaim algvorm *
algv_lopp = null_lopp;
algv_vorm = sg_g;
}
else if (!sgn && (*pMrfTul)[i]->vormid.Find(FSxSTR("pl n,"))!= -1)
{
algv_lopp = lopp_d;
algv_vorm = pl_n;
// HJK 2008: igaks juhuks (kui eelnenud analüüsil on tehtud tyve asemel lemma)
if ( (*pMrfTul)[i]->tyvi.Right(1) == FSxSTR("d") ) // nt Madalmaad; votad lopust maha
(*pMrfTul)[i]->tyvi = (*pMrfTul)[i]->tyvi.Left((*pMrfTul)[i]->tyvi.GetLength()-1);
}
else if (!sgn &&
// null-lopp !!!
(*pMrfTul)[i]->sl == LIIK_VERB &&
((*pMrfTul)[i]->tyvi == FSxSTR("ei") ||
(*pMrfTul)[i]->tyvi == FSxSTR("\x00E4ra"))) // ei, ära puhuks
{
algv_lopp = null_lopp;
FSXSTRING tmpstr;
tmpstr = (*pMrfTul)[i]->vormid;
if (TaheHulgad::OnLopus(&tmpstr, FSxSTR(", ")))
tmpstr = tmpstr.Left(tmpstr.GetLength()-2);
//.........这里部分代码省略.........
示例3: if
//.........这里部分代码省略.........
if (tyyp == NUMBER)
tulemus->Add((const FSxCHAR *)(*S6na), FSxSTR("0"), FSxSTR(""), FSxSTR("N"), FSxSTR("?, "));
else if (tyyp == ARV || tyyp == KELL)
{
if (TaheHulgad::OnLopus(&s, FSxSTR(".")) && kriips == FSxSTR(""))
{
FSXSTRING nn;
// nn = s;
nn = (const FSxCHAR *)(s.Mid(0, s.GetLength()-1));
if (TaheHulgad::PoleMuudKui(&nn, &TaheHulgad::number)) // ainult nr.
tulemus->Add((const FSxCHAR *)(*S6na), FSxSTR("0"), FSxSTR(""), FSxSTR("O"), FSxSTR("?, "));
else
{
int kr, kr_pik;
kr_pik = 2;
kr = nn.Find(FSxSTR(".-"));
if (kr == -1)
kr = nn.Find(FSxSTR("./"));
if (kr == -1)
{
kr_pik = 1;
kr = nn.Find(FSxSTR("-"));
}
if (kr == -1)
kr = nn.Find(FSxSTR("/"));
if (kr == -1)
{
kr_pik = 3;
kr = nn.Find(FSxSTR("..."));
}
if (kr != -1)
{ // 11.-12. v�i 11-12.
FSXSTRING nn1, nn2;
nn1 = (const FSxCHAR *)(nn.Left(kr));
nn2 = (const FSxCHAR *)(nn.Mid(kr+kr_pik));
if (TaheHulgad::PoleMuudKui(&nn1, &(TaheHulgad::number))
&& TaheHulgad::PoleMuudKui(&nn2, &(TaheHulgad::number)))
tulemus->Add((const FSxCHAR *)(*S6na), FSxSTR("0"), FSxSTR(""), FSxSTR("O"), FSxSTR("?, "));
}
else
tulemus->Add((const FSxCHAR *)(*S6na), FSxSTR("0"), FSxSTR(""), FSxSTR("N"), FSxSTR("?, "));
}
}
else
tulemus->Add((const FSxCHAR *)(*S6na), FSxSTR("0"), FSxSTR(""), FSxSTR("N"), FSxSTR("?, "));
}
else if (tyyp == KRAAD || tyyp == KRAADC)
tulemus->Add((const FSxCHAR *)(*S6na), FSxSTR("0"), FSxSTR(""), FSxSTR("Y"), FSxSTR("?, "));
else if (tyyp == PROTSENT || tyyp == PARAGRAHV)
{
if (s_pik == 1) // %, paragrahv on lyhend
tulemus->Add((const FSxCHAR *)(*S6na), FSxSTR("0"), FSxSTR(""), FSxSTR("Y"), FSxSTR("?, "));
else
{
if (tyyp==PARAGRAHV && s_pik==2 && s[0]==s[1]) // parapara
tulemus->Add((const FSxCHAR *)(*S6na), FSxSTR("0"), FSxSTR(""), FSxSTR("Y"), FSxSTR("?, "));
else
{
if (s.FindOneOf((const FSxCHAR *)(TaheHulgad::number)) == -1) // polegi numbrit kuskil...
return ALL_RIGHT;
tulemus->Add((const FSxCHAR *)(*S6na), FSxSTR("0"), FSxSTR(""), FSxSTR("N"), FSxSTR("?, "));
}
}
}
return ALL_RIGHT;
}
示例4: kriips
//.........这里部分代码省略.........
kriips = FSxSTR("");
if (tyyp == LYHEND && kriips == FSxSTR("")) // ebakindel v�rk
{
if (s.GetLength()==1) // nt Arike
return ALL_RIGHT;
i = s.ReverseFind(FSxSTR("-"));
if (i == s.GetLength()-2)
return ALL_RIGHT; // nt CD-Romile
}
s.TrimRight(FSxSTR("-"));
if (s.GetLength()==0) // pole siin midagi vaadata
return ALL_RIGHT;
if (TaheHulgad::PoleMuudKui(&s, &TaheHulgad::number))
tyyp = NUMBER;
/* oletan, et on lyhend vm lubatud asi */
i = 1;
if (tyyp == LYHEND)
{
if(mrfFlags.Chk(MF_LYHREZH))
{
if (s.GetLength() == 1 || (!mrfFlags.Chk(MF_SPELL) && s.GetLength() < 7))
i = 1;
else
i = (dctLoend[3])[(FSxCHAR *)(const FSxCHAR *)s];
}
}
// *(S6na+k) = taht; /* taastan esialgse sona */
if (i==-1) /* pole lyhend */
return ALL_RIGHT;
if ((s.GetLength() > 1 && tyyp == LYHEND && (TaheHulgad::OnAlguses(&lopp, FSxSTR("la")) || TaheHulgad::OnAlguses(&lopp, FSxSTR("li"))) )
|| ((tyyp == NUMBER || tyyp == PROTSENT || tyyp == KRAAD) && TaheHulgad::OnAlguses(&lopp, FSxSTR("li"))) )
{
ne_lopp = (const FSxCHAR *)(lopp.Mid(2));
lali = (const FSxCHAR *)(lopp.Left(2));
vn = nLopud.otsi_ne_vorm((const FSxCHAR *)ne_lopp);
if (vn != NULL) /* ongi line lise ... voi lane lase ... */
{
vorminimi = vn;
vorminimi += FSxSTR(", ");
tmpsona = s;
if (kriips.GetLength() == 1 && !mrfFlags.Chk(MF_ALGV))
tmpsona += kriips;
else
tmpsona += FSxSTR("=");
tmpsona += lali;
if (mrfFlags.Chk(MF_ALGV) || vorminimi == FSxSTR("sg n, "))
tmpsona += FSxSTR("ne");
else
{
if (TaheHulgad::OnAlguses(&vorminimi, FSxSTR("pl")) || TaheHulgad::OnAlguses(&vorminimi, FSxSTR("sg p")))
tmpsona += FSxSTR("s");
else
tmpsona += FSxSTR("se");
}
if (ne_lopp == FSxSTR("ne") || ne_lopp == FSxSTR("se"))
tmplopp = FSxSTR("0");
else if (ne_lopp == FSxSTR("st"))
tmplopp = FSxSTR("t");
else if (TaheHulgad::OnAlguses(&vorminimi, FSxSTR("sg")))
tmplopp = (const FSxCHAR *)(ne_lopp.Mid(2));
else
tmplopp = (const FSxCHAR *)(ne_lopp.Mid(1));
if (lali == FSxSTR("la"))
tmpliik = FSxSTR("S");
else
tmpliik = FSxSTR("A");
示例5: main
int main(int argc, FSTCHAR **argv)
{
CPFSFile infile; /* viit sisendfailile */
CPFSFile outf, errf; /* viidad [email protected] */
CPFSFile lgrf; /* viit lõpugruppide failile LGR*/
FSXSTRING inbuf; /* toodeldav rida */
FSXSTRING outbuf; /* toodeldav rida */
CFSFileName fn_0, fn_1, fn_2;
int total, converted, unknown;
int k;
int kk, era;
FSXSTRING inbuf_era, inbuf_para_ind;
total = converted = unknown = 0;
if (argc != 4)
{
printf("pane argumendid taha !\n");
return EXIT_FAILURE;
}
else
{
fn_0=argv[1];
fn_1=argv[2];
fn_2=argv[3];
}
if (infile.Open(fn_0, FSTSTR("rb" )) == false ||
outf.Open( fn_1, FSTSTR("wb" )) == false ||
errf.Open( fn_2, FSTSTR("wb" )) == false ||
lgrf.Open( FSTSTR("lgr"), FSTSTR("ab+")) == false)
{
printf( "Can't open files\n" );
return EXIT_FAILURE;
}
loe_lgr( &lgrf ); /* loe lõpugrupid mällu */
tyvi[0].tyv = FSxSTR("");
for (total=0; infile.ReadLine(&inbuf)==true; total++)
{
era = inbuf.Find(FSxSTR("**"));
if (era != -1)
{
tyybinr = 1; /* lihtsalt et poleks 0; vaja tee_rida() jaoks */
k = inbuf.Find(FSWSTR("!\\"));
if ( k == -1) /* polegi indeksit; ei saa olla... */
sliik = FSWSTR("V");
else
{
sliik = (const FSWCHAR *)inbuf.Mid(k+2);
k = sliik.Find(FSWSTR("\\"));
if ( k == -1)
{
printf("\nsonaliik sassis ");
return EXIT_FAILURE;
}
sliik = (const FSWCHAR *)sliik.Left(k);
}
k = verbera( &inbuf );
if (!k) /* oli mingi viga */
{
unknown++;
nullityv(); /* et saaks järgmist parad. teha */
if ((errf.WriteString((const FSxCHAR *)inbuf, inbuf.GetLength())) == false)
{
printf("\ntulemuse kirjut. error-faili ebaõnnestus");
return EXIT_FAILURE;
}
continue; /* vt järgmisi ridu */
}
converted++;
lisa_lgr( &lgrf ); /* leiab igale selle parad tyvele lgr nr */
tee_rida(&inbuf, &outbuf); /* teeb rea nr|tyvi,lgr/tyvi,lgr... */
if ((outf.WriteString((const FSxCHAR *)outbuf, outbuf.GetLength())) == false)
{
printf("\ntulemuse kirjut. väljundfaili ebaõnnestus");
return EXIT_FAILURE;
}
nullityv(); /* et saaks järgmist parad. teha */
continue; /* vt järgmist kirjet */
}
kk = inbuf.Find(FSxSTR("&&"));
inbuf_para_ind = FSxSTR("");
if (kk != -1)
inbuf_para_ind = (const FSxCHAR *)inbuf.Mid(kk);
inbuf = (const FSxCHAR *)inbuf.Left(inbuf.GetLength()-inbuf_para_ind.GetLength());
k = era_ind( &inbuf );
if (!k) /* oli mingi viga */
{
unknown++;
if ((errf.WriteString((const FSxCHAR *)inbuf, inbuf.GetLength())) == false)
{
printf("\ntulemuse kirjut. error-faili ebaõnnestus");
return EXIT_FAILURE;
}
continue; /* vt järgmisi ridu */
}
k = era_tyvi( &inbuf );
if (!k) /* oli mingi viga */
//.........这里部分代码省略.........
示例6: if
int MORF0::chkhy2(MRFTULEMUSED *tulemus, FSXSTRING *S6nna, int maxtasand, int *tagasi)
{
int i, j;
int res=0;
char rezz, rezz1;
struct lisa {
const FSxCHAR *lubatud_lopp;
const FSxCHAR *lubatud_sl;
const int mitu_eemaldada;
const FSxCHAR *otsa_panna;
} lisakatse[3] = {
{ FSxSTR("0"), FSxSTR("A"), 2, FSxSTR("ne") }, /* +ne */
{ FSxSTR("t"), FSxSTR("AS"), 0, FSxSTR("t") }, /* is+t */
{ FSxSTR("d"), FSxSTR("AS"), 0, FSxSTR("d") } }; /* +d */
int katsenr;
const FSxCHAR *lubatud_liik;
int viimane, lopus_kriips;
int tmp;
int mitu;
int sobiv_an;
CVARIANTIDE_AHEL ctoo_variandid, csobivad_variandid;
FSXSTRING S6na = *S6nna;
int k;
FSXSTRING algus;
FSXSTRING kriips;
FSXSTRING lopp;
FSXSTRING pisialgus;
MRFTULEMUSED ette;
FSXSTRING ettestr;
k = S6na.Find((FSxCHAR)'-');
if (k == -1)
k = S6na.Find((FSxCHAR)'/');
if (k == -1)
return ALL_RIGHT; // ei sisalda '-' ega '/'
algus = S6na.Left(k);
kriips = S6na.Mid(k, 1);
lopp = S6na.Mid(k+1);
if (k==0 && kriips == FSxSTR("-") ) // -sona
{
if (lopp.GetLength()<1)
return ALL_RIGHT;
res = chkwrd(tulemus, &lopp, lopp.GetLength(), maxtasand, tagasi, KOIK_LIIGID/*MITTE_VERB*/);
if (res > ALL_RIGHT)
return res; /* viga! */
if (!tulemus->on_tulem())
{
FSXSTRING pisilopp;
pisilopp = lopp;
pisilopp.MakeLower();
res = chkwrd(tulemus, &pisilopp, pisilopp.GetLength(), maxtasand, tagasi, KOIK_LIIGID);
if (res > ALL_RIGHT)
return res; /* viga! */
}
if (maxtasand < 4) // soovitaja pärast HJK 10.06.2005
return ALL_RIGHT;
if (!tulemus->on_tulem()) /* polnud -sona */
{
*tagasi = 4;
res = chklyh4(tulemus, &lopp, lopp.GetLength()); /* nt. -E */
if (res > ALL_RIGHT)
return res; /* viga! */
}
return ALL_RIGHT;
}
if (maxtasand < 4) // soovitaja p�rast HJK 10.06.2005
return ALL_RIGHT;
if (S6na.GetLength() == 2 && k == 1 && kriips == FSxSTR("-") && TaheHulgad::eestitht.Find(S6na[0])!=-1) // a-
{
tulemus->Add( (const FSxCHAR *)algus, FSxSTR("0"), FSxSTR(""), FSxSTR("Y"), FSxSTR("?, ")); /* parema puudusel */
*tagasi = 4;
return ALL_RIGHT;
}
/* sona-sona-sona-sona... */
viimane = 0;
lopus_kriips = 0;
lopp = S6na;
rezz = mrfFlags.Chk(MF_ALGV); /* algvormi rezhiimi lipp */
rezz1 = mrfFlags.Chk(MF_GENE); /* gene rezhiimi lipp */
for (mitu=0 ;; mitu++)
{
MRFTULEMUSED ajutine_tulemus;
MRFTUL t;
sobiv_an = -1;
k = lopp.Find(kriips);
if ( k==-1 ) /* viimane sonaosa */
{
algus = lopp;
lopp = FSxSTR("");
viimane = 1;
}
else
{
algus = lopp.Left(k);
lopp = lopp.Mid(k+1);
if (lopp.GetLength()==0) // viimane sonaosa; sona-
{
viimane = 1;
lopus_kriips = 1;
//.........这里部分代码省略.........
示例7: Tmain
int Tmain(int argc, FSTCHAR **argv)
{
CPFSFile infile; /* viit sisendfailile */
CPFSFile outf, errf; /* viidad [email protected] */
CPFSFile lgrf; /* viit lõpugruppide failile LGR*/
FSXSTRING inbuf; /* toodeldav rida */
FSXSTRING outbuf; /* toodeldav rida */
CFSFileName fn0=argv[1];
CFSFileName fn1=argv[2];
CFSFileName fn2=argv[3];
CFSFileName fn3=FSTSTR("lgr");
int total, converted, unknown;
int k;
int kk, era, k2, k3;
FSXSTRING inbuf_era, inbuf_para_ind;
converted = unknown = 0;
if (argc != 4)
{
printf("kirjuta paras arv parameetreid või keri poti laadale\n");
return EXIT_FAILURE;
}
if (infile.Open( fn0, FSTSTR("rb" )) == false ||
outf.Open( fn1, FSTSTR("wb" )) == false ||
errf.Open( fn2, FSTSTR("wb" )) == false ||
lgrf.Open( fn3, FSTSTR("ab+")) == false)
{
printf( "Can't open files\n" ); // fopen
exit( 1 );
}
loe_lgr( &lgrf ); /* loe lõpugrupid mällu */
tyvi[0].tyv = FSxSTR("");
for (total=0; infile.ReadLine(&inbuf)==true; total++)
{
kk = inbuf.Find(FSxSTR(".0!"));
if (kk!=-1) /* on 0-muuttyybi sõna */
{
tyybinr = 1; /* lihtsalt et poleks 0 */
k2 = inbuf.Find(FSxSTR("!\\"));
if (k2!=-1)
{
FSXSTRING tmp;
tmp = (const FSxCHAR *)inbuf.Mid(k2+2);
k3 = tmp.Find(FSxSTR("\\"));
if (k3!=-1)
{
sliik = (const FSxCHAR *)tmp.Left(k3);
}
}
if (k2==-1 || k3==-1)
{
unknown++;
if ((errf.WriteString((const FSxCHAR *)inbuf, inbuf.GetLength())) == false)
{
printf("\ntulemuse kirjut. error-faili ebaõnnestus");
return EXIT_FAILURE;
}
continue; /* vt järgmisi ridu */
}
k = nomnul( &inbuf );
if (!k)
{
unknown++;
if ((errf.WriteString((const FSxCHAR *)inbuf, inbuf.GetLength())) == false)
{
printf("\ntulemuse kirjut. error-faili ebaõnnestus");
return EXIT_FAILURE;
}
continue; /* vt järgmisi ridu */
}
converted++;
lisa_lgr( &lgrf ); /* leiab igale selle parad tyvele lgr nr */
tee_rida(&inbuf, &outbuf); /* teeb rea nr|tyvi,lgr/tyvi,lgr... */
if ((outf.WriteString((const FSxCHAR *)outbuf, outbuf.GetLength())) == false)
{
printf("\ntulemuse kirjut. väljundfaili ebaõnnestus");
return EXIT_FAILURE;
}
nullityv(); /* et saaks järgmist parad. teha */
continue; /* et ei vaataks nii, nagu 'norm' ridu */
}
era = inbuf.Find(FSxSTR("**"));
inbuf_era = FSxSTR("");
if (era != -1)
inbuf_era = (const FSxCHAR *)inbuf.Mid(era-1);
inbuf = (const FSxCHAR *)inbuf.Left(inbuf.GetLength()-inbuf_era.GetLength());
kk = inbuf.Find(FSxSTR("&&"));
inbuf_para_ind = FSxSTR("");
if (kk != -1)
inbuf_para_ind = (const FSxCHAR *)inbuf.Mid(kk);
inbuf = (const FSxCHAR *)inbuf.Left(inbuf.GetLength()-inbuf_para_ind.GetLength());
k = era_ind( &inbuf );
if (!k) /* oli mingi viga */
{
unknown++;
//.........这里部分代码省略.........