Example #1
0
void compare_per_run()
{
	int i, len;
	char utf8buf_expect[16];
	char utf8buf_commit[16];
	printf( "Expected:  %s", expect_string_buf );
	printf( "Committed: ");

	tested_word_count += (len = ueStrLen( expect_string_buf ) - 1);
		/* omit the suffix character */
	for ( i = 0; i < len; i++ ) {
		ueStrNCpy( utf8buf_expect,
		           ueStrSeek( expect_string_buf, i ),
			   1, STRNCPY_CLOSE );
		ueStrNCpy( utf8buf_commit,
		           ueStrSeek( commit_string_buf, i ),
			   1, STRNCPY_CLOSE );
		if ( ! strcmp( utf8buf_expect, utf8buf_commit ) )
			printf( "%s", utf8buf_commit );
		else {
			printf( "\033[44;37m%s\033[m", utf8buf_commit );
			failed_word_count++;
		}
	}
	memset( commit_string_buf, 0, MAXLEN );
	printf( "\n\n" );
}
Example #2
0
/* kpchen said, record is the index array of interval */
static void OutputRecordStr(
		ChewingData *pgdata,
		char *out_buf, int out_buf_len,
		int *record, int nRecord, 
		uint16_t phoneSeq[], int nPhoneSeq,
		char selectStr[][ MAX_PHONE_SEQ_LEN * MAX_UTF8_SIZE + 1 ], 
		IntervalType selectInterval[],
		int nSelect, TreeDataType *ptd )
{
	PhraseIntervalType inter;
	int i;

	LoadChar( pgdata, out_buf, out_buf_len, phoneSeq, nPhoneSeq );
	for ( i = 0; i < nRecord; i++ ) {
		inter = ptd->interval[ record[ i ] ];
		ueStrNCpy(
				ueStrSeek( out_buf, inter.from ),
				( inter.p_phr )->phrase,
				( inter.to - inter.from ), -1);
	}
	for ( i = 0; i < nSelect; i++ ) {
		inter.from = selectInterval[ i ].from;
		inter.to = selectInterval[ i ].to ;
		ueStrNCpy(
				ueStrSeek( out_buf, inter.from ),
				selectStr[ i ], ( inter.to - inter.from ), -1);
	}
}
Example #3
0
int main ()
{
    char *u8string;
    int u8len;
    int len;
    char u8string2[16];

    u8string = "HelloWorld";
    u8len = ueStrLen(u8string);
    len = strlen(u8string);
    ok (u8len == len, "ueStrLen");

    u8string = "\xE6\xB8\xAC\xE8\xA9\xA6\xE8\xA8\x88\xE7\xAE\x97\xE9\x95\xB7\xE5\xBA\xA6"; /* 測試計算長度 */
    u8len = ueStrLen(u8string);
    ok (u8len == 6, "ueStrLen");

    u8string = "\xE6\xB8\xAC\xE8\xA9\xA6\xE8\xA8\x88\xE7\xAE\x97\xE9\x95\xB7\xE5\xBA\xA6"; /* 測試計算長度 */
    ueStrNCpy(u8string2, u8string, 3, STRNCPY_CLOSE);
    ok (!strcmp(u8string2, "\xE6\xB8\xAC\xE8\xA9\xA6\xE8\xA8\x88" /* 測試計 */ ), "ueStrNCpy");

    u8string = "\xE6\xB8\xAC\xE8\xA9\xA6\xE8\xA8\x88\xE7\xAE\x97\xE9\x95\xB7\xE5\xBA\xA6"; /* 測試計算長度 */
    u8string = ueStrSeek(u8string, 3);
    ok (!strcmp(u8string, "\xE7\xAE\x97\xE9\x95\xB7\xE5\xBA\xA6" /* 算長度 */ ), "ueStrSeek");

    u8string = "\xE6\xB8\xAC\xE8\xA9\xA6\xE8\xA8\x88\xE7\xAE\x97\xE9\x95\xB7\xE5\xBA\xA6"; /* 測試計算長度 */
    u8string = ueStrSeek(u8string, 0);
    ok (!strcmp(u8string, "\xE6\xB8\xAC\xE8\xA9\xA6\xE8\xA8\x88\xE7\xAE\x97\xE9\x95\xB7\xE5\xBA\xA6" /* 測試計算長度 */ ), "ueStrSeek");

    return exit_status();
}
Example #4
0
static void ChangeSelectIntervalAndBreakpoint(ChewingData *pgdata, int from, int to, const char *str)
{
    int i;
    int user_alloc;

    IntervalType inte;

    inte.from = from;
    inte.to = to;
    for (i = 0; i < pgdata->nSelect; i++) {
        if (IsIntersect(inte, pgdata->selectInterval[i])) {
            RemoveSelectElement(i, pgdata);
            i--;
        }
    }

    pgdata->selectInterval[pgdata->nSelect].from = from;
    pgdata->selectInterval[pgdata->nSelect].to = to;

    /* No available selection */
    if ((user_alloc = (to - from)) == 0)
        return;

    ueStrNCpy(pgdata->selectStr[pgdata->nSelect], str, user_alloc, 1);
    pgdata->nSelect++;

    if (user_alloc > 1) {
        memset(&pgdata->bUserArrBrkpt[from + 1], 0, sizeof(int) * (user_alloc - 1));
        memset(&pgdata->bUserArrCnnct[from + 1], 0, sizeof(int) * (user_alloc - 1));
    }
}
Example #5
0
void test_utf8()
{
    char *u8string;
    int u8len;
    int len;
    char u8string2[16];

    start_testcase(NULL, fd);

    u8string = "HelloWorld";
    u8len = ueStrLen(u8string);
    len = strlen(u8string);
    ok(u8len == len, "ueStrLen");

    u8string = "\xE6\xB8\xAC\xE8\xA9\xA6\xE8\xA8\x88\xE7\xAE\x97\xE9\x95\xB7\xE5\xBA\xA6";      /* 測試計算長度 */
    u8len = ueStrLen(u8string);
    ok(u8len == 6, "ueStrLen");

    u8string = "\xE6\xB8\xAC\xE8\xA9\xA6\xE8\xA8\x88\xE7\xAE\x97\xE9\x95\xB7\xE5\xBA\xA6";      /* 測試計算長度 */
    ueStrNCpy(u8string2, u8string, 3, STRNCPY_CLOSE);
    ok(!strcmp(u8string2, "\xE6\xB8\xAC\xE8\xA9\xA6\xE8\xA8\x88" /* 測試計 */ ), "ueStrNCpy");

    u8string = "\xE6\xB8\xAC\xE8\xA9\xA6\xE8\xA8\x88\xE7\xAE\x97\xE9\x95\xB7\xE5\xBA\xA6";      /* 測試計算長度 */
    u8string = ueStrSeek(u8string, 3);
    ok(!strcmp(u8string, "\xE7\xAE\x97\xE9\x95\xB7\xE5\xBA\xA6" /* 算長度 */ ), "ueStrSeek");

    u8string = "\xE6\xB8\xAC\xE8\xA9\xA6\xE8\xA8\x88\xE7\xAE\x97\xE9\x95\xB7\xE5\xBA\xA6";      /* 測試計算長度 */
    u8string = ueStrSeek(u8string, 0);
    ok(!strcmp
       (u8string, "\xE6\xB8\xAC\xE8\xA9\xA6\xE8\xA8\x88\xE7\xAE\x97\xE9\x95\xB7\xE5\xBA\xA6" /* 測試計算長度 */ ),
       "ueStrSeek");

}
Example #6
0
int main (int argc, char *argv[])
{
    char *u8string;
    int u8len;

    u8string = "HelloWorld";
    u8len = ueStrLen(u8string);
    int len = strlen(u8string);
    ok (u8len == len, "ueStrLen");

    u8string = "測試計算長度";
    u8len = ueStrLen(u8string);
    ok (u8len == 6, "ueStrLen");

    u8string = "測試計算長度";
    char u8string2[16];
    ueStrNCpy(u8string2, u8string, 3, STRNCPY_CLOSE);
    ok (!strcmp(u8string2, "測試計"), "ueStrNCpy");

    u8string = "測試計算長度";
    u8string = ueStrSeek(u8string, 3);
    ok (!strcmp(u8string, "算長度"), "ueStrSeek");

    u8string = "測試計算長度";
    u8string = ueStrSeek(u8string, 0);
    ok (!strcmp(u8string, "測試計算長度"), "ueStrSeek");

    return exit_status();
}
Example #7
0
int faft_data_add_fixed(const char *s, ChewingData *data, ArrayCode ac)
{
	if (s == NULL || s[0] == '\0')
		return 0;

	AddChi(ac, data);
	--(data->chiSymbolCursor);
	int i_p = PhoneSeqCursor(data);
	++(data->chiSymbolCursor);

	/* Add selected character */
	ueStrNCpy(data->selectStr[data->nSelect], s, 1, STRNCPY_CLOSE);
	/* Add one character interval */
	data->selectInterval[data->nSelect].from = i_p;
	data->selectInterval[data->nSelect].to = i_p+1;
	++(data->nSelect);

	return 1;
}
Example #8
0
/* Routines */
int faft_data_add_symbol(const char *s, ChewingData *data)
{
	if (s == NULL || s[0] == '\0')
		return 0;
	/* This part is copied from libchewing */
	memmove(&(data->chiSymbolBuf[data->chiSymbolCursor + 1]),
			&(data->chiSymbolBuf[data->chiSymbolCursor]),
			sizeof(wch_t)
			* (data->chiSymbolBufLen - data->chiSymbolCursor));
	data->chiSymbolBuf[data->chiSymbolCursor].wch = (wchar_t) 0;
	ueStrNCpy((char *) data->chiSymbolBuf[data->chiSymbolCursor].s,
			s, 1, STRNCPY_CLOSE);


	int key = FindSymbolKey(s);
	data->symbolKeyBuf[data->chiSymbolCursor] = key ? key : '1';

	data->bUserArrCnnct[ PhoneSeqCursor(data)] = 0;
	++(data->chiSymbolBufLen);
	++(data->chiSymbolCursor); 

	return 1;
}
Example #9
0
static int CheckUserChoose( 
		ChewingData *pgdata,
		uint16_t *new_phoneSeq, int from , int to,
		Phrase **pp_phr, 
		char selectStr[][ MAX_PHONE_SEQ_LEN * MAX_UTF8_SIZE + 1 ], 
		IntervalType selectInterval[], int nSelect )
{
	IntervalType inte, c;
	int chno, len;
	int user_alloc;
	UserPhraseData *pUserPhraseData;
	Phrase *p_phr = ALC( Phrase, 1 );

	assert( p_phr );
	inte.from = from;
	inte.to = to;
	*pp_phr = NULL;

	/* pass 1
	 * if these exist one selected interval which is not contained by inte
	 * but has intersection with inte, then inte is an unacceptable interval
	 */
	for ( chno = 0; chno < nSelect; chno++ ) {
		c = selectInterval[ chno ];
		if ( IsIntersect( inte, c ) && ! IsContain( inte, c ) ) {
			free( p_phr );
			return 0;
		}
	}

	/* pass 2
	 * if there exist one phrase satisfied all selectStr then return 1, else return 0.
	 * also store the phrase with highest freq
	 */
	pUserPhraseData = UserGetPhraseFirst( pgdata, new_phoneSeq );
	p_phr->freq = -1;
	do {
		for ( chno = 0; chno < nSelect; chno++ ) {
			c = selectInterval[ chno ];

			if ( IsContain( inte, c ) ) {
				/* 
				 * find a phrase of ph_id where the text contains 
				 * 'selectStr[chno]' test if not ok then return 0, 
				 * if ok then continue to test. */
				len = c.to - c.from;
				if ( memcmp(
					ueStrSeek( pUserPhraseData->wordSeq, c.from - from ),
					selectStr[ chno ],
					ueStrNBytes( selectStr[ chno ], len ) ) )
					break;
			}

		}
		if ( chno == nSelect ) {
			/* save phrase data to "pp_phr" */
			if ( pUserPhraseData->userfreq > p_phr->freq ) {
				if ( ( user_alloc = ( to - from ) ) > 0 ) {
					ueStrNCpy( p_phr->phrase,
							pUserPhraseData->wordSeq,
							user_alloc, 1);
				}
				p_phr->freq = pUserPhraseData->userfreq;
				*pp_phr = p_phr;
			}
		}
	} while ( ( pUserPhraseData = UserGetPhraseNext( pgdata, new_phoneSeq ) ) != NULL );

	if ( p_phr->freq != -1 ) 
		return 1;
		
	free( p_phr );
	return 0;
}
Example #10
0
/** @brief Loading all possible phrases of certain length.
 *
 *	   Loading all possible phrases of certain length into ChoiceInfo structure from static
 *	   and dynamic dictionaries,\n
 *	   including number of total pages and the number of current page.\n
 */
static void SetChoiceInfo(
		ChoiceInfo *pci,AvailInfo *pai, uint16 *phoneSeq, int cursor,
		int candPerPage )
{
	Word tempWord;
	Phrase tempPhrase;
	int len;
	UserPhraseData *pUserPhraseData;
	uint16 userPhoneSeq[ MAX_PHONE_SEQ_LEN ];
	
	/* Clears previous candidates. */
	memset( pci->totalChoiceStr, '\0', sizeof(char) * MAX_CHOICE * MAX_PHRASE_LEN * MAX_UTF8_SIZE + 1);

	pci->nTotalChoice = 0;
	len = pai->avail[ pai->currentAvail ].len;
	assert(len);

	/* secondly, read tree phrase */
	if ( len == 1 ) { /* single character */
		GetCharFirst( &tempWord, phoneSeq[ cursor ] );
		do {
			if ( ChoiceTheSame( pci, tempWord.word, ueBytesFromChar( tempWord.word[0] ) * sizeof( char ) ) ) 
				continue;
			memcpy( 
				pci->totalChoiceStr[ pci->nTotalChoice ],
				tempWord.word, ueBytesFromChar( tempWord.word[0] ) * sizeof( char ) );
			assert(pci->nTotalChoice <= MAX_CHOICE);
			pci->totalChoiceStr[ pci->nTotalChoice ][ ueBytesFromChar( tempWord.word[0] ) ] = '\0';
			pci->nTotalChoice++;
		} while( GetCharNext( &tempWord ) );
	}
	/* phrase */
	else {
		if ( pai->avail[ pai->currentAvail ].id != -1 ) {
			GetPhraseFirst( &tempPhrase, pai->avail[ pai->currentAvail ].id );
			do {
				if ( ChoiceTheSame( 
					pci, 
					tempPhrase.phrase, 
					len * ueBytesFromChar( tempPhrase.phrase[0] ) * sizeof( char ) ) ) {
					continue;
				}
				ueStrNCpy( pci->totalChoiceStr[ pci->nTotalChoice ],
						tempPhrase.phrase, len, 1);
				pci->nTotalChoice++;
			} while( GetPhraseNext( &tempPhrase ) );
		}

		memcpy( userPhoneSeq, &phoneSeq[ cursor ], sizeof( uint16 ) * len );
		userPhoneSeq[ len ] = 0;
		pUserPhraseData = UserGetPhraseFirst( userPhoneSeq );
		if ( pUserPhraseData ) {
			do {
				/* check if the phrase is already in the choice list */
				if ( ChoiceTheSame( 
					pci, 
					pUserPhraseData->wordSeq, 
					len * ueBytesFromChar( pUserPhraseData->wordSeq[0] ) * sizeof( char ) ) )
					continue;
				/* otherwise store it */
				ueStrNCpy(
						pci->totalChoiceStr[ pci->nTotalChoice ],
						pUserPhraseData->wordSeq,
						len, 1);
				pci->nTotalChoice++;
			} while( ( pUserPhraseData = 
				UserGetPhraseNext( userPhoneSeq ) ) != NULL );
		}

	}

	/* magic number */
	pci->nChoicePerPage = candPerPage;
	if ( pci->nChoicePerPage > MAX_SELKEY )
		pci->nChoicePerPage = MAX_SELKEY;
	pci->nPage = CEIL_DIV( pci->nTotalChoice, pci->nChoicePerPage );
	pci->pageNo = 0;
}
Example #11
0
/** @brief Loading all possible phrases of certain length.
 *
 * Loading all possible phrases of certain length into ChoiceInfo structure
 * from static and dynamic dictionaries, including number of total pages and
 * the number of current page.
 */
static void SetChoiceInfo(ChewingData *pgdata)
{
    Phrase tempPhrase;
    int len;
    UserPhraseData *pUserPhraseData;
    uint16_t userPhoneSeq[MAX_PHONE_SEQ_LEN];

    ChoiceInfo *pci = &(pgdata->choiceInfo);
    AvailInfo *pai = &(pgdata->availInfo);
    uint16_t *phoneSeq = pgdata->phoneSeq;
    uint16_t *phoneSeqAlt = pgdata->phoneSeqAlt;
    int cursor = PhoneSeqCursor(pgdata);
    int candPerPage = pgdata->config.candPerPage;

    /* Clears previous candidates. */
    memset(pci->totalChoiceStr, '\0', MAX_CHOICE * MAX_PHRASE_LEN * MAX_UTF8_SIZE + 1);

    pci->nTotalChoice = 0;
    len = pai->avail[pai->currentAvail].len;
    assert(len);

    /* secondly, read tree phrase */
    if (len == 1) {             /* single character */
        ChoiceInfoAppendChi(pgdata, pci, phoneSeq[cursor]);

        if (phoneSeq[cursor] != phoneSeqAlt[cursor]) {
            ChoiceInfoAppendChi(pgdata, pci, phoneSeqAlt[cursor]);
        }

        if (pgdata->bopomofoData.kbtype == KB_HSU || pgdata->bopomofoData.kbtype == KB_DVORAK_HSU) {
            switch (phoneSeq[cursor]) {
            case 0x2800:       /* 'ㄘ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x30); /* 'ㄟ' */
                break;
            case 0x80:         /* 'ㄧ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x20); /* 'ㄝ' */
                break;
            case 0x2A00:       /* 'ㄙ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x1);  /* '˙' */
                break;
            case 0xA00:        /* 'ㄉ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x2);  /* 'ˊ' */
                break;
            case 0x800:        /* 'ㄈ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x3);  /* 'ˇ' */
                break;
            case 0x18:         /* 'ㄜ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x1200);       /* 'ㄍ' */
                break;
            case 0x10:         /* 'ㄛ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x1600);       /* 'ㄏ' */
                break;
            case 0x1E00:       /* 'ㄓ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x1800);       /* 'ㄐ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x4);  /* 'ˋ' */
                break;
            case 0x58:         /* 'ㄤ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x1400);       /* 'ㄎ' */
                break;
            case 0x68:         /* 'ㄦ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x1000);       /* 'ㄌ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x60); /* 'ㄥ' */
                break;
            case 0x2200:       /* 'ㄕ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x1C00);       /* 'ㄒ' */
                break;
            case 0x2000:       /* 'ㄔ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x1A00);       /* 'ㄑ' */
                break;
            case 0x50:         /* 'ㄣ' */
                ChoiceInfoAppendChi(pgdata, pci, 0xE00);        /* 'ㄋ' */
                break;
            case 0x48:         /* 'ㄢ' */
                ChoiceInfoAppendChi(pgdata, pci, 0x600);        /* 'ㄇ' */
                break;
            default:
                break;
            }
        }
    }
    /* phrase */
    else {
        if (pai->avail[pai->currentAvail].id) {
            GetPhraseFirst(pgdata, &tempPhrase, pai->avail[pai->currentAvail].id);
            do {
                if (ChoiceTheSame(pci, tempPhrase.phrase, len * ueBytesFromChar(tempPhrase.phrase[0]))) {
                    continue;
                }
                ueStrNCpy(pci->totalChoiceStr[pci->nTotalChoice], tempPhrase.phrase, len, 1);
                pci->nTotalChoice++;
            } while (GetVocabNext(pgdata, &tempPhrase));
        }

        memcpy(userPhoneSeq, &phoneSeq[cursor], sizeof(uint16_t) * len);
        userPhoneSeq[len] = 0;
        pUserPhraseData = UserGetPhraseFirst(pgdata, userPhoneSeq);
        if (pUserPhraseData) {
            do {
                /* check if the phrase is already in the choice list */
                if (ChoiceTheSame(pci, pUserPhraseData->wordSeq, len * ueBytesFromChar(pUserPhraseData->wordSeq[0])))
                    continue;
                /* otherwise store it */
                ueStrNCpy(pci->totalChoiceStr[pci->nTotalChoice], pUserPhraseData->wordSeq, len, 1);
                pci->nTotalChoice++;
            } while ((pUserPhraseData = UserGetPhraseNext(pgdata, userPhoneSeq)) != NULL);
        }
        UserGetPhraseEnd(pgdata, userPhoneSeq);

    }

    /* magic number */
    pci->nChoicePerPage = candPerPage;
    assert(pci->nTotalChoice > 0);
    pci->nPage = CEIL_DIV(pci->nTotalChoice, pci->nChoicePerPage);
    pci->pageNo = 0;
    pci->isSymbol = WORD_CHOICE;
}
Example #12
0
CHEWING_API int chewing_handle_CtrlNum( ChewingContext *ctx, int key )
{
	ChewingData *pgdata = ctx->data;
	ChewingOutput *pgo = ctx->output;
	int keystrokeRtn = KEYSTROKE_ABSORB;
	int newPhraseLen;
	int i;
	uint16 addPhoneSeq[ MAX_PHONE_SEQ_LEN ];
	char addWordSeq[ MAX_PHONE_SEQ_LEN * MAX_UTF8_SIZE + 1 ];
	int phraseState;
	int cursor;

	CheckAndResetRange( pgdata );

	if ( pgdata->bSelect )
		return 0;

	CallPhrasing( pgdata );
	newPhraseLen = key - '0';

	if ( key == '0' || key == '1' ) {
		pgdata->bSelect = 1;
		pgdata->choiceInfo.oldChiSymbolCursor = pgdata->chiSymbolCursor;

		HaninSymbolInput(
				&( pgdata->choiceInfo ),
				&( pgdata->availInfo ),
				pgdata->phoneSeq,
				pgdata->config.candPerPage );
		CallPhrasing( pgdata );
		MakeOutputWithRtn( pgo, pgdata, keystrokeRtn );
		return 0;
	}

	cursor = PhoneSeqCursor( pgdata );
	if ( ! pgdata->config.bAddPhraseForward ) {
		if ( 
			newPhraseLen >= 1 && 
			cursor + newPhraseLen - 1 <= pgdata->nPhoneSeq ) {
			if ( NoSymbolBetween( 
				pgdata, 
				cursor, 
				cursor + newPhraseLen - 1 ) ) {
				/* Manually add phrase to the user phrase database. */
				memcpy( addPhoneSeq,
				        &pgdata->phoneSeq[ cursor ],
				        sizeof( uint16 ) * newPhraseLen );
				addPhoneSeq[ newPhraseLen ] = 0;
				ueStrNCpy( addWordSeq,
				           ueStrSeek( (char *) &pgdata->phrOut.chiBuf,
				                      cursor ),
				           newPhraseLen, 1);


				phraseState = UserUpdatePhrase( addPhoneSeq, addWordSeq );
				SetUpdatePhraseMsg( 
					pgdata, 
					addWordSeq, 
					newPhraseLen, 
					phraseState );

				/* Clear the breakpoint between the New Phrase */
				for ( i = 1; i < newPhraseLen; i++ )
					pgdata->bUserArrBrkpt[ cursor + i ] = 0;
			}
		}
	}
	else {
		if ( 
			newPhraseLen >= 1 && 
			cursor - newPhraseLen >= 0 ) {
			if ( NoSymbolBetween( pgdata, 
			                      cursor, 
			                      cursor - newPhraseLen ) ) {
				/* Manually add phrase to the user phrase database. */
				memcpy( addPhoneSeq,
				        &pgdata->phoneSeq[ cursor - newPhraseLen ],
				        sizeof( uint16 ) * newPhraseLen );
				addPhoneSeq[ newPhraseLen ] = 0;
				ueStrNCpy( addWordSeq,
				           ueStrSeek( (char *) &pgdata->phrOut.chiBuf,
				           cursor - newPhraseLen ),
				           newPhraseLen, 1);

				phraseState = UserUpdatePhrase( addPhoneSeq, addWordSeq );
				SetUpdatePhraseMsg( 
					pgdata, 
					addWordSeq, 
					newPhraseLen, 
					phraseState );

				/* Clear the breakpoint between the New Phrase */
				for ( i = 1; i < newPhraseLen; i++ )
					pgdata->bUserArrBrkpt[ cursor - newPhraseLen + i ] = 0;
			}
		}
	}
	CallPhrasing( pgdata );
	MakeOutputWithRtn( pgo, pgdata, keystrokeRtn );
	MakeOutputAddMsgAndCleanInterval( pgo, pgdata );
	return 0;
}