Lines Matching refs:spho
247 spho_subobj_t * spho; in sphoReset() local
253 spho = (spho_subobj_t *) this->subObj; in sphoReset()
255 spho->curFst = 0; in sphoReset()
258 spho->procState = SPHO_STEPSTATE_INIT; in sphoReset()
259 spho->needMoreInput = TRUE; in sphoReset()
260 spho->suppressParseWordBound = FALSE; in sphoReset()
261 spho->suppressRecombWordBound = FALSE; in sphoReset()
262 spho->breakPending = FALSE; in sphoReset()
263 spho->force = 0; in sphoReset()
264 spho->sentenceStarted = 0; in sphoReset()
268 spho->headxBufSize = SPHO_MAXNR_HEADX; in sphoReset()
269 spho->headxReadPos = 0; in sphoReset()
270 spho->headxWritePos = 0; in sphoReset()
272 spho->cbufWritePos = 0; in sphoReset()
273 spho->cbufBufSize = SPHO_MAXSIZE_CBUF; in sphoReset()
276 spho->phonBuf = spho->phonBufA; in sphoReset()
277 spho->phonBufOut = spho->phonBufB; in sphoReset()
278 spho->phonReadPos = 0; in sphoReset()
281 spho->activeStartPos = 0; in sphoReset()
282 spho->penultima = SPHO_POS_INVALID; in sphoReset()
283 spho->activeEndPos = SPHO_POS_INVALID; in sphoReset()
292 spho_subobj_t * spho; in sphoInitialize() local
304 spho = (spho_subobj_t *) this->subObj; in sphoInitialize()
306 spho->numFsts = 0; in sphoInitialize()
308 spho->curFst = 0; in sphoInitialize()
313 spho->fst[spho->numFsts++] = fst; in sphoInitialize()
316 spho->fixedIds = picoktab_getFixedIds(this->voice->kbArray[PICOKNOW_KBID_FIXED_IDS]); in sphoInitialize()
317 spho->phones = picoktab_getPhones(this->voice->kbArray[PICOKNOW_KBID_TAB_PHONES]); in sphoInitialize()
319 spho->syllSepId = picoktab_getSyllboundID(spho->phones); in sphoInitialize()
320 spho->primStressId = picoktab_getPrimstressID(spho->phones); in sphoInitialize()
321 spho->secondStressId = picoktab_getSecstressID(spho->phones); in sphoInitialize()
323 PICODBG_DEBUG(("got %i fsts", spho->numFsts)); in sphoInitialize()
345 spho_subobj_t * spho; in sphoSubObjDeallocate() local
347 spho = (spho_subobj_t *) this->subObj; in sphoSubObjDeallocate()
351 spho = (spho_subobj_t *) (this->subObj); in sphoSubObjDeallocate()
352 picotrns_deallocate_alt_desc_buf(spho->common->mm,&spho->altDescBuf); in sphoSubObjDeallocate()
363 spho_subobj_t * spho; in picospho_newSentPhoUnit() local
380 spho = (spho_subobj_t *) this->subObj; in picospho_newSentPhoUnit()
382 spho->common = this->common; in picospho_newSentPhoUnit()
385 spho->outBufSize = PICODATA_BUFSIZE_DEFAULT; in picospho_newSentPhoUnit()
388 …spho->altDescBuf = picotrns_allocate_alt_desc_buf(spho->common->mm, SPHO_MAX_ALTDESC_SIZE, &spho->… in picospho_newSentPhoUnit()
389 if (NULL == spho->altDescBuf) { in picospho_newSentPhoUnit()
390 picotrns_deallocate_alt_desc_buf(spho->common->mm,&spho->altDescBuf); in picospho_newSentPhoUnit()
391 picoos_emRaiseException(spho->common->em,PICO_EXC_OUT_OF_MEM, NULL,NULL); in picospho_newSentPhoUnit()
407 static picoos_int16 shift_range_left_1(spho_subobj_t *spho, picoos_int16 * from, picoos_int16 to) in shift_range_left_1() argument
423 writePos = spho->headxWritePos; in shift_range_left_1()
424 c_i = spho->headx[to].cind; in shift_range_left_1()
426 c_j = spho->headx[j].cind; in shift_range_left_1()
428 c_j = spho->cbufWritePos; in shift_range_left_1()
431 c_writePos = spho->cbufWritePos; in shift_range_left_1()
444 spho->cbuf[c_i++] = spho->cbuf[c_j++]; in shift_range_left_1()
448 spho->headx[j].cind -= c_diff; in shift_range_left_1()
449 spho->headx[i++] = spho->headx[j++]; in shift_range_left_1()
451 spho->headxWritePos -= diff; in shift_range_left_1()
453 spho->cbufWritePos -= c_diff; in shift_range_left_1()
456 … "readPos,WritePos are now [%i,%i[, returning shift amount %i",*from, spho->headxWritePos, diff in shift_range_left_1()
461 static pico_status_t sphoAddPhoneme(register spho_subobj_t *spho, picoos_int16 pos, picoos_int16 sy… in sphoAddPhoneme() argument
465 …PICODBG_TRACE(("adding %i/%i (%c on plane %i) at phonBuf[%i]",pos,sym,unshifted,plane,spho->phonWr… in sphoAddPhoneme()
466 if (2* PICOTRNS_MAX_NUM_POSSYM <= spho->phonWritePos) { in sphoAddPhoneme()
471 spho->phonBuf[spho->phonWritePos].pos = pos; in sphoAddPhoneme()
472 spho->phonBuf[spho->phonWritePos].sym = sym; in sphoAddPhoneme()
473 spho->phonWritePos++; in sphoAddPhoneme()
478 static pico_status_t sphoAddStartPhoneme(register spho_subobj_t *spho) { in sphoAddStartPhoneme() argument
479 return sphoAddPhoneme(spho, PICOTRNS_POS_IGNORE, in sphoAddStartPhoneme()
480 (PICOKFST_PLANE_INTERN << 8) + spho->fixedIds->phonStartId); in sphoAddStartPhoneme()
483 static pico_status_t sphoAddTermPhonemes(register spho_subobj_t *spho, picoos_uint16 pos) { in sphoAddTermPhonemes() argument
484 return sphoAddPhoneme(spho, pos, in sphoAddTermPhonemes()
486 && sphoAddPhoneme(spho, PICOTRNS_POS_IGNORE, in sphoAddTermPhonemes()
487 (PICOKFST_PLANE_INTERN << 8) + spho->fixedIds->phonTermId); in sphoAddTermPhonemes()
491 static picoos_uint16 sphoGetSylAccent(register spho_subobj_t *spho, in sphoGetSylAccent() argument
496 spho = spho; /* avoid warning "var not used in this function"*/ in sphoGetSylAccent()
524 register spho_subobj_t *spho, picoos_uint16 pos, in sphoExtractPhonemes() argument
547 oldPos = spho->phonWritePos; in sphoExtractPhonemes()
549 head = &(spho->headx[pos].head); in sphoExtractPhonemes()
550 content = spho->cbuf + spho->headx[pos].cind; in sphoExtractPhonemes()
564 rv = sphoAddPhoneme(spho,pos,fstSymbol); in sphoExtractPhonemes()
577 rv = sphoAddPhoneme(spho,pos,fstSymbol); in sphoExtractPhonemes()
588 curPos = spho->phonWritePos; in sphoExtractPhonemes()
592 if (spho->primStressId == content[i]) { in sphoExtractPhonemes()
596 } else if (spho->secondStressId == content[i]) { in sphoExtractPhonemes()
600 } else if (spho->syllSepId == content[i]) { in sphoExtractPhonemes()
602 rv = sphoAddPhoneme(spho, pos, fstSymbol); in sphoExtractPhonemes()
604 fstSymbol = sphoGetSylAccent(spho,head->info2,curStress); in sphoExtractPhonemes()
608 rv = sphoAddPhoneme(spho,pos,fstSymbol); in sphoExtractPhonemes()
619 rv = sphoAddPhoneme(spho,pos,fstSymbol); in sphoExtractPhonemes()
627 rv = sphoAddPhoneme(spho,pos,fstSymbol); in sphoExtractPhonemes()
628 fstSymbol = sphoGetSylAccent(spho,head->info2,curStress); in sphoExtractPhonemes()
631 rv = sphoAddPhoneme(spho,pos,fstSymbol); in sphoExtractPhonemes()
636 j=spho->phonWritePos-1; in sphoExtractPhonemes()
638 tmpPosSym.pos = spho->phonBuf[i].pos; in sphoExtractPhonemes()
639 tmpPosSym.sym = spho->phonBuf[i].sym; in sphoExtractPhonemes()
640 spho->phonBuf[i].pos = spho->phonBuf[j].pos; in sphoExtractPhonemes()
641 spho->phonBuf[i].sym = spho->phonBuf[j].sym; in sphoExtractPhonemes()
642 spho->phonBuf[j].pos = tmpPosSym.pos; in sphoExtractPhonemes()
643 spho->phonBuf[j].sym = tmpPosSym.sym; in sphoExtractPhonemes()
651 rv = sphoAddPhoneme(spho,pos,fstSymbol); in sphoExtractPhonemes()
660 spho->phonWritePos = oldPos; in sphoExtractPhonemes()
682 static pico_status_t getNextPosSym(spho_subobj_t * spho, picoos_int16 * pos, picoos_int16 * sym, in getNextPosSym() argument
685 …while ((spho->phonReadPos < spho->phonWritePos) && (PICOTRNS_POS_IGNORE == spho->phonBuf[spho->pho… in getNextPosSym()
686 …PICODBG_DEBUG(("ignoring phone at spho->phonBuf[%i] because it has pos==IGNORE",spho->phonReadPos)… in getNextPosSym()
687 spho->phonReadPos++; in getNextPosSym()
689 if ((spho->phonReadPos < spho->phonWritePos)) { in getNextPosSym()
690 *pos = spho->phonBuf[spho->phonReadPos].pos; in getNextPosSym()
692 *sym = spho->phonBuf[spho->phonReadPos++].sym; in getNextPosSym()
806 static void putSideBoundToOutput(spho_subobj_t * spho) in putSideBoundToOutput() argument
816 ohead.info1 = spho->headx[spho->outReadPos].boundstrength; in putSideBoundToOutput()
817 ohead.info2 = spho->headx[spho->outReadPos].phrasetype; in putSideBoundToOutput()
818 sildur = spho->headx[spho->outReadPos].sildur; in putSideBoundToOutput()
832 spho->outBuf, spho->outBufSize, &clen); in putSideBoundToOutput()
834 spho->headx[spho->outReadPos].boundstrength = 0; in putSideBoundToOutput()
850 static void setSideBound(spho_subobj_t * spho, picoos_uint8 orig_strength, picoos_uint8 orig_type, … in setSideBound() argument
860 spho->headx[spho->outReadPos].boundstrength = strength; in setSideBound()
861 spho->headx[spho->outReadPos].sildur = -1; in setSideBound()
862 …ength to fst-suggested value %c (was %c)",strength, spho->headx[spho->outReadPos].boundstrength, s… in setSideBound()
866 if (spho->breakPending) { in setSideBound()
870 …strength = breakModifiedBoundStrength(strength, spho->breakTime, (PICODATA_ITEMINFO1_BOUND_PHR1 ==… in setSideBound()
871 …imposed value %c (was %c) and time to %i",strength, spho->headx[spho->outReadPos].boundstrength, s… in setSideBound()
872 spho->headx[spho->outReadPos].boundstrength = strength; in setSideBound()
873 spho->headx[spho->outReadPos].sildur = spho->breakTime; in setSideBound()
874 spho->breakPending = FALSE; in setSideBound()
876 if (spho->headx[spho->outReadPos].boundstrength) { in setSideBound()
886 spho->lastPhraseType = orig_type; in setSideBound()
888 if (spho->activeStartPos <= spho->lastPhraseBoundPos) { in setSideBound()
894 spho->headx[spho->lastPhraseBoundPos].phrasetype in setSideBound()
898 spho->lastPhraseBoundPos = spho->outReadPos; in setSideBound()
899 spho->headx[spho->lastPhraseBoundPos].phrasetype in setSideBound()
900 = spho->lastPhraseType; in setSideBound()
903 spho->headx[spho->outReadPos].phrasetype = PICODATA_ITEMINFO2_NA; in setSideBound()
905 spho->lastPhraseType = orig_type; in setSideBound()
906 if (spho->activeStartPos <= spho->lastPhraseBoundPos) { in setSideBound()
908 spho->headx[spho->lastPhraseBoundPos].phrasetype in setSideBound()
909 = spho->lastPhraseType; in setSideBound()
926 register spho_subobj_t *spho; in sphoStep() local
953 spho = (spho_subobj_t *) this->subObj; in sphoStep()
960 spho->procState, spho->headxReadPos, spho->headxWritePos)); in sphoStep()
962 switch (spho->procState) { in sphoStep()
970 spho->penultima = SPHO_POS_INVALID; in sphoStep()
971 spho->activeEndPos = SPHO_POS_INVALID; in sphoStep()
972 spho->headxReadPos = 0; in sphoStep()
973 spho->phonReadPos = 0; in sphoStep()
974 spho->phonWritePos = 0; in sphoStep()
975 spho->lastPhraseType = PICODATA_ITEMINFO2_NA; in sphoStep()
976 spho->lastPhraseBoundPos = -1; in sphoStep()
978 spho->procState = SPHO_STEPSTATE_COLLECT; in sphoStep()
991 remHeadxSize = spho->headxBufSize - spho->headxWritePos; in sphoStep()
992 remCbufSize = spho->cbufBufSize - spho->cbufWritePos; in sphoStep()
993 curPos = spho->headxWritePos; in sphoStep()
995 …PICODBG_DEBUG(("COLLECT getting item at headxWritePos %i (remaining %i)",spho->headxWritePos, remH… in sphoStep()
996 rv = picodata_cbGetItem(this->cbIn, spho->tmpbuf, PICODATA_MAX_ITEMSIZE, &blen); in sphoStep()
998 rv = picodata_get_itemparts(spho->tmpbuf, in sphoStep()
999 … PICODATA_MAX_ITEMSIZE, &(spho->headx[spho->headxWritePos].head), in sphoStep()
1000 … &(spho->cbuf[spho->cbufWritePos]), remCbufSize, &blen); in sphoStep()
1002 spho->headx[spho->headxWritePos].cind = spho->cbufWritePos; in sphoStep()
1003 spho->headx[spho->headxWritePos].boundstrength = 0; in sphoStep()
1004 spho->headxWritePos++; in sphoStep()
1006 spho->cbufWritePos += blen; in sphoStep()
1024 if (curPos < spho->headxWritePos) { /* we did get some new items */ in sphoStep()
1026 spho->headxWritePos - curPos)); in sphoStep()
1027 spho->needMoreInput = FALSE; in sphoStep()
1029 if (spho->needMoreInput) { /* not enough items to proceed */ in sphoStep()
1033 spho->procState = SPHO_STEPSTATE_PROCESS_PARSE; in sphoStep()
1039 if (spho->needMoreInput) { /* forced output because we can't get more data */ in sphoStep()
1040 spho->needMoreInput = FALSE; in sphoStep()
1041 spho->force = TRUE; in sphoStep()
1043 spho->procState = SPHO_STEPSTATE_PROCESS_PARSE; in sphoStep()
1063 if (spho->headxReadPos >= spho->headxWritePos) { in sphoStep()
1065 if (spho->force) { in sphoStep()
1069 spho->force = FALSE; in sphoStep()
1070 if (SPHO_POS_INVALID == spho->activeEndPos) { in sphoStep()
1071 spho->activeEndPos = spho->headxReadPos; in sphoStep()
1073 spho->procState = SPHO_STEPSTATE_PROCESS_TRANSDUCE; in sphoStep()
1077 spho->needMoreInput = TRUE; in sphoStep()
1078 spho->procState = SPHO_STEPSTATE_COLLECT; in sphoStep()
1083 ihead = spho->headx[spho->headxReadPos].head; in sphoStep()
1084 icontent = spho->cbuf + spho->headx[spho->headxReadPos].cind; in sphoStep()
1094 if (spho->sentenceStarted) { in sphoStep()
1097 spho->sentenceStarted = 0; in sphoStep()
1100 sphoAddTermPhonemes(spho, spho->headxReadPos); in sphoStep()
1101 spho->headxReadPos++; in sphoStep()
1102 spho->activeEndPos = spho->headxReadPos; in sphoStep()
1106 spho->penultima = spho->activeEndPos; in sphoStep()
1109 spho->procState = SPHO_STEPSTATE_PROCESS_TRANSDUCE; in sphoStep()
1121 spho->outBuf, spho->outBufSize, in sphoStep()
1124 spho->headxReadPos++; in sphoStep()
1125 spho->activeEndPos = spho->headxReadPos; in sphoStep()
1126 spho->penultima = SPHO_POS_INVALID; in sphoStep()
1127 spho->feedFollowState = SPHO_STEPSTATE_SHIFT; in sphoStep()
1128 spho->procState = SPHO_STEPSTATE_FEED; in sphoStep()
1133 spho->headxReadPos++; in sphoStep()
1134 spho->activeEndPos = spho->headxReadPos; in sphoStep()
1135 spho->penultima = SPHO_POS_INVALID; in sphoStep()
1143 sphoAddStartPhoneme(spho); in sphoStep()
1145 spho->sentenceStarted = 1; in sphoStep()
1153 rv = sphoExtractPhonemes(this, spho, spho->headxReadPos, in sphoStep()
1155 &spho->suppressParseWordBound); in sphoStep()
1160 … if ((spho->activeStartPos <= spho->headxReadPos) && ((PICODATA_ITEM_WORDPHON == ihead.type) in sphoStep()
1161 || (SPHO_POS_INVALID == spho->activeEndPos) in sphoStep()
1162 … || (PICODATA_ITEM_BOUND == spho->headx[spho->activeEndPos].head.type))) { in sphoStep()
1164 … spho->penultima,spho->activeEndPos,spho->activeEndPos,spho->headxReadPos)); in sphoStep()
1165 spho->penultima = spho->activeEndPos; in sphoStep()
1166 spho->activeEndPos = spho->headxReadPos; in sphoStep()
1173 …ction with overflow, number of phonemes in phonBuf: %i; forced to TRANSDUCE", spho->phonWritePos)); in sphoStep()
1174 … if ((SPHO_POS_INVALID == spho->activeEndPos) || (spho->activeStartPos == spho->activeEndPos)) { in sphoStep()
1175 spho->activeEndPos = spho->headxReadPos; in sphoStep()
1177 spho->procState = SPHO_STEPSTATE_PROCESS_TRANSDUCE; in sphoStep()
1189 … PICODBG_INFO(("PARSE going to next item: %i -> %i",spho->headxReadPos, spho->headxReadPos + 1)); in sphoStep()
1190 spho->headxReadPos++; in sphoStep()
1198 PICODBG_DEBUG(("TRANSDUCE (%i-th of %i fsts",spho->curFst+1, spho->numFsts)); in sphoStep()
1201 if (spho->curFst >= spho->numFsts) { in sphoStep()
1207 …PICOTRNS_PRINTSYMSEQ(this->voice->kbArray[PICOKNOW_KBID_DBG], spho->phonBufOut, spho->phonWritePos… in sphoStep()
1213 spho->curFst = 0; in sphoStep()
1215 spho->outReadPos = 0; in sphoStep()
1216 spho->phonReadPos = 0; in sphoStep()
1218 spho->procState = SPHO_STEPSTATE_PROCESS_BOUNDS; in sphoStep()
1230 … PICOTRNS_PRINTSYMSEQ(this->voice->kbArray[PICOKNOW_KBID_DBG], spho->phonBuf, spho->phonWritePos); in sphoStep()
1234 rv = picotrns_transduce(spho->fst[spho->curFst], FALSE, in sphoStep()
1235 picotrns_printSolution, spho->phonBuf, spho->phonWritePos, spho->phonBufOut, in sphoStep()
1236 &spho->phonWritePos, in sphoStep()
1237 4*PICOTRNS_MAX_NUM_POSSYM, spho->altDescBuf, in sphoStep()
1238 spho->maxAltDescLen, &nrSteps); in sphoStep()
1243 … PICODBG_INFO_MSG(("result of transduction: (output symbols: %i)", spho->phonWritePos)); in sphoStep()
1244 …PICOTRNS_PRINTSYMSEQ(this->voice->kbArray[PICOKNOW_KBID_DBG], spho->phonBufOut, spho->phonWritePos… in sphoStep()
1254 picotrns_eliminate_epsilons(spho->phonBufOut, spho->phonWritePos, spho->phonBuf, in sphoStep()
1255 &spho->phonWritePos,4*PICOTRNS_MAX_NUM_POSSYM); in sphoStep()
1257 spho->curFst++; in sphoStep()
1271 spho->suppressRecombWordBound = FALSE; in sphoStep()
1272 while (spho->outReadPos < spho->activeStartPos) { in sphoStep()
1274 ihead = spho->headx[spho->outReadPos].head; in sphoStep()
1276 …PICODBG_INFO(("in position %i, looking at item %s",spho->outReadPos,picodata_head_to_string(&ihead… in sphoStep()
1278 spho->suppressRecombWordBound = TRUE; in sphoStep()
1280 spho->suppressRecombWordBound = FALSE; in sphoStep()
1282 spho->outReadPos++; in sphoStep()
1287 spho->phonReadPos = 0; in sphoStep()
1288 while (SPHO_POSSYM_OK == (rv = getNextPosSym(spho, &pos, &sym, in sphoStep()
1289 spho->activeStartPos))) { in sphoStep()
1298 while (spho->outReadPos < spho->activeEndPos) { in sphoStep()
1301 ihead = spho->headx[spho->outReadPos].head; in sphoStep()
1302 icontent = spho->cbuf + spho->headx[spho->outReadPos].cind; in sphoStep()
1303 nextInPos = spho->outReadPos + 1; in sphoStep()
1305 …PICODBG_INFO(("in position %i, looking at item %s",spho->outReadPos,picodata_head_to_string(&ihead… in sphoStep()
1309 && (!spho->suppressRecombWordBound))) { in sphoStep()
1315 spho->suppressRecombWordBound = TRUE; in sphoStep()
1323 rv = getNextPosSym(spho, &pos, &sym, nextInPos); in sphoStep()
1334 setSideBound(spho, orig_strength, orig_type, in sphoStep()
1342 if (spho->breakPending) { in sphoStep()
1343 spho->breakTime += time; in sphoStep()
1345 spho->breakTime = time; in sphoStep()
1346 spho->breakPending = TRUE; in sphoStep()
1350 if (!spho->breakPending || (spho->breakTime <= 0)) { in sphoStep()
1351 spho->breakTime = SPHO_SMALLEST_SIL_DUR; in sphoStep()
1352 spho->breakPending = TRUE; in sphoStep()
1354 setSideBound(spho, PICODATA_ITEMINFO1_NA, in sphoStep()
1357 spho->breakTime = SPHO_SMALLEST_SIL_DUR; in sphoStep()
1358 spho->breakPending = TRUE; in sphoStep()
1361 if (breakBefore &&(!spho->breakPending || (spho->breakTime <= 0))) { in sphoStep()
1362 spho->breakTime = SPHO_SMALLEST_SIL_DUR; in sphoStep()
1363 spho->breakPending = TRUE; in sphoStep()
1365 setSideBound(spho, PICODATA_ITEMINFO1_NA, in sphoStep()
1369 spho->breakTime = SPHO_SMALLEST_SIL_DUR; in sphoStep()
1370 spho->breakPending = TRUE; in sphoStep()
1373 spho->suppressRecombWordBound = FALSE; in sphoStep()
1378 while (SPHO_POSSYM_OK == (rv = getNextPosSym(spho, &pos, in sphoStep()
1382 spho->outReadPos++; in sphoStep()
1386 spho->outReadPos = 0; in sphoStep()
1387 spho->phonReadPos = 0; in sphoStep()
1388 spho->suppressRecombWordBound = FALSE; in sphoStep()
1390 spho->procState = SPHO_STEPSTATE_PROCESS_RECOMB; in sphoStep()
1403 spho->feedFollowState = SPHO_STEPSTATE_PROCESS_RECOMB; in sphoStep()
1406 if (spho->outReadPos >= spho->activeEndPos) { in sphoStep()
1407 PICODBG_DEBUG(("RECOMB reached active region's end at %i",spho->outReadPos)); in sphoStep()
1408 spho->procState = SPHO_STEPSTATE_SHIFT; in sphoStep()
1413 ihead = spho->headx[spho->outReadPos].head; in sphoStep()
1414 icontent = spho->cbuf + spho->headx[spho->outReadPos].cind; in sphoStep()
1418 nextInPos = spho->outReadPos + 1; in sphoStep()
1420 PICODBG_DEBUG(("RECOMB treating item in headx at pos %i",spho->outReadPos)); in sphoStep()
1421 … if (nextInPos <= spho->activeStartPos) { /* we're in the (passive) left context. Just skip it */ in sphoStep()
1422 …DBG_DEBUG(("RECOMB skipping item in the left context (%i <= %i)",nextInPos, spho->activeStartPos)); in sphoStep()
1424 spho->suppressRecombWordBound = 1; in sphoStep()
1426 spho->suppressRecombWordBound = 0; in sphoStep()
1430 while (SPHO_POSSYM_OK == (rv = getNextPosSym(spho,&pos,&sym,nextInPos))) { in sphoStep()
1437 spho->outReadPos = nextInPos; in sphoStep()
1439 if (spho->headx[spho->outReadPos].boundstrength) { in sphoStep()
1442 putSideBoundToOutput(spho); in sphoStep()
1444 spho->headx[spho->outReadPos].boundstrength = 0; in sphoStep()
1446 spho->procState = SPHO_STEPSTATE_FEED; in sphoStep()
1451 rv = getNextPosSym(spho, &pos, &sym, nextInPos); in sphoStep()
1462 … spho->suppressRecombWordBound = TRUE; /* if word following, don't need word boundary */ in sphoStep()
1464 spho->outReadPos = nextInPos; in sphoStep()
1468 spho->wordStarted = TRUE; in sphoStep()
1470 if (spho->suppressRecombWordBound) { in sphoStep()
1472 spho->suppressRecombWordBound = FALSE; in sphoStep()
1475 rv = getNextPosSym(spho, &pos, &sym, nextInPos); in sphoStep()
1482 spho->procState = SPHO_STEPSTATE_PROCESS_SYL; in sphoStep()
1486 … PICODBG_DEBUG(("RECOMB consuming item from inBuf %i -> %i",spho->outReadPos, nextInPos)); in sphoStep()
1487 spho->outReadPos = nextInPos; in sphoStep()
1493 spho->outBuf, spho->outBufSize, &clen); in sphoStep()
1494 … PICODBG_DEBUG(("RECOMB consuming item from inBuf %i -> %i",spho->outReadPos, nextInPos)); in sphoStep()
1495 spho->outReadPos = nextInPos; in sphoStep()
1497 spho->procState = SPHO_STEPSTATE_FEED; in sphoStep()
1513 spho->feedFollowState = SPHO_STEPSTATE_PROCESS_SYL; in sphoStep()
1516 ihead = spho->headx[spho->outReadPos].head; in sphoStep()
1517 icontent = spho->cbuf + spho->headx[spho->outReadPos].cind; in sphoStep()
1518 nextInPos = spho->outReadPos + 1; in sphoStep()
1519 PICODBG_DEBUG(("SYL (1) treating item in headx at pos %i",spho->outReadPos)); in sphoStep()
1523 … (%i,%i) (outReadPos=%i)", spho->phonReadPos, spho->phonBuf[spho->phonReadPos].pos, spho->phonBuf[… in sphoStep()
1524 rv = getNextPosSym(spho,&pos,&sym,nextInPos); in sphoStep()
1535 … PICODBG_DEBUG(("SYL (2) treating item in inBuf range [%i,%i[",spho->outReadPos,nextInPos)); in sphoStep()
1536 rv = getNextPosSym(spho,&pos,&sym,nextInPos); in sphoStep()
1541 if (spho->wordStarted) { in sphoStep()
1542 spho->wordStarted = FALSE; in sphoStep()
1552 … PICODBG_DEBUG(("SYL (3) treating item in inBuf range [%i,%i[",spho->outReadPos,nextInPos)); in sphoStep()
1555 + spho->syllSepId; in sphoStep()
1557 spho->sylWritePos = 0; in sphoStep()
1558 … while (SPHO_POSSYM_OK == (rv = getNextPosSym(spho,&pos,&sym,nextInPos)) && (sym != sylsym)) { in sphoStep()
1559 spho->sylBuf[spho->sylWritePos++] = picotrns_unplane(sym, &plane); in sphoStep()
1564 … PICODBG_DEBUG(("SYL (4) treating item in inBuf range [%i,%i[",spho->outReadPos,nextInPos)); in sphoStep()
1565 ohead.len = spho->sylWritePos; in sphoStep()
1571 spho->outReadPos = nextInPos; /* advance to next item */ in sphoStep()
1572 … spho->feedFollowState = SPHO_STEPSTATE_PROCESS_RECOMB; /* go to RECOMB after feed */ in sphoStep()
1576 … PICODBG_DEBUG(("SYL (5) treating item in inBuf range [%i,%i[",spho->outReadPos,nextInPos)); in sphoStep()
1580 picodata_put_itemparts(&ohead, spho->sylBuf, in sphoStep()
1581 PICODATA_BUFSIZE_DEFAULT, spho->outBuf, in sphoStep()
1582 spho->outBufSize, &clen); in sphoStep()
1584 spho->procState = SPHO_STEPSTATE_FEED; in sphoStep()
1586 spho->procState = spho->feedFollowState; in sphoStep()
1600 rv = picodata_cbPutItem(this->cbOut, spho->outBuf, in sphoStep()
1601 spho->outBufSize, &clen); in sphoStep()
1605 spho->outBuf, spho->outBufSize); in sphoStep()
1613 spho->procState = spho->feedFollowState; in sphoStep()
1614 PICODBG_DEBUG(("FEED ok, going back to procState %i", spho->procState)); in sphoStep()
1618 spho->procState = spho->feedFollowState; in sphoStep()
1635 if (spho->penultima != SPHO_POS_INVALID) { in sphoStep()
1640 spho->penultima)); in sphoStep()
1641 shift = shift_range_left_1(spho, &spho->penultima, 0); in sphoStep()
1646 spho->activeStartPos = spho->activeEndPos in sphoStep()
1648 spho->lastPhraseBoundPos -= shift; in sphoStep()
1649 spho->suppressParseWordBound = FALSE; in sphoStep()
1650 spho->suppressRecombWordBound = FALSE; in sphoStep()
1655 if (spho->activeStartPos == spho->activeEndPos) { in sphoStep()
1657 spho->activeStartPos = 0; in sphoStep()
1659 lastPhraseBoundActive = (spho->lastPhraseBoundPos >= spho->activeStartPos); in sphoStep()
1662 spho->activeEndPos, spho->activeStartPos)); in sphoStep()
1663 shift = shift_range_left_1(spho, &spho->activeEndPos, spho->activeStartPos); in sphoStep()
1669 spho->lastPhraseBoundPos -= shift; in sphoStep()
1673 spho->procState = SPHO_STEPSTATE_INIT; in sphoStep()