Beispiel #1
0
unsigned char *WoreWaanRtn( register unsigned char *TempIndx ) {
	register unsigned char *plus1 = TempIndx + 1, *minus3 = TempIndx - 3;

	if ( istcon( *( TempIndx - 1 ) ) ) {
		if ( istlvwl( *( TempIndx - 2 ) ) ) {
			return( minus3 );
		} else if ( istcon( *( TempIndx - 2 ) ) && istcon( *plus1 ) ) {
			switch ( *( TempIndx + 1 ) ) {
			case OrAng:
				return( FAIL );
			case RoreReo:
				if ( *( TempIndx + 2 ) == RoreReo ) {
					return( FAIL );
				}
			default:
				if ( plus1 <= RightMargin ) {
					if ( *( TempIndx + 3 ) == Karan ) {
						return( FAIL );
					} else {
						return( !istrvwl( *( TempIndx + 2 ) ) ? plus1 : FAIL );
					}
				} else {
					return( FAIL );
				}
			}
		} else if ( isttnl( *( TempIndx - 1 ) ) && istcon( *( TempIndx - 2 ) ) && istcon( *minus3 ) ) {

			if ( plus1 <= RightMargin ) {
				return( plus1 );
			} else if ( !nstrcmp( "¡Ã", minus3 ) || !nstrcmp( "¡Å", minus3 ) || !nstrcmp( "˹", minus3 ) || !nstrcmp( "ËÂ", minus3 ) ) {
				return( TempIndx - 4 );
			} else {
				return( minus3 );
			}
		}
	}
	return( FAIL );
}
Beispiel #2
0
unsigned char *HunAkadRtn( register unsigned char *TempIndx ) {
    register unsigned char *plus1 = TempIndx + 1;
    register unsigned char *minus2 = TempIndx - 2;

    if ( plus1 <= RightMargin ) {
        switch ( *( plus1 ) ) {
        case KoreGai:
            if ( findchar( *( TempIndx - 1 ), "¡§ª«´µ¶º»¿ÁÇË" ) ) {
                return( plus1 );
            }
            break;
        case NgorNgoo:
            switch ( *( TempIndx - 1 ) ) {
            case SoreSeo:
                if ( *( TempIndx + 2 ) != KorKai && *( TempIndx + 2 ) != KoreRakung ) {
                    return( plus1 );
                }
                break;
            case RoreReo:
                if ( !nstrcmp( "¡Ãѧ´ì", minus2 ) ) {
                    return( TempIndx - 3 );
                } else {
                    return( plus1 );
                }
            default:
                return( plus1 );
            }
            break;
        case DoreDek:
            return( plus1 );
        case NoreNoo:
            if ( *( TempIndx + 3 ) != Karan ) {
                return( plus1 );
            }
            break;
        case YoreYak:
            if ( !nstrcmp( "¹Ñ¹ì", TempIndx - 1 ) ) {
                return( minus2 );
            } else {
                return( plus1 );
            }
        case SoreSeo:
            if ( *( TempIndx + 4 ) != Karan ) {
                return( plus1 );
            }
            break;
        case WoreWaan:
            switch ( *( TempIndx + 2 ) ) {
            case SaraAh:
                if ( TempIndx + 2 <= RightMargin ) {
                    return( TempIndx + 2 );
                }
                break;
            case RoreReo:
                if ( *( TempIndx + 3 ) == Karan ) {
                    return( minus2 );
                }
                break;
            default:
                return( plus1 );
            }
            break;
        default:
            if ( isttnl( *( plus1 ) ) ) {
                if ( *( TempIndx + 4 ) == Karan ) {
                    return( minus2 );
                } else {
                    if ( TempIndx + 2 <= RightMargin ) {
                        return( TempIndx + 2 );
                    }
                }
            }
        }

        switch ( *( TempIndx - 1 ) ) {
        case NgorNgoo:
            return( plus1 );
        case NoreNoo:
            if ( !findchar( *( plus1 ), "µ¹Â" ) ) {
                return( plus1 );
            }
            break;
        case MoreMar:
            if ( !findchar( *( plus1 ), "¤¹Ç" ) ) {
                return( plus1 );
            }
            break;
        case RoreReo:
            if ( !findchar( *( plus1 ), "¡µ¾È" ) ) {
                return( plus1 );
            }
            break;
        case HorHeeb:
            if ( *( plus1 ) != ToreTao && *( plus1 ) != NoreNoo ) {
                return( plus1 );
            }
            break;
        case HorNokHook:
            return( plus1 );
        }
    }

    if ( findchar( *( TempIndx - 1 ), "¢¤¦ª«­±³¶¸»¼½¾¿ÈÊÍÎ" ) ) {
        return( minus2 );
    } else {
        switch ( *( TempIndx - 1 ) ) {
        case KoreGai:
            return( *minus2 == SoreSeo ? FAIL : minus2 );
        case NgorNgoo:
            switch ( *minus2 ) {
            case HorHeeb:
                return( TempIndx - 3 );
            case SoreSeo:
                return( FAIL );
            default:
                return( minus2 );
            }
        case JoreJarn:
            return( ( *minus2 == KorKai ) ? FAIL : minus2 );
        case DoreDek:
            return( ( *minus2 == SoreSeo ) ? FAIL : minus2 );
        case ToreTao:
            return( ( *minus2 == KoreGai ) ? FAIL : minus2 );
        case ToreTaharn:
            switch ( *minus2 ) {
            case HorHeeb:
                return( TempIndx - 3 );
            case WoreWaan:
                return( FAIL );
            default:
                return( minus2 );
            }
        case BoreBaimai:
            return( ( *minus2 == ChorChing ) ? TempIndx - 3 : minus2 );
        case PoreSumpao:
            return( ( *minus2 == OrAng ) ? FAIL : minus2 );
        case WoreWaan:
            return( findchar( *minus2, "¡¢¤¨©µ¶¸ÊË" ) ? FAIL : minus2 );
        case HorHeeb:
            return( findchar( *minus2, "ÁÃÍ" ) ? FAIL : minus2 );
        }
    }
    return( FAIL );
}
Beispiel #3
0
unsigned char *SaraORtn( register unsigned char *TempIndx ) {
	register short i;
	unsigned char *TempIndxm1 = TempIndx - 1;
	short SoreSeoTbLen = 6;									/* 7 - 1 */
	short OrAngTbLen = 8;									/* 9 - 1 */
	short MoreMarTbLen = 6;									/* 7 - 1 */
	short NoreNooTbLen = 1;									/* 2 - 1 */
	short ShoreChangTbLen = 3;								/* 4 - 1 */
	static char *SoreSeoTable[] = { "╩т┼╟ь", "╩т╣╟ь", "╩т╡├ь", "╩т┴╩├", "╩т╡╣", "╩тд╗", "╩т┼сб╣" };
	static char *OrAngTable[] = { "═т│╖╤┬", "═т├д┬╥", "═т╦╩╘", "═т╣к╥", "═т╖╩╨", "═т┴╦╨", "═т┼└╨", "═т┼╦╨", "═т╚б" };
	static char *MoreMarTable[] = { "┴т╦├╨╖╓б", "┴т╦├╩╛", "┴т╦╠╥├", "┴т╦├╒", "┴т╦╩╢", "┴т╣└╥╛", "┴т╣╕├├┴" };
	static char *NoreNooTable[] = { "╣т┬║╥┬", "╣т├┤┴" };
	static char *ShoreChangTable[] = { "кт┼║┼", "кт┼╕├", "кт┼┴", "кт┬" };
	static char ToreTaharnWord[] = "╖т┴╣";
	static char RoreReoWord[] = "├т╦░╥╣";
	static char YoreYakWord[] = "┬т╩";
	static char KorKaiWord[] = "вт┴┬";

	switch ( *( TempIndxm1 ) ) {
	case SoreSeo:											/* ╩т┼╟ь ╩т╣╟ь ╩т╡├ь ╩т┴╩├ ╩т╡╣ ╩тд╗ ╩т┼сб╣*/
		for ( i = 0; i <= SoreSeoTbLen; ++i ) {
			if ( !( nstrcmp( SoreSeoTable[i], TempIndxm1 ) ) ) {
				return( TempIndx - 2 );						/* cut before consonant that before Sara O */
			}
		}
		return( TempIndxm1 );								/* cut before sara O */

	case OrAng:												/* ═т│╖╤┬ ═т├д┬╥ ═т╦╩╘ ═т╣к╥ ═т╖╩╨ ═т┴╦╨ ═т┼└╨ ═т┼╦╨ ═т╚б*/
		for ( i = 0; i <= OrAngTbLen; ++i ) {
			if ( !( nstrcmp( OrAngTable[i], TempIndxm1 ) ) ) {
				return( TempIndx - 2 );						/* cut before consonant that before Sara O */
			}
		}
		return( TempIndxm1 );								/* cut before sara O */

	case MoreMar:											/* ┴т╦├╨╖╓б, ┴т╦├╩╛,┴т╦╠╥├,┴т╦├,┴т╦╩╢ */
		for ( i = 0; i <= MoreMarTbLen; ++i ) {
			if ( !( nstrcmp( MoreMarTable[i], TempIndxm1 ) ) ) {
				return( TempIndx - 2 );						/* cut before consonant that before Sara O */
			}
		}
		return( TempIndxm1 );								/* cut before sara O */

	case NoreNoo:											/* ╣т┬║╥┬ ╣т├┤┴ */
		if ( !( nstrcmp( "╣т┴", TempIndxm1 ) ) && !( istlvwl( *( TempIndx - 2 ) ) ) ) {
			if ( !( isttnl( *( TempIndx + 2 ) ) ) ) {
				return( TempIndx - 2 );						/*cut before NoreNoo */
			}
		}
		for ( i = 0; i <= NoreNooTbLen; ++i ) {
			if ( !( nstrcmp( NoreNooTable[i], TempIndxm1 ) ) ) {
				return( TempIndx - 2 );						/* cut before consonant that before Sara O */
			}
		}
		return( TempIndxm1 );								/* cut before sara O */

	case ShoreChang:										/* кт┼║┼ кт┼╕├ кт┼┴ кт┬ */
		for ( i = 0; i <= ShoreChangTbLen; ++i ) {
			if ( !( nstrcmp( ShoreChangTable[i], TempIndxm1 ) ) ) {
				return( TempIndx - 2 );						/* cut before consonant that before Sara O */
			}
		}
		return( TempIndxm1 );								/* cut before sara O */

	case ToreTaharn:										/* ╖т┴╣ */
		if ( nstrcmp( ToreTaharnWord, TempIndxm1 ) ) {
			return( TempIndxm1 );							/* cut before sara O */
		} else {
			return( TempIndx - 2 );							/* cut before consonant that before Sara O */
		}
		break;

	case RoreReo:											/* ├т╦░╥╣ */
		if ( nstrcmp( RoreReoWord, TempIndxm1 ) ) {
			return( TempIndxm1 );							/* cut before sara O */
		} else {
			return( TempIndx - 2 );							/* cut before consonant that before Sara O */
		}
		break;

	case YoreYak:											/* ┬т╩ */
		if ( nstrcmp( YoreYakWord, TempIndxm1 ) ) {
			return( TempIndxm1 );							/* cut before sara O */
		} else {
			return( TempIndx - 2 );							/* cut before consonant that before Sara O */
		}
		break;

	case KorKai:											/* вт┴┬ */
		if ( nstrcmp( KorKaiWord, TempIndxm1 ) ) {
			return( TempIndxm1 );							/* cut before sara O */
		} else {
			return( TempIndx - 2 );							/* cut before consonant that before Sara O */
		}
		break;
/*
	default:
		return( TempIndx - 1 );
*/
	}
	return( TempIndx - 1 );
}
Beispiel #4
0
unsigned char *SaraUeRtn( unsigned char *TempIndx ) {
	if ( isttnl( *( TempIndx + 1 ) ) ) {	/* Check vowel routine here */
		if ( ( TempIndx + 2 ) <= RightMargin ) {
			return( TempIndx + 2 );
		}
	} else {
		switch ( *( TempIndx - 1 ) ) {
		case RoreReo:
			if ( findchar( *( TempIndx + 1 ), ":換" ) ) {
				if ( !istrvwl( *( TempIndx + 2 ) ) && TempIndx + 2 <= RightMargin ) {
					return( TempIndx + 1 );
				}
			} else {
				return( TempIndx );
			}
			break;
		case HorNokHook:
			switch ( *( TempIndx + 1 ) ) {
			case KoreGai:
			case DoreDek:
			case MoreMar:
				return( TempIndx - 2 );
			default:
				return( TempIndx );
			}
		case HorHeeb:
			if ( *( TempIndx + 1 ) == NgorNgoo ) {
				return( TempIndx - 2 );
			} else {
				return( TempIndx );
			}
		case OrAng:
			if ( findchar( *( TempIndx + 1 ), ":換" ) ) {
				if ( TempIndx + 1 <= RightMargin ) {
					return( TempIndx + 1 );
				} else {
					return( TempIndx - 2 );
				}
			} else {
				return( TempIndx );
			}
		default:
			if ( ( TempIndx + 1 ) <= RightMargin ) {
				return( TempIndx + 1 );
			}
		}
	}

	/* Check to cut in front */
	/* if ( !findchar( *( TempIndx - 1), "港壇" ) ) {
		return( TempIndx - 2 );
	} else {
		return( FAIL );
	}  */ /* corrected by Subun */
	/* modified by Subun  : date 24 May, 1988 */

	switch ( *( TempIndx - 1 ) ) {
	case NoreNoo:
		if ( !findchar( *( TempIndx - 2 ), "ぜ僕" ) ) {
			return( TempIndx - 2 );
		}
		break;
	case MoreMar:
		if ( *( TempIndx - 2 ) != HorHeeb ) {
			return( TempIndx - 2 );
		} else {
			return( TempIndx - 3 );
		} /* cut before HorHeep */
	case RoreReo:
		if ( !findchar( *( TempIndx - 2 ), "さ讃" ) ) {
			return( TempIndx - 2 );
		}
		break;
	case LoreLing:
		if ( !findchar( *( TempIndx - 2 ), ",脅瞥" ) ) {
			return( TempIndx - 2 );
		}
		break;
	default:
		return( TempIndx - 2 );
	}
	return( FAIL );
}