diff --git a/.gitattributes b/.gitattributes index 1ea583559f..5c92f04d3c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -67,7 +67,6 @@ icu4c/source/samples/ucnv/data02.bin -text icu4c/source/test/testdata/importtest.bin -text icu4c/source/test/testdata/ja_data.bin -text icu4c/source/test/testdata/uni-text.bin -text -icu4j/src/com/ibm/data/misc/english.dict -text icu4j/src/com/ibm/icu/dev/data/holidays_jp.ucs -text icu4j/src/com/ibm/icu/dev/data/rbbi/english.dict -text icu4j/src/com/ibm/icu/dev/data/thai6.ucs -text @@ -75,12 +74,6 @@ icu4j/src/com/ibm/icu/dev/data/unicode/Draft-TestSuite.txt -text icu4j/src/com/ibm/icu/impl/data/thai_dict -text icu4j/src/com/ibm/icu/impl/data/unames.dat -text icu4j/src/com/ibm/icu/impl/data/uprops.dat -text -icu4j/src/com/ibm/text/resources/thai_dict -text -icu4j/src/com/ibm/text/resources/unames.dat -text -icu4j/src/com/ibm/text/resources/uprops.dat -text -icu4j/src/data/holidays_jp.ucs -text -icu4j/src/data/thai6.ucs -text -icu4j/src/data/unicode/Draft-TestSuite.txt -text # The following file types are stored in Git-LFS. *.jar filter=lfs diff=lfs merge=lfs -text diff --git a/icu4j/src/com/ibm/data/misc/english.dict b/icu4j/src/com/ibm/data/misc/english.dict deleted file mode 100755 index 10f430b775..0000000000 Binary files a/icu4j/src/com/ibm/data/misc/english.dict and /dev/null differ diff --git a/icu4j/src/com/ibm/data/misc/words.txt b/icu4j/src/com/ibm/data/misc/words.txt deleted file mode 100755 index a7e06ac91a..0000000000 --- a/icu4j/src/com/ibm/data/misc/words.txt +++ /dev/null @@ -1,2990 +0,0 @@ --- ---such -a -a'bel-mizraim -a'iah -abate -abated -abdicated -abel -abi'da -abide -abim'a-el -abim'elech -abim'elech's -able -abolish -abolishing -abomination -about -above -abraham -abraham's -abram -abram's -abroad -absent -absolute -absolved -abundance -abundantly -abuses -accad -accept -accepted -accommodation -according -accordingly -account -accustomed -achbor -acknowledged -acquiesce -acquired -across -act -acts -adah -adam -adbeel -add -added -admah -administration -adullamite -advanced -adviser -afar -affected -afflicted -affliction -afraid -after -afterward -afterwards -again -against -age -ages -agile -agree -agreed -ahuz'zath -ai -aid -air -akan -al'lon-bacuth -alighted -alive -all -allegiance -alliances -allies -allow -allowance -almighty -almo'dad -almond -almonds -alone -along -aloud -already -also -altar -alter -altering -although -altogether -alvah -alvan -am -am'alek -am'raphel -amal'ekites -amazement -america -ammonites -among -amongst -amorite -amorites -amount -an -an'amim -anah -and -aner -angel -angels -anger -angry -animal -animals -annihilation -anointed -another -another's -answer -answered -any -anything -anywhere -apart -appealed -appealing -appear -appeared -appease -appoint -appointed -approached -approaching -appropriations -aprons -ar'arat -ar'ioch -ar'vadites -aram -aramean -aran -arbitrary -archers -ard -are -are'li -area -arise -ark -arkites -armed -armies -arms -army -aro'di -arose -around -arpach'shad -arrayed -arrive -art -as -as'enath -ascending -ash'kenaz -ash'teroth-karna'im -ashamed -ashbel -asher -asher's -ashes -aside -ask -asked -asks -asleep -ass -ass's -assemble -assembled -assent -asses -asshu'rim -asshur -assume -assured -assyria -at -atad -ate -attack -attacked -attained -attempts -attend -attended -attention -authority -avenged -avith -away -awesome -awoke -ba'al-ha'nan -ba'bel -back -backward -bad -bade -bags -baked -baker -balm -bank -banks -barbarous -barren -bas'emath -basket -baskets -battle -bdellium -be -be'or -be-e'ri -bear -bearing -bears -beast -beasts -beautiful -became -because -becher -become -becomes -bed -bedad -been -beer-la'hai-roi -beer-sheba -befall -befallen -befalls -before -beg -began -beginning -beguiled -begun -beheld -behind -behold -being -bela -believe -believed -belly -belong -belonging -belongs -below -ben-ammi -ben-o'ni -beneath -benefits -benjamin -benjamin's -bera -bereaved -bered -bereft -beri'ah -beside -besides -besought -best -bethel -bethlehem -bethu'el -better -between -beyond -bilhah -bilhan -binding -bird -birds -birsha -birth -birthday -birthright -bites -bitter -bitumen -black -blame -blameless -bless -blessed -blesses -blessing -blessings -blighted -blindness -blood -blossoms -blot -blotted -blow -bodies -body -boiling -bonds -bone -bones -book -booths -border -bore -born -borne -both -bough -bought -bound -boundaries -bounties -bow -bowed -bowing -bowshot -boys -bozrah -bracelets -branches -breach -bread -breadth -break -breaking -breasts -breath -breathed -bred -breed -breeding -brethren -brick -bricks -brimstone -bring -britain -british -broken -bronze -brother -brother's -brother-in-law -brothers -brought -brow -bruise -budded -build -building -built -bulls -bundle -bundles -buried -burn -burned -burnt -burst -bury -burying -bushes -but -butler -butlership -buy -buz -by -cain -cake -cakes -calah -calf -call -called -calls -came -camel -camel's -camels -camp -camped -can -canaan -canaan' -canaanite -canaanites -canaanitish -candid -cannot -caph'torim -captain -captive -captives -captured -caravan -carcasses -care -carefully -carmi -carried -carry -cases -caslu'him -cast -cattle -caught -cause -caused -causes -cave -cease -ceased -certain -chain -chalde'ans -chamber -change -changed -character -charge -charged -charging -chariot -chariots -charters -cheat -cheated -ched-or-lao'mer -cheran -cherubim -chesed -chezib -chief -chiefs -child -childbearing -childless -children -children's -choice -choicest -chose -chosen -circumcised -circumstances -cities -citizens -city -civil -civilized -clans -clean -clear -cleaves -close -closed -clothed -clothes -clothing -cloud -clouds -clusters -coastland -coasts -coffin -cold -colonies -colonies: -colt -colts -combined -come -comely -comes -comfort -comforted -comforts -coming -command -commanded -commander -commandments -commerce -commit -committed -common -companies -company -complained -complete -completed -compliance -conceal -conceived -concern -concerning -conclude -concubine -concubines -condition -conditions -confined -confuse -confused -congress -conjured -connected -connection -connections -consent -consent: -conspired -constitution -constrained -constrains -consume -consumed -contempt -contended -continually -continue -continued -contract -control -controlling -convulsions -cool -cord -correspondence -corrupt -corrupted -costly -couch -couched -couches -couching -could -council -count -counted -countenance -country -course -covenant -cover -covered -covering -cows -created -creation -creator -creature -creatures -creeping -creeps -cried -crossed -crossing -crouching -crown -cruel -cruelty -cry -crying -cubit -cubits -cup -curds -current -curse -cursed -curses -cush -custody -cut -cutting -dainties -damascus -dan -dangers -dares -dark -darkness -daughter -daughter-in-law -daughters -dawned -day -days -dead -deal -dealt -death -deb'orah -deceitfully -deceived -decent -decide -decks -declaration -declare -declaring -dedan -deed -deep -defeat -defeated -defiled -define -delay -delayed -delight -deliver -delivered -delivery -denied -denounces -depart -departed -departing -dependent -dependents -depository -depriving -deriving -descendants -descending -design -desire -desired -desolate -desolation -despised -despotism -destroy -destroyed -destroys -destruction -destructive -determined -devoured -devouring -dew -dictate -did -didst -die -died -dies -diklah -dim -din'habah -dinah -dinah's -dine -dipped -direct -direction -disaster -disavow -discreet -disgrace -dishan -dishon -dismayed -displeased -displeasing -disposed -dissolutions -dissolve -dissolved -distance -distant -distress -distressed -districts -divide -divided -dividing -divination -divine -divines -do -do'danim -doer -does -doing -domestic -dominion -done -door -dothan -double -doubling -doubt -dove -down -downcast -dowry -drank -draw -drawn -dread -dream -dreamed -dreamer -dreams -drew -dried -drink -drinking -drinks -driven -drove -droves -drunk -dry -dug -dumah -dungeon -during -dust -duty -dwell -dwelling -dwelt -e'domites -e'phraim -e'phraim's -each -early -ears -earth -easily -east -eastward -eat -eaten -eating -ebal -eber -eden -eder -edom -effect -egypt -egyptian -egyptian's -egyptians -ehi -eight -eighteen -eighty -eighty-seven -eighty-six -eighty-two -either -el'iphaz -el-bethel -el-el'ohe-israel -el-paran -elah -elam -elda'ah -elder -elders -eldest -elected -eleven -eli'shah -elie'zer -ella'sar -elon -else -embalm -embalmed -embalming -embrace -embraced -emigration -emim -emptied -empty -empty-handed -enaim -encamped -encampments -encourage -end -endeavored -ended -ending -endowed -ends -enemies -enemy -english -enlarge -enlarging -enmish'pat -enmity -enoch -enosh -enough -enter -entered -entitle -entrance -entreat -envied -ephah -epher -ephrath -ephron -equal -er -erech -erected -eri -errand -esau -esau's -escape -escaped -esek -eshban -eshcol -establish -established -establishing -establishment -eternal -euphra'tes -euphrates -eve -even -evening -events -ever -everlasting -every -everything -everywhere -evil -evils -evinces -ewe -ewes -example -exceedingly -except -exchange -excited -executioners -exercise -experience -expert -explain -exposed -exposing -extend -extended -eyes -ezbon -ezer -face -faces -facts -failed -fainted -fair -faithfulness -fall -fallen -falls -falsely -families -family -famine -famished -far -fare -fared -farewell -fast -fat -father -father's -father-in-law -fathers -fatiguing -fatness -faults -favor -favorable -fawns -fear -feared -feast -fed -feebler -feed -feel -feet -fell -fellow -felt -female -festal -fetch -few -field -fields -fierce -fiercely -fifteen -fifth -fifths -fifty -fig -fill -filled -find -finds -fine -finish -finished -fire -firm -firmament -firmness -first -first- -first-born -firstlings -fish -fit -five -fixed -flaming -fled -flee -fleeing -flesh -floated -flock -flocks -flood -floor -flowed -flows -fly -foal -follow -followed -following -follows -folly -fondling -food -foolishly -foot -for -forbidden -force -forced -forces -ford -foreign -foreigner -foreigners -foremost -foreskin -foreskins -forger -forget -forgets -forgive -forgot -forgotten -form -formed -former -formerly -formidable -forms -forsaken -forth -fortune -fortunes -forty -forty-five -forty-seven -found -foundation -fountains -four -fourteen -fourteenth -fourth -frail -free -freely -fresh -freshly -friend -friendly -friends -fro -from -front -frontiers -fruit -fruitful -fruits -fugitive -fulfil -fulfilled -full -fundamentally -furnace -fury -future -gad -gaham -gained -galeed -game -garden -garment -garments -gatam -gate -gather -gathered -gaunt -gave -gavest -gaza -gazed -genealogies -general -generation -generations -gera -gerar -gershon -get -gether -gift -gifts -gihon -gilead -gir'gashites -give -given -givest -giving -go -goat -goats -god -god's -gods -goes -goi'im -going -gold -gomer -gomor'rah -gone -good -good-looking -goods -gopher -goshen -got -gotten -governed -government -governments -governments: -governor -governors -gracious -graciously -grain -grandchildren -grandson -grant -granted -grapes -grass -grave -gray -great -greater -greatly -green -grew -grieved -grievous -groping -ground -grow -growing -grown -grows -guard -guards -guile -guilt -guilty -gum -guni -ha'mathites -had -hadad -hadar -hador'am -hagar -haggi -hairs -hairy -half -hallowed -ham -hamor -hamor's -hamstring -hamul -hand -hands -handsome -hang -hanged -hanoch -happened -happiness -happy -haran -harass -harassed -hard -hardship -harlot -harlotry -harm -harshly -harvest -harvests -has -hast -haste -hastened -hastily -hate -hated -hath -hav'ilah -have -haven -havilah -having -haz'azon-ta'mar -hazarma'veth -hazo -he -he-asses -he-goats -head -heads -healed -heap -hear -heard -hearing -hearken -hearkened -hears -heart -hearts -heat -heaven -heavens -heber -hebrew -hebrews -hebron -heed -heeded -heel -heels -heifer -height -heir -held -help -helper -heman -hemdan -her -herb -herd -herds -herdsmen -here -herself -heth -hewed -hezron -hid -hidden -hide -high -hill -hills -him -himself -hind -hinder -hip -hirah -hire -hired -his -history -hither -hittite -hittites -hivite -hivites -hobah -hold -hollow -home -honest -honesty -honey -honor -honored -hori -horite -horites -horns -horse's -horsemen -horses -host -hot -hotly -house -household -households -houses -how -hul -human -humane -humble -humbled -hundred -hundredfold -hundredth -hunt -hunted -hunter -hunting -huppim -husband -husham -hushim -i -if -ill -ill-treat -image -imagination -immediate -imnah -impel -importance -imposing -impossible -in -inasmuch -incapable -including -increased -indeed -independent -indian -indignant -inestimable -inevitably -inhabitants -inheritance -iniquity -injuries -injury -innocence -innocent -inquire -inquired -inside -instead -institute -instituted -instructed -instructing -instrument -instruments -insult -insurrections -integrity -intended -intentions -interpret -interpretation -interpretations -interpreted -interpreter -interrupt -into -introducing -invariably -invasion -invasions -invested -iob -irad -iram -iron -is -is'sachar -isaac -isaac's -iscah -ish'mael -ish'mael's -ish'maelites -ishbak -ishvah -ishvi -israel -israel's -israelites -it -ithran -its -itself -jabal -jabbok -jachin -jacob -jacob's -jah'leel -jahzeel -jalam -jamin -japheth -jar -jared -javan -je'gar-sahadu'tha -je'ush -jealous -jeb'usites -jemu'el -jerah -jesting -jetheth -jetur -jewelry -jezer -jidlaph -jobab -joined -joint -jokshan -joktan -jordan -joseph -joseph's -journey -journeyed -jubal -judah -judah's -judge -judged -judges -judgment -judiciary -judith -jurisdiction -jury: -just -justice -kad'monites -kadesh -ked'emah -kedar -keep -keeper -keepers -kemu'el -ken'ites -ken'izzites -kenan -kenaz -kept -ketu'rah -kid -kids -kill -killed -kind -kindled -kindness -kindred -kinds -king -king's -kingdom -kings -kinsman -kinsmen -kir'iath-ar'ba -kiss -kissed -kittim -knead -knee -kneel -knees -knew -knife -know -knowing -knowledge -known -knows -kohath -korah -laban -laban's -labor -lack -lacking -lad -lad's -ladder -lads -laid -lain -lamb -lambs -lamech -lamentation -lamented -land -lands -language -languages -languished -large -lasha -last -later -laugh -laughed -laughter -laws -lay -laying -le-um'mim -lead -leaf -leah -leah's -lean -leap -leaped -learn -learned -least -leave -leaves -led -left -legislate -legislation: -legislative -legislature -legislatures -leha'bim -length -lentils -lesser -lest -let -letu'shim -levey -levi -liberty -lie -lies -life -lifeblood -lift -lifted -light -lights -like -likely -likeness -likewise -limping -linen -lingered -lion -lion's -lioness -listen -listened -listening -little -live -lived -lives -livestock -living -lo -load -loaded -lodge -lodged -lodging -loins -long -longed -longer -longs -look -looked -looking -loose -lord -lord's -lords -loss -lot -lot's -lotan -lotan's -loud -love -loved -lovely -loves -lower -lowered -loyally -lud -ludim -luz -lying -lyre -ma'acah -ma'halath -ma-hal'alel -mach- -mach-pe'lah -machir -madai -made -mag'diel -magicians -magnanimity -magog -mahana'im -maid -maiden -maids -maidservants -make -maker -making -mal'chi-el -male -males -mamre -man -man'ahath -man's -manas'seh -manas'seh's -mandrakes -mankind -manly -manner -mantle -many -mark -marked -marriage -marriages -married -marries -marry -mash -masre'kah -massa -master -master's -mate -mating -matred -matter -may -me -me'zahab -me-hu'ja-el -me-thu'sha-el -meal -mean -meaning -means -meant -meantime -meanwhile -measure -measured -measures -medan -meditate -meet -meets -mehet'abel -mel-chiz'edek -members -men -men's -mend -mended -menservants -mention -merar'i -mercenaries -merchants -merciful -merciless -mercy -merry -mesha -meshech -mesopota'mia -message -messengers -met -methu'selah -mibsam -mibzar -mid'ian -mid'ianite -mid'ianites -midst -midwife -might -mightier -mightily -mighty -migrated -migration -milcah -milch -military -milk -mind -mine -mirth -miscarried -mishma -mist -mistress -mizpah -mizzah -moab -moabites -mock -mocking -money -monsters -month -months -moon -more -moreh -moreover -mori'ah -morning -morsel -mortar -most -mother -mother's -mothers -mottled -mount -mountain -mountains -mourn -mourned -mourning -mouth -moved -moves -moving -much -multiplied -multiply -multitude -muppim -murders -must -mutually -my -myrrh -myself -na'amah -na'aman -nahath -nahor -nahor's -naked -nakedness -name -named -names -naph'tali -naph-tu'him -naphish -nation -nations -native -naturalization -nature -nature's -near -neba'ioth -necessary -necessity -neck -need -negeb -neglected -neighboring -neither -nephilim -never -nevertheless -new -next -night -nights -nile -nimrod -nin'eveh -nine -nineteen -ninety -ninety-five -ninety-nine -no -noah -noah's -nod -none -noon -nor -north -northward -nose -nostrils -not -nothing -now -number -numbered -numbers -nurse -nuts -o -oak -oaks -oath -obal -obedience -obeisance -obey -obeyed -object -obstructed -obstructing -obtain -obtained -occasion -occupation -odious -odor -of -off -offended -offense -offenses: -offer -offered -offering -offerings -office -officer -officers -offices -offspring -oh -ohad -oholiba'mah -oil -old -older -oldest -olive -omar -on -onam -onan -once -one -ones -only -onyx -open -opened -operation -ophir -opinions -opposing -opposite -oppressed -oppressions -or -order -orders -organizing -ornaments -other -others -ought -our -ours -ourselves -out -outcry -outside -outwitted -over -overdriven -overseer -overseers -oversight -overtake -overthrew -overthrow -overtook -own -owns -oxen -pace -paddan -paddan-aram -paid -pain -pair -pairs -pallu -paralleled -paran -part -parts -pass -passed -past -pasture -pastured -pasturing -path -pathru'sim -patient -pau -pay -payment -pe'lah -peace -peaceably -peeled -peleg -peni'el -penu'el -people -peopled -peoples -per'izzites -perez -perfidy -perform -perhaps -perish -permit -perpetuated -persons -petitioned -petitions -pharaoh -pharaoh's -phicol -philistines -physicians -piece -pieces -pigeon -pildash -pillar -pinon -pipe -pishon -pistachio -pit -pitch -pitched -pits -place -placed -places -plagues -plain -plainly -plane -planning -plant -planted -plants -play -played -playing -pleasant -please -pleased -pleases -pleasing -pleasure -pledge -plenteous -plenty -plowing -plucked -plump -plundered -point -political -poor -poplar -population -portion -portions -possess -possession -possessions -posterity -pot -pot'i-phar -poti'phera -pottage -poured -poverty -power -powers -praise -praised -pray -prayed -prayer -pre-eminence -pre-eminent -prepare -prepared -presence -present -presented -preserve -preserved -pressed -pressing -pretended -prevail -prevailed -prevent -prevented -prey -price -pride -priest -priests -prince -princes -principles -prison -prisoners -proceed -produce -profit -promise -promised -pronounce -property -prophet -proposal -propose -prosper -prospered -protecting -protection -prove -provender -provide -provided -providence -province -provision -provisions -prudence -public -publish -punishment -purchased -purify -purpose -pursue -pursued -pursuing -pursuit -put -putting -puvah -quarrel -quarreled -quartering -questioned -questions -quickly -quiet -quiver -ra'amah -rachel -rachel's -raid -raiders -raiment -rain -rained -raise -raised -raising -ram -ram'eses -rams -ran -rather -ravaged -raven -ravenous -re'u -reached -ready -really -reaped -reason -reassured -rebekah -rebekah's -rebelled -rebuked -receded -receive -received -reckoned -reckoning -recognize -recognized -records -rectitude -red -redeemed -redress -reduce -reed -refresh -refused -refusing -regard -regarded -regards -reho'both -reho'both-ir -reign -reigned -reliance -relief -relinquish -remain -remained -remaining -remains -remember -remembered -reminded -remnant -remove -removed -removing -render -renown -rent -repeated -repeatedly -reph'aim -replace -replaced -replied -report -representation -representative -representatives -reproach -require -required -requires -rescue -resen -reserve -reserved -respect -rest -rested -resting -restore -restored -restrained -return -returned -reu'el -reuben -reumah -revealed -revived -reward -rib -ribs -rich -ride -rider -right -righted -righteous -righteousness -rightly -rights -ring -rings -ripened -riphath -rise -risen -river -rivers -road -robe -rock -rode -rods -roll -rolled -roof -room -rooms -rose -rosh -roughly -round -rouse -routed -royal -rule -ruler -ruler's -run -runnels -sab'teca -sabtah -sack -sackcloth -sacks -sacred -sacrifice -sacrifices -saddle -saddled -safely -safety -said -sake -salaries -salem -salt -salvation -same -samlah -sand -sandal-thong -sar'ai -sarah -sarah's -sat -savages -saved -saving -savory -saw -say -saying -says -scarcely -scarlet -scatter -scattered -scepter -se'ir -sea -searched -seas -seashore -season -seasons -seba -second -secretly -secure -security -see -seed -seedtime -seeing -seek -seeking -seem -seemed -seen -sees -seize -seized -select -self-evident -sell -semen -send -sent -separate -separated -separation -sephar -sepulchre -sepulchres -serah -sered -serpent -serug -servant -servant's -servants -serve -served -service -serving -set -seth -settle -settled -settlement -seven -sevenfold -seventeen -seventeenth -seventh -seventy -seventy-five -seventy-seven -seventy-sevenfold -severe -sewed -sexes -sha'veh-kiriatha'im -shall -shammah -share -shaul -shaved -shaveh -she -she-asses -she-goat -she-goats -sheaf -shear -sheaves -sheba -shechem -shechem's -shed -sheds -sheep -sheepfolds -sheepshearers -shekel -shekels -shelah -sheleph -shelter -shem -sheme'ber -sheol -shepherd -shepherding -shepherds -shepho -shibah -shield -shillem -shimron -shinab -shinar -ships -shobal -shore -short -shortly -shot -should -shoulder -shoulders -show -showed -shown -shua -shua's -shuah -shuni -shur -shut -siddim -side -sidon -sight -sign -signet -signs -silence -silver -simeon -sin -since -sinew -sinites -sinned -sinners -sinning -sister -sister's -sit -sitnah -sitting -six -sixteen -sixth -sixty -sixty-five -sixty-nine -sixty-six -sixty-two -skilful -skin -skins -slain -slaughter -slave -slaves -slay -slays -sleek -sleep -sleeves -slept -slew -slope -slowly -small -smell -smelled -smoke -smoking -smooth -so -sodom -soil -sojourn -sojourned -sojourner -sojourners -sojourning -sojournings -sold -sole -solemnly -some -son -son's -songs -sons -sons' -sons-in-law -soon -sore -sorely -sorrow -sorrowful -sorry -sort -sorts -sought -soul -sound -south -southward -sow -sowed -space -spare -spared -speak -speaking -speaks -speckled -speech -spend -spent -spies -spilled -spirit -splendor -spoil -spoke -spoken -spotted -spread -spring -springing -springs -sprouted -sprung -staff -stage -stalk -stand -standing -stands -stars -state -states -states: -station -statute -statutes -stay -stayed -stead -steadfast -steal -steward -still -stole -stolen -stone -stones -stood -stooped -stop -stopped -store -stored -storehouses -story -stranger -strangers -straw -streaks -stream -street -strength -stretched -strife -striking -striped -stripped -striven -strong -stronger -strongly -struck -struggled -subdue -subdued -subject -submit -submitted -subsided -substance -subtle -success -successful -succoth -such -suck -suckle -suffer -sufferable -sufferance -suitable -summer -summoned -sun -superior -supplanted -supplied -support -suppose -supreme -surely -surety -surrounded -survivors -suspended -suspending -sustained -swallowed -swarm -swarming -swarms -swear -sweat -sword -swords -swore -sworn -system -systems -table -tahash -take -taken -taking -talked -talking -tamar -tamarisk -tambourine -tarried -tarry -tarshish -taxes -te'manites -tebah -teeth -tell -tells -tema -teman -ten -tender -tenderly -tent -tenth -tents -tenure -terah -terms: -territory -terror -tested -than -that -the -thee -their -theirs -them -themselves -then -thence -there -therefore -therein -these -they -thicket -thigh -thin -thing -things -thinking -third -thirteen -thirteenth -thirty -thirty-five -thirty-four -thirty-seven -thirty-three -thirty-two -this -thistles -thorns -thoroughly -those -thou -thought -thoughts -thousand -thousands -thread -three -threshing -throne -through -throughout -throw -thus -thy -tidal -tidings -ties -tigris -till -tiller -time -times -timna -timnah -tiras -to -today -togar'mah -together -toil -tola -told -tomb -tonight -too -took -top -tops -torch -torn -totally -totaly -touch -touched -touches -toward -tower -towns -trade -traders -train -trained -transgression -transient -transporting -travailed -treasure -treat -treated -tree -trees -trembled -trembling -trial -tribes -tried -troops -trouble -troubled -troubles -trough -troughs -truly -truth -truths -tubal -tubal- -tubal-cain -turn -turned -turns -turtledove -twelve -twenty -twenty-nine -twenty-seven -twenty-seventh -twice -twins -two -tyranny -tyrant -tyrants -unacknowledged -unalienable -unawares -uncircumcised -uncomfortable -uncovered -under -understand -understood -undistinguished -unfit -ungirded -united -unknown -unleavened -unless -unmoved -unstable -until -unusual -unwarrantable -unworth -up -upbraided -upon -uppermost -upright -ur -urged -us -us: -use -using -usurpations -utterly -uz -uzal -valley -valuable -vegetation -veil -vengeance -vent -vents -verified -very -vesture -villages -vindication -vine -vineyard -violence -violently -viper -virgin -vision -visions -visit -visited -voice -void -vow -wages -waging -wagons -wait -waited -walk -walked -walking -wall -wander -wandered -wanderer -wandering -wanting -wantonness -war -warfare -warned -was -wash -washed -washes -watch -water -watered -watering -waters -way -wayside -we -weak -weakness -wealth -wealthy -weaned -weapons -wear -wearied -weary -week -weep -weeping -weighed -weighing -weight -weights -welfare -well -well's -wells -went -wept -were -west -westward -what -whatever -whatsoever -wheat -whelp -when -whence -whenever -where -whereby -wherever -whether -which -while -white -who -whoever -whole -wholesome -whom -whomever -whose -why -wicked -wickedly -wickedness -widow -widow's -widowhood -wife -wife's -wild -wilderness -will -willing -wilt -wind -window -windows -wine -winged -winter -wise -with -withered -withheld -withhold -within -without -witness -wives -wolf -woman -woman's -womb -wombs -women -wood -word -words -wore -work -works -world -world: -worse -worship -worshiped -worth -worthy -would -wounding -wrapping -wrath -wrestled -wrestlings -wrong -wrought -year -yearned -years -yes -yet -yield -yielding -yoke -yonder -you -young -younger -youngest -your -yours -yourself -yourselves -youth -za'avan -zaph'enath-pane'ah -zeb'ulun -zeboi'im -zem'arites -zepho -zerah -zib'eon -zillah -zilpah -zimran -ziph'ion -zo'ar -zohar -zuzim diff --git a/icu4j/src/com/ibm/demo/DemoApplet.java b/icu4j/src/com/ibm/demo/DemoApplet.java deleted file mode 100755 index cc9cd52a57..0000000000 --- a/icu4j/src/com/ibm/demo/DemoApplet.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1997-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/Attic/DemoApplet.java,v $ - * $Date: 2001/10/30 02:42:50 $ - * $Revision: 1.4 $ - * - ***************************************************************************************** - */ - -package com.ibm.demo; - -import java.applet.Applet; -import java.util.Locale; -import java.awt.*; -import java.awt.event.*; - -public abstract class DemoApplet extends java.applet.Applet { - private Button demoButton; - private Frame demoFrame; - private static int demoFrameCount = 0; - - protected abstract Frame createDemoFrame(DemoApplet applet); - protected Dimension getDefaultFrameSize(DemoApplet applet, Frame f) { - return new Dimension(700, 550); - } - - //Create a button that will display the demo - public void init() - { - setBackground(Color.white); - demoButton = new Button("Demo"); - demoButton.setBackground(Color.yellow); - add( demoButton ); - - demoButton.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (e.getID() == ActionEvent.ACTION_PERFORMED) { - demoButton.setLabel("loading"); - - if (demoFrame == null) { - demoFrame = createDemoFrame(DemoApplet.this); - showDemo(); - } - - demoButton.setLabel("Demo"); - } - } - } ); - } - - public void showDemo() - { - demoFrame = createDemoFrame(this); - demoFrame.doLayout(); - Dimension d = getDefaultFrameSize(this, demoFrame); - demoFrame.setSize(d.width, d.height); - demoFrame.show(); - demoFrameOpened(); - } - - public void demoClosed() - { - demoFrame = null; - demoFrameClosed(); - } - - protected static void demoFrameOpened() { - demoFrameCount++; - } - protected static void demoFrameClosed() { - if (--demoFrameCount == 0) { - System.exit(0); - } - } -} - diff --git a/icu4j/src/com/ibm/demo/DemoTextBox.java b/icu4j/src/com/ibm/demo/DemoTextBox.java deleted file mode 100755 index 3d114976a7..0000000000 --- a/icu4j/src/com/ibm/demo/DemoTextBox.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1997-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/Attic/DemoTextBox.java,v $ - * $Date: 2000/03/10 03:47:42 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.demo; - - -import java.text.BreakIterator; -import java.awt.*; - -public class DemoTextBox { - - public DemoTextBox(Graphics g, String text, int width) - { - this.text = text; - this.chars = new char[text.length()]; - text.getChars(0, text.length(), chars, 0); - - this.width = width; - this.port = g; - this.metrics = g.getFontMetrics(); - - breakText(); - } - - public int getHeight() { - return (nbreaks + 1) * metrics.getHeight(); - } - - public void draw(Graphics g, int x, int y) - { - int index = 0; - - y += metrics.getAscent(); - - for (int i = 0; i < nbreaks; i++) - { - g.drawChars(chars, index, breakPos[i] - index, x, y); - index = breakPos[i]; - y += metrics.getHeight(); - } - - g.drawChars(chars, index, chars.length - index, x, y); - } - - - private void breakText() - { - if (metrics.charsWidth(chars, 0, chars.length) > width) - { - BreakIterator iter = BreakIterator.getWordInstance(); - iter.setText(text); - - int start = iter.first(); - int end = start; - int pos; - - while ( (pos = iter.next()) != BreakIterator.DONE ) - { - int w = metrics.charsWidth(chars, start, pos - start); - if (w > width) - { - // We've gone past the maximum width, so break the line - if (end > start) { - // There was at least one break position before this point - breakPos[nbreaks++] = end; - start = end; - end = pos; - } else { - // There weren't any break positions before this one, so - // let this word overflow the margin (yuck) - breakPos[nbreaks++] = pos; - start = end = pos; - } - } else { - // the current position still fits on the line; it's the best - // tentative break position we have so far. - end = pos; - } - - } - } - } - - private String text; - private char[] chars; - private Graphics port; - private FontMetrics metrics; - private int width; - - private int[] breakPos = new int[10]; // TODO: get real - private int nbreaks = 0; -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/demo/DemoUtility.java b/icu4j/src/com/ibm/demo/DemoUtility.java deleted file mode 100755 index 8a2c9e39b1..0000000000 --- a/icu4j/src/com/ibm/demo/DemoUtility.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1997-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/Attic/DemoUtility.java,v $ - * $Date: 2001/10/30 02:42:50 $ - * $Revision: 1.5 $ - * - ***************************************************************************************** - */ -package com.ibm.demo; - -import java.awt.*; -import java.lang.*; -import java.util.*; - -public class DemoUtility -{ - public static final Font titleFont = new Font("TimesRoman",Font.BOLD,18); - public static final Font labelFont = new Font("TimesRoman",Font.BOLD,14); - public static final Font choiceFont = new Font("Helvetica",Font.BOLD,12); - public static final Font editFont = new Font("Helvetica",Font.PLAIN,14); - public static final Font creditFont = new Font("Helvetica",Font.PLAIN,10); - public static final Font numberFont = new Font("sansserif", Font.PLAIN, 14); - - public static final Color bgColor = Color.lightGray; - public static final Color choiceColor = Color.white; - - public static final String copyright1 = - "(C) Copyright Taligent, Inc. 1996-1998. Copyright (C) IBM, Inc. 1998 - All Rights Reserved"; - public static final String copyright2 = - "Portions copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved."; - - /** - Provides easy way to use basic functions of GridBagLayout, without - the complications. After building a panel, and inserting all the - * subcomponents, call this to lay it out in the desired number of columns. - */ - public static void fixGrid(Container cont, int columns) { - GridBagLayout gridbag = new GridBagLayout(); - cont.setLayout(gridbag); - - GridBagConstraints c = new GridBagConstraints(); - c.fill = GridBagConstraints.VERTICAL; - c.weightx = 1.0; - c.insets = new Insets(2,2,2,2); - - Component[] components = cont.getComponents(); - for (int i = 0; i < components.length; ++i) { - // not used int colNumber = i%columns; - c.gridwidth = 1; // default - if ((i%columns) == columns - 1) - c.gridwidth = GridBagConstraints.REMAINDER; // last in grid - if (components[i] instanceof Label) { - switch (((Label)components[i]).getAlignment()) { - case Label.CENTER: c.anchor = GridBagConstraints.CENTER; break; - case Label.LEFT: c.anchor = GridBagConstraints.WEST; break; - case Label.RIGHT: c.anchor = GridBagConstraints.EAST; break; - } - } - gridbag.setConstraints(components[i], c); - } - - } - - /** - Provides easy way to change the spacing around an object in a GridBagLayout. - Call AFTER fixGridBag, passing in the container, the component, and the - new insets. - */ - public static void setInsets(Container cont, Component comp, Insets insets) { - GridBagLayout gbl = (GridBagLayout)cont.getLayout(); - GridBagConstraints g = gbl.getConstraints(comp); - g.insets = insets; - gbl.setConstraints(comp,g); - } - - public static Panel createSpacer() { - Panel spacer = new Panel(); - spacer.setLayout(null); - spacer.setSize(1000, 1); - return spacer; - } - - // to avoid goofy updates and misplaced cursors - public static void setText(TextComponent area, String newText) { - String foo = area.getText(); - if (foo.equals(newText)) return; - area.setText(newText); - } - - /** - * Compares two locals. Return value is negative - * if they're different, and more positive the more - * fields that match. - */ - - public static int compareLocales(Locale l1, Locale l2) - { - int result = -1; - - if (l1.getLanguage().equals(l2.getLanguage())) { - result += 1; - - if (l1.getCountry().equals(l2.getCountry())) { - result += 1; - - if (l1.getVariant().equals(l2.getVariant())) { - result += 1; - } - } - } - - return result; - } - - /** - * Get the G7 locale list for demos. - */ - public static Locale[] getG7Locales() { - return localeList; - } - private static Locale[] localeList = { - new Locale("DA", "DK", ""), - new Locale("EN", "US", ""), - new Locale("EN", "GB", ""), - new Locale("EN", "CA", ""), - new Locale("FR", "FR", ""), - new Locale("FR", "CA", ""), - new Locale("DE", "DE", ""), - new Locale("IT", "IT", ""), - //new Locale("JA", "JP", ""), - }; -} diff --git a/icu4j/src/com/ibm/demo/calendar/CalendarApp.java b/icu4j/src/com/ibm/demo/calendar/CalendarApp.java deleted file mode 100755 index 4ff0d483a3..0000000000 --- a/icu4j/src/com/ibm/demo/calendar/CalendarApp.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1997-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/calendar/Attic/CalendarApp.java,v $ - * $Date: 2000/05/12 23:21:23 $ - * $Revision: 1.5 $ - * - ***************************************************************************************** - */ - -package com.ibm.demo.calendar; - -import com.ibm.demo.*; - -import java.applet.Applet; -import java.awt.*; -import java.awt.event.*; -import java.net.*; -import java.io.*; - -import com.ibm.util.*; -import com.ibm.text.*; - -/** - * CalendarApp demonstrates how Calendar works. - */ -public class CalendarApp extends DemoApplet -{ - /** - * The main function which defines the behavior of the CalendarDemo - * applet when an applet is started. - */ - public static void main(String argv[]) { - - new CalendarApp().showDemo(); - } - - /* This creates a CalendarFrame for the demo applet. */ - public Frame createDemoFrame(DemoApplet applet) { - return new CalendarFrame(applet); - } -} diff --git a/icu4j/src/com/ibm/demo/calendar/CalendarCalc.java b/icu4j/src/com/ibm/demo/calendar/CalendarCalc.java deleted file mode 100755 index 18e7c1cc23..0000000000 --- a/icu4j/src/com/ibm/demo/calendar/CalendarCalc.java +++ /dev/null @@ -1,584 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1997-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/calendar/Attic/CalendarCalc.java,v $ - * $Date: 2001/10/30 02:42:50 $ - * $Revision: 1.9 $ - * - ***************************************************************************************** - */ - -package com.ibm.demo.calendar; - -import com.ibm.demo.*; - -import java.applet.Applet; -import java.util.Date; -import java.awt.*; -import java.awt.event.*; - -//import java.text.DateFormat; -import com.ibm.text.DateFormat; -import java.text.ParsePosition; - -//import java.util.Calendar; -import com.ibm.util.Calendar; -//import java.util.GregorianCalendar; -import com.ibm.util.GregorianCalendar; -//import java.util.TimeZone; -import com.ibm.util.TimeZone; -import java.util.Locale; - -import com.ibm.util.*; -import com.ibm.text.*; - -import javax.swing.*; - -/** - * CalendarCalc demonstrates how Date/Time formatter works. - */ -public class CalendarCalc extends DemoApplet -{ - /** - * The main function which defines the behavior of the MultiCalendarDemo - * applet when an applet is started. - */ - public static void main(String argv[]) { - new CalendarCalc().showDemo(); - } - - /** - * This creates a CalendarCalcFrame for the demo applet. - */ - public Frame createDemoFrame(DemoApplet applet) { - return new CalendarCalcFrame(applet); - } -} - -/** - * A Frame is a top-level window with a title. The default layout for a frame - * is BorderLayout. The CalendarCalcFrame class defines the window layout of - * MultiCalendarDemo. - */ -class CalendarCalcFrame extends Frame implements ActionListener -{ - private static final String creditString = ""; - - static final Locale[] locales = DemoUtility.getG7Locales(); - - private static final boolean DEBUG = false; - - private DemoApplet applet; - private long time = System.currentTimeMillis(); - - private static final RollAddField kRollAddFields[] = { - new RollAddField(Calendar.YEAR, "Year" ), - new RollAddField(Calendar.MONTH, "Month" ), - new RollAddField(Calendar.WEEK_OF_MONTH, "Week of Month" ), - new RollAddField(Calendar.WEEK_OF_YEAR, "Week of Year" ), - new RollAddField(Calendar.DAY_OF_MONTH, "Day of Month" ), - new RollAddField(Calendar.DAY_OF_WEEK, "Day of Week" ), - new RollAddField(Calendar.DAY_OF_WEEK_IN_MONTH, "Day of Week in Month" ), - new RollAddField(Calendar.DAY_OF_YEAR, "Day of Year" ), - new RollAddField(Calendar.AM_PM, "AM/PM" ), - new RollAddField(Calendar.HOUR_OF_DAY, "Hour of day" ), - new RollAddField(Calendar.HOUR, "Hour" ), - new RollAddField(Calendar.MINUTE, "Minute" ), - new RollAddField(Calendar.SECOND, "Second" ), - }; - - /** - * Constructs a new CalendarCalcFrame that is initially invisible. - */ - public CalendarCalcFrame(DemoApplet applet) - { - super("Multiple Calendar Demo"); - this.applet = applet; - init(); - start(); - } - - /** - * Initializes the applet. You never need to call this directly, it - * is called automatically by the system once the applet is created. - */ - public void init() - { - buildGUI(); - - patternText.setText( calendars[0].toPattern() ); - - // Force an update of the display - cityChanged(); - millisFormat(); - enableEvents(KeyEvent.KEY_RELEASED); - enableEvents(WindowEvent.WINDOW_CLOSING); - } - - //------------------------------------------------------------ - // package private - //------------------------------------------------------------ - void addWithFont(Container container, Component foo, Font font) { - if (font != null) - foo.setFont(font); - container.add(foo); - } - - /** - * Called to start the applet. You never need to call this method - * directly, it is called when the applet's document is visited. - */ - public void start() - { - // do nothing - } - - TextField patternText; - - Choice dateMenu; - Choice localeMenu; - - Button up; - Button down; - - Checkbox getRoll; - Checkbox getAdd; - - public void buildGUI() - { - setBackground(DemoUtility.bgColor); - setLayout(new FlowLayout()); // shouldn't be necessary, but it is. - -// TITLE - Label label1=new Label("Calendar Converter", Label.CENTER); - label1.setFont(DemoUtility.titleFont); - add(label1); - add(DemoUtility.createSpacer()); - -// IO Panel - Panel topPanel = new Panel(); - topPanel.setLayout(new FlowLayout()); - - CheckboxGroup group1= new CheckboxGroup(); - - // Set up the controls for each calendar we're demonstrating - for (int i = 0; i < calendars.length; i++) - { - Label label = new Label(calendars[i].name, Label.RIGHT); - label.setFont(DemoUtility.labelFont); - topPanel.add(label); - - topPanel.add(calendars[i].text); - - final int j = i; - calendars[i].text.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { - textChanged(j); - } - } ); - - calendars[i].rollAdd.setCheckboxGroup(group1); - topPanel.add(calendars[i].rollAdd); - } - calendars[0].rollAdd.setState(true); // Make the first one selected - - Label label4=new Label("Pattern", Label.RIGHT); - label4.setFont(DemoUtility.labelFont); - topPanel.add(label4); - - patternText=new TextField(FIELD_COLUMNS); - patternText.setFont(DemoUtility.editFont); - topPanel.add(patternText); - topPanel.add(new Label("")); - - DemoUtility.fixGrid(topPanel,3); - add(topPanel); - add(DemoUtility.createSpacer()); - -// ROLL / ADD - Panel rollAddPanel=new Panel(); - { - rollAddPanel.setLayout(new FlowLayout()); - - Panel rollAddBoxes = new Panel(); - { - rollAddBoxes.setLayout(new GridLayout(2,1)); - CheckboxGroup group2= new CheckboxGroup(); - getRoll = new Checkbox("Roll",group2, false); - getAdd = new Checkbox("Add",group2, true); - - rollAddBoxes.add(getRoll); - rollAddBoxes.add(getAdd); - } - - Label dateLabel=new Label("Date Fields"); - dateLabel.setFont(DemoUtility.labelFont); - - dateMenu= new Choice(); - dateMenu.setBackground(DemoUtility.choiceColor); - for (int i = 0; i < kRollAddFields.length; i++) { - dateMenu.addItem(kRollAddFields[i].name); - if (kRollAddFields[i].field == Calendar.MONTH) { - dateMenu.select(i); - } - } - - Panel upDown = new Panel(); - { - upDown.setLayout(new GridLayout(2,1)); - - // *** If the images are not found, we use the label. - up = new Button("^"); - down = new Button("v"); - up.setBackground(DemoUtility.bgColor); - down.setBackground(DemoUtility.bgColor); - upDown.add(up); - upDown.add(down); - up.addActionListener(this); - down.addActionListener(this); - } - - rollAddPanel.add(dateLabel); - rollAddPanel.add(dateMenu); - rollAddPanel.add(rollAddBoxes); - rollAddPanel.add(upDown); - - } - Panel localePanel = new Panel(); - { - // Make the locale popup menus - localeMenu= new Choice(); - Locale defaultLocale = Locale.getDefault(); - int bestMatch = -1, thisMatch = -1; - int selectMe = 0; - - for (int i = 0; i < locales.length; i++) { - if (i > 0 && locales[i].getLanguage().equals(locales[i-1].getLanguage()) || - i < locales.length - 1 && - locales[i].getLanguage().equals(locales[i+1].getLanguage())) - { - localeMenu.addItem( locales[i].getDisplayName() ); - } else { - localeMenu.addItem( locales[i].getDisplayLanguage()); - } - - thisMatch = DemoUtility.compareLocales(locales[i], defaultLocale); - - if (thisMatch >= bestMatch) { - bestMatch = thisMatch; - selectMe = i; - } - } - - localeMenu.setBackground(DemoUtility.choiceColor); - localeMenu.select(selectMe); - - Label localeLabel =new Label("Display Locale"); - localeLabel.setFont(DemoUtility.labelFont); - - localePanel.add(localeLabel); - localePanel.add(localeMenu); - DemoUtility.fixGrid(localePanel,2); - - localeMenu.addItemListener( new ItemListener() { - public void itemStateChanged(ItemEvent e) { - Locale loc = locales[localeMenu.getSelectedIndex()]; - System.out.println("Change locale to " + loc.getDisplayName()); - - for (int i = 0; i < calendars.length; i++) { - calendars[i].setLocale(loc); - } - millisFormat(); - } - } ); - } - add(rollAddPanel); - add(DemoUtility.createSpacer()); - add(localePanel); - add(DemoUtility.createSpacer()); - -// COPYRIGHT - Panel copyrightPanel = new Panel(); - addWithFont (copyrightPanel,new Label(DemoUtility.copyright1, Label.LEFT), - DemoUtility.creditFont); - DemoUtility.fixGrid(copyrightPanel,1); - add(copyrightPanel); - } - - /** - * This function is called when users change the pattern text. - */ - public void setFormatFromPattern() { - String timePattern = patternText.getText(); - - for (int i = 0; i < calendars.length; i++) { - calendars[i].applyPattern(timePattern); - } - - millisFormat(); - } - - /** - * This function is called when it is necessary to parse the time - * string in one of the formatted date fields - */ - public void textChanged(int index) { - String rightString = calendars[index].text.getText(); - - ParsePosition status = new ParsePosition(0); - - if (rightString.length() == 0) - { - errorText("Error: no input to parse!"); - return; - } - - try { - Date date = calendars[index].format.parse(rightString, status); - time = date.getTime(); - } - catch (Exception e) { - for (int i = 0; i < calendars.length; i++) { - if (i != index) { - calendars[i].text.setText("ERROR"); - } - } - errorText("Exception: " + e.getClass().toString() + " parsing: "+rightString); - return; - } - - int start = calendars[index].text.getSelectionStart(); - int end = calendars[index].text.getSelectionEnd(); - - millisFormat(); - - calendars[index].text.select(start,end); - } - - /** - * This function is called when it is necessary to format the time - * in the "Millis" text field. - */ - public void millisFormat() { - String out = ""; - - for (int i = 0; i < calendars.length; i++) { - try { - out = calendars[i].format.format(new Date(time)); - calendars[i].text.setText(out); - } - catch (Exception e) { - calendars[i].text.setText("ERROR"); - errorText("Exception: " + e.getClass().toString() + " formatting " - + calendars[i].name + " " + time); - } - } - } - - - /** - * This function is called when users change the pattern text. - */ - public void patternTextChanged() { - setFormatFromPattern(); - } - - /** - * This function is called when users select a new representative city. - */ - public void cityChanged() { - TimeZone timeZone = TimeZone.getDefault(); - - for (int i = 0; i < calendars.length; i++) { - calendars[i].format.setTimeZone(timeZone); - } - millisFormat(); - } - - /** - * This function is called when users select a new time field - * to add or roll its value. - */ - public void dateFieldChanged(boolean up) { - int field = kRollAddFields[dateMenu.getSelectedIndex()].field; - - for (int i = 0; i < calendars.length; i++) - { - if (calendars[i].rollAdd.getState()) - { - Calendar c = calendars[i].calendar; - c.setTime(new Date(time)); - - if (getAdd.getState()) { - c.add(field, up ? 1 : -1); - } else { - c.roll(field, up); - } - - time = c.getTime().getTime(); - millisFormat(); - break; - } - } - } - - /** - * Print out the error message while debugging this program. - */ - public void errorText(String s) - { - if (true) { - System.out.println(s); - } - } - - /** - * Called if an action occurs in the CalendarCalcFrame object. - */ - public void actionPerformed(ActionEvent evt) - { - // *** Button events are handled here. - Object obj = evt.getSource(); - System.out.println("action " + obj); - if (obj instanceof Button) { - if (evt.getSource() == up) { - dateFieldChanged(false); - } else - if (evt.getSource() == down) { - dateFieldChanged(true); - } - } - } - - /** - * Handles the event. Returns true if the event is handled and should not - * be passed to the parent of this component. The default event handler - * calls some helper methods to make life easier on the programmer. - */ - protected void processKeyEvent(KeyEvent evt) - { - System.out.println("key " + evt); - if (evt.getID() == KeyEvent.KEY_RELEASED) { - if (evt.getSource() == patternText) { - patternTextChanged(); - } - else { - for (int i = 0; i < calendars.length; i++) { - if (evt.getSource() == calendars[i].text) { - textChanged(i); - } - } - } - } - } - - protected void processWindowEvent(WindowEvent evt) - { - System.out.println("window " + evt); - if (evt.getID() == WindowEvent.WINDOW_CLOSING && - evt.getSource() == this) { - this.hide(); - this.dispose(); - - if (applet != null) { - applet.demoClosed(); - } else System.exit(0); - } - } - - /* - protected void processEvent(AWTEvent evt) - { - if (evt.getID() == AWTEvent. Event.ACTION_EVENT && evt.target == up) { - dateFieldChanged(true); - return true; - } - else if (evt.id == Event.ACTION_EVENT && evt.target == down) { - dateFieldChanged(false); - return true; - } - } - */ - - private static final int FIELD_COLUMNS = 35; - private static final String DEFAULT_FORMAT = "EEEE MMMM d, yyyy G"; - - - class CalendarRec { - public CalendarRec(String nameStr, Calendar cal) - { - name = nameStr; - calendar = cal; - rollAdd = new Checkbox(); - - text = new JTextField("",FIELD_COLUMNS); - text.setFont(DemoUtility.editFont); - - format = DateFormat.getDateInstance(cal, DateFormat.FULL, - Locale.getDefault()); - //format.applyPattern(DEFAULT_FORMAT); - } - - public void setLocale(Locale loc) { - String pattern = toPattern(); - - format = DateFormat.getDateInstance(calendar, DateFormat.FULL, - loc); - applyPattern(pattern); - } - - public void applyPattern(String pattern) { - if (format instanceof SimpleDateFormat) { - ((SimpleDateFormat)format).applyPattern(pattern); -//hey {al} - -// } else if (format instanceof java.text.SimpleDateFormat) { -// ((java.text.SimpleDateFormat)format).applyPattern(pattern); - } - } - - private String toPattern() { - if (format instanceof SimpleDateFormat) { - return ((SimpleDateFormat)format).toPattern(); -//hey {al} - -// } else if (format instanceof java.text.SimpleDateFormat) { -// return ((java.text.SimpleDateFormat)format).toPattern(); - } else { - return ""; - } - } - - Calendar calendar; - DateFormat format; - String name; - JTextField text; - Checkbox rollAdd; - }; - - private final CalendarRec[] calendars = { - new CalendarRec("Gregorian", new GregorianCalendar()), - new CalendarRec("Hebrew", new HebrewCalendar()), - new CalendarRec("Islamic (civil)", makeIslamic(true)), - new CalendarRec("Islamic (true)", makeIslamic(false)), - new CalendarRec("Buddhist", new BuddhistCalendar()), - new CalendarRec("Japanese", new JapaneseCalendar()), -// new CalendarRec("Chinese", new ChineseCalendar()), - }; - - static private final Calendar makeIslamic(boolean civil) { - IslamicCalendar cal = new IslamicCalendar(); - cal.setCivil(civil); - return cal; - }; -}; - -class RollAddField { - RollAddField(int field, String name) { - this.field = field; - this.name = name; - } - int field; - String name; -}; diff --git a/icu4j/src/com/ibm/demo/calendar/CalendarFrame.java b/icu4j/src/com/ibm/demo/calendar/CalendarFrame.java deleted file mode 100755 index 9b400fedec..0000000000 --- a/icu4j/src/com/ibm/demo/calendar/CalendarFrame.java +++ /dev/null @@ -1,435 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1997-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/calendar/Attic/CalendarFrame.java,v $ - * $Date: 2000/10/19 00:27:16 $ - * $Revision: 1.8 $ - * - ***************************************************************************************** - */ - -package com.ibm.demo.calendar; - -import com.ibm.demo.*; -import com.ibm.util.Calendar; -import com.ibm.util.HebrewCalendar; -import com.ibm.util.BuddhistCalendar; -import com.ibm.util.JapaneseCalendar; -import com.ibm.util.IslamicCalendar; -import com.ibm.text.SimpleDateFormat; -//import java.util.SimpleTimeZone; -import com.ibm.util.SimpleTimeZone; -import java.applet.Applet; -import java.awt.*; -import java.awt.event.*; -import java.net.*; -import java.io.*; -//import java.text.DateFormat; -import com.ibm.text.DateFormat; -import java.text.MessageFormat; -//import java.util.Calendar; -import com.ibm.util.Calendar; -import java.util.Date; -//import java.util.GregorianCalendar; -import com.ibm.util.GregorianCalendar; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.ResourceBundle; -//import java.util.TimeZone; -import com.ibm.util.TimeZone; - -/** - * A Frame is a top-level window with a title. The default layout for a frame - * is BorderLayout. The CalendarFrame class defines the window layout of - * CalendarDemo. - */ -class CalendarFrame extends Frame -{ - private static final boolean DEBUG = false; - - private DemoApplet applet; - - /** - * Constructs a new CalendarFrame that is initially invisible. - */ - public CalendarFrame(DemoApplet myApplet) - { - super("Calendar Demo"); - this.applet = myApplet; - init(); - - // When the window is closed, we want to shut down the applet or application - addWindowListener( - new WindowAdapter() { - public void windowClosing(WindowEvent e) { - setVisible(false); - dispose(); - - if (applet != null) { - applet.demoClosed(); - } else System.exit(0); - } - } ); - } - - private Choice displayMenu; - private Locale[] locales = DemoUtility.getG7Locales(); - - private Calendar calendars[] = new Calendar[2]; - private Choice calMenu[] = new Choice[2]; - private ColoredLabel monthLabel[] = new ColoredLabel[2]; - private DateFormat monthFormat[] = new DateFormat[2]; - - private Button prevYear; - private Button prevMonth; - private Button gotoToday; - private Button nextMonth; - private Button nextYear; - private CalendarPanel calendarPanel; - - private static void add(Container container, Component component, - GridBagLayout g, GridBagConstraints c, - int gridwidth, int weightx) - { - c.gridwidth = gridwidth; - c.weightx = weightx; - g.setConstraints(component, c); - container.add(component); - } - - /** - * Initializes the applet. You never need to call this directly, it - * is called automatically by the system once the applet is created. - */ - public void init() { - setBackground(DemoUtility.bgColor); - setLayout(new BorderLayout(10,10)); - - Panel topPanel = new Panel(); - GridBagLayout g = new GridBagLayout(); - topPanel.setLayout(g); - GridBagConstraints c = new GridBagConstraints(); - c.fill = GridBagConstraints.HORIZONTAL; - - // Build the two menus for selecting which calendar is displayed, - // plus the month/year label for each calendar - for (int i = 0; i < 2; i++) { - calMenu[i] = new Choice(); - for (int j = 0; j < CALENDARS.length; j++) { - calMenu[i].addItem(CALENDARS[j].name); - } - calMenu[i].setBackground(DemoUtility.choiceColor); - calMenu[i].select(i); - calMenu[i].addItemListener(new CalMenuListener()); - - // Label for the current month name - monthLabel[i] = new ColoredLabel("", COLORS[i]); - monthLabel[i].setFont(DemoUtility.titleFont); - - // And the default calendar to use for this slot - calendars[i] = CALENDARS[i].calendar; - - add(topPanel, calMenu[i], g, c, 5, 0); - add(topPanel, monthLabel[i], g, c, GridBagConstraints.REMAINDER, 1); - } - - // Now add the next/previous year/month buttons: - prevYear = new Button("<<"); - prevYear.addActionListener(new AddAction(Calendar.YEAR, -1)); - - prevMonth = new Button("<"); - prevMonth.addActionListener(new AddAction(Calendar.MONTH, -1)); - - gotoToday = new Button("Today"); - gotoToday.addActionListener( new ActionListener() - { - public void actionPerformed(ActionEvent e) { - calendarPanel.setDate( new Date() ); - updateMonthName(); - } - } ); - - nextMonth = new Button(">"); - nextMonth.addActionListener(new AddAction(Calendar.MONTH, 1)); - - nextYear = new Button(">>"); - nextYear.addActionListener(new AddAction(Calendar.YEAR, 1)); - - c.fill = GridBagConstraints.NONE; - add(topPanel, prevYear, g, c, 1, 0); - add(topPanel, prevMonth, g, c, 1, 0); - add(topPanel, gotoToday, g, c, 1, 0); - add(topPanel, nextMonth, g, c, 1, 0); - add(topPanel, nextYear, g, c, 1, 0); - - // Now add the menu for selecting the display language - Panel displayPanel = new Panel(); - { - displayMenu = new Choice(); - Locale defaultLocale = Locale.getDefault(); - int bestMatch = -1, thisMatch = -1; - int selectMe = 0; - - for (int i = 0; i < locales.length; i++) { - if (i > 0 && - locales[i].getLanguage().equals(locales[i-1].getLanguage()) || - i < locales.length - 1 && - locales[i].getLanguage().equals(locales[i+1].getLanguage())) - { - displayMenu.addItem( locales[i].getDisplayName() ); - } else { - displayMenu.addItem( locales[i].getDisplayLanguage()); - } - - thisMatch = DemoUtility.compareLocales(locales[i], defaultLocale); - - if (thisMatch >= bestMatch) { - bestMatch = thisMatch; - selectMe = i; - } - } - - displayMenu.setBackground(DemoUtility.choiceColor); - displayMenu.select(selectMe); - - displayMenu.addItemListener( new ItemListener() - { - public void itemStateChanged(ItemEvent e) { - Locale loc = locales[displayMenu.getSelectedIndex()]; - calendarPanel.setLocale( loc ); - monthFormat[0] = monthFormat[1] = null; - updateMonthName(); - repaint(); - } - } ); - - Label l1 = new Label("Display Language:", Label.RIGHT); - l1.setFont(DemoUtility.labelFont); - - displayPanel.setLayout(new FlowLayout()); - displayPanel.add(l1); - displayPanel.add(displayMenu); - - } - c.fill = GridBagConstraints.NONE; - c.anchor = GridBagConstraints.EAST; - - add(topPanel, displayPanel, g, c, GridBagConstraints.REMAINDER, 0); - - // The title, buttons, etc. go in a panel at the top of the window - add("North", topPanel); - - // The copyright notice goes at the bottom of the window - Label copyright = new Label(DemoUtility.copyright1, Label.LEFT); - copyright.setFont(DemoUtility.creditFont); - add("South", copyright); - - // Now create the big calendar panel and stick it in the middle - calendarPanel = new CalendarPanel( locales[displayMenu.getSelectedIndex()] ); - add("Center", calendarPanel); - - for (int i = 0; i < 2; i++) { - calendarPanel.setCalendar(i, calendars[i]); - calendarPanel.setColor(i, COLORS[i]); - } - - updateMonthName(); - }; - - - private void updateMonthName() - { - for (int i = 0; i < 2; i++) { - try { - if (monthFormat[i] == null) { // TODO: optimize - DateFormat f = DateFormat.getDateTimeInstance( - calendars[i], DateFormat.MEDIUM, -1, - locales[displayMenu.getSelectedIndex()]); - if (f instanceof com.ibm.text.SimpleDateFormat) { - com.ibm.text.SimpleDateFormat f1 = (com.ibm.text.SimpleDateFormat) f; - f1.applyPattern("MMMM, yyyy G"); - f1.setTimeZone(new SimpleTimeZone(0, "UTC")); -//hey {al} - -// } else if (f instanceof java.text.SimpleDateFormat) { -// java.text.SimpleDateFormat f1 = (java.text.SimpleDateFormat) f; -// f1.applyPattern("MMMM, yyyy G"); -// f1.setTimeZone(new SimpleTimeZone(0, "UTC")); - } - monthFormat[i] = f; - } - } catch (ClassCastException e) { - //hey {lw} - there's something wrong in this routine that cuases exceptions. - System.out.println(e); - } - - monthLabel[i].setText( monthFormat[i].format( calendarPanel.firstOfMonth() )); - } - } - - /** - * CalMenuListener responds to events in the two popup menus that select - * the calendar systems to be used in the display. It figures out which - * of the two menus the event occurred in and updates the corresponding - * element of the calendars[] array to match the new selection. - */ - private class CalMenuListener implements ItemListener - { - public void itemStateChanged(ItemEvent e) - { - for (int i = 0; i < calMenu.length; i++) - { - if (e.getItemSelectable() == calMenu[i]) - { - // We found the menu that the event happened in. - // Figure out which new calendar they selected. - Calendar newCal = CALENDARS[ calMenu[i].getSelectedIndex() ].calendar; - - if (newCal != calendars[i]) - { - // If any of the other menus are set to the same new calendar - // we're about to use for this menu, set them to the current - // calendar from *this* menu so we won't have two the same - for (int j = 0; j < calendars.length; j++) { - if (j != i && calendars[j] == newCal) { - calendars[j] = calendars[i]; - calendarPanel.setCalendar(j, calendars[j]); - monthFormat[j] = null; - - for (int k = 0; k < CALENDARS.length; k++) { - if (calendars[j] == CALENDARS[k].calendar) { - calMenu[j].select(k); - break; - } - } - } - } - // Now update this menu to use the new calendar the user selected - calendars[i] = newCal; - calendarPanel.setCalendar(i, newCal); - monthFormat[i] = null; - - updateMonthName(); - } - break; - } - } - } - }; - - /** - * AddAction handles the next/previous year/month buttons... - */ - private class AddAction implements ActionListener { - AddAction(int field, int amount) { - this.field = field; - this.amount = amount; - } - - public void actionPerformed(ActionEvent e) { - calendarPanel.add(field, amount); - updateMonthName(); - } - - private int field, amount; - } - - /** - * ColoredLabel is similar to java.awt.Label, with two differences: - * - * - You can set its text color - * - * - It draws text using drawString rather than using a host-specific - * "Peer" object like AWT does. On 1.2, using drawString gives - * us Bidi reordering for free. - */ - static private class ColoredLabel extends Component { - public ColoredLabel(String label) { - text = label; - } - - public ColoredLabel(String label, Color c) { - text = label; - color = c; - } - - public void setText(String label) { - text = label; - repaint(); - } - - public void setFont(Font f) { - font = f; - repaint(); - } - - public void paint(Graphics g) { - FontMetrics fm = g.getFontMetrics(font); - - Rectangle bounds = getBounds(); - - g.setColor(color); - g.setFont(font); - g.drawString(text, fm.stringWidth("\u00a0"), - bounds.height/2 + fm.getHeight() - - fm.getAscent() + fm.getLeading()/2); - } - - public Dimension getPreferredSize() { - return getMinimumSize(); - } - - public Dimension getMinimumSize() { - FontMetrics fm = getFontMetrics(font); - - return new Dimension( fm.stringWidth(text) + 2*fm.stringWidth("\u00a0"), - fm.getHeight() + fm.getLeading()*2); - } - - String text; - Color color = Color.black; - Font font = DemoUtility.labelFont; - } - - /** - * Print out the error message while debugging this program. - */ - public void errorText(String s) - { - if (DEBUG) - { - System.out.println(s); - } - } - - class CalendarRec { - public CalendarRec(String nameStr, Calendar cal) - { - name = nameStr; - calendar = cal; - } - - Calendar calendar; - String name; - }; - - private final CalendarRec[] CALENDARS = { - new CalendarRec("Gregorian Calendar", new GregorianCalendar()), - new CalendarRec("Hebrew Calendar", new HebrewCalendar()), - new CalendarRec("Islamic Calendar", makeIslamic(false)), - new CalendarRec("Islamic Civil Calendar ", makeIslamic(true)), - new CalendarRec("Buddhist Calendar", new BuddhistCalendar()), - new CalendarRec("Japanese Calendar", new JapaneseCalendar()), - }; - - static private final Calendar makeIslamic(boolean civil) { - IslamicCalendar cal = new IslamicCalendar(); - cal.setCivil(civil); - return cal; - }; - - static final Color[] COLORS = { Color.blue, Color.black }; -} - diff --git a/icu4j/src/com/ibm/demo/calendar/CalendarPanel.java b/icu4j/src/com/ibm/demo/calendar/CalendarPanel.java deleted file mode 100755 index 7ce6db6fa8..0000000000 --- a/icu4j/src/com/ibm/demo/calendar/CalendarPanel.java +++ /dev/null @@ -1,369 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1997-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/calendar/Attic/CalendarPanel.java,v $ - * $Date: 2001/09/08 01:38:55 $ - * $Revision: 1.7 $ - * - ***************************************************************************************** - */ - -package com.ibm.demo.calendar; - -import com.ibm.demo.*; - -import java.applet.Applet; -import java.awt.*; -import java.awt.event.*; -//import java.util.*; -import java.net.*; -import java.io.*; - -//import java.text.DateFormat; -import com.ibm.text.DateFormat; -//import java.util.SimpleTimeZone; -import com.ibm.util.SimpleTimeZone; -//import java.util.*; -import java.util.Date; -import java.util.Locale; - -import com.ibm.util.*; -import com.ibm.text.*; - -class CalendarPanel extends Canvas { - - public CalendarPanel( Locale locale ) { - setLocale(locale); - } - - public void setLocale(Locale locale) { - if (fDisplayLocale == null || !fDisplayLocale.equals(locale)) { - fDisplayLocale = locale; - dirty = true; - - for (int i = 0; i < fCalendar.length; i++) { - if (fCalendar[i] != null) { - fSymbols[i] = new DateFormatSymbols(fCalendar[i], - fDisplayLocale); - } - } - String lang = locale.getLanguage(); - leftToRight = !(lang.equals("iw") || lang.equals("ar")); - - repaint(); - } - } - - public void setDate(Date date) { - fStartOfMonth = date; - dirty = true; - repaint(); - } - - public void add(int field, int delta) - { - synchronized(fCalendar) { - fCalendar[0].setTime(fStartOfMonth); - fCalendar[0].add(field, delta); - fStartOfMonth = fCalendar[0].getTime(); - } - dirty = true; - repaint(); - } - - public void setColor(int index, Color c) { - fColor[index] = c; - repaint(); - } - - public void setCalendar(int index, Calendar c) { - Date date = (fCalendar[index] == null) ? new Date() - : fCalendar[index].getTime(); - - fCalendar[index] = c; - fCalendar[index].setTime(date); - - fSymbols[index] = new DateFormatSymbols(c, fDisplayLocale); - dirty = true; - repaint(); - } - - public Calendar getCalendar(int index) { - return fCalendar[index]; - } - - public Locale getDisplayLocale() { - return fDisplayLocale; - } - - public Date firstOfMonth() { - return fStartOfMonth; - } - - private Date startOfMonth(Date dateInMonth) - { - synchronized(fCalendar) { - fCalendar[0].setTime(dateInMonth); - - int era = fCalendar[0].get(Calendar.ERA); - int year = fCalendar[0].get(Calendar.YEAR); - int month = fCalendar[0].get(Calendar.MONTH); - - fCalendar[0].clear(); - fCalendar[0].set(Calendar.ERA, era); - fCalendar[0].set(Calendar.YEAR, year); - fCalendar[0].set(Calendar.MONTH, month); - fCalendar[0].set(Calendar.DATE, 1); - - return fCalendar[0].getTime(); - } - } - - private void calculate() - { - // - // As a workaround for JDK 1.1.3 and below, where Calendars and time - // zones are a bit goofy, always set my calendar's time zone to UTC. - // You would think I would want to do this in the "set" function above, - // but if I do that, the program hangs when this class is loaded, - // perhaps due to some sort of static initialization ordering problem. - // So I do it here instead. - // - fCalendar[0].setTimeZone(new SimpleTimeZone(0, "UTC")); - - Calendar c = (Calendar)fCalendar[0].clone(); // Temporary copy - - fStartOfMonth = startOfMonth(fStartOfMonth); - - // Stash away a few useful constants for this calendar and display - minDay = c.getMinimum(Calendar.DAY_OF_WEEK); - daysInWeek = c.getMaximum(Calendar.DAY_OF_WEEK) - minDay + 1; - - firstDayOfWeek = Calendar.getInstance(fDisplayLocale).getFirstDayOfWeek(); - - // Stash away a Date for the start of this month - - // Find the day of week of the first day in this month - c.setTime(fStartOfMonth); - firstDayInMonth = c.get(Calendar.DAY_OF_WEEK); - int firstWeek = c.get(Calendar.WEEK_OF_MONTH); - - // Now find the # of days in the month - c.roll(Calendar.DATE, false); - daysInMonth = c.get(Calendar.DATE); - - // Finally, find the end of the month, i.e. the start of the next one - c.roll(Calendar.DATE, true); - c.add(Calendar.MONTH, 1); - c.getTime(); // JDK 1.1.2 bug workaround - c.add(Calendar.SECOND, -1); - Date endOfMonth = c.getTime(); - endOfMonth = null; - int lastWeek = c.get(Calendar.WEEK_OF_MONTH); - - // Calculate the number of full or partial weeks in this month. - numWeeks = lastWeek - firstWeek + 1; - - dirty = false; - } - - static final int XINSET = 4; - static final int YINSET = 2; - - /* - * Convert from the day number within a month (1-based) - * to the cell coordinates on the calendar (0-based) - */ - private void dateToCell(int date, Point pos) - { - int cell = (date + firstDayInMonth - firstDayOfWeek - minDay); - if (firstDayInMonth < firstDayOfWeek) { - cell += daysInWeek; - } - - pos.x = cell % daysInWeek; - pos.y = cell / daysInWeek; - } - private Point dateToCell(int date) { - Point p = new Point(0,0); - dateToCell(date, p); - return p; - } - - public void paint(Graphics g) { - - if (dirty) { - calculate(); - } - - Point cellPos = new Point(0,0); // Temporary variable - Dimension d = this.getSize(); - - g.setColor(Color.lightGray); - g.fillRect(0,0,d.width,d.height); - - // Draw the day names at the top - g.setColor(Color.black); - g.setFont(DemoUtility.labelFont); - FontMetrics fm = g.getFontMetrics(); - int labelHeight = fm.getHeight() + YINSET * 2; - - int v = fm.getAscent() + YINSET; - for (int i = 0; i < daysInWeek; i++) { - int dayNum = (i + minDay + firstDayOfWeek - 2) % daysInWeek + 1; - String dayName = fSymbols[0].getWeekdays()[dayNum]; - - - double h; - if (leftToRight) { - h = d.width*(i + 0.5) / daysInWeek; - } else { - h = d.width*(daysInWeek - i - 0.5) / daysInWeek; - } - h -= fm.stringWidth(dayName) / 2; - - g.drawString(dayName, (int)h, v); - } - - double cellHeight = (d.height - labelHeight - 1) / numWeeks; - double cellWidth = (double)(d.width - 1) / daysInWeek; - - // Draw a white background in the part of the calendar - // that displays this month. - // First figure out how much of the first week should be shaded. - { - g.setColor(Color.white); - dateToCell(1, cellPos); - int width = (int)(cellPos.x*cellWidth); // Width of unshaded area - - if (leftToRight) { - g.fillRect((int)(width), labelHeight , - d.width - width, (int)cellHeight); - } else { - g.fillRect(0, labelHeight , - d.width - width, (int)cellHeight); - } - - // All of the intermediate weeks get shaded completely - g.fillRect(0, (int)(labelHeight + cellHeight), - d.width, (int)(cellHeight * (numWeeks - 2))); - - // Now figure out the last week. - dateToCell(daysInMonth, cellPos); - width = (int)((cellPos.x+1)*cellWidth); // Width of shaded area - - if (leftToRight) { - g.fillRect(0, (int)(labelHeight + (numWeeks-1) * cellHeight), - width, (int)cellHeight); - } else { - g.fillRect(d.width - width, (int)(labelHeight + (numWeeks-1) * cellHeight), - width, (int)cellHeight); - } - - } - // Draw the X/Y grid lines - g.setColor(Color.black); - for (int i = 0; i <= numWeeks; i++) { - int y = (int)(labelHeight + i * cellHeight); - g.drawLine(0, y, d.width - 1, y); - } - for (int i = 0; i <= daysInWeek; i++) { - int x = (int)(i * cellWidth); - g.drawLine(x, labelHeight, x, d.height - 1); - } - - // Now loop through all of the days in the month, figure out where - // they go in the grid, and draw the day # for each one - - // Figure out the date of the first cell in the calendar display - int cell = (1 + firstDayInMonth - firstDayOfWeek - minDay); - if (firstDayInMonth < firstDayOfWeek) { - cell += daysInWeek; - } - - Calendar c = (Calendar)fCalendar[0].clone(); - c.setTime(fStartOfMonth); - c.add(Calendar.DATE, -cell); - - StringBuffer buffer = new StringBuffer(); - - for (int row = 0; row < numWeeks; row++) { - for (int col = 0; col < daysInWeek; col++) { - - g.setFont(DemoUtility.numberFont); - g.setColor(Color.black); - fm = g.getFontMetrics(); - - int cellx; - if (leftToRight) { - cellx = (int)((col) * cellWidth); - } else { - cellx = (int)((daysInWeek - col - 1) * cellWidth); - } - - int celly = (int)(row * cellHeight + labelHeight); - - for (int i = 0; i < 2; i++) { - fCalendar[i].setTime(c.getTime()); - - int date = fCalendar[i].get(Calendar.DATE); - buffer.setLength(0); - buffer.append(date); - String dayNum = buffer.toString(); - - int x; - - if (leftToRight) { - x = cellx + (int)cellWidth - XINSET - fm.stringWidth(dayNum); - } else { - x = cellx + XINSET; - } - int y = celly + + fm.getAscent() + YINSET + i * fm.getHeight(); - - if (fColor[i] != null) { - g.setColor(fColor[i]); - } - g.drawString(dayNum, x, y); - - if (date == 1 || row == 0 && col == 0) { - g.setFont(DemoUtility.numberFont); - String month = fSymbols[i].getMonths()[ - fCalendar[i].get(Calendar.MONTH)]; - - if (leftToRight) { - x = cellx + XINSET; - } else { - x = cellx + (int)cellWidth - XINSET - fm.stringWidth(month); - } - g.drawString(month, x, y); - } - } - - c.add(Calendar.DATE, 1); - } - } - } - - // Important state variables - private Calendar[] fCalendar = new Calendar[4]; - private Color[] fColor = new Color[4]; - - private Locale fDisplayLocale; - private DateFormatSymbols[] fSymbols = new DateFormatSymbols[4]; - - private Date fStartOfMonth = new Date(); // 00:00:00 on first day of month - - // Cached calculations to make drawing faster. - private transient int minDay; // Minimum legal day # - private transient int daysInWeek; // # of days in a week - private transient int firstDayOfWeek; // First day to display in week - private transient int numWeeks; // # full or partial weeks in month - private transient int daysInMonth; // # days in this month - private transient int firstDayInMonth; // Day of week of first day in month - private transient boolean leftToRight; - - private transient boolean dirty = true; -} diff --git a/icu4j/src/com/ibm/demo/calendar/package.html b/icu4j/src/com/ibm/demo/calendar/package.html deleted file mode 100755 index 5275b89c88..0000000000 --- a/icu4j/src/com/ibm/demo/calendar/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Calendar demo applications including date/time arithmetic. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/demo/holiday/HolidayBorderPanel.java b/icu4j/src/com/ibm/demo/holiday/HolidayBorderPanel.java deleted file mode 100755 index 4bc478be3c..0000000000 --- a/icu4j/src/com/ibm/demo/holiday/HolidayBorderPanel.java +++ /dev/null @@ -1,551 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1997-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/holiday/Attic/HolidayBorderPanel.java,v $ - * $Date: 2001/10/30 02:42:50 $ - * $Revision: 1.4 $ - * - ***************************************************************************************** - */ -package com.ibm.demo.holiday; - -import com.ibm.demo.*; -import java.awt.*; - -/** - * Various graphical borders. The border itself is a Panel so that it can - * contain other Components (i.e. it borders something). You use the - * HolidayBorderPanel like any other Panel: you set the layout that you prefer and - * add Components to it. Beware that a null layout does not obey the insets - * of the panel so if you use null layouts, adjust your measurements to - * handle the border by calling insets(). - * - * @author Andy Clark, Taligent Inc. - * @version 1.0 - */ -public class HolidayBorderPanel extends Panel { - // Constants - - /** Solid border. */ - public final static int SOLID = 0; - /** A raised border. */ - public final static int RAISED = 1; - /** A lowered border. */ - public final static int LOWERED = 2; - /** An etched in border. */ - public final static int IN = 3; - /** An etched out border. */ - public final static int OUT = 4; - - /** Left alignment. */ - public final static int LEFT = 0; - /** Center alignment. */ - public final static int CENTER = 1; - /** Right alignment. */ - public final static int RIGHT = 2; - - /** Default style (IN). */ - public final static int DEFAULT_STYLE = IN; - /** Default thickness (10). */ - public final static int DEFAULT_THICKNESS = 10; - /** Default thickness for solid borders (4). */ - public final static int DEFAULT_SOLID_THICKNESS = 4; - /** Default thickness for raised borders (2). */ - public final static int DEFAULT_RAISED_THICKNESS = 2; - /** Default thickness for lowered borders (2). */ - public final static int DEFAULT_LOWERED_THICKNESS = 2; - /** Default thickness for etched-in borders (10). */ - public final static int DEFAULT_IN_THICKNESS = 10; - /** Default thickness for etched-out borders (10). */ - public final static int DEFAULT_OUT_THICKNESS = 10; - /** Default gap between border and contained component (5). */ - public final static int DEFAULT_GAP = 5; - /** Default color (black). Applies to SOLID and etched borders. */ - public final static Color DEFAULT_COLOR = Color.black; - - /** Default font (TimesRoman,PLAIN,14). Only applies to etched borders. */ - public final static Font DEFAULT_FONT = new Font("TimesRoman", Font.PLAIN, 14); - /** Default alignment (LEFT). Only applies to etched borders. */ - public final static int DEFAULT_ALIGNMENT = LEFT; - - // Data - private int style; - private int thickness; - private int gap; - private Color color; - - private Font font; - private String text; - private int alignment; - - /** - * Constructor. Makes default border. - */ - public HolidayBorderPanel() { - - // initialize data - style = DEFAULT_STYLE; - thickness = DEFAULT_THICKNESS; - gap = DEFAULT_GAP; - color = DEFAULT_COLOR; - - text = null; - font = DEFAULT_FONT; - alignment = DEFAULT_ALIGNMENT; - - } - - /** - * Constructor. Makes an etched IN border with given text caption. - * - * @param text Text caption - */ - public HolidayBorderPanel(String text) { - this(); - - style = IN; - this.text = text; - } - - /** - * Constructor. Makes SOLID border with color and thickness given. - * - * @param color The color for the border. - * @param thickness The thickness of the border. - */ - public HolidayBorderPanel(Color color, int thickness) { - this(); - - style = SOLID; - this.color = color; - this.thickness = thickness; - } - - /** - * Constructor. Makes a border of the given style with the default - * thickness for that style. - * - * @param style The style for this border. - */ - public HolidayBorderPanel(int style) { - this(); - - // set thickness appropriate to this style - int thickness; - switch (style) { - case SOLID: thickness = DEFAULT_SOLID_THICKNESS; break; - case RAISED: thickness = DEFAULT_RAISED_THICKNESS; break; - case LOWERED: thickness = DEFAULT_LOWERED_THICKNESS; break; - case IN: thickness = DEFAULT_IN_THICKNESS; break; - case OUT: thickness = DEFAULT_OUT_THICKNESS; break; - default: - thickness = DEFAULT_THICKNESS; - } - - this.style = style; - this.thickness = thickness; - } - - /** - * Constructor. Makes border with given style and thickness. - * - * @param style The style for this border. - * @param thickness The thickness for this border. - */ - public HolidayBorderPanel(int style, int thickness) { - this(); - - this.style = style; - this.thickness = thickness; - } - - /** - * Returns the insets of this panel.. - */ - public Insets getInsets() { - int adjustment = 0; - - // adjust for text string - if (style == IN || style == OUT) { - if (text != null && text.length() > 0) { - try { - // set font and get info - int height = getGraphics().getFontMetrics(font).getHeight(); - if (height > thickness) - adjustment = height - thickness; - } - catch (Exception e) { - // nothing: just in case there is no graphics context - // at the beginning. - System.out.print(""); - } - } - } - - // return appropriate insets - int dist = thickness + gap; - return new Insets(dist + adjustment, dist, dist, dist); - } - - /** - * Sets the style of the border - * - * @param style The new style. - */ - public HolidayBorderPanel setStyle(int style) { - - // set the style and re-layout the panel - this.style = style; - doLayout(); - repaint(); - - return this; - } - - /** - * Gets the style of the border - */ - public int getStyle() { - - return style; - } - - /** - * Sets the thickness of the border. - * - * @param thickness The new thickness - */ - public HolidayBorderPanel setThickness(int thickness) { - - if (thickness > 0) { - this.thickness = thickness; - doLayout(); - repaint(); - } - - return this; - } - - /** - * Gets the thickness of the border. - */ - public int getThickness() { - - return thickness; - } - - /** - * Sets the gap between the border and the contained Component. - * - * @param gap The new gap, in pixels. - */ - public HolidayBorderPanel setGap(int gap) { - - if (gap > -1) { - this.gap = gap; - doLayout(); - repaint(); - } - - return this; - } - - /** - * Gets the gap between the border and the contained Component. - */ - public int getGap() { - - return gap; - } - - /** - * Sets the current color for SOLID borders and the caption text - * color for etched borders. - * - * @param color The new color. - */ - public HolidayBorderPanel setColor(Color color) { - - this.color = color; - if (style == SOLID || style == IN || style == OUT) - repaint(); - - return this; - } - - /** - * Gets the current color for SOLID borders and the caption - * text color for etched borders. - */ - public Color getColor() { - - return color; - } - - /** - * Sets the font. Only applies to etched borders. - */ - public HolidayBorderPanel setTextFont(Font font) { - - // set font - if (font != null) { - this.font = font; - if (style == IN || style == OUT) { - doLayout(); - repaint(); - } - } - - return this; - } - - /** - * Gets the font of the text. Only applies to etched borders. - */ - public Font getTextFont() { - - return font; - } - - /** - * Sets the text. Only applies to etched borders. - * - * @param text The new text. - */ - public HolidayBorderPanel setText(String text) { - - this.text = text; - if (style == IN || style == OUT) { - doLayout(); - repaint(); - } - - return this; - } - - /** - * Gets the text. Only applies to etched borders. - */ - public String getText() { - - return text; - } - - /** - * Sets the text alignment. Only applies to etched borders. - * - * @param alignment The new alignment. - */ - public HolidayBorderPanel setAlignment(int alignment) { - - this.alignment = alignment; - if (style == IN || style == OUT) { - doLayout(); - repaint(); - } - - return this; - } - - /** - * Gets the text alignment. - */ - public int getAlignment() { - - return alignment; - } - - /** - * Repaints the border. - * - * @param g The graphics context. - */ - public void paint(Graphics g) { - - // get current dimensions - Dimension size = getSize(); - int width = size.width; - int height = size.height; - - // set colors - Color light = getBackground().brighter().brighter().brighter(); - Color dark = getBackground().darker().darker().darker(); - - // Draw border - switch (style) { - case RAISED: // 3D Border (in or out) - case LOWERED: - Color topleft = null; - Color bottomright = null; - - // set colors - if (style == RAISED) { - topleft = light; - bottomright = dark; - } - else { - topleft = dark; - bottomright = light; - } - - // draw border - g.setColor(topleft); - for (int i = 0; i < thickness; i++) { - g.drawLine(i, i, width - i - 2, i); - g.drawLine(i, i + 1, i, height - i - 1); - } - g.setColor(bottomright); - for (int i = 0; i < thickness; i++) { - g.drawLine(i + 1, height - i - 1, width - i - 1, height - i - 1); - g.drawLine(width - i - 1, i, width - i - 1, height - i - 2); - } - break; - - case IN: // Etched Border (in or out) - case OUT: - int adjust1 = 0; - int adjust2 = 0; - - // set font and get info - Font oldfont = g.getFont(); - g.setFont(font); - FontMetrics fm = g.getFontMetrics(); - int ascent = fm.getAscent(); - - // set adjustment - if (style == IN) - adjust1 = 1; - else - adjust2 = 1; - - // Calculate adjustment for text - int adjustment = 0; - if (text != null && text.length() > 0) { - if (ascent > thickness) - adjustment = (ascent - thickness) / 2; - } - - // The adjustment is there so that we always draw the - // light rectangle first. Otherwise, your eye picks up - // the discrepancy where the light rect. passes over - // the darker rect. - int x = thickness / 2; - int y = thickness / 2 + adjustment; - int w = width - thickness - 1; - int h = height - thickness - 1 - adjustment; - - // draw rectangles - g.setColor(light); - g.drawRect(x + adjust1, y + adjust1, w, h); - g.setColor(dark); - g.drawRect(x + adjust2, y + adjust2, w, h); - - // draw text, if applicable - if (text != null && text.length() > 0) { - // calculate drawing area - int fontheight = fm.getHeight(); - int strwidth = fm.stringWidth(text); - - int textwidth = width - 2 * (thickness + 5); - if (strwidth > textwidth) - strwidth = textwidth; - - // calculate offset for alignment - int offset; - switch (alignment) { - case CENTER: - offset = (width - strwidth) / 2; - break; - case RIGHT: - offset = width - strwidth - thickness - 5; - break; - case LEFT: - default: // assume left alignment if invalid - offset = thickness + 5; - break; - } - - // clear drawing area and set clipping region - g.clearRect(offset - 5, 0, strwidth + 10, fontheight); - g.clipRect(offset, 0, strwidth, fontheight); - - // draw text - g.setColor(color); - g.drawString(text, offset, ascent); - - // restore old clipping area - g.clipRect(0, 0, width, height); - } - - g.setFont(oldfont); - break; - - case SOLID: - default: // assume SOLID - g.setColor(color); - for (int i = 0; i < thickness; i++) - g.drawRect(i, i, width - 2 * i - 1, height - 2 * i - 1); - } - - } - - /** - * Returns the settings of this HolidayBorderPanel instance as a string. - */ - public String toString() { - StringBuffer str = new StringBuffer("HolidayBorderPanel["); - - // style - str.append("style="); - switch (style) { - case SOLID: str.append("SOLID"); break; - case RAISED: str.append("RAISED"); break; - case LOWERED: str.append("LOWERED"); break; - case IN: str.append("IN"); break; - case OUT: str.append("OUT"); break; - default: str.append("unknown"); - } - str.append(","); - - // thickness - str.append("thickness="); - str.append(thickness); - str.append(","); - - // gap - str.append("gap="); - str.append(gap); - str.append(","); - - // color - str.append(color); - str.append(","); - - // font - str.append(font); - str.append(","); - - // text - str.append("text="); - str.append(text); - str.append(","); - - // alignment - str.append("alignment="); - switch (alignment) { - case LEFT: str.append("LEFT"); break; - case CENTER: str.append("CENTER"); break; - case RIGHT: str.append("RIGHT"); break; - default: str.append("unknown"); - } - - str.append("]"); - - return str.toString(); - } - - } - diff --git a/icu4j/src/com/ibm/demo/holiday/HolidayCalendarDemo.java b/icu4j/src/com/ibm/demo/holiday/HolidayCalendarDemo.java deleted file mode 100755 index bb7f3906fe..0000000000 --- a/icu4j/src/com/ibm/demo/holiday/HolidayCalendarDemo.java +++ /dev/null @@ -1,721 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/holiday/Attic/HolidayCalendarDemo.java,v $ - * $Date: 2001/10/30 02:42:49 $ - * $Revision: 1.7 $ - * - ***************************************************************************************** - */ - -package com.ibm.demo.holiday; - -import com.ibm.demo.*; -import java.applet.Applet; -import java.awt.*; -import java.awt.event.*; -//import java.util.*; -import java.net.*; -import java.io.*; - -//import java.text.SimpleDateFormat; -import com.ibm.text.SimpleDateFormat; -import java.text.DateFormatSymbols; -//import java.util.SimpleTimeZone; -import com.ibm.util.SimpleTimeZone; -import java.util.Locale; -import java.util.Vector; -import java.util.Date; - -import com.ibm.util.*; - -/** - * CalendarDemo demonstrates how Calendar works. - */ -public class HolidayCalendarDemo extends DemoApplet -{ - /** - * The main function which defines the behavior of the CalendarDemo - * applet when an applet is started. - */ - public static void main(String argv[]) { - - new HolidayCalendarDemo().showDemo(); - } - - /* This creates a CalendarFrame for the demo applet. */ - public Frame createDemoFrame(DemoApplet applet) { - return new CalendarFrame(applet); - } - - /** - * A Frame is a top-level window with a title. The default layout for a frame - * is BorderLayout. The CalendarFrame class defines the window layout of - * CalendarDemo. - */ - private static class CalendarFrame extends Frame implements ActionListener, - ItemListener - { - private static final String creditString = ""; - - private static final boolean DEBUG = false; - - private Locale curLocale = Locale.US; - - private DemoApplet applet; - - private static final Locale[] calendars = { - //new Locale("de","AT"), - Locale.CANADA, - Locale.CANADA_FRENCH, - Locale.FRANCE, - Locale.GERMANY, - new Locale("iw","IL"), - new Locale("el","GR"), - //new Locale("es","MX"), - Locale.UK, - Locale.US, - }; - private static final Locale[] displays = { - Locale.CANADA, - Locale.UK, - Locale.US, - Locale.FRANCE, - Locale.CANADA_FRENCH, - //new Locale("de","AT"), - Locale.GERMAN, - new Locale("el","GR"), - //new Locale("iw","IL"), - new Locale("es","MX"), - }; - - /** - * Constructs a new CalendarFrame that is initially invisible. - */ - public CalendarFrame(DemoApplet applet) - { - super("Calendar Demo"); - this.applet = applet; - init(); - start(); - enableEvents(WindowEvent.WINDOW_CLOSING); - } - - /** - * Initializes the applet. You never need to call this directly, it - * is called automatically by the system once the applet is created. - */ - public void init() - { - // Get G7 locales only for demo purpose. To get all the locales - // supported, switch to calling Calendar.getAvailableLocales(). - // commented - locales = displays; - - buildGUI(); - } - - //------------------------------------------------------------ - // package private - //------------------------------------------------------------ - void addWithFont(Container container, Component foo, Font font) { - if (font != null) - foo.setFont(font); - container.add(foo); - } - - /** - * Called to start the applet. You never need to call this method - * directly, it is called when the applet's document is visited. - */ - public void start() - { - // do nothing - } - - private Choice localeMenu; - private Choice displayMenu; - private Locale[] locales; - - private Label monthLabel; - private Button prevYear; - private Button prevMonth; - private Button gotoToday; - private Button nextMonth; - private Button nextYear; - private CalendarPanel calendarPanel; - - private static final Locale kFirstLocale = Locale.US; - - private static void add(Container container, Component component, - GridBagLayout g, GridBagConstraints c) - { - g.setConstraints(component, c); - container.add(component); - } - - public void buildGUI() - { - setBackground(DemoUtility.bgColor); - setLayout(new BorderLayout(10,10)); - - // Label for the demo's title - Label titleLabel = new Label("Calendar Demo", Label.CENTER); - titleLabel.setFont(DemoUtility.titleFont); - - // Label for the current month name - monthLabel = new Label("", Label.LEFT); - monthLabel.setFont(new Font(DemoUtility.titleFont.getName(), - DemoUtility.titleFont.getStyle(), - (DemoUtility.titleFont.getSize() * 3)/2)); - - // Make the locale popup menus - localeMenu= new Choice(); - localeMenu.addItemListener(this); - int selectMe = 0; - - for (int i = 0; i < calendars.length; i++) { - if (i > 0 && - calendars[i].getCountry().equals(calendars[i-1].getCountry()) || - i < calendars.length - 1 && - calendars[i].getCountry().equals(calendars[i+1].getCountry())) - { - localeMenu.addItem(calendars[i].getDisplayCountry() + " (" + - calendars[i].getDisplayLanguage() + ")"); - } else { - localeMenu.addItem( calendars[i].getDisplayCountry() ); - } - - if (calendars[i].equals(kFirstLocale)) { - selectMe = i; - } - } - - localeMenu.setBackground(DemoUtility.choiceColor); - localeMenu.select(selectMe); - - displayMenu = new Choice(); - displayMenu.addItemListener(this); - - selectMe = 0; - for (int i = 0; i < locales.length; i++) { - if (i > 0 && - locales[i].getLanguage().equals(locales[i-1].getLanguage()) || - i < locales.length - 1 && - locales[i].getLanguage().equals(locales[i+1].getLanguage())) - { - displayMenu.addItem( locales[i].getDisplayName() ); - } else { - displayMenu.addItem( locales[i].getDisplayLanguage()); - } - - if (locales[i].equals(kFirstLocale)) { - selectMe = i; - } - } - - displayMenu.setBackground(DemoUtility.choiceColor); - displayMenu.select(selectMe); - - // Make all the next/previous/today buttons - prevYear = new Button("<<"); - prevYear.addActionListener(this); - prevMonth = new Button("<"); - prevMonth.addActionListener(this); - gotoToday = new Button("Today"); - gotoToday.addActionListener(this); - nextMonth = new Button(">"); - nextMonth.addActionListener(this); - nextYear = new Button(">>"); - nextYear.addActionListener(this); - - // The month name and the control buttons are bunched together - Panel monthPanel = new Panel(); - { - GridBagLayout g = new GridBagLayout(); - GridBagConstraints c = new GridBagConstraints(); - monthPanel.setLayout(g); - - c.weightx = 1; - c.weighty = 1; - - c.gridwidth = 1; - c.fill = GridBagConstraints.HORIZONTAL; - c.gridwidth = GridBagConstraints.REMAINDER; - add(monthPanel, monthLabel, g, c); - - c.gridwidth = 1; - add(monthPanel, prevYear, g, c); - add(monthPanel, prevMonth, g, c); - add(monthPanel, gotoToday, g, c); - add(monthPanel, nextMonth, g, c); - c.gridwidth = GridBagConstraints.REMAINDER; - add(monthPanel, nextYear, g, c); - } - - // Stick the menu and buttons in a little "control panel" - Panel menuPanel = new Panel(); - { - GridBagLayout g = new GridBagLayout(); - GridBagConstraints c = new GridBagConstraints(); - menuPanel.setLayout(g); - - c.weightx = 1; - c.weighty = 1; - - c.fill = GridBagConstraints.HORIZONTAL; - - c.gridwidth = GridBagConstraints.RELATIVE; - Label l1 = new Label("Holidays"); - l1.setFont(DemoUtility.labelFont); - add(menuPanel, l1, g, c); - - c.gridwidth = GridBagConstraints.REMAINDER; - add(menuPanel, localeMenu, g, c); - - c.gridwidth = GridBagConstraints.RELATIVE; - Label l2 = new Label("Display:"); - l2.setFont(DemoUtility.labelFont); - add(menuPanel, l2, g, c); - - c.gridwidth = GridBagConstraints.REMAINDER; - add(menuPanel, displayMenu, g, c); - } - - // The title, buttons, etc. go in a panel at the top of the window - Panel topPanel = new Panel(); - { - topPanel.setLayout(new BorderLayout()); - - //topPanel.add("North", titleLabel); - topPanel.add("Center", monthPanel); - topPanel.add("East", menuPanel); - } - add("North", topPanel); - - // The copyright notice goes at the bottom of the window - Label copyright = new Label(DemoUtility.copyright1, Label.LEFT); - copyright.setFont(DemoUtility.creditFont); - add("South", copyright); - - // Now create the big calendar panel and stick it in the middle - calendarPanel = new CalendarPanel( kFirstLocale ); - add("Center", calendarPanel); - - updateMonthName(); - } - - private void updateMonthName() - { - SimpleDateFormat f = new SimpleDateFormat("MMMM yyyyy", - calendarPanel.getDisplayLocale()); - f.setCalendar(calendarPanel.getCalendar()); - f.setTimeZone(new SimpleTimeZone(0, "UTC")); // JDK 1.1.2 workaround - monthLabel.setText( f.format( calendarPanel.firstOfMonth() )); - } - - /** - * Handles the event. Returns true if the event is handled and should not - * be passed to the parent of this component. The default event handler - * calls some helper methods to make life easier on the programmer. - */ - public void actionPerformed(ActionEvent e) - { - Object obj = e.getSource(); - - // *** Button events are handled here. - if (obj instanceof Button) { - if (obj == nextMonth) { - calendarPanel.add(Calendar.MONTH, +1); - } - else - if (obj == prevMonth) { - calendarPanel.add(Calendar.MONTH, -1); - } - else - if (obj == prevYear) { - calendarPanel.add(Calendar.YEAR, -1); - } - else - if (obj == nextYear) { - calendarPanel.add(Calendar.YEAR, +1); - } - else - if (obj == gotoToday) { - calendarPanel.set( new Date() ); - } - updateMonthName(); - } - } - - public void itemStateChanged(ItemEvent e) - { - Object obj = e.getSource(); - if (obj == localeMenu) { - calendarPanel.setCalendarLocale(calendars[localeMenu.getSelectedIndex()]); - updateMonthName(); - } - else - if (obj == displayMenu) { - calendarPanel.setDisplayLocale(locales[displayMenu.getSelectedIndex()]); - updateMonthName(); - } - } - - /** - * Print out the error message while debugging this program. - */ - public void errorText(String s) - { - if (DEBUG) - { - System.out.println(s); - } - } - - protected void processWindowEvent(WindowEvent e) - { - System.out.println("event " + e); - if (e.getID() == WindowEvent.WINDOW_CLOSING) { - this.hide(); - this.dispose(); - - if (applet != null) { - applet.demoClosed(); - } else { - System.exit(0); - } - } - } - } - - - private static class CalendarPanel extends Canvas { - - public CalendarPanel( Locale locale ) { - set(locale, locale, new Date()); - } - - public void setCalendarLocale(Locale locale) { - set(locale, fDisplayLocale, fCalendar.getTime()); - } - - public void setDisplayLocale(Locale locale) { - set(fCalendarLocale, locale, fCalendar.getTime()); - } - - public void set(Date date) { - set(fCalendarLocale, fDisplayLocale, date); - } - - public void set(Locale loc, Locale display, Date date) - { - if (fCalendarLocale == null || !loc.equals(fCalendarLocale)) { - fCalendarLocale = loc; - fCalendar = Calendar.getInstance(fCalendarLocale); - fAllHolidays = Holiday.getHolidays(fCalendarLocale); - } - if (fDisplayLocale == null || !display.equals(fDisplayLocale)) { - fDisplayLocale = display; - fSymbols = new DateFormatSymbols(fDisplayLocale); - } - - fStartOfMonth = date; - - dirty = true; - repaint(); - } - - public void add(int field, int delta) - { - synchronized(fCalendar) { - fCalendar.setTime(fStartOfMonth); - fCalendar.add(field, delta); - fStartOfMonth = fCalendar.getTime(); - } - dirty = true; - repaint(); - } - - public com.ibm.util.Calendar getCalendar() { - return fCalendar; - } - - public Locale getCalendarLocale() { - return fCalendarLocale; - } - - public Locale getDisplayLocale() { - return fDisplayLocale; - } - - - public Date firstOfMonth() { - return fStartOfMonth; - } - - private Date startOfMonth(Date dateInMonth) - { - synchronized(fCalendar) { - fCalendar.setTime(dateInMonth); // TODO: synchronization - - int era = fCalendar.get(Calendar.ERA); - int year = fCalendar.get(Calendar.YEAR); - int month = fCalendar.get(Calendar.MONTH); - - fCalendar.clear(); - fCalendar.set(Calendar.ERA, era); - fCalendar.set(Calendar.YEAR, year); - fCalendar.set(Calendar.MONTH, month); - fCalendar.set(Calendar.DATE, 1); - - return fCalendar.getTime(); - } - } - - private void calculate() - { - // - // As a workaround for JDK 1.1.3 and below, where Calendars and time - // zones are a bit goofy, always set my calendar's time zone to UTC. - // You would think I would want to do this in the "set" function above, - // but if I do that, the program hangs when this class is loaded, - // perhaps due to some sort of static initialization ordering problem. - // So I do it here instead. - // - fCalendar.setTimeZone(new SimpleTimeZone(0, "UTC")); - - Calendar c = (Calendar)fCalendar.clone(); // Temporary copy - - fStartOfMonth = startOfMonth(fStartOfMonth); - - // Stash away a few useful constants for this calendar and display - minDay = c.getMinimum(Calendar.DAY_OF_WEEK); - daysInWeek = c.getMaximum(Calendar.DAY_OF_WEEK) - minDay + 1; - - firstDayOfWeek = Calendar.getInstance(fDisplayLocale).getFirstDayOfWeek(); - - // Stash away a Date for the start of this month - - // Find the day of week of the first day in this month - c.setTime(fStartOfMonth); - firstDayInMonth = c.get(Calendar.DAY_OF_WEEK); - - // Now find the # of days in the month - c.roll(Calendar.DATE, false); - daysInMonth = c.get(Calendar.DATE); - - // Finally, find the end of the month, i.e. the start of the next one - c.roll(Calendar.DATE, true); - c.add(Calendar.MONTH, 1); - c.getTime(); // JDK 1.1.2 bug workaround - c.add(Calendar.SECOND, -1); - Date endOfMonth = c.getTime(); - - // - // Calculate the number of full or partial weeks in this month. - // To do this I can just reuse the code that calculates which - // calendar cell contains a given date. - // - numWeeks = dateToCell(daysInMonth).y - dateToCell(1).y + 1; - - // Remember which holidays fall on which days in this month, - // to save the trouble of having to do it later - fHolidays.setSize(0); - - for (int h = 0; h < fAllHolidays.length; h++) - { - Date d = fStartOfMonth; - while ( (d = fAllHolidays[h].firstBetween(d, endOfMonth) ) != null) - { - c.setTime(d); - fHolidays.addElement( new HolidayInfo(c.get(Calendar.DATE), - fAllHolidays[h], - fAllHolidays[h].getDisplayName(fDisplayLocale) )); - - d.setTime( d.getTime() + 1000 ); // "d++" - } - } - dirty = false; - } - - static final int INSET = 2; - - /* - * Convert from the day number within a month (1-based) - * to the cell coordinates on the calendar (0-based) - */ - private void dateToCell(int date, Point pos) - { - int cell = (date + firstDayInMonth - firstDayOfWeek - minDay); - if (firstDayInMonth < firstDayOfWeek) { - cell += daysInWeek; - } - - pos.x = cell % daysInWeek; - pos.y = cell / daysInWeek; - } - private Point dateToCell(int date) { - Point p = new Point(0,0); - dateToCell(date, p); - return p; - } - - public void paint(Graphics g) { - - if (dirty) { - calculate(); - } - - Point cellPos = new Point(0,0); // Temporary variable - Dimension d = getSize(); - - g.setColor(DemoUtility.bgColor); - g.fillRect(0,0,d.width,d.height); - - // Draw the day names at the top - g.setColor(Color.black); - g.setFont(DemoUtility.labelFont); - FontMetrics fm = g.getFontMetrics(); - int labelHeight = fm.getHeight() + INSET * 2; - - int v = fm.getAscent() + INSET; - for (int i = 0; i < daysInWeek; i++) { - int dayNum = (i + minDay + firstDayOfWeek - 2) % daysInWeek + 1; - String dayName = fSymbols.getWeekdays()[dayNum]; - - int h = (int) (d.width * (i + 0.5)) / daysInWeek; - h -= fm.stringWidth(dayName) / 2; - - g.drawString(dayName, h, v); - } - - double cellHeight = (d.height - labelHeight - 1) / numWeeks; - double cellWidth = (double)(d.width - 1) / daysInWeek; - - // Draw a white background in the part of the calendar - // that displays this month. - // First figure out how much of the first week should be shaded. - { - g.setColor(Color.white); - dateToCell(1, cellPos); - int width = (int)(cellPos.x*cellWidth); // Width of unshaded area - - g.fillRect((int)(width), labelHeight , - (int)(d.width - width), (int)cellHeight); - - // All of the intermediate weeks get shaded completely - g.fillRect(0, (int)(labelHeight + cellHeight), - d.width, (int)(cellHeight * (numWeeks - 2))); - - // Now figure out the last week. - dateToCell(daysInMonth, cellPos); - width = (int)((cellPos.x+1)*cellWidth); // Width of shaded area - - g.fillRect(0, (int)(labelHeight + (numWeeks-1) * cellHeight), - width, (int)(cellHeight)); - - } - // Draw the X/Y grid lines - g.setColor(Color.black); - for (int i = 0; i <= numWeeks; i++) { - int y = (int)(labelHeight + i * cellHeight); - g.drawLine(0, y, d.width - 1, y); - } - for (int i = 0; i <= daysInWeek; i++) { - int x = (int)(i * cellWidth); - g.drawLine(x, labelHeight, x, d.height - 1); - } - - // Now loop through all of the days in the month, figure out where - // they go in the grid, and draw the day # for each one - Font numberFont = new Font("Helvetica",Font.PLAIN,12); - // not used Font holidayFont = DemoUtility.creditFont; - - Calendar c = (Calendar)fCalendar.clone(); - c.setTime(fStartOfMonth); - - for (int i = 1, h = 0; i <= daysInMonth; i++) { - g.setFont(numberFont); - g.setColor(Color.black); - fm = g.getFontMetrics(); - - dateToCell(i, cellPos); - int x = (int)((cellPos.x + 1) * cellWidth); - int y = (int)(cellPos.y * cellHeight + labelHeight); - - StringBuffer buffer = new StringBuffer(); - buffer.append(i); - String dayNum = buffer.toString(); - - x = x - INSET - fm.stringWidth(dayNum); - y = y + fm.getAscent() + INSET; - - g.drawString(dayNum, x, y); - - // See if any of the holidays land on this day.... - HolidayInfo info = null; - int count = 0; - - // Coordinates of lower-left corner of cell. - x = (int)((cellPos.x) * cellWidth); - y = (int)((cellPos.y+1) * cellHeight) + labelHeight; - - while (h < fHolidays.size() && - (info = (HolidayInfo)fHolidays.elementAt(h)).date <= i) - { - if (info.date == i) { - // Draw the holiday here. - g.setFont(numberFont); - g.setColor(Color.red); - - DemoTextBox box = new DemoTextBox(g, info.name, (int)(cellWidth - INSET)); - box.draw(g, x + INSET, y - INSET - box.getHeight()); - - y -= (box.getHeight() + INSET); - count++; - } - h++; - } - } - } - - // Important state variables - private Locale fCalendarLocale; // Whose calendar - private Calendar fCalendar; // Calendar for calculations - - private Locale fDisplayLocale; // How to display it - private DateFormatSymbols fSymbols; // Symbols for drawing - - private Date fStartOfMonth; // 00:00:00 on first day of month - - // Cached calculations to make drawing faster. - private transient int minDay; // Minimum legal day # - private transient int daysInWeek; // # of days in a week - private transient int firstDayOfWeek; // First day to display in week - private transient int numWeeks; // # full or partial weeks in month - private transient int daysInMonth; // # days in this month - private transient int firstDayInMonth; // Day of week of first day in month - - private transient Holiday[] fAllHolidays; - private transient Vector fHolidays = new Vector(5,5); - - private transient boolean dirty = true; - } - - private static class HolidayInfo { - public HolidayInfo(int date, Holiday holiday, String name) { - this.date = date; - this.holiday = holiday; - this.name = name; - } - - public Holiday holiday; - public int date; - public String name; - } -} - diff --git a/icu4j/src/com/ibm/demo/holiday/package.html b/icu4j/src/com/ibm/demo/holiday/package.html deleted file mode 100755 index 82ca145423..0000000000 --- a/icu4j/src/com/ibm/demo/holiday/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Holiday demo application. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/demo/package.html b/icu4j/src/com/ibm/demo/package.html deleted file mode 100755 index 045c6c3ec3..0000000000 --- a/icu4j/src/com/ibm/demo/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Shared utilities for demo applications and Applets. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/demo/rbbi/BreakIteratorRules_en_US_DEMO.java b/icu4j/src/com/ibm/demo/rbbi/BreakIteratorRules_en_US_DEMO.java deleted file mode 100755 index 8099ce2fee..0000000000 --- a/icu4j/src/com/ibm/demo/rbbi/BreakIteratorRules_en_US_DEMO.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/rbbi/Attic/BreakIteratorRules_en_US_DEMO.java,v $ - * $Date: 2001/02/20 22:50:12 $ - * $Revision: 1.6 $ - * - ***************************************************************************************** - */ -package com.ibm.text.resources; - -import java.util.ListResourceBundle; -import java.net.URL; - -/** - * This resource bundle is included for testing and demonstration purposes only. - * It applies the dictionary-based algorithm to English text that has had all the - * spaces removed. Once we have good test cases for Thai, we will replace this - * with good resource data (and a good dictionary file) for Thai - */ -public class BreakIteratorRules_en_US_DEMO extends ListResourceBundle { - - private static final URL url = - BreakIteratorRules_en_US_DEMO.class.getResource("/com/ibm/data/misc/english.dict"); - - public Object[][] getContents() { - return contents; - } - - static final Object[][] contents = { - // names of classes to instantiate for the different kinds of break - // iterator. Notice we're now using DictionaryBasedBreakIterator - // for word and line breaking. - { "BreakIteratorClasses", - new String[] { "RuleBasedBreakIterator", // character-break iterator class - "DictionaryBasedBreakIterator", // word-break iterator class - "DictionaryBasedBreakIterator", // line-break iterator class - "RuleBasedBreakIterator" } // sentence-break iterator class - }, - - // These are the same word-breaking rules as are specified in the default - // resource, except that the Latin letters, apostrophe, and hyphen are - // specified as dictionary characters - { "WordBreakRules", - // ignore non-spacing marks, enclosing marks, and format characters, - // all of which should not influence the algorithm - "$_ignore_=[[:Mn:][:Me:][:Cf:]];" - - // lower and upper case Roman letters, apostrophy and dash are - // in the English dictionary - + "$_dictionary_=[a-zA-Z\\'\\-];" - - // Hindi phrase separator, kanji, katakana, hiragana, CJK diacriticals, - // other letters, and digits - + "$danda=[\u0964\u0965];" - + "$kanji=[\u3005\u4e00-\u9fa5\uf900-\ufa2d];" - + "$kata=[\u3099-\u309c\u30a1-\u30fe];" - + "$hira=[\u3041-\u309e\u30fc];" - + "$let=[[[:L:][:Mc:]]-[$kanji$kata$hira]];" - + "$dgt=[:N:];" - - // punctuation that can occur in the middle of a word: currently - // dashes, apostrophes, and quotation marks - + "$mid_word=[[:Pd:]\u00ad\u2027\\\"\\\'];" - - // punctuation that can occur in the middle of a number: currently - // apostrophes, qoutation marks, periods, commas, and the Arabic - // decimal point - + "$mid_num=[\\\"\\\'\\,\u066b\\.];" - - // punctuation that can occur at the beginning of a number: currently - // the period, the number sign, and all currency symbols except the cents sign - + "$pre_num=[[[:Sc:]-[\u00a2]]\\#\\.];" - - // punctuation that can occur at the end of a number: currently - // the percent, per-thousand, per-ten-thousand, and Arabic percent - // signs, the cents sign, and the ampersand - + "$post_num=[\\%\\&\u00a2\u066a\u2030\u2031];" - - // line separators: currently LF, FF, PS, and LS - + "$ls=[\n\u000c\u2028\u2029];" - - // whitespace: all space separators and the tab character - + "$ws=[[:Zs:]\t];" - - // a word is a sequence of letters that may contain internal - // punctuation, as long as it begins and ends with a letter and - // never contains two punctuation marks in a row - + "$word=($let+($mid_word$let+)*$danda?);" - - // a number is a sequence of digits that may contain internal - // punctuation, as long as it begins and ends with a digit and - // never contains two punctuation marks in a row. - + "$number=($dgt+($mid_num$dgt+)*);" - - // break after every character, with the following exceptions - // (this will cause punctuation marks that aren't considered - // part of words or numbers to be treated as words unto themselves) - + ".;" - - // keep together any sequence of contiguous words and numbers - // (including just one of either), plus an optional trailing - // number-suffix character - + "$word?($number$word)*($number$post_num?)?;" - - // keep together and sequence of contiguous words and numbers - // that starts with a number-prefix character and a number, - // and may end with a number-suffix character - + "$pre_num($number$word)*($number$post_num?)?;" - - // keep together runs of whitespace (optionally with a single trailing - // line separator or CRLF sequence) - + "$ws*\r?$ls?;" - - // keep together runs of Katakana - + "$kata*;" - - // keep together runs of Hiragana - + "$hira*;" - - // keep together runs of Kanji - + "$kanji*;"}, - - // These are the same line-breaking rules as are specified in the default - // resource, except that the Latin letters, apostrophe, and hyphen are - // specified as dictionary characters - { "LineBreakRules", - // ignore non-spacing marks, enclosing marks, and format characters - "$_ignore_=[[:Mn:][:Me:][:Cf:]];" - - // lower and upper case Roman letters, apostrophy and dash - // are in the English dictionary - + "$_dictionary_=[a-zA-Z\\'\\-];" - - // Hindi phrase separators - + "$danda=[\u0964\u0965];" - - // characters that always cause a break: ETX, tab, LF, FF, LS, and PS - + "$break=[\u0003\t\n\f\u2028\u2029];" - - // characters that always prevent a break: the non-breaking space - // and similar characters - + "$nbsp=[\u00a0\u2007\u2011\ufeff];" - - // whitespace: space separators and control characters, except for - // CR and the other characters mentioned above - + "$space=[[[:Zs:][:Cc:]]-[$nbsp$break\r]];" - - // dashes: dash punctuation and the discretionary hyphen, except for - // non-breaking hyphens - + "$dash=[[[:Pd:]\u00ad]-[$nbsp]];" - - // characters that stick to a word if they precede it: currency symbols - // (except the cents sign) and starting punctuation - + "$pre_word=[[[:Sc:]-[\u00a2]][:Ps:]\\\"\\\'];" - - // characters that stick to a word if they follow it: ending punctuation, - // other punctuation that usually occurs at the end of a sentence, - // small Kana characters, some CJK diacritics, etc. - + "$post_word=[[:Pe:]\\!\\\"\\\'\\%\\.\\,\\:\\;\\?\u00a2\u00b0\u066a\u2030-\u2034" - + "\u2103\u2105\u2109\u3001\u3002\u3005\u3041\u3043\u3045\u3047\u3049\u3063" - + "\u3083\u3085\u3087\u308e\u3099-\u309e\u30a1\u30a3\u30a5\u30a7\u30a9" - + "\u30c3\u30e3\u30e5\u30e7\u30ee\u30f5\u30f6\u30fc-\u30fe\uff01\uff0c" - + "\uff0e\uff1f];" - - // Kanji: actually includes both Kanji and Kana, except for small Kana and - // CJK diacritics - + "$kanji=[[\u4e00-\u9fa5\uf900-\ufa2d\u3041-\u3094\u30a1-\u30fa]-[$post_word$_ignore_]];" - - // digits - + "$digit=[[:Nd:][:No:]];" - - // punctuation that can occur in the middle of a number: periods and commas - + "$mid_num=[\\.\\,];" - - // everything not mentioned above, plus the quote marks (which are both - // , , and ) - + "$char=[^$break$space$dash$kanji$nbsp$_ignore_$pre_word$post_word$mid_num$danda\r\\\"\\\'];" - - // a "number" is a run of prefix characters and dashes, followed by one or - // more digits with isolated number-punctuation characters interspersed - + "$number=([$pre_word$dash]*$digit+($mid_num$digit+)*);" - - // the basic core of a word can be either a "number" as defined above, a single - // "Kanji" character, or a run of any number of not-explicitly-mentioned - // characters (this includes Latin letters) - + "$word_core=([$pre_word$char]*|$kanji|$number);" - - // a word may end with an optional suffix that be either a run of one or - // more dashes or a run of word-suffix characters, followed by an optional - // run of whitespace - + "$word_suffix=(($dash+|$post_word*)$space*);" - - // a word, thus, is an optional run of word-prefix characters, followed by - // a word core and a word suffix (the syntax of and - // actually allows either of them to match the empty string, putting a break - // between things like ")(" or "aaa(aaa" - + "$word=($pre_word*$word_core$word_suffix);" - - // finally, the rule that does the work: Keep together any run of words that - // are joined by runs of one of more non-spacing mark. Also keep a trailing - // line-break character or CRLF combination with the word. (line separators - // "win" over nbsp's) - + "$word($nbsp+$word)*\r?$break?;" }, - - // these two resources specify the pathnames of the dictionary files to - // use for word breaking and line breaking. Both currently refer to - // a file called english.dict placed in com\ibm\text\resources - // somewhere in the class path. It's important to note that - // english.dict was created for testing purposes only, and doesn't - // come anywhere close to being an exhaustive dictionary of English - // words (basically, it contains all the words in the Declaration of - // Independence, and the Revised Standard Version of the book of Genesis, - // plus a few other words thrown in to show more interesting cases). - // { "WordBreakDictionary", "com\\ibm\\text\\resources\\english.dict" }, - // { "LineBreakDictionary", "com\\ibm\\text\\resources\\english.dict" } - { "WordBreakDictionary", url }, - { "LineBreakDictionary", url } - }; -} diff --git a/icu4j/src/com/ibm/demo/rbbi/DBBIDemo.java b/icu4j/src/com/ibm/demo/rbbi/DBBIDemo.java deleted file mode 100755 index 03072e988a..0000000000 --- a/icu4j/src/com/ibm/demo/rbbi/DBBIDemo.java +++ /dev/null @@ -1,471 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/rbbi/Attic/DBBIDemo.java,v $ - * $Date: 2001/11/12 23:44:44 $ - * $Revision: 1.9 $ - * - ***************************************************************************************** - */ -package com.ibm.demo.rbbi; - - -import com.ibm.demo.*; -import java.applet.Applet; -import java.awt.*; -import java.awt.event.WindowEvent; -import java.awt.event.KeyEvent; -import java.awt.event.ItemListener; -import java.awt.event.ItemEvent; -import javax.swing.JTextArea; -import javax.swing.JScrollPane; -import javax.swing.BorderFactory; -import java.util.*; - -import com.ibm.text.BreakIterator; - -public class DBBIDemo extends DemoApplet -{ - public static void main(String argv[]) { - Locale.setDefault(new Locale("en", "US", "DEMO")); - new DBBIDemo().showDemo(); - } - - public Frame createDemoFrame(DemoApplet applet) { - return new DBBIFrame(applet); - } -} - - - -class DBBIFrame extends Frame implements ItemListener -{ - private static final String creditString = - "v1.1a9, Demo"; - - private static final int FIELD_COLUMNS = 45; - private static final Font choiceFont = null; - private static final boolean DEBUG = false; - private DemoApplet applet; - - final String right = "-->"; - final String left = "<--"; - - private BreakIterator enum; - private static boolean isctrldown_ = false; - -JTextArea text; -// TextArea text; - Choice bound; - - public DBBIFrame(DemoApplet applet) - { - this.applet = applet; - init(); - start(); - } - - - - public void run() - { - /* - while (true) { - try { - checkChange(); - Thread.sleep(250); - } - catch (InterruptedException e) { - } - catch (Exception e) { - } - catch (Throwable e) { - } - } - */ - } - - int s, e; - int ts, te; - - public void checkChange() - { -// System.out.println("checkChange..."); - if ((text.getSelectionStart() & 0x7FFF) != ts || - (text.getSelectionEnd() & 0x7FFF) != te) { - - // not used int tempS = text.getSelectionStart() & 0x7FFF; - // not used int tempE = text.getSelectionEnd() & 0x7FFF; - -// System.out.println(">"); -// select(0, 0); -// select(tempS, tempE); - //select(tempS - (ts - s), tempE - (te - e)); -// System.out.println("<"); - - -// if (s != ts || e != te) System.out.println(" s("+s+") ts("+ts+") e("+e+") te("+te+")"); -// if (tempS != ts || tempE != te) System.out.println(">s("+s+") tempS("+tempS+") e("+e+") tempE("+tempE+")"); -// select(s - (ts - s), e - (te - e)); -// if (tempS != ts || tempE != te) System.out.println("s("+s+") tempS("+tempS+") e("+e+") tempE("+tempE+")"); - -// System.out.println("lkdslksj"); - } - } - - public void select(int sIn, int eIn) - { - s = sIn; - e = eIn; - text.select(s, e); - ts = text.getSelectionStart() & 0x7FFF; - te = text.getSelectionEnd() & 0x7FFF; -// if (s != ts || e != te) { -// System.out.println(">s("+s+") ts("+ts+") e("+e+") te("+te+")"); -// System.out.println(" "+(ts-s)+","+(te-e)); -// } - } - - public int getSelectionStart() - { - checkChange(); -// return s; - return text.getSelectionStart() & 0x7FFF; - } - - - public int getSelectionEnd() - { - checkChange(); -// return e; - return text.getSelectionEnd() & 0x7FFF; - } - - public final synchronized void selectRange(int s, int e) - { - try { - //if (getSelectionStart() != s || getSelectionEnd() != e) { - //text.select(s, e); - select(s,e); - //} -// if (getSelectionStart() != s || getSelectionEnd() != e) { -// System.out.println("AGH! select("+s+","+e+") -> ("+ -// getSelectionStart()+","+getSelectionEnd()+")"); -// text.select(s - (getSelectionStart() - s), e - (getSelectionEnd() - e)); -// } - } catch (Exception exp) { - errorText(exp.toString()); - } - } - - - - public void init() - { - buildGUI(); - } - - - public void start() - { - } - - - void addWithFont(Container container, Component foo, Font font) { - if (font != null) - foo.setFont(font); - container.add(foo); - } - - - - public void buildGUI() - { - setBackground(DemoUtility.bgColor); - setLayout(new BorderLayout()); - - Panel topPanel = new Panel(); - - Label titleLabel = - new Label("Text Boundary Demo", Label.CENTER); - titleLabel.setFont(DemoUtility.titleFont); - topPanel.add(titleLabel); - - //Label demo=new Label(creditString, Label.CENTER); - //demo.setFont(DemoUtility.creditFont); - //topPanel.add(demo); - - Panel choicePanel = new Panel(); - - Label demo1=new Label("Boundaries", Label.LEFT); - demo1.setFont(DemoUtility.labelFont); - choicePanel.add(demo1); - - bound = new Choice(); - bound.setBackground(DemoUtility.choiceColor); - bound.addItem("Sentence"); - bound.addItem("Line Break"); - bound.addItem("Word"); - bound.addItem("Char"); - - bound.addItemListener(this); - if (choiceFont != null) - bound.setFont(choiceFont); - - choicePanel.add(bound); - topPanel.add(choicePanel); - - DemoUtility.fixGrid(topPanel,1); - - - add("North", topPanel); - - - int ROWS = 15; - int COLUMNS = 50; -// text = new TextArea(getInitialText(), ROWS, COLUMNS); -text = new JTextArea(getInitialText(), ROWS, COLUMNS); -text.setLineWrap(true); -text.setWrapStyleWord(true); - text.setEditable(true); - text.selectAll(); - text.setFont(DemoUtility.editFont); - text.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); - - add("Center", new JScrollPane(text, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, - JScrollPane.HORIZONTAL_SCROLLBAR_NEVER)); - - Panel copyrightPanel = new Panel(); - addWithFont (copyrightPanel, - new Label(DemoUtility.copyright1, Label.LEFT),DemoUtility.creditFont); - addWithFont (copyrightPanel, - new Label(DemoUtility.copyright2, Label.LEFT),DemoUtility.creditFont); - DemoUtility.fixGrid(copyrightPanel,1); - add("South", copyrightPanel); - - //layout(); - handleEnumChanged(); - - enableEvents(WindowEvent.WINDOW_CLOSING); - enableEvents(KeyEvent.KEY_PRESSED); - enableEvents(KeyEvent.KEY_RELEASED); - - // (new Thread(this)).start(); - } - - - - public String getInitialText() - { - return -"When,inthecourseofhumanevents,itbecomesnecessaryforonepeopletodissolvethepoliticalbondswhichhave" -+ "connectedthemwithanother,andtoassumeamongthepowersoftheearth,theseparateandequalstationtowhichthelaws" -+ "ofnatureandofnature'sGodentitlethem,adecentrespecttotheopinionsofmankindrequiresthattheyshoulddeclarethe" -+ "causeswhichimpelthemtotheseparation.\n" -+ "Weholdthesetruthstobeself-evident,thatallmenarecreatedequal,thattheyareendowedbytheirCreatorwithcertain" -+ "unalienablerights,thatamongthesearelife,libertyandthepursuitofhappiness.Thattosecuretheserights,governmentsare" -+ "institutedamongmen,derivingtheirjustpowersfromtheconsentofthegoverned.Thatwheneveranyformofgovernment" -+ "becomesdestructivetotheseends,itistherightofthepeopletoalterortoabolishit,andtoinstitutenewgovernment,laying" -+ "itsfoundationonsuchprinciplesandorganizingitspowersinsuchform,astothemshallseemmostlikelytoeffecttheirsafety" -+ "andhappiness.Prudence,indeed,willdictatethatgovernmentslongestablishedshouldnotbechangedforlightandtransient" -+ "causes;andaccordinglyallexperiencehathshownthatmankindaremoredisposedtosuffer,whileevilsaresufferable,than" -+ "torightthemselvesbyabolishingtheformstowhichtheyareaccustomed.Butwhenalongtrainofabusesandusurpations," -+ "pursuinginvariablythesameobjectevincesadesigntoreducethemunderabsolutedespotism,itistheirright,itistheirduty," -+ "tothrowoffsuchgovernment,andtoprovidenewguardsfortheirfuturesecurity.--Suchhasbeenthepatientsufferanceof" -+ "thesecolonies;andsuchisnowthenecessitywhichconstrainsthemtoaltertheirformersystemsofgovernment.Thehistory" -+ "ofthepresentKingofGreatBritainisahistoryofrepeatedinjuriesandusurpations,allhavingindirectobjectthe" -+ "establishmentofanabsolutetyrannyoverthesestates.Toprovethis,letfactsbesubmittedtoacandidworld.\n" -+ "Hehasrefusedhisassenttolaws,themostwholesomeandnecessaryforthepublicgood.\n" -+ "Hehasforbiddenhisgovernorstopasslawsofimmediateandpressingimportance,unlesssuspendedintheiroperationtill" -+ "hisassentshouldbeobtained;andwhensosuspended,hehasutterlyneglectedtoattendtothem.\n" -+ "Hehasrefusedtopassotherlawsfortheaccommodationoflargedistrictsofpeople,unlessthosepeoplewouldrelinquish" -+ "therightofrepresentationinthelegislature,arightinestimabletothemandformidabletotyrantsonly.\n" -+ "Hehascalledtogetherlegislativebodiesatplacesunusual,uncomfortable,anddistantfromthedepositoryoftheirpublic" -+ "records,forthesolepurposeoffatiguingthemintocompliancewithhismeasures.\n" -+ "Hehasdissolvedrepresentativehousesrepeatedly,foropposingwithmanlyfirmnesshisinvasionsontherightsofthepeople.\n" -+ "Hehasrefusedforalongtime,aftersuchdissolutions,tocauseotherstobeelected;wherebythelegislativepowers," -+ "incapableofannihilation,havereturnedtothepeopleatlargefortheirexercise;thestateremaininginthemeantimeexposed" -+ "toallthedangersofinvasionfromwithout,andconvulsionswithin.\n" -+ "Hehasendeavoredtopreventthepopulationofthesestates;forthatpurposeobstructingthelawsfornaturalizationof" -+ "foreigners;refusingtopassotherstoencouragetheirmigrationhither,andraisingtheconditionsofnewappropriationsof" -+ "lands.\n" -+ "Hehasobstructedtheadministrationofjustice,byrefusinghisassenttolawsforestablishingjudiciarypowers.\n" -+ "Hehasmadejudgesdependentonhiswillalone,forthetenureoftheiroffices,andtheamountandpaymentoftheirsalaries.\n" -+ "Hehaserectedamultitudeofnewoffices,andsenthitherswarmsofofficerstoharassourpeople,andeatouttheir" -+ "substance.\n" -+ "Hehaskeptamongus,intimesofpeace,standingarmieswithouttheconsentofourlegislature.\n" -+ "Hehasaffectedtorenderthemilitaryindependentofandsuperiortocivilpower.\n" -+ "Hehascombinedwithotherstosubjectustoajurisdictionforeigntoourconstitution,andunacknowledgedbyourlaws;" -+ "givinghisassenttotheiractsofpretendedlegislation:\n" -+ "Forquarteringlargebodiesofarmedtroopsamongus:\n" -+ "Forprotectingthem,bymocktrial,frompunishmentforanymurderswhichtheyshouldcommitontheinhabitantsofthese" -+ "states:\n" -+ "Forcuttingoffourtradewithallpartsoftheworld:\n" -+ "Forimposingtaxesonuswithoutourconsent:\n" -+ "Fordeprivingusinmanycases,ofthebenefitsoftrialbyjury:\n" -+ "Fortransportingusbeyondseastobetriedforpretendedoffenses:\n" -+ "ForabolishingthefreesystemofEnglishlawsinaneighboringprovince,establishingthereinanarbitrarygovernment,and" -+ "enlargingitsboundariessoastorenderitatonceanexampleandfitinstrumentforintroducingthesameabsoluteruleinthese" -+ "colonies:\n" -+ "Fortakingawayourcharters,abolishingourmostvaluablelaws,andalteringfundamentallytheformsofourgovernments:\n" -+ "Forsuspendingourownlegislatures,anddeclaringthemselvesinvestedwithpowertolegislateforusinallcaseswhatsoever.\n" -+ "Hehasabdicatedgovernmenthere,bydeclaringusoutofhisprotectionandwagingwaragainstus.\n" -+ "Hehasplunderedourseas,ravagedourcoasts,burnedourtowns,anddestroyedthelivesofourpeople.\n" -+ "Heisatthistimetransportinglargearmiesofforeignmercenariestocompletetheworksofdeath,desolationandtyranny," -+ "alreadybegunwithcircumstancesofcrueltyandperfidyscarcelyparalleledinthemostbarbarousages,andtotallyunworthy" -+ "theheadofacivilizednation.\n" -+ "Hehasconstrainedourfellowcitizenstakencaptiveonthehighseastobeararmsagainsttheircountry,tobecomethe" -+ "executionersoftheirfriendsandbrethren,ortofallthemselvesbytheirhands.\n" -+ "Hehasexciteddomesticinsurrectionsamongstus,andhasendeavoredtobringontheinhabitantsofourfrontiers,the" -+ "mercilessIndiansavages,whoseknownruleofwarfare,isundistinguisheddestructionofallages,sexesandconditions.\n" -+ "Ineverystageoftheseoppressionswehavepetitionedforredressinthemosthumbleterms:ourrepeatedpetitionshave" -+ "beenansweredonlybyrepeatedinjury.Aprince,whosecharacteristhusmarkedbyeveryactwhichmaydefineatyrant,is" -+ "unfittobetherulerofafreepeople.\n" -+ "NorhavewebeenwantinginattentiontoourBritishbrethren.Wehavewarnedthemfromtimetotimeofattemptsbytheir" -+ "legislaturetoextendanunwarrantablejurisdictionoverus.Wehaveremindedthemofthecircumstancesofouremigration" -+ "andsettlementhere.Wehaveappealedtotheirnativejusticeandmagnanimity,andwehaveconjuredthembythetiesofour" -+ "commonkindredtodisavowtheseusurpations,which,wouldinevitablyinterruptourconnectionsandcorrespondence.We" -+ "must,therefore,acquiesceinthenecessity,whichdenouncesourseparation,andholdthem,asweholdtherestofmankind," -+ "enemiesinwar,inpeacefriends.\n" -+ "We,therefore,therepresentativesoftheUnitedStatesofAmerica,inGeneralCongress,assembled,appealingtothe" -+ "SupremeJudgeoftheworldfortherectitudeofourintentions,do,inthename,andbytheauthorityofthegoodpeopleof" -+ "thesecolonies,solemnlypublishanddeclare,thattheseunitedcoloniesare,andofrightoughttobefreeandindependent" -+ "states;thattheyareabsolvedfromallallegiancetotheBritishCrown,andthatallpoliticalconnectionbetweenthemandthe" -+ "stateofGreatBritain,isandoughttobetotallydissolved;andthatasfreeandindependentstates,theyhavefullpowerto" -+ "leveywar,concludepeace,contractalliances,establishcommerce,andtodoallotheractsandthingswhichindependent" -+ "statesmayofrightdo.Andforthesupportofthisdeclaration,withafirmrelianceontheprotectionofDivineProvidence,we" -+ "mutuallypledgetoeachotherourlives,ourfortunesandoursacredhonor.\n"; - } - - - public void handleEnumChanged() - { - String s = bound.getSelectedItem(); - if (s.equals("Char")) { - errorText("getCharacterInstance"); - enum = BreakIterator.getCharacterInstance(); - } - else if (s.equals("Word")) { - errorText("getWordInstance"); - enum = BreakIterator.getWordInstance(); - } - else if (s.equals("Line Break")) { - errorText("getLineInstance"); - enum = BreakIterator.getLineInstance(); - } - else /* if (s.equals("Sentence")) */ { - errorText("getSentenceInstance"); - enum = BreakIterator.getSentenceInstance(); - } - enum.setText(text.getText()); - selectRange(0, 0); - //text.select(0,0); - } - - public void handleForward() - { - try { -// System.out.println("entering handleForward"); - enum.setText(text.getText()); - int oldStart = getSelectionStart(); - int oldEnd = getSelectionEnd(); - -// System.out.println("handleForward: oldStart=" + oldStart + ", oldEnd=" + oldEnd); - - if (oldEnd < 1) { - selectRange(0, enum.following(0)); - } - else { - int s = enum.following(oldEnd-1); - int e = enum.next(); - if (e == -1) { - e = s; - } - selectRange(s, e); - } - //text.select(s, e); - errorText("<" + oldStart + "," + oldEnd + "> -> <" + - s + "," + e + ">"); - } - catch (Exception exp) { - errorText(exp.toString()); - } - } - - public void handleBackward() - { - try { - enum.setText(text.getText()); - int oldStart = getSelectionStart(); - int oldEnd = getSelectionEnd(); - if (oldStart < 1) { - selectRange(0, 0); - } - else { - int e = enum.following(oldStart-1); - int s = enum.previous(); - selectRange(s, e); - } - //text.select(s, e); - errorText("<" + oldStart + "," + oldEnd + "> -> <" + s + "," + e + ">"); - } - catch (Exception exp) { - errorText(exp.toString()); - } - } - - public void itemStateChanged(ItemEvent evt) - { - if (evt.getSource() instanceof Choice) { - handleEnumChanged(); - } - } - - public void errorText(String s) - { - if (DEBUG) - System.out.println(s); - } - - protected void processWindowEvent(WindowEvent evt) - { - if (evt.getID() == WindowEvent.WINDOW_CLOSING && - evt.getWindow() == this) { - hide(); - dispose(); - if (applet != null) { - applet.demoClosed(); - } else System.exit(0); - } - } - - protected void processKeyEvent(KeyEvent evt) - { - switch (evt.getID()) { - case KeyEvent.KEY_PRESSED : - if (evt.getKeyCode() == KeyEvent.VK_CONTROL) { - isctrldown_ = true; - } - break; - case KeyEvent.KEY_RELEASED : - // key detection for left and right buttons are removed - // to emulate the old release behaviour - int key = evt.getKeyCode(); - if (key == KeyEvent.VK_N && isctrldown_) { - handleForward(); - } - else - if (key == KeyEvent.VK_P && isctrldown_) { - handleBackward(); - } - else - if (key == KeyEvent.VK_CONTROL) { - isctrldown_ = false; - } - break; - } - } -} diff --git a/icu4j/src/com/ibm/demo/rbbi/RBBIDemo.java b/icu4j/src/com/ibm/demo/rbbi/RBBIDemo.java deleted file mode 100755 index b41606cd1e..0000000000 --- a/icu4j/src/com/ibm/demo/rbbi/RBBIDemo.java +++ /dev/null @@ -1,454 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/rbbi/Attic/RBBIDemo.java,v $ - * $Date: 2001/11/12 23:44:44 $ - * $Revision: 1.4 $ - * - ***************************************************************************************** - */ -package com.ibm.demo.rbbi; - -import com.ibm.demo.*; -import java.applet.Applet; -import java.awt.*; -import java.awt.event.WindowEvent; -import java.awt.event.KeyEvent; -import java.awt.event.ItemListener; -import java.awt.event.ItemEvent; -import javax.swing.JTextArea; -import javax.swing.JScrollPane; -import javax.swing.BorderFactory; -import java.util.*; - -import com.ibm.text.BreakIterator; - -public class RBBIDemo extends DemoApplet -{ - public static void main(String argv[]) { - Locale.setDefault(new Locale("en", "US")); - new RBBIDemo().showDemo(); - } - - public Frame createDemoFrame(DemoApplet applet) { - return new RBBIFrame(applet); - } -} - - - -class RBBIFrame extends Frame implements ItemListener -{ - private static final String creditString = - "v1.1a9, Demo"; - - private static final int FIELD_COLUMNS = 45; - private static final Font choiceFont = null; - private static final boolean DEBUG = false; - private DemoApplet applet; - - final String right = "-->"; - final String left = "<--"; - - private BreakIterator enum; - private boolean isctrldown_ = false; - -JTextArea text; -// TextArea text; - Choice bound; - - public RBBIFrame(DemoApplet applet) - { - this.applet = applet; - init(); - start(); - } - - - - public void run() - { - /* - while (true) { - try { - checkChange(); - Thread.sleep(250); - } - catch (InterruptedException e) { - } - catch (Exception e) { - } - catch (Throwable e) { - } - } - */ - } - - int s, e; - int ts, te; - - public void checkChange() - { -// System.out.println("checkChange..."); - if ((text.getSelectionStart() & 0x7FFF) != ts || - (text.getSelectionEnd() & 0x7FFF) != te) { - - // not used int tempS = text.getSelectionStart() & 0x7FFF; - // not used int tempE = text.getSelectionEnd() & 0x7FFF; - -// System.out.println(">"); -// select(0, 0); -// select(tempS, tempE); - //select(tempS - (ts - s), tempE - (te - e)); -// System.out.println("<"); - - -// if (s != ts || e != te) System.out.println(" s("+s+") ts("+ts+") e("+e+") te("+te+")"); -// if (tempS != ts || tempE != te) System.out.println(">s("+s+") tempS("+tempS+") e("+e+") tempE("+tempE+")"); -// select(s - (ts - s), e - (te - e)); -// if (tempS != ts || tempE != te) System.out.println("s("+s+") tempS("+tempS+") e("+e+") tempE("+tempE+")"); - -// System.out.println("lkdslksj"); - } - } - - public void select(int sIn, int eIn) - { - s = sIn; - e = eIn; - text.select(s, e); - ts = text.getSelectionStart() & 0x7FFF; - te = text.getSelectionEnd() & 0x7FFF; -// if (s != ts || e != te) { -// System.out.println(">s("+s+") ts("+ts+") e("+e+") te("+te+")"); -// System.out.println(" "+(ts-s)+","+(te-e)); -// } - } - - public int getSelectionStart() - { - checkChange(); -// return s; - return text.getSelectionStart() & 0x7FFF; - } - - - public int getSelectionEnd() - { - checkChange(); -// return e; - return text.getSelectionEnd() & 0x7FFF; - } - - public final synchronized void selectRange(int s, int e) - { - try { - //if (getSelectionStart() != s || getSelectionEnd() != e) { - //text.select(s, e); - select(s,e); - //} -// if (getSelectionStart() != s || getSelectionEnd() != e) { -// System.out.println("AGH! select("+s+","+e+") -> ("+ -// getSelectionStart()+","+getSelectionEnd()+")"); -// text.select(s - (getSelectionStart() - s), e - (getSelectionEnd() - e)); -// } - } catch (Exception exp) { - errorText(exp.toString()); - } - } - - - - public void init() - { - buildGUI(); - } - - - public void start() - { - } - - - void addWithFont(Container container, Component foo, Font font) { - if (font != null) - foo.setFont(font); - container.add(foo); - } - - - - public void buildGUI() - { - setBackground(DemoUtility.bgColor); - setLayout(new BorderLayout()); - - Panel topPanel = new Panel(); - - Label titleLabel = - new Label("Deva Text Boundary Demo", Label.CENTER); - titleLabel.setFont(DemoUtility.titleFont); - topPanel.add(titleLabel); - - //Label demo=new Label(creditString, Label.CENTER); - //demo.setFont(DemoUtility.creditFont); - //topPanel.add(demo); - - Panel choicePanel = new Panel(); - - Label demo1=new Label("Boundaries", Label.LEFT); - demo1.setFont(DemoUtility.labelFont); - choicePanel.add(demo1); - - bound = new Choice(); - bound.setBackground(DemoUtility.choiceColor); - bound.addItem("Sentence"); - bound.addItem("Line Break"); - bound.addItem("Word"); - bound.addItem("Char"); - bound.addItemListener(this); - if (choiceFont != null) - bound.setFont(choiceFont); - - choicePanel.add(bound); - topPanel.add(choicePanel); - - DemoUtility.fixGrid(topPanel,1); - - - add("North", topPanel); - - - int ROWS = 15; - int COLUMNS = 50; -// text = new TextArea(getInitialText(), ROWS, COLUMNS); - text = new JTextArea(getInitialText(), ROWS, COLUMNS); - text.setLineWrap(true); - text.setWrapStyleWord(true); - text.setEditable(true); - text.selectAll(); - text.setFont(new Font("Devanagari MT for IBM", Font.PLAIN, 48)); - text.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); - - add("Center", new JScrollPane(text, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, - JScrollPane.HORIZONTAL_SCROLLBAR_NEVER)); - - Panel copyrightPanel = new Panel(); - addWithFont (copyrightPanel, - new Label(DemoUtility.copyright1, Label.LEFT),DemoUtility.creditFont); - addWithFont (copyrightPanel, - new Label(DemoUtility.copyright2, Label.LEFT),DemoUtility.creditFont); - DemoUtility.fixGrid(copyrightPanel,1); - add("South", copyrightPanel); - - //layout(); - handleEnumChanged(); - - enableEvents(WindowEvent.WINDOW_CLOSING); - enableEvents(KeyEvent.KEY_PRESSED); - enableEvents(KeyEvent.KEY_RELEASED); - - // (new Thread(this)).start(); - } - - - - public String getInitialText() - { - return - "\u0936\u094d\u0930\u0940\u092e\u0926\u094d " + - "\u092d\u0917\u0935\u0926\u094d\u0917\u0940\u0924\u093e " + - "\u0905\u0927\u094d\u092f\u093e\u092f " + - "\u0905\u0930\u094d\u091c\u0941\u0928 " + - "\u0935\u093f\u0937\u093e\u0926 " + - "\u092f\u094b\u0917 " + - "\u0927\u0943\u0924\u0930\u093e\u0937\u094d\u091f\u094d\u0930 " + - "\u0909\u0935\u093E\u091A\u0943 " + - "\u0927\u0930\u094d\u092e\u0915\u094d\u0937\u0947\u0924\u094d\u0930\u0947 " + - "\u0915\u0941\u0930\u0941\u0915\u094d\u0937\u0947\u0924\u094d\u0930\u0947 " + - "\u0938\u092e\u0935\u0947\u0924\u093e " + - "\u092f\u0941\u092f\u0941\u0924\u094d\u0938\u0935\u0903 " + - "\u092e\u093e\u092e\u0915\u093e\u0903 " + - "\u092a\u093e\u0923\u094d\u0921\u0935\u093e\u0936\u094d\u091a\u0948\u0935 " + - "\u0915\u093f\u092e\u0915\u0941\u0930\u094d\u0935\u0924 " + - "\u0938\u0902\u091c\u0935"; - } - - - public void handleEnumChanged() - { - String s = bound.getSelectedItem(); - if (s.equals("Char")) { - errorText("getCharacterInstance"); - enum = BreakIterator.getCharacterInstance(); - } - else if (s.equals("Word")) { - errorText("tWordBreak"); - enum = BreakIterator.getWordInstance(); - } - else if (s.equals("Line Break")) { - errorText("getLineInstance"); - enum = BreakIterator.getLineInstance(); - } - else /* if (s.equals("Sentence")) */ { - errorText("getSentenceInstance"); - enum = BreakIterator.getSentenceInstance(); - } - enum.setText(text.getText()); - selectRange(0, 0); - //text.select(0,0); - } - - public void handleForward() - { - try { -// System.out.println("entering handleForward"); - enum.setText(text.getText()); - int oldStart = getSelectionStart(); - int oldEnd = getSelectionEnd(); - -// System.out.println("handleForward: oldStart=" + oldStart + ", oldEnd=" + oldEnd); - - if (oldEnd < 1) { - selectRange(0, enum.following(0)); - } - else { - int s = enum.following(oldEnd-1); - int e = enum.next(); - if (e == -1) { - e = s; - } - selectRange(s, e); - } - //text.select(s, e); - errorText("<" + oldStart + "," + oldEnd + "> -> <" + - s + "," + e + ">"); - } - catch (Exception exp) { - errorText(exp.toString()); - } - } - - public void handleBackward() - { - try { - enum.setText(text.getText()); - int oldStart = getSelectionStart(); - int oldEnd = getSelectionEnd(); - if (oldStart < 1) { - selectRange(0, 0); - } - else { - int e = enum.following(oldStart-1); - int s = enum.previous(); - selectRange(s, e); - } - //text.select(s, e); - errorText("<" + oldStart + "," + oldEnd + "> -> <" + s + "," + e + ">"); - } - catch (Exception exp) { - errorText(exp.toString()); - } - } - - /* - public boolean action(Event evt, Object obj) - { - - if(evt.target instanceof Button && left.equals(obj)) - { - handleBackward(); - return true; - } - else if(evt.target instanceof Button && right.equals(obj)) - { - handleForward(); - return true; - } - else if(evt.target instanceof Choice) - { - handleEnumChanged(); - return true; - } - return false; - } - - public boolean handleEvent(Event evt) - { - if (evt.id == Event.KEY_PRESS || evt.id == Event.KEY_ACTION) { - if (evt.key == Event.RIGHT || (evt.key == 0x0E && evt.controlDown())) { - handleForward(); - return true; - } - else if (evt.key == Event.LEFT || (evt.key == 0x10 && evt.controlDown())) { - handleBackward(); - return true; - } - } - else - if (evt.id == Event.WINDOW_DESTROY && evt.target == this) { - this.hide(); - this.dispose(); - if (applet != null) { - applet.demoClosed(); - } else System.exit(0); - return true; - } - return super.handleEvent(evt); - }*/ - - public void itemStateChanged(ItemEvent evt) - { - if (evt.getSource() instanceof Choice) { - handleEnumChanged(); - } - } - - public void errorText(String s) - { - if (DEBUG) - System.out.println(s); - } - - protected void processWindowEvent(WindowEvent evt) - { - if (evt.getID() == WindowEvent.WINDOW_CLOSING && - evt.getWindow() == this) { - hide(); - dispose(); - if (applet != null) { - applet.demoClosed(); - } else System.exit(0); - } - } - - protected void processKeyEvent(KeyEvent evt) - { - switch (evt.getID()) { - case KeyEvent.KEY_PRESSED : - if (evt.getKeyCode() == KeyEvent.VK_CONTROL) { - isctrldown_ = true; - } - break; - case KeyEvent.KEY_RELEASED : - // key detection for left and right buttons are removed - // to emulate the old release behaviour - int key = evt.getKeyCode(); - if (key == KeyEvent.VK_N && isctrldown_) { - handleForward(); - } - else - if (key == KeyEvent.VK_P && isctrldown_) { - handleBackward(); - } - else - if (key == KeyEvent.VK_CONTROL) { - isctrldown_ = false; - } - break; - } - } -} diff --git a/icu4j/src/com/ibm/demo/rbbi/TextBoundDemo.java b/icu4j/src/com/ibm/demo/rbbi/TextBoundDemo.java deleted file mode 100755 index 6bae439528..0000000000 --- a/icu4j/src/com/ibm/demo/rbbi/TextBoundDemo.java +++ /dev/null @@ -1,435 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/rbbi/Attic/TextBoundDemo.java,v $ - * $Date: 2001/11/12 23:44:44 $ - * $Revision: 1.6 $ - * - ***************************************************************************************** - */ -package com.ibm.demo.rbbi; - -import com.ibm.demo.*; -import java.applet.Applet; -import java.awt.*; -import java.awt.event.ItemListener; -import java.awt.event.ItemEvent; -import java.awt.event.KeyEvent; -import java.awt.event.WindowEvent; -import javax.swing.JTextArea; -import javax.swing.JScrollPane; -import javax.swing.BorderFactory; -import java.util.*; - -import com.ibm.text.BreakIterator; - -public class TextBoundDemo extends DemoApplet -{ - public static void main(String argv[]) { - new TextBoundDemo().showDemo(); - } - - public Frame createDemoFrame(DemoApplet applet) { - return new TextBoundFrame(applet); - } -} - - - -class TextBoundFrame extends Frame implements ItemListener -{ - private static final String creditString = - "v1.1a9, Demo"; - - private static final int FIELD_COLUMNS = 45; - private static final Font choiceFont = null; - private static final boolean DEBUG = false; - private DemoApplet applet; - - final String right = "-->"; - final String left = "<--"; - - private BreakIterator enum; - private boolean isctrldown_ = false; - -JTextArea text; -// TextArea text; - Choice bound; - - public TextBoundFrame(DemoApplet applet) - { - this.applet = applet; - init(); - start(); - } - - - - public void run() - { - /* - while (true) { - try { - checkChange(); - Thread.sleep(250); - } - catch (InterruptedException e) { - } - catch (Exception e) { - } - catch (Throwable e) { - } - } - */ - } - - int s, e; - int ts, te; - - public void checkChange() - { -// System.out.println("checkChange..."); - if ((text.getSelectionStart() & 0x7FFF) != ts || - (text.getSelectionEnd() & 0x7FFF) != te) { - - // not used int tempS = text.getSelectionStart() & 0x7FFF; - // not used int tempE = text.getSelectionEnd() & 0x7FFF; - -// System.out.println(">"); -// select(0, 0); -// select(tempS, tempE); - //select(tempS - (ts - s), tempE - (te - e)); -// System.out.println("<"); - - -// if (s != ts || e != te) System.out.println(" s("+s+") ts("+ts+") e("+e+") te("+te+")"); -// if (tempS != ts || tempE != te) System.out.println(">s("+s+") tempS("+tempS+") e("+e+") tempE("+tempE+")"); -// select(s - (ts - s), e - (te - e)); -// if (tempS != ts || tempE != te) System.out.println("s("+s+") tempS("+tempS+") e("+e+") tempE("+tempE+")"); - -// System.out.println("lkdslksj"); - } - } - - public void select(int sIn, int eIn) - { - s = sIn; - e = eIn; - text.select(s, e); - ts = text.getSelectionStart() & 0x7FFF; - te = text.getSelectionEnd() & 0x7FFF; -// if (s != ts || e != te) { -// System.out.println(">s("+s+") ts("+ts+") e("+e+") te("+te+")"); -// System.out.println(" "+(ts-s)+","+(te-e)); -// } - } - - public int getSelectionStart() - { - checkChange(); -// return s; - return text.getSelectionStart() & 0x7FFF; - } - - - public int getSelectionEnd() - { - checkChange(); -// return e; - return text.getSelectionEnd() & 0x7FFF; - } - - public final synchronized void selectRange(int s, int e) - { - try { - //if (getSelectionStart() != s || getSelectionEnd() != e) { - //text.select(s, e); - select(s,e); - //} -// if (getSelectionStart() != s || getSelectionEnd() != e) { -// System.out.println("AGH! select("+s+","+e+") -> ("+ -// getSelectionStart()+","+getSelectionEnd()+")"); -// text.select(s - (getSelectionStart() - s), e - (getSelectionEnd() - e)); -// } - } catch (Exception exp) { - errorText(exp.toString()); - } - } - - - - public void init() - { - buildGUI(); - } - - - public void start() - { - } - - - void addWithFont(Container container, Component foo, Font font) { - if (font != null) - foo.setFont(font); - container.add(foo); - } - - - - public void buildGUI() - { - setBackground(DemoUtility.bgColor); - setLayout(new BorderLayout()); - - Panel topPanel = new Panel(); - - Label titleLabel = - new Label("Text Boundary Demo", Label.CENTER); - titleLabel.setFont(DemoUtility.titleFont); - topPanel.add(titleLabel); - - //Label demo=new Label(creditString, Label.CENTER); - //demo.setFont(DemoUtility.creditFont); - //topPanel.add(demo); - - Panel choicePanel = new Panel(); - - Label demo1=new Label("Boundaries", Label.LEFT); - demo1.setFont(DemoUtility.labelFont); - choicePanel.add(demo1); - - bound = new Choice(); - bound.setBackground(DemoUtility.choiceColor); - bound.addItem("Sentence"); - bound.addItem("Line Break"); - bound.addItem("Word"); - bound.addItem("Char"); - bound.addItemListener(this); - if (choiceFont != null) - bound.setFont(choiceFont); - - choicePanel.add(bound); - topPanel.add(choicePanel); - - DemoUtility.fixGrid(topPanel,1); - - - add("North", topPanel); - - - int ROWS = 15; - int COLUMNS = 50; -// text = new TextArea(getInitialText(), ROWS, COLUMNS); -text = new JTextArea(getInitialText(), ROWS, COLUMNS); -text.setLineWrap(true); -text.setWrapStyleWord(true); - text.setEditable(true); - text.selectAll(); - text.setFont(DemoUtility.editFont); - text.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); - - add("Center", new JScrollPane(text, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, - JScrollPane.HORIZONTAL_SCROLLBAR_NEVER)); - - Panel copyrightPanel = new Panel(); - addWithFont (copyrightPanel, - new Label(DemoUtility.copyright1, Label.LEFT),DemoUtility.creditFont); - addWithFont (copyrightPanel, - new Label(DemoUtility.copyright2, Label.LEFT),DemoUtility.creditFont); - DemoUtility.fixGrid(copyrightPanel,1); - add("South", copyrightPanel); - - //layout(); - handleEnumChanged(); - - enableEvents(WindowEvent.WINDOW_CLOSING); - enableEvents(KeyEvent.KEY_PRESSED); - enableEvents(KeyEvent.KEY_RELEASED); - - // (new Thread(this)).start(); - } - - - - public String getInitialText() - { - return - /* - "\"This is a sentence.\" This is not.\" \"because. And go. " + - "This is a simple 012.566,5 sample sentence. \n"+ - "It does not have to make any sense as you can see. \n"+ - "Nel mezzo del cammin di nostra vita, mi ritrovai in "+ - "una selva oscura. \n"+ - "Che la dritta via aveo smarrita. \n"+ - "He said, that I said, that you said!! \n"+ - "Don't rock the boat.\n\n"+ - "Because I am the daddy, that is why. \n"+ - "Not on my time (el timo.)! \n"+ - "Tab\tTab\rTab\tWow."+ - "So what!!\n\n"+ - "Is this a question??? " + - "I wonder...Hmm.\n" + - "Harris thumbed down several, including \"Away We Go\" "+ - "(which became the huge success Oklahoma!). \n"+ - "One species, B. anthracis, is highly virulent.\n"+ - "Wolf said about Sounder: \"Beautifully thought-out and "+ - "directed.\"\n"+ - "Have you ever said, \"This is where I shall live\"? \n"+ - "He 1000,233,456.000 answered, \"You may not!\" \n"+ - "Another popular saying is: \"How do you do?\". \n"+ - "What is the proper use of the abbreviation pp.? \n"+ - "Yes, I am 1,23.322% definatelly 12\" tall!!"; - */ - "(\"This is a complete sentence.\") This is (\"not.\") also. " - +"An abbreviation in the middle, etc. and one at the end, etc. "+ - "This " - +"is a simple sample 012.566,5 sentence. It doesn't " - +"have to make any sense, as you can see. Nel mezzo del c" - +"ammin di nostra vita, mi ritrovai in una selva oscura. Che " - +"la dritta via aveo smarrita. Not on my time (el timo.)! And " - +"tabulated columns: \tCol1\tCol2\t3,456%.\t " - +"Is this a question??? I wonder... Hmm. Harris thumbed " - +"down several, including \"Away We Go\" (which became the " - +"huge success Oklahoma!). One species, B. anthracis, is " - +"highly virulent. Wolf said about Sounder: \"Beautifully " - +"thought-out and directed.\" Have you ever said, \"This is "+ - "where I " - +"shall live\"? He said 1000,233,456.000 and answered, \"You "+ - "may not!\" " - +"Another popular saying is: \"How do you do?\". What is the " - +"proper use of the abbreviation pp.? Yes, I am 12\' 3\" tall!!"; - } - - - public void handleEnumChanged() - { - String s = bound.getSelectedItem(); - if (s.equals("Char")) { - errorText("getCharacterInstance"); - enum = BreakIterator.getCharacterInstance(); - } - else if (s.equals("Word")) { - errorText("tWordBreak"); - enum = BreakIterator.getWordInstance(); - } - else if (s.equals("Line Break")) { - errorText("getLineInstance"); - enum = BreakIterator.getLineInstance(); - } - else /* if (s.equals("Sentence")) */ { - errorText("getSentenceInstance"); - enum = BreakIterator.getSentenceInstance(); - } - enum.setText(text.getText()); - selectRange(0, 0); - //text.select(0,0); - } - - public void handleForward() - { - try { -// System.out.println("entering handleForward"); - enum.setText(text.getText()); - int oldStart = getSelectionStart(); - int oldEnd = getSelectionEnd(); - -// System.out.println("handleForward: oldStart=" + oldStart + ", oldEnd=" + oldEnd); - - if (oldEnd < 1) { - selectRange(0, enum.following(0)); - } - else { - int s = enum.following(oldEnd-1); - int e = enum.next(); - if (e == -1) { - e = s; - } - selectRange(s, e); - } - //text.select(s, e); - errorText("<" + oldStart + "," + oldEnd + "> -> <" + - s + "," + e + ">"); - } - catch (Exception exp) { - errorText(exp.toString()); - } - } - - public void handleBackward() - { - try { - enum.setText(text.getText()); - int oldStart = getSelectionStart(); - int oldEnd = getSelectionEnd(); - if (oldStart < 1) { - selectRange(0, 0); - } - else { - int e = enum.following(oldStart-1); - int s = enum.previous(); - selectRange(s, e); - } - //text.select(s, e); - errorText("<" + oldStart + "," + oldEnd + "> -> <" + s + "," + e + ">"); - } - catch (Exception exp) { - errorText(exp.toString()); - } - } - - public void itemStateChanged(ItemEvent evt) - { - if (evt.getSource() instanceof Choice) { - handleEnumChanged(); - } - } - - public void errorText(String s) - { - if (DEBUG) - System.out.println(s); - } - - protected void processWindowEvent(WindowEvent evt) - { - if (evt.getID() == WindowEvent.WINDOW_CLOSING && - evt.getWindow() == this) { - hide(); - dispose(); - if (applet != null) { - applet.demoClosed(); - } else System.exit(0); - } - } - - protected void processKeyEvent(KeyEvent evt) - { - switch (evt.getID()) { - case KeyEvent.KEY_PRESSED : - if (evt.getKeyCode() == KeyEvent.VK_CONTROL) { - isctrldown_ = true; - } - break; - case KeyEvent.KEY_RELEASED : - // key detection for left and right buttons are removed - // to emulate the old release behaviour - int key = evt.getKeyCode(); - if (key == KeyEvent.VK_N && isctrldown_) { - handleForward(); - } - else - if (key == KeyEvent.VK_P && isctrldown_) { - handleBackward(); - } - else - if (key == KeyEvent.VK_CONTROL) { - isctrldown_ = false; - } - break; - } - } -} diff --git a/icu4j/src/com/ibm/demo/rbbi/package.html b/icu4j/src/com/ibm/demo/rbbi/package.html deleted file mode 100755 index d5eb46ad17..0000000000 --- a/icu4j/src/com/ibm/demo/rbbi/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -RuleBasedBreakIterator and DictionaryBasedBreakIterator demo applications. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/demo/rbnf/RbnfDemo.java b/icu4j/src/com/ibm/demo/rbnf/RbnfDemo.java deleted file mode 100755 index e78295ac35..0000000000 --- a/icu4j/src/com/ibm/demo/rbnf/RbnfDemo.java +++ /dev/null @@ -1,533 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/rbnf/Attic/RbnfDemo.java,v $ - * $Date: 2000/03/10 03:47:43 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.demo.rbnf; - -import com.ibm.demo.*; -import java.applet.Applet; -import java.awt.*; -import java.awt.event.*; -import java.text.DecimalFormat; -import java.text.BreakIterator; -import java.text.ParsePosition; -import java.util.Locale; - -import com.ibm.text.RuleBasedNumberFormat; - -public class RbnfDemo extends DemoApplet { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - /* - * code to run the demo as an application - */ - public static void main(String[] argv) { - new RbnfDemo().showDemo(); - } - - protected Dimension getDefaultFrameSize(DemoApplet applet, Frame f) { - return new Dimension(430,270); - } - - protected Frame createDemoFrame(DemoApplet applet) { - final Frame window = new Frame("Number Spellout Demo"); - window.setSize(800, 600); - window.setLayout(new BorderLayout()); - - Panel mainPanel = new Panel(); - mainPanel.setLayout(new GridLayout(1,2)); - - commentaryField = new TextArea("", 0, 0, TextArea.SCROLLBARS_VERTICAL_ONLY); - commentaryField.setSize(800, 50); - commentaryField.setText(RbnfSampleRuleSets.sampleRuleSetCommentary[0]); - commentaryField.setEditable(false); - commentaryField.setFont(new Font("Helvetica", Font.PLAIN, 14)); - - spelloutFormatter = new RuleBasedNumberFormat(RbnfSampleRuleSets.usEnglish, Locale.US); - spelloutFormatter.setLenientParseMode(lenientParse); - populateRuleSetMenu(); - numberFormatter = new DecimalFormat("#,##0.##########"); - parsePosition = new ParsePosition(0); - theNumber = 0; - - numberField = new TextField(); - numberField.setFont(new Font("Serif", Font.PLAIN, 24)); - textField = new DemoTextFieldHolder(); - textField.setFont(new Font("Serif", Font.PLAIN, 24)); - rulesField = new DemoTextFieldHolder(); - rulesField.setFont(new Font("Serif", Font.PLAIN, 14)); - lenientParseButton = new Checkbox("Lenient parse", lenientParse); - - numberField.addTextListener(new TextListener() { - public void textValueChanged(TextEvent e) { - if (!numberFieldHasFocus) - return; - - String fieldText = ((TextComponent)(e.getSource())).getText(); - parsePosition.setIndex(0); - Number temp = numberFormatter.parse(fieldText, parsePosition); - if (temp == null || parsePosition.getIndex() == 0) { - theNumber = 0; - textField.setText("PARSE ERROR"); - } - else { - theNumber = temp.doubleValue(); - textField.setText(spelloutFormatter.format(theNumber, ruleSetName)); - } - } - } ); - - numberField.addFocusListener(new FocusAdapter() { - public void focusLost(FocusEvent e) { - numberFieldHasFocus = false; - numberField.setText(numberFormatter.format(theNumber)); - } - - public void focusGained(FocusEvent e) { - numberFieldHasFocus = true; - numberField.selectAll(); - } - } ); - - textField.addKeyListener(new KeyAdapter() { - public void keyTyped(KeyEvent e) { - if (e.getKeyChar() == '\t') { - String fieldText = ((TextComponent)(e.getSource())).getText(); - parsePosition.setIndex(0); - theNumber = spelloutFormatter.parse(fieldText, parsePosition) - .doubleValue(); - if (parsePosition.getIndex() == 0) { - theNumber = 0; - numberField.setText("PARSE ERROR"); - textField.selectAll(); - } - else if (parsePosition.getIndex() < fieldText.length()) { - textField.select(parsePosition.getIndex(), fieldText.length()); - numberField.setText(numberFormatter.format(theNumber)); - } - else { - textField.selectAll(); - numberField.setText(numberFormatter.format(theNumber)); - } - e.consume(); - } - } - } ); - - textField.addFocusListener(new FocusAdapter() { - public void focusLost(FocusEvent e) { - String fieldText = ((TextComponent)(e.getSource())).getText(); - parsePosition.setIndex(0); - theNumber = spelloutFormatter.parse(fieldText, parsePosition) - .doubleValue(); - if (parsePosition.getIndex() == 0) - numberField.setText("PARSE ERROR"); - else - numberField.setText(numberFormatter.format(theNumber)); - textField.setText(textField.getText()); // textField.repaint() didn't work right - } - - public void focusGained(FocusEvent e) { - textField.selectAll(); - } - } ); - - rulesField.addKeyListener(new KeyAdapter() { - public void keyTyped(KeyEvent e) { - if (e.getKeyChar() == '\t') { - String fieldText = ((TextComponent)(e.getSource())).getText(); - if (formatterMenu.getSelectedItem().equals("Custom") || !fieldText.equals( - RbnfSampleRuleSets.sampleRuleSets[formatterMenu.getSelectedIndex()])) { - try { - RuleBasedNumberFormat temp = new RuleBasedNumberFormat(fieldText); - temp.setLenientParseMode(lenientParse); - populateRuleSetMenu(); - spelloutFormatter = temp; - customRuleSet = fieldText; - formatterMenu.select("Custom"); - commentaryField.setText(RbnfSampleRuleSets. - sampleRuleSetCommentary[RbnfSampleRuleSets. - sampleRuleSetCommentary.length - 1]); - redisplay(); - } - catch (Exception x) { - textField.setText(x.toString()); - } - } - e.consume(); - } - } - } ); - - rulesField.addFocusListener(new FocusAdapter() { - public void focusLost(FocusEvent e) { - String fieldText = ((TextComponent)(e.getSource())).getText(); - if (formatterMenu.getSelectedItem().equals("Custom") || !fieldText.equals( - RbnfSampleRuleSets.sampleRuleSets[formatterMenu.getSelectedIndex()])) { - try { - RuleBasedNumberFormat temp = new RuleBasedNumberFormat(fieldText); - temp.setLenientParseMode(lenientParse); - populateRuleSetMenu(); - spelloutFormatter = temp; - customRuleSet = fieldText; - formatterMenu.select("Custom"); - redisplay(); - } - catch (Exception x) { - textField.setText(x.toString()); - } - } - rulesField.setText(rulesField.getText()); // rulesField.repaint() didn't work right - } - } ); - - lenientParseButton.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - lenientParse = lenientParseButton.getState(); - spelloutFormatter.setLenientParseMode(lenientParse); - } - } ); - - numberField.setText(numberFormatter.format(theNumber)); - numberField.selectAll(); - textField.setText(spelloutFormatter.format(theNumber, ruleSetName)); - - Panel leftPanel = new Panel(); - leftPanel.setLayout(new BorderLayout()); - Panel panel = new Panel(); - panel.setLayout(new BorderLayout()); - Panel panel1 = new Panel(); - panel1.setLayout(new GridLayout(3, 1)); - panel1.add(new Panel()); - panel1.add(numberField, "Center"); - panel1.add(lenientParseButton); - panel.add(panel1, "Center"); - Panel panel2 = new Panel(); - panel2.setLayout(new GridLayout(3, 3)); - Button button = new Button("+100"); - button.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { - roll(100); - } - } ); - panel2.add(button); - button = new Button("+10"); - button.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { - roll(10); - } - } ); - panel2.add(button); - button = new Button("+1"); - button.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { - roll(1); - } - } ); - panel2.add(button); - button = new Button("<"); - button.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { - theNumber *= 10; - redisplay(); - } - } ); - panel2.add(button); - panel2.add(new Panel()); - button = new Button(">"); - button.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { - theNumber /= 10; - redisplay(); - } - } ); - panel2.add(button); - button = new Button("-100"); - button.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { - roll(-100); - } - } ); - panel2.add(button); - button = new Button("-10"); - button.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { - roll(-10); - } - } ); - panel2.add(button); - button = new Button("-1"); - button.addActionListener( new ActionListener() { - public void actionPerformed(ActionEvent e) { - roll(-1); - } - } ); - panel2.add(button); - panel.add(panel2, "East"); - leftPanel.add(panel, "North"); - leftPanel.add(textField, "Center"); - - Panel rightPanel = new Panel(); - rightPanel.setLayout(new BorderLayout()); - formatterMenu = new Choice(); - for (int i = 0; i < RbnfSampleRuleSets.sampleRuleSetNames.length; i++) - formatterMenu.addItem(RbnfSampleRuleSets.sampleRuleSetNames[i]); - formatterMenu.addItem("Custom"); - formatterMenu.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - Choice source = (Choice)(e.getSource()); - int item = source.getSelectedIndex(); - Locale locale = RbnfSampleRuleSets.sampleRuleSetLocales[item]; - - commentaryField.setText(RbnfSampleRuleSets. - sampleRuleSetCommentary[item]); - - if (locale != null && (locale.getLanguage().equals("iw") - || locale.getLanguage().equals("ru") || locale.getLanguage().equals("ja") - || locale.getLanguage().equals("el") - || locale.getLanguage().equals("zh"))) { - textField.togglePanes(false); - rulesField.togglePanes(false); - } - else { - textField.togglePanes(true); - rulesField.togglePanes(true); - } - - makeNewSpelloutFormatter(); - redisplay(); - } - } ); - - ruleSetMenu = new Choice(); - populateRuleSetMenu(); - - ruleSetMenu.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - ruleSetName = ruleSetMenu.getSelectedItem(); - redisplay(); - } - } ); - - Panel menuPanel = new Panel(); - menuPanel.setLayout(new GridLayout(1, 2)); - menuPanel.add(formatterMenu); - menuPanel.add(ruleSetMenu); - rightPanel.add(menuPanel, "North"); - - rulesField.setText(RbnfSampleRuleSets.sampleRuleSets[formatterMenu.getSelectedIndex()]); - rightPanel.add(rulesField, "Center"); - - mainPanel.add(leftPanel); - mainPanel.add(rightPanel); - - window.add(mainPanel, "Center"); - window.add(commentaryField, "South"); - - window.doLayout(); - window.show(); - return window; - } - - void roll(int delta) { - theNumber += delta; - redisplay(); - } - - void redisplay() { - numberField.setText(numberFormatter.format(theNumber)); - textField.setText(spelloutFormatter.format(theNumber, ruleSetName)); - } - - void makeNewSpelloutFormatter() { - int item = formatterMenu.getSelectedIndex(); - String formatterMenuItem = formatterMenu.getSelectedItem(); - - if (formatterMenuItem.equals("Custom")) { - rulesField.setText(customRuleSet); - spelloutFormatter = new RuleBasedNumberFormat(customRuleSet); - } - else { - rulesField.setText(RbnfSampleRuleSets.sampleRuleSets[item]); - - Locale locale = RbnfSampleRuleSets.sampleRuleSetLocales[item]; - if (locale == null) - locale = Locale.getDefault(); - - spelloutFormatter = new RuleBasedNumberFormat(RbnfSampleRuleSets. - sampleRuleSets[item], locale); - } - spelloutFormatter.setLenientParseMode(lenientParse); - populateRuleSetMenu(); - } - - void populateRuleSetMenu() { - String[] ruleSetNames = spelloutFormatter.getRuleSetNames(); - - if (ruleSetMenu != null) { - ruleSetMenu.removeAll(); - for (int i = 0; i < ruleSetNames.length; i++) - ruleSetMenu.addItem(ruleSetNames[i]); - - ruleSetName = ruleSetMenu.getSelectedItem(); - } - else - ruleSetName = ruleSetNames[0]; - } - - private Frame demoWindow = null; - - private TextComponent numberField; - private DemoTextFieldHolder textField; - private DemoTextFieldHolder rulesField; - private TextComponent commentaryField; - private Checkbox lenientParseButton; - - private boolean numberFieldHasFocus = true; - - private RuleBasedNumberFormat spelloutFormatter; - private DecimalFormat numberFormatter; - private ParsePosition parsePosition; - - private boolean lenientParse = true; - - private double theNumber = 0; - private boolean canEdit = true; - - private Choice formatterMenu; - private Choice ruleSetMenu; - private String ruleSetName; - - private String customRuleSet = "NO RULES!"; -} - -class DemoTextField extends Component { - public DemoTextField() { - } - - public void setText(String text) { - this.text = text; - this.repaint(); - } - - public String getText() { - return text; - } - - public void paint(Graphics g) { - Font font = getFont(); - FontMetrics fm = g.getFontMetrics(); - g.setFont(font); - String text = getText(); - BreakIterator bi = BreakIterator.getLineInstance(); - bi.setText(text); - int lineHeight = fm.getHeight(); - int width = getSize().width; - int penY = fm.getAscent(); - int lineStart = 0; - int tempLineEnd = bi.first(); - int lineEnd = 0; - int maxLineEnd = 0; - totalHeight = 0; - - while (lineStart < text.length()) { - maxLineEnd = text.indexOf('\n', lineStart); - if (maxLineEnd == -1) - maxLineEnd = Integer.MAX_VALUE; - while (tempLineEnd != BreakIterator.DONE && fm.stringWidth(text.substring( - lineStart, tempLineEnd)) < width) { - lineEnd = tempLineEnd; - tempLineEnd = bi.next(); - } - if (lineStart >= lineEnd) { - if (tempLineEnd == BreakIterator.DONE) - lineEnd = text.length(); - else - lineEnd = tempLineEnd; - } - if (lineEnd > maxLineEnd) - lineEnd = maxLineEnd; - g.drawString(text.substring(lineStart, lineEnd), 0, penY); - penY += lineHeight; - totalHeight += lineHeight; - lineStart = lineEnd; - if (lineStart < text.length() && text.charAt(lineStart) == '\n') - ++lineStart; - } - } - -/* - public Dimension getPreferredSize() { - Dimension size = getParent().getSize(); - return new Dimension(size.width, totalHeight); - } -*/ - - private String text; - private int totalHeight; -} - -class DemoTextFieldHolder extends Panel { - public DemoTextFieldHolder() { - tf1 = new TextArea("", 0, 0, TextArea.SCROLLBARS_VERTICAL_ONLY); - tf2 = new DemoTextField(); - sp = new ScrollPane(); - - setLayout(new CardLayout()); - - sp.add(tf2, "TextField1"); - sp.setVisible(false); - add(tf1, "TestField2"); - add(sp, "ScrollPane"); - } - - public void addFocusListener(FocusListener l) { - tf1.addFocusListener(l); - } - - public void addKeyListener(KeyListener l) { - tf1.addKeyListener(l); - } - - public void setText(String text) { - tf1.setText(text); - tf2.setText(text); - } - - public String getText() { - return tf1.getText(); - } - - public void select(int start, int end) { - tf1.select(start, end); - } - - public void selectAll() { - tf1.selectAll(); - } - - public void togglePanes(boolean canShowRealTextField) { - if (canShowRealTextField != showingRealTextField) { - CardLayout layout = (CardLayout)(getLayout()); - layout.next(this); - showingRealTextField = canShowRealTextField; - } - } - - private TextArea tf1 = null; - private DemoTextField tf2 = null; - private ScrollPane sp = null; - private boolean showingRealTextField = true; -} diff --git a/icu4j/src/com/ibm/demo/rbnf/RbnfSampleRuleSets.java b/icu4j/src/com/ibm/demo/rbnf/RbnfSampleRuleSets.java deleted file mode 100755 index 2294212573..0000000000 --- a/icu4j/src/com/ibm/demo/rbnf/RbnfSampleRuleSets.java +++ /dev/null @@ -1,1949 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/rbnf/Attic/RbnfSampleRuleSets.java,v $ - * $Date: 2000/03/10 03:47:44 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.demo.rbnf; - -import com.ibm.demo.*; -import java.util.Locale; - -/** - * A collection of example rule sets for use with RuleBasedNumberFormat. - * These examples are intended to serve both as demonstrations of what can - * be done with this framework, and as starting points for designing new - * rule sets. - * - * For those that claim to represent number-spellout rules for languages - * other than U.S. English, we make no claims of either accuracy or - * completeness. In fact, we know them to be incomplete, and suspect - * most have mistakes in them. If you see something that you know is wrong, - * please tell us! - * - * @author Richard Gillam - * @version $Version$ $Date: 2000/03/10 03:47:44 $ - */ -public class RbnfSampleRuleSets { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - //======================================================================== - // Spellout rules for various languages - // - // The following RuleBasedNumberFormat descriptions show the rules for - // spelling out numeric values in various languages. As mentioned - // before, we cannot vouch for the accuracy or completeness of this - // data, although we believe it's pretty close. Basically, this - // represents one day's worth of Web-surfing. If you can supply the - // missing information in any of these rule sets, or if you find errors, - // or if you can supply spellout rules for languages that aren't shown - // here, we want to hear from you! - //======================================================================== - - /** - * Spellout rules for U.S. English. This demonstration version of the - * U.S. English spellout rules has four variants: 1) %simplified is a - * set of rules showing the simple method of spelling out numbers in - * English: 289 is formatted as "two hundred eighty-nine". 2) %alt-teens - * is the same as %simplified, except that values between 1,000 and 9,999 - * whose hundreds place isn't zero are formatted in hundreds. For example, - * 1,983 is formatted as "nineteen hundred eighty-three," and 2,183 is - * formatted as "twenty-one hundred eighty-three," but 2,083 is still - * formatted as "two thousand eighty-three." 3) %ordinal formats the - * values as ordinal numbers in English (e.g., 289 is "two hundred eighty- - * ninth"). 4) %default uses a more complicated algorithm to format - * numbers in a more natural way: 289 is formatted as "two hundred AND - * eighty-nine" and commas are inserted between the thousands groups for - * values above 100,000. - */ - public static final String usEnglish = - // This rule set shows the normal simple formatting rules for English - "%simplified:\n" - // negative number rule. This rule is used to format negative - // numbers. The result of formatting the number's absolute - // value is placed where the >> is. - + " -x: minus >>;\n" - // faction rule. This rule is used for formatting numbers - // with fractional parts. The result of formatting the - // number's integral part is substituted for the <<, and - // the result of formatting the number's fractional part - // (one digit at a time, e.g., 0.123 is "zero point one two - // three") replaces the >>. - + " x.x: << point >>;\n" - // the rules for the values from 0 to 19 are simply the - // words for those numbers - + " zero; one; two; three; four; five; six; seven; eight; nine;\n" - + " ten; eleven; twelve; thirteen; fourteen; fifteen; sixteen;\n" - + " seventeen; eighteen; nineteen;\n" - // beginning at 20, we use the >> to mark the position where - // the result of formatting the number's ones digit. Thus, - // we only need a new rule at every multiple of 10. Text in - // backets is omitted if the value being formatted is an - // even multiple of 10. - + " 20: twenty[->>];\n" - + " 30: thirty[->>];\n" - + " 40: forty[->>];\n" - + " 50: fifty[->>];\n" - + " 60: sixty[->>];\n" - + " 70: seventy[->>];\n" - + " 80: eighty[->>];\n" - + " 90: ninety[->>];\n" - // beginning at 100, we can use << to mark the position where - // the result of formatting the multiple of 100 is to be - // inserted. Notice also that the meaning of >> has shifted: - // here, it refers to both the ones place and the tens place. - // The meanings of the << and >> tokens depend on the base value - // of the rule. A rule's divisor is (usually) the highest - // power of 10 that is less than or equal to the rule's base - // value. The value being formatted is divided by the rule's - // divisor, and the integral quotient is used to get the text - // for <<, while the remainder is used to produce the text - // for >>. Again, text in brackets is omitted if the value - // being formatted is an even multiple of the rule's divisor - // (in this case, an even multiple of 100) - + " 100: << hundred[ >>];\n" - // The rules for the higher numbers work the same way as the - // rule for 100: Again, the << and >> tokens depend on the - // rule's divisor, which for all these rules is also the rule's - // base value. To group by thousand, we simply don't have any - // rules between 1,000 and 1,000,000. - + " 1000: << thousand[ >>];\n" - + " 1,000,000: << million[ >>];\n" - + " 1,000,000,000: << billion[ >>];\n" - + " 1,000,000,000,000: << trillion[ >>];\n" - // overflow rule. This rule specifies that values of a - // quadrillion or more are shown in numerals rather than words. - // The == token means to format (with new rules) the value - // being formatted by this rule and place the result where - // the == is. The #,##0 inside the == signs is a - // DecimalFormat pattern. It specifies that the value should - // be formatted with a DecimalFormat object, and that it - // should be formatted with no decimal places, at least one - // digit, and a thousands separator. - + " 1,000,000,000,000,000: =#,##0=;\n" - - // This rule set formats numbers between 1,000 and 9,999 somewhat - // differently: If the hundreds digit is not zero, the first two - // digits are treated as a number of hundreds. For example, 2,197 - // would come out as "twenty-one hundred ninety-seven." - + "%alt-teens:\n" - // just use %simplified to format values below 1,000 - + " =%simplified=;\n" - // values between 1,000 and 9,999 are delegated to %%alt-hundreds - // for formatting. The > after "1000" decreases the exponent - // of the rule's radix by one, causing the rule's divisor - // to be 100 instead of 1,000. This causes the first TWO - // digits of the number, instead of just the first digit, - // to be sent to %%alt-hundreds - + " 1000>: <%%alt-hundreds<[ >>];\n" - // for values of 10,000 and more, we again just use %simplified - + " 10,000: =%simplified=;\n" - // This rule set uses some obscure voodoo of the description language - // to format the first two digits of a value in the thousands. - // The rule at 10 formats the first two digits as a multiple of 1,000 - // and the rule at 11 formats the first two digits as a multiple of - // 100. This works because of something known as the "rollback rule": - // if the rule applicable to the value being formatted has two - // substitutions, the value being formatted is an even multiple of - // the rule's divisor, and the rule's base value ISN'T an even multiple - // if the rule's divisor, then the rule that precedes this one in the - // list is used instead. (The [] notation is implemented internally - // using this notation: a rule containing [] is split into two rules, - // and the right one is chosen using the rollback rule.) In this case, - // it means that if the first two digits are an even multiple of 10, - // they're formatted with the 10 rule (containing "thousand"), and if - // they're not, they're formatted with the 11 rule (containing - // "hundred"). %%empty is a hack to cause the rollback rule to be - // invoked: it makes the 11 rule have two substitutions, even though - // the second substitution (calling %%empty) doesn't actually do - // anything. - + "%%alt-hundreds:\n" - + " 0: SHOULD NEVER GET HERE!;\n" - + " 10: <%simplified< thousand;\n" - + " 11: =%simplified= hundred>%%empty>;\n" - + "%%empty:\n" - + " 0:;" - - // this rule set is the same as %simplified, except that it formats - // the value as an ordinal number: 234 is formatted as "two hundred - // thirty-fourth". Notice the calls to ^simplified: we have to - // call %simplified to avoid getting "second hundred thirty-fourth." - + "%ordinal:\n" - + " zeroth; first; second; third; fourth; fifth; sixth; seventh;\n" - + " eighth; ninth;\n" - + " tenth; eleventh; twelfth; thirteenth; fourteenth;\n" - + " fifteenth; sixteenth; seventeenth; eighteenth;\n" - + " nineteenth;\n" - + " twentieth; twenty->>;\n" - + " 30: thirtieth; thirty->>;\n" - + " 40: fortieth; forty->>;\n" - + " 50: fiftieth; fifty->>;\n" - + " 60: sixtieth; sixty->>;\n" - + " 70: seventieth; seventy->>;\n" - + " 80: eightieth; eighty->>;\n" - + " 90: ninetieth; ninety->>;\n" - + " 100: <%simplified< hundredth; <%simplified< hundred >>;\n" - + " 1000: <%simplified< thousandth; <%simplified< thousand >>;\n" - + " 1,000,000: <%simplified< millionth; <%simplified< million >>;\n" - + " 1,000,000,000: <%simplified< billionth;\n" - + " <%simplified< billion >>;\n" - + " 1,000,000,000,000: <%simplified< trillionth;\n" - + " <%simplified< trillion >>;\n" - + " 1,000,000,000,000,000: =#,##0=;" - - // %default is a more elaborate form of %simplified; It is basically - // the same, except that it introduces "and" before the ones digit - // when appropriate (basically, between the tens and ones digits) and - // separates the thousands groups with commas in values over 100,000. - + "%default:\n" - // negative-number and fraction rules. These are the same - // as those for %simplified, but ave to be stated here too - // because this is an entry point - + " -x: minus >>;\n" - + " x.x: << point >>;\n" - // just use %simplified for values below 100 - + " =%simplified=;\n" - // for values from 100 to 9,999 use %%and to decide whether or - // not to interpose the "and" - + " 100: << hundred[ >%%and>];\n" - + " 1000: << thousand[ >%%and>];\n" - // for values of 100,000 and up, use %%commas to interpose the - // commas in the right places (and also to interpose the "and") - + " 100,000>>: << thousand[>%%commas>];\n" - + " 1,000,000: << million[>%%commas>];\n" - + " 1,000,000,000: << billion[>%%commas>];\n" - + " 1,000,000,000,000: << trillion[>%%commas>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - // if the value passed to this rule set is greater than 100, don't - // add the "and"; if it's less than 100, add "and" before the last - // digits - + "%%and:\n" - + " and =%default=;\n" - + " 100: =%default=;\n" - // this rule set is used to place the commas - + "%%commas:\n" - // for values below 100, add "and" (the apostrophe at the - // beginning is ignored, but causes the space that follows it - // to be significant: this is necessary because the rules - // calling %%commas don't put a space before it) - + " ' and =%default=;\n" - // put a comma after the thousands (or whatever preceded the - // hundreds) - + " 100: , =%default=;\n" - // put a comma after the millions (or whatever precedes the - // thousands) - + " 1000: , <%default< thousand, >%default>;\n" - // and so on... - + " 1,000,000: , =%default=;" - // %%lenient-parse isn't really a set of number formatting rules; - // it's a set of collation rules. Lenient-parse mode uses a Collator - // object to compare fragments of the text being parsed to the text - // in the rules, allowing more leeway in the matching text. This set - // of rules tells the formatter to ignore commas when parsing (it - // already ignores spaces, which is why we refer to the space; it also - // ignores hyphens, making "twenty one" and "twenty-one" parse - // identically) - + "%%lenient-parse:\n" - + " & ' ' , ',' ;\n"; - - /** - * Spellout rules for U.K. English. U.K. English has one significant - * difference from U.S. English: the names for values of 1,000,000,000 - * and higher. In American English, each successive "-illion" is 1,000 - * times greater than the preceding one: 1,000,000,000 is "one billion" - * and 1,000,000,000,000 is "one trillion." In British English, each - * successive "-illion" is one million times greater than the one before: - * "one billion" is 1,000,000,000,000 (or what Americans would call a - * "trillion"), and "one trillion" is 1,000,000,000,000,000,000. - * 1,000,000,000 in British English is "one thousand million." (This - * value is sometimes called a "milliard," but this word seems to have - * fallen into disuse.) - */ - public static final String ukEnglish = - "%simplified:\n" - + " -x: minus >>;\n" - + " x.x: << point >>;\n" - + " zero; one; two; three; four; five; six; seven; eight; nine;\n" - + " ten; eleven; twelve; thirteen; fourteen; fifteen; sixteen;\n" - + " seventeen; eighteen; nineteen;\n" - + " 20: twenty[->>];\n" - + " 30: thirty[->>];\n" - + " 40: forty[->>];\n" - + " 50: fifty[->>];\n" - + " 60: sixty[->>];\n" - + " 70: seventy[->>];\n" - + " 80: eighty[->>];\n" - + " 90: ninety[->>];\n" - + " 100: << hundred[ >>];\n" - + " 1000: << thousand[ >>];\n" - + " 1,000,000: << million[ >>];\n" - + " 1,000,000,000,000: << billion[ >>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - + "%alt-teens:\n" - + " =%simplified=;\n" - + " 1000>: <%%alt-hundreds<[ >>];\n" - + " 10,000: =%simplified=;\n" - + " 1,000,000: << million[ >%simplified>];\n" - + " 1,000,000,000,000: << billion[ >%simplified>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - + "%%alt-hundreds:\n" - + " 0: SHOULD NEVER GET HERE!;\n" - + " 10: <%simplified< thousand;\n" - + " 11: =%simplified= hundred>%%empty>;\n" - + "%%empty:\n" - + " 0:;" - + "%ordinal:\n" - + " zeroth; first; second; third; fourth; fifth; sixth; seventh;\n" - + " eighth; ninth;\n" - + " tenth; eleventh; twelfth; thirteenth; fourteenth;\n" - + " fifteenth; sixteenth; seventeenth; eighteenth;\n" - + " nineteenth;\n" - + " twentieth; twenty->>;\n" - + " 30: thirtieth; thirty->>;\n" - + " 40: fortieth; forty->>;\n" - + " 50: fiftieth; fifty->>;\n" - + " 60: sixtieth; sixty->>;\n" - + " 70: seventieth; seventy->>;\n" - + " 80: eightieth; eighty->>;\n" - + " 90: ninetieth; ninety->>;\n" - + " 100: <%simplified< hundredth; <%simplified< hundred >>;\n" - + " 1000: <%simplified< thousandth; <%simplified< thousand >>;\n" - + " 1,000,000: <%simplified< millionth; <%simplified< million >>;\n" - + " 1,000,000,000,000: <%simplified< billionth;\n" - + " <%simplified< billion >>;\n" - + " 1,000,000,000,000,000: =#,##0=;" - + "%default:\n" - + " -x: minus >>;\n" - + " x.x: << point >>;\n" - + " =%simplified=;\n" - + " 100: << hundred[ >%%and>];\n" - + " 1000: << thousand[ >%%and>];\n" - + " 100,000>>: << thousand[>%%commas>];\n" - + " 1,000,000: << million[>%%commas>];\n" - + " 1,000,000,000,000: << billion[>%%commas>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - + "%%and:\n" - + " and =%default=;\n" - + " 100: =%default=;\n" - + "%%commas:\n" - + " ' and =%default=;\n" - + " 100: , =%default=;\n" - + " 1000: , <%default< thousand, >%default>;\n" - + " 1,000,000: , =%default=;" - + "%%lenient-parse:\n" - + " & ' ' , ',' ;\n"; - // Could someone please correct me if I'm wrong about "milliard" falling - // into disuse, or have missed any other details of how large numbers - // are rendered. Also, could someone please provide me with information - // on which other English-speaking countries use which system? Right now, - // I'm assuming that the U.S. system is used in Canada and that all the - // other English-speaking countries follow the British system. Can - // someone out there confirm this? - - /** - * Spellout rules for Spanish. The Spanish rules are quite similar to - * the English rules, but there are some important differences: - * First, we have to provide separate rules for most of the twenties - * because the ones digit frequently picks up an accent mark that it - * doesn't have when standing alone. Second, each multiple of 100 has - * to be specified separately because the multiplier on 100 very often - * changes form in the contraction: 500 is "quinientos," not - * "cincocientos." In addition, the word for 100 is "cien" when - * standing alone, but changes to "ciento" when followed by more digits. - * There also some other differences. - */ - public static final String spanish = - // negative-number and fraction rules - "-x: menos >>;\n" - + "x.x: << punto >>;\n" - // words for values from 0 to 19 - + "cero; uno; dos; tres; cuatro; cinco; seis; siete; ocho; nueve;\n" - + "diez; once; doce; trece; catorce; quince; diecis\u00e9is;\n" - + " diecisiete; dieciocho; diecinueve;\n" - // words for values from 20 to 29 (necessary because the ones digit - // often picks up an accent mark it doesn't have when standing alone) - + "veinte; veintiuno; veintid\u00f3s; veintitr\u00e9s; veinticuatro;\n" - + " veinticinco; veintis\u00e9is; veintisiete; veintiocho;\n" - + " veintinueve;\n" - // words for multiples of 10 (notice that the tens digit is separated - // from the ones digit by the word "y".) - + "30: treinta[ y >>];\n" - + "40: cuarenta[ y >>];\n" - + "50: cincuenta[ y >>];\n" - + "60: sesenta[ y >>];\n" - + "70: setenta[ y >>];\n" - + "80: ochenta[ y >>];\n" - + "90: noventa[ y >>];\n" - // 100 by itself is "cien," but 100 followed by something is "cineto" - + "100: cien;\n" - + "101: ciento >>;\n" - // words for multiples of 100 (must be stated because they're - // rarely simple concatenations) - + "200: doscientos[ >>];\n" - + "300: trescientos[ >>];\n" - + "400: cuatrocientos[ >>];\n" - + "500: quinientos[ >>];\n" - + "600: seiscientos[ >>];\n" - + "700: setecientos[ >>];\n" - + "800: ochocientos[ >>];\n" - + "900: novecientos[ >>];\n" - // for 1,000, the multiplier on "mil" is omitted: 2,000 is "dos mil," - // but 1,000 is just "mil." - + "1000: mil[ >>];\n" - + "2000: << mil[ >>];\n" - // 1,000,000 is "un millon," not "uno millon" - + "1,000,000: un mill\u00f3n[ >>];\n" - + "2,000,000: << mill\u00f3n[ >>];\n" - // overflow rule - + "1,000,000,000: =#,##0= (incomplete data);"; - // The Spanish rules are incomplete. I'm missing information on negative - // numbers and numbers with fractional parts. I also don't have - // information on numbers higher than the millions - - /** - * Spellout rules for French. French adds some interesting quirks of its - * own: 1) The word "et" is interposed between the tens and ones digits, - * but only if the ones digit if 1: 20 is "vingt," and 2 is "vingt-deux," - * but 21 is "vingt-et-un." 2) There are no words for 70, 80, or 90. - * "quatre-vingts" ("four twenties") is used for 80, and values proceed - * by score from 60 to 99 (e.g., 73 is "soixante-treize" ["sixty-thirteen"]). - * Numbers from 1,100 to 1,199 are rendered as hundreds rather than - * thousands: 1,100 is "onze cents" ("eleven hundred"), rather than - * "mille cent" ("one thousand one hundred") - */ - public static final String french = - // the main rule set - "%main:\n" - // negative-number and fraction rules - + " -x: moins >>;\n" - + " x.x: << virgule >>;\n" - // words for numbers from 0 to 10 - + " z\u00e9ro; un; deux; trois; quatre; cinq; six; sept; huit; neuf;\n" - + " dix; onze; douze; treize; quatorze; quinze; seize;\n" - + " dix-sept; dix-huit; dix-neuf;\n" - // ords for the multiples of 10: %%alt-ones inserts "et" - // when needed - + " 20: vingt[->%%alt-ones>];\n" - + " 30: trente[->%%alt-ones>];\n" - + " 40: quarante[->%%alt-ones>];\n" - + " 50: cinquante[->%%alt-ones>];\n" - // rule for 60. The /20 causes this rule's multiplier to be - // 20 rather than 10, allowinhg us to recurse for all values - // from 60 to 79... - + " 60/20: soixante[->%%alt-ones>];\n" - // ...except for 71, which must be special-cased - + " 71: soixante et onze;\n" - // at 72, we have to repeat the rule for 60 to get us to 79 - + " 72/20: soixante->%%alt-ones>;\n" - // at 80, we state a new rule with the phrase for 80. Since - // it changes form when there's a ones digit, we need a second - // rule at 81. This rule also includes "/20," allowing it to - // be used correctly for all values up to 99 - + " 80: quatre-vingts; 81/20: quatre-vingt->>;\n" - // "cent" becomes plural when preceded by a multiplier, and - // the multiplier is omitted from the singular form - + " 100: cent[ >>];\n" - + " 200: << cents[ >>];\n" - + " 1000: mille[ >>];\n" - // values from 1,100 to 1,199 are rendered as "onze cents..." - // instead of "mille cent..." The > after "1000" decreases - // the rule's exponent, causing its multiplier to be 100 instead - // of 1,000. This prevents us from getting "onze cents cent - // vingt-deux" ("eleven hundred one hundred twenty-two"). - + " 1100>: onze cents[ >>];\n" - // at 1,200, we go back to formating in thousands, so we - // repeat the rule for 1,000 - + " 1200: mille >>;\n" - // at 2,000, the multiplier is added - + " 2000: << mille[ >>];\n" - + " 1,000,000: << million[ >>];\n" - + " 1,000,000,000: << milliarde[ >>];\n" - + " 1,000,000,000,000: << billion[ >>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - // %%alt-ones is used to insert "et" when the ones digit is 1 - + "%%alt-ones:\n" - + " ; et-un; =%main=;"; - - /** - * Spellout rules for Swiss French. Swiss French differs from French French - * in that it does have words for 70, 80, and 90. This rule set shows them, - * and is simpler as a result. - */ - public static final String swissFrench = - "%main:\n" - + " -x: moins >>;\n" - + " x.x: << virgule >>;\n" - + " z\u00e9ro; un; deux; trois; quatre; cinq; six; sept; huit; neuf;\n" - + " dix; onze; douze; treize; quatorze; quinze; seize;\n" - + " dix-sept; dix-huit; dix-neuf;\n" - + " 20: vingt[->%%alt-ones>];\n" - + " 30: trente[->%%alt-ones>];\n" - + " 40: quarante[->%%alt-ones>];\n" - + " 50: cinquante[->%%alt-ones>];\n" - + " 60: soixante[->%%alt-ones>];\n" - // notice new words for 70, 80, and 90 - + " 70: septante[->%%alt-ones>];\n" - + " 80: octante[->%%alt-ones>];\n" - + " 90: nonante[->%%alt-ones>];\n" - + " 100: cent[ >>];\n" - + " 200: << cents[ >>];\n" - + " 1000: mille[ >>];\n" - + " 1100>: onze cents[ >>];\n" - + " 1200: mille >>;\n" - + " 2000: << mille[ >>];\n" - + " 1,000,000: << million[ >>];\n" - + " 1,000,000,000: << milliarde[ >>];\n" - + " 1,000,000,000,000: << billion[ >>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - + "%%alt-ones:\n" - + " ; et-un; =%main=;"; - // I'm not 100% sure about Swiss French. Is - // this correct? Is "onze cents" commonly used for 1,100 in both France - // and Switzerland? Can someone fill me in on the rules for the other - // French-speaking countries? I've heard conflicting opinions on which - // version is used in Canada, and I understand there's an alternate set - // of words for 70, 80, and 90 that is used somewhere, but I don't know - // what those words are or where they're used. - - /** - * Spellout rules for German. German also adds some interesting - * characteristics. For values below 1,000,000, numbers are customarily - * written out as a single word. And the ones digit PRECEDES the tens - * digit (e.g., 23 is "dreiundzwanzig," not "zwanzigunddrei"). - */ - public static final String german = - // 1 is "eins" when by itself, but turns into "ein" in most - // combinations - "%alt-ones:\n" - + " null; eins; =%%main=;\n" - + "%%main:\n" - // words for numbers from 0 to 12. Notice that the values - // from 13 to 19 can derived algorithmically, unlike in most - // other languages - + " null; ein; zwei; drei; vier; f\u00fcnf; sechs; sieben; acht; neun;\n" - + " zehn; elf; zw\u00f6lf; >>zehn;\n" - // rules for the multiples of 10. Notice that the ones digit - // goes on the front - + " 20: [>>und]zwanzig;\n" - + " 30: [>>und]drei\u00dfig;\n" - + " 40: [>>und]vierzig;\n" - + " 50: [>>und]f\u00fcnfzig;\n" - + " 60: [>>und]sechzig;\n" - + " 70: [>>und]siebzig;\n" - + " 80: [>>und]achtzig;\n" - + " 90: [>>und]neunzig;\n" - + " 100: hundert[>%alt-ones>];\n" - + " 200: <%alt-ones>];\n" - + " 1000: tausend[>%alt-ones>];\n" - + " 2000: <%alt-ones>];\n" - + " 1,000,000: eine Million[ >%alt-ones>];\n" - + " 2,000,000: << Millionen[ >%alt-ones>];\n" - + " 1,000,000,000: eine Milliarde[ >%alt-ones>];\n" - + " 2,000,000,000: << Milliarden[ >%alt-ones>];\n" - + " 1,000,000,000,000: eine Billion[ >%alt-ones>];\n" - + " 2,000,000,000,000: << Billionen[ >%alt-ones>];\n" - + " 1,000,000,000,000,000: =#,##0=;"; - // again, I'm not 100% sure of these rules. I think both "hundert" and - // "einhundert" are correct or 100, but I'm not sure which is preferable - // in situations where this framework is likely to be used. Also, is it - // really true that numbers are run together into compound words all the - // time? And again, I'm missing information on negative numbers and - // decimas. - - /** - * Spellout rules for Italian. Like German, most Italian numbers are - * written as single words. What makes these rules complicated is the rule - * that says that when a word ending in a vowel and a word beginning with - * a vowel are combined into a compound, the vowel is dropped from the - * end of the first word: 180 is "centottanta," not "centoottanta." - * The complexity of this rule set is to produce this behavior. - */ - public static final String italian = - // main rule set. Follows the patterns of the preceding rule sets, - // except that the final vowel is omitted from words ending in - // vowels when they are followed by another word; instead, we have - // separate rule sets that are identical to this one, except that - // all the words that don't begin with a vowel have a vowel tacked - // onto them at the front. A word ending in a vowel calls a - // substitution that will supply that vowel, unless that vowel is to - // be elided. - "%main:\n" - + " -x: meno >>;\n" - + " x.x: << virgola >>;\n" - + " zero; uno; due; tre; quattro; cinque; sei; sette; otto;\n" - + " nove;\n" - + " dieci; undici; dodici; tredici; quattordici; quindici; sedici;\n" - + " diciasette; diciotto; diciannove;\n" - + " 20: venti; vent>%%with-i>;\n" - + " 30: trenta; trent>%%with-i>;\n" - + " 40: quaranta; quarant>%%with-a>;\n" - + " 50: cinquanta; cinquant>%%with-a>;\n" - + " 60: sessanta; sessant>%%with-a>;\n" - + " 70: settanta; settant>%%with-a>;\n" - + " 80: ottanta; ottant>%%with-a>;\n" - + " 90: novanta; novant>%%with-a>;\n" - + " 100: cento; cent[>%%with-o>];\n" - + " 200: <%%with-o>];\n" - + " 1000: mille; mill[>%%with-i>];\n" - + " 2000: <%%with-a>];\n" - + " 100,000>>: <>];\n" - + " 1,000,000: =#,##0= (incomplete data);\n" - + "%%with-a:\n" - + " azero; uno; adue; atre; aquattro; acinque; asei; asette; otto;\n" - + " anove;\n" - + " adieci; undici; adodici; atredici; aquattordici; aquindici; asedici;\n" - + " adiciasette; adiciotto; adiciannove;\n" - + " 20: aventi; avent>%%with-i>;\n" - + " 30: atrenta; atrent>%%with-i>;\n" - + " 40: aquaranta; aquarant>%%with-a>;\n" - + " 50: acinquanta; acinquant>%%with-a>;\n" - + " 60: asessanta; asessant>%%with-a>;\n" - + " 70: asettanta; asettant>%%with-a>;\n" - + " 80: ottanta; ottant>%%with-a>;\n" - + " 90: anovanta; anovant>%%with-a>;\n" - + " 100: acento; acent[>%%with-o>];\n" - + " 200: <%%with-a%%with-o>];\n" - + " 1000: amille; amill[>%%with-i>];\n" - + " 2000: <%%with-a%%with-a>];\n" - + " 100,000: =%main=;\n" - + "%%with-i:\n" - + " izero; uno; idue; itre; iquattro; icinque; isei; isette; otto;\n" - + " inove;\n" - + " idieci; undici; idodici; itredici; iquattordici; iquindici; isedici;\n" - + " idiciasette; idiciotto; idiciannove;\n" - + " 20: iventi; ivent>%%with-i>;\n" - + " 30: itrenta; itrent>%%with-i>;\n" - + " 40: iquaranta; iquarant>%%with-a>;\n" - + " 50: icinquanta; icinquant>%%with-a>;\n" - + " 60: isessanta; isessant>%%with-a>;\n" - + " 70: isettanta; isettant>%%with-a>;\n" - + " 80: ottanta; ottant>%%with-a>;\n" - + " 90: inovanta; inovant>%%with-a>;\n" - + " 100: icento; icent[>%%with-o>];\n" - + " 200: <%%with-i%%with-o>];\n" - + " 1000: imille; imill[>%%with-i>];\n" - + " 2000: <%%with-i%%with-a>];\n" - + " 100,000: =%main=;\n" - + "%%with-o:\n" - + " ozero; uno; odue; otre; oquattro; ocinque; osei; osette; otto;\n" - + " onove;\n" - + " odieci; undici; ododici; otredici; oquattordici; oquindici; osedici;\n" - + " odiciasette; odiciotto; odiciannove;\n" - + " 20: oventi; ovent>%%with-i>;\n" - + " 30: otrenta; otrent>%%with-i>;\n" - + " 40: oquaranta; oquarant>%%with-a>;\n" - + " 50: ocinquanta; ocinquant>%%with-a>;\n" - + " 60: osessanta; osessant>%%with-a>;\n" - + " 70: osettanta; osettant>%%with-a>;\n" - + " 80: ottanta; ottant>%%with-a>;\n" - + " 90: onovanta; onovant>%%with-a>;\n" - + " 100: ocento; ocent[>%%with-o>];\n" - + " 200: <%%with-o%%with-o>];\n" - + " 1000: omille; omill[>%%with-i>];\n" - + " 2000: <%%with-o%%with-a>];\n" - + " 100,000: =%main=;\n"; - // Can someone confirm that I did the vowel-eliding thing right? I'm - // not 100% sure I'm doing it in all the right places, or completely - // correctly. Also, I don't have information for negatives and decimals, - // and I lack words fror values from 1,000,000 on up. - - /** - * Spellout rules for Swedish. - */ - public static final String swedish = - "noll; ett; tv\u00e5; tre; fyra; fem; sex; sjo; \u00e5tta; nio;\n" - + "tio; elva; tolv; tretton; fjorton; femton; sexton; sjutton; arton; nitton;\n" - + "20: tjugo[>>];\n" - + "30: trettio[>>];\n" - + "40: fyrtio[>>];\n" - + "50: femtio[>>];\n" - + "60: sextio[>>];\n" - + "70: sjuttio[>>];\n" - + "80: \u00e5ttio[>>];\n" - + "90: nittio[>>];\n" - + "100: hundra[>>];\n" - + "200: <>];\n" - + "1000: tusen[ >>];\n" - + "2000: << tusen[ >>];\n" - + "1,000,000: en miljon[ >>];\n" - + "2,000,000: << miljon[ >>];\n" - + "1,000,000,000: en miljard[ >>];\n" - + "2,000,000,000: << miljard[ >>];\n" - + "1,000,000,000,000: en biljon[ >>];\n" - + "2,000,000,000,000: << biljon[ >>];\n" - + "1,000,000,000,000,000: =#,##0="; - // can someone supply me with information on negatives and decimals? - - /** - * Spellout rules for Dutch. Notice that in Dutch, as in German, - * the ones digit precedes the tens digit. - */ - public static final String dutch = - " -x: min >>;\n" - + "x.x: << komma >>;\n" - + "(zero?); een; twee; drie; vier; vijf; zes; zeven; acht; negen;\n" - + "tien; elf; twaalf; dertien; veertien; vijftien; zestien;\n" - + "zeventien; achtien; negentien;\n" - + "20: [>> en ]twintig;\n" - + "30: [>> en ]dertig;\n" - + "40: [>> en ]veertig;\n" - + "50: [>> en ]vijftig;\n" - + "60: [>> en ]zestig;\n" - + "70: [>> en ]zeventig;\n" - + "80: [>> en ]tachtig;\n" - + "90: [>> en ]negentig;\n" - + "100: << honderd[ >>];\n" - + "1000: << duizend[ >>];\n" - + "1,000,000: << miljoen[ >>];\n" - + "1,000,000,000: << biljoen[ >>];\n" - + "1,000,000,000,000: =#,##0="; - - /** - * Spellout rules for Japanese. In Japanese, there really isn't any - * distinction between a number written out in digits and a number - * written out in words: the ideographic characters are both digits - * and words. This rule set provides two variants: %traditional - * uses the traditional CJK numerals (which are also used in China - * and Korea). %financial uses alternate ideographs for many numbers - * that are harder to alter than the traditional numerals (one could - * fairly easily change a one to - * a three just by adding two strokes, for example). This is also done in - * the other countries using Chinese idographs, but different ideographs - * are used in those places. - */ - public static final String japanese = - "%financial:\n" - + " \u96f6; \u58f1; \u5f10; \u53c2; \u56db; \u4f0d; \u516d; \u4e03; \u516b; \u4e5d;\n" - + " \u62fe[>>];\n" - + " 20: <<\u62fe[>>];\n" - + " 100: <<\u767e[>>];\n" - + " 1000: <<\u5343[>>];\n" - + " 10,000: <<\u4e07[>>];\n" - + " 100,000,000: <<\u5104[>>];\n" - + " 1,000,000,000,000: <<\u5146[>>];\n" - + " 10,000,000,000,000,000: =#,##0=;\n" - + "%traditional:\n" - + " \u96f6; \u4e00; \u4e8c; \u4e09; \u56db; \u4e94; \u516d; \u4e03; \u516b; \u4e5d;\n" - + " \u5341[>>];\n" - + " 20: <<\u5341[>>];\n" - + " 100: <<\u767e[>>];\n" - + " 1000: <<\u5343[>>];\n" - + " 10,000: <<\u4e07[>>];\n" - + " 100,000,000: <<\u5104[>>];\n" - + " 1,000,000,000,000: <<\u5146[>>];\n" - + " 10,000,000,000,000,000: =#,##0=;"; - // Can someone supply me with the right fraud-proof ideographs for - // Simplified and Traditional Chinese, and for Korean? Can someone - // supply me with information on negatives and decimals? - - /** - * Spellout rules for Greek. Again in Greek we have to supply the words - * for the multiples of 100 because they can't be derived algorithmically. - * Also, the tens dgit changes form when followed by a ones digit: an - * accent mark disappears from the tens digit and moves to the ones digit. - * Therefore, instead of using the [] notation, we actually have to use - * two separate rules for each multiple of 10 to show the two forms of - * the word. - */ - public static final String greek = - "zero (incomplete data); \u03ad\u03bd\u03b1; \u03b4\u03cd\u03bf; \u03b4\u03c1\u03af\u03b1; " - + "\u03c4\u03ad\u03c3\u03c3\u03b5\u03c1\u03b1; \u03c0\u03ad\u03bd\u03c4\u03b5; " - + "\u03ad\u03be\u03b9; \u03b5\u03c0\u03c4\u03ac; \u03bf\u03ba\u03c4\u03ce; " - + "\u03b5\u03bd\u03bd\u03ad\u03b1;\n" - + "10: \u03b4\u03ad\u03ba\u03b1; " - + "\u03ad\u03bd\u03b4\u03b5\u03ba\u03b1; \u03b4\u03ce\u03b4\u03b5\u03ba\u03b1; " - + "\u03b4\u03b5\u03ba\u03b1>>;\n" - + "20: \u03b5\u03af\u03ba\u03bf\u03c3\u03b9; \u03b5\u03b9\u03ba\u03bf\u03c3\u03b9>>;\n" - + "30: \u03c4\u03c1\u03b9\u03ac\u03bd\u03c4\u03b1; \u03c4\u03c1\u03b9\u03b1\u03bd\u03c4\u03b1>>;\n" - + "40: \u03c3\u03b1\u03c1\u03ac\u03bd\u03c4\u03b1; \u03c3\u03b1\u03c1\u03b1\u03bd\u03c4\u03b1>>;\n" - + "50: \u03c0\u03b5\u03bd\u03ae\u03bd\u03c4\u03b1; \u03c0\u03b5\u03bd\u03b7\u03bd\u03c4\u03b1>>;\n" - + "60: \u03b5\u03be\u03ae\u03bd\u03c4\u03b1; \u03b5\u03be\u03b7\u03bd\u03c4\u03b1>>;\n" - + "70: \u03b5\u03b2\u03b4\u03bf\u03bc\u03ae\u03bd\u03c4\u03b1; " - + "\u03b5\u03b2\u03b4\u03bf\u03bc\u03b7\u03bd\u03c4\u03b1>>;\n" - + "80: \u03bf\u03b3\u03b4\u03cc\u03bd\u03c4\u03b1; \u03bf\u03b3\u03b4\u03bf\u03bd\u03c4\u03b1>>;\n" - + "90: \u03b5\u03bd\u03bd\u03b5\u03bd\u03ae\u03bd\u03c4\u03b1; " - + "\u03b5\u03bd\u03bd\u03b5\u03bd\u03b7\u03bd\u03c4\u03b1>>;\n" - + "100: \u03b5\u03ba\u03b1\u03c4\u03cc[\u03bd >>];\n" - + "200: \u03b4\u03b9\u03b1\u03ba\u03cc\u03c3\u03b9\u03b1[ >>];\n" - + "300: \u03c4\u03c1\u03b9\u03b1\u03ba\u03cc\u03c3\u03b9\u03b1[ >>];\n" - + "400: \u03c4\u03b5\u03c4\u03c1\u03b1\u03ba\u03cc\u03c3\u03b9\u03b1[ >>];\n" - + "500: \u03c0\u03b5\u03bd\u03c4\u03b1\u03ba\u03cc\u03c3\u03b9\u03b1[ >>];\n" - + "600: \u03b5\u03be\u03b1\u03ba\u03cc\u03c3\u03b9\u03b1[ >>];\n" - + "700: \u03b5\u03c0\u03c4\u03b1\u03ba\u03cc\u03c3\u03b9\u03b1[ >>];\n" - + "800: \u03bf\u03ba\u03c4\u03b1\u03ba\u03cc\u03c3\u03b9\u03b1[ >>];\n" - + "900: \u03b5\u03bd\u03bd\u03b9\u03b1\u03ba\u03cc\u03c3\u03b9\u03b1[ >>];\n" - + "1000: \u03c7\u03af\u03bb\u03b9\u03b1[ >>];\n" - + "2000: << \u03c7\u03af\u03bb\u03b9\u03b1[ >>];\n" - + "1,000,000: << \u03b5\u03ba\u03b1\u03c4\u03bf\u03bc\u03bc\u03b9\u03cc\u03c1\u03b9\u03bf[ >>];\n" - + "1,000,000,000: << \u03b4\u03b9\u03c3\u03b5\u03ba\u03b1\u03c4\u03bf\u03bc\u03bc\u03b9\u03cc\u03c1\u03b9\u03bf[ >>];\n" - + "1,000,000,000,000: =#,##0="; - // Can someone supply me with information on negatives and decimals? - // I'm also missing the word for zero. Can someone clue me in? - - /** - * Spellout rules for Russian. - */ - public static final String russian = - "\u043d\u043e\u043b\u044c; \u043e\u0434\u0438\u043d; \u0434\u0432\u0430; \u0442\u0440\u0438; " - + "\u0447\u0435\u0442\u044b\u0440\u0435; \u043f\u044f\u0442; \u0448\u0435\u0441\u0442; " - + "\u0441\u0435\u043c\u044c; \u0432\u043e\u0441\u0435\u043c\u044c; \u0434\u0435\u0432\u044f\u0442;\n" - + "10: \u0434\u0435\u0441\u044f\u0442; " - + "\u043e\u0434\u0438\u043d\u043d\u0430\u0434\u0446\u0430\u0442\u044c;\n" - + "\u0434\u0432\u0435\u043d\u043d\u0430\u0434\u0446\u0430\u0442\u044c; " - + "\u0442\u0440\u0438\u043d\u0430\u0434\u0446\u0430\u0442\u044c; " - + "\u0447\u0435\u0442\u044b\u0440\u043d\u0430\u0434\u0446\u0430\u0442\u044c;\n" - + "15: \u043f\u044f\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u044c; " - + "\u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u044c; " - + "\u0441\u0435\u043c\u043d\u0430\u0434\u0446\u0430\u0442\u044c; " - + "\u0432\u043e\u0441\u0435\u043c\u043d\u0430\u0434\u0446\u0430\u0442\u044c; " - + "\u0434\u0435\u0432\u044f\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u044c;\n" - + "20: \u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044c[ >>];\n" - + "30: \u0442\u0440\u043b\u0434\u0446\u0430\u0442\u044c[ >>];\n" - + "40: \u0441\u043e\u0440\u043e\u043a[ >>];\n" - + "50: \u043f\u044f\u0442\u044c\u0434\u0435\u0441\u044f\u0442[ >>];\n" - + "60: \u0448\u0435\u0441\u0442\u044c\u0434\u0435\u0441\u044f\u0442[ >>];\n" - + "70: \u0441\u0435\u043c\u044c\u0434\u0435\u0441\u044f\u0442[ >>];\n" - + "80: \u0432\u043e\u0441\u0435\u043c\u044c\u0434\u0435\u0441\u044f\u0442[ >>];\n" - + "90: \u0434\u0435\u0432\u044f\u043d\u043e\u0441\u0442\u043e[ >>];\n" - + "100: \u0441\u0442\u043e[ >>];\n" - + "200: << \u0441\u0442\u043e[ >>];\n" - + "1000: \u0442\u044b\u0441\u044f\u0447\u0430[ >>];\n" - + "2000: << \u0442\u044b\u0441\u044f\u0447\u0430[ >>];\n" - + "1,000,000: \u043c\u0438\u043b\u043b\u0438\u043e\u043d[ >>];\n" - + "2,000,000: << \u043c\u0438\u043b\u043b\u0438\u043e\u043d[ >>];\n" - + "1,000,000,000: =#,##0=;"; - // Can someone supply me with information on negatives and decimals? - // How about words for billions and trillions? - - /** - * Spellout rules for Hebrew. Hebrew actually has inflected forms for - * most of the lower-order numbers. The masculine forms are shown - * here. - */ - public static final String hebrew = - "zero (incomplete data); \u05d0\u05d4\u05d3; \u05e9\u05d2\u05d9\u05d9\u05dd; \u05e9\u05dc\u05d5\u05e9\u05d4;\n" - + "4: \u05d0\u05d3\u05d1\u05e6\u05d4; \u05d7\u05d2\u05d5\u05d9\u05e9\u05d4; \u05e9\u05e9\u05d4;\n" - + "7: \u05e9\u05d1\u05e6\u05d4; \u05e9\u05de\u05d5\u05d2\u05d4; \u05ea\u05e9\u05e6\u05d4;\n" - + "10: \u05e6\u05e9\u05d3\u05d4[ >>];\n" - + "20: \u05e6\u05e9\u05d3\u05d9\u05dd[ >>];\n" - + "30: \u05e9\u05dc\u05d5\u05e9\u05d9\u05dd[ >>];\n" - + "40: \u05d0\u05d3\u05d1\u05e6\u05d9\u05dd[ >>];\n" - + "50: \u05d7\u05de\u05d9\u05e9\u05d9\u05dd[ >>];\n" - + "60: \u05e9\u05e9\u05d9\u05dd[ >>];\n" - + "70: \u05e9\u05d1\u05e6\u05d9\u05dd[ >>];\n" - + "80: \u05e9\u05de\u05d5\u05d2\u05d9\u05dd[ >>];\n" - + "90: \u05ea\u05e9\u05e6\u05d9\u05dd[ >>];\n" - + "100: \u05de\u05d0\u05d4[ >>];\n" - + "200: << \u05de\u05d0\u05d4[ >>];\n" - + "1000: \u05d0\u05dc\u05e3[ >>];\n" - + "2000: << \u05d0\u05dc\u05e3[ >>];\n" - + "1,000,000: =#,##0= (incomplete data);"; - // This data is woefully incomplete. Can someone fill me in on the - // various inflected forms of the numbers, which seem to be necessary - // to do Hebrew correctly? Can somone supply me with data for values - // from 1,000,000 on up? What about the word for zero? What about - // information on negatives and decimals? - - //======================================================================== - // Simple examples - //======================================================================== - - /** - * This rule set adds an English ordinal abbreviation to the end of a - * number. For example, 2 is formatted as "2nd". Parsing doesn't work with - * this rule set. To parse, use DecimalFormat on the numeral. - */ - public static final String ordinal = - // this rule set formats the numeral and calls %%abbrev to - // supply the abbreviation - "%main:\n" - + " =#,##0==%%abbrev=;\n" - // this rule set supplies the abbreviation - + "%%abbrev:\n" - // the abbreviations. Everything from 4 to 19 ends in "th" - + " th; st; nd; rd; th;\n" - // at 20, we begin repeating the cycle every 10 (13 is "13th", - // but 23 and 33 are "23rd" and "33rd") We do this by - // ignoring all bug the ones digit in selecting the abbreviation - + " 20: >>;\n" - // at 100, we repeat the whole cycle by considering only the - // tens and ones digits in picking an abbreviation - + " 100: >>;\n"; - - /** - * This is a simple message-formatting example. Normally one would - * use ChoiceFormat and MessageFormat to do something this simple, - * but this shows it could be done with RuleBasedNumberFormat too. - * A message-formatting example that might work better with - * RuleBasedNumberFormat appears later. - */ - public static final String message1 = - // this rule surrounds whatever the other rules produce with the - // rest of the sentence - "x.0: The search found <<.;\n" - // use words for values below 10 (and change to "file" for 1) - + "no files; one file; two files; three files; four files; five files;\n" - + " six files; seven files; eight files; nine files;\n" - // use numerals for values higher than 10 - + "=#,##0= files;"; - - //======================================================================== - // Fraction handling - // - // The next few examples show how RuleBasedNumberFormat can be used for - // more flexible handling of fractions - //======================================================================== - - /** - * This example formats a number in one of the two styles often used - * on checks. %dollars-and-hundredths formats cents as hundredths of - * a dollar (23.40 comes out as "twenty-three and 40/100 dollars"). - * %dollars-and-cents formats in dollars and cents (23.40 comes out as - * "twenty-three dollars and forty cents") - */ - public static final String dollarsAndCents = - // this rule set formats numbers as dollars and cents - "%dollars-and-cents:\n" - // if the value is 1 or more, put "xx dollars and yy cents". - // the "and y cents" part is suppressed if the value is an - // even number of dollars - + " x.0: << [and >%%cents>];\n" - // if the value is between 0 and 1, put "xx cents" - + " 0.x: >%%cents>;\n" - // these three rules take care of the singular and plural - // forms of "dollar" and use %%main to format the number - + " 0: zero dollars; one dollar; =%%main= dollars;\n" - // these are the regular U.S. English number spellout rules - + "%%main:\n" - + " zero; one; two; three; four; five; six; seven; eight; nine;\n" - + " ten; eleven; twelve; thirteen; fourteen; fifteen; sixteen;\n" - + " seventeen; eighteen; nineteen;\n" - + " 20: twenty[->>];\n" - + " 30: thirty[->>];\n" - + " 40: forty[->>];\n" - + " 50: fifty[->>];\n" - + " 60: sixty[->>];\n" - + " 70: seventy[->>];\n" - + " 80: eighty[->>];\n" - + " 90: ninety[->>];\n" - + " 100: << hundred[ >>];\n" - + " 1000: << thousand[ >>];\n" - + " 1,000,000: << million[ >>];\n" - + " 1,000,000,000: << billion[ >>];\n" - + " 1,000,000,000,000: << trillion[ >>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - // this rule takes care of the fractional part of the value. It - // multiplies the fractional part of the number being formatted by - // 100, formats it with %%main, and then addes the word "cent" or - // "cents" to the end. (The text in brackets is omitted if the - // numerator of the fraction is 1.) - + "%%cents:\n" - + " 100: <%%main< cent[s];\n" - - // this rule set formats numbers as dollars and hundredths of dollars - + "%dollars-and-hundredths:\n" - // this rule takes care of the general shell of the output - // string. We always show the cents, even when there aren't - // any. Because of this, the word is always "dollars"-- - // we don't have to worry about the singular form. We use - // %%main to format the number of dollars and %%hundredths to - // format the number of cents - + " x.0: <%%main< and >%%hundredths>/100 dollars;\n" - // this rule set formats the cents for %dollars-and-hundredths. - // It multiplies the fractional part of the number by 100 and formats - // the result using a DecimalFormat ("00" tells the DecimalFormat to - // always use two digits, even for numbers under 10) - + "%%hundredths:\n" - + " 100: <00<;\n"; - - /** - * This rule set shows the fractional part of the number as a fraction - * with a power of 10 as the denominator. Some languages don't spell - * out the fractional part of a number as "point one two three," but - * always render it as a fraction. If we still want to treat the fractional - * part of the number as a decimal, then the fraction's denominator - * is always a power of 10. This example does that: 23.125 is formatted - * as "twenty-three and one hundred twenty-five thousandths" (as opposed - * to "twenty-three point one two five" or "twenty-three and one eighth"). - */ - public static final String decimalAsFraction = - // the regular U.S. English spellout rules, with one difference - "%main:\n" - + " -x: minus >>;\n" - // the difference. This rule uses %%frac to show the fractional - // part of the number. Text in brackets is omitted when the - // value is between 0 and 1 (causing 0.3 to come out as "three - // tenths" instead of "zero and three tenths"). - + " x.x: [<< and ]>%%frac>;\n" - + " zero; one; two; three; four; five; six; seven; eight; nine;\n" - + " ten; eleven; twelve; thirteen; fourteen; fifteen; sixteen;\n" - + " seventeen; eighteen; nineteen;\n" - + " twenty[->>];\n" - + " 30: thirty[->>];\n" - + " 40: forty[->>];\n" - + " 50: fifty[->>];\n" - + " 60: sixty[->>];\n" - + " 70: seventy[->>];\n" - + " 80: eighty[->>];\n" - + " 90: ninety[->>];\n" - + " 100: << hundred[ >>];\n" - + " 1000: << thousand[ >>];\n" - + " 1,000,000: << million[ >>];\n" - + " 1,000,000,000: << billion[ >>];\n" - + " 1,000,000,000,000: << trillion[ >>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - // the rule set that formats the fractional part of the number. - // The rule that is used is the one that, when its baase value is - // multiplied by the fractional part of the number being formatted, - // produces the result closest to zero. Thus, the base values are - // prospective denominators of the fraction. The << marks the place - // where the numerator of the fraction (the result of multiplying the - // fractional part of the number by the rule's base value) is - // placed. Text in brackets is omitted when the numerator is 1, giving - // us the singular and plural forms of the words. - // [In languages where the singular and plural are completely different - // words, the rule can just be stated twice: the second time with - // the plural form.] - + "%%frac:\n" - + " 10: << tenth[s];\n" - + " 100: << hundredth[s];\n" - + " 1000: << thousandth[s];\n" - + " 10,000: << ten-thousandth[s];\n" - + " 100,000: << hundred-thousandth[s];\n" - + " 1,000,000: << millionth[s];"; - - /** - * Number with closest fraction. This example formats a value using - * numerals, but shows the fractional part as a ratio (fraction) rather - * than a decimal. The fraction always has a denominator between 2 and 10. - */ - public static final String closestFraction = - "%main:\n" - // this rule formats the number if it's 1 or more. It formats - // the integral part using a DecimalFormat ("#,##0" puts - // thousands separators in the right places) and the fractional - // part using %%frac. If there is no fractional part, it - // just shows the integral part. - + " x.0: <#,##0<[ >%%frac>];\n" - // this rule formats the number if it's between 0 and 1. It - // shows only the fractional part (0.5 shows up as "1/2," not - // "0 1/2") - + " 0.x: >%%frac>;\n" - // the fraction rule set. This works the same way as the one in the - // preceding example: We multiply the fractional part of the number - // being formatted by each rule's base value and use the rule that - // produces the result closest to 0 (or the first rule that produces 0). - // Since we only provide rules for the numbers from 2 to 10, we know - // we'll get a fraction with a denominator between 2 and 10. - // "<0<" causes the numerator of the fraction to be formatted - // using numerals - + "%%frac:\n" - + " 2: 1/2;\n" - + " 3: <0%%frac1>];\n" - // this rule is used for values between 0 and 1 and omits the - // integral part - + " 0.x: >%%frac2>;\n" - // this rule set is used to format the fractional part of the number when - // there's an integral part before it (again, we try all denominators - // and use the "best" one) - + "%%frac1:\n" - // for even multiples of 1/4, format the fraction using the - // typographer's fractions - + " 4: <%%quarters<;\n" - // format the value as a number of eighths, sixteenths, or - // thirty-seconds, whichever produces the most accurate value. - // The apostrophe at the front of these rules is ignored, but - // it makes the space that follows it significant. This puts a - // space between the value's integral and fractional parts so - // you can read it - + " 8: ' <0%%small>;\n" - // otherwise, show between 3 and 6 significant digits of the value - // along with the most appropriate unit - + " 0: =##0.###= m;\n" - + " 1,000: <##0.###< km;\n" - + " 1,000,000: <##0.###< Mm;\n" - + " 1,000,000,000: <##0.###< Gm;\n" - + " 1,000,000,000,000: <#,##0.###< Tm;\n" - // %%small formats the number when it's less then 1. It multiplies the - // value by one billion, and then uses %%small2 to actually do the - // formatting. - + "%%small:\n" - + " 1,000,000,000,000: <%%small2<;\n" - // this rule set actually formats small values. %%small passes this - // rule set a number of picometers, and it takes care of scaling up as - // appropriate in exactly the same way %main does (we can't normally - // handle fractional values this way: here, we're concerned about - // magnitude; most of the time, we're concerned about precsion) - + "%%small2:\n" - + " 0: =##0= pm;\n" - + " 1,000: <##0.###< nm;\n" - + " 1,000,000: <##0.###< \u00b5m;\n" - + " 1,000,000,000: <##0.###< mm;\n"; - - /** - * A more complicated message-formatting example. Here, in addition to - * handling the singular and plural versions of the word, the value is - * denominated in bytes, kilobytes, or megabytes depending on its magnitude. - * Also notice that it correctly treats a kilobyte as 1,024 bytes (not 1,000), - * and a megabyte as 1,024 kilobytes (not 1,000). - */ - public static final String message2 = - // this rule supplies the shell of the sentence - "x.0: There << free space on the disk.;\n" - // handle singular and plural forms of "byte" (and format 0 as - // "There is no free space...") - + "0: is no;\n" - + "is one byte of;\n" - + "are =0= bytes of;\n" - // for values above 1,024, format the number in K (since "K" is usually - // promounced "K" regardless of whether it's singular or plural, we - // don't worry about the plural form). The "/1024" here causes us to - // treat a K as 1,024 bytes rather than 1,000 bytes. - + "1024/1024: is <0>];\n" - // format values over 144 in gross - + "144/12: << gross[, >>];\n" - // format values over 1,000 in thousands - + "1000: << thousand[, >>];\n" - // overflow rule. Format values over 10,000 in numerals - + "10,000: =#,##0=;\n"; - - //======================================================================== - // Major and minor units - // - // These examples show how a single value can be divided up into major - // and minor units that don't relate to each other by a factor of 10. - //======================================================================== - - /** - * This example formats a number of seconds in sexagesimal notation - * (i.e., hours, minutes, and seconds). %with-words formats it with - * words (3740 is "1 hour, 2 minutes, 20 seconds") and %in-numerals - * formats it entirely in numerals (3740 is "1:02:20"). - */ - public static final String durationInSeconds = - // main rule set for formatting with words - "%with-words:\n" - // take care of singular and plural forms of "second" - + " 0 seconds; 1 second; =0= seconds;\n" - // use %%min to format values greater than 60 seconds - + " 60/60: <%%min<[, >>];\n" - // use %%hr to format values greater than 3,600 seconds - // (the ">>>" below causes us to see the number of minutes - // when when there are zero minutes) - + " 3600/60: <%%hr<[, >>>];\n" - // this rule set takes care of the singular and plural forms - // of "minute" - + "%%min:\n" - + " 0 minutes; 1 minute; =0= minutes;\n" - // this rule set takes care of the singular and plural forms - // of "hour" - + "%%hr:\n" - + " 0 hours; 1 hour; =0= hours;\n" - - // main rule set for formatting in numerals - + "%in-numerals:\n" - // values below 60 seconds are shown with "sec." - + " =0= sec.;\n" - // higher values are shown with colons: %%min-sec is used for - // values below 3,600 seconds... - + " 60: =%%min-sec=;\n" - // ...and %%hr-min-sec is used for values of 3,600 seconds - // and above - + " 3600: =%%hr-min-sec=;\n" - // this rule causes values of less than 10 minutes to show without - // a leading zero - + "%%min-sec:\n" - + " 0: :=00=;\n" - + " 60/60: <0<>>;\n" - // this rule set is used for values of 3,600 or more. Minutes are always - // shown, and always shown with two digits - + "%%hr-min-sec:\n" - + " 0: :=00=;\n" - + " 60/60: <00<>>;\n" - + " 3600/60: <#,##0<:>>>;\n" - // the lenient-parse rules allow several different characters to be used - // as delimiters between hours, minutes, and seconds - + "%%lenient-parse:\n" - + " & : = . = ' ' = -;\n"; - - /** - * This example formats a number of hours in sexagesimal notation (i.e., - * hours, minutes, and seconds). %with-words formats the value using - * words for the units, and %in-numerals formats the value using only - * numerals. - */ - public static final String durationInHours = - // main entry point for formatting with words - "%with-words:\n" - // this rule omits minutes and seconds when the value is - // an even number of hours - + " x.0: <<[, >%%min-sec>];\n" - // these rules take care of the singular and plural forms - // of hours - + " 0 hours; 1 hour; =#,##0= hours;\n" - // this rule set takes the fractional part of the number and multiplies - // it by 3,600 (turning it into a number of seconds). Then it delegates - // to %%min-sec-implementation to format the resulting value - + "%%min-sec:\n" - + " 3600: =%%min-sec-implementation=;\n" - // this rule set formats the seconds as either seconds or minutes and - // seconds, and takes care of the singular and plural forms of - // "minute" and "second" - + "%%min-sec-implementation:\n" - + " 0 seconds; 1 second; =0= seconds;\n" - + " 60/60: 1 minute[, >>];\n" - + " 120/60: <0< minutes[, >>];\n" - - // main entry point for formatting in numerals - + "%in-numerals:\n" - // show minutes even for even numbers of hours - + " x.0: <#,##0<:00;\n" - // delegate to %%min-sec2 to format minutes and seconds - + " x.x: <#,##0<:>%%min-sec2>;\n" - // this rule set formats minutes when there is an even number of - // minutes, and delegates to %%min-sec2-implementation when there - // are seconds - + "%%min-sec2:\n" - + " 60: <00<;\n" - + " 3600: <%%min-sec2-implementation<;\n" - // these two rule sets are used to format the minutes and seconds - + "%%min-sec2-implementation:\n" - // if there are fewer than 60 seconds, show the minutes anyway - + " 0: 00:=00=;\n" - // if there are minutes, format them too, and always use 2 digits - // for both minutes and seconds - + " 60: =%%min-sec3=;\n" - + "%%min-sec3:\n" - + " 0: :=00=;\n" - + " 60/60: <00<>>;\n" - // the lenient-parse rules allow the user to use any of several - // characters as delimiters between hours, minutes, and seconds - + "%%lenient-parse:\n" - + " & : = . = ' ' = -;\n"; - - /** - * This rule set formats a number of pounds as pounds, shillings, and - * pence in the old English system of currency. - */ - public static final String poundsShillingsAndPence = - // for values of 1 or more, format the integral part with a pound - // sign in front, and show shillings and pence if necessary - "%main:\n" - + " x.0: \u00a3<#,##0<[ >%%shillings-and-pence>];\n" - // for values between 0 and 1, omit the number of pounds - + " 0.x: >%%pence-alone>;\n" - // this rule set is used to show shillings and pence. It multiplies - // the fractional part of the number by 240 (the number of pence in a - // pound) and uses %%shillings-and-pence-implementation to format - // the result - + "%%shillings-and-pence:\n" - + " 240: <%%shillings-and-pence-implementation<;\n" - // this rule set is used to show shillings and pence when there are - // no pounds. It also multiplies the value by 240, and then it uses - // %%pence-alone-implementation to format the result. - + "%%pence-alone:\n" - + " 240: <%%pence-alone-implementation<;\n" - // this rule set formats a number of pence when we know we also - // have pounds. We always show shillings (with a 0 if necessary), - // but only show pence if the value isn't an even number of shillings - + "%%shillings-and-pence-implementation:\n" - + " 0/; 0/=0=;\n" - + " 12/12: <00>];\n" - // this rule set formats a number of pence when we know there are - // no pounds. Values less than a shilling are shown with "d." (the - // abbreviation for pence), and values greater than a shilling are - // shown with a shilling bar (and without pence when the value is - // an even number of shillings) - + "%%pence-alone-implementation:\n" - + " =0= d.;\n" - + " 12/12: <00>];\n"; - - //======================================================================== - // Alternate numeration systems - // - // These examples show how RuleBasedNumberFormat can be used to format - // numbers using non-positional numeration systems. - //======================================================================== - - /** - * Arabic digits. This example formats numbers in Arabic numerals. - * Normally, you'd do this with DecimalFormat, but this shows that - * RuleBasedNumberFormat can handle it too. - */ - public static final String arabicNumerals = - "0; 1; 2; 3; 4; 5; 6; 7; 8; 9;\n" - + "10: <<>>;\n" - + "100: <<>>>;\n" - + "1000: <<,>>>;\n" - + "1,000,000: <<,>>>;\n" - + "1,000,000,000: <<,>>>;\n" - + "1,000,000,000,000: <<,>>>;\n" - + "1,000,000,000,000,000: =#,##0=;\n" - + "-x: ->>;\n" - + "x.x: <<.>>;"; - - /** - * Words for digits. Follows the same pattern as the Arabic-numerals - * example above, but uses words for the various digits (e.g., 123 comes - * out as "one two three"). - */ - public static final String wordsForDigits = - "-x: minus >>;\n" - + "x.x: << point >>;\n" - + "zero; one; two; three; four; five; six;\n" - + " seven; eight; nine;\n" - + "10: << >>;\n" - + "100: << >>>;\n" - + "1000: <<, >>>;\n" - + "1,000,000: <<, >>>;\n" - + "1,000,000,000: <<, >>>;\n" - + "1,000,000,000,000: <<, >>>;\n" - + "1,000,000,000,000,000: =#,##0=;\n"; - - /** - * This example formats numbers using Chinese characters in the Arabic - * place-value method. This was used historically in China for a while. - */ - public static final String chinesePlaceValue = - "\u3007; \u4e00; \u4e8c; \u4e09; \u56db; \u4e94; \u516d; \u4e03; \u516b; \u4e5d;\n" - + "10: <<>>;\n" - + "100: <<>>>;\n" - + "1000: <<>>>;\n" - + "1,000,000: <<>>>;\n" - + "1,000,000,000: <<>>>;\n" - + "1,000,000,000,000: <<>>>;\n" - + "1,000,000,000,000,000: =#,##0=;\n"; - - /** - * Roman numerals. This example has two variants: %modern shows how large - * numbers are usually handled today; %historical ses the older symbols for - * thousands. - */ - public static final String romanNumerals = - "%historical:\n" - + " =%modern=;\n" - // in early Roman numerals, 1,000 was shown with a circle - // bisected by a vertical line. Additional thousands were - // shown by adding more concentric circles, and fives were - // shown by cutting the symbol for next-higher power of 10 - // in half (the letter D for 500 evolved from this). - // We could go beyond 40,000, but Unicode doesn't encode - // the symbols for higher numbers/ - + " 1000: \u2180[>>]; 2000: \u2180\u2180[>>]; 3000: \u2180\u2180\u2180[>>]; 4000: \u2180\u2181[>>];\n" - + " 5000: \u2181[>>]; 6000: \u2181\u2180[>>]; 7000: \u2181\u2180\u2180[>>];\n" - + " 8000: \u2181\u2180\u2180\u2180[>>]; 9000: \u2180\u2182[>>];\n" - + " 10,000: \u2182[>>]; 20,000: \u2182\u2182[>>]; 30,000: \u2182\u2182\u2182[>>];\n" - + " 40,000: =#,##0=;\n" - + "%modern:\n" - + " ; I; II; III; IV; V; VI; VII; VIII; IX;\n" - + " 10: X[>>]; 20: XX[>>]; 30: XXX[>>]; 40: XL[>>]; 50: L[>>];\n" - + " 60: LX[>>]; 70: LXX[>>]; 80: LXXX[>>]; 90: XC[>>];\n" - + " 100: C[>>]; 200: CC[>>]; 300: CCC[>>]; 400: CD[>>]; 500: D[>>];\n" - + " 600: DC[>>]; 700: DCC[>>]; 800: DCCC[>>]; 900: CM[>>];\n" - // in modern Roman numerals, high numbers are generally shown - // by placing a bar over the letters for the lower numbers: - // the bar multiplied a letter's value by 1,000 - + " 1000: M[>>]; 2000: MM[>>]; 3000: MMM[>>]; 4000: MV\u0306[>>];\n" - + " 5000: V\u0306[>>]; 6000: V\u0306M[>>]; 7000: V\u0306MM[>>];\n" - + " 8000: V\u0306MMM[>>]; 9000: MX\u0306[>>];\n" - + " 10,000: X\u0306[>>]; 20,000: X\u0306X\u0306[>>]; 30,000: X\u0306X\u0306X\u0306[>>];\n" - + " 40,000: X\u0306L\u0306[>>]; 50,000: L\u0306[>>]; 60,000: L\u0306X\u0306[>>];\n" - + " 70,000: L\u0306X\u0306X\u0306[>>]; 80,000: L\u0306X\u0306X\u0306X\u0306[>>];\n" - + " 90,000: X\u0306C\u0306[>>];\n" - + " 100,000: C\u0306[>>]; 200,000: C\u0306C\u0306[>>]; 300,000: C\u0306C\u0306[>>];\n" - + " 400,000: C\u0306D\u0306[>>]; 500,000: D\u0306[>>]; 600,000: D\u0306C\u0306[>>];\n" - + " 700,000: D\u0306C\u0306C\u0306[>>]; 800,000: D\u0306C\u0306C\u0306C\u0306[>>];\n" - + " 900,000: =#,##0=;\n"; - - /** - * Hebrew alphabetic numerals. Before adoption of Arabic numerals, Hebrew speakers - * used the letter of their alphabet as numerals. The first nine letters of - * the alphabet repesented the values from 1 to 9, the second nine letters the - * multiples of 10, and the remaining letters the multiples of 100. Since they - * ran out of letters at 400, the remaining multiples of 100 were represented - * using combinations of the existing letters for the hundreds. Numbers were - * distinguished from words in a number of different ways: the way shown here - * uses a single mark after a number consisting of one letter, and a double - * mark between the last two letters of a number consisting of two or more - * letters. Two dots over a letter multiplied its value by 1,000. Also, since - * the letter for 10 is the first letter of God's name and the letters for 5 and 6 - * are letters in God's name, which wasn't supposed to be written or spoken, 15 and - * 16 were usually written as 9 + 6 and 9 + 7 instead of 10 + 5 and 10 + 6. - */ - public static final String hebrewAlphabetic = - // letters for the ones - "%%ones:\n" - + " (no zero); \u05d0; \u05d1; \u05d2; \u05d3; \u05d4; \u05d5; \u05d6; \u05d7; \u05d8;\n" - // letters for the tens - + "%%tens:\n" - + " ; \u05d9; \u05db; \u05dc; \u05de; \u05e0; \u05e1; \u05e2; \u05e4; \u05e6;\n" - // letters for the first four hundreds - + "%%hundreds:\n" - + " ; \u05e7; \u05e8; \u05e9; \u05ea;\n" - // this rule set is used to write the combination of the tens and ones digits - // when we know that no other digits precede them: they put the numeral marks - // in the right place and properly handle 15 and 16 (I'm using the mathematical - // prime characters for the numeral marks because my Unicode font doesn't - // include the real Hebrew characters, which look just like the prime marks) - + "%%tens-and-ones:\n" - // for values less than 10, just use %%ones and put the numeral mark - // afterward - + " =%%ones=\u2032;\n" - // put the numeral mark at the end for 10, but in the middle for - // 11 through 14 - + " 10: <%%tens<\u2032; <%%tens<\u2033>%%ones>;\n" - // special-case 15 and 16 - + " 15: \u05d8\u2033\u05d5; 16: \u05d8\u2033\u05d6;\n" - // go back to the normal method at 17 - + " 17: <%%tens<\u2033>%%ones>;\n" - // repeat the rules for 10 and 11 to cover the values from 20 to 99 - + " 20: <%%tens<\u2032; <%%tens<\u2033>%%ones>;\n" - // this rule set is used to format numbers below 1,000. It relies on - // %%tens-and-ones to format the tens and ones places, and adds logic - // to handle the high hundreds and the numeral marks when there is no - // tens digit. Notice how the rules are paired: all of these pairs of - // rules take advantage of the rollback rule: if the value (between 100 - // and 499) is an even multiple of 100, the rule for 100 is used; otherwise, - // the rule for 101 (the following rule) is used. The first rule in each - // pair (the one for the even multiple) places the numeral mark in a different - // spot than the second rule in each pair (which knows there are more digits - // and relies on the rule supplying them to also supply the numeral mark). - // The call to %%null in line 10 is there simply to invoke the rollback - // rule. - + "%%low-order:\n" - // this rule is only called when there are other characters before. - // It places the numeral mark before the last digit - + " \u2033=%%ones=;\n" - // the rule for 10 places the numeral mark before the 10 character - // (because we know it's the last character); the rule for 11 relies - // on %%tens-and-ones to place the numeral mark - + " 10: \u2033<%%tens<; =%%tens-and-ones=>%%null>;\n" - // the rule for 100 places the numeral mark before the 100 character - // (we know it's the last character); the rule for 101 recurses to - // fill in the remaining digits and the numeral mark - + " 100: <%%hundreds<\u2032; <%%hundreds<>>;\n" - // special-case the hundreds from 500 to 900 because they consist of - // more than one character - + " 500: \u05ea\u2033\u05e7; \u05ea\u05e7>>;\n" - + " 600: \u05ea\u2033\u05e8; \u05ea\u05e8>>;\n" - + " 700: \u05ea\u2033\u05e9; \u05ea\u05e9>>;\n" - + " 800: \u05ea\u2033\u05ea; \u05ea\u05ea>>;\n" - + " 900: \u05ea\u05ea\u2033\u05e7; \u05ea\u05ea\u05e7>>;\n" - // this rule set is used to format values of 1,000 or more. Here, we don't - // worry about the numeral mark, and we add two dots (the Unicode combining - // diaeresis character) to ever letter - + "%%high-order:\n" - // put the ones digit, followed by the diaeresis - + " =%%ones=\u0308;\n" - // the tens can be handled with recursion - + " 10: <%%tens<\u0308[>>];\n" - // still have to special-case 15 and 16 - + " 15: \u05d8\u0308\u05d5\u0308; 16: \u05d8\u003078\u05d6\u0308;\n" - // back to the regular rules at 17 - + " 17: <%%tens<\u0308[>>];\n" - // the hundreds with the dots added (and without worrying about - // placing the numeral mark) - + " 100: <%%hundreds<\u0308[>>];\n" - + " 500: \u05ea\u0308\u05e7\u0308[>>];\n" - + " 600: \u05ea\u0308\u05e8\u0308[>>];\n" - + " 700: \u05ea\u0308\u05e9\u0308[>>];\n" - + " 800: \u05ea\u0308\u05ea\u0308[>>];\n" - + " 900: \u05ea\u0308\u05ea\u0308\u05e7\u0308[>>];\n" - // this rule set doesn't do anything; it's used by some other rules to - // invoke the rollback rule - + " %%null:\n" - + " ;\n" - // the main rule set. - + "%main:\n" - // for values below 10, just output the letter and the numeral mark - + " =%%ones=\u2032;\n" - // for values from 10 to 99, use %%tens-and-ones to do the formatting - + " 10: =%%tens-and-ones=;\n" - // for values from 100 to 999, use %%low-order to do the formatting - + " 100: =%%low-order=;\n" - // for values of 1,000 and over, use %%high-order to do the formatting - + " 1000: <%%high-order<[>%%low-order>];\n"; - - /** - * Greek alphabetic numerals. The Greeks, before adopting the Arabic numerals, - * also used the letters of their alphabet as numerals. There are three now- - * obsolete Greek letters that are used as numerals; many fonts don't have them. - * Large numbers were handled many different ways; the way shown here divides - * large numbers into groups of four letters (factors of 10,000), and separates - * the groups with the capital letter mu (for myriad). Capital letters are used - * for values below 10,000; small letters for higher numbers (to make the capital - * mu stand out). - */ - public static final String greekAlphabetic = - // this rule set is used for formatting numbers below 10,000. It uses - // capital letters. - "%%low-order:\n" - + " (no zero); \u0391; \u0392; \u0393; \u0394; \u0395; \u03dc; \u0396; \u0397; \u0398;\n" - + " 10: \u0399[>>]; 20: \u039a[>>]; 30: \u039b[>>]; 40: \u039c[>>]; 50: \u039d[>>];\n" - + " 60: \u039e[>>]; 70: \u039f[>>]; 80: \u03a0[>>]; 90: \u03de[>>];\n" - + " 100: \u03a1[>>]; 200: \u03a3[>>]; 300: \u03a4[>>]; 400: \u03a5[>>];\n" - + " 500: \u03a6[>>]; 600: \u03a7[>>]; 700: \u03a8[>>]; 800: \u03a9[>>];\n" - + " 900: \u03e0[>>];\n" - // the thousands are represented by the same numbers as the ones, but - // with a comma-like mark added to their left shoulder - + " 1000: \u0391\u0313[>>]; 2000: \u0392\u0313[>>]; 3000: \u0393\u0313[>>];\n" - + " 4000: \u0394\u0313[>>]; 5000: \u0395\u0313[>>]; 6000: \u03dc\u0313[>>];\n" - + " 7000: \u0396\u0313[>>]; 8000: \u0397\u0313[>>]; 9000: \u0398\u0313[>>];\n" - // this rule set is the same as above, but uses lowercase letters. It is used - // for formatting the groups in numbers above 10,000. - + "%%high-order:\n" - + " (no zero); \u03b1; \u03b2; \u03b3; \u03b4; \u03b5; \u03dc; \u03b6; \u03b7; \u03b8;\n" - + " 10: \u03b9[>>]; 20: \u03ba[>>]; 30: \u03bb[>>]; 40: \u03bc[>>]; 50: \u03bd[>>];\n" - + " 60: \u03be[>>]; 70: \u03bf[>>]; 80: \u03c0[>>]; 90: \u03de[>>];\n" - + " 100: \u03c1[>>]; 200: \u03c3[>>]; 300: \u03c4[>>]; 400: \u03c5[>>];\n" - + " 500: \u03c6[>>]; 600: \u03c7[>>]; 700: \u03c8[>>]; 800: \u03c9[>>];\n" - + " 900: \u03c0[>>];\n" - + " 1000: \u03b1\u0313[>>]; 2000: \u03b2\u0313[>>]; 3000: \u03b3\u0313[>>];\n" - + " 4000: \u03b4\u0313[>>]; 5000: \u03b5\u0313[>>]; 6000: \u03dc\u0313[>>];\n" - + " 7000: \u03b6\u0313[>>]; 8000: \u03b7\u0313[>>]; 9000: \u03b8\u0313[>>];\n" - // the main rule set - + "%main:\n" - // for values below 10,000, just use %%low-order - + " =%%low-order=;\n" - // for values above 10,000, split into two groups of four digits - // and format each with %%high-order (putting an M in betwen) - + " 10,000: <%%high-order<\u039c>%%high-order>;\n" - // for values above 100,000,000, add another group onto the front - // and another M - + " 100,000,000: <%%high-order<\u039c>>\n"; - - /** - * A list of all the sample rule sets, used by the demo program. - */ - public static final String[] sampleRuleSets = - { usEnglish, - ukEnglish, - spanish, - french, - swissFrench, - german, - italian, - swedish, - dutch, - japanese, - greek, - russian, - hebrew, - ordinal, - message1, - dollarsAndCents, - decimalAsFraction, - closestFraction, - stock, - abbEnglish, - units, - message2, - dozens, - durationInSeconds, - durationInHours, - poundsShillingsAndPence, - arabicNumerals, - wordsForDigits, - chinesePlaceValue, - romanNumerals, - hebrewAlphabetic, - greekAlphabetic }; - - /** - * The displayable names for all the sample rule sets, in the same order as - * the preceding array. - */ - public static final String[] sampleRuleSetNames = - { "English (US)", - "English (UK)", - "Spanish", - "French (France)", - "French (Switzerland)", - "German", - "Italian", - "Swedish", - "Dutch", - "Japanese", - "Greek", - "Russian", - "Hebrew", - "English ordinal abbreviations", - "Simple message formatting", - "Dollars and cents", - "Decimals as fractions", - "Closest fraction", - "Stock prices", - "Abbreviated US English", - "Changing dimensions", - "Complex message formatting", - "Dozens", - "Duration (value in seconds)", - "Duration (value in hours)", - "Pounds, shillings, and pence", - "Arabic numerals", - "Words for digits", - "Chinese place-value notation", - "Roman numerals", - "Hebrew ahlphabetic numerals", - "Greek alphabetic numerals" }; - - /** - * The base locale for each of the sample rule sets. The locale is used to - * determine DecimalFormat behavior, lenient-parse behavior, and text-display - * selection (we have a hack in here to allow display of non-Latin scripts). - * Null means the locale setting is irrelevant and the default can be used. - */ - public static final Locale[] sampleRuleSetLocales = - { Locale.US, - Locale.UK, - new Locale("es", "", ""), - Locale.FRANCE, - new Locale("fr", "CH", ""), - Locale.GERMAN, - Locale.ITALIAN, - new Locale("sv", "", ""), - new Locale("nl", "", ""), - Locale.JAPANESE, - new Locale("el", "", ""), - new Locale("ru", "", ""), - new Locale("iw", "", ""), - Locale.ENGLISH, - Locale.ENGLISH, - Locale.US, - Locale.ENGLISH, - null, - null, - Locale.ENGLISH, - null, - Locale.ENGLISH, - Locale.ENGLISH, - null, - null, - Locale.UK, - null, - Locale.ENGLISH, - new Locale("zh", "", ""), - null, - new Locale("iw", "", ""), - new Locale("el", "", ""), - null }; - - public static final String[] sampleRuleSetCommentary = { - "This demonstration version of the " - + "U.S. English spellout rules has four variants: 1) %simplified is a " - + "set of rules showing the simple method of spelling out numbers in " - + "English: 289 is formatted as \"two hundred eighty-nine\". 2) %alt-teens " - + "is the same as %simplified, except that values between 1,000 and 9,999 " - + "whose hundreds place isn't zero are formatted in hundreds. For example, " - + "1,983 is formatted as \"nineteen hundred eighty-three,\" and 2,183 is " - + "formatted as \"twenty-one hundred eighty-three,\" but 2,083 is still " - + "formatted as \"two thousand eighty-three.\" 3) %ordinal formats the " - + "values as ordinal numbers in English (e.g., 289 is \"two hundred eighty-" - + "ninth\"). 4) %default uses a more complicated algorithm to format " - + "numbers in a more natural way: 289 is formatted as \"two hundred AND " - + "eighty-nine\" and commas are inserted between the thousands groups for " - + "values above 100,000.", - - "U.K. English has one significant " - + "difference from U.S. English: the names for values of 1,000,000,000 " - + "and higher. In American English, each successive \"-illion\" is 1,000 " - + "times greater than the preceding one: 1,000,000,000 is \"one billion\" " - + "and 1,000,000,000,000 is \"one trillion.\" In British English, each " - + "successive \"-illion\" is one million times greater than the one before: " - + "\"one billion\" is 1,000,000,000,000 (or what Americans would call a " - + "\"trillion\"), and \"one trillion\" is 1,000,000,000,000,000,000. " - + "1,000,000,000 in British English is \"one thousand million.\" (This " - + "value is sometimes called a \"milliard,\" but this word seems to have " - + "fallen into disuse.)", - - "The Spanish rules are quite similar to " - + "the English rules, but there are some important differences: " - + "First, we have to provide separate rules for most of the twenties " - + "because the ones digit frequently picks up an accent mark that it " - + "doesn't have when standing alone. Second, each multiple of 100 has " - + "to be specified separately because the multiplier on 100 very often " - + "changes form in the contraction: 500 is \"quinientos,\" not " - + "\"cincocientos.\" In addition, the word for 100 is \"cien\" when " - + "standing alone, but changes to \"ciento\" when followed by more digits. " - + "There also some other differences.", - - "French adds some interesting quirks of its " - + "own: 1) The word \"et\" is interposed between the tens and ones digits, " - + "but only if the ones digit if 1: 20 is \"vingt,\" and 2 is \"vingt-deux,\" " - + "but 21 is \"vingt-et-un.\" 2) There are no words for 70, 80, or 90. " - + "\"quatre-vingts\" (\"four twenties\") is used for 80, and values proceed " - + "by score from 60 to 99 (e.g., 73 is \"soixante-treize\" [\"sixty-thirteen\"]). " - + "Numbers from 1,100 to 1,199 are rendered as hundreds rather than " - + "thousands: 1,100 is \"onze cents\" (\"eleven hundred\"), rather than " - + "\"mille cent\" (\"one thousand one hundred\")", - - "Swiss French differs from French French " - + "in that it does have words for 70, 80, and 90. This rule set shows them, " - + "and is simpler as a result.", - - "German also adds some interesting " - + "characteristics. For values below 1,000,000, numbers are customarily " - + "written out as a single word. And the ones digit PRECEDES the tens " - + "digit (e.g., 23 is \"dreiundzwanzig,\" not \"zwanzigunddrei\").", - - "Like German, most Italian numbers are " - + "written as single words. What makes these rules complicated is the rule " - + "that says that when a word ending in a vowel and a word beginning with " - + "a vowel are combined into a compound, the vowel is dropped from the " - + "end of the first word: 180 is \"centottanta,\" not \"centoottanta.\" " - + "The complexity of this rule set is to produce this behavior.", - - "Spellout rules for Swedish.", - - "Spellout rules for Dutch. Notice that in Dutch, as in German," - + "the ones digit precedes the tens digit.", - - "In Japanese, there really isn't any " - + "distinction between a number written out in digits and a number " - + "written out in words: the ideographic characters are both digits " - + "and words. This rule set provides two variants: %traditional " - + "uses the traditional CJK numerals (which are also used in China " - + "and Korea). %financial uses alternate ideographs for many numbers " - + "that are harder to alter than the traditional numerals (one could " - + "fairly easily change a one to " - + "a three just by adding two strokes, for example). This is also done in " - + "the other countries using Chinese idographs, but different ideographs " - + "are used in those places.", - - "Again in Greek we have to supply the words " - + "for the multiples of 100 because they can't be derived algorithmically. " - + "Also, the tens dgit changes form when followed by a ones digit: an " - + "accent mark disappears from the tens digit and moves to the ones digit. " - + "Therefore, instead of using the [] notation, we actually have to use " - + "two separate rules for each multiple of 10 to show the two forms of " - + "the word.", - - "Spellout rules for Russian.", - - "Spellout rules for Hebrew. Hebrew actually has inflected forms for " - + "most of the lower-order numbers. The masculine forms are shown " - + "here.", - - "This rule set adds an English ordinal abbreviation to the end of a " - + "number. For example, 2 is formatted as \"2nd\". Parsing doesn't work with " - + "this rule set. To parse, use DecimalFormat on the numeral.", - - "This is a simple message-formatting example. Normally one would " - + "use ChoiceFormat and MessageFormat to do something this simple, " - + "but this shows it could be done with RuleBasedNumberFormat too. " - + "A message-formatting example that might work better with " - + "RuleBasedNumberFormat appears later.", - - "The next few examples demonstrate fraction handling. " - + "This example formats a number in one of the two styles often used " - + "on checks. %dollars-and-hundredths formats cents as hundredths of " - + "a dollar (23.40 comes out as \"twenty-three and 40/100 dollars\"). " - + "%dollars-and-cents formats in dollars and cents (23.40 comes out as " - + "\"twenty-three dollars and forty cents\")", - - "This rule set shows the fractional part of the number as a fraction " - + "with a power of 10 as the denominator. Some languages don't spell " - + "out the fractional part of a number as \"point one two three,\" but " - + "always render it as a fraction. If we still want to treat the fractional " - + "part of the number as a decimal, then the fraction's denominator " - + "is always a power of 10. This example does that: 23.125 is formatted " - + "as \"twenty-three and one hundred twenty-five thousandths\" (as opposed " - + "to \"twenty-three point one two five\" or \"twenty-three and one eighth\").", - - "Number with closest fraction. This example formats a value using " - + "numerals, but shows the fractional part as a ratio (fraction) rather " - + "than a decimal. The fraction always has a denominator between 2 and 10.", - - "American stock-price formatting. Non-integral stock prices are still " - + "generally shown in eighths or sixteenths of dollars instead of dollars " - + "and cents. This example formats stock prices in this way if possible, " - + "and in dollars and cents if not.", - - "The next few examples demonstrate using a RuleBasedNumberFormat to " - + "change the units a value is denominated in depending on its magnitude. " - + "The example shows large numbers the way they often appear is nwespapers: " - + "1,200,000 is formatted as \"1.2 million\".", - - "This example takes a number of meters and formats it in whatever unit " - + "will produce a number with from one to three digits before the decimal " - + "point. For example, 230,000 is formatted as \"230 km\".", - - "A more complicated message-formatting example. Here, in addition to " - + "handling the singular and plural versions of the word, the value is " - + "denominated in bytes, kilobytes, or megabytes depending on its magnitude. " - + "Also notice that it correctly treats a kilobyte as 1,024 bytes (not 1,000), " - + "and a megabyte as 1,024 kilobytes (not 1,000).", - - "This example formats a number in dozens and gross. This is intended to " - + "demonstrate how this rule set can be used to format numbers in systems " - + "other than base 10. The \"/12\" after the rules' base values controls this. " - + "Also notice that the base doesn't have to be consistent throughout the " - + "whole rule set: we go back to base 10 for values over 1,000.", - - "The next few examples show how a single value can be divided up into major " - + "and minor units that don't relate to each other by a factor of 10. " - + "This example formats a number of seconds in sexagesimal notation " - + "(i.e., hours, minutes, and seconds). %with-words formats it with " - + "words (3740 is \"1 hour, 2 minutes, 20 seconds\") and %in-numerals " - + "formats it entirely in numerals (3740 is \"1:02:20\").", - - "This example formats a number of hours in sexagesimal notation (i.e., " - + "hours, minutes, and seconds). %with-words formats the value using " - + "words for the units, and %in-numerals formats the value using only " - + "numerals.", - - "This rule set formats a number of pounds as pounds, shillings, and " - + "pence in the old English system of currency.", - - "These examples show how RuleBasedNumberFormat can be used to format " - + "numbers using non-positional numeration systems. " - + "This example formats numbers in Arabic numerals. " - + "Normally, you'd do this with DecimalFormat, but this shows that " - + "RuleBasedNumberFormat can handle it too.", - - "This example follows the same pattern as the Arabic-numerals " - + "example, but uses words for the various digits (e.g., 123 comes " - + "out as \"one two three\").", - - "This example formats numbers using Chinese characters in the Arabic " - + "place-value method. This was used historically in China for a while.", - - "Roman numerals. This example has two variants: %modern shows how large " - + "numbers are usually handled today; %historical ses the older symbols for " - + "thousands. Not all of the characters are displayable with most fonts.", - - "Hebrew alphabetic numerals. Before adoption of Arabic numerals, Hebrew speakers " - + "used the letter of their alphabet as numerals. The first nine letters of " - + "the alphabet repesented the values from 1 to 9, the second nine letters the " - + "multiples of 10, and the remaining letters the multiples of 100. Since they " - + "ran out of letters at 400, the remaining multiples of 100 were represented " - + "using combinations of the existing letters for the hundreds. Numbers were " - + "distinguished from words in a number of different ways: the way shown here " - + "uses a single mark after a number consisting of one letter, and a double " - + "mark between the last two letters of a number consisting of two or more " - + "letters. Two dots over a letter multiplied its value by 1,000. Also, since " - + "the letter for 10 is the first letter of God's name and the letters for 5 and 6 " - + "are letters in God's name, which wasn't supposed to be written or spoken, 15 and " - + "16 were usually written as 9 + 6 and 9 + 7 instead of 10 + 5 and 10 + 6.", - - "Greek alphabetic numerals. The Greeks, before adopting the Arabic numerals, " - + "also used the letters of their alphabet as numerals. There are three now-" - + "obsolete Greek letters that are used as numerals; many fonts don't have them. " - + "Large numbers were handled many different ways; the way shown here divides " - + "large numbers into groups of four letters (factors of 10,000), and separates " - + "the groups with the capital letter mu (for myriad). Capital letters are used " - + "for values below 10,000; small letters for higher numbers (to make the capital " - + "mu stand out).", - - "This is a custom (user-defined) rule set." - }; -} diff --git a/icu4j/src/com/ibm/demo/rbnf/package.html b/icu4j/src/com/ibm/demo/rbnf/package.html deleted file mode 100755 index 48917aed39..0000000000 --- a/icu4j/src/com/ibm/demo/rbnf/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -RuleBasedNumberFormat demo appliation. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/demo/translit/Demo.java b/icu4j/src/com/ibm/demo/translit/Demo.java deleted file mode 100755 index cda2069faf..0000000000 --- a/icu4j/src/com/ibm/demo/translit/Demo.java +++ /dev/null @@ -1,589 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/translit/Attic/Demo.java,v $ - * $Date: 2001/11/29 17:28:38 $ - * $Revision: 1.11 $ - * - ***************************************************************************************** - */ -package com.ibm.demo.translit; -import java.applet.*; -import java.awt.*; -import java.awt.event.*; -import java.util.*; -import com.ibm.icu.demo.components.*; -import com.ibm.text.*; - -/** - * A frame that allows the user to experiment with keyboard - * transliteration. This class has a main() method so it can be run - * as an application. The frame contains an editable text component - * and uses keyboard transliteration to process keyboard events. - * - *

Copyright (c) IBM Corporation 1999. All rights reserved. - * - * @author Alan Liu - * @version $RCSfile: Demo.java,v $ $Revision: 1.11 $ $Date: 2001/11/29 17:28:38 $ - */ -public class Demo extends Frame { - - static final boolean DEBUG = true; - - Transliterator translit = null; - String fontName = "Arial Unicode MS"; - int fontSize = 36; - - - - /* - boolean compound = false; - Transliterator[] compoundTranslit = new Transliterator[MAX_COMPOUND]; - static final int MAX_COMPOUND = 128; - int compoundCount = 0; - */ - - TransliteratingTextComponent text = null; - - Menu translitMenu; - CheckboxMenuItem translitItem; - CheckboxMenuItem noTranslitItem; - - static final String NO_TRANSLITERATOR = "None"; - - private static final String COPYRIGHT = - "\u00A9 IBM Corporation 1999. All rights reserved."; - - public static void main(String[] args) { - Frame f = new Demo(600, 200); - f.addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { - System.exit(0); - } - }); - f.setVisible(true); - } - - public Demo(int width, int height) { - super("Transliteration Demo"); - - initMenus(); - - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { - handleClose(); - } - }); - - text = new TransliteratingTextComponent(); - Font font = new Font(fontName, Font.PLAIN, fontSize); - text.setFont(font); - text.setSize(width, height); - text.setVisible(true); - text.setText("\u03B1\u05D0\u3042\u4E80"); - add(text); - - setSize(width, height); - setTransliterator("Latin-Greek"); - } - - private void initMenus() { - MenuBar mbar; - Menu menu; - MenuItem mitem; - CheckboxMenuItem citem; - - setMenuBar(mbar = new MenuBar()); - mbar.add(menu = new Menu("File")); - menu.add(mitem = new MenuItem("Quit")); - mitem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - handleClose(); - } - }); -/* - final ItemListener setTransliteratorListener = new ItemListener() { - public void itemStateChanged(ItemEvent e) { - CheckboxMenuItem item = (CheckboxMenuItem) e.getSource(); - if (e.getStateChange() == ItemEvent.DESELECTED) { - // Don't let the current transliterator be deselected. - // Just reselect it. - item.setState(true); - } else if (compound) { - // Adding an item to a compound transliterator - handleAddToCompound(item.getLabel()); - } else if (item != translitItem) { - // Deselect previous choice. Don't need to call - // setState(true) on new choice. - translitItem.setState(false); - translitItem = item; - handleSetTransliterator(item.getLabel()); - } - } - }; -*/ - /* - translitMenu.add(translitItem = noTranslitItem = - new CheckboxMenuItem(NO_TRANSLITERATOR, true)); - noTranslitItem.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - // Can't uncheck None -- any action here sets None to true - setNoTransliterator(); - } - }); - - translitMenu.addSeparator(); - */ - -/* - translitMenu.add(citem = new CheckboxMenuItem("Compound")); - citem.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - CheckboxMenuItem item = (CheckboxMenuItem) e.getSource(); - if (e.getStateChange() == ItemEvent.DESELECTED) { - // If compound gets deselected, then select NONE - setNoTransliterator(); - } else if (!compound) { - // Switching from non-compound to compound - translitItem.setState(false); - translitItem = item; - translit = null; - compound = true; - compoundCount = 0; - for (int i=0; i" : variant); - mitem.addActionListener(new TransliterationListener(source + "-" + target + "/" + variant)); - variantMenu.add(mitem); - } - targetMenu.add(variantMenu); - } - } - translitMenu.add(targetMenu); - } - - - } - - boolean transliterateTyping = true; - Transliterator fromHex = Transliterator.getInstance("Hex-Any"); - InfoDialog helpDialog; - InfoDialog hexDialog; - InfoDialog compoundDialog; - MenuItem convertSelectionItem = null; - MenuItem invertSelectionItem = null; - MenuItem swapSelectionItem = null; - MenuItem convertTypingItem = null; - Menu historyMenu; - Map historyMap = new HashMap(); - Set historySet = new TreeSet(new Comparator() { - public int compare(Object a, Object b) { - MenuItem aa = (MenuItem)a; - MenuItem bb = (MenuItem)b; - return aa.getLabel().compareTo(bb.getLabel()); - } - }); - - void setTransliterator(String name) { - System.out.println("Got: " + name); - translit = Transliterator.getInstance(name); - text.flush(); - text.setTransliterator(translit); - convertSelectionItem.setLabel(Transliterator.getDisplayName(translit.getID())); - - addHistory(translit); - - Transliterator inv = translit.getInverse(); - if (inv != null) { - addHistory(inv); - invertSelectionItem.setEnabled(true); - swapSelectionItem.setEnabled(true); - invertSelectionItem.setLabel(Transliterator.getDisplayName(inv.getID())); - } else { - invertSelectionItem.setEnabled(false); - swapSelectionItem.setEnabled(false); - invertSelectionItem.setLabel("No inverse"); - } - } - - void addHistory(Transliterator translit) { - String name = translit.getID(); - MenuItem cmi = (MenuItem) historyMap.get(name); - if (cmi == null) { - cmi = new MenuItem(translit.getDisplayName(name)); - cmi.addActionListener(new TransliterationListener(name)); - historyMap.put(name, cmi); - historySet.add(cmi); - historyMenu.removeAll(); - Iterator it = historySet.iterator(); - while (it.hasNext()) { - historyMenu.add((MenuItem)it.next()); - } - } - } - - class TransliterationListener implements ActionListener, ItemListener { - String name; - public TransliterationListener(String name) { - this.name = name; - } - public void actionPerformed(ActionEvent e) { - setTransliterator(name); - } - public void itemStateChanged(ItemEvent e) { - if (e.getStateChange() == e.SELECTED) { - setTransliterator(name); - } else { - setTransliterator("Any-Null"); - } - } - } - - class FontActionListener implements ActionListener { - String name; - public FontActionListener(String name) { - this.name = name; - } - public void actionPerformed(ActionEvent e) { - System.out.println("Font: " + name); - fontName = name; - text.setFont(new Font(fontName, Font.PLAIN, fontSize)); - } - } - - class SizeActionListener implements ActionListener { - int size; - public SizeActionListener(int size) { - this.size = size; - } - public void actionPerformed(ActionEvent e) { - System.out.println("Size: " + size); - fontSize = size; - text.setFont(new Font(fontName, Font.PLAIN, fontSize)); - } - } - - Set add(Set s, Enumeration enum) { - while(enum.hasMoreElements()) { - s.add(enum.nextElement()); - } - return s; - } - - /** - * Get a sorted list of the system transliterators. - */ - /* - private static Vector getSystemTransliteratorNames() { - Vector v = new Vector(); - for (Enumeration e=Transliterator.getAvailableIDs(); - e.hasMoreElements(); ) { - v.addElement(e.nextElement()); - } - // Insertion sort, O(n^2) acceptable for small n - for (int i=0; i<(v.size()-1); ++i) { - String a = (String) v.elementAt(i); - for (int j=i+1; j 0) { - v.setElementAt(b, i); - v.setElementAt(a, j); - a = b; - } - } - } - return v; - } - */ - -/* - private void setNoTransliterator() { - translitItem = noTranslitItem; - noTranslitItem.setState(true); - handleSetTransliterator(noTranslitItem.getLabel()); - compound = false; - for (int i=0; i. - */ - /* - private static Transliterator decodeTranslitItem(String name) { - return (name.equals(NO_TRANSLITERATOR)) - ? null : Transliterator.getInstance(name); - } - */ - - private void handleBatchTransliterate(Transliterator translit) { - if (translit == null) { - return; - } - - int start = text.getSelectionStart(); - int end = text.getSelectionEnd(); - ReplaceableString s = - new ReplaceableString(text.getText().substring(start, end)); - - StringBuffer log = null; - if (DEBUG) { - log = new StringBuffer(); - log.append('"' + s.toString() + "\" (start " + start + - ", end " + end + ") -> \""); - } - - translit.transliterate(s); - String str = s.toString(); - - if (DEBUG) { - log.append(str + "\""); - System.out.println("Batch " + translit.getID() + ": " + log.toString()); - } - - text.replaceRange(str, start, end); - text.select(start, start + str.length()); - } - - private void handleClose() { - helpDialog.dispose(); - dispose(); - } - - class InfoDialog extends Dialog { - protected Button button; - protected TextArea area; - protected Dialog me; - protected Panel bottom; - - public TextArea getArea() { - return area; - } - - public Panel getBottom() { - return bottom; - } - - InfoDialog(Frame parent, String title, String label, String message) { - super(parent, title, false); - me = this; - this.setLayout(new BorderLayout()); - if (label.length() != 0) { - this.add("North", new Label(label)); - } - - area = new TextArea(message, 8, 80, TextArea.SCROLLBARS_VERTICAL_ONLY); - this.add("Center", area); - - button = new Button("Hide"); - button.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - me.hide(); - } - }); - bottom = new Panel(); - bottom.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0)); - bottom.add(button); - this.add("South", bottom); - this.pack(); - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { - me.hide(); - } - }); - } - } -} diff --git a/icu4j/src/com/ibm/demo/translit/DemoApplet.java b/icu4j/src/com/ibm/demo/translit/DemoApplet.java deleted file mode 100755 index 34251f20ec..0000000000 --- a/icu4j/src/com/ibm/demo/translit/DemoApplet.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/translit/Attic/DemoApplet.java,v $ - * $Date: 2001/11/28 19:27:09 $ - * $Revision: 1.5 $ - * - ***************************************************************************************** - */ -package com.ibm.demo.translit; -import java.awt.*; -import java.awt.event.*; -import java.applet.*; -import com.ibm.icu.demo.components.AppletFrame; - -/** - * A simple Applet that shows a button. When pressed, the button - * shows the DemoAppletFrame. This Applet is meant to be embedded - * in a web page. - * - *

Copyright (c) IBM Corporation 1999. All rights reserved. - * - * @author Alan Liu - * @version $RCSfile: DemoApplet.java,v $ $Revision: 1.5 $ $Date: 2001/11/28 19:27:09 $ - */ -public class DemoApplet extends Applet { - - Demo frame = null; - - private static final String COPYRIGHT = - "\u00A9 IBM Corporation 1999. All rights reserved."; - - public static void main(String args[]) { - final DemoApplet applet = new DemoApplet(); - new AppletFrame("Transliteration Demo", applet, 640, 480); - } - - public void init() { - - Button button = new Button("Transliteration Demo"); - button.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (frame == null) { - frame = new Demo(600, 200); - frame.addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent we) { - frame = null; - } - }); - } - frame.setVisible(true); - frame.toFront(); - } - }); - - add(button); - - Dimension size = button.getPreferredSize(); - size.width += 10; - size.height += 10; - - resize(size); - } - - public void stop() { - if (frame != null) { - frame.dispose(); - } - frame = null; - } -} diff --git a/icu4j/src/com/ibm/demo/translit/demo.bat b/icu4j/src/com/ibm/demo/translit/demo.bat deleted file mode 100755 index 36f8b78b8d..0000000000 --- a/icu4j/src/com/ibm/demo/translit/demo.bat +++ /dev/null @@ -1,19 +0,0 @@ -REM /* -REM ******************************************************************************* -REM * Copyright (C) 1996-2000, International Business Machines Corporation and * -REM * others. All Rights Reserved. * -REM ******************************************************************************* -REM * -REM * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/demo/translit/Attic/demo.bat,v $ -REM * $Date: 2000/03/10 03:47:44 $ -REM * $Revision: 1.2 $ -REM * -REM ***************************************************************************************** -REM */ -REM For best results, run the demo as an applet inside of Netscape -REM with Bitstream Cyberbit installed. - -REM setup your JDK 1.1.x path and classpath here: -call JDK11 -set CLASSPATH=../translit.jar;%CLASSPATH% -javaw Demo diff --git a/icu4j/src/com/ibm/demo/translit/demo.html b/icu4j/src/com/ibm/demo/translit/demo.html deleted file mode 100755 index c655dc94db..0000000000 --- a/icu4j/src/com/ibm/demo/translit/demo.html +++ /dev/null @@ -1,27 +0,0 @@ - - -Transliteration Demo - - - - - -


- -If you don't see a button above, then your browser is failing to -locate the necessary Java class files. - -

- -One way to make this work is to copy this HTML file to -icu4j/src, and make sure the Java files in the directories -under icu4j/src/com are built. Then open this HTML file -using a browser or appletviewer. - -

- -For best results, run this demo as an applet within Netscape with -Bitstream Cyberbit installed. - - - diff --git a/icu4j/src/com/ibm/demo/translit/package.html b/icu4j/src/com/ibm/demo/translit/package.html deleted file mode 100755 index 3f4e5b962b..0000000000 --- a/icu4j/src/com/ibm/demo/translit/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Transliterator demo appliation. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/demo/translit/resources/Transliterator_Han_Pinyin.txt b/icu4j/src/com/ibm/demo/translit/resources/Transliterator_Han_Pinyin.txt deleted file mode 100755 index 8f7c21d3a6..0000000000 --- a/icu4j/src/com/ibm/demo/translit/resources/Transliterator_Han_Pinyin.txt +++ /dev/null @@ -1,20365 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Generated: Fri Jan 26 15:14:48 2001 -# Tool: ..\..\tools\translit\hanpinyin.pl -#-------------------------------------------------------------------- - -# Han-Pinyin - -# Mechanically derived from \desk\Unihan.txt (ftp.unicode.org), version: -# -# Name: Unihan database -# Unicode version: 3.0b1 -# Table version: 1.1 -# Date: 2 July 1999 -# -# Copyright (c) 1996-1999 Unicode, Inc. All Rights reserved. - -ä¸ > dÄ«ng; #4E01 -丂 > kăo; #4E02 -七 > qÄ«; #4E03 -丄 > shàng; #4E04 -丅 > xià; #4E05 -万 > mò; #4E07 -丈 > zhàng; #4E08 -三 > sÄn; #4E09 -上 > shàng; #4E0A -下 > xià; #4E0B -丌 > jÄ«; #4E0C -ä¸ > bù; #4E0D -与 > yÅ­; #4E0E -ä¸ > miăn; #4E0F -ä¸ > gài; #4E10 -丑 > chÅu; #4E11 -丒 > chÅu; #4E12 -专 > zhuÄn; #4E13 -且 > qiÄ•; #4E14 -丕 > pÄ«; #4E15 -世 > shì; #4E16 -丗 > shì; #4E17 -丘 > qÄ«u; #4E18 -丙 > bÄ­ng; #4E19 -业 > yè; #4E1A -丛 > cóng; #4E1B -东 > dÅng; #4E1C -ä¸ > sÄ«; #4E1D -丞 > chéng; #4E1E -丟 > dÄ«u; #4E1F -丠 > qÄ«u; #4E20 -両 > liăng; #4E21 -丢 > dÄ«u; #4E22 -丣 > yÅu; #4E23 -两 > liăng; #4E24 -严 > yán; #4E25 -並 > bìng; #4E26 -丧 > sÄng; #4E27 -丨 > gÅ­n; #4E28 -丩 > jÄ«u; #4E29 -个 > gè; #4E2A -丫 > yÄ; #4E2B -丬 > qiáng; #4E2C -中 > zhÅng; #4E2D -丮 > jÄ­; #4E2E -丯 > jiè; #4E2F -丰 > fÄ“ng; #4E30 -丱 > guàn; #4E31 -串 > chuàn; #4E32 -丳 > chăn; #4E33 -临 > lín; #4E34 -丵 > zhÅ­o; #4E35 -丶 > zhÅ­; #4E36 -丸 > wán; #4E38 -丹 > dÄn; #4E39 -为 > wèi; #4E3A -主 > zhÅ­; #4E3B -丼 > jÄ­ng; #4E3C -丽 > lì; #4E3D -举 > jÅ­; #4E3E -丿 > piÄ•; #4E3F -ä¹€ > fú; #4E40 -ä¹ > yí; #4E41 -乂 > yì; #4E42 -乃 > năi; #4E43 -ä¹… > jÄ­u; #4E45 -乆 > jÄ­u; #4E46 -乇 > zhé; #4E47 -么 > yÄo; #4E48 -义 > yì; #4E49 -之 > zhÄ«; #4E4B -乌 > wÅ«; #4E4C -ä¹ > zhà; #4E4D -乎 > hÅ«; #4E4E -ä¹ > fá; #4E4F -ä¹ > lè; #4E50 -乑 > zhòng; #4E51 -ä¹’ > pÄ«ng; #4E52 -乓 > pang; #4E53 -ä¹” > qiáo; #4E54 -乕 > hÅ­; #4E55 -ä¹– > guÄi; #4E56 -ä¹— > chéng; #4E57 -乘 > chéng; #4E58 -ä¹™ > yÄ­; #4E59 -乚 > yÄ­n; #4E5A -乜 > miÄ“; #4E5C -ä¹ > jÄ­u; #4E5D -乞 > qÄ­; #4E5E -也 > yÄ•; #4E5F -ä¹  > xí; #4E60 -乡 > xiÄng; #4E61 -ä¹¢ > gài; #4E62 -ä¹£ > dÄ«u; #4E63 -书 > shÅ«; #4E66 -乨 > shÄ­; #4E68 -乩 > jÄ«; #4E69 -乪 > nÄng; #4E6A -乫 > jiÄ; #4E6B -ä¹­ > shí; #4E6D -ä¹° > măi; #4E70 -ä¹± > luàn; #4E71 -ä¹³ > rÅ­; #4E73 -ä¹´ > xué; #4E74 -ä¹µ > yăn; #4E75 -乶 > fÅ­; #4E76 -ä¹· > shÄ; #4E77 -乸 > nă; #4E78 -ä¹¹ > gÄn; #4E79 -ä¹¾ > gÄn; #4E7E -乿 > chì; #4E7F -亀 > gÅ«i; #4E80 -äº > gÄn; #4E81 -亂 > luàn; #4E82 -亃 > lín; #4E83 -亄 > yì; #4E84 -亅 > jué; #4E85 -了 > liăo; #4E86 -予 > yú; #4E88 -争 > zhÄ“ng; #4E89 -亊 > shì; #4E8A -事 > shì; #4E8B -二 > èr; #4E8C -äº > chù; #4E8D -于 > yú; #4E8E -äº > yú; #4E8F -äº > yú; #4E90 -云 > yún; #4E91 -互 > hù; #4E92 -亓 > qí; #4E93 -五 > wÅ­; #4E94 -井 > jÄ­ng; #4E95 -亖 > sì; #4E96 -亗 > sùi; #4E97 -亘 > gèn; #4E98 -亙 > gèn; #4E99 -亚 > yà; #4E9A -些 > xiÄ“; #4E9B -亜 > yà; #4E9C -äº > qí; #4E9D -亞 > yà; #4E9E -亟 > jí; #4E9F -亠 > tóu; #4EA0 -亡 > wáng; #4EA1 -亢 > kàng; #4EA2 -亣 > tà; #4EA3 -交 > jiÄo; #4EA4 -亥 > hài; #4EA5 -亦 > yì; #4EA6 -产 > chăn; #4EA7 -亨 > hÄ“ng; #4EA8 -亩 > mÅ­; #4EA9 -享 > xiăng; #4EAB -京 > jÄ«ng; #4EAC -亭 > tíng; #4EAD -亮 > liàng; #4EAE -亯 > xiăng; #4EAF -亰 > jÄ«ng; #4EB0 -亱 > yè; #4EB1 -亲 > qÄ«n; #4EB2 -亳 > bó; #4EB3 -亴 > yòu; #4EB4 -亵 > xiè; #4EB5 -亶 > dăn; #4EB6 -亷 > lián; #4EB7 -亸 > dÅ­o; #4EB8 -亹 > wÄ•i; #4EB9 -人 > rén; #4EBA -亻 > rén; #4EBB -亼 > jí; #4EBC -亾 > wáng; #4EBE -亿 > yì; #4EBF -什 > shí; #4EC0 -ä» > rén; #4EC1 -仂 > lè; #4EC2 -仃 > dÄ«ng; #4EC3 -仄 > zè; #4EC4 -ä»… > jÄ­n; #4EC5 -仆 > pÅ«; #4EC6 -仇 > chóu; #4EC7 -仈 > bÄ; #4EC8 -仉 > zhăng; #4EC9 -今 > jÄ«n; #4ECA -介 > jiè; #4ECB -仌 > bÄ«ng; #4ECC -ä» > réng; #4ECD -从 > cóng; #4ECE -ä» > fó; #4ECF -ä» > săn; #4ED0 -仑 > lún; #4ED1 -仓 > cÄng; #4ED3 -ä»” > zÄ­; #4ED4 -仕 > shì; #4ED5 -ä»– > tÄ; #4ED6 -ä»— > zhàng; #4ED7 -付 > fù; #4ED8 -ä»™ > xiÄn; #4ED9 -仚 > xiÄn; #4EDA -ä»› > tÅ«o; #4EDB -仜 > hóng; #4EDC -ä» > tóng; #4EDD -仞 > rèn; #4EDE -仟 > qiÄn; #4EDF -ä»  > gán; #4EE0 -仡 > yì; #4EE1 -仢 > dí; #4EE2 -代 > dài; #4EE3 -令 > lìng; #4EE4 -以 > yÄ­; #4EE5 -仦 > chào; #4EE6 -仧 > cháng; #4EE7 -仨 > sÄ; #4EE8 -仪 > yí; #4EEA -仫 > mù; #4EEB -们 > men; #4EEC -ä»­ > rèn; #4EED -ä»® > jiă; #4EEE -仯 > chào; #4EEF -ä»° > yăng; #4EF0 -ä»± > qián; #4EF1 -仲 > zhòng; #4EF2 -仳 > pÄ­; #4EF3 -ä»´ > wàn; #4EF4 -仵 > wÅ­; #4EF5 -件 > jiàn; #4EF6 -ä»· > jiè; #4EF7 -仸 > yăo; #4EF8 -仹 > fÄ“ng; #4EF9 -仺 > cÄng; #4EFA -ä»» > rèn; #4EFB -仼 > wáng; #4EFC -份 > fèn; #4EFD -仾 > dÄ«; #4EFE -仿 > făng; #4EFF -ä¼€ > zhÅng; #4F00 -ä¼ > qÄ­; #4F01 -伂 > pèi; #4F02 -伃 > yú; #4F03 -伄 > diào; #4F04 -ä¼… > dùn; #4F05 -伆 > wèn; #4F06 -伇 > yì; #4F07 -伈 > xÄ­n; #4F08 -伉 > kàng; #4F09 -伊 > yÄ«; #4F0A -伋 > jí; #4F0B -伌 > ài; #4F0C -ä¼ > wÅ­; #4F0D -伎 > jì; #4F0E -ä¼ > fú; #4F0F -ä¼ > fá; #4F10 -休 > xÄ«u; #4F11 -ä¼’ > jìn; #4F12 -伓 > bÄ“i; #4F13 -ä¼” > dăn; #4F14 -伕 > fÅ«; #4F15 -ä¼– > tăng; #4F16 -ä¼— > zhòng; #4F17 -优 > yÅu; #4F18 -ä¼™ > hÅ­o; #4F19 -会 > hùi; #4F1A -ä¼› > yÅ­; #4F1B -伜 > cùi; #4F1C -ä¼ > chuán; #4F1D -伞 > săn; #4F1E -伟 > wÄ•i; #4F1F -ä¼  > chuán; #4F20 -伡 > chÄ“; #4F21 -ä¼¢ > yá; #4F22 -ä¼£ > xiàn; #4F23 -伤 > shÄng; #4F24 -ä¼¥ > chÄng; #4F25 -伦 > lún; #4F26 -伧 > cÄng; #4F27 -伨 > xùn; #4F28 -伩 > xìn; #4F29 -伪 > wÄ•i; #4F2A -伫 > zhù; #4F2B -ä¼­ > xuán; #4F2D -ä¼® > nú; #4F2E -伯 > bó; #4F2F -ä¼° > gÅ«; #4F30 -ä¼± > nÄ­; #4F31 -ä¼² > nÄ­; #4F32 -ä¼³ > xiè; #4F33 -ä¼´ > bàn; #4F34 -ä¼µ > xù; #4F35 -伶 > líng; #4F36 -ä¼· > zhòu; #4F37 -伸 > shÄ“n; #4F38 -ä¼¹ > qÅ«; #4F39 -伺 > sì; #4F3A -ä¼» > bÄ“ng; #4F3B -ä¼¼ > sì; #4F3C -ä¼½ > jiÄ; #4F3D -ä¼¾ > pÄ«; #4F3E -伿 > yì; #4F3F -ä½€ > sì; #4F40 -ä½ > ăi; #4F41 -佂 > zhÄ“ng; #4F42 -佃 > diàn; #4F43 -佄 > hán; #4F44 -ä½… > mài; #4F45 -但 > dàn; #4F46 -佇 > zhù; #4F47 -佈 > bù; #4F48 -佉 > qÅ«; #4F49 -佊 > bÄ­; #4F4A -佋 > shào; #4F4B -佌 > cÄ­; #4F4C -ä½ > wèi; #4F4D -低 > dÄ«; #4F4E -ä½ > zhù; #4F4F -ä½ > zÅ­o; #4F50 -佑 > yòu; #4F51 -ä½’ > yÄng; #4F52 -体 > tÄ­; #4F53 -ä½” > zhàn; #4F54 -何 > hé; #4F55 -ä½– > bì; #4F56 -ä½— > tÅ«o; #4F57 -佘 > shé; #4F58 -ä½™ > yú; #4F59 -佚 > yì; #4F5A -ä½› > fó; #4F5B -作 > zùo; #4F5C -ä½ > kòu; #4F5D -佞 > nìng; #4F5E -佟 > tóng; #4F5F -ä½  > nÄ­; #4F60 -佡 > xuÄn; #4F61 -ä½¢ > qú; #4F62 -ä½£ > yòng; #4F63 -佤 > wă; #4F64 -ä½¥ > qiÄn; #4F65 -佧 > kă; #4F67 -佩 > pèi; #4F69 -佪 > huái; #4F6A -佫 > hè; #4F6B -佬 > lăo; #4F6C -ä½­ > xiáng; #4F6D -ä½® > gé; #4F6E -佯 > yáng; #4F6F -ä½° > băi; #4F70 -ä½± > fă; #4F71 -ä½² > míng; #4F72 -ä½³ > jia; #4F73 -ä½´ > èr; #4F74 -ä½µ > bìng; #4F75 -佶 > jí; #4F76 -ä½· > hÄ•n; #4F77 -佸 > húo; #4F78 -ä½¹ > gÅ­i; #4F79 -佺 > quán; #4F7A -ä½» > tiÄo; #4F7B -ä½¼ > jiăo; #4F7C -ä½½ > cì; #4F7D -ä½¾ > yì; #4F7E -使 > shÄ­; #4F7F -ä¾€ > xíng; #4F80 -ä¾ > shÄ“n; #4F81 -侂 > tÅ«o; #4F82 -侃 > kăn; #4F83 -侄 > zhí; #4F84 -ä¾… > gÄi; #4F85 -來 > lái; #4F86 -侇 > yí; #4F87 -侈 > chÄ­; #4F88 -侉 > kuÄ; #4F89 -侊 > guÄng; #4F8A -例 > lì; #4F8B -侌 > yÄ«n; #4F8C -ä¾ > shì; #4F8D -侎 > mÄ­; #4F8E -ä¾ > zhÅ«; #4F8F -ä¾ > xù; #4F90 -侑 > yòu; #4F91 -ä¾’ > Än; #4F92 -侓 > lù; #4F93 -ä¾” > móu; #4F94 -侕 > ér; #4F95 -ä¾– > lún; #4F96 -ä¾— > tóng; #4F97 -侘 > chà; #4F98 -ä¾™ > chì; #4F99 -侚 > xùn; #4F9A -ä¾› > gÅng; #4F9B -侜 > zhÅu; #4F9C -ä¾ > yÄ«; #4F9D -侞 > rÅ­; #4F9E -侟 > jiàn; #4F9F -ä¾  > xiá; #4FA0 -価 > jià; #4FA1 -ä¾¢ > zài; #4FA2 -ä¾£ > lÇš; #4FA3 -ä¾¥ > jiăo; #4FA5 -侦 > zhÄ“n; #4FA6 -侧 > cè; #4FA7 -侨 > qiáo; #4FA8 -侩 > kuài; #4FA9 -侪 > chái; #4FAA -侫 > nìng; #4FAB -侬 > nóng; #4FAC -ä¾­ > jÄ­n; #4FAD -ä¾® > wÅ­; #4FAE -侯 > hóu; #4FAF -ä¾° > jÄ­ong; #4FB0 -ä¾± > chÄ•ng; #4FB1 -ä¾² > zhèn; #4FB2 -ä¾³ > zùo; #4FB3 -ä¾´ > chÅu; #4FB4 -ä¾µ > qÄ«n; #4FB5 -侶 > lÇš; #4FB6 -ä¾· > jú; #4FB7 -侸 > shù; #4FB8 -ä¾¹ > tÄ­ng; #4FB9 -侺 > shèn; #4FBA -ä¾» > tÅ«o; #4FBB -ä¾¼ > bó; #4FBC -ä¾½ > nán; #4FBD -ä¾¾ > hÄo; #4FBE -便 > biàn; #4FBF -ä¿€ > tÅ­i; #4FC0 -ä¿ > yÅ­; #4FC1 -ä¿‚ > xì; #4FC2 -促 > cù; #4FC3 -ä¿„ > é; #4FC4 -ä¿… > qíu; #4FC5 -俆 > xú; #4FC6 -俇 > kuăng; #4FC7 -俈 > kù; #4FC8 -俉 > wù; #4FC9 -ä¿Š > jùn; #4FCA -ä¿‹ > yì; #4FCB -ä¿Œ > fÅ­; #4FCC -ä¿ > láng; #4FCD -ä¿Ž > zÅ­; #4FCE -ä¿ > qiào; #4FCF -ä¿ > lì; #4FD0 -ä¿‘ > yÅng; #4FD1 -ä¿’ > hùn; #4FD2 -ä¿“ > jìng; #4FD3 -ä¿” > xiàn; #4FD4 -ä¿• > sàn; #4FD5 -ä¿– > păi; #4FD6 -ä¿— > sú; #4FD7 -俘 > fú; #4FD8 -ä¿™ > xÄ«; #4FD9 -ä¿š > lÄ­; #4FDA -ä¿› > fÅ­; #4FDB -ä¿œ > pÄ«ng; #4FDC -ä¿ > băo; #4FDD -ä¿ž > yú; #4FDE -ä¿Ÿ > sì; #4FDF -ä¿  > xiá; #4FE0 -ä¿¡ > xìn; #4FE1 -ä¿¢ > xÄ«u; #4FE2 -ä¿£ > yÅ­; #4FE3 -俤 > tì; #4FE4 -ä¿¥ > chÄ“; #4FE5 -俦 > chóu; #4FE6 -俨 > yăn; #4FE8 -ä¿© > liă; #4FE9 -俪 > lì; #4FEA -ä¿« > lái; #4FEB -ä¿­ > jiăn; #4FED -ä¿® > xÄ«u; #4FEE -俯 > fÅ­; #4FEF -ä¿° > hè; #4FF0 -俱 > jù; #4FF1 -俲 > xiào; #4FF2 -俳 > pái; #4FF3 -ä¿´ > jiàn; #4FF4 -俵 > biào; #4FF5 -俶 > chù; #4FF6 -ä¿· > fèi; #4FF7 -俸 > fèng; #4FF8 -俹 > yà; #4FF9 -俺 > ăn; #4FFA -ä¿» > bèi; #4FFB -俼 > yù; #4FFC -俽 > xÄ«n; #4FFD -俾 > bÄ­; #4FFE -ä¿¿ > jiàn; #4FFF -倀 > chÄng; #5000 -å€ > chí; #5001 -倂 > bìng; #5002 -倃 > zán; #5003 -倄 > yáo; #5004 -倅 > cùi; #5005 -倆 > liă; #5006 -倇 > wăn; #5007 -倈 > lái; #5008 -倉 > cÄng; #5009 -倊 > zòng; #500A -個 > gè; #500B -倌 > guÄn; #500C -å€ > bèi; #500D -倎 > tiÄn; #500E -å€ > shÅ«; #500F -å€ > shÅ«; #5010 -們 > men; #5011 -倒 > dăo; #5012 -倓 > tán; #5013 -倔 > jué; #5014 -倕 > chúi; #5015 -倖 > xìng; #5016 -倗 > péng; #5017 -倘 > tăng; #5018 -候 > hòu; #5019 -倚 > yÄ­; #501A -倛 > qÄ«; #501B -倜 > tì; #501C -å€ > gàn; #501D -倞 > jìng; #501E -借 > jiè; #501F -倠 > sÅ«i; #5020 -倡 > chàng; #5021 -倢 > jié; #5022 -倣 > făng; #5023 -値 > zhí; #5024 -倥 > kÅng; #5025 -倦 > juàn; #5026 -倧 > zÅng; #5027 -倨 > jù; #5028 -倩 > qiàn; #5029 -倪 > ní; #502A -倫 > lún; #502B -倬 > zhÅ«o; #502C -倭 > wÄ“i; #502D -倮 > lÅ­o; #502E -倯 > sÅng; #502F -倰 > léng; #5030 -倱 > hùn; #5031 -倲 > dÅng; #5032 -倳 > zì; #5033 -倴 > bèn; #5034 -倵 > wÅ­; #5035 -倶 > jù; #5036 -倷 > nài; #5037 -倸 > căi; #5038 -倹 > jiăn; #5039 -债 > zhài; #503A -倻 > yÄ“; #503B -值 > zhí; #503C -倽 > shà; #503D -倾 > qÄ«ng; #503E -å€ > yÄ«ng; #5040 -å > chÄ“ng; #5041 -å‚ > jiÄn; #5042 -åƒ > yăn; #5043 -å„ > nuàn; #5044 -å… > zhòng; #5045 -å† > chÅ­n; #5046 -å‡ > jiă; #5047 -åˆ > jié; #5048 -å‰ > wÄ•i; #5049 -åŠ > yÅ­; #504A -å‹ > bÄ­ng; #504B -åŒ > rùo; #504C -å > tí; #504D -åŽ > wÄ“i; #504E -å > piÄn; #504F -å > yàn; #5050 -å‘ > fÄ“ng; #5051 -å’ > tăng; #5052 -å“ > wò; #5053 -å” > è; #5054 -å• > xié; #5055 -å– > chÄ•; #5056 -å— > shÄ•ng; #5057 -å˜ > kăn; #5058 -å™ > dì; #5059 -åš > zùo; #505A -å› > chÄ; #505B -åœ > tíng; #505C -å > bèi; #505D -åž > yè; #505E -åŸ > huáng; #505F -å  > yăo; #5060 -å¡ > zhàn; #5061 -å¢ > chÅu; #5062 -å£ > yÄn; #5063 -å¤ > yÅu; #5064 -å¥ > jiàn; #5065 -å¦ > xÅ«; #5066 -å§ > zhÄ; #5067 -å¨ > cÄ«; #5068 -å© > fù; #5069 -åª > bÄ«; #506A -å« > zhì; #506B -å¬ > zÅng; #506C -å­ > miăn; #506D -å® > jí; #506E -å¯ > yÄ­; #506F -å° > xiè; #5070 -å± > xún; #5071 -å² > sÄ«; #5072 -å³ > duÄn; #5073 -å´ > cè; #5074 -åµ > zhÄ“n; #5075 -å¶ > Åu; #5076 -å· > tÅu; #5077 -å¸ > tÅu; #5078 -å¹ > bèi; #5079 -åº > zá; #507A -å» > lÇš; #507B -å¼ > jié; #507C -å½ > wÄ•i; #507D -å¾ > fèn; #507E -å¿ > cháng; #507F -å‚€ > gÅ«i; #5080 -å‚ > sÅu; #5081 -å‚‚ > zhì; #5082 -傃 > sù; #5083 -å‚„ > xiÄ; #5084 -å‚… > fù; #5085 -傆 > yuàn; #5086 -傇 > rÅng; #5087 -傈 > lì; #5088 -傉 > rù; #5089 -å‚Š > yÅ­n; #508A -å‚‹ > gòu; #508B -å‚Œ > mà; #508C -å‚ > bàng; #508D -å‚Ž > diÄn; #508E -å‚ > táng; #508F -å‚ > hào; #5090 -å‚‘ > jié; #5091 -å‚’ > xÄ«; #5092 -å‚“ > shàn; #5093 -å‚” > qiàn; #5094 -å‚• > jué; #5095 -å‚– > cÄng; #5096 -å‚— > chù; #5097 -傘 > săn; #5098 -å‚™ > bèi; #5099 -å‚š > xiào; #509A -å‚› > yÅng; #509B -å‚œ > yáo; #509C -å‚ > tàn; #509D -å‚ž > sÅ«o; #509E -å‚Ÿ > yăng; #509F -å‚  > fÄ; #50A0 -å‚¡ > bìng; #50A1 -å‚¢ > jiÄ; #50A2 -å‚£ > dăi; #50A3 -傤 > zài; #50A4 -å‚¥ > tăng; #50A5 -傧 > bìn; #50A7 -储 > chÅ­; #50A8 -å‚© > núo; #50A9 -傪 > cÄn; #50AA -å‚« > lÄ•i; #50AB -催 > cÅ«i; #50AC -å‚­ > yÅng; #50AD -å‚® > zÄo; #50AE -傯 > zÅng; #50AF -å‚° > péng; #50B0 -傱 > sÅng; #50B1 -傲 > ào; #50B2 -傳 > chuán; #50B3 -å‚´ > yÅ­; #50B4 -債 > zhài; #50B5 -傶 > còu; #50B6 -å‚· > shÄng; #50B7 -傸 > qiăng; #50B8 -傹 > jìng; #50B9 -傺 > chì; #50BA -å‚» > shă; #50BB -傼 > hàn; #50BC -傽 > zhÄng; #50BD -傾 > qÄ«ng; #50BE -å‚¿ > yàn; #50BF -僀 > dì; #50C0 -åƒ > xÄ«; #50C1 -僂 > lÇš; #50C2 -僃 > bèi; #50C3 -僄 > piào; #50C4 -僅 > jÄ­n; #50C5 -僆 > lián; #50C6 -僇 > lù; #50C7 -僈 > màn; #50C8 -僉 > qiÄn; #50C9 -僊 > xiÄn; #50CA -僋 > tàn; #50CB -僌 > yíng; #50CC -åƒ > dòng; #50CD -僎 > zhuàn; #50CE -åƒ > xiàng; #50CF -åƒ > shàn; #50D0 -僑 > qiáo; #50D1 -僒 > jÄ­ong; #50D2 -僓 > tÅ­i; #50D3 -僔 > zÅ­n; #50D4 -僕 > pú; #50D5 -僖 > xÄ«; #50D6 -僗 > láo; #50D7 -僘 > chăng; #50D8 -僙 > guÄng; #50D9 -僚 > liáo; #50DA -僛 > qÄ«; #50DB -僜 > dèng; #50DC -åƒ > chán; #50DD -僞 > wÄ•i; #50DE -僟 > jÄ«; #50DF -僠 > fÄn; #50E0 -僡 > hùi; #50E1 -僢 > chuăn; #50E2 -僣 > jiàn; #50E3 -僤 > dàn; #50E4 -僥 > jiăo; #50E5 -僦 > jìu; #50E6 -僧 > sÄ“ng; #50E7 -僨 > fèn; #50E8 -僩 > xiàn; #50E9 -僪 > jué; #50EA -僫 > è; #50EB -僬 > jiÄo; #50EC -僭 > jiàn; #50ED -僮 > tóng; #50EE -僯 > lÄ­n; #50EF -僰 > bó; #50F0 -僱 > gù; #50F1 -僳 > sù; #50F3 -僴 > xiàn; #50F4 -僵 > jiÄng; #50F5 -僶 > mÄ­n; #50F6 -僷 > yè; #50F7 -僸 > jìn; #50F8 -價 > jià; #50F9 -僺 > qiào; #50FA -僻 > pì; #50FB -僼 > fÄ“ng; #50FC -僽 > zhòu; #50FD -僾 > ài; #50FE -僿 > sài; #50FF -å„€ > yí; #5100 -å„ > jùn; #5101 -å„‚ > nóng; #5102 -儃 > chán; #5103 -å„„ > yì; #5104 -å„… > dÄng; #5105 -儆 > jÄ­ng; #5106 -儇 > xuÄn; #5107 -儈 > kuài; #5108 -儉 > jiăn; #5109 -å„Š > chù; #510A -å„‹ > dÄn; #510B -å„Œ > jiăo; #510C -å„ > shă; #510D -å„Ž > zài; #510E -å„ > bìn; #5110 -å„‘ > àn; #5111 -å„’ > rú; #5112 -å„“ > tái; #5113 -å„” > chóu; #5114 -å„• > chái; #5115 -å„– > lán; #5116 -å„— > nÄ­; #5117 -儘 > jÄ­n; #5118 -å„™ > qiàn; #5119 -å„š > méng; #511A -å„› > wÅ­; #511B -å„œ > níng; #511C -å„ > qíong; #511D -å„ž > nÄ­; #511E -å„Ÿ > cháng; #511F -å„  > liè; #5120 -å„¡ > lÄ•i; #5121 -å„¢ > lÇš; #5122 -å„£ > kuàng; #5123 -儤 > bào; #5124 -å„¥ > dú; #5125 -儦 > biÄo; #5126 -儧 > zăn; #5127 -儨 > zhí; #5128 -å„© > sì; #5129 -優 > yÅu; #512A -å„« > háo; #512B -儬 > chèn; #512C -å„­ > chèn; #512D -å„® > lì; #512E -儯 > téng; #512F -å„° > wÄ•i; #5130 -儱 > lÅng; #5131 -儲 > chÅ­; #5132 -儳 > chàn; #5133 -å„´ > ráng; #5134 -儵 > shÅ«; #5135 -儶 > hùi; #5136 -å„· > lì; #5137 -儸 > lúo; #5138 -儹 > zăn; #5139 -儺 > núo; #513A -å„» > tăng; #513B -儼 > yăn; #513C -儽 > lÄ•i; #513D -儾 > nàng; #513E -å„¿ > ér; #513F -å…€ > wù; #5140 -å… > yÅ­n; #5141 -å…‚ > zÄn; #5142 -å…ƒ > yuán; #5143 -å…„ > xÄ«ong; #5144 -å…… > chÅng; #5145 -å…† > zhào; #5146 -å…‡ > xÄ«ong; #5147 -å…ˆ > xiÄn; #5148 -å…‰ > guÄng; #5149 -å…Š > dùi; #514A -å…‹ > kè; #514B -å…Œ > dùi; #514C -å… > miăn; #514D -å…Ž > tù; #514E -å… > cháng; #514F -å… > ér; #5150 -å…‘ > dùi; #5151 -å…’ > ér; #5152 -å…“ > xÄ«n; #5153 -å…” > tù; #5154 -å…• > sì; #5155 -å…– > yăn; #5156 -å…— > yăn; #5157 -å…˜ > shÄ­; #5158 -å…™ > shí' 'kè; #5159 -å…š > dăng; #515A -å…› > qiÄn; #515B -å…œ > dÅu; #515C -å… > fÄ“n; #515D -å…ž > máo; #515E -å…Ÿ > shÄ“n; #515F -å…  > dÅu; #5160 -å…¡ > băi' 'kè; #5161 -å…¢ > jÄ«ng; #5162 -å…£ > lÄ­; #5163 -å…¤ > huáng; #5164 -å…¥ > rù; #5165 -å…¦ > wáng; #5166 -å…§ > nèi; #5167 -å…¨ > quán; #5168 -å…© > liăng; #5169 -å…ª > yú; #516A -å…« > bÄ; #516B -å…¬ > gÅng; #516C -å…­ > lìu; #516D -å…® > xÄ«; #516E -å…° > lán; #5170 -å…± > gòng; #5171 -å…² > tiÄn; #5172 -å…³ > guÄn; #5173 -å…´ > xÄ«ng; #5174 -å…µ > bÄ«ng; #5175 -å…¶ > qí; #5176 -å…· > jù; #5177 -å…¸ > diăn; #5178 -å…¹ > zÄ«; #5179 -å…» > yăng; #517B -å…¼ > jiÄn; #517C -å…½ > shòu; #517D -å…¾ > jì; #517E -å…¿ > yì; #517F -冀 > jì; #5180 -å† > chăn; #5181 -冂 > jÄ«ong; #5182 -冃 > mao; #5183 -冄 > răn; #5184 -内 > nèi; #5185 -円 > yuan; #5186 -冇 > măo; #5187 -冈 > gÄng; #5188 -冉 > răn; #5189 -冊 > cè; #518A -冋 > jÄ«ong; #518B -册 > cè; #518C -å† > zài; #518D -冎 > guă; #518E -å† > jÄ­ong; #518F -å† > mào; #5190 -冑 > zhòu; #5191 -冒 > mòu; #5192 -冓 > gòu; #5193 -冔 > xÅ­; #5194 -冕 > miăn; #5195 -冖 > mì; #5196 -冗 > rÅng; #5197 -冘 > yín; #5198 -写 > xiÄ•; #5199 -冚 > kăn; #519A -军 > jÅ«n; #519B -农 > nóng; #519C -å† > yí; #519D -冞 > mí; #519E -冟 > shì; #519F -冠 > guÄn; #51A0 -冡 > méng; #51A1 -冢 > zhÅng; #51A2 -冣 > jù; #51A3 -冤 > yuÄn; #51A4 -冥 > míng; #51A5 -冦 > kòu; #51A6 -冨 > fù; #51A8 -冩 > xiÄ•; #51A9 -冪 > mì; #51AA -冫 > bÄ«ng; #51AB -冬 > dÅng; #51AC -冭 > tái; #51AD -冮 > gÄng; #51AE -冯 > féng; #51AF -冰 > bÄ«ng; #51B0 -冱 > hù; #51B1 -冲 > chÅng; #51B2 -决 > jué; #51B3 -冴 > hù; #51B4 -况 > kuàng; #51B5 -冶 > yÄ•; #51B6 -冷 > lÄ•ng; #51B7 -冸 > pàn; #51B8 -冹 > fú; #51B9 -冺 > mÄ­n; #51BA -冻 > dòng; #51BB -冼 > xiăn; #51BC -冽 > liè; #51BD -冾 > xiá; #51BE -冿 > jiÄn; #51BF -净 > jìng; #51C0 -å‡ > shù; #51C1 -凂 > mÄ•i; #51C2 -凃 > tú; #51C3 -凄 > qÄ«; #51C4 -凅 > gù; #51C5 -准 > zhÅ­n; #51C6 -凇 > sòng; #51C7 -凈 > jìng; #51C8 -凉 > liáng; #51C9 -凊 > qìng; #51CA -凋 > diÄo; #51CB -凌 > líng; #51CC -å‡ > dòng; #51CD -凎 > gàn; #51CE -å‡ > jiăn; #51CF -å‡ > yÄ«n; #51D0 -凑 > còu; #51D1 -凒 > yí; #51D2 -凓 > lì; #51D3 -凔 > cÄng; #51D4 -凕 > mÄ­ng; #51D5 -凖 > zhuÄ•n; #51D6 -凗 > cúi; #51D7 -凘 > sÄ«; #51D8 -凙 > dúo; #51D9 -凚 > jìn; #51DA -凛 > lÄ­n; #51DB -凜 > lÄ­n; #51DC -å‡ > níng; #51DD -凞 > xÄ«; #51DE -凟 > dú; #51DF -几 > jÄ«; #51E0 -凡 > fán; #51E1 -凢 > fán; #51E2 -凣 > fán; #51E3 -凤 > fèng; #51E4 -凥 > jÅ«; #51E5 -処 > chÅ­; #51E6 -凨 > fÄ“ng; #51E8 -凫 > fú; #51EB -凬 > fÄ“ng; #51EC -凭 > píng; #51ED -凮 > fÄ“ng; #51EE -凯 > kăi; #51EF -凰 > huáng; #51F0 -凱 > kăi; #51F1 -凲 > gÄn; #51F2 -凳 > dèng; #51F3 -凴 > píng; #51F4 -凵 > qÅ«; #51F5 -凶 > xÄ«ong; #51F6 -凷 > kuài; #51F7 -凸 > tÅ«; #51F8 -凹 > Äo; #51F9 -出 > chÅ«; #51FA -击 > jí; #51FB -凼 > dàng; #51FC -函 > hán; #51FD -凾 > hán; #51FE -凿 > záo; #51FF -刀 > dÄo; #5200 -åˆ > diÄo; #5201 -刂 > dÄo; #5202 -刃 > rèn; #5203 -刄 > rèn; #5204 -刅 > chuÄng; #5205 -分 > fÄ“n; #5206 -切 > qiÄ“; #5207 -刈 > yì; #5208 -刉 > jÄ«; #5209 -刊 > kÄn; #520A -刋 > qiàn; #520B -刌 > cÅ­n; #520C -åˆ > chú; #520D -刎 > wÄ•n; #520E -åˆ > jÄ«; #520F -åˆ > dăn; #5210 -刑 > xíng; #5211 -划 > huá; #5212 -刓 > wán; #5213 -刔 > jué; #5214 -刕 > lí; #5215 -刖 > yuè; #5216 -列 > liè; #5217 -刘 > líu; #5218 -则 > zé; #5219 -刚 > gÄng; #521A -创 > chuàng; #521B -刜 > fú; #521C -åˆ > chÅ«; #521D -刞 > qù; #521E -刟 > jÅ«; #521F -删 > shÄn; #5220 -刡 > mÄ­n; #5221 -刢 > líng; #5222 -刣 > zhÅng; #5223 -判 > pàn; #5224 -別 > bié; #5225 -刦 > jié; #5226 -刧 > jié; #5227 -刨 > bào; #5228 -利 > lì; #5229 -刪 > shÄn; #522A -别 > bié; #522B -刬 > chăn; #522C -刭 > jÄ­ng; #522D -刮 > guÄ; #522E -刯 > gÄ“n; #522F -到 > dào; #5230 -刱 > chuàng; #5231 -刲 > kÅ«i; #5232 -刳 > kÅ«; #5233 -刴 > dùo; #5234 -刵 > èr; #5235 -制 > zhì; #5236 -刷 > shuÄ; #5237 -券 > quàn; #5238 -刹 > chà; #5239 -刺 > cì; #523A -刻 > kè; #523B -刼 > jié; #523C -刽 > gùi; #523D -刾 > cì; #523E -刿 > gùi; #523F -剀 > kăi; #5240 -å‰ > dùo; #5241 -剂 > jì; #5242 -剃 > tì; #5243 -剄 > jÄ­ng; #5244 -剅 > lóu; #5245 -剆 > gÄ“n; #5246 -則 > zé; #5247 -剈 > yuÄn; #5248 -剉 > cùo; #5249 -削 > xuÄ“; #524A -剋 > kè; #524B -剌 > là; #524C -å‰ > qián; #524D -剎 > chà; #524E -å‰ > chuàng; #524F -å‰ > guă; #5250 -剑 > jiàn; #5251 -剒 > cùo; #5252 -剓 > lí; #5253 -剔 > tÄ«; #5254 -剕 > fèi; #5255 -剖 > pÅu; #5256 -剗 > chăn; #5257 -剘 > qí; #5258 -剙 > chuàng; #5259 -剚 > zì; #525A -剛 > gÄng; #525B -剜 > wÄn; #525C -å‰ > bÅ; #525D -剞 > jÄ«; #525E -剟 > dÅ«o; #525F -剠 > qíng; #5260 -剡 > yăn; #5261 -剢 > zhúo; #5262 -剣 > jiàn; #5263 -剤 > jì; #5264 -剥 > bÅ; #5265 -剦 > yÄn; #5266 -剧 > jù; #5267 -剨 > hùo; #5268 -剩 > shèng; #5269 -剪 > jiăn; #526A -剫 > dúo; #526B -剬 > duÄn; #526C -剭 > wÅ«; #526D -剮 > guă; #526E -副 > fù; #526F -剰 > shèng; #5270 -剱 > jiàn; #5271 -割 > gÄ“; #5272 -剳 > zhÄ; #5273 -剴 > kăi; #5274 -創 > chuàng; #5275 -剶 > juÄn; #5276 -剷 > chăn; #5277 -剸 > tuán; #5278 -剹 > lù; #5279 -剺 > lí; #527A -剻 > fóu; #527B -剼 > shÄn; #527C -剽 > piào; #527D -剾 > kÅu; #527E -剿 > jiăo; #527F -劀 > guÄ; #5280 -åŠ > qiÄo; #5281 -劂 > jué; #5282 -劃 > huà; #5283 -劄 > zhá; #5284 -劅 > zhùo; #5285 -劆 > lián; #5286 -劇 > jù; #5287 -劈 > pÄ«; #5288 -劉 > líu; #5289 -劊 > gùi; #528A -劋 > jiăo; #528B -劌 > gùi; #528C -åŠ > jiàn; #528D -劎 > jiàn; #528E -åŠ > tÄng; #528F -åŠ > hÅ«o; #5290 -劑 > jì; #5291 -劒 > jiàn; #5292 -劓 > yì; #5293 -劔 > jiàn; #5294 -劕 > zhí; #5295 -劖 > chán; #5296 -劗 > cuán; #5297 -劘 > mó; #5298 -劙 > lí; #5299 -劚 > zhú; #529A -力 > lì; #529B -劜 > yÄ; #529C -åŠ > quàn; #529D -办 > bàn; #529E -功 > gÅng; #529F -加 > jiÄ; #52A0 -务 > wù; #52A1 -劢 > mài; #52A2 -劣 > liè; #52A3 -劤 > jìn; #52A4 -劥 > kÄ“ng; #52A5 -劦 > xié; #52A6 -劧 > zhÄ­; #52A7 -动 > dòng; #52A8 -助 > zhù; #52A9 -努 > nÅ­; #52AA -劫 > jié; #52AB -劬 > qú; #52AC -劭 > shào; #52AD -劮 > yì; #52AE -劯 > zhÅ«; #52AF -劰 > miăo; #52B0 -励 > lì; #52B1 -劲 > jìng; #52B2 -劳 > láo; #52B3 -労 > láo; #52B4 -劵 > juàn; #52B5 -劶 > kÅu; #52B6 -劷 > yáng; #52B7 -劸 > wÄ; #52B8 -効 > xiào; #52B9 -劺 > móu; #52BA -劻 > kuÄng; #52BB -劼 > jié; #52BC -劽 > liè; #52BD -劾 > hé; #52BE -势 > shì; #52BF -å‹€ > kè; #52C0 -å‹ > jìng; #52C1 -å‹‚ > háo; #52C2 -勃 > bó; #52C3 -å‹„ > mÄ­n; #52C4 -å‹… > chì; #52C5 -勆 > láng; #52C6 -勇 > yÅng; #52C7 -勈 > yÅng; #52C8 -勉 > miăn; #52C9 -å‹Š > kè; #52CA -å‹‹ > xÅ«n; #52CB -å‹Œ > juàn; #52CC -å‹ > qíng; #52CD -å‹Ž > lù; #52CE -å‹ > pÅu; #52CF -å‹ > mÄ•ng; #52D0 -å‹‘ > lài; #52D1 -å‹’ > lè; #52D2 -å‹“ > kài; #52D3 -å‹” > miăn; #52D4 -å‹• > dòng; #52D5 -å‹– > xù; #52D6 -å‹— > xù; #52D7 -勘 > kÄn; #52D8 -å‹™ > wù; #52D9 -å‹š > yì; #52DA -å‹› > xÅ«n; #52DB -å‹œ > wÄ•ng; #52DC -å‹ > shèng; #52DD -å‹ž > láo; #52DE -å‹Ÿ > mù; #52DF -å‹  > lù; #52E0 -å‹¡ > piào; #52E1 -å‹¢ > shì; #52E2 -å‹£ > jÄ«; #52E3 -勤 > qín; #52E4 -å‹¥ > qiăng; #52E5 -勦 > jiăo; #52E6 -勧 > quàn; #52E7 -勨 > yăng; #52E8 -å‹© > yì; #52E9 -勪 > jué; #52EA -å‹« > fán; #52EB -勬 > juàn; #52EC -å‹­ > tóng; #52ED -å‹® > jù; #52EE -勯 > dÄn; #52EF -å‹° > xié; #52F0 -勱 > mài; #52F1 -勲 > xÅ«n; #52F2 -勳 > xÅ«n; #52F3 -å‹´ > lÇœ; #52F4 -勵 > lì; #52F5 -勶 > chè; #52F6 -å‹· > ráng; #52F7 -勸 > quàn; #52F8 -勹 > bÄo; #52F9 -勺 > sháo; #52FA -å‹» > yún; #52FB -勼 > jÄ«u; #52FC -勽 > bào; #52FD -勾 > gÅu; #52FE -å‹¿ > wù; #52FF -匀 > yún; #5300 -匃 > gài; #5303 -匄 > gài; #5304 -包 > bÄo; #5305 -匆 > cÅng; #5306 -匈 > xÄ«ong; #5308 -匉 > pÄ“ng; #5309 -匊 > jú; #530A -匋 > táo; #530B -匌 > gé; #530C -åŒ > pú; #530D -匎 > àn; #530E -åŒ > páo; #530F -åŒ > fú; #5310 -匑 > gÅng; #5311 -匒 > dá; #5312 -匓 > jìu; #5313 -匔 > qÄ«ong; #5314 -匕 > bÄ­; #5315 -化 > huà; #5316 -北 > bÄ•i; #5317 -匘 > năo; #5318 -匙 > chí; #5319 -匚 > fÄng; #531A -匛 > jìu; #531B -匜 > yí; #531C -åŒ > zÄ; #531D -匞 > jiàng; #531E -匟 > kàng; #531F -匠 > jiàng; #5320 -匡 > kuÄng; #5321 -匢 > hÅ«; #5322 -匣 > xiá; #5323 -匤 > qÅ«; #5324 -匥 > biàn; #5325 -匦 > gÅ­i; #5326 -匧 > qiè; #5327 -匨 > zÄng; #5328 -匩 > kuÄng; #5329 -匪 > fÄ•i; #532A -匫 > hÅ«; #532B -匬 > tóu; #532C -匭 > gÅ­i; #532D -匮 > gùi; #532E -匯 > hùi; #532F -匰 > dÄn; #5330 -匱 > gùi; #5331 -匲 > lián; #5332 -匳 > lián; #5333 -匴 > suăn; #5334 -匵 > dú; #5335 -匶 > jìu; #5336 -匷 > qú; #5337 -匸 > xÄ­; #5338 -匹 > pÄ­; #5339 -区 > qÅ«; #533A -医 > yì; #533B -匼 > qià; #533C -匽 > yăn; #533D -匾 > biăn; #533E -匿 > nì; #533F -å€ > qÅ«; #5340 -å > shí; #5341 -å‚ > xìn; #5342 -åƒ > qiÄn; #5343 -å„ > niàn; #5344 -å… > sà; #5345 -å† > zú; #5346 -å‡ > shÄ“ng; #5347 -åˆ > wÅ­; #5348 -å‰ > hùi; #5349 -åŠ > bàn; #534A -å‹ > shì; #534B -åŒ > xì; #534C -å > wàn; #534D -åŽ > huá; #534E -å > xié; #534F -å > wàn; #5350 -å‘ > bÄ“i; #5351 -å’ > zú; #5352 -å“ > zhÅ«o; #5353 -å” > xié; #5354 -å• > dÄn; #5355 -å– > mài; #5356 -å— > nán; #5357 -å˜ > dÄn; #5358 -å™ > jí; #5359 -åš > bó; #535A -å› > shuài; #535B -åœ > bÅ­; #535C -å > kuàng; #535D -åž > biàn; #535E -åŸ > bÅ­; #535F -å  > zhÄn; #5360 -å¡ > qiă; #5361 -å¢ > lú; #5362 -å£ > yÅu; #5363 -å¤ > lÅ­; #5364 -å¥ > xÄ«; #5365 -å¦ > guà; #5366 -å§ > wò; #5367 -å¨ > xiè; #5368 -å© > jié; #5369 -åª > jié; #536A -å« > wèi; #536B -å¬ > áng; #536C -å­ > qíong; #536D -å® > zhÄ«; #536E -å¯ > măo; #536F -å° > yìn; #5370 -å± > wÄ“i; #5371 -å² > shào; #5372 -å³ > jí; #5373 -å´ > què; #5374 -åµ > luăn; #5375 -å¶ > shì; #5376 -å· > juàn; #5377 -å¸ > xiè; #5378 -å¹ > xù; #5379 -åº > jÄ­n; #537A -å» > què; #537B -å¼ > wù; #537C -å½ > jí; #537D -å¾ > è; #537E -å¿ > qÄ«ng; #537F -厀 > xÄ«; #5380 -厂 > hàn; #5382 -厃 > zhÄn; #5383 -厄 > è; #5384 -厅 > tÄ«ng; #5385 -历 > lì; #5386 -厇 > zhé; #5387 -厈 > hăn; #5388 -厉 > lì; #5389 -厊 > yă; #538A -压 > yÄ; #538B -厌 > yàn; #538C -åŽ > shè; #538D -厎 > zhÄ­; #538E -åŽ > zhă; #538F -åŽ > páng; #5390 -厒 > hé; #5392 -厓 > yá; #5393 -厔 > zhì; #5394 -厕 > cè; #5395 -厖 > páng; #5396 -厗 > tí; #5397 -厘 > lí; #5398 -厙 > shè; #5399 -厚 > hòu; #539A -厛 > tÄ«ng; #539B -厜 > zÅ«i; #539C -åŽ > cùo; #539D -厞 > fèi; #539E -原 > yuán; #539F -厠 > cè; #53A0 -厡 > yuán; #53A1 -厢 > xiÄng; #53A2 -厣 > yăn; #53A3 -厤 > lì; #53A4 -厥 > jué; #53A5 -厦 > shà; #53A6 -厧 > diÄn; #53A7 -厨 > chú; #53A8 -厩 > jìu; #53A9 -厪 > qín; #53AA -厫 > áo; #53AB -厬 > gÅ­i; #53AC -厭 > yàn; #53AD -厮 > sÄ«; #53AE -厯 > lì; #53AF -厰 > chăng; #53B0 -厱 > lán; #53B1 -厲 > lì; #53B2 -厳 > yán; #53B3 -厴 > yăn; #53B4 -厵 > yuán; #53B5 -厶 > sÄ«; #53B6 -厷 > gÅng; #53B7 -厸 > lín; #53B8 -厹 > qíu; #53B9 -厺 > qù; #53BA -去 > qù; #53BB -厽 > lÄ•i; #53BD -厾 > dÅ«; #53BE -县 > xiàn; #53BF -å€ > zhuÄn; #53C0 -å > sÄn; #53C1 -å‚ > cÄn; #53C2 -åƒ > cÄn; #53C3 -å„ > cÄn; #53C4 -å… > cÄn; #53C5 -å† > ài; #53C6 -å‡ > dài; #53C7 -åˆ > yòu; #53C8 -å‰ > cha; #53C9 -åŠ > jí; #53CA -å‹ > yÅu; #53CB -åŒ > shuÄng; #53CC -å > făn; #53CD -åŽ > shÅu; #53CE -å > guài; #53CF -å > bá; #53D0 -å‘ > fÄ; #53D1 -å’ > rùo; #53D2 -å“ > shì; #53D3 -å” > shÅ«; #53D4 -å• > zhúo; #53D5 -å– > qÅ«; #53D6 -å— > shòu; #53D7 -å˜ > biàn; #53D8 -å™ > xù; #53D9 -åš > jiă; #53DA -å› > pàn; #53DB -åœ > sÅu; #53DC -å > gào; #53DD -åž > wèi; #53DE -åŸ > sÅu; #53DF -å  > dié; #53E0 -å¡ > rùi; #53E1 -å¢ > cóng; #53E2 -å£ > kÅu; #53E3 -å¤ > gÅ­; #53E4 -å¥ > jù; #53E5 -å¦ > lìng; #53E6 -å§ > guă; #53E7 -å¨ > tÄo; #53E8 -å© > kòu; #53E9 -åª > zhÄ­; #53EA -å« > jiào; #53EB -å¬ > zhào; #53EC -å­ > bÄ; #53ED -å® > dÄ«ng; #53EE -å¯ > kÄ•; #53EF -å° > tái; #53F0 -å± > chì; #53F1 -å² > shÄ­; #53F2 -å³ > yòu; #53F3 -å´ > qíu; #53F4 -åµ > pÅ; #53F5 -å¶ > xié; #53F6 -å· > hào; #53F7 -å¸ > sÄ«; #53F8 -å¹ > tàn; #53F9 -åº > chÄ­; #53FA -å» > lè; #53FB -å¼ > diÄo; #53FC -å½ > jÄ«; #53FD -å¿ > hÅng; #53FF -å€ > miÄ“; #5400 -å > xÅ«; #5401 -å‚ > máng; #5402 -åƒ > chÄ«; #5403 -å„ > gè; #5404 -å… > xuÄn; #5405 -å† > yÄo; #5406 -å‡ > zÄ­; #5407 -åˆ > hé; #5408 -å‰ > jí; #5409 -åŠ > diào; #540A -å‹ > cùn; #540B -åŒ > tóng; #540C -å > míng; #540D -åŽ > hòu; #540E -å > lì; #540F -å > tÅ­; #5410 -å‘ > xiàng; #5411 -å’ > zhà; #5412 -å“ > xià; #5413 -å” > yÄ•; #5414 -å• > lÇš; #5415 -å– > Ä; #5416 -å— > ma; #5417 -å˜ > Åu; #5418 -å™ > xuÄ“; #5419 -åš > yÄ«; #541A -å› > jÅ«n; #541B -åœ > chÅu; #541C -å > lìn; #541D -åž > tÅ«n; #541E -åŸ > yín; #541F -å  > fèi; #5420 -å¡ > bÄ­; #5421 -å¢ > qìn; #5422 -å£ > qìn; #5423 -å¤ > jiè; #5424 -å¥ > bù; #5425 -å¦ > fÅu; #5426 -å§ > ba; #5427 -å¨ > dÅ«n; #5428 -å© > fÄ“n; #5429 -åª > é; #542A -å« > hán; #542B -å¬ > tÄ«ng; #542C -å­ > háng; #542D -å® > shÅ­n; #542E -å¯ > qÄ­; #542F -å° > hóng; #5430 -å± > zhÄ«; #5431 -å² > shÄ•n; #5432 -å³ > wú; #5433 -å´ > wú; #5434 -åµ > chăo; #5435 -å¶ > nè; #5436 -å· > xuè; #5437 -å¸ > xÄ«; #5438 -å¹ > chÅ«i; #5439 -åº > dÅu; #543A -å» > wÄ•n; #543B -å¼ > hÅu; #543C -å½ > óu; #543D -å¾ > wú; #543E -å¿ > gào; #543F -å‘€ > yÄ; #5440 -å‘ > jùn; #5441 -å‘‚ > lÇš; #5442 -呃 > è; #5443 -å‘„ > gé; #5444 -å‘… > méi; #5445 -呆 > ái; #5446 -呇 > qÄ­; #5447 -呈 > chéng; #5448 -呉 > wú; #5449 -å‘Š > gào; #544A -å‘‹ > fÅ«; #544B -å‘Œ > jiào; #544C -å‘ > hÅng; #544D -å‘Ž > chÄ­; #544E -å‘ > shÄ“ng; #544F -å‘ > nè; #5450 -å‘‘ > tÅ«n; #5451 -å‘’ > fÅ­; #5452 -å‘“ > yì; #5453 -å‘” > dÄi; #5454 -å‘• > Åu; #5455 -å‘– > lì; #5456 -å‘— > bài; #5457 -员 > yuán; #5458 -å‘™ > kuÄi; #5459 -å‘› > qiÄng; #545B -å‘œ > wÅ«; #545C -å‘ > è; #545D -å‘ž > shÄ«; #545E -å‘Ÿ > quăn; #545F -å‘  > pÄ“n; #5460 -å‘¡ > wÄ•n; #5461 -å‘¢ > ní; #5462 -å‘£ > mÌ; #5463 -呤 > lÄ­ng; #5464 -å‘¥ > răn; #5465 -呦 > yÅu; #5466 -呧 > dÄ­; #5467 -周 > zhÅu; #5468 -å‘© > shì; #5469 -呪 > zhòu; #546A -å‘« > tiÄ“; #546B -呬 > xì; #546C -å‘­ > yì; #546D -å‘® > qì; #546E -呯 > píng; #546F -å‘° > zÄ­; #5470 -呱 > gÅ«; #5471 -呲 > zÄ«; #5472 -味 > wèi; #5473 -å‘´ > xÅ«; #5474 -呵 > hÄ“; #5475 -呶 > náo; #5476 -å‘· > xiÄ; #5477 -呸 > pÄ“i; #5478 -呹 > yì; #5479 -呺 > xiÄo; #547A -å‘» > shÄ“n; #547B -呼 > hÅ«; #547C -命 > mìng; #547D -呾 > dá; #547E -å‘¿ > qÅ«; #547F -å’€ > jÅ­; #5480 -å’ > gèm; #5481 -å’‚ > zÄ; #5482 -å’ƒ > tÅ«o; #5483 -å’„ > dÅ«o; #5484 -å’… > pòu; #5485 -å’† > páo; #5486 -å’‡ > bì; #5487 -å’ˆ > fú; #5488 -å’‰ > yÄng; #5489 -å’Š > hé; #548A -å’‹ > zhà; #548B -å’Œ > hé; #548C -å’ > hÄi; #548D -å’Ž > jìu; #548E -å’ > yÅng; #548F -å’ > fù; #5490 -å’‘ > què; #5491 -å’’ > zhòu; #5492 -å’“ > wă; #5493 -å’” > kă; #5494 -å’• > gÅ«; #5495 -å’– > kÄ; #5496 -å’— > zÅ­o; #5497 -å’˜ > bù; #5498 -å’™ > lóng; #5499 -å’š > dÅng; #549A -å’› > níng; #549B -å’ > sÄ«; #549D -å’ž > xiàn; #549E -å’Ÿ > hùo; #549F -å’  > qì; #54A0 -å’¡ > èr; #54A1 -å’¢ > è; #54A2 -å’£ > guÄng; #54A3 -å’¤ > zhà; #54A4 -å’¥ > xì; #54A5 -å’¦ > yí; #54A6 -å’§ > liÄ•; #54A7 -å’¨ > zÄ«; #54A8 -å’© > miÄ“; #54A9 -å’ª > mÄ«; #54AA -å’« > zhÄ­; #54AB -å’¬ > yăo; #54AC -å’­ > jÄ«; #54AD -å’® > zhòu; #54AE -å’¯ > gÄ“; #54AF -å’° > shuài; #54B0 -å’± > zán; #54B1 -å’² > xiào; #54B2 -å’³ > ké; #54B3 -å’´ > hÅ«i; #54B4 -å’µ > kuÄ; #54B5 -å’¶ > huài; #54B6 -å’· > táo; #54B7 -å’¸ > xián; #54B8 -å’¹ > è; #54B9 -å’º > xuÄn; #54BA -å’» > xÄ«u; #54BB -å’¼ > wÄi; #54BC -å’½ > yÄn; #54BD -å’¾ > lăo; #54BE -å’¿ > yÄ«; #54BF -å“€ > Äi; #54C0 -å“ > pÄ­n; #54C1 -å“‚ > shÄ•n; #54C2 -哃 > tóng; #54C3 -å“„ > hÅng; #54C4 -å“… > xÄ«ong; #54C5 -哆 > chÄ­; #54C6 -哇 > wÄ; #54C7 -哈 > hÄ; #54C8 -哉 > zÄi; #54C9 -å“Š > yù; #54CA -å“‹ > dì; #54CB -å“Œ > pài; #54CC -å“ > xiăng; #54CD -å“Ž > Äi; #54CE -å“ > hÄ•n; #54CF -å“ > kuÄng; #54D0 -å“‘ > yă; #54D1 -å“’ > dÄ; #54D2 -å““ > xiÄo; #54D3 -å“” > bì; #54D4 -å“• > yuÄ•; #54D5 -å“— > huÄ; #54D7 -å“™ > kuài; #54D9 -å“š > dÅ­o; #54DA -å“œ > jì; #54DC -å“ > nóng; #54DD -å“ž > mÅu; #54DE -å“Ÿ > yo; #54DF -å“  > hào; #54E0 -å“¡ > yuán; #54E1 -å“¢ > lòng; #54E2 -å“£ > pÅu; #54E3 -哤 > máng; #54E4 -å“¥ > gÄ“; #54E5 -哦 > é; #54E6 -哧 > chÄ«; #54E7 -哨 > shào; #54E8 -å“© > lÄ«; #54E9 -哪 > nă; #54EA -å“« > zú; #54EB -哬 > hé; #54EC -å“­ > kÅ«; #54ED -å“® > xiÄo; #54EE -哯 > xiàn; #54EF -å“° > láo; #54F0 -哱 > bÅ; #54F1 -哲 > zhé; #54F2 -哳 > zhÄ; #54F3 -å“´ > liàng; #54F4 -哵 > bÄ; #54F5 -哶 > miÄ“; #54F6 -å“· > lè; #54F7 -哸 > sÅ«i; #54F8 -哹 > fóu; #54F9 -哺 > bÅ­; #54FA -å“» > hàn; #54FB -哼 > hÄ“ng; #54FC -哽 > gÄ•ng; #54FD -哾 > shÅ«o; #54FE -å“¿ > gÄ•; #54FF -唀 > yÅu; #5500 -å” > yàn; #5501 -唂 > gÅ­; #5502 -唃 > gÅ­; #5503 -唄 > bài; #5504 -å”… > hÄn; #5505 -唆 > sÅ«o; #5506 -唇 > chún; #5507 -唈 > yì; #5508 -唉 > Äi; #5509 -唊 > jiá; #550A -唋 > tÅ­; #550B -唌 > xián; #550C -å” > huăn; #550D -唎 > lÄ«; #550E -å” > xÄ«; #550F -å” > táng; #5510 -唑 > zùo; #5511 -å”’ > qíu; #5512 -唓 > chÄ“; #5513 -å”” > wú; #5514 -唕 > zào; #5515 -å”– > yă; #5516 -å”— > dÅu; #5517 -唘 > qÄ­; #5518 -å”™ > dí; #5519 -唚 > qìn; #551A -å”› > mà; #551B -å” > hÅng; #551D -唞 > dÅu; #551E -å”  > láo; #5520 -唡 > liăng; #5521 -唢 > sÅ­o; #5522 -唣 > zào; #5523 -唤 > huàn; #5524 -唦 > shÄ; #5526 -唧 > jÄ«; #5527 -唨 > zÅ­o; #5528 -唩 > wÅ; #5529 -唪 > fÄ•ng; #552A -唫 > yín; #552B -唬 > hÅ­; #552C -å”­ > qÄ«; #552D -å”® > shòu; #552E -唯 > wéi; #552F -å”° > shuÄ; #5530 -å”± > chàng; #5531 -唲 > ér; #5532 -唳 > lì; #5533 -å”´ > qiàng; #5534 -唵 > ăn; #5535 -唶 > jiè; #5536 -å”· > yÅ; #5537 -唸 > niàn; #5538 -唹 > yÅ«; #5539 -唺 > tiăn; #553A -å”» > lăi; #553B -唼 > shà; #553C -唽 > xÄ«; #553D -唾 > tùo; #553E -唿 > hÅ«; #553F -å•€ > ái; #5540 -å• > zhÅu; #5541 -å•‚ > nòu; #5542 -啃 > kÄ•n; #5543 -å•„ > zhúo; #5544 -å•… > zhúo; #5545 -商 > shÄng; #5546 -啇 > dí; #5547 -啈 > hèng; #5548 -啉 > lán; #5549 -å•Š > a; #554A -å•‹ > xiÄo; #554B -å•Œ > xiÄng; #554C -å• > tÅ«n; #554D -å•Ž > wÅ­; #554E -å• > wèn; #554F -å• > cùi; #5550 -å•‘ > shà; #5551 -å•’ > hÅ«; #5552 -å•“ > qÄ­; #5553 -å•” > qÄ­; #5554 -å•• > táo; #5555 -å•– > dàn; #5556 -å•— > dàn; #5557 -啘 > yè; #5558 -å•™ > zÄ­; #5559 -å•š > bÄ­; #555A -å•› > cùi; #555B -å•œ > chùo; #555C -å• > hé; #555D -å•ž > yă; #555E -å•Ÿ > qÄ­; #555F -å•  > zhé; #5560 -å•¡ > pÄ“i; #5561 -å•¢ > liăng; #5562 -å•£ > xián; #5563 -啤 > pí; #5564 -å•¥ > shà; #5565 -啦 > la; #5566 -啧 > zé; #5567 -啨 > qÄ«ng; #5568 -å•© > guà; #5569 -啪 > pÄ; #556A -å•« > zhÄ•; #556B -啬 > sè; #556C -å•­ > zhuàn; #556D -å•® > niè; #556E -啯 > guo; #556F -å•° > lÅ«o; #5570 -啱 > yÄn; #5571 -啲 > dì; #5572 -啳 > quán; #5573 -å•´ > tÄn; #5574 -啵 > bo; #5575 -啶 > dìng; #5576 -å•· > lÄng; #5577 -啸 > xiào; #5578 -啺 > táng; #557A -å•» > chì; #557B -啼 > tí; #557C -啽 > án; #557D -啾 > jÄ«u; #557E -å•¿ > dàn; #557F -å–€ > kè; #5580 -å– > yóng; #5581 -å–‚ > wèi; #5582 -å–ƒ > nán; #5583 -å–„ > shàn; #5584 -å–… > yù; #5585 -å–† > zhé; #5586 -å–‡ > lă; #5587 -å–ˆ > jiÄ“; #5588 -å–‰ > hóu; #5589 -å–Š > hăn; #558A -å–‹ > dié; #558B -å–Œ > zhÅu; #558C -å– > chái; #558D -å–Ž > wÄi; #558E -å– > rÄ•; #558F -å– > yù; #5590 -å–‘ > yÄ«n; #5591 -å–’ > zán; #5592 -å–“ > yÄo; #5593 -å–” > wÅ; #5594 -å–• > miăn; #5595 -å–– > hú; #5596 -å–— > yÅ­n; #5597 -å–˜ > chuăn; #5598 -å–™ > hùi; #5599 -å–š > huàn; #559A -å–› > huàn; #559B -å–œ > xÄ­; #559C -å– > hÄ“; #559D -å–ž > jÄ«; #559E -å–Ÿ > kùi; #559F -å–  > zhÅng; #55A0 -å–¡ > wÄ•i; #55A1 -å–¢ > shà; #55A2 -å–£ > xÅ­; #55A3 -å–¤ > huáng; #55A4 -å–¥ > dù; #55A5 -å–¦ > niè; #55A6 -å–§ > 1xuÄn; #55A7 -å–¨ > liàng; #55A8 -å–© > yù; #55A9 -å–ª > sÄng; #55AA -å–« > chÄ«; #55AB -å–¬ > qiáo; #55AC -å–­ > yàn; #55AD -å–® > dÄn; #55AE -å–¯ > pÄ“n; #55AF -å–° > cÄn; #55B0 -å–± > lí; #55B1 -å–² > yo; #55B2 -å–³ > zhÄ; #55B3 -å–´ > wÄ“i; #55B4 -å–µ > miÄo; #55B5 -å–¶ > yíng; #55B6 -å–· > pÄ“n; #55B7 -å–¹ > kúi; #55B9 -å–º > xì; #55BA -å–» > yù; #55BB -å–¼ > jié; #55BC -å–½ > lou; #55BD -å–¾ > kù; #55BE -å–¿ > sào; #55BF -å—€ > hùo; #55C0 -å— > tí; #55C1 -å—‚ > yáo; #55C2 -å—ƒ > hè; #55C3 -å—„ > á; #55C4 -å—… > xìu; #55C5 -å—† > qiÄng; #55C6 -å—‡ > sè; #55C7 -å—ˆ > yÅng; #55C8 -å—‰ > sù; #55C9 -å—Š > hÅng; #55CA -å—‹ > xié; #55CB -å—Œ > yì; #55CC -å— > sÅ«o; #55CD -å—Ž > ma; #55CE -å— > chÄ; #55CF -å— > hài; #55D0 -å—‘ > kè; #55D1 -å—’ > tà; #55D2 -å—“ > săng; #55D3 -å—” > tián; #55D4 -å—• > rù; #55D5 -å—– > sÅu; #55D6 -å—— > wÄ; #55D7 -å—˜ > jÄ«; #55D8 -å—™ > păng; #55D9 -å—š > wÅ«; #55DA -å—› > xián; #55DB -å—œ > shì; #55DC -å— > gé; #55DD -å—ž > zÄ«; #55DE -å—Ÿ > jiÄ“; #55DF -å—  > lùo; #55E0 -å—¡ > wÄ“ng; #55E1 -å—¢ > wà; #55E2 -å—£ > sì; #55E3 -å—¤ > chÄ«; #55E4 -å—¥ > háo; #55E5 -å—¦ > sÅ«o; #55E6 -å—§ > jiÄ' 'lún; #55E7 -å—¨ > hăi; #55E8 -å—© > sÅ­o; #55E9 -å—ª > qín; #55EA -å—« > niè; #55EB -å—¬ > hÄ“; #55EC -å—® > sài; #55EE -å—¯ > nÌ€g; #55EF -å—° > gè; #55F0 -å—± > ná; #55F1 -å—² > diă; #55F2 -å—³ > ài; #55F3 -å—µ > tÅng; #55F5 -å—¶ > bì; #55F6 -å—· > áo; #55F7 -å—¸ > áo; #55F8 -å—¹ > lián; #55F9 -å—º > cÅ«i; #55FA -å—» > zhÄ“; #55FB -å—¼ > mò; #55FC -å—½ > sòu; #55FD -å—¾ > sÅu; #55FE -å—¿ > tăn; #55FF -嘀 > dí; #5600 -å˜ > qÄ«; #5601 -嘂 > jiào; #5602 -嘃 > chÅng; #5603 -嘄 > jiÄo; #5604 -嘅 > kăi; #5605 -嘆 > tàn; #5606 -嘇 > sÄn; #5607 -嘈 > cáo; #5608 -嘉 > jiÄ; #5609 -嘊 > ái; #560A -嘋 > xiÄo; #560B -嘌 > piÄo; #560C -å˜ > lou; #560D -嘎 > gÄ; #560E -å˜ > gÅ­; #560F -å˜ > xiÄo; #5610 -嘑 > hÅ«; #5611 -嘒 > hùi; #5612 -嘓 > guo; #5613 -嘔 > Åu; #5614 -嘕 > xiÄn; #5615 -嘖 > zé; #5616 -嘗 > cháng; #5617 -嘘 > xÅ«; #5618 -嘙 > pó; #5619 -嘚 > dé; #561A -嘛 > ma; #561B -嘜 > mà; #561C -å˜ > hú; #561D -嘞 > lei; #561E -嘟 > dÅ«; #561F -嘠 > gÄ; #5620 -嘡 > tÄng; #5621 -嘢 > yÄ•; #5622 -嘣 > bÄ“ng; #5623 -嘤 > yÄ«ng; #5624 -嘦 > jiào; #5626 -嘧 > mÄ«; #5627 -嘨 > xiào; #5628 -嘩 > huÄ; #5629 -嘪 > măi; #562A -嘫 > rán; #562B -嘬 > zÅ«o; #562C -嘭 > pÄ“ng; #562D -嘮 > láo; #562E -嘯 > xiào; #562F -嘰 > jÄ«; #5630 -嘱 > zhÅ­; #5631 -嘲 > cháo; #5632 -嘳 > kùi; #5633 -嘴 > zÅ­i; #5634 -嘵 > xiÄo; #5635 -嘶 > sÄ«; #5636 -嘷 > háo; #5637 -嘸 > fÅ­; #5638 -嘹 > liáo; #5639 -嘺 > qiáo; #563A -嘻 > xÄ«; #563B -嘼 > xìu; #563C -嘽 > tÄn; #563D -嘾 > tán; #563E -嘿 > mò; #563F -噀 > xùn; #5640 -å™ > Ä•; #5641 -噂 > zÅ­n; #5642 -噃 > fÄn; #5643 -噄 > chÄ«; #5644 -å™… > hÅ«i; #5645 -噆 > zăn; #5646 -噇 > chuáng; #5647 -噈 > cù; #5648 -噉 > dàn; #5649 -噊 > yù; #564A -噋 > tÅ«n; #564B -噌 > chÄ“ng; #564C -å™ > jiào; #564D -噎 > yÄ“; #564E -å™ > xÄ«; #564F -å™ > qì; #5650 -噑 > háo; #5651 -å™’ > lián; #5652 -噓 > xÅ«; #5653 -å™” > dÄ“ng; #5654 -噕 > hÅ«i; #5655 -å™– > yín; #5656 -å™— > pÅ«; #5657 -噘 > juÄ“; #5658 -å™™ > qín; #5659 -噚 > xún; #565A -å™› > niè; #565B -噜 > lÅ«; #565C -å™ > sÄ«; #565D -噞 > yăn; #565E -噟 > yìng; #565F -å™  > dÄ; #5660 -噡 > dÄn; #5661 -噢 > yÅ­; #5662 -噣 > zhòu; #5663 -噤 > jìn; #5664 -噥 > nóng; #5665 -噦 > yuÄ•; #5666 -噧 > hùi; #5667 -器 > qì; #5668 -噩 > è; #5669 -噪 > zào; #566A -噫 > yÄ«; #566B -噬 > shì; #566C -å™­ > jiào; #566D -å™® > yuÄn; #566E -噯 > ài; #566F -å™° > yÅng; #5670 -å™± > jué; #5671 -噲 > kuài; #5672 -噳 > yÅ­; #5673 -å™´ > pÄ“n; #5674 -噵 > dào; #5675 -噶 > gé; #5676 -å™· > xÄ«n; #5677 -噸 > dÅ«n; #5678 -噹 > dÄng; #5679 -å™» > sai; #567B -噼 > pÄ«; #567C -噽 > pÄ­; #567D -噾 > yÄ«n; #567E -噿 > zÅ­i; #567F -嚀 > níng; #5680 -åš > dí; #5681 -åš‚ > làn; #5682 -嚃 > tÄ; #5683 -åš„ > hùo; #5684 -åš… > rú; #5685 -嚆 > hÄo; #5686 -嚇 > xià; #5687 -嚈 > yà; #5688 -嚉 > dÅ«o; #5689 -嚊 > xì; #568A -åš‹ > chóu; #568B -嚌 > jì; #568C -åš > jìn; #568D -嚎 > háo; #568E -åš > tì; #568F -åš > cháng; #5690 -åš“ > cÄ; #5693 -åš” > tì; #5694 -åš• > lÅ«; #5695 -åš– > hùi; #5696 -åš— > bó; #5697 -嚘 > yÅu; #5698 -åš™ > niè; #5699 -åšš > yín; #569A -åš› > hù; #569B -åšœ > mò; #569C -åš > huÄng; #569D -åšž > zhé; #569E -嚟 > lí; #569F -åš  > líu; #56A0 -嚢 > náng; #56A2 -嚣 > xiÄo; #56A3 -嚤 > mó; #56A4 -嚥 > yàn; #56A5 -嚦 > lì; #56A6 -嚧 > lú; #56A7 -嚨 > lóng; #56A8 -åš© > fú; #56A9 -嚪 > dàn; #56AA -åš« > chèn; #56AB -嚬 > pín; #56AC -åš­ > pÄ­; #56AD -åš® > xiàng; #56AE -嚯 > hùo; #56AF -åš° > mó; #56B0 -åš± > xì; #56B1 -åš² > dÅ­o; #56B2 -åš³ > kù; #56B3 -åš´ > yán; #56B4 -åšµ > chán; #56B5 -嚶 > yÄ«ng; #56B6 -åš· > răng; #56B7 -嚸 > diăn; #56B8 -åš¹ > lÄ; #56B9 -嚺 > tà; #56BA -åš» > xiÄo; #56BB -åš¼ > jiáo; #56BC -åš½ > chùo; #56BD -åš¾ > huÄn; #56BE -åš¿ > hùo; #56BF -囀 > zhuàn; #56C0 -å› > niè; #56C1 -囂 > xiÄo; #56C2 -囃 > cà; #56C3 -囄 > lí; #56C4 -å›… > chăn; #56C5 -囆 > chài; #56C6 -囇 > lì; #56C7 -囈 > yì; #56C8 -囉 > lÅ«o; #56C9 -囊 > náng; #56CA -囋 > zàn; #56CB -囌 > sÅ«; #56CC -å› > xÄ­; #56CD -å› > jiÄn; #56CF -å› > zá; #56D0 -囑 > zhÅ­; #56D1 -å›’ > lán; #56D2 -囓 > niè; #56D3 -å›” > nÄng; #56D4 -å›— > wéi; #56D7 -囘 > húi; #56D8 -å›™ > yÄ«n; #56D9 -囚 > qíu; #56DA -å›› > sì; #56DB -囜 > nín; #56DC -å› > jiăn; #56DD -回 > húi; #56DE -囟 > xìn; #56DF -å›  > yÄ«n; #56E0 -囡 > nÄn; #56E1 -团 > tuán; #56E2 -団 > tuán; #56E3 -囤 > dùn; #56E4 -囥 > kàng; #56E5 -囦 > yuÄn; #56E6 -囧 > jÄ­ong; #56E7 -囨 > piÄn; #56E8 -囩 > yùn; #56E9 -囪 > cÅng; #56EA -囫 > hú; #56EB -囬 > húi; #56EC -å›­ > yuán; #56ED -å›® > yóu; #56EE -囯 > gúo; #56EF -å›° > kùn; #56F0 -å›± > cÅng; #56F1 -囲 > wéi; #56F2 -図 > tú; #56F3 -å›´ > wéi; #56F4 -囵 > lún; #56F5 -囶 > gúo; #56F6 -å›· > qÅ«n; #56F7 -囸 > rì; #56F8 -囹 > líng; #56F9 -固 > gù; #56FA -å›» > gúo; #56FB -囼 > tÄi; #56FC -国 > gúo; #56FD -图 > tú; #56FE -囿 > yòu; #56FF -圀 > gúo; #5700 -åœ > yín; #5701 -圂 > hùn; #5702 -圃 > pÅ­; #5703 -圄 > yÅ­; #5704 -圅 > hán; #5705 -圆 > yuán; #5706 -圇 > lún; #5707 -圈 > quÄn; #5708 -圉 > yÅ­; #5709 -圊 > qÄ«ng; #570A -國 > gúo; #570B -圌 > chuán; #570C -åœ > wéi; #570D -圎 > yuán; #570E -åœ > quÄn; #570F -åœ > kÅ«; #5710 -圑 > fù; #5711 -園 > yuán; #5712 -圓 > yuán; #5713 -圔 > è; #5714 -圕 > tú' 'shÅ«' 'guăn; #5715 -圖 > tú; #5716 -圗 > tú; #5717 -團 > tuán; #5718 -圙 > lÇœe; #5719 -圚 > hùi; #571A -圛 > yì; #571B -圜 > yuán; #571C -åœ > luán; #571D -圞 > luán; #571E -土 > tÅ­; #571F -圠 > yà; #5720 -圡 > tÅ­; #5721 -圢 > tÄ«ng; #5722 -圣 > shèng; #5723 -圤 > pÅ­; #5724 -圥 > lù; #5725 -圧 > yÄ; #5727 -在 > zài; #5728 -圩 > wéi; #5729 -圪 > gÄ“; #572A -圫 > yù; #572B -圬 > wÅ«; #572C -圭 > gÅ«i; #572D -圮 > pÄ­; #572E -圯 > yí; #572F -地 > dì; #5730 -圱 > qiÄn; #5731 -圲 > qiÄn; #5732 -圳 > zhèn; #5733 -圴 > zhúo; #5734 -圵 > dàng; #5735 -圶 > qià; #5736 -圹 > kuàng; #5739 -场 > cháng; #573A -圻 > qí; #573B -圼 > niè; #573C -圽 > mò; #573D -圾 > jí; #573E -圿 > jiá; #573F -å€ > zhÄ­; #5740 -å > zhÄ­; #5741 -å‚ > băn; #5742 -åƒ > xÅ«n; #5743 -å„ > tóu; #5744 -å… > qÄ­n; #5745 -å† > fén; #5746 -å‡ > jÅ«n; #5747 -åˆ > kÄ“ng; #5748 -å‰ > tún; #5749 -åŠ > fÄng; #574A -å‹ > fèn; #574B -åŒ > bèn; #574C -å > tÄn; #574D -åŽ > kăn; #574E -å > pÄ«; #574F -å > zùo; #5750 -å‘ > kÄ“ng; #5751 -å’ > bì; #5752 -å“ > xíng; #5753 -å” > dì; #5754 -å• > jÄ«ng; #5755 -å– > jì; #5756 -å— > kuài; #5757 -å˜ > dÄ­; #5758 -å™ > jÄ«ng; #5759 -åš > jiÄn; #575A -å› > tán; #575B -åœ > lì; #575C -å > bà; #575D -åž > wù; #575E -åŸ > fén; #575F -å  > zhùi; #5760 -å¡ > pÅ; #5761 -å¢ > păn; #5762 -å£ > tÄng; #5763 -å¤ > kÅ«n; #5764 -å¥ > qÅ«; #5765 -å¦ > tăn; #5766 -å§ > zhÄ«; #5767 -å¨ > túo; #5768 -å© > gÄn; #5769 -åª > píng; #576A -å« > diàn; #576B -å¬ > guà; #576C -å­ > ní; #576D -å® > tái; #576E -å¯ > pÄ«; #576F -å° > jÄ«ong; #5770 -å± > yăng; #5771 -å² > fó; #5772 -å³ > ào; #5773 -å´ > lìu; #5774 -åµ > qÄ«u; #5775 -å¶ > mù; #5776 -å· > kÄ•; #5777 -å¸ > gòu; #5778 -å¹ > xuè; #5779 -åº > bá; #577A -å» > chí; #577B -å¼ > chè; #577C -å½ > líng; #577D -å¾ > zhù; #577E -å¿ > fù; #577F -垀 > hÅ«; #5780 -åž > zhì; #5781 -åž‚ > chúi; #5782 -垃 > lÄ; #5783 -åž„ > lÅng; #5784 -åž… > lÅng; #5785 -垆 > lú; #5786 -垇 > ào; #5787 -垉 > páo; #5789 -åž‹ > xíng; #578B -垌 > dòng; #578C -åž > jì; #578D -垎 > kè; #578E -åž > lù; #578F -åž > cí; #5790 -åž‘ > chÄ­; #5791 -åž’ > lÄ•i; #5792 -åž“ > gÄi; #5793 -åž” > yÄ«n; #5794 -åž• > hòu; #5795 -åž– > dÅ«i; #5796 -åž— > zhào; #5797 -垘 > fú; #5798 -åž™ > guÄng; #5799 -åžš > yáo; #579A -åž› > dÅ­o; #579B -åžœ > dÅ­o; #579C -åž > gÅ­i; #579D -åžž > chá; #579E -垟 > yáng; #579F -åž  > yín; #57A0 -åž¡ > fá; #57A1 -垢 > gòu; #57A2 -垣 > yuán; #57A3 -垤 > dié; #57A4 -垥 > xié; #57A5 -垦 > kÄ•n; #57A6 -垧 > jÄ«ong; #57A7 -垨 > shÅu; #57A8 -åž© > è; #57A9 -åž« > diàn; #57AB -垬 > hóng; #57AC -åž­ > wù; #57AD -åž® > kuă; #57AE -åž± > dàng; #57B1 -åž² > kăi; #57B2 -åž´ > năo; #57B4 -åžµ > ăn; #57B5 -垶 > xÄ«ng; #57B6 -åž· > xiàn; #57B7 -垸 > huàn; #57B8 -åž¹ > bÄng; #57B9 -垺 > pÄ“i; #57BA -åž» > bà; #57BB -åž¼ > yì; #57BC -åž½ > yìn; #57BD -åž¾ > hàn; #57BE -åž¿ > xù; #57BF -埀 > chúi; #57C0 -åŸ > cén; #57C1 -埂 > gÄ•ng; #57C2 -埃 > Äi; #57C3 -埄 > péng; #57C4 -埅 > fáng; #57C5 -埆 > què; #57C6 -埇 > yÅng; #57C7 -埈 > xùn; #57C8 -埉 > jiá; #57C9 -埊 > dì; #57CA -埋 > mái; #57CB -埌 > làng; #57CC -åŸ > xuàn; #57CD -城 > chéng; #57CE -åŸ > yán; #57CF -åŸ > jÄ«n; #57D0 -埑 > zhé; #57D1 -埒 > lèi; #57D2 -埓 > liè; #57D3 -埔 > bù; #57D4 -埕 > chéng; #57D5 -埗 > bù; #57D7 -埘 > shí; #57D8 -埙 > xÅ«n; #57D9 -埚 > gÅ«o; #57DA -埛 > jÄ«ong; #57DB -埜 > yÄ•; #57DC -åŸ > niàn; #57DD -埞 > dÄ­; #57DE -域 > yù; #57DF -埠 > bù; #57E0 -埡 > yà; #57E1 -埢 > juăn; #57E2 -埣 > sùi; #57E3 -埤 > pí; #57E4 -埥 > chÄ“ng; #57E5 -埦 > wăn; #57E6 -埧 > jù; #57E7 -埨 > lÅ­n; #57E8 -埩 > zhÄ“ng; #57E9 -埪 > kÅng; #57EA -埫 > chÅng; #57EB -埬 > dÅng; #57EC -埭 > dài; #57ED -埮 > tàn; #57EE -埯 > ăn; #57EF -埰 > cài; #57F0 -埱 > shú; #57F1 -埲 > bÄ•ng; #57F2 -埳 > kăn; #57F3 -埴 > zhí; #57F4 -埵 > dÅ­o; #57F5 -埶 > yì; #57F6 -執 > zhí; #57F7 -埸 > yì; #57F8 -培 > péi; #57F9 -基 > jÄ«; #57FA -埻 > zhÅ­n; #57FB -埼 > qí; #57FC -埽 > sào; #57FD -埾 > jù; #57FE -埿 > ní; #57FF -å € > kÅ«; #5800 -å  > kè; #5801 -å ‚ > táng; #5802 -å ƒ > kÅ«n; #5803 -å „ > nì; #5804 -å … > jiÄn; #5805 -å † > dÅ«i; #5806 -å ‡ > jÄ­n; #5807 -å ˆ > gÄng; #5808 -å ‰ > yù; #5809 -å Š > è; #580A -å ‹ > péng; #580B -å Œ > gù; #580C -å  > tù; #580D -å Ž > lèng; #580E -å  > yá; #5810 -å ‘ > qiàn; #5811 -å “ > àn; #5813 -å • > dùo; #5815 -å – > năo; #5816 -å — > tÅ«; #5817 -å ˜ > chéng; #5818 -å ™ > yÄ«n; #5819 -å š > hún; #581A -å › > bì; #581B -å œ > liàn; #581C -å  > gÅ«o; #581D -å ž > dié; #581E -å Ÿ > zhuàn; #581F -å   > hòu; #5820 -å ¡ > băo; #5821 -å ¢ > băo; #5822 -å £ > yú; #5823 -å ¤ > dÄ«; #5824 -å ¥ > máo; #5825 -å ¦ > jiÄ“; #5826 -å § > ruán; #5827 -å ¨ > è; #5828 -å © > gèng; #5829 -å ª > kÄn; #582A -å « > zÅng; #582B -å ¬ > yú; #582C -å ­ > huáng; #582D -å ® > è; #582E -å ¯ > yáo; #582F -å ° > yàn; #5830 -å ± > bào; #5831 -å ² > jí; #5832 -å ³ > méi; #5833 -å ´ > cháng; #5834 -å µ > dÅ­; #5835 -å ¶ > túo; #5836 -å · > yìn; #5837 -å ¸ > féng; #5838 -å ¹ > zhòng; #5839 -å º > jiè; #583A -å » > zhÄ“n; #583B -å ¼ > fÄ“ng; #583C -å ½ > gÄng; #583D -å ¾ > chuăn; #583E -å ¿ > jiăn; #583F -å¡‚ > xiàng; #5842 -塃 > huÄng; #5843 -å¡„ > léng; #5844 -å¡… > duàn; #5845 -塇 > xuÄn; #5847 -塈 > jì; #5848 -塉 > jí; #5849 -å¡Š > kuài; #584A -å¡‹ > yíng; #584B -å¡Œ > tÄ; #584C -å¡ > chéng; #584D -å¡Ž > yÅng; #584E -å¡ > kăi; #584F -å¡ > sù; #5850 -å¡‘ > sù; #5851 -å¡’ > shí; #5852 -å¡“ > mì; #5853 -å¡” > tă; #5854 -å¡• > wÄ•ng; #5855 -å¡– > chéng; #5856 -å¡— > tú; #5857 -塘 > táng; #5858 -å¡™ > què; #5859 -å¡š > zhÅng; #585A -å¡› > lì; #585B -å¡œ > péng; #585C -å¡ > bàng; #585D -å¡ž > sÄi; #585E -å¡Ÿ > zàng; #585F -å¡  > dÅ«i; #5860 -å¡¡ > tián; #5861 -å¡¢ > wù; #5862 -å¡£ > chÄ•ng; #5863 -塤 > xÅ«n; #5864 -å¡¥ > gé; #5865 -塦 > zhèn; #5866 -塧 > ài; #5867 -塨 > gÅng; #5868 -å¡© > yán; #5869 -塪 > kăn; #586A -å¡« > tián; #586B -塬 > yuán; #586C -å¡­ > wÄ“n; #586D -å¡® > xiè; #586E -塯 > lìu; #586F -塱 > lăng; #5871 -塲 > cháng; #5872 -塳 > péng; #5873 -å¡´ > bèng; #5874 -塵 > chén; #5875 -塶 > cù; #5876 -å¡· > lÅ­; #5877 -塸 > Åu; #5878 -塹 > qiàn; #5879 -塺 > méi; #587A -å¡» > mò; #587B -塼 > zhuÄn; #587C -塽 > shuăng; #587D -塾 > shú; #587E -å¡¿ > lÅu; #587F -墀 > chí; #5880 -å¢ > màn; #5881 -墂 > biÄo; #5882 -境 > jìng; #5883 -墄 > qÄ«; #5884 -墅 > shù; #5885 -墆 > dì; #5886 -墇 > zhÄng; #5887 -墈 > kàn; #5888 -墉 > yÅng; #5889 -墊 > diàn; #588A -墋 > chÄ•n; #588B -墌 > zhÄ«; #588C -å¢ > xì; #588D -墎 > gÅ«o; #588E -å¢ > qiăng; #588F -å¢ > jìn; #5890 -墑 > dÄ«; #5891 -墒 > shÄng; #5892 -墓 > mù; #5893 -墔 > cÅ«i; #5894 -墕 > yàn; #5895 -墖 > tă; #5896 -増 > zÄ“ng; #5897 -墘 > qí; #5898 -墙 > qiáng; #5899 -墚 > liáng; #589A -墜 > zhùi; #589C -å¢ > qiÄo; #589D -增 > zÄ“ng; #589E -墟 > xÅ«; #589F -墠 > shàn; #58A0 -墡 > shàn; #58A1 -墢 > bá; #58A2 -墣 > pÅ«; #58A3 -墤 > kuài; #58A4 -墥 > dÅng; #58A5 -墦 > fán; #58A6 -墧 > què; #58A7 -墨 > mò; #58A8 -墩 > dÅ«n; #58A9 -墪 > dÅ«n; #58AA -墫 > dÅ«n; #58AB -墬 > dì; #58AC -墭 > shèng; #58AD -墮 > dùo; #58AE -墯 > dùo; #58AF -墰 > tán; #58B0 -墱 > dèng; #58B1 -墲 > wÅ­; #58B2 -墳 > fén; #58B3 -墴 > huáng; #58B4 -墵 > tán; #58B5 -墶 > dÄ; #58B6 -墷 > yè; #58B7 -墺 > yù; #58BA -墻 > qiáng; #58BB -墼 > jÄ«; #58BC -墽 > qiÄo; #58BD -墾 > kÄ•n; #58BE -墿 > yì; #58BF -壀 > pí; #58C0 -å£ > bì; #58C1 -壂 > diàn; #58C2 -壃 > jiÄng; #58C3 -壄 > yÄ•; #58C4 -壅 > yÅng; #58C5 -壆 > bó; #58C6 -壇 > tán; #58C7 -壈 > lăn; #58C8 -壉 > jù; #58C9 -壊 > huài; #58CA -壋 > dàng; #58CB -壌 > răng; #58CC -å£ > qiàn; #58CD -壎 > xÅ«n; #58CE -å£ > làn; #58CF -å£ > xÄ­; #58D0 -壑 > hè; #58D1 -壒 > ài; #58D2 -壓 > yÄ; #58D3 -壔 > dăo; #58D4 -壕 > háo; #58D5 -壖 > ruán; #58D6 -壘 > lÄ•i; #58D8 -壙 > kuàng; #58D9 -壚 > lú; #58DA -壛 > yán; #58DB -壜 > tán; #58DC -å£ > wéi; #58DD -壞 > huài; #58DE -壟 > lÅng; #58DF -壠 > lÅng; #58E0 -壡 > rùi; #58E1 -壢 > lì; #58E2 -壣 > lín; #58E3 -壤 > răng; #58E4 -壦 > xÅ«n; #58E6 -壧 > yán; #58E7 -壨 > léi; #58E8 -壩 > bà; #58E9 -士 > shì; #58EB -壬 > rén; #58EC -壮 > zhuàng; #58EE -壯 > zhuàng; #58EF -声 > shÄ“ng; #58F0 -壱 > yÄ«; #58F1 -売 > mài; #58F2 -壳 > ké; #58F3 -壴 > zhÅ­; #58F4 -壵 > zhuàng; #58F5 -壶 > hú; #58F6 -壷 > hú; #58F7 -壸 > kÅ­n; #58F8 -壹 > yÄ«; #58F9 -壺 > hú; #58FA -壻 > xù; #58FB -壼 > kÅ­n; #58FC -壽 > shòu; #58FD -壾 > măng; #58FE -壿 > zÅ­n; #58FF -夀 > shòu; #5900 -å¤ > yÄ«; #5901 -夂 > zhÄ­; #5902 -夃 > gÅ«; #5903 -处 > chù; #5904 -夅 > jiàng; #5905 -夆 > fÄ“ng; #5906 -备 > bèi; #5907 -変 > biàn; #5909 -夊 > sÅ«i; #590A -夋 > qÅ«n; #590B -夌 > líng; #590C -å¤ > fù; #590D -夎 > zùo; #590E -å¤ > xià; #590F -å¤ > xìong; #5910 -夒 > náo; #5912 -夓 > xià; #5913 -夔 > kúi; #5914 -夕 > xÄ«; #5915 -外 > wài; #5916 -夗 > yuàn; #5917 -夘 > măo; #5918 -夙 > sù; #5919 -多 > dÅ«o; #591A -夛 > dÅ«o; #591B -夜 > yè; #591C -å¤ > qíng; #591D -够 > gòu; #591F -夠 > gòu; #5920 -夡 > qì; #5921 -夢 > mèng; #5922 -夣 > mèng; #5923 -夤 > yín; #5924 -夥 > hÅ­o; #5925 -夦 > chèn; #5926 -大 > dà; #5927 -夨 > zè; #5928 -天 > tiÄn; #5929 -太 > tài; #592A -夫 > fÅ«; #592B -夬 > guài; #592C -夭 > yăo; #592D -央 > yÄng; #592E -夯 > hÄng; #592F -夰 > găo; #5930 -失 > shÄ«; #5931 -夲 > bÄ•n; #5932 -夳 > tài; #5933 -头 > tóu; #5934 -夵 > yăn; #5935 -夶 > bÄ­; #5936 -夷 > yí; #5937 -夸 > kuÄ; #5938 -夹 > jiÄ; #5939 -夺 > dúo; #593A -夼 > kuăng; #593C -夽 > yùn; #593D -夾 > jiÄ; #593E -夿 > pÄ; #593F -奀 > Ä“n; #5940 -å¥ > lián; #5941 -奂 > huàn; #5942 -奃 > dì; #5943 -奄 > yăn; #5944 -奅 > pào; #5945 -奆 > quăn; #5946 -奇 > qí; #5947 -奈 > nài; #5948 -奉 > fèng; #5949 -奊 > xié; #594A -奋 > fèn; #594B -奌 > diăn; #594C -奎 > kúi; #594E -å¥ > zòu; #594F -å¥ > huàn; #5950 -契 > qì; #5951 -奒 > kÄi; #5952 -奓 > zhà; #5953 -奔 > bÄ“n; #5954 -奕 > yì; #5955 -奖 > jiăng; #5956 -套 > tào; #5957 -奘 > zàng; #5958 -奙 > bÄ•n; #5959 -奚 > xÄ«; #595A -奛 > xiăng; #595B -奜 > fÄ•i; #595C -å¥ > diÄo; #595D -奞 > xùn; #595E -奟 > kÄ“ng; #595F -奠 > diàn; #5960 -奡 > ào; #5961 -奢 > shÄ“; #5962 -奣 > wÄ•ng; #5963 -奤 > păn; #5964 -奥 > ào; #5965 -奦 > wù; #5966 -奧 > ào; #5967 -奨 > jiăng; #5968 -奩 > lián; #5969 -奪 > dúo; #596A -奫 > yÅ«n; #596B -奬 > jiăng; #596C -奭 > shì; #596D -奮 > fèn; #596E -奯 > hùo; #596F -奰 > bì; #5970 -奱 > lián; #5971 -奲 > dÅ­o; #5972 -女 > nÇš; #5973 -奴 > nú; #5974 -奵 > dÄ«ng; #5975 -奶 > năi; #5976 -奷 > qiÄn; #5977 -奸 > jiÄn; #5978 -她 > tÄ; #5979 -奺 > jÄ­u; #597A -奻 > nán; #597B -奼 > chà; #597C -好 > hăo; #597D -奾 > xiÄn; #597E -奿 > fàn; #597F -妀 > jÄ­; #5980 -å¦ > shùo; #5981 -如 > rú; #5982 -妃 > fÄ“i; #5983 -妄 > wàng; #5984 -妅 > hóng; #5985 -妆 > zhuÄng; #5986 -妇 > fù; #5987 -妈 > mÄ; #5988 -妉 > dÄn; #5989 -妊 > rèn; #598A -妋 > fÅ«; #598B -妌 > jìng; #598C -å¦ > yán; #598D -妎 > xiè; #598E -å¦ > wèn; #598F -å¦ > zhÅng; #5990 -妑 > pÄ; #5991 -妒 > dù; #5992 -妓 > jì; #5993 -妔 > kÄ“ng; #5994 -妕 > zhòng; #5995 -妖 > yÄo; #5996 -妗 > jìn; #5997 -妘 > yún; #5998 -妙 > miào; #5999 -妚 > pÄ“i; #599A -妜 > yuè; #599C -å¦ > zhuÄng; #599D -妞 > nÄ«u; #599E -妟 > yàn; #599F -妠 > nà; #59A0 -妡 > xÄ«n; #59A1 -妢 > fén; #59A2 -妣 > bÄ­; #59A3 -妤 > yú; #59A4 -妥 > tÅ­o; #59A5 -妦 > fÄ“ng; #59A6 -妧 > yuán; #59A7 -妨 > fáng; #59A8 -妩 > wÅ­; #59A9 -妪 > yù; #59AA -妫 > gÅ«i; #59AB -妬 > dù; #59AC -妭 > bá; #59AD -妮 > nÄ«; #59AE -妯 > zhóu; #59AF -妰 > zhúo; #59B0 -妱 > zhÄo; #59B1 -妲 > dá; #59B2 -妳 > năi; #59B3 -妴 > yuăn; #59B4 -妵 > tÅu; #59B5 -妶 > xuán; #59B6 -妷 > zhí; #59B7 -妸 > Ä“; #59B8 -妹 > mèi; #59B9 -妺 > mò; #59BA -妻 > qÄ«; #59BB -妼 > bì; #59BC -妽 > shÄ“n; #59BD -妾 > qiè; #59BE -妿 > Ä“; #59BF -姀 > hé; #59C0 -å§ > xÅ­; #59C1 -姂 > fá; #59C2 -姃 > zhÄ“ng; #59C3 -姄 > mín; #59C4 -姅 > bàn; #59C5 -姆 > mÅ­; #59C6 -姇 > fÅ«; #59C7 -姈 > líng; #59C8 -姉 > zÄ­; #59C9 -姊 > zÄ­; #59CA -始 > shÄ­; #59CB -姌 > răn; #59CC -å§ > shÄn; #59CD -姎 > yÄng; #59CE -å§ > mán; #59CF -å§ > jiÄ•; #59D0 -姑 > gÅ«; #59D1 -姒 > sì; #59D2 -姓 > xìng; #59D3 -委 > wÄ•i; #59D4 -姕 > zÄ«; #59D5 -姖 > jù; #59D6 -姗 > shÄn; #59D7 -姘 > pÄ«n; #59D8 -姙 > rèn; #59D9 -姚 > yáo; #59DA -姛 > tÅng; #59DB -姜 > jiÄng; #59DC -å§ > shÅ«; #59DD -姞 > jí; #59DE -姟 > gÄi; #59DF -姠 > shàng; #59E0 -姡 > kùo; #59E1 -姢 > juÄn; #59E2 -姣 > jiÄo; #59E3 -姤 > gòu; #59E4 -姥 > mÅ­; #59E5 -姦 > jiÄn; #59E6 -姧 > jiÄn; #59E7 -姨 > yí; #59E8 -姩 > niàn; #59E9 -姪 > zhí; #59EA -姫 > jÄ«; #59EB -姬 > jÄ«; #59EC -姭 > xiàn; #59ED -姮 > héng; #59EE -姯 > guÄng; #59EF -姰 > jÅ«n; #59F0 -姱 > kuÄ; #59F1 -姲 > yàn; #59F2 -姳 > mÄ­ng; #59F3 -姴 > liè; #59F4 -姵 > pèi; #59F5 -姶 > yăn; #59F6 -姷 > yòu; #59F7 -姸 > yán; #59F8 -姹 > chà; #59F9 -姺 > shÄ“n; #59FA -姻 > yÄ«n; #59FB -姼 > chÄ­; #59FC -姽 > gÅ­i; #59FD -姾 > quÄn; #59FE -姿 > zÄ«; #59FF -娀 > sÅng; #5A00 -å¨ > wÄ“i; #5A01 -娂 > hóng; #5A02 -娃 > wá; #5A03 -娄 > lóu; #5A04 -娅 > yà; #5A05 -娆 > răo; #5A06 -娇 > jiÄo; #5A07 -娈 > luán; #5A08 -娉 > pÄ«ng; #5A09 -娊 > xiàn; #5A0A -娋 > shào; #5A0B -娌 > lÄ­; #5A0C -å¨ > chéng; #5A0D -娎 > xiào; #5A0E -å¨ > máng; #5A0F -å¨ > fu; #5A10 -娑 > sÅ«o; #5A11 -娒 > wÅ­; #5A12 -娓 > wÄ•i; #5A13 -娔 > kè; #5A14 -娕 > lài; #5A15 -娖 > chùo; #5A16 -娗 > dìng; #5A17 -娘 > niáng; #5A18 -娙 > xíng; #5A19 -娚 > nán; #5A1A -娛 > yú; #5A1B -娜 > núo; #5A1C -å¨ > pÄ“i; #5A1D -娞 > nÄ•i; #5A1E -娟 > juÄn; #5A1F -娠 > shÄ“n; #5A20 -娡 > zhì; #5A21 -娢 > hán; #5A22 -娣 > dì; #5A23 -娤 > zhuÄng; #5A24 -娥 > é; #5A25 -娦 > pín; #5A26 -娧 > tùi; #5A27 -娨 > hàn; #5A28 -娩 > miăn; #5A29 -娪 > wú; #5A2A -娫 > yán; #5A2B -娬 > wÅ­; #5A2C -娭 > xÄ«; #5A2D -娮 > yán; #5A2E -娯 > yú; #5A2F -娰 > sì; #5A30 -娱 > yú; #5A31 -娲 > wÄ; #5A32 -娴 > xián; #5A34 -娵 > jÅ«; #5A35 -娶 > qÅ­; #5A36 -娷 > shùi; #5A37 -娸 > qÄ«; #5A38 -娹 > xián; #5A39 -娺 > zhÅ«i; #5A3A -娻 > dÅng; #5A3B -娼 > chÄng; #5A3C -娽 > lù; #5A3D -娾 > ăi; #5A3E -娿 > Ä“; #5A3F -å©€ > Ä“; #5A40 -å© > lóu; #5A41 -å©‚ > mián; #5A42 -婃 > cóng; #5A43 -å©„ > pÅu; #5A44 -å©… > jú; #5A45 -婆 > pó; #5A46 -婇 > căi; #5A47 -婈 > díng; #5A48 -婉 > wăn; #5A49 -å©Š > biăo; #5A4A -å©‹ > xiÄo; #5A4B -å©Œ > shÅ­; #5A4C -å© > qÄ­; #5A4D -å©Ž > hÅ«i; #5A4E -å© > fù; #5A4F -å© > Ä“; #5A50 -å©‘ > wÅ; #5A51 -å©’ > tán; #5A52 -å©“ > fÄ“i; #5A53 -å©” > wei; #5A54 -å©• > jié; #5A55 -å©– > tiÄn; #5A56 -å©— > ní; #5A57 -婘 > quán; #5A58 -å©™ > jìng; #5A59 -å©š > hÅ«n; #5A5A -å©› > jÄ«ng; #5A5B -å©œ > qiÄn; #5A5C -å© > diàn; #5A5D -å©ž > xìng; #5A5E -å©Ÿ > hù; #5A5F -å©  > wà; #5A60 -å©¡ > lái; #5A61 -å©¢ > bì; #5A62 -å©£ > yÄ«n; #5A63 -婤 > chÅu; #5A64 -å©¥ > chùo; #5A65 -婦 > fù; #5A66 -婧 > jìng; #5A67 -婨 > lún; #5A68 -å©© > yàn; #5A69 -婪 > lán; #5A6A -å©« > kÅ«n; #5A6B -婬 > yín; #5A6C -å©­ > yà; #5A6D -å©® > ju; #5A6E -婯 > lì; #5A6F -å©° > diăn; #5A70 -婱 > xián; #5A71 -婳 > huà; #5A73 -å©´ > yÄ«ng; #5A74 -婵 > chán; #5A75 -婶 > shÄ•n; #5A76 -å©· > tíng; #5A77 -婸 > dàng; #5A78 -婹 > yăo; #5A79 -婺 > wù; #5A7A -å©» > nàn; #5A7B -婼 > rùo; #5A7C -婽 > jiă; #5A7D -婾 > tÅu; #5A7E -å©¿ > xù; #5A7F -媀 > yú; #5A80 -åª > wÄ“i; #5A81 -媂 > tí; #5A82 -媃 > róu; #5A83 -媄 > mÄ•i; #5A84 -媅 > dÄn; #5A85 -媆 > ruăn; #5A86 -媇 > qÄ«n; #5A87 -媈 > hui; #5A88 -媉 > wÅ«; #5A89 -媊 > qián; #5A8A -媋 > chÅ«n; #5A8B -媌 > máo; #5A8C -åª > fù; #5A8D -媎 > jiÄ•; #5A8E -åª > duÄn; #5A8F -åª > xÄ«; #5A90 -媑 > zhòng; #5A91 -媒 > méi; #5A92 -媓 > huáng; #5A93 -媔 > mián; #5A94 -媕 > Än; #5A95 -媖 > yÄ«ng; #5A96 -媗 > xuÄn; #5A97 -媘 > jie; #5A98 -媙 > wÄ“i; #5A99 -媚 > mèi; #5A9A -媛 > yuàn; #5A9B -媜 > zhÄ“n; #5A9C -åª > qÄ«u; #5A9D -媞 > tí; #5A9E -媟 > xiè; #5A9F -媠 > tÅ­o; #5AA0 -媡 > liàn; #5AA1 -媢 > mào; #5AA2 -媣 > răn; #5AA3 -媤 > sÄ«; #5AA4 -媥 > piÄn; #5AA5 -媦 > wèi; #5AA6 -媧 > wÄ; #5AA7 -媨 > jìu; #5AA8 -媩 > hú; #5AA9 -媪 > ăo; #5AAA -媭 > xÅ«; #5AAD -媮 > tÅu; #5AAE -媯 > gÅ«i; #5AAF -媰 > zÅu; #5AB0 -媱 > yáo; #5AB1 -媲 > pì; #5AB2 -媳 > xí; #5AB3 -媴 > yuán; #5AB4 -媵 > yìng; #5AB5 -媶 > róng; #5AB6 -媷 > rù; #5AB7 -媸 > chÄ«; #5AB8 -媹 > líu; #5AB9 -媺 > mÄ•i; #5ABA -媻 > pán; #5ABB -媼 > ăo; #5ABC -媽 > mÄ; #5ABD -媾 > gòu; #5ABE -媿 > kùi; #5ABF -å«€ > qín; #5AC0 -å« > jià; #5AC1 -å«‚ > săo; #5AC2 -嫃 > zhÄ“n; #5AC3 -å«„ > yuán; #5AC4 -å«… > chÄ; #5AC5 -嫆 > yóng; #5AC6 -嫇 > míng; #5AC7 -嫈 > yÄ«ng; #5AC8 -嫉 > jí; #5AC9 -å«Š > sù; #5ACA -å«‹ > niăo; #5ACB -å«Œ > xián; #5ACC -å« > tÄo; #5ACD -å«Ž > páng; #5ACE -å« > láng; #5ACF -å« > năo; #5AD0 -å«‘ > báo; #5AD1 -å«’ > ài; #5AD2 -å«“ > pì; #5AD3 -å«” > pín; #5AD4 -å«• > yì; #5AD5 -å«– > piào; #5AD6 -å«— > yù; #5AD7 -嫘 > léi; #5AD8 -å«™ > xuán; #5AD9 -å«š > màn; #5ADA -å«› > yÄ«; #5ADB -å«œ > zhÄng; #5ADC -å« > kÄng; #5ADD -å«ž > yóng; #5ADE -å«Ÿ > nì; #5ADF -å«  > lí; #5AE0 -å«¡ > dí; #5AE1 -å«¢ > gÅ«i; #5AE2 -å«£ > yÄn; #5AE3 -嫤 > jìn; #5AE4 -å«¥ > zhuÄn; #5AE5 -嫦 > cháng; #5AE6 -嫧 > cè; #5AE7 -嫨 > hÄn; #5AE8 -å«© > nèn; #5AE9 -嫪 > lào; #5AEA -å«« > mó; #5AEB -嫬 > zhÄ“; #5AEC -å«­ > hù; #5AED -å«® > hù; #5AEE -嫯 > ào; #5AEF -å«° > nèn; #5AF0 -嫱 > qiáng; #5AF1 -嫳 > piè; #5AF3 -å«´ > gÅ«; #5AF4 -嫵 > wÅ­; #5AF5 -嫶 > jiáo; #5AF6 -å«· > tÅ­o; #5AF7 -嫸 > zhăn; #5AF8 -嫹 > máo; #5AF9 -嫺 > xián; #5AFA -å«» > xián; #5AFB -嫼 > mò; #5AFC -嫽 > liáo; #5AFD -嫾 > lián; #5AFE -å«¿ > huà; #5AFF -嬀 > gÅ«i; #5B00 -å¬ > dÄ“ng; #5B01 -嬂 > zhÄ«; #5B02 -嬃 > xÅ«; #5B03 -嬄 > yi; #5B04 -嬅 > huá; #5B05 -嬆 > xÄ«; #5B06 -嬇 > hùi; #5B07 -嬈 > răo; #5B08 -嬉 > xÄ«; #5B09 -嬊 > yàn; #5B0A -嬋 > chán; #5B0B -嬌 > jiÄo; #5B0C -å¬ > mÄ•i; #5B0D -嬎 > fàn; #5B0E -å¬ > fÄn; #5B0F -å¬ > xiÄn; #5B10 -嬑 > yì; #5B11 -嬒 > wèi; #5B12 -嬓 > jiào; #5B13 -嬔 > fù; #5B14 -嬕 > shì; #5B15 -嬖 > bì; #5B16 -嬗 > shàn; #5B17 -嬘 > sùi; #5B18 -嬙 > qiáng; #5B19 -嬚 > liăn; #5B1A -嬛 > huán; #5B1B -嬜 > xin; #5B1C -å¬ > niăo; #5B1D -嬞 > dÅng; #5B1E -嬟 > yì; #5B1F -嬠 > cán; #5B20 -嬡 > ài; #5B21 -嬢 > niáng; #5B22 -嬣 > néng; #5B23 -嬤 > mÄ; #5B24 -嬥 > tiăo; #5B25 -嬦 > chóu; #5B26 -嬧 > jìn; #5B27 -嬨 > cí; #5B28 -嬩 > yú; #5B29 -嬪 > pín; #5B2A -嬫 > yong; #5B2B -嬬 > xÅ«; #5B2C -嬭 > năi; #5B2D -嬮 > yÄn; #5B2E -嬯 > tái; #5B2F -嬰 > yÄ«ng; #5B30 -嬱 > cán; #5B31 -嬲 > niăo; #5B32 -嬳 > wo; #5B33 -嬴 > yíng; #5B34 -嬵 > mián; #5B35 -嬷 > mÄ; #5B37 -嬸 > shÄ•n; #5B38 -嬹 > xìng; #5B39 -嬺 > nì; #5B3A -嬻 > dú; #5B3B -嬼 > lÄ­u; #5B3C -嬽 > yuÄn; #5B3D -嬾 > lăn; #5B3E -嬿 > yàn; #5B3F -å­€ > shuÄng; #5B40 -å­ > líng; #5B41 -å­‚ > jiăo; #5B42 -å­ƒ > niáng; #5B43 -å­„ > lăn; #5B44 -å­… > xiÄn; #5B45 -å­† > yÄ«ng; #5B46 -å­‡ > shuÄng; #5B47 -å­ˆ > shuÄi; #5B48 -å­‰ > quán; #5B49 -å­Š > mÄ­; #5B4A -å­‹ > lí; #5B4B -å­Œ > luán; #5B4C -å­ > yán; #5B4D -å­Ž > zhÅ­; #5B4E -å­ > lăn; #5B4F -å­ > zÄ­; #5B50 -å­‘ > jié; #5B51 -å­’ > jué; #5B52 -å­“ > jué; #5B53 -å­” > kÅng; #5B54 -å­• > yùn; #5B55 -å­– > zÄ«; #5B56 -å­— > zì; #5B57 -å­˜ > cún; #5B58 -å­™ > sÅ«n; #5B59 -å­š > fú; #5B5A -å­› > bèi; #5B5B -å­œ > zÄ«; #5B5C -å­ > xiào; #5B5D -å­ž > xìn; #5B5E -å­Ÿ > mèng; #5B5F -å­  > sì; #5B60 -å­¡ > tÄi; #5B61 -å­¢ > bÄo; #5B62 -å­£ > jì; #5B63 -å­¤ > gÅ«; #5B64 -å­¥ > nú; #5B65 -å­¦ > xué; #5B66 -å­¨ > zhuăn; #5B68 -å­© > hái; #5B69 -å­ª > luán; #5B6A -å­« > sÅ«n; #5B6B -å­¬ > huài; #5B6C -å­­ > miÄ“; #5B6D -å­® > cóng; #5B6E -å­¯ > qiÄn; #5B6F -å­° > shú; #5B70 -å­± > chán; #5B71 -å­² > yÄ; #5B72 -å­³ > zÄ«; #5B73 -å­´ > nÄ­; #5B74 -å­µ > fÅ«; #5B75 -å­¶ > zÄ«; #5B76 -å­· > lí; #5B77 -å­¸ > xué; #5B78 -å­¹ > bò; #5B79 -å­º > rú; #5B7A -å­» > lái; #5B7B -å­¼ > niè; #5B7C -å­½ > niè; #5B7D -å­¾ > yÄ«ng; #5B7E -å­¿ > luán; #5B7F -宀 > mián; #5B80 -å® > zhù; #5B81 -宂 > rÅng; #5B82 -它 > tÄ; #5B83 -宄 > gÅ­i; #5B84 -å®… > zhái; #5B85 -宆 > qíong; #5B86 -宇 > yÅ­; #5B87 -守 > shÅu; #5B88 -安 > Än; #5B89 -宊 > tú; #5B8A -宋 > sòng; #5B8B -完 > wán; #5B8C -å® > ròu; #5B8D -宎 > yăo; #5B8E -å® > hóng; #5B8F -å® > yí; #5B90 -宑 > jÄ­ng; #5B91 -å®’ > zhÅ«n; #5B92 -宓 > mì; #5B93 -å®” > zhÅ­; #5B94 -宕 > dàng; #5B95 -å®– > hóng; #5B96 -å®— > zÅng; #5B97 -官 > guÄn; #5B98 -å®™ > zhòu; #5B99 -定 > dìng; #5B9A -å®› > wăn; #5B9B -宜 > yí; #5B9C -å® > băo; #5B9D -实 > shí; #5B9E -実 > shí; #5B9F -å®  > chÅng; #5BA0 -审 > shÄ•n; #5BA1 -客 > kè; #5BA2 -宣 > xuÄn; #5BA3 -室 > shì; #5BA4 -宥 > yòu; #5BA5 -宦 > huàn; #5BA6 -宧 > yí; #5BA7 -宨 > tiăo; #5BA8 -宩 > shÄ­; #5BA9 -宪 > xiàn; #5BAA -宫 > gÅng; #5BAB -宬 > chéng; #5BAC -å®­ > qún; #5BAD -å®® > gÅng; #5BAE -宯 > xiÄo; #5BAF -å®° > zăi; #5BB0 -å®± > zhà; #5BB1 -宲 > băo; #5BB2 -害 > hài; #5BB3 -å®´ > yàn; #5BB4 -宵 > xiÄo; #5BB5 -家 > jiÄ; #5BB6 -å®· > shÄ•n; #5BB7 -宸 > chén; #5BB8 -容 > róng; #5BB9 -宺 > huăng; #5BBA -å®» > mì; #5BBB -宼 > kòu; #5BBC -宽 > kuÄn; #5BBD -宾 > bÄ«n; #5BBE -宿 > sù; #5BBF -寀 > cài; #5BC0 -å¯ > zăn; #5BC1 -寂 > jì; #5BC2 -寃 > yuÄn; #5BC3 -寄 > jì; #5BC4 -寅 > yín; #5BC5 -密 > mì; #5BC6 -寇 > kòu; #5BC7 -寈 > qÄ«ng; #5BC8 -寉 > què; #5BC9 -寊 > zhÄ“n; #5BCA -寋 > jiăn; #5BCB -富 > fù; #5BCC -å¯ > níng; #5BCD -寎 > bìng; #5BCE -å¯ > huán; #5BCF -å¯ > mèi; #5BD0 -寑 > qÄ­n; #5BD1 -寒 > hán; #5BD2 -寓 > yù; #5BD3 -寔 > shí; #5BD4 -寕 > níng; #5BD5 -寖 > qìn; #5BD6 -寗 > níng; #5BD7 -寘 > zhì; #5BD8 -寙 > yÅ­; #5BD9 -寚 > băo; #5BDA -寛 > kuÄn; #5BDB -寜 > níng; #5BDC -å¯ > qÄ­n; #5BDD -寞 > mò; #5BDE -察 > chá; #5BDF -寠 > jù; #5BE0 -寡 > guă; #5BE1 -寢 > qÄ­n; #5BE2 -寣 > hÅ«; #5BE3 -寤 > wù; #5BE4 -寥 > liáo; #5BE5 -實 > shí; #5BE6 -寧 > zhù; #5BE7 -寨 > zhài; #5BE8 -審 > shÄ•n; #5BE9 -寪 > wÄ•i; #5BEA -寫 > xiÄ•; #5BEB -寬 > kuÄn; #5BEC -寭 > hùi; #5BED -寮 > liáo; #5BEE -寯 > jùn; #5BEF -寰 > huán; #5BF0 -寱 > yì; #5BF1 -寲 > yí; #5BF2 -寳 > băo; #5BF3 -寴 > qìn; #5BF4 -寵 > chÅng; #5BF5 -寶 > băo; #5BF6 -寷 > fÄ“ng; #5BF7 -寸 > cùn; #5BF8 -对 > dùi; #5BF9 -寺 > sì; #5BFA -寻 > xún; #5BFB -导 > dăo; #5BFC -寽 > lÇœ; #5BFD -対 > dùi; #5BFE -寿 > shòu; #5BFF -å°€ > pÅ; #5C00 -å° > fÄ“ng; #5C01 -å°‚ > zhuÄn; #5C02 -å°ƒ > fÅ«; #5C03 -å°„ > shè; #5C04 -å°… > kè; #5C05 -å°† > jiÄng; #5C06 -å°‡ > jiÄng; #5C07 -å°ˆ > zhuÄn; #5C08 -å°‰ > wèi; #5C09 -å°Š > zÅ«n; #5C0A -å°‹ > xún; #5C0B -å°Œ > shù; #5C0C -å° > dùi; #5C0D -å°Ž > dăo; #5C0E -å° > xiăo; #5C0F -å° > jÄ«; #5C10 -å°‘ > shăo; #5C11 -å°’ > Ä•r; #5C12 -å°“ > Ä•r; #5C13 -å°” > Ä•r; #5C14 -å°• > gă; #5C15 -å°– > jiÄn; #5C16 -å°— > shú; #5C17 -å°˜ > chén; #5C18 -å°™ > shàng; #5C19 -å°š > shàng; #5C1A -å°› > mo; #5C1B -å°œ > gá; #5C1C -å° > cháng; #5C1D -å°ž > liào; #5C1E -å°Ÿ > xiăn; #5C1F -å°  > xiăn; #5C20 -å°¢ > wÄng; #5C22 -å°£ > wÄng; #5C23 -å°¤ > yóu; #5C24 -å°¥ > liào; #5C25 -å°¦ > liào; #5C26 -å°§ > yáo; #5C27 -å°¨ > máng; #5C28 -å°© > wÄng; #5C29 -å°ª > wÄng; #5C2A -å°« > wÄng; #5C2B -å°¬ > gà; #5C2C -å°­ > yáo; #5C2D -å°® > dùo; #5C2E -å°¯ > kùi; #5C2F -å°° > zhÅng; #5C30 -å°± > jìu; #5C31 -å°² > gÄn; #5C32 -å°³ > gÅ­; #5C33 -å°´ > gÄn; #5C34 -å°µ > túi; #5C35 -å°¶ > gÄn; #5C36 -å°· > gÄn; #5C37 -å°¸ > shÄ«; #5C38 -å°¹ > yÄ­n; #5C39 -å°º > chÄ­; #5C3A -å°» > kÄo; #5C3B -å°¼ > ní; #5C3C -å°½ > jÄ­n; #5C3D -å°¾ > wÄ•i; #5C3E -å°¿ > niào; #5C3F -å±€ > jú; #5C40 -å± > pì; #5C41 -层 > céng; #5C42 -屃 > xì; #5C43 -屄 > bÄ«; #5C44 -å±… > jÅ«; #5C45 -屆 > jiè; #5C46 -屇 > tián; #5C47 -屈 > qÅ«; #5C48 -屉 > tì; #5C49 -届 > jiè; #5C4A -屋 > wÅ«; #5C4B -屌 > diăo; #5C4C -å± > shÄ«; #5C4D -屎 > shÄ­; #5C4E -å± > píng; #5C4F -å± > jÄ«; #5C50 -屑 > xiè; #5C51 -å±’ > chén; #5C52 -屓 > xì; #5C53 -å±” > ní; #5C54 -展 > zhăn; #5C55 -å±– > xÄ«; #5C56 -屘 > măn; #5C58 -å±™ > Ä“; #5C59 -屚 > lòu; #5C5A -å±› > píng; #5C5B -屜 > tì; #5C5C -å± > fèi; #5C5D -属 > shÅ­; #5C5E -屟 > xiè; #5C5F -å±  > tú; #5C60 -屡 > lÇš; #5C61 -å±¢ > lÇš; #5C62 -å±£ > xÄ­; #5C63 -層 > céng; #5C64 -å±¥ > lÇš; #5C65 -屦 > jù; #5C66 -屧 > xiè; #5C67 -屨 > jù; #5C68 -屩 > juÄ“; #5C69 -屪 > liáo; #5C6A -屫 > jué; #5C6B -屬 > shÅ­; #5C6C -å±­ > xì; #5C6D -å±® > chè; #5C6E -屯 > tún; #5C6F -å±° > nì; #5C70 -å±± > shÄn; #5C71 -å±³ > xiÄn; #5C73 -å±´ > lì; #5C74 -å±µ > xuÄ“; #5C75 -屸 > lóng; #5C78 -å±¹ > yì; #5C79 -屺 > qÄ­; #5C7A -å±» > rèn; #5C7B -å±¼ > wù; #5C7C -å±½ > hàn; #5C7D -å±¾ > shÄ“n; #5C7E -屿 > yÅ­; #5C7F -å²€ > chÅ«; #5C80 -å² > sùi; #5C81 -岂 > qÄ­; #5C82 -岄 > yuè; #5C84 -å²… > băn; #5C85 -岆 > yăo; #5C86 -岇 > áng; #5C87 -岈 > yá; #5C88 -岉 > wù; #5C89 -岊 > jié; #5C8A -岋 > è; #5C8B -岌 > jí; #5C8C -å² > qiÄn; #5C8D -岎 > fÄ“n; #5C8E -å² > yuán; #5C8F -å² > qí; #5C90 -岑 > cén; #5C91 -å²’ > qián; #5C92 -岓 > qí; #5C93 -å²” > chà; #5C94 -岕 > jiè; #5C95 -å²– > qÅ«; #5C96 -å²— > găng; #5C97 -岘 > xiàn; #5C98 -å²™ > ào; #5C99 -岚 > lán; #5C9A -å²› > dăo; #5C9B -岜 > bÄ; #5C9C -å² > zùo; #5C9D -岞 > zùo; #5C9E -岟 > yăng; #5C9F -å²  > jù; #5CA0 -岡 > gÄng; #5CA1 -å²¢ > kÄ•; #5CA2 -å²£ > gÅu; #5CA3 -岤 > xuè; #5CA4 -å²¥ > bÄ“i; #5CA5 -岦 > lì; #5CA6 -岧 > tiáo; #5CA7 -岨 > jÅ«; #5CA8 -岩 > yán; #5CA9 -岪 > fú; #5CAA -岫 > xìu; #5CAB -岬 > jiă; #5CAC -å²­ > líng; #5CAD -å²® > túo; #5CAE -岯 > pÄ“i; #5CAF -å²° > yÅu; #5CB0 -å²± > dài; #5CB1 -å²² > kuàng; #5CB2 -å²³ > yuè; #5CB3 -å²´ > qÅ«; #5CB4 -å²µ > hù; #5CB5 -岶 > pò; #5CB6 -å²· > mín; #5CB7 -岸 > àn; #5CB8 -å²¹ > tiáo; #5CB9 -岺 > líng; #5CBA -å²» > chí; #5CBB -å²½ > dÅng; #5CBD -岿 > kÅ«i; #5CBF -å³€ > xìu; #5CC0 -å³ > măo; #5CC1 -峂 > tóng; #5CC2 -峃 > xué; #5CC3 -峄 > yì; #5CC4 -峆 > hÄ“; #5CC6 -峇 > kÄ“; #5CC7 -峈 > lùo; #5CC8 -峉 > Ä“; #5CC9 -峊 > fù; #5CCA -峋 > xún; #5CCB -峌 > dié; #5CCC -å³ > lù; #5CCD -峎 > Än; #5CCE -å³ > Ä•r; #5CCF -å³ > gÄi; #5CD0 -峑 > quán; #5CD1 -å³’ > tóng; #5CD2 -峓 > yí; #5CD3 -å³” > mÅ­; #5CD4 -峕 > shí; #5CD5 -å³– > Än; #5CD6 -å³— > wéi; #5CD7 -峘 > hÅ«; #5CD8 -å³™ > zhì; #5CD9 -峚 > mì; #5CDA -å³› > lÄ­; #5CDB -峜 > jÄ«; #5CDC -å³ > tóng; #5CDD -峞 > wéi; #5CDE -峟 > yòu; #5CDF -峡 > xiá; #5CE1 -å³¢ > lÄ­; #5CE2 -å³£ > yáo; #5CE3 -峤 > jiào; #5CE4 -å³¥ > zhÄ“ng; #5CE5 -峦 > luán; #5CE6 -峧 > jiÄo; #5CE7 -峨 > é; #5CE8 -峩 > é; #5CE9 -峪 > yù; #5CEA -峫 > yé; #5CEB -峬 > bÅ«; #5CEC -å³­ > qiào; #5CED -å³® > qÅ«n; #5CEE -峯 > fÄ“ng; #5CEF -å³° > fÄ“ng; #5CF0 -å³± > náo; #5CF1 -å³² > lÄ­; #5CF2 -å³³ > yóu; #5CF3 -å³´ > xiàn; #5CF4 -å³µ > hóng; #5CF5 -島 > dăo; #5CF6 -å³· > shÄ“n; #5CF7 -峸 > chéng; #5CF8 -å³¹ > tú; #5CF9 -峺 > gÄ•ng; #5CFA -å³» > jùn; #5CFB -å³¼ > hào; #5CFC -å³½ > xiá; #5CFD -å³¾ > yÄ«n; #5CFE -峿 > yÅ­; #5CFF -å´€ > làng; #5D00 -å´ > kăn; #5D01 -å´‚ > láo; #5D02 -å´ƒ > lái; #5D03 -å´„ > xiăn; #5D04 -å´… > què; #5D05 -å´† > kÅng; #5D06 -å´‡ > chóng; #5D07 -å´ˆ > chóng; #5D08 -å´‰ > tà; #5D09 -å´Š > lin; #5D0A -å´‹ > huá; #5D0B -å´Œ > jÅ«; #5D0C -å´ > lái; #5D0D -å´Ž > qí; #5D0E -å´ > mín; #5D0F -å´ > kÅ«n; #5D10 -å´‘ > kÅ«n; #5D11 -å´’ > zú; #5D12 -å´“ > gù; #5D13 -å´” > cÅ«i; #5D14 -å´• > yá; #5D15 -å´– > yá; #5D16 -å´— > găng; #5D17 -å´˜ > lún; #5D18 -å´™ > lún; #5D19 -å´š > léng; #5D1A -å´› > jué; #5D1B -å´œ > dÅ«o; #5D1C -å´ > zhÄ“ng; #5D1D -å´ž > gÅ«o; #5D1E -å´Ÿ > yín; #5D1F -å´  > dÅng; #5D20 -å´¡ > hán; #5D21 -å´¢ > zhÄ“ng; #5D22 -å´£ > wÄ•i; #5D23 -å´¤ > yáo; #5D24 -å´¥ > pÄ­; #5D25 -å´¦ > yÄn; #5D26 -å´§ > sÅng; #5D27 -å´¨ > jié; #5D28 -å´© > bÄ“ng; #5D29 -å´ª > zú; #5D2A -å´« > jué; #5D2B -å´¬ > dÅng; #5D2C -å´­ > zhăn; #5D2D -å´® > gù; #5D2E -å´¯ > yín; #5D2F -å´± > zé; #5D31 -å´² > huáng; #5D32 -å´³ > yú; #5D33 -å´´ > wÄ“i; #5D34 -å´µ > yáng; #5D35 -å´¶ > fÄ“ng; #5D36 -å´· > qíu; #5D37 -å´¸ > dùn; #5D38 -å´¹ > tí; #5D39 -å´º > yÄ­; #5D3A -å´» > zhì; #5D3B -å´¼ > shì; #5D3C -å´½ > zăi; #5D3D -å´¾ > yăo; #5D3E -å´¿ > è; #5D3F -åµ€ > zhù; #5D40 -åµ > kÄn; #5D41 -嵂 > lÇœ; #5D42 -嵃 > yăn; #5D43 -嵄 > mÄ•i; #5D44 -åµ… > gÄn; #5D45 -嵆 > jÄ«; #5D46 -嵇 > jÄ«; #5D47 -嵈 > huăn; #5D48 -嵉 > tíng; #5D49 -嵊 > shèng; #5D4A -嵋 > méi; #5D4B -嵌 > qiàn; #5D4C -åµ > wù; #5D4D -嵎 > yú; #5D4E -åµ > zÅng; #5D4F -åµ > lán; #5D50 -嵑 > jué; #5D51 -åµ’ > yán; #5D52 -嵓 > yán; #5D53 -åµ” > wÄ•i; #5D54 -嵕 > zÅng; #5D55 -åµ– > chá; #5D56 -åµ— > sùi; #5D57 -嵘 > róng; #5D58 -嵚 > qÄ«n; #5D5A -åµ› > yú; #5D5B -åµ > lÅu; #5D5D -嵞 > tú; #5D5E -嵟 > dÅ«i; #5D5F -åµ  > xÄ«; #5D60 -嵡 > wÄ“ng; #5D61 -åµ¢ > cÄng; #5D62 -åµ£ > dÄng; #5D63 -嵤 > hóng; #5D64 -åµ¥ > jié; #5D65 -嵦 > ái; #5D66 -嵧 > líu; #5D67 -嵨 > wÅ­; #5D68 -嵩 > sÅng; #5D69 -嵪 > qiÄo; #5D6A -嵫 > zÄ«; #5D6B -嵬 > wéi; #5D6C -åµ­ > bÄ“ng; #5D6D -åµ® > diÄn; #5D6E -嵯 > cúo; #5D6F -åµ° > qiăn; #5D70 -åµ± > yÅng; #5D71 -åµ² > niè; #5D72 -åµ³ > cúo; #5D73 -åµ´ > jí; #5D74 -åµ· > sÅng; #5D77 -嵸 > zÅng; #5D78 -åµ¹ > jiàng; #5D79 -嵺 > liáo; #5D7A -åµ» > kang; #5D7B -åµ¼ > chăn; #5D7C -åµ½ > dié; #5D7D -åµ¾ > cÄ“n; #5D7E -嵿 > dÄ­ng; #5D7F -嶀 > tÅ«; #5D80 -å¶ > lÅu; #5D81 -嶂 > zhàng; #5D82 -嶃 > zhăn; #5D83 -嶄 > zhăn; #5D84 -嶅 > áo; #5D85 -嶆 > cáo; #5D86 -嶇 > qÅ«; #5D87 -嶈 > qiÄng; #5D88 -嶉 > zÅ«i; #5D89 -嶊 > zÅ­i; #5D8A -嶋 > dăo; #5D8B -嶌 > dăo; #5D8C -å¶ > xí; #5D8D -嶎 > yù; #5D8E -å¶ > bó; #5D8F -å¶ > lóng; #5D90 -嶑 > xiăng; #5D91 -嶒 > céng; #5D92 -嶓 > bÅ; #5D93 -嶔 > qÄ«n; #5D94 -嶕 > jiÄo; #5D95 -嶖 > yăn; #5D96 -嶗 > láo; #5D97 -嶘 > zhàn; #5D98 -嶙 > lín; #5D99 -嶚 > liáo; #5D9A -嶛 > liáo; #5D9B -嶜 > jÄ«n; #5D9C -å¶ > dèng; #5D9D -嶞 > dùo; #5D9E -嶟 > zÅ«n; #5D9F -嶠 > jiào; #5DA0 -嶡 > gùi; #5DA1 -嶢 > yáo; #5DA2 -嶣 > qiáo; #5DA3 -嶤 > yáo; #5DA4 -嶥 > jué; #5DA5 -嶦 > zhÄn; #5DA6 -嶧 > yì; #5DA7 -嶨 > xué; #5DA8 -嶩 > náo; #5DA9 -嶪 > yè; #5DAA -嶫 > yè; #5DAB -嶬 > yí; #5DAC -嶭 > è; #5DAD -嶮 > xiăn; #5DAE -嶯 > jí; #5DAF -嶰 > xiè; #5DB0 -嶱 > kÄ•; #5DB1 -嶲 > xÄ«; #5DB2 -嶳 > dì; #5DB3 -嶴 > ào; #5DB4 -嶵 > zÅ­i; #5DB5 -嶷 > nì; #5DB7 -嶸 > róng; #5DB8 -嶹 > dăo; #5DB9 -嶺 > lÄ­ng; #5DBA -嶻 > zá; #5DBB -嶼 > yÅ­; #5DBC -嶽 > yuè; #5DBD -嶾 > yÄ­n; #5DBE -å·€ > jiÄ“; #5DC0 -å· > lì; #5DC1 -å·‚ > sÅ­i; #5DC2 -å·ƒ > lóng; #5DC3 -å·„ > lóng; #5DC4 -å·… > diÄn; #5DC5 -å·† > yíng; #5DC6 -å·‡ > xÄ«; #5DC7 -å·ˆ > jú; #5DC8 -å·‰ > chán; #5DC9 -å·Š > yÄ­ng; #5DCA -å·‹ > kÅ«i; #5DCB -å·Œ > yán; #5DCC -å· > wÄ“i; #5DCD -å·Ž > náo; #5DCE -å· > quán; #5DCF -å· > chăo; #5DD0 -å·‘ > cuán; #5DD1 -å·’ > luán; #5DD2 -å·“ > diÄn; #5DD3 -å·” > diÄn; #5DD4 -å·– > yán; #5DD6 -å·— > yán; #5DD7 -å·˜ > yăn; #5DD8 -å·™ > náo; #5DD9 -å·š > yăn; #5DDA -å·› > chuÄn; #5DDB -å·œ > gùi; #5DDC -å· > chuÄn; #5DDD -å·ž > zhÅu; #5DDE -å·Ÿ > huÄng; #5DDF -å·  > jÄ«ng; #5DE0 -å·¡ > xún; #5DE1 -å·¢ > cháo; #5DE2 -å·£ > cháo; #5DE3 -å·¤ > liÄ“; #5DE4 -å·¥ > gÅng; #5DE5 -å·¦ > zÅ­o; #5DE6 -å·§ > qiăo; #5DE7 -å·¨ > jù; #5DE8 -å·© > gÅng; #5DE9 -å·« > wÅ«; #5DEB -å·® > chÄi; #5DEE -å·¯ > qíu; #5DEF -å·° > qíu; #5DF0 -å·± > jÄ­; #5DF1 -å·² > yÄ­; #5DF2 -å·³ > sì; #5DF3 -å·´ > bÄ; #5DF4 -å·µ > zhÄ«; #5DF5 -å·¶ > zhÄo; #5DF6 -å·· > xiàng; #5DF7 -å·¸ > yí; #5DF8 -å·¹ > jÄ­n; #5DF9 -å·º > xùn; #5DFA -å·» > juàn; #5DFB -å·½ > xùn; #5DFD -å·¾ > jÄ«n; #5DFE -å·¿ > fú; #5DFF -帀 > zÄ; #5E00 -å¸ > bì; #5E01 -市 > shì; #5E02 -布 > bù; #5E03 -帄 > dÄ«ng; #5E04 -帅 > shuài; #5E05 -帆 > fÄn; #5E06 -帇 > niè; #5E07 -师 > shÄ«; #5E08 -帉 > fÄ“n; #5E09 -帊 > pà; #5E0A -帋 > zhÄ­; #5E0B -希 > xÄ«; #5E0C -å¸ > hù; #5E0D -帎 > dàn; #5E0E -å¸ > wéi; #5E0F -å¸ > zhàng; #5E10 -帑 > tăng; #5E11 -帒 > dài; #5E12 -帓 > mà; #5E13 -帔 > pèi; #5E14 -帕 > pà; #5E15 -帖 > tiÄ“; #5E16 -帗 > fú; #5E17 -帘 > lián; #5E18 -帙 > zhì; #5E19 -帚 > zhÅu; #5E1A -帛 > bó; #5E1B -帜 > zhì; #5E1C -å¸ > dì; #5E1D -帞 > mò; #5E1E -帟 > yì; #5E1F -帠 > yì; #5E20 -帡 > píng; #5E21 -帢 > qià; #5E22 -帣 > juàn; #5E23 -帤 > rú; #5E24 -帥 > shuài; #5E25 -带 > dài; #5E26 -帧 > zhèng; #5E27 -帨 > shùi; #5E28 -帩 > qiào; #5E29 -帪 > zhÄ“n; #5E2A -師 > shÄ«; #5E2B -帬 > qún; #5E2C -席 > xí; #5E2D -帮 > bÄng; #5E2E -帯 > dài; #5E2F -帰 > gÅ«i; #5E30 -帱 > chóu; #5E31 -帲 > píng; #5E32 -帳 > zhàng; #5E33 -帴 > shÄ; #5E34 -帵 > wÄn; #5E35 -帶 > dài; #5E36 -帷 > wéi; #5E37 -常 > cháng; #5E38 -帹 > shà; #5E39 -帺 > qí; #5E3A -帻 > zé; #5E3B -帼 > gúo; #5E3C -帽 > mào; #5E3D -帾 > dÅ­; #5E3E -帿 > hóu; #5E3F -å¹€ > zhèng; #5E40 -å¹ > xÅ«; #5E41 -幂 > mì; #5E42 -幃 > wéi; #5E43 -幄 > wò; #5E44 -å¹… > fú; #5E45 -幆 > yì; #5E46 -幇 > bÄng; #5E47 -幈 > píng; #5E48 -幊 > gÅng; #5E4A -幋 > pán; #5E4B -幌 > huăng; #5E4C -å¹ > dÄo; #5E4D -幎 > mì; #5E4E -å¹ > jiÄ; #5E4F -å¹ > téng; #5E50 -幑 > hÅ«i; #5E51 -å¹’ > zhÅng; #5E52 -幓 > shÄn; #5E53 -å¹” > màn; #5E54 -幕 > mù; #5E55 -å¹– > biÄo; #5E56 -å¹— > gúo; #5E57 -幘 > zé; #5E58 -å¹™ > mù; #5E59 -幚 > bÄng; #5E5A -å¹› > zhàng; #5E5B -幜 > jÄ­ong; #5E5C -å¹ > chăn; #5E5D -幞 > fú; #5E5E -幟 > zhì; #5E5F -å¹  > hÅ«; #5E60 -幡 > fÄn; #5E61 -å¹¢ > chuáng; #5E62 -å¹£ > bì; #5E63 -幦 > mì; #5E66 -幧 > qiÄo; #5E67 -幨 > chÄn; #5E68 -幩 > fén; #5E69 -幪 > méng; #5E6A -幫 > bÄng; #5E6B -幬 > chóu; #5E6C -å¹­ > miè; #5E6D -å¹® > chú; #5E6E -幯 > jié; #5E6F -å¹° > xiăn; #5E70 -å¹± > lán; #5E71 -å¹² > gÄn; #5E72 -å¹³ > píng; #5E73 -å¹´ > nián; #5E74 -å¹µ > qiÄn; #5E75 -并 > bìng; #5E76 -å¹· > bìng; #5E77 -幸 > xìng; #5E78 -å¹¹ > gàn; #5E79 -幺 > yÄo; #5E7A -å¹» > huàn; #5E7B -å¹¼ > yòu; #5E7C -å¹½ > yÅu; #5E7D -å¹¾ > jÄ­; #5E7E -广 > yăn; #5E7F -庀 > pÄ­; #5E80 -åº > tÄ«ng; #5E81 -庂 > zè; #5E82 -広 > guăng; #5E83 -庄 > zhuÄng; #5E84 -庅 > mo; #5E85 -庆 > qìng; #5E86 -庇 > bì; #5E87 -庈 > qín; #5E88 -庉 > dùn; #5E89 -床 > chuáng; #5E8A -庋 > gÅ­i; #5E8B -庌 > yă; #5E8C -åº > bài; #5E8D -庎 > jiè; #5E8E -åº > xù; #5E8F -åº > lú; #5E90 -庑 > wÅ­; #5E91 -库 > kù; #5E93 -应 > yìng; #5E94 -底 > dÄ­; #5E95 -庖 > páo; #5E96 -店 > diàn; #5E97 -庘 > yÄ; #5E98 -庙 > miào; #5E99 -庚 > gÄ“ng; #5E9A -庛 > cÄ«; #5E9B -府 > fÅ­; #5E9C -åº > tóng; #5E9D -庞 > páng; #5E9E -废 > fèi; #5E9F -庠 > xiáng; #5EA0 -庡 > yÄ­; #5EA1 -庢 > zhì; #5EA2 -庣 > tiÄo; #5EA3 -庤 > zhì; #5EA4 -庥 > xÄ«u; #5EA5 -度 > dù; #5EA6 -座 > zùo; #5EA7 -庨 > xiÄo; #5EA8 -庩 > tú; #5EA9 -庪 > gÅ­i; #5EAA -庫 > kù; #5EAB -庬 > páng; #5EAC -庭 > tíng; #5EAD -庮 > yÅu; #5EAE -庯 > bÅ«; #5EAF -庰 > dÄ«ng; #5EB0 -庱 > chÄ•ng; #5EB1 -庲 > lái; #5EB2 -庳 > bÄ“i; #5EB3 -庴 > jí; #5EB4 -庵 > Än; #5EB5 -庶 > shù; #5EB6 -康 > kÄng; #5EB7 -庸 > yÅng; #5EB8 -庹 > tÅ­o; #5EB9 -庺 > sÅng; #5EBA -庻 > shù; #5EBB -庼 > qÄ­ng; #5EBC -庽 > yù; #5EBD -庾 > yÅ­; #5EBE -庿 > miào; #5EBF -廀 > sÅu; #5EC0 -å» > cè; #5EC1 -廂 > xiÄng; #5EC2 -廃 > fèi; #5EC3 -廄 > jìu; #5EC4 -å»… > hé; #5EC5 -廆 > hùi; #5EC6 -廇 > lìu; #5EC7 -廈 > shà; #5EC8 -廉 > lián; #5EC9 -廊 > láng; #5ECA -廋 > sÅu; #5ECB -廌 > jiàn; #5ECC -å» > pÅu; #5ECD -廎 > qÄ­ng; #5ECE -å» > jìu; #5ECF -å» > jìu; #5ED0 -廑 > qín; #5ED1 -å»’ > áo; #5ED2 -廓 > kùo; #5ED3 -å»” > lóu; #5ED4 -廕 > yÄ«n; #5ED5 -å»– > liào; #5ED6 -å»— > dài; #5ED7 -廘 > lù; #5ED8 -å»™ > yì; #5ED9 -廚 > chú; #5EDA -å»› > chán; #5EDB -廜 > tÅ«; #5EDC -å» > sÄ«; #5EDD -廞 > xÄ«n; #5EDE -廟 > miào; #5EDF -å»  > chăng; #5EE0 -廡 > wÅ­; #5EE1 -廢 > fèi; #5EE2 -廣 > guăng; #5EE3 -廥 > kuài; #5EE5 -廦 > bì; #5EE6 -廧 > qiáng; #5EE7 -廨 > xiè; #5EE8 -廩 > lÄ­n; #5EE9 -廪 > lÄ­n; #5EEA -廫 > liáo; #5EEB -廬 > lú; #5EEC -å»® > yíng; #5EEE -廯 > xiÄn; #5EEF -å»° > tÄ«ng; #5EF0 -å»± > yÅng; #5EF1 -廲 > lí; #5EF2 -廳 > tÄ«ng; #5EF3 -å»´ > yÄ­n; #5EF4 -廵 > xún; #5EF5 -延 > yán; #5EF6 -å»· > tíng; #5EF7 -廸 > dí; #5EF8 -廹 > pò; #5EF9 -建 > jiàn; #5EFA -å»» > húi; #5EFB -廼 > năi; #5EFC -廽 > húi; #5EFD -廾 > gòng; #5EFE -廿 > niàn; #5EFF -å¼€ > kÄi; #5F00 -å¼ > biàn; #5F01 -异 > yì; #5F02 -弃 > qì; #5F03 -弄 > nòng; #5F04 -å¼… > fén; #5F05 -弆 > jÅ­; #5F06 -弇 > yăn; #5F07 -弈 > yì; #5F08 -弉 > zàng; #5F09 -弊 > bì; #5F0A -弋 > yì; #5F0B -弌 > yÄ«; #5F0C -å¼ > èr; #5F0D -弎 > sÄn; #5F0E -å¼ > shì; #5F0F -å¼ > èr; #5F10 -弑 > shì; #5F11 -å¼’ > shì; #5F12 -弓 > gÅng; #5F13 -å¼” > diào; #5F14 -引 > yÄ­n; #5F15 -å¼– > hù; #5F16 -å¼— > fú; #5F17 -弘 > hóng; #5F18 -å¼™ > wÅ«; #5F19 -弚 > túi; #5F1A -å¼› > chí; #5F1B -弜 > jiàng; #5F1C -å¼ > bà; #5F1D -弞 > shÄ•n; #5F1E -弟 > dì; #5F1F -å¼  > zhÄng; #5F20 -弡 > jué; #5F21 -å¼¢ > tÄo; #5F22 -å¼£ > fÅ­; #5F23 -弤 > dÄ­; #5F24 -å¼¥ > mí; #5F25 -弦 > xián; #5F26 -弧 > hú; #5F27 -弨 > chÄo; #5F28 -弩 > nÅ­; #5F29 -弪 > jìng; #5F2A -弫 > zhÄ•n; #5F2B -弬 > yí; #5F2C -å¼­ > mÄ­; #5F2D -å¼® > quÄn; #5F2E -弯 > wÄn; #5F2F -å¼° > shÄo; #5F30 -å¼± > rùo; #5F31 -å¼² > xuÄn; #5F32 -å¼³ > jìng; #5F33 -å¼´ > dÅ«n; #5F34 -å¼µ > zhÄng; #5F35 -弶 > jiàng; #5F36 -å¼· > qiáng; #5F37 -弸 > péng; #5F38 -å¼¹ > dàn; #5F39 -强 > qiáng; #5F3A -å¼» > bì; #5F3B -å¼¼ > bì; #5F3C -å¼½ > shè; #5F3D -å¼¾ > dàn; #5F3E -弿 > jiăn; #5F3F -å½€ > gòu; #5F40 -彂 > fÄ; #5F42 -彃 > bì; #5F43 -彄 > kÅu; #5F44 -彆 > biè; #5F46 -彇 > xiÄo; #5F47 -彈 > dàn; #5F48 -彉 > kùo; #5F49 -彊 > qiáng; #5F4A -彋 > hóng; #5F4B -彌 > mí; #5F4C -å½ > kùo; #5F4D -彎 > wÄn; #5F4E -å½ > jué; #5F4F -å½ > jì; #5F50 -彑 > jì; #5F51 -å½’ > gÅ«i; #5F52 -当 > dÄng; #5F53 -å½” > lù; #5F54 -录 > lù; #5F55 -å½– > tuàn; #5F56 -å½— > hùi; #5F57 -彘 > zhì; #5F58 -å½™ > hùi; #5F59 -彚 > hùi; #5F5A -å½› > yí; #5F5B -彜 > yí; #5F5C -å½ > yí; #5F5D -彞 > yí; #5F5E -彟 > hùo; #5F5F -å½  > hùo; #5F60 -彡 > shÄn; #5F61 -å½¢ > xíng; #5F62 -å½£ > wén; #5F63 -彤 > tóng; #5F64 -å½¥ > yàn; #5F65 -彦 > yàn; #5F66 -彧 > yù; #5F67 -彨 > chÄ«; #5F68 -彩 > căi; #5F69 -彪 > biÄo; #5F6A -彫 > diÄo; #5F6B -彬 > bÄ«n; #5F6C -å½­ > péng; #5F6D -å½® > yÅng; #5F6E -彯 > piÄo; #5F6F -å½° > zhÄng; #5F70 -å½± > yÄ­ng; #5F71 -å½² > chÄ«; #5F72 -å½³ > chì; #5F73 -å½´ > zhúo; #5F74 -å½µ > tÅ­o; #5F75 -彶 > jí; #5F76 -å½· > páng; #5F77 -彸 > zhÅng; #5F78 -å½¹ > yì; #5F79 -彺 > wáng; #5F7A -å½» > chè; #5F7B -å½¼ > bÄ­; #5F7C -å½½ > chí; #5F7D -å½¾ > lÄ­ng; #5F7E -彿 > fú; #5F7F -å¾€ > wăng; #5F80 -å¾ > zhÄ“ng; #5F81 -徂 > cú; #5F82 -徃 > wăng; #5F83 -径 > jìng; #5F84 -å¾… > dài; #5F85 -徆 > xÄ«; #5F86 -徇 > xùn; #5F87 -很 > hÄ•n; #5F88 -徉 > yáng; #5F89 -徊 > huái; #5F8A -律 > lÇœ; #5F8B -後 > hòu; #5F8C -å¾ > wÄ; #5F8D -徎 > chÄ•ng; #5F8E -å¾ > zhì; #5F8F -å¾ > xú; #5F90 -徑 > jìng; #5F91 -å¾’ > tú; #5F92 -従 > cóng; #5F93 -徕 > lái; #5F95 -å¾– > cóng; #5F96 -å¾— > dé; #5F97 -徘 > pái; #5F98 -å¾™ > xÄ­; #5F99 -å¾› > qì; #5F9B -徜 > cháng; #5F9C -å¾ > zhì; #5F9D -從 > cóng; #5F9E -徟 > zhÅu; #5F9F -å¾  > lái; #5FA0 -御 > yù; #5FA1 -å¾¢ > xiè; #5FA2 -å¾£ > jiè; #5FA3 -徤 > jiàn; #5FA4 -å¾¥ > chí; #5FA5 -徦 > jiă; #5FA6 -徧 > biàn; #5FA7 -徨 > huáng; #5FA8 -復 > fù; #5FA9 -循 > xún; #5FAA -徫 > wÄ•i; #5FAB -徬 > páng; #5FAC -å¾­ > yáo; #5FAD -å¾® > wÄ“i; #5FAE -徯 > xÄ«; #5FAF -å¾° > zhÄ“ng; #5FB0 -å¾± > piào; #5FB1 -å¾² > chí; #5FB2 -å¾³ > dé; #5FB3 -å¾´ > zhÄ“ng; #5FB4 -å¾µ > zhÄ“ng; #5FB5 -徶 > biè; #5FB6 -å¾· > dé; #5FB7 -徸 > chÅng; #5FB8 -å¾¹ > chè; #5FB9 -徺 > jiăo; #5FBA -å¾» > wèi; #5FBB -å¾¼ > jiào; #5FBC -å¾½ > hÅ«i; #5FBD -å¾¾ > méi; #5FBE -徿 > lòng; #5FBF -å¿€ > xiÄng; #5FC0 -å¿ > bào; #5FC1 -å¿‚ > qú; #5FC2 -心 > xÄ«n; #5FC3 -å¿„ > shù' 'xÄ«n' 'páng; #5FC4 -å¿… > bì; #5FC5 -忆 > yì; #5FC6 -忇 > lè; #5FC7 -忈 > rén; #5FC8 -忉 > dÄo; #5FC9 -å¿Š > dìng; #5FCA -å¿‹ > găi; #5FCB -å¿Œ > jì; #5FCC -å¿ > rÄ•n; #5FCD -å¿Ž > rén; #5FCE -å¿ > chàn; #5FCF -å¿ > tăn; #5FD0 -å¿‘ > tè; #5FD1 -å¿’ > tè; #5FD2 -å¿“ > gÄn; #5FD3 -å¿” > qì; #5FD4 -å¿• > shì; #5FD5 -å¿– > cÅ­n; #5FD6 -å¿— > zhì; #5FD7 -忘 > wàng; #5FD8 -å¿™ > máng; #5FD9 -å¿š > xÄ«; #5FDA -å¿› > fán; #5FDB -å¿œ > yÄ«ng; #5FDC -å¿ > tiăn; #5FDD -å¿ž > mín; #5FDE -å¿Ÿ > mín; #5FDF -å¿  > zhÅng; #5FE0 -å¿¡ > chÅng; #5FE1 -å¿¢ > wù; #5FE2 -å¿£ > jí; #5FE3 -忤 > wÅ­; #5FE4 -å¿¥ > xì; #5FE5 -忦 > yè; #5FE6 -忧 > yÅu; #5FE7 -忨 > wàn; #5FE8 -å¿© > cÅng; #5FE9 -忪 > zhÅng; #5FEA -å¿« > kuài; #5FEB -忬 > yù; #5FEC -å¿­ > biàn; #5FED -å¿® > zhì; #5FEE -忯 > qí; #5FEF -å¿° > cùi; #5FF0 -忱 > chén; #5FF1 -忲 > tài; #5FF2 -忳 > tún; #5FF3 -å¿´ > qián; #5FF4 -念 > niàn; #5FF5 -忶 > hún; #5FF6 -å¿· > xÄ«ong; #5FF7 -忸 > nÄ­u; #5FF8 -忹 > wăng; #5FF9 -忺 > xiÄn; #5FFA -å¿» > xÄ«n; #5FFB -忼 > kÄng; #5FFC -忽 > hÅ«; #5FFD -忾 > kài; #5FFE -å¿¿ > fèn; #5FFF -怀 > huái; #6000 -æ€ > tài; #6001 -怂 > sÅng; #6002 -怃 > wÅ­; #6003 -怄 > òu; #6004 -怅 > chàng; #6005 -怆 > chuàng; #6006 -怇 > jù; #6007 -怈 > yì; #6008 -怉 > băo; #6009 -怊 > chÄo; #600A -怋 > mín; #600B -怌 > pÄ“i; #600C -æ€ > zùo; #600D -怎 > zÄ•n; #600E -æ€ > yàng; #600F -æ€ > kòu; #6010 -怑 > bàn; #6011 -怒 > nù; #6012 -怓 > náo; #6013 -怔 > zhÄ“ng; #6014 -怕 > pà; #6015 -怖 > bù; #6016 -怗 > tiÄ“; #6017 -怘 > gù; #6018 -怙 > hù; #6019 -怚 > jù; #601A -怛 > dá; #601B -怜 > lián; #601C -æ€ > sÄ«; #601D -怞 > chÅu; #601E -怟 > dì; #601F -怠 > dài; #6020 -怡 > yí; #6021 -怢 > tú; #6022 -怣 > yóu; #6023 -怤 > fÅ«; #6024 -急 > jí; #6025 -怦 > pÄ“ng; #6026 -性 > xìng; #6027 -怨 > yuàn; #6028 -怩 > ní; #6029 -怪 > guài; #602A -怫 > fú; #602B -怬 > xì; #602C -怭 > bì; #602D -怮 > yÅu; #602E -怯 > qiè; #602F -怰 > xuàn; #6030 -怱 > cÅng; #6031 -怲 > bÄ­ng; #6032 -怳 > huăng; #6033 -怴 > xù; #6034 -怵 > chù; #6035 -怶 > pÄ«; #6036 -怷 > xÄ«; #6037 -怸 > xÄ«; #6038 -怹 > tÄn; #6039 -总 > zÅng; #603B -怼 > dùi; #603C -怿 > yì; #603F -æ€ > chÄ­; #6040 -æ > rèn; #6041 -æ‚ > xún; #6042 -æƒ > shì; #6043 -æ„ > xì; #6044 -æ… > lăo; #6045 -æ† > héng; #6046 -æ‡ > kuÄng; #6047 -æˆ > mú; #6048 -æ‰ > zhÄ­; #6049 -æŠ > xié; #604A -æ‹ > liàn; #604B -æŒ > tiÄo; #604C -æ > huăng; #604D -æŽ > dié; #604E -æ > hăo; #604F -æ > kÅng; #6050 -æ‘ > gÅ­i; #6051 -æ’ > héng; #6052 -æ“ > xÄ«; #6053 -æ” > xiào; #6054 -æ• > shù; #6055 -æ– > sÄ«; #6056 -æ— > kuă; #6057 -æ˜ > qÄ«u; #6058 -æ™ > yàng; #6059 -æš > hùi; #605A -æ› > húi; #605B -æœ > chì; #605C -æ > jiá; #605D -æž > yí; #605E -æŸ > xÄ«ong; #605F -æ  > guài; #6060 -æ¡ > lìn; #6061 -æ¢ > hÅ«i; #6062 -æ£ > zì; #6063 -æ¤ > xù; #6064 -æ¥ > chÄ­; #6065 -æ¦ > xiàng; #6066 -æ§ > nÇœ; #6067 -æ¨ > hèn; #6068 -æ© > Ä“n; #6069 -æª > kè; #606A -æ« > tÅng; #606B -æ¬ > tián; #606C -æ­ > gÅng; #606D -æ® > quán; #606E -æ¯ > xÄ«; #606F -æ° > qià; #6070 -æ± > yuè; #6071 -æ² > pÄ“ng; #6072 -æ³ > kÄ•n; #6073 -æ´ > dé; #6074 -æµ > hùi; #6075 -æ¶ > è; #6076 -æ¸ > tòng; #6078 -æ¹ > yàn; #6079 -æº > kăi; #607A -æ» > cè; #607B -æ¼ > năo; #607C -æ½ > yùn; #607D -æ¾ > máng; #607E -æ¿ > yÅng; #607F -æ‚€ > yÅng; #6080 -æ‚ > yuÄn; #6081 -æ‚‚ > pÄ«; #6082 -悃 > kÅ­n; #6083 -æ‚„ > qiăo; #6084 -æ‚… > yuè; #6085 -悆 > yù; #6086 -悇 > yù; #6087 -悈 > jiè; #6088 -悉 > xÄ«; #6089 -æ‚Š > zhé; #608A -æ‚‹ > lìn; #608B -æ‚Œ > tì; #608C -æ‚ > hàn; #608D -æ‚Ž > hào; #608E -æ‚ > qiè; #608F -æ‚ > tì; #6090 -æ‚‘ > bù; #6091 -æ‚’ > yì; #6092 -æ‚“ > qiàn; #6093 -æ‚” > hÅ­i; #6094 -æ‚• > xÄ«; #6095 -æ‚– > bèi; #6096 -æ‚— > mán; #6097 -悘 > yÄ«; #6098 -æ‚™ > hÄ“ng; #6099 -æ‚š > sÅng; #609A -æ‚› > quÄn; #609B -æ‚œ > chÄ•ng; #609C -æ‚ > hÅ«i; #609D -æ‚ž > wù; #609E -æ‚Ÿ > wù; #609F -æ‚  > yÅu; #60A0 -æ‚¡ > lí; #60A1 -æ‚¢ > liàng; #60A2 -æ‚£ > huàn; #60A3 -悤 > cÅng; #60A4 -æ‚¥ > yì; #60A5 -悦 > yuè; #60A6 -悧 > lì; #60A7 -您 > nín; #60A8 -æ‚© > năo; #60A9 -悪 > è; #60AA -æ‚« > què; #60AB -悬 > xuán; #60AC -æ‚­ > qiÄn; #60AD -æ‚® > wù; #60AE -悯 > mÄ­n; #60AF -æ‚° > cóng; #60B0 -悱 > fÄ•i; #60B1 -悲 > bÄ“i; #60B2 -悳 > dúo; #60B3 -æ‚´ > cùi; #60B4 -悵 > chàng; #60B5 -悶 > mèn; #60B6 -æ‚· > lì; #60B7 -悸 > jì; #60B8 -悹 > guàn; #60B9 -悺 > guàn; #60BA -æ‚» > xìng; #60BB -悼 > dào; #60BC -悽 > qÄ«; #60BD -悾 > kÅng; #60BE -æ‚¿ > tiăn; #60BF -惀 > lún; #60C0 -æƒ > xÄ«; #60C1 -惂 > kăn; #60C2 -惃 > kÅ«n; #60C3 -惄 > nì; #60C4 -情 > qíng; #60C5 -惆 > chóu; #60C6 -惇 > dÅ«n; #60C7 -惈 > gÅ­o; #60C8 -惉 > chÄn; #60C9 -惊 > liáng; #60CA -惋 > wăn; #60CB -惌 > yuÄn; #60CC -æƒ > jÄ«n; #60CD -惎 > jì; #60CE -æƒ > lín; #60CF -æƒ > yù; #60D0 -惑 > hùo; #60D1 -惒 > hé; #60D2 -惓 > quán; #60D3 -惔 > tán; #60D4 -惕 > tì; #60D5 -惖 > tì; #60D6 -惗 > niÄ“; #60D7 -惘 > wăng; #60D8 -惙 > chùo; #60D9 -惚 > bÅ«; #60DA -惛 > hÅ«n; #60DB -惜 > xÄ«; #60DC -æƒ > tăng; #60DD -惞 > xÄ«n; #60DE -惟 > wéi; #60DF -惠 > hùi; #60E0 -惡 > è; #60E1 -惢 > rÅ­i; #60E2 -惣 > zÅng; #60E3 -惤 > jiÄn; #60E4 -惥 > yÅng; #60E5 -惦 > diàn; #60E6 -惧 > jù; #60E7 -惨 > căn; #60E8 -惩 > chéng; #60E9 -惪 > dé; #60EA -惫 > bèi; #60EB -惬 > qiè; #60EC -惭 > cán; #60ED -惮 > dàn; #60EE -惯 > guàn; #60EF -惰 > dùo; #60F0 -惱 > năo; #60F1 -惲 > yùn; #60F2 -想 > xiăng; #60F3 -惴 > zhùi; #60F4 -惵 > diè; #60F5 -惶 > huáng; #60F6 -惷 > chÅ­n; #60F7 -惸 > qíong; #60F8 -惹 > rÄ•; #60F9 -惺 > xÄ«ng; #60FA -惻 > cè; #60FB -惼 > biăn; #60FC -惽 > hÅ«n; #60FD -惾 > zÅng; #60FE -惿 > tí; #60FF -æ„€ > qiăo; #6100 -æ„ > chóu; #6101 -æ„‚ > bèi; #6102 -愃 > xuÄn; #6103 -æ„„ > wÄ“i; #6104 -æ„… > gé; #6105 -愆 > qiÄn; #6106 -愇 > wÄ•i; #6107 -愈 > yù; #6108 -愉 > yú; #6109 -æ„Š > bì; #610A -æ„‹ > xuÄn; #610B -æ„Œ > huàn; #610C -æ„ > mÄ­n; #610D -æ„Ž > bì; #610E -æ„ > yì; #610F -æ„ > miăn; #6110 -æ„‘ > yÅng; #6111 -æ„’ > kài; #6112 -æ„“ > dàng; #6113 -æ„” > yÄ«n; #6114 -æ„• > è; #6115 -æ„– > chén; #6116 -æ„— > mòu; #6117 -愘 > kè; #6118 -æ„™ > kè; #6119 -æ„š > yú; #611A -æ„› > ài; #611B -æ„œ > qiè; #611C -æ„ > yăn; #611D -æ„ž > nùo; #611E -æ„Ÿ > găn; #611F -æ„  > yùn; #6120 -æ„¡ > zÅng; #6121 -æ„¢ > sÄi; #6122 -æ„£ > léng; #6123 -愤 > fèn; #6124 -愦 > kùi; #6126 -愧 > kùi; #6127 -愨 > què; #6128 -æ„© > gÅng; #6129 -愪 > yún; #612A -æ„« > sù; #612B -愬 > sù; #612C -æ„­ > qí; #612D -æ„® > yáo; #612E -愯 > sÅng; #612F -æ„° > huăng; #6130 -愱 > jí; #6131 -愲 > gÅ­; #6132 -愳 > jù; #6133 -æ„´ > chuàng; #6134 -愵 > nì; #6135 -愶 > xié; #6136 -æ„· > kăi; #6137 -愸 > zhÄ•ng; #6138 -愹 > yÅng; #6139 -愺 > căo; #613A -æ„» > sùn; #613B -愼 > shèn; #613C -愽 > bó; #613D -愾 > kài; #613E -æ„¿ > yuàn; #613F -æ…€ > xié; #6140 -æ… > hùn; #6141 -æ…‚ > yÅng; #6142 -æ…ƒ > yăng; #6143 -æ…„ > lì; #6144 -æ…… > sÄo; #6145 -æ…† > tÄo; #6146 -æ…‡ > yÄ«n; #6147 -æ…ˆ > cí; #6148 -æ…‰ > xù; #6149 -æ…Š > qiàn; #614A -æ…‹ > tài; #614B -æ…Œ > huÄng; #614C -æ… > yùn; #614D -æ…Ž > shèn; #614E -æ… > mÄ­ng; #614F -æ…‘ > shè; #6151 -æ…’ > cóng; #6152 -æ…“ > piào; #6153 -æ…” > mò; #6154 -æ…• > mù; #6155 -æ…– > gúo; #6156 -æ…— > chì; #6157 -æ…˜ > căn; #6158 -æ…™ > cán; #6159 -æ…š > cán; #615A -æ…› > cúi; #615B -æ…œ > mÄ­n; #615C -æ… > tè; #615D -æ…ž > zhÄng; #615E -æ…Ÿ > tòng; #615F -æ…  > ào; #6160 -æ…¡ > shuăng; #6161 -æ…¢ > màn; #6162 -æ…£ > guàn; #6163 -æ…¤ > què; #6164 -æ…¥ > zào; #6165 -æ…¦ > jìu; #6166 -æ…§ > hùi; #6167 -æ…¨ > kăi; #6168 -æ…© > lián; #6169 -æ…ª > òu; #616A -æ…« > sÅng; #616B -æ…¬ > jÄ­n; #616C -æ…­ > yìn; #616D -æ…® > lÇœ; #616E -æ…¯ > shÄng; #616F -æ…° > wèi; #6170 -æ…± > tuán; #6171 -æ…² > mán; #6172 -æ…³ > qiÄn; #6173 -æ…´ > shè; #6174 -æ…µ > yÅng; #6175 -æ…¶ > qìng; #6176 -æ…· > kÄng; #6177 -æ…¸ > dì; #6178 -æ…¹ > zhí; #6179 -æ…º > lóu; #617A -æ…» > juàn; #617B -æ…¼ > qÄ«; #617C -æ…½ > qÄ«; #617D -æ…¾ > yù; #617E -æ…¿ > píng; #617F -憀 > liáo; #6180 -æ† > cÅng; #6181 -憂 > yÅu; #6182 -憃 > chÅng; #6183 -憄 > zhì; #6184 -憅 > tòng; #6185 -憆 > chÄ“ng; #6186 -憇 > qì; #6187 -憈 > qÅ«; #6188 -憉 > péng; #6189 -憊 > bèi; #618A -憋 > biÄ“; #618B -憌 > chún; #618C -æ† > jiÄo; #618D -憎 > zÄ“ng; #618E -æ† > chì; #618F -æ† > lián; #6190 -憑 > píng; #6191 -憒 > kùi; #6192 -憓 > hùi; #6193 -憔 > qiáo; #6194 -憕 > chéng; #6195 -憖 > yìn; #6196 -憗 > yìn; #6197 -憘 > xÄ­; #6198 -憙 > xÄ­; #6199 -憚 > dàn; #619A -憛 > tán; #619B -憜 > dÅ­o; #619C -æ† > dùi; #619D -憞 > dùi; #619E -憟 > sù; #619F -憠 > jué; #61A0 -憡 > cè; #61A1 -憢 > xiÄo; #61A2 -憣 > fán; #61A3 -憤 > fèn; #61A4 -憥 > láo; #61A5 -憦 > lào; #61A6 -憧 > chÅng; #61A7 -憨 > hÄn; #61A8 -憩 > qì; #61A9 -憪 > xián; #61AA -憫 > mÄ­n; #61AB -憬 > jÄ­ng; #61AC -憭 > liăo; #61AD -憮 > wÅ­; #61AE -憯 > căn; #61AF -憰 > jué; #61B0 -憱 > cù; #61B1 -憲 > xiàn; #61B2 -憳 > tăn; #61B3 -憴 > shéng; #61B4 -憵 > pÄ«; #61B5 -憶 > yì; #61B6 -憷 > chÅ­; #61B7 -憸 > xiÄn; #61B8 -憹 > náo; #61B9 -憺 > dàn; #61BA -憻 > tăn; #61BB -憼 > jÄ­ng; #61BC -憽 > sÅng; #61BD -憾 > hàn; #61BE -憿 > jiÄo; #61BF -懀 > wài; #61C0 -æ‡ > huán; #61C1 -懂 > dÅng; #61C2 -懃 > qín; #61C3 -懄 > qín; #61C4 -懅 > qú; #61C5 -懆 > căo; #61C6 -懇 > kÄ•n; #61C7 -懈 > xiè; #61C8 -應 > yìng; #61C9 -懊 > ào; #61CA -懋 > mào; #61CB -懌 > yì; #61CC -æ‡ > lÄ­n; #61CD -懎 > sè; #61CE -æ‡ > jùn; #61CF -æ‡ > huái; #61D0 -懑 > mèn; #61D1 -懒 > lăn; #61D2 -懓 > ài; #61D3 -懔 > lÄ­n; #61D4 -懕 > yÄn; #61D5 -懖 > guÄ; #61D6 -懗 > xià; #61D7 -懘 > chì; #61D8 -懙 > yÅ­; #61D9 -懚 > yìn; #61DA -懛 > dÄi; #61DB -懜 > mèng; #61DC -æ‡ > ài; #61DD -懞 > méng; #61DE -懟 > dùi; #61DF -懠 > qí; #61E0 -懡 > mÅ; #61E1 -懢 > lán; #61E2 -懣 > mèn; #61E3 -懤 > chóu; #61E4 -懥 > zhì; #61E5 -懦 > nùo; #61E6 -懧 > nùo; #61E7 -懨 > yÄn; #61E8 -懩 > yăng; #61E9 -懪 > bó; #61EA -懫 > zhí; #61EB -懬 > kuàng; #61EC -懭 > kuàng; #61ED -懮 > yÅu; #61EE -懯 > fÅ«; #61EF -懰 > líu; #61F0 -懱 > miè; #61F1 -懲 > chéng; #61F2 -懴 > chàn; #61F4 -懵 > méng; #61F5 -懶 > lăn; #61F6 -懷 > huái; #61F7 -懸 > xuán; #61F8 -懹 > ràng; #61F9 -懺 > chàn; #61FA -懻 > jì; #61FB -懼 > jù; #61FC -懽 > huÄn; #61FD -懾 > shè; #61FE -懿 > yì; #61FF -戀 > liàn; #6200 -æˆ > năn; #6201 -戂 > mí; #6202 -戃 > tăng; #6203 -戄 > jué; #6204 -戅 > gàng; #6205 -戆 > gàng; #6206 -戇 > gàng; #6207 -戈 > gÄ“; #6208 -戉 > yuè; #6209 -戊 > wù; #620A -戋 > jiÄn; #620B -戌 > xÅ«; #620C -æˆ > shù; #620D -戎 > róng; #620E -æˆ > xì; #620F -æˆ > chéng; #6210 -我 > wÅ; #6211 -戒 > jiè; #6212 -戓 > gÄ“; #6213 -戔 > jiÄn; #6214 -戕 > qiÄng; #6215 -或 > hùo; #6216 -戗 > qiÄng; #6217 -战 > zhàn; #6218 -戙 > dòng; #6219 -戚 > qÄ«; #621A -戛 > jiá; #621B -戜 > dié; #621C -æˆ > zéi; #621D -戞 > jiá; #621E -戟 > jÄ­; #621F -戠 > shì; #6220 -戡 > kÄn; #6221 -戢 > jí; #6222 -戣 > kúi; #6223 -戤 > gài; #6224 -戥 > dÄ•ng; #6225 -戦 > zhàn; #6226 -戧 > chuÄng; #6227 -戨 > gÄ“; #6228 -戩 > jiăn; #6229 -截 > jié; #622A -戫 > yù; #622B -戬 > jiăn; #622C -戭 > yăn; #622D -戮 > lù; #622E -戯 > xì; #622F -戰 > zhàn; #6230 -戱 > xì; #6231 -戲 > xì; #6232 -戳 > chÅ«o; #6233 -戴 > dài; #6234 -戵 > qú; #6235 -戶 > hù; #6236 -户 > hù; #6237 -戸 > hù; #6238 -戹 > è; #6239 -戺 > shì; #623A -戻 > lì; #623B -戼 > măo; #623C -戽 > hù; #623D -戾 > lì; #623E -房 > fáng; #623F -所 > sÅ­o; #6240 -æ‰ > biăn; #6241 -扂 > diàn; #6242 -扃 > jÄ«ong; #6243 -扄 > shăng; #6244 -扅 > yí; #6245 -扆 > yÄ­; #6246 -扇 > shàn; #6247 -扈 > hù; #6248 -扉 > fÄ“i; #6249 -扊 > yăn; #624A -手 > shÅu; #624B -扌 > tÌ„' 'shÅu' 'páng; #624C -æ‰ > cái; #624D -扎 > zhÄ; #624E -æ‰ > qíu; #624F -æ‰ > lè; #6250 -扑 > bÅ«; #6251 -扒 > bÄ; #6252 -打 > dă; #6253 -扔 > rÄ“ng; #6254 -払 > fú; #6255 -扗 > zài; #6257 -托 > tÅ«o; #6258 -扙 > zhàng; #6259 -扚 > diÄo; #625A -扛 > káng; #625B -扜 > yÅ«; #625C -æ‰ > kÅ«; #625D -扞 > hàn; #625E -扟 > shÄ“n; #625F -扠 > chÄ; #6260 -扡 > yÄ­; #6261 -扢 > gÅ­; #6262 -扣 > kòu; #6263 -扤 > wù; #6264 -扥 > tÅ«o; #6265 -扦 > qiÄn; #6266 -执 > zhí; #6267 -扨 > rèn; #6268 -扩 > kùo; #6269 -扪 > mén; #626A -扫 > săo; #626B -扬 > yáng; #626C -扭 > nÄ­u; #626D -扮 > bàn; #626E -扯 > chÄ•; #626F -扰 > răo; #6270 -扱 > xÄ«; #6271 -扲 > qián; #6272 -扳 > bÄn; #6273 -扴 > jiá; #6274 -扵 > yú; #6275 -扶 > fú; #6276 -扷 > ào; #6277 -扸 > xÄ«; #6278 -批 > pÄ«; #6279 -扺 > zhÄ­; #627A -扻 > zì; #627B -扼 > è; #627C -扽 > dùn; #627D -找 > zhăo; #627E -承 > chéng; #627F -技 > jì; #6280 -æŠ > yăn; #6281 -抂 > kuáng; #6282 -抃 > biàn; #6283 -抄 > chÄo; #6284 -抅 > jÅ«; #6285 -抆 > wèn; #6286 -抇 > hú; #6287 -抈 > yuè; #6288 -抉 > jué; #6289 -把 > bă; #628A -抋 > qìn; #628B -抌 > zhÄ•n; #628C -æŠ > zhÄ•ng; #628D -抎 > yÅ­n; #628E -æŠ > wán; #628F -æŠ > nù; #6290 -抑 > yì; #6291 -抒 > shÅ«; #6292 -抓 > zhuÄ; #6293 -抔 > póu; #6294 -投 > tóu; #6295 -抖 > dÅu; #6296 -抗 > kàng; #6297 -折 > zhé; #6298 -抙 > póu; #6299 -抚 > fÅ­; #629A -抛 > pÄo; #629B -抜 > bá; #629C -æŠ > ăo; #629D -択 > zé; #629E -抟 > tuán; #629F -抠 > kÅu; #62A0 -抡 > lún; #62A1 -抢 > qiăng; #62A2 -护 > hù; #62A4 -报 > bào; #62A5 -抦 > bÄ­ng; #62A6 -抧 > zhÄ­; #62A7 -抨 > pÄ“ng; #62A8 -抩 > tÄn; #62A9 -抪 > pÅ«; #62AA -披 > pÄ«; #62AB -抬 > tái; #62AC -抭 > yăo; #62AD -抮 > zhÄ•n; #62AE -抯 > zhÄ; #62AF -抰 > yăng; #62B0 -抱 > bào; #62B1 -抲 > hÄ“; #62B2 -抳 > nÄ­; #62B3 -抴 > yì; #62B4 -抵 > dÄ­; #62B5 -抶 > chì; #62B6 -抷 > pÄ«; #62B7 -抸 > zÄ; #62B8 -抹 > mÅ; #62B9 -抺 > mÅ; #62BA -抻 > shèn; #62BB -押 > yÄ; #62BC -抽 > chÅu; #62BD -抾 > qÅ«; #62BE -抿 > mÄ­n; #62BF -æ‹€ > chù; #62C0 -æ‹ > jiÄ; #62C1 -æ‹‚ > fú; #62C2 -拃 > zhăn; #62C3 -æ‹„ > zhÅ­; #62C4 -æ‹… > dàn; #62C5 -拆 > chÄi; #62C6 -拇 > mÅ­; #62C7 -拈 > nián; #62C8 -拉 > lÄ; #62C9 -æ‹Š > fÅ­; #62CA -æ‹‹ > pÄo; #62CB -æ‹Œ > bàn; #62CC -æ‹ > pÄi; #62CD -æ‹Ž > lÄ«ng; #62CE -æ‹ > ná; #62CF -æ‹ > guăi; #62D0 -æ‹‘ > qián; #62D1 -æ‹’ > jù; #62D2 -æ‹“ > tùo; #62D3 -æ‹” > bá; #62D4 -æ‹• > tÅ«o; #62D5 -æ‹– > tÅ«o; #62D6 -æ‹— > ăo; #62D7 -拘 > jÅ«; #62D8 -æ‹™ > zhúo; #62D9 -æ‹š > pàn; #62DA -æ‹› > zhÄo; #62DB -æ‹œ > bài; #62DC -æ‹ > bài; #62DD -æ‹ž > dÄ­; #62DE -æ‹Ÿ > nÄ­; #62DF -æ‹  > jù; #62E0 -æ‹¡ > kùo; #62E1 -æ‹¢ > lÅng; #62E2 -æ‹£ > jiăn; #62E3 -æ‹¥ > yÅng; #62E5 -拦 > lán; #62E6 -拧 > níng; #62E7 -拨 > bÅ; #62E8 -æ‹© > zé; #62E9 -拪 > qiÄn; #62EA -æ‹« > hén; #62EB -括 > guÄ; #62EC -æ‹­ > shì; #62ED -æ‹® > jié; #62EE -拯 > zhÄ•ng; #62EF -æ‹° > nÄ­n; #62F0 -拱 > gÅng; #62F1 -拲 > gÅng; #62F2 -拳 > quán; #62F3 -æ‹´ > shuÄn; #62F4 -拵 > cún; #62F5 -拶 > zăn; #62F6 -æ‹· > kăo; #62F7 -拸 > chÄ­; #62F8 -拹 > xié; #62F9 -拺 > cè; #62FA -æ‹» > hÅ«i; #62FB -拼 > pÄ«n; #62FC -拽 > zhuÄi; #62FD -拾 > shí; #62FE -æ‹¿ > ná; #62FF -挀 > bò; #6300 -æŒ > chí; #6301 -挂 > guà; #6302 -挃 > zhì; #6303 -挄 > kùo; #6304 -挅 > dÅ­o; #6305 -挆 > dÅ­o; #6306 -指 > zhÄ­; #6307 -挈 > qiè; #6308 -按 > àn; #6309 -挊 > nòng; #630A -挋 > zhèn; #630B -挌 > gé; #630C -æŒ > jiào; #630D -挎 > kÅ«; #630E -æŒ > dòng; #630F -æŒ > rú; #6310 -挑 > tiÄo; #6311 -挒 > liè; #6312 -挓 > zhÄ; #6313 -挔 > lÇš; #6314 -挕 > dié; #6315 -挖 > wÄ; #6316 -挗 > jué; #6317 -挙 > jÅ­; #6319 -挚 > zhì; #631A -挛 > luán; #631B -挜 > yà; #631C -æŒ > zhuÄ; #631D -挞 > tà; #631E -挟 > xié; #631F -挠 > náo; #6320 -挡 > dăng; #6321 -挢 > jiăo; #6322 -挣 > zhÄ“ng; #6323 -挤 > jÄ­; #6324 -挥 > hÅ«i; #6325 -挦 > xún; #6326 -挨 > Äi; #6328 -挩 > tÅ«o; #6329 -挪 > núo; #632A -挫 > cùo; #632B -挬 > bó; #632C -挭 > gÄ•ng; #632D -挮 > tÄ­; #632E -振 > zhèn; #632F -挰 > chéng; #6330 -挱 > sÅ«o; #6331 -挲 > sÅ«o; #6332 -挳 > kÄ“ng; #6333 -挴 > mÄ•i; #6334 -挵 > lòng; #6335 -挶 > jú; #6336 -挷 > péng; #6337 -挸 > jiăn; #6338 -挹 > yì; #6339 -挺 > tÄ­ng; #633A -挻 > shÄn; #633B -挼 > nùo; #633C -挽 > wăn; #633D -挾 > xié; #633E -挿 > chÄ; #633F -æ€ > fÄ“ng; #6340 -æ > jiăo; #6341 -æ‚ > wÅ­; #6342 -æƒ > jùn; #6343 -æ„ > jìu; #6344 -æ… > tÅng; #6345 -æ† > kÅ­n; #6346 -æ‡ > hùo; #6347 -æˆ > tú; #6348 -æ‰ > zhÅ«o; #6349 -æŠ > póu; #634A -æ‹ > lè; #634B -æŒ > bÄ; #634C -æ > hàn; #634D -æŽ > shÄo; #634E -æ > niÄ“; #634F -æ > juÄn; #6350 -æ‘ > zé; #6351 -æ’ > sÅng; #6352 -æ“ > yé; #6353 -æ” > jué; #6354 -æ• > bÅ­; #6355 -æ– > huán; #6356 -æ— > bù; #6357 -æ˜ > zùn; #6358 -æ™ > yì; #6359 -æš > zhÄi; #635A -æ› > lÇš; #635B -æœ > sÅu; #635C -æ > tÅ«o; #635D -æž > lÄo; #635E -æŸ > sÅ­n; #635F -æ  > bÄng; #6360 -æ¡ > jiăn; #6361 -æ¢ > huàn; #6362 -æ£ > dăo; #6363 -æ¥ > wàn; #6365 -æ¦ > qín; #6366 -æ§ > pÄ•ng; #6367 -æ¨ > shÄ•; #6368 -æ© > liè; #6369 -æª > mín; #636A -æ« > mén; #636B -æ¬ > fÅ­; #636C -æ­ > băi; #636D -æ® > jù; #636E -æ¯ > dăo; #636F -æ° > wÅ; #6370 -æ± > ái; #6371 -æ² > juăn; #6372 -æ³ > yuè; #6373 -æ´ > zÅng; #6374 -æµ > chÄ•n; #6375 -æ¶ > chúi; #6376 -æ· > jié; #6377 -æ¸ > tÅ«; #6378 -æ¹ > bèn; #6379 -æº > nà; #637A -æ» > niăn; #637B -æ¼ > núo; #637C -æ½ > zú; #637D -æ¾ > wò; #637E -æ¿ > xÄ«; #637F -掀 > xiÄn; #6380 -æŽ > chéng; #6381 -掂 > diÄn; #6382 -掃 > săo; #6383 -掄 > lún; #6384 -掅 > qìng; #6385 -掆 > gÄng; #6386 -掇 > dúo; #6387 -授 > shòu; #6388 -掉 > diào; #6389 -掊 > póu; #638A -掋 > dÄ­; #638B -掌 > zhăng; #638C -æŽ > gÅ­n; #638D -掎 > jÄ­; #638E -æŽ > tÄo; #638F -æŽ > qiÄ; #6390 -掑 > qí; #6391 -排 > pái; #6392 -掓 > shú; #6393 -掔 > qiÄn; #6394 -掕 > lìng; #6395 -掖 > yì; #6396 -掗 > yà; #6397 -掘 > jué; #6398 -掙 > zhÄ“ng; #6399 -掚 > liăng; #639A -掛 > guà; #639B -掜 > yÄ­; #639C -æŽ > hùo; #639D -掞 > shàn; #639E -掟 > zhÄ•ng; #639F -掠 > lÇœe; #63A0 -採 > căi; #63A1 -探 > tàn; #63A2 -掣 > chè; #63A3 -掤 > bÄ«ng; #63A4 -接 > jiÄ“; #63A5 -掦 > tì; #63A6 -控 > kòng; #63A7 -推 > tÅ«i; #63A8 -掩 > yăn; #63A9 -措 > cùo; #63AA -掫 > zÅu; #63AB -掬 > jú; #63AC -掭 > tiàn; #63AD -掮 > qián; #63AE -掯 > kèn; #63AF -掰 > bÄi; #63B0 -掱 > shÅu; #63B1 -掲 > jiÄ“; #63B2 -掳 > lÅ­; #63B3 -掴 > gúo; #63B4 -掷 > zhí; #63B7 -掸 > dăn; #63B8 -掺 > xiÄn; #63BA -掻 > sÄo; #63BB -掼 > guàn; #63BC -掽 > pèng; #63BD -掾 > yuàn; #63BE -掿 > nùo; #63BF -æ€ > jiăn; #63C0 -æ > zhÄ“n; #63C1 -æ‚ > jÄ«u; #63C2 -æƒ > jiÄn; #63C3 -æ„ > yú; #63C4 -æ… > yán; #63C5 -æ† > kúi; #63C6 -æ‡ > năn; #63C7 -æˆ > hÅng; #63C8 -æ‰ > róu; #63C9 -æŠ > pì; #63CA -æ‹ > wÄ“i; #63CB -æŒ > sÄi; #63CC -æ > zòu; #63CD -æŽ > xuÄn; #63CE -æ > miáo; #63CF -æ > tí; #63D0 -æ‘ > niÄ“; #63D1 -æ’ > chÄ; #63D2 -æ“ > shì; #63D3 -æ” > zÅng; #63D4 -æ• > zhèn; #63D5 -æ– > yÄ«; #63D6 -æ— > shÅ­n; #63D7 -æ˜ > héng; #63D8 -æ™ > biàn; #63D9 -æš > yáng; #63DA -æ› > huàn; #63DB -æœ > yăn; #63DC -æ > zuàn; #63DD -æž > ăn; #63DE -æŸ > xÅ«; #63DF -æ  > yà; #63E0 -æ¡ > wò; #63E1 -æ¢ > kè; #63E2 -æ£ > chuăi; #63E3 -æ¤ > jí; #63E4 -æ¥ > tì; #63E5 -æ¦ > lá; #63E6 -æ§ > là; #63E7 -æ¨ > chéng; #63E8 -æ© > kÄi; #63E9 -æª > jÄ«u; #63EA -æ« > jÄ«u; #63EB -æ¬ > tú; #63EC -æ­ > jiÄ“; #63ED -æ® > hÅ«i; #63EE -æ¯ > gÄ“ng; #63EF -æ° > chòng; #63F0 -æ± > shùo; #63F1 -æ² > shé; #63F2 -æ³ > xiè; #63F3 -æ´ > yuán; #63F4 -æµ > qián; #63F5 -æ¶ > yé; #63F6 -æ· > chÄ; #63F7 -æ¸ > zhÄ; #63F8 -æ¹ > bÄ“i; #63F9 -æº > yáo; #63FA -æ½ > lăn; #63FD -æ¾ > wèn; #63FE -æ¿ > qìn; #63FF -æ€ > chÄn; #6400 -æ > gÄ“; #6401 -æ‚ > lÅu; #6402 -æƒ > zÅng; #6403 -æ„ > gÄ“ng; #6404 -æ… > jiăo; #6405 -æ† > gòu; #6406 -æ‡ > qìn; #6407 -æˆ > yÅng; #6408 -æ‰ > què; #6409 -æŠ > chÅu; #640A -æ‹ > chÄ­; #640B -æŒ > zhăn; #640C -æ > sÅ­n; #640D -æŽ > sÅ«n; #640E -æ > bó; #640F -æ > chù; #6410 -æ‘ > rÅng; #6411 -æ’ > bèng; #6412 -æ“ > cÅ«o; #6413 -æ” > sÄo; #6414 -æ• > kè; #6415 -æ– > yáo; #6416 -æ— > dăo; #6417 -æ˜ > zhÄ«; #6418 -æ™ > nù; #6419 -æš > xié; #641A -æ› > jiÄn; #641B -æœ > sÅu; #641C -æ > qÄ­u; #641D -æž > găo; #641E -æŸ > xiăn; #641F -æ  > shùo; #6420 -æ¡ > săng; #6421 -æ¢ > jìn; #6422 -æ£ > miè; #6423 -æ¤ > è; #6424 -æ¥ > chúi; #6425 -æ¦ > nùo; #6426 -æ§ > shÄn; #6427 -æ¨ > tà; #6428 -æ© > jié; #6429 -æª > táng; #642A -æ« > pán; #642B -æ¬ > bÄn; #642C -æ­ > dÄ; #642D -æ® > lì; #642E -æ¯ > tÄo; #642F -æ° > hú; #6430 -æ± > zhì; #6431 -æ² > wÄ; #6432 -æ³ > xiá; #6433 -æ´ > qiÄn; #6434 -æµ > wèn; #6435 -æ¶ > qiăng; #6436 -æ· > tián; #6437 -æ¸ > zhÄ“n; #6438 -æ¹ > è; #6439 -æº > xÄ«; #643A -æ» > nùo; #643B -æ¼ > quán; #643C -æ½ > chá; #643D -æ¾ > zhà; #643E -æ¿ > gé; #643F -æ‘€ > wÅ­; #6440 -æ‘ > èn; #6441 -æ‘‚ > shè; #6442 -摃 > káng; #6443 -æ‘„ > shè; #6444 -æ‘… > shÅ«; #6445 -摆 > băi; #6446 -摇 > yáo; #6447 -摈 > bìn; #6448 -摉 > sÅu; #6449 -æ‘Š > tÄn; #644A -æ‘‹ > sà; #644B -æ‘Œ > chăn; #644C -æ‘ > sÅ«o; #644D -æ‘Ž > liáo; #644E -æ‘ > chÅng; #644F -æ‘ > chuÄng; #6450 -æ‘‘ > gúo; #6451 -æ‘’ > bìng; #6452 -æ‘“ > féng; #6453 -æ‘” > shuÄi; #6454 -æ‘• > dì; #6455 -æ‘– > qì; #6456 -æ‘— > sou; #6457 -摘 > zhÄi; #6458 -æ‘™ > liăn; #6459 -æ‘š > táng; #645A -æ‘› > chÄ«; #645B -æ‘œ > guàn; #645C -æ‘ > lù; #645D -æ‘ž > lúo; #645E -æ‘Ÿ > lÅu; #645F -æ‘  > zÅng; #6460 -æ‘¡ > gài; #6461 -æ‘¢ > hù; #6462 -æ‘£ > zhÄ; #6463 -摤 > chuăng; #6464 -æ‘¥ > tàng; #6465 -摦 > huà; #6466 -摧 > cÅ«i; #6467 -摨 > nái; #6468 -æ‘© > mó; #6469 -摪 > jiÄng; #646A -æ‘« > gÅ«i; #646B -摬 > yìng; #646C -æ‘­ > zhí; #646D -æ‘® > áo; #646E -摯 > zhì; #646F -æ‘° > niè; #6470 -摱 > mán; #6471 -摲 > shàn; #6472 -摳 > kÅu; #6473 -æ‘´ > shÅ«; #6474 -摵 > sÅ­o; #6475 -摶 > tuán; #6476 -æ‘· > jiăo; #6477 -摸 > mÅ; #6478 -摹 > mó; #6479 -摺 > zhé; #647A -æ‘» > xiÄn; #647B -摼 > kÄ“ng; #647C -摽 > piăo; #647D -摾 > jiàng; #647E -æ‘¿ > yÄ«n; #647F -æ’€ > gòu; #6480 -æ’ > qiÄn; #6481 -æ’‚ > lÇœe; #6482 -æ’ƒ > jí; #6483 -æ’„ > yÄ«ng; #6484 -æ’… > juÄ“; #6485 -æ’† > piÄ“; #6486 -æ’‡ > piÄ•; #6487 -æ’ˆ > lÄo; #6488 -æ’‰ > dÅ«n; #6489 -æ’Š > xiàn; #648A -æ’‹ > ruán; #648B -æ’Œ > kùi; #648C -æ’ > zăn; #648D -æ’Ž > yì; #648E -æ’ > xún; #648F -æ’ > chÄ“ng; #6490 -æ’‘ > chÄ“ng; #6491 -æ’’ > să; #6492 -æ’“ > náo; #6493 -æ’” > hèng; #6494 -æ’• > sÄ«; #6495 -æ’– > qiăn; #6496 -æ’— > huáng; #6497 -æ’˜ > dÄ; #6498 -æ’™ > zÅ­n; #6499 -æ’š > niăn; #649A -æ’› > lÄ­n; #649B -æ’œ > zhÄ•ng; #649C -æ’ > hÅ«i; #649D -æ’ž > zhuàng; #649E -æ’Ÿ > jiăo; #649F -æ’  > jÄ­; #64A0 -æ’¡ > cÄo; #64A1 -æ’¢ > dăn; #64A2 -æ’£ > dăn; #64A3 -æ’¤ > chè; #64A4 -æ’¥ > bÅ; #64A5 -æ’¦ > chÄ•; #64A6 -æ’§ > jué; #64A7 -æ’¨ > xiÄo; #64A8 -æ’© > liáo; #64A9 -æ’ª > bèn; #64AA -æ’« > fÅ­; #64AB -æ’¬ > qiào; #64AC -æ’­ > bò; #64AD -æ’® > cÅ«o; #64AE -æ’¯ > zhúo; #64AF -æ’° > zhuàn; #64B0 -æ’± > tÅ­o; #64B1 -æ’² > pÅ«; #64B2 -æ’³ > qìn; #64B3 -æ’´ > dÅ«n; #64B4 -æ’µ > niăn; #64B5 -æ’· > xié; #64B7 -æ’¸ > lÅ­; #64B8 -æ’¹ > jiăo; #64B9 -æ’º > cuÄn; #64BA -æ’» > tà; #64BB -æ’¼ > hàn; #64BC -æ’½ > qiào; #64BD -æ’¾ > zhuÄ; #64BE -æ’¿ > jiăn; #64BF -æ“€ > găn; #64C0 -æ“ > yÅng; #64C1 -æ“‚ > léi; #64C2 -擃 > kÅ­o; #64C3 -æ“„ > lÅ­; #64C4 -æ“… > shàn; #64C5 -擆 > zhúo; #64C6 -擇 > zé; #64C7 -擈 > pÅ«; #64C8 -擉 > chùo; #64C9 -æ“Š > jí; #64CA -æ“‹ > dăng; #64CB -æ“Œ > sÅ­o; #64CC -æ“ > cÄo; #64CD -æ“Ž > qíng; #64CE -æ“ > jìng; #64CF -æ“ > huàn; #64D0 -æ“‘ > jiÄ“; #64D1 -æ“’ > qín; #64D2 -æ““ > kuăi; #64D3 -æ“” > dÄn; #64D4 -æ“• > xÄ«; #64D5 -æ“– > gÄ•; #64D6 -æ“— > pì; #64D7 -擘 > bò; #64D8 -æ“™ > ào; #64D9 -æ“š > jù; #64DA -æ“› > yè; #64DB -æ“ž > sÅu; #64DE -æ“Ÿ > mí; #64DF -æ“  > jÄ­; #64E0 -æ“¡ > tái; #64E1 -æ“¢ > zhúo; #64E2 -æ“£ > dăo; #64E3 -擤 > xÄ­ng; #64E4 -æ“¥ > lăn; #64E5 -擦 > cÄ; #64E6 -擧 > jÅ­; #64E7 -擨 > yé; #64E8 -æ“© > rÅ­; #64E9 -擪 > yè; #64EA -æ“« > yè; #64EB -擬 > nÄ­; #64EC -æ“­ > hù; #64ED -æ“® > jí; #64EE -擯 > bìn; #64EF -æ“° > níng; #64F0 -擱 > gÄ“; #64F1 -擲 > zhí; #64F2 -擳 > jié; #64F3 -æ“´ > kùo; #64F4 -擵 > mó; #64F5 -擶 > jiàn; #64F6 -æ“· > xié; #64F7 -擸 > liè; #64F8 -擹 > tÄn; #64F9 -擺 > băi; #64FA -æ“» > sÅu; #64FB -擼 > lÅ­; #64FC -擽 > lÇœe; #64FD -擾 > răo; #64FE -æ“¿ > zhí; #64FF -攀 > pÄn; #6500 -æ” > yăng; #6501 -攂 > lèi; #6502 -攃 > sà; #6503 -攄 > shÅ«; #6504 -æ”… > zăn; #6505 -攆 > niăn; #6506 -攇 > xiăn; #6507 -攈 > jùn; #6508 -攉 > hùo; #6509 -攊 > lì; #650A -攋 > là; #650B -攌 > hàn; #650C -æ” > yíng; #650D -攎 > lú; #650E -æ” > lÅng; #650F -æ” > qiÄn; #6510 -攑 > qiÄn; #6511 -æ”’ > zăn; #6512 -攓 > qiÄn; #6513 -æ”” > lán; #6514 -攕 > sÄn; #6515 -æ”– > yÄ«ng; #6516 -æ”— > méi; #6517 -攘 > ráng; #6518 -æ”™ > chÄn; #6519 -æ”› > cuÄn; #651B -攜 > xÄ«; #651C -æ” > shè; #651D -攞 > lÅ­o; #651E -攟 > jùn; #651F -æ”  > mí; #6520 -攡 > lí; #6521 -攢 > zăn; #6522 -攣 > lǘan; #6523 -攤 > tÄn; #6524 -攥 > zuàn; #6525 -攦 > lì; #6526 -攧 > diÄn; #6527 -攨 > wÄ; #6528 -攩 > dăng; #6529 -攪 > jiăo; #652A -攫 > jué; #652B -攬 > lăn; #652C -æ”­ > lì; #652D -æ”® > năng; #652E -支 > zhÄ«; #652F -æ”° > gùi; #6530 -æ”± > gÅ­i; #6531 -攲 > qÄ«; #6532 -攳 > xín; #6533 -æ”´ > pÅ«; #6534 -攵 > sÅ«i; #6535 -收 > shÅu; #6536 -æ”· > káo; #6537 -攸 > yÅu; #6538 -改 > găi; #6539 -攺 > yÄ­; #653A -æ”» > gÅng; #653B -攼 > gÄn; #653C -攽 > bÄn; #653D -放 > fàng; #653E -政 > zhèng; #653F -æ•€ > bó; #6540 -æ• > diÄn; #6541 -æ•‚ > kòu; #6542 -敃 > mÄ­n; #6543 -æ•„ > wù; #6544 -æ•… > gù; #6545 -敆 > hé; #6546 -敇 > cè; #6547 -效 > xiào; #6548 -敉 > mÄ­; #6549 -æ•Š > chù; #654A -æ•‹ > gé; #654B -æ•Œ > dí; #654C -æ• > xù; #654D -æ•Ž > jiào; #654E -æ• > mÄ­n; #654F -æ• > chén; #6550 -æ•‘ > jìu; #6551 -æ•’ > zhèn; #6552 -æ•“ > dúo; #6553 -æ•” > yÅ­; #6554 -æ•• > chì; #6555 -æ•– > áo; #6556 -æ•— > bài; #6557 -敘 > xù; #6558 -æ•™ > jiào; #6559 -æ•š > dúo; #655A -æ•› > liàn; #655B -æ•œ > niè; #655C -æ• > bì; #655D -æ•ž > chăng; #655E -æ•Ÿ > diăn; #655F -æ•  > dúo; #6560 -æ•¡ > yì; #6561 -æ•¢ > găn; #6562 -æ•£ > sàn; #6563 -敤 > kÄ•; #6564 -æ•¥ > yàn; #6565 -敦 > dÅ«n; #6566 -敧 > qÄ­; #6567 -敨 > dÅu; #6568 -æ•© > xiào; #6569 -敪 > dúo; #656A -æ•« > jiào; #656B -敬 > jìng; #656C -æ•­ > yáng; #656D -æ•® > xiá; #656E -敯 > mín; #656F -æ•° > shù; #6570 -敱 > ái; #6571 -敲 > qiÄo; #6572 -敳 > ái; #6573 -æ•´ > zhÄ•ng; #6574 -敵 > dí; #6575 -敶 > zhèn; #6576 -æ•· > fÅ«; #6577 -數 > shù; #6578 -敹 > liáo; #6579 -敺 > qÅ«; #657A -æ•» > xìong; #657B -敼 > xÄ­; #657C -敽 > jiăo; #657D -æ•¿ > jiăo; #657F -æ–€ > zhúo; #6580 -æ– > yì; #6581 -æ–‚ > liàn; #6582 -æ–ƒ > bì; #6583 -æ–„ > lì; #6584 -æ–… > xiào; #6585 -æ–† > xiào; #6586 -æ–‡ > wén; #6587 -æ–ˆ > xué; #6588 -æ–‰ > qí; #6589 -æ–Š > qí; #658A -æ–‹ > zhÄi; #658B -æ–Œ > bÄ«n; #658C -æ– > jué; #658D -æ–Ž > zhÄi; #658E -æ– > fÄ•i; #6590 -æ–‘ > bÄn; #6591 -æ–’ > bÄn; #6592 -æ–“ > lán; #6593 -æ–” > yÅ­; #6594 -æ–• > lán; #6595 -æ–– > wÄ•i; #6596 -æ–— > dÅu; #6597 -æ–˜ > shÄ“ng; #6598 -æ–™ > liào; #6599 -æ–š > jiă; #659A -æ–› > hú; #659B -æ–œ > xié; #659C -æ– > jiă; #659D -æ–ž > yÅ­; #659E -æ–Ÿ > zhÄ“n; #659F -æ–  > jiào; #65A0 -æ–¡ > wò; #65A1 -æ–¢ > tÅu; #65A2 -æ–£ > chù; #65A3 -æ–¤ > jÄ«n; #65A4 -æ–¥ > chì; #65A5 -æ–¦ > yín; #65A6 -æ–§ > fÅ­; #65A7 -æ–¨ > qiÄng; #65A8 -æ–© > zhăn; #65A9 -æ–ª > qú; #65AA -æ–« > zhúo; #65AB -æ–¬ > zhăn; #65AC -æ–­ > duàn; #65AD -æ–® > zhúo; #65AE -æ–¯ > sÄ«; #65AF -æ–° > xÄ«n; #65B0 -æ–± > zhúo; #65B1 -æ–² > zhúo; #65B2 -æ–³ > qín; #65B3 -æ–´ > lín; #65B4 -æ–µ > zhúo; #65B5 -æ–¶ > chù; #65B6 -æ–· > duàn; #65B7 -æ–¸ > zhÅ­; #65B8 -æ–¹ > fÄng; #65B9 -æ–º > xiè; #65BA -æ–» > háng; #65BB -æ–¼ > yú; #65BC -æ–½ > shÄ«; #65BD -æ–¾ > pèi; #65BE -æ–¿ > yóu; #65BF -æ— > páng; #65C1 -æ—‚ > qí; #65C2 -æ—ƒ > zhÄn; #65C3 -æ—„ > máo; #65C4 -æ—… > lÇš; #65C5 -æ—† > pèi; #65C6 -æ—‡ > pÄ«; #65C7 -æ—ˆ > líu; #65C8 -æ—‰ > fÅ«; #65C9 -æ—Š > făng; #65CA -æ—‹ > xuán; #65CB -æ—Œ > jÄ«ng; #65CC -æ— > jÄ«ng; #65CD -æ—Ž > nÄ­; #65CE -æ— > zú; #65CF -æ— > zhào; #65D0 -æ—‘ > yÄ­; #65D1 -æ—’ > líu; #65D2 -æ—“ > shÄo; #65D3 -æ—” > jiàn; #65D4 -æ—– > yÄ­; #65D6 -æ—— > qí; #65D7 -æ—˜ > zhì; #65D8 -æ—™ > fÄn; #65D9 -æ—š > piÄo; #65DA -æ—› > fÄn; #65DB -æ—œ > zhÄn; #65DC -æ— > guài; #65DD -æ—ž > sùi; #65DE -æ—Ÿ > yú; #65DF -æ—  > wú; #65E0 -æ—¡ > jì; #65E1 -æ—¢ > jì; #65E2 -æ—£ > jì; #65E3 -æ—¤ > hùo; #65E4 -æ—¥ > rì; #65E5 -æ—¦ > dàn; #65E6 -æ—§ > jìu; #65E7 -æ—¨ > zhÄ­; #65E8 -æ—© > zăo; #65E9 -æ—ª > xié; #65EA -æ—« > tiÄo; #65EB -æ—¬ > xún; #65EC -æ—­ > xù; #65ED -æ—® > xù; #65EE -æ—¯ > xù; #65EF -æ—° > gàn; #65F0 -æ—± > hàn; #65F1 -æ—² > tái; #65F2 -æ—³ > dì; #65F3 -æ—´ > xÅ«; #65F4 -æ—µ > chăn; #65F5 -æ—¶ > shí; #65F6 -æ—· > kuàng; #65F7 -æ—¸ > yáng; #65F8 -æ—¹ > shí; #65F9 -æ—º > wàng; #65FA -æ—» > mín; #65FB -æ—¼ > mín; #65FC -æ—½ > tÅ«n; #65FD -æ—¾ > chÅ«n; #65FE -æ—¿ > wÅ­; #65FF -昀 > yún; #6600 -æ˜ > bèi; #6601 -昂 > áng; #6602 -昃 > zè; #6603 -昄 > băn; #6604 -昅 > jié; #6605 -昆 > kÅ«n; #6606 -昇 > shÄ“ng; #6607 -昈 > hù; #6608 -昉 > făng; #6609 -昊 > hào; #660A -昋 > gùi; #660B -昌 > chÄng; #660C -æ˜ > xuÄn; #660D -明 > míng; #660E -æ˜ > hÅ«n; #660F -æ˜ > fÄ“n; #6610 -昑 > qÄ­n; #6611 -昒 > hÅ«; #6612 -易 > yì; #6613 -昔 > xí; #6614 -昕 > xÄ«n; #6615 -昖 > yán; #6616 -昗 > zè; #6617 -昘 > făng; #6618 -昙 > tán; #6619 -昚 > shèn; #661A -昛 > jù; #661B -昜 > yáng; #661C -æ˜ > zăn; #661D -昞 > bÄ­ng; #661E -星 > xÄ«ng; #661F -映 > yìng; #6620 -昡 > xuàn; #6621 -昢 > pÄ•i; #6622 -昣 > zhÄ•n; #6623 -昤 > lÄ«ng; #6624 -春 > chÅ«n; #6625 -昦 > hào; #6626 -昧 > mèi; #6627 -昨 > zúo; #6628 -昩 > mò; #6629 -昪 > biàn; #662A -昫 > xÅ­; #662B -昬 > hÅ«n; #662C -昭 > zhÄo; #662D -昮 > zòng; #662E -是 > shì; #662F -昰 > shì; #6630 -昱 > yù; #6631 -昲 > fèi; #6632 -昳 > dié; #6633 -昴 > măo; #6634 -昵 > nì; #6635 -昶 > chăng; #6636 -昷 > wÄ“n; #6637 -昸 > dÅng; #6638 -昹 > ăi; #6639 -昺 > bÄ­ng; #663A -昻 > áng; #663B -昼 > zhòu; #663C -昽 > lóng; #663D -显 > xiăn; #663E -昿 > kuàng; #663F -晀 > tiăo; #6640 -æ™ > cháo; #6641 -時 > shí; #6642 -晃 > huăng; #6643 -晄 > huăng; #6644 -æ™… > xuÄn; #6645 -晆 > kúi; #6646 -晇 > xÅ«; #6647 -晈 > jiăo; #6648 -晉 > jìn; #6649 -晊 > zhÄ­; #664A -晋 > jìn; #664B -晌 > shăng; #664C -æ™ > tóng; #664D -晎 > hÅng; #664E -æ™ > yàn; #664F -æ™ > gÄi; #6650 -晑 > xiăng; #6651 -æ™’ > shài; #6652 -晓 > xiăo; #6653 -æ™” > yÄ“; #6654 -晕 > yÅ«n; #6655 -æ™– > hÅ«i; #6656 -æ™— > hán; #6657 -晘 > hàn; #6658 -æ™™ > jùn; #6659 -晚 > wăn; #665A -æ™› > xiàn; #665B -晜 > kÅ«n; #665C -æ™ > zhòu; #665D -晞 > xÄ«; #665E -晟 > chéng; #665F -æ™  > shéng; #6660 -晡 > bÅ«; #6661 -晢 > zhÄ“; #6662 -晣 > zhÄ“; #6663 -晤 > wù; #6664 -晥 > hàn; #6665 -晦 > hùi; #6666 -晧 > hào; #6667 -晨 > chén; #6668 -晩 > wăn; #6669 -晪 > tiăn; #666A -晫 > zhúo; #666B -晬 > zùi; #666C -æ™­ > zhÅu; #666D -æ™® > pÅ­; #666E -景 > jÄ­ng; #666F -æ™° > xÄ«; #6670 -æ™± > shăn; #6671 -晲 > yÄ­; #6672 -晳 > xì; #6673 -æ™´ > qíng; #6674 -晵 > qÄ­; #6675 -晶 > jÄ«ng; #6676 -æ™· > gÅ­i; #6677 -晸 > zhÄ•n; #6678 -晹 > yì; #6679 -智 > zhì; #667A -æ™» > ăn; #667B -晼 > wăn; #667C -晽 > lín; #667D -晾 > liàng; #667E -晿 > chÄng; #667F -暀 > wăng; #6680 -æš > xiăo; #6681 -æš‚ > zàn; #6682 -æš„ > xuÄn; #6684 -æš… > xuăn; #6685 -暆 > yí; #6686 -暇 > xiá; #6687 -暈 > yÅ«n; #6688 -暉 > hÅ«i; #6689 -暊 > fÅ­; #668A -æš‹ > mÄ­n; #668B -暌 > kúi; #668C -æš > hè; #668D -暎 > yìng; #668E -æš > dÅ­; #668F -æš > wÄ•i; #6690 -æš‘ > shÅ­; #6691 -æš’ > qíng; #6692 -æš“ > mào; #6693 -æš” > nán; #6694 -æš• > jiăn; #6695 -æš– > nuăn; #6696 -æš— > àn; #6697 -暘 > yáng; #6698 -æš™ > chÅ«n; #6699 -æšš > yáo; #669A -æš› > sÅ­o; #669B -æšœ > jìn; #669C -æš > míng; #669D -æšž > jiăo; #669E -暟 > kăi; #669F -æš  > găo; #66A0 -æš¡ > wÄ•ng; #66A1 -暢 > chàng; #66A2 -暣 > qì; #66A3 -暤 > hào; #66A4 -暥 > yàn; #66A5 -暦 > lì; #66A6 -暧 > ài; #66A7 -暨 > jì; #66A8 -æš© > gùi; #66A9 -暪 > mÄ•n; #66AA -æš« > zàn; #66AB -暬 > xiè; #66AC -æš­ > hào; #66AD -æš® > mù; #66AE -暯 > mò; #66AF -æš° > cÅng; #66B0 -æš± > nì; #66B1 -æš² > zhÄng; #66B2 -æš³ > hùi; #66B3 -æš´ > bào; #66B4 -æšµ > hàn; #66B5 -暶 > xuán; #66B6 -æš· > chuán; #66B7 -暸 > liáo; #66B8 -æš¹ > xiÄn; #66B9 -暺 > dàn; #66BA -æš» > jÄ­ng; #66BB -æš¼ > piÄ“; #66BC -æš½ > lín; #66BD -æš¾ > tÅ«n; #66BE -æš¿ > xÄ­; #66BF -曀 > yì; #66C0 -æ› > jì; #66C1 -曂 > huàng; #66C2 -曃 > tài; #66C3 -曄 > yè; #66C4 -æ›… > yè; #66C5 -曆 > lì; #66C6 -曇 > tán; #66C7 -曈 > tóng; #66C8 -曉 > xiăo; #66C9 -曊 > fèi; #66CA -曋 > qÄ­n; #66CB -曌 > zhào; #66CC -æ› > hào; #66CD -曎 > yì; #66CE -æ› > xiàng; #66CF -æ› > xÄ«ng; #66D0 -曑 > sÄ“n; #66D1 -æ›’ > jiăo; #66D2 -曓 > bào; #66D3 -æ›” > jìng; #66D4 -曕 > yiàn; #66D5 -æ›– > ài; #66D6 -æ›— > yè; #66D7 -曘 > rú; #66D8 -æ›™ > shù; #66D9 -曚 > méng; #66DA -æ›› > xÅ«n; #66DB -曜 > yào; #66DC -æ› > pù; #66DD -曞 > lì; #66DE -曟 > chén; #66DF -æ›  > kuàng; #66E0 -曡 > dié; #66E1 -曣 > yàn; #66E3 -曤 > hùo; #66E4 -曥 > lú; #66E5 -曦 > xÄ«; #66E6 -曧 > róng; #66E7 -曨 > lóng; #66E8 -曩 > năng; #66E9 -曪 > lÅ­o; #66EA -曫 > luán; #66EB -曬 > shài; #66EC -æ›­ > tăng; #66ED -æ›® > yăn; #66EE -曯 > chú; #66EF -æ›° > yuÄ“; #66F0 -æ›± > yuÄ“; #66F1 -曲 > qÅ­; #66F2 -曳 > yì; #66F3 -æ›´ > gèng; #66F4 -曵 > yè; #66F5 -曶 > hÅ«; #66F6 -æ›· > hé; #66F7 -書 > shÅ«; #66F8 -曹 > cáo; #66F9 -曺 > cáo; #66FA -曼 > màn; #66FC -曽 > cÄ“ng; #66FD -曾 > céng; #66FE -替 > tì; #66FF -最 > zùi; #6700 -æœ > căn; #6701 -朂 > xù; #6702 -會 > hùi; #6703 -朄 > yìn; #6704 -朅 > qiè; #6705 -朆 > fÄ“n; #6706 -朇 > pí; #6707 -月 > yuè; #6708 -有 > yÅu; #6709 -朊 > ruăn; #670A -朋 > péng; #670B -朌 > bÄn; #670C -æœ > fú; #670D -朎 > líng; #670E -æœ > fÄ•i; #670F -æœ > qú; #6710 -朒 > nÇœ; #6712 -朓 > tiào; #6713 -朔 > shùo; #6714 -朕 > zhèn; #6715 -朖 > lăng; #6716 -朗 > lăng; #6717 -朘 > juÄn; #6718 -朙 > míng; #6719 -朚 > huÄng; #671A -望 > wàng; #671B -朜 > tÅ«n; #671C -æœ > zhÄo; #671D -朞 > jÄ«; #671E -期 > qí; #671F -朠 > yÄ«ng; #6720 -朡 > zÅng; #6721 -朢 > wàng; #6722 -朣 > tóng; #6723 -朤 > lăng; #6724 -朦 > méng; #6726 -朧 > lóng; #6727 -木 > mù; #6728 -朩 > dÄ•ng; #6729 -未 > wèi; #672A -末 > mò; #672B -本 > bÄ•n; #672C -札 > zhá; #672D -朮 > zhú; #672E -术 > zhú; #672F -朱 > zhÅ«; #6731 -朲 > rén; #6732 -朳 > bÄ; #6733 -朴 > pò; #6734 -朵 > dÅ­o; #6735 -朶 > dÅ­o; #6736 -朷 > dÄo; #6737 -朸 > lì; #6738 -朹 > qíu; #6739 -机 > jÄ«; #673A -朻 > jÄ«u; #673B -朼 > bÄ­; #673C -朽 > xÄ­u; #673D -朾 > tíng; #673E -朿 > cì; #673F -æ€ > shÄ; #6740 -æ‚ > zá; #6742 -æƒ > quán; #6743 -æ„ > qiÄn; #6744 -æ… > yú; #6745 -æ† > gÄn; #6746 -æ‡ > wÅ«; #6747 -æˆ > chÄ; #6748 -æ‰ > shÄn; #6749 -æŠ > xún; #674A -æ‹ > fÄn; #674B -æŒ > wù; #674C -æ > zÄ­; #674D -æŽ > lÄ­; #674E -æ > xìng; #674F -æ > cái; #6750 -æ‘ > cÅ«n; #6751 -æ’ > rèn; #6752 -æ“ > sháo; #6753 -æ” > tÅ«o; #6754 -æ• > dì; #6755 -æ– > zhàng; #6756 -æ— > máng; #6757 -æ˜ > chì; #6758 -æ™ > yì; #6759 -æš > gÅ­; #675A -æ› > gÅng; #675B -æœ > dù; #675C -æ > yí; #675D -æž > qÄ­; #675E -æŸ > shù; #675F -æ  > gÄng; #6760 -æ¡ > tiáo; #6761 -æ¥ > lái; #6765 -æ§ > máng; #6767 -æ¨ > yáng; #6768 -æ© > mà; #6769 -æª > miăo; #676A -æ« > sì; #676B -æ¬ > yuán; #676C -æ­ > háng; #676D -æ® > fèi; #676E -æ¯ > bÄ“i; #676F -æ° > jié; #6770 -æ± > dÅng; #6771 -æ² > găo; #6772 -æ³ > yăo; #6773 -æ´ > xiÄn; #6774 -æµ > chÅ­; #6775 -æ¶ > qÅ«n; #6776 -æ· > pá; #6777 -æ¸ > shÅ«; #6778 -æ¹ > huà; #6779 -æº > xÄ«n; #677A -æ» > chÅu; #677B -æ¼ > zhù; #677C -æ½ > chÅu; #677D -æ¾ > sÅng; #677E -æ¿ > băn; #677F -枀 > sÅng; #6780 -æž > jí; #6781 -æž‚ > yuè; #6782 -枃 > jìn; #6783 -æž„ > gÅu; #6784 -æž… > jÄ«; #6785 -枆 > máo; #6786 -枇 > pí; #6787 -枈 > bì; #6788 -枉 > wăng; #6789 -枊 > àng; #678A -æž‹ > fÄng; #678B -枌 > fén; #678C -æž > yì; #678D -枎 > fú; #678E -æž > nán; #678F -æž > xÄ«; #6790 -æž‘ > hù; #6791 -æž’ > yá; #6792 -æž“ > dÅu; #6793 -æž” > xún; #6794 -æž• > zhÄ•n; #6795 -æž– > yÄo; #6796 -æž— > lín; #6797 -枘 > rùi; #6798 -æž™ > é; #6799 -æžš > méi; #679A -æž› > zhào; #679B -æžœ > gÅ­o; #679C -æž > zhÄ«; #679D -æžž > cÅng; #679E -枟 > yùn; #679F -æž¡ > dÅu; #67A1 -枢 > shÅ«; #67A2 -枣 > zăo; #67A3 -枥 > lì; #67A5 -枧 > jiàn; #67A7 -枨 > chéng; #67A8 -枪 > qiÄng; #67AA -æž« > fÄ“ng; #67AB -枬 > nán; #67AC -æž­ > xiÄo; #67AD -æž® > xiÄn; #67AE -枯 > kÅ«; #67AF -æž° > píng; #67B0 -æž± > yí; #67B1 -æž² > xÄ­; #67B2 -æž³ > zhÄ«; #67B3 -æž´ > guăi; #67B4 -æžµ > xiÄo; #67B5 -架 > jià; #67B6 -æž· > jiÄ; #67B7 -枸 > gÅu; #67B8 -æž¹ > fÅ«; #67B9 -枺 > mò; #67BA -æž» > yì; #67BB -æž¼ > yè; #67BC -æž½ > yè; #67BD -æž¾ > shì; #67BE -æž¿ > niè; #67BF -柀 > bÄ­; #67C0 -æŸ > dùo; #67C1 -柂 > yí; #67C2 -柃 > líng; #67C3 -柄 > bÄ­ng; #67C4 -柅 > nÄ­; #67C5 -柆 > lÄ; #67C6 -柇 > hé; #67C7 -柈 > pán; #67C8 -柉 > fán; #67C9 -柊 > zhÅng; #67CA -柋 > dài; #67CB -柌 > cí; #67CC -æŸ > yÄng; #67CD -柎 > fÅ«; #67CE -æŸ > bó; #67CF -æŸ > mÅu; #67D0 -柑 > gÄn; #67D1 -柒 > qÄ«; #67D2 -染 > răn; #67D3 -柔 > róu; #67D4 -柕 > mào; #67D5 -柖 > zhÄo; #67D6 -柗 > sÅng; #67D7 -柘 > zhè; #67D8 -柙 > xiá; #67D9 -柚 > yòu; #67DA -柛 > shÄ“n; #67DB -柜 > jÅ­; #67DC -æŸ > tùo; #67DD -柞 > zùo; #67DE -柟 > nán; #67DF -柠 > níng; #67E0 -柡 > yÅng; #67E1 -柢 > dÄ­; #67E2 -柣 > zhí; #67E3 -柤 > zhÄ; #67E4 -查 > chá; #67E5 -柦 > dàn; #67E6 -柧 > gÅ«; #67E7 -柨 > pu; #67E8 -柩 > jìu; #67E9 -柪 > Äo; #67EA -柫 > fú; #67EB -柬 > jiăn; #67EC -柭 > bÅ; #67ED -柮 > dùo; #67EE -柯 > kÄ“; #67EF -柰 > nài; #67F0 -柱 > zhù; #67F1 -柲 > bì; #67F2 -柳 > lÄ­u; #67F3 -柴 > chái; #67F4 -柵 > zhà; #67F5 -柶 > sì; #67F6 -柷 > zhù; #67F7 -柸 > pÄ“i; #67F8 -柹 > shì; #67F9 -柺 > guăi; #67FA -査 > chá; #67FB -柼 > yăo; #67FC -柽 > jué; #67FD -柾 > jìu; #67FE -柿 > shì; #67FF -æ € > zhÄ«; #6800 -æ  > lÄ­u; #6801 -æ ‚ > méi; #6802 -æ „ > róng; #6804 -æ … > zhà; #6805 -æ ‡ > biÄo; #6807 -æ ˆ > zhàn; #6808 -æ ‰ > jié; #6809 -æ Š > lóng; #680A -æ ‹ > dòng; #680B -æ Œ > lú; #680C -æ Ž > lì; #680E -æ  > lán; #680F -æ  > yÅng; #6810 -æ ‘ > shù; #6811 -æ ’ > xún; #6812 -æ “ > shuÄn; #6813 -æ ” > qì; #6814 -æ • > zhÄ“n; #6815 -æ – > qÄ«; #6816 -æ — > lì; #6817 -æ ˜ > yÄ­; #6818 -æ ™ > xiáng; #6819 -æ š > zhèn; #681A -æ › > lì; #681B -æ œ > sù; #681C -æ  > guÄ; #681D -æ ž > kÄn; #681E -æ Ÿ > bÄ«ng; #681F -æ   > rÄ•n; #6820 -æ ¡ > xiào; #6821 -æ ¢ > bó; #6822 -æ £ > rÄ•n; #6823 -æ ¤ > bìng; #6824 -æ ¥ > zÄ«; #6825 -æ ¦ > chóu; #6826 -æ § > yì; #6827 -æ ¨ > jié; #6828 -æ © > xÅ­; #6829 -æ ª > zhÅ«; #682A -æ « > jiàn; #682B -æ ¬ > zùi; #682C -æ ­ > ér; #682D -æ ® > Ä•r; #682E -æ ¯ > yÅu; #682F -æ ° > fá; #6830 -æ ± > gÅng; #6831 -æ ² > kăo; #6832 -æ ³ > lăo; #6833 -æ ´ > zhÄn; #6834 -æ µ > lì; #6835 -æ ¶ > yin; #6836 -æ · > yáng; #6837 -æ ¸ > hé; #6838 -æ ¹ > gÄ“n; #6839 -æ º > zhÄ­; #683A -æ » > chì; #683B -æ ¼ > gé; #683C -æ ½ > zÄi; #683D -æ ¾ > luán; #683E -æ ¿ > fú; #683F -æ¡€ > jié; #6840 -æ¡ > háng; #6841 -æ¡‚ > gùi; #6842 -桃 > táo; #6843 -æ¡„ > guàng; #6844 -æ¡… > wéi; #6845 -框 > kuàng; #6846 -桇 > rú; #6847 -案 > àn; #6848 -桉 > àn; #6849 -æ¡Š > juàn; #684A -æ¡‹ > yí; #684B -æ¡Œ > zhÅ«o; #684C -æ¡ > kÅ«; #684D -æ¡Ž > zhí; #684E -æ¡ > qíong; #684F -æ¡ > tóng; #6850 -æ¡‘ > sÄng; #6851 -æ¡’ > sÄng; #6852 -æ¡“ > huán; #6853 -æ¡” > jié; #6854 -æ¡• > jìu; #6855 -æ¡– > xuè; #6856 -æ¡— > dùo; #6857 -桘 > zhùi; #6858 -æ¡™ > yú; #6859 -æ¡š > zăn; #685A -æ¡œ > yÄ«ng; #685C -æ¡Ÿ > zhàn; #685F -æ¡  > yá; #6860 -æ¡¡ > náo; #6861 -æ¡¢ > zhÄ“n; #6862 -æ¡£ > dăng; #6863 -桤 > qÄ«; #6864 -æ¡¥ > qiáo; #6865 -桦 > huà; #6866 -桧 > kuài; #6867 -桨 > jiăng; #6868 -æ¡© > zhuÄng; #6869 -桪 > xún; #686A -æ¡« > sÅ«o; #686B -桬 > shÄ; #686C -æ¡­ > zhÄ“n; #686D -æ¡® > bÄ“i; #686E -桯 > tÄ«ng; #686F -æ¡° > guÄ; #6870 -桱 > jìng; #6871 -桲 > bó; #6872 -桳 > bèn; #6873 -æ¡´ > fú; #6874 -桵 > rÅ­i; #6875 -桶 > tÅng; #6876 -æ¡· > jué; #6877 -桸 > xÄ«; #6878 -桹 > láng; #6879 -桺 > lÄ­u; #687A -æ¡» > fÄ“ng; #687B -桼 > qÄ«; #687C -桽 > wÄ•n; #687D -桾 > jÅ«n; #687E -æ¡¿ > găn; #687F -梀 > cù; #6880 -æ¢ > liáng; #6881 -梂 > qíu; #6882 -梃 > tÄ­ng; #6883 -梄 > yÅu; #6884 -梅 > méi; #6885 -梆 > bÄng; #6886 -梇 > lòng; #6887 -梈 > pÄ“ng; #6888 -梉 > zhuÄng; #6889 -梊 > dì; #688A -梋 > xuÄn; #688B -梌 > tú; #688C -æ¢ > zào; #688D -梎 > Äo; #688E -æ¢ > gù; #688F -æ¢ > bì; #6890 -梑 > dí; #6891 -梒 > hán; #6892 -梓 > zÄ­; #6893 -梔 > zhÄ«; #6894 -梕 > rèn; #6895 -梖 > bèi; #6896 -梗 > gÄ•ng; #6897 -梘 > jiàn; #6898 -梙 > huàn; #6899 -梚 > wăn; #689A -梛 > núo; #689B -梜 > jiá; #689C -æ¢ > tiáo; #689D -梞 > jì; #689E -梟 > xiÄo; #689F -梠 > lÇš; #68A0 -梡 > huán; #68A1 -梢 > shÄo; #68A2 -梣 > cén; #68A3 -梤 > fén; #68A4 -梥 > sÅng; #68A5 -梦 > mèng; #68A6 -梧 > wú; #68A7 -梨 > lí; #68A8 -梩 > lí; #68A9 -梪 > dòu; #68AA -梫 > cÄ“n; #68AB -梬 > yÄ­ng; #68AC -梭 > sÅ«o; #68AD -梮 > jú; #68AE -梯 > tÄ«; #68AF -械 > jiè; #68B0 -梱 > kÅ­n; #68B1 -梲 > zhúo; #68B2 -梳 > shÅ«; #68B3 -梴 > chÄn; #68B4 -梵 > fàn; #68B5 -梶 > wÄ•i; #68B6 -梷 > jìng; #68B7 -梸 > lí; #68B8 -梹 > bÄ«ng; #68B9 -梼 > táo; #68BC -梽 > zhì; #68BD -梾 > lái; #68BE -梿 > lián; #68BF -检 > jiăn; #68C0 -æ£ > zhúo; #68C1 -棂 > líng; #68C2 -棃 > lí; #68C3 -棄 > qì; #68C4 -棅 > bìng; #68C5 -棆 > zhÅ«n; #68C6 -棇 > cÅng; #68C7 -棈 > qiàn; #68C8 -棉 > mián; #68C9 -棊 > qí; #68CA -棋 > qí; #68CB -棌 > căi; #68CC -æ£ > gùn; #68CD -棎 > chán; #68CE -æ£ > tè; #68CF -æ£ > fÄ•i; #68D0 -棑 > pái; #68D1 -棒 > bàng; #68D2 -棓 > pÅu; #68D3 -棔 > hÅ«n; #68D4 -棕 > zÅng; #68D5 -棖 > chéng; #68D6 -棗 > zăo; #68D7 -棘 > jí; #68D8 -棙 > lì; #68D9 -棚 > péng; #68DA -棛 > yù; #68DB -棜 > yù; #68DC -æ£ > gù; #68DD -棞 > hún; #68DE -棟 > dòng; #68DF -棠 > táng; #68E0 -棡 > gÄng; #68E1 -棢 > wăng; #68E2 -棣 > dì; #68E3 -棤 > xí; #68E4 -棥 > fán; #68E5 -棦 > chÄ“ng; #68E6 -棧 > zhàn; #68E7 -棨 > qÄ­; #68E8 -棩 > yuÄn; #68E9 -棪 > yăn; #68EA -棫 > yù; #68EB -棬 > quÄn; #68EC -棭 > yì; #68ED -森 > sÄ“n; #68EE -棯 > rÄ•n; #68EF -棰 > chúi; #68F0 -棱 > léng; #68F1 -棲 > qÄ«; #68F2 -棳 > zhúo; #68F3 -棴 > fú; #68F4 -棵 > kÄ“; #68F5 -棶 > lái; #68F6 -棷 > zÅu; #68F7 -棸 > zÅu; #68F8 -棹 > zhÅ«o; #68F9 -棺 > guÄn; #68FA -棻 > fén; #68FB -棼 > fén; #68FC -棽 > chÄ“n; #68FD -棾 > qíong; #68FE -棿 > niè; #68FF -椀 > wăn; #6900 -æ¤ > gÅ­o; #6901 -椂 > lù; #6902 -椃 > háo; #6903 -椄 > jiÄ“; #6904 -椅 > yÄ­; #6905 -椆 > chóu; #6906 -椇 > jÅ­; #6907 -椈 > jú; #6908 -椉 > chéng; #6909 -椊 > zúo; #690A -椋 > liáng; #690B -椌 > qiÄng; #690C -æ¤ > zhí; #690D -椎 > zhÅ«i; #690E -æ¤ > yÄ; #690F -æ¤ > jÅ«; #6910 -椑 > bÄ“i; #6911 -椒 > jiÄo; #6912 -椓 > zhúo; #6913 -椔 > zÄ«; #6914 -椕 > bÄ«n; #6915 -椖 > péng; #6916 -椗 > dìng; #6917 -椘 > chÅ­; #6918 -検 > jiăn; #691C -æ¤ > gÅ«i; #691D -椞 > xì; #691E -椟 > dú; #691F -椠 > qiàn; #6920 -椤 > lúo; #6924 -椥 > zhÄ«; #6925 -椪 > pèng; #692A -椫 > zhăn; #692B -椭 > tÅ­o; #692D -椮 > sÄ“n; #692E -椯 > dúo; #692F -椰 > yé; #6930 -椱 > fòu; #6931 -椲 > wÄ•i; #6932 -椳 > wÄ“i; #6933 -椴 > duàn; #6934 -椵 > jiă; #6935 -椶 > zÅng; #6936 -椷 > jiÄn; #6937 -椸 > yí; #6938 -椹 > shèn; #6939 -椺 > xí; #693A -椻 > yàn; #693B -椼 > yăn; #693C -椽 > chuán; #693D -椾 > zhàn; #693E -椿 > chÅ«n; #693F -楀 > yÅ­; #6940 -æ¥ > hé; #6941 -楂 > zhÄ; #6942 -楃 > wò; #6943 -楄 > pián; #6944 -楅 > bì; #6945 -楆 > yÄo; #6946 -楇 > hùo; #6947 -楈 > xÅ«; #6948 -楉 > rùo; #6949 -楊 > yáng; #694A -楋 > là; #694B -楌 > yán; #694C -æ¥ > bÄ•n; #694D -楎 > hún; #694E -æ¥ > kúi; #694F -æ¥ > jiè; #6950 -楑 > kúi; #6951 -楒 > sÄ«; #6952 -楓 > fÄ“ng; #6953 -楔 > xiè; #6954 -楕 > tÅ­o; #6955 -楖 > zhì; #6956 -楗 > jiàn; #6957 -楘 > mù; #6958 -楙 > mào; #6959 -楚 > chÅ­; #695A -楛 > hù; #695B -楜 > hú; #695C -æ¥ > liàn; #695D -楞 > léng; #695E -楟 > tíng; #695F -楠 > nán; #6960 -楡 > yú; #6961 -楢 > yóu; #6962 -楣 > méi; #6963 -楤 > sÅng; #6964 -楥 > xuàn; #6965 -楦 > xuàn; #6966 -楧 > yÄ«ng; #6967 -楨 > zhÄ“n; #6968 -楩 > pián; #6969 -楪 > yè; #696A -楫 > jí; #696B -楬 > jié; #696C -業 > yè; #696D -楮 > chÅ­; #696E -楯 > shÅ­n; #696F -楰 > yú; #6970 -楱 > còu; #6971 -楲 > wÄ“i; #6972 -楳 > méi; #6973 -楴 > dì; #6974 -極 > jí; #6975 -楶 > jié; #6976 -楷 > kăi; #6977 -楸 > qÄ«u; #6978 -楹 > yíng; #6979 -楺 > róu; #697A -楻 > héng; #697B -楼 > lóu; #697C -楽 > lè; #697D -榀 > pÄ­n; #6980 -概 > gài; #6982 -榃 > tán; #6983 -榄 > lăn; #6984 -榅 > yún; #6985 -榆 > yú; #6986 -榇 > chèn; #6987 -榈 > lǘ; #6988 -榉 > jÅ­; #6989 -æ¦ > xiè; #698D -榎 > jiă; #698E -æ¦ > yì; #698F -æ¦ > zhăn; #6990 -榑 > fù; #6991 -榒 > nài; #6992 -榓 > mì; #6993 -榔 > láng; #6994 -榕 > róng; #6995 -榖 > gÅ­; #6996 -榗 > jiàn; #6997 -榘 > jÅ­; #6998 -榙 > tă; #6999 -榚 > yăo; #699A -榛 > zhÄ“n; #699B -榜 > băng; #699C -æ¦ > shÄ; #699D -榞 > yuán; #699E -榟 > zÄ­; #699F -榠 > mÄ«ng; #69A0 -榡 > sù; #69A1 -榢 > jià; #69A2 -榣 > yáo; #69A3 -榤 > jié; #69A4 -榥 > huăng; #69A5 -榦 > gàn; #69A6 -榧 > fÄ•i; #69A7 -榨 > zhà; #69A8 -榩 > qián; #69A9 -榪 > mà; #69AA -榫 > sÅ­n; #69AB -榬 > yuán; #69AC -榭 > xiè; #69AD -榮 > róng; #69AE -榯 > shí; #69AF -榰 > zhÄ«; #69B0 -榱 > cÅ«i; #69B1 -榲 > yún; #69B2 -榳 > tíng; #69B3 -榴 > líu; #69B4 -榵 > róng; #69B5 -榶 > táng; #69B6 -榷 > què; #69B7 -榸 > zhÄi; #69B8 -榹 > sÄ«; #69B9 -榺 > shèng; #69BA -榻 > tà; #69BB -榼 > kè; #69BC -榽 > xÄ«; #69BD -榾 > gù; #69BE -榿 > qÄ«; #69BF -槀 > kăo; #69C0 -æ§ > găo; #69C1 -槂 > sÅ«n; #69C2 -槃 > pán; #69C3 -槄 > tÄo; #69C4 -槅 > gé; #69C5 -槆 > xún; #69C6 -槇 > diÄn; #69C7 -槈 > nòu; #69C8 -槉 > jí; #69C9 -槊 > shùo; #69CA -構 > gòu; #69CB -槌 > chúi; #69CC -æ§ > qiÄng; #69CD -槎 > chÄ; #69CE -æ§ > qiăn; #69CF -æ§ > huái; #69D0 -槑 > méi; #69D1 -槒 > xù; #69D2 -槓 > gàng; #69D3 -槔 > gÄo; #69D4 -槕 > zhúo; #69D5 -槖 > tùo; #69D6 -様 > yàng; #69D8 -槙 > diÄn; #69D9 -槚 > jiă; #69DA -槛 > jiàn; #69DB -槜 > zùi; #69DC -槟 > bÄ«n; #69DF -槠 > zhÅ«; #69E0 -槢 > xí; #69E2 -槣 > qÄ­; #69E3 -槤 > lián; #69E4 -槥 > hùi; #69E5 -槦 > yóng; #69E6 -槧 > qiàn; #69E7 -槨 > gÅ­o; #69E8 -槩 > gài; #69E9 -槪 > gài; #69EA -槫 > tuán; #69EB -槬 > huà; #69EC -槭 > cù; #69ED -槮 > sÄ“n; #69EE -槯 > cÅ«i; #69EF -槰 > bèng; #69F0 -槱 > yÅu; #69F1 -槲 > hú; #69F2 -槳 > jiăng; #69F3 -槴 > hù; #69F4 -槵 > huàn; #69F5 -槶 > kùi; #69F6 -槷 > yì; #69F7 -槸 > niè; #69F8 -槹 > gÄo; #69F9 -槺 > kÄng; #69FA -槻 > gÅ«i; #69FB -槼 > gÅ«i; #69FC -槽 > cáo; #69FD -槾 > mán; #69FE -槿 > jÄ­n; #69FF -樀 > dì; #6A00 -æ¨ > zhuÄng; #6A01 -樂 > lè; #6A02 -樃 > láng; #6A03 -樄 > chén; #6A04 -樅 > cÅng; #6A05 -樆 > lí; #6A06 -樇 > xÄ«u; #6A07 -樈 > qíng; #6A08 -樉 > shuăng; #6A09 -樊 > fán; #6A0A -樋 > tÅng; #6A0B -樌 > guàn; #6A0C -æ¨ > jÄ«; #6A0D -樎 > sÅ«o; #6A0E -æ¨ > lÄ•i; #6A0F -æ¨ > lÅ­; #6A10 -樑 > liáng; #6A11 -樒 > mì; #6A12 -樓 > lóu; #6A13 -樔 > cháo; #6A14 -樕 > sù; #6A15 -樖 > kÄ“; #6A16 -樗 > shÅ«; #6A17 -樘 > táng; #6A18 -標 > biÄo; #6A19 -樚 > lù; #6A1A -樛 > jÄ«u; #6A1B -樜 > shù; #6A1C -æ¨ > zhÄ; #6A1D -樞 > shÅ«; #6A1E -樟 > zhÄng; #6A1F -樠 > mén; #6A20 -模 > mó; #6A21 -樢 > niăo; #6A22 -樣 > yàng; #6A23 -樤 > tiáo; #6A24 -樥 > péng; #6A25 -樦 > zhù; #6A26 -樧 > shÄ; #6A27 -樨 > xÄ«; #6A28 -権 > quán; #6A29 -横 > héng; #6A2A -樫 > jiÄn; #6A2B -樬 > cÅng; #6A2C -樯 > qiáng; #6A2F -樱 > yÄ«ng; #6A31 -樲 > èr; #6A32 -樳 > xín; #6A33 -樴 > zhí; #6A34 -樵 > qiáo; #6A35 -樶 > zÅ«i; #6A36 -樷 > cÅng; #6A37 -樸 > pú; #6A38 -樹 > shù; #6A39 -樺 > huà; #6A3A -樻 > kùi; #6A3B -樼 > zhÄ“n; #6A3C -樽 > zÅ«n; #6A3D -樾 > yuè; #6A3E -樿 > zhăn; #6A3F -æ©€ > xÄ«; #6A40 -æ© > xún; #6A41 -æ©‚ > diàn; #6A42 -橃 > fÄ; #6A43 -æ©„ > găn; #6A44 -æ©… > mó; #6A45 -橆 > wÅ­; #6A46 -橇 > qiÄo; #6A47 -橈 > náo; #6A48 -橉 > lìn; #6A49 -æ©Š > líu; #6A4A -æ©‹ > qiáo; #6A4B -æ©Œ > xiàn; #6A4C -æ© > rùn; #6A4D -æ©Ž > fán; #6A4E -æ© > zhăn; #6A4F -æ© > tùo; #6A50 -æ©‘ > lăo; #6A51 -æ©’ > yún; #6A52 -æ©“ > shùn; #6A53 -æ©” > túi; #6A54 -æ©• > chÄ“ng; #6A55 -æ©– > táng; #6A56 -æ©— > méng; #6A57 -橘 > jú; #6A58 -æ©™ > chéng; #6A59 -æ©š > sù; #6A5A -æ©› > jué; #6A5B -æ©œ > jué; #6A5C -æ© > tÄn; #6A5D -æ©ž > hùi; #6A5E -æ©Ÿ > jÄ«; #6A5F -æ©  > nÅ­o; #6A60 -æ©¡ > xiàng; #6A61 -æ©¢ > tÅ­o; #6A62 -æ©£ > nÄ­ng; #6A63 -橤 > rÅ­i; #6A64 -æ©¥ > zhÅ«; #6A65 -橦 > chuáng; #6A66 -橧 > zÄ“ng; #6A67 -橨 > fén; #6A68 -æ©© > qíong; #6A69 -橪 > răn; #6A6A -æ©« > héng; #6A6B -橬 > cén; #6A6C -æ©­ > gÅ«; #6A6D -æ©® > lÄ­u; #6A6E -橯 > lào; #6A6F -æ©° > gÄo; #6A70 -橱 > chú; #6A71 -橶 > jí; #6A76 -æ©· > dÅu; #6A77 -橹 > lÅ­; #6A79 -橼 > yuán; #6A7C -橽 > tà; #6A7D -橾 > shÅ«; #6A7E -æ©¿ > jiÄng; #6A7F -檀 > tán; #6A80 -æª > lÄ­n; #6A81 -檂 > nóng; #6A82 -檃 > yÄ­n; #6A83 -檄 > xí; #6A84 -檅 > sùi; #6A85 -檆 > shÄn; #6A86 -檇 > zùi; #6A87 -檈 > xuán; #6A88 -檉 > chÄ“ng; #6A89 -檊 > gàn; #6A8A -檋 > jÅ«; #6A8B -檌 > zùi; #6A8C -æª > yì; #6A8D -檎 > qín; #6A8E -æª > pÅ­; #6A8F -æª > yán; #6A90 -檑 > léi; #6A91 -檒 > fÄ“ng; #6A92 -檓 > hÅ­i; #6A93 -檔 > dăng; #6A94 -檕 > jì; #6A95 -檖 > sùi; #6A96 -檗 > bò; #6A97 -檘 > bì; #6A98 -檙 > dÄ­ng; #6A99 -檚 > chÅ­; #6A9A -檛 > zhuÄ; #6A9B -檜 > kuài; #6A9C -æª > jí; #6A9D -檞 > jiÄ•; #6A9E -檟 > jiă; #6A9F -檠 > qíng; #6AA0 -檡 > zhè; #6AA1 -檢 > jiăn; #6AA2 -檣 > qiáng; #6AA3 -檤 > dào; #6AA4 -檥 > yÄ­; #6AA5 -檦 > biăo; #6AA6 -檧 > sÅng; #6AA7 -檨 > shÄ“; #6AA8 -檩 > lÄ­n; #6AA9 -檫 > chá; #6AAB -檬 > méng; #6AAC -檭 > yín; #6AAD -檮 > táo; #6AAE -檯 > tái; #6AAF -檰 > mián; #6AB0 -檱 > qí; #6AB1 -檲 > tóan; #6AB2 -檳 > bÄ«n; #6AB3 -檴 > hùo; #6AB4 -檵 > jì; #6AB5 -檶 > qiÄn; #6AB6 -檷 > mí; #6AB7 -檸 > níng; #6AB8 -檹 > yÄ«; #6AB9 -檺 > găo; #6ABA -檻 > jiàn; #6ABB -檼 > yìn; #6ABC -檽 > ér; #6ABD -檾 > qÄ­ng; #6ABE -檿 > yăn; #6ABF -æ«€ > qí; #6AC0 -æ« > mì; #6AC1 -æ«‚ > zhào; #6AC2 -櫃 > gùi; #6AC3 -æ«„ > chÅ«n; #6AC4 -æ«… > jÄ«; #6AC5 -櫆 > kúi; #6AC6 -櫇 > pó; #6AC7 -櫈 > dèng; #6AC8 -櫉 > chú; #6AC9 -æ«‹ > mián; #6ACB -æ«Œ > yÅu; #6ACC -æ« > zhì; #6ACD -æ«Ž > guàng; #6ACE -æ« > qiÄn; #6ACF -æ« > lÄ•i; #6AD0 -æ«‘ > lÄ•i; #6AD1 -æ«’ > sà; #6AD2 -æ«“ > lÅ­; #6AD3 -æ«” > lì; #6AD4 -æ«• > cuán; #6AD5 -æ«– > lǘ; #6AD6 -æ«— > miè; #6AD7 -櫘 > hùi; #6AD8 -æ«™ > Åu; #6AD9 -æ«š > lǘ; #6ADA -æ«› > jié; #6ADB -æ«œ > gÄo; #6ADC -æ« > dú; #6ADD -æ«ž > yuán; #6ADE -æ«Ÿ > lì; #6ADF -æ«  > fèi; #6AE0 -æ«¡ > zhúo; #6AE1 -æ«¢ > sÅu; #6AE2 -æ«£ > lián; #6AE3 -æ«¥ > chú; #6AE5 -櫧 > zhÅ«; #6AE7 -櫨 > lú; #6AE8 -æ«© > yán; #6AE9 -櫪 > lì; #6AEA -æ«« > zhÅ«; #6AEB -櫬 > chèn; #6AEC -æ«­ > jié; #6AED -æ«® > è; #6AEE -櫯 > sÅ«; #6AEF -æ«° > huái; #6AF0 -櫱 > niè; #6AF1 -櫲 > yù; #6AF2 -櫳 > lóng; #6AF3 -æ«´ > lài; #6AF4 -櫶 > xiăn; #6AF6 -櫸 > jÅ­; #6AF8 -櫹 > xiÄo; #6AF9 -櫺 > líng; #6AFA -æ«» > yÄ«ng; #6AFB -櫼 > jiÄn; #6AFC -櫽 > yÄ­n; #6AFD -櫾 > yóu; #6AFE -æ«¿ > yíng; #6AFF -欀 > xiÄng; #6B00 -æ¬ > nóng; #6B01 -欂 > bó; #6B02 -欃 > chán; #6B03 -欄 > lán; #6B04 -欅 > jÅ­; #6B05 -欆 > shuÄng; #6B06 -欇 > shè; #6B07 -欈 > wéi; #6B08 -欉 > còng; #6B09 -權 > quán; #6B0A -欋 > qú; #6B0B -欎 > yù; #6B0E -æ¬ > lúo; #6B0F -æ¬ > lÄ­; #6B10 -欑 > zàn; #6B11 -欒 > luán; #6B12 -欓 > dăng; #6B13 -欔 > jué; #6B14 -欖 > lăn; #6B16 -欗 > lán; #6B17 -欘 > zhÅ­; #6B18 -欙 > léi; #6B19 -欚 > lÄ­; #6B1A -欛 > bà; #6B1B -欜 > náng; #6B1C -æ¬ > yù; #6B1D -欞 > líng; #6B1E -欠 > qiàn; #6B20 -次 > cì; #6B21 -欢 > huÄn; #6B22 -欣 > xÄ«n; #6B23 -欤 > yú; #6B24 -欥 > yù; #6B25 -欦 > qiÄn; #6B26 -欧 > Åu; #6B27 -欨 > xÅ«; #6B28 -欩 > chÄo; #6B29 -欪 > chù; #6B2A -欫 > chÄ«; #6B2B -欬 > kài; #6B2C -欭 > yì; #6B2D -欮 > jué; #6B2E -欯 > xí; #6B2F -欰 > xÅ«; #6B30 -欱 > xià; #6B31 -欲 > yù; #6B32 -欳 > kuài; #6B33 -欴 > láng; #6B34 -欵 > kuăn; #6B35 -欶 > shùo; #6B36 -欷 > xÄ«; #6B37 -欸 > ăi; #6B38 -欹 > yÄ«; #6B39 -欺 > qÄ«; #6B3A -欻 > hÅ«; #6B3B -欼 > chÄ­; #6B3C -欽 > qÄ«n; #6B3D -款 > kuăn; #6B3E -欿 > kăn; #6B3F -æ­€ > kuăn; #6B40 -æ­ > kăn; #6B41 -æ­‚ > chuán; #6B42 -æ­ƒ > shà; #6B43 -æ­„ > gua; #6B44 -æ­… > yÄ«n; #6B45 -æ­† > xÄ«n; #6B46 -æ­‡ > xiÄ“; #6B47 -æ­ˆ > yú; #6B48 -æ­‰ > qiàn; #6B49 -æ­Š > xiÄo; #6B4A -æ­‹ > yí; #6B4B -æ­Œ > gÄ“; #6B4C -æ­ > wÅ«; #6B4D -æ­Ž > tàn; #6B4E -æ­ > jìn; #6B4F -æ­ > Åu; #6B50 -æ­‘ > hÅ«; #6B51 -æ­’ > tì; #6B52 -æ­“ > huÄn; #6B53 -æ­” > xÅ«; #6B54 -æ­• > pèn; #6B55 -æ­– > xÄ«; #6B56 -æ­— > xiào; #6B57 -æ­˜ > xÅ«; #6B58 -æ­™ > xì; #6B59 -æ­› > liàn; #6B5B -æ­œ > chù; #6B5C -æ­ > yì; #6B5D -æ­ž > kăn; #6B5E -æ­Ÿ > yú; #6B5F -æ­  > chùo; #6B60 -æ­¡ > huÄn; #6B61 -æ­¢ > zhÄ­; #6B62 -æ­£ > zhèng; #6B63 -æ­¤ > cÄ­; #6B64 -æ­¥ > bù; #6B65 -æ­¦ > wÅ­; #6B66 -æ­§ > qí; #6B67 -æ­¨ > bù; #6B68 -æ­© > bù; #6B69 -æ­ª > wÄi; #6B6A -æ­« > jù; #6B6B -æ­¬ > qián; #6B6C -æ­­ > chí; #6B6D -æ­® > sè; #6B6E -æ­¯ > chÄ­; #6B6F -æ­° > sè; #6B70 -æ­± > zhÅng; #6B71 -æ­² > sùi; #6B72 -æ­³ > sùi; #6B73 -æ­´ > lì; #6B74 -æ­µ > cùo; #6B75 -æ­¶ > yú; #6B76 -æ­· > lì; #6B77 -æ­¸ > gÅ«i; #6B78 -æ­¹ > dăi; #6B79 -æ­º > dăi; #6B7A -æ­» > sÄ­; #6B7B -æ­¼ > jiÄn; #6B7C -æ­½ > zhé; #6B7D -æ­¾ > mò; #6B7E -æ­¿ > mò; #6B7F -殀 > yăo; #6B80 -æ® > mò; #6B81 -殂 > cú; #6B82 -殃 > yÄng; #6B83 -殄 > tiăn; #6B84 -æ®… > shÄ“ng; #6B85 -殆 > dài; #6B86 -殇 > shÄng; #6B87 -殈 > xù; #6B88 -殉 > xùn; #6B89 -殊 > shÅ«; #6B8A -残 > cán; #6B8B -殌 > jué; #6B8C -æ® > piăo; #6B8D -殎 > qià; #6B8E -æ® > qìu; #6B8F -æ® > sù; #6B90 -殑 > qíng; #6B91 -æ®’ > yÅ­n; #6B92 -殓 > liàn; #6B93 -æ®” > yì; #6B94 -殕 > fÅu; #6B95 -æ®– > zhí; #6B96 -æ®— > yè; #6B97 -殘 > cán; #6B98 -æ®™ > hÅ«n; #6B99 -殚 > dÄn; #6B9A -æ®› > jí; #6B9B -殜 > yè; #6B9C -æ® > zhen; #6B9D -殞 > yÅ­n; #6B9E -殟 > wÄ“n; #6B9F -æ®  > chòu; #6BA0 -殡 > bìn; #6BA1 -殢 > tì; #6BA2 -殣 > jÄ­n; #6BA3 -殤 > shÄng; #6BA4 -殥 > yín; #6BA5 -殦 > diÄo; #6BA6 -殧 > cù; #6BA7 -殨 > hùi; #6BA8 -殩 > cuàn; #6BA9 -殪 > yì; #6BAA -殫 > dÄn; #6BAB -殬 > dù; #6BAC -æ®­ > jiÄng; #6BAD -æ®® > liàn; #6BAE -殯 > bìn; #6BAF -æ®° > dú; #6BB0 -殲 > jiÄn; #6BB2 -殳 > shÅ«; #6BB3 -æ®´ > Åu; #6BB4 -段 > duàn; #6BB5 -殶 > zhù; #6BB6 -æ®· > yÄ«n; #6BB7 -殸 > qìng; #6BB8 -殹 > yì; #6BB9 -殺 > shÄ; #6BBA -æ®» > què; #6BBB -殼 > ké; #6BBC -殽 > yáo; #6BBD -殾 > jùn; #6BBE -殿 > diàn; #6BBF -毀 > hÅ­i; #6BC0 -æ¯ > hÅ­i; #6BC1 -毂 > gÅ­; #6BC2 -毃 > què; #6BC3 -毄 > jÄ«; #6BC4 -毅 > yì; #6BC5 -毆 > Åu; #6BC6 -毇 > hÅ­i; #6BC7 -毈 > duàn; #6BC8 -毉 > yÄ«; #6BC9 -毊 > xiÄo; #6BCA -毋 > wú; #6BCB -毌 > guàn; #6BCC -æ¯ > mÅ­; #6BCD -毎 > mÄ•i; #6BCE -æ¯ > mÄ•i; #6BCF -æ¯ > ăi; #6BD0 -毑 > zÅ­o; #6BD1 -毒 > dú; #6BD2 -毓 > yù; #6BD3 -比 > bÄ­; #6BD4 -毕 > bì; #6BD5 -毖 > bì; #6BD6 -毗 > pí; #6BD7 -毘 > pí; #6BD8 -毙 > bì; #6BD9 -毚 > chán; #6BDA -毛 > máo; #6BDB -毞 > pú; #6BDE -毠 > jiÄ; #6BE0 -毡 > zhÄn; #6BE1 -毢 > sÄi; #6BE2 -毣 > mù; #6BE3 -毤 > tùo; #6BE4 -毥 > xún; #6BE5 -毦 > èr; #6BE6 -毧 > róng; #6BE7 -毨 > xiăn; #6BE8 -毩 > jú; #6BE9 -毪 > mú; #6BEA -毫 > háo; #6BEB -毬 > qíu; #6BEC -毭 > dòu; #6BED -毯 > tăn; #6BEF -毰 > péi; #6BF0 -毱 > jú; #6BF1 -毲 > dúo; #6BF2 -毳 > cùi; #6BF3 -毴 > bÄ«; #6BF4 -毵 > sÄn; #6BF5 -毷 > mào; #6BF7 -毸 > sÅ«i; #6BF8 -毹 > yÅ«; #6BF9 -毺 > yÅ«; #6BFA -毻 > tùo; #6BFB -毼 > hé; #6BFC -毽 > jiàn; #6BFD -毾 > tà; #6BFE -毿 > sÄn; #6BFF -æ°€ > lǘ; #6C00 -æ° > mú; #6C01 -æ°‚ > lí; #6C02 -æ°ƒ > tóng; #6C03 -æ°„ > rÅng; #6C04 -æ°… > chăng; #6C05 -æ°† > pÅ­; #6C06 -æ°‡ > lúo; #6C07 -æ°ˆ > zhÄn; #6C08 -æ°‰ > sào; #6C09 -æ°Š > zhÄn; #6C0A -æ°‹ > méng; #6C0B -æ°Œ > lúo; #6C0C -æ° > qú; #6C0D -æ°Ž > dié; #6C0E -æ° > shì; #6C0F -æ° > dÄ­; #6C10 -æ°‘ > mín; #6C11 -æ°’ > jué; #6C12 -æ°“ > máng; #6C13 -æ°” > qì; #6C14 -æ°• > piÄ“; #6C15 -æ°– > năi; #6C16 -æ°— > qì; #6C17 -æ°˜ > dÄo; #6C18 -æ°™ > xiÄn; #6C19 -æ°š > chuÄn; #6C1A -æ°› > fÄ“n; #6C1B -æ°œ > rì; #6C1C -æ° > nèi; #6C1D -æ°Ÿ > fú; #6C1F -æ°  > shÄ“n; #6C20 -æ°¡ > dÅng; #6C21 -æ°¢ > qÄ«ng; #6C22 -æ°£ > qì; #6C23 -æ°¤ > yÄ«n; #6C24 -æ°¥ > xÄ«; #6C25 -æ°¦ > hài; #6C26 -æ°§ > yăng; #6C27 -æ°¨ > Än; #6C28 -æ°© > yà; #6C29 -æ°ª > kè; #6C2A -æ°« > qÄ«ng; #6C2B -æ°¬ > yà; #6C2C -æ°­ > dÅng; #6C2D -æ°® > dàn; #6C2E -æ°¯ > lÇœ; #6C2F -æ°° > qÄ«ng; #6C30 -æ°± > yăng; #6C31 -æ°² > yÅ«n; #6C32 -æ°³ > yÅ«n; #6C33 -æ°´ > shÅ­i; #6C34 -æ°µ > sÄn' 'diăn' 'shÅ­i; #6C35 -æ°¶ > zhÄ•ng; #6C36 -æ°· > bÄ«ng; #6C37 -æ°¸ > yÅng; #6C38 -æ°¹ > dàng; #6C39 -æ°» > lè; #6C3B -æ°¼ > nì; #6C3C -æ°½ > tÅ­n; #6C3D -æ°¾ > fàn; #6C3E -æ°¿ > gÅ­i; #6C3F -æ±€ > tÄ«ng; #6C40 -æ± > zhÄ«; #6C41 -求 > qíu; #6C42 -汃 > bÄ«n; #6C43 -汄 > zè; #6C44 -æ±… > miăn; #6C45 -汆 > cuÄn; #6C46 -汇 > hùi; #6C47 -汈 > diÄo; #6C48 -汉 > yì; #6C49 -汊 > chà; #6C4A -汋 > zhúo; #6C4B -汌 > chuàn; #6C4C -æ± > wán; #6C4D -汎 > fàn; #6C4E -æ± > dài; #6C4F -æ± > xì; #6C50 -汑 > tÅ«o; #6C51 -æ±’ > máng; #6C52 -汓 > qíu; #6C53 -æ±” > qì; #6C54 -汕 > shàn; #6C55 -æ±– > pài; #6C56 -æ±— > hàn; #6C57 -汘 > qiÄn; #6C58 -æ±™ > wÅ«; #6C59 -汚 > wÅ«; #6C5A -æ±› > xùn; #6C5B -汜 > sì; #6C5C -æ± > rÅ­; #6C5D -汞 > gÅng; #6C5E -江 > jiÄng; #6C5F -æ±  > chí; #6C60 -污 > wÅ«; #6C61 -汤 > tÄng; #6C64 -æ±¥ > zhÄ«; #6C65 -汦 > chí; #6C66 -汧 > qiÄn; #6C67 -汨 > mì; #6C68 -汩 > yù; #6C69 -汪 > wÄng; #6C6A -汫 > qìng; #6C6B -汬 > jÄ­ng; #6C6C -æ±­ > rùi; #6C6D -æ±® > jÅ«n; #6C6E -汯 > hóng; #6C6F -æ±° > tài; #6C70 -æ±± > quăn; #6C71 -æ±² > jí; #6C72 -æ±³ > biàn; #6C73 -æ±´ > biàn; #6C74 -æ±µ > gàn; #6C75 -汶 > wèn; #6C76 -æ±· > zhÅng; #6C77 -汸 > fÄng; #6C78 -æ±¹ > xÄ«ong; #6C79 -決 > jué; #6C7A -æ±» > hăng; #6C7B -æ±¼ > niÅu; #6C7C -æ±½ > qì; #6C7D -æ±¾ > fén; #6C7E -汿 > xù; #6C7F -æ²€ > xù; #6C80 -æ² > qìn; #6C81 -沂 > yí; #6C82 -沃 > wò; #6C83 -沄 > yún; #6C84 -æ²… > yuán; #6C85 -沆 > háng; #6C86 -沇 > yăn; #6C87 -沈 > chén; #6C88 -沉 > chén; #6C89 -沊 > dàn; #6C8A -沋 > yóu; #6C8B -沌 > dùn; #6C8C -æ² > hù; #6C8D -沎 > hùo; #6C8E -æ² > qiÄ“; #6C8F -æ² > mù; #6C90 -沑 > róu; #6C91 -æ²’ > méi; #6C92 -沓 > tà; #6C93 -æ²” > miăn; #6C94 -沕 > wù; #6C95 -æ²– > chÅng; #6C96 -æ²— > tiÄn; #6C97 -沘 > bÄ­; #6C98 -æ²™ > shÄ; #6C99 -沚 > zhÄ­; #6C9A -æ²› > pèi; #6C9B -沜 > pàn; #6C9C -æ² > zhÅ­i; #6C9D -沞 > zÄ; #6C9E -沟 > gÅu; #6C9F -æ²  > líu; #6CA0 -没 > méi; #6CA1 -æ²¢ > zé; #6CA2 -æ²£ > fÄ“ng; #6CA3 -沤 > òu; #6CA4 -æ²¥ > lì; #6CA5 -沦 > lún; #6CA6 -沧 > cÄng; #6CA7 -沨 > féng; #6CA8 -沩 > wéi; #6CA9 -沪 > hù; #6CAA -沫 > mò; #6CAB -沬 > mèi; #6CAC -æ²­ > shù; #6CAD -æ²® > jÅ«; #6CAE -沯 > zăn; #6CAF -æ²° > tÅ«o; #6CB0 -æ²± > túo; #6CB1 -æ²² > túo; #6CB2 -æ²³ > hé; #6CB3 -æ²´ > lì; #6CB4 -æ²µ > mÄ­; #6CB5 -沶 > yí; #6CB6 -æ²· > fÄ; #6CB7 -沸 > fèi; #6CB8 -æ²¹ > yóu; #6CB9 -沺 > tián; #6CBA -æ²» > zhì; #6CBB -æ²¼ > zhăo; #6CBC -æ²½ > gÅ«; #6CBD -æ²¾ > zhÄn; #6CBE -沿 > yán; #6CBF -æ³€ > sÄ«; #6CC0 -æ³ > kuàng; #6CC1 -泂 > jÄ­ong; #6CC2 -泃 > jù; #6CC3 -泄 > xiè; #6CC4 -æ³… > qíu; #6CC5 -泆 > yÄ«; #6CC6 -泇 > jiÄ; #6CC7 -泈 > zhÅng; #6CC8 -泉 > quán; #6CC9 -泊 > bó; #6CCA -泋 > hùi; #6CCB -泌 > mì; #6CCC -æ³ > bÄ“n; #6CCD -泎 > zhúo; #6CCE -æ³ > chù; #6CCF -æ³ > lè; #6CD0 -泑 > yÅu; #6CD1 -æ³’ > gÅ«; #6CD2 -泓 > hóng; #6CD3 -æ³” > gÄn; #6CD4 -法 > fă; #6CD5 -æ³– > măo; #6CD6 -æ³— > sì; #6CD7 -泘 > hÅ«; #6CD8 -æ³™ > píng; #6CD9 -泚 > cÄ­; #6CDA -æ³› > fàn; #6CDB -泜 > chí; #6CDC -æ³ > sù; #6CDD -泞 > nìng; #6CDE -泟 > chÄ“ng; #6CDF -æ³  > líng; #6CE0 -泡 > pào; #6CE1 -æ³¢ > bÅ; #6CE2 -æ³£ > qì; #6CE3 -泤 > sì; #6CE4 -æ³¥ > ní; #6CE5 -泦 > jú; #6CE6 -泧 > yuè; #6CE7 -注 > zhù; #6CE8 -泩 > shÄ“ng; #6CE9 -泪 > lèi; #6CEA -泫 > xuàn; #6CEB -泬 > xuè; #6CEC -æ³­ > fÅ«; #6CED -æ³® > pàn; #6CEE -泯 > mÄ­n; #6CEF -æ³° > tài; #6CF0 -æ³± > yÄng; #6CF1 -æ³² > jÄ­; #6CF2 -æ³³ > yÅng; #6CF3 -æ³´ > guàn; #6CF4 -æ³µ > bèng; #6CF5 -泶 > xué; #6CF6 -æ³· > lóng; #6CF7 -泸 > lú; #6CF8 -泺 > bó; #6CFA -æ³» > xiè; #6CFB -æ³¼ > pÅ; #6CFC -æ³½ > zé; #6CFD -æ³¾ > jÄ«ng; #6CFE -泿 > yín; #6CFF -æ´€ > zhÅu; #6D00 -æ´ > jí; #6D01 -æ´‚ > yì; #6D02 -æ´ƒ > hÅ«i; #6D03 -æ´„ > húi; #6D04 -æ´… > zÅ­i; #6D05 -æ´† > chéng; #6D06 -æ´‡ > yÄ«n; #6D07 -æ´ˆ > wéi; #6D08 -æ´‰ > hòu; #6D09 -æ´Š > jiàn; #6D0A -æ´‹ > yáng; #6D0B -æ´Œ > liè; #6D0C -æ´ > sì; #6D0D -æ´Ž > jì; #6D0E -æ´ > ér; #6D0F -æ´ > xíng; #6D10 -æ´‘ > fú; #6D11 -æ´’ > să; #6D12 -æ´“ > sÅ­o; #6D13 -æ´” > zhÄ­; #6D14 -æ´• > yÄ«n; #6D15 -æ´– > wú; #6D16 -æ´— > xÄ­; #6D17 -æ´˜ > kăo; #6D18 -æ´™ > zhÅ«; #6D19 -æ´š > jiàng; #6D1A -æ´› > lùo; #6D1B -æ´ > àn; #6D1D -æ´ž > dòng; #6D1E -æ´Ÿ > yí; #6D1F -æ´  > móu; #6D20 -æ´¡ > lÄ•i; #6D21 -æ´¢ > yÄ«; #6D22 -æ´£ > mÄ­; #6D23 -æ´¤ > quán; #6D24 -æ´¥ > jÄ«n; #6D25 -æ´¦ > mò; #6D26 -æ´§ > wÄ•i; #6D27 -æ´¨ > xiáo; #6D28 -æ´© > xiè; #6D29 -æ´ª > hóng; #6D2A -æ´« > xù; #6D2B -æ´¬ > shùo; #6D2C -æ´­ > kuÄng; #6D2D -æ´® > tÄo; #6D2E -æ´¯ > qiè; #6D2F -æ´° > jù; #6D30 -æ´± > Ä•r; #6D31 -æ´² > zhÅu; #6D32 -æ´³ > rù; #6D33 -æ´´ > píng; #6D34 -æ´µ > xún; #6D35 -æ´¶ > xÄ«ong; #6D36 -æ´· > zhì; #6D37 -æ´¸ > guÄng; #6D38 -æ´¹ > huán; #6D39 -æ´º > míng; #6D3A -æ´» > húo; #6D3B -æ´¼ > wÄ; #6D3C -æ´½ > qià; #6D3D -æ´¾ > pài; #6D3E -æ´¿ > wÅ«; #6D3F -æµ€ > qÅ­; #6D40 -æµ > líu; #6D41 -浂 > yì; #6D42 -浃 > jiá; #6D43 -浄 > jìng; #6D44 -æµ… > qiăn; #6D45 -浆 > jiÄng; #6D46 -浇 > jiÄo; #6D47 -浈 > chéng; #6D48 -浉 > shÄ«; #6D49 -浊 > zhúo; #6D4A -测 > cè; #6D4B -æµ > kuài; #6D4D -济 > jì; #6D4E -æµ > líu; #6D4F -æµ > chăn; #6D50 -浑 > hún; #6D51 -æµ’ > hÅ­; #6D52 -浓 > nóng; #6D53 -æµ” > xún; #6D54 -浕 > jìn; #6D55 -æµ– > liè; #6D56 -æµ— > qíu; #6D57 -浘 > wÄ•i; #6D58 -æµ™ > zhè; #6D59 -浚 > jùn; #6D5A -æµ› > hàn; #6D5B -浜 > bÄng; #6D5C -æµ > máng; #6D5D -浞 > zhúo; #6D5E -浟 > yóu; #6D5F -æµ  > xÄ«; #6D60 -浡 > bó; #6D61 -æµ¢ > dòu; #6D62 -æµ£ > wăn; #6D63 -浤 > hóng; #6D64 -æµ¥ > yì; #6D65 -浦 > pÅ­; #6D66 -浧 > yÄ­ng; #6D67 -浨 > lăn; #6D68 -浩 > hào; #6D69 -浪 > làng; #6D6A -浫 > hăn; #6D6B -浬 > lÄ­; #6D6C -æµ­ > gÄ“ng; #6D6D -æµ® > fú; #6D6E -浯 > wú; #6D6F -æµ° > liàn; #6D70 -æµ± > chún; #6D71 -æµ² > féng; #6D72 -æµ³ > yì; #6D73 -æµ´ > yù; #6D74 -æµµ > tóng; #6D75 -浶 > láo; #6D76 -æµ· > hăi; #6D77 -浸 > jìn; #6D78 -æµ¹ > jiá; #6D79 -浺 > chÅng; #6D7A -æµ» > wÄ•ng; #6D7B -æµ¼ > mÄ•i; #6D7C -æµ½ > sÅ«i; #6D7D -æµ¾ > chÄ“ng; #6D7E -浿 > pèi; #6D7F -涀 > xiàn; #6D80 -æ¶ > shèn; #6D81 -涂 > tú; #6D82 -涃 > kùn; #6D83 -涄 > pÄ«n; #6D84 -涅 > niè; #6D85 -涆 > hàn; #6D86 -涇 > jÄ«ng; #6D87 -消 > xiÄo; #6D88 -涉 > shè; #6D89 -涊 > niàn; #6D8A -涋 > tÅ«; #6D8B -涌 > yÅng; #6D8C -æ¶ > xiào; #6D8D -涎 > xián; #6D8E -æ¶ > tÄ­ng; #6D8F -æ¶ > é; #6D90 -涑 > sù; #6D91 -涒 > tÅ«n; #6D92 -涓 > juÄn; #6D93 -涔 > cén; #6D94 -涕 > tì; #6D95 -涖 > lì; #6D96 -涗 > shùi; #6D97 -涘 > sì; #6D98 -涙 > lèi; #6D99 -涚 > shùi; #6D9A -涛 > tÄo; #6D9B -涜 > dú; #6D9C -æ¶ > lào; #6D9D -涞 > lái; #6D9E -涟 > lián; #6D9F -涠 > wéi; #6DA0 -涡 > wÅ; #6DA1 -涢 > yún; #6DA2 -涣 > huàn; #6DA3 -涤 > dí; #6DA4 -润 > rùn; #6DA6 -涧 > jiàn; #6DA7 -涨 > zhăng; #6DA8 -涩 > sè; #6DA9 -涪 > fú; #6DAA -涫 > guàn; #6DAB -涬 > xìng; #6DAC -涭 > shòu; #6DAD -涮 > shuàn; #6DAE -涯 > yá; #6DAF -涰 > chùo; #6DB0 -涱 > zhàng; #6DB1 -液 > yè; #6DB2 -涳 > kÅng; #6DB3 -涴 > wò; #6DB4 -涵 > hán; #6DB5 -涶 > tÅ«o; #6DB6 -涷 > dÅng; #6DB7 -涸 > hé; #6DB8 -涹 > wÅ; #6DB9 -涺 > jÅ«; #6DBA -涻 > gàn; #6DBB -涼 > liáng; #6DBC -涽 > hÅ«n; #6DBD -涾 > tà; #6DBE -涿 > zhúo; #6DBF -æ·€ > diàn; #6DC0 -æ· > qiè; #6DC1 -æ·‚ > dé; #6DC2 -æ·ƒ > juàn; #6DC3 -æ·„ > zÄ«; #6DC4 -æ·… > xÄ«; #6DC5 -æ·† > yáo; #6DC6 -æ·‡ > qí; #6DC7 -æ·ˆ > gÅ­; #6DC8 -æ·‰ > gÅ­o; #6DC9 -æ·Š > hàn; #6DCA -æ·‹ > lín; #6DCB -æ·Œ > tăng; #6DCC -æ· > zhÅu; #6DCD -æ·Ž > pÄ•ng; #6DCE -æ· > hào; #6DCF -æ· > chÄng; #6DD0 -æ·‘ > shú; #6DD1 -æ·’ > qÄ«; #6DD2 -æ·“ > fÄng; #6DD3 -æ·” > chì; #6DD4 -æ·• > lù; #6DD5 -æ·– > nào; #6DD6 -æ·— > jú; #6DD7 -æ·˜ > táo; #6DD8 -æ·™ > cóng; #6DD9 -æ·š > lèi; #6DDA -æ·› > zhì; #6DDB -æ·œ > péng; #6DDC -æ· > féi; #6DDD -æ·ž > sÅng; #6DDE -æ·Ÿ > tiăn; #6DDF -æ·  > pì; #6DE0 -æ·¡ > dàn; #6DE1 -æ·¢ > yù; #6DE2 -æ·£ > ní; #6DE3 -æ·¤ > yÅ«; #6DE4 -æ·¥ > lù; #6DE5 -æ·¦ > gàn; #6DE6 -æ·§ > mì; #6DE7 -æ·¨ > jìng; #6DE8 -æ·© > líng; #6DE9 -æ·ª > lún; #6DEA -æ·« > yín; #6DEB -æ·¬ > cùi; #6DEC -æ·­ > qú; #6DED -æ·® > huái; #6DEE -æ·¯ > yù; #6DEF -æ·° > niàn; #6DF0 -æ·± > shÄ“n; #6DF1 -æ·² > piáo; #6DF2 -æ·³ > chún; #6DF3 -æ·´ > wà; #6DF4 -æ·µ > yuÄn; #6DF5 -æ·¶ > lái; #6DF6 -æ·· > hÅ­n; #6DF7 -æ·¸ > qÄ«ng; #6DF8 -æ·¹ > yÄn; #6DF9 -æ·º > qiăn; #6DFA -æ·» > tiÄn; #6DFB -æ·¼ > miăo; #6DFC -æ·½ > zhÄ­; #6DFD -æ·¾ > yÄ­n; #6DFE -æ·¿ > mì; #6DFF -渀 > bÄ“n; #6E00 -æ¸ > yuÄn; #6E01 -渂 > wèn; #6E02 -渃 > rè; #6E03 -渄 > fÄ“i; #6E04 -清 > qÄ«ng; #6E05 -渆 > yuÄn; #6E06 -渇 > kÄ•; #6E07 -済 > jì; #6E08 -渉 > shè; #6E09 -渊 > yuÄn; #6E0A -渌 > lù; #6E0C -æ¸ > zì; #6E0D -渎 > dú; #6E0E -æ¸ > jiàn; #6E10 -渑 > mÄ­n; #6E11 -渒 > pì; #6E12 -渔 > yú; #6E14 -渕 > yuÄn; #6E15 -渖 > shÄ•n; #6E16 -渗 > shèn; #6E17 -渘 > róu; #6E18 -渙 > huàn; #6E19 -渚 > zhÅ­; #6E1A -減 > jiăn; #6E1B -渜 > nuăn; #6E1C -æ¸ > yú; #6E1D -渞 > qíu; #6E1E -渟 > tíng; #6E1F -渠 > qú; #6E20 -渡 > dù; #6E21 -渢 > féng; #6E22 -渣 > zhÄ; #6E23 -渤 > bó; #6E24 -渥 > wò; #6E25 -渦 > wÅ; #6E26 -渧 > dì; #6E27 -渨 > wÄ“i; #6E28 -温 > wÄ“n; #6E29 -渪 > rú; #6E2A -渫 > xiè; #6E2B -測 > cè; #6E2C -渭 > wèi; #6E2D -渮 > gÄ“; #6E2E -港 > găng; #6E2F -渰 > yăn; #6E30 -渱 > hóng; #6E31 -渲 > xuàn; #6E32 -渳 > mÄ­; #6E33 -渴 > kÄ•; #6E34 -渵 > máo; #6E35 -渶 > yÄ«ng; #6E36 -渷 > yăn; #6E37 -游 > yóu; #6E38 -渹 > hÅng; #6E39 -渺 > miăo; #6E3A -渻 > xÄ­ng; #6E3B -渼 > mÄ•i; #6E3C -渽 > zÄi; #6E3D -渾 > hún; #6E3E -渿 > nài; #6E3F -æ¹€ > kúi; #6E40 -æ¹ > shí; #6E41 -湂 > è; #6E42 -湃 > pài; #6E43 -湄 > méi; #6E44 -æ¹… > liàn; #6E45 -湆 > qì; #6E46 -湇 > qì; #6E47 -湈 > méi; #6E48 -湉 > tián; #6E49 -湊 > còu; #6E4A -湋 > wéi; #6E4B -湌 > cÄn; #6E4C -æ¹ > tuÄn; #6E4D -湎 > miăn; #6E4E -æ¹ > hùi; #6E4F -æ¹ > mò; #6E50 -湑 > xÅ­; #6E51 -æ¹’ > jí; #6E52 -湓 > pén; #6E53 -æ¹” > jiÄn; #6E54 -湕 > jiăn; #6E55 -æ¹– > hú; #6E56 -æ¹— > fèng; #6E57 -湘 > xiÄng; #6E58 -æ¹™ > yì; #6E59 -湚 > yìn; #6E5A -æ¹› > zhàn; #6E5B -湜 > shí; #6E5C -æ¹ > jiÄ“; #6E5D -湞 > chéng; #6E5E -湟 > huáng; #6E5F -æ¹  > tàn; #6E60 -湡 > yú; #6E61 -æ¹¢ > bì; #6E62 -æ¹£ > mÄ­n; #6E63 -湤 > shÄ«; #6E64 -æ¹¥ > tú; #6E65 -湦 > shÄ“ng; #6E66 -湧 > yÅng; #6E67 -湨 > qù; #6E68 -湩 > zhòng; #6E69 -湪 > suèi; #6E6A -湫 > jÄ«u; #6E6B -湬 > jiăo; #6E6C -æ¹­ > qióu; #6E6D -æ¹® > yÄ«n; #6E6E -湯 > tÄng; #6E6F -æ¹° > lóng; #6E70 -æ¹± > hùo; #6E71 -æ¹² > yuán; #6E72 -æ¹³ > năn; #6E73 -æ¹´ > bàn; #6E74 -æ¹µ > yÅu; #6E75 -湶 > quán; #6E76 -æ¹· > chúi; #6E77 -湸 > liàng; #6E78 -æ¹¹ > chán; #6E79 -湺 > yán; #6E7A -æ¹» > chún; #6E7B -æ¹¼ > niè; #6E7C -æ¹½ > zÄ«; #6E7D -æ¹¾ > wÄn; #6E7E -湿 > shÄ«; #6E7F -満 > măn; #6E80 -æº > yíng; #6E81 -溃 > kùi; #6E83 -溅 > jiàn; #6E85 -溆 > xù; #6E86 -溇 > lÇš; #6E87 -溈 > gÅ«i; #6E88 -溉 > gài; #6E89 -溌 > pÅ; #6E8C -æº > jìn; #6E8D -溎 > gùi; #6E8E -æº > táng; #6E8F -æº > yuán; #6E90 -溑 > sÅ­o; #6E91 -溒 > yuán; #6E92 -溓 > lián; #6E93 -溔 > yăo; #6E94 -溕 > mèng; #6E95 -準 > zhÅ­n; #6E96 -溗 > shéng; #6E97 -溘 > kè; #6E98 -溙 > tài; #6E99 -溚 > dá; #6E9A -溛 > wÄ; #6E9B -溜 > lÄ«u; #6E9C -æº > gÅu; #6E9D -溞 > sÄo; #6E9E -溟 > míng; #6E9F -溠 > zhà; #6EA0 -溡 > shí; #6EA1 -溢 > yì; #6EA2 -溣 > lún; #6EA3 -溤 > mă; #6EA4 -溥 > pÅ­; #6EA5 -溦 > wéi; #6EA6 -溧 > lì; #6EA7 -溨 > cái; #6EA8 -溩 > wù; #6EA9 -溪 > xÄ«; #6EAA -溫 > wÄ“n; #6EAB -溬 > qiÄng; #6EAC -溭 > zé; #6EAD -溮 > shÄ«; #6EAE -溯 > sù; #6EAF -溰 > yÄ«; #6EB0 -溱 > zhÄ“n; #6EB1 -溲 > sÅu; #6EB2 -溳 > yún; #6EB3 -溴 > xìu; #6EB4 -溵 > yÄ«n; #6EB5 -溶 > róng; #6EB6 -溷 > hùn; #6EB7 -溸 > sù; #6EB8 -溹 > sù; #6EB9 -溺 > nì; #6EBA -溻 > tà; #6EBB -溼 > shÄ«; #6EBC -溽 > rù; #6EBD -溾 > wÄ“i; #6EBE -溿 > pàn; #6EBF -滀 > chù; #6EC0 -æ» > chú; #6EC1 -滂 > pÄng; #6EC2 -滃 > wÄ•ng; #6EC3 -滄 > cÄng; #6EC4 -æ»… > miè; #6EC5 -滆 > hé; #6EC6 -滇 > diÄn; #6EC7 -滈 > hào; #6EC8 -滉 > huăng; #6EC9 -滊 > xì; #6ECA -滋 > zÄ«; #6ECB -滌 > dí; #6ECC -æ» > zhÄ­; #6ECD -滎 > yíng; #6ECE -æ» > fÅ­; #6ECF -æ» > jié; #6ED0 -滑 > huá; #6ED1 -æ»’ > gÄ“; #6ED2 -滓 > zÄ­; #6ED3 -æ»” > tÄo; #6ED4 -滕 > téng; #6ED5 -æ»– > sÅ«i; #6ED6 -æ»— > bÄ­; #6ED7 -滘 > jiào; #6ED8 -æ»™ > hùi; #6ED9 -滚 > gÅ­n; #6EDA -æ»› > yín; #6EDB -滜 > gÄo; #6EDC -æ» > lóng; #6EDD -滞 > zhì; #6EDE -滟 > yàn; #6EDF -æ»  > shè; #6EE0 -满 > măn; #6EE1 -滢 > yìng; #6EE2 -滣 > chún; #6EE3 -滤 > lÇœ; #6EE4 -滥 > làn; #6EE5 -滦 > luán; #6EE6 -滨 > bÄ«n; #6EE8 -滩 > tÄn; #6EE9 -滪 > yù; #6EEA -滫 > sÅu; #6EEB -滬 > hù; #6EEC -æ»­ > bì; #6EED -æ»® > biÄo; #6EEE -滯 > zhì; #6EEF -æ»° > jiăng; #6EF0 -æ»± > kòu; #6EF1 -滲 > shèn; #6EF2 -滳 > shÄng; #6EF3 -æ»´ > dÄ«; #6EF4 -滵 > mì; #6EF5 -滶 > áo; #6EF6 -æ»· > lÅ­; #6EF7 -滸 > hÅ­; #6EF8 -滹 > hÅ«; #6EF9 -滺 > yóu; #6EFA -æ»» > chăn; #6EFB -滼 > fàn; #6EFC -滽 > yóng; #6EFD -滾 > gÅ­n; #6EFE -滿 > măn; #6EFF -æ¼€ > qìng; #6F00 -æ¼ > yú; #6F01 -漂 > piÄo; #6F02 -漃 > jí; #6F03 -漄 > yá; #6F04 -æ¼… > jiăo; #6F05 -漆 > qÄ«; #6F06 -漇 > xÄ­; #6F07 -漈 > jì; #6F08 -漉 > lù; #6F09 -漊 > lÇš; #6F0A -漋 > lóng; #6F0B -漌 > jÄ­n; #6F0C -æ¼ > gúo; #6F0D -漎 > cóng; #6F0E -æ¼ > lòu; #6F0F -æ¼ > zhí; #6F10 -漑 > gài; #6F11 -æ¼’ > qiáng; #6F12 -漓 > lí; #6F13 -æ¼” > yăn; #6F14 -漕 > cáo; #6F15 -æ¼– > jiào; #6F16 -æ¼— > cÅng; #6F17 -漘 > qún; #6F18 -æ¼™ > tuán; #6F19 -漚 > òu; #6F1A -æ¼› > téng; #6F1B -漜 > yÄ•; #6F1C -æ¼ > xí; #6F1D -漞 > mì; #6F1E -漟 > táng; #6F1F -æ¼  > mò; #6F20 -漡 > shÄng; #6F21 -æ¼¢ > hàn; #6F22 -æ¼£ > lián; #6F23 -漤 > lăn; #6F24 -æ¼¥ > wÄ; #6F25 -漦 > lí; #6F26 -漧 > qián; #6F27 -漨 > féng; #6F28 -漩 > xuán; #6F29 -漪 > yÄ«; #6F2A -漫 > màn; #6F2B -漬 > zì; #6F2C -æ¼­ > măng; #6F2D -æ¼® > kÄng; #6F2E -漯 > lÄ•i; #6F2F -æ¼° > pÄ“ng; #6F30 -æ¼± > shù; #6F31 -æ¼² > zhăng; #6F32 -æ¼³ > zhÄng; #6F33 -æ¼´ > chóng; #6F34 -æ¼µ > xù; #6F35 -漶 > huàn; #6F36 -æ¼· > kùo; #6F37 -漸 > jiàn; #6F38 -æ¼¹ > yÄn; #6F39 -漺 > chuăng; #6F3A -æ¼» > liáo; #6F3B -æ¼¼ > cÅ­i; #6F3C -æ¼½ > tí; #6F3D -æ¼¾ > yàng; #6F3E -漿 > jiÄng; #6F3F -æ½€ > cóng; #6F40 -æ½ > yÄ­ng; #6F41 -潂 > hóng; #6F42 -潃 > xún; #6F43 -潄 > shù; #6F44 -æ½… > guàn; #6F45 -潆 > yíng; #6F46 -潇 > xiÄo; #6F47 -潊 > xù; #6F4A -潋 > liàn; #6F4B -潌 > zhì; #6F4C -æ½ > wéi; #6F4D -潎 > pì; #6F4E -æ½ > jué; #6F4F -æ½ > jiào; #6F50 -潑 > pÅ; #6F51 -æ½’ > dàng; #6F52 -潓 > hùi; #6F53 -æ½” > jié; #6F54 -潕 > wÅ­; #6F55 -æ½– > pá; #6F56 -æ½— > jí; #6F57 -潘 > pÄn; #6F58 -æ½™ > gúi; #6F59 -潚 > xiÄo; #6F5A -æ½› > qián; #6F5B -潜 > qián; #6F5C -æ½ > xÄ«; #6F5D -潞 > lù; #6F5E -潟 > xì; #6F5F -æ½  > xuàn; #6F60 -潡 > dùn; #6F61 -æ½¢ > huáng; #6F62 -æ½£ > mÄ­n; #6F63 -潤 > rùn; #6F64 -æ½¥ > sù; #6F65 -潦 > liáo; #6F66 -潧 > zhÄ“n; #6F67 -潨 > zhÅng; #6F68 -潩 > yì; #6F69 -潪 > dí; #6F6A -潫 > wÄn; #6F6B -潬 > dàn; #6F6C -æ½­ > tán; #6F6D -æ½® > cháo; #6F6E -潯 > xún; #6F6F -æ½° > kùi; #6F70 -æ½± > yie; #6F71 -æ½² > shào; #6F72 -æ½³ > tú; #6F73 -æ½´ > zhÅ«; #6F74 -æ½µ > sàn; #6F75 -潶 > hÄ“i; #6F76 -æ½· > bÄ­; #6F77 -潸 > shÄn; #6F78 -æ½¹ > chán; #6F79 -潺 > chán; #6F7A -æ½» > shÅ­; #6F7B -æ½¼ > tóng; #6F7C -æ½½ > pÅ­; #6F7D -æ½¾ > lín; #6F7E -潿 > wéi; #6F7F -æ¾€ > sè; #6F80 -æ¾ > sè; #6F81 -澂 > chéng; #6F82 -澃 > jìong; #6F83 -澄 > chéng; #6F84 -æ¾… > huà; #6F85 -澆 > jiÄo; #6F86 -澇 > lào; #6F87 -澈 > chè; #6F88 -澉 > găn; #6F89 -澊 > cÅ«n; #6F8A -澋 > hèng; #6F8B -澌 > sÄ«; #6F8C -æ¾ > shù; #6F8D -澎 > péng; #6F8E -æ¾ > hàn; #6F8F -æ¾ > yún; #6F90 -澑 > lìu; #6F91 -æ¾’ > hòng; #6F92 -澓 > fú; #6F93 -æ¾” > hào; #6F94 -澕 > hé; #6F95 -æ¾– > xiÄn; #6F96 -æ¾— > jiàn; #6F97 -澘 > shÄn; #6F98 -æ¾™ > xì; #6F99 -澜 > lán; #6F9C -澞 > yú; #6F9E -澟 > lÄ­n; #6F9F -æ¾  > mÄ­n; #6FA0 -澡 > zăo; #6FA1 -æ¾¢ > dÄng; #6FA2 -æ¾£ > wăn; #6FA3 -澤 > zé; #6FA4 -æ¾¥ > xiè; #6FA5 -澦 > yù; #6FA6 -澧 > lÄ­; #6FA7 -澨 > shì; #6FA8 -澩 > xué; #6FA9 -澪 > líng; #6FAA -澫 > màn; #6FAB -澬 > zÄ«; #6FAC -æ¾­ > yÅng; #6FAD -æ¾® > kuài; #6FAE -澯 > càn; #6FAF -æ¾° > liàn; #6FB0 -æ¾± > diàn; #6FB1 -æ¾² > yè; #6FB2 -æ¾³ > ào; #6FB3 -æ¾´ > huán; #6FB4 -æ¾µ > zhÄ“n; #6FB5 -澶 > chán; #6FB6 -æ¾· > màn; #6FB7 -澸 > dăn; #6FB8 -æ¾¹ > dàn; #6FB9 -澺 > yì; #6FBA -æ¾» > sùi; #6FBB -æ¾¼ > pì; #6FBC -æ¾½ > jù; #6FBD -æ¾¾ > tà; #6FBE -澿 > qín; #6FBF -æ¿€ > jÄ«; #6FC0 -æ¿ > zhúo; #6FC1 -æ¿‚ > lián; #6FC2 -濃 > nóng; #6FC3 -æ¿„ > gÅ«o; #6FC4 -æ¿… > jìn; #6FC5 -濆 > fén; #6FC6 -濇 > sè; #6FC7 -濈 > jí; #6FC8 -濉 > sÅ«i; #6FC9 -æ¿Š > hùi; #6FCA -æ¿‹ > chÅ­; #6FCB -æ¿Œ > tà; #6FCC -æ¿ > sÅng; #6FCD -æ¿Ž > dÄ­ng; #6FCE -æ¿ > zhÅ­; #6FD0 -æ¿‘ > lài; #6FD1 -æ¿’ > bÄ«n; #6FD2 -æ¿“ > lián; #6FD3 -æ¿” > mÄ­; #6FD4 -æ¿• > shÄ«; #6FD5 -æ¿– > shù; #6FD6 -æ¿— > mì; #6FD7 -濘 > nìng; #6FD8 -æ¿™ > yíng; #6FD9 -æ¿š > yíng; #6FDA -æ¿› > méng; #6FDB -æ¿œ > jìn; #6FDC -æ¿ > qí; #6FDD -æ¿ž > pì; #6FDE -æ¿Ÿ > jì; #6FDF -æ¿  > háo; #6FE0 -æ¿¡ > rú; #6FE1 -æ¿¢ > zÅ­i; #6FE2 -æ¿£ > wò; #6FE3 -濤 > tÄo; #6FE4 -æ¿¥ > yìn; #6FE5 -濦 > yÄ­n; #6FE6 -濧 > dùi; #6FE7 -濨 > cí; #6FE8 -æ¿© > hùo; #6FE9 -濪 > jìng; #6FEA -æ¿« > làn; #6FEB -濬 > jùn; #6FEC -æ¿­ > ài; #6FED -æ¿® > pÅ«; #6FEE -濯 > zhúo; #6FEF -æ¿° > wéi; #6FF0 -濱 > bÄ«n; #6FF1 -濲 > gÅ­; #6FF2 -濳 > qián; #6FF3 -æ¿´ > xíng; #6FF4 -濶 > kùo; #6FF6 -æ¿· > fèi; #6FF7 -濺 > jiàn; #6FFA -æ¿» > wÄ•i; #6FFB -濼 > lùo; #6FFC -濽 > zàn; #6FFD -濾 > lÇœ; #6FFE -æ¿¿ > lì; #6FFF -瀀 > yÅu; #7000 -ç€ > yàng; #7001 -瀂 > lÅ­; #7002 -瀃 > sì; #7003 -瀄 > jié; #7004 -瀅 > yìng; #7005 -瀆 > dú; #7006 -瀇 > wăng; #7007 -瀈 > hÅ«i; #7008 -瀉 > xiè; #7009 -瀊 > pán; #700A -瀋 > shÄ•n; #700B -瀌 > biÄo; #700C -ç€ > chán; #700D -瀎 > mò; #700E -ç€ > líu; #700F -ç€ > jiÄn; #7010 -瀑 > pù; #7011 -瀒 > sè; #7012 -瀓 > chéng; #7013 -瀔 > gÅ­; #7014 -瀕 > bÄ«n; #7015 -瀖 > hùo; #7016 -瀗 > xiàn; #7017 -瀘 > lú; #7018 -瀙 > qÄ«n; #7019 -瀚 > hàn; #701A -瀛 > yíng; #701B -瀜 > yÅng; #701C -ç€ > lì; #701D -瀞 > jìng; #701E -瀟 > xiÄo; #701F -瀠 > yíng; #7020 -瀡 > sÅ­i; #7021 -瀢 > wéi; #7022 -瀣 > xiè; #7023 -瀤 > huái; #7024 -瀥 > hào; #7025 -瀦 > zhÅ«; #7026 -瀧 > lóng; #7027 -瀨 > lài; #7028 -瀩 > dùi; #7029 -瀪 > fán; #702A -瀫 > hú; #702B -瀬 > lài; #702C -瀯 > yíng; #702F -瀰 > mí; #7030 -瀱 > jì; #7031 -瀲 > liàn; #7032 -瀳 > jiàn; #7033 -瀴 > yÄ­ng; #7034 -瀵 > fèn; #7035 -瀶 > lín; #7036 -瀷 > yì; #7037 -瀸 > jiÄn; #7038 -瀹 > yuè; #7039 -瀺 > chán; #703A -瀻 > dài; #703B -瀼 > ráng; #703C -瀽 > jiăn; #703D -瀾 > lán; #703E -瀿 > fán; #703F -ç€ > shuàng; #7040 -ç > yuÄn; #7041 -ç‚ > zhúo; #7042 -çƒ > fÄ“ng; #7043 -ç„ > shè; #7044 -ç… > lÄ•i; #7045 -ç† > lán; #7046 -ç‡ > cóng; #7047 -çˆ > qú; #7048 -ç‰ > yÅng; #7049 -çŠ > qián; #704A -ç‹ > fă; #704B -çŒ > guàn; #704C -ç > què; #704D -çŽ > yàn; #704E -ç > hào; #704F -ç‘ > să; #7051 -ç’ > zàn; #7052 -ç“ > luán; #7053 -ç” > yàn; #7054 -ç• > lí; #7055 -ç– > mÄ­; #7056 -ç— > shàn; #7057 -ç˜ > tÄn; #7058 -ç™ > dăng; #7059 -çš > jiăo; #705A -ç› > chăn; #705B -ç > hào; #705D -çž > bà; #705E -çŸ > zhú; #705F -ç  > lăn; #7060 -ç¡ > lán; #7061 -ç¢ > năng; #7062 -ç£ > wÄn; #7063 -ç¤ > luán; #7064 -ç¥ > xún; #7065 -ç¦ > xiăn; #7066 -ç§ > yàn; #7067 -ç¨ > găn; #7068 -ç© > yàn; #7069 -çª > yù; #706A -ç« > hÅ­o; #706B -ç¬ > sì' 'diăn' 'hÅ­o; #706C -ç­ > miè; #706D -ç® > guÄng; #706E -ç¯ > dÄ“ng; #706F -ç° > hÅ«i; #7070 -ç± > xiÄo; #7071 -ç² > xiÄo; #7072 -ç³ > hÅ«1; #7073 -ç´ > hóng; #7074 -çµ > líng; #7075 -ç¶ > zào; #7076 -ç· > zhuàn; #7077 -ç¸ > jÄ­u; #7078 -ç¹ > zhà; #7079 -çº > xiè; #707A -ç» > chì; #707B -ç¼ > zhúo; #707C -ç½ > zÄi; #707D -ç¾ > zÄi; #707E -ç¿ > càn; #707F -ç‚€ > yáng; #7080 -ç‚ > qì; #7081 -ç‚‚ > zhÅng; #7082 -炃 > fén; #7083 -ç‚„ > nÄ­u; #7084 -ç‚… > jÄ­ong; #7085 -炆 > wén; #7086 -炇 > pò; #7087 -炈 > yì; #7088 -炉 > lú; #7089 -ç‚Š > chÅ«i; #708A -ç‚‹ > pÄ«; #708B -ç‚Œ > kài; #708C -ç‚ > pàn; #708D -ç‚Ž > yán; #708E -ç‚ > kài; #708F -ç‚ > pàng; #7090 -ç‚‘ > mù; #7091 -ç‚’ > chăo; #7092 -ç‚“ > liào; #7093 -ç‚” > gùi; #7094 -ç‚• > kàng; #7095 -ç‚– > tÅ«n; #7096 -ç‚— > guÄng; #7097 -炘 > xÄ«n; #7098 -ç‚™ > zhì; #7099 -ç‚š > guang; #709A -ç‚› > guÄng; #709B -ç‚œ > wÄ•i; #709C -ç‚ > qiàng; #709D -ç‚Ÿ > dá; #709F -ç‚  > xiá; #70A0 -ç‚¡ > zhÄ“ng; #70A1 -ç‚¢ > zhú; #70A2 -ç‚£ > kÄ•; #70A3 -炤 > zhào; #70A4 -ç‚¥ > fú; #70A5 -炦 > bá; #70A6 -炧 > dùo; #70A7 -炨 > dùo; #70A8 -ç‚© > lìng; #70A9 -炪 > zhúo; #70AA -ç‚« > xuàn; #70AB -炬 > jù; #70AC -ç‚­ > tàn; #70AD -ç‚® > pào; #70AE -炯 > jÄ­ong; #70AF -ç‚° > páo; #70B0 -炱 > tái; #70B1 -炲 > tái; #70B2 -炳 > bÄ­ng; #70B3 -ç‚´ > yăng; #70B4 -炵 > tÅng; #70B5 -炶 > hÄn; #70B6 -ç‚· > zhù; #70B7 -炸 > zhà; #70B8 -点 > diăn; #70B9 -為 > wèi; #70BA -ç‚» > shí; #70BB -炼 > liàn; #70BC -炽 > chì; #70BD -炾 > huăng; #70BE -烀 > hÅ«; #70C0 -çƒ > shùo; #70C1 -烂 > làn; #70C2 -烃 > jÄ­ng; #70C3 -烄 > jiăo; #70C4 -烅 > xù; #70C5 -烆 > xíng; #70C6 -烇 > quàn; #70C7 -烈 > liè; #70C8 -烉 > huàn; #70C9 -烊 > yáng; #70CA -烋 > xiÄo; #70CB -烌 > xÄ«u; #70CC -çƒ > xiăn; #70CD -烎 > yín; #70CE -çƒ > wÅ«; #70CF -çƒ > zhÅu; #70D0 -烑 > yáo; #70D1 -烒 > shì; #70D2 -烓 > wÄ“i; #70D3 -烔 > tóng; #70D4 -烕 > xuè; #70D5 -烖 > zÄi; #70D6 -烗 > kài; #70D7 -烘 > hÅng; #70D8 -烙 > lùo; #70D9 -烚 > xiá; #70DA -烛 > zhú; #70DB -烜 > xuăn; #70DC -çƒ > zhÄ“ng; #70DD -烞 > pò; #70DE -烟 > yÄn; #70DF -烠 > hÅ­i; #70E0 -烡 > guÄng; #70E1 -烢 > zhè; #70E2 -烣 > hÅ«i; #70E3 -烤 > kăo; #70E4 -烦 > fán; #70E6 -烧 > shÄo; #70E7 -烨 > yè; #70E8 -烩 > hùi; #70E9 -烫 > tàng; #70EB -烬 > jìn; #70EC -热 > rè; #70ED -烯 > xÄ«; #70EF -烰 > fú; #70F0 -烱 > jÄ­ong; #70F1 -烲 > chè; #70F2 -烳 > pÅ­; #70F3 -烴 > jÄ­ng; #70F4 -烵 > zhúo; #70F5 -烶 > tÄ­ng; #70F6 -烷 > wán; #70F7 -烸 > hăi; #70F8 -烹 > pÄ“ng; #70F9 -烺 > lăng; #70FA -烻 > shÄn; #70FB -烼 > hÅ«; #70FC -烽 > fÄ“ng; #70FD -烾 > chì; #70FE -烿 > róng; #70FF -ç„€ > hú; #7100 -ç„ > xi; #7101 -ç„‚ > shú; #7102 -焃 > hè; #7103 -ç„„ > xÅ«n; #7104 -ç„… > kù; #7105 -焆 > jué; #7106 -焇 > xiÄo; #7107 -焈 > xÄ«; #7108 -焉 > yÄn; #7109 -ç„Š > hàn; #710A -ç„‹ > zhuàng; #710B -ç„Œ > jùn; #710C -ç„ > dì; #710D -ç„Ž > xiè; #710E -ç„ > jí; #710F -ç„ > wù; #7110 -ç„“ > hán; #7113 -ç„” > yàn; #7114 -ç„• > huàn; #7115 -ç„– > mèn; #7116 -ç„— > jú; #7117 -焘 > chóu; #7118 -ç„™ > bèi; #7119 -ç„š > fén; #711A -ç„› > lìn; #711B -ç„œ > kÅ«n; #711C -ç„ > hùn; #711D -ç„ž > tÅ«n; #711E -ç„Ÿ > xí; #711F -ç„  > cùi; #7120 -ç„¡ > wú; #7121 -ç„¢ > hÅng; #7122 -ç„£ > jù; #7123 -焤 > fÅ­; #7124 -ç„¥ > wò; #7125 -焦 > jiÄo; #7126 -焧 > cÅng; #7127 -焨 > fèng; #7128 -ç„© > pÄ«ng; #7129 -焪 > qÄ«ong; #712A -ç„« > rùo; #712B -焬 > xí; #712C -ç„­ > qíong; #712D -ç„® > xìn; #712E -焯 > zhúo; #712F -ç„° > yàn; #7130 -焱 > yàn; #7131 -焲 > yì; #7132 -焳 > jué; #7133 -ç„´ > yù; #7134 -焵 > gàng; #7135 -然 > rán; #7136 -ç„· > pí; #7137 -焸 > gÅ­; #7138 -焺 > shÄ“ng; #713A -ç„» > chàng; #713B -焼 > shÄo; #713C -ç… > chén; #7141 -ç…‚ > hè; #7142 -ç…ƒ > kÅ­i; #7143 -ç…„ > zhÅng; #7144 -ç…… > duàn; #7145 -ç…† > xiÄ; #7146 -ç…‡ > hÅ«i; #7147 -ç…ˆ > fèng; #7148 -ç…‰ > liàn; #7149 -ç…Š > xuÄn; #714A -ç…‹ > xÄ«ng; #714B -ç…Œ > huáng; #714C -ç… > jiăo; #714D -ç…Ž > jiÄn; #714E -ç… > bì; #714F -ç… > yÄ«ng; #7150 -ç…‘ > zhÅ­; #7151 -ç…’ > wÄ•i; #7152 -ç…“ > tuÄn; #7153 -ç…” > tiàn; #7154 -ç…• > xÄ«; #7155 -ç…– > nuăn; #7156 -ç…— > nuăn; #7157 -ç…˜ > chán; #7158 -ç…™ > yÄn; #7159 -ç…š > jÄ­ong; #715A -ç…› > jÄ­ong; #715B -ç…œ > yù; #715C -ç… > mèi; #715D -ç…ž > shà; #715E -ç…Ÿ > wèi; #715F -ç…  > yè; #7160 -ç…¡ > xìn; #7161 -ç…¢ > qíong; #7162 -ç…£ > rÅu; #7163 -ç…¤ > méi; #7164 -ç…¥ > huàn; #7165 -ç…¦ > xÅ­; #7166 -ç…§ > zhào; #7167 -ç…¨ > wÄ“i; #7168 -ç…© > fán; #7169 -ç…ª > qíu; #716A -ç…« > sùi; #716B -ç…¬ > yáng; #716C -ç…­ > liè; #716D -ç…® > zhÅ­; #716E -ç…¯ > jie; #716F -ç…° > gào; #7170 -ç…± > guÄ; #7171 -ç…² > bào; #7172 -ç…³ > hú; #7173 -ç…´ > yÅ«n; #7174 -ç…µ > xiÄ; #7175 -ç…¸ > biÄn; #7178 -ç…¹ > gòu; #7179 -ç…º > tùi; #717A -ç…» > táng; #717B -ç…¼ > chăo; #717C -ç…½ > shÄn; #717D -ç…¾ > n; #717E -ç…¿ > bó; #717F -熀 > huăng; #7180 -ç† > xié; #7181 -熂 > xì; #7182 -熃 > wù; #7183 -熄 > xí; #7184 -熅 > yún; #7185 -熆 > hé; #7186 -熇 > hè; #7187 -熈 > xÄ«; #7188 -熉 > yún; #7189 -熊 > xíong; #718A -熋 > nái; #718B -熌 > shàn; #718C -ç† > qiong; #718D -熎 > yào; #718E -ç† > xÅ«n; #718F -ç† > mì; #7190 -熑 > lián; #7191 -熒 > yíng; #7192 -熓 > wèn; #7193 -熔 > róng; #7194 -熗 > qiàng; #7197 -熘 > lÄ«u; #7198 -熙 > xÄ«; #7199 -熚 > bì; #719A -熛 > biÄo; #719B -熜 > zÅng; #719C -ç† > lù; #719D -熞 > jiÄn; #719E -熟 > shóu; #719F -熠 > yì; #71A0 -熡 > lóu; #71A1 -熢 > fÄ“ng; #71A2 -熣 > sÅ«i; #71A3 -熤 > yì; #71A4 -熥 > tÅng; #71A5 -熦 > jué; #71A6 -熧 > zÅng; #71A7 -熨 > yùn; #71A8 -熩 > hù; #71A9 -熪 > yí; #71AA -熫 > zhì; #71AB -熬 > áo; #71AC -熭 > wèi; #71AD -熮 > liáo; #71AE -熯 > hàn; #71AF -熰 > Åu; #71B0 -熱 > rè; #71B1 -熲 > jÄ­ong; #71B2 -熳 > màn; #71B3 -熵 > shÄng; #71B5 -熶 > cuàn; #71B6 -熷 > zÄ“ng; #71B7 -熸 > jiÄn; #71B8 -熹 > xÄ«; #71B9 -熺 > xÄ«; #71BA -熻 > xÄ«; #71BB -熼 > yì; #71BC -熽 > xiào; #71BD -熾 > chì; #71BE -熿 > huáng; #71BF -燀 > chăn; #71C0 -ç‡ > yè; #71C1 -燂 > qián; #71C2 -燃 > rán; #71C3 -燄 > yàn; #71C4 -燅 > xián; #71C5 -燆 > qiáo; #71C6 -燇 > zùn; #71C7 -燈 > dÄ“ng; #71C8 -燉 > dùn; #71C9 -燊 > shÄ“n; #71CA -燋 > jiÄo; #71CB -燌 > fén; #71CC -ç‡ > sÄ«; #71CD -燎 > liào; #71CE -ç‡ > yù; #71CF -ç‡ > lín; #71D0 -燑 > tóng; #71D1 -燒 > shÄo; #71D2 -燓 > fÄ“n; #71D3 -燔 > fán; #71D4 -燕 > yàn; #71D5 -燖 > xún; #71D6 -燗 > làn; #71D7 -燘 > mÄ•i; #71D8 -燙 > tàng; #71D9 -燚 > yÄ«; #71DA -燛 > jÄ­ng; #71DB -燜 > mèn; #71DC -營 > yíng; #71DF -燠 > yù; #71E0 -燡 > yì; #71E1 -燢 > xué; #71E2 -燣 > lán; #71E3 -燤 > tài; #71E4 -燥 > zào; #71E5 -燦 > càn; #71E6 -燧 > sùi; #71E7 -燨 > xÄ«; #71E8 -燩 > què; #71E9 -燪 > cÅng; #71EA -燫 > lián; #71EB -燬 > hÅ­i; #71EC -燭 > zhú; #71ED -燮 > xiè; #71EE -燯 > líng; #71EF -燰 > wÄ“i; #71F0 -燱 > yì; #71F1 -燲 > xié; #71F2 -燳 > zhào; #71F3 -燴 > hùi; #71F4 -燷 > lán; #71F7 -燸 > rú; #71F8 -燹 > xiăn; #71F9 -燺 > kăo; #71FA -燻 > xÅ«n; #71FB -燼 > jìn; #71FC -燽 > chóu; #71FD -燾 > chóu; #71FE -燿 > yào; #71FF -爀 > hè; #7200 -çˆ > làn; #7201 -爂 > biÄo; #7202 -爃 > róng; #7203 -爄 > lì; #7204 -爅 > mò; #7205 -爆 > bào; #7206 -爇 > rùo; #7207 -爈 > lǘ; #7208 -爉 > là; #7209 -爊 > áo; #720A -爋 > xùn; #720B -爌 > kuàng; #720C -çˆ > shùo; #720D -çˆ > lì; #720F -çˆ > lú; #7210 -爑 > jué; #7211 -爒 > liào; #7212 -爓 > yàn; #7213 -爔 > xÄ«; #7214 -爕 > xiè; #7215 -爖 > lóng; #7216 -爗 > yè; #7217 -爙 > răng; #7219 -爚 > yuè; #721A -爛 > làn; #721B -爜 > cóng; #721C -çˆ > jué; #721D -爞 > tóng; #721E -爟 > guàn; #721F -爡 > chè; #7221 -爢 > mí; #7222 -爣 > tăng; #7223 -爤 > làn; #7224 -爥 > zhú; #7225 -爧 > líng; #7227 -爨 > cuàn; #7228 -爩 > yù; #7229 -爪 > zhuă; #722A -爬 > pá; #722C -爭 > zhÄ“ng; #722D -爮 > páo; #722E -爯 > chÄ“ng; #722F -爰 > yuán; #7230 -爱 > ài; #7231 -爲 > wèi; #7232 -爴 > jué; #7234 -爵 > jué; #7235 -父 > fù; #7236 -爷 > yé; #7237 -爸 > bà; #7238 -爹 > diÄ“; #7239 -爺 > yé; #723A -爻 > yáo; #723B -爼 > zÅ­; #723C -爽 > shuăng; #723D -爾 > Ä•r; #723E -爿 > qiáng; #723F -牀 > chuáng; #7240 -ç‰ > gÄ“; #7241 -牂 > zÄng; #7242 -牃 > dié; #7243 -牄 > qiÄng; #7244 -牅 > yóng; #7245 -牆 > qiáng; #7246 -片 > piàn; #7247 -版 > băn; #7248 -牉 > pàn; #7249 -牊 > sháo; #724A -牋 > jiÄn; #724B -牌 > pái; #724C -ç‰ > dú; #724D -牎 > chuÄng; #724E -ç‰ > tóu; #724F -ç‰ > zhá; #7250 -牑 > biÄn; #7251 -牒 > dié; #7252 -牓 > băng; #7253 -牔 > bó; #7254 -牕 > chuÄng; #7255 -牖 > yÅu; #7256 -牘 > dú; #7258 -牙 > yá; #7259 -牚 > chèng; #725A -牛 > níu; #725B -ç‰ > pìn; #725D -牞 > jÄ«u; #725E -牟 > móu; #725F -牠 > tÅ«o; #7260 -牡 > mÅ­; #7261 -牢 > láo; #7262 -牣 > rèn; #7263 -牤 > máng; #7264 -牥 > fÄng; #7265 -牦 > máo; #7266 -牧 > mù; #7267 -牨 > gÄng; #7268 -物 > wù; #7269 -牪 > yàn; #726A -牫 > gÄ“; #726B -牬 > bèi; #726C -牭 > sì; #726D -牮 > jiàn; #726E -牯 > gÅ­; #726F -牰 > yòu; #7270 -牱 > gÄ“; #7271 -牲 > shÄ“ng; #7272 -牳 > mÅ­; #7273 -牴 > dÄ­; #7274 -牵 > qiÄn; #7275 -牶 > quàn; #7276 -牷 > quán; #7277 -牸 > zì; #7278 -特 > tè; #7279 -牺 > xÄ«; #727A -牻 > máng; #727B -牼 > kÄ“ng; #727C -牽 > qiÄn; #727D -牾 > wú; #727E -牿 > gù; #727F -犀 > xÄ«; #7280 -çŠ > lí; #7281 -犂 > lí; #7282 -犃 > pÅu; #7283 -犄 > jÄ«; #7284 -犅 > gÄng; #7285 -犆 > zhí; #7286 -犇 > bÄ“n; #7287 -犈 > quán; #7288 -犉 > rún; #7289 -犊 > dú; #728A -犋 > jù; #728B -犌 > jiÄ; #728C -çŠ > jiÄn; #728D -犎 > fÄ“ng; #728E -çŠ > piÄn; #728F -çŠ > kÄ“; #7290 -犑 > jú; #7291 -犒 > kào; #7292 -犓 > chú; #7293 -犔 > xì; #7294 -犕 > bèi; #7295 -犖 > lùo; #7296 -犗 > jiè; #7297 -犘 > má; #7298 -犙 > sÄn; #7299 -犚 > wèi; #729A -犛 > lí; #729B -犜 > dÅ«n; #729C -çŠ > tóng; #729D -犟 > jiàng; #729F -犡 > lì; #72A1 -犢 > dú; #72A2 -犣 > liè; #72A3 -犤 > pí; #72A4 -犥 > piăo; #72A5 -犦 > bào; #72A6 -犧 > xÄ«; #72A7 -犨 > chÅu; #72A8 -犩 > wèi; #72A9 -犪 > kúi; #72AA -犫 > chÅu; #72AB -犬 > quăn; #72AC -犭 > făn' 'quăn' 'páng; #72AD -犮 > bá; #72AE -犯 > fàn; #72AF -犰 > qíu; #72B0 -犱 > jÄ­; #72B1 -犲 > cái; #72B2 -犳 > chúo; #72B3 -犴 > àn; #72B4 -犵 > jié; #72B5 -状 > zhuàng; #72B6 -犷 > guăng; #72B7 -犸 > mà; #72B8 -犹 > yóu; #72B9 -犺 > kàng; #72BA -犻 > bó; #72BB -犼 > hÅu; #72BC -犽 > yá; #72BD -犾 > yín; #72BE -犿 > huÄn; #72BF -ç‹€ > zhuàng; #72C0 -ç‹ > yÅ­n; #72C1 -ç‹‚ > kuáng; #72C2 -狃 > nÄ­u; #72C3 -ç‹„ > dí; #72C4 -ç‹… > qÄ«ng; #72C5 -狆 > zhòng; #72C6 -狇 > mù; #72C7 -狈 > bèi; #72C8 -狉 > pÄ«; #72C9 -ç‹Š > jú; #72CA -ç‹‹ > ní; #72CB -ç‹Œ > shÄ“ng; #72CC -ç‹ > páo; #72CD -ç‹Ž > xiá; #72CE -ç‹ > túo; #72CF -ç‹ > hú; #72D0 -ç‹‘ > líng; #72D1 -ç‹’ > fèi; #72D2 -ç‹“ > pÄ«; #72D3 -ç‹” > nÄ­; #72D4 -ç‹• > ăo; #72D5 -ç‹– > yòu; #72D6 -ç‹— > gÅu; #72D7 -狘 > yuè; #72D8 -ç‹™ > jÅ«; #72D9 -ç‹š > dàn; #72DA -ç‹› > pò; #72DB -ç‹œ > gÅ­; #72DC -ç‹ > xiăn; #72DD -ç‹ž > níng; #72DE -ç‹Ÿ > huán; #72DF -ç‹  > hÄ•n; #72E0 -ç‹¡ > jiăo; #72E1 -ç‹¢ > hé; #72E2 -ç‹£ > zhào; #72E3 -狤 > jí; #72E4 -ç‹¥ > xùn; #72E5 -狦 > shÄn; #72E6 -狧 > tà; #72E7 -狨 > róng; #72E8 -ç‹© > shòu; #72E9 -狪 > tÅng; #72EA -ç‹« > lăo; #72EB -独 > dú; #72EC -ç‹­ > xiá; #72ED -ç‹® > shÄ«; #72EE -狯 > huá; #72EF -ç‹° > zhÄ“ng; #72F0 -狱 > yù; #72F1 -狲 > sÅ«n; #72F2 -狳 > yú; #72F3 -ç‹´ > bì; #72F4 -狵 > máng; #72F5 -狶 > xÄ­; #72F6 -ç‹· > juàn; #72F7 -狸 > lí; #72F8 -狹 > xiá; #72F9 -狺 > yín; #72FA -ç‹» > suÄn; #72FB -狼 > láng; #72FC -狽 > bèi; #72FD -狾 > zhì; #72FE -ç‹¿ > yán; #72FF -猀 > shÄ; #7300 -çŒ > lì; #7301 -猂 > hàn; #7302 -猃 > xiăn; #7303 -猄 > jÄ«ng; #7304 -猅 > pái; #7305 -猆 > fÄ“i; #7306 -猇 > yáo; #7307 -猈 > bà; #7308 -猉 > qí; #7309 -猊 > ní; #730A -猋 > biÄo; #730B -猌 > yìn; #730C -çŒ > lái; #730D -猎 > xí; #730E -çŒ > jiÄn; #730F -çŒ > qiÄng; #7310 -猑 > kÅ«n; #7311 -猒 > yÄn; #7312 -猓 > gÅ­o; #7313 -猔 > zòng; #7314 -猕 > mí; #7315 -猖 > chÄng; #7316 -猗 > yÄ«; #7317 -猘 > zhì; #7318 -猙 > zhÄ“ng; #7319 -猚 > yá; #731A -猛 > mÄ•ng; #731B -猜 > cÄi; #731C -çŒ > cù; #731D -猞 > shè; #731E -猡 > lúo; #7321 -猢 > hú; #7322 -猣 > zÅng; #7323 -猤 > jì; #7324 -猥 > wÄ•i; #7325 -猦 > fÄ“ng; #7326 -猧 > wÅ; #7327 -猨 > yuán; #7328 -猩 > xÄ«ng; #7329 -猪 > zhÅ«; #732A -猫 > mÄo; #732B -猬 > wèi; #732C -猭 > yuán; #732D -献 > xiàn; #732E -猯 > tuÄn; #732F -猰 > yà; #7330 -猱 > náo; #7331 -猲 > xiÄ“; #7332 -猳 > jiÄ; #7333 -猴 > hóu; #7334 -猵 > biÄn; #7335 -猶 > yóu; #7336 -猷 > yóu; #7337 -猸 > méi; #7338 -猹 > zhÄ; #7339 -猺 > yáo; #733A -猻 > sÅ«n; #733B -猼 > bó; #733C -猽 > míng; #733D -猾 > huá; #733E -猿 > yuán; #733F -ç€ > sÅu; #7340 -ç > mà; #7341 -ç‚ > yuán; #7342 -çƒ > dÄi; #7343 -ç„ > yù; #7344 -ç… > shÄ«; #7345 -ç† > háo; #7346 -çˆ > yì; #7348 -ç‰ > zhÄ“n; #7349 -çŠ > chuàng; #734A -ç‹ > háo; #734B -çŒ > màn; #734C -ç > jìng; #734D -çŽ > jiăng; #734E -ç > mú; #734F -ç > zhÄng; #7350 -ç‘ > chán; #7351 -ç’ > áo; #7352 -ç“ > áo; #7353 -ç” > háo; #7354 -ç• > cÅ«i; #7355 -ç– > fén; #7356 -ç— > jué; #7357 -ç˜ > bì; #7358 -ç™ > bì; #7359 -çš > huáng; #735A -ç› > pú; #735B -çœ > lín; #735C -ç > yù; #735D -çž > tóng; #735E -çŸ > yào; #735F -ç  > liáo; #7360 -ç¡ > shùo; #7361 -ç¢ > xiÄo; #7362 -ç¥ > xí; #7365 -ç¦ > gé; #7366 -ç§ > juàn; #7367 -ç¨ > dú; #7368 -ç© > hùi; #7369 -çª > kuài; #736A -ç« > xiăn; #736B -ç¬ > xiè; #736C -ç­ > tà; #736D -ç® > xiăn; #736E -ç¯ > xÅ«n; #736F -ç° > níng; #7370 -ç± > pín; #7371 -ç² > hùo; #7372 -ç³ > nòu; #7373 -ç´ > méng; #7374 -çµ > liè; #7375 -ç¶ > náo; #7376 -ç· > guăng; #7377 -ç¸ > shòu; #7378 -ç¹ > lú; #7379 -çº > tà; #737A -ç» > xiàn; #737B -ç¼ > mí; #737C -ç½ > ráng; #737D -ç¾ > huÄn; #737E -ç¿ > náo; #737F -玀 > lúo; #7380 -çŽ > xiăn; #7381 -玂 > qí; #7382 -玃 > jué; #7383 -玄 > xuán; #7384 -玅 > miào; #7385 -玆 > zÄ«; #7386 -率 > lÇœ; #7387 -玈 > lú; #7388 -玉 > yù; #7389 -玊 > sù; #738A -王 > wáng; #738B -玌 > qíu; #738C -çŽ > gă; #738D -玎 > dÄ«ng; #738E -çŽ > lè; #738F -çŽ > bÄ; #7390 -玑 > jÄ«; #7391 -玒 > hóng; #7392 -玓 > dì; #7393 -玔 > quàn; #7394 -玕 > gÄn; #7395 -玖 > jÄ­u; #7396 -玗 > yú; #7397 -玘 > jÄ­; #7398 -玙 > yú; #7399 -玚 > yáng; #739A -玛 > mă; #739B -玜 > gÅng; #739C -çŽ > wÅ­; #739D -玞 > fÅ«; #739E -玟 > wén; #739F -玠 > jiè; #73A0 -玡 > yà; #73A1 -玢 > fén; #73A2 -玣 > biàn; #73A3 -玤 > bÄ•ng; #73A4 -玥 > yuè; #73A5 -玦 > jué; #73A6 -玧 > yÅ­n; #73A7 -玨 > jué; #73A8 -玩 > wán; #73A9 -玪 > jiÄn; #73AA -玫 > méi; #73AB -玬 > dăn; #73AC -玭 > pí; #73AD -玮 > wÄ•i; #73AE -环 > huán; #73AF -现 > xiàn; #73B0 -玱 > qiÄng; #73B1 -玲 > líng; #73B2 -玳 > dài; #73B3 -玴 > yì; #73B4 -玵 > án; #73B5 -玶 > píng; #73B6 -玷 > diàn; #73B7 -玸 > fú; #73B8 -玹 > xuán; #73B9 -玺 > xÄ­; #73BA -玻 > bÅ; #73BB -玼 > cÄ­; #73BC -玽 > gÅu; #73BD -玾 > jiă; #73BE -玿 > sháo; #73BF -ç€ > pò; #73C0 -ç > cí; #73C1 -ç‚ > kÄ“; #73C2 -çƒ > răn; #73C3 -ç„ > shÄ“ng; #73C4 -ç… > shÄ“n; #73C5 -ç† > yí; #73C6 -ç‡ > zÅ­; #73C7 -çˆ > jiÄ; #73C8 -ç‰ > mín; #73C9 -çŠ > shÄn; #73CA -ç‹ > lÄ­u; #73CB -çŒ > bì; #73CC -ç > zhÄ“n; #73CD -çŽ > zhÄ“n; #73CE -ç > jué; #73CF -ç > fà; #73D0 -ç‘ > lóng; #73D1 -ç’ > jÄ«n; #73D2 -ç“ > jiào; #73D3 -ç” > jiàn; #73D4 -ç• > lì; #73D5 -ç– > guÄng; #73D6 -ç— > xiÄn; #73D7 -ç˜ > zhÅu; #73D8 -ç™ > gÅng; #73D9 -çš > yÄn; #73DA -ç› > xìu; #73DB -çœ > yáng; #73DC -ç > xÅ­; #73DD -çž > lùo; #73DE -çŸ > sù; #73DF -ç  > zhÅ«; #73E0 -ç¡ > qín; #73E1 -ç¢ > kèn; #73E2 -ç£ > xún; #73E3 -ç¤ > băo; #73E4 -ç¥ > Ä•r; #73E5 -ç¦ > xiàng; #73E6 -ç§ > yáo; #73E7 -ç¨ > xiá; #73E8 -ç© > héng; #73E9 -çª > gÅ«i; #73EA -ç« > chÅng; #73EB -ç¬ > xù; #73EC -ç­ > bÄn; #73ED -ç® > pèi; #73EE -ç° > dÄng; #73F0 -ç² > hún; #73F2 -ç³ > wén; #73F3 -ç´ > é; #73F4 -çµ > chéng; #73F5 -ç¶ > tí; #73F6 -ç· > wÅ­; #73F7 -ç¸ > wú; #73F8 -ç¹ > chéng; #73F9 -çº > jùn; #73FA -ç» > méi; #73FB -ç¼ > bèi; #73FC -ç½ > tÄ­ng; #73FD -ç¾ > xiàn; #73FE -ç¿ > chùo; #73FF -ç€ > hán; #7400 -ç > xuan; #7401 -ç‚ > yán; #7402 -çƒ > qíu; #7403 -ç„ > quăn; #7404 -ç… > láng; #7405 -ç† > lÄ­; #7406 -ç‡ > xìu; #7407 -çˆ > fú; #7408 -ç‰ > líu; #7409 -çŠ > yé; #740A -ç‹ > xÄ«; #740B -çŒ > líng; #740C -ç > lì; #740D -çŽ > jìn; #740E -ç > lián; #740F -ç > sÅ­o; #7410 -ç“ > wán; #7413 -ç” > diàn; #7414 -ç• > pín; #7415 -ç– > zhăn; #7416 -ç— > cùi; #7417 -ç˜ > mín; #7418 -ç™ > yù; #7419 -çš > jÅ«; #741A -ç› > chÄ“n; #741B -çœ > lái; #741C -ç > wén; #741D -çž > shèng; #741E -çŸ > wéi; #741F -ç  > diăn; #7420 -ç¡ > chù; #7421 -ç¢ > zhúo; #7422 -ç£ > pÄ•i; #7423 -ç¤ > chÄ“ng; #7424 -ç¥ > hÅ­; #7425 -ç¦ > qí; #7426 -ç§ > è; #7427 -ç¨ > kÅ«n; #7428 -ç© > chÄng; #7429 -çª > qí; #742A -ç« > bÄ•ng; #742B -ç¬ > wăn; #742C -ç­ > lù; #742D -ç® > cóng; #742E -ç¯ > guăn; #742F -ç° > yăn; #7430 -ç± > diÄo; #7431 -ç² > bèi; #7432 -ç³ > lín; #7433 -ç´ > qín; #7434 -çµ > pí; #7435 -ç¶ > pá; #7436 -ç· > què; #7437 -ç¸ > zhúo; #7438 -ç¹ > qín; #7439 -çº > fà; #743A -ç¼ > qíong; #743C -ç½ > dÅ­; #743D -ç¾ > jiè; #743E -ç¿ > hún; #743F -ç‘€ > yÅ­; #7440 -ç‘ > mào; #7441 -ç‘‚ > méi; #7442 -瑃 > chun; #7443 -ç‘„ > xuÄn; #7444 -ç‘… > tí; #7445 -瑆 > xÄ«ng; #7446 -瑇 > dài; #7447 -瑈 > róu; #7448 -瑉 > mín; #7449 -ç‘Š > zhÄ“n; #744A -ç‘‹ > wÄ•i; #744B -ç‘Œ > ruăn; #744C -ç‘ > huàn; #744D -ç‘Ž > jiÄ“; #744E -ç‘ > chuÄn; #744F -ç‘ > jiăn; #7450 -ç‘‘ > zhuàn; #7451 -ç‘’ > yáng; #7452 -ç‘“ > liàn; #7453 -ç‘” > quán; #7454 -ç‘• > xiá; #7455 -ç‘– > duàn; #7456 -ç‘— > yuàn; #7457 -瑘 > yé; #7458 -ç‘™ > năo; #7459 -ç‘š > hú; #745A -ç‘› > yÄ«ng; #745B -ç‘œ > yú; #745C -ç‘ > huáng; #745D -ç‘ž > rùi; #745E -ç‘Ÿ > sè; #745F -ç‘  > líu; #7460 -ç‘¡ > shi; #7461 -ç‘¢ > róng; #7462 -ç‘£ > sÅ­o; #7463 -瑤 > yáo; #7464 -ç‘¥ > wÄ“n; #7465 -瑦 > wÅ«; #7466 -瑧 > jÄ«n; #7467 -瑨 > jìn; #7468 -ç‘© > yíng; #7469 -瑪 > mă; #746A -ç‘« > tÄo; #746B -瑬 > líu; #746C -ç‘­ > táng; #746D -ç‘® > lì; #746E -瑯 > láng; #746F -ç‘° > gÅ«i; #7470 -瑱 > zhèn; #7471 -瑲 > qiÄng; #7472 -瑳 > cÅ­o; #7473 -ç‘´ > jué; #7474 -瑵 > zhăo; #7475 -瑶 > yáo; #7476 -ç‘· > ài; #7477 -瑸 > bÄ«n; #7478 -瑹 > tú; #7479 -瑺 > cháng; #747A -ç‘» > kÅ«n; #747B -瑼 > zhuÄn; #747C -瑽 > cÅng; #747D -瑾 > jÄ­n; #747E -ç‘¿ > yÄ«; #747F -ç’€ > cÅ­i; #7480 -ç’ > cÅng; #7481 -ç’‚ > qí; #7482 -ç’ƒ > lí; #7483 -ç’„ > yÄ­ng; #7484 -ç’… > sÅ­o; #7485 -ç’† > qíu; #7486 -ç’‡ > xuán; #7487 -ç’ˆ > áo; #7488 -ç’‰ > lián; #7489 -ç’Š > mán; #748A -ç’‹ > zhÄng; #748B -ç’Œ > yín; #748C -ç’Ž > yÄ«ng; #748E -ç’ > zhì; #748F -ç’ > lù; #7490 -ç’‘ > wú; #7491 -ç’’ > dÄ“ng; #7492 -ç’“ > xiòu; #7493 -ç’” > zÄ“ng; #7494 -ç’• > xún; #7495 -ç’– > qú; #7496 -ç’— > dàng; #7497 -ç’˜ > lín; #7498 -ç’™ > liáo; #7499 -ç’š > qíong; #749A -ç’› > sù; #749B -ç’œ > huáng; #749C -ç’ > gÅ«i; #749D -ç’ž > pú; #749E -ç’Ÿ > jÄ­ng; #749F -ç’  > fán; #74A0 -ç’¡ > jìn; #74A1 -ç’¢ > líu; #74A2 -ç’£ > jÄ«; #74A3 -ç’¥ > jÄ­ng; #74A5 -ç’¦ > ài; #74A6 -ç’§ > bì; #74A7 -ç’¨ > càn; #74A8 -ç’© > qú; #74A9 -ç’ª > zăo; #74AA -ç’« > dÄng; #74AB -ç’¬ > jiăo; #74AC -ç’­ > gùn; #74AD -ç’® > tăn; #74AE -ç’¯ > hùi; #74AF -ç’° > huán; #74B0 -ç’± > sè; #74B1 -ç’² > sùi; #74B2 -ç’³ > tián; #74B3 -ç’µ > yú; #74B5 -ç’¶ > jìn; #74B6 -ç’· > lú; #74B7 -ç’¸ > bÄ«n; #74B8 -ç’¹ > shòu; #74B9 -ç’º > wèn; #74BA -ç’» > zÅ­i; #74BB -ç’¼ > lán; #74BC -ç’½ > xÄ­; #74BD -ç’¾ > jì; #74BE -ç’¿ > xuán; #74BF -ç“€ > ruăn; #74C0 -ç“ > hùo; #74C1 -ç“‚ > gài; #74C2 -瓃 > léi; #74C3 -ç“„ > dú; #74C4 -ç“… > lì; #74C5 -瓆 > zhí; #74C6 -瓇 > róu; #74C7 -瓈 > lí; #74C8 -瓉 > zàn; #74C9 -ç“Š > qíong; #74CA -ç“‹ > zhé; #74CB -ç“Œ > gÅ«i; #74CC -ç“ > sùi; #74CD -ç“Ž > là; #74CE -ç“ > lóng; #74CF -ç“ > lú; #74D0 -ç“‘ > lì; #74D1 -ç“’ > zàn; #74D2 -ç““ > làn; #74D3 -ç“” > yÄ«ng; #74D4 -ç“• > mí; #74D5 -ç“– > xiÄng; #74D6 -ç“— > xÄ«; #74D7 -瓘 > guàn; #74D8 -ç“™ > dào; #74D9 -ç“š > zàn; #74DA -ç“› > huán; #74DB -ç“œ > guÄ; #74DC -ç“ > bó; #74DD -ç“ž > dié; #74DE -ç“Ÿ > báo; #74DF -ç“  > hù; #74E0 -ç“¡ > zhí; #74E1 -ç“¢ > piáo; #74E2 -ç“£ > bàn; #74E3 -瓤 > ráng; #74E4 -ç“¥ > lì; #74E5 -瓦 > wă; #74E6 -瓨 > jiÄng; #74E8 -ç“© > qián' 'wă; #74E9 -瓪 > făn; #74EA -ç“« > pén; #74EB -瓬 > făng; #74EC -ç“­ > dăn; #74ED -ç“® > wèng; #74EE -瓯 > Åu; #74EF -瓳 > hú; #74F3 -ç“´ > líng; #74F4 -瓵 > yí; #74F5 -瓶 > píng; #74F6 -ç“· > cí; #74F7 -瓹 > juàn; #74F9 -瓺 > cháng; #74FA -ç“» > chÄ«; #74FB -瓽 > dàng; #74FD -瓾 > mÄ•ng; #74FE -ç“¿ > pÅu; #74FF -甀 > zhùi; #7500 -ç” > píng; #7501 -甂 > biÄn; #7502 -甃 > zhòu; #7503 -甄 > zhÄ“n; #7504 -甆 > cí; #7506 -甇 > yÄ«ng; #7507 -甈 > qì; #7508 -甉 > xián; #7509 -甊 > lÅu; #750A -甋 > dì; #750B -甌 > Åu; #750C -ç” > méng; #750D -甎 > zhuÄn; #750E -ç” > pèng; #750F -ç” > lín; #7510 -甑 > zèng; #7511 -ç”’ > wÅ­; #7512 -甓 > pì; #7513 -ç”” > dÄn; #7514 -甕 > wèng; #7515 -ç”– > yÄ«ng; #7516 -ç”— > yăn; #7517 -甘 > gÄn; #7518 -ç”™ > dài; #7519 -甚 > shén; #751A -ç”› > tián; #751B -甜 > tián; #751C -ç” > hÄn; #751D -甞 > cháng; #751E -生 > shÄ“ng; #751F -ç”  > qíng; #7520 -甡 > shÄ“ng; #7521 -產 > chăn; #7522 -産 > chăn; #7523 -甤 > rúi; #7524 -甥 > shÄ“ng; #7525 -甦 > sÅ«; #7526 -甧 > sÄ“n; #7527 -用 > yòng; #7528 -甩 > shuăi; #7529 -甪 > lù; #752A -甫 > fÅ­; #752B -甬 > yÅng; #752C -ç”­ > béng; #752D -ç”® > fèng; #752E -甯 > níng; #752F -ç”° > tián; #7530 -ç”± > yóu; #7531 -甲 > jiă; #7532 -申 > shÄ“n; #7533 -ç”´ > zhá; #7534 -电 > diàn; #7535 -甶 > fú; #7536 -ç”· > nán; #7537 -甸 > diàn; #7538 -甹 > píng; #7539 -町 > tÄ­ng; #753A -ç”» > huà; #753B -甼 > tÄ­ng; #753C -甽 > quăn; #753D -甾 > zÄ«; #753E -甿 > méng; #753F -ç•€ > bì; #7540 -ç• > qí; #7541 -ç•‚ > lìu; #7542 -畃 > xún; #7543 -ç•„ > líu; #7544 -ç•… > chàng; #7545 -畆 > mÅ­; #7546 -畇 > yún; #7547 -畈 > fàn; #7548 -畉 > fú; #7549 -ç•Š > gÄ“ng; #754A -ç•‹ > tián; #754B -ç•Œ > jiè; #754C -ç• > jiè; #754D -ç•Ž > quăn; #754E -ç• > wèi; #754F -ç• > fú; #7550 -ç•‘ > tián; #7551 -ç•’ > mÅ­; #7552 -ç•” > pàn; #7554 -ç•• > jiÄng; #7555 -ç•– > wÄ; #7556 -ç•— > dá; #7557 -畘 > nán; #7558 -ç•™ > líu; #7559 -ç•š > bÄ•n; #755A -ç•› > zhÄ•n; #755B -ç•œ > chù; #755C -ç• > mÅ­; #755D -ç•ž > mÅ­; #755E -ç•Ÿ > cè; #755F -ç•¡ > gÄi; #7561 -ç•¢ > bì; #7562 -ç•£ > dá; #7563 -畤 > zhì; #7564 -ç•¥ > lÇœe; #7565 -畦 > qí; #7566 -畧 > lÇœe; #7567 -畨 > pÄn; #7568 -番 > fÄn; #756A -ç•« > huà; #756B -畬 > yú; #756C -ç•­ > yú; #756D -ç•® > mÅ­; #756E -畯 > jùn; #756F -ç•° > yì; #7570 -畱 > líu; #7571 -畲 > yú; #7572 -畳 > dié; #7573 -ç•´ > chóu; #7574 -畵 > huà; #7575 -當 > dÄng; #7576 -ç•· > chùo; #7577 -畸 > jÄ«; #7578 -畹 > wăn; #7579 -畺 > jiÄng; #757A -ç•» > shéng; #757B -畼 > chàng; #757C -畽 > tuăn; #757D -畾 > léi; #757E -ç•¿ > jÄ«; #757F -ç–€ > chÄ; #7580 -ç– > líu; #7581 -ç–ƒ > tuăn; #7583 -ç–„ > lín; #7584 -ç–… > jiÄng; #7585 -ç–† > jiÄng; #7586 -ç–‡ > chóu; #7587 -ç–ˆ > bò; #7588 -ç–‰ > dié; #7589 -ç–Š > dié; #758A -ç–‹ > pÄ­; #758B -ç–Œ > niè; #758C -ç– > dàn; #758D -ç–Ž > shÅ«; #758E -ç– > shÅ«; #758F -ç– > zhì; #7590 -ç–‘ > yí; #7591 -ç–’ > chuáng; #7592 -ç–“ > năi; #7593 -ç–” > dÄ«ng; #7594 -ç–• > bÄ­; #7595 -ç–– > jié; #7596 -ç–— > liáo; #7597 -ç–˜ > gÅng; #7598 -ç–™ > gÄ“; #7599 -ç–š > jìu; #759A -ç–› > zhÅu; #759B -ç–œ > xià; #759C -ç– > shàn; #759D -ç–ž > xÅ«; #759E -ç–Ÿ > nÇœe; #759F -ç–  > lì; #75A0 -ç–¡ > yáng; #75A1 -ç–¢ > chèn; #75A2 -ç–£ > yóu; #75A3 -ç–¤ > bÄ; #75A4 -ç–¥ > jiè; #75A5 -ç–¦ > jué; #75A6 -ç–§ > zhÄ«; #75A7 -ç–¨ > xiÄ; #75A8 -ç–© > cùi; #75A9 -ç–ª > bì; #75AA -ç–« > yì; #75AB -ç–¬ > lì; #75AC -ç–­ > zòng; #75AD -ç–® > chuÄng; #75AE -ç–¯ > fÄ“ng; #75AF -ç–° > zhù; #75B0 -ç–± > pào; #75B1 -ç–² > pí; #75B2 -ç–³ > gÄn; #75B3 -ç–´ > kÄ“; #75B4 -ç–µ > cÄ«; #75B5 -ç–¶ > xiè; #75B6 -ç–· > qí; #75B7 -ç–¸ > dăn; #75B8 -ç–¹ > zhÄ•n; #75B9 -ç–º > fá; #75BA -ç–» > zhÄ­; #75BB -ç–¼ > téng; #75BC -ç–½ > jÅ«; #75BD -ç–¾ > jí; #75BE -ç–¿ > fèi; #75BF -ç—€ > qú; #75C0 -ç— > diàn; #75C1 -ç—‚ > jiÄ; #75C2 -ç—ƒ > xián; #75C3 -ç—„ > chá; #75C4 -ç—… > bìng; #75C5 -ç—† > nì; #75C6 -ç—‡ > zhèng; #75C7 -ç—ˆ > yÅng; #75C8 -ç—‰ > jìng; #75C9 -ç—Š > quán; #75CA -ç—‹ > chóng; #75CB -ç—Œ > tÅng; #75CC -ç— > yí; #75CD -ç—Ž > kÄi; #75CE -ç— > wÄ•i; #75CF -ç— > húi; #75D0 -ç—‘ > dÅ­o; #75D1 -ç—’ > yăng; #75D2 -ç—“ > chì; #75D3 -ç—” > zhì; #75D4 -ç—• > hén; #75D5 -ç—– > yă; #75D6 -ç—— > mèi; #75D7 -ç—˜ > dòu; #75D8 -ç—™ > jìng; #75D9 -ç—š > xiÄo; #75DA -ç—› > tòng; #75DB -ç—œ > tÅ«; #75DC -ç— > máng; #75DD -ç—ž > pÄ­; #75DE -ç—Ÿ > xiÄo; #75DF -ç—  > suÄn; #75E0 -ç—¡ > pÅ«; #75E1 -ç—¢ > lì; #75E2 -ç—£ > zhì; #75E3 -ç—¤ > cúo; #75E4 -ç—¥ > dúo; #75E5 -ç—¦ > wù; #75E6 -ç—§ > shÄ; #75E7 -ç—¨ > láo; #75E8 -ç—© > shòu; #75E9 -ç—ª > huàn; #75EA -ç—« > xián; #75EB -ç—¬ > yì; #75EC -ç—­ > péng; #75ED -ç—® > zhàng; #75EE -ç—¯ > guăn; #75EF -ç—° > tán; #75F0 -ç—± > fèi; #75F1 -ç—² > má; #75F2 -ç—³ > lín; #75F3 -ç—´ > chÄ«; #75F4 -ç—µ > jì; #75F5 -ç—¶ > diăn; #75F6 -ç—· > Än; #75F7 -ç—¸ > chì; #75F8 -ç—¹ > bì; #75F9 -ç—º > bÄ“i; #75FA -ç—» > mín; #75FB -ç—¼ > gÅ«; #75FC -ç—½ > dÅ«i; #75FD -ç—¾ > Ä“; #75FE -ç—¿ > wÄ•i; #75FF -瘀 > yÅ«; #7600 -ç˜ > cùi; #7601 -瘂 > yă; #7602 -瘃 > zhÅ­; #7603 -瘄 > cù; #7604 -瘅 > dàn; #7605 -瘆 > shèn; #7606 -瘇 > zhÅ­ng; #7607 -瘈 > jì; #7608 -瘉 > yù; #7609 -瘊 > hóu; #760A -瘋 > fÄ“ng; #760B -瘌 > là; #760C -ç˜ > yáng; #760D -瘎 > shèn; #760E -ç˜ > tú; #760F -ç˜ > yÅ­; #7610 -瘑 > guÄ; #7611 -瘒 > wén; #7612 -瘓 > huàn; #7613 -瘔 > kù; #7614 -瘕 > jiă; #7615 -瘖 > yÄ«n; #7616 -瘗 > yì; #7617 -瘘 > lǘ; #7618 -瘙 > sÄo; #7619 -瘚 > jué; #761A -瘛 > chì; #761B -瘜 > xí; #761C -ç˜ > guÄn; #761D -瘞 > yì; #761E -瘟 > wÄ“n; #761F -瘠 > jí; #7620 -瘡 > chuÄng; #7621 -瘢 > bÄn; #7622 -瘣 > lÄ•i; #7623 -瘤 > líu; #7624 -瘥 > chài; #7625 -瘦 > shòu; #7626 -瘧 > nÇœe; #7627 -瘨 > diÄn; #7628 -瘩 > dÄ; #7629 -瘪 > piÄ“; #762A -瘫 > tÄn; #762B -瘬 > zhàng; #762C -瘭 > biÄo; #762D -瘮 > shen; #762E -瘯 > cù; #762F -瘰 > lÅ­o; #7630 -瘱 > yì; #7631 -瘲 > zòng; #7632 -瘳 > chÅu; #7633 -瘴 > zhàng; #7634 -瘵 > zhài; #7635 -瘶 > sòu; #7636 -瘷 > sÅ­o; #7637 -瘸 > qué; #7638 -瘹 > diào; #7639 -瘺 > lòu; #763A -瘻 > lǘ; #763B -瘼 > mò; #763C -瘽 > jìn; #763D -瘾 > yÄ­n; #763E -瘿 > yÄ­ng; #763F -癀 > huáng; #7640 -ç™ > fú; #7641 -療 > liáo; #7642 -癃 > lóng; #7643 -癄 > qiáo; #7644 -ç™… > líu; #7645 -癆 > láo; #7646 -癇 > xián; #7647 -癈 > fèi; #7648 -癉 > dàn; #7649 -癊 > yìn; #764A -癋 > hè; #764B -癌 > yán; #764C -ç™ > bÄn; #764D -癎 > xián; #764E -ç™ > guÄn; #764F -ç™ > guài; #7650 -癑 > nóng; #7651 -ç™’ > yù; #7652 -癓 > wéi; #7653 -ç™” > yì; #7654 -癕 > yÅng; #7655 -ç™– > pÄ­; #7656 -ç™— > lÄ•i; #7657 -癘 > lì; #7658 -ç™™ > shÅ­; #7659 -癚 > dàn; #765A -ç™› > lÄ­n; #765B -癜 > diàn; #765C -ç™ > lÄ­n; #765D -癞 > lài; #765E -癟 > piÄ“; #765F -ç™  > jì; #7660 -癡 > chÄ«; #7661 -癢 > yăng; #7662 -癣 > xiăn; #7663 -癤 > jié; #7664 -癥 > zhÄ“ng; #7665 -癧 > lì; #7667 -癨 > hùo; #7668 -癩 > lài; #7669 -癫 > diÄn; #766B -癬 > xiăn; #766C -ç™­ > yÄ­ng; #766D -ç™® > yÄ­n; #766E -癯 > qú; #766F -ç™° > yÅng; #7670 -ç™± > tÄn; #7671 -癲 > diÄn; #7672 -癳 > lÅ­o; #7673 -ç™´ > lǘan; #7674 -癵 > luán; #7675 -癶 > bÅ; #7676 -癸 > gÅ­i; #7678 -癹 > pÅ; #7679 -発 > fÄ; #767A -ç™» > dÄ“ng; #767B -發 > fÄ; #767C -白 > bái; #767D -百 > băi; #767E -癿 > qié; #767F -皀 > bÄ«; #7680 -çš > zào; #7681 -çš‚ > zào; #7682 -皃 > mào; #7683 -çš„ > de; #7684 -çš… > pÄ; #7685 -皆 > jiÄ“; #7686 -皇 > huáng; #7687 -皈 > gÅ«i; #7688 -皉 > cÄ­; #7689 -皊 > líng; #768A -çš‹ > gÄo; #768B -皌 > mò; #768C -çš > jí; #768D -皎 > jiăo; #768E -çš > pÄ•ng; #768F -çš > gÄo; #7690 -çš‘ > ái; #7691 -çš’ > é; #7692 -çš“ > hào; #7693 -çš” > hàn; #7694 -çš• > bÄ«; #7695 -çš– > wăn; #7696 -çš— > chóu; #7697 -皘 > qiàn; #7698 -çš™ > xÄ«; #7699 -çšš > ái; #769A -çš› > jÄ­ong; #769B -çšœ > hào; #769C -çš > huăng; #769D -çšž > hào; #769E -皟 > zé; #769F -çš  > cÅ­i; #76A0 -çš¡ > hào; #76A1 -皢 > xiăo; #76A2 -皣 > yè; #76A3 -皤 > pó; #76A4 -皥 > hào; #76A5 -皦 > jiăo; #76A6 -皧 > ài; #76A7 -皨 > xÄ«ng; #76A8 -çš© > huàng; #76A9 -皪 > lì; #76AA -çš« > piăo; #76AB -皬 > hè; #76AC -çš­ > jiào; #76AD -çš® > pí; #76AE -皯 > găn; #76AF -çš° > pào; #76B0 -çš± > zhòu; #76B1 -çš² > jÅ«n; #76B2 -çš³ > qíu; #76B3 -çš´ > cÅ«n; #76B4 -çšµ > què; #76B5 -皶 > zhÄ; #76B6 -çš· > gÅ­; #76B7 -皸 > jÅ«n; #76B8 -çš¹ > jÅ«n; #76B9 -皺 > zhòu; #76BA -çš» > zhÄ; #76BB -çš¼ > gÅ­; #76BC -çš½ > zhăn; #76BD -çš¾ > dú; #76BE -çš¿ > mÄ­n; #76BF -盀 > qÄ­; #76C0 -ç› > yíng; #76C1 -盂 > yú; #76C2 -盃 > bÄ“i; #76C3 -盄 > zhÄo; #76C4 -ç›… > zhÅng; #76C5 -盆 > pén; #76C6 -盇 > hé; #76C7 -盈 > yíng; #76C8 -盉 > hé; #76C9 -益 > yì; #76CA -盋 > bÅ; #76CB -盌 > wăn; #76CC -ç› > hé; #76CD -盎 > àng; #76CE -ç› > zhăn; #76CF -ç› > yán; #76D0 -监 > jiÄn; #76D1 -ç›’ > hé; #76D2 -盓 > yÅ«; #76D3 -ç›” > kÅ«i; #76D4 -盕 > fàn; #76D5 -ç›– > gài; #76D6 -ç›— > dào; #76D7 -盘 > pán; #76D8 -ç›™ > fÅ­; #76D9 -盚 > qíu; #76DA -ç›› > shèng; #76DB -盜 > dào; #76DC -ç› > lù; #76DD -盞 > zhăn; #76DE -盟 > méng; #76DF -ç›  > lÄ­; #76E0 -盡 > jìn; #76E1 -盢 > xù; #76E2 -監 > jiÄn; #76E3 -盤 > pán; #76E4 -盥 > guàn; #76E5 -盦 > Än; #76E6 -盧 > lú; #76E7 -盨 > shÅ­; #76E8 -盩 > zhÅu; #76E9 -盪 > dàng; #76EA -盫 > Än; #76EB -盬 > gÅ­; #76EC -ç›­ > lì; #76ED -ç›® > mù; #76EE -盯 > chéng; #76EF -ç›° > găn; #76F0 -ç›± > xÅ«; #76F1 -盲 > máng; #76F2 -盳 > máng; #76F3 -ç›´ > zhí; #76F4 -盵 > qì; #76F5 -盶 > ruăn; #76F6 -ç›· > tián; #76F7 -相 > xiÄng; #76F8 -盹 > dùn; #76F9 -盺 > xÄ«n; #76FA -ç›» > xì; #76FB -盼 > pàn; #76FC -盽 > fÄ“ng; #76FD -盾 > dùn; #76FE -盿 > mín; #76FF -眀 > míng; #7700 -çœ > shÄ•ng; #7701 -眂 > shì; #7702 -眃 > yún; #7703 -眄 > miăn; #7704 -眅 > pÄn; #7705 -眆 > făng; #7706 -眇 > miăo; #7707 -眈 > dÄn; #7708 -眉 > méi; #7709 -眊 > mào; #770A -看 > kàn; #770B -県 > xiàn; #770C -çœ > Åu; #770D -眎 > shì; #770E -çœ > yÄng; #770F -çœ > zhÄ“ng; #7710 -眑 > yăo; #7711 -眒 > shèn; #7712 -眓 > hùo; #7713 -眔 > dà; #7714 -眕 > zhÄ•n; #7715 -眖 > kuàng; #7716 -眗 > jÅ«; #7717 -眘 > shèn; #7718 -眙 > chì; #7719 -眚 > shÄ•ng; #771A -眛 > mèi; #771B -眜 > mò; #771C -çœ > zhù; #771D -眞 > zhÄ“n; #771E -真 > zhÄ“n; #771F -眠 > mián; #7720 -眡 > dÄ«; #7721 -眢 > yuÄn; #7722 -眣 > dié; #7723 -眤 > yí; #7724 -眥 > zì; #7725 -眦 > zì; #7726 -眧 > chăo; #7727 -眨 > zhă; #7728 -眩 > xuàn; #7729 -眪 > bÄ­ng; #772A -眫 > mÄ­; #772B -眬 > lóng; #772C -眭 > sÅ«i; #772D -眮 > dòng; #772E -眯 > mÄ­; #772F -眰 > dié; #7730 -眱 > yí; #7731 -眲 > èr; #7732 -眳 > mÄ­ng; #7733 -眴 > xuàn; #7734 -眵 > chÄ«; #7735 -眶 > kuàng; #7736 -眷 > juàn; #7737 -眸 > móu; #7738 -眹 > zhèn; #7739 -眺 > tiào; #773A -眻 > yáng; #773B -眼 > yăn; #773C -眽 > mò; #773D -眾 > zhòng; #773E -眿 > mài; #773F -ç€ > zháo; #7740 -ç > zhÄ“ng; #7741 -ç‚ > méi; #7742 -çƒ > jùn; #7743 -ç„ > shào; #7744 -ç… > hàn; #7745 -ç† > huăn; #7746 -ç‡ > dì; #7747 -çˆ > chÄ•ng; #7748 -ç‰ > cÅ«o; #7749 -çŠ > juàn; #774A -ç‹ > é; #774B -çŒ > wăn; #774C -ç > xiàn; #774D -çŽ > xÄ«; #774E -ç > kùn; #774F -ç > lài; #7750 -ç‘ > jiăn; #7751 -ç’ > shăn; #7752 -ç“ > tiăn; #7753 -ç” > hÅ­n; #7754 -ç• > wăn; #7755 -ç– > líng; #7756 -ç— > shì; #7757 -ç˜ > qíong; #7758 -ç™ > liè; #7759 -çš > yái; #775A -ç› > jÄ«ng; #775B -çœ > zhÄ“ng; #775C -ç > lí; #775D -çž > lài; #775E -çŸ > sùi; #775F -ç  > juàn; #7760 -ç¡ > shùi; #7761 -ç¢ > sÅ«i; #7762 -ç£ > dÅ«; #7763 -ç¤ > bì; #7764 -ç¥ > bì; #7765 -ç¦ > mù; #7766 -ç§ > hÅ«n; #7767 -ç¨ > nì; #7768 -ç© > lù; #7769 -çª > yì; #776A -ç« > jié; #776B -ç¬ > căi; #776C -ç­ > zhÅu; #776D -ç® > yú; #776E -ç¯ > hÅ«n; #776F -ç° > mà; #7770 -ç± > xià; #7771 -ç² > xÄ­ng; #7772 -ç³ > xÄ«; #7773 -ç´ > gùn; #7774 -çµ > cai; #7775 -ç¶ > chÅ­n; #7776 -ç· > jiÄn; #7777 -ç¸ > mèi; #7778 -ç¹ > dÅ­; #7779 -çº > hóu; #777A -ç» > xuÄn; #777B -ç¼ > tì; #777C -ç½ > kúi; #777D -ç¾ > gÄo; #777E -ç¿ > rùi; #777F -瞀 > mòu; #7780 -çž > xù; #7781 -çž‚ > fÄ; #7782 -瞃 > wÄ“n; #7783 -çž„ > miáo; #7784 -çž… > chÅu; #7785 -瞆 > kùi; #7786 -瞇 > mÄ«; #7787 -瞈 > wÄ•ng; #7788 -瞉 > kòu; #7789 -瞊 > dàng; #778A -çž‹ > chÄ“n; #778B -瞌 > kÄ“; #778C -çž > sÅu; #778D -瞎 > xiÄ; #778E -çž > qíong; #778F -çž > mào; #7790 -çž‘ > míng; #7791 -çž’ > mán; #7792 -çž“ > shùi; #7793 -çž” > zé; #7794 -çž• > zhàng; #7795 -çž– > yì; #7796 -çž— > diÄo; #7797 -瞘 > Åu; #7798 -çž™ > mò; #7799 -çžš > shùn; #779A -çž› > cÅng; #779B -çžœ > lÅu; #779C -çž > chÄ«; #779D -çžž > mán; #779E -瞟 > piăo; #779F -çž  > chÄ“ng; #77A0 -çž¡ > jì; #77A1 -瞢 > méng; #77A2 -瞤 > rún; #77A4 -瞥 > piÄ“; #77A5 -瞦 > xÄ«; #77A6 -瞧 > qiáo; #77A7 -瞨 > pú; #77A8 -çž© > zhÅ­; #77A9 -瞪 > dèng; #77AA -çž« > shÄ•n; #77AB -瞬 > shùn; #77AC -çž­ > liăo; #77AD -çž® > chè; #77AE -瞯 > xián; #77AF -çž° > kàn; #77B0 -çž± > yè; #77B1 -çž² > xù; #77B2 -çž³ > tóng; #77B3 -çž´ > móu; #77B4 -çžµ > lín; #77B5 -瞶 > kùi; #77B6 -çž· > xián; #77B7 -瞸 > yè; #77B8 -çž¹ > ài; #77B9 -瞺 > hùi; #77BA -çž» > zhÄn; #77BB -çž¼ > jiăn; #77BC -çž½ > gÅ­; #77BD -çž¾ > zhào; #77BE -çž¿ > qÅ«; #77BF -矀 > wéi; #77C0 -çŸ > chÅu; #77C1 -矂 > sào; #77C2 -矃 > nÄ­ng; #77C3 -矄 > xÅ«n; #77C4 -矅 > yào; #77C5 -矆 > hùo; #77C6 -矇 > méng; #77C7 -矈 > mián; #77C8 -矉 > bÄ«n; #77C9 -矊 > mián; #77CA -矋 > lì; #77CB -矌 > kuàng; #77CC -çŸ > jué; #77CD -矎 > xuÄn; #77CE -çŸ > mián; #77CF -çŸ > hùo; #77D0 -矑 > lú; #77D1 -矒 > méng; #77D2 -矓 > lóng; #77D3 -矔 > guàn; #77D4 -矕 > măn; #77D5 -矖 > xÄ­; #77D6 -矗 > chù; #77D7 -矘 > tăng; #77D8 -矙 > kàn; #77D9 -矚 > zhÅ­; #77DA -矛 > máo; #77DB -矜 > jÄ«n; #77DC -çŸ > lín; #77DD -矞 > yù; #77DE -矟 > shùo; #77DF -矠 > cè; #77E0 -矡 > jué; #77E1 -矢 > shÄ­; #77E2 -矣 > yÄ­; #77E3 -矤 > shÄ•n; #77E4 -知 > zhÄ«; #77E5 -矦 > hóu; #77E6 -矧 > shÄ•n; #77E7 -矨 > yÄ­ng; #77E8 -矩 > jÅ­; #77E9 -矪 > zhÅu; #77EA -矫 > jiăo; #77EB -矬 > cúo; #77EC -短 > duăn; #77ED -矮 > ăi; #77EE -矯 > jiăo; #77EF -矰 > zÄ“ng; #77F0 -矱 > hùo; #77F1 -矲 > băi; #77F2 -石 > shí; #77F3 -矴 > dìng; #77F4 -矵 > qì; #77F5 -矶 > jÄ«; #77F6 -矷 > zÄ­; #77F7 -矸 > gÄn; #77F8 -矹 > wù; #77F9 -矺 > tÅ«o; #77FA -矻 > kù; #77FB -矼 > qiÄng; #77FC -矽 > xì; #77FD -矾 > fán; #77FE -矿 > kuàng; #77FF -ç € > dàng; #7800 -ç  > mă; #7801 -ç ‚ > shÄ; #7802 -ç ƒ > dÄn; #7803 -ç „ > jué; #7804 -ç … > lì; #7805 -ç † > fÅ«; #7806 -ç ‡ > mín; #7807 -ç ˆ > nÅ­o; #7808 -ç ‰ > hùo; #7809 -ç Š > kàng; #780A -ç ‹ > zhÄ­; #780B -ç Œ > qì; #780C -ç  > kăn; #780D -ç Ž > jiè; #780E -ç  > fÄ“n; #780F -ç  > è; #7810 -ç ‘ > yà; #7811 -ç ’ > pÄ«; #7812 -ç “ > zhé; #7813 -ç ” > yán; #7814 -ç • > sùi; #7815 -ç – > zhuÄn; #7816 -ç — > chÄ“; #7817 -ç ˜ > dùn; #7818 -ç ™ > pÄn; #7819 -ç š > yàn; #781A -ç œ > fÄ“ng; #781C -ç  > fá; #781D -ç ž > mò; #781E -ç Ÿ > zhà; #781F -ç   > qÅ«; #7820 -ç ¡ > yù; #7821 -ç ¢ > lÅ­o; #7822 -ç £ > túo; #7823 -ç ¤ > túo; #7824 -ç ¥ > dÄ­; #7825 -ç ¦ > zhài; #7826 -ç § > zhÄ“n; #7827 -ç ¨ > ài; #7828 -ç © > fèi; #7829 -ç ª > mÅ­; #782A -ç « > zhÅ­; #782B -ç ¬ > lì; #782C -ç ­ > biÄn; #782D -ç ® > nÅ­; #782E -ç ¯ > pÄ«ng; #782F -ç ° > pÄ“ng; #7830 -ç ± > líng; #7831 -ç ² > pào; #7832 -ç ³ > lè; #7833 -ç ´ > pò; #7834 -ç µ > bÅ; #7835 -ç ¶ > pò; #7836 -ç · > shÄ“n; #7837 -ç ¸ > zá; #7838 -ç ¹ > nÅ­o; #7839 -ç º > lì; #783A -ç » > lóng; #783B -ç ¼ > tóng; #783C -ç ¾ > lì; #783E -ç¡€ > chÅ­; #7840 -ç¡ > kÄ“ng; #7841 -ç¡‚ > quán; #7842 -硃 > zhÅ«; #7843 -ç¡„ > kuÄng; #7844 -ç¡… > hùo; #7845 -硆 > è; #7846 -硇 > náo; #7847 -硈 > jiá; #7848 -硉 > lù; #7849 -ç¡Š > wÄ•i; #784A -ç¡‹ > ài; #784B -ç¡Œ > lùo; #784C -ç¡ > kèn; #784D -ç¡Ž > xíng; #784E -ç¡ > yán; #784F -ç¡ > tóng; #7850 -ç¡‘ > pÄ“ng; #7851 -ç¡’ > xÄ«; #7852 -ç¡” > hóng; #7854 -ç¡• > shùo; #7855 -ç¡– > xiá; #7856 -ç¡— > qiÄo; #7857 -ç¡™ > wèi; #7859 -ç¡š > qiáo; #785A -ç¡œ > kÄ“ng; #785C -ç¡ > xiÄo; #785D -ç¡ž > què; #785E -ç¡Ÿ > chàn; #785F -ç¡  > lăng; #7860 -ç¡¡ > hóng; #7861 -ç¡¢ > yú; #7862 -ç¡£ > xiÄo; #7863 -硤 > xiá; #7864 -ç¡¥ > măng; #7865 -硦 > lòng; #7866 -硧 > Ä­ong; #7867 -硨 > chÄ“; #7868 -ç¡© > chè; #7869 -硪 > é; #786A -ç¡« > líu; #786B -硬 > yìng; #786C -ç¡­ > máng; #786D -ç¡® > què; #786E -硯 > yàn; #786F -ç¡° > shÄ; #7870 -硱 > kÅ­n; #7871 -硲 > yù; #7872 -硵 > lÅ­; #7875 -硶 > chÄ•n; #7876 -ç¡· > jiăn; #7877 -硸 > nuè; #7878 -硹 > sÅng; #7879 -硺 > zhúo; #787A -ç¡» > kÄ“ng; #787B -硼 > péng; #787C -硽 > yăn; #787D -硾 > zhùi; #787E -ç¡¿ > kÅng; #787F -碀 > céng; #7880 -ç¢ > qí; #7881 -碂 > zòng; #7882 -碃 > qìng; #7883 -碄 > lín; #7884 -碅 > jÅ«n; #7885 -碆 > bÅ; #7886 -碇 > dìng; #7887 -碈 > mín; #7888 -碉 > diÄo; #7889 -碊 > jiÄn; #788A -碋 > hè; #788B -碌 > lù; #788C -ç¢ > ài; #788D -碎 > sùi; #788E -ç¢ > què; #788F -ç¢ > líng; #7890 -碑 > bÄ“i; #7891 -碒 > yín; #7892 -碓 > dùi; #7893 -碔 > wÅ­; #7894 -碕 > qí; #7895 -碖 > lùn; #7896 -碗 > wăn; #7897 -碘 > diăn; #7898 -碙 > gÄng; #7899 -碚 > péi; #789A -碛 > qì; #789B -碜 > chÄ•n; #789C -ç¢ > ruăn; #789D -碞 > yán; #789E -碟 > dié; #789F -碠 > dìng; #78A0 -碡 > dú; #78A1 -碢 > túo; #78A2 -碣 > jié; #78A3 -碤 > yÄ«ng; #78A4 -碥 > biăn; #78A5 -碦 > kè; #78A6 -碧 > bì; #78A7 -碨 > wÄ“i; #78A8 -碩 > shùo; #78A9 -碪 > zhÄ“n; #78AA -碫 > duàn; #78AB -碬 > xiá; #78AC -碭 > dàng; #78AD -碮 > tí; #78AE -碯 > năo; #78AF -碰 > pèng; #78B0 -碱 > jiăn; #78B1 -碲 > dì; #78B2 -碳 > tàn; #78B3 -碴 > chá; #78B4 -碶 > qì; #78B6 -碸 > fÄ“ng; #78B8 -碹 > xuàn; #78B9 -確 > què; #78BA -碻 > què; #78BB -碼 > mă; #78BC -碽 > gÅng; #78BD -碾 > niàn; #78BE -碿 > sù; #78BF -磀 > é; #78C0 -ç£ > cí; #78C1 -磂 > lìu; #78C2 -磃 > sÄ«; #78C3 -磄 > táng; #78C4 -磅 > bàng; #78C5 -磆 > huá; #78C6 -磇 > pÄ«; #78C7 -磈 > wÄ•i; #78C8 -磉 > săng; #78C9 -磊 > lÄ•i; #78CA -磋 > cÅ«o; #78CB -磌 > zhÄ“n; #78CC -ç£ > xiá; #78CD -磎 > qÄ«; #78CE -ç£ > lián; #78CF -ç£ > pán; #78D0 -磑 > wèi; #78D1 -磒 > yÅ­n; #78D2 -磓 > dÅ«i; #78D3 -磔 > zhé; #78D4 -磕 > kÄ“; #78D5 -磖 > lÄ; #78D6 -磘 > qìng; #78D8 -磙 > gÅ­n; #78D9 -磚 > zhuÄn; #78DA -磛 > chán; #78DB -磜 > qì; #78DC -ç£ > áo; #78DD -磞 > pÄ“ng; #78DE -磟 > lù; #78DF -磠 > lÅ­; #78E0 -磡 > kàn; #78E1 -磢 > qiăng; #78E2 -磣 > chÄ•n; #78E3 -磤 > yÄ­n; #78E4 -磥 > lÄ•i; #78E5 -磦 > biÄo; #78E6 -磧 > qì; #78E7 -磨 > mó; #78E8 -磩 > qÄ«; #78E9 -磪 > cÅ«i; #78EA -磫 > zÅng; #78EB -磬 > qìng; #78EC -磭 > chùo; #78ED -磯 > jÄ«; #78EF -磰 > shàn; #78F0 -磱 > láo; #78F1 -磲 > qú; #78F2 -磳 > zÄ“ng; #78F3 -磴 > dèng; #78F4 -磵 > jiàn; #78F5 -磶 > xì; #78F6 -磷 > lìn; #78F7 -磸 > dìng; #78F8 -磹 > diàn; #78F9 -磺 > huáng; #78FA -磻 > pán; #78FB -磼 > zá; #78FC -磽 > qiÄo; #78FD -磾 > dÄ«; #78FE -磿 > lì; #78FF -ç¤ > jiÄo; #7901 -礃 > zhăng; #7903 -礄 > qiáo; #7904 -礅 > dÅ«n; #7905 -礆 > xiăn; #7906 -礇 > yù; #7907 -礈 > zhùi; #7908 -礉 > hé; #7909 -礊 > hùo; #790A -礋 > zhái; #790B -礌 > lèi; #790C -ç¤ > kÄ•; #790D -礎 > chÅ­; #790E -ç¤ > jí; #790F -ç¤ > què; #7910 -礑 > dàng; #7911 -礒 > yÄ­; #7912 -礓 > jiÄng; #7913 -礔 > pì; #7914 -礕 > pÄ«; #7915 -礖 > yù; #7916 -礗 > pÄ«n; #7917 -礘 > qì; #7918 -礙 > ài; #7919 -礚 > kài; #791A -礛 > jiÄn; #791B -礜 > yù; #791C -ç¤ > ruăn; #791D -礞 > méng; #791E -礟 > pào; #791F -礠 > cí; #7920 -礣 > miè; #7923 -礤 > că; #7924 -礥 > xián; #7925 -礦 > kuàng; #7926 -礧 > lèi; #7927 -礨 > lÄ•i; #7928 -礩 > zhì; #7929 -礪 > lì; #792A -礫 > lì; #792B -礬 > fán; #792C -礭 > què; #792D -礮 > pào; #792E -礯 > yÄ«ng; #792F -礰 > lì; #7930 -礱 > lóng; #7931 -礲 > lóng; #7932 -礳 > mò; #7933 -礴 > bó; #7934 -礵 > shuÄng; #7935 -礶 > guàn; #7936 -礷 > lán; #7937 -礸 > zăn; #7938 -礹 > yán; #7939 -示 > shì; #793A -礻 > shì' 'zì' 'páng; #793B -礼 > lÄ­; #793C -礽 > réng; #793D -社 > shè; #793E -礿 > yuè; #793F -祀 > sì; #7940 -ç¥ > qí; #7941 -祂 > tÄ; #7942 -祃 > mà; #7943 -祄 > xiè; #7944 -祅 > xiÄn; #7945 -祆 > xiÄn; #7946 -祇 > zhÄ«; #7947 -祈 > qí; #7948 -祉 > zhÄ­; #7949 -祊 > bÄ“ng; #794A -祋 > dùi; #794B -祌 > zhòng; #794C -祎 > yÄ«; #794E -ç¥ > shí; #794F -ç¥ > yòu; #7950 -祑 > zhì; #7951 -祒 > tiáo; #7952 -祓 > fú; #7953 -祔 > fù; #7954 -祕 > mì; #7955 -祖 > zÅ­; #7956 -祗 > zhÄ«; #7957 -祘 > suàn; #7958 -祙 > mèi; #7959 -祚 > zùo; #795A -祛 > qÅ«; #795B -祜 > hù; #795C -ç¥ > zhù; #795D -神 > shén; #795E -祟 > sùi; #795F -祠 > cí; #7960 -祡 > chái; #7961 -祢 > mí; #7962 -祣 > lÇš; #7963 -祤 > yÅ­; #7964 -祥 > xiáng; #7965 -祦 > wú; #7966 -祧 > tiÄo; #7967 -票 > piào; #7968 -祩 > zhÅ«; #7969 -祪 > gÅ­i; #796A -祫 > xiá; #796B -祬 > zhÄ«; #796C -祭 > jì; #796D -祮 > gào; #796E -祯 > zhÄ“n; #796F -祰 > gào; #7970 -祱 > shùi; #7971 -祲 > jÄ«n; #7972 -祳 > chÄ•n; #7973 -祴 > gÄi; #7974 -祵 > kÅ­n; #7975 -祶 > dì; #7976 -祷 > dăo; #7977 -祸 > hùo; #7978 -祹 > táo; #7979 -祺 > qí; #797A -祻 > gù; #797B -祼 > guàn; #797C -祽 > zùi; #797D -祾 > líng; #797E -祿 > lù; #797F -禀 > bÄ­ng; #7980 -ç¦ > jìn; #7981 -禂 > dăo; #7982 -禃 > zhí; #7983 -禄 > lù; #7984 -禅 > shàn; #7985 -禆 > bÄ“i; #7986 -禇 > zhÄ•; #7987 -禈 > hÅ«i; #7988 -禉 > yÅu; #7989 -禊 > xì; #798A -禋 > yÄ«n; #798B -禌 > zÄ«; #798C -ç¦ > hùo; #798D -禎 > zhÄ“n; #798E -ç¦ > fú; #798F -ç¦ > yuàn; #7990 -禑 > wú; #7991 -禒 > xiăn; #7992 -禓 > yáng; #7993 -禔 > tí; #7994 -禕 > yÄ«; #7995 -禖 > méi; #7996 -禗 > sÄ«; #7997 -禘 > dì; #7998 -禚 > zhúo; #799A -禛 > zhÄ“n; #799B -禜 > yÅng; #799C -ç¦ > jí; #799D -禞 > gào; #799E -禟 > táng; #799F -禠 > sÄ«; #79A0 -禡 > mà; #79A1 -禢 > tÄ; #79A2 -禤 > xuÄn; #79A4 -禥 > qí; #79A5 -禦 > yù; #79A6 -禧 > xÄ«; #79A7 -禨 > jÄ«; #79A8 -禩 > sì; #79A9 -禪 > chán; #79AA -禫 > tăn; #79AB -禬 > kuài; #79AC -禭 > sùi; #79AD -禮 > lÄ­; #79AE -禯 > nóng; #79AF -禰 > nÄ­; #79B0 -禱 > dăo; #79B1 -禲 > lì; #79B2 -禳 > ráng; #79B3 -禴 > yuè; #79B4 -禵 > tí; #79B5 -禶 > zăn; #79B6 -禷 > lèi; #79B7 -禸 > róu; #79B8 -禹 > yÅ­; #79B9 -禺 > yú; #79BA -离 > chÄ«; #79BB -禼 > xiè; #79BC -禽 > qín; #79BD -禾 > hé; #79BE -禿 > tÅ«; #79BF -秀 > xìu; #79C0 -ç§ > sÄ«; #79C1 -秂 > rén; #79C2 -秃 > tÅ«; #79C3 -秄 > zÄ­; #79C4 -秅 > chá; #79C5 -秆 > găn; #79C6 -秇 > yì; #79C7 -秈 > xiÄn; #79C8 -秉 > bÄ­ng; #79C9 -秊 > nián; #79CA -秋 > qÄ«u; #79CB -秌 > qÄ«u; #79CC -ç§ > chóng; #79CD -秎 > fén; #79CE -ç§ > hào; #79CF -ç§ > yún; #79D0 -科 > kÄ“; #79D1 -秒 > miăo; #79D2 -秓 > zhÄ«; #79D3 -秔 > gÄ“ng; #79D4 -秕 > bÄ­; #79D5 -秖 > zhÄ«; #79D6 -秗 > yù; #79D7 -秘 > mì; #79D8 -秙 > kù; #79D9 -秚 > bàn; #79DA -秛 > pÄ«; #79DB -秜 > ní; #79DC -ç§ > lì; #79DD -秞 > yóu; #79DE -租 > zÅ«; #79DF -秠 > pÄ«; #79E0 -秡 > bá; #79E1 -秢 > líng; #79E2 -秣 > mò; #79E3 -秤 > chèng; #79E4 -秥 > nián; #79E5 -秦 > qín; #79E6 -秧 > yÄng; #79E7 -秨 > zúo; #79E8 -秩 > zhì; #79E9 -秪 > zhÄ«; #79EA -秫 > shú; #79EB -秬 > jù; #79EC -秭 > zÄ­; #79ED -秮 > húo; #79EE -积 > jÄ«; #79EF -称 > chÄ“ng; #79F0 -秱 > tóng; #79F1 -秲 > zhì; #79F2 -秳 > húo; #79F3 -秴 > hé; #79F4 -秵 > yÄ«n; #79F5 -秶 > zÄ«; #79F6 -秷 > zhí; #79F7 -秸 > jiÄ“; #79F8 -秹 > rÄ•n; #79F9 -秺 > dù; #79FA -移 > yí; #79FB -秼 > zhÅ«; #79FC -秽 > hùi; #79FD -秾 > nóng; #79FE -秿 > fÅ­; #79FF -稀 > xÄ«; #7A00 -ç¨ > kăo; #7A01 -稂 > láng; #7A02 -稃 > fÅ«; #7A03 -稄 > zè; #7A04 -稅 > shùi; #7A05 -稆 > lÇš; #7A06 -稇 > kÅ­n; #7A07 -稈 > găn; #7A08 -稉 > gÄ“ng; #7A09 -稊 > tí; #7A0A -程 > chéng; #7A0B -稌 > tú; #7A0C -ç¨ > shÄo; #7A0D -税 > shùi; #7A0E -ç¨ > yà; #7A0F -ç¨ > lÅ­n; #7A10 -稑 > lù; #7A11 -稒 > gù; #7A12 -稓 > zúo; #7A13 -稔 > rÄ•n; #7A14 -稕 > zhùn; #7A15 -稖 > bàng; #7A16 -稗 > bài; #7A17 -稘 > jÄ«; #7A18 -稙 > zhí; #7A19 -稚 > zhì; #7A1A -稛 > kÅ­n; #7A1B -稜 > léng; #7A1C -ç¨ > péng; #7A1D -稞 > kÄ“; #7A1E -稟 > bÄ­ng; #7A1F -稠 > chóu; #7A20 -稡 > zú; #7A21 -稢 > yù; #7A22 -稣 > sÅ«; #7A23 -稤 > lÇœe; #7A24 -稦 > yÄ«; #7A26 -稧 > xì; #7A27 -稨 > biÄn; #7A28 -稩 > jì; #7A29 -稪 > fù; #7A2A -稫 > bÄ«; #7A2B -稬 > nùo; #7A2C -稭 > jiÄ“; #7A2D -種 > zhÅng; #7A2E -稯 > zÅng; #7A2F -稰 > xÅ«; #7A30 -稱 > chÄ“ng; #7A31 -稲 > dào; #7A32 -稳 > wÄ•n; #7A33 -稴 > lián; #7A34 -稵 > zÄ«; #7A35 -稶 > yù; #7A36 -稷 > jì; #7A37 -稸 > xù; #7A38 -稹 > zhÄ•n; #7A39 -稺 > zhì; #7A3A -稻 > dào; #7A3B -稼 > jià; #7A3C -稽 > jÄ«; #7A3D -稾 > găo; #7A3E -稿 > găo; #7A3F -ç©€ > gÅ­; #7A40 -ç© > róng; #7A41 -ç©‚ > sùi; #7A42 -ç©„ > jì; #7A44 -ç©… > kÄng; #7A45 -穆 > mù; #7A46 -穇 > shÄn; #7A47 -穈 > mén; #7A48 -穉 > zhì; #7A49 -ç©Š > jì; #7A4A -ç©‹ > lù; #7A4B -ç©Œ > sÅ«; #7A4C -ç© > jÄ«; #7A4D -ç©Ž > yÄ­ng; #7A4E -ç© > wÄ•n; #7A4F -ç© > qÄ«u; #7A50 -ç©‘ > sè; #7A51 -ç©“ > yì; #7A53 -ç©” > huáng; #7A54 -ç©• > qiè; #7A55 -ç©– > jÄ­; #7A56 -ç©— > sùi; #7A57 -穘 > xiÄo; #7A58 -ç©™ > pú; #7A59 -ç©š > jiÄo; #7A5A -ç©› > zhÅ«o; #7A5B -ç©œ > tóng; #7A5C -ç©ž > lÇš; #7A5E -ç©Ÿ > sùi; #7A5F -ç©  > nóng; #7A60 -ç©¡ > sè; #7A61 -ç©¢ > hùi; #7A62 -ç©£ > ráng; #7A63 -穤 > nùo; #7A64 -ç©¥ > yù; #7A65 -穦 > bin; #7A66 -穧 > jì; #7A67 -穨 > túi; #7A68 -ç©© > wÄ•n; #7A69 -穪 > chÄ“ng; #7A6A -ç©« > hùo; #7A6B -穬 > gÅng; #7A6C -ç©­ > lÇš; #7A6D -ç©® > biÄo; #7A6E -ç©° > ráng; #7A70 -穱 > zhÅ«o; #7A71 -穲 > lí; #7A72 -穳 > zàn; #7A73 -ç©´ > xuè; #7A74 -穵 > wÄ; #7A75 -究 > jìu; #7A76 -ç©· > qíong; #7A77 -穸 > xì; #7A78 -穹 > qÄ«ong; #7A79 -空 > kÅng; #7A7A -ç©» > yÅ«; #7A7B -穼 > sÄ“n; #7A7C -穽 > jÄ­ng; #7A7D -穾 > yào; #7A7E -ç©¿ > chuÄn; #7A7F -窀 > zhÅ«n; #7A80 -çª > tú; #7A81 -窂 > láo; #7A82 -窃 > qiè; #7A83 -窄 > zhăi; #7A84 -窅 > yăo; #7A85 -窆 > biăn; #7A86 -窇 > báo; #7A87 -窈 > yăo; #7A88 -窉 > bÄ­ng; #7A89 -窊 > wÄ; #7A8A -窋 > zhú; #7A8B -窌 > jiào; #7A8C -çª > qiào; #7A8D -窎 > diào; #7A8E -çª > wÅ«; #7A8F -çª > gÅ«i; #7A90 -窑 > yáo; #7A91 -窒 > zhì; #7A92 -窓 > chuÄng; #7A93 -窔 > yăo; #7A94 -窕 > tiăo; #7A95 -窖 > jiào; #7A96 -窗 > chuÄng; #7A97 -窘 > jÄ­ong; #7A98 -窙 > xiÄo; #7A99 -窚 > chéng; #7A9A -窛 > kòu; #7A9B -窜 > cuàn; #7A9C -çª > wÅ; #7A9D -窞 > dàn; #7A9E -窟 > kÅ«; #7A9F -窠 > kÄ“; #7AA0 -窡 > zhùi; #7AA1 -窢 > xù; #7AA2 -窣 > sù; #7AA3 -窤 > guan; #7AA4 -窥 > kÅ«i; #7AA5 -窦 > dòu; #7AA6 -窨 > yìn; #7AA8 -窩 > wÅ; #7AA9 -窪 > wÄ; #7AAA -窫 > yà; #7AAB -窬 > yú; #7AAC -窭 > jù; #7AAD -窮 > qíong; #7AAE -窯 > yáo; #7AAF -窰 > yáo; #7AB0 -窱 > tiào; #7AB1 -窲 > cháo; #7AB2 -窳 > yÅ­; #7AB3 -窴 > tián; #7AB4 -窵 > diào; #7AB5 -窶 > jù; #7AB6 -窷 > liáo; #7AB7 -窸 > xÄ«; #7AB8 -窹 > wù; #7AB9 -窺 > kÅ«i; #7ABA -窻 > chuÄng; #7ABB -窼 > zhÄo; #7ABC -窾 > kuăn; #7ABE -窿 > lóng; #7ABF -ç«€ > chÄ“ng; #7AC0 -ç« > cùi; #7AC1 -ç«‚ > piáo; #7AC2 -竃 > zào; #7AC3 -ç«„ > cuàn; #7AC4 -ç«… > qiào; #7AC5 -竆 > qíong; #7AC6 -竇 > dòu; #7AC7 -竈 > zào; #7AC8 -竉 > lÅng; #7AC9 -ç«Š > qiè; #7ACA -ç«‹ > lì; #7ACB -ç«Œ > chù; #7ACC -ç« > shí' 'gÅng' 'shÄ“ng; #7ACD -ç«Ž > fòu; #7ACE -ç« > qiÄn' 'gÅng' 'shÄ“ng; #7ACF -ç« > chù; #7AD0 -ç«‘ > hóng; #7AD1 -ç«’ > qí; #7AD2 -ç«“ > qiÄn' 'fÄ“n' 'zhÄ«' 'yÄ«' 'gÅng' 'shÄ“ng; #7AD3 -ç«” > gÅng' 'shÄ“ng; #7AD4 -ç«• > shí' 'fÄ“n' 'zhÄ«' 'yÄ«' 'gÅng' 'shÄ“ng; #7AD5 -ç«– > shù; #7AD6 -ç«— > miào; #7AD7 -竘 > jÅ­; #7AD8 -ç«™ > zhàn; #7AD9 -ç«š > zhù; #7ADA -ç«› > líng; #7ADB -ç«œ > lóng; #7ADC -ç« > bìng; #7ADD -ç«ž > jìng; #7ADE -ç«Ÿ > jìng; #7ADF -ç«  > zhÄng; #7AE0 -ç«¡ > yÄ«' 'gÅng' 'shÄ“ng' 'de' 'yÄ«' 'băi' 'bèi; #7AE1 -ç«¢ > sì; #7AE2 -ç«£ > jùn; #7AE3 -竤 > hóng; #7AE4 -ç«¥ > tóng; #7AE5 -竦 > sÅng; #7AE6 -竧 > jìng; #7AE7 -竨 > diào; #7AE8 -ç«© > yì; #7AE9 -竪 > shù; #7AEA -ç«« > jìng; #7AEB -竬 > qÅ­; #7AEC -ç«­ > jié; #7AED -ç«® > píng; #7AEE -端 > duÄn; #7AEF -ç«° > sháo; #7AF0 -竱 > zhuăn; #7AF1 -竲 > céng; #7AF2 -竳 > dÄ“ng; #7AF3 -ç«´ > cÅ«i; #7AF4 -竵 > huÄi; #7AF5 -競 > jìng; #7AF6 -ç«· > kàn; #7AF7 -竸 > jìng; #7AF8 -竹 > zhú; #7AF9 -竺 > zhú; #7AFA -ç«» > lè; #7AFB -竼 > péng; #7AFC -竽 > yú; #7AFD -竾 > chí; #7AFE -ç«¿ > gÄn; #7AFF -笀 > máng; #7B00 -ç¬ > zhú; #7B01 -笃 > dÅ­; #7B03 -笄 > jÄ«; #7B04 -笅 > xiáo; #7B05 -笆 > bÄ; #7B06 -笇 > suàn; #7B07 -笈 > jí; #7B08 -笉 > zhÄ•n; #7B09 -笊 > zhào; #7B0A -笋 > sÅ­n; #7B0B -笌 > yá; #7B0C -ç¬ > zhùi; #7B0D -笎 > yuán; #7B0E -ç¬ > hù; #7B0F -ç¬ > gÄng; #7B10 -笑 > xiào; #7B11 -笒 > cén; #7B12 -笓 > pí; #7B13 -笔 > bÄ­; #7B14 -笕 > jiăn; #7B15 -笖 > yÄ­; #7B16 -笗 > dÅng; #7B17 -笘 > shÄn; #7B18 -笙 > shÄ“ng; #7B19 -笚 > xiá; #7B1A -笛 > dí; #7B1B -笜 > zhú; #7B1C -ç¬ > nà; #7B1D -笞 > chÄ«; #7B1E -笟 > gÅ«; #7B1F -笠 > lì; #7B20 -笡 > qiè; #7B21 -笢 > mÄ­n; #7B22 -笣 > bÄo; #7B23 -笤 > tiáo; #7B24 -笥 > sì; #7B25 -符 > fú; #7B26 -笧 > cè; #7B27 -笨 > bèn; #7B28 -笩 > pèi; #7B29 -笪 > dá; #7B2A -笫 > zÄ­; #7B2B -第 > dì; #7B2C -笭 > líng; #7B2D -笮 > zé; #7B2E -笯 > nú; #7B2F -笰 > fú; #7B30 -笱 > gÅu; #7B31 -笲 > fÄn; #7B32 -笳 > jiÄ; #7B33 -笴 > gÄ•; #7B34 -笵 > fàn; #7B35 -笶 > shÄ­; #7B36 -笷 > măo; #7B37 -笸 > pÅ; #7B38 -笺 > jiÄn; #7B3A -笻 > qíong; #7B3B -笼 > lóng; #7B3C -笾 > biÄn; #7B3E -笿 > lùo; #7B3F -ç­€ > gùi; #7B40 -ç­ > qÅ­; #7B41 -ç­‚ > chí; #7B42 -ç­ƒ > yÄ«n; #7B43 -ç­„ > yào; #7B44 -ç­… > xiăn; #7B45 -ç­† > bÄ­; #7B46 -ç­‡ > qíong; #7B47 -ç­ˆ > guÄ; #7B48 -ç­‰ > dÄ•ng; #7B49 -ç­Š > jiăo; #7B4A -ç­‹ > jÄ«n; #7B4B -ç­Œ > quán; #7B4C -ç­ > sÅ­n; #7B4D -ç­Ž > rú; #7B4E -ç­ > fá; #7B4F -ç­ > kuÄng; #7B50 -ç­‘ > zhú; #7B51 -ç­’ > tÅng; #7B52 -ç­“ > jÄ«; #7B53 -ç­” > dá; #7B54 -ç­• > xíng; #7B55 -ç­– > cè; #7B56 -ç­— > zhòng; #7B57 -ç­˜ > kòu; #7B58 -ç­™ > lái; #7B59 -ç­š > bì; #7B5A -ç­› > shÄi; #7B5B -ç­œ > dÄng; #7B5C -ç­ > zhÄ“ng; #7B5D -ç­ž > cè; #7B5E -ç­Ÿ > fÅ«; #7B5F -ç­  > yún; #7B60 -ç­¡ > tú; #7B61 -ç­¢ > pá; #7B62 -ç­£ > lì; #7B63 -ç­¤ > láng; #7B64 -ç­¥ > jÅ­; #7B65 -ç­¦ > guăn; #7B66 -ç­§ > jiăn; #7B67 -ç­¨ > hán; #7B68 -ç­© > tóng; #7B69 -ç­ª > xiá; #7B6A -ç­« > zhì; #7B6B -ç­¬ > chéng; #7B6C -ç­­ > suàn; #7B6D -ç­® > shì; #7B6E -ç­¯ > zhù; #7B6F -ç­° > zúo; #7B70 -ç­± > xiăo; #7B71 -ç­² > shÄo; #7B72 -ç­³ > tíng; #7B73 -ç­´ > cè; #7B74 -ç­µ > yán; #7B75 -ç­¶ > găo; #7B76 -ç­· > kuài; #7B77 -ç­¸ > gÄn; #7B78 -ç­¹ > chóu; #7B79 -ç­» > gàng; #7B7B -ç­¼ > yún; #7B7C -ç­¾ > qiÄn; #7B7E -ç­¿ > xiăo; #7B7F -简 > jiăn; #7B80 -ç® > pú; #7B81 -箂 > lái; #7B82 -箃 > zÅu; #7B83 -箄 > bì; #7B84 -ç®… > bì; #7B85 -箆 > bì; #7B86 -箇 > gè; #7B87 -箈 > chí; #7B88 -箉 > guăi; #7B89 -箊 > yÅ«; #7B8A -箋 > jiÄn; #7B8B -箌 > zhào; #7B8C -ç® > gÅ«; #7B8D -箎 > chí; #7B8E -ç® > zhÄ“ng; #7B8F -ç® > jÄ«ng; #7B90 -箑 > shà; #7B91 -ç®’ > zhÅu; #7B92 -箓 > lù; #7B93 -ç®” > bó; #7B94 -箕 > jÄ«; #7B95 -ç®– > lín; #7B96 -ç®— > suàn; #7B97 -箘 > jùn; #7B98 -ç®™ > fú; #7B99 -箚 > zhá; #7B9A -ç®› > gÅ«; #7B9B -箜 > kÅng; #7B9C -ç® > qián; #7B9D -箞 > quÄn; #7B9E -箟 > jùn; #7B9F -ç®  > chúi; #7BA0 -管 > guăn; #7BA1 -箢 > yuÄn; #7BA2 -箣 > cè; #7BA3 -箤 > jú; #7BA4 -箥 > bÅ; #7BA5 -箦 > zé; #7BA6 -箧 > qiè; #7BA7 -箨 > tùo; #7BA8 -箩 > lúo; #7BA9 -箪 > dÄn; #7BAA -箫 > xiÄo; #7BAB -箬 > rùo; #7BAC -ç®­ > jiàn; #7BAD -ç®® > xuan; #7BAE -箯 > biÄn; #7BAF -ç®° > sÅ­n; #7BB0 -ç®± > xiÄng; #7BB1 -箲 > xiăn; #7BB2 -箳 > píng; #7BB3 -ç®´ > zhÄ“n; #7BB4 -箵 > shÄ•ng; #7BB5 -箶 > hú; #7BB6 -ç®· > shÄ«; #7BB7 -箸 > zhù; #7BB8 -箹 > yuÄ“; #7BB9 -箺 > chÅ­n; #7BBA -ç®» > lÇœ; #7BBB -箼 > wÅ«; #7BBC -箽 > dÅng; #7BBD -箾 > xiÄo; #7BBE -箿 > jí; #7BBF -節 > jié; #7BC0 -ç¯ > huáng; #7BC1 -篂 > xÄ«ng; #7BC2 -篃 > méi; #7BC3 -範 > fàn; #7BC4 -篅 > chúi; #7BC5 -篆 > zhuàn; #7BC6 -篇 > piÄn; #7BC7 -篈 > fÄ“ng; #7BC8 -築 > zhú; #7BC9 -篊 > hóng; #7BCA -篋 > qiè; #7BCB -篌 > hóu; #7BCC -ç¯ > qÄ«u; #7BCD -篎 > miăo; #7BCE -ç¯ > qiàn; #7BCF -篑 > kùi; #7BD1 -篓 > lÅu; #7BD3 -篔 > yún; #7BD4 -篕 > hé; #7BD5 -篖 > táng; #7BD6 -篗 > yuè; #7BD7 -篘 > chÅu; #7BD8 -篙 > gÄo; #7BD9 -篚 > fÄ•i; #7BDA -篛 > rùo; #7BDB -篜 > zhÄ“ng; #7BDC -ç¯ > gÅu; #7BDD -篞 > niè; #7BDE -篟 > qiàn; #7BDF -篠 > xiăo; #7BE0 -篡 > cuàn; #7BE1 -篢 > gÅng; #7BE2 -篣 > páng; #7BE3 -篤 > dÅ­; #7BE4 -篥 > lì; #7BE5 -篦 > bì; #7BE6 -篧 > zhúo; #7BE7 -篨 > chú; #7BE8 -篩 > shÄi; #7BE9 -篪 > chí; #7BEA -篫 > zhú; #7BEB -篬 > qiÄng; #7BEC -篭 > lóng; #7BED -篮 > lán; #7BEE -篯 > jiÄn; #7BEF -篰 > bù; #7BF0 -篱 > lí; #7BF1 -篲 > hùi; #7BF2 -篳 > bì; #7BF3 -篴 > dí; #7BF4 -篵 > cÅng; #7BF5 -篶 > yÄn; #7BF6 -篷 > péng; #7BF7 -篸 > sÄ“n; #7BF8 -篹 > zhuàn; #7BF9 -篺 > pái; #7BFA -篻 > piào; #7BFB -篼 > dÅu; #7BFC -篽 > yÅ­; #7BFD -篾 > miè; #7BFE -篿 > zhuÄn; #7BFF -ç°€ > zé; #7C00 -ç° > xÄ­; #7C01 -ç°‚ > gúo; #7C02 -ç°ƒ > yí; #7C03 -ç°„ > hù; #7C04 -ç°… > chăn; #7C05 -ç°† > kòu; #7C06 -ç°‡ > cù; #7C07 -ç°ˆ > píng; #7C08 -ç°‰ > chòu; #7C09 -ç°Š > jÄ«; #7C0A -ç°‹ > gÅ­i; #7C0B -ç°Œ > sù; #7C0C -ç° > lÅu; #7C0D -ç°Ž > zhà; #7C0E -ç° > lù; #7C0F -ç° > niăn; #7C10 -ç°‘ > sÅ«o; #7C11 -ç°’ > cuàn; #7C12 -ç°” > sÅ«o; #7C14 -ç°• > lè; #7C15 -ç°– > duàn; #7C16 -ç°˜ > xiÄo; #7C18 -ç°™ > bó; #7C19 -ç°š > mì; #7C1A -ç°› > sÄ«; #7C1B -ç°œ > dàng; #7C1C -ç° > liáo; #7C1D -ç°ž > dÄn; #7C1E -ç°Ÿ > diàn; #7C1F -ç°  > fÅ­; #7C20 -ç°¡ > jiăn; #7C21 -ç°¢ > mÄ­n; #7C22 -ç°£ > kùi; #7C23 -ç°¤ > dài; #7C24 -ç°¥ > qiáo; #7C25 -ç°¦ > dÄ“ng; #7C26 -ç°§ > huáng; #7C27 -ç°¨ > sÅ­n; #7C28 -ç°© > láo; #7C29 -ç°ª > zÄn; #7C2A -ç°« > xiÄo; #7C2B -ç°¬ > dù; #7C2C -ç°­ > shì; #7C2D -ç°® > zÄn; #7C2E -ç°° > pái; #7C30 -ç°² > pái; #7C32 -ç°³ > gàn; #7C33 -ç°´ > jù; #7C34 -ç°µ > dù; #7C35 -ç°¶ > lù; #7C36 -ç°· > yán; #7C37 -ç°¸ > bò; #7C38 -ç°¹ > dÄng; #7C39 -ç°º > sài; #7C3A -ç°» > kÄ“; #7C3B -ç°¼ > lóng; #7C3C -ç°½ > qiÄn; #7C3D -ç°¾ > lián; #7C3E -ç°¿ > bó; #7C3F -ç±€ > zhòu; #7C40 -ç± > lài; #7C41 -籃 > lán; #7C43 -籄 > kùi; #7C44 -ç±… > yú; #7C45 -籆 > yuè; #7C46 -籇 > háo; #7C47 -籈 > zhÄ“n; #7C48 -籉 > tái; #7C49 -籊 > tì; #7C4A -籋 > mí; #7C4B -籌 > chóu; #7C4C -ç± > jí; #7C4D -ç± > téng; #7C50 -籑 > zhuàn; #7C51 -ç±’ > zhòu; #7C52 -籓 > fÄn; #7C53 -ç±” > sÅu; #7C54 -籕 > zhòu; #7C55 -ç±— > zhúo; #7C57 -籘 > téng; #7C58 -ç±™ > lù; #7C59 -籚 > lú; #7C5A -ç±› > jiÄn; #7C5B -籜 > tùo; #7C5C -ç± > yíng; #7C5D -籞 > yù; #7C5E -籟 > lài; #7C5F -ç±  > lóng; #7C60 -ç±¢ > lián; #7C62 -ç±£ > lán; #7C63 -籤 > qiÄn; #7C64 -ç±¥ > yuè; #7C65 -籦 > zhÅng; #7C66 -籧 > qú; #7C67 -籨 > lián; #7C68 -籩 > biÄn; #7C69 -籪 > duàn; #7C6A -籫 > zuăn; #7C6B -籬 > lí; #7C6C -ç±­ > sÄ«; #7C6D -ç±® > lúo; #7C6E -籯 > yíng; #7C6F -ç±° > yuè; #7C70 -ç±± > zhúo; #7C71 -ç±² > xÅ«; #7C72 -ç±³ > mÄ­; #7C73 -ç±´ > dí; #7C74 -ç±µ > fán; #7C75 -籶 > shÄ“n; #7C76 -ç±· > zhé; #7C77 -籸 > shÄ“n; #7C78 -ç±¹ > nÇš; #7C79 -籺 > xié; #7C7A -ç±» > lèi; #7C7B -ç±¼ > xiÄn; #7C7C -ç±½ > zÄ­; #7C7D -ç±¾ > ní; #7C7E -籿 > cùn; #7C7F -ç² > qiÄn; #7C81 -粃 > bÄ­; #7C83 -粄 > băn; #7C84 -ç²… > wù; #7C85 -粆 > shÄ; #7C86 -粇 > kÄng; #7C87 -粈 > rÅu; #7C88 -粉 > fÄ•n; #7C89 -粊 > bì; #7C8A -粋 > cùi; #7C8B -ç² > lí; #7C8D -粎 > chÄ­; #7C8E -粑 > bÄ; #7C91 -ç²’ > lì; #7C92 -粓 > gÄn; #7C93 -ç²” > jù; #7C94 -粕 > pò; #7C95 -ç²– > mò; #7C96 -ç²— > cÅ«; #7C97 -粘 > nián; #7C98 -ç²™ > zhòu; #7C99 -粚 > lí; #7C9A -ç²› > sù; #7C9B -粜 > tiào; #7C9C -ç² > lì; #7C9D -粞 > qÄ«; #7C9E -粟 > sù; #7C9F -ç²  > hóng; #7CA0 -粡 > tóng; #7CA1 -ç²¢ > zÄ«; #7CA2 -ç²£ > cè; #7CA3 -粤 > yuè; #7CA4 -ç²¥ > zhÅu; #7CA5 -粦 > lìn; #7CA6 -粧 > zhuÄng; #7CA7 -粨 > băi; #7CA8 -粪 > fèn; #7CAA -ç²® > liáng; #7CAE -粯 > xiàn; #7CAF -ç²° > fú; #7CB0 -ç²± > liáng; #7CB1 -ç²² > càn; #7CB2 -ç²³ > gÄ“ng; #7CB3 -ç²´ > lÄ­; #7CB4 -ç²µ > yuè; #7CB5 -粶 > lù; #7CB6 -ç²· > jú; #7CB7 -粸 > qí; #7CB8 -ç²¹ > cùi; #7CB9 -粺 > bài; #7CBA -ç²» > zhÄng; #7CBB -ç²¼ > lín; #7CBC -ç²½ > zòng; #7CBD -ç²¾ > jÄ«ng; #7CBE -粿 > gÅ­o; #7CBF -ç³ > sÄn; #7CC1 -糂 > săn; #7CC2 -糃 > táng; #7CC3 -糄 > biÄn; #7CC4 -ç³… > rÅu; #7CC5 -糆 > miàn; #7CC6 -糇 > hóu; #7CC7 -糈 > xÅ­; #7CC8 -糉 > zòng; #7CC9 -糊 > hú; #7CCA -糋 > jiàn; #7CCB -糌 > zán; #7CCC -ç³ > cí; #7CCD -糎 > lí; #7CCE -ç³ > xiè; #7CCF -ç³ > fÅ«; #7CD0 -糑 > nì; #7CD1 -ç³’ > bèi; #7CD2 -糓 > gÅ­; #7CD3 -ç³” > xÄ­u; #7CD4 -糕 > gÄo; #7CD5 -ç³– > táng; #7CD6 -ç³— > qÄ­u; #7CD7 -ç³™ > cÄo; #7CD9 -糚 > zhuÄng; #7CDA -ç³› > táng; #7CDB -糜 > mí; #7CDC -ç³ > sÄn; #7CDD -糞 > fèn; #7CDE -糟 > zÄo; #7CDF -ç³  > kÄng; #7CE0 -糡 > jiàng; #7CE1 -ç³¢ > mó; #7CE2 -ç³£ > săn; #7CE3 -糤 > săn; #7CE4 -ç³¥ > nùo; #7CE5 -糦 > xÄ«; #7CE6 -糧 > liáng; #7CE7 -糨 > jiàng; #7CE8 -糩 > kuài; #7CE9 -糪 > bó; #7CEA -糫 > huán; #7CEB -ç³­ > zòng; #7CED -ç³® > xiàn; #7CEE -糯 > nùo; #7CEF -ç³° > tuán; #7CF0 -ç³± > niè; #7CF1 -ç³² > lì; #7CF2 -ç³³ > zùo; #7CF3 -ç³´ > dí; #7CF4 -ç³µ > niè; #7CF5 -糶 > tiào; #7CF6 -ç³· > lán; #7CF7 -糸 > mì; #7CF8 -ç³¹ > jiăo' 'sÄ«' 'páng; #7CF9 -糺 > jÄ«u; #7CFA -ç³» > xì; #7CFB -ç³¼ > gÅng; #7CFC -ç³½ > zhÄ•ng; #7CFD -ç³¾ > jÄ«u; #7CFE -糿 > yòu; #7CFF -ç´€ > jì; #7D00 -ç´ > chà; #7D01 -ç´‚ > zhòu; #7D02 -ç´ƒ > xún; #7D03 -ç´„ > yuÄ“; #7D04 -ç´… > hóng; #7D05 -ç´† > yÅ«; #7D06 -ç´‡ > hé; #7D07 -ç´ˆ > wán; #7D08 -ç´‰ > rèn; #7D09 -ç´Š > wèn; #7D0A -ç´‹ > wén; #7D0B -ç´Œ > qíu; #7D0C -ç´ > nà; #7D0D -ç´Ž > zÄ«; #7D0E -ç´ > tÅu; #7D0F -ç´ > nÄ­u; #7D10 -ç´‘ > fóu; #7D11 -ç´’ > jiè; #7D12 -ç´“ > shÅ«; #7D13 -ç´” > chún; #7D14 -ç´• > pí; #7D15 -ç´– > yÄ­n; #7D16 -ç´— > shÄ; #7D17 -ç´˜ > hóng; #7D18 -ç´™ > zhÄ­; #7D19 -ç´š > jí; #7D1A -ç´› > fÄ“n; #7D1B -ç´œ > yún; #7D1C -ç´ > rén; #7D1D -ç´ž > dăn; #7D1E -ç´Ÿ > jÄ«n; #7D1F -ç´  > sù; #7D20 -ç´¡ > făng; #7D21 -ç´¢ > sÅ­o; #7D22 -ç´£ > cùi; #7D23 -ç´¤ > jÄ­u; #7D24 -ç´¥ > zhá; #7D25 -ç´§ > jÄ­n; #7D27 -ç´¨ > fù; #7D28 -ç´© > zhì; #7D29 -ç´ª > cÄ­; #7D2A -ç´« > zÄ­; #7D2B -ç´¬ > chóu; #7D2C -ç´­ > hóng; #7D2D -ç´® > zhá; #7D2E -ç´¯ > lèi; #7D2F -ç´° > xì; #7D30 -ç´± > fú; #7D31 -ç´² > xiè; #7D32 -ç´³ > shÄ“n; #7D33 -ç´´ > bèi; #7D34 -ç´µ > zhù; #7D35 -ç´¶ > qÅ­; #7D36 -ç´· > líng; #7D37 -ç´¸ > zhù; #7D38 -ç´¹ > shào; #7D39 -ç´º > gàn; #7D3A -ç´» > yÄng; #7D3B -ç´¼ > fú; #7D3C -ç´½ > túo; #7D3D -ç´¾ > zhÄ•n; #7D3E -ç´¿ > dài; #7D3F -çµ€ > zhúo; #7D40 -çµ > shÄ«; #7D41 -終 > zhÅng; #7D42 -絃 > xián; #7D43 -組 > zÅ­; #7D44 -çµ… > jÄ­ong; #7D45 -絆 > bàn; #7D46 -絇 > jù; #7D47 -絈 > mò; #7D48 -絉 > shù; #7D49 -絊 > zùi; #7D4A -経 > jÄ«ng; #7D4C -çµ > rén; #7D4D -絎 > hèng; #7D4E -çµ > xiè; #7D4F -çµ > jié; #7D50 -絑 > zhÅ«; #7D51 -çµ’ > chóu; #7D52 -絓 > guà; #7D53 -çµ” > băi; #7D54 -絕 > jué; #7D55 -çµ– > kuàng; #7D56 -çµ— > hú; #7D57 -絘 > cì; #7D58 -çµ™ > gÄ“ng; #7D59 -絚 > gÄ“ng; #7D5A -çµ› > tÄo; #7D5B -絜 > xié; #7D5C -çµ > kù; #7D5D -絞 > jiăo; #7D5E -絟 > quÄn; #7D5F -çµ  > găi; #7D60 -絡 > lùo; #7D61 -çµ¢ > xuàn; #7D62 -çµ£ > bÄ«ng; #7D63 -絤 > xiàn; #7D64 -çµ¥ > fú; #7D65 -給 > gÄ•i; #7D66 -絧 > tóng; #7D67 -絨 > róng; #7D68 -絩 > tiào; #7D69 -絪 > yÄ«n; #7D6A -絫 > lÄ•i; #7D6B -絬 > xiè; #7D6C -çµ­ > quàn; #7D6D -çµ® > xù; #7D6E -絯 > lÇœn; #7D6F -çµ° > dié; #7D70 -çµ± > tÅng; #7D71 -çµ² > sÄ«; #7D72 -çµ³ > jiàng; #7D73 -çµ´ > xiáng; #7D74 -çµµ > hùi; #7D75 -絶 > jué; #7D76 -çµ· > zhí; #7D77 -絸 > jiăn; #7D78 -çµ¹ > juàn; #7D79 -絺 > chÄ«; #7D7A -çµ» > miăn; #7D7B -çµ¼ > zhÄ•n; #7D7C -çµ½ > lÇš; #7D7D -çµ¾ > chéng; #7D7E -絿 > qíu; #7D7F -綀 > shÅ«; #7D80 -ç¶ > băng; #7D81 -綂 > tÅng; #7D82 -綃 > xiÄo; #7D83 -綄 > wàn; #7D84 -綅 > qÄ«n; #7D85 -綆 > gÄ•ng; #7D86 -綇 > xÄ­u; #7D87 -綈 > tí; #7D88 -綉 > xìu; #7D89 -綊 > xié; #7D8A -綋 > hóng; #7D8B -綌 > xì; #7D8C -ç¶ > fú; #7D8D -綎 > tÄ«ng; #7D8E -ç¶ > sÅ«i; #7D8F -ç¶ > dùi; #7D90 -綑 > kÅ­n; #7D91 -綒 > fÅ«; #7D92 -經 > jÄ«ng; #7D93 -綔 > hù; #7D94 -綕 > zhÄ«; #7D95 -綖 > yán; #7D96 -綗 > jÄ­ong; #7D97 -綘 > féng; #7D98 -継 > jì; #7D99 -綜 > zòng; #7D9C -ç¶ > lín; #7D9D -綞 > dÅ­o; #7D9E -綟 > lì; #7D9F -綠 > lÇœ; #7DA0 -綡 > liáng; #7DA1 -綢 > chóu; #7DA2 -綣 > quăn; #7DA3 -綤 > shào; #7DA4 -綥 > qì; #7DA5 -綦 > qí; #7DA6 -綧 > zhÅ­n; #7DA7 -綨 > qí; #7DA8 -綩 > wăn; #7DA9 -綪 > qiàn; #7DAA -綫 > xiàn; #7DAB -綬 > shòu; #7DAC -維 > wéi; #7DAD -綮 > qÄ­; #7DAE -綯 > táo; #7DAF -綰 > wăn; #7DB0 -綱 > gÄng; #7DB1 -網 > wăng; #7DB2 -綳 > bÄ“ng; #7DB3 -綴 > zhùi; #7DB4 -綵 > căi; #7DB5 -綶 > gÅ­o; #7DB6 -綷 > cùi; #7DB7 -綸 > lún; #7DB8 -綹 > lÄ­u; #7DB9 -綺 > qÄ­; #7DBA -綻 > zhàn; #7DBB -綼 > bÄ“i; #7DBC -綽 > chùo; #7DBD -綾 > líng; #7DBE -綿 > mián; #7DBF -ç·€ > qÄ«; #7DC0 -ç· > qiè; #7DC1 -ç·‚ > tÄn; #7DC2 -ç·ƒ > zÅng; #7DC3 -ç·„ > gÅ­n; #7DC4 -ç·… > zÅu; #7DC5 -ç·† > yì; #7DC6 -ç·‡ > zÄ«; #7DC7 -ç·ˆ > xìng; #7DC8 -ç·‰ > liăng; #7DC9 -ç·Š > jÄ­n; #7DCA -ç·‹ > fÄ“i; #7DCB -ç·Œ > rúi; #7DCC -ç· > mín; #7DCD -ç·Ž > yù; #7DCE -ç· > zÅng; #7DCF -ç· > fán; #7DD0 -ç·‘ > lÇœ; #7DD1 -ç·’ > xù; #7DD2 -ç·“ > yingl; #7DD3 -ç·” > zhàng; #7DD4 -ç·– > xù; #7DD6 -ç·— > xiÄng; #7DD7 -ç·˜ > jiÄn; #7DD8 -ç·™ > kè; #7DD9 -ç·š > xiàn; #7DDA -ç·› > ruăn; #7DDB -ç·œ > mián; #7DDC -ç· > qì; #7DDD -ç·ž > duàn; #7DDE -ç·Ÿ > zhòng; #7DDF -ç·  > dì; #7DE0 -ç·¡ > mín; #7DE1 -ç·¢ > miáo; #7DE2 -ç·£ > yuán; #7DE3 -ç·¤ > xiè; #7DE4 -ç·¥ > băo; #7DE5 -ç·¦ > sÄ«; #7DE6 -ç·§ > qÄ«u; #7DE7 -ç·¨ > biÄn; #7DE8 -ç·© > huăn; #7DE9 -ç·ª > gÄ“ng; #7DEA -ç·« > cÅng; #7DEB -ç·¬ > miăn; #7DEC -ç·­ > wèi; #7DED -ç·® > fù; #7DEE -ç·¯ > wÄ•i; #7DEF -ç·° > yú; #7DF0 -ç·± > gÅu; #7DF1 -ç·² > miăo; #7DF2 -ç·³ > xié; #7DF3 -ç·´ > liàn; #7DF4 -ç·µ > zÅng; #7DF5 -ç·¶ > biàn; #7DF6 -ç·· > yùn; #7DF7 -ç·¸ > yÄ«n; #7DF8 -ç·¹ > tí; #7DF9 -ç·º > guÄ; #7DFA -ç·» > zhì; #7DFB -ç·¼ > yÅ«n; #7DFC -ç·½ > chÄ“ng; #7DFD -ç·¾ > chán; #7DFE -ç·¿ > dài; #7DFF -縀 > xiá; #7E00 -ç¸ > yuán; #7E01 -縂 > zÅng; #7E02 -縃 > xÅ«; #7E03 -縆 > gÄ“ng; #7E06 -縈 > yíng; #7E08 -縉 > jìn; #7E09 -縊 > yì; #7E0A -縋 > zhùi; #7E0B -縌 > nì; #7E0C -ç¸ > bÄng; #7E0D -縎 > gÅ­; #7E0E -ç¸ > pán; #7E0F -ç¸ > zhòu; #7E10 -縑 > jiÄn; #7E11 -縒 > cÅ­o; #7E12 -縓 > quăn; #7E13 -縔 > shuăng; #7E14 -縕 > yÅ«n; #7E15 -縖 > xiá; #7E16 -縗 > shuÄi; #7E17 -縘 > xÄ«; #7E18 -縙 > róng; #7E19 -縚 > tÄo; #7E1A -縛 > fú; #7E1B -縜 > yún; #7E1C -ç¸ > zhÄ“n; #7E1D -縞 > găo; #7E1E -縟 > rù; #7E1F -縠 > hú; #7E20 -縡 > zăi; #7E21 -縢 > téng; #7E22 -縣 > xiàn; #7E23 -縤 > sù; #7E24 -縥 > zhÄ•n; #7E25 -縦 > zòng; #7E26 -縧 > tÄo; #7E27 -縩 > cài; #7E29 -縪 > bì; #7E2A -縫 > féng; #7E2B -縬 > cù; #7E2C -縭 > lí; #7E2D -縮 > sÅ«o; #7E2E -縯 > yÄ­n; #7E2F -縰 > xÄ­; #7E30 -縱 > zòng; #7E31 -縲 > léi; #7E32 -縳 > zhuàn; #7E33 -縴 > qiÄn; #7E34 -縵 > màn; #7E35 -縶 > zhí; #7E36 -縷 > lÇš; #7E37 -縸 > mò; #7E38 -縹 > piăo; #7E39 -縺 > lián; #7E3A -縻 > mí; #7E3B -縼 > xuàn; #7E3C -總 > zÅng; #7E3D -績 > jÄ«; #7E3E -縿 > shÄn; #7E3F -ç¹€ > sùi; #7E40 -ç¹ > fán; #7E41 -繂 > shuài; #7E42 -繃 > bÄ“ng; #7E43 -繄 > yÄ«; #7E44 -ç¹… > sÄo; #7E45 -繆 > móu; #7E46 -繇 > zhòu; #7E47 -繈 > qiăng; #7E48 -繉 > hún; #7E49 -繋 > xì; #7E4B -ç¹ > xìu; #7E4D -繎 > rán; #7E4E -ç¹ > xuàn; #7E4F -ç¹ > hùi; #7E50 -繑 > qiÄo; #7E51 -ç¹’ > zÄ“ng; #7E52 -繓 > zÅ­o; #7E53 -ç¹” > zhÄ«; #7E54 -繕 > shàn; #7E55 -ç¹– > săn; #7E56 -ç¹— > lín; #7E57 -繘 > yù; #7E58 -ç¹™ > fÄn; #7E59 -繚 > liáo; #7E5A -ç¹› > chùo; #7E5B -繜 > zÅ«n; #7E5C -ç¹ > jiàn; #7E5D -繞 > rào; #7E5E -繟 > chăn; #7E5F -ç¹  > rÅ­i; #7E60 -繡 > xìu; #7E61 -ç¹¢ > hùi; #7E62 -ç¹£ > huà; #7E63 -繤 > zuăn; #7E64 -ç¹¥ > xÄ«; #7E65 -繦 > qiăng; #7E66 -繨 > dá; #7E68 -繩 > shéng; #7E69 -繪 > hùi; #7E6A -繫 > xì; #7E6B -繬 > sè; #7E6C -ç¹­ > jiăn; #7E6D -ç¹® > jiÄng; #7E6E -繯 > huán; #7E6F -ç¹° > zăo; #7E70 -ç¹± > cÅng; #7E71 -ç¹² > jiè; #7E72 -ç¹³ > jiăo; #7E73 -ç¹´ > bò; #7E74 -ç¹µ > chán; #7E75 -繶 > yì; #7E76 -ç¹· > náo; #7E77 -繸 > sùi; #7E78 -ç¹¹ > yì; #7E79 -繺 > shăi; #7E7A -ç¹» > xÅ«; #7E7B -ç¹¼ > jì; #7E7C -ç¹½ > bÄ«n; #7E7D -ç¹¾ > qiăn; #7E7E -繿 > lán; #7E7F -纀 > pú; #7E80 -çº > xÅ«n; #7E81 -纂 > zuăn; #7E82 -纃 > qí; #7E83 -纄 > péng; #7E84 -纅 > lì; #7E85 -纆 > mò; #7E86 -纇 > lèi; #7E87 -纈 > xié; #7E88 -纉 > zuăn; #7E89 -纊 > kuàng; #7E8A -纋 > yÅu; #7E8B -續 > xù; #7E8C -çº > léi; #7E8D -纎 > xiÄn; #7E8E -çº > chán; #7E8F -纑 > lú; #7E91 -纒 > chán; #7E92 -纓 > yÄ«ng; #7E93 -纔 > cái; #7E94 -纕 > xiÄng; #7E95 -纖 > xiÄn; #7E96 -纗 > zÅ«i; #7E97 -纘 > zuăn; #7E98 -纙 > lùo; #7E99 -纚 > xÄ­; #7E9A -纛 > dào; #7E9B -纜 > làn; #7E9C -çº > léi; #7E9D -纞 > liàn; #7E9E -纟 > sÄ«; #7E9F -纠 > jÄ«u; #7EA0 -纡 > yÅ«; #7EA1 -红 > hóng; #7EA2 -纣 > zhòu; #7EA3 -纤 > xiÄn; #7EA4 -纥 > hé; #7EA5 -约 > yuÄ“; #7EA6 -级 > jí; #7EA7 -纨 > wán; #7EA8 -纩 > kuàng; #7EA9 -纪 > jì; #7EAA -纫 > rèn; #7EAB -纬 > wÄ•i; #7EAC -纭 > yún; #7EAD -纮 > hóng; #7EAE -纯 > chún; #7EAF -纰 > pí; #7EB0 -纱 > shÄ; #7EB1 -纲 > gÄng; #7EB2 -纳 > nà; #7EB3 -纴 > rén; #7EB4 -纵 > zòng; #7EB5 -纶 > lún; #7EB6 -纷 > fÄ“n; #7EB7 -纸 > zhÄ­; #7EB8 -纹 > wén; #7EB9 -纺 > făng; #7EBA -纻 > zhù; #7EBB -纼 > yÄ­n; #7EBC -纽 > nÄ­u; #7EBD -纾 > shÅ«; #7EBE -线 > xiàn; #7EBF -绀 > gàn; #7EC0 -ç» > xiè; #7EC1 -绂 > fú; #7EC2 -练 > liàn; #7EC3 -组 > zÅ­; #7EC4 -ç»… > shÄ“n; #7EC5 -细 > xì; #7EC6 -织 > zhÄ«; #7EC7 -终 > zhÅng; #7EC8 -绉 > zhòu; #7EC9 -绊 > bàn; #7ECA -绋 > fú; #7ECB -绌 > zhúo; #7ECC -ç» > shào; #7ECD -绎 > yì; #7ECE -ç» > jÄ«ng; #7ECF -ç» > dài; #7ED0 -绑 > băng; #7ED1 -ç»’ > róng; #7ED2 -结 > jié; #7ED3 -ç»” > kù; #7ED4 -绕 > rào; #7ED5 -ç»– > dié; #7ED6 -ç»— > hèng; #7ED7 -绘 > hùi; #7ED8 -ç»™ > gÄ•i; #7ED9 -绚 > xuàn; #7EDA -ç»› > jiàng; #7EDB -络 > lùo; #7EDC -ç» > jué; #7EDD -绞 > jiăo; #7EDE -统 > tÅng; #7EDF -ç»  > gÄ•ng; #7EE0 -绡 > xiÄo; #7EE1 -绢 > juàn; #7EE2 -绣 > xìu; #7EE3 -绤 > xì; #7EE4 -绥 > sÅ«i; #7EE5 -绦 > tÄo; #7EE6 -继 > jì; #7EE7 -绨 > tí; #7EE8 -绩 > jÄ«; #7EE9 -绪 > xù; #7EEA -绫 > líng; #7EEB -ç»­ > xù; #7EED -ç»® > qÄ­; #7EEE -绯 > fÄ“i; #7EEF -ç»° > chùo; #7EF0 -ç»± > zhăng; #7EF1 -绲 > gÅ­n; #7EF2 -绳 > shéng; #7EF3 -ç»´ > wéi; #7EF4 -绵 > mián; #7EF5 -绶 > shòu; #7EF6 -ç»· > bÄ“ng; #7EF7 -绸 > chóu; #7EF8 -绹 > táo; #7EF9 -绺 > lÄ­u; #7EFA -ç»» > quăn; #7EFB -综 > zòng; #7EFC -绽 > zhàn; #7EFD -绾 > wăn; #7EFE -绿 > lÇœ; #7EFF -ç¼€ > zhùi; #7F00 -ç¼ > zÄ«; #7F01 -缂 > kè; #7F02 -缃 > xiÄng; #7F03 -缄 > jiÄn; #7F04 -ç¼… > miăn; #7F05 -缆 > làn; #7F06 -缇 > tí; #7F07 -缈 > miăo; #7F08 -缉 > qì; #7F09 -缊 > yÅ«n; #7F0A -缋 > hùi; #7F0B -缌 > sÄ«; #7F0C -ç¼ > dÅ­o; #7F0D -缎 > duàn; #7F0E -ç¼ > biàn; #7F0F -ç¼ > xiàn; #7F10 -缑 > gÅu; #7F11 -ç¼’ > zhùi; #7F12 -缓 > huăn; #7F13 -ç¼” > dì; #7F14 -缕 > lÇš; #7F15 -ç¼– > biÄn; #7F16 -ç¼— > mín; #7F17 -缘 > yuán; #7F18 -ç¼™ > jìn; #7F19 -缚 > fú; #7F1A -ç¼› > rù; #7F1B -缜 > zhÄ“n; #7F1C -ç¼ > féng; #7F1D -缞 > shuÄi; #7F1E -缟 > găo; #7F1F -ç¼  > chán; #7F20 -缡 > lí; #7F21 -ç¼¢ > yì; #7F22 -ç¼£ > jiÄn; #7F23 -缤 > bÄ«n; #7F24 -ç¼¥ > piăo; #7F25 -缦 > màn; #7F26 -缧 > léi; #7F27 -缨 > yÄ«ng; #7F28 -缩 > sÅ«o; #7F29 -缪 > móu; #7F2A -缫 > sÄo; #7F2B -缬 > xié; #7F2C -ç¼­ > liáo; #7F2D -ç¼® > shàn; #7F2E -缯 > zÄ“ng; #7F2F -ç¼° > jiÄng; #7F30 -ç¼± > qiăn; #7F31 -ç¼² > zăo; #7F32 -ç¼³ > huán; #7F33 -ç¼´ > jiăo; #7F34 -ç¼µ > zuăn; #7F35 -缶 > fÅu; #7F36 -ç¼· > xiè; #7F37 -缸 > gÄng; #7F38 -ç¼¹ > fÅu; #7F39 -缺 > quÄ“; #7F3A -ç¼» > fÅu; #7F3B -ç¼½ > bÅ; #7F3D -ç¼¾ > píng; #7F3E -缿 > hòu; #7F3F -ç½ > gÄng; #7F41 -罂 > yÄ«ng; #7F42 -罃 > yÄ«ng; #7F43 -罄 > qìng; #7F44 -ç½… > xià; #7F45 -罆 > guàn; #7F46 -罇 > zÅ«n; #7F47 -罈 > tán; #7F48 -罊 > qì; #7F4A -罋 > wèng; #7F4B -罌 > yÄ«ng; #7F4C -ç½ > léi; #7F4D -罎 > tán; #7F4E -ç½ > lú; #7F4F -ç½ > guàn; #7F50 -网 > wăng; #7F51 -ç½’ > wăng; #7F52 -罓 > gÄng; #7F53 -ç½” > wăng; #7F54 -罕 > hăn; #7F55 -ç½— > lÅ«o; #7F57 -罘 > fú; #7F58 -ç½™ > mí; #7F59 -罚 > fá; #7F5A -ç½› > gÅ«; #7F5B -罜 > zhÅ­; #7F5C -ç½ > jÅ«; #7F5D -罞 > máo; #7F5E -罟 > gÅ­; #7F5F -ç½  > mín; #7F60 -罡 > gÄng; #7F61 -ç½¢ > bà; #7F62 -ç½£ > guà; #7F63 -罤 > tí; #7F64 -ç½¥ > juàn; #7F65 -罦 > fÅ«; #7F66 -罧 > lín; #7F67 -罨 > yăn; #7F68 -罩 > zhào; #7F69 -罪 > zùi; #7F6A -罫 > guà; #7F6B -罬 > zhúo; #7F6C -ç½­ > yù; #7F6D -ç½® > zhì; #7F6E -罯 > ăn; #7F6F -ç½° > fá; #7F70 -ç½± > năn; #7F71 -ç½² > shÅ­; #7F72 -ç½³ > sÄ«; #7F73 -ç½´ > pí; #7F74 -ç½µ > mà; #7F75 -罶 > lÄ­u; #7F76 -ç½· > bà; #7F77 -罸 > fá; #7F78 -ç½¹ > lí; #7F79 -罺 > chÄo; #7F7A -ç½» > wèi; #7F7B -ç½¼ > bì; #7F7C -ç½½ > jì; #7F7D -ç½¾ > zÄ“ng; #7F7E -罿 > tóng; #7F7F -ç¾€ > lÄ­u; #7F80 -ç¾ > jÄ«; #7F81 -羂 > juàn; #7F82 -羃 > mì; #7F83 -羄 > zhào; #7F84 -ç¾… > lúo; #7F85 -羆 > pí; #7F86 -羇 > jÄ«; #7F87 -羈 > jÄ«; #7F88 -羉 > luán; #7F89 -羊 > yáng; #7F8A -羋 > miÄ“; #7F8B -羌 > qiÄng; #7F8C -ç¾ > tà; #7F8D -美 > mÄ•i; #7F8E -ç¾ > yáng; #7F8F -ç¾ > yÅu; #7F90 -羑 > yÅu; #7F91 -ç¾’ > fén; #7F92 -羓 > bÄ; #7F93 -ç¾” > gÄo; #7F94 -羕 > yàng; #7F95 -ç¾– > gÅ­; #7F96 -ç¾— > qiÄng; #7F97 -羘 > zÄng; #7F98 -ç¾™ > gÄo; #7F99 -羚 > líng; #7F9A -ç¾› > yì; #7F9B -羜 > zhù; #7F9C -ç¾ > dÄ«; #7F9D -羞 > xÄ«u; #7F9E -羟 > qiÄn; #7F9F -ç¾  > yí; #7FA0 -羡 > xiàn; #7FA1 -ç¾¢ > róng; #7FA2 -ç¾£ > qún; #7FA3 -群 > qún; #7FA4 -ç¾¥ > qiÄn; #7FA5 -羦 > huán; #7FA6 -羧 > zÅ«i; #7FA7 -羨 > xiàn; #7FA8 -義 > yì; #7FA9 -羫 > qiÄng; #7FAB -羬 > xián; #7FAC -ç¾­ > yú; #7FAD -ç¾® > gÄ“ng; #7FAE -羯 > jié; #7FAF -ç¾° > tÄng; #7FB0 -ç¾± > yuán; #7FB1 -ç¾² > xÄ«; #7FB2 -ç¾³ > fán; #7FB3 -ç¾´ > shÄn; #7FB4 -ç¾µ > fÄ•n; #7FB5 -羶 > shÄn; #7FB6 -ç¾· > liăn; #7FB7 -羸 > léi; #7FB8 -ç¾¹ > gÄ“ng; #7FB9 -羺 > nóu; #7FBA -ç¾» > qiàng; #7FBB -ç¾¼ > chàn; #7FBC -ç¾½ > yÅ­; #7FBD -ç¾¾ > gòng; #7FBE -羿 > yì; #7FBF -ç¿€ > chóng; #7FC0 -ç¿ > wÄ“ng; #7FC1 -ç¿‚ > fÄ“n; #7FC2 -翃 > hóng; #7FC3 -ç¿„ > chì; #7FC4 -ç¿… > chì; #7FC5 -翆 > cùi; #7FC6 -翇 > fú; #7FC7 -翈 > xiá; #7FC8 -翉 > pÄ•n; #7FC9 -ç¿Š > yì; #7FCA -ç¿‹ > lÄ; #7FCB -ç¿Œ > yì; #7FCC -ç¿ > pÄ«; #7FCD -ç¿Ž > líng; #7FCE -ç¿ > lìu; #7FCF -ç¿ > zhì; #7FD0 -ç¿‘ > qú; #7FD1 -ç¿’ > xí; #7FD2 -ç¿“ > xié; #7FD3 -ç¿” > xiáng; #7FD4 -ç¿• > xì; #7FD5 -ç¿– > xì; #7FD6 -ç¿— > qí; #7FD7 -翘 > qiáo; #7FD8 -ç¿™ > hùi; #7FD9 -ç¿š > hÅ«i; #7FDA -ç¿› > xiÄo; #7FDB -ç¿œ > sè; #7FDC -ç¿ > hóng; #7FDD -ç¿ž > jiÄng; #7FDE -ç¿Ÿ > dí; #7FDF -ç¿  > cùi; #7FE0 -ç¿¡ > fÄ•i; #7FE1 -ç¿¢ > tÄo; #7FE2 -ç¿£ > shà; #7FE3 -翤 > chì; #7FE4 -ç¿¥ > zhù; #7FE5 -翦 > jiăn; #7FE6 -翧 > xuÄn; #7FE7 -翨 > shì; #7FE8 -ç¿© > piÄn; #7FE9 -翪 > zÅng; #7FEA -ç¿« > wàn; #7FEB -翬 > hÅ«i; #7FEC -ç¿­ > hóu; #7FED -ç¿® > hé; #7FEE -翯 > hè; #7FEF -ç¿° > hàn; #7FF0 -翱 > áo; #7FF1 -翲 > piÄo; #7FF2 -翳 > yì; #7FF3 -ç¿´ > lián; #7FF4 -翵 > qú; #7FF5 -ç¿· > lín; #7FF7 -翸 > pÄ•n; #7FF8 -翹 > qiáo; #7FF9 -翺 > áo; #7FFA -ç¿» > fÄn; #7FFB -翼 > yì; #7FFC -翽 > hùi; #7FFD -翾 > xuÄn; #7FFE -ç¿¿ > dào; #7FFF -耀 > yào; #8000 -è€ > lăo; #8001 -考 > kăo; #8003 -耄 > mào; #8004 -者 > zhÄ•; #8005 -耆 > qí; #8006 -耇 > gÅu; #8007 -耈 > gÅu; #8008 -耉 > gÅu; #8009 -耊 > diè; #800A -耋 > diè; #800B -而 > ér; #800C -è€ > shuă; #800D -耎 > ruăn; #800E -è€ > ér; #800F -è€ > nài; #8010 -耑 > zhuÄn; #8011 -耒 > lÄ•i; #8012 -耓 > tÄ«ng; #8013 -耔 > zÄ­; #8014 -耕 > gÄ“ng; #8015 -耖 > chào; #8016 -耗 > hào; #8017 -耘 > yún; #8018 -耙 > pá; #8019 -耚 > pÄ«; #801A -耛 > chí; #801B -耜 > sì; #801C -è€ > chú; #801D -耞 > jiÄ; #801E -耟 > jù; #801F -耠 > hé; #8020 -耡 > chú; #8021 -耢 > lào; #8022 -耣 > lÅ­n; #8023 -耤 > jí; #8024 -耥 > tăng; #8025 -耦 > Åu; #8026 -耧 > lóu; #8027 -耨 > nòu; #8028 -耩 > gÅu; #8029 -耪 > păng; #802A -耫 > zé; #802B -耬 > lóu; #802C -耭 > jÄ«; #802D -耮 > lào; #802E -耯 > hùo; #802F -耰 > yÅu; #8030 -耱 > mò; #8031 -耲 > huái; #8032 -耳 > Ä•r; #8033 -耴 > zhé; #8034 -耵 > tÄ«ng; #8035 -耶 > yé; #8036 -耷 > dÄ; #8037 -耸 > sÅng; #8038 -耹 > qín; #8039 -耺 > yún; #803A -耻 > chÄ­; #803B -耼 > dÄn; #803C -耽 > dÄn; #803D -耾 > hóng; #803E -耿 > gÄ•ng; #803F -è€ > zhí; #8040 -è‚ > niè; #8042 -èƒ > dÄn; #8043 -è„ > zhÄ•n; #8044 -è… > chè; #8045 -è† > líng; #8046 -è‡ > zhÄ“ng; #8047 -èˆ > yÅu; #8048 -è‰ > wÄ; #8049 -èŠ > liáo; #804A -è‹ > lóng; #804B -èŒ > zhí; #804C -è > níng; #804D -èŽ > tiÄo; #804E -è > ér; #804F -è > yà; #8050 -è‘ > dié; #8051 -è’ > guÄ; #8052 -è” > lián; #8054 -è• > hào; #8055 -è– > shèng; #8056 -è— > liè; #8057 -è˜ > pìn; #8058 -è™ > jÄ«ng; #8059 -èš > jù; #805A -è› > bì; #805B -èœ > dÄ­; #805C -è > gúo; #805D -èž > wén; #805E -èŸ > xù; #805F -è  > píng; #8060 -è¡ > cÅng; #8061 -è¤ > tíng; #8064 -è¥ > yÅ­; #8065 -è¦ > cÅng; #8066 -è§ > kúi; #8067 -è© > kùi; #8069 -èª > cÅng; #806A -è« > lián; #806B -è¬ > wÄ•ng; #806C -è­ > kùi; #806D -è® > lián; #806E -è¯ > lián; #806F -è° > cÅng; #8070 -è± > áo; #8071 -è² > shÄ“ng; #8072 -è³ > sÅng; #8073 -è´ > tÄ«ng; #8074 -èµ > kùi; #8075 -è¶ > niè; #8076 -è· > zhí; #8077 -è¸ > dÄn; #8078 -è¹ > níng; #8079 -èº > qie; #807A -è» > jÄ«; #807B -è¼ > tÄ«ng; #807C -è½ > tÄ«ng; #807D -è¾ > lóng; #807E -è¿ > yù; #807F -è‚€ > yù; #8080 -è‚ > zhào; #8081 -è‚‚ > sì; #8082 -肃 > sù; #8083 -è‚„ > yì; #8084 -è‚… > sù; #8085 -肆 > sì; #8086 -肇 > zhào; #8087 -肈 > zhào; #8088 -肉 > ròu; #8089 -è‚Š > yì; #808A -è‚‹ > lè; #808B -è‚Œ > jÄ«; #808C -è‚ > qíu; #808D -è‚Ž > kÄ•n; #808E -è‚ > cào; #808F -è‚ > gÄ“; #8090 -è‚‘ > dì; #8091 -è‚’ > huán; #8092 -è‚“ > huÄng; #8093 -è‚” > yÄ­; #8094 -è‚• > rèn; #8095 -è‚– > xiào; #8096 -è‚— > rÅ­; #8097 -肘 > zhÅu; #8098 -è‚™ > yuÄn; #8099 -è‚š > dù; #809A -è‚› > gÄng; #809B -è‚œ > róng; #809C -è‚ > gÄn; #809D -è‚ž > chÄ; #809E -è‚Ÿ > wò; #809F -è‚  > cháng; #80A0 -è‚¡ > gÅ­; #80A1 -è‚¢ > zhÄ«; #80A2 -è‚£ > hán; #80A3 -肤 > fÅ«; #80A4 -è‚¥ > féi; #80A5 -肦 > fén; #80A6 -肧 > pÄ“i; #80A7 -肨 > pàng; #80A8 -è‚© > jiÄn; #80A9 -肪 > fáng; #80AA -è‚« > zhÅ«n; #80AB -肬 > yóu; #80AC -è‚­ > nà; #80AD -è‚® > háng; #80AE -肯 > kÄ•n; #80AF -è‚° > rán; #80B0 -肱 > gÅng; #80B1 -育 > yù; #80B2 -肳 > wÄ•n; #80B3 -è‚´ > yáo; #80B4 -肵 > jìn; #80B5 -肶 > pí; #80B6 -è‚· > qiÄn; #80B7 -肸 > xì; #80B8 -肹 > xÄ«; #80B9 -肺 > fèi; #80BA -è‚» > kÄ•n; #80BB -肼 > jÄ­ng; #80BC -肽 > tài; #80BD -肾 > shèn; #80BE -è‚¿ > zhÅng; #80BF -胀 > zhàng; #80C0 -èƒ > xié; #80C1 -胂 > shÄ“n; #80C2 -胃 > wèi; #80C3 -胄 > zhòu; #80C4 -胅 > dié; #80C5 -胆 > dăn; #80C6 -胇 > fèi; #80C7 -胈 > bá; #80C8 -胉 > bó; #80C9 -胊 > qú; #80CA -胋 > tián; #80CB -背 > bèi; #80CC -èƒ > guÄ; #80CD -胎 > tÄi; #80CE -èƒ > zÄ­; #80CF -èƒ > kÅ«; #80D0 -胑 > zhÄ«; #80D1 -胒 > nì; #80D2 -胓 > píng; #80D3 -胔 > zì; #80D4 -胕 > fù; #80D5 -胖 > pàng; #80D6 -胗 > zhÄ“n; #80D7 -胘 > xián; #80D8 -胙 > zùo; #80D9 -胚 > pÄ“i; #80DA -胛 > jiă; #80DB -胜 > shèng; #80DC -èƒ > zhÄ«; #80DD -胞 > bÄo; #80DE -胟 > mÅ­; #80DF -胠 > qÅ«; #80E0 -胡 > hú; #80E1 -胢 > kÄ“; #80E2 -胣 > yÄ­; #80E3 -胤 > yìn; #80E4 -胥 > xÅ«; #80E5 -胦 > yÄng; #80E6 -胧 > lóng; #80E7 -胨 > dòng; #80E8 -胩 > kă; #80E9 -胪 > lú; #80EA -胫 > jìng; #80EB -胬 > nÅ­; #80EC -胭 > yÄn; #80ED -胮 > páng; #80EE -胯 > kuà; #80EF -胰 > yí; #80F0 -胱 > guÄng; #80F1 -胲 > gÄi; #80F2 -胳 > gÄ“; #80F3 -胴 > dòng; #80F4 -胵 > zhì; #80F5 -胶 > xiáo; #80F6 -胷 > xÄ«ong; #80F7 -胸 > xÄ«ong; #80F8 -胹 > ér; #80F9 -胺 > è; #80FA -胻 > xíng; #80FB -胼 > pián; #80FC -能 > néng; #80FD -胾 > zì; #80FE -胿 > gui; #80FF -è„€ > chéng; #8100 -è„ > tiào; #8101 -è„‚ > zhÄ«; #8102 -脃 > cùi; #8103 -è„„ > méi; #8104 -è„… > xié; #8105 -脆 > cùi; #8106 -脇 > xié; #8107 -脈 > mò; #8108 -脉 > mài; #8109 -è„Š > jí; #810A -è„ > kuài; #810D -è„Ž > sà; #810E -è„ > zÄng; #810F -è„ > qí; #8110 -è„‘ > năo; #8111 -è„’ > mÄ­; #8112 -è„“ > nóng; #8113 -è„” > luán; #8114 -è„• > wăn; #8115 -è„– > bó; #8116 -è„— > wÄ•n; #8117 -脘 > guăn; #8118 -è„™ > qíu; #8119 -è„š > jiăo; #811A -è„› > jìng; #811B -è„œ > róu; #811C -è„ > hÄ“ng; #811D -è„ž > cÅ­o; #811E -è„Ÿ > liè; #811F -è„  > shÄn; #8120 -è„¡ > tÄ­ng; #8121 -è„¢ > méi; #8122 -è„£ > chún; #8123 -脤 > shèn; #8124 -è„¥ > xié; #8125 -脦 > de; #8126 -脧 > zÅ«i; #8127 -脨 > cù; #8128 -è„© > xÄ«u; #8129 -脪 > xìn; #812A -è„« > tÅ«o; #812B -脬 > pÄo; #812C -è„­ > chéng; #812D -è„® > nÄ•i; #812E -脯 > fÅ­; #812F -è„° > dòu; #8130 -脱 > tÅ«o; #8131 -脲 > niào; #8132 -è„´ > pÄ­; #8134 -脵 > gÅ­; #8135 -脶 > guÄ; #8136 -è„· > lì; #8137 -脸 > liăn; #8138 -脹 > zhàng; #8139 -脺 > cùi; #813A -è„» > jié; #813B -脼 > liăng; #813C -脽 > zhÅu; #813D -脾 > pí; #813E -è„¿ > biÄo; #813F -è…€ > lún; #8140 -è… > pián; #8141 -è…‚ > gùo; #8142 -è…ƒ > kùi; #8143 -è…„ > chúi; #8144 -è…… > dàn; #8145 -è…† > tiăn; #8146 -è…‡ > nÄ•i; #8147 -è…ˆ > jÄ«ng; #8148 -è…‰ > jiÄ“; #8149 -è…Š > là; #814A -è…‹ > yì; #814B -è…Œ > Än; #814C -è… > rÄ•n; #814D -è…Ž > shèn; #814E -è… > chùo; #814F -è… > fÅ­; #8150 -è…‘ > fÅ­; #8151 -è…’ > jÅ«; #8152 -è…“ > féi; #8153 -è…” > qiÄng; #8154 -è…• > wàn; #8155 -è…– > dòng; #8156 -è…— > pí; #8157 -è…˜ > gúo; #8158 -è…™ > zÅng; #8159 -è…š > dìng; #815A -è…› > wÅ«; #815B -è…œ > méi; #815C -è… > ruăn; #815D -è…ž > zhuàn; #815E -è…Ÿ > zhì; #815F -è…  > còu; #8160 -è…¡ > guÄ; #8161 -è…¢ > Åu; #8162 -è…£ > dì; #8163 -è…¤ > Än; #8164 -è…¥ > xÄ«ng; #8165 -è…¦ > năo; #8166 -è…§ > yú; #8167 -è…¨ > chuăn; #8168 -è…© > năn; #8169 -è…ª > yùn; #816A -è…« > zhÅng; #816B -è…¬ > róu; #816C -è…­ > è; #816D -è…® > sÄi; #816E -è…¯ > tú; #816F -è…° > yÄo; #8170 -è…± > jiàn; #8171 -è…² > wÄ•i; #8172 -è…³ > jiăo; #8173 -è…´ > yú; #8174 -è…µ > jiÄ; #8175 -è…¶ > duàn; #8176 -è…· > bì; #8177 -è…¸ > cháng; #8178 -è…¹ > fù; #8179 -è…º > xiàn; #817A -è…» > nì; #817B -è…¼ > miăn; #817C -è…½ > wà; #817D -è…¾ > téng; #817E -è…¿ > tÅ­i; #817F -膀 > băng; #8180 -è† > qiÄn; #8181 -膂 > lÇš; #8182 -膃 > wà; #8183 -膄 > sòu; #8184 -膅 > táng; #8185 -膆 > sù; #8186 -膇 > zhùi; #8187 -膈 > gé; #8188 -膉 > yì; #8189 -膊 > bó; #818A -膋 > liáo; #818B -膌 > jí; #818C -è† > pí; #818D -膎 > xié; #818E -è† > gÄo; #818F -è† > lÇš; #8190 -膑 > bìn; #8191 -膒 > ou; #8192 -膓 > cháng; #8193 -膔 > lù; #8194 -膕 > gúo; #8195 -膖 > pÄng; #8196 -膗 > chuái; #8197 -膘 > piăo; #8198 -膙 > jiăng; #8199 -膚 > fÅ«; #819A -膛 > táng; #819B -膜 > mò; #819C -è† > xÄ«; #819D -膞 > zhuÄn; #819E -膟 > lÇœ; #819F -膠 > jiÄo; #81A0 -膡 > yìng; #81A1 -膢 > lǘ; #81A2 -膣 > zhì; #81A3 -膥 > chÅ«n; #81A5 -膦 > liăn; #81A6 -膧 > tóng; #81A7 -膨 > péng; #81A8 -膩 > nì; #81A9 -膪 > zhà; #81AA -膫 > liáo; #81AB -膬 > cùi; #81AC -膭 > gÅ«i; #81AD -膮 > xiÄo; #81AE -膯 > tÄ“ng; #81AF -膰 > fán; #81B0 -膱 > zhí; #81B1 -膲 > jiÄo; #81B2 -膳 > shàn; #81B3 -膴 > wú; #81B4 -膵 > cùi; #81B5 -膶 > rùn; #81B6 -膷 > xiÄng; #81B7 -膸 > sÅ­i; #81B8 -膹 > fèn; #81B9 -膺 > yÄ«ng; #81BA -膻 > tăn; #81BB -膼 > zhuÄ; #81BC -膽 > dăn; #81BD -膾 > kuài; #81BE -膿 > nóng; #81BF -臀 > tún; #81C0 -è‡ > lián; #81C1 -臂 > bì; #81C2 -臃 > yÅng; #81C3 -臄 > jué; #81C4 -臅 > chù; #81C5 -臆 > yì; #81C6 -臇 > juăn; #81C7 -臈 > là; #81C8 -臉 > liăn; #81C9 -臊 > sÄo; #81CA -臋 > tún; #81CB -臌 > gÅ­; #81CC -è‡ > qí; #81CD -臎 > cùi; #81CE -è‡ > bìn; #81CF -è‡ > xÅ«n; #81D0 -臑 > rú; #81D1 -臒 > hùo; #81D2 -臓 > zàng; #81D3 -臔 > xiàn; #81D4 -臕 > biÄo; #81D5 -臖 > xìng; #81D6 -臗 > kuÄn; #81D7 -臘 > là; #81D8 -臙 > yÄn; #81D9 -臚 > lú; #81DA -臛 > hùo; #81DB -臜 > zÄng; #81DC -è‡ > lÅ­o; #81DD -臞 > qú; #81DE -臟 > zàng; #81DF -臠 > luán; #81E0 -臡 > ní; #81E1 -臢 > zÄng; #81E2 -臣 > chén; #81E3 -臤 > qiÄn; #81E4 -臥 > wò; #81E5 -臦 > guàng; #81E6 -臧 > záng; #81E7 -臨 > lín; #81E8 -臩 > guàng; #81E9 -自 > zì; #81EA -臫 > jiăo; #81EB -臬 > niè; #81EC -臭 > chòu; #81ED -臮 > jì; #81EE -臯 > gÄo; #81EF -臰 > chòu; #81F0 -臱 > mián; #81F1 -臲 > niè; #81F2 -至 > zhì; #81F3 -致 > zhì; #81F4 -臵 > gé; #81F5 -臶 > jiàn; #81F6 -臷 > dié; #81F7 -臸 > zhì; #81F8 -臹 > xÄ«u; #81F9 -臺 > tái; #81FA -臻 > zhÄ“n; #81FB -臼 > jìu; #81FC -臽 > xiàn; #81FD -臾 > yú; #81FE -臿 > chÄ; #81FF -舀 > yăo; #8200 -èˆ > yú; #8201 -舂 > chÅng; #8202 -舃 > xì; #8203 -舄 > xì; #8204 -舅 > jìu; #8205 -舆 > yú; #8206 -與 > yÅ­; #8207 -興 > xÄ«ng; #8208 -舉 > jÅ­; #8209 -舊 > jìu; #820A -舋 > xìn; #820B -舌 > shé; #820C -èˆ > shè; #820D -èˆ > jÄ­u; #820F -èˆ > shì; #8210 -舑 > tÄn; #8211 -舒 > shÅ«; #8212 -舓 > shì; #8213 -舔 > tiăn; #8214 -舕 > dàn; #8215 -舖 > pù; #8216 -舗 > pù; #8217 -舘 > guăn; #8218 -舙 > huà; #8219 -舚 > tÄn; #821A -舛 > chuăn; #821B -舜 > shùn; #821C -èˆ > xiá; #821D -舞 > wÅ­; #821E -舟 > zhÅu; #821F -舠 > dÄo; #8220 -舡 > gÄng; #8221 -舢 > shÄn; #8222 -舣 > yÄ­; #8223 -舥 > pÄ; #8225 -舦 > tài; #8226 -舧 > fán; #8227 -舨 > băn; #8228 -舩 > chuán; #8229 -航 > háng; #822A -舫 > făng; #822B -般 > bÄn; #822C -舭 > què; #822D -舯 > zhÅng; #822F -舰 > jiàn; #8230 -舱 > cÄng; #8231 -舲 > líng; #8232 -舳 > zhú; #8233 -舴 > zé; #8234 -舵 > dùo; #8235 -舶 > bó; #8236 -舷 > xián; #8237 -舸 > gÄ•; #8238 -船 > chuán; #8239 -舺 > jiá; #823A -舻 > lÅ­; #823B -舼 > hóng; #823C -舽 > páng; #823D -舾 > xÄ«; #823E -艀 > fú; #8240 -è‰ > zào; #8241 -艂 > féng; #8242 -艃 > lí; #8243 -艄 > shÄo; #8244 -艅 > yú; #8245 -艆 > láng; #8246 -艇 > tÄ­ng; #8247 -艉 > wÄ•i; #8249 -艊 > bó; #824A -艋 > mÄ•ng; #824B -艌 > niàn; #824C -è‰ > jÅ«; #824D -艎 > huáng; #824E -è‰ > shÅu; #824F -è‰ > zÅng; #8250 -艑 > biàn; #8251 -艒 > mào; #8252 -艓 > dié; #8253 -艕 > bàng; #8255 -艖 > chÄ; #8256 -艗 > yì; #8257 -艘 > sÄo; #8258 -艙 > cÄng; #8259 -艚 > cáo; #825A -艛 > lóu; #825B -艜 > dài; #825C -艞 > yào; #825E -艟 > tóng; #825F -艡 > dÄng; #8261 -艢 > tán; #8262 -艣 > lÅ­; #8263 -艤 > yÄ­; #8264 -艥 > jiè; #8265 -艦 > jiàn; #8266 -艧 > hùo; #8267 -艨 > méng; #8268 -艩 > qí; #8269 -艪 > lÅ­; #826A -艫 > lú; #826B -艬 > chán; #826C -艭 > shuÄng; #826D -艮 > gèn; #826E -良 > liáng; #826F -艰 > jiÄn; #8270 -艱 > jiÄn; #8271 -色 > sè; #8272 -艳 > yàn; #8273 -艴 > fú; #8274 -艵 > píng; #8275 -艶 > yàn; #8276 -艷 > yàn; #8277 -艸 > căo; #8278 -艹 > căo' 'zì' 'tóu; #8279 -艺 > yì; #827A -艻 > lè; #827B -艼 > tÄ«ng; #827C -艽 > qíu; #827D -艾 > ài; #827E -艿 > năi; #827F -芀 > tiáo; #8280 -èŠ > jiÄo; #8281 -节 > jié; #8282 -芃 > péng; #8283 -芄 > wán; #8284 -芅 > yì; #8285 -芆 > chÄi; #8286 -芇 > mián; #8287 -芈 > miÄ“; #8288 -芉 > gÄn; #8289 -芊 > qiÄn; #828A -芋 > yù; #828B -芌 > yù; #828C -èŠ > shùo; #828D -芎 > qÄ«ong; #828E -èŠ > tÅ­; #828F -èŠ > xià; #8290 -芑 > qÄ­; #8291 -芒 > máng; #8292 -芓 > zÄ­; #8293 -芔 > hÅ­i; #8294 -芕 > sÅ«i; #8295 -芖 > zhì; #8296 -芗 > xiÄng; #8297 -芘 > bÄ«; #8298 -芙 > fú; #8299 -芚 > tún; #829A -芛 > wÄ•i; #829B -芜 > wú; #829C -èŠ > zhÄ«; #829D -芞 > qÄ­; #829E -芟 > shÄn; #829F -芠 > wén; #82A0 -芡 > qiàn; #82A1 -芢 > rén; #82A2 -芣 > fÅu; #82A3 -芤 > kÅu; #82A4 -芥 > jiè; #82A5 -芦 > lú; #82A6 -芧 > xù; #82A7 -芨 > jí; #82A8 -芩 > qín; #82A9 -芪 > qí; #82AA -芫 > yuán; #82AB -芬 > fÄ“n; #82AC -芭 > bÄ; #82AD -芮 > rùi; #82AE -芯 > xÄ«n; #82AF -芰 > jì; #82B0 -花 > huÄ; #82B1 -芲 > huÄ; #82B2 -芳 > fÄng; #82B3 -芴 > wù; #82B4 -芵 > jué; #82B5 -芶 > gÅu; #82B6 -芷 > zhÄ­; #82B7 -芸 > yún; #82B8 -芹 > qín; #82B9 -芺 > ăo; #82BA -芻 > chú; #82BB -芼 > mào; #82BC -芽 > yá; #82BD -芾 > fèi; #82BE -芿 > rèng; #82BF -è‹€ > háng; #82C0 -è‹ > cÅng; #82C1 -è‹‚ > yín; #82C2 -苃 > yÅu; #82C3 -è‹„ > biàn; #82C4 -è‹… > yì; #82C5 -苇 > wÄ•i; #82C7 -苈 > lì; #82C8 -苉 > pÄ­; #82C9 -è‹Š > è; #82CA -è‹‹ > xiàn; #82CB -è‹Œ > cháng; #82CC -è‹ > cÄng; #82CD -è‹Ž > méng; #82CE -è‹ > sÅ«; #82CF -è‹ > yí; #82D0 -è‹‘ > yuàn; #82D1 -è‹’ > răn; #82D2 -è‹“ > líng; #82D3 -è‹” > tái; #82D4 -è‹• > tiáo; #82D5 -è‹– > dÄ­; #82D6 -è‹— > miáo; #82D7 -苘 > qÄ­ong; #82D8 -è‹™ > lì; #82D9 -è‹š > yòng; #82DA -è‹› > kÄ“; #82DB -è‹œ > mù; #82DC -è‹ > pèi; #82DD -è‹ž > bÄo; #82DE -è‹Ÿ > gÅu; #82DF -è‹  > mín; #82E0 -è‹¡ > yÄ­; #82E1 -è‹¢ > yÄ­; #82E2 -è‹£ > jù; #82E3 -苤 > pÄ­; #82E4 -è‹¥ > rùo; #82E5 -苦 > kÅ­; #82E6 -苧 > zhù; #82E7 -苨 > nÄ­; #82E8 -è‹© > bó; #82E9 -苪 > bÄ­ng; #82EA -è‹« > shÄn; #82EB -苬 > qíu; #82EC -è‹­ > yăo; #82ED -è‹® > xiÄn; #82EE -苯 > bÄ•n; #82EF -è‹° > hóng; #82F0 -英 > yÄ«ng; #82F1 -苲 > zhă; #82F2 -苳 > dÅng; #82F3 -è‹´ > jÅ«; #82F4 -苵 > dié; #82F5 -苶 > nié; #82F6 -è‹· > gÄn; #82F7 -苸 > hÅ«; #82F8 -苹 > píng; #82F9 -苺 > méi; #82FA -è‹» > fú; #82FB -苼 > shÄ“ng; #82FC -苽 > gÅ«; #82FD -苾 > bì; #82FE -è‹¿ > wèi; #82FF -茀 > fú; #8300 -èŒ > zhúo; #8301 -茂 > mào; #8302 -范 > fàn; #8303 -茄 > qié; #8304 -茅 > máo; #8305 -茆 > măo; #8306 -茇 > bá; #8307 -茈 > zÄ­; #8308 -茉 > mò; #8309 -茊 > zÄ«; #830A -茋 > dÄ­; #830B -茌 > chí; #830C -èŒ > jì; #830D -茎 > jÄ«ng; #830E -èŒ > lóng; #830F -茑 > niăo; #8311 -茓 > xué; #8313 -茔 > yíng; #8314 -茕 > qíong; #8315 -茖 > gé; #8316 -茗 > mÄ­ng; #8317 -茘 > lì; #8318 -茙 > róng; #8319 -茚 > yìn; #831A -茛 > gèn; #831B -茜 > qiàn; #831C -èŒ > chăi; #831D -茞 > chén; #831E -茟 > yù; #831F -茠 > xÄ«u; #8320 -茡 > zì; #8321 -茢 > liè; #8322 -茣 > wú; #8323 -茤 > jì; #8324 -茥 > kÅ«i; #8325 -茦 > cè; #8326 -茧 > chóng; #8327 -茨 > cí; #8328 -茩 > gÅu; #8329 -茪 > guÄng; #832A -茫 > máng; #832B -茬 > chí; #832C -茭 > jiÄo; #832D -茮 > jiÄo; #832E -茯 > fú; #832F -茰 > yú; #8330 -茱 > zhÅ«; #8331 -茲 > zÄ«; #8332 -茳 > jiÄng; #8333 -茴 > húi; #8334 -茵 > yÄ«n; #8335 -茶 > chá; #8336 -茷 > fá; #8337 -茸 > róng; #8338 -茹 > rú; #8339 -茺 > chÅng; #833A -茻 > măng; #833B -茼 > tóng; #833C -茽 > zhòng; #833D -茿 > zhú; #833F -è€ > xún; #8340 -è > huán; #8341 -è‚ > kuÄ; #8342 -èƒ > quán; #8343 -è„ > gÄi; #8344 -è… > dÄ; #8345 -è† > jÄ«ng; #8346 -è‡ > xìng; #8347 -èˆ > quàn; #8348 -è‰ > căo; #8349 -èŠ > jÄ«ng; #834A -è‹ > ér; #834B -èŒ > àn; #834C -è > shÅu; #834D -èŽ > chí; #834E -è > rÄ•n; #834F -è > jiàn; #8350 -è‘ > tí; #8351 -è’ > huÄng; #8352 -è“ > píng; #8353 -è” > lì; #8354 -è• > jÄ«n; #8355 -è– > lăo; #8356 -è— > shù; #8357 -è˜ > zhuÄng; #8358 -è™ > dá; #8359 -èš > jiá; #835A -è› > ráo; #835B -èœ > bì; #835C -è > zé; #835D -èž > qiáo; #835E -èŸ > hùi; #835F -è  > qí; #8360 -è¡ > dàng; #8361 -è£ > róng; #8363 -è¤ > hÅ«n; #8364 -è¥ > yíng; #8365 -è¦ > lùo; #8366 -è§ > yíng; #8367 -è¨ > xún; #8368 -è© > jìn; #8369 -èª > sÅ«n; #836A -è« > yìn; #836B -è¬ > măi; #836C -è­ > hóng; #836D -è® > zhòu; #836E -è¯ > yào; #836F -è° > dù; #8370 -è± > wÄ•i; #8371 -è² > chù; #8372 -è³ > dòu; #8373 -è´ > fÅ«; #8374 -èµ > rÄ•n; #8375 -è¶ > yín; #8376 -è· > hé; #8377 -è¸ > bí; #8378 -è¹ > bù; #8379 -èº > yún; #837A -è» > dí; #837B -è¼ > tú; #837C -è½ > sÅ«i; #837D -è¾ > sÅ«i; #837E -è¿ > chéng; #837F -莀 > chén; #8380 -èŽ > wú; #8381 -莂 > bié; #8382 -莃 > xÄ«; #8383 -莄 > gÄ•ng; #8384 -莅 > lì; #8385 -莆 > fÅ­; #8386 -莇 > zhù; #8387 -莈 > mò; #8388 -莉 > lì; #8389 -莊 > zhuÄng; #838A -莋 > jí; #838B -莌 > dúo; #838C -èŽ > qíu; #838D -莎 > shÄ; #838E -èŽ > sÅ«o; #838F -èŽ > chén; #8390 -莑 > fÄ“ng; #8391 -莒 > jÅ­; #8392 -莓 > méi; #8393 -莔 > méng; #8394 -莕 > xìng; #8395 -莖 > jÄ«ng; #8396 -莗 > chÄ“; #8397 -莘 > xÄ«n; #8398 -莙 > jÅ«n; #8399 -莚 > yán; #839A -莛 > tíng; #839B -莜 > diào; #839C -èŽ > cùo; #839D -莞 > wăn; #839E -莟 > hàn; #839F -莠 > yÅu; #83A0 -莡 > cùo; #83A1 -莢 > jiá; #83A2 -莣 > wáng; #83A3 -莤 > yóu; #83A4 -莥 > nÄ­u; #83A5 -莦 > shÄo; #83A6 -莧 > xiàn; #83A7 -莨 > láng; #83A8 -莩 > fú; #83A9 -莪 > é; #83AA -莫 > mò; #83AB -莬 > wèn; #83AC -莭 > jié; #83AD -莮 > nán; #83AE -莯 > mù; #83AF -莰 > kăn; #83B0 -莱 > lái; #83B1 -莲 > lián; #83B2 -莳 > shí; #83B3 -莴 > wÅ; #83B4 -莶 > liăn; #83B6 -获 > hùo; #83B7 -莸 > yóu; #83B8 -莹 > yíng; #83B9 -莺 > yÄ«ng; #83BA -莼 > chún; #83BC -莽 > măng; #83BD -莾 > măng; #83BE -莿 > cì; #83BF -è€ > wăn; #83C0 -è > jÄ«ng; #83C1 -è‚ > dÄ«; #83C2 -èƒ > qú; #83C3 -è„ > dÅng; #83C4 -è… > jiÄn; #83C5 -è† > zÅu; #83C6 -è‡ > gÅ«; #83C7 -èˆ > lÄ; #83C8 -è‰ > lù; #83C9 -èŠ > jú; #83CA -è‹ > wèi; #83CB -èŒ > jùn; #83CC -è > niè; #83CD -èŽ > kÅ«n; #83CE -è > hé; #83CF -è > pú; #83D0 -è‘ > zÄ«; #83D1 -è’ > găo; #83D2 -è“ > gÅ­o; #83D3 -è” > fú; #83D4 -è• > lún; #83D5 -è– > chÄng; #83D6 -è— > chóu; #83D7 -è˜ > sÅng; #83D8 -è™ > chúi; #83D9 -èš > zhàn; #83DA -è› > mén; #83DB -èœ > cài; #83DC -è > bá; #83DD -èž > lí; #83DE -èŸ > tù; #83DF -è  > bÅ; #83E0 -è¡ > hàn; #83E1 -è¢ > bào; #83E2 -è£ > qìn; #83E3 -è¤ > juăn; #83E4 -è¥ > xÄ«; #83E5 -è¦ > qín; #83E6 -è§ > dÄ­; #83E7 -è¨ > jiÄ“; #83E8 -è© > pú; #83E9 -èª > dàng; #83EA -è« > jÄ­n; #83EB -è¬ > zhăo; #83EC -è­ > tái; #83ED -è® > gÄ“ng; #83EE -è¯ > huá; #83EF -è° > gÅ«; #83F0 -è± > líng; #83F1 -è² > fÄ“i; #83F2 -è³ > jÄ«n; #83F3 -è´ > Än; #83F4 -èµ > wăng; #83F5 -è¶ > bÄ•ng; #83F6 -è· > zhÅu; #83F7 -è¸ > yÄn; #83F8 -è¹ > jÅ«; #83F9 -èº > jiÄn; #83FA -è» > lÄ­n; #83FB -è¼ > tăn; #83FC -è½ > shú; #83FD -è¾ > tián; #83FE -è¿ > dào; #83FF -è€ > hÅ­; #8400 -è > qí; #8401 -è‚ > hé; #8402 -èƒ > cùi; #8403 -è„ > táo; #8404 -è… > chÅ«n; #8405 -è† > bÄ“i; #8406 -è‡ > cháng; #8407 -èˆ > huán; #8408 -è‰ > féi; #8409 -èŠ > lái; #840A -è‹ > qÄ«; #840B -èŒ > méng; #840C -è > píng; #840D -èŽ > wÄ“i; #840E -è > dàn; #840F -è > shà; #8410 -è‘ > huán; #8411 -è’ > yăn; #8412 -è“ > yí; #8413 -è” > tiáo; #8414 -è• > qí; #8415 -è– > wăn; #8416 -è— > cè; #8417 -è˜ > nài; #8418 -èš > tùo; #841A -è› > jÄ«u; #841B -èœ > tiÄ“; #841C -è > lúo; #841D -è  > méng; #8420 -è¤ > yíng; #8424 -è¥ > yíng; #8425 -è¦ > yíng; #8426 -è§ > xiÄo; #8427 -è¨ > sà; #8428 -è© > qÄ«u; #8429 -èª > kÄ“; #842A -è« > xiàng; #842B -è¬ > wàn; #842C -è­ > yÅ­; #842D -è® > yù; #842E -è¯ > fù; #842F -è° > liàn; #8430 -è± > xuÄn; #8431 -è² > yuán; #8432 -è³ > nán; #8433 -è´ > zé; #8434 -èµ > wÅ; #8435 -è¶ > chÅ­n; #8436 -è· > xiÄo; #8437 -è¸ > yú; #8438 -è¹ > piÄn; #8439 -èº > mào; #843A -è» > Än; #843B -è¼ > è; #843C -è½ > lùo; #843D -è¾ > yíng; #843E -è¿ > húo; #843F -è‘€ > guÄ; #8440 -è‘ > jiÄng; #8441 -è‘‚ > miăn; #8442 -葃 > zúo; #8443 -è‘„ > zùo; #8444 -è‘… > jÅ«; #8445 -葆 > băo; #8446 -葇 > róu; #8447 -葈 > xÄ­; #8448 -葉 > xié; #8449 -è‘Š > Än; #844A -è‘‹ > qú; #844B -è‘Œ > jiÄn; #844C -è‘ > fú; #844D -è‘Ž > lÇœ; #844E -è‘ > jÄ«ng; #844F -è‘ > pén; #8450 -è‘‘ > fÄ“ng; #8451 -è‘’ > hóng; #8452 -è‘“ > hóng; #8453 -è‘” > hóu; #8454 -è‘• > yán; #8455 -è‘– > tú; #8456 -è‘— > zhù; #8457 -葘 > zÄ«; #8458 -è‘™ > xiÄng; #8459 -è‘š > shèn; #845A -è‘› > gÄ•; #845B -è‘œ > jié; #845C -è‘ > jìng; #845D -è‘ž > mÄ­; #845E -è‘Ÿ > huáng; #845F -è‘  > shÄ“n; #8460 -è‘¡ > pú; #8461 -è‘¢ > gài; #8462 -è‘£ > dÅng; #8463 -葤 > zhòu; #8464 -è‘¥ > qián; #8465 -葦 > wÄ•i; #8466 -葧 > bó; #8467 -葨 > wÄ“i; #8468 -è‘© > pÄ; #8469 -葪 > jì; #846A -è‘« > hú; #846B -葬 > zàng; #846C -è‘­ > jiÄ; #846D -è‘® > duàn; #846E -葯 > yào; #846F -è‘° > jùn; #8470 -葱 > cÅng; #8471 -葲 > quán; #8472 -葳 > wÄ“i; #8473 -è‘´ > xián; #8474 -葵 > kúi; #8475 -葶 > tíng; #8476 -è‘· > hÅ«n; #8477 -葸 > xÄ­; #8478 -葹 > shÄ«; #8479 -葺 > qì; #847A -è‘» > lán; #847B -葼 > zÅng; #847C -葽 > yÄo; #847D -葾 > yuÄn; #847E -è‘¿ > méi; #847F -è’€ > yÅ«n; #8480 -è’ > shù; #8481 -è’‚ > dì; #8482 -è’ƒ > zhuàn; #8483 -è’„ > guÄn; #8484 -è’† > xuÄ“; #8486 -è’‡ > chăn; #8487 -è’ˆ > kăi; #8488 -è’‰ > kùi; #8489 -è’‹ > jiăng; #848B -è’Œ > lóu; #848C -è’ > wéi; #848D -è’Ž > pài; #848E -è’ > sÅu; #8490 -è’‘ > yÄ«n; #8491 -è’’ > shÄ«; #8492 -è’“ > chún; #8493 -è’” > shí; #8494 -è’• > yÅ«n; #8495 -è’– > zhÄ“n; #8496 -è’— > làng; #8497 -è’˜ > nú; #8498 -è’™ > méng; #8499 -è’š > hé; #849A -è’› > quÄ“; #849B -è’œ > suàn; #849C -è’ > yuán; #849D -è’ž > lì; #849E -è’Ÿ > jÅ­; #849F -è’  > xí; #84A0 -è’¡ > páng; #84A1 -è’¢ > chú; #84A2 -è’£ > xú; #84A3 -è’¤ > tú; #84A4 -è’¥ > líu; #84A5 -è’¦ > wò; #84A6 -è’§ > zhÄ“n; #84A7 -è’¨ > qiàn; #84A8 -è’© > zÅ«; #84A9 -è’ª > pò; #84AA -è’« > cÅ«o; #84AB -è’¬ > yuÄn; #84AC -è’­ > chú; #84AD -è’® > yù; #84AE -è’¯ > kuăi; #84AF -è’° > pán; #84B0 -è’± > pú; #84B1 -è’² > pú; #84B2 -è’³ > nà; #84B3 -è’´ > shùo; #84B4 -è’µ > xÄ«; #84B5 -è’¶ > fén; #84B6 -è’· > yún; #84B7 -è’¸ > zhÄ“ng; #84B8 -è’¹ > jiÄn; #84B9 -è’º > jí; #84BA -è’» > rùo; #84BB -è’¼ > cÄng; #84BC -è’½ > Ä“n; #84BD -è’¾ > mí; #84BE -è’¿ > hÄo; #84BF -è“€ > sÅ«n; #84C0 -è“ > zhÄ“n; #84C1 -è“‚ > míng; #84C2 -蓃 > sou; #84C3 -è“„ > xù; #84C4 -è“… > líu; #84C5 -蓆 > xí; #84C6 -蓇 > gÅ­; #84C7 -蓈 > láng; #84C8 -蓉 > róng; #84C9 -è“Š > wÄ•ng; #84CA -è“‹ > gài; #84CB -è“Œ > cùo; #84CC -è“ > shÄ«; #84CD -è“Ž > táng; #84CE -è“ > lÅ­o; #84CF -è“ > rù; #84D0 -è“‘ > sÅ«o; #84D1 -è“’ > xiÄn; #84D2 -è““ > bèi; #84D3 -è“” > yăo; #84D4 -è“• > gùi; #84D5 -è“– > bÄ«; #84D6 -è“— > zÅng; #84D7 -蓘 > gÅ­n; #84D8 -è“š > xÄ«u; #84DA -è“› > cè; #84DB -è“ > lán; #84DD -è“Ÿ > jì; #84DF -è“  > lí; #84E0 -è“¡ > cÄn; #84E1 -è“¢ > láng; #84E2 -è“£ > yù; #84E3 -è“¥ > yìng; #84E5 -蓦 > mò; #84E6 -蓧 > diào; #84E7 -蓨 > tiÄo; #84E8 -è“© > mào; #84E9 -蓪 > tÅng; #84EA -è“« > zhú; #84EB -蓬 > péng; #84EC -è“­ > Än; #84ED -è“® > lián; #84EE -蓯 > cÅng; #84EF -è“° > xÄ­; #84F0 -蓱 > píng; #84F1 -蓲 > qÄ«u; #84F2 -蓳 > jìn; #84F3 -è“´ > chún; #84F4 -蓵 > jié; #84F5 -蓶 > wÄ•i; #84F6 -è“· > tÅ«i; #84F7 -蓸 > cáo; #84F8 -蓹 > yÅ­; #84F9 -蓺 > yì; #84FA -è“» > jí; #84FB -蓼 > liăo; #84FC -蓽 > bì; #84FD -蓾 > lÅ­; #84FE -è“¿ > sù; #84FF -蔀 > bù; #8500 -è” > zhÄng; #8501 -蔂 > lúo; #8502 -蔃 > jiàng; #8503 -蔄 > màn; #8504 -è”… > yán; #8505 -蔆 > líng; #8506 -蔇 > jì; #8507 -蔈 > piăo; #8508 -蔉 > gÅ­n; #8509 -蔊 > hăn; #850A -蔋 > dí; #850B -蔌 > sù; #850C -è” > lù; #850D -蔎 > shè; #850E -è” > shÄng; #850F -è” > dí; #8510 -蔑 > miè; #8511 -è”’ > xÅ«n; #8512 -蔓 > màn; #8513 -è”” > bó; #8514 -蔕 > dì; #8515 -è”– > cúo; #8516 -è”— > zhè; #8517 -蔘 > sÄ“n; #8518 -è”™ > xuàn; #8519 -蔚 > wèi; #851A -è”› > hú; #851B -蔜 > áo; #851C -è” > mÄ­; #851D -蔞 > lóu; #851E -蔟 > cù; #851F -è”  > zhÅng; #8520 -蔡 > cài; #8521 -蔢 > pó; #8522 -蔣 > jiăng; #8523 -蔤 > mì; #8524 -蔥 > cÅng; #8525 -蔦 > niăo; #8526 -蔧 > hùi; #8527 -蔨 > jùn; #8528 -蔩 > yín; #8529 -蔪 > jiàn; #852A -蔫 > yÄn; #852B -蔬 > shÅ«; #852C -è”­ > yìn; #852D -è”® > kùi; #852E -蔯 > chén; #852F -è”° > hù; #8530 -è”± > shÄ; #8531 -蔲 > kòu; #8532 -蔳 > qiàn; #8533 -è”´ > má; #8534 -蔵 > zÄng; #8535 -è”· > qiáng; #8537 -蔸 > dÅu; #8538 -蔹 > liàn; #8539 -蔺 > lìn; #853A -è”» > kòu; #853B -蔼 > ăi; #853C -蔽 > bì; #853D -蔾 > lí; #853E -蔿 > wéi; #853F -è•€ > jí; #8540 -è• > xún; #8541 -è•‚ > shèng; #8542 -蕃 > fán; #8543 -è•„ > méng; #8544 -è•… > Åu; #8545 -蕆 > chăn; #8546 -蕇 > diăn; #8547 -蕈 > xùn; #8548 -蕉 > jiÄo; #8549 -è•Š > rÅ­i; #854A -è•‹ > rÅ­i; #854B -è•Œ > lÄ•i; #854C -è• > yú; #854D -è•Ž > qiáo; #854E -è• > chú; #854F -è• > huá; #8550 -è•‘ > jiÄn; #8551 -è•’ > măi; #8552 -è•“ > yún; #8553 -è•” > bÄo; #8554 -è•• > yóu; #8555 -è•– > qú; #8556 -è•— > lù; #8557 -蕘 > ráo; #8558 -è•™ > hùi; #8559 -è•š > è; #855A -è•› > téng; #855B -è•œ > fÄ•i; #855C -è• > jué; #855D -è•ž > zùi; #855E -è•Ÿ > fà; #855F -è•  > rú; #8560 -è•¡ > fén; #8561 -è•¢ > kùi; #8562 -è•£ > shùn; #8563 -蕤 > rúi; #8564 -è•¥ > yă; #8565 -蕦 > xÅ«; #8566 -蕧 > fù; #8567 -蕨 > jué; #8568 -è•© > dàng; #8569 -蕪 > wú; #856A -è•« > tóng; #856B -蕬 > sÄ«; #856C -è•­ > xiÄo; #856D -è•® > xì; #856E -蕯 > lóng; #856F -è•° > yùn; #8570 -蕲 > qí; #8572 -蕳 > jiÄn; #8573 -è•´ > yùn; #8574 -蕵 > sÅ«n; #8575 -蕶 > líng; #8576 -è•· > yù; #8577 -蕸 > xiá; #8578 -蕹 > yÅng; #8579 -蕺 > jí; #857A -è•» > hòng; #857B -蕼 > sì; #857C -蕽 > nóng; #857D -蕾 > lÄ•i; #857E -è•¿ > xuÄn; #857F -è–€ > yùn; #8580 -è– > yù; #8581 -è–‚ > xí; #8582 -è–ƒ > hào; #8583 -è–„ > bó; #8584 -è–… > hÄo; #8585 -è–† > ài; #8586 -è–‡ > wéi; #8587 -è–ˆ > hùi; #8588 -è–‰ > wèi; #8589 -è–Š > jì; #858A -è–‹ > cÄ«; #858B -è–Œ > xiÄng; #858C -è– > luàn; #858D -è–Ž > miè; #858E -è– > yì; #858F -è– > léng; #8590 -è–‘ > jiÄng; #8591 -è–’ > càn; #8592 -è–“ > shÄ“n; #8593 -è–” > qiáng; #8594 -è–• > lián; #8595 -è–– > kÄ“; #8596 -è–— > yuán; #8597 -è–˜ > dá; #8598 -è–™ > tì; #8599 -è–š > táng; #859A -è–› > xiÄ“; #859B -è–œ > bì; #859C -è– > zhán; #859D -è–ž > sÅ«n; #859E -è–Ÿ > liăn; #859F -è–  > fán; #85A0 -è–¡ > dÄ­ng; #85A1 -è–¢ > jiÄ“; #85A2 -è–£ > gÅ­; #85A3 -è–¤ > xiè; #85A4 -è–¥ > shÅ­; #85A5 -è–¦ > jiàn; #85A6 -è–§ > kăo; #85A7 -è–¨ > hÅng; #85A8 -è–© > sà; #85A9 -è–ª > xÄ«n; #85AA -è–« > xÅ«n; #85AB -è–¬ > yào; #85AC -è–® > sÅu; #85AE -è–¯ > shÅ­; #85AF -è–° > xÅ«n; #85B0 -è–± > dùi; #85B1 -è–² > pín; #85B2 -è–³ > wÄ•i; #85B3 -è–´ > néng; #85B4 -è–µ > chóu; #85B5 -è–¶ > mái; #85B6 -è–· > rú; #85B7 -è–¸ > piÄo; #85B8 -è–¹ > tái; #85B9 -è–º > qí; #85BA -è–» > zăo; #85BB -è–¼ > chén; #85BC -è–½ > zhÄ“n; #85BD -è–¾ > Ä•r; #85BE -è–¿ > nÄ­; #85BF -è—€ > yíng; #85C0 -è— > găo; #85C1 -è—‚ > còng; #85C2 -è—ƒ > xiÄo; #85C3 -è—„ > qí; #85C4 -è—… > fá; #85C5 -è—† > jiăn; #85C6 -è—‡ > xù; #85C7 -è—ˆ > kÅ«i; #85C8 -è—‰ > jiè; #85C9 -è—Š > biăn; #85CA -è—‹ > diào; #85CB -è—Œ > mì; #85CC -è— > lán; #85CD -è—Ž > jìn; #85CE -è— > cáng; #85CF -è— > miăo; #85D0 -è—‘ > qíong; #85D1 -è—’ > qiè; #85D2 -è—“ > xiăn; #85D3 -è—• > Åu; #85D5 -è—– > xián; #85D6 -è—— > sù; #85D7 -è—˜ > lǘ; #85D8 -è—™ > yì; #85D9 -è—š > xù; #85DA -è—› > xiÄ•; #85DB -è—œ > lí; #85DC -è— > yì; #85DD -è—ž > lă; #85DE -è—Ÿ > lÄ•i; #85DF -è—  > xiào; #85E0 -è—¡ > dí; #85E1 -è—¢ > zhÄ­; #85E2 -è—£ > bÄ“i; #85E3 -è—¤ > téng; #85E4 -è—¥ > yào; #85E5 -è—¦ > mò; #85E6 -è—§ > huăn; #85E7 -è—¨ > piăo; #85E8 -è—© > fán; #85E9 -è—ª > sÅu; #85EA -è—« > tán; #85EB -è—¬ > tÅ«i; #85EC -è—­ > qíong; #85ED -è—® > qiáo; #85EE -è—¯ > wèi; #85EF -è—° > líu; #85F0 -è—± > hùi; #85F1 -è—³ > găo; #85F3 -è—´ > yùn; #85F4 -è—¶ > lì; #85F6 -è—· > shÅ­; #85F7 -è—¸ > chú; #85F8 -è—¹ > ăi; #85F9 -è—º > lìn; #85FA -è—» > zăo; #85FB -è—¼ > xuÄn; #85FC -è—½ > chèn; #85FD -è—¾ > lài; #85FE -è—¿ > hùo; #85FF -蘀 > tùo; #8600 -è˜ > wù; #8601 -蘂 > rÅ­i; #8602 -蘃 > rÅ­i; #8603 -蘄 > qí; #8604 -蘅 > héng; #8605 -蘆 > lú; #8606 -蘇 > sÅ«; #8607 -蘈 > túi; #8608 -蘉 > máng; #8609 -蘊 > yùn; #860A -蘋 > pín; #860B -蘌 > yÅ­; #860C -è˜ > xÅ«n; #860D -蘎 > jì; #860E -è˜ > jÄ«ong; #860F -è˜ > xiÄn; #8610 -蘑 > mó; #8611 -蘓 > sÅ«; #8613 -蘔 > jÄ«ong; #8614 -蘖 > niè; #8616 -蘗 > bò; #8617 -蘘 > ráng; #8618 -蘙 > yì; #8619 -蘚 > xiăn; #861A -蘛 > yú; #861B -蘜 > jú; #861C -è˜ > liàn; #861D -蘞 > liàn; #861E -蘟 > yÄ­n; #861F -蘠 > qiáng; #8620 -蘡 > yÄ«ng; #8621 -蘢 > lóng; #8622 -蘣 > tòng; #8623 -蘤 > wÄ•i; #8624 -蘥 > yuè; #8625 -蘦 > líng; #8626 -蘧 > qú; #8627 -蘨 > yáo; #8628 -蘩 > fán; #8629 -蘪 > mí; #862A -蘫 > lán; #862B -蘬 > kÅ«i; #862C -蘭 > lán; #862D -蘮 > jì; #862E -蘯 > dàng; #862F -蘱 > lèi; #8631 -蘲 > léi; #8632 -蘳 > huă; #8633 -蘴 > fÄ“ng; #8634 -蘵 > zhí; #8635 -蘶 > wèi; #8636 -蘷 > kúi; #8637 -蘸 > zhàn; #8638 -蘹 > huài; #8639 -蘺 > lí; #863A -蘻 > jì; #863B -蘼 > mí; #863C -蘽 > lÄ•i; #863D -蘾 > huài; #863E -蘿 > lúo; #863F -虀 > jÄ«; #8640 -è™ > kúi; #8641 -虂 > lù; #8642 -虃 > jiÄn; #8643 -虆 > léi; #8646 -虇 > quăn; #8647 -虈 > xiÄo; #8648 -虉 > yì; #8649 -虊 > luán; #864A -虋 > mén; #864B -虌 > biÄ“; #864C -è™ > hÅ«; #864D -虎 > hÅ­; #864E -è™ > lÅ­; #864F -è™ > nÇœe; #8650 -虑 > lÇœ; #8651 -è™’ > sÄ«; #8652 -虓 > xiÄo; #8653 -è™” > qián; #8654 -處 > chù; #8655 -è™– > hÅ«; #8656 -è™— > xÅ«; #8657 -虘 > cúo; #8658 -è™™ > fú; #8659 -虚 > xÅ«; #865A -è™› > xÅ«; #865B -虜 > lÅ­; #865C -è™ > hÅ­; #865D -虞 > yú; #865E -號 > hào; #865F -è™  > jiăo; #8660 -虡 > jù; #8661 -虢 > gúo; #8662 -虣 > bào; #8663 -虤 > yán; #8664 -虥 > zhàn; #8665 -虦 > zhàn; #8666 -虧 > kÅ«i; #8667 -虨 > bÄn; #8668 -虩 > xì; #8669 -虪 > shú; #866A -虫 > chóng; #866B -虬 > qíu; #866C -è™­ > diÄo; #866D -è™® > jÄ«; #866E -虯 > qíu; #866F -è™° > chéng; #8670 -è™± > shÄ«; #8671 -虳 > dì; #8673 -è™´ > zhé; #8674 -虵 > shé; #8675 -虶 > yÅ«; #8676 -è™· > gÄn; #8677 -虸 > zÄ­; #8678 -虹 > hóng; #8679 -虺 > hÅ­i; #867A -è™» > méng; #867B -虼 > gè; #867C -虽 > sÅ«i; #867D -虾 > xiÄ; #867E -虿 > chài; #867F -蚀 > shí; #8680 -èš > yÄ­; #8681 -èš‚ > mă; #8682 -蚃 > xiàng; #8683 -èš„ > fÄng; #8684 -èš… > è; #8685 -蚆 > pÄ; #8686 -蚇 > chÄ­; #8687 -蚈 > qiÄn; #8688 -蚉 > wén; #8689 -蚊 > wén; #868A -èš‹ > rùi; #868B -蚌 > bàng; #868C -èš > bÄ­; #868D -蚎 > yuè; #868E -èš > yuè; #868F -èš > jÅ«n; #8690 -èš‘ > qí; #8691 -èš’ > rán; #8692 -èš“ > yÄ­n; #8693 -èš” > qí; #8694 -èš• > tiăn; #8695 -èš– > yuán; #8696 -èš— > jué; #8697 -蚘 > húi; #8698 -èš™ > qín; #8699 -èšš > qí; #869A -èš› > zhòng; #869B -èšœ > yá; #869C -èš > cì; #869D -èšž > mù; #869E -蚟 > wáng; #869F -èš  > fén; #86A0 -èš¡ > fén; #86A1 -蚢 > háng; #86A2 -蚣 > gÅng; #86A3 -蚤 > zăo; #86A4 -蚥 > fÅ­; #86A5 -蚦 > rán; #86A6 -蚧 > jiè; #86A7 -蚨 > fú; #86A8 -èš© > chÄ«; #86A9 -蚪 > dÅu; #86AA -èš« > piáo; #86AB -蚬 > xiàn; #86AC -èš­ > ní; #86AD -èš® > tè; #86AE -蚯 > qÄ«u; #86AF -èš° > yóu; #86B0 -èš± > zhà; #86B1 -èš² > píng; #86B2 -èš³ > chí; #86B3 -èš´ > yÅu; #86B4 -èšµ > hé; #86B5 -蚶 > hÄn; #86B6 -èš· > jù; #86B7 -蚸 > lì; #86B8 -èš¹ > fù; #86B9 -蚺 > rán; #86BA -èš» > zhá; #86BB -èš¼ > gÅu; #86BC -èš½ > pí; #86BD -èš¾ > bÅ; #86BE -èš¿ > xián; #86BF -蛀 > zhù; #86C0 -è› > diÄo; #86C1 -蛂 > biÄ•; #86C2 -蛃 > bÄ­ng; #86C3 -蛄 > gÅ«; #86C4 -è›… > rán; #86C5 -蛆 > qÅ«; #86C6 -蛇 > shé; #86C7 -蛈 > tiè; #86C8 -蛉 > líng; #86C9 -蛊 > gÅ­; #86CA -蛋 > dàn; #86CB -蛌 > gÅ­; #86CC -è› > yíng; #86CD -蛎 > lì; #86CE -è› > chÄ“ng; #86CF -è› > qÅ«; #86D0 -蛑 > móu; #86D1 -è›’ > gé; #86D2 -蛓 > cì; #86D3 -è›” > húi; #86D4 -蛕 > húi; #86D5 -è›– > máng; #86D6 -è›— > fù; #86D7 -蛘 > yáng; #86D8 -è›™ > wÄ; #86D9 -蛚 > liè; #86DA -è›› > zhÅ«; #86DB -蛜 > yÄ«; #86DC -è› > xián; #86DD -蛞 > kùo; #86DE -蛟 > jiÄo; #86DF -è›  > lì; #86E0 -蛡 > yì; #86E1 -蛢 > píng; #86E2 -蛣 > jÄ«; #86E3 -蛤 > há; #86E4 -蛥 > shé; #86E5 -蛦 > yí; #86E6 -蛧 > wăng; #86E7 -蛨 > mò; #86E8 -蛩 > qíong; #86E9 -蛪 > qiè; #86EA -蛫 > gÅ­i; #86EB -蛬 > gÅng; #86EC -è›­ > zhì; #86ED -è›® > mán; #86EE -è›° > zhí; #86F0 -è›± > jiá; #86F1 -蛲 > ráo; #86F2 -蛳 > sÄ«; #86F3 -è›´ > qí; #86F4 -蛵 > xÄ«ng; #86F5 -蛶 > liè; #86F6 -è›· > qíu; #86F7 -蛸 > shÄo; #86F8 -蛹 > yÅng; #86F9 -蛺 > jiá; #86FA -è›» > shùi; #86FB -蛼 > chÄ“; #86FC -蛽 > bài; #86FD -蛾 > é; #86FE -蛿 > hàn; #86FF -蜀 > shÅ­; #8700 -èœ > xuán; #8701 -蜂 > fÄ“ng; #8702 -蜃 > shèn; #8703 -蜄 > zhèn; #8704 -蜅 > fÅ­; #8705 -蜆 > xiàn; #8706 -蜇 > zhé; #8707 -蜈 > wú; #8708 -蜉 > fú; #8709 -蜊 > lí; #870A -蜋 > láng; #870B -蜌 > bì; #870C -èœ > chú; #870D -蜎 > yuÄn; #870E -èœ > yÅu; #870F -èœ > jié; #8710 -蜑 > dàn; #8711 -蜒 > yán; #8712 -蜓 > tíng; #8713 -蜔 > diàn; #8714 -蜕 > shùi; #8715 -蜖 > húi; #8716 -蜗 > guÄ; #8717 -蜘 > zhÄ«; #8718 -蜙 > sÅng; #8719 -蜚 > fÄ“i; #871A -蜛 > jÅ«; #871B -蜜 > mì; #871C -èœ > qí; #871D -蜞 > qí; #871E -蜟 > yù; #871F -蜠 > jÅ­n; #8720 -蜡 > zhà; #8721 -蜢 > mÄ•ng; #8722 -蜣 > qiÄng; #8723 -蜤 > sÄ«; #8724 -蜥 > xÄ«; #8725 -蜦 > lún; #8726 -蜧 > lì; #8727 -蜨 > dié; #8728 -蜩 > tiáo; #8729 -蜪 > tÄo; #872A -蜫 > kÅ«n; #872B -蜬 > gÄn; #872C -蜭 > hàn; #872D -蜮 > yù; #872E -蜯 > bàng; #872F -蜰 > féi; #8730 -蜱 > pí; #8731 -蜲 > wÄ•i; #8732 -蜳 > dÅ«n; #8733 -蜴 > yì; #8734 -蜵 > yuÄn; #8735 -蜶 > sù; #8736 -蜷 > quán; #8737 -蜸 > qiăn; #8738 -蜹 > rùi; #8739 -蜺 > ní; #873A -蜻 > qÄ«ng; #873B -蜼 > wèi; #873C -蜽 > liăng; #873D -蜾 > gÅ­o; #873E -蜿 > wÄn; #873F -è€ > dÅng; #8740 -è > è; #8741 -è‚ > băn; #8742 -èƒ > dì; #8743 -è„ > wăng; #8744 -è… > cán; #8745 -è† > yăng; #8746 -è‡ > yíng; #8747 -èˆ > gÅ«o; #8748 -è‰ > chán; #8749 -è‹ > là; #874B -èŒ > kÄ“; #874C -è > jí; #874D -èŽ > hé; #874E -è > tíng; #874F -è > mài; #8750 -è‘ > xÅ«; #8751 -è’ > mián; #8752 -è“ > yú; #8753 -è” > jiÄ“; #8754 -è• > shí; #8755 -è– > xuÄn; #8756 -è— > huáng; #8757 -è˜ > yăn; #8758 -è™ > biÄn; #8759 -èš > róu; #875A -è› > wÄ“i; #875B -èœ > fù; #875C -è > yuán; #875D -èž > mèi; #875E -èŸ > wèi; #875F -è  > fú; #8760 -è¡ > ruăn; #8761 -è¢ > xié; #8762 -è£ > yóu; #8763 -è¤ > qíu; #8764 -è¥ > máo; #8765 -è¦ > xiÄ; #8766 -è§ > yÄ«ng; #8767 -è¨ > shÄ«; #8768 -è© > chóng; #8769 -èª > tÄng; #876A -è« > zhÅ«; #876B -è¬ > zÅng; #876C -è­ > tí; #876D -è® > fù; #876E -è¯ > yuán; #876F -è° > hÅ­i; #8770 -è± > méng; #8771 -è² > là; #8772 -è³ > dú; #8773 -è´ > hú; #8774 -èµ > qÄ«u; #8775 -è¶ > dié; #8776 -è· > lì; #8777 -è¸ > guÄ; #8778 -è¹ > yÅ«n; #8779 -èº > jÅ­; #877A -è» > năn; #877B -è¼ > lóu; #877C -è½ > qÅ­n; #877D -è¾ > róng; #877E -è¿ > yíng; #877F -螀 > jiÄng; #8780 -èž‚ > láng; #8782 -螃 > páng; #8783 -èž„ > sÄ«; #8784 -èž… > xÄ«; #8785 -螆 > cì; #8786 -螇 > xÄ«; #8787 -螈 > yuán; #8788 -螉 > wÄ“ng; #8789 -螊 > lián; #878A -èž‹ > sÅu; #878B -螌 > bÄn; #878C -èž > róng; #878D -螎 > róng; #878E -èž > jí; #878F -èž > wÅ«; #8790 -èž‘ > qìu; #8791 -èž’ > hàn; #8792 -èž“ > qín; #8793 -èž” > yí; #8794 -èž• > bÄ«; #8795 -èž– > huá; #8796 -èž— > táng; #8797 -螘 > yÄ­; #8798 -èž™ > dù; #8799 -èžš > nài; #879A -èž› > hé; #879B -èžœ > hú; #879C -èž > hùi; #879D -èžž > mă; #879E -螟 > míng; #879F -èž  > yì; #87A0 -èž¡ > wén; #87A1 -螢 > yíng; #87A2 -螣 > téng; #87A3 -螤 > yÅ­; #87A4 -螥 > cÄng; #87A5 -螨 > măn; #87A8 -螪 > shÄng; #87AA -èž« > zhÄ“; #87AB -螬 > cáo; #87AC -èž­ > chÄ«; #87AD -èž® > dì; #87AE -螯 > áo; #87AF -èž° > lù; #87B0 -èž± > wèi; #87B1 -èž² > zhì; #87B2 -èž³ > táng; #87B3 -èž´ > chén; #87B4 -èžµ > piÄo; #87B5 -螶 > qú; #87B6 -èž· > pí; #87B7 -螸 > yú; #87B8 -èž¹ > jiàn; #87B9 -螺 > lúo; #87BA -èž» > lóu; #87BB -èž¼ > qÄ­n; #87BC -èž½ > zhÅng; #87BD -èž¾ > yÄ­n; #87BE -èž¿ > jiÄng; #87BF -蟀 > shuài; #87C0 -èŸ > wén; #87C1 -蟂 > jiÄo; #87C2 -蟃 > wàn; #87C3 -蟄 > zhí; #87C4 -蟅 > zhè; #87C5 -蟆 > má; #87C6 -蟇 > má; #87C7 -蟈 > gÅ«o; #87C8 -蟉 > líu; #87C9 -蟊 > máo; #87CA -蟋 > xÄ«; #87CB -蟌 > cÅng; #87CC -èŸ > lí; #87CD -蟎 > măn; #87CE -èŸ > xiÄo; #87CF -蟑 > zhÄng; #87D1 -蟒 > măng; #87D2 -蟓 > xiàng; #87D3 -蟔 > mò; #87D4 -蟕 > zÅ«i; #87D5 -蟖 > sÄ«; #87D6 -蟗 > qÄ«u; #87D7 -蟘 > tè; #87D8 -蟙 > zhí; #87D9 -蟚 > péng; #87DA -蟛 > péng; #87DB -蟜 > jiăo; #87DC -èŸ > qú; #87DD -蟞 > bié; #87DE -蟟 > liáo; #87DF -蟠 > pán; #87E0 -蟡 > gÅ­i; #87E1 -蟢 > xÄ­; #87E2 -蟣 > jÄ­; #87E3 -蟤 > zhuÄn; #87E4 -蟥 > huáng; #87E5 -蟦 > fèi; #87E6 -蟧 > láo; #87E7 -蟨 > jué; #87E8 -蟩 > jué; #87E9 -蟪 > hùi; #87EA -蟫 > yín; #87EB -蟬 > chán; #87EC -蟭 > jiÄo; #87ED -蟮 > shàn; #87EE -蟯 > ráo; #87EF -蟰 > xiÄo; #87F0 -蟱 > móu; #87F1 -蟲 > chóng; #87F2 -蟳 > xún; #87F3 -蟴 > sÄ«; #87F4 -蟶 > chÄ“ng; #87F6 -蟷 > dÄng; #87F7 -蟸 > lÄ­; #87F8 -蟹 > xiè; #87F9 -蟺 > shàn; #87FA -蟻 > yÄ­; #87FB -蟼 > jÄ­ng; #87FC -蟽 > dá; #87FD -蟾 > chán; #87FE -蟿 > qì; #87FF -è € > cÄ«; #8800 -è  > xiàng; #8801 -è ‚ > shè; #8802 -è ƒ > lÅ­o; #8803 -è „ > qín; #8804 -è … > yíng; #8805 -è † > chài; #8806 -è ‡ > lì; #8807 -è ˆ > zé; #8808 -è ‰ > xuÄn; #8809 -è Š > lián; #880A -è ‹ > zhú; #880B -è Œ > zé; #880C -è  > xiÄ“; #880D -è Ž > măng; #880E -è  > xiè; #880F -è  > qí; #8810 -è ‘ > róng; #8811 -è ’ > jiăn; #8812 -è “ > mÄ•ng; #8813 -è ” > háo; #8814 -è • > ruăn; #8815 -è – > hùo; #8816 -è — > zhúo; #8817 -è ˜ > jié; #8818 -è ™ > bÄ«n; #8819 -è š > hè; #881A -è › > miè; #881B -è œ > fán; #881C -è  > léi; #881D -è ž > jié; #881E -è Ÿ > là; #881F -è   > mì; #8820 -è ¡ > lÄ­; #8821 -è ¢ > chÅ­n; #8822 -è £ > lì; #8823 -è ¤ > qÄ«u; #8824 -è ¥ > niè; #8825 -è ¦ > lú; #8826 -è § > dù; #8827 -è ¨ > xiÄo; #8828 -è © > zhÅ«; #8829 -è ª > lóng; #882A -è « > lì; #882B -è ¬ > lóng; #882C -è ­ > fÄ“ng; #882D -è ® > yÄ“; #882E -è ¯ > bèng; #882F -è ° > shàng; #8830 -è ± > gÅ­; #8831 -è ² > juÄn; #8832 -è ³ > yÄ«ng; #8833 -è µ > xÄ«; #8835 -è ¶ > cán; #8836 -è · > qú; #8837 -è ¸ > quán; #8838 -è ¹ > dù; #8839 -è º > cán; #883A -è » > mán; #883B -è ¼ > jué; #883C -è ½ > jié; #883D -è ¾ > zhú; #883E -è ¿ > zhá; #883F -è¡€ > xiÄ•; #8840 -è¡ > huÄng; #8841 -è¡‚ > nìu; #8842 -衃 > pÄ“i; #8843 -è¡„ > nÇœ; #8844 -è¡… > xìn; #8845 -衆 > zhòng; #8846 -衇 > mò; #8847 -衈 > èr; #8848 -衉 > kè; #8849 -è¡Š > miè; #884A -è¡‹ > xì; #884B -è¡Œ > xíng; #884C -è¡ > yăn; #884D -è¡Ž > kàn; #884E -è¡ > yuàn; #884F -è¡‘ > líng; #8851 -è¡’ > xuàn; #8852 -è¡“ > shù; #8853 -è¡” > xián; #8854 -è¡• > tòng; #8855 -è¡– > lòng; #8856 -è¡— > jiÄ“; #8857 -衘 > xián; #8858 -è¡™ > yá; #8859 -è¡š > hú; #885A -è¡› > wèi; #885B -è¡œ > dào; #885C -è¡ > chÅng; #885D -è¡ž > wèi; #885E -è¡Ÿ > dào; #885F -è¡  > zhÅ«n; #8860 -è¡¡ > héng; #8861 -è¡¢ > qú; #8862 -è¡£ > yÄ«; #8863 -衤 > yÄ«' 'zì' 'páng; #8864 -è¡¥ > bÅ­; #8865 -衦 > găn; #8866 -衧 > yú; #8867 -表 > biăo; #8868 -è¡© > chà; #8869 -衪 > yÄ­; #886A -è¡« > shÄn; #886B -衬 > chèn; #886C -è¡­ > fÅ«; #886D -è¡® > gÅ­n; #886E -衯 > fÄ“n; #886F -è¡° > shuÄi; #8870 -衱 > jié; #8871 -衲 > nà; #8872 -衳 > zhÅng; #8873 -è¡´ > dăn; #8874 -衵 > rì; #8875 -衶 > zhòng; #8876 -è¡· > zhÅng; #8877 -衸 > xiè; #8878 -衹 > qí; #8879 -衺 > xié; #887A -è¡» > rán; #887B -衼 > zhÄ«; #887C -衽 > rèn; #887D -衾 > qÄ«n; #887E -è¡¿ > jÄ«n; #887F -袀 > jÅ«n; #8880 -è¢ > yuán; #8881 -袂 > mèi; #8882 -袃 > chài; #8883 -袄 > ăo; #8884 -袅 > niăo; #8885 -袆 > hÅ«i; #8886 -袇 > rán; #8887 -袈 > jiÄ; #8888 -袉 > túo; #8889 -袊 > lÄ­ng; #888A -袋 > dài; #888B -袌 > bào; #888C -è¢ > páo; #888D -袎 > yào; #888E -è¢ > zùo; #888F -è¢ > bì; #8890 -袑 > shào; #8891 -袒 > tăn; #8892 -袓 > jÅ­; #8893 -袔 > hè; #8894 -袕 > shù; #8895 -袖 > xìu; #8896 -袗 > zhÄ•n; #8897 -袘 > yí; #8898 -袙 > pà; #8899 -袚 > bÅ; #889A -袛 > dÄ«; #889B -袜 > wà; #889C -è¢ > fù; #889D -袞 > gÅ­n; #889E -袟 > zhì; #889F -袠 > zhì; #88A0 -袡 > rán; #88A1 -袢 > pàn; #88A2 -袣 > yì; #88A3 -袤 > mào; #88A4 -袥 > tuo; #88A5 -袦 > nà; #88A6 -袧 > kÅu; #88A7 -袨 > xiàn; #88A8 -袩 > chÄn; #88A9 -袪 > qÅ«; #88AA -被 > bèi; #88AB -袬 > gÅ­n; #88AC -袭 > xí; #88AD -袯 > bó; #88AF -袱 > fú; #88B1 -袲 > yí; #88B2 -袳 > chÄ­; #88B3 -袴 > kù; #88B4 -袵 > rèn; #88B5 -袶 > jiàng; #88B6 -袷 > jiá; #88B7 -袸 > cún; #88B8 -袹 > mò; #88B9 -袺 > jié; #88BA -袻 > ér; #88BB -袼 > lùo; #88BC -袽 > rú; #88BD -袾 > zhÅ«; #88BE -袿 > gÅ«i; #88BF -裀 > yÄ«n; #88C0 -è£ > cái; #88C1 -裂 > liè; #88C2 -装 > zhuÄng; #88C5 -裆 > dÄng; #88C6 -裈 > kÅ«n; #88C8 -裉 > kèn; #88C9 -裊 > niăo; #88CA -裋 > shù; #88CB -裌 > jiá; #88CC -è£ > kÅ­n; #88CD -裎 > chéng; #88CE -è£ > lÄ­; #88CF -è£ > juÄn; #88D0 -裑 > shÄ“n; #88D1 -裒 > póu; #88D2 -裓 > gé; #88D3 -裔 > yì; #88D4 -裕 > yù; #88D5 -裖 > zhÄ•n; #88D6 -裗 > líu; #88D7 -裘 > qíu; #88D8 -裙 > qún; #88D9 -裚 > jì; #88DA -裛 > yì; #88DB -補 > bÅ­; #88DC -è£ > zhuÄng; #88DD -裞 > shùi; #88DE -裟 > shÄ; #88DF -裠 > qún; #88E0 -裡 > lÄ­; #88E1 -裢 > lián; #88E2 -裣 > liàn; #88E3 -裤 > kù; #88E4 -裥 > jiăn; #88E5 -裦 > fóu; #88E6 -裧 > chÄn; #88E7 -裨 > bì; #88E8 -裩 > gÅ«n; #88E9 -裪 > táo; #88EA -裫 > yuàn; #88EB -裬 > líng; #88EC -裭 > chÄ­; #88ED -裮 > chÄng; #88EE -裯 > chóu; #88EF -裰 > dúo; #88F0 -裱 > biăo; #88F1 -裲 > liăng; #88F2 -裳 > cháng; #88F3 -裴 > péi; #88F4 -裵 > péi; #88F5 -裶 > fÄ“i; #88F6 -裷 > yuÄn; #88F7 -裸 > lÅ­o; #88F8 -裹 > gÅ­o; #88F9 -裺 > yăn; #88FA -裻 > dÅ­; #88FB -裼 > xí; #88FC -製 > zhì; #88FD -裾 > jÅ«; #88FE -裿 > qÄ­; #88FF -褀 > jì; #8900 -è¤ > zhí; #8901 -褂 > guà; #8902 -褃 > kèn; #8903 -褅 > tì; #8905 -褆 > tí; #8906 -複 > fù; #8907 -褈 > chóng; #8908 -褉 > xiÄ“; #8909 -褊 > biăn; #890A -褋 > dié; #890B -褌 > kÅ«n; #890C -è¤ > duÄn; #890D -褎 > xìu; #890E -è¤ > xìu; #890F -è¤ > hé; #8910 -褑 > yuàn; #8911 -褒 > bÄo; #8912 -褓 > băo; #8913 -褔 > fù; #8914 -褕 > yú; #8915 -褖 > tuàn; #8916 -褗 > yăn; #8917 -褘 > hÅ«i; #8918 -褙 > bèi; #8919 -褚 > chÅ­; #891A -褛 > lÇš; #891B -褞 > yÅ­n; #891E -褟 > dá; #891F -褠 > gÅu; #8920 -褡 > dÄ; #8921 -褢 > huái; #8922 -褣 > róng; #8923 -褤 > yuàn; #8924 -褥 > rù; #8925 -褦 > nài; #8926 -褧 > jÄ­ong; #8927 -褨 > sÅ­o; #8928 -褩 > bÄn; #8929 -褪 > tùn; #892A -褫 > chÄ­; #892B -褬 > săng; #892C -褭 > niăo; #892D -褮 > yÄ«ng; #892E -褯 > jiè; #892F -褰 > qiÄn; #8930 -褱 > huái; #8931 -褲 > kù; #8932 -褳 > lián; #8933 -褴 > băo; #8934 -褵 > lí; #8935 -褶 > zhé; #8936 -褷 > shÄ«; #8937 -褸 > lÇš; #8938 -褹 > yì; #8939 -褺 > dié; #893A -褻 > xiè; #893B -褼 > xiÄn; #893C -褽 > wèi; #893D -褾 > biăo; #893E -褿 > cáo; #893F -襀 > jÄ«; #8940 -è¥ > jiăng; #8941 -襂 > sÄ“n; #8942 -襃 > bÄo; #8943 -襄 > xiÄng; #8944 -襆 > pú; #8946 -襇 > jiăn; #8947 -襈 > zhuàn; #8948 -襉 > jiàn; #8949 -襊 > zùi; #894A -襋 > jí; #894B -襌 > dÄn; #894C -è¥ > zá; #894D -襎 > fán; #894E -è¥ > bó; #894F -è¥ > xiàng; #8950 -襑 > xín; #8951 -襒 > bié; #8952 -襓 > ráo; #8953 -襔 > măn; #8954 -襕 > lán; #8955 -襖 > ăo; #8956 -襗 > dúo; #8957 -襘 > gùi; #8958 -襙 > cào; #8959 -襚 > sùi; #895A -襛 > nóng; #895B -襜 > chÄn; #895C -è¥ > liàn; #895D -襞 > bì; #895E -襟 > jÄ«n; #895F -襠 > dÄng; #8960 -襡 > shú; #8961 -襢 > tăn; #8962 -襣 > bì; #8963 -襤 > lán; #8964 -襥 > pú; #8965 -襦 > rú; #8966 -襧 > zhÄ­; #8967 -襩 > shÅ­; #8969 -襪 > wà; #896A -襫 > shì; #896B -襬 > băi; #896C -襭 > xié; #896D -襮 > bó; #896E -襯 > chèn; #896F -襰 > lài; #8970 -襱 > lóng; #8971 -襲 > xí; #8972 -襳 > xiÄn; #8973 -襴 > lán; #8974 -襵 > zhé; #8975 -襶 > dài; #8976 -襸 > zàn; #8978 -襹 > shÄ«; #8979 -襺 > jiăn; #897A -襻 > pàn; #897B -襼 > yì; #897C -襾 > yà; #897E -西 > xÄ«; #897F -覀 > xÄ«; #8980 -è¦ > yào; #8981 -覂 > fÄ•ng; #8982 -覃 > tán; #8983 -覅 > biào; #8985 -覆 > fù; #8986 -覇 > bà; #8987 -覈 > hé; #8988 -覉 > jÄ«; #8989 -覊 > jÄ«; #898A -見 > jiàn; #898B -覌 > guÄn; #898C -è¦ > biàn; #898D -覎 > yàn; #898E -è¦ > gÅ«i; #898F -è¦ > jué; #8990 -覑 > piăn; #8991 -覒 > máo; #8992 -覓 > mì; #8993 -覔 > mì; #8994 -覕 > miè; #8995 -視 > shì; #8996 -覗 > sÄ«; #8997 -覘 > zhÄn; #8998 -覙 > lúo; #8999 -覚 > jué; #899A -覛 > mì; #899B -覜 > tiào; #899C -è¦ > lián; #899D -覞 > yào; #899E -覟 > zhì; #899F -覠 > jÅ«n; #89A0 -覡 > xí; #89A1 -覢 > shăn; #89A2 -覣 > wÄ“i; #89A3 -覤 > xì; #89A4 -覥 > tiăn; #89A5 -覦 > yú; #89A6 -覧 > lăn; #89A7 -覨 > è; #89A8 -覩 > dÅ­; #89A9 -親 > qÄ«n; #89AA -覫 > păng; #89AB -覬 > jì; #89AC -覭 > míng; #89AD -覮 > yíng; #89AE -覯 > gòu; #89AF -覰 > qù; #89B0 -覱 > zhàn; #89B1 -覲 > jÄ­n; #89B2 -観 > guÄn; #89B3 -覴 > dÄ“ng; #89B4 -覵 > jiàn; #89B5 -覶 > lúo; #89B6 -覷 > qù; #89B7 -覸 > jiàn; #89B8 -覹 > wéi; #89B9 -覺 > jué; #89BA -覻 > qù; #89BB -覼 > lúo; #89BC -覽 > lăn; #89BD -覾 > shÄ•n; #89BE -覿 > dí; #89BF -觀 > guÄn; #89C0 -è§ > jiàn; #89C1 -观 > guÄn; #89C2 -觃 > yàn; #89C3 -规 > gÅ«i; #89C4 -觅 > mì; #89C5 -视 > shì; #89C6 -觇 > zhÄn; #89C7 -览 > lăn; #89C8 -觉 > jué; #89C9 -觊 > jì; #89CA -觋 > xí; #89CB -觌 > dí; #89CC -è§ > tiăn; #89CD -觎 > yú; #89CE -è§ > gòu; #89CF -è§ > jÄ­n; #89D0 -觑 > qù; #89D1 -角 > jiăo; #89D2 -觓 > jÄ«u; #89D3 -觔 > jÄ«n; #89D4 -觕 > cÅ«; #89D5 -觖 > jué; #89D6 -觗 > zhì; #89D7 -觘 > chào; #89D8 -觙 > jí; #89D9 -觚 > gÅ«; #89DA -觛 > dàn; #89DB -觜 > zÅ­i; #89DC -è§ > dÄ­; #89DD -觞 > shÄng; #89DE -觟 > huà; #89DF -觠 > quán; #89E0 -觡 > gé; #89E1 -觢 > chì; #89E2 -解 > jiÄ•; #89E3 -觤 > gÅ­i; #89E4 -觥 > gÅng; #89E5 -触 > hóng; #89E6 -觧 > jiÄ•; #89E7 -觨 > hùn; #89E8 -觩 > qíu; #89E9 -觪 > xÄ«ng; #89EA -觫 > sù; #89EB -觬 > ní; #89EC -觭 > jÄ«; #89ED -觮 > lù; #89EE -觯 > zhì; #89EF -觰 > zhÄ; #89F0 -觱 > bì; #89F1 -觲 > xÄ«ng; #89F2 -觳 > hú; #89F3 -觴 > shÄng; #89F4 -觵 > gÅng; #89F5 -觶 > zhì; #89F6 -觷 > xué; #89F7 -觸 > chù; #89F8 -觹 > xÄ«; #89F9 -觺 > yí; #89FA -觻 > lù; #89FB -觼 > jué; #89FC -觽 > xÄ«; #89FD -觾 > yàn; #89FE -觿 > xÄ«; #89FF -言 > yán; #8A00 -è¨ > yán' 'zì' 'páng; #8A01 -訂 > dìng; #8A02 -訃 > fù; #8A03 -訄 > qíu; #8A04 -訅 > qíu; #8A05 -訆 > jiào; #8A06 -訇 > hÅng; #8A07 -計 > jì; #8A08 -訉 > fàn; #8A09 -訊 > xùn; #8A0A -訋 > diào; #8A0B -訌 > hóng; #8A0C -è¨ > chà; #8A0D -討 > tăo; #8A0E -è¨ > xÅ«; #8A0F -è¨ > jié; #8A10 -訑 > yí; #8A11 -訒 > rèn; #8A12 -訓 > xùn; #8A13 -訔 > yín; #8A14 -訕 > shàn; #8A15 -訖 > qì; #8A16 -託 > tÅ«o; #8A17 -記 > jì; #8A18 -訙 > xùn; #8A19 -訚 > yín; #8A1A -訛 > é; #8A1B -訜 > fÄ“n; #8A1C -è¨ > yà; #8A1D -訞 > yÄo; #8A1E -訟 > sòng; #8A1F -訠 > shÄ•n; #8A20 -訡 > yín; #8A21 -訢 > xÄ«n; #8A22 -訣 > jué; #8A23 -訤 > xiáo; #8A24 -訥 > nè; #8A25 -訦 > chén; #8A26 -訧 > yóu; #8A27 -訨 > zhÄ­; #8A28 -訩 > xÄ«ong; #8A29 -訪 > făng; #8A2A -訫 > xìn; #8A2B -訬 > chÄo; #8A2C -設 > shè; #8A2D -訮 > xiÄn; #8A2E -訯 > shă; #8A2F -訰 > tún; #8A30 -許 > xÅ­; #8A31 -訲 > yì; #8A32 -訳 > yì; #8A33 -訴 > sù; #8A34 -訵 > chÄ«; #8A35 -訶 > hÄ“; #8A36 -訷 > shÄ“n; #8A37 -訸 > hé; #8A38 -訹 > xù; #8A39 -診 > zhÄ•n; #8A3A -註 > zhù; #8A3B -証 > zhèng; #8A3C -訽 > gòu; #8A3D -訾 > zÄ­; #8A3E -訿 > zÄ­; #8A3F -è©€ > zhÄn; #8A40 -è© > gÅ­; #8A41 -è©‚ > fù; #8A42 -詃 > quăn; #8A43 -è©„ > dié; #8A44 -è©… > líng; #8A45 -詆 > dÄ­; #8A46 -詇 > yàng; #8A47 -詈 > lì; #8A48 -詉 > náo; #8A49 -è©Š > pàn; #8A4A -è©‹ > zhòu; #8A4B -è©Œ > gàn; #8A4C -è© > yì; #8A4D -è©Ž > jù; #8A4E -è© > ào; #8A4F -è© > zhà; #8A50 -è©‘ > túo; #8A51 -è©’ > yí; #8A52 -è©“ > qÅ­; #8A53 -è©” > zhào; #8A54 -è©• > píng; #8A55 -è©– > bì; #8A56 -è©— > xìong; #8A57 -詘 > qù; #8A58 -è©™ > bá; #8A59 -è©š > dá; #8A5A -è©› > zÅ­; #8A5B -è©œ > tÄo; #8A5C -è© > zhÅ­; #8A5D -è©ž > cí; #8A5E -è©Ÿ > zhé; #8A5F -è©  > yÅng; #8A60 -è©¡ > xÅ­; #8A61 -è©¢ > xún; #8A62 -è©£ > yì; #8A63 -詤 > huăng; #8A64 -è©¥ > hé; #8A65 -試 > shì; #8A66 -詧 > chá; #8A67 -詨 > jiÄo; #8A68 -è©© > shÄ«; #8A69 -詪 > hÄ•n; #8A6A -è©« > chà; #8A6B -詬 > gòu; #8A6C -è©­ > gÅ­i; #8A6D -è©® > quán; #8A6E -詯 > hùi; #8A6F -è©° > jié; #8A70 -話 > huà; #8A71 -該 > gÄi; #8A72 -詳 > xiáng; #8A73 -è©´ > wÄ“i; #8A74 -詵 > shÄ“n; #8A75 -詶 > chóu; #8A76 -è©· > tóng; #8A77 -詸 > mí; #8A78 -詹 > zhÄn; #8A79 -詺 > mìng; #8A7A -è©» > è; #8A7B -詼 > hÅ«i; #8A7C -詽 > yán; #8A7D -詾 > xÄ«ong; #8A7E -è©¿ > guà; #8A7F -誀 > èr; #8A80 -èª > bÄ•ng; #8A81 -誂 > tiăo; #8A82 -誃 > chÄ­; #8A83 -誄 > lÄ•i; #8A84 -誅 > zhÅ«; #8A85 -誆 > kuÄng; #8A86 -誇 > kuÄ; #8A87 -誈 > wú; #8A88 -誉 > yù; #8A89 -誊 > téng; #8A8A -誋 > jì; #8A8B -誌 > zhì; #8A8C -èª > rèn; #8A8D -誎 > sù; #8A8E -èª > lăng; #8A8F -èª > é; #8A90 -誑 > kuáng; #8A91 -誒 > è; #8A92 -誓 > shì; #8A93 -誔 > tÄ­ng; #8A94 -誕 > dàn; #8A95 -誖 > bó; #8A96 -誗 > chán; #8A97 -誘 > yòu; #8A98 -誙 > héng; #8A99 -誚 > qiào; #8A9A -誛 > qÄ«n; #8A9B -誜 > shuà; #8A9C -èª > Än; #8A9D -語 > yÅ­; #8A9E -誟 > xiào; #8A9F -誠 > chéng; #8AA0 -誡 > jiè; #8AA1 -誢 > xiàn; #8AA2 -誣 > wú; #8AA3 -誤 > wù; #8AA4 -誥 > gào; #8AA5 -誦 > sòng; #8AA6 -誧 > pÅ­; #8AA7 -誨 > hùi; #8AA8 -誩 > jìng; #8AA9 -說 > shÅ«o; #8AAA -誫 > zhèn; #8AAB -説 > shÅ«o; #8AAC -読 > dú; #8AAD -誯 > chàng; #8AAF -誰 > shúi; #8AB0 -誱 > jié; #8AB1 -課 > kè; #8AB2 -誳 > qÅ«; #8AB3 -誴 > cóng; #8AB4 -誵 > xiáo; #8AB5 -誶 > sùi; #8AB6 -誷 > wăng; #8AB7 -誸 > xuán; #8AB8 -誹 > fÄ•i; #8AB9 -誺 > chÄ«; #8ABA -誻 > tà; #8ABB -誼 > yí; #8ABC -誽 > ná; #8ABD -誾 > yín; #8ABE -調 > diào; #8ABF -è«€ > pÄ­; #8AC0 -è« > chùo; #8AC1 -è«‚ > chăn; #8AC2 -諃 > chÄ“n; #8AC3 -è«„ > zhÅ«n; #8AC4 -è«… > jÄ«; #8AC5 -諆 > qÄ«; #8AC6 -談 > tán; #8AC7 -諈 > zhùi; #8AC8 -諉 > wÄ•i; #8AC9 -è«Š > jú; #8ACA -è«‹ > qÄ­ng; #8ACB -è«Œ > jiàn; #8ACC -è« > zhÄ“ng; #8ACD -è«Ž > zé; #8ACE -è« > zÅu; #8ACF -è« > qiÄn; #8AD0 -è«‘ > zhúo; #8AD1 -è«’ > liàng; #8AD2 -è«“ > jiàn; #8AD3 -è«” > zhù; #8AD4 -è«• > háo; #8AD5 -è«– > lùn; #8AD6 -è«— > shÄ•n; #8AD7 -諘 > biăo; #8AD8 -è«™ > huài; #8AD9 -è«š > pián; #8ADA -è«› > yú; #8ADB -è«œ > dié; #8ADC -è« > xÅ­; #8ADD -è«ž > pián; #8ADE -è«Ÿ > shì; #8ADF -è«  > xuÄn; #8AE0 -è«¡ > shì; #8AE1 -è«¢ > hùn; #8AE2 -è«£ > huà; #8AE3 -諤 > è; #8AE4 -è«¥ > zhòng; #8AE5 -諦 > dì; #8AE6 -諧 > xié; #8AE7 -諨 > fú; #8AE8 -è«© > pÅ­; #8AE9 -諪 > tíng; #8AEA -è«« > jiàn; #8AEB -諬 > qÄ­; #8AEC -è«­ > yù; #8AED -è«® > zÄ«; #8AEE -諯 > chuán; #8AEF -è«° > xÄ­; #8AF0 -諱 > hùi; #8AF1 -諲 > yÄ«n; #8AF2 -諳 > Än; #8AF3 -è«´ > xián; #8AF4 -諵 > nán; #8AF5 -諶 > chén; #8AF6 -è«· > fÄ“ng; #8AF7 -諸 > zhÅ«; #8AF8 -諹 > yáng; #8AF9 -諺 > yàn; #8AFA -è«» > hÄ“ng; #8AFB -諼 > xuÄn; #8AFC -諽 > gé; #8AFD -諾 > nùo; #8AFE -è«¿ > qì; #8AFF -謀 > móu; #8B00 -è¬ > yè; #8B01 -謂 > wèi; #8B02 -謄 > téng; #8B04 -謅 > zÅu; #8B05 -謆 > shàn; #8B06 -謇 > jiăn; #8B07 -謈 > bó; #8B08 -謉 > kù1; #8B09 -謊 > huăng; #8B0A -謋 > hùo; #8B0B -謌 > gÄ“; #8B0C -è¬ > yíng; #8B0D -謎 > mí; #8B0E -è¬ > xiăo; #8B0F -è¬ > mì; #8B10 -謑 > xì; #8B11 -謒 > qiÄng; #8B12 -謓 > chÄ“n; #8B13 -謔 > nÇœe; #8B14 -謕 > tí; #8B15 -謖 > sù; #8B16 -謗 > bàng; #8B17 -謘 > chí; #8B18 -謙 > qiÄn; #8B19 -謚 > shì; #8B1A -講 > jiăng; #8B1B -謜 > yuàn; #8B1C -è¬ > xiè; #8B1D -謞 > xuè; #8B1E -謟 > tÄo; #8B1F -謠 > yáo; #8B20 -謡 > yáo; #8B21 -謣 > yú; #8B23 -謤 > biÄo; #8B24 -謥 > còng; #8B25 -謦 > qìng; #8B26 -謧 > lí; #8B27 -謨 > mó; #8B28 -謩 > mò; #8B29 -謪 > shÄng; #8B2A -謫 > zhé; #8B2B -謬 > mìu; #8B2C -謭 > jiăn; #8B2D -謮 > zé; #8B2E -謯 > jiÄ“; #8B2F -謰 > lián; #8B30 -謱 > lóu; #8B31 -謲 > cÄn; #8B32 -謳 > Åu; #8B33 -謴 > guàn; #8B34 -謵 > xí; #8B35 -謶 > zhúo; #8B36 -謷 > áo; #8B37 -謸 > áo; #8B38 -謹 > jÄ­n; #8B39 -謺 > zhé; #8B3A -謻 > yí; #8B3B -謼 > hù; #8B3C -謽 > jiàng; #8B3D -謾 > mán; #8B3E -謿 > cháo; #8B3F -è­€ > hàn; #8B40 -è­ > huá; #8B41 -è­‚ > chăn; #8B42 -è­ƒ > xÅ«; #8B43 -è­„ > zÄ“ng; #8B44 -è­… > sè; #8B45 -è­† > xÄ«; #8B46 -è­‡ > shÄ“; #8B47 -è­ˆ > dùi; #8B48 -è­‰ > zhèng; #8B49 -è­Š > náo; #8B4A -è­‹ > lán; #8B4B -è­Œ > é; #8B4C -è­ > yìng; #8B4D -è­Ž > jué; #8B4E -è­ > jÄ«; #8B4F -è­ > zÅ­n; #8B50 -è­‘ > jiăo; #8B51 -è­’ > bò; #8B52 -è­“ > hùi; #8B53 -è­” > zhuàn; #8B54 -è­• > mú; #8B55 -è­– > zèn; #8B56 -è­— > zhá; #8B57 -è­˜ > shì; #8B58 -è­™ > qiáo; #8B59 -è­š > tán; #8B5A -è­› > zèn; #8B5B -è­œ > pÅ­; #8B5C -è­ > shéng; #8B5D -è­ž > xuÄn; #8B5E -è­Ÿ > zào; #8B5F -è­  > tÄn; #8B60 -è­¡ > dăng; #8B61 -è­¢ > sùi; #8B62 -è­£ > qiÄn; #8B63 -è­¤ > jÄ«; #8B64 -è­¥ > jiào; #8B65 -è­¦ > jÄ­ng; #8B66 -è­§ > lián; #8B67 -è­¨ > nóu; #8B68 -è­© > yÄ«; #8B69 -è­ª > ài; #8B6A -è­« > zhÄn; #8B6B -è­¬ > pì; #8B6C -è­­ > hÅ­i; #8B6D -è­® > huà; #8B6E -è­¯ > yì; #8B6F -è­° > yì; #8B70 -è­± > shàn; #8B71 -è­² > ràng; #8B72 -è­³ > nòu; #8B73 -è­´ > qiăn; #8B74 -è­µ > zhùi; #8B75 -è­¶ > tà; #8B76 -è­· > hù; #8B77 -è­¸ > zhÅu; #8B78 -è­¹ > háo; #8B79 -è­º > yè; #8B7A -è­» > yÄ«ng; #8B7B -è­¼ > jiàn; #8B7C -è­½ > yù; #8B7D -è­¾ > jiăn; #8B7E -è­¿ > hùi; #8B7F -讀 > dú; #8B80 -è® > zhé; #8B81 -讂 > xuàn; #8B82 -讃 > zàn; #8B83 -讄 > lÄ•i; #8B84 -è®… > shÄ•n; #8B85 -讆 > wèi; #8B86 -讇 > chăn; #8B87 -讈 > lì; #8B88 -讉 > yí; #8B89 -變 > biàn; #8B8A -讋 > zhé; #8B8B -讌 > yàn; #8B8C -è® > è; #8B8D -讎 > chóu; #8B8E -è® > wèi; #8B8F -è® > chóu; #8B90 -讑 > yào; #8B91 -è®’ > chán; #8B92 -讓 > ràng; #8B93 -è®” > yÄ­n; #8B94 -讕 > lán; #8B95 -è®– > chèn; #8B96 -è®— > hùo; #8B97 -讘 > zhé; #8B98 -è®™ > huÄn; #8B99 -讚 > zàn; #8B9A -è®› > yì; #8B9B -讜 > dăng; #8B9C -è® > zhÄn; #8B9D -讞 > yàn; #8B9E -讟 > dú; #8B9F -è®  > yán; #8BA0 -计 > jì; #8BA1 -订 > dìng; #8BA2 -讣 > fù; #8BA3 -认 > rèn; #8BA4 -讥 > jÄ«; #8BA5 -讦 > jié; #8BA6 -讧 > hóng; #8BA7 -讨 > tăo; #8BA8 -让 > ràng; #8BA9 -讪 > shàn; #8BAA -讫 > qì; #8BAB -讬 > tÅ«o; #8BAC -è®­ > xùn; #8BAD -è®® > yì; #8BAE -讯 > xùn; #8BAF -è®° > jì; #8BB0 -è®± > rèn; #8BB1 -讲 > jiăng; #8BB2 -讳 > hùi; #8BB3 -è®´ > Åu; #8BB4 -讵 > jù; #8BB5 -讶 > yà; #8BB6 -è®· > nè; #8BB7 -许 > xÅ­; #8BB8 -讹 > é; #8BB9 -论 > lùn; #8BBA -è®» > xÄ«ong; #8BBB -讼 > sòng; #8BBC -讽 > fÄ“ng; #8BBD -设 > shè; #8BBE -访 > făng; #8BBF -诀 > jué; #8BC0 -è¯ > zhèng; #8BC1 -诂 > gÅ­; #8BC2 -诃 > hÄ“; #8BC3 -评 > píng; #8BC4 -诅 > zÅ­; #8BC5 -识 > shì; #8BC6 -诇 > xìong; #8BC7 -诈 > zhà; #8BC8 -诉 > sù; #8BC9 -诊 > zhÄ•n; #8BCA -诋 > dÄ­; #8BCB -诌 > zÅu; #8BCC -è¯ > cí; #8BCD -诎 > qù; #8BCE -è¯ > zhào; #8BCF -è¯ > bì; #8BD0 -译 > yì; #8BD1 -诒 > yí; #8BD2 -诓 > kuÄng; #8BD3 -诔 > lÄ•i; #8BD4 -试 > shì; #8BD5 -诖 > guà; #8BD6 -诗 > shÄ«; #8BD7 -诘 > jié; #8BD8 -诙 > hÅ«i; #8BD9 -诚 > chéng; #8BDA -诛 > zhÅ«; #8BDB -诜 > shÄ“n; #8BDC -è¯ > huà; #8BDD -诞 > dàn; #8BDE -诟 > gòu; #8BDF -诠 > quán; #8BE0 -诡 > gÅ­i; #8BE1 -询 > xún; #8BE2 -诣 > yì; #8BE3 -诤 > zhÄ“ng; #8BE4 -该 > gÄi; #8BE5 -详 > xiáng; #8BE6 -诧 > chà; #8BE7 -诨 > hùn; #8BE8 -诩 > xÅ­; #8BE9 -诪 > zhÅu; #8BEA -诫 > jiè; #8BEB -诬 > wú; #8BEC -语 > yÅ­; #8BED -诮 > qiào; #8BEE -误 > wù; #8BEF -诰 > gào; #8BF0 -诱 > yòu; #8BF1 -诲 > hùi; #8BF2 -诳 > kuáng; #8BF3 -说 > shÅ«o; #8BF4 -诵 > sòng; #8BF5 -诶 > Äi; #8BF6 -请 > qÄ­ng; #8BF7 -诸 > zhÅ«; #8BF8 -诹 > zÅu; #8BF9 -诺 > nùo; #8BFA -读 > dú; #8BFB -诼 > zhúo; #8BFC -诽 > fÄ•i; #8BFD -课 > kè; #8BFE -诿 > wÄ•i; #8BFF -è°€ > yú; #8C00 -è° > shúi; #8C01 -è°‚ > shÄ•n; #8C02 -è°ƒ > diào; #8C03 -è°„ > chăn; #8C04 -è°… > liàng; #8C05 -è°† > zhÅ«n; #8C06 -è°‡ > sùi; #8C07 -è°ˆ > tán; #8C08 -è°‰ > shÄ•n; #8C09 -è°Š > yí; #8C0A -è°‹ > móu; #8C0B -è°Œ > chén; #8C0C -è° > dié; #8C0D -è°Ž > huăng; #8C0E -è° > jiàn; #8C0F -è° > xié; #8C10 -è°‘ > nÇœe; #8C11 -è°’ > yè; #8C12 -è°“ > wèi; #8C13 -è°” > è; #8C14 -è°• > yù; #8C15 -è°– > xuÄn; #8C16 -è°— > chán; #8C17 -è°˜ > zÄ«; #8C18 -è°™ > Än; #8C19 -è°š > yàn; #8C1A -è°› > dì; #8C1B -è°œ > mí; #8C1C -è° > pián; #8C1D -è°ž > xÅ­; #8C1E -è°Ÿ > mó; #8C1F -è°  > dăng; #8C20 -è°¡ > sù; #8C21 -è°¢ > xiè; #8C22 -è°£ > yáo; #8C23 -è°¤ > bàng; #8C24 -è°¥ > shì; #8C25 -è°¦ > qiÄn; #8C26 -è°§ > mì; #8C27 -è°¨ > jÄ­n; #8C28 -è°© > mán; #8C29 -è°ª > zhé; #8C2A -è°« > jiăn; #8C2B -è°¬ > mìu; #8C2C -è°­ > tán; #8C2D -è°® > zèn; #8C2E -è°¯ > qiáo; #8C2F -è°° > lán; #8C30 -è°± > pÅ­; #8C31 -è°² > jué; #8C32 -è°³ > yàn; #8C33 -è°´ > qiăn; #8C34 -è°µ > zhÄn; #8C35 -è°¶ > chèn; #8C36 -è°· > gÅ­; #8C37 -è°¸ > qiÄn; #8C38 -è°¹ > hóng; #8C39 -è°º > xiÄ; #8C3A -è°» > jué; #8C3B -è°¼ > hóng; #8C3C -è°½ > hÄn; #8C3D -è°¾ > hÅng; #8C3E -è°¿ > xÄ«; #8C3F -è±€ > xÄ«; #8C40 -è± > hùo; #8C41 -豂 > liáo; #8C42 -豃 > hăn; #8C43 -豄 > dú; #8C44 -è±… > lóng; #8C45 -豆 > dòu; #8C46 -豇 > jiÄng; #8C47 -豈 > qÄ­; #8C48 -豉 > shì; #8C49 -豊 > lÄ­; #8C4A -豋 > dÄ“ng; #8C4B -豌 > wÄn; #8C4C -è± > bÄ«; #8C4D -豎 > shù; #8C4E -è± > xiàn; #8C4F -è± > fÄ“ng; #8C50 -豑 > zhì; #8C51 -è±’ > zhì; #8C52 -豓 > yàn; #8C53 -è±” > yàn; #8C54 -豕 > shÄ­; #8C55 -è±– > chù; #8C56 -è±— > hÅ«i; #8C57 -豘 > tún; #8C58 -è±™ > yì; #8C59 -豚 > tún; #8C5A -è±› > yì; #8C5B -豜 > jiÄn; #8C5C -è± > bÄ; #8C5D -豞 > hòu; #8C5E -豟 > è; #8C5F -è±  > cú; #8C60 -象 > xiàng; #8C61 -è±¢ > huàn; #8C62 -è±£ > jiÄn; #8C63 -豤 > kÄ•n; #8C64 -è±¥ > gÄi; #8C65 -豦 > qú; #8C66 -豧 > fÅ«; #8C67 -豨 > xÄ«; #8C68 -豩 > bÄ«n; #8C69 -豪 > háo; #8C6A -豫 > yù; #8C6B -豬 > zhÅ«; #8C6C -è±­ > jiÄ; #8C6D -豯 > xÄ«; #8C6F -è±° > bó; #8C70 -è±± > wÄ“n; #8C71 -è±² > huán; #8C72 -è±³ > bÄ«n; #8C73 -è±´ > dí; #8C74 -è±µ > zÅng; #8C75 -豶 > fén; #8C76 -è±· > yì; #8C77 -豸 > zhì; #8C78 -è±¹ > bào; #8C79 -豺 > chái; #8C7A -è±» > hàn; #8C7B -è±¼ > pí; #8C7C -è±½ > nà; #8C7D -è±¾ > pÄ«; #8C7E -豿 > gÅu; #8C7F -è²€ > nà; #8C80 -è² > yòu; #8C81 -貂 > diÄo; #8C82 -貃 > mò; #8C83 -貄 > sì; #8C84 -è²… > xÄ«u; #8C85 -貆 > huán; #8C86 -貇 > kÅ«n; #8C87 -貈 > hé; #8C88 -貉 > hé; #8C89 -貊 > mò; #8C8A -貋 > hàn; #8C8B -貌 > mào; #8C8C -è² > lí; #8C8D -貎 > ní; #8C8E -è² > bÄ­; #8C8F -è² > yÅ­; #8C90 -貑 > jiÄ; #8C91 -è²’ > tuÄn; #8C92 -貓 > mÄo; #8C93 -è²” > pí; #8C94 -貕 > xÄ«; #8C95 -è²– > è; #8C96 -è²— > jù; #8C97 -貘 > mò; #8C98 -è²™ > chÅ«; #8C99 -貚 > tán; #8C9A -è²› > huÄn; #8C9B -貜 > jué; #8C9C -è² > bèi; #8C9D -貞 > zhÄ“n; #8C9E -貟 > yuán; #8C9F -è²  > fù; #8CA0 -財 > cái; #8CA1 -è²¢ > gòng; #8CA2 -è²£ > tè; #8CA3 -貤 > yí; #8CA4 -è²¥ > háng; #8CA5 -貦 > wàn; #8CA6 -貧 > pín; #8CA7 -貨 > hùo; #8CA8 -販 > fàn; #8CA9 -貪 > tÄn; #8CAA -貫 > guàn; #8CAB -責 > zé; #8CAC -è²­ > zhí; #8CAD -è²® > èr; #8CAE -貯 > zhÅ­; #8CAF -è²° > shì; #8CB0 -è²± > bì; #8CB1 -è²² > zÄ«; #8CB2 -è²³ > èr; #8CB3 -è²´ > gùi; #8CB4 -è²µ > piăn; #8CB5 -貶 > biăn; #8CB6 -è²· > măi; #8CB7 -貸 > dài; #8CB8 -è²¹ > shèng; #8CB9 -貺 > kuàng; #8CBA -è²» > fèi; #8CBB -è²¼ > tiÄ“; #8CBC -è²½ > yí; #8CBD -è²¾ > chí; #8CBE -貿 > mào; #8CBF -è³€ > hè; #8CC0 -è³ > bì; #8CC1 -賂 > lù; #8CC2 -賃 > rèn; #8CC3 -賄 > hùi; #8CC4 -è³… > gÄi; #8CC5 -賆 > pián; #8CC6 -資 > zÄ«; #8CC7 -賈 > jiă; #8CC8 -賉 > xù; #8CC9 -賊 > zéi; #8CCA -賋 > jiăo; #8CCB -賌 > gài; #8CCC -è³ > zÄng; #8CCD -賎 > jiàn; #8CCE -è³ > yìng; #8CCF -è³ > xùn; #8CD0 -賑 > zhèn; #8CD1 -è³’ > shÄ“; #8CD2 -賓 > bÄ«n; #8CD3 -è³” > bÄ«n; #8CD4 -賕 > qíu; #8CD5 -è³– > shÄ“; #8CD6 -è³— > chuàn; #8CD7 -賘 > zÄng; #8CD8 -è³™ > zhÅu; #8CD9 -賚 > lài; #8CDA -è³› > zàn; #8CDB -賜 > sì; #8CDC -è³ > chÄ“n; #8CDD -賞 > shăng; #8CDE -賟 > tiăn; #8CDF -è³  > péi; #8CE0 -賡 > gÄ“ng; #8CE1 -è³¢ > xián; #8CE2 -è³£ > mài; #8CE3 -賤 > jiàn; #8CE4 -è³¥ > sùi; #8CE5 -賦 > fù; #8CE6 -賧 > tàn; #8CE7 -賨 > cóng; #8CE8 -賩 > cóng; #8CE9 -質 > zhí; #8CEA -賫 > jÄ«; #8CEB -賬 > zhàng; #8CEC -è³­ > dÅ­; #8CED -è³® > jìn; #8CEE -賯 > xÄ«ong; #8CEF -è³° > shÅ­n; #8CF0 -è³± > yÅ­n; #8CF1 -è³² > băo; #8CF2 -è³³ > zÄi; #8CF3 -è³´ > lài; #8CF4 -è³µ > fèng; #8CF5 -賶 > càng; #8CF6 -è³· > jÄ«; #8CF7 -賸 > shèng; #8CF8 -è³¹ > ài; #8CF9 -賺 > zhuàn; #8CFA -è³» > fù; #8CFB -è³¼ > gòu; #8CFC -è³½ > sài; #8CFD -è³¾ > zé; #8CFE -賿 > liáo; #8CFF -è´€ > wèi; #8D00 -è´ > bài; #8D01 -è´‚ > chÄ•n; #8D02 -è´ƒ > zhuàn; #8D03 -è´„ > zhì; #8D04 -è´… > zhùi; #8D05 -è´† > biÄo; #8D06 -è´‡ > yÅ«n; #8D07 -è´ˆ > zèng; #8D08 -è´‰ > tăn; #8D09 -è´Š > zàn; #8D0A -è´‹ > yàn; #8D0B -è´ > shàn; #8D0D -è´Ž > wàn; #8D0E -è´ > yíng; #8D0F -è´ > jìn; #8D10 -è´‘ > găn; #8D11 -è´’ > xián; #8D12 -è´“ > zÄng; #8D13 -è´” > bì; #8D14 -è´• > dú; #8D15 -è´– > shú; #8D16 -è´— > yàn; #8D17 -è´™ > xuàn; #8D19 -è´š > lòng; #8D1A -è´› > gàn; #8D1B -è´œ > zÄng; #8D1C -è´ > bèi; #8D1D -è´ž > zhÄ“n; #8D1E -è´Ÿ > fù; #8D1F -è´  > yuán; #8D20 -è´¡ > gòng; #8D21 -è´¢ > cái; #8D22 -è´£ > zé; #8D23 -è´¤ > xián; #8D24 -è´¥ > bài; #8D25 -è´¦ > zhàng; #8D26 -è´§ > hùo; #8D27 -è´¨ > zhí; #8D28 -è´© > fàn; #8D29 -è´ª > tÄn; #8D2A -è´« > pín; #8D2B -è´¬ > biăn; #8D2C -è´­ > gòu; #8D2D -è´® > zhÅ­; #8D2E -è´¯ > guàn; #8D2F -è´° > èr; #8D30 -è´± > jiàn; #8D31 -è´² > bì; #8D32 -è´³ > shì; #8D33 -è´´ > tiÄ“; #8D34 -è´µ > gùi; #8D35 -è´¶ > kuàng; #8D36 -è´· > dài; #8D37 -è´¸ > mào; #8D38 -è´¹ > fèi; #8D39 -è´º > hè; #8D3A -è´» > yí; #8D3B -è´¼ > zéi; #8D3C -è´½ > zhì; #8D3D -è´¾ > jiă; #8D3E -è´¿ > hùi; #8D3F -èµ€ > zÄ«; #8D40 -èµ > rèn; #8D41 -赂 > lù; #8D42 -赃 > zÄng; #8D43 -资 > zÄ«; #8D44 -èµ… > gÄi; #8D45 -赆 > jìn; #8D46 -赇 > qíu; #8D47 -赈 > zhèn; #8D48 -赉 > lài; #8D49 -赊 > shÄ“; #8D4A -赋 > fù; #8D4B -赌 > dÅ­; #8D4C -èµ > jÄ«; #8D4D -赎 > shú; #8D4E -èµ > shăng; #8D4F -èµ > sì; #8D50 -赑 > bì; #8D51 -èµ’ > zhÅu; #8D52 -赓 > gÄ“ng; #8D53 -èµ” > péi; #8D54 -赕 > tàn; #8D55 -èµ– > lài; #8D56 -èµ— > fèng; #8D57 -赘 > zhùi; #8D58 -èµ™ > fù; #8D59 -赚 > zhuàn; #8D5A -èµ› > sài; #8D5B -赜 > zé; #8D5C -èµ > yàn; #8D5D -赞 > zàn; #8D5E -赟 > yÅ«n; #8D5F -èµ  > zèng; #8D60 -赡 > shàn; #8D61 -èµ¢ > yíng; #8D62 -èµ£ > gàn; #8D63 -赤 > chì; #8D64 -èµ¥ > xì; #8D65 -赦 > shè; #8D66 -赧 > năn; #8D67 -赨 > xíong; #8D68 -赩 > xì; #8D69 -赪 > chÄ“ng; #8D6A -赫 > hè; #8D6B -赬 > chÄ“ng; #8D6C -èµ­ > zhÄ•; #8D6D -èµ® > xiá; #8D6E -赯 > táng; #8D6F -èµ° > zÅu; #8D70 -èµ± > zÅu; #8D71 -èµ² > lì; #8D72 -èµ³ > jÄ­u; #8D73 -èµ´ > fù; #8D74 -èµµ > zhào; #8D75 -赶 > găn; #8D76 -èµ· > qÄ­; #8D77 -赸 > shàn; #8D78 -èµ¹ > qíong; #8D79 -赺 > qín; #8D7A -èµ» > xiăn; #8D7B -èµ¼ > cÄ«; #8D7C -èµ½ > jué; #8D7D -èµ¾ > qÄ­n; #8D7E -赿 > chí; #8D7F -趀 > cÄ«; #8D80 -è¶ > chèn; #8D81 -趂 > chèn; #8D82 -趃 > dié; #8D83 -趄 > jÅ«; #8D84 -超 > chÄo; #8D85 -趆 > dÄ«; #8D86 -趇 > sè; #8D87 -趈 > zhÄn; #8D88 -趉 > zhú; #8D89 -越 > yuè; #8D8A -趋 > qÅ«; #8D8B -趌 > jié; #8D8C -è¶ > chí; #8D8D -趎 > chú; #8D8E -è¶ > guÄ; #8D8F -è¶ > xuè; #8D90 -趑 > cÄ«; #8D91 -趒 > tiáo; #8D92 -趓 > dÅ­o; #8D93 -趔 > liè; #8D94 -趕 > găn; #8D95 -趖 > sÅ«o; #8D96 -趗 > cù; #8D97 -趘 > xí; #8D98 -趙 > zhào; #8D99 -趚 > sù; #8D9A -趛 > yÄ­n; #8D9B -趜 > jú; #8D9C -è¶ > jiàn; #8D9D -趞 > què; #8D9E -趟 > tàng; #8D9F -趠 > chùo; #8DA0 -趡 > cÅ­i; #8DA1 -趢 > lù; #8DA2 -趣 > qù; #8DA3 -趤 > dàng; #8DA4 -趥 > qÄ«u; #8DA5 -趦 > zÄ«; #8DA6 -趧 > tí; #8DA7 -趨 > qÅ«; #8DA8 -趩 > chì; #8DA9 -趪 > huáng; #8DAA -趫 > qiáo; #8DAB -趬 > qiáo; #8DAC -趭 > yào; #8DAD -趮 > zào; #8DAE -趯 > tì; #8DAF -趱 > zăn; #8DB1 -趲 > zăn; #8DB2 -足 > zú; #8DB3 -趴 > pÄ; #8DB4 -趵 > bào; #8DB5 -趶 > kù; #8DB6 -趷 > kÄ“; #8DB7 -趸 > dÅ­n; #8DB8 -趹 > jué; #8DB9 -趺 > fÅ«; #8DBA -趻 > chÄ•n; #8DBB -趼 > jiăn; #8DBC -趽 > fàng; #8DBD -趾 > zhÄ­; #8DBE -趿 > sà; #8DBF -è·€ > yuè; #8DC0 -è· > pá; #8DC1 -è·‚ > qí; #8DC2 -è·ƒ > yuè; #8DC3 -è·„ > qiÄng; #8DC4 -è·… > tùo; #8DC5 -è·† > tái; #8DC6 -è·‡ > yì; #8DC7 -è·ˆ > niăn; #8DC8 -è·‰ > líng; #8DC9 -è·Š > mèi; #8DCA -è·‹ > bá; #8DCB -è·Œ > diÄ“; #8DCC -è· > kÅ«; #8DCD -è·Ž > túo; #8DCE -è· > jiÄ; #8DCF -è· > cÄ­; #8DD0 -è·‘ > păo; #8DD1 -è·’ > qiă; #8DD2 -è·“ > zhù; #8DD3 -è·” > jÅ«; #8DD4 -è·• > dié; #8DD5 -è·– > zhÄ«; #8DD6 -è·— > fÅ«; #8DD7 -è·˜ > pán; #8DD8 -è·™ > jÅ­; #8DD9 -è·š > shÄn; #8DDA -è·› > bÅ; #8DDB -è·œ > ní; #8DDC -è· > jù; #8DDD -è·ž > lì; #8DDE -è·Ÿ > gÄ“n; #8DDF -è·  > yí; #8DE0 -è·¡ > jÄ«; #8DE1 -è·¢ > dài; #8DE2 -è·£ > xiăn; #8DE3 -è·¤ > jiÄo; #8DE4 -è·¥ > dùo; #8DE5 -è·¦ > zhÅ«; #8DE6 -è·§ > zhuÄn; #8DE7 -è·¨ > kuà; #8DE8 -è·© > zhuăi; #8DE9 -è·ª > gùi; #8DEA -è·« > qíong; #8DEB -è·¬ > kÅ­i; #8DEC -è·­ > xiáng; #8DED -è·® > chì; #8DEE -è·¯ > lù; #8DEF -è·° > bèng; #8DF0 -è·± > zhì; #8DF1 -è·² > jiá; #8DF2 -è·³ > tiào; #8DF3 -è·´ > căi; #8DF4 -è·µ > jiàn; #8DF5 -è·¶ > tà; #8DF6 -è·· > qiÄo; #8DF7 -è·¸ > bì; #8DF8 -è·¹ > xiÄn; #8DF9 -è·º > dùo; #8DFA -è·» > jÄ«; #8DFB -è·¼ > jú; #8DFC -è·½ > jì; #8DFD -è·¾ > shú; #8DFE -è·¿ > tú; #8DFF -踀 > chù; #8E00 -è¸ > jìng; #8E01 -踂 > niè; #8E02 -踃 > xiÄo; #8E03 -踄 > bó; #8E04 -踅 > chì; #8E05 -踆 > qÅ«n; #8E06 -踇 > mÅu; #8E07 -踈 > shÅ«; #8E08 -踉 > láng; #8E09 -踊 > yÅng; #8E0A -踋 > jiăo; #8E0B -踌 > chóu; #8E0C -è¸ > qiÄo; #8E0D -è¸ > tà; #8E0F -è¸ > jiàn; #8E10 -踑 > qí; #8E11 -踒 > wÅ; #8E12 -踓 > wÄ•i; #8E13 -踔 > zhúo; #8E14 -踕 > jié; #8E15 -踖 > jí; #8E16 -踗 > niÄ“; #8E17 -踘 > jú; #8E18 -踙 > jÅ«; #8E19 -踚 > lún; #8E1A -踛 > lù; #8E1B -踜 > lèng; #8E1C -è¸ > huái; #8E1D -踞 > jù; #8E1E -踟 > chí; #8E1F -踠 > wăn; #8E20 -踡 > quán; #8E21 -踢 > tÄ«; #8E22 -踣 > bó; #8E23 -踤 > zú; #8E24 -踥 > qiè; #8E25 -踦 > jÄ­; #8E26 -踧 > cù; #8E27 -踨 > zÅng; #8E28 -踩 > căi; #8E29 -踪 > zÅng; #8E2A -踫 > pèng; #8E2B -踬 > zhì; #8E2C -踭 > zhÄ“ng; #8E2D -踮 > diăn; #8E2E -踯 > zhí; #8E2F -踰 > yú; #8E30 -踱 > dùo; #8E31 -踲 > dùn; #8E32 -踳 > chÅ­n; #8E33 -踴 > yÅng; #8E34 -踵 > zhÅng; #8E35 -踶 > dì; #8E36 -踷 > zhÄ•; #8E37 -踸 > chÄ•n; #8E38 -踹 > chuài; #8E39 -踺 > jiàn; #8E3A -踻 > guÄ; #8E3B -踼 > táng; #8E3C -踽 > jÅ­; #8E3D -踾 > fú; #8E3E -踿 > zú; #8E3F -è¹€ > dié; #8E40 -è¹ > pián; #8E41 -蹂 > róu; #8E42 -蹃 > nùo; #8E43 -蹄 > tí; #8E44 -è¹… > chă; #8E45 -蹆 > tÅ­i; #8E46 -蹇 > jiăn; #8E47 -蹈 > dào; #8E48 -蹉 > cÅ«o; #8E49 -蹊 > xÄ«; #8E4A -蹋 > tà; #8E4B -蹌 > qiÄng; #8E4C -è¹ > zhăn; #8E4D -蹎 > diÄn; #8E4E -è¹ > tí; #8E4F -è¹ > jí; #8E50 -蹑 > niè; #8E51 -è¹’ > mán; #8E52 -蹓 > lÄ«u; #8E53 -è¹” > zhàn; #8E54 -蹕 > bì; #8E55 -è¹– > chÅng; #8E56 -è¹— > lù; #8E57 -蹘 > liáo; #8E58 -è¹™ > cù; #8E59 -蹚 > tÄng; #8E5A -è¹› > dài; #8E5B -蹜 > sÅ«o; #8E5C -è¹ > xÄ­; #8E5D -蹞 > kÅ­i; #8E5E -蹟 > jÄ«; #8E5F -è¹  > zhí; #8E60 -蹡 > qiÄng; #8E61 -è¹¢ > dí; #8E62 -è¹£ > mán; #8E63 -蹤 > zÅng; #8E64 -è¹¥ > lián; #8E65 -蹦 > bèng; #8E66 -蹧 > zÄo; #8E67 -蹨 > niăn; #8E68 -蹩 > bié; #8E69 -蹪 > túi; #8E6A -蹫 > jú; #8E6B -蹬 > dèng; #8E6C -è¹­ > cèng; #8E6D -è¹® > xiÄn; #8E6E -蹯 > fán; #8E6F -è¹° > chú; #8E70 -è¹± > zhÅng; #8E71 -è¹² > dÅ«n; #8E72 -è¹³ > bÅ; #8E73 -è¹´ > cù; #8E74 -è¹µ > zú; #8E75 -蹶 > jué; #8E76 -è¹· > jué; #8E77 -蹸 > lìn; #8E78 -è¹¹ > tà; #8E79 -蹺 > qiÄo; #8E7A -è¹» > qiÄo; #8E7B -è¹¼ > pú; #8E7C -è¹½ > liÄo; #8E7D -è¹¾ > dÅ«n; #8E7E -蹿 > cuÄn; #8E7F -躀 > kuàng; #8E80 -èº > zào; #8E81 -躂 > tà; #8E82 -躃 > bì; #8E83 -躄 > bì; #8E84 -躅 > zhú; #8E85 -躆 > jù; #8E86 -躇 > chú; #8E87 -躈 > qiào; #8E88 -躉 > dÅ­n; #8E89 -躊 > chóu; #8E8A -躋 > jÄ«; #8E8B -躌 > wÅ­; #8E8C -èº > yuè; #8E8D -躎 > niăn; #8E8E -èº > lìn; #8E8F -èº > liè; #8E90 -躑 > zhí; #8E91 -躒 > lì; #8E92 -躓 > zhì; #8E93 -躔 > chán; #8E94 -躕 > chú; #8E95 -躖 > duàn; #8E96 -躗 > wèi; #8E97 -躘 > lóng; #8E98 -躙 > lìn; #8E99 -躚 > xiÄn; #8E9A -躛 > wèi; #8E9B -躜 > zuÄn; #8E9C -èº > lán; #8E9D -躞 > xiè; #8E9E -躟 > ráng; #8E9F -躠 > xiÄ•; #8EA0 -躡 > niè; #8EA1 -躢 > tà; #8EA2 -躣 > qú; #8EA3 -躤 > jiè; #8EA4 -躥 > cuÄn; #8EA5 -躦 > zuÄn; #8EA6 -躧 > xÄ­; #8EA7 -躨 > kúi; #8EA8 -躩 > jué; #8EA9 -躪 > lìn; #8EAA -身 > shÄ“n; #8EAB -躬 > gÅng; #8EAC -躭 > dÄn; #8EAD -躯 > qÅ«; #8EAF -躰 > tÄ­; #8EB0 -躱 > dÅ­o; #8EB1 -躲 > dÅ­o; #8EB2 -躳 > gÅng; #8EB3 -躴 > láng; #8EB4 -躶 > lÅ­o; #8EB6 -躷 > ăi; #8EB7 -躸 > jÄ«; #8EB8 -躹 > jú; #8EB9 -躺 > tăng; #8EBA -躽 > yăn; #8EBD -躿 > kÄng; #8EBF -軀 > qÅ«; #8EC0 -è» > lóu; #8EC1 -軂 > lào; #8EC2 -軃 > tÅ­o; #8EC3 -軄 > zhí; #8EC4 -軆 > tÄ­; #8EC6 -軇 > dào; #8EC7 -軉 > yù; #8EC9 -車 > chÄ“; #8ECA -軋 > yà; #8ECB -軌 > gÅ­i; #8ECC -è» > jÅ«n; #8ECD -軎 > wèi; #8ECE -è» > yuè; #8ECF -è» > xìn; #8ED0 -軑 > dì; #8ED1 -è»’ > xuÄn; #8ED2 -軓 > fàn; #8ED3 -è»” > rèn; #8ED4 -軕 > shÄn; #8ED5 -è»– > qiáng; #8ED6 -è»— > shÅ«; #8ED7 -軘 > tún; #8ED8 -è»™ > chén; #8ED9 -軚 > dài; #8EDA -è»› > è; #8EDB -軜 > nà; #8EDC -è» > qí; #8EDD -軞 > máo; #8EDE -軟 > ruăn; #8EDF -è»  > rèn; #8EE0 -軡 > făn; #8EE1 -転 > zhuăn; #8EE2 -軣 > hÅng; #8EE3 -軤 > hÅ«; #8EE4 -軥 > qú; #8EE5 -軦 > huàng; #8EE6 -軧 > dÄ­; #8EE7 -軨 > líng; #8EE8 -軩 > dài; #8EE9 -軪 > Äo; #8EEA -軫 > zhÄ•n; #8EEB -軬 > fàn; #8EEC -è»­ > kuÄng; #8EED -è»® > ăng; #8EEE -軯 > pÄ“ng; #8EEF -è»° > bèi; #8EF0 -è»± > gÅ«; #8EF1 -軲 > kÅ«; #8EF2 -軳 > páo; #8EF3 -è»´ > zhù; #8EF4 -軵 > rÅng; #8EF5 -軶 > è; #8EF6 -è»· > bá; #8EF7 -軸 > zhóu; #8EF8 -軹 > zhÄ­; #8EF9 -軺 > yáo; #8EFA -è»» > kÄ“; #8EFB -軼 > yì; #8EFC -軽 > qÄ«ng; #8EFD -軾 > shì; #8EFE -軿 > píng; #8EFF -è¼€ > ér; #8F00 -è¼ > qíong; #8F01 -輂 > jú; #8F02 -較 > jiào; #8F03 -輄 > guÄng; #8F04 -è¼… > lù; #8F05 -輆 > kăi; #8F06 -輇 > quán; #8F07 -輈 > zhÅu; #8F08 -載 > zài; #8F09 -輊 > zhì; #8F0A -輋 > shÄ“; #8F0B -輌 > liàng; #8F0C -è¼ > yù; #8F0D -輎 > shÄo; #8F0E -è¼ > yóu; #8F0F -è¼ > huăn; #8F10 -輑 > yÅ­n; #8F11 -è¼’ > zhé; #8F12 -輓 > wăn; #8F13 -è¼” > fÅ­; #8F14 -輕 > qÄ«ng; #8F15 -è¼– > zhÅu; #8F16 -è¼— > ní; #8F17 -輘 > líng; #8F18 -è¼™ > zhé; #8F19 -輚 > zhàn; #8F1A -è¼› > liàng; #8F1B -輜 > zÄ«; #8F1C -è¼ > hÅ«i; #8F1D -輞 > wăng; #8F1E -輟 > chùo; #8F1F -è¼  > gÅ­o; #8F20 -輡 > kăn; #8F21 -è¼¢ > yÄ­; #8F22 -è¼£ > péng; #8F23 -輤 > qiàn; #8F24 -è¼¥ > gÅ­n; #8F25 -輦 > niăn; #8F26 -輧 > pián; #8F27 -輨 > guăn; #8F28 -輩 > bèi; #8F29 -輪 > lún; #8F2A -輫 > pái; #8F2B -輬 > liáng; #8F2C -è¼­ > ruăn; #8F2D -è¼® > róu; #8F2E -輯 > jí; #8F2F -è¼° > yáng; #8F30 -è¼± > xián; #8F31 -è¼² > chuán; #8F32 -è¼³ > còu; #8F33 -è¼´ > qÅ«n; #8F34 -è¼µ > gé; #8F35 -輶 > yóu; #8F36 -è¼· > hÅng; #8F37 -輸 > shÅ«; #8F38 -è¼¹ > fù; #8F39 -輺 > zÄ«; #8F3A -è¼» > fú; #8F3B -è¼¼ > wÄ“n; #8F3C -è¼½ > bèn; #8F3D -è¼¾ > zhăn; #8F3E -輿 > yú; #8F3F -è½€ > wÄ“n; #8F40 -è½ > tÄo; #8F41 -轂 > gÅ­; #8F42 -轃 > zhÄ“n; #8F43 -轄 > xiá; #8F44 -è½… > yuán; #8F45 -轆 > lù; #8F46 -轇 > jÄ«u; #8F47 -轈 > cháo; #8F48 -轉 > zhuăn; #8F49 -轊 > wèi; #8F4A -轋 > hún; #8F4B -è½ > chè; #8F4D -轎 > jiào; #8F4E -è½ > zhàn; #8F4F -è½ > pú; #8F50 -轑 > lăo; #8F51 -è½’ > fén; #8F52 -轓 > fÄn; #8F53 -è½” > lín; #8F54 -轕 > gé; #8F55 -è½– > sè; #8F56 -è½— > kăn; #8F57 -轘 > huàn; #8F58 -è½™ > yÄ­; #8F59 -轚 > jí; #8F5A -è½› > dùi; #8F5B -轜 > ér; #8F5C -è½ > yú; #8F5D -轞 > xiàn; #8F5E -轟 > hÅng; #8F5F -è½  > lÄ•i; #8F60 -轡 > pèi; #8F61 -è½¢ > lì; #8F62 -è½£ > lì; #8F63 -轤 > lú; #8F64 -è½¥ > lìn; #8F65 -车 > chÄ“; #8F66 -轧 > yà; #8F67 -轨 > gÅ­i; #8F68 -轩 > xuÄn; #8F69 -轪 > dì; #8F6A -轫 > rèn; #8F6B -转 > zhuăn; #8F6C -è½­ > è; #8F6D -è½® > lún; #8F6E -软 > ruăn; #8F6F -è½° > hÅng; #8F70 -è½± > kÅ«; #8F71 -è½² > kÄ“; #8F72 -è½³ > lú; #8F73 -è½´ > zhóu; #8F74 -è½µ > zhÄ­; #8F75 -轶 > yì; #8F76 -è½· > hÅ«; #8F77 -轸 > zhÄ•n; #8F78 -è½¹ > lì; #8F79 -轺 > yáo; #8F7A -è½» > qÄ«ng; #8F7B -è½¼ > shì; #8F7C -è½½ > zài; #8F7D -è½¾ > zhì; #8F7E -轿 > jiào; #8F7F -è¾€ > zhÅu; #8F80 -è¾ > quán; #8F81 -辂 > lù; #8F82 -较 > jiào; #8F83 -辄 > zhé; #8F84 -è¾… > fÅ­; #8F85 -辆 > liàng; #8F86 -辇 > niăn; #8F87 -辈 > bèi; #8F88 -辉 > hÅ«i; #8F89 -辊 > gÅ­n; #8F8A -辋 > wăng; #8F8B -辌 > liáng; #8F8C -è¾ > chùo; #8F8D -辎 > zÄ«; #8F8E -è¾ > còu; #8F8F -è¾ > fú; #8F90 -辑 > jí; #8F91 -è¾’ > wÄ“n; #8F92 -输 > shÅ«; #8F93 -è¾” > pèi; #8F94 -辕 > yuán; #8F95 -è¾– > xiá; #8F96 -è¾— > zhăn; #8F97 -辘 > lù; #8F98 -è¾™ > chè; #8F99 -辚 > lín; #8F9A -è¾› > xÄ«n; #8F9B -辜 > gÅ«; #8F9C -è¾ > cí; #8F9D -辞 > cí; #8F9E -辟 > pì; #8F9F -è¾  > zùi; #8FA0 -辡 > biàn; #8FA1 -è¾¢ > là; #8FA2 -è¾£ > là; #8FA3 -辤 > cí; #8FA4 -è¾¥ > xuÄ“; #8FA5 -辦 > bàn; #8FA6 -辧 > biàn; #8FA7 -辨 > biàn; #8FA8 -辩 > biàn; #8FA9 -辫 > biàn; #8FAB -辬 > bÄn; #8FAC -è¾­ > cí; #8FAD -è¾® > biàn; #8FAE -辯 > biàn; #8FAF -è¾° > chén; #8FB0 -è¾± > rù; #8FB1 -è¾² > nóng; #8FB2 -è¾³ > nóng; #8FB3 -è¾´ > zhÄ•n; #8FB4 -è¾µ > chùo; #8FB5 -辶 > chùo; #8FB6 -辸 > réng; #8FB8 -è¾¹ > biÄn; #8FB9 -辺 > biÄn; #8FBA -è¾½ > liáo; #8FBD -è¾¾ > dá; #8FBE -辿 > chÄn; #8FBF -è¿€ > gÄn; #8FC0 -è¿ > qiÄn; #8FC1 -è¿‚ > yÅ«; #8FC2 -迃 > yÅ«; #8FC3 -è¿„ > qì; #8FC4 -è¿… > xùn; #8FC5 -迆 > yÄ­; #8FC6 -过 > gùo; #8FC7 -迈 > mài; #8FC8 -迉 > qí; #8FC9 -è¿Š > zÄ; #8FCA -è¿‹ > wàng; #8FCB -è¿Œ > jia; #8FCC -è¿ > zhÅ«n; #8FCD -è¿Ž > yíng; #8FCE -è¿ > tì; #8FCF -è¿ > yùn; #8FD0 -è¿‘ > jìn; #8FD1 -è¿’ > háng; #8FD2 -è¿“ > yà; #8FD3 -è¿” > făn; #8FD4 -è¿• > wù; #8FD5 -è¿– > dá; #8FD6 -è¿— > é; #8FD7 -还 > huán; #8FD8 -è¿™ > zhè; #8FD9 -è¿› > jìn; #8FDB -è¿œ > yuăn; #8FDC -è¿ > wéi; #8FDD -è¿ž > lián; #8FDE -è¿Ÿ > chí; #8FDF -è¿  > chè; #8FE0 -è¿¡ > nì; #8FE1 -è¿¢ > tiáo; #8FE2 -è¿£ > zhì; #8FE3 -迤 > yÄ­; #8FE4 -è¿¥ > jÄ­ong; #8FE5 -迦 > jiÄ; #8FE6 -迧 > chén; #8FE7 -迨 > dài; #8FE8 -è¿© > Ä•r; #8FE9 -迪 > dí; #8FEA -è¿« > pò; #8FEB -迬 > wăng; #8FEC -è¿­ > dié; #8FED -è¿® > zé; #8FEE -迯 > táo; #8FEF -è¿° > shù; #8FF0 -迱 > túo; #8FF1 -迳 > jìng; #8FF3 -è¿´ > húi; #8FF4 -迵 > tóng; #8FF5 -迶 > yòu; #8FF6 -è¿· > mí; #8FF7 -迸 > bèng; #8FF8 -迹 > jÄ«; #8FF9 -迺 > năi; #8FFA -è¿» > yí; #8FFB -迼 > jié; #8FFC -追 > zhÅ«i; #8FFD -迾 > liè; #8FFE -è¿¿ > xùn; #8FFF -退 > tùi; #9000 -é€ > sòng; #9001 -适 > guÄ; #9002 -逃 > táo; #9003 -逄 > páng; #9004 -逅 > hòu; #9005 -逆 > nì; #9006 -逇 > dùn; #9007 -逈 > jÄ­ong; #9008 -选 > xuăn; #9009 -逊 > xùn; #900A -逋 > bÅ«; #900B -逌 > yóu; #900C -é€ > xiÄo; #900D -逎 > qíu; #900E -é€ > tòu; #900F -é€ > zhú; #9010 -逑 > qíu; #9011 -递 > dì; #9012 -逓 > dì; #9013 -途 > tú; #9014 -逕 > jìng; #9015 -逖 > tì; #9016 -逗 > dòu; #9017 -逘 > yÄ­; #9018 -這 > zhè; #9019 -通 > tÅng; #901A -逛 > guàng; #901B -逜 > wù; #901C -é€ > shì; #901D -逞 > chÄ•ng; #901E -速 > sù; #901F -造 > zào; #9020 -逡 > qÅ«n; #9021 -逢 > féng; #9022 -連 > lián; #9023 -逤 > sùo; #9024 -逥 > húi; #9025 -逦 > lÄ­; #9026 -逨 > lái; #9028 -逩 > bèn; #9029 -逪 > cùo; #902A -逫 > jué; #902B -逬 > bèng; #902C -逭 > huàn; #902D -逮 > dài; #902E -逯 > lù; #902F -逰 > yóu; #9030 -週 > zhÅu; #9031 -進 > jìn; #9032 -逳 > yù; #9033 -逴 > chùo; #9034 -逵 > kúi; #9035 -逶 > wÄ“i; #9036 -逷 > tì; #9037 -逸 > yì; #9038 -逹 > dá; #9039 -逺 > yuăn; #903A -逻 > lúo; #903B -逼 > bÄ«; #903C -逽 > nùo; #903D -逾 > yú; #903E -逿 > dàng; #903F -é€ > súi; #9040 -é > dùn; #9041 -é‚ > sùi; #9042 -éƒ > yăn; #9043 -é„ > chuán; #9044 -é… > chí; #9045 -é† > tí; #9046 -é‡ > yù; #9047 -éˆ > shí; #9048 -é‰ > zhÄ“n; #9049 -éŠ > yóu; #904A -é‹ > yùn; #904B -éŒ > è; #904C -é > biàn; #904D -éŽ > gùo; #904E -é > è; #904F -é > xiá; #9050 -é‘ > huáng; #9051 -é’ > qíu; #9052 -é“ > dào; #9053 -é” > dá; #9054 -é• > wéi; #9055 -é— > yí; #9057 -é˜ > gòu; #9058 -é™ > yáo; #9059 -éš > chù; #905A -é› > líu; #905B -éœ > xùn; #905C -é > tà; #905D -éž > dì; #905E -éŸ > chí; #905F -é  > yuăn; #9060 -é¡ > sù; #9061 -é¢ > tà; #9062 -é£ > qiăn; #9063 -é¥ > yáo; #9065 -é¦ > guàn; #9066 -é§ > zhÄng; #9067 -é¨ > áo; #9068 -é© > shì; #9069 -éª > cè; #906A -é« > chì; #906B -é¬ > sù; #906C -é­ > zÄo; #906D -é® > zhÄ“; #906E -é¯ > dùn; #906F -é° > dì; #9070 -é± > lóu; #9071 -é² > chí; #9072 -é³ > cÅ«o; #9073 -é´ > lín; #9074 -éµ > zÅ«n; #9075 -é¶ > rào; #9076 -é· > qiÄn; #9077 -é¸ > xuăn; #9078 -é¹ > yù; #9079 -éº > yí; #907A -é» > wù; #907B -é¼ > liáo; #907C -é½ > jù; #907D -é¾ > shì; #907E -é¿ > bì; #907F -é‚€ > yÄo; #9080 -é‚ > mài; #9081 -é‚‚ > xiè; #9082 -邃 > sùi; #9083 -é‚„ > huán; #9084 -é‚… > zhÄn; #9085 -邆 > téng; #9086 -邇 > Ä•r; #9087 -邈 > miăo; #9088 -邉 > biÄn; #9089 -é‚Š > biÄn; #908A -é‚‹ > lá; #908B -é‚Œ > lí; #908C -é‚ > yuán; #908D -é‚Ž > yáo; #908E -é‚ > lúo; #908F -é‚ > lÄ­; #9090 -é‚‘ > yì; #9091 -é‚’ > tíng; #9092 -é‚“ > dèng; #9093 -é‚” > qÄ­; #9094 -é‚• > yÅng; #9095 -é‚– > shÄn; #9096 -é‚— > hán; #9097 -邘 > yú; #9098 -é‚™ > máng; #9099 -é‚š > rú; #909A -é‚› > qíong; #909B -é‚ > kuàng; #909D -é‚ž > fÅ«; #909E -é‚Ÿ > kàng; #909F -é‚  > bÄ«n; #90A0 -é‚¡ > fÄng; #90A1 -é‚¢ > xíng; #90A2 -é‚£ > nà; #90A3 -邤 > xin; #90A4 -é‚¥ > shÄ•n; #90A5 -邦 > bÄng; #90A6 -邧 > yuán; #90A7 -邨 > cÅ«n; #90A8 -é‚© > hÅ­o; #90A9 -邪 > xié; #90AA -é‚« > bÄng; #90AB -邬 > wÅ«; #90AC -é‚­ > jù; #90AD -é‚® > yóu; #90AE -邯 > hán; #90AF -é‚° > tái; #90B0 -邱 > qÄ«u; #90B1 -邲 > bì; #90B2 -邳 > péi; #90B3 -é‚´ > bÄ­ng; #90B4 -邵 > shào; #90B5 -邶 > bèi; #90B6 -é‚· > wă; #90B7 -邸 > dÄ­; #90B8 -邹 > zÅu; #90B9 -邺 > yè; #90BA -é‚» > lín; #90BB -邼 > kuÄng; #90BC -邽 > gÅ«i; #90BD -邾 > zhÅ«; #90BE -é‚¿ > shÄ«; #90BF -郀 > kÅ«; #90C0 -éƒ > yù; #90C1 -郂 > gÄi; #90C2 -郃 > gé; #90C3 -郄 > xì; #90C4 -郅 > zhì; #90C5 -郆 > jí; #90C6 -郇 > xún; #90C7 -郈 > hòu; #90C8 -郉 > xíng; #90C9 -郊 > jiÄo; #90CA -郋 > xí; #90CB -郌 > gÅ«i; #90CC -éƒ > núo; #90CD -郎 > láng; #90CE -éƒ > jiá; #90CF -éƒ > kuài; #90D0 -郑 > zhèng; #90D1 -郓 > yùn; #90D3 -郔 > yán; #90D4 -郕 > chéng; #90D5 -郖 > dÅu; #90D6 -郗 > chÄ«; #90D7 -郘 > lÇš; #90D8 -郙 > fÅ­; #90D9 -郚 > wú; #90DA -郛 > fú; #90DB -郜 > gào; #90DC -éƒ > hăo; #90DD -郞 > láng; #90DE -郟 > jiá; #90DF -郠 > gÄ•ng; #90E0 -郡 > jùn; #90E1 -郢 > yÄ­ng; #90E2 -郣 > bó; #90E3 -郤 > xì; #90E4 -郥 > bèi; #90E5 -郦 > lì; #90E6 -郧 > yún; #90E7 -部 > bù; #90E8 -郩 > xiáo; #90E9 -郪 > qÄ«; #90EA -郫 > pí; #90EB -郬 > qÄ«ng; #90EC -郭 > gÅ«o; #90ED -郮 > zhou; #90EE -郯 > tán; #90EF -郰 > zÅu; #90F0 -郱 > píng; #90F1 -郲 > lái; #90F2 -郳 > ní; #90F3 -郴 > chÄ“n; #90F4 -郵 > yóu; #90F5 -郶 > bù; #90F6 -郷 > xiÄng; #90F7 -郸 > dÄn; #90F8 -郹 > jú; #90F9 -郺 > yÅng; #90FA -郻 > qiÄo; #90FB -郼 > yÄ«; #90FC -都 > dÅ«; #90FD -郾 > yăn; #90FE -郿 > méi; #90FF -é„€ > rùo; #9100 -é„ > bèi; #9101 -é„‚ > è; #9102 -鄃 > yú; #9103 -é„„ > juàn; #9104 -é„… > yÅ­; #9105 -鄆 > yùn; #9106 -鄇 > hòu; #9107 -鄈 > kúi; #9108 -鄉 > xiÄng; #9109 -é„Š > xiÄng; #910A -é„‹ > sÅu; #910B -é„Œ > táng; #910C -é„ > míng; #910D -é„Ž > xì; #910E -é„ > rù; #910F -é„ > chù; #9110 -é„‘ > zÄ«; #9111 -é„’ > zÅu; #9112 -é„“ > jú; #9113 -é„” > wÅ«; #9114 -é„• > xiÄng; #9115 -é„– > yún; #9116 -é„— > hào; #9117 -鄘 > yÅng; #9118 -é„™ > bÄ­; #9119 -é„š > mò; #911A -é„› > cháo; #911B -é„œ > fÅ«; #911C -é„ > liăo; #911D -é„ž > yín; #911E -é„Ÿ > zhuÄn; #911F -é„  > hù; #9120 -é„¡ > qiÄo; #9121 -é„¢ > yÄn; #9122 -é„£ > zhÄng; #9123 -鄤 > fàn; #9124 -é„¥ > qiÄo; #9125 -鄦 > xÅ­; #9126 -鄧 > dèng; #9127 -鄨 > bì; #9128 -é„© > xín; #9129 -鄪 > bì; #912A -é„« > céng; #912B -鄬 > wéi; #912C -é„­ > zhèng; #912D -é„® > mào; #912E -鄯 > shàn; #912F -é„° > lín; #9130 -鄱 > pó; #9131 -鄲 > dÄn; #9132 -鄳 > méng; #9133 -é„´ > yè; #9134 -鄵 > cÄo; #9135 -鄶 > kuài; #9136 -é„· > fÄ“ng; #9137 -鄸 > méng; #9138 -鄹 > zÅu; #9139 -鄺 > kuàng; #913A -é„» > lián; #913B -鄼 > zàn; #913C -鄽 > chán; #913D -鄾 > yÅu; #913E -é„¿ > qí; #913F -é…€ > yÄn; #9140 -é… > chán; #9141 -é…‚ > zàn; #9142 -é…ƒ > líng; #9143 -é…„ > huÄn; #9144 -é…… > xÄ«; #9145 -é…† > fÄ“ng; #9146 -é…‡ > zàn; #9147 -é…ˆ > lì; #9148 -é…‰ > yÅu; #9149 -é…Š > dÄ­ng; #914A -é…‹ > qíu; #914B -é…Œ > zhúo; #914C -é… > pèi; #914D -é…Ž > zhòu; #914E -é… > yí; #914F -é… > hăng; #9150 -é…‘ > yÅ­; #9151 -é…’ > jÄ­u; #9152 -é…“ > yăn; #9153 -é…” > zùi; #9154 -é…• > máo; #9155 -é…– > dÄn; #9156 -é…— > xù; #9157 -é…˜ > tóu; #9158 -é…™ > zhÄ“n; #9159 -é…š > fÄ“n; #915A -é… > yùn; #915D -é…ž > tài; #915E -é…Ÿ > tiÄn; #915F -é…  > qiă; #9160 -é…¡ > túo; #9161 -é…¢ > zùo; #9162 -é…£ > hÄn; #9163 -é…¤ > gÅ«; #9164 -é…¥ > sÅ«; #9165 -é…¦ > pò; #9166 -é…§ > chóu; #9167 -é…¨ > zài; #9168 -é…© > míng; #9169 -é…ª > lùo; #916A -é…« > chùo; #916B -é…¬ > chóu; #916C -é…­ > yòu; #916D -é…® > tóng; #916E -é…¯ > zhÄ­; #916F -é…° > xiÄn; #9170 -é…± > jiàng; #9171 -é…² > chéng; #9172 -é…³ > yìn; #9173 -é…´ > tú; #9174 -é…µ > xiào; #9175 -é…¶ > méi; #9176 -é…· > kù; #9177 -é…¸ > suÄn; #9178 -é…¹ > lèi; #9179 -é…º > pú; #917A -é…» > zùi; #917B -é…¼ > hăi; #917C -é…½ > yàn; #917D -é…¾ > xÄ­; #917E -é…¿ > niàng; #917F -醀 > wéi; #9180 -é† > lù; #9181 -醂 > lăn; #9182 -醃 > yÄn; #9183 -醄 > táo; #9184 -醅 > pÄ“i; #9185 -醆 > zhăn; #9186 -醇 > chún; #9187 -醈 > tán; #9188 -醉 > zùi; #9189 -醊 > chùo; #918A -醋 > cù; #918B -醌 > kÅ«n; #918C -é† > tí; #918D -醎 > mián; #918E -é† > dÅ«; #918F -é† > hú; #9190 -醑 > xÅ­; #9191 -醒 > xÄ­ng; #9192 -醓 > tăn; #9193 -醔 > jÄ«u; #9194 -醕 > chún; #9195 -醖 > yùn; #9196 -醗 > pò; #9197 -醘 > kè; #9198 -醙 > sÅu; #9199 -醚 > mí; #919A -醛 > quán; #919B -醜 > chÅu; #919C -é† > cúo; #919D -醞 > yùn; #919E -醟 > yòng; #919F -醠 > àng; #91A0 -醡 > zhà; #91A1 -醢 > hăi; #91A2 -醣 > táng; #91A3 -醤 > jiàng; #91A4 -醥 > piăo; #91A5 -醦 > shăn; #91A6 -醧 > yù; #91A7 -醨 > lí; #91A8 -醩 > záo; #91A9 -醪 > láo; #91AA -醫 > yÄ«; #91AB -醬 > jiàng; #91AC -醭 > pÅ«; #91AD -醮 > jiào; #91AE -醯 > xÄ«; #91AF -醰 > tán; #91B0 -醱 > pò; #91B1 -醲 > nóng; #91B2 -醳 > yì; #91B3 -醴 > lÄ­; #91B4 -醵 > jù; #91B5 -醶 > jiào; #91B6 -醷 > yì; #91B7 -醸 > niàng; #91B8 -醹 > rú; #91B9 -醺 > xÅ«n; #91BA -醻 > chóu; #91BB -醼 > yàn; #91BC -醽 > líng; #91BD -醾 > mí; #91BE -醿 > mí; #91BF -釀 > niàng; #91C0 -é‡ > xìn; #91C1 -釂 > jiào; #91C2 -釃 > xÄ­; #91C3 -釄 > mí; #91C4 -釅 > yàn; #91C5 -釆 > biàn; #91C6 -采 > căi; #91C7 -釈 > shì; #91C8 -釉 > yòu; #91C9 -释 > shì; #91CA -釋 > shì; #91CB -里 > lÄ­; #91CC -é‡ > zhòng; #91CD -野 > yÄ•; #91CE -é‡ > liàng; #91CF -é‡ > lí; #91D0 -金 > jÄ«n; #91D1 -釒 > jÄ«n' 'zì' 'páng; #91D2 -釓 > qíu; #91D3 -釔 > yÄ­; #91D4 -釕 > diăo; #91D5 -釖 > dÄo; #91D6 -釗 > zhÄo; #91D7 -釘 > dÄ«ng; #91D8 -釙 > pò; #91D9 -釚 > qíu; #91DA -釛 > hé; #91DB -釜 > fÅ­; #91DC -é‡ > zhÄ“n; #91DD -釞 > zhí; #91DE -釟 > bÄ; #91DF -釠 > luàn; #91E0 -釡 > fÅ­; #91E1 -釢 > nái; #91E2 -釣 > diào; #91E3 -釤 > shàn; #91E4 -釥 > qiăo; #91E5 -釦 > kòu; #91E6 -釧 > chuàn; #91E7 -釨 > zÄ­; #91E8 -釩 > fán; #91E9 -釪 > yú; #91EA -釫 > huá; #91EB -釬 > hàn; #91EC -釭 > gÅng; #91ED -釮 > qí; #91EE -釯 > máng; #91EF -釰 > rì; #91F0 -釱 > dì; #91F1 -釲 > sì; #91F2 -釳 > xì; #91F3 -釴 > yì; #91F4 -釵 > chÄi; #91F5 -釶 > shÄ«; #91F6 -釷 > tÅ­; #91F7 -釸 > xì; #91F8 -釹 > nÇš; #91F9 -釺 > qiÄn; #91FA -釼 > jiàn; #91FC -釽 > pÄ«; #91FD -釾 > yé; #91FE -釿 > yín; #91FF -鈀 > bă; #9200 -éˆ > fÄng; #9201 -鈂 > chén; #9202 -鈃 > xíng; #9203 -鈄 > tÅu; #9204 -鈅 > yuè; #9205 -鈆 > yán; #9206 -鈇 > fÅ«; #9207 -鈈 > pÄ«; #9208 -鈉 > nà; #9209 -鈊 > xÄ«n; #920A -鈋 > é; #920B -鈌 > jué; #920C -éˆ > dùn; #920D -鈎 > gÅu; #920E -éˆ > yÄ­n; #920F -éˆ > qián; #9210 -鈑 > băn; #9211 -鈒 > jí; #9212 -鈓 > rén; #9213 -鈔 > chÄo; #9214 -鈕 > nÄ­u; #9215 -鈖 > fÄ“n; #9216 -鈗 > yÅ­n; #9217 -鈘 > jÄ­; #9218 -鈙 > qín; #9219 -鈚 > pí; #921A -鈛 > gÅ«o; #921B -鈜 > hóng; #921C -éˆ > yín; #921D -鈞 > jÅ«n; #921E -鈟 > shÄ«; #921F -鈠 > yì; #9220 -鈡 > zhÅng; #9221 -鈢 > niÄ“; #9222 -鈣 > gài; #9223 -鈤 > rì; #9224 -鈥 > húo; #9225 -鈦 > tài; #9226 -鈧 > kàng; #9227 -鈬 > dúo; #922C -鈭 > zÄ«; #922D -鈮 > nÄ­; #922E -鈯 > tú; #922F -鈰 > shì; #9230 -鈱 > mín; #9231 -鈲 > gÅ«; #9232 -鈳 > Ä“; #9233 -鈴 > líng; #9234 -鈵 > bìng; #9235 -鈶 > yí; #9236 -鈷 > gÅ«; #9237 -鈸 > bá; #9238 -鈹 > pÄ«; #9239 -鈺 > yù; #923A -鈻 > sì; #923B -鈼 > zúo; #923C -鈽 > bù; #923D -鈾 > yóu; #923E -鈿 > diàn; #923F -鉀 > jiă; #9240 -é‰ > zhÄ“n; #9241 -鉂 > shÄ­; #9242 -鉃 > shì; #9243 -鉄 > tiÄ•; #9244 -鉅 > jù; #9245 -鉆 > zhÄn; #9246 -鉇 > shÄ«; #9247 -鉈 > shé; #9248 -鉉 > xuàn; #9249 -鉊 > zhÄo; #924A -鉋 > bào; #924B -鉌 > hé; #924C -é‰ > bì; #924D -鉎 > shÄ“ng; #924E -é‰ > chú; #924F -é‰ > shí; #9250 -鉑 > bó; #9251 -鉒 > zhù; #9252 -鉓 > chì; #9253 -鉔 > zÄ; #9254 -鉕 > pÅ; #9255 -鉖 > tóng; #9256 -鉗 > qián; #9257 -鉘 > fú; #9258 -鉙 > zhăi; #9259 -鉚 > lÄ­u; #925A -鉛 > qiÄn; #925B -鉜 > fú; #925C -é‰ > lì; #925D -鉞 > yuè; #925E -鉟 > pÄ«; #925F -鉠 > yÄng; #9260 -鉡 > bàn; #9261 -鉢 > bÅ; #9262 -鉣 > jié; #9263 -鉤 > gÅu; #9264 -鉥 > shù; #9265 -鉦 > zhÄ“ng; #9266 -鉧 > mÅ­; #9267 -鉨 > nÄ­; #9268 -鉩 > niÄ“; #9269 -鉪 > dì; #926A -鉫 > jiÄ; #926B -鉬 > mù; #926C -鉭 > dàn; #926D -鉮 > shÄ“n; #926E -鉯 > yÄ­; #926F -鉰 > sÄ«; #9270 -鉱 > kuàng; #9271 -鉲 > kă; #9272 -鉳 > bÄ•i; #9273 -鉴 > jiàn; #9274 -鉵 > tóng; #9275 -鉶 > xíng; #9276 -鉷 > hóng; #9277 -鉸 > jiăo; #9278 -鉹 > chÄ­; #9279 -鉺 > èr; #927A -鉻 > gè; #927B -鉼 > bÄ­ng; #927C -鉽 > shì; #927D -鉾 > móu; #927E -鉿 > jiá; #927F -銀 > yín; #9280 -éŠ > jÅ«n; #9281 -銂 > zhÅu; #9282 -銃 > chòng; #9283 -銄 > shàng; #9284 -銅 > tóng; #9285 -銆 > mò; #9286 -銇 > lèi; #9287 -銈 > jÄ«; #9288 -銉 > yù; #9289 -銊 > xù; #928A -銋 > rén; #928B -銌 > zùn; #928C -éŠ > zhì; #928D -銎 > qÄ«ong; #928E -éŠ > shàn; #928F -éŠ > chì; #9290 -銑 > xiăn; #9291 -銒 > xíng; #9292 -銓 > quán; #9293 -銔 > pÄ«; #9294 -銕 > tiÄ•; #9295 -銖 > zhÅ«; #9296 -銗 > hóu; #9297 -銘 > míng; #9298 -銙 > kuă; #9299 -銚 > yáo; #929A -銛 > xiÄn; #929B -銜 > xián; #929C -éŠ > xÄ«u; #929D -銞 > jÅ«n; #929E -銟 > chÄ; #929F -銠 > lăo; #92A0 -銡 > jí; #92A1 -銢 > pÄ­; #92A2 -銣 > rÅ­; #92A3 -銤 > mÄ­; #92A4 -銥 > yÄ­; #92A5 -銦 > yÄ«n; #92A6 -銧 > guÄng; #92A7 -銨 > Än; #92A8 -銩 > diÅu; #92A9 -銪 > yÅu; #92AA -銫 > sè; #92AB -銬 > kào; #92AC -銭 > qián; #92AD -銮 > luán; #92AE -銰 > Äi; #92B0 -銱 > diào; #92B1 -銲 > hàn; #92B2 -銳 > rùi; #92B3 -銴 > shì; #92B4 -銵 > kÄ“ng; #92B5 -銶 > qíu; #92B6 -銷 > xiÄo; #92B7 -銸 > zhé; #92B8 -銹 > xìu; #92B9 -銺 > zàng; #92BA -銻 > tì; #92BB -銼 > cùo; #92BC -銽 > guÄ; #92BD -銾 > gÅng; #92BE -銿 > zhÅng; #92BF -é‹€ > dòu; #92C0 -é‹ > lÇš; #92C1 -é‹‚ > méi; #92C2 -鋃 > láng; #92C3 -é‹„ > wăn; #92C4 -é‹… > xÄ«n; #92C5 -鋆 > yún; #92C6 -鋇 > bèi; #92C7 -鋈 > wù; #92C8 -鋉 > sù; #92C9 -é‹Š > yù; #92CA -é‹‹ > chán; #92CB -é‹Œ > tÄ­ng; #92CC -é‹ > bó; #92CD -é‹Ž > hàn; #92CE -é‹ > jiá; #92CF -é‹ > hóng; #92D0 -é‹‘ > cuÄn; #92D1 -é‹’ > fÄ“ng; #92D2 -é‹“ > chÄn; #92D3 -é‹” > wăn; #92D4 -é‹• > zhì; #92D5 -é‹– > sÄ«; #92D6 -é‹— > xuÄn; #92D7 -鋘 > wú; #92D8 -é‹™ > wú; #92D9 -é‹š > tiáo; #92DA -é‹› > gÅng; #92DB -é‹œ > zhúo; #92DC -é‹ > lÇœe; #92DD -é‹ž > xíng; #92DE -é‹Ÿ > qiÄn; #92DF -é‹  > shèn; #92E0 -é‹¡ > hán; #92E1 -é‹¢ > lÇœe; #92E2 -é‹£ > xié; #92E3 -鋤 > chú; #92E4 -é‹¥ > zhèng; #92E5 -鋦 > jú; #92E6 -鋧 > xiàn; #92E7 -鋨 > tiÄ•; #92E8 -é‹© > máng; #92E9 -鋪 > pÅ«; #92EA -é‹« > lí; #92EB -鋬 > pàn; #92EC -é‹­ > rùi; #92ED -é‹® > chéng; #92EE -鋯 > gào; #92EF -é‹° > lÄ­; #92F0 -鋱 > tè; #92F1 -鋳 > zhù; #92F3 -鋵 > tÅ«; #92F5 -鋶 > lÄ­u; #92F6 -é‹· > zùi; #92F7 -鋸 > jù; #92F8 -鋹 > chăng; #92F9 -鋺 > yuÄn; #92FA -é‹» > jiàn; #92FB -鋼 > gÄng; #92FC -鋽 > diào; #92FD -鋾 > táo; #92FE -é‹¿ > cháng; #92FF -錀 > lún; #9300 -éŒ > kuă; #9301 -錂 > líng; #9302 -錃 > bÄ“i; #9303 -錄 > lù; #9304 -錅 > lí; #9305 -錆 > qiÄng; #9306 -錇 > póu; #9307 -錈 > juàn; #9308 -錉 > mín; #9309 -錊 > zùi; #930A -錋 > péng; #930B -錌 > àn; #930C -éŒ > pí; #930D -錎 > xiàn; #930E -éŒ > yà; #930F -éŒ > zhÅ«i; #9310 -錑 > lèi; #9311 -錒 > Ä; #9312 -錓 > kÅng; #9313 -錔 > tà; #9314 -錕 > kÅ«n; #9315 -錖 > dÅ­; #9316 -錗 > wèi; #9317 -錘 > chúi; #9318 -錙 > zÄ«; #9319 -錚 > zhÄ“ng; #931A -錛 > bÄ“n; #931B -錜 > niÄ“; #931C -éŒ > cóng; #931D -錞 > qún; #931E -錟 > tán; #931F -錠 > dìng; #9320 -錡 > qí; #9321 -錢 > qián; #9322 -錣 > zhúo; #9323 -錤 > qí; #9324 -錥 > yù; #9325 -錦 > jÄ­n; #9326 -錧 > guăn; #9327 -錨 > máo; #9328 -錩 > chÄng; #9329 -錪 > tiăn; #932A -錫 > xí; #932B -錬 > liàn; #932C -錭 > táo; #932D -錮 > gù; #932E -錯 > cùo; #932F -錰 > shù; #9330 -錱 > zhÄ“n; #9331 -録 > lù; #9332 -錳 > mÄ•ng; #9333 -錴 > lù; #9334 -錵 > huÄ; #9335 -錶 > biăo; #9336 -錷 > gá; #9337 -錸 > lái; #9338 -錹 > kÄ•n; #9339 -錼 > nài; #933C -錽 > wăn; #933D -錾 > zàn; #933E -é€ > dé; #9340 -é > xiÄn; #9341 -éƒ > hÅ«o; #9343 -é„ > liàng; #9344 -é† > mén; #9346 -é‡ > kăi; #9347 -éˆ > yÄ«ng; #9348 -é‰ > dÄ«; #9349 -éŠ > liàn; #934A -é‹ > gÅ«o; #934B -éŒ > xiăn; #934C -é > dù; #934D -éŽ > tú; #934E -é > wéi; #934F -é > cÅng; #9350 -é‘ > fù; #9351 -é’ > róu; #9352 -é“ > jí; #9353 -é” > è; #9354 -é• > róu; #9355 -é– > chÄ•n; #9356 -é— > tí; #9357 -é˜ > zhá; #9358 -é™ > hòng; #9359 -éš > yáng; #935A -é› > duàn; #935B -éœ > xiÄ; #935C -é > yú; #935D -éž > kÄ“ng; #935E -éŸ > xÄ«ng; #935F -é  > huáng; #9360 -é¡ > wÄ•i; #9361 -é¢ > fù; #9362 -é£ > zhÄo; #9363 -é¤ > chá; #9364 -é¥ > qiè; #9365 -é¦ > shé; #9366 -é§ > hÅng; #9367 -é¨ > kúi; #9368 -é© > tiăn; #9369 -éª > móu; #936A -é« > qiÄo; #936B -é¬ > qiÄo; #936C -é­ > hóu; #936D -é® > tÅu; #936E -é¯ > cÅng; #936F -é° > huán; #9370 -é± > yè; #9371 -é² > mín; #9372 -é³ > jiàn; #9373 -é´ > duÄn; #9374 -éµ > jiàn; #9375 -é¶ > sÅng; #9376 -é· > kÅ«i; #9377 -é¸ > hú; #9378 -é¹ > xuÄn; #9379 -éº > dÅ­o; #937A -é» > jié; #937B -é¼ > zhÄ“n; #937C -é½ > biÄn; #937D -é¾ > zhÅng; #937E -é¿ > zÄ«; #937F -鎀 > xÄ«u; #9380 -éŽ > yé; #9381 -鎂 > mÄ•i; #9382 -鎃 > pài; #9383 -鎄 > Äi; #9384 -鎅 > jiè; #9385 -鎇 > méi; #9387 -鎈 > chÅ«o; #9388 -鎉 > tà; #9389 -鎊 > bàng; #938A -鎋 > xiá; #938B -鎌 > lián; #938C -éŽ > sÅ­o; #938D -鎎 > xì; #938E -éŽ > líu; #938F -éŽ > zú; #9390 -鎑 > yè; #9391 -鎒 > nòu; #9392 -鎓 > wÄ“ng; #9393 -鎔 > róng; #9394 -鎕 > táng; #9395 -鎖 > sÅ­o; #9396 -鎗 > qiÄng; #9397 -鎘 > gé; #9398 -鎙 > shùo; #9399 -鎚 > chúi; #939A -鎛 > bó; #939B -鎜 > pán; #939C -éŽ > sà; #939D -鎞 > bì; #939E -鎟 > săng; #939F -鎠 > gÄng; #93A0 -鎡 > zÄ«; #93A1 -鎢 > wù; #93A2 -鎣 > yìng; #93A3 -鎤 > huăng; #93A4 -鎥 > tiáo; #93A5 -鎦 > líu; #93A6 -鎧 > kăi; #93A7 -鎨 > sÅ­n; #93A8 -鎩 > shÄ; #93A9 -鎪 > sÅu; #93AA -鎫 > wàn; #93AB -鎬 > hào; #93AC -鎭 > zhèn; #93AD -鎮 > zhèn; #93AE -鎯 > lÅ­o; #93AF -鎰 > yì; #93B0 -鎱 > yuán; #93B1 -鎲 > tăng; #93B2 -鎳 > niè; #93B3 -鎴 > xí; #93B4 -鎵 > jiÄ; #93B5 -鎶 > gÄ“; #93B6 -鎷 > mă; #93B7 -鎸 > juÄn; #93B8 -鎻 > sÅ­o; #93BB -鎿 > ná; #93BF -é€ > lÅ­; #93C0 -é > sÅ­o; #93C1 -é‚ > Åu; #93C2 -éƒ > zú; #93C3 -é„ > tuán; #93C4 -é… > xÄ«u; #93C5 -é† > guàn; #93C6 -é‡ > xuàn; #93C7 -éˆ > liàn; #93C8 -é‰ > shòu; #93C9 -éŠ > áo; #93CA -é‹ > măn; #93CB -éŒ > mò; #93CC -é > lúo; #93CD -éŽ > bì; #93CE -é > wèi; #93CF -é > líu; #93D0 -é‘ > dí; #93D1 -é’ > qiÄo; #93D2 -é“ > cÅng; #93D3 -é” > yí; #93D4 -é• > lù; #93D5 -é– > áo; #93D6 -é— > kÄ“ng; #93D7 -é˜ > qiÄng; #93D8 -é™ > cÅ«i; #93D9 -éš > qì; #93DA -é› > cháng; #93DB -éœ > tÄng; #93DC -é > màn; #93DD -éž > yÅng; #93DE -éŸ > chăn; #93DF -é  > fÄ“ng; #93E0 -é¡ > jìng; #93E1 -é¢ > biÄo; #93E2 -é£ > shù; #93E3 -é¤ > lòu; #93E4 -é¥ > xìu; #93E5 -é¦ > cÅng; #93E6 -é§ > lóng; #93E7 -é¨ > zàn; #93E8 -é© > jiàn; #93E9 -éª > cáo; #93EA -é« > lí; #93EB -é¬ > xià; #93EC -é­ > xÄ«; #93ED -é® > kÄng; #93EE -é° > bèng; #93F0 -é³ > zhÄ“ng; #93F3 -é´ > lù; #93F4 -éµ > huá; #93F5 -é¶ > jí; #93F6 -é· > pú; #93F7 -é¸ > hùi; #93F8 -é¹ > qiÄng; #93F9 -éº > pÅ; #93FA -é» > lín; #93FB -é¼ > sÅ­o; #93FC -é½ > xìu; #93FD -é¾ > săn; #93FE -é¿ > chÄ“ng; #93FF -é€ > kùi; #9400 -é > sÄ«; #9401 -é‚ > lìu; #9402 -éƒ > náo; #9403 -é„ > héng; #9404 -é… > piÄ•; #9405 -é† > sùi; #9406 -é‡ > fán; #9407 -éˆ > qiáo; #9408 -é‰ > quÄn; #9409 -éŠ > yáng; #940A -é‹ > tàng; #940B -éŒ > xiàng; #940C -é > jué; #940D -éŽ > jiÄo; #940E -é > zÅ«n; #940F -é > liáo; #9410 -é‘ > jié; #9411 -é’ > láo; #9412 -é“ > dùi; #9413 -é” > tán; #9414 -é• > zÄn; #9415 -é– > jÄ«; #9416 -é— > jiăn; #9417 -é˜ > zhÅng; #9418 -é™ > dÄ“ng; #9419 -éš > yà; #941A -é› > yìng; #941B -éœ > dùi; #941C -é > jué; #941D -éž > nòu; #941E -éŸ > tì; #941F -é  > pÅ­; #9420 -é¡ > tiÄ•; #9421 -é¤ > dÄ­ng; #9424 -é¥ > shàn; #9425 -é¦ > kÄi; #9426 -é§ > jiăn; #9427 -é¨ > fèi; #9428 -é© > sùi; #9429 -éª > lÅ­; #942A -é« > juÄn; #942B -é¬ > hùi; #942C -é­ > yù; #942D -é® > lián; #942E -é¯ > zhúo; #942F -é° > qiÄo; #9430 -é± > qiÄn; #9431 -é² > zhúo; #9432 -é³ > léi; #9433 -é´ > bì; #9434 -éµ > tiÄ•; #9435 -é¶ > huán; #9436 -é· > yè; #9437 -é¸ > dúo; #9438 -é¹ > gÅ­o; #9439 -éº > dÄng; #943A -é» > jù; #943B -é¼ > fén; #943C -é½ > dá; #943D -é¾ > bèi; #943E -é¿ > yì; #943F -é‘€ > ài; #9440 -é‘ > zÅng; #9441 -é‘‚ > xùn; #9442 -鑃 > diào; #9443 -é‘„ > zhù; #9444 -é‘… > héng; #9445 -鑆 > zhùi; #9446 -鑇 > jÄ«; #9447 -鑈 > niÄ“; #9448 -鑉 > tà; #9449 -é‘Š > hùo; #944A -é‘‹ > qìng; #944B -é‘Œ > bÄ«n; #944C -é‘ > yÄ«ng; #944D -é‘Ž > kùi; #944E -é‘ > níng; #944F -é‘ > xÅ«; #9450 -é‘‘ > jiàn; #9451 -é‘’ > jiàn; #9452 -é‘” > chă; #9454 -é‘• > zhì; #9455 -é‘– > miè; #9456 -é‘— > lí; #9457 -鑘 > léi; #9458 -é‘™ > jÄ«; #9459 -é‘š > zuàn; #945A -é‘› > kuàng; #945B -é‘œ > shàng; #945C -é‘ > péng; #945D -é‘ž > là; #945E -é‘Ÿ > dú; #945F -é‘  > shùo; #9460 -é‘¡ > chùo; #9461 -é‘¢ > lÇœ; #9462 -é‘£ > biÄo; #9463 -鑤 > bào; #9464 -é‘¥ > lÅ­; #9465 -鑨 > lóng; #9468 -é‘© > è; #9469 -鑪 > lú; #946A -é‘« > xÄ«n; #946B -鑬 > jiàn; #946C -é‘­ > làn; #946D -é‘® > bó; #946E -鑯 > jiÄn; #946F -é‘° > yào; #9470 -鑱 > chán; #9471 -鑲 > xiÄng; #9472 -鑳 > jiàn; #9473 -é‘´ > xÄ«; #9474 -鑵 > guàn; #9475 -鑶 > cáng; #9476 -é‘· > niè; #9477 -鑸 > lÄ•i; #9478 -鑹 > cuàn; #9479 -鑺 > qú; #947A -é‘» > pàn; #947B -鑼 > lúo; #947C -鑽 > zuàn; #947D -鑾 > luán; #947E -é‘¿ > záo; #947F -é’€ > niè; #9480 -é’ > jué; #9481 -é’‚ > tăng; #9482 -é’ƒ > shÅ­; #9483 -é’„ > lán; #9484 -é’… > jÄ«n; #9485 -é’† > qíu; #9486 -é’‡ > yÄ­; #9487 -é’ˆ > zhÄ“n; #9488 -é’‰ > dÄ«ng; #9489 -é’Š > zhÄo; #948A -é’‹ > pò; #948B -é’Œ > diăo; #948C -é’ > tÅ­; #948D -é’Ž > qiÄn; #948E -é’ > chuàn; #948F -é’ > shàn; #9490 -é’‘ > jí; #9491 -é’’ > fán; #9492 -é’“ > diào; #9493 -é’” > mén; #9494 -é’• > nÇš; #9495 -é’– > xí; #9496 -é’— > chÄi; #9497 -é’˜ > xíng; #9498 -é’™ > gài; #9499 -é’š > bù; #949A -é’› > tài; #949B -é’œ > jù; #949C -é’ > dùn; #949D -é’ž > chÄo; #949E -é’Ÿ > zhÅng; #949F -é’  > nà; #94A0 -é’¡ > bèi; #94A1 -é’¢ > gÄng; #94A2 -é’£ > băn; #94A3 -é’¤ > qián; #94A4 -é’¥ > yào; #94A5 -é’¦ > qÄ«n; #94A6 -é’§ > jÅ«n; #94A7 -é’¨ > wù; #94A8 -é’© > gÅu; #94A9 -é’ª > kàng; #94AA -é’« > fÄng; #94AB -é’¬ > húo; #94AC -é’­ > tÅu; #94AD -é’® > nÄ­u; #94AE -é’¯ > bă; #94AF -é’° > yù; #94B0 -é’± > qián; #94B1 -é’² > zhÄ“ng; #94B2 -é’³ > qián; #94B3 -é’´ > gÅ«; #94B4 -é’µ > bÅ; #94B5 -é’¶ > Ä“; #94B6 -é’· > pÅ; #94B7 -é’¸ > bù; #94B8 -é’¹ > bá; #94B9 -é’º > yuè; #94BA -é’» > zuàn; #94BB -é’¼ > mù; #94BC -é’½ > dàn; #94BD -é’¾ > jiă; #94BE -é’¿ > diàn; #94BF -é“€ > yóu; #94C0 -é“ > tiÄ•; #94C1 -é“‚ > bó; #94C2 -铃 > líng; #94C3 -é“„ > shùo; #94C4 -é“… > qiÄn; #94C5 -铆 > lÄ­u; #94C6 -铇 > bào; #94C7 -铈 > shì; #94C8 -铉 > xuàn; #94C9 -é“Š > shé; #94CA -é“‹ > bì; #94CB -é“Œ > nÄ­; #94CC -é“ > pÄ«; #94CD -é“Ž > dúo; #94CE -é“ > xíng; #94CF -é“ > kào; #94D0 -é“‘ > lăo; #94D1 -é“’ > èr; #94D2 -é““ > máng; #94D3 -é“” > yà; #94D4 -é“• > yÅu; #94D5 -é“– > chéng; #94D6 -é“— > jiá; #94D7 -铘 > yé; #94D8 -é“™ > náo; #94D9 -é“š > zhì; #94DA -é“› > dÄng; #94DB -é“œ > tóng; #94DC -é“ > lÇš; #94DD -é“ž > diào; #94DE -é“Ÿ > yÄ«n; #94DF -é“  > kăi; #94E0 -é“¡ > zhá; #94E1 -é“¢ > zhÅ«; #94E2 -é“£ > xiăn; #94E3 -铤 > tÄ­ng; #94E4 -é“¥ > dÄ«u; #94E5 -铦 > xiÄn; #94E6 -铧 > huá; #94E7 -铨 > quán; #94E8 -é“© > shÄ; #94E9 -铪 > jiá; #94EA -é“« > yáo; #94EB -铬 > gè; #94EC -é“­ > míng; #94ED -é“® > zhÄ“ng; #94EE -铯 > sè; #94EF -é“° > jiăo; #94F0 -铱 > yÄ­; #94F1 -铲 > chăn; #94F2 -铳 > chòng; #94F3 -é“´ > tàng; #94F4 -铵 > Än; #94F5 -银 > yín; #94F6 -é“· > rÅ­; #94F7 -铸 > zhù; #94F8 -铹 > láo; #94F9 -铺 > pÅ«; #94FA -é“» > wú; #94FB -铼 > lái; #94FC -铽 > tè; #94FD -链 > liàn; #94FE -é“¿ > kÄ“ng; #94FF -销 > xiÄo; #9500 -é” > sÅ­o; #9501 -锂 > lÄ­; #9502 -锃 > zhèng; #9503 -锄 > chú; #9504 -é”… > gÅ«o; #9505 -锆 > gào; #9506 -锇 > tiÄ•; #9507 -锈 > xìu; #9508 -锉 > cùo; #9509 -锊 > lÇœe; #950A -锋 > fÄ“ng; #950B -锌 > xÄ«n; #950C -é” > lÄ­u; #950D -锎 > kÄi; #950E -é” > jiăn; #950F -é” > rùi; #9510 -锑 > tì; #9511 -é”’ > láng; #9512 -锓 > qiÄn; #9513 -é”” > jú; #9514 -锕 > Ä; #9515 -é”– > qiÄng; #9516 -é”— > dÅ­o; #9517 -锘 > tiăn; #9518 -é”™ > cùo; #9519 -锚 > máo; #951A -é”› > bÄ“n; #951B -锜 > qí; #951C -é” > dé; #951D -锞 > kuă; #951E -锟 > kÅ«n; #951F -é”  > chÄng; #9520 -锡 > xí; #9521 -锢 > gù; #9522 -锣 > lúo; #9523 -锤 > chúi; #9524 -锥 > zhÅ«i; #9525 -锦 > jÄ­n; #9526 -锧 > zhì; #9527 -锨 > xiÄn; #9528 -锩 > juàn; #9529 -锪 > hÅ«o; #952A -锫 > póu; #952B -锬 > tán; #952C -é”­ > dìng; #952D -é”® > jiàn; #952E -锯 > jù; #952F -é”° > mÄ•ng; #9530 -é”± > zÄ«; #9531 -锲 > qiè; #9532 -锳 > yÄ«ng; #9533 -é”´ > kăi; #9534 -锵 > qiÄng; #9535 -锶 > sÅng; #9536 -é”· > è; #9537 -锸 > chá; #9538 -锹 > qiÄo; #9539 -锺 > zhÅng; #953A -é”» > duàn; #953B -锼 > sÅu; #953C -锽 > huáng; #953D -锾 > huán; #953E -锿 > Äi; #953F -é•€ > dù; #9540 -é• > mÄ•i; #9541 -é•‚ > lòu; #9542 -镃 > zÄ«; #9543 -é•„ > fèi; #9544 -é•… > méi; #9545 -镆 > mò; #9546 -镇 > zhèn; #9547 -镈 > bó; #9548 -镉 > gé; #9549 -é•Š > niè; #954A -é•‹ > tăng; #954B -é•Œ > juÄn; #954C -é• > niè; #954D -é•Ž > ná; #954E -é• > líu; #954F -é• > hào; #9550 -é•‘ > bàng; #9551 -é•’ > yì; #9552 -é•“ > jiÄ; #9553 -é•” > bÄ«n; #9554 -é•• > róng; #9555 -é•– > biÄo; #9556 -é•— > tÄng; #9557 -镘 > màn; #9558 -é•™ > lúo; #9559 -é•š > bèng; #955A -é•› > yÅng; #955B -é•œ > jìng; #955C -é• > dí; #955D -é•ž > zú; #955E -é•Ÿ > xuàn; #955F -é•  > líu; #9560 -é•¡ > tán; #9561 -é•¢ > jué; #9562 -é•£ > liáo; #9563 -镤 > pú; #9564 -é•¥ > lÅ­; #9565 -镦 > dùi; #9566 -镧 > làn; #9567 -镨 > pÅ­; #9568 -é•© > cuàn; #9569 -镪 > qiÄng; #956A -é•« > dÄ“ng; #956B -镬 > hùo; #956C -é•­ > léi; #956D -é•® > huán; #956E -镯 > zhúo; #956F -é•° > lián; #9570 -镱 > yì; #9571 -镲 > chă; #9572 -镳 > biÄo; #9573 -é•´ > là; #9574 -镵 > chán; #9575 -镶 > xiÄng; #9576 -é•· > cháng; #9577 -镸 > cháng; #9578 -镹 > jÄ­u; #9579 -镺 > ăo; #957A -é•» > dié; #957B -镼 > qÅ«; #957C -镽 > liăo; #957D -镾 > mí; #957E -é•¿ > cháng; #957F -é–€ > mén; #9580 -é– > mà; #9581 -é–‚ > shuÄn; #9582 -é–ƒ > shăn; #9583 -é–„ > hùo; #9584 -é–… > mén; #9585 -é–† > yàn; #9586 -é–‡ > bì; #9587 -é–ˆ > hàn; #9588 -é–‰ > bì; #9589 -é–‹ > kÄi; #958B -é–Œ > kàng; #958C -é– > bÄ“ng; #958D -é–Ž > hóng; #958E -é– > rùn; #958F -é– > sàn; #9590 -é–‘ > xián; #9591 -é–’ > xián; #9592 -é–“ > jiÄn; #9593 -é–” > mÄ­n; #9594 -é–• > xiÄ; #9595 -é–— > dòu; #9597 -é–˜ > zhá; #9598 -é–™ > nào; #9599 -é–š > jian; #959A -é–› > pÄ“ng; #959B -é–œ > xiă; #959C -é– > líng; #959D -é–ž > biàn; #959E -é–Ÿ > bì; #959F -é–  > rùn; #95A0 -é–¡ > hé; #95A1 -é–¢ > guÄn; #95A2 -é–£ > gé; #95A3 -é–¤ > gé; #95A4 -é–¥ > fá; #95A5 -é–¦ > chù; #95A6 -é–§ > hòng; #95A7 -é–¨ > gÅ«i; #95A8 -é–© > mÄ­n; #95A9 -é–« > kÅ­n; #95AB -é–¬ > lăng; #95AC -é–­ > lǘ; #95AD -é–® > tíng; #95AE -é–¯ > shà; #95AF -é–° > jú; #95B0 -é–± > yuè; #95B1 -é–² > yuè; #95B2 -é–³ > chăn; #95B3 -é–´ > qù; #95B4 -é–µ > lìn; #95B5 -é–¶ > chÄng; #95B6 -é–· > shài; #95B7 -é–¸ > kÅ­n; #95B8 -é–¹ > yÄn; #95B9 -é–º > mín; #95BA -é–» > yán; #95BB -é–¼ > è; #95BC -é–½ > hÅ«n; #95BD -é–¾ > yù; #95BE -é–¿ > wén; #95BF -é—€ > xiàng; #95C0 -é— > bao; #95C1 -é—‚ > xiàng; #95C2 -é—ƒ > qù; #95C3 -é—„ > yăo; #95C4 -é—… > wén; #95C5 -é—† > băn; #95C6 -é—‡ > àn; #95C7 -é—ˆ > wéi; #95C8 -é—‰ > yÄ«n; #95C9 -é—Š > kùo; #95CA -é—‹ > què; #95CB -é—Œ > lán; #95CC -é— > dÅ«; #95CD -é— > tián; #95D0 -é—‘ > niè; #95D1 -é—’ > tà; #95D2 -é—“ > kăi; #95D3 -é—” > hé; #95D4 -é—• > què; #95D5 -é—– > chuăng; #95D6 -é—— > guÄn; #95D7 -é—˜ > dòu; #95D8 -é—™ > qÄ­; #95D9 -é—š > kÅ«i; #95DA -é—› > táng; #95DB -é—œ > guÄn; #95DC -é— > piáo; #95DD -é—ž > kàn; #95DE -é—Ÿ > xì; #95DF -é—  > hùi; #95E0 -é—¡ > chăn; #95E1 -é—¢ > pì; #95E2 -é—£ > dàng; #95E3 -é—¤ > huán; #95E4 -é—¥ > tà; #95E5 -é—¦ > wén; #95E6 -é—¨ > mén; #95E8 -é—© > shuÄn; #95E9 -é—ª > shăn; #95EA -é—« > yàn; #95EB -é—¬ > hàn; #95EC -é—­ > bì; #95ED -é—® > wèn; #95EE -é—¯ > chuăng; #95EF -é—° > rùn; #95F0 -é—± > wéi; #95F1 -é—² > xián; #95F2 -é—³ > hóng; #95F3 -é—´ > jiÄn; #95F4 -é—µ > mÄ­n; #95F5 -é—¶ > kàng; #95F6 -é—· > mèn; #95F7 -é—¸ > zhá; #95F8 -é—¹ > nào; #95F9 -é—º > gÅ«i; #95FA -é—» > wén; #95FB -é—¼ > tà; #95FC -é—½ > mÄ­n; #95FD -é—¾ > lǘ; #95FE -é—¿ > kăi; #95FF -阀 > fá; #9600 -é˜ > gé; #9601 -阂 > hé; #9602 -阃 > kÅ­n; #9603 -阄 > jÄ«u; #9604 -阅 > yuè; #9605 -阆 > lăng; #9606 -阇 > dÅ«; #9607 -阈 > yù; #9608 -阉 > yÄn; #9609 -阊 > chÄng; #960A -阋 > xì; #960B -阌 > wén; #960C -é˜ > hÅ«n; #960D -阎 > yán; #960E -é˜ > è; #960F -é˜ > chăn; #9610 -阑 > lán; #9611 -阒 > qù; #9612 -阓 > hùi; #9613 -阔 > kùo; #9614 -阕 > què; #9615 -阖 > gé; #9616 -阗 > tián; #9617 -阘 > tà; #9618 -阙 > què; #9619 -阚 > kàn; #961A -阛 > huán; #961B -阜 > fù; #961C -é˜ > fù; #961D -阞 > lè; #961E -队 > dùi; #961F -阠 > xìn; #9620 -阡 > qiÄn; #9621 -阢 > wù; #9622 -阣 > yì; #9623 -阤 > túo; #9624 -阥 > yÄ«n; #9625 -阦 > yáng; #9626 -阧 > dÅu; #9627 -阨 > è; #9628 -阩 > shÄ“ng; #9629 -阪 > băn; #962A -阫 > péi; #962B -阬 > kÄ“ng; #962C -阭 > yÅ­n; #962D -阮 > ruăn; #962E -阯 > zhÄ­; #962F -阰 > pí; #9630 -阱 > jÄ­ng; #9631 -防 > fáng; #9632 -阳 > yáng; #9633 -阴 > yÄ«n; #9634 -阵 > zhèn; #9635 -阶 > jiÄ“; #9636 -阷 > chÄ“ng; #9637 -阸 > è; #9638 -阹 > qÅ«; #9639 -阺 > dÄ­; #963A -阻 > zÅ­; #963B -阼 > zùo; #963C -阽 > diàn; #963D -阾 > lÄ­ng; #963E -阿 > Ä; #963F -陀 > túo; #9640 -é™ > túo; #9641 -陂 > pÅ; #9642 -陃 > bÄ­ng; #9643 -附 > fù; #9644 -é™… > jì; #9645 -陆 > lù; #9646 -陇 > lÅng; #9647 -陈 > chén; #9648 -陉 > xíng; #9649 -陊 > dùo; #964A -陋 > lòu; #964B -陌 > mò; #964C -é™ > jiàng; #964D -陎 > shÅ«; #964E -é™ > dùo; #964F -é™ > xiàn; #9650 -陑 > ér; #9651 -é™’ > gÅ­i; #9652 -陓 > yÅ«; #9653 -é™” > gÄi; #9654 -陕 > shăn; #9655 -é™– > xùn; #9656 -é™— > qiào; #9657 -陘 > xíng; #9658 -é™™ > chún; #9659 -陚 > fù; #965A -é™› > bì; #965B -陜 > xiá; #965C -é™ > shăn; #965D -陞 > shÄ“ng; #965E -陟 > zhì; #965F -é™  > pÅ«; #9660 -陡 > dÅu; #9661 -院 > yuàn; #9662 -陣 > zhèn; #9663 -除 > chú; #9664 -陥 > xiàn; #9665 -陧 > niè; #9667 -陨 > yÅ­n; #9668 -险 > xiăn; #9669 -陪 > péi; #966A -陫 > péi; #966B -陬 > zÅu; #966C -é™­ > yÄ«; #966D -é™® > dÅ­i; #966E -陯 > lún; #966F -é™° > yÄ«n; #9670 -é™± > jÅ«; #9671 -陲 > chúi; #9672 -陳 > chén; #9673 -é™´ > pí; #9674 -陵 > líng; #9675 -陶 > táo; #9676 -é™· > xiàn; #9677 -陸 > lù; #9678 -陹 > sheng; #9679 -険 > xiăn; #967A -é™» > yÄ«n; #967B -陼 > zhÅ­; #967C -陽 > yáng; #967D -陾 > réng; #967E -陿 > shăn; #967F -隀 > chóng; #9680 -éš > yàn; #9681 -éš‚ > yÄ«n; #9682 -隃 > yú; #9683 -éš„ > tí; #9684 -éš… > yú; #9685 -隆 > lóng; #9686 -隇 > wÄ“i; #9687 -隈 > wÄ“i; #9688 -隉 > niè; #9689 -隊 > dùi; #968A -éš‹ > súi; #968B -隌 > ăn; #968C -éš > huáng; #968D -階 > jiÄ“; #968E -éš > súi; #968F -éš > yÄ­n; #9690 -éš‘ > gÄi; #9691 -éš’ > yăn; #9692 -éš“ > hÅ«i; #9693 -éš” > gé; #9694 -éš• > yÅ­n; #9695 -éš– > wù; #9696 -éš— > wÄ•i; #9697 -隘 > ài; #9698 -éš™ > xì; #9699 -éšš > táng; #969A -éš› > jì; #969B -éšœ > zhàng; #969C -éš > dăo; #969D -éšž > áo; #969E -隟 > xì; #969F -éš  > yÄ­n; #96A0 -隢 > rào; #96A2 -隣 > lín; #96A3 -隤 > túi; #96A4 -隥 > dèng; #96A5 -隦 > pÄ­; #96A6 -隧 > sùi; #96A7 -隨 > súi; #96A8 -éš© > yù; #96A9 -險 > xiăn; #96AA -éš« > fÄ“n; #96AB -隬 > nÄ­; #96AC -éš­ > ér; #96AD -éš® > jÄ«; #96AE -隯 > dăo; #96AF -éš° > xí; #96B0 -éš± > yÄ­n; #96B1 -éš² > é; #96B2 -éš³ > hÅ«i; #96B3 -éš´ > lÅng; #96B4 -éšµ > xÄ«; #96B5 -隶 > lì; #96B6 -éš· > lì; #96B7 -隸 > lì; #96B8 -éš¹ > zhÅ«i; #96B9 -隺 > hè; #96BA -éš» > zhÄ«; #96BB -éš¼ > zhÅ­n; #96BC -éš½ > jùn; #96BD -éš¾ > nán; #96BE -éš¿ > yì; #96BF -雀 > què; #96C0 -é› > yàn; #96C1 -雂 > qián; #96C2 -雃 > yă; #96C3 -雄 > xíong; #96C4 -é›… > yă; #96C5 -集 > jí; #96C6 -雇 > gù; #96C7 -雈 > huán; #96C8 -雉 > zhì; #96C9 -雊 > gòu; #96CA -雋 > jùn; #96CB -雌 > cí; #96CC -é› > yÅng; #96CD -雎 > jÅ«; #96CE -é› > chú; #96CF -é› > hÅ«; #96D0 -雑 > zá; #96D1 -é›’ > lùo; #96D2 -雓 > yú; #96D3 -é›” > chóu; #96D4 -雕 > diÄo; #96D5 -é›– > sÅ«i; #96D6 -é›— > hàn; #96D7 -雘 > hùo; #96D8 -é›™ > shuÄng; #96D9 -雚 > guàn; #96DA -é›› > chú; #96DB -雜 > zá; #96DC -é› > yÅng; #96DD -雞 > jÄ«; #96DE -雟 > xÄ«; #96DF -é›  > chóu; #96E0 -雡 > lìu; #96E1 -離 > lí; #96E2 -難 > nán; #96E3 -雤 > xué; #96E4 -雥 > zá; #96E5 -雦 > jí; #96E6 -雧 > jí; #96E7 -雨 > yÅ­; #96E8 -雩 > yú; #96E9 -雪 > xuÄ•; #96EA -雫 > nă; #96EB -雬 > fÅu; #96EC -é›­ > sè; #96ED -é›® > mù; #96EE -雯 > wén; #96EF -é›° > fÄ“n; #96F0 -é›± > páng; #96F1 -雲 > yún; #96F2 -雳 > lì; #96F3 -é›´ > lì; #96F4 -雵 > ăng; #96F5 -零 > líng; #96F6 -é›· > léi; #96F7 -雸 > án; #96F8 -雹 > báo; #96F9 -雺 > méng; #96FA -é›» > diàn; #96FB -雼 > dàng; #96FC -雽 > xíng; #96FD -雾 > wù; #96FE -雿 > zhào; #96FF -需 > xÅ«; #9700 -éœ > jì; #9701 -霂 > mù; #9702 -霃 > chén; #9703 -霄 > xiÄo; #9704 -霅 > zhá; #9705 -霆 > tíng; #9706 -震 > zhèn; #9707 -霈 > pèi; #9708 -霉 > méi; #9709 -霊 > líng; #970A -霋 > qÄ«; #970B -霌 > chÅu; #970C -éœ > hùo; #970D -霎 > shà; #970E -éœ > fÄ“i; #970F -éœ > wÄ“ng; #9710 -霑 > zhÄn; #9711 -霒 > yÄ«n; #9712 -霓 > ní; #9713 -霔 > chòu; #9714 -霕 > tún; #9715 -霖 > lín; #9716 -霘 > dòng; #9718 -霙 > yÄ«ng; #9719 -霚 > wù; #971A -霛 > líng; #971B -霜 > shuÄng; #971C -éœ > líng; #971D -霞 > xiá; #971E -霟 > hóng; #971F -霠 > yÄ«n; #9720 -霡 > mò; #9721 -霢 > mài; #9722 -霣 > yÅ­n; #9723 -霤 > lìu; #9724 -霥 > mèng; #9725 -霦 > bÄ«n; #9726 -霧 > wù; #9727 -霨 > wèi; #9728 -霩 > hùo; #9729 -霪 > yín; #972A -霫 > xí; #972B -霬 > yì; #972C -霭 > ăi; #972D -霮 > dàn; #972E -霯 > dèng; #972F -霰 > xiàn; #9730 -霱 > yù; #9731 -露 > lù; #9732 -霳 > lóng; #9733 -霴 > dài; #9734 -霵 > jí; #9735 -霶 > páng; #9736 -霷 > yáng; #9737 -霸 > bà; #9738 -霹 > pÄ«; #9739 -霺 > wéi; #973A -霼 > xÄ­; #973C -霽 > jì; #973D -霾 > mái; #973E -霿 > mèng; #973F -é€ > méng; #9740 -é > léi; #9741 -é‚ > lì; #9742 -éƒ > hùo; #9743 -é„ > ăi; #9744 -é… > fèi; #9745 -é† > dài; #9746 -é‡ > lóng; #9747 -éˆ > líng; #9748 -é‰ > ài; #9749 -éŠ > fÄ“ng; #974A -é‹ > lì; #974B -éŒ > băo; #974C -éŽ > hè; #974E -é > hè; #974F -é > bìng; #9750 -é‘ > qÄ«ng; #9751 -é’ > qÄ«ng; #9752 -é“ > jìng; #9753 -é” > tiÄn; #9754 -é• > zhÄ“n; #9755 -é– > jìng; #9756 -é— > chèng; #9757 -é˜ > qìng; #9758 -é™ > jìng; #9759 -éš > jìng; #975A -é› > diàn; #975B -éœ > jìng; #975C -é > tiÄn; #975D -éž > fÄ“i; #975E -éŸ > fÄ“i; #975F -é  > kào; #9760 -é¡ > mÄ­; #9761 -é¢ > miàn; #9762 -é£ > miàn; #9763 -é¤ > pào; #9764 -é¥ > yè; #9765 -é¦ > tiăn; #9766 -é§ > hùi; #9767 -é¨ > yè; #9768 -é© > gé; #9769 -éª > dÄ«ng; #976A -é« > chÄ; #976B -é¬ > jiÄn; #976C -é­ > rèn; #976D -é® > dí; #976E -é¯ > dù; #976F -é° > wù; #9770 -é± > rèn; #9771 -é² > qín; #9772 -é³ > jìn; #9773 -é´ > xuÄ“; #9774 -éµ > nÄ­u; #9775 -é¶ > bă; #9776 -é· > yÄ­n; #9777 -é¸ > să; #9778 -é¹ > nà; #9779 -éº > mò; #977A -é» > zÅ­; #977B -é¼ > dá; #977C -é½ > bàn; #977D -é¾ > yì; #977E -é¿ > yào; #977F -鞀 > táo; #9780 -éž > túo; #9781 -éž‚ > jiá; #9782 -鞃 > hóng; #9783 -éž„ > páo; #9784 -éž… > yăng; #9785 -鞇 > yÄ«n; #9787 -鞈 > jiá; #9788 -鞉 > táo; #9789 -鞊 > jí; #978A -éž‹ > xié; #978B -鞌 > Än; #978C -éž > Än; #978D -鞎 > hén; #978E -éž > gÅng; #978F -éž‘ > dá; #9791 -éž’ > qiÄo; #9792 -éž“ > tÄ«ng; #9793 -éž” > wăn; #9794 -éž• > yìng; #9795 -éž– > sÅ«i; #9796 -éž— > tiáo; #9797 -鞘 > qiào; #9798 -éž™ > xuàn; #9799 -éžš > kòng; #979A -éž› > bÄ•ng; #979B -éžœ > tà; #979C -éž > zhăng; #979D -éžž > bÄ­ng; #979E -鞟 > kùo; #979F -éž  > jú; #97A0 -éž¡ > la; #97A1 -鞢 > xiè; #97A2 -鞣 > róu; #97A3 -鞤 > bÄng; #97A4 -鞥 > yì; #97A5 -鞦 > qÄ«u; #97A6 -鞧 > qÄ«u; #97A7 -鞨 > hé; #97A8 -éž© > xiào; #97A9 -鞪 > mù; #97AA -éž« > jú; #97AB -鞬 > jiÄn; #97AC -éž­ > biÄn; #97AD -éž® > dÄ«; #97AE -鞯 > jiÄn; #97AF -éž± > tÄo; #97B1 -éž² > gÅu; #97B2 -éž³ > tà; #97B3 -éž´ > bèi; #97B4 -éžµ > xié; #97B5 -鞶 > pán; #97B6 -éž· > gé; #97B7 -鞸 > bì; #97B8 -éž¹ > kùo; #97B9 -鞺 > tang; #97BA -éž» > lóu; #97BB -éž¼ > gùi; #97BC -éž½ > qiáo; #97BD -éž¾ > xuÄ“; #97BE -éž¿ > jÄ«; #97BF -韀 > jiÄn; #97C0 -éŸ > jiÄng; #97C1 -韂 > chàn; #97C2 -韃 > dá; #97C3 -韄 > hùo; #97C4 -韅 > xiăn; #97C5 -韆 > qiÄn; #97C6 -韇 > dú; #97C7 -韈 > wà; #97C8 -韉 > jiÄn; #97C9 -韊 > lán; #97CA -韋 > wéi; #97CB -韌 > rèn; #97CC -éŸ > fú; #97CD -韎 > mèi; #97CE -éŸ > juàn; #97CF -éŸ > gé; #97D0 -韑 > wÄ•i; #97D1 -韒 > qiào; #97D2 -韓 > hán; #97D3 -韔 > chàng; #97D4 -韖 > róu; #97D6 -韗 > xùn; #97D7 -韘 > shè; #97D8 -韙 > wÄ•i; #97D9 -韚 > gé; #97DA -韛 > bèi; #97DB -韜 > tÄo; #97DC -éŸ > gÅu; #97DD -韞 > yùn; #97DE -韠 > bì; #97E0 -韡 > wÄ•i; #97E1 -韢 > hùi; #97E2 -韣 > dú; #97E3 -韤 > wà; #97E4 -韥 > dú; #97E5 -韦 > wéi; #97E6 -韧 > rèn; #97E7 -韨 > fú; #97E8 -韩 > hán; #97E9 -韪 > wÄ•i; #97EA -韫 > yùn; #97EB -韬 > tÄo; #97EC -韭 > jÄ­u; #97ED -韮 > jÄ­u; #97EE -韯 > xiÄn; #97EF -韰 > xiè; #97F0 -韱 > xiÄn; #97F1 -韲 > jÄ«; #97F2 -音 > yÄ«n; #97F3 -韴 > zá; #97F4 -韵 > yùn; #97F5 -韶 > sháo; #97F6 -韷 > lè; #97F7 -韸 > péng; #97F8 -韹 > héng; #97F9 -韺 > yÄ«ng; #97FA -韻 > yùn; #97FB -韼 > péng; #97FC -韽 > yÄ«n; #97FD -韾 > yÄ«n; #97FE -響 > xiăng; #97FF -é € > hù; #9800 -é  > yè; #9801 -é ‚ > dÄ­ng; #9802 -é ƒ > qÄ­ng; #9803 -é „ > pàn; #9804 -é … > xiàng; #9805 -é † > shùn; #9806 -é ‡ > hÄn; #9807 -é ˆ > xÅ«; #9808 -é ‰ > yí; #9809 -é Š > xù; #980A -é ‹ > gù; #980B -é Œ > sòng; #980C -é  > kÅ­i; #980D -é Ž > qí; #980E -é  > háng; #980F -é  > yù; #9810 -é ‘ > wán; #9811 -é ’ > bÄn; #9812 -é “ > dùn; #9813 -é ” > dí; #9814 -é • > dÄn; #9815 -é – > pàn; #9816 -é — > pÅ; #9817 -é ˜ > lÄ­ng; #9818 -é ™ > cè; #9819 -é š > jÄ­ng; #981A -é › > lÄ•i; #981B -é œ > hé; #981C -é  > qiÄo; #981D -é ž > è; #981E -é Ÿ > é; #981F -é   > wÄ•i; #9820 -é ¡ > jié; #9821 -é ¢ > guÄ; #9822 -é £ > shÄ•n; #9823 -é ¤ > yí; #9824 -é ¥ > shÄ•n; #9825 -é ¦ > hái; #9826 -é § > dÅ«i; #9827 -é ¨ > piÄn; #9828 -é © > pÄ«ng; #9829 -é ª > lèi; #982A -é « > fÅ­; #982B -é ¬ > jiá; #982C -é ­ > tóu; #982D -é ® > hùi; #982E -é ¯ > kúi; #982F -é ° > jiá; #9830 -é ± > lè; #9831 -é ² > tian; #9832 -é ³ > chÄ“ng; #9833 -é ´ > yÄ­ng; #9834 -é µ > jÅ«n; #9835 -é ¶ > hú; #9836 -é · > hàn; #9837 -é ¸ > jÄ­ng; #9838 -é ¹ > túi; #9839 -é º > túi; #983A -é » > pín; #983B -é ¼ > lài; #983C -é ½ > túi; #983D -é ¾ > zÄ«; #983E -é ¿ > zÄ«; #983F -é¡€ > chúi; #9840 -é¡ > dìng; #9841 -é¡‚ > lài; #9842 -顃 > yán; #9843 -é¡„ > hàn; #9844 -é¡… > jiÄn; #9845 -顆 > kÄ“; #9846 -顇 > cùi; #9847 -顈 > jÄ­ong; #9848 -顉 > qÄ«n; #9849 -é¡Š > yí; #984A -é¡‹ > sÄi; #984B -é¡Œ > tí; #984C -é¡ > é; #984D -é¡Ž > è; #984E -é¡ > yán; #984F -é¡ > hún; #9850 -é¡‘ > kăn; #9851 -é¡’ > yóng; #9852 -é¡“ > zhuÄn; #9853 -é¡” > yán; #9854 -é¡• > xiăn; #9855 -é¡– > xìn; #9856 -é¡— > yÄ­; #9857 -願 > yuàn; #9858 -é¡™ > săng; #9859 -é¡š > diÄn; #985A -é¡› > diÄn; #985B -é¡œ > jiăng; #985C -é¡ > kÅ«; #985D -é¡ž > lèi; #985E -é¡Ÿ > liáo; #985F -é¡  > piào; #9860 -é¡¡ > yì; #9861 -é¡¢ > mán; #9862 -é¡£ > qÄ«; #9863 -顤 > rào; #9864 -é¡¥ > hào; #9865 -顦 > qiáo; #9866 -顧 > gù; #9867 -顨 > xùn; #9868 -é¡© > qiÄn; #9869 -顪 > hÅ«i; #986A -é¡« > zhàn; #986B -顬 > rú; #986C -é¡­ > hÅng; #986D -é¡® > bÄ«n; #986E -顯 > xiăn; #986F -é¡° > pín; #9870 -顱 > lú; #9871 -顲 > lăn; #9872 -顳 > niè; #9873 -é¡´ > quán; #9874 -页 > yè; #9875 -顶 > dÄ­ng; #9876 -é¡· > qÄ­ng; #9877 -顸 > hÄn; #9878 -项 > xiàng; #9879 -顺 > shùn; #987A -é¡» > xÅ«; #987B -顼 > xù; #987C -顽 > wán; #987D -顾 > gù; #987E -é¡¿ > dùn; #987F -颀 > qí; #9880 -é¢ > bÄn; #9881 -颂 > sòng; #9882 -颃 > háng; #9883 -预 > yù; #9884 -颅 > lú; #9885 -领 > lÄ­ng; #9886 -颇 > pÅ; #9887 -颈 > jÄ­ng; #9888 -颉 > jié; #9889 -颊 > jiá; #988A -颋 > tian; #988B -颌 > hàn; #988C -é¢ > yÄ­ng; #988D -颎 > jÄ­ong; #988E -é¢ > hái; #988F -é¢ > yí; #9890 -频 > pín; #9891 -颒 > hùi; #9892 -颓 > túi; #9893 -颔 > hàn; #9894 -颕 > yÄ­ng; #9895 -颖 > yÄ­ng; #9896 -颗 > kÄ“; #9897 -题 > tí; #9898 -颙 > yóng; #9899 -颚 > è; #989A -颛 > zhuÄn; #989B -颜 > yán; #989C -é¢ > é; #989D -颞 > niè; #989E -颟 > mán; #989F -颠 > diÄn; #98A0 -颡 > săng; #98A1 -颢 > hào; #98A2 -颣 > lèi; #98A3 -颤 > zhàn; #98A4 -颥 > rú; #98A5 -颦 > pín; #98A6 -颧 > quán; #98A7 -風 > fÄ“ng; #98A8 -颩 > biÄo; #98A9 -颫 > fú; #98AB -颬 > xiÄ; #98AC -颭 > zhăn; #98AD -颮 > biÄo; #98AE -颯 > sà; #98AF -颰 > bá; #98B0 -颱 > tái; #98B1 -颲 > liè; #98B2 -颳 > guÄ; #98B3 -颴 > xuàn; #98B4 -颵 > shào; #98B5 -颶 > jù; #98B6 -颷 > bÄ«; #98B7 -颸 > sÄ«; #98B8 -颹 > wÄ•i; #98B9 -颺 > yáng; #98BA -颻 > yáo; #98BB -颼 > sÅu; #98BC -颽 > kăi; #98BD -颾 > sÄo; #98BE -颿 > fán; #98BF -飀 > líu; #98C0 -é£ > xí; #98C1 -飂 > liáo; #98C2 -飃 > piÄo; #98C3 -飄 > piÄo; #98C4 -飅 > líu; #98C5 -飆 > biÄo; #98C6 -飇 > biÄo; #98C7 -飈 > biăo; #98C8 -飉 > liáo; #98C9 -飋 > sè; #98CB -飌 > fÄ“ng; #98CC -é£ > biÄo; #98CD -风 > fÄ“ng; #98CE -é£ > yáng; #98CF -é£ > zhăn; #98D0 -飑 > biÄo; #98D1 -飒 > sà; #98D2 -飓 > jù; #98D3 -飔 > sÄ«; #98D4 -飕 > sÅu; #98D5 -飖 > yáo; #98D6 -飗 > líu; #98D7 -飘 > piÄo; #98D8 -飙 > biÄo; #98D9 -飚 > biÄo; #98DA -飛 > fÄ“i; #98DB -飜 > fÄn; #98DC -é£ > fÄ“i; #98DD -飞 > fÄ“i; #98DE -食 > shí; #98DF -飠 > shí; #98E0 -飡 > cÄn; #98E1 -飢 > jÄ«; #98E2 -飣 > dìng; #98E3 -飤 > sì; #98E4 -飥 > tÅ«o; #98E5 -飦 > zhÄn; #98E6 -飧 > sÅ«n; #98E7 -飨 > xiăng; #98E8 -飩 > tún; #98E9 -飪 > rèn; #98EA -飫 > yù; #98EB -飬 > juàn; #98EC -飭 > chì; #98ED -飮 > yÄ­n; #98EE -飯 > fàn; #98EF -飰 > fàn; #98F0 -飱 > sÅ«n; #98F1 -飲 > yÄ­n; #98F2 -飳 > zhù; #98F3 -飴 > yí; #98F4 -飵 > zhăi; #98F5 -飶 > bì; #98F6 -飷 > jiÄ•; #98F7 -飸 > tÄo; #98F8 -飹 > lÄ­u; #98F9 -飺 > cí; #98FA -飻 > tiè; #98FB -飼 > sì; #98FC -飽 > băo; #98FD -飾 > shì; #98FE -飿 > dùo; #98FF -餀 > hài; #9900 -é¤ > rèn; #9901 -餂 > tiăn; #9902 -餃 > jiăo; #9903 -餄 > jiá; #9904 -餅 > bÄ­ng; #9905 -餆 > yáo; #9906 -餇 > tóng; #9907 -餈 > cí; #9908 -餉 > xiăng; #9909 -養 > yăng; #990A -餋 > yăng; #990B -餌 > Ä•r; #990C -é¤ > yàn; #990D -餎 > le; #990E -é¤ > yÄ«; #990F -é¤ > cÄn; #9910 -餑 > bó; #9911 -餒 > nÄ•i; #9912 -餓 > è; #9913 -餔 > bÅ«; #9914 -餕 > jùn; #9915 -餖 > dòu; #9916 -餗 > sù; #9917 -餘 > yú; #9918 -餙 > shì; #9919 -餚 > yáo; #991A -餛 > hún; #991B -餜 > gÅ­o; #991C -é¤ > shì; #991D -餞 > jiàn; #991E -餟 > zhùi; #991F -餠 > bÄ­ng; #9920 -餡 > xiàn; #9921 -餢 > bù; #9922 -餣 > yè; #9923 -餤 > tán; #9924 -餥 > fÄ•i; #9925 -餦 > zhÄng; #9926 -餧 > wèi; #9927 -館 > guăn; #9928 -餩 > è; #9929 -餪 > nuăn; #992A -餫 > hún; #992B -餬 > hú; #992C -餭 > huáng; #992D -餮 > tiè; #992E -餯 > hùi; #992F -餰 > jiÄn; #9930 -餱 > hóu; #9931 -餲 > hé; #9932 -餳 > xíng; #9933 -餴 > fÄ“n; #9934 -餵 > wèi; #9935 -餶 > gÅ­; #9936 -餷 > chÄ; #9937 -餸 > sòng; #9938 -餹 > táng; #9939 -餺 > bó; #993A -餻 > gÄo; #993B -餼 > xì; #993C -餽 > kùi; #993D -餾 > lìu; #993E -餿 > sÅu; #993F -饀 > táo; #9940 -é¥ > yè; #9941 -饂 > yún; #9942 -饃 > mó; #9943 -饄 > táng; #9944 -饅 > mán; #9945 -饆 > bì; #9946 -饇 > yù; #9947 -饈 > xÄ«u; #9948 -饉 > jÄ­n; #9949 -饊 > săn; #994A -饋 > kùi; #994B -饌 > zhuàn; #994C -é¥ > shàn; #994D -饎 > chì; #994E -é¥ > dàn; #994F -é¥ > yì; #9950 -饑 > jÄ«; #9951 -饒 > ráo; #9952 -饓 > chÄ“ng; #9953 -饔 > yÅng; #9954 -饕 > tÄo; #9955 -饖 > hùi; #9956 -饗 > xiăng; #9957 -饘 > zhÄn; #9958 -饙 > fÄ“n; #9959 -饚 > hài; #995A -饛 > méng; #995B -饜 > yàn; #995C -é¥ > mó; #995D -饞 > chán; #995E -饟 > xiăng; #995F -饠 > lúo; #9960 -饡 > zuàn; #9961 -饢 > năng; #9962 -饣 > shí; #9963 -饤 > dìng; #9964 -饥 > jÄ«; #9965 -饦 > tÅ«o; #9966 -饧 > xíng; #9967 -饨 > tún; #9968 -饩 > xì; #9969 -饪 > rèn; #996A -饫 > yù; #996B -饬 > chì; #996C -饭 > fàn; #996D -饮 > yÄ­n; #996E -饯 > jiàn; #996F -饰 > shì; #9970 -饱 > băo; #9971 -饲 > sì; #9972 -饳 > dùo; #9973 -饴 > yí; #9974 -饵 > Ä•r; #9975 -饶 > ráo; #9976 -饷 > xiăng; #9977 -饸 > jiá; #9978 -饹 > le; #9979 -饺 > jiăo; #997A -饻 > yÄ«; #997B -饼 > bÄ­ng; #997C -饽 > bó; #997D -饾 > dòu; #997E -饿 > è; #997F -馀 > yú; #9980 -é¦ > nÄ•i; #9981 -馂 > jùn; #9982 -馃 > gÅ­o; #9983 -馄 > hún; #9984 -馅 > xiàn; #9985 -馆 > guăn; #9986 -馇 > chÄ; #9987 -馈 > kùi; #9988 -馉 > gÅ­; #9989 -馊 > sÅu; #998A -馋 > chán; #998B -馌 > yè; #998C -é¦ > mó; #998D -馎 > bó; #998E -é¦ > lìu; #998F -é¦ > xÄ«u; #9990 -馑 > jÄ­n; #9991 -馒 > mán; #9992 -馓 > săn; #9993 -馔 > zhuàn; #9994 -馕 > năng; #9995 -首 > shÅu; #9996 -馗 > kúi; #9997 -馘 > gúo; #9998 -香 > xiÄng; #9999 -馚 > fén; #999A -馛 > bá; #999B -馜 > nÄ­; #999C -é¦ > bì; #999D -馞 > bó; #999E -馟 > tú; #999F -馠 > hÄn; #99A0 -馡 > fÄ“i; #99A1 -馢 > jiÄn; #99A2 -馣 > Än; #99A3 -馤 > ăi; #99A4 -馥 > fù; #99A5 -馦 > xiÄn; #99A6 -馧 > wÄ“n; #99A7 -馨 > xÄ«n; #99A8 -馩 > fén; #99A9 -馪 > bÄ«n; #99AA -馫 > xÄ«ng; #99AB -馬 > mă; #99AC -馭 > yù; #99AD -馮 > féng; #99AE -馯 > hàn; #99AF -馰 > dì; #99B0 -馱 > túo; #99B1 -馲 > tÅ«o; #99B2 -馳 > chí; #99B3 -馴 > xún; #99B4 -馵 > zhù; #99B5 -馶 > zhÄ«; #99B6 -馷 > pèi; #99B7 -馸 > xìn; #99B8 -馹 > rì; #99B9 -馺 > sà; #99BA -馻 > yÄ­n; #99BB -馼 > wén; #99BC -馽 > zhí; #99BD -馾 > dàn; #99BE -馿 > lǘ; #99BF -駀 > yóu; #99C0 -é§ > bó; #99C1 -駂 > băo; #99C2 -駃 > kuài; #99C3 -駄 > túo; #99C4 -駅 > yì; #99C5 -駆 > qÅ«; #99C6 -駈 > qÅ«; #99C8 -駉 > jÄ«ong; #99C9 -駊 > bÅ; #99CA -駋 > zhÄo; #99CB -駌 > yuÄn; #99CC -é§ > pÄ“ng; #99CD -駎 > zhòu; #99CE -é§ > jù; #99CF -é§ > zhù; #99D0 -駑 > nú; #99D1 -駒 > jÅ«; #99D2 -駓 > pí; #99D3 -駔 > zăng; #99D4 -駕 > jià; #99D5 -駖 > líng; #99D6 -駗 > zhÄ“n; #99D7 -駘 > tái; #99D8 -駙 > fù; #99D9 -駚 > yăng; #99DA -駛 > shÄ­; #99DB -駜 > bì; #99DC -é§ > túo; #99DD -駞 > túo; #99DE -駟 > sì; #99DF -駠 > líu; #99E0 -駡 > mà; #99E1 -駢 > pián; #99E2 -駣 > táo; #99E3 -駤 > zhì; #99E4 -駥 > róng; #99E5 -駦 > téng; #99E6 -駧 > dòng; #99E7 -駨 > xún; #99E8 -駩 > quán; #99E9 -駪 > shÄ“n; #99EA -駫 > jÄ«ong; #99EB -駬 > Ä•r; #99EC -駭 > hài; #99ED -駮 > bó; #99EE -駯 > zhu; #99EF -駰 > yÄ«n; #99F0 -駱 > lùo; #99F1 -駳 > dàn; #99F3 -駴 > xiè; #99F4 -駵 > líu; #99F5 -駶 > jú; #99F6 -駷 > sÅng; #99F7 -駸 > qÄ«n; #99F8 -駹 > máng; #99F9 -駺 > liáng; #99FA -駻 > hàn; #99FB -駼 > tú; #99FC -駽 > xuàn; #99FD -駾 > tùi; #99FE -駿 > jùn; #99FF -騀 > é; #9A00 -é¨ > chÄ•ng; #9A01 -騂 > xÄ«n; #9A02 -騃 > ái; #9A03 -騄 > lù; #9A04 -騅 > zhÅ«i; #9A05 -騆 > zhÅu; #9A06 -騇 > shÄ•; #9A07 -騈 > pián; #9A08 -騉 > kÅ«n; #9A09 -騊 > táo; #9A0A -騋 > lái; #9A0B -騌 > zÅng; #9A0C -é¨ > kè; #9A0D -騎 > qí; #9A0E -é¨ > qí; #9A0F -é¨ > yàn; #9A10 -騑 > fÄ“i; #9A11 -騒 > sÄo; #9A12 -験 > yăn; #9A13 -騔 > jié; #9A14 -騕 > yăo; #9A15 -騖 > wù; #9A16 -騗 > piàn; #9A17 -騘 > cÅng; #9A18 -騙 > piàn; #9A19 -騚 > qián; #9A1A -騛 > fÄ“i; #9A1B -騜 > huáng; #9A1C -é¨ > jiÄn; #9A1D -騞 > hùo; #9A1E -騟 > yù; #9A1F -騠 > tí; #9A20 -騡 > quán; #9A21 -騢 > xiá; #9A22 -騣 > zÅng; #9A23 -騤 > kúi; #9A24 -騥 > róu; #9A25 -騦 > sÄ«; #9A26 -騧 > guÄ; #9A27 -騨 > túo; #9A28 -騩 > kùi; #9A29 -騪 > sÅu; #9A2A -騫 > qiÄn; #9A2B -騬 > chéng; #9A2C -騭 > zhì; #9A2D -騮 > líu; #9A2E -騯 > páng; #9A2F -騰 > téng; #9A30 -騱 > xÄ«; #9A31 -騲 > căo; #9A32 -騳 > dú; #9A33 -騴 > yàn; #9A34 -騵 > yuán; #9A35 -騶 > zÅu; #9A36 -騷 > sÄo; #9A37 -騸 > shàn; #9A38 -騹 > lí; #9A39 -騺 > zhì; #9A3A -騻 > shuăng; #9A3B -騼 > lù; #9A3C -騽 > xí; #9A3D -騾 > lúo; #9A3E -騿 > zhÄng; #9A3F -é©€ > mò; #9A40 -é© > áo; #9A41 -é©‚ > cÄn; #9A42 -驃 > piào; #9A43 -é©„ > cÅng; #9A44 -é©… > qÅ«; #9A45 -驆 > bì; #9A46 -驇 > zhì; #9A47 -驈 > yù; #9A48 -驉 > xÅ«; #9A49 -é©Š > huá; #9A4A -é©‹ > bÅ; #9A4B -é©Œ > sù; #9A4C -é© > xiÄo; #9A4D -é©Ž > lín; #9A4E -é© > chăn; #9A4F -é© > dÅ«n; #9A50 -é©‘ > líu; #9A51 -é©’ > túo; #9A52 -é©“ > zÄ“ng; #9A53 -é©” > tán; #9A54 -é©• > jiÄo; #9A55 -é©– > tiÄ•; #9A56 -é©— > yàn; #9A57 -驘 > lúo; #9A58 -é©™ > zhÄn; #9A59 -é©š > jÄ«ng; #9A5A -é©› > yì; #9A5B -é©œ > yè; #9A5C -é© > tÅ«o; #9A5D -é©ž > bÄ«n; #9A5E -é©Ÿ > zòu; #9A5F -é©  > yàn; #9A60 -é©¡ > péng; #9A61 -é©¢ > lǘ; #9A62 -é©£ > téng; #9A63 -驤 > xiÄng; #9A64 -é©¥ > jì; #9A65 -驦 > shuÄng; #9A66 -驧 > jú; #9A67 -驨 > xÄ«; #9A68 -é©© > huÄn; #9A69 -驪 > lí; #9A6A -é©« > biÄo; #9A6B -马 > mă; #9A6C -é©­ > yù; #9A6D -é©® > túo; #9A6E -驯 > xún; #9A6F -é©° > chí; #9A70 -驱 > qÅ«; #9A71 -驲 > rì; #9A72 -驳 > bó; #9A73 -é©´ > lǘ; #9A74 -驵 > zăng; #9A75 -驶 > shÄ­; #9A76 -é©· > sì; #9A77 -驸 > fù; #9A78 -驹 > jÅ«; #9A79 -驺 > zÅu; #9A7A -é©» > zhù; #9A7B -驼 > túo; #9A7C -驽 > nú; #9A7D -驾 > jià; #9A7E -é©¿ > yì; #9A7F -骀 > tái; #9A80 -éª > xiÄo; #9A81 -骂 > mà; #9A82 -骃 > yÄ«n; #9A83 -骄 > jiÄo; #9A84 -骅 > huá; #9A85 -骆 > lùo; #9A86 -骇 > hài; #9A87 -骈 > pián; #9A88 -骉 > biÄo; #9A89 -骊 > lí; #9A8A -骋 > chÄ•ng; #9A8B -验 > yàn; #9A8C -éª > xÄ«n; #9A8D -骎 > qÄ«n; #9A8E -éª > jùn; #9A8F -éª > qí; #9A90 -骑 > qí; #9A91 -骒 > kè; #9A92 -骓 > zhÅ«i; #9A93 -骔 > zÅng; #9A94 -骕 > sù; #9A95 -骖 > cÄn; #9A96 -骗 > piàn; #9A97 -骘 > zhì; #9A98 -骙 > kúi; #9A99 -骚 > sÄo; #9A9A -骛 > wù; #9A9B -骜 > áo; #9A9C -éª > líu; #9A9D -骞 > qiÄn; #9A9E -骟 > shàn; #9A9F -骠 > piào; #9AA0 -骡 > lúo; #9AA1 -骢 > cÅng; #9AA2 -骣 > chăn; #9AA3 -骤 > zòu; #9AA4 -骥 > jì; #9AA5 -骦 > shuÄng; #9AA6 -骧 > xiÄng; #9AA7 -骨 > gÅ­; #9AA8 -骩 > wÄ•i; #9AA9 -骪 > wÄ•i; #9AAA -骫 > wÄ•i; #9AAB -骬 > yú; #9AAC -骭 > gàn; #9AAD -骮 > yì; #9AAE -骯 > Äng; #9AAF -骰 > tóu; #9AB0 -骱 > xiè; #9AB1 -骲 > bÄo; #9AB2 -骳 > bì; #9AB3 -骴 > chÄ«; #9AB4 -骵 > tÄ­; #9AB5 -骶 > dÄ­; #9AB6 -骷 > kÅ«; #9AB7 -骸 > hái; #9AB8 -骹 > qiÄo; #9AB9 -骺 > gòu; #9ABA -骻 > kuà; #9ABB -骼 > gé; #9ABC -骽 > tÅ­i; #9ABD -骾 > gÄ•ng; #9ABE -骿 > pián; #9ABF -é«€ > bì; #9AC0 -é« > kÄ“; #9AC1 -é«‚ > kà; #9AC2 -髃 > yú; #9AC3 -é«„ > sÅ­i; #9AC4 -é«… > lóu; #9AC5 -髆 > bó; #9AC6 -髇 > xiÄo; #9AC7 -髈 > páng; #9AC8 -髉 > bÅ; #9AC9 -é«Š > cÄ«; #9ACA -é«‹ > kuÄn; #9ACB -é«Œ > bìn; #9ACC -é« > mó; #9ACD -é«Ž > liáo; #9ACE -é« > lóu; #9ACF -é« > náo; #9AD0 -é«‘ > dú; #9AD1 -é«’ > zÄng; #9AD2 -é«“ > sÅ­i; #9AD3 -é«” > tÄ­; #9AD4 -é«• > bìn; #9AD5 -é«– > kuÄn; #9AD6 -é«— > lú; #9AD7 -高 > gÄo; #9AD8 -é«™ > gÄo; #9AD9 -é«š > qiào; #9ADA -é«› > kÄo; #9ADB -é«œ > qiÄo; #9ADC -é« > lào; #9ADD -é«ž > zào; #9ADE -é«Ÿ > biÄo; #9ADF -é«  > kÅ«n; #9AE0 -é«¡ > kÅ«n; #9AE1 -é«¢ > tì; #9AE2 -é«£ > făng; #9AE3 -髤 > xÄ«u; #9AE4 -é«¥ > rán; #9AE5 -髦 > máo; #9AE6 -髧 > dàn; #9AE7 -髨 > kÅ«n; #9AE8 -é«© > bìn; #9AE9 -髪 > fà; #9AEA -é«« > tiáo; #9AEB -髬 > peng; #9AEC -é«­ > zÄ«; #9AED -é«® > fă; #9AEE -髯 > rán; #9AEF -é«° > tì; #9AF0 -髱 > pào; #9AF1 -髲 > pÄ«; #9AF2 -髳 > máo; #9AF3 -é«´ > fú; #9AF4 -髵 > ér; #9AF5 -髶 > róng; #9AF6 -é«· > qÅ«; #9AF7 -髸 > gong; #9AF8 -髹 > xÄ«u; #9AF9 -髺 > guà; #9AFA -é«» > jì; #9AFB -髼 > péng; #9AFC -髽 > zhuÄ; #9AFD -髾 > shÄo; #9AFE -é«¿ > shÄ; #9AFF -鬀 > tì; #9B00 -é¬ > lì; #9B01 -鬂 > bìn; #9B02 -鬃 > zÅng; #9B03 -鬄 > tì; #9B04 -鬅 > péng; #9B05 -鬆 > sÅng; #9B06 -鬇 > zhÄ“ng; #9B07 -鬈 > quán; #9B08 -鬉 > zÅng; #9B09 -鬊 > shùn; #9B0A -鬋 > jiÄn; #9B0B -鬌 > dÅ­o; #9B0C -é¬ > hú; #9B0D -鬎 > là; #9B0E -é¬ > jÄ«u; #9B0F -é¬ > qí; #9B10 -鬑 > lián; #9B11 -鬒 > zhÄ•n; #9B12 -鬓 > bìn; #9B13 -鬔 > péng; #9B14 -鬕 > mò; #9B15 -鬖 > sÄn; #9B16 -鬗 > màn; #9B17 -鬘 > mán; #9B18 -鬙 > sÄ“ng; #9B19 -鬚 > xÅ«; #9B1A -鬛 > liè; #9B1B -鬜 > qiÄn; #9B1C -é¬ > qiÄn; #9B1D -鬞 > nóng; #9B1E -鬟 > huán; #9B1F -鬠 > kuài; #9B20 -鬡 > níng; #9B21 -鬢 > bìn; #9B22 -鬣 > liè; #9B23 -鬤 > ráng; #9B24 -鬥 > dòu; #9B25 -鬦 > dòu; #9B26 -鬧 > nào; #9B27 -鬨 > hÅng; #9B28 -鬩 > xì; #9B29 -鬪 > dòu; #9B2A -鬫 > hăn; #9B2B -鬬 > dòu; #9B2C -鬭 > dòu; #9B2D -鬮 > jÄ«u; #9B2E -鬯 > chàng; #9B2F -鬰 > yù; #9B30 -鬱 > yù; #9B31 -鬲 > lì; #9B32 -鬳 > juàn; #9B33 -鬴 > fÅ­; #9B34 -鬵 > qián; #9B35 -鬶 > gÅ«i; #9B36 -鬷 > zÅng; #9B37 -鬸 > lìu; #9B38 -鬹 > gÅ«i; #9B39 -鬺 > shÄng; #9B3A -鬻 > yù; #9B3B -鬼 > gÅ­i; #9B3C -鬽 > mèi; #9B3D -鬾 > jì; #9B3E -鬿 > qí; #9B3F -é­€ > jiè; #9B40 -é­ > kúi; #9B41 -é­‚ > hún; #9B42 -é­ƒ > bá; #9B43 -é­„ > pò; #9B44 -é­… > mèi; #9B45 -é­† > xù; #9B46 -é­‡ > yăn; #9B47 -é­ˆ > xiÄo; #9B48 -é­‰ > liăng; #9B49 -é­Š > yù; #9B4A -é­‹ > túi; #9B4B -é­Œ > qÄ«; #9B4C -é­ > wăng; #9B4D -é­Ž > liăng; #9B4E -é­ > wèi; #9B4F -é­ > jiÄn; #9B50 -é­‘ > chÄ«; #9B51 -é­’ > piÄo; #9B52 -é­“ > bì; #9B53 -é­” > mó; #9B54 -é­• > jÄ­; #9B55 -é­– > xÅ«; #9B56 -é­— > chÅu; #9B57 -é­˜ > yăn; #9B58 -é­™ > zhăn; #9B59 -é­š > yú; #9B5A -é­› > dÄo; #9B5B -é­œ > rén; #9B5C -é­ > jì; #9B5D -é­Ÿ > gÅng; #9B5F -é­  > túo; #9B60 -é­¡ > diào; #9B61 -é­¢ > jÄ­; #9B62 -é­£ > xù; #9B63 -é­¤ > é; #9B64 -é­¥ > è; #9B65 -é­¦ > shÄ; #9B66 -é­§ > háng; #9B67 -é­¨ > tún; #9B68 -é­© > mò; #9B69 -é­ª > jiè; #9B6A -é­« > shÄ•n; #9B6B -é­¬ > făn; #9B6C -é­­ > yuán; #9B6D -é­® > bí; #9B6E -é­¯ > lÅ­; #9B6F -é­° > wén; #9B70 -é­± > hú; #9B71 -é­² > lú; #9B72 -é­³ > zá; #9B73 -é­´ > fáng; #9B74 -é­µ > fén; #9B75 -é­¶ > nà; #9B76 -é­· > yóu; #9B77 -é­º > hé; #9B7A -é­» > xiá; #9B7B -é­¼ > qÅ«; #9B7C -é­½ > hÄn; #9B7D -é­¾ > pí; #9B7E -é­¿ > líng; #9B7F -鮀 > túo; #9B80 -é® > bÅ; #9B81 -鮂 > qíu; #9B82 -鮃 > píng; #9B83 -鮄 > fú; #9B84 -é®… > bì; #9B85 -鮆 > jì; #9B86 -鮇 > wèi; #9B87 -鮈 > jÅ«; #9B88 -鮉 > diÄo; #9B89 -鮊 > bó; #9B8A -鮋 > yóu; #9B8B -鮌 > gÅ­n; #9B8C -é® > pÄ«; #9B8D -鮎 > nián; #9B8E -é® > xÄ«ng; #9B8F -é® > tái; #9B90 -鮑 > bào; #9B91 -é®’ > fù; #9B92 -鮓 > zhă; #9B93 -é®” > jù; #9B94 -鮕 > gÅ«; #9B95 -é®™ > tà; #9B99 -鮚 > jié; #9B9A -é®› > shù; #9B9B -鮜 > hòu; #9B9C -é® > xiăng; #9B9D -鮞 > ér; #9B9E -鮟 > àn; #9B9F -é®  > wéi; #9BA0 -鮡 > tiÄo; #9BA1 -鮢 > zhÅ«; #9BA2 -鮣 > yìn; #9BA3 -鮤 > liè; #9BA4 -鮥 > lùo; #9BA5 -鮦 > tóng; #9BA6 -鮧 > yí; #9BA7 -鮨 > qí; #9BA8 -鮩 > bìng; #9BA9 -鮪 > wÄ•i; #9BAA -鮫 > jiăo; #9BAB -鮬 > bù; #9BAC -é®­ > gÅ«i; #9BAD -é®® > xiÄn; #9BAE -鮯 > gé; #9BAF -é®° > húi; #9BB0 -鮳 > kăo; #9BB3 -鮵 > dúo; #9BB5 -鮶 > jÅ«n; #9BB6 -é®· > tí; #9BB7 -鮸 > măn; #9BB8 -鮹 > xiÄo; #9BB9 -鮺 > ză; #9BBA -é®» > shÄ; #9BBB -鮼 > qÄ«n; #9BBC -鮽 > yú; #9BBD -鮾 > nÄ•i; #9BBE -鮿 > zhé; #9BBF -鯀 > gÅ­n; #9BC0 -é¯ > gÄ•ng; #9BC1 -鯂 > su; #9BC2 -鯃 > wú; #9BC3 -鯄 > qíu; #9BC4 -鯅 > tíng; #9BC5 -鯆 > fÅ­; #9BC6 -鯇 > wăn; #9BC7 -鯈 > yóu; #9BC8 -鯉 > lÄ­; #9BC9 -鯊 > shÄ; #9BCA -鯋 > shÄ; #9BCB -鯌 > gào; #9BCC -é¯ > méng; #9BCD -鯒 > yÅng; #9BD2 -鯓 > ní; #9BD3 -鯔 > zÄ«; #9BD4 -鯕 > qí; #9BD5 -鯖 > qÄ«ng; #9BD6 -鯗 > xiăng; #9BD7 -鯘 > nÄ•i; #9BD8 -鯙 > chún; #9BD9 -鯚 > jì; #9BDA -鯛 > diÄo; #9BDB -鯜 > qiè; #9BDC -é¯ > gù; #9BDD -鯞 > zhÅu; #9BDE -鯟 > dÅng; #9BDF -鯠 > lái; #9BE0 -鯡 > fÄ“i; #9BE1 -鯢 > ní; #9BE2 -鯣 > yì; #9BE3 -鯤 > kÅ«n; #9BE4 -鯥 > lù; #9BE5 -鯦 > jìu; #9BE6 -鯧 > chÄng; #9BE7 -鯨 > jÄ«ng; #9BE8 -鯩 > lún; #9BE9 -鯪 > líng; #9BEA -鯫 > zÅu; #9BEB -鯬 > lí; #9BEC -鯭 > mÄ•ng; #9BED -鯮 > zÅng; #9BEE -鯯 > zhì; #9BEF -鯰 > nián; #9BF0 -鯴 > shÄ«; #9BF4 -鯵 > shÄ“n; #9BF5 -鯶 > hÅ­n; #9BF6 -鯷 > shì; #9BF7 -鯸 > hóu; #9BF8 -鯹 > xÄ«ng; #9BF9 -鯺 > zhÅ«; #9BFA -鯻 > là; #9BFB -鯼 > zÅng; #9BFC -鯽 > jì; #9BFD -鯾 > biÄn; #9BFE -鯿 > biÄn; #9BFF -é°€ > huàn; #9C00 -é° > quán; #9C01 -é°‚ > zé; #9C02 -é°ƒ > wÄ“i; #9C03 -é°„ > wÄ“i; #9C04 -é°… > yú; #9C05 -é°† > qÅ«n; #9C06 -é°‡ > róu; #9C07 -é°ˆ > dié; #9C08 -é°‰ > huáng; #9C09 -é°Š > liàn; #9C0A -é°‹ > yăn; #9C0B -é°Œ > qíu; #9C0C -é° > qÄ«u; #9C0D -é°Ž > jiàn; #9C0E -é° > bì; #9C0F -é° > è; #9C10 -é°‘ > yáng; #9C11 -é°’ > fù; #9C12 -é°“ > sÄi; #9C13 -é°” > jiăn; #9C14 -é°• > xiá; #9C15 -é°– > tÅ­o; #9C16 -é°— > hú; #9C17 -é°™ > rùo; #9C19 -é°› > wÄ“n; #9C1B -é°œ > jiÄn; #9C1C -é° > hào; #9C1D -é°ž > wÅ«; #9C1E -é°Ÿ > fáng; #9C1F -é°  > sÄo; #9C20 -é°¡ > líu; #9C21 -é°¢ > mă; #9C22 -é°£ > shí; #9C23 -é°¤ > shÄ«; #9C24 -é°¥ > yín; #9C25 -é°¦ > zÌ„; #9C26 -é°§ > téng; #9C27 -é°¨ > tà; #9C28 -é°© > yáo; #9C29 -é°ª > gé; #9C2A -é°« > róng; #9C2B -é°¬ > qián; #9C2C -é°­ > qí; #9C2D -é°® > wÄ“n; #9C2E -é°¯ > rùo; #9C2F -é°± > lián; #9C31 -é°² > áo; #9C32 -é°³ > lè; #9C33 -é°´ > hÅ«i; #9C34 -é°µ > mÄ­n; #9C35 -é°¶ > jì; #9C36 -é°· > tiáo; #9C37 -é°¸ > qÅ«; #9C38 -é°¹ > jiÄn; #9C39 -é°º > sÄo; #9C3A -é°» > mán; #9C3B -é°¼ > xí; #9C3C -é°½ > qíu; #9C3D -é°¾ > biào; #9C3E -é°¿ > jÄ«; #9C3F -é±€ > jì; #9C40 -é± > zhú; #9C41 -鱂 > jiÄng; #9C42 -鱃 > qÄ«u; #9C43 -鱄 > zhuÄn; #9C44 -é±… > yóng; #9C45 -鱆 > zhÄng; #9C46 -鱇 > kÄng; #9C47 -鱈 > xuÄ•; #9C48 -鱉 > biÄ“; #9C49 -鱊 > jué; #9C4A -鱋 > qÅ«; #9C4B -鱌 > xiàng; #9C4C -é± > bÅ; #9C4D -鱎 > jiÄo; #9C4E -é± > xún; #9C4F -é± > sù; #9C50 -鱑 > huáng; #9C51 -é±’ > zùn; #9C52 -鱓 > shàn; #9C53 -é±” > shàn; #9C54 -鱕 > fÄn; #9C55 -é±– > jué; #9C56 -é±— > lín; #9C57 -鱘 > xún; #9C58 -é±™ > miáo; #9C59 -鱚 > xÄ­; #9C5A -é± > fèn; #9C5D -鱞 > guÄn; #9C5E -鱟 > hòu; #9C5F -é±  > kuài; #9C60 -鱡 > zéi; #9C61 -é±¢ > sÄo; #9C62 -é±£ > zhÄn; #9C63 -鱤 > găn; #9C64 -é±¥ > gùi; #9C65 -鱦 > shéng; #9C66 -鱧 > lÄ­; #9C67 -鱨 > cháng; #9C68 -鱬 > rú; #9C6C -é±­ > jì; #9C6D -é±® > xù; #9C6E -鱯 > hùo; #9C6F -é±± > lì; #9C71 -é±² > liè; #9C72 -é±³ > lì; #9C73 -é±´ > miè; #9C74 -é±µ > zhÄ“n; #9C75 -鱶 > xiăng; #9C76 -é±· > è; #9C77 -鱸 > lú; #9C78 -é±¹ > guàn; #9C79 -鱺 > lí; #9C7A -é±» > xiÄn; #9C7B -é±¼ > yú; #9C7C -é±½ > dÄo; #9C7D -é±¾ > jÄ­; #9C7E -鱿 > yóu; #9C7F -é²€ > tún; #9C80 -é² > lÅ­; #9C81 -鲂 > fáng; #9C82 -鲃 > bÄ; #9C83 -鲄 > hé; #9C84 -é²… > bÅ; #9C85 -鲆 > píng; #9C86 -鲇 > nián; #9C87 -鲈 > lú; #9C88 -鲉 > yóu; #9C89 -鲊 > zhă; #9C8A -鲋 > fù; #9C8B -鲌 > bó; #9C8C -é² > bào; #9C8D -鲎 > hòu; #9C8E -é² > pÄ«; #9C8F -é² > tái; #9C90 -鲑 > gÅ«i; #9C91 -é²’ > jié; #9C92 -鲓 > kăo; #9C93 -é²” > wÄ•i; #9C94 -鲕 > ér; #9C95 -é²– > tóng; #9C96 -é²— > zé; #9C97 -鲘 > hòu; #9C98 -é²™ > kuài; #9C99 -鲚 > jì; #9C9A -é²› > jiăo; #9C9B -鲜 > xiÄn; #9C9C -é² > ză; #9C9D -鲞 > xiăng; #9C9E -鲟 > xún; #9C9F -é²  > gÄ•ng; #9CA0 -鲡 > lí; #9CA1 -é²¢ > lián; #9CA2 -é²£ > jiÄn; #9CA3 -鲤 > lÄ­; #9CA4 -é²¥ > shí; #9CA5 -鲦 > tiáo; #9CA6 -鲧 > gÅ­n; #9CA7 -鲨 > shÄ; #9CA8 -鲩 > wăn; #9CA9 -鲪 > jÅ«n; #9CAA -鲫 > jì; #9CAB -鲬 > yÅng; #9CAC -é²­ > qÄ«ng; #9CAD -é²® > líng; #9CAE -鲯 > qí; #9CAF -é²° > zÅu; #9CB0 -é²± > fÄ“i; #9CB1 -é²² > kÅ«n; #9CB2 -é²³ > chÄng; #9CB3 -é²´ > gù; #9CB4 -é²µ > ní; #9CB5 -鲶 > nián; #9CB6 -é²· > diÄo; #9CB7 -鲸 > jÄ«ng; #9CB8 -é²¹ > shÄ“n; #9CB9 -鲺 > shÄ«; #9CBA -é²» > zÄ«; #9CBB -é²¼ > fèn; #9CBC -é²½ > dié; #9CBD -é²¾ > bì; #9CBE -鲿 > cháng; #9CBF -é³€ > shì; #9CC0 -é³ > wÄ“n; #9CC1 -鳂 > wÄ“i; #9CC2 -鳃 > sÄi; #9CC3 -鳄 > è; #9CC4 -é³… > qÄ«u; #9CC5 -鳆 > fù; #9CC6 -鳇 > huáng; #9CC7 -鳈 > quán; #9CC8 -鳉 > jiÄng; #9CC9 -鳊 > biÄn; #9CCA -鳋 > sÄo; #9CCB -鳌 > áo; #9CCC -é³ > qí; #9CCD -鳎 > tà; #9CCE -é³ > yín; #9CCF -é³ > yáo; #9CD0 -鳑 > fáng; #9CD1 -é³’ > jiÄn; #9CD2 -鳓 > lè; #9CD3 -é³” > biào; #9CD4 -鳕 > xuÄ•; #9CD5 -é³– > biÄ“; #9CD6 -é³— > mán; #9CD7 -鳘 > mÄ­n; #9CD8 -é³™ > yóng; #9CD9 -鳚 > wèi; #9CDA -é³› > xí; #9CDB -鳜 > jué; #9CDC -é³ > shàn; #9CDD -鳞 > lín; #9CDE -鳟 > zùn; #9CDF -é³  > hùo; #9CE0 -鳡 > găn; #9CE1 -é³¢ > lÄ­; #9CE2 -é³£ > zhÄn; #9CE3 -鳤 > guăn; #9CE4 -é³¥ > niăo; #9CE5 -鳦 > yÄ­; #9CE6 -鳧 > fú; #9CE7 -鳨 > lì; #9CE8 -鳩 > jÄ«u; #9CE9 -鳪 > bÅ­; #9CEA -鳫 > yàn; #9CEB -鳬 > fú; #9CEC -é³­ > diÄo; #9CED -é³® > jÄ«; #9CEE -鳯 > fèng; #9CEF -é³± > gÄn; #9CF1 -é³² > shÄ«; #9CF2 -é³³ > fèng; #9CF3 -é³´ > míng; #9CF4 -é³µ > băo; #9CF5 -鳶 > yuÄn; #9CF6 -é³· > zhÄ«; #9CF7 -鳸 > hù; #9CF8 -é³¹ > qín; #9CF9 -鳺 > fÅ«; #9CFA -é³» > fÄ“n; #9CFB -é³¼ > wén; #9CFC -é³½ > jiÄn; #9CFD -é³¾ > shÄ«; #9CFE -鳿 > yù; #9CFF -é´€ > fÅu; #9D00 -é´ > yiÄo; #9D01 -é´‚ > juè; #9D02 -é´ƒ > jué; #9D03 -é´„ > pÄ«; #9D04 -é´… > huÄn; #9D05 -é´† > zhèn; #9D06 -é´‡ > băo; #9D07 -é´ˆ > yàn; #9D08 -é´‰ > yÄ; #9D09 -é´Š > zhèng; #9D0A -é´‹ > fÄng; #9D0B -é´Œ > fèng; #9D0C -é´ > wén; #9D0D -é´Ž > Åu; #9D0E -é´ > tè; #9D0F -é´ > jiÄ; #9D10 -é´‘ > nú; #9D11 -é´’ > líng; #9D12 -é´“ > miè; #9D13 -é´” > fú; #9D14 -é´• > túo; #9D15 -é´– > wén; #9D16 -é´— > lì; #9D17 -é´˜ > biàn; #9D18 -é´™ > zhì; #9D19 -é´š > gÄ“; #9D1A -é´› > yuÄn; #9D1B -é´œ > zÄ«; #9D1C -é´ > qú; #9D1D -é´ž > xiÄo; #9D1E -é´Ÿ > zhÄ«; #9D1F -é´  > dàn; #9D20 -é´¡ > jÅ«; #9D21 -é´¢ > yòu; #9D22 -é´£ > gÅ«; #9D23 -é´¤ > zhÅng; #9D24 -é´¥ > yù; #9D25 -é´¦ > yÄng; #9D26 -é´§ > ròng; #9D27 -é´¨ > yÄ; #9D28 -é´© > tiÄ•; #9D29 -é´ª > yù; #9D2A -é´¬ > yÄ«ng; #9D2C -é´­ > zhÅ«i; #9D2D -é´® > wÅ«; #9D2E -é´¯ > ér; #9D2F -é´° > guÄ; #9D30 -é´± > ài; #9D31 -é´² > zhÄ«; #9D32 -é´³ > yàn; #9D33 -é´´ > héng; #9D34 -é´µ > jiÄo; #9D35 -é´¶ > jí; #9D36 -é´· > liè; #9D37 -é´¸ > zhÅ«; #9D38 -é´¹ > rén; #9D39 -é´º > yí; #9D3A -é´» > hóng; #9D3B -é´¼ > lùo; #9D3C -é´½ > rú; #9D3D -é´¾ > móu; #9D3E -é´¿ > gÄ“; #9D3F -éµ€ > rèn; #9D40 -éµ > jiÄo; #9D41 -鵂 > xÄ«u; #9D42 -鵃 > zhÅu; #9D43 -鵄 > zhÄ«; #9D44 -éµ… > lùo; #9D45 -鵉 > luán; #9D49 -鵊 > jiá; #9D4A -鵋 > jì; #9D4B -鵌 > yú; #9D4C -éµ > huÄn; #9D4D -鵎 > tÅ­o; #9D4E -éµ > bÅ«; #9D4F -éµ > wú; #9D50 -鵑 > juÄn; #9D51 -éµ’ > yù; #9D52 -鵓 > bó; #9D53 -éµ” > xùn; #9D54 -鵕 > xùn; #9D55 -éµ– > bì; #9D56 -éµ— > xÄ«; #9D57 -鵘 > jùn; #9D58 -éµ™ > jú; #9D59 -鵚 > tú; #9D5A -éµ› > jÄ«ng; #9D5B -鵜 > tí; #9D5C -éµ > é; #9D5D -鵞 > é; #9D5E -鵟 > kuáng; #9D5F -éµ  > hú; #9D60 -鵡 > wÅ­; #9D61 -éµ¢ > shÄ“n; #9D62 -éµ£ > lài; #9D63 -鵦 > lù; #9D66 -鵧 > píng; #9D67 -鵨 > shÅ«; #9D68 -鵩 > fú; #9D69 -鵪 > Än; #9D6A -鵫 > zhào; #9D6B -鵬 > péng; #9D6C -éµ­ > qín; #9D6D -éµ® > qiÄn; #9D6E -鵯 > bÄ“i; #9D6F -éµ° > diÄo; #9D70 -éµ± > lù; #9D71 -éµ² > què; #9D72 -éµ³ > jiÄn; #9D73 -éµ´ > jú; #9D74 -éµµ > tù; #9D75 -鵶 > yÄ; #9D76 -éµ· > yuÄn; #9D77 -鵸 > qí; #9D78 -éµ¹ > lí; #9D79 -鵺 > yè; #9D7A -éµ» > zhÅ«i; #9D7B -éµ¼ > kÅng; #9D7C -éµ½ > zhùi; #9D7D -éµ¾ > kÅ«n; #9D7E -鵿 > shÄ“ng; #9D7F -鶀 > qí; #9D80 -é¶ > jÄ«ng; #9D81 -鶂 > yì; #9D82 -鶃 > yì; #9D83 -鶄 > jÄ«ng; #9D84 -鶅 > zÄ«; #9D85 -鶆 > lái; #9D86 -鶇 > dÅng; #9D87 -鶈 > qÄ«; #9D88 -鶉 > chún; #9D89 -鶊 > gÄ“ng; #9D8A -鶋 > jÅ«; #9D8B -鶌 > qÅ«; #9D8C -é¶ > jÄ«; #9D8F -é¶ > shù; #9D90 -鶒 > chì; #9D92 -鶓 > miáo; #9D93 -鶔 > róu; #9D94 -鶕 > Än; #9D95 -鶖 > qÄ«u; #9D96 -鶗 > tí; #9D97 -鶘 > hú; #9D98 -鶙 > tí; #9D99 -鶚 > è; #9D9A -鶛 > jiÄ“; #9D9B -鶜 > máo; #9D9C -é¶ > fú; #9D9D -鶞 > chÅ«n; #9D9E -鶟 > tú; #9D9F -鶠 > yăn; #9DA0 -鶡 > hé; #9DA1 -鶢 > yuán; #9DA2 -鶣 > piÄn; #9DA3 -鶤 > yùn; #9DA4 -鶥 > méi; #9DA5 -鶦 > hú; #9DA6 -鶧 > yÄ«ng; #9DA7 -鶨 > dùn; #9DA8 -鶩 > mù; #9DA9 -鶪 > jú; #9DAA -鶬 > cÄng; #9DAC -鶭 > făng; #9DAD -鶮 > gù; #9DAE -鶯 > yÄ«ng; #9DAF -鶰 > yuán; #9DB0 -鶱 > xuÄn; #9DB1 -鶲 > wÄ“ng; #9DB2 -鶳 > shÄ«; #9DB3 -鶴 > hè; #9DB4 -鶵 > chú; #9DB5 -鶶 > táng; #9DB6 -鶷 > xià; #9DB7 -鶸 > rùo; #9DB8 -鶹 > líu; #9DB9 -鶺 > jí; #9DBA -鶻 > gú; #9DBB -鶼 > jiÄn; #9DBC -鶽 > zhÅ­n; #9DBD -鶾 > hàn; #9DBE -鶿 > zÄ«; #9DBF -é·€ > zÄ«; #9DC0 -é· > nì; #9DC1 -é·‚ > yào; #9DC2 -é·ƒ > yàn; #9DC3 -é·„ > jÄ«; #9DC4 -é·… > lì; #9DC5 -é·† > tián; #9DC6 -é·‡ > kòu; #9DC7 -é·ˆ > tÄ«; #9DC8 -é·‰ > tÄ«; #9DC9 -é·Š > nì; #9DCA -é·‹ > tú; #9DCB -é·Œ > mă; #9DCC -é· > jiÄo; #9DCD -é·Ž > gÄo; #9DCE -é· > tián; #9DCF -é· > chén; #9DD0 -é·‘ > lì; #9DD1 -é·’ > zhuÄn; #9DD2 -é·“ > zhè; #9DD3 -é·” > áo; #9DD4 -é·• > yăo; #9DD5 -é·– > yÄ«; #9DD6 -é·— > Åu; #9DD7 -é·˜ > chì; #9DD8 -é·™ > zhì; #9DD9 -é·š > liáo; #9DDA -é·› > róng; #9DDB -é·œ > lóu; #9DDC -é· > bì; #9DDD -é·ž > shuÄng; #9DDE -é·Ÿ > zhúo; #9DDF -é·  > yú; #9DE0 -é·¡ > wú; #9DE1 -é·¢ > jué; #9DE2 -é·£ > yín; #9DE3 -é·¤ > quán; #9DE4 -é·¥ > sÄ«; #9DE5 -é·¦ > jiÄo; #9DE6 -é·§ > yì; #9DE7 -é·¨ > huÄ; #9DE8 -é·© > bì; #9DE9 -é·ª > yÄ«ng; #9DEA -é·« > sù; #9DEB -é·¬ > huáng; #9DEC -é·­ > fán; #9DED -é·® > jiÄo; #9DEE -é·¯ > liáo; #9DEF -é·° > yàn; #9DF0 -é·± > kÄo; #9DF1 -é·² > jìu; #9DF2 -é·³ > xián; #9DF3 -é·´ > xián; #9DF4 -é·µ > tú; #9DF5 -é·¶ > măi; #9DF6 -é·· > zÅ«n; #9DF7 -é·¸ > yù; #9DF8 -é·¹ > yÄ«ng; #9DF9 -é·º > lù; #9DFA -é·» > tuán; #9DFB -é·¼ > xián; #9DFC -é·½ > xué; #9DFD -é·¾ > yì; #9DFE -é·¿ > pì; #9DFF -鸀 > shú; #9E00 -é¸ > lúo; #9E01 -鸂 > qÄ«; #9E02 -鸃 > yí; #9E03 -鸄 > jí; #9E04 -鸅 > zhé; #9E05 -鸆 > yú; #9E06 -鸇 > zhÄn; #9E07 -鸈 > yè; #9E08 -鸉 > yáng; #9E09 -鸊 > pì; #9E0A -鸋 > níng; #9E0B -鸌 > hùo; #9E0C -é¸ > mí; #9E0D -鸎 > yÄ«ng; #9E0E -é¸ > méng; #9E0F -é¸ > dí; #9E10 -鸑 > yuè; #9E11 -鸒 > yú; #9E12 -鸓 > lÄ•i; #9E13 -鸔 > bào; #9E14 -鸕 > lú; #9E15 -鸖 > hè; #9E16 -鸗 > lóng; #9E17 -鸘 > shuÄng; #9E18 -鸙 > yuè; #9E19 -鸚 > yÄ«ng; #9E1A -鸛 > guàn; #9E1B -鸜 > qú; #9E1C -é¸ > lí; #9E1D -鸞 > luán; #9E1E -鸟 > niăo; #9E1F -鸠 > jÄ«u; #9E20 -鸡 > jÄ«; #9E21 -鸢 > yuÄn; #9E22 -鸣 > míng; #9E23 -鸤 > shÄ«; #9E24 -鸥 > Åu; #9E25 -鸦 > yÄ; #9E26 -鸧 > cÄng; #9E27 -鸨 > băo; #9E28 -鸩 > zhèn; #9E29 -鸪 > gÅ«; #9E2A -鸫 > dÅng; #9E2B -鸬 > lú; #9E2C -鸭 > yÄ; #9E2D -鸮 > xiÄo; #9E2E -鸯 > yÄng; #9E2F -鸰 > líng; #9E30 -鸱 > zhÄ«; #9E31 -鸲 > qú; #9E32 -鸳 > yuÄn; #9E33 -鸴 > xué; #9E34 -鸵 > túo; #9E35 -鸶 > sÄ«; #9E36 -鸷 > zhì; #9E37 -鸸 > ér; #9E38 -鸹 > guÄ; #9E39 -鸺 > xÄ«u; #9E3A -鸻 > héng; #9E3B -鸼 > zhÅu; #9E3C -鸽 > gÄ“; #9E3D -鸾 > luán; #9E3E -鸿 > hóng; #9E3F -é¹€ > wú; #9E40 -é¹ > bó; #9E41 -鹂 > lí; #9E42 -鹃 > juÄn; #9E43 -鹄 > hú; #9E44 -é¹… > é; #9E45 -鹆 > yù; #9E46 -鹇 > xián; #9E47 -鹈 > tí; #9E48 -鹉 > wÅ­; #9E49 -鹊 > què; #9E4A -鹋 > miáo; #9E4B -鹌 > Än; #9E4C -é¹ > kÅ«n; #9E4D -鹎 > bÄ“i; #9E4E -é¹ > péng; #9E4F -é¹ > qiÄn; #9E50 -鹑 > chún; #9E51 -é¹’ > gÄ“ng; #9E52 -鹓 > yuÄn; #9E53 -é¹” > sù; #9E54 -鹕 > hú; #9E55 -é¹– > hé; #9E56 -é¹— > è; #9E57 -鹘 > gú; #9E58 -é¹™ > qÄ«u; #9E59 -鹚 > zÄ«; #9E5A -é¹› > méi; #9E5B -鹜 > mù; #9E5C -é¹ > nì; #9E5D -鹞 > yào; #9E5E -鹟 > wÄ“ng; #9E5F -é¹  > líu; #9E60 -鹡 > jí; #9E61 -é¹¢ > nì; #9E62 -é¹£ > jiÄn; #9E63 -鹤 > hè; #9E64 -é¹¥ > yÄ«; #9E65 -鹦 > yÄ«ng; #9E66 -鹧 > zhè; #9E67 -鹨 > liáo; #9E68 -鹩 > liáo; #9E69 -鹪 > jiÄo; #9E6A -鹫 > jìu; #9E6B -鹬 > yù; #9E6C -é¹­ > lù; #9E6D -é¹® > xuán; #9E6E -鹯 > zhÄn; #9E6F -é¹° > yÄ«ng; #9E70 -é¹± > hùo; #9E71 -é¹² > méng; #9E72 -é¹³ > guàn; #9E73 -é¹´ > shuÄng; #9E74 -é¹µ > lÅ­; #9E75 -鹶 > jÄ«n; #9E76 -é¹· > líng; #9E77 -鹸 > jiăn; #9E78 -é¹¹ > xián; #9E79 -鹺 > cúo; #9E7A -é¹» > jiăn; #9E7B -é¹¼ > jiăn; #9E7C -é¹½ > yán; #9E7D -é¹¾ > cúo; #9E7E -鹿 > lù; #9E7F -麀 > yÅu; #9E80 -éº > cÅ«; #9E81 -麂 > jÄ­; #9E82 -麃 > biÄo; #9E83 -麄 > cÅ«; #9E84 -麅 > biÄo; #9E85 -麆 > zhù; #9E86 -麇 > jÅ«n; #9E87 -麈 > zhÅ­; #9E88 -麉 > jiÄn; #9E89 -麊 > mí; #9E8A -麋 > mí; #9E8B -麌 > wú; #9E8C -éº > líu; #9E8D -麎 > chén; #9E8E -éº > jÅ«n; #9E8F -éº > lín; #9E90 -麑 > ní; #9E91 -麒 > qí; #9E92 -麓 > lù; #9E93 -麔 > jìu; #9E94 -麕 > jÅ«n; #9E95 -麖 > jÄ«ng; #9E96 -麗 > lì; #9E97 -麘 > xiÄng; #9E98 -麙 > yán; #9E99 -麚 > jiÄ; #9E9A -麛 > mí; #9E9B -麜 > lì; #9E9C -éº > shè; #9E9D -麞 > zhÄng; #9E9E -麟 > lín; #9E9F -麠 > jÄ«ng; #9EA0 -麡 > jÄ«; #9EA1 -麢 > líng; #9EA2 -麣 > yán; #9EA3 -麤 > cÅ«; #9EA4 -麥 > mài; #9EA5 -麦 > mài; #9EA6 -麧 > gÄ“; #9EA7 -麨 > chăo; #9EA8 -麩 > fÅ«; #9EA9 -麪 > miăn; #9EAA -麫 > miăn; #9EAB -麬 > fÅ«; #9EAC -麭 > pào; #9EAD -麮 > qù; #9EAE -麯 > qú; #9EAF -麰 > móu; #9EB0 -麱 > fÅ«; #9EB1 -麲 > xiàn; #9EB2 -麳 > lái; #9EB3 -麴 > qú; #9EB4 -麵 > miàn; #9EB5 -麷 > fÄ“ng; #9EB7 -麸 > fÅ«; #9EB8 -麹 > qú; #9EB9 -麺 > miàn; #9EBA -麻 > má; #9EBB -麼 > mo; #9EBC -麽 > mo; #9EBD -麾 > hÅ«i; #9EBE -黀 > zÅu; #9EC0 -é» > nÄ“n; #9EC1 -黂 > fén; #9EC2 -黃 > huáng; #9EC3 -黄 > huáng; #9EC4 -é»… > jÄ«n; #9EC5 -黆 > guÄng; #9EC6 -黇 > tiÄn; #9EC7 -黈 > tÅu; #9EC8 -黉 > héng; #9EC9 -黊 > xÄ«; #9ECA -黋 > kuăng; #9ECB -黌 > héng; #9ECC -é» > shÅ­; #9ECD -黎 > lí; #9ECE -é» > nián; #9ECF -é» > chÄ«; #9ED0 -黑 > hÄ“i; #9ED1 -é»’ > hÄ“i; #9ED2 -黓 > yì; #9ED3 -é»” > qián; #9ED4 -黕 > dÄn; #9ED5 -é»– > xì; #9ED6 -é»— > tuăn; #9ED7 -默 > mò; #9ED8 -é»™ > mò; #9ED9 -黚 > qián; #9EDA -é»› > dài; #9EDB -黜 > chù; #9EDC -é» > yÅu; #9EDD -點 > diăn; #9EDE -黟 > yÄ«; #9EDF -é»  > xiá; #9EE0 -黡 > yăn; #9EE1 -黢 > qÅ«; #9EE2 -黣 > mÄ•i; #9EE3 -黤 > yăn; #9EE4 -黥 > jÄ«ng; #9EE5 -黦 > yù; #9EE6 -黧 > lí; #9EE7 -黨 > dăng; #9EE8 -黩 > dú; #9EE9 -黪 > căn; #9EEA -黫 > yÄ«n; #9EEB -黬 > àn; #9EEC -é»­ > yÄn; #9EED -é»® > tăn; #9EEE -黯 > àn; #9EEF -é»° > zhÄ•n; #9EF0 -é»± > dài; #9EF1 -黲 > căn; #9EF2 -黳 > yÄ«; #9EF3 -é»´ > méi; #9EF4 -黵 > dăn; #9EF5 -黶 > yăn; #9EF6 -é»· > dú; #9EF7 -黸 > lú; #9EF8 -黹 > zhÄ­; #9EF9 -黺 > fÄ•n; #9EFA -é»» > fù; #9EFB -黼 > fÅ­; #9EFC -黽 > mÄ­n; #9EFD -黾 > mÄ­n; #9EFE -黿 > yuán; #9EFF -é¼€ > cù; #9F00 -é¼ > qù; #9F01 -鼂 > cháo; #9F02 -鼃 > wÄ; #9F03 -鼄 > zhÅ«; #9F04 -é¼… > zhÄ«; #9F05 -鼆 > máng; #9F06 -鼇 > áo; #9F07 -鼈 > biÄ“; #9F08 -鼉 > túo; #9F09 -鼊 > bì; #9F0A -鼋 > yuán; #9F0B -鼌 > cháo; #9F0C -é¼ > túo; #9F0D -鼎 > dÄ­ng; #9F0E -é¼ > mì; #9F0F -é¼ > nài; #9F10 -鼑 > dÄ­ng; #9F11 -é¼’ > zÄ«; #9F12 -鼓 > gÅ­; #9F13 -é¼” > gÅ­; #9F14 -鼕 > dÅng; #9F15 -é¼– > fén; #9F16 -é¼— > táo; #9F17 -鼘 > yuÄn; #9F18 -é¼™ > pí; #9F19 -鼚 > chÄng; #9F1A -é¼› > gÄo; #9F1B -鼜 > qì; #9F1C -é¼ > yuÄn; #9F1D -鼞 > tÄng; #9F1E -鼟 > tÄ“ng; #9F1F -é¼  > shÅ­; #9F20 -鼡 > shÅ­; #9F21 -é¼¢ > fén; #9F22 -é¼£ > fèi; #9F23 -鼤 > wén; #9F24 -é¼¥ > bá; #9F25 -鼦 > diÄo; #9F26 -鼧 > túo; #9F27 -鼨 > tóng; #9F28 -鼩 > qú; #9F29 -鼪 > shÄ“ng; #9F2A -鼫 > shí; #9F2B -鼬 > yòu; #9F2C -é¼­ > shí; #9F2D -é¼® > tíng; #9F2E -鼯 > wú; #9F2F -é¼° > niàn; #9F30 -é¼± > jÄ«ng; #9F31 -é¼² > hún; #9F32 -é¼³ > jú; #9F33 -é¼´ > yăn; #9F34 -é¼µ > tú; #9F35 -鼶 > tí; #9F36 -é¼· > xÄ«; #9F37 -鼸 > xiăn; #9F38 -é¼¹ > yăn; #9F39 -鼺 > léi; #9F3A -é¼» > bí; #9F3B -é¼¼ > yăo; #9F3C -é¼½ > qíu; #9F3D -é¼¾ > hÄn; #9F3E -鼿 > wÅ«; #9F3F -é½€ > wù; #9F40 -é½ > hóu; #9F41 -齂 > xì; #9F42 -齃 > gé; #9F43 -齄 > zhÄ; #9F44 -é½… > xìu; #9F45 -齆 > wèng; #9F46 -齇 > zhÄ; #9F47 -齈 > nóng; #9F48 -齉 > nàng; #9F49 -齊 > qí; #9F4A -齋 > zhÄi; #9F4B -齌 > jì; #9F4C -é½ > zÄ«; #9F4D -齎 > jÄ«; #9F4E -é½ > jÄ«; #9F4F -é½ > qí; #9F50 -齑 > jÄ«; #9F51 -é½’ > chÄ­; #9F52 -齓 > chèn; #9F53 -é½” > chèn; #9F54 -齕 > hé; #9F55 -é½– > yá; #9F56 -é½— > kÄ•n; #9F57 -齘 > xiè; #9F58 -é½™ > páo; #9F59 -齚 > cùo; #9F5A -é½› > shì; #9F5B -齜 > zÄ«; #9F5C -é½ > chÄ«; #9F5D -齞 > niàn; #9F5E -齟 > jÅ­; #9F5F -é½  > tiáo; #9F60 -齡 > líng; #9F61 -é½¢ > líng; #9F62 -é½£ > chÅ«; #9F63 -齤 > quán; #9F64 -é½¥ > xiè; #9F65 -齦 > kÄ•n; #9F66 -齧 > niè; #9F67 -齨 > jìu; #9F68 -齩 > yăo; #9F69 -齪 > chùo; #9F6A -齫 > kÅ­n; #9F6B -齬 > yÅ­; #9F6C -é½­ > chÅ­; #9F6D -é½® > yÄ­; #9F6E -齯 > ní; #9F6F -é½° > cùo; #9F70 -é½± > zÅu; #9F71 -é½² > qÅ­; #9F72 -é½³ > nÄ•n; #9F73 -é½´ > xiăn; #9F74 -é½µ > óu; #9F75 -齶 > è; #9F76 -é½· > wò; #9F77 -齸 > yì; #9F78 -é½¹ > chÅ«o; #9F79 -齺 > zÅu; #9F7A -é½» > diÄn; #9F7B -é½¼ > chÅ­; #9F7C -é½½ > jìn; #9F7D -é½¾ > yà; #9F7E -齿 > chÄ­; #9F7F -é¾€ > chèn; #9F80 -é¾ > hé; #9F81 -龂 > kÄ•n; #9F82 -龃 > jÅ­; #9F83 -龄 > líng; #9F84 -é¾… > páo; #9F85 -龆 > tiáo; #9F86 -龇 > zÄ«; #9F87 -龈 > kÄ•n; #9F88 -龉 > yÅ­; #9F89 -龊 > chùo; #9F8A -龋 > qÅ­; #9F8B -龌 > wò; #9F8C -é¾ > lóng; #9F8D -龎 > páng; #9F8E -é¾ > gÅng; #9F8F -é¾ > páng; #9F90 -龑 > yăn; #9F91 -é¾’ > lóng; #9F92 -龓 > lóng; #9F93 -é¾” > gÅng; #9F94 -龕 > kÄn; #9F95 -é¾– > tà; #9F96 -é¾— > líng; #9F97 -龘 > tà; #9F98 -é¾™ > lóng; #9F99 -龚 > gÅng; #9F9A -é¾› > kÄn; #9F9B -龜 > gÅ«i; #9F9C -é¾ > qÄ«u; #9F9D -龞 > biÄ“; #9F9E -龟 > gÅ«i; #9F9F -é¾  > yuè; #9FA0 -龡 > chùi; #9FA1 -é¾¢ > hé; #9FA2 -é¾£ > jué; #9FA3 -龤 > xié; #9FA4 -é¾¥ > yù; #9FA5 -癩 > là; #F90E -兀 > wù; #FA0C -ï¨ > hùo; #FA0D -ï¨ > zhÅng; #FA10 -晴 > qíng; #FA12 -凞 > xÄ«; #FA15 -猪 > zhÅ«; #FA16 -益 > yì; #FA17 -礼 > lÄ­; #FA18 -神 > shén; #FA19 -祥 > xiáng; #FA1A -福 > fú; #FA1B -靖 > jìng; #FA1C -ï¨ > jÄ«ng; #FA1D -羽 > yÅ­; #FA1E -諸 > zhÅ«; #FA22 -逸 > yì; #FA25 -都 > dÅ«; #FA26 -飯 > fàn; #FA2A -飼 > sì; #FA2B -館 > guăn; #FA2C -鶴 > hè; #FA2D - -# eof diff --git a/icu4j/src/com/ibm/demo/translit/resources/Transliterator_Kanji_English.txt b/icu4j/src/com/ibm/demo/translit/resources/Transliterator_Kanji_English.txt deleted file mode 100755 index fe353f3a02..0000000000 --- a/icu4j/src/com/ibm/demo/translit/resources/Transliterator_Kanji_English.txt +++ /dev/null @@ -1,6366 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:42:02 2001 -#-------------------------------------------------------------------- - -# Kanji-English - -ä¸>'[male adult]'; -七>'[seven]'; -万>'[ten thousand]'; -丈>'[unit of length equal 3.3 meters]'; -三>'[three]'; -上>'[top]'; -下>'[under]'; -ä¸>'[no]'; -与>'[and]'; -ä¸>'[beggar]'; -丑>'[clown]'; -且>'[moreover]'; -丕>'[great]'; -世>'[generation]'; -丗>'[thirty]'; -丘>'[hill]'; -丙>'[third of heavenly stems]'; -丞>'[assist]'; -両>'[two]'; -並>'[equal to]'; -个>'[numerary adjunct]'; -中>'[central]'; -丱>'[child''s hairstyle bound in two tufts]'; -串>'[string]'; -丶>'[dot]'; -丸>'[small round object]'; -丹>'[cinnabar (native HgS)]'; -主>'[master]'; -丼>'[bowl of food]'; -丿>'[line]'; -乂>'[govern]'; -乃>'[then]'; -ä¹…>'[long time (ago)]'; -之>'[''s (marks preceding phrase as modifier of following phrase)]'; -ä¹>'[suddenly]'; -乎>'[interrogative or exclamatory final particle]'; -ä¹>'[lack]'; -乕>'[tiger]'; -ä¹–>'[rebel]'; -ä¹—>'[ride]'; -乘>'[ride]'; -ä¹™>'[second heaven''s stem]'; -ä¹>'[nine]'; -乞>'[beg]'; -也>'[also]'; -ä¹¢>'[lid]'; -ä¹±>'[confusion]'; -ä¹³>'[breast]'; -ä¹¾>'[dry]'; -亀>'[turtle or tortoise]'; -亂>'[confusion]'; -亅>'[hook]'; -了>'[to finish]'; -予>'[I]'; -争>'[dispute]'; -亊>'[affair]'; -事>'[affair]'; -二>'[two]'; -于>'[in]'; -云>'[say]'; -互>'[mutually]'; -五>'[five]'; -井>'[well]'; -亘>'[extend across]'; -亙>'[extend across]'; -些>'[little]'; -亜>'[asia]'; -亞>'[asia]'; -亟>'[urgently]'; -亠>'[head]'; -亡>'[death]'; -亢>'[high]'; -交>'[mix]'; -亥>'[last of 12 earth branches]'; -亦>'[also]'; -亨>'[smoothly]'; -享>'[enjoy]'; -京>'[capital city]'; -亭>'[pavilion]'; -亮>'[bright]'; -亰>'[capital city]'; -亳>'[name of district in Anhui]'; -亶>'[sincere]'; -人>'[man]'; -什>'[file of ten soldiers]'; -ä»>'[humaneness]'; -仂>'[surplus or excess]'; -仄>'[slanting]'; -仆>'[fall forward]'; -仇>'[enemy]'; -今>'[now]'; -介>'[forerunner]'; -ä»>'[yet]'; -从>'[from]'; -ä»>'[buddha]'; -ä»”>'[small thing]'; -仕>'[official]'; -ä»–>'[other]'; -ä»—>'[rely upon]'; -付>'[give]'; -ä»™>'[Taoist super-being]'; -ä»>'[together]'; -仞>'[ancient unit of measure (8 feet)]'; -仟>'[one thousand]'; -代>'[replace]'; -令>'[command]'; -以>'[by means of]'; -ä»­>'[ancient unit of measure (8 feet)]'; -ä»®>'[falsehood]'; -ä»°>'[raise the head to look]'; -仲>'[middle brother]'; -件>'[numerary adjunct for article]'; -ä»·>'[price]'; -ä»»>'[trust to]'; -ä¼>'[plan a project]'; -伉>'[compare]'; -伊>'[third person pronoun]'; -ä¼>'[five]'; -伎>'[talent]'; -ä¼>'[crouch]'; -ä¼>'[cut down]'; -休>'[rest]'; -会>'[assemble]'; -伜>'[deputy]'; -ä¼>'[summon]'; -伯>'[older brother]'; -ä¼°>'[merchant]'; -ä¼´>'[companion]'; -伶>'[lonely]'; -伸>'[extend]'; -伺>'[serve]'; -ä¼¼>'[resemble]'; -ä¼½>'[transcription of sanskrit gha in buddhist texts ('ëmâæ' \"samgha\")]'; -佃>'[tenant farmer]'; -但>'[only]'; -佇>'[wait]'; -ä½>'[throne]'; -低>'[low]'; -ä½>'[reside]'; -ä½>'[assist]'; -佑>'[help]'; -体>'[body]'; -何>'[what]'; -ä½—>'[other]'; -ä½™>'[I]'; -佚>'[indulge in pleasures]'; -ä½›>'[buddha (contraction of MC 'bhiêtdha')]'; -作>'[make]'; -ä½>'[rickets]'; -佞>'[flattery]'; -佩>'[belt ornament]'; -佯>'[pretend]'; -ä½°>'[hundred]'; -ä½³>'[good]'; -ä½µ>'[combine]'; -佶>'[strong]'; -ä½»>'[frivolous]'; -ä½¼>'[beautiful]'; -使>'[cause]'; -侃>'[upright and strong]'; -來>'[come]'; -侈>'[luxurious]'; -例>'[precedent]'; -ä¾>'[serve]'; -ä¾>'[small]'; -侑>'[help]'; -ä¾–>'[logical reasons]'; -侘>'[disappointed]'; -ä¾›>'[supply]'; -ä¾>'[rely on]'; -ä¾ >'[chivalrous person]'; -価>'[price]'; -侫>'[flattery]'; -ä¾­>'[complete]'; -ä¾®>'[insult]'; -侯>'[marquis]'; -ä¾µ>'[invade]'; -侶>'[companion]'; -便>'[convenience]'; -ä¿‚>'[bind]'; -促>'[urge]'; -ä¿„>'[sudden(ly)]'; -ä¿Š>'[talented]'; -ä¿Ž>'[chopping board or block]'; -ä¿>'[smooth]'; -ä¿‘>'[wooden figure buried with dead]'; -ä¿”>'[like]'; -ä¿—>'[social customs]'; -俘>'[prisoner of war]'; -ä¿š>'[rustic]'; -ä¿›>'[make effort]'; -ä¿>'[protect]'; -ä¿Ÿ>'[wait for]'; -ä¿¡>'[trust]'; -ä¿£>'[big]'; -#"ä¿£>'[big]'", -ä¿¥>'[rickshaw]'; -ä¿®>'[study]'; -俯>'[bow down]'; -俳>'[actor]'; -俵>'[divide]'; -俶>'[start]'; -俸>'[wages]'; -俺>'[personal pronoun]'; -俾>'[so that]'; -倅>'[deputy]'; -倆>'[clever]'; -倉>'[granary]'; -個>'[numerary adjunct]'; -å€>'[times]'; -å€>'[hastily]'; -們>'[adjunct pronoun indicate plural]'; -倒>'[fall over]'; -倔>'[stubborn]'; -倖>'[lucky]'; -候>'[wait]'; -倚>'[rely on]'; -借>'[borrow]'; -倡>'[guide]'; -倣>'[imitate]'; -値>'[price]'; -倥>'[boorish]'; -倦>'[be tired of]'; -倨>'[arrogant]'; -倩>'[beautiful]'; -倪>'[feeble]'; -倫>'[normal human relationships]'; -倬>'[noticeable]'; -倭>'[dwarf]'; -倶>'[all]'; -倹>'[temperate]'; -åƒ>'[cease]'; -å‡>'[falsehood]'; -åˆ>'[brave]'; -å‰>'[great]'; -å>'[inclined one side]'; -å>'[false]'; -å•>'[together]'; -å–>'[rip up]'; -åš>'[work]'; -åœ>'[stop]'; -å¥>'[strong]'; -å¬>'[urgent]'; -å²>'[talented]'; -å´>'[side]'; -åµ>'[spy]'; -å¶>'[accidentally]'; -å¸>'[to steal]'; -å½>'[false]'; -å‚€>'[great]'; -å‚…>'[tutor]'; -å‚>'[by side of]'; -å‚‘>'[hero]'; -傘>'[umbrella]'; -å‚™>'[prepare]'; -å‚š>'[imitate]'; -催>'[press]'; -å‚­>'[hire]'; -傲>'[proud]'; -傳>'[summon]'; -å‚´>'[humpback]'; -債>'[debt]'; -å‚·>'[wound]'; -傾>'[upset]'; -僂>'[humpback]'; -僅>'[only]'; -僉>'[all]'; -僊>'[Taoist super-being]'; -åƒ>'[labor]'; -åƒ>'[picture]'; -僑>'[sojourn]'; -僕>'[slave]'; -僖>'[joy]'; -僚>'[companion]'; -僞>'[false]'; -僣>'[assume]'; -僥>'[be lucky]'; -僧>'[buddhist priest]'; -僭>'[assume]'; -僮>'[page]'; -僵>'[stiff and motionless]'; -價>'[price]'; -僻>'[out-of-the-way]'; -å„€>'[ceremony]'; -å„>'[outstanding]'; -å„‚>'[I]'; -å„„>'[hundred million]'; -儉>'[temperate]'; -å„’>'[confucian scholar]'; -å„”>'[companion]'; -å„•>'[a company]'; -#"å„•>'[a company]'", -儘>'[utmost]'; -#"儘>'[utmost]'", -å„Ÿ>'[repay]'; -å„¡>'[puppet]'; -優>'[superior]'; -儲>'[save money]'; -å„·>'[spouse]'; -儺>'[rich]'; -å„»>'[if]'; -儼>'[grave]'; -å„¿>'[son]'; -å…€>'[to cut off the feet]'; -å…>'[to grant]'; -å…ƒ>'[first]'; -å…„>'[elder brother]'; -å……>'[fill]'; -å…†>'[omen]'; -å…‡>'[atrocious]'; -å…ˆ>'[first]'; -å…‰>'[light]'; -å…‹>'[gram]'; -å…Œ>'[cash]'; -å…>'[spare]'; -å…Ž>'[rabbit]'; -å…>'[son]'; -å…’>'[son]'; -å…”>'[rabbit]'; -å…š>'[political party]'; -å…œ>'[pouch]'; -å…¢>'[fearful]'; -å…¥>'[enter]'; -å…¨>'[maintain]'; -å…©>'[two]'; -å…ª>'[surname]'; -å…«>'[eight]'; -å…¬>'[fair]'; -å…­>'[number six]'; -å…®>'[exclamatory particle]'; -å…±>'[together with]'; -å…µ>'[soldier]'; -å…¶>'[his]'; -å…·>'[tool]'; -å…¸>'[law]'; -å…¼>'[unite]'; -冀>'[hope for]'; -冂>'[wide]'; -内>'[inside]'; -円>'[yen]'; -冉>'[tender]'; -冊>'[book]'; -册>'[book]'; -å†>'[again]'; -å†>'[[not found in dictionary]]'; -å†>'[risk]'; -冑>'[helmet]'; -冒>'[risk]'; -冓>'[a secluded place]'; -冕>'[crown]'; -冖>'[cover]'; -冗>'[excessive]'; -写>'[write]'; -冠>'[cap]'; -冢>'[burial mound]'; -冤>'[grievance]'; -冥>'[dark]'; -冦>'[bandits]'; -冨>'[abundant]'; -冩>'[write]'; -冪>'[cover-cloth]'; -冫>'[ice]'; -冬>'[winter]'; -冰>'[ice]'; -冱>'[freezing]'; -冲>'[soar]'; -决>'[decide]'; -冴>'[freezing]'; -况>'[condition]'; -冶>'[smelt]'; -冷>'[cold]'; -冽>'[cold and raw]'; -凄>'[bitter cold]'; -凅>'[dried up]'; -准>'[approve]'; -凉>'[cool]'; -凋>'[be withered]'; -凌>'[pure]'; -å‡>'[freeze]'; -凖>'[rule]'; -凛>'[to shiver with cold or fear]'; -凜>'[shiver with cold or fear]'; -å‡>'[coagulate]'; -几>'[small table]'; -凡>'[all]'; -処>'[place]'; -凧>'[kite]'; -凩>'[wintry wind]'; -凪>'[calm]'; -凭>'[lean on]'; -凰>'[female phoenix]'; -凱>'[triumphant]'; -凵>'[receptacle]'; -凶>'[culprit]'; -凸>'[protrude]'; -凹>'[concave]'; -出>'[go out]'; -函>'[correspondence]'; -凾>'[correspondence]'; -刀>'[knife]'; -刃>'[edged tool]'; -刄>'[edged tool]'; -分>'[divide]'; -切>'[cut]'; -刈>'[cut off]'; -刊>'[publication]'; -刋>'[publication]'; -刎>'[behead]'; -刑>'[punishment]'; -刔>'[scoop out]'; -列>'[line]'; -åˆ>'[beginning]'; -判>'[judge]'; -別>'[separate]'; -刧>'[disaster]'; -利>'[gains]'; -刪>'[to cut]'; -刮>'[shave]'; -到>'[go to]'; -刳>'[cut out]'; -制>'[system]'; -刷>'[brush]'; -券>'[certificate]'; -刹>'[temple]'; -刺>'[stab]'; -刻>'[carve]'; -剃>'[shave]'; -剄>'[cut throat]'; -則>'[rule]'; -削>'[scrape off]'; -剋>'[subdue]'; -剌>'[slash]'; -å‰>'[in front]'; -å‰>'[establish]'; -剔>'[pick out]'; -剖>'[split in two]'; -剛>'[hard]'; -剞>'[carving or engraving knife]'; -剣>'[sword]'; -剤>'[medicinal preparation]'; -剥>'[peel]'; -剩>'[leftovers]'; -剪>'[scissors]'; -副>'[assist]'; -剰>'[leftovers]'; -剱>'[sword]'; -割>'[cut]'; -剳>'[brief note]'; -剴>'[sharpen]'; -創>'[establish]'; -剽>'[rob]'; -剿>'[destroy]'; -劃>'[divide]'; -劇>'[theatrical plays]'; -劈>'[cut apart]'; -劉>'[surname]'; -åŠ>'[sword]'; -劑>'[medicinal preparation]'; -劒>'[sword]'; -劔>'[sword]'; -力>'[power]'; -功>'[achievement]'; -加>'[add to]'; -劣>'[bad]'; -助>'[help]'; -努>'[exert]'; -劫>'[take by force]'; -劬>'[be diligent]'; -劭>'[encourage]'; -励>'[strive]'; -労>'[labor]'; -劵>'[certificate]'; -効>'[efficacious]'; -劼>'[be discreet]'; -劾>'[examine into]'; -å‹>'[strong]'; -勃>'[suddenly]'; -å‹…>'[imperial degree]'; -勇>'[brave]'; -勉>'[endeavor]'; -å‹>'[strong]'; -å‹’>'[strangle]'; -å‹•>'[move]'; -å‹—>'[enjoin]'; -勘>'[investigate]'; -å‹™>'[affairs]'; -å‹>'[victory]'; -å‹ž>'[labor]'; -å‹Ÿ>'[levy]'; -å‹ >'[join forces]'; -å‹¢>'[power]'; -å‹£>'[achievements]'; -勤>'[industrious]'; -勦>'[destroy]'; -勧>'[recommend]'; -勲>'[meritorious deed]'; -勳>'[meritorious deed]'; -勵>'[strive]'; -勸>'[recommend]'; -勹>'[wrap]'; -勺>'[spoon]'; -勾>'[hook]'; -å‹¿>'[must not]'; -åŒ>'[Japanese unit of weight (1/1000 of a kan)]'; -匂>'[fragrance]'; -包>'[wrap]'; -匆>'[hastily]'; -匈>'[breast]'; -åŒ>'[crawl]'; -åŒ>'[gourd]'; -åŒ>'[fall prostrate]'; -匕>'[spoon]'; -化>'[change]'; -北>'[north]'; -匙>'[spoon]'; -匚>'[box]'; -åŒ>'[full circle]'; -匠>'[craftsman]'; -匡>'[correct]'; -匣>'[small box]'; -匪>'[bandits]'; -匯>'[concourse]'; -匱>'[to lack]'; -匳>'[ladies toilet case with mirror]'; -匸>'[box]'; -匹>'[bolt of cloth]'; -区>'[area]'; -医>'[cure]'; -匿>'[hide]'; -å€>'[area]'; -å>'[ten]'; -åƒ>'[thousand]'; -å…>'[thirty]'; -å†>'[soldier]'; -å‡>'[arise]'; -åˆ>'[noon]'; -å‰>'[general term for plants]'; -åŠ>'[half]'; -å>'[swastika - fourth of auspicious]'; -å‘>'[humble]'; -å’>'[soldier]'; -å“>'[profound]'; -å”>'[be united]'; -å—>'[south]'; -#"å—>'[south]'", -åš>'[gamble]'; -åœ>'[fortune telling]'; -åž>'[be impatient]'; -å >'[divine]'; -å¦>'[fortune telling]'; -å©>'[seal]'; -å®>'[measuring cup]'; -å¯>'[4th of Earth Branches]'; -å°>'[print]'; -å±>'[dangerous]'; -å³>'[promptly]'; -å´>'[still]'; -åµ>'[egg]'; -å·>'[scroll]'; -å¸>'[lay down]'; -å»>'[still]'; -å¿>'[noble]'; -厂>'[factory]'; -厄>'[adversity]'; -厖>'[bulky]'; -厘>'[thousandth part of tael]'; -厚>'[thick]'; -原>'[source]'; -厠>'[mingle with]'; -厥>'[personal pronoun - he]'; -厦>'[big building]'; -厨>'[kitchen]'; -厩>'[stable]'; -厭>'[dislike]'; -厮>'[servant]'; -厰>'[factory]'; -厳>'[strict]'; -厶>'[private]'; -去>'[go away]'; -å‚>'[take part in]'; -åƒ>'[take part in]'; -åˆ>'[and]'; -å‰>'[crotch]'; -åŠ>'[extend]'; -å‹>'[friend]'; -åŒ>'[set of two]'; -å>'[reverse]'; -åŽ>'[gather together]'; -å”>'[father''s younger brother]'; -å–>'[take]'; -å—>'[receive]'; -å™>'[express]'; -å›>'[rebel]'; -åŸ>'[old man]'; -å¡>'[astute]'; -å¢>'[bush]'; -å£>'[mouth]'; -å¤>'[old]'; -å¥>'[sentence]'; -å¨>'[talkative]'; -å©>'[knock]'; -åª>'[only]'; -å«>'[cry]'; -å¬>'[imperial decree]'; -å­>'[trumpet]'; -å®>'[exhort or enjoin repeatedly]'; -å¯>'[may]'; -å°>'[platform]'; -å±>'[scold]'; -å²>'[history]'; -å³>'[right]'; -å¶>'[to harmonize]'; -å·>'[mark]'; -å¸>'[take charge of]'; -#"å¹>'[sigh]'", -å>'[interjection \"Alas!\"]'; -åƒ>'[eat]'; -å„>'[each]'; -åˆ>'[combine]'; -å‰>'[lucky]'; -åŠ>'[condole]'; -å‹>'[inch]'; -åŒ>'[same]'; -å>'[name]'; -åŽ>'[queen]'; -å>'[government official]'; -å>'[vomit]'; -å‘>'[toward]'; -å›>'[sovereign]'; -å>'[stingy]'; -åŸ>'[sing]'; -å >'[bark]'; -å¦>'[not]'; -å©>'[order]'; -å«>'[hold in mouth]'; -å¬>'[hear]'; -å­>'[throat]'; -å®>'[suck with mouth]'; -å¶>'[raise voice]'; -å¸>'[inhale]'; -å¹>'[blow]'; -å»>'[kiss]'; -å¼>'[roar]'; -å½>'[\"OM\"]'; -å¾>'[i]'; -å‘€>'[particle used express surprise]'; -å‘‚>'[surname]'; -呆>'[dull]'; -呈>'[submit]'; -呉>'[one of warring states]'; -å‘Š>'[tell]'; -å‘Ž>'[foot]'; -å‘‘>'[swallow]'; -#"å‘œ>'[sound of crying]'", -周>'[zhou dynasty]'; -呪>'[curse]'; -#"å‘°>'[................................]'", -呱>'[wail]'; -味>'[taste]'; -呵>'[scold]'; -呶>'[talkative]'; -å‘·>'[suck]'; -å‘»>'[groan]'; -呼>'[breathe sigh]'; -命>'[life]'; -å’€>'[suck]'; -å’„>'[noise of rage]'; -å’†>'[roar]'; -å’‹>'[why? how? what?]'; -å’Œ>'[harmony]'; -å’Ž>'[fault]'; -å’>'[sing song or poem]'; -å’>'[instruct]'; -å’’>'[curse]'; -å’¢>'[sound]'; -å’¤>'[scold]'; -å’¥>'[sound of cat]'; -å’¨>'[inquire]'; -å’«>'[foot measure of Zhou dynasty]'; -å’¬>'[bite]'; -å’¯>'[final particle]'; -å’²>'[smile]'; -å’³>'[cough]'; -å’¸>'[together]'; -å’¼>'[chat]'; -å’½>'[throat]'; -å’¾>'[a noise]'; -å“€>'[sad]'; -å“>'[article]'; -å“‚>'[smile]'; -å“„>'[coax]'; -哇>'[vomit]'; -哈>'[sound of laughter]'; -哉>'[final exclamatory particle]'; -#"å“—>'[rushing sound]'", -å“¡>'[member]'; -å“¢>'[syllable]'; -å“¥>'[elder brother]'; -哦>'[oh? really? is that so?]'; -哨>'[whistle]'; -å“©>'[mile]'; -å“­>'[weep]'; -å“®>'[cough]'; -哲>'[wise]'; -哺>'[chew food]'; -哽>'[choke]'; -唄>'[final particle of assertion pathaka]'; -唆>'[make mischief]'; -唇>'[lips]'; -å”>'[weep or sob]'; -å”>'[tang dynasty]'; -å””>'[hold in mouth]'; -å”–>'[dumb]'; -å”®>'[sell]'; -唯>'[only]'; -å”±>'[sing]'; -唳>'[cry of bird]'; -唸>'[recite]'; -唹>'[to smile at]'; -唾>'[spit]'; -å•€>'[gnaw]'; -å•„>'[to peck]'; -#"å•„>'[to peck]'", -商>'[commerce]'; -å•Œ>'[animal disease]'; -å•>'[ask (about)]'; -å•“>'[open]'; -å•–>'[eat]'; -å•—>'[eat]'; -å•œ>'[sip]'; -#"å•œ>'[sip]'", -å•£>'[hold in mouth]'; -å•»>'[only]'; -啼>'[weep]'; -啾>'[wailing of child]'; -å–€>'[vomit]'; -å–ƒ>'[keep talking]'; -å–„>'[good]'; -å–‡>'[horn]'; -å–‰>'[throat]'; -å–Š>'[shout]'; -å–‹>'[nag]'; -å–˜>'[pant]'; -å–™>'[beak]'; -å–š>'[call]'; -å–œ>'[like]'; -å–>'[drink]'; -å–ž>'[chirping of insects]'; -å–Ÿ>'[heave sigh]'; -å–§>'[lively]'; -å–¨>'[wail]'; -å–©>'[metaphor]'; -å–ª>'[mourning]'; -å–«>'[eat]'; -å–¬>'[tall]'; -å–®>'[single]'; -å–°>'[to eat]'; -å–¶>'[encampment]'; -å—„>'[hoarse of voice]'; -å—…>'[smell]'; -å—‡>'[miserly]'; -å—”>'[be angry at]'; -å—š>'[sound of crying]'; -å—œ>'[be fond of]'; -å—Ÿ>'[sigh]'; -å—£>'[to connect]'; -å—¤>'[laugh at]'; -å—·>'[loud clamor]'; -å—¹>'[chatter]'; -å—½>'[cough]'; -å—¾>'[to set a dog on]'; -嘆>'[sigh]'; -嘉>'[excellent]'; -嘔>'[vomit]'; -嘖>'[interjection of approval or admi]'; -嘗>'[taste]'; -嘘>'[exhale]'; -嘛>'[final exclamatory particle]'; -嘩>'[rushing sound]'; -嘯>'[roar]'; -嘱>'[order]'; -嘲>'[ridicule]'; -嘴>'[mouth]'; -嘶>'[neighing of a horse]'; -嘸>'[unclear]'; -噂>'[meet]'; -噌>'[scold]'; -噎>'[choke]'; -å™>'[receptacle]'; -å™›>'[bite]'; -噤>'[close]'; -器>'[receptacle]'; -噪>'[be noisy]'; -噫>'[belch]'; -噬>'[bite]'; -å™´>'[spurt]'; -噸>'[metric ton]'; -噺>'[story]'; -嚀>'[enjoin]'; -嚆>'[give forth sound]'; -嚇>'[scare]'; -嚊>'[to pant]'; -åš>'[sneeze]'; -åš”>'[sneeze]'; -#"åšœ>'[be silent]'", -嚢>'[bag]'; -嚥>'[swallow]'; -åš®>'[guide]'; -åš´>'[strict]'; -嚶>'[seek friends]'; -åš¼>'[prattle]'; -囀>'[sing]'; -å›>'[move lip when speaking]'; -囂>'[be noisy]'; -#"囂>'[be noisy]'", -囈>'[talk in one''s sleep]'; -#"å›>'[double happiness]'", -囑>'[order]'; -囓>'[gnaw]'; -å›—>'[erect]'; -囘>'[return]'; -囚>'[prisoner]'; -å››>'[four]'; -回>'[return]'; -å› >'[cause]'; -団>'[sphere]'; -å›®>'[inveigle]'; -å›°>'[surround]'; -囲>'[surround]'; -図>'[diagram]'; -囹>'[prison]'; -固>'[become solid]'; -国>'[nation]'; -囿>'[pen up]'; -圀>'[nation]'; -圃>'[garden]'; -圄>'[prison]'; -圈>'[to circle]'; -圉>'[stable]'; -國>'[nation]'; -åœ>'[surround]'; -åœ>'[to circle]'; -園>'[garden]'; -圓>'[circle]'; -圖>'[diagram]'; -團>'[sphere]'; -圜>'[circle]'; -土>'[soil]'; -圦>'[(kokuji) water gate]'; -#"圦>'[(kokuji) water gate]'", -在>'[be at]'; -圭>'[jade pointed at top]'; -地>'[earth]'; -#"圳>'[furrow in field]'", -#"圳>'[furrow in field]'", -圻>'[border]'; -å€>'[site]'; -å‚>'[hillside]'; -å‡>'[equal]'; -åŠ>'[neighborhood]'; -åŽ>'[pit]'; -å>'[rotten]'; -å>'[sit]'; -å‘>'[pit]'; -å¡>'[slope]'; -å¤>'[earth]'; -å¦>'[flat]'; -å©>'[earthenware]'; -åª>'[level ground]'; -å¿>'[mound]'; -åž‚>'[let down]'; -#"垆>'[black clods of earth]'", -#"垉>'[................................]'", -åž‹>'[pattern]'; -åž“>'[border]'; -åž >'[boundary]'; -垢>'[dirt]'; -垣>'[low wall]'; -垤>'[ant-hill]'; -#"åž©>'[holy]'", -#"åž®>'[be defeated]'", -#"åž²>'[high and dry place]'", -埀>'[let down]'; -埃>'[fine dust]'; -埆>'[stony]'; -埋>'[bury]'; -城>'[castle]'; -埒>'[enclosure]'; -埓>'[enclosure]'; -埔>'[plain]'; -#"埔>'[plain]'", -埜>'[open country]'; -域>'[district]'; -埠>'[port city]'; -#"埣>'[................................]'", -埴>'[soil with large clay content]'; -執>'[hold in hand]'; -培>'[bank up with dirt]'; -基>'[foundation]'; -埼>'[headland]'; -å €>'[cave]'; -å ‚>'[hall]'; -å …>'[hard]'; -å †>'[heap]'; -å Š>'[white earth]'; -å ‹>'[bury]'; -å •>'[fall]'; -å ™>'[bury]'; -å >'[crucible]'; -å ¡>'[fort]'; -å ¤>'[dike]'; -å ª>'[adequately capable of]'; -å ¯>'[a legendary ancient emperor-sage]'; -å °>'[dam]'; -å ±>'[report]'; -å ´>'[open space]'; -å µ>'[wall]'; -å º>'[person''s name]'; -å ½>'[mound]'; -å¡€>'[wall]'; -å¡>'[rampart]'; -å¡Š>'[piece]'; -å¡‹>'[grave]'; -å¡‘>'[model in clay]'; -å¡’>'[roost]'; -å¡”>'[tower]'; -å¡—>'[smear]'; -塘>'[pond]'; -å¡™>'[truly]'; -å¡š>'[cemetery]'; -å¡ž>'[stop up]'; -å¡¢>'[entrenchment]'; -å¡©>'[salt]'; -å¡«>'[fill in]'; -#"å¡­>'[[not found in any dictionary]]'", -塲>'[open space]'; -塵>'[dust]'; -塹>'[moat]'; -塾>'[village school]'; -境>'[boundery]'; -墅>'[villa]'; -墓>'[grave]'; -増>'[increase]'; -墜>'[fall down]'; -墟>'[high mound]'; -墨>'[ink]'; -墫>'[cup]'; -墮>'[fall]'; -墳>'[grave]'; -#"墳>'[grave]'", -#"墳>'[grave]'", -墺>'[4 walls]'; -墻>'[wall]'; -墾>'[cultivate]'; -å£>'[partition wall]'; -壅>'[to obstruct]'; -壇>'[altar]'; -壊>'[bad]'; -壌>'[soil]'; -壑>'[bed of torrent]'; -壓>'[press]'; -壕>'[trench]'; -#"壖>'[open space along water]'", -壘>'[rampart]'; -壙>'[tomb]'; -壜>'[earthen jar or jug]'; -壞>'[bad]'; -壟>'[grave]'; -壤>'[soil]'; -#"壥>'[................................]'", -士>'[scholar]'; -壬>'[ninth of ten celestial stems]'; -壮>'[big]'; -壯>'[big]'; -声>'[sound]'; -壱>'[number one]'; -売>'[sell]'; -壷>'[jar]'; -壹>'[number one]'; -壺>'[jar]'; -壻>'[son-in-law]'; -壼>'[palace corridor or passageway]'; -壽>'[old age]'; -夂>'[go]'; -変>'[change]'; -夊>'[Radical No. 35]'; -å¤>'[summer]'; -å¤>'[long]'; -夕>'[evening]'; -外>'[out]'; -夘>'[4th of Earth Branches]'; -夙>'[early in morning]'; -多>'[much]'; -夛>'[much]'; -夜>'[night]'; -夢>'[dream]'; -夥>'[companion]'; -大>'[big]'; -天>'[sky]'; -太>'[very]'; -夫>'[man]'; -夬>'[parted]'; -夭>'[young]'; -央>'[center]'; -失>'[lose]'; -夲>'[advance quickly]'; -夷>'[ancient barbarian tribes]'; -夸>'[extravagant]'; -夾>'[be wedged or inserted between]'; -奄>'[ere long]'; -奇>'[strange]'; -奈>'[but]'; -奉>'[offer]'; -奎>'[stride of man]'; -å¥>'[memorialize emperor]'; -å¥>'[be numerous]'; -契>'[deed]'; -奔>'[run fast]'; -奕>'[in sequence]'; -套>'[case]'; -奘>'[large]'; -奚>'[where? what? how? why?]'; -奠>'[pay respect]'; -奢>'[extravagant]'; -奥>'[mysterious]'; -奧>'[mysterious]'; -奨>'[prize]'; -奩>'[lady''s vanity case]'; -奪>'[take by force]'; -奬>'[prize]'; -奮>'[strive]'; -女>'[woman]'; -奴>'[slave]'; -奸>'[crafty]'; -好>'[good]'; -å¦>'[act as go-between]'; -如>'[if]'; -妃>'[wife]'; -妄>'[absurd]'; -妊>'[conceive]'; -å¦>'[beautiful]'; -妓>'[prostitute]'; -妖>'[strange]'; -妙>'[mysterious]'; -#"妙>'[mysterious]'", -å¦>'[adorn oneself]'; -妣>'[one''s deceased mother]'; -妥>'[satisfactory]'; -妨>'[interfere with]'; -妬>'[jealous]'; -妲>'[concubine of last ruler of shang]'; -妹>'[younger sister]'; -妻>'[wife]'; -妾>'[concubine]'; -姆>'[child''s governess]'; -姉>'[elder sister]'; -始>'[begin]'; -å§>'[elder sister]'; -姑>'[father''s sister]'; -姓>'[one''s family name]'; -委>'[appoint]'; -姙>'[conceive]'; -姚>'[handsome]'; -姜>'[surname]'; -姥>'[maternal grandmother]'; -姦>'[adultery]'; -姨>'[mother/wife''s sister]'; -姪>'[niece]'; -姫>'[beauty]'; -#"姱>'[beautiful]'", -姻>'[relatives by marriage]'; -姿>'[one''s manner]'; -å¨>'[pomp]'; -娃>'[baby]'; -娉>'[beautiful]'; -娑>'[dance]'; -娘>'[mother]'; -#"娚>'[................................]'", -娜>'[elegant]'; -娟>'[beautiful]'; -娠>'[pregnant]'; -娥>'[be beautiful]'; -娩>'[give birth child]'; -娯>'[pleasure]'; -娵>'[star]'; -娶>'[marry]'; -娼>'[prostitute]'; -å©€>'[be beautiful]'; -å©>'[surname]'; -婆>'[old woman]'; -婉>'[amiable]'; -å©š>'[get married]'; -å©¢>'[servant girl]'; -婦>'[married women]'; -婪>'[covet]'; -婬>'[obscene]'; -å©¿>'[son-in-law]'; -媒>'[go-between]'; -媚>'[charming]'; -媛>'[beauty]'; -媼>'[old woman]'; -媽>'[mother]'; -媾>'[marry]'; -å«>'[marry]'; -å«‚>'[sister-in-law]'; -嫉>'[jealousy]'; -å«‹>'[slender and delicate]'; -å«Œ>'[hate]'; -å«>'[frolic]'; -å«–>'[patronize prostitutes]'; -å«—>'[old woman]'; -å«¡>'[legal wife]'; -å«£>'[charming]'; -嫦>'[name of a moon goddess]'; -å«©>'[soft]'; -嫺>'[refined]'; -å«»>'[elegant]'; -嬉>'[enjoy]'; -嬋>'[beautiful]'; -嬌>'[seductive and loveable]'; -嬖>'[favorite]'; -嬢>'[troubled]'; -嬪>'[court lady]'; -嬬>'[mistress]'; -嬰>'[baby]'; -嬲>'[frolic]'; -#"嬴>'[to win]'", -嬾>'[lazy]'; -å­€>'[widow]'; -å­ƒ>'[troubled]'; -å­…>'[slender]'; -å­>'[offspring]'; -å­‘>'[remaining]'; -å­”>'[opening]'; -å­•>'[be pregnant]'; -å­—>'[letter]'; -å­˜>'[exist]'; -å­š>'[brood over eggs]'; -å­›>'[comet]'; -å­œ>'[be as diligent as possible]'; -å­>'[filial piety]'; -å­Ÿ>'[first in series]'; -å­£>'[quarter of year]'; -å­¤>'[orphan]'; -å­¥>'[one''s children]'; -å­¦>'[learning]'; -å­©>'[baby]'; -å­«>'[grandchild]'; -å­°>'[who? which? what? which one?]'; -å­±>'[weak]'; -å­³>'[breed in large numbers]'; -å­µ>'[sit on eggs]'; -å­¸>'[learning]'; -å­º>'[child]'; -宀>'[roof]'; -它>'[it]'; -å®…>'[residence]'; -宇>'[house]'; -守>'[defend]'; -安>'[peaceful]'; -宋>'[Song dynasty]'; -完>'[complete]'; -å®>'[flesh]'; -å®>'[wide]'; -宕>'[stone quarry]'; -å®—>'[lineage]'; -官>'[official]'; -å®™>'[time as concept]'; -定>'[decide]'; -å®›>'[seem]'; -宜>'[suitable]'; -å®>'[treasure]'; -実>'[real]'; -客>'[guest]'; -宣>'[declare]'; -室>'[room]'; -宥>'[forgive]'; -宦>'[officialdom]'; -å®®>'[palace]'; -å®°>'[to slaughter]'; -害>'[injure]'; -å®´>'[entertain]'; -宵>'[night]'; -家>'[house]'; -宸>'[imperial]'; -容>'[looks]'; -宿>'[stop]'; -寂>'[still]'; -寃>'[grievance]'; -寄>'[send]'; -寅>'[respect]'; -密>'[dense]'; -寇>'[bandits]'; -#"寉>'[................................]'", -富>'[abundant]'; -å¯>'[sleep]'; -寒>'[cold]'; -寓>'[residence]'; -寔>'[real]'; -寛>'[broad]'; -å¯>'[sleep]'; -寞>'[silent]'; -察>'[examine]'; -寡>'[widowed]'; -寢>'[sleep]'; -寤>'[few]'; -寥>'[few]'; -實>'[real]'; -寧>'[repose]'; -寨>'[stockade]'; -審>'[examine]'; -寫>'[write]'; -寮>'[shanty]'; -寰>'[great domain]'; -寳>'[treasure]'; -寵>'[favorite]'; -寶>'[treasure]'; -寸>'[inch]'; -寺>'[court]'; -対>'[correct]'; -寿>'[old age]'; -å°>'[letter]'; -å°‚>'[monopolize]'; -å°„>'[shoot]'; -å°…>'[subdue]'; -å°†>'[will]'; -å°‡>'[will]'; -å°ˆ>'[monopolize]'; -å°‰>'[officer]'; -å°Š>'[respect]'; -å°‹>'[seek]'; -å°>'[correct]'; -å°Ž>'[direct]'; -å°>'[small]'; -å°‘>'[few]'; -å°“>'[you]'; -å°–>'[sharp]'; -å°š>'[still]'; -å° >'[very few]'; -å°¢>'[weak]'; -å°¤>'[especially]'; -å°¨>'[shaggy haired dog]'; -å°­>'[a legendary ancient emperor-sage]'; -å°±>'[just]'; -å°¸>'[corpse]'; -å°¹>'[govern]'; -å°º>'[chinese measure approx. \"foot\"]'; -å°»>'[end of spine]'; -å°¼>'[buddhist nun]'; -å°½>'[exhaust]'; -å°¾>'[tail]'; -å°¿>'[urine]'; -å±€>'[bureau]'; -å±>'[break wind]'; -å±…>'[live]'; -屆>'[numerary adjunct for time]'; -屈>'[bend]'; -届>'[numerary adjunct for time]'; -屋>'[house]'; -å±>'[corpse]'; -屎>'[excrement]'; -å±>'[folding screen]'; -å±>'[wooden shoes]'; -屑>'[bits]'; -屓>'[gigantic strength]'; -展>'[open]'; -属>'[class]'; -å± >'[butcher]'; -屡>'[frequently]'; -層>'[storey]'; -å±¥>'[footwear]'; -屬>'[class]'; -å±®>'[sprout]'; -屯>'[village]'; -å±±>'[mountain]'; -屶>'[lofty]'; -å±¹>'[to rise high]'; -岌>'[perilous]'; -å²>'[high]'; -岑>'[steep]'; -å²”>'[diverge]'; -岡>'[ridge or crest of hill]'; -岨>'[uneven]'; -岩>'[cliff]'; -岫>'[mountain peak]'; -岬>'[cape]'; -å²±>'[daishan one of five sacred mount]'; -å²³>'[mountain peak]'; -#"岶>'[................................]'", -å²·>'[min mountain]'; -岸>'[bank]'; -#"岺>'[mountain ridge]'", -#"岺>'[mountain ridge]'", -å²¾>'[mountain pass (korean)]'; -#"峄>'[range of peaks]'", -峇>'[cave]'; -å³™>'[stand erect]'; -å³ >'[mountain pass]'; -峡>'[gorge]'; -峨>'[lofty]'; -峩>'[lofty]'; -峪>'[valley]'; -å³­>'[steep]'; -峯>'[peak]'; -å³°>'[peak]'; -島>'[island]'; -#"峺>'[................................]'", -å³»>'[high]'; -å³½>'[gorge]'; -å´‡>'[esteem]'; -å´‹>'[flowery]'; -å´Ž>'[rough]'; -å´‘>'[Kunlun mountains in Jiang Su province.]'; -å´”>'[high]'; -å´•>'[cliff]'; -å´–>'[cliff]'; -å´—>'[post]'; -å´˜>'[kunlun mountains in jiangsu]'; -å´™>'[kunlun mountains in jiangsu]'; -å´š>'[hilly]'; -å´›>'[towering]'; -å´Ÿ>'[cliffs]'; -å´¢>'[high]'; -å´©>'[rupture]'; -嵋>'[omei mountain in sichuan]'; -嵌>'[inlay]'; -嵎>'[mountain recess]'; -åµ>'[mountain mist]'; -åµ’>'[cliff]'; -嵜>'[rough]'; -嵩>'[high]'; -嵬>'[high]'; -嵯>'[high]'; -åµ³>'[high]'; -嵶>'[low part of a mountain]'; -嶂>'[cliff]'; -嶄>'[high]'; -嶇>'[steep]'; -嶋>'[island]'; -嶌>'[island]'; -#"å¶>'[................................]'", -å¶>'[path leading up a mountain]'; -嶢>'[high or tall]'; -#"嶬>'[................................]'", -嶮>'[high]'; -嶷>'[range of mountains in hunan prov]'; -嶺>'[mountain ridge]'; -嶼>'[island]'; -嶽>'[mountain peak]'; -å·‰>'[steep]'; -å·Œ>'[cliff]'; -å·>'[high]'; -å·’>'[mountain range]'; -å·“>'[summit of mountain]'; -å·–>'[cliff]'; -å·›>'[river]'; -å·>'[stream]'; -å·ž>'[administrative division]'; -å·¡>'[patrol]'; -å·£>'[nest]'; -å·¥>'[labor]'; -å·¦>'[left]'; -å·§>'[skillful]'; -å·¨>'[large]'; -å·«>'[wizard]'; -å·®>'[differ]'; -å·±>'[self]'; -å·²>'[already]'; -å·³>'[sixth of twelve branches]'; -å·´>'[greatly desire]'; -å·µ>'[measuring cup]'; -å··>'[alley]'; -å·»>'[scroll]'; -å·½>'[5th of the 8 trigrams]'; -å·¾>'[kerchief]'; -市>'[market]'; -布>'[cotton cloth]'; -帆>'[sail]'; -帋>'[paper]'; -希>'[rare]'; -帑>'[a treasury]'; -帖>'[invitation card]'; -帙>'[book cover]'; -帚>'[broom]'; -帛>'[silks]'; -å¸>'[supreme ruler]'; -帥>'[commander]'; -師>'[teacher]'; -席>'[seat]'; -帯>'[belt]'; -帰>'[return]'; -帳>'[tent]'; -帶>'[belt]'; -帷>'[tent]'; -常>'[common]'; -帽>'[hat]'; -å¹€>'[picture]'; -幃>'[curtain that forms wall]'; -幄>'[tent]'; -å¹…>'[piece]'; -幇>'[help]'; -幌>'[curtain]'; -幎>'[cover-cloth]'; -å¹”>'[curtain]'; -幕>'[curtain]'; -å¹—>'[women''s headgear]'; -幟>'[flag]'; -幡>'[pennant]'; -å¹¢>'[carriage curtain]'; -å¹£>'[currency]'; -幤>'[evil]'; -å¹²>'[oppose]'; -å¹³>'[flat]'; -å¹´>'[year]'; -å¹µ>'[even level. to raise in both hands]'; -并>'[combine]'; -幸>'[luck(ily)]'; -å¹¹>'[trunk of tree or of human body]'; -幺>'[one]'; -å¹»>'[illusion]'; -å¹¼>'[infant]'; -å¹½>'[quiet]'; -å¹¾>'[how many? how much? (a)few]'; -广>'[wide]'; -åº>'[hall]'; -広>'[broad]'; -庄>'[village]'; -庇>'[cover]'; -床>'[bed]'; -åº>'[series]'; -底>'[bottom]'; -庖>'[kitchen]'; -店>'[shop]'; -庚>'[seventh of ten cyclical stems]'; -府>'[prefecture]'; -庠>'[village school]'; -度>'[degree]'; -座>'[seat]'; -庫>'[armory]'; -庭>'[courtyard]'; -庵>'[buddhist monastery or nunnery]'; -庶>'[numerous]'; -康>'[peaceful]'; -庸>'[usual]'; -å»>'[toilet]'; -廂>'[side-room]'; -廃>'[abrogate]'; -廈>'[big building]'; -廉>'[upright]'; -廊>'[corridor]'; -å»>'[stable]'; -å»>'[stable]'; -廓>'[broad]'; -å»–>'[surname]'; -廚>'[kitchen]'; -å»›>'[store]'; -å»>'[servant]'; -廟>'[temple]'; -å» >'[factory]'; -廡>'[corridor]'; -廢>'[abrogate]'; -廣>'[broad]'; -廨>'[government office]'; -廩>'[granary]'; -廬>'[hut]'; -å»°>'[hall]'; -å»±>'[harmonious]'; -廳>'[hall]'; -å»´>'[go]'; -延>'[delay]'; -å»·>'[court]'; -廸>'[enlighten]'; -建>'[build]'; -å»»>'[circle around]'; -廼>'[then]'; -廾>'[two hands]'; -廿>'[twenty]'; -å¼>'[conical cap worn under zhou dyna]'; -弃>'[reject]'; -弄>'[do]'; -弉>'[large]'; -弊>'[evil]'; -弋>'[catch]'; -弌>'[number one]'; -å¼>'[number two]'; -å¼>'[style]'; -å¼>'[number two]'; -弑>'[to kill one''s superior]'; -弓>'[bow]'; -å¼”>'[condole]'; -引>'[pull]'; -å¼–>'[phonetic for \"te\" (Japanese)]'; -å¼—>'[not]'; -弘>'[enlarge]'; -å¼›>'[loosen]'; -弟>'[young brother]'; -å¼¥>'[extensive]'; -弦>'[string]'; -弧>'[wooden bow]'; -弩>'[cross-bow]'; -å¼­>'[stop]'; -弯>'[bend]'; -å¼±>'[weak]'; -å¼µ>'[stretch]'; -å¼·>'[strong]'; -弸>'[bow stretched full]'; -å¼¼>'[aid]'; -#"å¼¼>'[aid]'", -#"å½>'[................................]'", -彈>'[pellet]'; -彊>'[stubborn]'; -彌>'[extensive]'; -彎>'[bend]'; -彑>'[snout]'; -当>'[bear]'; -å½–>'[a hog]'; -å½—>'[broomstick]'; -å½™>'[collect]'; -彜>'[yi]'; -å½>'[yi]'; -彡>'[hair]'; -å½¢>'[form]'; -彦>'[elegant]'; -彩>'[hue]'; -彪>'[tiger]'; -彫>'[carve]'; -彬>'[cultivated]'; -å½­>'[name of ancient country]'; -å½°>'[clear]'; -å½±>'[shadow]'; -å½³>'[step with left foot]'; -å½·>'[like]'; -å½¹>'[service]'; -å½¼>'[that]'; -彿>'[resembling]'; -å¾€>'[go]'; -å¾>'[invade]'; -徂>'[go]'; -徃>'[go]'; -径>'[narrow path]'; -å¾…>'[treat]'; -徇>'[comply with]'; -很>'[very]'; -徊>'[linger]'; -律>'[statute]'; -後>'[behind]'; -å¾>'[slowly]'; -徑>'[narrow path]'; -å¾’>'[disciple]'; -従>'[from]'; -å¾—>'[obtain]'; -徘>'[walk back and forth]'; -å¾™>'[move one''s abode]'; -從>'[from]'; -å¾ >'[induce]'; -御>'[drive]'; -徨>'[doubtful]'; -復>'[return]'; -循>'[obey]'; -å¾­>'[conscript labor]'; -å¾®>'[small]'; -å¾³>'[virtue]'; -å¾´>'[summon]'; -å¾¹>'[penetrate]'; -å¾¼>'[frontier]'; -å¾½>'[a badge]'; -心>'[heart]'; -å¿…>'[surely]'; -å¿Œ>'[jealous]'; -å¿>'[endure]'; -å¿–>'[guess]'; -å¿—>'[purpose]'; -忘>'[forget]'; -å¿™>'[busy]'; -å¿œ>'[should]'; -å¿>'[disgrace]'; -å¿ >'[loyalty]'; -忤>'[insubordinate]'; -å¿«>'[rapid]'; -å¿°>'[suffer]'; -忱>'[truth]'; -念>'[think of]'; -忸>'[blush]'; -å¿»>'[delightful]'; -忽>'[suddenly]'; -å¿¿>'[get angry]'; -怎>'[what? why? how?]'; -æ€>'[discontented]'; -#"æ€>'[................................]'", -怒>'[anger]'; -怕>'[fear]'; -怖>'[terror]'; -怙>'[rely on]'; -怛>'[grieved]'; -怜>'[pity]'; -æ€>'[think]'; -怠>'[idle]'; -怡>'[harmony]'; -急>'[quick]'; -怦>'[eager]'; -性>'[nature]'; -怨>'[hatred]'; -怩>'[shy]'; -怪>'[strange]'; -怫>'[sorry]'; -怯>'[lacking in courage]'; -怱>'[hastily]'; -怺>'[to endure]'; -æ>'[that]'; -æ‚>'[careful]'; -æƒ>'[rely on]'; -æ†>'[constant]'; -æŠ>'[be united]'; -æ‹>'[love]'; -æ>'[seemingly]'; -æ>'[fear]'; -æ’>'[constant]'; -æ•>'[forgive]'; -æ™>'[illness]'; -æš>'[anger]'; -æŸ>'[scared]'; -æ >'[strange]'; -æ¢>'[restore]'; -æ£>'[indulge oneself]'; -æ¤>'[show pity]'; -æ¥>'[shame]'; -æ¨>'[hatred]'; -æ©>'[kindness]'; -æª>'[respectful]'; -æ«>'[in pain]'; -æ¬>'[quiet]'; -æ­>'[respectful]'; -æ¯>'[rest]'; -æ°>'[just]'; -æµ>'[favor]'; -#"æ¶>'[evil]'", -æ‚>'[irritable]'; -悃>'[sincere]'; -æ‚„>'[silent]'; -悉>'[know]'; -æ‚‹>'[stingy]'; -æ‚Œ>'[brotherly]'; -æ‚>'[courageous]'; -æ‚’>'[sorrowful]'; -æ‚”>'[repent]'; -æ‚–>'[be contradictory to]'; -#"æ‚–>'[be contradictory to]'", -æ‚š>'[be afraid]'; -æ‚›>'[repent]'; -æ‚Ÿ>'[apprehend]'; -æ‚ >'[long]'; -æ‚£>'[suffer]'; -悦>'[pleased]'; -悧>'[smooth]'; -æ‚©>'[angered]'; -悪>'[evil]'; -悲>'[sorrow]'; -悳>'[ethics]'; -æ‚´>'[suffer]'; -悵>'[disappointed]'; -悶>'[gloomy]'; -悸>'[fearful]'; -悼>'[grieve]'; -悽>'[sorrowful]'; -情>'[feeling]'; -惆>'[distressed]'; -惇>'[be kind]'; -惑>'[confuse]'; -惓>'[careful]'; -惘>'[disconcerted]'; -惚>'[absent-minded]'; -惜>'[pity]'; -惟>'[but]'; -惠>'[favor]'; -惡>'[evil]'; -惣>'[overall [questionable variant]]'; -惧>'[fear]'; -惨>'[sad]'; -惰>'[indolent]'; -惱>'[angered]'; -想>'[think]'; -惴>'[afraid]'; -惶>'[fearful]'; -惷>'[wriggle]'; -惹>'[irritate]'; -惺>'[intelligent]'; -惻>'[feel anguish]'; -æ„€>'[change one''s countenance]'; -æ„>'[anxiety]'; -愃>'[relax]'; -愆>'[fault]'; -愈>'[more and more]'; -愉>'[pleasant]'; -æ„>'[pity]'; -æ„Ž>'[obstinate]'; -æ„>'[thought]'; -æ„•>'[startled]'; -æ„š>'[stupid]'; -æ„›>'[love]'; -æ„Ÿ>'[feel]'; -æ„¡>'[absent-minded]'; -愧>'[ashamed]'; -愨>'[sincerity]'; -愬>'[accuse]'; -æ„´>'[sad]'; -愼>'[act with care]'; -愽>'[gamble]'; -愾>'[anger]'; -æ„¿>'[sincere]'; -æ…‚>'[urge]'; -æ…„>'[shiver]'; -æ…‡>'[careful]'; -æ…ˆ>'[kind]'; -æ…Š>'[to resent]'; -æ…‹>'[manner]'; -æ…Œ>'[nervous]'; -æ…>'[angry]'; -æ…Ž>'[act with care]'; -#"æ…“>'[................................]'", -æ…•>'[long for]'; -æ…˜>'[sad]'; -æ…™>'[ashamed]'; -æ…š>'[ashamed]'; -æ…>'[do evil in secret]'; -æ…Ÿ>'[sadness]'; -æ…¢>'[slow(ly)]'; -æ…£>'[habit]'; -æ…¥>'[sincere]'; -æ…§>'[bright]'; -æ…¨>'[sigh]'; -æ…«>'[to alarm]'; -æ…®>'[be concerned]'; -#"æ…¯>'[................................]'", -æ…°>'[comfort]'; -æ…±>'[sad]'; -æ…³>'[miserly]'; -æ…´>'[fear]'; -æ…µ>'[indolent]'; -æ…¶>'[congratulate]'; -æ…·>'[ardent]'; -æ…¾>'[lust]'; -憂>'[sad]'; -憇>'[rest]'; -憊>'[tired]'; -憎>'[hate]'; -æ†>'[pity]'; -憑>'[lean on]'; -憔>'[be worn-out]'; -憖>'[cautious]'; -憙>'[like]'; -憚>'[dread]'; -憤>'[resent]'; -憧>'[irresolute]'; -憩>'[rest]'; -憫>'[pity]'; -憬>'[rouse]'; -憮>'[regretful]'; -憲>'[constitution]'; -憶>'[remember]'; -憺>'[peace]'; -憾>'[regret]'; -懃>'[courteous]'; -懆>'[anxious]'; -懇>'[sincere]'; -懈>'[idle]'; -應>'[should]'; -懊>'[vexed]'; -懋>'[splendid]'; -懌>'[enjoy]'; -æ‡>'[be afraid of]'; -æ‡>'[bosom]'; -懣>'[be sick at heart]'; -懦>'[weak]'; -懲>'[punish]'; -懴>'[regret]'; -懶>'[lazy]'; -懷>'[bosom]'; -懸>'[hang]'; -懺>'[regret]'; -懼>'[fear]'; -懽>'[happy]'; -懾>'[afraid]'; -懿>'[virtuous]'; -戀>'[love]'; -戈>'[halberd]'; -戉>'[a battle-axe]'; -戊>'[fifth of ten celestial stems]'; -戌>'[eleventh of terrestrial branches]'; -æˆ>'[defend borders]'; -戎>'[arms]'; -æˆ>'[completed]'; -我>'[our]'; -戒>'[warn]'; -戔>'[small]'; -或>'[or]'; -戚>'[relative]'; -戛>'[lance]'; -æˆ>'[pirate]'; -戞>'[lance]'; -戟>'[halberd with crescent blade]'; -戡>'[subjugate]'; -戦>'[war]'; -截>'[cut off]'; -戮>'[kill]'; -戯>'[theatrical play]'; -戰>'[war]'; -戲>'[theatrical play]'; -戳>'[prick]'; -戴>'[wear on top]'; -戸>'[door]'; -戻>'[perverse]'; -房>'[house]'; -所>'[place]'; -æ‰>'[flat]'; -扇>'[fan]'; -扈>'[escort]'; -扉>'[door panel]'; -手>'[hand]'; -æ‰>'[talent]'; -扎>'[pull up]'; -打>'[strike]'; -払>'[shake off]'; -托>'[hold up with palm]'; -扛>'[carry on shoulders]'; -扞>'[ward off]'; -扠>'[pick up with fork or pincers]'; -扣>'[knock]'; -扨>'[pick up with fork or pincers]'; -扮>'[dress up]'; -扱>'[collect]'; -扶>'[support]'; -批>'[comment]'; -扼>'[grasp]'; -找>'[search]'; -承>'[inherit]'; -技>'[skill]'; -#"抂>'[................................]'", -抃>'[to clap hands]'; -抄>'[copy]'; -抉>'[choose]'; -把>'[hold]'; -抑>'[press down]'; -抒>'[express]'; -抓>'[scratch]'; -抔>'[take or hold up in both hands]'; -投>'[throw]'; -抖>'[tremble]'; -抗>'[resist]'; -折>'[break off]'; -抛>'[throw (away)]'; -抜>'[uproot]'; -択>'[select]'; -披>'[wear]'; -抬>'[lift]'; -抱>'[embrace]'; -抵>'[resist]'; -抹>'[smear]'; -抻>'[pull]'; -押>'[mortgage]'; -抽>'[draw out]'; -æ‹‚>'[shake off]'; -æ‹…>'[carry]'; -拆>'[break up]'; -拇>'[thumb]'; -拈>'[pick up with fingers]'; -拉>'[pull]'; -æ‹Š>'[slap]'; -æ‹Œ>'[mix]'; -æ‹>'[clap]'; -æ‹>'[take]'; -æ‹>'[kidnap]'; -æ‹‘>'[to clamp]'; -æ‹’>'[ward off with hand]'; -æ‹“>'[expand]'; -æ‹”>'[uproot]'; -æ‹—>'[obstinate]'; -拘>'[restrain]'; -æ‹™>'[stupid]'; -æ‹›>'[beckon]'; -æ‹œ>'[do obeisance]'; -æ‹>'[do obeisance]'; -æ‹ >'[occupy]'; -æ‹¡>'[expand]'; -括>'[include]'; -æ‹­>'[wipe away stains with cloth]'; -æ‹®>'[laboring hard]'; -拯>'[help]'; -拱>'[fold hands on breast]'; -拳>'[fist]'; -#"æ‹´>'[bind with rope]'", -拶>'[press]'; -æ‹·>'[torture and interrogate]'; -拾>'[pick up]'; -æ‹¿>'[take]'; -æŒ>'[sustain]'; -挂>'[hang]'; -指>'[finger]'; -挈>'[assist]'; -按>'[put hand on]'; -挌>'[fight]'; -挑>'[load carried on shoulders]'; -挙>'[raise]'; -挟>'[clasp under arm]'; -#"挥>'[direct]'", -挨>'[near]'; -挫>'[push down]'; -振>'[raise]'; -挺>'[stand upright]'; -挽>'[pull]'; -挾>'[clasp under arm]'; -挿>'[insert]'; -æ‰>'[grasp]'; -æŒ>'[break open]'; -æ>'[ward off]'; -æ>'[pick with fingers]'; -æ>'[contribute]'; -æ•>'[arrest]'; -æ—>'[make progress]'; -æœ>'[search]'; -æ§>'[hold up in two hands]'; -æ¨>'[discard]'; -æ©>'[twist with hands]'; -æ«>'[stoke]'; -æ®>'[occupy]'; -æ²>'[curl]'; -æ¶>'[strike with stick]'; -æ·>'[win]'; -æº>'[press down heavily with fringers]'; -æ»>'[twist with fingers]'; -掀>'[lift]'; -掃>'[sweep]'; -授>'[give to]'; -掉>'[turn]'; -掌>'[palm of hand]'; -掎>'[drag aside]'; -æŽ>'[take out]'; -排>'[row]'; -掖>'[stick in]'; -掘>'[dig]'; -掛>'[hang]'; -#"掟>'[................................]'", -掠>'[rob]'; -採>'[gather]'; -探>'[find]'; -掣>'[drag]'; -接>'[receive]'; -控>'[accuse]'; -推>'[push]'; -掩>'[cover]'; -措>'[place]'; -掫>'[be on night watch]'; -掬>'[grasp with both hands]'; -#"掱>'[pickpocket]'", -掴>'[box one''s ears]'; -#"掴>'[box one''s ears]'", -掻>'[scratch lightly]'; -掾>'[a general designation of officials]'; -æ€>'[choose]'; -æƒ>'[shear]'; -æ„>'[lift]'; -æ†>'[prime minister]'; -æ‰>'[rub]'; -æ>'[copy]'; -æ>'[hold in hand]'; -æ’>'[insert]'; -æ–>'[salute]'; -æš>'[scatter]'; -æ›>'[change]'; -æ¡>'[grasp]'; -æ£>'[put things under clothes]'; -æ©>'[rub and wipe]'; -æ®>'[direct]'; -æ´>'[aid]'; -æ¶>'[make fun of]'; -æº>'[wag]'; -æ†>'[pull]'; -æ>'[diminish]'; -æ>'[seize]'; -æ“>'[trample]'; -æ–>'[wag]'; -æ—>'[hull]'; -æœ>'[search]'; -æ¦>'[grasp]'; -æ¨>'[rub]'; -æ¬>'[transfer]'; -æ­>'[join together]'; -æ´>'[extract]'; -æ¶>'[plunder]'; -æº>'[lead by hand]'; -æ¾>'[press]'; -æ‘‚>'[take in]'; -æ‘Ž>'[to strangle]'; -摘>'[pluck]'; -摧>'[destroy]'; -æ‘©>'[rub]'; -摯>'[sincere]'; -摶>'[roll around with hand]'; -摸>'[gently touch with hand]'; -摺>'[fold]'; -æ’ƒ>'[strike]'; -æ’ˆ>'[scoop out of water]'; -æ’’>'[release]'; -æ’“>'[scratch]'; -æ’•>'[rip]'; -æ’š>'[twirl in fingers]'; -æ’ž>'[knock against]'; -æ’¤>'[omit]'; -æ’¥>'[move]'; -æ’©>'[lift up]'; -æ’«>'[pat]'; -æ’­>'[sow]'; -æ’®>'[little bit]'; -æ’°>'[compose]'; -æ’²>'[pound]'; -æ’¹>'[disturb]'; -æ’»>'[flog]'; -æ’¼>'[move]'; -æ“>'[embrace]'; -æ“‚>'[rub]'; -æ“…>'[monopolize]'; -擇>'[select]'; -æ“>'[conduct]'; -æ“’>'[catch]'; -æ“”>'[carry]'; -擘>'[thumb]'; -æ“š>'[occupy]'; -æ“ >'[crowd]'; -æ“¡>'[carry]'; -æ“¢>'[pull up]'; -æ“£>'[hull]'; -擦>'[wipe]'; -擧>'[raise]'; -擬>'[draft]'; -擯>'[exclude]'; -擱>'[place]'; -擲>'[throw]'; -æ“´>'[expand]'; -#"擶>'[................................]'", -擺>'[put]'; -擽>'[tickle]'; -擾>'[disturb]'; -攀>'[climb]'; -æ”…>'[save]'; -攘>'[seize]'; -攜>'[lead by hand]'; -æ”>'[take in]'; -攣>'[tangled]'; -攤>'[spread out]'; -攪>'[disturb]'; -攫>'[snatch away]'; -攬>'[grasp]'; -支>'[disperse]'; -æ”´>'[rap]'; -攵>'[rap]'; -收>'[gather together]'; -æ”·>'[examine]'; -攸>'[distant]'; -改>'[change]'; -æ”»>'[attack]'; -放>'[put]'; -政>'[government]'; -æ•…>'[ancient]'; -效>'[result]'; -æ•>'[express]'; -æ•>'[fast]'; -æ•‘>'[save]'; -æ••>'[an imperial order or decree]'; -æ•–>'[ramble]'; -æ•—>'[be defeated]'; -敘>'[express]'; -æ•™>'[teach]'; -æ•>'[break]'; -æ•ž>'[roomy]'; -æ•¢>'[dare]'; -æ•£>'[scatter]'; -敦>'[esteem]'; -敬>'[respect]'; -æ•°>'[number]'; -敲>'[strike]'; -æ•´>'[orderly]'; -敵>'[enemy]'; -æ•·>'[spread]'; -數>'[number]'; -æ–‚>'[draw back]'; -æ–ƒ>'[kill]'; -æ–‡>'[literature]'; -æ–ˆ>'[learning]'; -æ–‰>'[even]'; -æ–Œ>'[refined]'; -æ–Ž>'[vegetarian diet]'; -æ–>'[graceful]'; -æ–‘>'[mottled]'; -æ–—>'[chinese peck]'; -æ–™>'[consider]'; -æ–›>'[dry measure 10 or 5 times of dou]'; -æ–œ>'[slanting]'; -æ–Ÿ>'[pour wine or tea into cup]'; -æ–¡>'[revolve]'; -æ–¤>'[catty]'; -æ–¥>'[scold]'; -æ–§>'[axe]'; -æ–«>'[cut]'; -æ–¬>'[cut]'; -æ–­>'[sever]'; -æ–¯>'[this]'; -æ–°>'[new]'; -æ–·>'[sever]'; -æ–¹>'[square]'; -æ–¼>'[in]'; -æ–½>'[grant]'; -æ—>'[side]'; -æ—ƒ>'[silk banner with bent pole]'; -æ—„>'[a kind of ancient flag]'; -æ—…>'[trip]'; -æ—†>'[flag ornament]'; -æ—‹>'[revolve]'; -æ—Œ>'[banner or flag adorned with feat]'; -æ—>'[family clan]'; -æ—’>'[fringes of pearls on crowns]'; -æ——>'[banner]'; -æ—™>'[a pennant]'; -æ—›>'[a pennant]'; -æ— >'[negative]'; -æ—¡>'[choke on something eaten]'; -æ—¢>'[already]'; -æ—¥>'[sun]'; -æ—¦>'[dawn]'; -æ—§>'[old]'; -æ—¨>'[purpose]'; -æ—©>'[early]'; -æ—¬>'[ten-day period]'; -æ—­>'[rising sun]'; -æ—±>'[drought]'; -æ—º>'[prosper]'; -æ—»>'[heaven]'; -昂>'[rise]'; -昃>'[afternoon]'; -昆>'[elder brother]'; -昇>'[rise]'; -昊>'[summer time]'; -昌>'[light of sun]'; -明>'[bright]'; -æ˜>'[dusk]'; -易>'[change]'; -昔>'[formerly]'; -昜>'[to open out]'; -星>'[star]'; -映>'[project]'; -春>'[spring]'; -昧>'[obscure]'; -昨>'[yesterday]'; -昭>'[bright]'; -是>'[indeed]'; -昴>'[one of the 28 constellations]'; -昵>'[intimate]'; -昶>'[a long day. bright. extended. clear]'; -昼>'[daytime]'; -昿>'[extensive]'; -æ™>'[morning]'; -時>'[time]'; -晃>'[bright]'; -晄>'[bright]'; -晉>'[advance]'; -晋>'[advance]'; -æ™>'[peaceful]'; -æ™’>'[dry in sun]'; -æ™>'[daytime]'; -晞>'[dry]'; -晟>'[clear]'; -晢>'[light of stars]'; -晤>'[have interview with]'; -晦>'[dark]'; -晧>'[daybreak]'; -晨>'[early morning]'; -晩>'[night]'; -æ™®>'[universal]'; -景>'[scenery]'; -æ™°>'[clear]'; -æ™´>'[clear weather]'; -晶>'[crystal]'; -智>'[wisdom]'; -æš>'[dawn]'; -#"æš‚>'[temporary]'", -æš„>'[warm]'; -暇>'[leisure]'; -暈>'[halo in sky]'; -暉>'[sunshine]'; -暎>'[sun beginning decline]'; -æš‘>'[hot]'; -æš–>'[warm]'; -æš—>'[dark]'; -暘>'[rising sun]'; -æš>'[dark]'; -暢>'[smoothly]'; -暦>'[calendar]'; -æš«>'[temporary]'; -æš®>'[evening]'; -æš´>'[violent]'; -暸>'[bright]'; -æš¹>'[rise]'; -æš¼>'[take fleeting glance at]'; -æš¾>'[morning sun]'; -æ›>'[and]'; -曄>'[bright]'; -曇>'[become cloudy]'; -曉>'[dawn]'; -æ›–>'[obscure]'; -æ›™>'[bright]'; -曚>'[twilight just before sun rises]'; -曜>'[glorious]'; -æ›>'[sun]'; -æ› >'[extensive]'; -曦>'[sunlight]'; -曩>'[in ancient times]'; -æ›°>'[say]'; -曲>'[crooked]'; -曳>'[trail]'; -æ›´>'[more]'; -曵>'[trail]'; -æ›·>'[why? what? where?]'; -書>'[book]'; -曹>'[ministry officials]'; -曼>'[long]'; -曽>'[already]'; -曾>'[already]'; -替>'[change]'; -最>'[most]'; -會>'[assemble]'; -月>'[moon]'; -有>'[have]'; -朋>'[friend]'; -æœ>'[clothes]'; -æœ>'[light of crescent moon]'; -朔>'[first day of lunar month]'; -朕>'[pronoun \"i\"]'; -朖>'[clear]'; -朗>'[clear]'; -望>'[look at or forward]'; -æœ>'[dynasty]'; -朞>'[full year]'; -期>'[period of time]'; -朦>'[condition or appearance of moon]'; -朧>'[condition or appearance of moon]'; -木>'[tree]'; -未>'[not yet]'; -末>'[final]'; -本>'[root]'; -札>'[letter]'; -朮>'[skill]'; -朱>'[cinnabar]'; -朴>'[simple]'; -朶>'[cluster of flowers]'; -#"朶>'[cluster of flowers]'", -#"朶>'[cluster of flowers]'", -机>'[desk]'; -朽>'[decayed]'; -朿>'[stab]'; -#"æ€>'[kill]'", -æ†>'[pole]'; -æ‰>'[various species of pine and fir]'; -æŽ>'[plum]'; -æ>'[apricot]'; -æ>'[material]'; -æ‘>'[village]'; -æ“>'[handle of cup]'; -æ–>'[cane]'; -æ™>'[a tiny wooden post]'; -æœ>'[stop]'; -æž>'[willow]'; -æŸ>'[bind]'; -æ >'[lever]'; -æ¡>'[clause]'; -æ¢>'[woodworker]'; -#"æ¢>'[woodworker]'", -æ¤>'[type of oak]'; -æ¥>'[come]'; -æª>'[tip of twig]'; -æ­>'[cross stream]'; -æ¯>'[cup]'; -æ°>'[hero]'; -æ±>'[east]'; -æ²>'[bright sun]'; -æ³>'[obscure]'; -æµ>'[pestle]'; -æ·>'[loquat]'; -æ¼>'[shuttle of loom]'; -æ¾>'[pine tree]'; -æ¿>'[plank]'; -#"æž…>'[................................]'", -枇>'[loquat]'; -枉>'[useless]'; -æž‹>'[sandalwood]'; -枌>'[variety of elm with small seeds]'; -æž>'[split wood]'; -æž•>'[pillow]'; -æž—>'[forest]'; -æžš>'[stalk of shrub]'; -æžœ>'[fruit]'; -æž>'[branches]'; -#"枟>'[wood streaks]'", -#"枟>'[wood streaks]'", -枢>'[door hinge]'; -#"枦>'[................................]'", -æž©>'[pine tree]'; -枯>'[dried out]'; -æž³>'[trifoliate orange]'; -æž´>'[cane]'; -架>'[rack]'; -æž·>'[cangue scaffold]'; -枸>'[kind of aspen found in sichuan]'; -æž¹>'[drumstick]'; -æŸ>'[large tie-beams]'; -柄>'[handle]'; -#"柆>'[................................]'", -#"柈>'[container]'", -柎>'[calyx of flower]'; -æŸ>'[cypress]'; -æŸ>'[certain thing or person]'; -柑>'[tangerine]'; -染>'[dye]'; -柔>'[soft]'; -柘>'[a thorny tree]'; -柚>'[pumelo]'; -æŸ>'[watchman''s rattle]'; -柞>'[oak]'; -柢>'[root]'; -柤>'[hawthorn]'; -#"柧>'[................................]'", -柩>'[coffin which contains corpse]'; -柬>'[letter]'; -柮>'[flat pieces of wood]'; -柯>'[axe-handle]'; -柱>'[pillar]'; -柳>'[willow tree]'; -柴>'[firewood]'; -柵>'[fence]'; -査>'[investigate]'; -柾>'[straight grain]'; -柿>'[persimmon]'; -æ ‚>'[a kind of evergreen tree]'; -æ ƒ>'[type of oak]'; -æ „>'[glory]'; -æ “>'[wooden peg]'; -æ –>'[perch]'; -æ —>'[chestnut tree]'; -æ ž>'[publication]'; -æ ¡>'[school]'; -æ ¢>'[cypress]'; -æ ©>'[species of oak]'; -æ ª>'[numerary adjunct for trees]'; -æ «>'[fence]'; -æ ²>'[mangrove]'; -æ ´>'[sandalwood]'; -æ ¸>'[seed]'; -æ ¹>'[root]'; -æ ¼>'[pattern]'; -æ ½>'[cultivate]'; -æ¡€>'[chicken roost]'; -æ¡>'[cross-beams of roof]'; -æ¡‚>'[cassia or cinnamon]'; -桃>'[peach]'; -框>'[frame]'; -案>'[table]'; -#"æ¡>'[................................]'", -æ¡Ž>'[fetters]'; -æ¡>'[name applied various trees]'; -æ¡‘>'[mulberry tree]'; -æ¡“>'[variety of tree]'; -æ¡”>'[chinese bellflower]'; -#"æ¡™>'[................................]'", -æ¡œ>'[cherry]'; -æ¡>'[................]'; -#"æ¡>'[................]'", -æ¡£>'[shelf]'; -桧>'[chinese cypress]'; -æ¡´>'[raft]'; -桶>'[pail]'; -æ¡·>'[rafter]'; -#"桾>'[................................]'", -æ¡¿>'[pole]'; -æ¢>'[bridge]'; -梃>'[a club]'; -梅>'[plums]'; -æ¢>'[tree name]'; -æ¢>'[handcuffs]'; -梓>'[catalpa ovata]'; -梔>'[gardenia]'; -梗>'[stem of flower]'; -#"梘>'[bamboo tube]'", -æ¢>'[clause]'; -梟>'[owl thus]'; -梠>'[small beam supporting rafters at]'; -梢>'[pointed tip of something long like a branch]'; -梦>'[dream]'; -梧>'[sterculia platanifolia]'; -梨>'[pear]'; -梭>'[weaver''s shuttle]'; -梯>'[ladder]'; -械>'[weapons]'; -梱>'[doorsill]'; -梳>'[comb]'; -梵>'[buddhist]'; -梶>'[oar]'; -梹>'[the areca-nut]'; -#"梹>'[the areca-nut]'", -梼>'[block of wood]'; -棄>'[reject]'; -#"棆>'[................................]'", -棉>'[cotton]'; -棊>'[chess]'; -棋>'[chess]'; -æ£>'[stick]'; -棒>'[stick]'; -#"棔>'[................................]'", -棕>'[hemp palm]'; -棗>'[date tree]'; -棘>'[jujube tree]'; -棚>'[tent]'; -棟>'[main beams supporting house]'; -棠>'[crab apple tree]'; -#"棡>'[................................]'", -棣>'[kerria japonica plant]'; -棧>'[warehouse]'; -森>'[forest]'; -棯>'[jujube tree]'; -棲>'[perch]'; -棹>'[oar]'; -棺>'[coffin]'; -椀>'[bowl]'; -æ¤>'[outer-coffin]'; -椄>'[to graft]'; -椅>'[chair]'; -椈>'[cedar]'; -椋>'[fruit]'; -椌>'[instrument]'; -æ¤>'[plant]'; -椎>'[hammer]'; -æ¤>'[the forking branch of a tree]'; -椒>'[pepper]'; -#"椓>'[strike]'", -#"椚>'[................................]'", -椛>'[type of birch]'; -検>'[check]'; -#"椡>'[................................]'", -#"椢>'[................................]'", -#"椣>'[................................]'", -#"椥>'[................................]'", -#"椦>'[................................]'", -#"椨>'[................................]'", -椪>'[machilus nanmu]'; -椰>'[palm tree]'; -椴>'[poplar]'; -椶>'[palm tree]'; -椹>'[a chopping board]'; -椽>'[beams]'; -椿>'[father]'; -楊>'[willow]'; -楓>'[maple tree]'; -楔>'[wedge]'; -楕>'[oval-shaped]'; -楙>'[name of plant]'; -楚>'[name of feudal state]'; -#"楜>'[................................]'", -æ¥>'[melia japonica]'; -楞>'[used for ceylon in buddhist text]'; -楠>'[name of tree]'; -楡>'[elm tree]'; -楢>'[tinder]'; -楪>'[small dish]'; -楫>'[oar]'; -業>'[profession]'; -楮>'[mulberry]'; -楯>'[shield]'; -楳>'[plums]'; -#"楴>'[................................]'", -極>'[extreme]'; -楷>'[model style of chinese writing]'; -楸>'[mallotus japonicus]'; -楹>'[column]'; -楼>'[building of two or more stories]'; -楽>'[happy]'; -#"楽>'[happy]'", -#"榀>'[[not found in dictionary]]'", -概>'[generally]'; -#"榉>'[type of elm]'", -榎>'[small evergreen shrub]'; -#"榑>'[................................]'", -榔>'[betel-nut tree]'; -榕>'[banyan tree]'; -榛>'[hazelnut]'; -榜>'[placard]'; -#"榠>'[................................]'", -榧>'[type of yew]'; -榮>'[glory]'; -榱>'[rafter]'; -榲>'[pillar]'; -榴>'[pomegranate]'; -榻>'[cot]'; -榾>'[pieces of wood]'; -榿>'[alder]'; -æ§>'[wither]'; -槃>'[tray]'; -槇>'[tip of a tree]'; -槊>'[spear]'; -構>'[frame]'; -槌>'[hammer]'; -æ§>'[spear]'; -槎>'[raft]'; -æ§>'[locust tree]'; -槓>'[lever]'; -様>'[shape]'; -#"様>'[shape]'", -#"槛>'[threshold]'", -#"槛>'[threshold]'", -槧>'[wooden tablet]'; -槨>'[outer-coffin]'; -#"槫>'[................................]'", -槭>'[maple]'; -槲>'[type of oak]'; -槹>'[spar]'; -槻>'[zelkova tree]'; -槽>'[trough]'; -槿>'[hibiscus]'; -樂>'[happy]'; -樅>'[fir tree]'; -樊>'[a railing]'; -樋>'[tree name]'; -#"樌>'[................................]'", -#"樒>'[................................]'", -樓>'[building of two or more stories]'; -#"樓>'[building of two or more stories]'", -樗>'[kind of tree with useless timber]'; -標>'[mark]'; -樛>'[bending branches]'; -樞>'[door hinge]'; -樟>'[camphor tree]'; -模>'[model]'; -#"樢>'[................................]'", -樣>'[shape]'; -権>'[power]'; -横>'[across]'; -#"横>'[across]'", -#"横>'[across]'", -樵>'[woodcutter]'; -樶>'[c]'; -樸>'[simple]'; -樹>'[tree]'; -樺>'[type of birch]'; -樽>'[goblet]'; -æ©„>'[olive]'; -橇>'[a sledge for transportation]'; -橈>'[bent or twisted piece of wood]'; -æ©‹>'[bridge]'; -橘>'[orange]'; -æ©™>'[orange]'; -æ©Ÿ>'[machine]'; -æ©¡>'[chestnut oak]'; -æ©¢>'[oval-shaped]'; -橦>'[tree]'; -#"橱>'[cabinet]'", -#"橵>'[wood placed under roof tiles]'", -#"æ©¿>'[................................]'", -檀>'[sandalwood]'; -檄>'[call arms]'; -æª>'[ilex]'; -檎>'[small red apple]'; -æª>'[eaves of house]'; -檗>'[tree]'; -檜>'[chinese cypress]'; -檠>'[stand for lamp]'; -檢>'[check]'; -檣>'[mast]'; -檪>'[chestnut-leaved oak]'; -檬>'[type of locust oracacia]'; -檮>'[block of wood]'; -檳>'[betelnut]'; -檸>'[lemon]'; -檻>'[threshold]'; -#"æ«>'[................................]'", -æ«‚>'[oar]'; -櫃>'[cupboard]'; -#"æ«‘>'[................................]'", -æ«“>'[oar]'; -æ«š>'[palm]'; -æ«›>'[comb out]'; -æ«ž>'[citrus]'; -æ«Ÿ>'[chestnut-leaved oak]'; -櫨>'[supporting block]'; -櫪>'[type of oak]'; -櫺>'[carved or patterned window sills]'; -æ«»>'[cherry]'; -欄>'[railing]'; -欅>'[zelkova]'; -權>'[power]'; -欒>'[name of tree]'; -欖>'[olive]'; -æ¬>'[luxuriant]'; -#"欞>'[the lattice of a window a sill]'", -欠>'[owe]'; -次>'[order]'; -欣>'[happy]'; -欧>'[translit.: europe]'; -欲>'[desire]'; -欷>'[sob]'; -欸>'[sighs]'; -欹>'[fierce dog]'; -欺>'[cheat]'; -欽>'[respect]'; -款>'[item]'; -æ­ƒ>'[smear one''s mouth with blood of a victim when taking an oath]'; -æ­‡>'[rest]'; -æ­‰>'[deficient]'; -æ­Œ>'[song]'; -æ­Ž>'[sigh]'; -æ­>'[translit.: europe]'; -æ­“>'[happy]'; -æ­”>'[blow through nose]'; -æ­™>'[to suck]'; -æ­›>'[draw back]'; -æ­Ÿ>'[final particle used express ques]'; -æ­¡>'[happy]'; -æ­¢>'[stop]'; -æ­£>'[right]'; -æ­¤>'[this]'; -æ­¦>'[military]'; -æ­©>'[step]'; -æ­ª>'[slant]'; -æ­¯>'[teeth]'; -æ­³>'[year]'; -æ­´>'[take place]'; -æ­¸>'[return]'; -æ­¹>'[bad]'; -æ­»>'[die]'; -æ­¿>'[die]'; -殀>'[die young]'; -殃>'[misfortune]'; -殄>'[to end]'; -殆>'[dangerous]'; -殉>'[die for cause]'; -殊>'[different]'; -残>'[injure]'; -æ®>'[to starve to death]'; -殕>'[[not found in dictionary]]'; -æ®–>'[breed]'; -殘>'[injure]'; -殞>'[die]'; -殤>'[die young]'; -殪>'[die]'; -殫>'[utmost]'; -殯>'[encoffin]'; -æ®±>'[annihilate]'; -殲>'[annihilate]'; -殳>'[name of old weapon]'; -æ®´>'[beat]'; -段>'[section]'; -æ®·>'[many]'; -殺>'[kill]'; -æ®»>'[casing]'; -殼>'[casing]'; -殿>'[hall]'; -毀>'[destroy]'; -毅>'[resolute]'; -毆>'[beat]'; -毋>'[do not]'; -æ¯>'[mother]'; -毎>'[every]'; -毒>'[poison]'; -毓>'[give birth to]'; -比>'[compare]'; -毘>'[help]'; -毛>'[hair]'; -#"毟>'[................................]'", -毫>'[fine hair]'; -毬>'[ball]'; -毯>'[rug]'; -毳>'[fine hair or fur on animals]'; -æ°ˆ>'[felt]'; -æ°>'[clan]'; -æ°‘>'[people]'; -æ°“>'[people]'; -æ°”>'[steam]'; -æ°—>'[air]'; -æ°›>'[gas]'; -æ°£>'[air]'; -æ°¤>'[hanging fog]'; -æ°´>'[water]'; -æ°·>'[ice]'; -æ°¸>'[long]'; -æ°¾>'[overflow]'; -æ±€>'[sandbar]'; -æ±>'[juice]'; -求>'[seek]'; -汎>'[float]'; -æ±>'[night tides]'; -汕>'[basket for catching fish]'; -æ±—>'[perspiration]'; -汚>'[filthy]'; -æ±>'[you]'; -汞>'[element mercury]'; -江>'[large river]'; -æ± >'[pool]'; -#"æ±¢>'[................................]'", -汨>'[Mi(luo) river in hunan province where Qu Yuan drowned himself]'; -汪>'[vast]'; -æ±°>'[excessive]'; -æ±²>'[draw water from well]'; -#"æ±²>'[draw water from well]'", -決>'[decide]'; -æ±½>'[steam]'; -æ±¾>'[river in shanxi province]'; -æ²>'[soak into]'; -沂>'[river in southeast shandong flow]'; -沃>'[water]'; -沈>'[sink]'; -沌>'[chaotic]'; -æ²>'[freezing]'; -æ²>'[bathe]'; -æ²’>'[not]'; -沓>'[connected]'; -æ²–>'[pour]'; -æ²™>'[sand]'; -沚>'[islet in stream]'; -æ²›>'[abundant]'; -没>'[not]'; -æ²¢>'[marsh]'; -沫>'[froth]'; -æ²®>'[stop]'; -æ²±>'[rivers]'; -æ²³>'[river]'; -沸>'[boil]'; -æ²¹>'[oil]'; -沺>'[turbulent]'; -æ²»>'[govern]'; -æ²¼>'[lake]'; -æ²½>'[buy and sell]'; -æ²¾>'[moisten]'; -沿>'[follow course]'; -æ³>'[condition]'; -泄>'[leak]'; -æ³…>'[swim]'; -泉>'[spring]'; -泊>'[anchor vessel]'; -泌>'[to seep out]'; -泓>'[clear]'; -法>'[law]'; -æ³—>'[mucous]'; -æ³™>'[roar]'; -æ³›>'[drift]'; -æ³>'[go upstream]'; -泡>'[bubbles]'; -æ³¢>'[waves]'; -æ³£>'[cry]'; -æ³¥>'[mud]'; -注>'[concentrate]'; -泪>'[tears]'; -泯>'[destroy]'; -æ³°>'[great]'; -æ³±>'[great]'; -æ³³>'[dive]'; -æ´‹>'[ocean]'; -æ´Œ>'[clear]'; -æ´’>'[sprinkle]'; -æ´—>'[wash]'; -æ´™>'[name of a river in shandong]'; -æ´›>'[river in shaanxi province]'; -æ´ž>'[cave]'; -æ´Ÿ>'[snivel]'; -æ´¥>'[ferry]'; -æ´©>'[leak]'; -æ´ª>'[vast]'; -æ´«>'[to ditch]'; -æ´²>'[continent]'; -æ´³>'[damp]'; -æ´µ>'[true]'; -æ´¶>'[the rush of water]'; -æ´¸>'[sparkle]'; -æ´»>'[live]'; -æ´½>'[spread]'; -æ´¾>'[school of thought]'; -æµ>'[flow]'; -浄>'[pure]'; -æµ…>'[shallow]'; -æµ™>'[zhejiang province]'; -浚>'[dredge]'; -浜>'[creek]'; -æµ£>'[to wash]'; -浤>'[beating of ocean]'; -浦>'[bank of river]'; -浩>'[great]'; -浪>'[wave]'; -浬>'[nautical mile]'; -æµ®>'[float]'; -æµ´>'[bathe]'; -æµ·>'[sea]'; -浸>'[soak]'; -æµ¹>'[saturate]'; -涅>'[blacken]'; -消>'[vanish]'; -涌>'[surge up]'; -涎>'[saliva]'; -涓>'[brook]'; -涕>'[tear]'; -涙>'[tears]'; -涛>'[large waves]'; -涜>'[ditch]'; -涯>'[shore]'; -液>'[sap]'; -涵>'[soak]'; -涸>'[dried up]'; -涼>'[cool]'; -æ·€>'[shallow water]'; -æ·…>'[water used wash rice]'; -æ·†>'[confused]'; -æ·‡>'[river in henan province]'; -æ·‹>'[drip]'; -æ·Œ>'[trickle]'; -æ·‘>'[good]'; -æ·’>'[bitter cold]'; -#"æ·•>'[................................]'", -æ·˜>'[wash in sieve]'; -æ·™>'[gurgling sound of water]'; -æ·ž>'[name of a river in Jiangsu]'; -æ·¡>'[weak]'; -æ·¤>'[mud]'; -æ·¦>'[river in jiangxi province: water]'; -æ·¨>'[pure]'; -æ·ª>'[be lost]'; -æ·«>'[obscene]'; -æ·¬>'[temper]'; -æ·®>'[river in anhui province]'; -æ·±>'[deep]'; -æ·³>'[cyanogen]'; -æ·µ>'[gulf]'; -æ··>'[mix]'; -æ·¹>'[drown]'; -æ·º>'[shallow]'; -æ·»>'[append]'; -清>'[clear]'; -渇>'[thirsty]'; -済>'[help]'; -渉>'[ford stream]'; -渊>'[surge up]'; -渋>'[astringent]'; -渓>'[mountain stream]'; -渕>'[surge up]'; -渙>'[scatter]'; -渚>'[small sand bank]'; -減>'[decrease]'; -æ¸>'[change]'; -渟>'[(of water) not flowing]'; -渠>'[ditch]'; -渡>'[cross]'; -渣>'[refuse]'; -渤>'[swelling]'; -渥>'[moisten]'; -渦>'[swirl]'; -温>'[lukewarm]'; -渫>'[beating of ocean]'; -測>'[measure]'; -渭>'[name of a river in shaanxi]'; -渮>'[river in shandong province]'; -港>'[port]'; -游>'[swim]'; -渺>'[endlessly long]'; -渾>'[muddy]'; -湃>'[sound of waves]'; -湊>'[piece together]'; -æ¹>'[rapid water current]'; -湎>'[flushed with drink]'; -æ¹–>'[lake]'; -湘>'[hunan province]'; -æ¹›>'[deep]'; -湟>'[river in qinghai province]'; -湧>'[well up]'; -湫>'[a small pond]'; -æ¹®>'[bury]'; -湯>'[hot water]'; -æ¹²>'[flow]'; -#"æ¹³>'[[not found in dictionary]]'", -æ¹¾>'[bay]'; -湿>'[wet]'; -#"湿>'[wet]'", -#"湿>'[wet]'", -溌>'[pour]'; -æº>'[pool]'; -æº>'[spring]'; -準>'[rule]'; -溘>'[abruptly]'; -溜>'[slide]'; -æº>'[ditch]'; -溟>'[drizzling rain]'; -溢>'[overflow]'; -溥>'[big]'; -溪>'[mountain stream]'; -溯>'[go upstream]'; -溲>'[urinate]'; -溶>'[melt]'; -溷>'[privy]'; -溺>'[drown]'; -溽>'[moist]'; -滂>'[torrential]'; -滄>'[blue]'; -æ»…>'[extinguish]'; -滉>'[deep]'; -滋>'[grow]'; -滌>'[wash]'; -滑>'[slip]'; -滓>'[sediment]'; -æ»”>'[overflow]'; -滕>'[ county in shandong province]'; -æ»>'[raining]'; -滞>'[block up]'; -滬>'[shanghai]'; -滯>'[block up]'; -滲>'[soak through]'; -æ»´>'[drip]'; -æ»·>'[thick gravy]'; -滸>'[riverbank]'; -滾>'[turn]'; -滿>'[fill]'; -æ¼>'[to fish]'; -漂>'[float]'; -漆>'[varnish]'; -漉>'[filter]'; -æ¼>'[leak]'; -漑>'[water]'; -漓>'[river in guangxi province]'; -æ¼”>'[perform]'; -漕>'[transport by water]'; -æ¼ >'[desert]'; -æ¼¢>'[chinese people]'; -æ¼£>'[flowing water]'; -漫>'[overflow of water]'; -漬>'[soak]'; -æ¼±>'[gargle]'; -æ¼²>'[rise in price]'; -漸>'[gradually]'; -æ¼¾>'[overflow]'; -漿>'[any thick fluid]'; -æ½>'[river in anhui]'; -æ½…>'[pour]'; -æ½”>'[clean]'; -潘>'[surname]'; -æ½›>'[hide]'; -潜>'[hide]'; -潟>'[land inundated with salt from ti]'; -潤>'[soft]'; -潦>'[to flood]'; -æ½­>'[deep pool]'; -æ½®>'[tide]'; -潯>'[steep bank by stream]'; -æ½°>'[flooding river]'; -æ½´>'[pond]'; -潸>'[weep]'; -潺>'[sound of flowing water]'; -æ½¼>'[high]'; -æ¾€>'[astringent]'; -æ¾>'[astringent]'; -澂>'[clear and still water]'; -澄>'[purify water by allowing sedimen]'; -澆>'[spray]'; -澎>'[splatter]'; -澑>'[slide]'; -æ¾—>'[brook]'; -澡>'[wash]'; -æ¾£>'[cleanse]'; -澤>'[marsh]'; -#"澪>'[................................]'", -æ¾±>'[sediment]'; -æ¾³>'[inlet]'; -æ¾¹>'[calm]'; -æ¿€>'[arouse]'; -æ¿>'[muddy]'; -æ¿‚>'[waterfall]'; -濃>'[thick]'; -濆>'[river bank]'; -æ¿”>'[many]'; -æ¿•>'[wet]'; -濘>'[mud]'; -æ¿›>'[drizzling]'; -æ¿Ÿ>'[help]'; -æ¿ >'[moat]'; -æ¿¡>'[immerse]'; -濤>'[large waves]'; -æ¿«>'[flood]'; -濬>'[dredge]'; -æ¿®>'[county in Henan province]'; -濯>'[wash out]'; -濱>'[beach]'; -濳>'[hide]'; -濶>'[broad]'; -濺>'[sprinkle]'; -濾>'[strain out]'; -ç€>'[waves]'; -瀉>'[drain off]'; -瀋>'[juice]'; -ç€>'[clear]'; -瀑>'[waterfall]'; -瀕>'[approach]'; -瀘>'[river in jiangxi province]'; -瀚>'[vast]'; -瀛>'[sea]'; -ç€>'[trickle]'; -瀞>'[pool in a river]'; -瀟>'[sound of beating wind and rain]'; -瀦>'[pond]'; -瀧>'[raining]'; -瀬>'[swift current]'; -瀰>'[overflow]'; -瀲>'[waves]'; -瀾>'[overflowing]'; -çŒ>'[pour]'; -ç‘>'[sprinkle]'; -ç˜>'[bank]'; -ç£>'[bay]'; -ç«>'[fire]'; -ç¯>'[lantern]'; -ç°>'[ashes]'; -ç¸>'[cauterize with moxa]'; -ç¼>'[burn]'; -ç½>'[calamity]'; -炉>'[fireplace]'; -ç‚Š>'[cook]'; -ç‚Ž>'[flame]'; -ç‚’>'[fry]'; -ç‚™>'[roast]'; -炬>'[torch]'; -ç‚­>'[charcoal]'; -ç‚®>'[large gun]'; -炯>'[bright]'; -炳>'[bright]'; -炸>'[fry in oil]'; -点>'[dot]'; -為>'[do]'; -烈>'[fiery]'; -烋>'[boast]'; -çƒ>'[crow]'; -烙>'[brand]'; -çƒ>'[rise]'; -烟>'[smoke]'; -烱>'[bright]'; -烹>'[boil]'; -烽>'[signal fire]'; -焉>'[thereupon]'; -ç„”>'[flame]'; -ç„™>'[dry over slow fire]'; -ç„š>'[burn]'; -ç„œ>'[fire]'; -ç„¡>'[negative]'; -焦>'[burned]'; -然>'[yes]'; -焼>'[burn]'; -ç…‰>'[smelt]'; -ç…Œ>'[bright]'; -ç…Ž>'[fry in fat or oil]'; -ç…•>'[bright]'; -ç…–>'[warm]'; -ç…™>'[smoke]'; -ç…¢>'[alone]'; -ç…¤>'[coal]'; -ç…¥>'[shining]'; -ç…¦>'[kind]'; -ç…§>'[shine]'; -ç…©>'[bother]'; -ç…¬>'[roast]'; -ç…®>'[cook]'; -ç…½>'[stir up]'; -熄>'[put out]'; -熈>'[bright]'; -熊>'[bear]'; -ç†>'[smoke]'; -熔>'[melt]'; -#"熕>'[................................]'", -熙>'[bright]'; -熟>'[well cooked]'; -熨>'[iron]'; -熬>'[cook down]'; -熱>'[hot]'; -熹>'[dim light]'; -熾>'[burning hot]'; -燃>'[burn]'; -燈>'[lantern]'; -燉>'[heat with fire]'; -燎>'[burn]'; -ç‡>'[phosphorus]'; -燒>'[burn]'; -燔>'[to roast]'; -燕>'[swallow (bird)]'; -#"燗>'[................................]'", -營>'[encampment]'; -燠>'[warm]'; -燥>'[dry]'; -燦>'[vivid]'; -燧>'[flintstone]'; -燬>'[burn down]'; -燭>'[candle]'; -燮>'[harmonize]'; -#"燵>'[................................]'", -燹>'[fire]'; -燻>'[smoke]'; -燼>'[cinders]'; -燿>'[shine]'; -爆>'[crackle]'; -çˆ>'[shine]'; -çˆ>'[fireplace]'; -爛>'[rotten]'; -爨>'[oven]'; -爪>'[claw]'; -爬>'[crawl]'; -爭>'[dispute]'; -爰>'[lead on to]'; -爲>'[do]'; -爵>'[feudal title or rank]'; -父>'[father]'; -爺>'[father]'; -爻>'[diagrams for divination]'; -爼>'[chopping board or block]'; -爽>'[happy]'; -爾>'[you]'; -爿>'[half of tree trunk]'; -牀>'[bed]'; -牆>'[wall]'; -片>'[slice]'; -版>'[printing blocks]'; -牋>'[memorandum]'; -牌>'[signboard]'; -牒>'[documents]'; -牘>'[writing tablet]'; -牙>'[tooth]'; -牛>'[cow]'; -ç‰>'[female of species]'; -牟>'[make]'; -牡>'[male of animals]'; -牢>'[prison]'; -牧>'[tend cattle]'; -物>'[thing]'; -牲>'[sacrificial animal]'; -牴>'[gore]'; -特>'[special]'; -牽>'[drag]'; -牾>'[to oppose]'; -犀>'[rhinoceros]'; -çŠ>'[plow]'; -犂>'[plow]'; -犇>'[run fast]'; -犒>'[entertain victorious soldiers]'; -犖>'[brindled ox]'; -犠>'[sacrifice]'; -犢>'[calf]'; -犧>'[sacrifice]'; -犬>'[dog]'; -犯>'[commit crime]'; -犲>'[wolf]'; -状>'[form]'; -犹>'[like]'; -ç‹‚>'[insane]'; -狃>'[to covet]'; -ç‹„>'[tribe from northern china]'; -狆>'[pekinese dog]'; -ç‹Ž>'[be familiar with]'; -ç‹>'[species of fox]'; -ç‹’>'[baboon]'; -ç‹—>'[dog]'; -ç‹™>'[ape]'; -#"ç‹›>'[................................]'", -ç‹ >'[vicious]'; -ç‹¡>'[cunning]'; -ç‹¢>'[animal name]'; -ç‹©>'[winter hunting]'; -独>'[alone]'; -ç‹­>'[narrow]'; -ç‹·>'[rash]'; -狸>'[fox]'; -狹>'[narrow]'; -狼>'[wolf]'; -狽>'[legendary animal with short fore]'; -猊>'[lion]'; -猖>'[mad]'; -猗>'[exclamation of admiration]'; -猛>'[violent]'; -猜>'[guess]'; -çŒ>'[abruptly]'; -猟>'[hunt]'; -猥>'[vulgar]'; -猩>'[species of orangutan]'; -猪>'[pig]'; -猫>'[cat]'; -献>'[offer]'; -#"猯>'[................................]'", -猴>'[monkey]'; -猶>'[like]'; -猷>'[plan]'; -猾>'[crafty]'; -猿>'[ape]'; -ç„>'[prison]'; -ç…>'[lion]'; -çŽ>'[prize]'; -ç>'[the panther]'; -ç—>'[unruly]'; -ç£>'[beast]'; -ç¨>'[alone]'; -çª>'[sly]'; -ç°>'[ferocious appearance]'; -ç²>'[obtain]'; -çµ>'[hunt]'; -ç¸>'[beast]'; -çº>'[otter]'; -ç»>'[offer]'; -玄>'[deep]'; -率>'[to lead]'; -玉>'[jade]'; -王>'[king]'; -玖>'[black-colored jade]'; -玩>'[play with]'; -玲>'[tinkling of jade]'; -玳>'[tortoise shell]'; -玻>'[glass]'; -ç€>'[amber]'; -ç‚>'[inferior kind of jade]'; -çˆ>'[ornament attached woman''s hairpi]'; -çŠ>'[coral]'; -ç>'[precious]'; -çŽ>'[precious]'; -çž>'[kind of necklace]'; -ç >'[precious stone]'; -ç¥>'[ear ornament]'; -çª>'[jade table conferred upon feudal]'; -ç­>'[class]'; -ç®>'[jade ornament]'; -ç±>'[necklace made of precious stones]'; -#"ç¸>'[................................]'", -ç¾>'[appear]'; -çƒ>'[ball]'; -ç…>'[variety of white carnelian]'; -ç†>'[reason]'; -ç‰>'[sparkling stone]'; -ç¢>'[polish jade]'; -ç¥>'[jewel in shape of tiger]'; -ç²>'[necklace]'; -ç³>'[beautiful jade]'; -ç´>'[chinese lute or guitar]'; -çµ>'[guitar-like instrument]'; -ç¶>'[guitar-like instrument]'; -çº>'[enamel]'; -ç¿>'[bright]'; -ç‘>'[fine piece of jade]'; -ç‘•>'[flaw in gem]'; -ç‘™>'[agate]'; -ç‘š>'[coral]'; -ç‘›>'[luster of gem]'; -ç‘œ>'[flawless gem or jewel]'; -ç‘ž>'[felicitous omen]'; -ç‘Ÿ>'[large stringed musical instrument]'; -ç‘ >'[precious stone]'; -ç‘£>'[fragments]'; -瑤>'[precious jade]'; -ç‘©>'[lustre of gems]'; -瑪>'[agate]'; -瑯>'[kind of white cornelian]'; -ç‘°>'[extraordinary]'; -瑳>'[luster of gem]'; -瑶>'[precious jade]'; -瑾>'[brilliance of gems]'; -ç’ƒ>'[glass]'; -ç’‹>'[jade plaything]'; -ç’ž>'[unpolished gem]'; -ç’¢>'[precious stone]'; -ç’§>'[piece of jade with hole in it]'; -ç’°>'[jade ring or bracelet]'; -ç’½>'[imperial signet]'; -ç“Š>'[jade]'; -ç“>'[gem cut like dragon]'; -ç“”>'[necklace made of precious stones]'; -ç“œ>'[melon]'; -ç“ >'[bottle gourd]'; -ç“¢>'[ladle made from dried gourd]'; -ç“£>'[petal]'; -瓦>'[tile]'; -瓧>'[decagram]'; -ç“©>'[kilowatt]'; -ç“®>'[earthen jar]'; -ç“°>'[[not found in dictionary]]'; -瓱>'[milligram]'; -#"瓲>'[................................]'", -瓶>'[jug]'; -ç“·>'[crockery]'; -瓸>'[hectogram]'; -甃>'[brick wall of a well]'; -甄>'[examine]'; -ç”…>'[centigram]'; -甌>'[bowl]'; -ç”>'[rafters supporting roof tiles]'; -甎>'[brick]'; -甑>'[boiler for steaming rice]'; -甓>'[glazed tiles]'; -甕>'[earthen jar]'; -甘>'[sweetness]'; -甚>'[great extent]'; -甜>'[sweet]'; -甞>'[taste]'; -生>'[life]'; -産>'[give birth]'; -甥>'[sister''s child]'; -甦>'[be reborn]'; -用>'[use]'; -甫>'[begin]'; -甬>'[path]'; -ç”°>'[field]'; -ç”±>'[cause]'; -甲>'[armor]'; -申>'[to state to a superior]'; -ç”·>'[male]'; -甸>'[suburbs of capital]'; -町>'[raised path between fields]'; -ç”»>'[painting]'; -甼>'[raised path between fields]'; -ç•„>'[stop]'; -畆>'[chinese land measure]'; -#"畉>'[................................]'", -ç•Š>'[plow]'; -ç•‹>'[till land]'; -ç•Œ>'[boundary]'; -#"ç•>'[................................]'", -ç•>'[fear]'; -ç•‘>'[dry (as opposed to rice) field]'; -ç•”>'[boundary path dividing fields]'; -ç•™>'[stop]'; -ç•š>'[straw basket]'; -ç•›>'[border]'; -ç•œ>'[livestock]'; -ç•>'[chinese land measure]'; -ç• >'[garden]'; -ç•¢>'[end]'; -畤>'[place for worshipping the haven]'; -ç•¥>'[approximately]'; -畦>'[sections in vegetable farm]'; -畧>'[approximately]'; -#"ç•©>'[................................]'", -番>'[take turns]'; -ç•«>'[delineate]'; -#"ç•­>'[................................]'", -ç•°>'[different]'; -畳>'[repeat]'; -ç•´>'[farmland]'; -當>'[bear]'; -ç•·>'[raised path between fields]'; -畸>'[odd]'; -ç•¿>'[imperial domain]'; -ç–‚>'[repeat]'; -ç–†>'[boundary]'; -ç–‡>'[farmland]'; -ç–‰>'[repeat]'; -ç–Š>'[repeat]'; -ç–‹>'[roll]'; -ç–Ž>'[neglect]'; -ç–>'[neglect]'; -ç–‘>'[doubt]'; -ç–”>'[carbuncle]'; -ç–š>'[chronic disease]'; -ç–>'[hernia]'; -ç–£>'[wart]'; -ç–¥>'[scabies]'; -ç–«>'[epidemic]'; -ç–±>'[acne]'; -ç–²>'[feel tired]'; -ç–³>'[childhood diseases]'; -ç–µ>'[flaw]'; -ç–¸>'[jaundice]'; -ç–¹>'[measles]'; -ç–¼>'[aches]'; -ç–½>'[ulcer]'; -ç–¾>'[illness]'; -ç—‚>'[scab]'; -ç—ƒ>'[indigestion]'; -ç—…>'[illness]'; -ç—‡>'[disease]'; -ç—Š>'[be healed]'; -ç—>'[wound]'; -ç—’>'[itch]'; -ç—”>'[hemorrhoids]'; -ç—•>'[scar]'; -ç—˜>'[smallpox]'; -ç—™>'[convulsions]'; -ç—›>'[pain]'; -ç—ž>'[dyspepsia]'; -ç—¢>'[dysentry]'; -ç—£>'[spots]'; -ç—©>'[thin]'; -ç—°>'[phlegm]'; -ç—²>'[pock-marked]'; -ç—³>'[pock-marked]'; -ç—´>'[foolish]'; -ç—º>'[paralysis]'; -ç—¼>'[chronic disease]'; -ç—¾>'[chronic illness]'; -ç—¿>'[paralysis]'; -ç˜>'[feel tired]'; -瘉>'[get well]'; -瘋>'[crazy]'; -ç˜>'[ulcers]'; -瘟>'[epidemic]'; -瘠>'[thin]'; -瘡>'[tumor]'; -瘢>'[scar]'; -瘤>'[tumor]'; -瘧>'[intermittent fever]'; -瘰>'[scrofula]'; -瘴>'[malaria pestilential vapors]'; -瘻>'[fistula]'; -療>'[be healed]'; -癆>'[consumption]'; -癇>'[epilepsy]'; -癈>'[abrogate]'; -癌>'[cancer]'; -ç™’>'[get well]'; -ç™–>'[craving]'; -癘>'[sore]'; -癜>'[erythema]'; -癡>'[silly]'; -癢>'[itch]'; -癧>'[scrofulous lumps or swellings]'; -癨>'[quickly]'; -癩>'[leprosy]'; -癪>'[spasms]'; -癬>'[ringworms]'; -ç™°>'[carbuncle]'; -癲>'[crazy]'; -癶>'[legs]'; -癸>'[last of ten celestial stems]'; -発>'[issue]'; -ç™»>'[rise]'; -發>'[issue]'; -白>'[white]'; -百>'[one hundred]'; -皀>'[kernel]'; -皃>'[countenance]'; -çš„>'[possessive]'; -皆>'[all]'; -皇>'[royal]'; -皈>'[follow]'; -çš‹>'[the high land along a river]'; -皎>'[white]'; -çš>'[the high land along a river]'; -çš“>'[bright]'; -çš–>'[anhui province]'; -çš™>'[white]'; -çšš>'[brilliant white]'; -çš®>'[skin]'; -çš°>'[pimples]'; -çš´>'[chapped]'; -çš·>'[drum]'; -皸>'[crack]'; -çš¹>'[crack]'; -皺>'[wrinkles]'; -çš¿>'[shallow container]'; -盂>'[basin]'; -盃>'[glass]'; -盆>'[basin]'; -盈>'[fill]'; -益>'[profit]'; -ç›>'[what? why not? correspond]'; -ç›’>'[small box or case]'; -ç›–>'[cover]'; -ç›—>'[rob]'; -ç››>'[abundant]'; -盜>'[rob]'; -盞>'[small cup or container]'; -盟>'[swear]'; -盡>'[exhaust]'; -監>'[supervise]'; -盤>'[tray]'; -盥>'[wash]'; -盧>'[cottage]'; -盪>'[to toss about]'; -ç›®>'[eye]'; -盲>'[blind]'; -ç›´>'[straight]'; -相>'[mutual]'; -ç›»>'[glare]'; -盾>'[shield]'; -çœ>'[province]'; -眄>'[to look askance]'; -眇>'[blind in one eye]'; -眈>'[gloat]'; -眉>'[eyebrows]'; -看>'[look]'; -県>'[county]'; -眛>'[dim]'; -#"眞>'[real]'", -真>'[real]'; -眠>'[close eyes]'; -#"眤>'[................................]'", -眥>'[eye sockets]'; -眦>'[corner of the eyes]'; -眩>'[confuse]'; -眷>'[take interest in]'; -眸>'[pupil of eye]'; -眺>'[look at]'; -眼>'[eye]'; -ç€>'[make move]'; -ç‡>'[look at]'; -çš>'[corner of eye]'; -ç›>'[eyeball]'; -ç¡>'[sleep]'; -ç£>'[supervise]'; -ç¥>'[look askance at]'; -ç¦>'[friendly]'; -ç¨>'[look askance at]'; -ç«>'[eyelashes]'; -ç¹>'[look at]'; -ç¾>'[testicle]'; -ç¿>'[shrewd]'; -çž‹>'[glare with anger]'; -瞎>'[blind]'; -çž‘>'[close eyes]'; -çžž>'[deceive]'; -çž >'[look at]'; -瞥>'[take fleeting glance at]'; -瞬>'[wink]'; -çž­>'[bright]'; -çž°>'[watch]'; -çž³>'[pupil of eye]'; -瞶>'[dim]'; -#"瞶>'[dim]'", -çž»>'[look]'; -çž¼>'[eyelid]'; -çž½>'[blind]'; -çž¿>'[surname]'; -矇>'[stupid]'; -çŸ>'[look about in firght or alarm]'; -矗>'[straight]'; -矚>'[watch carefully]'; -矛>'[spear]'; -矜>'[pity]'; -矢>'[arrow]'; -矣>'[particle of completed action]'; -知>'[know]'; -矧>'[much more]'; -矩>'[carpenter''s square]'; -短>'[short]'; -矮>'[short]'; -矯>'[correct]'; -石>'[stone]'; -矼>'[stone bridge]'; -ç ‚>'[sand]'; -ç Œ>'[stone steps]'; -ç ’>'[arsenic]'; -ç ”>'[grind]'; -ç •>'[break]'; -ç  >'[rocky]'; -ç ¥>'[whetstone]'; -ç ¦>'[stockade]'; -ç §>'[anvil]'; -ç ²>'[gun]'; -ç ´>'[break]'; -ç º>'[whetstone]'; -ç ¿>'[mine]'; -ç¡…>'[silicon]'; -ç¡>'[saltpeter]'; -ç¡«>'[sulfur]'; -硬>'[hard]'; -硯>'[inkstone]'; -#"硲>'[................................]'", -#"ç¡´>'[................................]'", -硼>'[borax]'; -ç¢>'[chess]'; -碆>'[arrow-tip]'; -碇>'[anchor]'; -碌>'[rough]'; -ç¢>'[obstruct]'; -碎>'[break]'; -碑>'[stone tablet]'; -碓>'[pestle]'; -#"碕>'[................................]'", -碗>'[bowl]'; -碚>'[suburb]'; -碣>'[stone tablet]'; -碧>'[jade]'; -碩>'[great]'; -碪>'[stone slab used for washing clot]'; -碯>'[agate]'; -#"碵>'[................................]'", -確>'[sure]'; -碼>'[number]'; -碾>'[roller]'; -ç£>'[magnetic]'; -磅>'[pound]'; -#"磆>'[................................]'", -磊>'[pile of rocks or stones]'; -磋>'[polish]'; -ç£>'[large rock]'; -磑>'[stone mill]'; -磔>'[downward stroke slanting righ]'; -磚>'[tile]'; -磧>'[sand and gravel]'; -磨>'[grind]'; -磬>'[musical instrument]'; -磯>'[jetty]'; -磴>'[steps on ledge]'; -磽>'[barren land]'; -ç¤>'[reef]'; -#"礇>'[................................]'", -礎>'[foundation stone]'; -#"礎>'[foundation stone]'", -#"礒>'[................................]'", -礙>'[obstruct]'; -礦>'[mine]'; -礪>'[whetstone]'; -礫>'[gravel]'; -礬>'[alum]'; -示>'[show]'; -礼>'[social custom]'; -社>'[god of the soil and altars to him]'; -祀>'[to sacrifice]'; -ç¥>'[pray]'; -祇>'[only]'; -祈>'[pray]'; -祉>'[happiness]'; -ç¥>'[divine intervention]'; -祓>'[exorcise]'; -祕>'[mysterious]'; -祖>'[ancestor]'; -祗>'[respect]'; -祚>'[throne]'; -ç¥>'[pray for happiness or blessings]'; -神>'[spirit]'; -祟>'[evil spirit]'; -祠>'[ancestral temple]'; -祢>'[one''s deceased father]'; -祥>'[good luck]'; -票>'[slip of paper or bamboo]'; -祭>'[sacrifice to]'; -祷>'[pray]'; -祺>'[good luck]'; -祿>'[blessing]'; -禀>'[report to]'; -ç¦>'[restrict]'; -禄>'[blessing]'; -禅>'[meditation]'; -禊>'[semi-annual ceremony of purifica]'; -ç¦>'[misfortune]'; -禎>'[lucky]'; -ç¦>'[happiness]'; -ç¦>'[[not found in dictionary]]'; -禦>'[defend]'; -禧>'[happiness]'; -禪>'[meditation]'; -禮>'[social custom]'; -禰>'[one''s deceased father]'; -禳>'[pray or sacrifice]'; -禹>'[legendary hsia dynasty founder]'; -禺>'[district]'; -禽>'[birds]'; -禾>'[grain still on stalk]'; -禿>'[bald]'; -秀>'[ear of grain]'; -ç§>'[private]'; -秉>'[grasp]'; -秋>'[autumn]'; -科>'[section]'; -秒>'[beard of grain or corn]'; -秕>'[empty grain or rice husk]'; -秘>'[secret]'; -租>'[rent]'; -#"秡>'[................................]'", -秣>'[fodder]'; -秤>'[balance]'; -秦>'[feudal state of qin]'; -秧>'[rice seedlings]'; -秩>'[order]'; -秬>'[black millet]'; -称>'[call]'; -移>'[change place]'; -稀>'[rare]'; -稈>'[stalk of grain]'; -程>'[journey]'; -ç¨>'[little]'; -税>'[taxes]'; -稔>'[ripe grain]'; -稗>'[darnels]'; -#"稘>'[................................]'", -稙>'[grain ready for grinding]'; -稚>'[young]'; -稜>'[corner]'; -稟>'[report to]'; -稠>'[dense]'; -種>'[seed]'; -稱>'[call]'; -稲>'[rice growing in field]'; -稷>'[god of cereals]'; -稻>'[rice growing in field]'; -稼>'[sow grain]'; -稽>'[examine]'; -稾>'[draft]'; -稿>'[draft]'; -ç©€>'[corn]'; -ç©‚>'[ear of grain]'; -#"穃>'[................................]'", -穆>'[majestic]'; -穉>'[young grain]'; -ç©>'[accumulate]'; -ç©Ž>'[rice tassel]'; -#"ç©Ž>'[rice tassel]'", -ç©>'[fall]'; -ç©—>'[ear of grain]'; -ç©¡>'[farm]'; -ç©¢>'[dirty]'; -ç©£>'[stalks of grain]'; -ç©©>'[stable]'; -ç©«>'[harvest]'; -ç©°>'[stalks of grain]'; -ç©´>'[cave]'; -究>'[examine]'; -穹>'[high and vast]'; -空>'[empty]'; -穽>'[hole]'; -ç©¿>'[penetrate]'; -çª>'[suddenly]'; -窃>'[secretly]'; -窄>'[narrow]'; -窈>'[obscure]'; -窒>'[stop up]'; -窓>'[window]'; -窕>'[slender]'; -窖>'[pit]'; -窗>'[window]'; -窘>'[embrassassed]'; -窟>'[hole]'; -窩>'[nest]'; -窪>'[hollow]'; -窮>'[poor]'; -窯>'[kiln]'; -窰>'[kiln]'; -窶>'[poor]'; -窺>'[peep]'; -窿>'[mine shaft]'; -竃>'[furnace]'; -ç«„>'[run away]'; -ç«…>'[hole]'; -竇>'[surname]'; -竈>'[furnace]'; -ç«Š>'[secretly]'; -ç«‹>'[stand]'; -ç«>'[decaliter]'; -ç«>'[kiloliter]'; -ç«’>'[strange]'; -ç«“>'[milliliter]'; -ç«•>'[deciliter]'; -ç«™>'[stand up]'; -ç«š>'[stand and wait for long time]'; -ç«œ>'[dragon]'; -ç«>'[combine]'; -ç«Ÿ>'[finally]'; -ç« >'[composition]'; -ç«¡>'[hectoliter]'; -ç«¢>'[wait for]'; -ç«£>'[terminate]'; -ç«¥>'[child]'; -竦>'[revere]'; -竪>'[perpendicular]'; -ç«­>'[put forth great effort]'; -端>'[end]'; -ç«°>'[centiliter]'; -競>'[contend]'; -竸>'[contend]'; -竹>'[bamboo]'; -竺>'[india]'; -ç«¿>'[bamboo pole]'; -#"笂>'[................................]'", -笄>'[hairpin]'; -笆>'[bamboo fence]'; -笈>'[bamboo box used carry books]'; -笊>'[ladle]'; -笋>'[bamboo shoots]'; -ç¬>'[tablet held by someone having au]'; -笑>'[smile]'; -#"笘>'[................................]'", -笙>'[small gourd-shaped musical instrument]'; -笛>'[bamboo flute]'; -笞>'[bamboo rod used for beatings]'; -笠>'[bamboo hat]'; -笥>'[a hamper]'; -符>'[i.d. tag]'; -笨>'[foolish]'; -第>'[sequence]'; -笳>'[a reed leaf whistle]'; -笵>'[a bamboo form]'; -#"笶>'[................................]'", -笹>'[small bamboo]'; -ç­…>'[bamboo brush]'; -ç­†>'[writing brush]'; -ç­ˆ>'[arrow end]'; -ç­‰>'[rank]'; -ç­‹>'[muscles]'; -ç­Œ>'[bamboo fish trap]'; -ç­>'[bamboo shoot]'; -ç­>'[raft]'; -ç­>'[bamboo basket or chest]'; -ç­‘>'[ancient lute]'; -ç­’>'[thick piece of bamboo]'; -ç­”>'[answer]'; -ç­–>'[scheme]'; -ç­>'[stringed musical instrument]'; -ç­¥>'[round-shaped bamboo basket for]'; -ç­§>'[bamboo water pipe]'; -ç­¬>'[reed of a loom]'; -ç­®>'[divination with stalks of plants]'; -ç­°>'[cable]'; -ç­±>'[dwarf bamboo]'; -ç­´>'[type of grass used in divination]'; -ç­µ>'[bamboo mat]'; -ç­º>'[bamboo basket or chest]'; -箆>'[fine-toothed comb]'; -箇>'[numerary adjunct]'; -箋>'[note]'; -ç®>'[hoop]'; -ç®>'[stringed musical instrument]'; -ç®’>'[broom]'; -ç®”>'[reed screen]'; -箕>'[sieve]'; -ç®—>'[count]'; -箘>'[fine bamboo]'; -ç®™>'[quiver]'; -箚>'[brief note]'; -箜>'[ancient string music instrument]'; -ç®>'[tweezers]'; -#"箟>'[................................]'", -管>'[pipe]'; -箪>'[small bamboo basket for holding]'; -ç®­>'[arrow]'; -ç®±>'[case]'; -ç®´>'[needle]'; -箸>'[chopsticks]'; -節>'[knot]'; -ç¯>'[bamboo grove]'; -範>'[pattern]'; -篆>'[seal script]'; -篇>'[chapter]'; -築>'[build]'; -篋>'[ratton box]'; -篌>'[ancient music instrument]'; -ç¯>'[inlay]'; -ç¯>'[bamboo basket]'; -篠>'[dwarf bamboo]'; -篤>'[deep]'; -篥>'[bulgle]'; -篦>'[fine-toothed comb]'; -篩>'[sieve]'; -篭>'[cage]'; -篳>'[wicker]'; -#"篶>'[................................]'", -篷>'[awning]'; -ç°€>'[bed mat]'; -ç°‡>'[swarm]'; -ç°>'[bamboo basket]'; -ç°‘>'[a coir raincoat]'; -ç°’>'[usurp]'; -#"ç°“>'[................................]'", -ç°”>'[a coir raincoat]'; -#"ç°—>'[................................]'", -ç°Ÿ>'[bamboo mat]'; -ç°¡>'[simple]'; -ç°£>'[bamboo basket for carrying earth]'; -ç°§>'[reed of woodwind instrument]'; -ç°ª>'[hairpin]'; -ç°«>'[musical instrument like pan-pipes]'; -ç°·>'[eaves of house]'; -ç°¸>'[winnower]'; -ç°½>'[sign]'; -ç°¾>'[a blind]'; -ç°¿>'[register]'; -ç±€>'[recite]'; -籃>'[basket]'; -籌>'[chip]'; -ç±>'[record]'; -ç±>'[flag]'; -ç±>'[climbing plants]'; -ç±”>'[bamboo basket]'; -ç±–>'[tally]'; -籘>'[climbing plants]'; -籟>'[bamboo flute]'; -ç± >'[cage]'; -籤>'[tally]'; -ç±¥>'[key]'; -籬>'[bamboo or wooden fence]'; -ç±³>'[hulled or husked uncooked rice]'; -ç±µ>'[dm]'; -ç±¾>'[unhulled rice]'; -ç²>'[km]'; -粂>'[surname]'; -粃>'[empty husks of grain]'; -粉>'[powder]'; -粋>'[pure]'; -ç²>'[mm]'; -#"ç²>'[................................]'", -ç²’>'[grain]'; -粕>'[lees]'; -ç²—>'[rough]'; -粘>'[viscous]'; -ç²›>'[pay respects]'; -粟>'[unhusked millet]'; -#"粡>'[................................]'", -ç²¢>'[grain offered in ritual sacrific]'; -粤>'[Guangdong and Guangxi provinces]'; -ç²¥>'[rice gruel]'; -粧>'[toilet]'; -粨>'[hm]'; -#"粫>'[................................]'", -#"ç²­>'[................................]'", -ç²®>'[food]'; -ç²±>'[better varieties of millet]'; -ç²²>'[polish]'; -ç²³>'[non-glutinous rice]'; -ç²¹>'[pure]'; -ç²½>'[dumpling made of glutinous rice]'; -ç²¾>'[essence]'; -#"ç³€>'[................................]'", -#"糂>'[................................]'", -ç³…>'[blend]'; -糊>'[paste]'; -糎>'[mm]'; -ç³’>'[food for a journey]'; -ç³–>'[sugar]'; -#"糘>'[................................]'", -糜>'[rice gruel]'; -糞>'[manure]'; -糟>'[sediment]'; -ç³ >'[chaff]'; -ç³¢>'[rice snacks]'; -糧>'[food]'; -糯>'[glutinous rice]'; -ç³²>'[unpolished rice]'; -ç³´>'[purchase grains]'; -糶>'[sell grains]'; -糸>'[silk]'; -糺>'[to collaborate]'; -ç³»>'[system]'; -ç³¾>'[investigate]'; -ç´€>'[record]'; -ç´‚>'[name of an emperor]'; -ç´„>'[treaty]'; -ç´…>'[red]'; -ç´†>'[bend]'; -ç´Š>'[confused]'; -ç´‹>'[line]'; -ç´>'[admit]'; -ç´>'[knot]'; -ç´”>'[pure]'; -ç´•>'[spoiled silk]'; -ç´—>'[gauze]'; -ç´˜>'[string]'; -ç´™>'[paper]'; -ç´š>'[level]'; -ç´›>'[in disorder]'; -ç´œ>'[confused]'; -ç´ >'[white (silk)]'; -ç´¡>'[spin]'; -ç´¢>'[large rope]'; -ç´«>'[purple]'; -ç´¬>'[kind of thin silk]'; -ç´®>'[tie]'; -ç´¯>'[tired]'; -ç´°>'[fine]'; -ç´²>'[bridle]'; -ç´³>'[girdle]'; -ç´µ>'[ramie]'; -ç´¹>'[continue]'; -ç´º>'[dark blue color]'; -ç´¿>'[cheat]'; -終>'[end]'; -絃>'[string on musical instrument]'; -組>'[class]'; -çµ…>'[unlined garment]'; -絆>'[loop]'; -#"絋>'[................................]'", -経>'[classic works]'; -絎>'[baste]'; -çµ>'[rope]'; -çµ>'[knot]'; -çµ–>'[fine silks]'; -çµ›>'[silk braid]'; -絞>'[twist]'; -絡>'[enmesh]'; -çµ¢>'[variegated]'; -çµ£>'[to baste for sewing]'; -給>'[give]'; -絨>'[silk]'; -çµ®>'[waste cotton]'; -çµ±>'[govern]'; -çµ²>'[silk]'; -çµ³>'[deep red]'; -çµµ>'[draw]'; -絶>'[cut]'; -çµ¹>'[kind of thick stiff silk]'; -#"çµ½>'[................................]'", -綉>'[embroider]'; -ç¶>'[soothe]'; -經>'[classic works]'; -継>'[continue]'; -続>'[continue]'; -#"綛>'[................................]'", -綜>'[arrange threads for weaving]'; -#"綟>'[................................]'", -綢>'[silk cloth]'; -綣>'[affectionate]'; -綫>'[line]'; -綬>'[silk ribbon attached as a seal]'; -維>'[maintain]'; -綮>'[embroidered banner]'; -綯>'[braid]'; -綰>'[to string together]'; -綱>'[heavy rope]'; -網>'[net]'; -綴>'[patch together]'; -綵>'[varicolored silk]'; -綸>'[green silk thread or tassel]'; -綺>'[fine thin silk]'; -綻>'[ripped seam]'; -綽>'[graceful]'; -綾>'[thin silk]'; -綿>'[cotton wad]'; -ç·‡>'[black silk]'; -ç·Š>'[tense]'; -ç·‹>'[scarlet]'; -ç·>'[collect]'; -ç·‘>'[green]'; -ç·’>'[end of thread]'; -#"ç·•>'[................................]'", -ç·˜>'[seal]'; -ç·š>'[thread]'; -ç·œ>'[cotton wad]'; -ç·>'[to sew in close stitches]'; -ç·ž>'[satin]'; -ç· >'[tie]'; -ç·¡>'[fishing-line]'; -ç·¤>'[cord]'; -ç·¨>'[knit]'; -ç·©>'[slow]'; -ç·¬>'[distant]'; -ç·¯>'[woof]'; -ç·²>'[indistinct]'; -ç·´>'[practice]'; -ç·»>'[delicate]'; -ç¸>'[hem]'; -縄>'[rope]'; -#"縄>'[rope]'", -縉>'[red silk]'; -縊>'[hang]'; -縋>'[climd down rope]'; -#"縑>'[fine silk]'", -縛>'[to tie]'; -縞>'[white raw silk]'; -縟>'[decorative]'; -縡>'[matter]'; -縢>'[bind]'; -縣>'[county]'; -縦>'[indulge in]'; -縫>'[sew]'; -縮>'[contract]'; -縱>'[indulge in]'; -縲>'[chain or rope used bind criminal]'; -縵>'[plain silk]'; -縷>'[thread]'; -縹>'[light blue silk]'; -#"縺>'[................................]'", -縻>'[halter for ox]'; -總>'[collect]'; -績>'[spin]'; -ç¹>'[complicated]'; -繃>'[bind]'; -繆>'[wind around]'; -繊>'[fine]'; -繋>'[attach]'; -ç¹>'[embroider]'; -ç¹”>'[weave]'; -繕>'[repair]'; -ç¹–>'[umbrella]'; -ç¹™>'[interpret]'; -繚>'[wind round]'; -#"ç¹>'[................................]'", -繞>'[entwine]'; -繦>'[string of copper coins]'; -#"繧>'[................................]'", -繩>'[rope]'; -繪>'[draw]'; -ç¹­>'[cocoon]'; -ç¹°>'[to reel silk from cocoons]'; -ç¹¹>'[unravel or unreel silk]'; -ç¹»>'[fine silk guaze]'; -ç¹¼>'[continue]'; -ç¹½>'[flourishing]'; -#"繿>'[................................]'", -纂>'[edit]'; -#"纃>'[................................]'", -纈>'[patterned silk]'; -#"纉>'[................................]'", -續>'[continue]'; -纎>'[fine]'; -çº>'[wrap]'; -#"çº>'[................................]'", -纒>'[wrap]'; -纓>'[chin strap]'; -纔>'[talent]'; -纖>'[fine]'; -纛>'[a banner]'; -纜>'[hawser]'; -缶>'[earthen crock or jar]'; -缸>'[earthen jug]'; -缺>'[be short of]'; -ç½…>'[crack]'; -罌>'[long necked jar or bottle]'; -ç½>'[large earthenware wine jar]'; -罎>'[an earthenware jar]'; -ç½>'[jar]'; -网>'[net]'; -ç½”>'[net]'; -罕>'[rare]'; -罘>'[screen used in ancient times]'; -罟>'[net]'; -ç½ >'[animal trap]'; -#"罧>'[................................]'", -罨>'[medical compress]'; -罩>'[basket for catching fish]'; -罪>'[crime]'; -罫>'[hinder]'; -ç½®>'[place]'; -ç½°>'[penalty]'; -ç½²>'[public office]'; -ç½µ>'[accuse]'; -ç½·>'[cease]'; -罸>'[penalty]'; -ç½¹>'[sorrow]'; -#"羂>'[................................]'", -羃>'[cover-cloth]'; -ç¾…>'[net for catching birds]'; -羆>'[brown bear]'; -羇>'[inn]'; -羈>'[halter]'; -羊>'[sheep]'; -羌>'[qiang nationality]'; -美>'[beautiful]'; -ç¾”>'[lamb]'; -羚>'[species of antelope]'; -ç¾>'[ram]'; -羞>'[disgrace]'; -ç¾£>'[group]'; -群>'[group]'; -羨>'[envy]'; -義>'[right conduct]'; -ç¾®>'[soup]'; -羯>'[wether]'; -ç¾²>'[ancient emperor]'; -羶>'[rank odor]'; -羸>'[weak]'; -ç¾¹>'[soup]'; -ç¾½>'[feather]'; -ç¿>'[old man]'; -ç¿…>'[wings]'; -翆>'[color green]'; -ç¿Š>'[flying]'; -ç¿Œ>'[bright]'; -ç¿’>'[practice]'; -ç¿”>'[soar]'; -ç¿•>'[agree]'; -ç¿ >'[color green]'; -ç¿¡>'[kingfisher]'; -翦>'[scissors]'; -ç¿©>'[fly]'; -ç¿«>'[careless]'; -ç¿°>'[writing brush]'; -翳>'[shade]'; -翹>'[turn up]'; -ç¿»>'[flip over]'; -翼>'[wings]'; -耀>'[shine]'; -è€>'[old]'; -考>'[examine]'; -耄>'[elderly person]'; -者>'[that which]'; -耆>'[man of sixty]'; -耋>'[aged]'; -而>'[and]'; -è€>'[endure]'; -耒>'[handle of plow]'; -耕>'[plow]'; -耗>'[consume]'; -耘>'[weed]'; -耙>'[rake]'; -耜>'[spade-shaped tool]'; -耡>'[hoe]'; -耨>'[hoe]'; -耳>'[ear]'; -耶>'[used in transliteration]'; -耻>'[shame]'; -耽>'[indulge in]'; -耿>'[bright]'; -è†>'[listen]'; -èŠ>'[somewhat]'; -è’>'[clamor]'; -è–>'[holy]'; -è˜>'[engage]'; -èš>'[assemble]'; -èž>'[hear]'; -èŸ>'[son-in-law]'; -è¡>'[intelligent]'; -#"è¢>'[................................]'", -è¨>'[connect]'; -è¯>'[connect]'; -è°>'[intelligent]'; -è²>'[sound]'; -è³>'[urge on]'; -è´>'[hear]'; -è¶>'[whisper]'; -è·>'[duty]'; -è¹>'[earwax]'; -è½>'[hear]'; -è¾>'[deaf]'; -è¿>'[writing brush]'; -è‚„>'[learn]'; -è‚…>'[pay respects]'; -肆>'[indulge]'; -肇>'[begin]'; -肉>'[flesh]'; -è‚‹>'[ribs]'; -è‚Œ>'[muscle tissue]'; -è‚“>'[region between heart and diaphragm]'; -è‚–>'[look like]'; -肘>'[elbow]'; -è‚š>'[belly]'; -è‚›>'[anus]'; -è‚>'[liver]'; -è‚¡>'[thighs]'; -è‚¢>'[human limbs]'; -è‚¥>'[fat]'; -è‚©>'[shoulders]'; -肪>'[animal fat]'; -肬>'[wart]'; -è‚­>'[fat]'; -肯>'[willing]'; -肱>'[forearm]'; -育>'[produce]'; -è‚´>'[cooked or prepared meat]'; -肺>'[lungs]'; -胃>'[stomach]'; -胄>'[helmet]'; -胆>'[gall bladder]'; -背>'[back]'; -胎>'[unborn child]'; -胖>'[fat]'; -胙>'[food offered in sacrificial serv]'; -胚>'[embryo]'; -胛>'[the shoulder]'; -èƒ>'[callous]'; -胞>'[womb]'; -胡>'[recklessly]'; -胤>'[heir]'; -胥>'[all]'; -胯>'[pelvis]'; -胱>'[bladder]'; -胴>'[the large intestine]'; -胸>'[breast]'; -胼>'[callus]'; -能>'[be able]'; -è„‚>'[fat]'; -è„…>'[ribs]'; -脆>'[crisp]'; -脇>'[ribs]'; -脈>'[blood vessels]'; -脉>'[blood vessels]'; -è„Š>'[spine]'; -è„š>'[leg]'; -è„›>'[shinbone]'; -è„£>'[lips]'; -è„©>'[dried meat (used as teachers payment in ancient times)]'; -脯>'[dried meat]'; -脱>'[take off]'; -脳>'[brain]'; -脹>'[swell]'; -脾>'[spleen]'; -è…†>'[prosperous]'; -è…‹>'[armpit]'; -è…Ž>'[kidneys]'; -è…>'[rot]'; -è…‘>'[bowels]'; -è…“>'[calf]'; -è…”>'[chest cavity]'; -è…•>'[wrist]'; -è…Ÿ>'[vagina]'; -è…¥>'[raw meat]'; -è…¦>'[brain]'; -è…«>'[swell]'; -è…®>'[lower part of face]'; -è…°>'[waist]'; -è…±>'[tendons]'; -è…´>'[fat]'; -è…¸>'[intestines]'; -è…¹>'[stomach]'; -è…º>'[gland]'; -è…¿>'[legs]'; -膀>'[upper arm]'; -膂>'[backbone]'; -膃>'[fat]'; -膈>'[diaphragm]'; -膊>'[shoulders]'; -è†>'[grease]'; -膓>'[intestines]'; -膕>'[hollow]'; -膚>'[skin]'; -膜>'[membrane]'; -è†>'[knee]'; -膠>'[glue]'; -膣>'[vagina]'; -#"膤>'[................................]'", -膨>'[swell]'; -膩>'[greasy]'; -膰>'[cook meat for sacrifice or offer]'; -膳>'[meals]'; -膵>'[pancreas]'; -#"膸>'[................................]'", -膺>'[breast]'; -膽>'[gall bladder]'; -膾>'[minced meat or fish]'; -膿>'[pus]'; -臀>'[buttocks]'; -臂>'[arm]'; -臆>'[chest]'; -臈>'[year end sacrifice]'; -臉>'[face]'; -è‡>'[abdominal area of crab]'; -臑>'[soft]'; -臓>'[internal organs]'; -臘>'[year end sacrifice]'; -臙>'[rouge]'; -臚>'[arrange in order]'; -臟>'[internal organs]'; -臠>'[small lump of meat]'; -臣>'[minister]'; -臥>'[lie down]'; -臧>'[good]'; -臨>'[draw near]'; -自>'[self]'; -臭>'[smell]'; -至>'[reach]'; -致>'[send]'; -臺>'[tower]'; -臻>'[reach]'; -臼>'[mortar]'; -臾>'[moment]'; -èˆ>'[carry on one''s shoulder]'; -舂>'[grind in mortar]'; -舅>'[mother''s brother]'; -與>'[and]'; -興>'[thrive]'; -舉>'[raise]'; -舊>'[old]'; -舌>'[tongue]'; -èˆ>'[house]'; -舎>'[house]'; -èˆ>'[lick with tongue]'; -舒>'[open up]'; -舖>'[store]'; -舗>'[store]'; -舘>'[a mansion]'; -舛>'[oppose]'; -舜>'[legendary ruler]'; -舞>'[dance]'; -舟>'[boat]'; -舩>'[boat]'; -航>'[sail]'; -舫>'[fancy boat]'; -般>'[sort]'; -舮>'[bow or prow of boat]'; -舳>'[stern of ship]'; -舵>'[rudder]'; -舶>'[large]'; -舷>'[sides of boat]'; -舸>'[large boat]'; -船>'[ship]'; -艀>'[[not found in dictionary]]'; -艇>'[small boat]'; -艘>'[counter for ships]'; -艙>'[hold of ship]'; -艚>'[ship]'; -#"è‰>'[................................]'", -艟>'[ancient warship]'; -艢>'[a mast]'; -艤>'[to moor a boat to the bank]'; -艦>'[warship]'; -艨>'[long and narrow war-boat]'; -艪>'[oar]'; -艫>'[bow or prow of boat]'; -艮>'[seventh of eight diagrams]'; -良>'[good]'; -艱>'[difficult]'; -色>'[color]'; -艶>'[beautiful]'; -艷>'[beautiful]'; -艸>'[grass]'; -艾>'[artemisia]'; -芋>'[taro]'; -èŠ>'[peony]'; -芒>'[miscanthus sinensis]'; -芙>'[hibiscus]'; -èŠ>'[purplish mushroom thought promot]'; -芟>'[mow]'; -芥>'[mustard plant]'; -芦>'[rushes]'; -芫>'[daphne genkwa]'; -芬>'[fragrance]'; -芭>'[plantain or banana palm]'; -芯>'[pith from rush (juncus effusus)]'; -花>'[flower]'; -芳>'[fragrant]'; -芸>'[rue]'; -芹>'[celery]'; -芻>'[mow]'; -芽>'[bud]'; -è‹…>'[cut off]'; -è‹‘>'[pasture]'; -è‹’>'[lush]'; -è‹“>'[fungus]'; -è‹”>'[moss]'; -è‹—>'[sprouts]'; -è‹™>'[pigsty]'; -è‹›>'[small]'; -è‹œ>'[clover]'; -è‹ž>'[variety of rush]'; -è‹Ÿ>'[careless]'; -è‹¡>'[barley]'; -è‹£>'[kind of lettuce]'; -è‹¥>'[if]'; -苦>'[bitter]'; -苧>'[china grass]'; -è‹«>'[rush or straw matting]'; -英>'[petal]'; -#"苳>'[................................]'", -è‹´>'[sackcloth]'; -苹>'[artemisia]'; -苺>'[berries]'; -è‹»>'[kind of herb]'; -茂>'[thick]'; -范>'[surname]'; -茄>'[eggplant]'; -茅>'[reeds]'; -茆>'[species of grass]'; -茉>'[white jasmine]'; -茎>'[stem]'; -茖>'[allium victorialis]'; -茗>'[tea]'; -#"茗>'[tea]'", -茜>'[madder]'; -#"茣>'[................................]'", -茨>'[caltrop]'; -茫>'[vast]'; -茯>'[china root]'; -茱>'[dogwood]'; -茲>'[now]'; -茴>'[fennel]'; -茵>'[cushion]'; -茶>'[tea]'; -茸>'[soft]'; -茹>'[roots]'; -è€>'[surname]'; -è…>'[answer: small bean]'; -è‰>'[grass]'; -èŠ>'[thorns]'; -è>'[beans]'; -è>'[repeat]'; -è’>'[wasteland]'; -è˜>'[village]'; -è³>'[beans]'; -#"èµ>'[................................]'", -è·>'[lotus]'; -è»>'[reed]'; -è¼>'[bitter vegetable]'; -莅>'[attend]'; -#"莇>'[................................]'", -莉>'[white jasmine]'; -莊>'[village]'; -莎>'[kind of sedge grass]'; -莓>'[moss]'; -莖>'[stem]'; -莚>'[bamboo mat]'; -莞>'[smiling]'; -#"莟>'[................................]'", -莠>'[weeds]'; -莢>'[pods of leguminous plants]'; -莨>'[herb]'; -莪>'[artemisia]'; -莫>'[do not]'; -莱>'[goosefoot]'; -莵>'[dodder]'; -莽>'[thicket]'; -è>'[flower of leek family]'; -è…>'[coarse grass]'; -èŠ>'[chrysanthemum]'; -èŒ>'[mushroom]'; -èŽ>'[beautiful jade]'; -è“>'[fruits]'; -è–>'[iris]'; -è˜>'[celery]'; -èœ>'[vegetables]'; -èŸ>'[dodder]'; -è >'[spinach and similar greens]'; -è©>'[herb]'; -è«>'[celery]'; -è¯>'[flowery]'; -è°>'[wild rice]'; -è±>'[water-chestnut]'; -è²>'[fragrant]'; -è´>'[small buddhist monastery]'; -#"è·>'[................................]'", -è»>'[artemisia]'; -è½>'[beans and peas]'; -èƒ>'[dense]'; -è„>'[grapes]'; -è‡>'[averrhora carambola]'; -è‹>'[luxuriant foliage]'; -èŒ>'[bud]'; -è>'[duckweed]'; -èŽ>'[wither]'; -#"è“>'[................................]'", -è >'[bud]'; -#"è¢>'[................................]'", -è©>'[scandent hop]'; -#"èª>'[................................]'", -è¬>'[ten thousand]'; -è±>'[day-lily]'; -èµ>'[lettuce]'; -è¸>'[dogwood]'; -è¼>'[calyx of flower]'; -è½>'[fall]'; -葆>'[reserve]'; -葉>'[leaf]'; -#"è‘Ž>'[................................]'", -è‘—>'[manifest]'; -è‘›>'[edible bean]'; -è‘¡>'[grapes]'; -è‘¢>'[cover]'; -è‘£>'[direct]'; -葦>'[reed]'; -è‘©>'[flowers]'; -è‘«>'[bottle-gourd]'; -葬>'[bury]'; -è‘­>'[bulrush]'; -#"è‘­>'[bulrush]'", -葯>'[leaf of angelica plant]'; -葱>'[scallions]'; -葵>'[sunflower]'; -è‘·>'[meat diet]'; -葹>'[kind of chrysanthemum]'; -葺>'[thatch]'; -è’‚>'[peduncle or stem of plants]'; -#"è’„>'[................................]'", -è’‹>'[surname]'; -è’>'[collect]'; -è’”>'[transplant]'; -è’™>'[cover]'; -è’œ>'[garlic]'; -è’Ÿ>'[betel pepper]'; -è’¡>'[burdock]'; -è’­>'[to cutgrass]'; -è’²>'[type of rush]'; -è’¸>'[steam]'; -è’¹>'[reed]'; -è’»>'[rushes]'; -è’¼>'[blue]'; -è’¿>'[mugwort]'; -è“>'[abundant]'; -è“„>'[store]'; -蓆>'[straw mat]'; -蓉>'[hibiscus]'; -è“Š>'[luxuriant vegetation]'; -è“‹>'[cover]'; -è“>'[milfoil]'; -è“>'[straw bed mat]'; -è“‘>'[rain coat made of straw]'; -è“–>'[castor-oil plant]'; -#"è“™>'[................................]'", -è“š>'[oxalic (used in compounds)]'; -蓬>'[type of raspberry]'; -è“®>'[lotus]'; -è“´>'[edible water plant]'; -蓼>'[smartweed]'; -è“¿>'[clover]'; -蔀>'[screen]'; -蔆>'[water-chestnut]'; -蔑>'[disdain]'; -蔓>'[creeping plants]'; -è””>'[radish]'; -蔕>'[peduncle or stem of plants]'; -è”—>'[sugar cane]'; -蔘>'[ginsen]'; -蔚>'[luxuriant]'; -蔟>'[frame on which silkworms spin]'; -蔡>'[surname]'; -蔦>'[parasitic plants]'; -蔬>'[vegetables]'; -è”­>'[shade]'; -蔵>'[hide]'; -蔽>'[cover]'; -#"è•€>'[................................]'", -è•>'[nettle]'; -蕃>'[foreign things]'; -蕈>'[mushrooms]'; -蕉>'[banana]'; -è•Š>'[unopened flowers]'; -è•‹>'[unopened flowers]'; -è•Ž>'[buckwheat]'; -è••>'[caryopteris divaricata]'; -#"è•—>'[................................]'", -蕘>'[fuel]'; -è•š>'[calyx of flower]'; -è•£>'[hibiscus]'; -蕨>'[pteris aquilina]'; -è•©>'[pond]'; -蕪>'[luxurious growth of weeds]'; -è•­>'[common artemisia]'; -è•·>'[yam]'; -蕾>'[buds]'; -è–€>'[the hippuris or mare''s tail plant]'; -è–„>'[thin]'; -è–‡>'[osmunda regalis]'; -è–ˆ>'[luxuriant]'; -è–Š>'[circium]'; -è–>'[spinach]'; -è–‘>'[ginger]'; -è–”>'[rose]'; -è–—>'[garden]'; -è–™>'[weed]'; -è–›>'[kind of marsh grass]'; -è–œ>'[evergreen shrubs]'; -è–¤>'[allium bakeri]'; -è–¦>'[offer]'; -è–¨>'[death of prince]'; -è–©>'[transliteration of \"sat\" of boddhisattva etc.]'; -è–ª>'[fuel]'; -è–«>'[a medicinal herb]'; -è–¬>'[drugs]'; -è–®>'[marsh]'; -è–¯>'[yam]'; -è–¹>'[cyperus rotundus]'; -è–º>'[water-chestnuts]'; -è—>'[straw]'; -è—‰>'[mat]'; -è—>'[blue]'; -è—>'[hide]'; -è—>'[disregard]'; -è—•>'[lotus root]'; -è—œ>'[chenopodium album]'; -è—>'[art]'; -è—¤>'[rattan]'; -è—¥>'[drugs]'; -è—©>'[fence]'; -è—ª>'[marsh]'; -è—·>'[yam]'; -è—¹>'[lush]'; -è—º>'[rush used in making mats]'; -è—»>'[splendid]'; -è—¾>'[shade]'; -蘂>'[stamen or pistil]'; -蘆>'[rushes]'; -蘇>'[thyme]'; -蘊>'[collect]'; -蘋>'[apple]'; -蘓>'[thyme]'; -蘖>'[stump]'; -蘗>'[stump]'; -蘚>'[moss]'; -蘢>'[tall grass]'; -蘭>'[orchid]'; -蘯>'[to toss about]'; -#"蘯>'[to toss about]'", -蘿>'[type of creeping plant]'; -è™>'[tiger]'; -虎>'[tiger]'; -è™>'[cruel]'; -è™”>'[act with reverence]'; -處>'[place]'; -虚>'[false]'; -虜>'[capture]'; -虞>'[concerned about]'; -號>'[mark]'; -虧>'[lose]'; -虫>'[insects]'; -è™±>'[louse]'; -虹>'[rainbow]'; -è™»>'[horsefly]'; -蚊>'[mosquito]'; -èš‹>'[gnat]'; -蚌>'[oysters]'; -èš“>'[earthworm]'; -èš•>'[silkworms]'; -蚣>'[centipede]'; -蚤>'[flea]'; -èš©>'[worm]'; -蚪>'[tadpole]'; -èš«>'[abalone]'; -蚯>'[earthworm]'; -èš°>'[millipede]'; -蚶>'[kind of clam]'; -蛄>'[mole cricket]'; -蛆>'[maggots]'; -蛇>'[snake]'; -蛉>'[dragonfly]'; -蛋>'[eggs]'; -è›>'[glow-worm]'; -蛎>'[oyster]'; -è›”>'[tapeworm]'; -è›™>'[frog]'; -è››>'[spider]'; -蛞>'[snail]'; -蛟>'[scaly dragon with four legs]'; -蛤>'[clam]'; -蛩>'[cricket]'; -#"蛩>'[cricket]'", -è›­>'[leech]'; -è›®>'[barbarians]'; -蛯>'[shrimp]'; -蛸>'[long legged spider]'; -蛹>'[chrysalis]'; -è›»>'[molt]'; -蛾>'[moth]'; -蜀>'[name of an ancient state]'; -蜂>'[bee]'; -蜃>'[marine monster which can change its shape]'; -蜆>'[a variety of bivalves]'; -蜈>'[centipede]'; -蜉>'[mayfly]'; -蜊>'[clam]'; -èœ>'[toad]'; -蜑>'[egg]'; -蜒>'[millipede]'; -蜘>'[spider]'; -蜚>'[cockroach]'; -蜜>'[honey]'; -蜥>'[lizard]'; -蜩>'[cicada]'; -蜴>'[lizard]'; -蜷>'[creep like worm]'; -蜻>'[dragonfly]'; -蜿>'[creep]'; -è‰>'[cicada]'; -è‹>'[wax]'; -èŒ>'[tadpole]'; -èŽ>'[scorpion]'; -è“>'[snail]'; -è•>'[nibble away]'; -è—>'[kind of locust]'; -è™>'[bat]'; -èŸ>'[hedgehog]'; -è >'[kind of bat]'; -è£>'[mayfly]'; -è¦>'[shrimp]'; -è¨>'[louse]'; -#"è¨>'[louse]'", -è®>'[venomous snake]'; -è´>'[butterfly]'; -è¶>'[butterfly]'; -è¸>'[snail]'; -è¿>'[flies]'; -èž‚>'[mantis]'; -èž>'[melt]'; -螟>'[kind of caterpillar]'; -螢>'[glow-worm]'; -èž«>'[poison]'; -螯>'[nippers]'; -èž³>'[mantis]'; -螺>'[spiral shell]'; -èž»>'[gryllotalpa africana]'; -èž½>'[katydid]'; -蟀>'[cricket]'; -蟄>'[to hibernate]'; -蟆>'[frog]'; -蟇>'[frog]'; -蟋>'[cricket]'; -#"蟋>'[cricket]'", -蟒>'[python]'; -蟠>'[coil]'; -蟯>'[worms]'; -蟲>'[worms]'; -蟶>'[razor clam]'; -蟷>'[mantis]'; -蟹>'[crab]'; -蟻>'[ants]'; -蟾>'[toad]'; -è …>'[flies]'; -è >'[scorpion]'; -è Ž>'[python]'; -è >'[crab]'; -è ‘>'[lizard]'; -è •>'[eumenes polifomis]'; -è –>'[measuring worm]'; -è ¡>'[wood-boring insect]'; -è ¢>'[wriggle]'; -è £>'[oyster]'; -è §>'[moth]'; -è ±>'[posion]'; -è ¶>'[silkworms]'; -è ¹>'[moth]'; -è »>'[barbarians]'; -è¡€>'[blood]'; -è¡‚>'[to be defeated]'; -è¡„>'[epistaxis]'; -衆>'[multitude]'; -è¡Œ>'[go]'; -è¡>'[overflow]'; -è¡’>'[brag]'; -è¡“>'[art]'; -è¡—>'[street]'; -è¡™>'[public office]'; -è¡›>'[guard]'; -è¡>'[rush against]'; -è¡ž>'[guard]'; -è¡¡>'[measure]'; -è¡¢>'[highway]'; -è¡£>'[clothes]'; -表>'[show]'; -è¡«>'[shirt]'; -è¡°>'[decline]'; -衲>'[mend]'; -衵>'[chemise]'; -è¡·>'[heart]'; -衽>'[lapel]'; -衾>'[coverlet]'; -è¡¿>'[collar or lapel of garment]'; -è¢>'[robe]'; -袂>'[sleeves]'; -袈>'[buddhist cassock]'; -袋>'[pocket]'; -è¢>'[long gown]'; -袒>'[strip]'; -袖>'[sleeve]'; -袗>'[unlined garments]'; -#"袙>'[................................]'", -袞>'[ceremonial dress worn by emperor]'; -袢>'[robe]'; -袤>'[longitude]'; -被>'[passive indicator \"by\"]'; -#"袮>'[................................]'", -#"袰>'[................................]'", -袱>'[piece of cloth used wrap bundles]'; -袴>'[pants]'; -袵>'[lapel]'; -袷>'[lined garment]'; -袿>'[gown]'; -è£>'[cut out]'; -裂>'[split]'; -#"裂>'[split]'", -#"裂>'[split]'", -装>'[dress]'; -è£>'[inside]'; -裔>'[progeny]'; -裕>'[abundant]'; -裘>'[fur garments]'; -裙>'[skirt]'; -補>'[mend]'; -è£>'[dress]'; -裟>'[a cassock or robe of a monk]'; -裡>'[inside]'; -裨>'[aid]'; -裲>'[waistcoat]'; -裳>'[clothes]'; -裴>'[surname]'; -裸>'[bare]'; -裹>'[wrap]'; -裼>'[to take off one''s top]'; -製>'[make]'; -裾>'[lapel]'; -褂>'[jacket]'; -#"褃>'[a seam in a garment]'", -複>'[repeat]'; -褊>'[cramped]'; -褌>'[trousers]'; -è¤>'[coarse woolen cloth]'; -褒>'[praise]'; -褓>'[swaddling cloth]'; -è¤>'[unlined garment]'; -#"褞>'[................................]'", -褥>'[mattress]'; -褪>'[strip]'; -褫>'[strip]'; -褶>'[pleat]'; -褸>'[lapel]'; -褻>'[dirty]'; -è¥>'[swaddling clothes]'; -襃>'[commend]'; -襄>'[aid]'; -襌>'[unlined garment]'; -è¥>'[mixed]'; -襖>'[outer garments]'; -襞>'[fold]'; -襟>'[lapel]'; -襠>'[crotch or seat of pants]'; -襤>'[ragged]'; -襦>'[short coat]'; -襪>'[socks]'; -襭>'[tuck up hem of garment and wrap]'; -襯>'[underwear]'; -襲>'[raid]'; -襴>'[a one piece garment]'; -#"襶>'[ignorant]'", -襾>'[cover]'; -西>'[west(ern)]'; -è¦>'[necessary]'; -覃>'[reach to]'; -覆>'[cover]'; -覇>'[rule by might rather than right]'; -覈>'[investigate]'; -覊>'[halter]'; -見>'[see]'; -è¦>'[rules]'; -覓>'[seek]'; -視>'[look at]'; -覗>'[peek]'; -覘>'[peek]'; -覚>'[wake up from sleep]'; -覡>'[wizard]'; -覦>'[desire strongly]'; -覧>'[look at]'; -覩>'[see]'; -親>'[relatives]'; -覬>'[covet]'; -覯>'[meet or see unexpectedly]'; -覲>'[have imperial audience]'; -観>'[see]'; -覺>'[wake up from sleep]'; -覽>'[look at]'; -覿>'[see]'; -觀>'[see]'; -角>'[horn]'; -觚>'[jug]'; -觜>'[beak]'; -è§>'[gore]'; -解>'[loosen]'; -触>'[butt]'; -觧>'[loosen]'; -觴>'[wine vessel]'; -觸>'[touch]'; -言>'[words]'; -訂>'[draw up agreement]'; -訃>'[obituary]'; -計>'[plan]'; -訊>'[inquire]'; -訌>'[confusion]'; -討>'[ask for]'; -è¨>'[expose other''s secrets]'; -訓>'[teach]'; -訖>'[finish]'; -託>'[entrust]'; -記>'[record]'; -訛>'[swindle]'; -è¨>'[express surprise]'; -訟>'[accuse]'; -訣>'[take leave of]'; -訥>'[slow of speech]'; -訪>'[visit]'; -設>'[build]'; -許>'[allow]'; -訳>'[translate]'; -訴>'[accuse]'; -訶>'[scold loudly]'; -診>'[examine patient]'; -註>'[explain]'; -証>'[prove]'; -è©>'[exegesis]'; -詆>'[slander]'; -詈>'[scold]'; -è©>'[cheat]'; -è©‘>'[cheat]'; -è©’>'[bequeath]'; -è©”>'[decree]'; -è©•>'[appraise]'; -è©›>'[curse]'; -è©ž>'[words]'; -è© >'[sing]'; -è©¢>'[inquire into]'; -è©£>'[reach]'; -試>'[test]'; -è©©>'[poetry]'; -è©«>'[be surprised]'; -詬>'[abuse]'; -è©­>'[deceive]'; -è©®>'[explain]'; -è©°>'[question]'; -話>'[speech]'; -該>'[should]'; -詳>'[detailed]'; -詼>'[tease]'; -誂>'[tempt]'; -誄>'[eulogize]'; -誅>'[execute]'; -誇>'[exaggerate]'; -誉>'[fame]'; -誌>'[write down]'; -èª>'[recognize]'; -誑>'[deceive]'; -誓>'[swear]'; -誕>'[bear children]'; -誘>'[persuade]'; -誚>'[criticize]'; -語>'[language]'; -誠>'[sincere]'; -誡>'[warn]'; -誣>'[make false accusation]'; -誤>'[err]'; -誥>'[inform]'; -誦>'[recite]'; -誨>'[teach]'; -説>'[speak]'; -読>'[read]'; -誰>'[who? whom? whose? anyone?]'; -課>'[lesson]'; -誹>'[slander]'; -誼>'[friendship]'; -調>'[transfer]'; -è«‚>'[flatter]'; -è«„>'[patient]'; -談>'[talk]'; -è«‹>'[ask]'; -è«Œ>'[remonstrate]'; -è«>'[to expostulate]'; -è«>'[consult]'; -è«’>'[excuse]'; -è«–>'[debate]'; -è«š>'[(kokuji) command]'; -è«›>'[flatter]'; -è«œ>'[intelligence report]'; -è«ž>'[brag]'; -è« >'[noisy]'; -è«¡>'[posthumous name]'; -è«¢>'[jokes]'; -諤>'[honest speech]'; -諦>'[careful]'; -諧>'[harmonize]'; -è««>'[remonstrate]'; -è«­>'[proclaim]'; -è«®>'[consult]'; -諱>'[conceal]'; -諳>'[versed in]'; -è«·>'[recite]'; -諸>'[several]'; -諺>'[proverb]'; -諾>'[promise]'; -謀>'[plan]'; -è¬>'[visit]'; -謂>'[say]'; -謄>'[copy]'; -謇>'[stutter]'; -謌>'[slander]'; -謎>'[riddle]'; -è¬>'[calm]'; -謔>'[jeer]'; -謖>'[rise up]'; -謗>'[slander]'; -謙>'[humble]'; -謚>'[to confer posthumous titles]'; -講>'[explain]'; -è¬>'[thank]'; -謠>'[sing]'; -謡>'[sing]'; -謦>'[t speak softly]'; -謨>'[scheme]'; -謫>'[charge]'; -謬>'[error]'; -謳>'[sing]'; -謹>'[prudent]'; -謾>'[deceive]'; -è­>'[noise]'; -è­‰>'[proof]'; -è­Œ>'[false]'; -è­Ž>'[cunning]'; -è­>'[ridicule]'; -è­–>'[to slander]'; -è­˜>'[recognize]'; -è­š>'[surname]'; -è­›>'[to slander]'; -è­œ>'[register]'; -è­Ÿ>'[clamor]'; -è­¦>'[guard]'; -è­«>'[talkative]'; -è­¬>'[metaphor]'; -è­¯>'[translate]'; -è­°>'[consult]'; -#"è­±>'[................................]'", -è­²>'[allow]'; -è­´>'[reprimand]'; -è­·>'[protect]'; -è­½>'[fame]'; -讀>'[read]'; -讃>'[praise]'; -變>'[change]'; -讌>'[feast]'; -讎>'[enemy]'; -è®>'[enemy]'; -è®’>'[slander]'; -讓>'[allow]'; -è®–>'[prophecy]'; -è®™>'[cheer]'; -讚>'[praise]'; -è°·>'[valley]'; -è°º>'[the mouth of a valley]'; -è°¿>'[valley]'; -è±>'[open up]'; -豆>'[beans]'; -豈>'[how? what?]'; -豊>'[abundant]'; -豌>'[peas]'; -豎>'[vertical]'; -è±>'[abundant]'; -豕>'[pigs]'; -豚>'[small pig]'; -象>'[elephant]'; -è±¢>'[domestic animals]'; -豪>'[brave]'; -豫>'[relaxed]'; -豬>'[pig]'; -豸>'[radical 153]'; -è±¹>'[leopard]'; -豺>'[wolf]'; -è±¼>'[fox]'; -貂>'[marten]'; -è²…>'[brave]'; -貉>'[badger]'; -貊>'[leopard]'; -貌>'[countenance]'; -è²>'[a fox-like animal]'; -貎>'[lion]'; -è²”>'[fox]'; -貘>'[the panther]'; -è²>'[sea shell]'; -貞>'[virtuous]'; -è² >'[load]'; -財>'[wealth]'; -è²¢>'[offer tribute]'; -貧>'[poor]'; -貨>'[goods]'; -販>'[peddler]'; -貪>'[greedy]'; -貫>'[string of 1000 coins]'; -責>'[one''s responsibility]'; -è²­>'[matter]'; -è²®>'[number two]'; -貯>'[store]'; -è²°>'[borrow]'; -è²²>'[property]'; -è²³>'[number two]'; -è²´>'[expensive]'; -貶>'[decrease]'; -è²·>'[buy]'; -貸>'[lend]'; -è²»>'[expenses]'; -è²¼>'[paste to]'; -è²½>'[give to]'; -貿>'[trade]'; -è³€>'[congratulate]'; -è³>'[forge ahead]'; -賂>'[bribe]'; -賃>'[rent]'; -賄>'[bribe]'; -資>'[property]'; -賈>'[surname]'; -賊>'[thief]'; -è³>'[booty]'; -賎>'[mean]'; -賑>'[relieve]'; -賓>'[guest]'; -賚>'[give]'; -è³›>'[help]'; -賜>'[give]'; -賞>'[reward]'; -è³ >'[indemnify]'; -è³¢>'[virtuous]'; -è³£>'[sell]'; -賤>'[mean]'; -賦>'[tax]'; -質>'[matter]'; -è³­>'[bet]'; -賺>'[make money]'; -è³»>'[gift of money help pay funeral]'; -è³¼>'[buy]'; -è³½>'[compete]'; -è´„>'[gift superior]'; -è´…>'[unnecessary]'; -è´‡>'[affable]'; -è´ˆ>'[give present]'; -è´Š>'[help]'; -è´‹>'[false]'; -è´>'[support]'; -è´>'[win]'; -è´>'[farewell present]'; -è´“>'[booty]'; -è´”>'[strong]'; -è´–>'[buy]'; -赤>'[red]'; -赦>'[forgive]'; -赧>'[blush]'; -赫>'[bright]'; -èµ­>'[reddish brown]'; -èµ°>'[walk]'; -èµ±>'[walk]'; -èµ³>'[grand]'; -èµ´>'[go to]'; -èµ·>'[rise]'; -è¶>'[take advantage of]'; -超>'[jump over]'; -越>'[exceed]'; -趙>'[surname]'; -趣>'[what attracts one''s attention]'; -趨>'[hasten]'; -足>'[foot]'; -趺>'[sit cross-legged]'; -趾>'[toe]'; -è·‚>'[creeping]'; -è·‹>'[go by foot]'; -è·Œ>'[stumble]'; -è·>'[sit cross-legged]'; -è·–>'[sole (of the foot)]'; -è·š>'[stagger]'; -è·›>'[lame]'; -è·>'[distance]'; -è·Ÿ>'[heel]'; -è·¡>'[search]'; -è·£>'[bare footed]'; -è·¨>'[straddle]'; -è·ª>'[kneel]'; -è·«>'[sound of footsteps]'; -è·¯>'[road]'; -è·³>'[jump]'; -è·µ>'[trample]'; -è·¼>'[bent]'; -#"è·¿>'[................................]'", -踈>'[neglect]'; -踉>'[hop]'; -踊>'[leap]'; -è¸>'[step on]'; -è¸>'[trample]'; -è¸>'[ankle]'; -踞>'[crouch]'; -踟>'[hesitate]'; -踪>'[footprints]'; -踰>'[exceed]'; -踴>'[leap]'; -踵>'[heel]'; -蹂>'[trample under foot]'; -蹄>'[hoof]'; -蹇>'[lame]'; -蹈>'[stamp feet]'; -蹉>'[error]'; -蹊>'[footpath]'; -蹌>'[walk rapidly]'; -è¹>'[take short steps]'; -蹕>'[clear way]'; -è¹™>'[urgent]'; -蹟>'[trace]'; -è¹ >'[step on]'; -è¹£>'[to jump over]'; -蹤>'[footprints]'; -è¹²>'[squat]'; -è¹´>'[kick]'; -蹶>'[stumble]'; -è¹¼>'[webbed feet of waterfowl]'; -èº>'[tense]'; -躄>'[cripple]'; -躅>'[walk carefully]'; -躇>'[hesitate]'; -躊>'[hesitate]'; -躋>'[ascend]'; -èº>'[skip]'; -躑>'[waver]'; -躓>'[stumble]'; -躔>'[follow in]'; -躙>'[trample down]'; -躡>'[tread]'; -躪>'[trample down]'; -身>'[body]'; -躬>'[body]'; -躯>'[body]'; -躰>'[body]'; -躱>'[hide]'; -#"躺>'[lie down]'", -#"軄>'[to govern]'", -軆>'[body]'; -#"軆>'[body]'", -車>'[cart]'; -軋>'[crush by weight]'; -軌>'[track]'; -è»>'[army]'; -è»’>'[carriage]'; -è»›>'[yoke]'; -軟>'[soft]'; -転>'[shift]'; -軣>'[rumble]'; -軫>'[cross board at rear of carriage]'; -軸>'[axle]'; -è»»>'[axle]'; -軼>'[rush forth]'; -軽>'[light]'; -軾>'[horizontal wooden bar in front of a sedan chair]'; -較>'[compare]'; -è¼…>'[chariot]'; -載>'[load]'; -輊>'[low rear portion of cart]'; -輌>'[numerary adjunct for vehicles]'; -è¼’>'[sides of chariot where weapons]'; -輓>'[mourn]'; -è¼”>'[cheek bone]'; -輕>'[light]'; -è¼™>'[sides of chariot were weapons]'; -è¼›>'[numerary adjunct for vehicles]'; -輜>'[supply cart]'; -è¼>'[brightness]'; -輟>'[stop]'; -輦>'[hand-cart]'; -輩>'[generation]'; -輪>'[wheel]'; -輯>'[gather up]'; -è¼³>'[hubs of wheel]'; -輸>'[transport]'; -è¼¹>'[two pieces of wood underneath ca]'; -è¼»>'[spokes of wheel]'; -è¼¾>'[turn over]'; -輿>'[cart]'; -轂>'[hub of wheel]'; -轄>'[linchpin of wheel]'; -è½…>'[axle]'; -轆>'[windlass]'; -轉>'[shift]'; -轌>'[sled]'; -è½>'[wagon ruts]'; -轎>'[sedan-chair]'; -è½—>'[fail]'; -轜>'[hearse]'; -轟>'[rumble]'; -轡>'[bridle of horse]'; -è½¢>'[run over something with vehicle]'; -#"è½£>'[................................]'", -轤>'[pulley]'; -è¾›>'[bitter]'; -辜>'[crime]'; -辞>'[words]'; -辟>'[law]'; -è¾£>'[peppery]'; -辧>'[manage]'; -辨>'[distinguish]'; -è¾­>'[words]'; -è¾®>'[braid]'; -辯>'[dispute]'; -è¾°>'[early morning]'; -è¾±>'[humiliate]'; -è¾²>'[agriculture]'; -è¾·>'[smooth]'; -辺>'[edge]'; -è¾»>'[crossroads]'; -è¾¼>'[crowd into]'; -辿>'[follow]'; -è¿‚>'[doctrinaire]'; -è¿„>'[extend]'; -è¿…>'[quick]'; -è¿Ž>'[receive]'; -è¿‘>'[near]'; -è¿”>'[return]'; -è¿š>'[very]'; -è¿¢>'[far]'; -è¿¥>'[distant]'; -迦>'[character for transliteration]'; -è¿©>'[be near]'; -迪>'[enlighten]'; -è¿«>'[coerce]'; -è¿­>'[repeatedly]'; -迯>'[escape]'; -è¿°>'[narrate]'; -è¿´>'[revolve]'; -è¿·>'[bewitch]'; -迸>'[gush out]'; -迹>'[traces]'; -迺>'[then]'; -追>'[pursue]'; -退>'[step back]'; -é€>'[see off]'; -逃>'[escape]'; -逅>'[meet unexpectedly]'; -逆>'[disobey]'; -逋>'[flee]'; -é€>'[ramble]'; -逎>'[strong]'; -é€>'[penetrate]'; -é€>'[chase]'; -逑>'[collect]'; -逓>'[hand over]'; -途>'[way]'; -逕>'[pass by]'; -逖>'[far]'; -逗>'[tempt]'; -這>'[this]'; -通>'[pass through]'; -é€>'[pass away]'; -逞>'[indulge oneself]'; -速>'[quick]'; -造>'[construct]'; -逡>'[retreat]'; -逢>'[come upon]'; -連>'[join]'; -#"逦>'[meandering]'", -逮>'[seize]'; -週>'[week]'; -進>'[advance]'; -逵>'[thoroughfare]'; -逶>'[winding]'; -逸>'[flee]'; -逹>'[arrive at]'; -逼>'[compel]'; -逾>'[go over]'; -é>'[hide]'; -é‚>'[comply with]'; -é…>'[late]'; -é‡>'[meet]'; -é‰>'[spy]'; -éŠ>'[wander]'; -é‹>'[luck]'; -é>'[everywhere]'; -éŽ>'[pass]'; -é>'[stop]'; -é>'[afar]'; -é‘>'[leisure]'; -é’>'[strong]'; -é“>'[path]'; -é”>'[arrive at]'; -é•>'[disobey]'; -#"é•>'[disobey]'", -é˜>'[to meet]'; -é™>'[far away]'; -éœ>'[humble]'; -éž>'[hand over]'; -é >'[distant]'; -é¡>'[go upstream]'; -é£>'[send]'; -é¥>'[far away]'; -é¨>'[ramble]'; -é©>'[match]'; -é­>'[come across]'; -é®>'[cover]'; -é¯>'[deceive]'; -é²>'[late]'; -éµ>'[obey]'; -é¶>'[entwine]'; -é·>'[move]'; -é¸>'[choose]'; -éº>'[lose]'; -é¼>'[distant]'; -é½>'[suddenly]'; -é¿>'[avoid]'; -é‚€>'[invite]'; -é‚>'[take a big stride]'; -é‚‚>'[unexpected meeting]'; -邃>'[profound]'; -é‚„>'[still]'; -邇>'[be near]'; -邉>'[edge]'; -é‚Š>'[edge]'; -é‚>'[patrol]'; -é‚‘>'[area]'; -é‚£>'[that]'; -邦>'[nation]'; -邨>'[village]'; -邪>'[wrong]'; -邯>'[city in hebei province]'; -邱>'[surname]'; -邵>'[surname]'; -邸>'[official residence]'; -éƒ>'[sweet smelling]'; -郊>'[suburbs]'; -郎>'[gentleman]'; -郛>'[outer walls of city]'; -郡>'[administrative division]'; -郢>'[state in today''s hubei province]'; -郤>'[crack]'; -部>'[part]'; -郭>'[outer part (of a city)]'; -郵>'[postal]'; -郷>'[country]'; -都>'[metropolis]'; -é„‚>'[hubei province]'; -é„’>'[name of an ancient state]'; -é„™>'[mean]'; -é„­>'[state in today''s henan]'; -é„°>'[neighbor]'; -鄲>'[county in hebei proincev]'; -é…‰>'[tenth in series of twelve cyclic]'; -é…Š>'[drunk]'; -é…‹>'[chief of tribe]'; -é…Œ>'[serve wine]'; -é…>'[match]'; -é…Ž>'[double-fermented wine]'; -é…’>'[wine]'; -é…”>'[intoxicated]'; -é…–>'[wine with bird poison added]'; -#"é…˜>'[................................]'", -é…¢>'[toast one''s host with wine]'; -é…£>'[enjoy intoxicants]'; -é…¥>'[butter]'; -é…©>'[drunk]'; -é…ª>'[cream]'; -é…¬>'[toast]'; -é…²>'[hangover]'; -#"é…²>'[hangover]'", -é…µ>'[yeast]'; -é…·>'[strong]'; -é…¸>'[tart]'; -#"é†>'[a kind of green-colored wine]'", -醇>'[rich]'; -醉>'[intoxicated]'; -醋>'[vinegar]'; -é†>'[essential oil of butter]'; -é†>'[purest cream]'; -醒>'[wake up]'; -醗>'[to brew for the second time]'; -醜>'[ugly looking]'; -醢>'[minced pickled meat]'; -醤>'[any jam-like or paste-like food]'; -醪>'[unclear wine]'; -醫>'[cure]'; -醯>'[vinegar]'; -醴>'[sweet wine]'; -醵>'[contribute for drinks]'; -醸>'[brew]'; -醺>'[get drunk]'; -釀>'[brew]'; -é‡>'[smear with blood in sacrifice]'; -釆>'[distinguish]'; -采>'[collect]'; -釈>'[interprete]'; -釉>'[glaze]'; -釋>'[interprete]'; -里>'[unit of distance]'; -é‡>'[heavy]'; -野>'[open country]'; -é‡>'[measure]'; -é‡>'[manage]'; -金>'[gold]'; -釖>'[knife]'; -釘>'[nail]'; -#"釛>'[................................]'", -釜>'[cauldron]'; -é‡>'[needle]'; -#"釟>'[................................]'", -釡>'[cauldron]'; -釣>'[fish]'; -釦>'[button]'; -釧>'[bracelet]'; -釵>'[ornamental hairpin]'; -#"釶>'[................................]'", -釼>'[sword]'; -#"釿>'[................................]'", -éˆ>'[blunt]'; -鈎>'[hook]'; -鈑>'[plate]'; -鈔>'[paper money]'; -鈕>'[button]'; -鈞>'[unit of measure equivalent thirt]'; -鈩>'[fireplace]'; -鈬>'[bell]'; -鈴>'[bell]'; -鈷>'[cobalt]'; -鈿>'[hairpin]'; -鉄>'[iron]'; -鉅>'[steel]'; -鉈>'[thallium]'; -鉉>'[device for carrying a tripod]'; -鉋>'[carpenter''s plane]'; -#"é‰>'[................................]'", -鉗>'[pincers]'; -鉚>'[rivet]'; -鉛>'[lead plumbum]'; -鉞>'[broad-axe]'; -鉢>'[earthenware basin]'; -鉤>'[hook]'; -鉦>'[kind of gong used in ancient tim]'; -鉱>'[mine]'; -鉾>'[spear]'; -銀>'[silver]'; -銃>'[ancient weapon]'; -銅>'[copper]'; -銑>'[mill]'; -銓>'[weigh]'; -銕>'[iron]'; -銖>'[unit of weight]'; -銘>'[inscribe]'; -銚>'[large hoe]'; -銛>'[sharp]'; -銜>'[bit]'; -銭>'[money]'; -銷>'[melt]'; -銹>'[rust]'; -é‹>'[tongs]'; -é‹’>'[point of spear]'; -鋤>'[hoe]'; -é‹©>'[point of sword]'; -鋪>'[spread out]'; -é‹­>'[sharp]'; -鋲>'[rivet]'; -鋳>'[melt]'; -鋸>'[a saw]'; -#"鋺>'[................................]'", -鋼>'[steel]'; -錆>'[the color of a mineral]'; -éŒ>'[soft steel]'; -éŒ>'[gimlet]'; -錘>'[balance weight on scale]'; -錙>'[8 oz]'; -錚>'[clanging sound]'; -錠>'[spindle]'; -錢>'[money]'; -#"錣>'[................................]'", -錦>'[brocade]'; -錨>'[anchor]'; -錫>'[tin]'; -錬>'[smelt metals]'; -錮>'[run metal into cracks]'; -錯>'[error]'; -録>'[copy]'; -#"錵>'[................................]'", -#"錺>'[................................]'", -#"錻>'[................................]'", -#"é„>'[................................]'", -é‹>'[cooking-pot]'; -é>'[plate]'; -é”>'[high]'; -#"é–>'[................................]'", -é›>'[forge metal]'; -#"éœ>'[................................]'", -é >'[weapon]'; -é¬>'[shovel]'; -é®>'[brass]'; -éµ>'[door bolt]'; -é¼>'[needle]'; -é¾>'[cup]'; -鎌>'[sickle]'; -鎔>'[fuse]'; -鎖>'[lock]'; -鎗>'[rifle]'; -鎚>'[hammer]'; -鎧>'[armor]'; -鎬>'[stove]'; -鎭>'[town]'; -鎮>'[town]'; -鎰>'[measure of weight for gold]'; -#"鎹>'[................................]'", -éƒ>'[arrowhead]'; -éˆ>'[chain]'; -é>'[pure gold]'; -é‘>'[dysprosium the barb of an arrow]'; -é–>'[fight end]'; -é—>'[strike]'; -é˜>'[tinkle]'; -é>'[trowel]'; -é¡>'[mirror]'; -é¤>'[carve]'; -é¥>'[rust]'; -é¨>'[engraving tool]'; -éƒ>'[cymbals]'; -é‡>'[vanadium]'; -é>'[fetters]'; -é“>'[ferrule]'; -é”>'[dagger]'; -é˜>'[clock]'; -é™>'[lamp]'; -éš>'[soft steel]'; -é¡>'[iron]'; -é«>'[engraving tool]'; -éµ>'[iron]'; -é¶>'[metal ring]'; -é¸>'[bell]'; -éº>'[frying pan]'; -#"é‘>'[................................]'", -é‘„>'[melt]'; -é‘‘>'[mirror]'; -é‘’>'[mirror]'; -é‘“>'[spear]'; -é‘š>'[drill]'; -é‘›>'[mine]'; -é‘ž>'[solder]'; -é‘ >'[melt]'; -é‘¢>'[file]'; -鑪>'[fireplace]'; -é‘°>'[key]'; -鑵>'[jar]'; -é‘·>'[tweezers]'; -鑼>'[gong]'; -鑽>'[drill]'; -鑾>'[bells hung on horse]'; -é‘¿>'[chisel]'; -é’>'[a mattock]'; -é•·>'[long]'; -é–€>'[gate]'; -é–‚>'[bolt]'; -é–ƒ>'[flash]'; -é–‡>'[shut]'; -é–‰>'[shut]'; -#"é–‰>'[shut]'", -é–‹>'[open]'; -é–>'[intercalary]'; -é–‘>'[fence]'; -é–“>'[interval]'; -é–”>'[mourn]'; -#"é–”>'[mourn]'", -é–˜>'[sluice]'; -é–™>'[quarrel]'; -é– >'[intercalary]'; -é–¢>'[frontier pass]'; -é–£>'[chamber]'; -é–¤>'[small side door]'; -é–¥>'[powerful and influential group]'; -é–§>'[boisterous]'; -é–¨>'[small entrance]'; -é–­>'[village of twenty-five families]'; -é–²>'[examine]'; -é–¹>'[castrate]'; -é–»>'[village gate]'; -é–¼>'[block]'; -é–¾>'[threshold]'; -é—ƒ>'[alone]'; -é—‡>'[close]'; -é—Š>'[broad]'; -é—Œ>'[door screen]'; -é—>'[tower over city gate]'; -é—”>'[close]'; -é—•>'[watch tower]'; -é—–>'[rush in]'; -é—˜>'[struggle]'; -é—œ>'[frontier pass]'; -é—¡>'[explain]'; -é—¢>'[open]'; -é—¥>'[door]'; -阜>'[mound]'; -阡>'[footpaths between fields]'; -阨>'[in distress]'; -阪>'[hillside farmland]'; -阮>'[ancient musical instrument: surname]'; -阯>'[foundation]'; -防>'[defend]'; -阻>'[impede]'; -阿>'[prefix to name]'; -陀>'[steep bank]'; -陂>'[dam]'; -附>'[adhere to]'; -陋>'[narrow]'; -陌>'[foot path between rice fields]'; -é™>'[descend]'; -#"é™>'[descend]'", -é™>'[boundary]'; -é™›>'[steps leading throne]'; -陜>'[narrow]'; -é™>'[mountain pass]'; -陞>'[promote]'; -陟>'[climb]'; -院>'[courtyard]'; -陣>'[column]'; -除>'[eliminate]'; -陥>'[submerge]'; -#"陥>'[submerge]'", -陪>'[accompany]'; -陬>'[corner]'; -é™°>'[\"female\" principle]'; -陲>'[frontier]'; -陳>'[exhibit]'; -陵>'[hill]'; -陶>'[pottery]'; -é™·>'[submerge]'; -陸>'[land]'; -険>'[narrow pass]'; -陽>'[\"male\" principle]'; -éš…>'[corner]'; -隆>'[prosperous]'; -隈>'[cove]'; -隊>'[team]'; -éš‹>'[Sui dynasty]'; -éš>'[dry ditch]'; -階>'[stairs]'; -éš>'[follow]'; -éš”>'[separate]'; -éš•>'[fall]'; -éš—>'[high]'; -隘>'[narrow]'; -éš™>'[crack]'; -éš›>'[border]'; -éšœ>'[separate]'; -#"éšœ>'[separate]'", -隣>'[neighbor]'; -隧>'[tunnel]'; -隨>'[follow]'; -險>'[narrow pass]'; -éš°>'[low]'; -éš±>'[hide]'; -éš²>'[stallion]'; -éš´>'[mountain located between shaanxi]'; -隶>'[subservient]'; -éš·>'[be subservient to]'; -隸>'[be subservient to]'; -éš¹>'[bird]'; -éš»>'[single]'; -éš¼>'[aquiline (nose)]'; -雀>'[sparrow]'; -é›>'[wild goose]'; -雄>'[male of species]'; -é›…>'[elegant]'; -集>'[assemble]'; -雇>'[employ]'; -雉>'[pheasant]'; -雋>'[superior]'; -雌>'[female]'; -é›>'[harmony]'; -雎>'[osprey]'; -雑>'[mixed]'; -雕>'[engrave]'; -é›–>'[although]'; -é›™>'[set of two]'; -é››>'[chick]'; -雜>'[mixed]'; -離>'[leave]'; -難>'[difficult]'; -雨>'[rain]'; -雪>'[snow]'; -#"雫>'[................................]'", -é›°>'[atmosphere]'; -雲>'[clouds]'; -零>'[zero]'; -é›·>'[thunder]'; -雹>'[hail]'; -é›»>'[electricity]'; -需>'[need]'; -霄>'[sky]'; -霆>'[a sudden peal of thunder]'; -震>'[shake]'; -霈>'[torrential rains]'; -霊>'[spirit]'; -éœ>'[quickly]'; -霎>'[light rain]'; -éœ>'[falling of snow and rain]'; -霑>'[be moistened]'; -霓>'[rainbow]'; -霖>'[long spell of rain]'; -霙>'[sleet]'; -霜>'[frost]'; -霞>'[rosy clouds]'; -霤>'[drip]'; -霧>'[fog]'; -霪>'[long and heavy rain]'; -霰>'[hail]'; -露>'[dew]'; -霸>'[rule by might rather than right]'; -霹>'[thunder]'; -霽>'[clear up after rain cease be ang]'; -霾>'[misty]'; -é‚>'[thunderclap]'; -é„>'[cloudy sky]'; -é†>'[cloudy sky]'; -éˆ>'[spirit]'; -é‰>'[cloudy sky]'; -é’>'[blue]'; -é–>'[pacify]'; -é™>'[quiet]'; -éœ>'[quiet]'; -éž>'[not]'; -é >'[lean on]'; -é¡>'[divide]'; -é¢>'[face]'; -#"é¤>'[................................]'", -é¦>'[timid]'; -é¨>'[dimples]'; -é©>'[leather]'; -é«>'[strong and pliable]'; -é­>'[strong and pliable]'; -é±>'[strong and pliable]'; -é´>'[boots]'; -#"é¹>'[................................]'", -éº>'[stocking]'; -é¼>'[tartars]'; -#"éž>'[................................]'", -éž„>'[to work hides]'; -éž…>'[leather strap over horse''s neck]'; -#"éž…>'[leather strap over horse''s neck]'", -éž‹>'[shoes]'; -éž>'[saddle]'; -éž>'[bind]'; -#"éž>'[bind]'", -鞘>'[scabbard]'; -#"éžœ>'[................................]'", -éž >'[bow]'; -鞣>'[tan]'; -鞦>'[leather stap]'; -鞨>'[tribe]'; -éž«>'[interrogate]'; -éž­>'[whip]'; -#"éž³>'[................................]'", -éž´>'[saddle up horse]'; -韃>'[tatars]'; -韆>'[swing]'; -韈>'[socks]'; -韋>'[tanned leather]'; -韓>'[fence]'; -韜>'[sheath]'; -韭>'[scallion]'; -韮>'[scallion]'; -韲>'[break or smash into pieces]'; -音>'[sound]'; -韵>'[rhyme]'; -韶>'[music of emperor Shun]'; -韻>'[rhyme]'; -響>'[make sound]'; -é >'[page]'; -é ‚>'[top]'; -é ƒ>'[moment]'; -é …>'[neck]'; -é †>'[obey]'; -é ˆ>'[must]'; -é Œ>'[laud]'; -é >'[fly down or downward]'; -é >'[prepare]'; -é ‘>'[obstinate]'; -é ’>'[confer]'; -é “>'[pause]'; -é —>'[lean one side]'; -é ˜>'[neck]'; -é š>'[neck]'; -é ¡>'[fly upward]'; -é ¤>'[cheeks]'; -é ¬>'[cheeks]'; -é ­>'[head]'; -é ´>'[rice tassel]'; -é ·>'[chin]'; -é ¸>'[neck]'; -é »>'[frequently]'; -é ¼>'[rely]'; -é ½>'[ruined]'; -顆>'[grain]'; -é¡‹>'[lower part of face]'; -é¡Œ>'[forehead]'; -é¡>'[forehead]'; -é¡Ž>'[jaw]'; -é¡>'[face]'; -é¡”>'[face]'; -é¡•>'[manifest]'; -願>'[desire]'; -é¡›>'[top]'; -é¡ž>'[class]'; -顧>'[look back]'; -é¡«>'[shiver]'; -顯>'[manifest]'; -é¡°>'[frown]'; -顱>'[skull]'; -顳>'[the temporal bone]'; -é¡´>'[cheek bones]'; -風>'[wind]'; -#"風>'[wind]'", -颯>'[sound of wind]'; -颱>'[taiphoon]'; -颶>'[cyclone]'; -飃>'[whirlwind]'; -飄>'[whirlwind]'; -飆>'[whirlwind]'; -飛>'[fly]'; -飜>'[flip over]'; -食>'[eat]'; -飢>'[hunger]'; -飩>'[stuffed dumplings]'; -飫>'[surfeited]'; -飭>'[order]'; -飮>'[drink]'; -飯>'[cooked rice]'; -飲>'[drink]'; -飴>'[sweet-meats]'; -飼>'[raise animals]'; -飽>'[eat heartily]'; -飾>'[decorate]'; -餃>'[stuffed dumplings]'; -餅>'[rice-cakes]'; -餉>'[rations and pay for soldiers]'; -養>'[raise]'; -餌>'[bait]'; -é¤>'[eat]'; -餒>'[hungry]'; -餓>'[be hungry]'; -餔>'[eat]'; -餘>'[surplus]'; -#"é¤>'[................................]'", -餞>'[farewell party]'; -餠>'[rice-cakes]'; -餡>'[pastry filling]'; -餤>'[incite]'; -館>'[public building]'; -餬>'[porridge]'; -餮>'[a legendary animal]'; -餽>'[make present of food]'; -餾>'[distill]'; -#"é¥>'[carry meal to workers in field]'", -饅>'[steamed bread]'; -饉>'[time of famine or crop failure]'; -饋>'[offer food superior]'; -饌>'[feed]'; -é¥>'[spoiled]'; -饑>'[starve]'; -饒>'[bountiful]'; -饕>'[gluttonous]'; -饗>'[host banquet]'; -首>'[head]'; -馗>'[cheekbone]'; -馘>'[cut off left ear]'; -香>'[fragrant]'; -馥>'[fragrance]'; -馨>'[fragrant]'; -馬>'[horse]'; -馭>'[drive]'; -馮>'[surname]'; -馳>'[go quickly or swiftly]'; -馴>'[tame]'; -#"馼>'[................................]'", -é§>'[varicolored]'; -#"駃>'[gallop]'", -駅>'[relay station]'; -駆>'[spur horse on]'; -駈>'[spur horse on]'; -é§>'[to be stationed at]'; -駑>'[tired]'; -駒>'[colt]'; -駕>'[drive]'; -駘>'[tired]'; -駛>'[sail]'; -é§>'[camel]'; -駟>'[team of four horses]'; -駢>'[team of horses]'; -駭>'[terrify]'; -駮>'[a kind of fierce animal]'; -駱>'[white horse w. black mane]'; -#"駱>'[white horse w. black mane]'", -駸>'[galloping]'; -#"駻>'[................................]'", -駿>'[excellent horse]'; -é¨>'[gallop horse]'; -騅>'[piebald horse]'; -騎>'[ride horseback]'; -é¨>'[piebald horse]'; -騒>'[harass]'; -験>'[test]'; -騙>'[swindle]'; -騨>'[dappled]'; -騫>'[raise]'; -騰>'[fly]'; -騷>'[harass]'; -騾>'[mule]'; -é©€>'[suddenly]'; -é©‚>'[two outside ones in three horse]'; -驃>'[charger]'; -é©…>'[spur horse on]'; -é©>'[excellent horse]'; -é©•>'[spirited horse]'; -é©—>'[test]'; -é©š>'[frighten]'; -é©›>'[relay station]'; -é©Ÿ>'[procedure]'; -é©¢>'[donkey]'; -驤>'[gallop about with head uplifted]'; -é©¥>'[thoroughbred horse]'; -é©©>'[happy]'; -驪>'[pure black horse]'; -é©«>'[horses]'; -骨>'[bone]'; -骭>'[shin bone]'; -骰>'[die]'; -骸>'[skelton]'; -骼>'[bone]'; -é«€>'[buttocks]'; -é«„>'[bone marrow]'; -é«>'[skull]'; -é«‘>'[skull]'; -é«“>'[bone marrow]'; -é«”>'[body]'; -高>'[high]'; -é«ž>'[high]'; -é«Ÿ>'[hair]'; -é«¢>'[wig]'; -é«£>'[similar to]'; -髦>'[flowing hair of young child]'; -髪>'[hair]'; -é««>'[children''s hair style]'; -é«­>'[mustache]'; -é«®>'[hair]'; -髯>'[beard]'; -#"髱>'[................................]'", -é«´>'[disheveled hair]'; -#"é«·>'[................................]'", -é«»>'[hair rolled up in a bun]'; -鬆>'[lax]'; -鬘>'[beautiful hair]'; -鬚>'[beard]'; -鬟>'[dress hair in coiled knot]'; -鬢>'[hair on temples]'; -鬣>'[horse''s mane]'; -鬥>'[struggle]'; -鬧>'[quarrel]'; -鬨>'[boisterous]'; -鬩>'[feud]'; -鬪>'[struggle]'; -鬮>'[lots (to be drawn)]'; -鬯>'[sacrificial wine]'; -鬱>'[luxuriant]'; -鬲>'[type of caldron]'; -鬻>'[sell]'; -鬼>'[ghost]'; -é­>'[chief]'; -é­‚>'[soul]'; -é­ƒ>'[drought demon]'; -é­„>'[vigor]'; -é­…>'[kind of forest demon]'; -é­>'[demons]'; -é­Ž>'[a kind of monster]'; -é­>'[kingdom of wei]'; -é­‘>'[a montain demon resembling tiger]'; -é­”>'[demon]'; -é­˜>'[nightmare]'; -é­š>'[fish]'; -é­¯>'[foolish]'; -é­´>'[bream]'; -#"é®>'[the bonito]'", -鮎>'[sheatfish]'; -鮑>'[abalone]'; -é®’>'[carp]'; -鮓>'[minced and salted fish]'; -#"鮓>'[minced and salted fish]'", -#"鮓>'[minced and salted fish]'", -鮟>'[anglerfish]'; -é® >'[a kind of shad with a head like a sturgeon]'; -#"鮨>'[................................]'", -鮪>'[kind of sturgeon]'; -鮫>'[shark]'; -é®­>'[salmon]'; -é®®>'[fresh]'; -#"é®´>'[................................]'", -#"鮹>'[................................]'", -鯀>'[giant fish]'; -鯆>'[the skate or ray]'; -鯉>'[carp]'; -鯊>'[shark]'; -é¯>'[a dialect........ name of fish]'; -#"鯑>'[................................]'", -#"鯒>'[................................]'", -鯔>'[mullet]'; -鯖>'[mackerel]'; -鯛>'[pagrosomus major]'; -鯡>'[herring]'; -鯢>'[cryptobranchus japonicus]'; -#"鯣>'[................................]'", -鯤>'[spawn]'; -鯨>'[whale]'; -鯰>'[sheat]'; -#"鯱>'[................................]'", -#"鯱>'[................................]'", -#"鯱>'[................................]'", -#"é°„>'[................................]'", -#"é°†>'[................................]'", -é°ˆ>'[flatfish]'; -é°‰>'[sturgeon]'; -#"é°Š>'[................................]'", -é°Œ>'[loach]'; -é°>'[loach]'; -é°>'[alligator]'; -é°’>'[abalone]'; -é°“>'[fish gills]'; -#"é°”>'[................................]'", -é°•>'[shrimp]'; -é°›>'[sardine]'; -#"é°¡>'[................................]'", -#"é°¤>'[................................]'", -é°¥>'[huge fish]'; -é°­>'[fin]'; -é°®>'[sardine]'; -#"é°¯>'[................................]'", -#"é°¯>'[................................]'", -é°²>'[huge sea turtle]'; -é°¹>'[skipjack]'; -#"é°º>'[................................]'", -é°»>'[eel]'; -é°¾>'[swimming bladder of fish]'; -#"鱆>'[................................]'", -鱇>'[anglerfish]'; -鱈>'[codfish]'; -é±’>'[barbel]'; -é±—>'[fish scales]'; -#"鱘>'[sturgeon]'", -é± >'[minced fish]'; -鱧>'[snakehead]'; -#"鱶>'[................................]'", -鱸>'[sea perch]'; -é³¥>'[bird]'; -鳧>'[wild duck]'; -鳩>'[pigeon]'; -鳫>'[wild goose]'; -鳬>'[wild duck]'; -#"é³°>'[................................]'", -é³³>'[male phoenix]'; -é³´>'[cry of bird or animal]'; -鳶>'[kite]'; -é´ƒ>'[shrike]'; -é´†>'[bird resembling secretary falcon]'; -é´‡>'[bustard]'; -é´ˆ>'[wild goose]'; -é´‰>'[crow]'; -é´Ž>'[seagull]'; -é´’>'[species of lark]'; -é´•>'[ostrich]'; -é´›>'[male mandarin duck]'; -é´Ÿ>'[kite]'; -é´£>'[species of taiwan pigeon]'; -é´¦>'[female mandarin duck]'; -é´¨>'[duck]'; -é´ª>'[swoop]'; -é´«>'[a snipe]'; -é´¬>'[oriole]'; -é´»>'[species of wild swan]'; -#"é´¾>'[................................]'", -é´¿>'[pigeon]'; -#"éµ>'[................................]'", -鵄>'[kite]'; -#"鵄>'[kite]'", -#"鵄>'[kite]'", -#"éµ>'[................................]'", -鵑>'[cuckoo]'; -éµ™>'[a shrike]'; -鵜>'[pelican]'; -éµ>'[goose]'; -鵞>'[goose]'; -éµ >'[target]'; -鵡>'[species of parrot]'; -#"鵡>'[species of parrot]'", -鵬>'[fabulous bird of enormous size]'; -鵯>'[bird]'; -éµ²>'[magpie]'; -#"鵺>'[................................]'", -鶇>'[thrush]'; -鶉>'[quail]'; -é¶>'[chicken]'; -鶚>'[osprey]'; -#"鶤>'[................................]'", -鶩>'[duck]'; -鶫>'[thrush]'; -鶯>'[oriole]'; -#"鶱>'[soar]'", -鶴>'[crane]'; -鶸>'[[not found in any dictionary]]'; -鶺>'[wagtail]'; -鶻>'[a kind of pigeon]'; -é·>'[fishhawk bow or prow]'; -é·‚>'[sparrow hawk]'; -é·„>'[chicken]'; -é·†>'[bird name]'; -é·>'[bird name]'; -é·“>'[partridge]'; -é·™>'[hawk]'; -é·¦>'[wren]'; -#"é·«>'[turquoise kingfisher]'", -é·¯>'[wren]'; -é·²>'[condor]'; -é·¸>'[snipe]'; -é·¹>'[eagle]'; -é·º>'[heron]'; -é·½>'[oriental bullfinch]'; -鸚>'[species of parrot]'; -鸛>'[crane]'; -鸞>'[fabulous bird]'; -é¹µ>'[saline soil]'; -鹸>'[alkaline]'; -é¹¹>'[salty]'; -é¹½>'[salt]'; -鹿>'[deer]'; -éº>'[rough]'; -麈>'[species of deer]'; -麋>'[elk]'; -麌>'[stag]'; -麑>'[fawn]'; -麒>'[legendary auspicious animal]'; -麓>'[foot of hill]'; -麕>'[muntjac deer]'; -麗>'[beautiful]'; -éº>'[musk deer]'; -麟>'[female of chinese unicorn]'; -麥>'[wheat]'; -麦>'[wheat]'; -麩>'[bran]'; -麪>'[flour]'; -#"麫>'[flour]'", -麸>'[bran]'; -麹>'[yeast]'; -麺>'[flour]'; -麻>'[hemp]'; -麼>'[interrogative final particle]'; -麾>'[pennant]'; -麿>'[I]'; -黄>'[yellow]'; -黌>'[school]'; -é»>'[glutinous millet]'; -黎>'[surname]'; -é»>'[stick to]'; -é»>'[stick]'; -é»’>'[black]'; -é»”>'[black]'; -默>'[silent]'; -é»™>'[silent]'; -é»›>'[blacken eyebrows]'; -黜>'[dismiss]'; -é»>'[black]'; -點>'[dot]'; -é» >'[sly]'; -黥>'[tattooing face]'; -黨>'[political party]'; -黯>'[dark]'; -é»´>'[mold]'; -黶>'[mole]'; -é»·>'[dishonor]'; -黹>'[embroidery]'; -é»»>'[special pattern of embroidery]'; -黼>'[embroidered official or sacrific]'; -黽>'[to strive]'; -鼇>'[huge sea turtle]'; -鼈>'[fresh water turtle]'; -鼎>'[large]'; -鼓>'[drum]'; -鼕>'[rattle of drums]'; -é¼ >'[rat]'; -鼡>'[rat]'; -鼬>'[weasel]'; -é¼»>'[nose]'; -é¼¾>'[snore loudly]'; -齊>'[even]'; -齋>'[vegetarian diet]'; -齎>'[take in both hands and offer to]'; -é½>'[break or smash into pieces]'; -é½’>'[teeth]'; -é½”>'[lose baby teeth and get adult te]'; -齟>'[irregular teeth]'; -é½ >'[lose baby teeth and get adult teeth]'; -齡>'[age]'; -é½¢>'[age]'; -é½£>'[act]'; -齦>'[gums]'; -齧>'[bite]'; -齪>'[narrow]'; -齬>'[uneven teeth]'; -é½²>'[tooth decay]'; -齶>'[palate]'; -é½·>'[narrow]'; -é¾>'[dragon]'; -龕>'[niche]'; -龜>'[turtle or tortoise]'; -é¾>'[autumn]'; -é¾ >'[flute]'; - -# eof diff --git a/icu4j/src/com/ibm/demo/translit/resources/Transliterator_Kanji_OnRomaji.txt b/icu4j/src/com/ibm/demo/translit/resources/Transliterator_Kanji_OnRomaji.txt deleted file mode 100755 index 7435913f8f..0000000000 --- a/icu4j/src/com/ibm/demo/translit/resources/Transliterator_Kanji_OnRomaji.txt +++ /dev/null @@ -1,6216 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:42:03 2001 -#-------------------------------------------------------------------- - -# Kanji-OnRomaji - -ä¸>Tei; -七>Shichi; -万>Man; -丈>Jou; -三>San; -上>Jou; -下>Ka; -ä¸>Fu; -与>Yo; -ä¸>Kai; -丑>Chuu; -且>Sha; -丕>Hi; -世>Se; -丗>Sei; -丘>Kyuu; -丙>Hei; -丞>Shou; -両>Ryou; -並>Hei; -个>Ka; -中>Chuu; -丱>Kan; -串>Sen; -丶>Chu; -丸>Gan; -丹>Tan; -主>Shu; -丼>Sei; -丿>Hetsu; -乂>Gai; -乃>Dai; -ä¹…>Kyuu; -之>Shi; -ä¹>Saku; -乎>Ko; -ä¹>Bou; -乕>Ko; -ä¹–>Kai; -ä¹—>Jou; -乘>Jou; -ä¹™>Otsu; -ä¹>Kyuu; -乞>Kotsu; -也>Ya; -ä¹¢>Gai; -ä¹±>Ran; -ä¹³>Nyuu; -ä¹¾>Kan; -亀>Ki; -亂>Ran; -亅>Ketsu; -了>Ryou; -予>Yo; -争>Sou; -亊>Ji; -事>Ji; -二>Ni; -于>U; -云>Un; -互>Go; -五>Go; -井>Sei; -亘>Sen; -亙>Kou; -些>Sa; -亜>A; -亞>A; -亟>Kyoku; -亠>Tou; -亡>Bou; -亢>Kou; -交>Kou; -亥>Gai; -亦>Eki; -亨>Kyou; -享>Kyou; -京>Kyou; -亭>Tei; -亮>Ryou; -亰>Kei; -亳>Haku; -亶>Tan; -人>Jin; -什>Shuu; -ä»>Jin; -仂>Roku; -仄>Soku; -仆>Fu; -仇>Kyuu; -今>Kon; -介>Kai; -ä»>Jou; -从>Juu; -ä»>Butsu; -ä»”>Shi; -仕>Shi; -ä»–>Ta; -ä»—>Jou; -付>Fu; -ä»™>Sen; -ä»>Dou; -仞>Jin; -仟>Sen; -代>Dai; -令>Rei; -以>I; -ä»­>Jin; -ä»®>Ka; -ä»°>Gyou; -仲>Chuu; -件>Ken; -ä»·>Kai; -ä»»>Nin; -ä¼>Ki; -伉>Kou; -伊>I; -ä¼>Go; -伎>Ki; -ä¼>Fuku; -ä¼>Batsu; -休>Kyuu; -会>Kai; -伜>Sai; -ä¼>Den; -伯>Haku; -ä¼°>Ko; -ä¼´>Han; -伶>Rei; -伸>Shin; -伺>Shi; -ä¼¼>Ji; -ä¼½>Kya; -佃>Ten; -但>Tan; -佇>Cho; -ä½>I; -低>Tei; -ä½>Juu; -ä½>Sa; -佑>Yuu; -体>Tei; -何>Ka; -ä½—>Ta; -ä½™>Yo; -佚>Itsu; -ä½›>Butsu; -作>Saku; -ä½>Kou; -佞>Nei; -佩>Hai; -佯>You; -ä½°>Haku; -ä½³>Ka; -ä½µ>Hei; -佶>Kitsu; -ä½»>Chou; -ä½¼>Kou; -使>Shi; -侃>Kan; -來>Rai; -侈>Shi; -例>Rei; -ä¾>Ji; -ä¾>Shu; -侑>Yuu; -ä¾–>Ron; -侘>Ta; -ä¾›>Kyou; -ä¾>I; -ä¾ >Kyou; -価>Ka; -侫>Nei; -ä¾­>Jin; -ä¾®>Bu; -侯>Kou; -ä¾µ>Shin; -侶>Ryo; -便>Ben; -ä¿‚>Kei; -促>Soku; -ä¿„>Ga; -ä¿Š>Shun; -ä¿Ž>Sho; -ä¿>Ri; -ä¿‘>You; -ä¿”>Ken; -ä¿—>Zoku; -俘>Fu; -ä¿š>Ri; -ä¿›>Ben; -ä¿>Ho; -ä¿Ÿ>Shi; -ä¿¡>Shin; -ä¿®>Shuu; -俯>Fu; -俳>Hai; -俵>Hyou; -俶>Shuku; -俸>Hou; -俺>En; -俾>Hi; -倅>Sai; -倆>Ryou; -倉>Sou; -個>Ko; -å€>Bai; -å€>Shuku; -們>Mon; -倒>Tou; -倔>Kutsu; -倖>Kou; -候>Kou; -倚>I; -借>Shaku; -倡>Shou; -倣>Hou; -値>Chi; -倥>Kou; -倦>Ken; -倨>Kyo; -倩>Sen; -倪>Gei; -倫>Rin; -倬>Taku; -倭>I; -倶>Ku; -倹>Ken; -åƒ>En; -å‡>Ka; -åˆ>Ketsu; -å‰>I; -å>Hen; -å>Gan; -å•>Kai; -å–>Sha; -åš>Saku; -åœ>Tei; -å¥>Ken; -å¬>Sou; -å²>Shi; -å´>Soku; -åµ>Tei; -å¶>Guu; -å¸>Chuu; -å½>Gi; -å‚€>Kai; -å‚…>Fu; -å‚>Bou; -å‚‘>Ketsu; -傘>San; -å‚™>Bi; -å‚š>Kou; -催>Sai; -å‚­>You; -傲>Gou; -傳>Den; -å‚´>U; -債>Sai; -å‚·>Shou; -傾>Kei; -僂>Rou; -僅>Kin; -僉>Sen; -僊>Sen; -åƒ>Dou; -åƒ>Zou; -僑>Kyou; -僕>Boku; -僖>Ki; -僚>Ryou; -僞>Gi; -僣>Sen; -僥>Kyou; -僧>Sou; -僭>Sen; -僮>Dou; -僵>Kyou; -價>Ka; -僻>Heki; -å„€>Gi; -å„>Shun; -å„‚>Dou; -å„„>Oku; -儉>Ken; -å„’>Ju; -å„”>Chuu; -å„•>Sei; -å„–>Ran; -儘>Jin; -å„š>Bou; -å„Ÿ>Shou; -å„¡>Rai; -優>Yuu; -儲>Cho; -å„·>Rei; -儺>Da; -å„»>Tou; -儼>Gen; -å„¿>Jin; -å…€>Kotsu; -å…>In; -å…ƒ>Gen; -å…„>Kei; -å……>Juu; -å…†>Chou; -å…‡>Kyou; -å…ˆ>Sen; -å…‰>Kou; -å…‹>Koku; -å…Œ>Da; -å…>Men; -å…Ž>To; -å…>Ji; -å…’>Ji; -å…”>To; -å…š>Tou; -å…œ>Tou; -å…¢>Kyou; -å…¥>Nyuu; -å…¨>Zen; -å…©>Ryou; -å…ª>Yu; -å…«>Hachi; -å…¬>Kou; -å…­>Roku; -å…®>Kei; -å…±>Kyou; -å…µ>Hei; -å…¶>Ki; -å…·>Gu; -å…¸>Ten; -å…¼>Ken; -冀>Ki; -冂>Kei; -内>Dai; -円>En; -冉>Nen; -冊>Satsu; -册>Satsu; -å†>Sai; -å†>Kei; -å†>Bou; -冑>Chuu; -冒>Bou; -冓>Kou; -冕>Ben; -冖>Beki; -冗>Jou; -写>Sha; -冠>Kan; -冢>Chou; -冤>En; -冥>Mei; -冦>Kou; -冨>Fu; -冩>Sha; -冪>Beki; -冫>Hyou; -冬>Tou; -冰>Hyou; -冱>Go; -冲>Chuu; -决>Ketsu; -冴>Go; -况>Kyou; -冶>Ya; -冷>Rei; -冽>Retsu; -凄>Sei; -凅>Ko; -准>Jun; -凉>Ryou; -凋>Chou; -凌>Ryou; -å‡>Tou; -凖>Jun; -凛>Rin; -凜>Rin; -å‡>Gyou; -几>Ki; -凡>Bon; -処>Sho; -凭>Hyou; -凰>Kou; -凱>Gai; -凵>Kan; -凶>Kyou; -凸>Totsu; -凹>Ou; -出>Shutsu; -函>Kan; -凾>Kan; -刀>Tou; -刃>Jin; -刄>Jin; -分>Bun; -切>Setsu; -刈>Gai; -刊>Kan; -刋>Sen; -刎>Fun; -刑>Kei; -刔>Ketsu; -列>Retsu; -åˆ>Sho; -判>Han; -別>Betsu; -刧>Gou; -利>Ri; -刪>San; -刮>Katsu; -到>Tou; -刳>Ko; -制>Sei; -刷>Satsu; -券>Ken; -刹>Satsu; -刺>Shi; -刻>Koku; -剃>Tei; -剄>Kei; -則>Soku; -削>Saku; -剋>Koku; -剌>Ratsu; -å‰>Zen; -å‰>Sou; -剔>Teki; -剖>Bou; -剛>Gou; -剞>Ki; -剣>Ken; -剤>Zai; -剥>Haku; -剩>Jou; -剪>Sen; -副>Fuku; -剰>Jou; -剱>Ken; -割>Katsu; -剳>Tou; -剴>Gai; -創>Sou; -剽>Hyou; -剿>Shou; -劃>Kaku; -劇>Geki; -劈>Heki; -劉>Ru; -åŠ>Ken; -劑>Zai; -劒>Ken; -劔>Ken; -力>Ryoku; -功>Kou; -加>Ka; -劣>Retsu; -助>Jo; -努>Do; -劫>Gou; -劬>Ku; -劭>Shou; -励>Rei; -労>Rou; -劵>Ken; -効>Kou; -劼>Katsu; -劾>Gai; -å‹>Kei; -勃>Botsu; -å‹…>Choku; -勇>Yuu; -勉>Ben; -å‹>Kei; -å‹’>Roku; -å‹•>Dou; -å‹—>Bou; -勘>Kan; -å‹™>Mu; -å‹>Shou; -å‹ž>Rou; -å‹Ÿ>Bo; -å‹ >Riku; -å‹¢>Sei; -å‹£>Seki; -勤>Kin; -勦>Sou; -勧>Kan; -勲>Kun; -勳>Kun; -勵>Rei; -勸>Kan; -勹>Hou; -勺>Shaku; -勾>Kou; -å‹¿>Butsu; -包>Hou; -匆>Sou; -匈>Kyou; -åŒ>Ho; -åŒ>Hou; -åŒ>Hoku; -匕>Hi; -化>Ka; -北>Hoku; -匙>Shi; -匚>Hou; -åŒ>Sou; -匠>Shou; -匡>Kyou; -匣>Kou; -匪>Hi; -匯>Wai; -匱>Ki; -匳>Ren; -匸>Kei; -匹>Hitsu; -区>Ku; -医>I; -匿>Toku; -å€>Ku; -å>Juu; -åƒ>Sen; -å…>Sou; -å†>Sotsu; -å‡>Shou; -åˆ>Go; -å‰>Ki; -åŠ>Han; -å>Ban; -å‘>Hi; -å’>Sotsu; -å“>Taku; -å”>Kyou; -å—>Nan; -å˜>Tan; -åš>Haku; -åœ>Boku; -åž>Hen; -å >Sen; -å¦>Ka; -å©>Setsu; -å®>Shi; -å¯>Bou; -å°>In; -å±>Ki; -å³>Soku; -å´>Kyaku; -åµ>Ran; -å·>Kan; -å¸>Sha; -å»>Kyaku; -å¿>Kyou; -厂>Kan; -厄>Yaku; -厖>Bou; -厘>Rin; -厚>Kou; -原>Gen; -厠>Shi; -厥>Ketsu; -厦>Ka; -厨>Zu; -厩>Kyuu; -厭>En; -厮>Shi; -厰>Shou; -厳>Gen; -厶>Shi; -去>Kyo; -å‚>San; -åƒ>San; -åˆ>Yuu; -å‰>Sha; -åŠ>Kyuu; -å‹>Yuu; -åŒ>Sou; -å>Han; -åŽ>Shuu; -å”>Shuku; -å–>Shu; -å—>Ju; -å™>Jo; -å›>Han; -åŸ>Sou; -å¡>Ei; -å¢>Sou; -å£>Kou; -å¤>Ko; -å¥>Ku; -å¨>Tou; -å©>Kou; -åª>Shi; -å«>Kyou; -å¬>Shou; -å­>Hatsu; -å®>Tei; -å¯>Ka; -å°>Dai; -å±>Shitsu; -å²>Shi; -å³>U; -å¶>Kyou; -å·>Gou; -å¸>Shi; -å>Ku; -åƒ>Kitsu; -å„>Kaku; -åˆ>Gou; -å‰>Kichi; -åŠ>Chou; -å‹>Sun; -åŒ>Dou; -å>Mei; -åŽ>Kou; -å>Ri; -å>To; -å‘>Kou; -å›>Kun; -å>Rin; -åŸ>Gin; -å >Hai; -å¦>Hi; -å©>Fun; -å«>Gan; -å¬>Kin; -å­>Kou; -å®>Sen; -å¶>Totsu; -å¸>Kyuu; -å¹>Sui; -å»>Fun; -å¼>Kou; -å½>In; -å¾>Go; -å‘€>Ga; -å‘‚>Ryo; -呆>Bou; -呈>Tei; -呉>Go; -å‘Š>Koku; -å‘Ž>Seki; -å‘‘>Don; -å‘Ÿ>Gen; -周>Shuu; -呪>Ju; -å‘°>Shi; -呱>Ko; -味>Mi; -呵>Ka; -呶>Do; -å‘·>Kou; -å‘»>Shin; -呼>Ko; -命>Mei; -å’€>So; -å’„>Totsu; -å’†>Hou; -å’‹>Saku; -å’Œ>Wa; -å’Ž>Kyuu; -å’>Ei; -å’>Ho; -å’’>Shu; -å’¢>Gaku; -å’¤>Ta; -å’¥>Ki; -å’¨>Shi; -å’«>Shi; -å’¬>Kou; -å’¯>Kaku; -å’²>Shou; -å’³>Gai; -å’¸>Kan; -å’¼>Ka; -å’½>In; -å’¾>Rou; -å“€>Ai; -å“>Hin; -å“‚>Shin; -å“„>Kou; -哇>Ai; -哈>Gou; -哉>Sai; -å“¡>In; -å“¢>Rou; -å“¥>Ka; -哦>Ga; -哨>Shou; -å“©>Ri; -å“­>Koku; -å“®>Kou; -哲>Tetsu; -哺>Ho; -哽>Kou; -唄>Bai; -唆>Sa; -唇>Shin; -å”>Ki; -å”>Tou; -å””>Go; -å”–>A; -å”®>Shuu; -唯>Yui; -å”±>Shou; -唳>Rei; -唸>Ten; -唹>Yo; -唾>Da; -å•€>Gai; -å•„>Taku; -å•…>Taku; -商>Shou; -å•Œ>Kou; -å•>Mon; -å•“>Kei; -å•–>Tan; -å•—>Tan; -å•œ>Setsu; -å•>Ka; -å•£>Kan; -å•»>Shi; -啼>Tei; -啾>Shuu; -å–€>Kaku; -å–ƒ>Nan; -å–„>Zen; -å–‡>Ratsu; -å–‰>Kou; -å–Š>Kan; -å–‹>Chou; -å–˜>Zen; -å–™>Kai; -å–š>Kan; -å–œ>Ki; -å–>Katsu; -å–ž>Soku; -å–Ÿ>Ki; -å–§>Ken; -å–¨>Ryou; -å–©>Yu; -å–ª>Sou; -å–«>Kitsu; -å–¬>Kyou; -å–®>Tan; -å–¶>Ei; -å—„>Sa; -å—…>Kyuu; -å—‡>Shoku; -å—”>Shin; -å—š>O; -å—œ>Shi; -å—Ÿ>Sa; -å—£>Shi; -å—¤>Shi; -å—·>Gou; -å—¹>Ren; -å—½>Soku; -å—¾>Sou; -嘆>Tan; -嘉>Ka; -嘔>Ou; -嘖>Saku; -嘗>Shou; -嘘>Kyo; -嘛>Ma; -嘩>Ka; -嘯>Shou; -嘱>Shoku; -嘲>Tou; -嘴>Shi; -嘶>Sei; -嘸>Bu; -噂>Son; -噌>Sou; -噎>Itsu; -å™>Ki; -å™›>Gou; -噤>Kin; -器>Ki; -噪>Sou; -噫>I; -噬>Zei; -å™´>Fun; -噸>Ton; -嚀>Dei; -嚆>Kou; -嚇>Kaku; -嚊>Hi; -åš>Tei; -åš”>Tei; -åš >Ryuu; -嚢>Nou; -嚥>En; -åš®>Kou; -åš´>Gen; -嚶>Ou; -åš¼>Shaku; -囀>Ten; -å›>Shou; -囂>Gou; -囃>Sou; -囈>Gei; -囎>So; -囑>Shoku; -囓>Ketsu; -å›—>I; -囘>Kai; -囚>Shuu; -å››>Shi; -回>Kai; -å› >In; -団>Dan; -å›®>Ka; -å›°>Kon; -囲>I; -図>To; -囹>Rei; -固>Ko; -国>Koku; -囿>Yuu; -圀>Koku; -圃>Ho; -圄>Gyo; -圈>Ken; -圉>Gyo; -國>Koku; -åœ>I; -åœ>Ken; -園>En; -圓>En; -圖>To; -團>Dan; -圜>Kan; -土>Do; -圧>Atsu; -在>Zai; -圭>Kei; -地>Chi; -圻>Ki; -å€>Shi; -å‚>Han; -å‡>Kin; -åŠ>Bou; -åŽ>Kan; -å>Hai; -å>Za; -å‘>Kou; -å¡>Ha; -å¤>Kon; -å¦>Tan; -å©>Kan; -åª>Hei; -å¿>Fu; -åž‚>Sui; -垈>Tai; -垉>Hou; -åž‹>Kei; -åž“>Gai; -åž >Gin; -垢>Kou; -垣>En; -垤>Tetsu; -埀>Sui; -埃>Ai; -埆>Kaku; -埋>Mai; -城>Jou; -埒>Rachi; -埓>Rachi; -埔>Ho; -埜>Sho; -域>Iki; -埠>Fu; -埣>Sai; -埴>Shoku; -執>Shitsu; -培>Bai; -基>Ki; -埼>Ki; -å €>Kutsu; -å ‚>Dou; -å …>Ken; -å †>Tai; -å Š>A; -å ‹>Hou; -å •>Da; -å ™>In; -å >Ka; -å ¡>Hou; -å ¤>Tei; -å ª>Kan; -å ¯>Gyou; -å °>En; -å ±>Hou; -å ´>Jou; -å µ>To; -å º>Kai; -å ½>Kou; -å¡>Rui; -å¡Š>Kai; -å¡‹>Ei; -å¡‘>So; -å¡’>Shi; -å¡”>Tou; -å¡—>To; -塘>Tou; -å¡™>Kaku; -å¡š>Chou; -å¡ž>Soku; -å¡¢>O; -å¡©>En; -å¡«>Ten; -塲>Jou; -塵>Jin; -塹>Zan; -塾>Juku; -境>Kyou; -墅>Sho; -墓>Bo; -増>Zou; -墜>Tsui; -墟>Kyo; -墨>Boku; -墫>Shun; -墮>Da; -墳>Fun; -墸>Sho; -墺>Ou; -墻>Shou; -墾>Kon; -å£>Heki; -壅>You; -壇>Dan; -壊>Kai; -壌>Jou; -壑>Gaku; -壓>Atsu; -壕>Gou; -壘>Rui; -壙>Kou; -壜>Tan; -壞>Kai; -壟>Ryou; -壤>Jou; -壥>Ten; -士>Shi; -壬>Jin; -壮>Sou; -壯>Sou; -声>Sei; -壱>Ichi; -売>Bai; -壷>Ko; -壹>Ichi; -壺>Ko; -壻>Sei; -壼>Kon; -壽>Ju; -夂>Chi; -変>Hen; -夊>Sui; -å¤>Ka; -å¤>Kei; -夕>Seki; -外>Gai; -夘>Bou; -夙>Shuku; -多>Ta; -夛>Ta; -夜>Ya; -夢>Mu; -夥>Ka; -大>Tai; -天>Ten; -太>Ta; -夫>Fu; -夬>Ketsu; -夭>You; -央>Ou; -失>Shitsu; -夲>Tou; -夷>I; -夸>Ko; -夾>Kou; -奄>En; -奇>Ki; -奈>Na; -奉>Hou; -奎>Kei; -å¥>Sou; -å¥>Kan; -契>Setsu; -奔>Hon; -奕>Eki; -套>Tou; -奘>Jou; -奚>Kei; -奠>Ten; -奢>Sha; -奥>Ou; -奧>Ou; -奨>Shou; -奩>Ren; -奪>Datsu; -奬>Shou; -奮>Fun; -女>Jo; -奴>Do; -奸>Kan; -好>Kou; -å¦>Shaku; -如>Jo; -妃>Hi; -妄>Bou; -妊>Nin; -å¦>Ken; -妓>Ki; -妖>You; -妙>Myou; -妛>Shi; -å¦>Sou; -妣>Hi; -妥>Da; -妨>Bou; -妬>To; -妲>Datsu; -妹>Mai; -妻>Sai; -妾>Shou; -姆>Bo; -姉>Shi; -始>Shi; -å§>So; -姑>Ko; -姓>Sei; -委>I; -姙>Nin; -姚>You; -姜>Kyou; -姥>Bo; -姦>Kan; -姨>I; -姪>Tetsu; -姫>Ki; -姶>Ou; -姻>In; -姿>Shi; -å¨>I; -娃>A; -娉>Hei; -娑>Sha; -娘>Jou; -娚>Nan; -娜>Da; -娟>Ken; -娠>Shin; -娥>Ga; -娩>Ben; -娯>Go; -娵>Shu; -娶>Shu; -娼>Shou; -å©€>A; -å©>Rou; -婆>Ba; -婉>En; -å©š>Kon; -å©¢>Hi; -婦>Fu; -婪>Ran; -婬>In; -å©¿>Sei; -媒>Bai; -媚>Bi; -媛>En; -媼>Ou; -媽>Bo; -媾>Kou; -å«>Ka; -å«‚>Sou; -嫉>Shitsu; -å«‹>Jou; -å«Œ>Ken; -å«>Jou; -å«–>Hyou; -å«—>Ou; -å«¡>Chaku; -å«£>En; -嫦>Kou; -å«©>Don; -嫺>Kan; -å«»>Kan; -嬉>Ki; -嬋>Sen; -嬌>Kyou; -嬖>Hei; -嬢>Jou; -嬪>Hin; -嬬>Shu; -嬰>Ei; -嬲>Jou; -嬾>Ran; -å­€>Sou; -å­ƒ>Jou; -å­…>Sen; -å­>Shi; -å­‘>Getsu; -å­”>Kou; -å­•>You; -å­—>Ji; -å­˜>Son; -å­š>Fu; -å­›>Botsu; -å­œ>Shi; -å­>Kou; -å­Ÿ>Mou; -å­£>Ki; -å­¤>Ko; -å­¥>Do; -å­¦>Gaku; -å­©>Kai; -å­«>Son; -å­°>Juku; -å­±>Sen; -å­³>Shi; -å­µ>Fu; -å­¸>Gaku; -å­º>Ju; -宀>Ben; -它>Ta; -å®…>Taku; -宇>U; -守>Shu; -安>An; -宋>Sou; -完>Kan; -å®>Niku; -å®>Kou; -宕>Tou; -å®—>Shuu; -官>Kan; -å®™>Chuu; -定>Tei; -å®›>En; -宜>Gi; -å®>Hou; -実>Jitsu; -客>Kyaku; -宣>Sen; -室>Shitsu; -宥>Yuu; -宦>Kan; -å®®>Kyuu; -å®°>Sai; -害>Gai; -å®´>En; -宵>Shou; -家>Ka; -宸>Shin; -容>You; -宿>Shuku; -寂>Jaku; -寃>En; -寄>Ki; -寅>In; -密>Mitsu; -寇>Kou; -寉>Kaku; -富>Fu; -å¯>Bi; -寒>Kan; -寓>Guu; -寔>Shoku; -寛>Kan; -å¯>Shin; -寞>Baku; -察>Satsu; -寡>Ka; -寢>Shin; -寤>Go; -寥>Ryou; -實>Jitsu; -寧>Nei; -寨>Sai; -審>Shin; -寫>Sha; -寮>Ryou; -寰>Kan; -寳>Hou; -寵>Chou; -寶>Hou; -寸>Sun; -寺>Ji; -対>Tai; -寿>Ju; -å°>Fuu; -å°‚>Sen; -å°„>Sha; -å°…>Koku; -å°†>Shou; -å°‡>Shou; -å°ˆ>Sen; -å°‰>I; -å°Š>Son; -å°‹>Jin; -å°>Tai; -å°Ž>Dou; -å°>Shou; -å°‘>Shou; -å°“>Ji; -å°–>Sen; -å°š>Shou; -å° >Sen; -å°¢>Ou; -å°¤>Yuu; -å°¨>Bou; -å°­>Gyou; -å°±>Shuu; -å°¸>Shi; -å°¹>In; -å°º>Shaku; -å°»>Kou; -å°¼>Ni; -å°½>Jin; -å°¾>Bi; -å°¿>Nyou; -å±€>Kyoku; -å±>Hi; -å±…>Kyo; -屆>Kai; -屈>Kutsu; -届>Kai; -屋>Oku; -å±>Shi; -屎>Shi; -å±>Hei; -å±>Geki; -屑>Setsu; -屓>Ki; -展>Ten; -属>Zoku; -å± >To; -屡>Ru; -層>Sou; -å±¥>Ri; -屬>Zoku; -å±®>Sa; -屯>Ton; -å±±>San; -å±¹>Kitsu; -岌>Kyuu; -å²>Ki; -岑>Shin; -å²”>Sa; -岡>Kou; -岨>So; -岩>Gan; -岫>Shuu; -岬>Kou; -å²±>Tai; -å²³>Gaku; -岶>Haku; -å²·>Bin; -岸>Gan; -å²»>Ji; -å²¾>Sen; -峇>Kou; -å³™>Ji; -峡>Kyou; -峨>Ga; -峩>Ga; -峪>Yoku; -å³­>Shou; -峯>Hou; -å³°>Hou; -島>Tou; -峺>Kou; -å³»>Shun; -å³½>Kyou; -å´‡>Suu; -å´‹>Ka; -å´Ž>Ki; -å´‘>Kon; -å´”>Sai; -å´•>Gai; -å´–>Gai; -å´—>Kou; -å´˜>Ron; -å´™>Ron; -å´š>Ryou; -å´›>Kutsu; -å´Ÿ>Gin; -å´¢>Sou; -å´©>Hou; -嵋>Bi; -嵌>Kan; -嵎>Guu; -åµ>Ran; -åµ’>Gan; -嵜>Ki; -嵩>Suu; -嵬>Kai; -嵯>Sa; -åµ³>Sa; -嶂>Shou; -嶄>San; -嶇>Ku; -嶋>Tou; -嶌>Tou; -å¶>Ryuu; -å¶>Tou; -嶢>Gyou; -嶬>Gi; -嶮>Ken; -嶷>Gi; -嶺>Rei; -嶼>Sho; -嶽>Gaku; -å·‰>San; -å·Œ>Gan; -å·>Gi; -å·’>Ran; -å·“>Ten; -å·–>Gan; -å·›>Sen; -å·>Sen; -å·ž>Shuu; -å·¡>Jun; -å·£>Sou; -å·¥>Kou; -å·¦>Sa; -å·§>Kou; -å·¨>Kyo; -å·«>Fu; -å·®>Shi; -å·±>Ki; -å·²>I; -å·³>Shi; -å·´>Ha; -å·µ>Shi; -å··>Kou; -å·»>Kan; -å·½>Son; -å·¾>Kin; -市>Shi; -布>Fu; -帆>Han; -帋>Shi; -希>Ki; -帑>Do; -帖>Jou; -帙>Chitsu; -帚>Sou; -帛>Haku; -å¸>Tei; -帥>Sotsu; -師>Shi; -席>Seki; -帯>Tai; -帰>Ki; -帳>Chou; -帶>Tai; -帷>I; -常>Jou; -帽>Bou; -å¹€>Tei; -幃>I; -幄>Aku; -å¹…>Fuku; -幇>Hou; -幌>Kou; -幎>Beki; -å¹”>Ban; -幕>Maku; -å¹—>Kaku; -幟>Shi; -幡>Han; -å¹¢>Tou; -å¹£>Hei; -幤>Hei; -å¹²>Kan; -å¹³>Hei; -å¹´>Nen; -å¹µ>Ken; -并>Hei; -幸>Kou; -å¹¹>Kan; -幺>You; -å¹»>Gen; -å¹¼>You; -å¹½>Yuu; -å¹¾>Ki; -广>Gen; -åº>Chou; -広>Kou; -庄>Sou; -庇>Hi; -床>Shou; -åº>Jo; -底>Tei; -庖>Hou; -店>Ten; -庚>Kou; -府>Fu; -庠>Shou; -度>Taku; -座>Za; -庫>Ko; -庭>Tei; -庵>An; -庶>Sho; -康>Kou; -庸>You; -å»>Shi; -廂>Shou; -廃>Hai; -廈>Ka; -廉>Ren; -廊>Rou; -å»>Kyuu; -廓>Kaku; -å»–>Ryou; -廚>Zu; -å»›>Ten; -å»>Shi; -廟>Byou; -å» >Shou; -廡>Bu; -廢>Hai; -廣>Kou; -廨>Kai; -廩>Rin; -廬>Ryo; -å»°>Chou; -å»±>You; -廳>Chou; -å»´>In; -延>En; -å»·>Tei; -廸>Teki; -建>Ken; -å»»>Kai; -廼>Dai; -廾>Kyou; -廿>Juu; -å¼>Ben; -弃>Ki; -弄>Rou; -弉>Jou; -弊>Hei; -弋>Yoku; -弌>Itsu; -å¼>Ni; -å¼>Shiki; -å¼>Ni; -弑>Shi; -弓>Kyuu; -å¼”>Chou; -引>In; -å¼—>Futsu; -弘>Kou; -å¼›>Shi; -弟>Tei; -å¼¥>Mi; -弦>Gen; -弧>Ko; -弩>Do; -å¼­>Bi; -弯>Wan; -å¼±>Jaku; -å¼µ>Chou; -å¼·>Kyou; -弸>Hou; -å¼¼>Hitsu; -å¼¾>Dan; -å½>Sei; -彈>Dan; -彊>Kyou; -彌>Bi; -彎>Wan; -彑>Kei; -当>Tou; -å½–>Tan; -å½—>Sui; -å½™>I; -彜>I; -å½>I; -彡>San; -å½¢>Kei; -彦>Gen; -彩>Sai; -彪>Hyou; -彫>Chou; -彬>Hin; -å½­>Hou; -å½°>Shou; -å½±>Ei; -å½³>Teki; -å½·>Hou; -å½¹>Yaku; -å½¼>Hi; -彿>Futsu; -å¾€>Ou; -å¾>Sei; -徂>So; -徃>Ou; -径>Kei; -å¾…>Tai; -徇>Shun; -很>Kon; -徊>Kai; -律>Ritsu; -後>Go; -å¾>Jo; -徑>Kei; -å¾’>To; -従>Juu; -å¾—>Toku; -徘>Hai; -å¾™>Shi; -從>Juu; -å¾ >Rai; -御>Gyo; -徨>Kou; -復>Fuku; -循>Jun; -å¾­>You; -å¾®>Bi; -å¾³>Toku; -å¾´>Chou; -å¾¹>Tetsu; -å¾¼>Kyou; -å¾½>Ki; -心>Shin; -å¿…>Hitsu; -å¿Œ>Ki; -å¿>Nin; -å¿–>Son; -å¿—>Shi; -忘>Bou; -å¿™>Bou; -å¿œ>Ou; -å¿>Ten; -å¿ >Chuu; -忤>Go; -å¿«>Kai; -å¿°>Sui; -忱>Shin; -念>Nen; -忸>Jiku; -å¿»>Kin; -忽>Kotsu; -å¿¿>Fun; -怎>Shin; -æ€>You; -æ€>Kou; -怒>Do; -怕>Ha; -怖>Fu; -怙>Ko; -怛>Datsu; -怜>Rei; -æ€>Shi; -怠>Tai; -怡>I; -急>Kyuu; -怦>Hou; -性>Sei; -怨>En; -怩>Ji; -怪>Kai; -怫>Futsu; -怯>Kyou; -怱>Sou; -æ>In; -æ‚>Jun; -æƒ>Ji; -æ†>Kou; -æŠ>Kyou; -æ‹>Ren; -æ>Kou; -æ>Kyou; -æ’>Kou; -æ•>Jo; -æ™>You; -æš>I; -æŸ>Kyou; -æ >Kai; -æ¢>Kai; -æ£>Shi; -æ¤>Jutsu; -æ¥>Chi; -æ¨>Kon; -æ©>On; -æª>Kaku; -æ«>Dou; -æ¬>Ten; -æ­>Kyou; -æ¯>Soku; -æ°>Kou; -æµ>Kei; -æ·>Kyuu; -æ‚>En; -悃>Kon; -æ‚„>Shou; -悉>Shitsu; -æ‚‹>Rin; -æ‚Œ>Tei; -æ‚>Kan; -æ‚’>Yuu; -æ‚”>Kai; -æ‚–>Hai; -æ‚—>Ban; -æ‚š>Shou; -æ‚›>Sen; -æ‚Ÿ>Go; -æ‚ >Yuu; -æ‚£>Kan; -悦>Etsu; -悧>Ri; -æ‚©>Nou; -悪>Aku; -悲>Hi; -悳>Toku; -æ‚´>Sui; -悵>Chou; -悶>Mon; -悸>Ki; -悼>Tou; -悽>Sei; -情>Jou; -惆>Chuu; -惇>Ton; -惑>Waku; -惓>Ken; -惘>Bou; -惚>Kotsu; -惜>Seki; -惟>I; -惠>Kei; -惡>O; -惣>Sou; -惧>Ku; -惨>San; -惰>Da; -惱>Nou; -想>Sou; -惴>Zui; -惶>Kou; -惷>Shun; -惹>Ja; -惺>Sei; -惻>Soku; -æ„€>Shou; -æ„>Shuu; -愃>Ken; -愆>Ken; -愈>Yu; -愉>Yu; -æ„>Bin; -æ„Ž>Hyoku; -æ„>I; -æ„•>Gaku; -æ„š>Gu; -æ„›>Ai; -æ„Ÿ>Kan; -æ„¡>Sou; -愧>Ki; -愨>Kaku; -愬>So; -æ„´>Sou; -愼>Shin; -愽>Haku; -愾>Ki; -æ„¿>Gen; -æ…‚>You; -æ…„>Ritsu; -æ…‡>In; -æ…ˆ>Ji; -æ…Š>Ken; -æ…‹>Tai; -æ…Œ>Kou; -æ…>Un; -æ…Ž>Shin; -æ…“>Hyou; -æ…•>Bo; -æ…˜>San; -æ…™>Zan; -æ…š>Zan; -æ…>Toku; -æ…Ÿ>Dou; -æ…¢>Man; -æ…£>Kan; -æ…¥>Zou; -æ…§>Kei; -æ…¨>Gai; -æ…«>Shou; -æ…®>Ryo; -æ…¯>Shou; -æ…°>I; -æ…±>Tan; -æ…³>Kan; -æ…´>Shou; -æ…µ>You; -æ…¶>Kei; -æ…·>Kou; -æ…¾>Yoku; -憂>Yuu; -憇>Kei; -憊>Hai; -憎>Zou; -æ†>Ren; -憑>Hyou; -憔>Shou; -憖>Gin; -憙>Ki; -憚>Tan; -憤>Fun; -憧>Dou; -憩>Kei; -憫>Bin; -憬>Kei; -憮>Bu; -憲>Ken; -憶>Oku; -憺>Tan; -憾>Kan; -懃>Kin; -懆>Sou; -懇>Kon; -懈>Kai; -應>You; -懊>Ou; -懋>Bou; -懌>Eki; -æ‡>Rin; -æ‡>Kai; -懣>Mon; -懦>Da; -懲>Chou; -懴>Zan; -懶>Ran; -懷>Kai; -懸>Ken; -懺>Zan; -懼>Ku; -懽>Kan; -懾>Shou; -懿>I; -戀>Ren; -戈>Ka; -戉>Etsu; -戊>Bo; -戌>Jutsu; -æˆ>Ju; -戎>Juu; -æˆ>Sei; -我>Ga; -戒>Kai; -戔>San; -或>Waku; -戚>Seki; -戛>Katsu; -æˆ>Zoku; -戞>Katsu; -戟>Geki; -戡>Kan; -戦>Sen; -截>Setsu; -戮>Riku; -戯>Gi; -戰>Sen; -戲>Gi; -戳>Taku; -戴>Tai; -戸>Ko; -戻>Rei; -房>Bou; -所>Sho; -æ‰>Hen; -扇>Sen; -扈>Ko; -扉>Hi; -手>Shu; -æ‰>Sai; -扎>Satsu; -打>Da; -払>Futsu; -托>Taku; -扛>Kou; -扞>Kan; -扠>Sa; -扣>Kou; -扮>Fun; -扱>Sou; -扶>Fu; -批>Hi; -扼>Aku; -找>Ka; -承>Shou; -技>Gi; -抂>Kyou; -抃>Ben; -抄>Shou; -抉>Ketsu; -把>Ha; -抑>Yoku; -抒>Jo; -抓>Sou; -抔>Hou; -投>Tou; -抖>Tou; -抗>Kou; -折>Setsu; -抛>Hou; -抜>Batsu; -択>Taku; -披>Hi; -抬>Tai; -抱>Hou; -抵>Tei; -抹>Matsu; -抻>Shin; -押>Ou; -抽>Chuu; -æ‹‚>Futsu; -æ‹…>Tan; -拆>Taku; -拇>Bo; -拈>Den; -拉>Ratsu; -æ‹Š>Fu; -æ‹Œ>Han; -æ‹>Haku; -æ‹>Da; -æ‹>Kai; -æ‹‘>Kan; -æ‹’>Kyo; -æ‹“>Taku; -æ‹”>Batsu; -æ‹—>Ou; -拘>Kou; -æ‹™>Setsu; -æ‹›>Shou; -æ‹œ>Hai; -æ‹>Hai; -æ‹ >Kyo; -æ‹¡>Kaku; -括>Katsu; -æ‹­>Shiki; -æ‹®>Kitsu; -拯>Jou; -拱>Kyou; -拳>Ken; -拵>Son; -拶>Satsu; -æ‹·>Gou; -拾>Shuu; -æ‹¿>Da; -æŒ>Ji; -挂>Kei; -指>Shi; -挈>Ketsu; -按>An; -挌>Kaku; -挑>Chou; -挙>Kyo; -挟>Kyou; -挧>Ku; -挨>Ai; -挫>Za; -振>Shin; -挺>Tei; -挽>Ban; -挾>Kyou; -挿>Sou; -æ‰>Soku; -æŒ>Hatsu; -æ>Kan; -æ>Detsu; -æ>En; -æ•>Ho; -æ—>Ho; -æœ>Sou; -æ§>Hou; -æ¨>Sha; -æ©>Retsu; -æ«>Mon; -æ®>Kyo; -æ²>Ken; -æ¶>Sui; -æ·>Shou; -æº>Natsu; -æ»>Nen; -掀>Kin; -掃>Sou; -授>Ju; -掉>Tou; -掌>Shou; -掎>Ki; -æŽ>Tou; -排>Hai; -掖>Eki; -掘>Kutsu; -掛>Ka; -掟>Tou; -掠>Ryaku; -採>Sai; -探>Tan; -掣>Sei; -接>Setsu; -控>Kou; -推>Sui; -掩>En; -措>So; -掫>Sou; -掬>Kiku; -掲>Kei; -掴>Kaku; -掻>Sou; -掾>En; -æ€>Kan; -æƒ>Sen; -æ„>Yu; -æ†>Ki; -æ‰>Juu; -æ>Byou; -æ>Tei; -æ’>Sou; -æ–>Yuu; -æš>You; -æ›>Kan; -æ¡>Aku; -æ£>Shi; -æ©>Kai; -æ®>Ki; -æ´>En; -æ¶>Ya; -æº>You; -æ†>Kou; -æ>Son; -æ>Haku; -æ“>Sa; -æ–>You; -æ—>Tou; -æœ>Sou; -æ¦>Jaku; -æ¨>Tou; -æ¬>Han; -æ­>Tou; -æ´>Ken; -æ¶>Shou; -æº>Kei; -æ¾>Saku; -æ‘‚>Setsu; -æ‘Ž>Kyuu; -摘>Teki; -摧>Sai; -æ‘©>Ma; -摯>Shi; -摶>Tan; -摸>Mo; -摺>Shou; -æ’ƒ>Geki; -æ’ˆ>Rou; -æ’’>San; -æ’“>Dou; -æ’•>Sei; -æ’š>Nen; -æ’ž>Shu; -æ’¤>Tetsu; -æ’¥>Hatsu; -æ’©>Ryou; -æ’«>Bu; -æ’­>Ha; -æ’®>Satsu; -æ’°>San; -æ’²>Boku; -æ’¹>Kaku; -æ’»>Tachi; -æ’¼>Kan; -æ“>You; -æ“‚>Rai; -æ“…>Sen; -擇>Taku; -æ“>Sou; -æ“’>Kin; -æ“”>Tan; -擘>Haku; -æ“š>Kyo; -æ“ >Sei; -æ“¡>Tai; -æ“¢>Teki; -æ“£>Tou; -擦>Satsu; -擧>Kyo; -擬>Gi; -擯>Hin; -擱>Kaku; -擲>Teki; -æ“´>Kaku; -擶>Sen; -擺>Hai; -擽>Ryaku; -擾>Jou; -攀>Han; -æ”…>San; -攘>Jou; -攜>Kei; -æ”>Setsu; -攣>Ren; -攤>Tan; -攪>Kaku; -攫>Kaku; -攬>Ran; -支>Shi; -æ”´>Hoku; -攵>Boku; -收>Shuu; -æ”·>Kou; -攸>Yuu; -改>Kai; -æ”»>Kou; -放>Hou; -政>Sei; -æ•…>Ko; -效>Kou; -æ•>Jo; -æ•>Bin; -æ•‘>Kyuu; -æ••>Choku; -æ•–>Gou; -æ•—>Hai; -敘>Jo; -æ•™>Kyou; -æ•>Hei; -æ•ž>Shou; -æ•¢>Kan; -æ•£>San; -敦>Ton; -敬>Kei; -æ•°>Suu; -敲>Kou; -æ•´>Sei; -敵>Teki; -æ•·>Fu; -數>Suu; -æ–‚>Ren; -æ–ƒ>Hei; -æ–‡>Bun; -æ–ˆ>Gaku; -æ–‰>Sei; -æ–Œ>Hin; -æ–Ž>Sai; -æ–>Hi; -æ–‘>Han; -æ–—>To; -æ–™>Ryou; -æ–›>Koku; -æ–œ>Sha; -æ–Ÿ>Shin; -æ–¡>Atsu; -æ–¤>Kin; -æ–¥>Seki; -æ–§>Fu; -æ–«>Shaku; -æ–¬>Zan; -æ–­>Dan; -æ–¯>Shi; -æ–°>Shin; -æ–·>Dan; -æ–¹>Hou; -æ–¼>O; -æ–½>Shi; -æ—>Hou; -æ—ƒ>Sen; -æ—„>Bou; -æ—…>Ryo; -æ—†>Hai; -æ—‹>Sen; -æ—Œ>Sei; -æ—>Zoku; -æ—’>Ryuu; -æ——>Ki; -æ—™>Han; -æ—›>Han; -æ— >Bu; -æ—¡>Ki; -æ—¢>Ki; -æ—¥>Nichi; -æ—¦>Tan; -æ—§>Kyuu; -æ—¨>Shi; -æ—©>Sou; -æ—¬>Jun; -æ—­>Kyoku; -æ—±>Kan; -æ—º>Ou; -æ—»>Bin; -昂>Kou; -昃>Soku; -昆>Kon; -昇>Shou; -昊>Kou; -昌>Shou; -明>Mei; -æ˜>Kon; -易>Eki; -昔>Seki; -昜>You; -星>Sei; -映>Ei; -春>Shun; -昧>Mai; -昨>Saku; -昭>Shou; -是>Ze; -昴>Bou; -昵>Jitsu; -昶>Chou; -昼>Chuu; -昿>Kou; -æ™>Chou; -時>Ji; -晃>Kou; -晄>Kou; -晉>Shin; -晋>Shin; -æ™>An; -æ™’>Sai; -æ™>Chuu; -晞>Ki; -晟>Sei; -晢>Setsu; -晤>Go; -晦>Kai; -晧>Kou; -晨>Shin; -晩>Ban; -æ™®>Fu; -景>Kei; -æ™°>Seki; -æ™´>Sei; -晶>Shou; -智>Chi; -æš>Gyou; -暃>Hi; -æš„>Ken; -暇>Ka; -暈>Un; -暉>Ki; -暎>Ei; -æš‘>Sho; -æš–>Dan; -æš—>An; -暘>You; -æš>Mei; -暢>Chou; -暦>Reki; -æš«>Zan; -æš®>Bo; -æš´>Bou; -暸>Ryou; -æš¹>Sen; -æš¼>Hetsu; -æš¾>Ton; -æ›>Ki; -曄>You; -曇>Don; -曉>Gyou; -æ›–>Ai; -æ›™>Sho; -曚>Bou; -曜>You; -æ›>Baku; -æ› >Kou; -曦>Gi; -曩>Dou; -æ›°>Etsu; -曲>Kyoku; -曳>Ei; -æ›´>Kou; -曵>Ei; -æ›·>Katsu; -書>Sho; -曹>Sou; -曼>Ban; -曽>Zo; -曾>So; -替>Tai; -最>Sai; -會>Kai; -月>Getsu; -有>Yuu; -朋>Hou; -æœ>Fuku; -æœ>Hi; -朔>Saku; -朕>Chin; -朖>Rou; -朗>Rou; -望>Bou; -æœ>Chou; -朞>Ki; -期>Ki; -朦>Bou; -朧>Rou; -木>Boku; -未>Mi; -末>Matsu; -本>Hon; -札>Satsu; -朮>Jutsu; -朱>Shu; -朴>Boku; -朶>Da; -朷>Tou; -朸>Ryoku; -机>Ki; -朽>Kyuu; -朿>Shi; -æ†>Kan; -æ‰>San; -æŽ>Ri; -æ>Kyou; -æ>Zai; -æ‘>Son; -æ“>Hyou; -æ–>Jou; -æ™>Yoku; -æœ>Do; -æž>Ko; -æŸ>Soku; -æ >Kou; -æ¡>Jou; -æ¥>Rai; -æª>Byou; -æ­>Kou; -æ¯>Hai; -æ°>Ketsu; -æ±>Tou; -æ²>Kou; -æ³>You; -æµ>Sho; -æ·>Ha; -æ¼>Cho; -æ¾>Shou; -æ¿>Han; -æž…>Kei; -枇>Hi; -枉>Ou; -æž‹>Hou; -枌>Fun; -æž>Seki; -æž•>Chin; -æž—>Rin; -æžš>Mai; -æžœ>Ka; -æž>Shi; -枢>Suu; -枦>Ro; -æž©>Shou; -枯>Ko; -æž³>Ki; -æž´>Kai; -架>Ka; -æž·>Ka; -枸>Ku; -æž¹>Hou; -æŸ>Ta; -柄>Hei; -柆>Rou; -柊>Shuu; -柎>Fu; -æŸ>Haku; -æŸ>Bou; -柑>Kan; -染>Sen; -柔>Nyuu; -柘>Sha; -柚>Yuu; -æŸ>Taku; -柞>Saku; -柢>Tei; -柤>Sa; -柧>Ko; -柩>Kyuu; -柬>Kan; -柮>Totsu; -柯>Ka; -柱>Chuu; -柳>Ryuu; -柴>Sai; -柵>Saku; -査>Sa; -柾>Kyuu; -柿>Shi; -æ „>Ei; -æ “>Sen; -æ –>Sei; -æ —>Ritsu; -æ ž>Kan; -æ ¡>Kou; -æ ¢>Haku; -æ ©>Ku; -æ ª>Chu; -æ «>Son; -æ ²>Gou; -æ ´>Sen; -æ ¸>Kaku; -æ ¹>Kon; -æ ¼>Kou; -æ ½>Sai; -æ¡€>Ketsu; -æ¡>Kou; -æ¡‚>Kei; -桃>Tou; -框>Kyou; -案>An; -æ¡>Ko; -æ¡Ž>Shitsu; -æ¡>Dou; -æ¡‘>Sou; -æ¡“>Kan; -æ¡”>Kitsu; -æ¡™>U; -æ¡œ>Ou; -æ¡Ÿ>San; -æ¡£>Tou; -桧>Kai; -æ¡´>Fu; -桶>Tou; -æ¡·>Kaku; -桾>Kun; -æ¡¿>Kan; -æ¢>Ryou; -梃>Tei; -梅>Bai; -æ¢>Sou; -æ¢>Koku; -梓>Shi; -梔>Shi; -梗>Kou; -梛>Da; -æ¢>Jou; -梟>Kyou; -梠>Ryo; -梢>Shou; -梦>Mu; -梧>Go; -梨>Ri; -梭>Sa; -梯>Tei; -械>Kai; -梱>Kon; -梳>So; -梵>Fuu; -梶>Bi; -梹>Bin; -梼>Tou; -棄>Ki; -棆>Rin; -棉>Men; -棊>Ki; -棋>Ki; -æ£>Kon; -棒>Bou; -棔>Kon; -棕>Shu; -棗>Sou; -棘>Kyoku; -棚>Hou; -棟>Tou; -棠>Tou; -棡>Kou; -棣>Tei; -棧>San; -森>Shin; -棯>Jin; -棲>Sei; -棹>Tou; -棺>Kan; -椀>Wan; -æ¤>Kaku; -椄>Setsu; -椅>I; -椈>Kiku; -椋>Ryou; -椌>Kou; -æ¤>Shoku; -椎>Tsui; -æ¤>A; -椒>Shou; -検>Ken; -椢>Kai; -椦>Ken; -椰>Ya; -椴>Tan; -椶>Shu; -椹>Chin; -椽>Ten; -椿>Chin; -楊>You; -楓>Fuu; -楔>Setsu; -楕>Da; -楙>Bou; -楚>So; -楜>Ko; -æ¥>Ren; -楞>Rou; -楠>Nan; -楡>Yu; -楢>Shuu; -楪>You; -楫>Shuu; -業>Gyou; -楮>Cho; -楯>Jun; -楳>Bai; -楴>Tei; -極>Goku; -楷>Kai; -楸>Shuu; -楹>Ei; -楼>Rou; -楽>Gaku; -概>Gai; -榎>Ka; -榑>Fu; -榔>Rou; -榕>You; -榛>Shin; -榜>Bou; -榠>Bei; -榧>Hi; -榮>Ei; -榱>Sui; -榲>Otsu; -榴>Ryuu; -榻>Tou; -榾>Kotsu; -榿>Ki; -æ§>Kou; -槃>Han; -槇>Ten; -槊>Saku; -構>Kou; -槌>Tsui; -æ§>Sou; -槎>Sa; -æ§>Kai; -槓>Kou; -様>You; -槙>Ten; -æ§>Tou; -槞>Rou; -槧>San; -槨>Kaku; -槫>Tan; -槭>Shuku; -槲>Koku; -槹>Kou; -槻>Ki; -槽>Sou; -槿>Kin; -樂>Gaku; -樅>Shou; -樊>Han; -樋>Tou; -樌>Kan; -樒>Mitsu; -樓>Rou; -樔>Sou; -樗>Cho; -標>Hyou; -樛>Kyuu; -樞>Suu; -樟>Shou; -模>Mo; -樢>Boku; -樣>You; -権>Ken; -横>Ou; -樵>Shou; -樶>Sai; -樸>Boku; -樹>Ju; -樺>Ka; -樽>Son; -æ©„>Kan; -橇>Zei; -橈>Dou; -æ©‹>Kyou; -橘>Kitsu; -æ©™>Tou; -æ©Ÿ>Ki; -æ©¡>Shou; -æ©¢>Da; -橦>Tou; -橸>Shou; -æ©¿>Kyou; -檀>Tan; -檄>Geki; -æª>Yoku; -檎>Go; -æª>En; -檗>Haku; -檜>Kai; -檠>Kei; -檢>Ken; -檣>Shou; -檪>Reki; -檬>Bou; -檮>Tou; -檳>Bin; -檸>Nei; -檻>Kan; -æ«>Mitsu; -æ«‚>Tou; -櫃>Ki; -æ«‘>Rai; -æ«“>Ro; -æ«š>Ryo; -æ«›>Shitsu; -æ«ž>En; -æ«Ÿ>Reki; -櫨>Ro; -櫪>Reki; -櫺>Rei; -æ«»>Ou; -欄>Ran; -欅>Kyo; -權>Ken; -欒>Ran; -欖>Ran; -æ¬>Utsu; -欠>Ketsu; -次>Ji; -欣>Gon; -欧>Ou; -欲>Yoku; -欷>Ki; -欸>Ai; -欹>I; -欺>Gi; -欽>Kin; -款>Kan; -æ­ƒ>Sou; -æ­‡>Ketsu; -æ­‰>Ken; -æ­Œ>Ka; -æ­Ž>Tan; -æ­>Ou; -æ­“>Kan; -æ­”>Kyo; -æ­™>Kyuu; -æ­›>Kan; -æ­Ÿ>Yo; -æ­¡>Kan; -æ­¢>Shi; -æ­£>Sei; -æ­¤>Shi; -æ­¦>Bu; -æ­©>Ho; -æ­ª>Wai; -æ­¯>Shi; -æ­³>Sei; -æ­´>Reki; -æ­¸>Ki; -æ­¹>Gatsu; -æ­»>Shi; -æ­¿>Botsu; -殀>You; -殃>You; -殄>Ten; -殆>Tai; -殉>Jun; -殊>Shu; -残>Zan; -æ®>Hyou; -殕>Fuu; -æ®–>Shoku; -殘>Zan; -殞>In; -殤>Shou; -殪>Ei; -殫>Tan; -殯>Hin; -æ®±>Sen; -殲>Sen; -殳>Shu; -æ®´>Ou; -段>Dan; -æ®·>In; -殺>Satsu; -æ®»>Kaku; -殼>Kaku; -殿>Ten; -毀>Ki; -毅>Ki; -毆>Ou; -毋>Bu; -æ¯>Bo; -毎>Mai; -毒>Doku; -毓>Iku; -比>Hi; -毘>Hi; -毛>Mou; -毫>Kou; -毬>Kyuu; -毯>Tan; -毳>Zei; -æ°ˆ>Sen; -æ°>Shi; -æ°‘>Min; -æ°“>Bou; -æ°”>Ki; -æ°—>Ki; -æ°›>Fun; -æ°£>Ki; -æ°¤>In; -æ°´>Sui; -æ°·>Hyou; -æ°¸>Ei; -æ°¾>Han; -æ±€>Tei; -æ±>Juu; -求>Kyuu; -汎>Han; -æ±>Seki; -汕>San; -æ±—>Kan; -汚>O; -æ±>Jo; -汞>Kou; -江>Kou; -æ± >Chi; -汨>Beki; -汪>Ou; -æ±°>Ta; -æ±²>Kyuu; -æ±³>Hen; -決>Ketsu; -æ±½>Ki; -æ±¾>Fun; -æ²>Shin; -沂>Ki; -沃>Yoku; -沈>Chin; -沌>Ton; -æ²>Go; -æ²>Boku; -æ²’>Botsu; -沓>Tou; -æ²–>Chuu; -æ²™>Sa; -沚>Shi; -æ²›>Hai; -没>Botsu; -æ²¢>Taku; -沫>Matsu; -æ²®>Sho; -æ²±>Ta; -æ²³>Ka; -沸>Futsu; -æ²¹>Yu; -沺>Ten; -æ²»>Ji; -æ²¼>Shou; -æ²½>Ko; -æ²¾>Ten; -沿>En; -æ³>Kyou; -泄>Ei; -æ³…>Shuu; -泉>Sen; -泊>Haku; -泌>Hitsu; -泓>Ou; -法>Hou; -æ³—>Shi; -æ³™>Hou; -æ³›>Han; -æ³>So; -泡>Hou; -æ³¢>Ha; -æ³£>Kyuu; -æ³¥>Dei; -注>Chuu; -泪>Rui; -泯>Bin; -æ³°>Tai; -æ³±>Ou; -æ³³>Ei; -æ´‹>You; -æ´Œ>Retsu; -æ´’>Sei; -æ´—>Sen; -æ´™>Shu; -æ´›>Raku; -æ´ž>Dou; -æ´Ÿ>I; -æ´¥>Shin; -æ´©>Ei; -æ´ª>Kou; -æ´«>Kyoku; -æ´²>Shuu; -æ´³>Jo; -æ´µ>Shun; -æ´¶>Kyou; -æ´¸>Kou; -æ´»>Katsu; -æ´½>Kou; -æ´¾>Ha; -æµ>Ryuu; -浄>Jou; -æµ…>Sen; -æµ™>Setsu; -浚>Shun; -浜>Hin; -æµ£>Kan; -浤>Kou; -浦>Ho; -浩>Kou; -浪>Rou; -浬>Ri; -æµ®>Fu; -æµ´>Yoku; -æµ·>Kai; -浸>Shin; -æµ¹>Shou; -涅>Netsu; -消>Shou; -涌>Yuu; -涎>Sen; -涓>Ken; -涕>Tei; -涙>Rui; -涛>Tou; -涜>Toku; -涯>Gai; -液>Eki; -涵>Kan; -涸>Ko; -涼>Ryou; -æ·€>Ten; -æ·…>Seki; -æ·†>Kou; -æ·‡>Ki; -æ·‹>Rin; -æ·Œ>Shou; -æ·‘>Shuku; -æ·’>Sei; -æ·•>Riku; -æ·˜>Tou; -æ·™>Sou; -æ·ž>Shou; -æ·¡>Tan; -æ·¤>Yo; -æ·¦>Kan; -æ·¨>Jou; -æ·ª>Rin; -æ·«>In; -æ·¬>Sai; -æ·®>Wai; -æ·±>Shin; -æ·³>Shun; -æ·µ>En; -æ··>Kon; -æ·¹>En; -æ·º>Sen; -æ·»>Ten; -清>Sei; -渇>Katsu; -済>Sai; -渉>Shou; -渊>En; -渋>Juu; -渓>Kei; -渕>En; -渙>Kan; -渚>Sho; -減>Gen; -æ¸>Yu; -渟>Tei; -渠>Kyo; -渡>To; -渣>Sa; -渤>Botsu; -渥>Aku; -渦>Ka; -温>On; -渫>Setsu; -測>Soku; -渭>I; -渮>Ka; -港>Kou; -游>Yuu; -渺>Byou; -渾>Kon; -湃>Hai; -湊>Sou; -æ¹>Tan; -湎>Ben; -æ¹–>Ko; -湘>Shou; -æ¹›>Tan; -湟>Kou; -湧>Yuu; -湫>Shou; -æ¹®>In; -湯>Tou; -æ¹²>Kan; -湶>Sen; -æ¹¾>Wan; -湿>Shitsu; -満>Man; -溂>Ratsu; -溌>Hatsu; -æº>Tou; -æº>Gen; -準>Jun; -溘>Kou; -溜>Ryuu; -æº>Kou; -溟>Mei; -溢>Itsu; -溥>Ho; -溪>Kei; -溯>So; -溲>Sou; -溶>You; -溷>Kon; -溺>Deki; -溽>Joku; -滂>Bou; -滄>Sou; -æ»…>Metsu; -滉>Kou; -滋>Ji; -滌>Deki; -滑>Katsu; -滓>Sai; -æ»”>Tou; -滕>Tou; -æ»>Sou; -滞>Tai; -滬>Ko; -滯>Tai; -滲>Shin; -æ»´>Teki; -æ»·>Ro; -滸>Ko; -滾>Kon; -滿>Man; -æ¼>Ryou; -漂>Hyou; -漆>Shitsu; -漉>Roku; -æ¼>Rou; -漑>Gai; -漓>Ri; -æ¼”>En; -漕>Sou; -æ¼ >Baku; -æ¼¢>Kan; -æ¼£>Ran; -漫>Man; -漬>Shi; -æ¼±>Sou; -æ¼²>Chou; -漸>Zen; -æ¼¾>You; -漿>Shou; -æ½>Ei; -æ½…>Kan; -æ½”>Ketsu; -潘>Han; -æ½›>Sen; -潜>Sen; -潟>Seki; -潤>Jun; -潦>Rou; -æ½­>Tan; -æ½®>Chou; -潯>Jin; -æ½°>Kai; -æ½´>Cho; -潸>San; -潺>San; -æ½¼>Dou; -æ¾€>Juu; -æ¾>Juu; -澂>Chou; -澄>Chou; -澆>Gyou; -澎>Hou; -澑>Ryuu; -æ¾—>Kan; -澡>Sou; -æ¾£>Kan; -澤>Taku; -澪>Rei; -æ¾±>Ten; -æ¾³>Iku; -æ¾¹>Tan; -æ¿€>Geki; -æ¿>Daku; -æ¿‚>Ren; -濃>Nou; -濆>Fun; -æ¿”>Dei; -æ¿•>Shitsu; -濘>Nei; -æ¿Ÿ>Sai; -æ¿ >Gou; -æ¿¡>Ju; -濤>Tou; -æ¿«>Ran; -濬>Shun; -æ¿®>Hoku; -濯>Taku; -濱>Hin; -濳>Sen; -濶>Katsu; -濺>Sen; -濾>Ryo; -ç€>You; -瀉>Sha; -瀋>Shin; -ç€>Ryuu; -瀑>Baku; -瀕>Hin; -瀘>Ro; -瀚>Kan; -瀛>Ei; -ç€>Reki; -瀞>Jou; -瀟>Shou; -瀦>Cho; -瀧>Sou; -瀬>Rai; -瀰>Bi; -瀲>Ren; -瀾>Ran; -çŒ>Kan; -ç‘>Sai; -ç˜>Dan; -ç£>Wan; -ç«>Ka; -ç¯>Tou; -ç°>Kai; -ç¸>Kyuu; -ç¼>Shaku; -ç½>Sai; -炉>Ro; -ç‚Š>Sui; -ç‚Ž>En; -ç‚’>Sou; -ç‚™>Sha; -炬>Ko; -ç‚­>Tan; -ç‚®>Hou; -炯>Kei; -炳>Hei; -炸>Saku; -点>Ten; -為>I; -烈>Retsu; -烋>Kou; -çƒ>U; -烙>Raku; -çƒ>Jou; -烟>En; -烱>Kei; -烹>Hou; -烽>Hou; -焉>En; -ç„”>En; -ç„™>Hou; -ç„š>Fun; -ç„œ>Kon; -ç„¡>Mu; -焦>Shou; -然>Zen; -焼>Shou; -ç…‰>Ren; -ç…Œ>Kou; -ç…Ž>Sen; -ç…•>Ki; -ç…–>Dan; -ç…™>En; -ç…¢>Kei; -ç…¤>Bai; -ç…¥>Kan; -ç…¦>Ku; -ç…§>Shou; -ç…©>Han; -ç…¬>You; -ç…®>Sha; -ç…½>Sen; -熄>Soku; -熈>Ki; -熊>Yuu; -ç†>Kun; -熔>You; -熕>Kou; -熙>Ki; -熟>Juku; -熨>I; -熬>Gou; -熱>Netsu; -熹>Ki; -熾>Shi; -燃>Nen; -燈>Tou; -燉>Ton; -燎>Ryou; -ç‡>Rin; -燒>Shou; -燔>Han; -燕>En; -燗>Ran; -營>Ei; -燠>Iku; -燥>Sou; -燦>San; -燧>Sui; -燬>Ki; -燭>Shoku; -燮>Shou; -燵>Tatsu; -燹>Sen; -燻>Kun; -燼>Jin; -燿>You; -爆>Baku; -çˆ>Shaku; -çˆ>Ro; -爛>Ran; -爨>San; -爪>Sou; -爬>Ha; -爭>Sou; -爰>En; -爲>I; -爵>Shaku; -父>Fu; -爺>Ya; -爻>Kou; -爼>Sho; -爽>Sou; -爾>Ji; -爿>Shou; -牀>Sou; -牆>Shou; -片>Hen; -版>Han; -牋>Sen; -牌>Hai; -牒>Chou; -牘>Toku; -牙>Ga; -牛>Gyuu; -ç‰>Hin; -牟>Bou; -牡>Bo; -牢>Rou; -牧>Boku; -物>Motsu; -牲>Sei; -牴>Tei; -特>Toku; -牽>Ken; -牾>Go; -犀>Sei; -çŠ>Ri; -犂>Ri; -犇>Hon; -犒>Kou; -犖>Raku; -犠>Gi; -犢>Toku; -犧>Gi; -犬>Ken; -犯>Han; -犲>Sai; -状>Jou; -犹>Yuu; -ç‹‚>Kyou; -狃>Juu; -ç‹„>Teki; -狆>Chuu; -ç‹Ž>Kou; -ç‹>Ko; -ç‹’>Hi; -ç‹—>Kou; -ç‹™>Sho; -ç‹›>Haku; -ç‹ >Gan; -ç‹¡>Kou; -ç‹¢>Kaku; -ç‹©>Shu; -独>Doku; -ç‹­>Kyou; -ç‹·>Ken; -狸>Ri; -狹>Kyou; -狼>Rou; -狽>Hai; -猊>Gei; -猖>Shou; -猗>I; -猛>Mou; -猜>Sai; -çŒ>Sotsu; -猟>Ryou; -猥>Wai; -猩>Sei; -猪>Cho; -猫>Byou; -献>Ken; -猯>Tan; -猴>Kou; -猶>Yuu; -猷>Yuu; -猾>Katsu; -猿>En; -ç„>Goku; -ç…>Shi; -çŽ>Shou; -ç>Baku; -ç—>Ketsu; -ç£>Juu; -ç¨>Doku; -çª>Kai; -ç°>Dou; -ç²>Kaku; -çµ>Ryou; -ç¸>Juu; -çº>Datsu; -ç»>Ken; -玄>Gen; -率>Ritsu; -玉>Gyoku; -王>Ou; -玖>Kyuu; -玩>Gan; -玲>Rei; -玳>Tai; -玻>Ha; -ç€>Haku; -ç‚>Ka; -çˆ>Ka; -çŠ>San; -ç>Chin; -çŽ>Chin; -çž>Raku; -ç >Shu; -ç¥>Ji; -çª>Kei; -ç­>Han; -ç®>Hai; -ç±>Ei; -ç¸>Go; -ç¾>Gen; -çƒ>Kyuu; -ç…>Rou; -ç†>Ri; -ç‰>Ryuu; -ç¢>Taku; -ç¥>Ko; -ç²>Hai; -ç³>Rin; -ç´>Kin; -çµ>Bi; -ç¶>Ha; -çº>Hou; -ç¿>Kon; -ç‘>Bou; -ç‘•>Ka; -ç‘™>Dou; -ç‘š>Ko; -ç‘›>Ei; -ç‘œ>Yu; -ç‘ž>Zui; -ç‘Ÿ>Shitsu; -ç‘ >Ryuu; -ç‘£>Sa; -瑤>You; -ç‘©>Ei; -瑪>Ba; -瑯>Rou; -ç‘°>Kai; -瑳>Sa; -瑶>You; -瑾>Kin; -ç’ƒ>Ri; -ç’‹>Shou; -ç’ž>Haku; -ç’¢>Ryuu; -ç’§>Heki; -ç’°>Kan; -ç’½>Ji; -ç“Š>Kei; -ç“>Rou; -ç“”>Ei; -ç“œ>Ka; -ç“ >Ko; -ç“¢>Hyou; -ç“£>Ben; -瓦>Ga; -ç“®>Ou; -瓶>Hei; -ç“·>Shi; -甃>Shuu; -甄>Ken; -甌>Ou; -ç”>Bou; -甎>Sen; -甑>Sou; -甓>Heki; -甕>Ou; -甘>Kan; -甚>Shin; -甜>Ten; -甞>Shou; -生>Sei; -産>San; -甥>Sei; -甦>So; -用>You; -甫>Ho; -甬>You; -ç”°>Den; -ç”±>Yuu; -甲>Kou; -申>Shin; -ç”·>Dan; -甸>Ten; -町>Chou; -ç”»>Ga; -甼>Chou; -ç•„>Ryuu; -畆>Ho; -畉>Fu; -ç•Š>Kou; -ç•‹>Ten; -ç•Œ>Kai; -ç•>Kai; -ç•>I; -ç•”>Han; -ç•™>Ryuu; -ç•š>Hon; -ç•›>Shin; -ç•œ>Chiku; -ç•>Ho; -ç•¢>Hitsu; -畤>Shi; -ç•¥>Ryaku; -畦>Kei; -畧>Ryaku; -番>Ban; -ç•«>Kaku; -ç•­>Yo; -ç•°>I; -畳>Jou; -ç•´>Chuu; -當>Tou; -ç•·>Tetsu; -畸>Ki; -ç•¿>Ki; -ç–‚>Jou; -ç–†>Kyou; -ç–‡>Chuu; -ç–‰>Jou; -ç–Š>Jou; -ç–‹>So; -ç–Ž>So; -ç–>So; -ç–‘>Gi; -ç–”>Chou; -ç–š>Kyuu; -ç–>San; -ç–£>Yuu; -ç–¥>Kai; -ç–«>Eki; -ç–±>Hou; -ç–²>Hi; -ç–³>Kan; -ç–µ>Shi; -ç–¸>Tan; -ç–¹>Shin; -ç–¼>Tou; -ç–½>Sho; -ç–¾>Shitsu; -ç—‚>Ka; -ç—ƒ>Ken; -ç—…>Byou; -ç—‡>Shou; -ç—Š>Sen; -ç—>I; -ç—’>You; -ç—”>Ji; -ç—•>Kon; -ç—˜>Tou; -ç—™>Kei; -ç—›>Ts; -ç—ž>Hi; -ç—¢>Ri; -ç—£>Shi; -ç—©>Sou; -ç—°>Tan; -ç—²>Ma; -ç—³>Rin; -ç—´>Chi; -ç—º>Hi; -ç—¼>Ko; -ç—¾>A; -ç—¿>I; -ç˜>Sui; -瘉>Yu; -瘋>Fuu; -ç˜>You; -瘟>On; -瘠>Seki; -瘡>Sou; -瘢>Han; -瘤>Ryuu; -瘧>Gyaku; -瘰>Rui; -瘴>Shou; -瘻>Rou; -療>Ryou; -癆>Rou; -癇>Kan; -癈>Hai; -癌>Gan; -ç™’>Yu; -ç™–>Heki; -癘>Rei; -癜>Den; -癡>Chi; -癢>You; -癧>Reki; -癨>Kaku; -癩>Rai; -癪>Shaku; -癬>Sen; -ç™°>You; -癲>Ten; -癶>Hatsu; -癸>Ki; -発>Hotsu; -ç™»>Tou; -發>Hotsu; -白>Haku; -百>Hyaku; -皀>Hyuu; -皃>Bou; -çš„>Teki; -皆>Kai; -皇>Kou; -皈>Ki; -çš‹>Kou; -皎>Kou; -çš>Kou; -çš“>Kou; -çš–>Kan; -çš™>Seki; -çšš>Gai; -çš®>Hi; -çš°>Hou; -çš´>Shun; -çš·>Ko; -皸>Kun; -çš¹>Kun; -皺>Suu; -çš¿>Bai; -盂>U; -盃>Hai; -盆>Bon; -盈>Ei; -益>Eki; -ç›>Kou; -ç›’>Kou; -ç›–>Gai; -ç›—>Tou; -ç››>Sei; -盜>Tou; -盞>San; -盟>Mei; -盡>Jin; -監>Kan; -盤>Ban; -盥>Kan; -盧>Ro; -盪>Tou; -ç›®>Moku; -盲>Mou; -ç›´>Choku; -相>Shou; -ç›»>Kei; -盾>Jun; -çœ>Sei; -眄>Ben; -眇>Byou; -眈>Tan; -眉>Bi; -看>Kan; -県>Ken; -眛>Mai; -眞>Shin; -真>Shin; -眠>Min; -眤>Tei; -眥>Sei; -眦>Sei; -眩>Gen; -眷>Ken; -眸>Bou; -眺>Chou; -眼>Gan; -ç€>Chaku; -ç‡>Tei; -çš>Gai; -ç›>Sei; -ç¡>Sui; -ç£>Toku; -ç¥>Hei; -ç¦>Boku; -ç¨>Gei; -ç«>Shou; -ç¹>To; -ç¾>Kou; -ç¿>Ei; -çž‹>Shin; -瞎>Katsu; -çž‘>Mei; -çžž>Ban; -çž >Dou; -瞥>Betsu; -瞬>Shun; -çž­>Ryou; -çž°>Kan; -çž³>Dou; -瞶>Ki; -çž¹>Ai; -çž»>Sen; -çž¼>Ken; -çž½>Ko; -çž¿>Ku; -矇>Mou; -çŸ>Kaku; -矗>Chiku; -矚>Shoku; -矛>Mu; -矜>Kin; -矢>Shi; -矣>I; -知>Chi; -矧>Shin; -矩>Ku; -短>Tan; -矮>Wai; -矯>Kyou; -石>Shaku; -矼>Kou; -ç ‚>Sa; -ç Œ>Sei; -ç ’>Hi; -ç ”>Ken; -ç •>Sai; -ç  >Sho; -ç ¥>Shi; -ç ¦>Sai; -ç §>Chin; -ç ²>Hou; -ç ´>Ha; -ç º>Rei; -ç ¿>Kou; -ç¡…>Kei; -ç¡>Shou; -ç¡«>Ryuu; -硬>Kou; -硯>Ken; -硼>Hou; -ç¢>Go; -碆>Ha; -碇>Tei; -碌>Roku; -ç¢>Gai; -碎>Sai; -碑>Hi; -碓>Tai; -碕>Ki; -碗>Wan; -碚>Hai; -碣>Ketsu; -碧>Heki; -碩>Seki; -碪>Chin; -碯>Dou; -碵>Seki; -確>Kaku; -碼>Ba; -碾>Ten; -ç£>Ji; -磅>Hou; -磆>Katsu; -磊>Rai; -磋>Sa; -ç£>Han; -磑>Gai; -磔>Taku; -磚>Sen; -磧>Seki; -磨>Ma; -磬>Kei; -磯>Ki; -磴>Tou; -磽>Kou; -ç¤>Shou; -礇>Iku; -礎>So; -礑>Tou; -礒>Gi; -礙>Gai; -礦>Kou; -礪>Rei; -礫>Reki; -礬>Ban; -示>Shi; -礼>Rei; -社>Sha; -祀>Shi; -ç¥>Ki; -祇>Ki; -祈>Ki; -祉>Shi; -ç¥>Yuu; -祓>Futsu; -祕>Hi; -祖>So; -祗>Shi; -祚>So; -ç¥>Shuku; -神>Shin; -祟>Sui; -祠>Shi; -祢>Dei; -祥>Shou; -票>Hyou; -祭>Sai; -祷>Tou; -祺>Ki; -祿>Roku; -禀>Rin; -ç¦>Kin; -禄>Roku; -禅>Zen; -禊>Kei; -ç¦>Ka; -禎>Tei; -ç¦>Fuku; -ç¦>Shoku; -禦>Gyo; -禧>Ki; -禪>Zen; -禮>Rei; -禰>Dei; -禳>Jou; -禹>U; -禺>Guu; -禽>Kin; -禾>Ka; -禿>Toku; -秀>Shuu; -ç§>Shi; -秉>Hei; -秋>Shuu; -科>Ka; -秒>Byou; -秕>Hi; -秘>Hi; -租>So; -秡>Hatsu; -秣>Matsu; -秤>Shou; -秦>Shin; -秧>Ou; -秩>Chitsu; -秬>Kyo; -称>Shou; -移>I; -稀>Ki; -稈>Kan; -程>Tei; -ç¨>Sou; -税>Zei; -稔>Jin; -稗>Hai; -稘>Ki; -稙>Choku; -稚>Chi; -稜>Ryou; -稟>Rin; -稠>Chuu; -種>Shu; -稱>Shou; -稲>Tou; -稷>Shoku; -稻>Tou; -稼>Ka; -稽>Kei; -稾>Kou; -稿>Kou; -ç©€>Koku; -ç©‚>Sui; -穃>You; -穆>Boku; -穉>Chi; -ç©>Seki; -ç©Ž>Ei; -ç©>On; -ç©>Shuu; -ç©—>Sui; -ç©¡>Shoku; -ç©¢>Ai; -ç©£>Jou; -ç©©>On; -ç©«>Kaku; -ç©°>Jou; -ç©´>Ketsu; -究>Kyuu; -穹>Kyuu; -空>Kuu; -穽>Sei; -ç©¿>Sen; -çª>Totsu; -窃>Setsu; -窄>Saku; -窈>You; -窒>Chitsu; -窓>Sou; -窕>Chou; -窖>Kou; -窗>Sou; -窘>Kin; -窟>Kutsu; -窩>Ka; -窪>Wa; -窮>Kyuu; -窯>You; -窰>You; -窶>Ku; -窺>Ki; -窿>Ryuu; -竃>Sou; -ç«„>Zan; -ç«…>Kyou; -竇>Tou; -竈>Sou; -ç«Š>Setsu; -ç«‹>Ritsu; -ç«’>Ki; -ç«™>Tan; -ç«š>Cho; -ç«œ>Ryuu; -ç«>Hei; -ç«Ÿ>Kei; -ç« >Shou; -ç«¢>Shi; -ç«£>Shun; -ç«¥>Dou; -竦>Shou; -竪>Ju; -ç«­>Ketsu; -端>Tan; -競>Kyou; -竸>Kei; -竹>Chiku; -竺>Toku; -ç«¿>Kan; -笄>Kei; -笆>Ha; -笈>Kyuu; -笊>Sou; -笋>Jun; -ç¬>Kotsu; -笑>Shou; -笘>Sen; -笙>Sou; -笛>Teki; -笞>Chi; -笠>Ryuu; -笥>Shi; -符>Fu; -笨>Hon; -第>Dai; -笳>Ka; -笵>Han; -笶>Shi; -ç­…>Sen; -ç­†>Hitsu; -ç­ˆ>Katsu; -ç­‰>Tou; -ç­‹>Kin; -ç­Œ>Sen; -ç­>Jun; -ç­>Batsu; -ç­>Kyou; -ç­‘>Chiku; -ç­’>Tou; -ç­”>Tou; -ç­–>Saku; -ç­>Sou; -ç­¥>Kyo; -ç­§>Ken; -ç­¬>Sei; -ç­®>Sei; -ç­°>Saku; -ç­±>Shou; -ç­´>Kyou; -ç­µ>En; -ç­º>Kyou; -箆>Hei; -箇>Ka; -箋>Sen; -ç®>Ko; -ç®>Sou; -ç®’>Sou; -ç®”>Haku; -箕>Ki; -ç®—>San; -箘>Kin; -ç®™>Fuku; -箚>Satsu; -箜>Kou; -ç®>Kan; -箟>Kin; -管>Kan; -箪>Tan; -ç®­>Sen; -ç®±>Shou; -ç®´>Shin; -箸>Cho; -節>Setsu; -ç¯>Kou; -範>Han; -篆>Ten; -篇>Hen; -築>Chiku; -篋>Kyou; -篌>Kou; -ç¯>Kan; -ç¯>Kou; -篠>Shou; -篤>Toku; -篥>Ritsu; -篦>Hei; -篩>Shi; -篭>Rou; -篳>Hitsu; -篶>En; -篷>Hou; -ç°€>Saku; -ç°‡>Sou; -ç°>Rou; -ç°‘>Sa; -ç°’>San; -ç°“>Sen; -ç°”>Sa; -ç°Ÿ>Ten; -ç°¡>Kan; -ç°£>Ki; -ç°§>Kou; -ç°ª>Shin; -ç°«>Shou; -ç°·>En; -ç°¸>Ha; -ç°½>Sen; -ç°¾>Ren; -ç°¿>Bo; -ç±€>Chuu; -籃>Ran; -籌>Chuu; -ç±>Seki; -ç±>Tou; -ç±”>Su; -ç±–>Sen; -籘>Tou; -籟>Rai; -ç± >Rou; -籤>Sen; -ç±¥>Yaku; -籬>Ri; -ç±³>Bei; -粃>Hi; -粉>Fun; -粋>Sui; -ç²>Ro; -ç²’>Ryuu; -粕>Haku; -ç²—>So; -粘>Nen; -ç²›>Shuku; -粟>Zoku; -粡>Tou; -ç²¢>Shi; -粤>Etsu; -ç²¥>Shuku; -粧>Shou; -粫>Ji; -ç²®>Ryou; -ç²±>Ryou; -ç²²>San; -ç²³>Kou; -ç²¹>Sui; -ç²½>Sou; -ç²¾>Sei; -糂>San; -ç³…>Juu; -糊>Ko; -ç³’>Hi; -ç³–>Tou; -糜>Bi; -糞>Fun; -糟>Sou; -ç³ >Kou; -ç³¢>Bo; -糧>Ryou; -糯>Da; -ç³²>Rei; -ç³´>Teki; -糶>Chou; -糸>Shi; -糺>Kyuu; -ç³»>Kei; -ç³¾>Kyuu; -ç´€>Ki; -ç´‚>Chuu; -ç´„>Yaku; -ç´…>Ku; -ç´†>U; -ç´Š>Bin; -ç´‹>Mon; -ç´>Tou; -ç´>Chuu; -ç´”>Shun; -ç´•>Hi; -ç´—>Sa; -ç´˜>Kou; -ç´™>Shi; -ç´š>Kyuu; -ç´›>Fun; -ç´œ>Un; -ç´ >So; -ç´¡>Bou; -ç´¢>Saku; -ç´«>Shi; -ç´¬>Chuu; -ç´®>Satsu; -ç´¯>Rui; -ç´°>Sei; -ç´²>Setsu; -ç´³>Shin; -ç´µ>Cho; -ç´¹>Shou; -ç´º>Kon; -ç´¿>Tai; -終>Shuu; -絃>Gen; -組>So; -çµ…>Kei; -絆>Ban; -絋>Kou; -経>Kei; -絎>Kou; -çµ>Setsu; -çµ>Ketsu; -çµ–>Kou; -çµ›>Jou; -絞>Kou; -絡>Raku; -çµ¢>Ken; -çµ£>Hou; -給>Kyuu; -絨>Juu; -çµ®>Jo; -çµ±>Tou; -çµ²>Shi; -çµ³>Kou; -çµµ>Kai; -絶>Zetsu; -çµ¹>Ken; -çµ½>Ryo; -綉>Tou; -ç¶>Sui; -經>Kei; -継>Kei; -続>Zoku; -綜>Sou; -綟>Rei; -綢>Chuu; -綣>Ken; -綫>Sen; -綬>Ju; -維>I; -綮>Kei; -綯>Tou; -綰>Wan; -綱>Kou; -網>Mou; -綴>Tei; -綵>Sai; -綸>Rin; -綺>Ki; -綻>Tan; -綽>Shaku; -綾>Ryou; -綿>Men; -ç·‡>Shi; -ç·Š>Kin; -ç·‹>Hi; -ç·>Sou; -ç·‘>Ryoku; -ç·’>Sho; -ç·˜>Kan; -ç·š>Sen; -ç·œ>Ben; -ç·>Shuu; -ç·ž>Tan; -ç· >Tei; -ç·¡>Bin; -ç·¤>Setsu; -ç·¨>Hen; -ç·©>Kan; -ç·¬>Men; -ç·¯>I; -ç·²>Byou; -ç·´>Ren; -ç·»>Chi; -ç¸>En; -縄>Jou; -縉>Shin; -縊>Ei; -縋>Tsui; -縒>Shi; -縛>Baku; -縞>Kou; -縟>Joku; -縡>Sai; -縢>Tou; -縣>Ken; -縦>Juu; -縫>Hou; -縮>Shuku; -縱>Juu; -縲>Rui; -縵>Ban; -縷>Ru; -縹>Hyou; -縺>Ren; -縻>Bi; -總>Sou; -績>Seki; -ç¹>Han; -繃>Hou; -繆>Kyuu; -繊>Sen; -繋>Kei; -ç¹>Shuu; -ç¹”>Shoku; -繕>Zen; -ç¹–>San; -ç¹™>Han; -繚>Ryou; -ç¹>Kan; -繞>Jou; -繦>Kyou; -繧>Un; -繩>Jou; -繪>Kai; -ç¹­>Ken; -ç¹°>Sou; -ç¹¹>Eki; -ç¹»>Ju; -ç¹¼>Kei; -ç¹½>Hin; -繿>Ran; -纂>San; -纈>Ketsu; -纉>San; -續>Zoku; -纎>Sen; -çº>Ten; -纒>Ten; -纓>Ei; -纔>San; -纖>Sen; -纛>Tou; -纜>Ran; -缶>Kan; -缸>Kou; -缺>Ketsu; -ç½…>Ka; -罌>Ou; -ç½>Rai; -罎>Tan; -ç½>Kan; -网>Bou; -ç½”>Bou; -罕>Kan; -罘>Fu; -罟>Ko; -ç½ >Bin; -罧>Shin; -罨>An; -罩>Tou; -罪>Zai; -罫>Kei; -ç½®>Chi; -ç½°>Batsu; -ç½²>Sho; -ç½µ>Ba; -ç½·>Hi; -罸>Batsu; -ç½¹>Ri; -羂>Ken; -羃>Beki; -ç¾…>Ra; -羆>Hi; -羇>Ki; -羈>Ki; -羊>You; -羌>Kyou; -美>Bi; -ç¾”>Kou; -羚>Rei; -ç¾>Tei; -羞>Shuu; -ç¾£>Gun; -群>Gun; -羨>Sen; -義>Gi; -ç¾®>Kou; -羯>Katsu; -ç¾²>Gi; -羶>Sen; -羸>Rui; -ç¾¹>Kou; -ç¾½>U; -ç¿>Ou; -ç¿…>Shi; -翆>Sui; -ç¿Š>Yoku; -ç¿Œ>Yoku; -ç¿’>Shuu; -ç¿”>Shou; -ç¿•>Kyuu; -ç¿ >Sui; -ç¿¡>Hi; -翦>Sen; -ç¿©>Hen; -ç¿«>Gan; -ç¿°>Kan; -翳>Ei; -翹>Gyou; -ç¿»>Hon; -翼>Yoku; -耀>You; -è€>Rou; -考>Kou; -耄>Mou; -者>Sha; -耆>Ki; -耋>Tetsu; -而>Ji; -è€>Tai; -耒>Rai; -耕>Kou; -耗>Mou; -耘>Un; -耙>Ha; -耜>Shi; -耡>Jo; -耨>Dou; -耳>Ji; -耶>Ya; -耻>Chi; -耽>Tan; -耿>Kou; -è†>Rei; -èŠ>Ryou; -è’>Katsu; -è–>Sei; -è˜>Hei; -èš>Shuu; -èž>Bun; -èŸ>Sei; -è¡>Sou; -è¨>Ren; -è¯>Ren; -è°>Sou; -è²>Sei; -è³>Shou; -è´>Chou; -è¶>Jou; -è·>Shoku; -è¹>Dei; -è½>Chou; -è¾>Rou; -è¿>Itsu; -è‚„>I; -è‚…>Shuku; -肆>Shi; -肇>Chou; -肉>Niku; -è‚‹>Roku; -è‚Œ>Ki; -è‚“>Kou; -è‚–>Shou; -肘>Chuu; -è‚š>To; -è‚›>Kou; -è‚>Kan; -è‚¡>Ko; -è‚¢>Shi; -è‚¥>Hi; -è‚©>Ken; -肪>Bou; -肬>Yuu; -è‚­>Dotsu; -肯>Kou; -肱>Kou; -育>Iku; -è‚´>Kou; -肺>Hai; -胃>I; -胄>Chuu; -胆>Tan; -背>Hai; -胎>Tai; -胖>Han; -胙>So; -胚>Hai; -胛>Kou; -èƒ>Chi; -胞>Hou; -胡>Ko; -胤>In; -胥>Sho; -胯>Ko; -胱>Kou; -胴>Dou; -胸>Kyou; -胼>Hen; -能>Nou; -è„‚>Shi; -è„…>Kyou; -脆>Zei; -脇>Kyou; -脈>Myaku; -脉>Myaku; -è„Š>Seki; -è„š>Kyaku; -è„›>Kei; -è„£>Shin; -è„©>Shuu; -脯>Ho; -脱>Datsu; -脳>Nou; -脹>Chou; -脾>Hi; -è…†>Ten; -è…‹>Eki; -è…Ž>Jin; -è…>Fu; -è…‘>Fu; -è…“>Hi; -è…”>Kou; -è…•>Wan; -è…Ÿ>Chitsu; -è…¥>Sei; -è…¦>Nou; -è…«>Shou; -è…®>Sai; -è…°>You; -è…±>Ken; -è…´>Yu; -è…¸>Chou; -è…¹>Fuku; -è…º>Sen; -è…¿>Tai; -膀>Hou; -膂>Ryo; -膃>Otsu; -膈>Kaku; -膊>Haku; -è†>Kou; -膓>Chou; -膕>Kaku; -膚>Fu; -膜>Maku; -è†>Shitsu; -膠>Kou; -膣>Chitsu; -膨>Bou; -膩>Ji; -膰>Han; -膳>Sen; -膵>Sui; -膸>Zui; -膺>You; -膽>Tan; -膾>Kai; -膿>Dou; -臀>Den; -臂>Hi; -臆>Oku; -臈>Rou; -臉>Ren; -è‡>Sei; -臑>Dau; -臓>Zou; -臘>Rou; -臙>En; -臚>Ryo; -臟>Zou; -臠>Ren; -臣>Shin; -臥>Ga; -臧>Zou; -臨>Rin; -自>Shi; -臭>Shuu; -至>Shi; -致>Chi; -臺>Tai; -臻>Shin; -臼>Kyuu; -臾>Yu; -èˆ>Yo; -舂>Shou; -舅>Kyuu; -與>Yo; -興>Kyou; -舉>Kyo; -舊>Kyuu; -舌>Zetsu; -èˆ>Sha; -舎>Sha; -èˆ>Shi; -舒>Jo; -舖>Ho; -舗>Ho; -舘>Kan; -舛>Sen; -舜>Shun; -舞>Bu; -舟>Shuu; -舩>Sen; -航>Kou; -舫>Hou; -般>Han; -舮>Ro; -舳>Chiku; -舵>Ta; -舶>Haku; -舷>Ken; -舸>Ka; -船>Sen; -艀>Fu; -艇>Tei; -艘>Sou; -艙>Sou; -艚>Sou; -艟>Dou; -艢>Shou; -艤>Gi; -艦>Kan; -艨>Mou; -艪>Ro; -艫>Ro; -艮>Kon; -良>Ryou; -艱>Kan; -色>Shoku; -艶>En; -艷>En; -艸>Sou; -艾>Gai; -芋>U; -èŠ>Shaku; -芒>Bou; -芙>Fu; -èŠ>Shi; -芟>San; -芥>Kai; -芦>Ro; -芫>Gen; -芬>Fun; -芭>Ba; -芯>Shin; -花>Ka; -芳>Hou; -芸>Gei; -芹>Kin; -芻>Suu; -芽>Ga; -è‹…>Gai; -è‹‘>En; -è‹’>Zen; -è‹“>Rei; -è‹”>Tai; -è‹—>Byou; -è‹™>Ryuu; -è‹›>Ka; -è‹œ>Boku; -è‹ž>Hou; -è‹Ÿ>Kou; -è‹¡>I; -è‹£>Kyo; -è‹¥>Jaku; -苦>Ku; -苧>Cho; -è‹«>Sen; -英>Ei; -苳>Tou; -è‹´>So; -苹>Hei; -苺>Mai; -è‹»>Fu; -茂>Mo; -范>Han; -茄>Ka; -茅>Bou; -茆>Bou; -茉>Matsu; -茎>Kei; -茖>Kaku; -茗>Mei; -茘>Ri; -茜>Sen; -茣>Go; -茨>Shi; -茫>Bou; -茯>Fuku; -茱>Shu; -茲>Ji; -茴>Kai; -茵>In; -茶>Cha; -茸>Jou; -茹>Jo; -è€>Jun; -è…>Tou; -è‰>Sou; -èŠ>Kei; -è>Jin; -è>Sen; -è’>Kou; -è˜>Sou; -è³>Tou; -èµ>Jin; -è·>Ka; -è»>Teki; -è¼>To; -莅>Ri; -莇>Cho; -莉>Chi; -莊>Sou; -莎>Sa; -莓>Mai; -莖>Kei; -莚>En; -莞>Kan; -莟>Kan; -莠>Yuu; -莢>Kyou; -莨>Rou; -莪>Ga; -莫>Bo; -莱>Rai; -莵>To; -莽>Bou; -è>Sei; -è…>Kan; -èŠ>Kiku; -èŒ>Kin; -èŽ>Kon; -è“>Ka; -è–>Shou; -è˜>Suu; -èœ>Sai; -èŸ>To; -è >Ha; -è©>Hai; -è«>Kin; -è¯>Ka; -è°>Ko; -è±>Ryou; -è²>Hi; -è´>An; -è·>Sou; -è»>Rin; -è½>Shuku; -èƒ>Sui; -è„>Tou; -è‡>Chou; -è‹>Sei; -èŒ>Hou; -è>Hei; -èŽ>I; -è“>Gi; -è >Hou; -è©>Shuu; -èª>Kuwa; -è¬>Man; -è±>Ken; -èµ>Wa; -è¸>Yu; -è¼>Gaku; -è½>Raku; -葆>Ho; -葉>You; -è‘Ž>Ritsu; -è‘—>Cho; -è‘›>Katsu; -è‘¡>Ho; -è‘¢>Gai; -è‘£>Tou; -葦>I; -è‘©>Ha; -è‘«>Ko; -葬>Sou; -è‘­>Ka; -è‘®>Tan; -葯>Yaku; -葱>Sou; -葵>Ki; -è‘·>Gun; -葹>Shi; -葺>Shuu; -è’‚>Tei; -è’„>Kan; -è’‹>Shou; -è’>Shuu; -è’”>Shi; -è’™>Bou; -è’œ>San; -è’Ÿ>Kon; -è’¡>Hou; -è’­>Suu; -è’²>Ho; -è’¸>Jou; -è’¹>Ken; -è’»>Jaku; -è’¼>Sou; -è’¿>Kou; -è“>Shin; -è“„>Chiku; -蓆>Seki; -蓉>You; -è“Š>Ou; -è“‹>Gai; -è“>Shi; -è“>Joku; -è“‘>Sa; -è“–>Hi; -è“š>Chou; -蓬>Hou; -è“®>Ren; -è“´>Shun; -蓼>Ryou; -è“¿>Shuku; -蔀>Hou; -蔆>Ryou; -蔑>Betsu; -蔓>Ban; -è””>Fuku; -蔕>Tei; -è”—>Sho; -蔘>Shin; -蔚>Utsu; -蔟>Zoku; -蔡>Sai; -蔦>Chou; -蔬>So; -è”­>In; -蔵>Zou; -蔽>Hei; -è•€>Kyoku; -è•>Jin; -蕃>Ban; -蕈>Shin; -蕉>Shou; -è•Š>Zui; -è•‹>Zui; -è•Ž>Kyou; -è••>Yuu; -è•—>Ro; -蕘>Jou; -è•š>Gaku; -è•£>Shun; -蕨>Ketsu; -è•©>Tou; -蕪>Bu; -è•­>Shou; -è•·>Yo; -蕾>Rai; -è–€>Un; -è–„>Haku; -è–‡>Bi; -è–ˆ>Kai; -è–Š>Kei; -è–>Rou; -è–‘>Kyou; -è–”>Shoku; -è–—>En; -è–™>Tei; -è–›>Setsu; -è–œ>Heki; -è–¤>Kai; -è–¦>Sen; -è–¨>Kou; -è–©>Satsu; -è–ª>Shin; -è–«>Kun; -è–¬>Yaku; -è–®>Sou; -è–¯>Sho; -è–¹>Tai; -è–º>Sei; -è—>Kou; -è—‰>Sha; -è—>Ran; -è—>Zou; -è—>Baku; -è—•>Guu; -è—œ>Rei; -è—>Gei; -è—¤>Tou; -è—¥>Yaku; -è—©>Han; -è—ª>Sou; -è—·>Sho; -è—¹>Ai; -è—º>Rin; -è—»>Sou; -è—¾>Rai; -蘂>Zui; -蘆>Ro; -蘇>So; -蘊>Un; -蘋>Hin; -蘓>So; -蘖>Getsu; -蘗>Haku; -蘚>Sen; -蘢>Rou; -蘭>Ran; -蘯>Tou; -蘿>Ra; -è™>Ko; -虎>Ko; -è™>Gyaku; -è™”>Ken; -處>Sho; -虚>Kyo; -虜>Ryo; -虞>Gu; -號>Gou; -虧>Ki; -虫>Chuu; -è™±>Shitsu; -虹>Kou; -è™»>Bou; -蚊>Bun; -èš‹>Zei; -蚌>Hou; -èš“>In; -èš•>San; -蚣>Kou; -蚤>Sou; -èš©>Shi; -蚪>Tou; -èš«>Hou; -蚯>Kyuu; -èš°>Yuu; -蚶>Kan; -蛄>Ko; -蛆>Sho; -蛇>Ja; -蛉>Rei; -蛋>Tan; -è›>Kei; -蛎>Rei; -è›”>Kai; -è›™>A; -è››>Shu; -蛞>Katsu; -蛟>Kou; -蛤>Kou; -蛩>Kyou; -蛬>Kyou; -è›­>Shitsu; -è›®>Ban; -蛸>Sou; -蛹>You; -è›»>Zei; -蛾>Ga; -蜀>Shoku; -蜂>Hou; -蜃>Shin; -蜆>Ken; -蜈>Go; -蜉>Fu; -蜊>Ri; -èœ>Sho; -蜑>Tan; -蜒>En; -蜘>Chi; -蜚>Hi; -蜜>Mitsu; -蜥>Seki; -蜩>Chou; -蜴>Eki; -蜷>Ken; -蜻>Sei; -蜿>En; -è‰>Sen; -è‹>Rou; -èŒ>Ka; -èŽ>Katsu; -è“>Yu; -è•>Shoku; -è—>Kou; -è™>Hen; -èŸ>I; -è >Fuku; -è£>Yuu; -è¦>Ka; -è¨>Shitsu; -èª>Tou; -è®>Fuku; -è´>Ko; -è¶>Chou; -è¸>Ka; -è¿>You; -èž‚>Rou; -èž>Yuu; -螟>Mei; -螢>Kei; -èž«>Seki; -螯>Gou; -èž³>Tou; -螺>Ra; -èž»>Rou; -èž½>Shuu; -蟀>Shutsu; -蟄>Chitsu; -蟆>Ba; -蟇>Ba; -蟋>Shitsu; -èŸ>Tou; -蟒>Bou; -蟠>Han; -蟯>Gyou; -蟲>Ki; -蟶>Tei; -蟷>Tou; -蟹>Kai; -蟻>Gi; -蟾>Sen; -è …>You; -è >Katsu; -è Ž>Bou; -è >Kai; -è ‘>Ei; -è •>Da; -è –>Kaku; -è ¡>Rei; -è ¢>Shun; -è £>Rei; -è §>To; -è ±>Ko; -è ¶>San; -è ¹>To; -è »>Ban; -è¡€>Ketsu; -è¡‚>Jiku; -è¡„>Jiku; -衆>Shuu; -è¡Œ>Kou; -è¡>En; -è¡’>Ken; -è¡“>Jutsu; -è¡—>Gai; -è¡™>Gyo; -è¡›>Ei; -è¡>Shou; -è¡ž>Ei; -è¡¡>Kou; -è¡¢>Ku; -è¡£>I; -表>Hyou; -è¡«>San; -è¡°>Sa; -衲>Dou; -衵>Jitsu; -è¡·>Chuu; -衽>Jin; -衾>Kin; -è¡¿>Kin; -è¢>En; -袂>Bei; -袈>Ka; -袋>Tai; -è¢>Hou; -袒>Tan; -袖>Shuu; -袗>Shin; -袙>Ha; -袞>Kon; -袢>Han; -袤>Bou; -被>Hi; -袮>Ne; -袱>Fuku; -袴>Ko; -袵>Jin; -袷>Kou; -袿>Kei; -è£>Sai; -裂>Retsu; -装>Sou; -è£>Ri; -裔>Ei; -裕>Yuu; -裘>Kyuu; -裙>Kun; -補>Ho; -è£>Sou; -裟>Sa; -裡>Ri; -裨>Hi; -裲>Ryou; -裳>Shou; -裴>Hai; -裸>Ra; -裹>Ka; -裼>Seki; -製>Sei; -裾>Kyo; -褂>Kai; -複>Fuku; -褊>Hen; -褌>Kon; -è¤>Katsu; -褒>Hou; -褓>Ho; -è¤>Tan; -褞>On; -褥>Joku; -褪>Tai; -褫>Chi; -褶>Chou; -褸>Rou; -褻>Setsu; -è¥>Kyou; -襃>Hou; -襄>Jou; -襌>Tan; -è¥>Zatsu; -襖>Ou; -襞>Heki; -襟>Kin; -襠>Tou; -襤>Ran; -襦>Ju; -襪>Betsu; -襭>Ketsu; -襯>Shin; -襲>Shuu; -襴>Ran; -襾>Aka; -西>Sei; -è¦>You; -覃>Tan; -覆>Fuku; -覇>Ha; -覈>Kaku; -覊>Ki; -見>Ken; -è¦>Ki; -覓>Beki; -視>Shi; -覗>Shi; -覘>Ten; -覚>Kaku; -覡>Geki; -覦>Yu; -覧>Ran; -覩>To; -親>Shin; -覬>Ki; -覯>Kou; -覲>Kin; -観>Kan; -覺>Kaku; -覽>Ran; -覿>Teki; -觀>Kan; -角>Kaku; -觚>Ko; -觜>Shi; -è§>Tei; -解>Kai; -触>Shoku; -觧>Kai; -觴>Shou; -觸>Shoku; -言>Gen; -訂>Tei; -訃>Fu; -計>Kei; -訊>Jin; -訌>Kou; -討>Tou; -è¨>Ketsu; -訓>Kun; -訖>Kitsu; -託>Taku; -記>Ki; -訛>Ka; -è¨>Ga; -訟>Shou; -訣>Ketsu; -訥>Totsu; -訪>Hou; -設>Setsu; -許>Kyo; -訳>Yaku; -訴>So; -訶>Ka; -診>Shin; -註>Chuu; -証>Shou; -è©>Ko; -詆>Tei; -詈>Ri; -è©>Sa; -è©‘>Ta; -è©’>Tai; -è©”>Shou; -è©•>Hyou; -è©›>So; -è©ž>Shi; -è© >Ei; -è©¢>Jun; -è©£>Kei; -試>Shi; -è©©>Shi; -è©«>Ta; -詬>Kou; -è©­>Ki; -è©®>Sen; -è©°>Kitsu; -話>Wa; -該>Gai; -詳>Shou; -詼>Kai; -誂>Chou; -誄>Rui; -誅>Chuu; -誇>Ko; -誉>Yo; -誌>Shi; -èª>Nin; -誑>Kyou; -誓>Sei; -誕>Tan; -誘>Yuu; -誚>Shou; -語>Go; -誠>Sei; -誡>Kai; -誣>Fu; -誤>Go; -誥>Kou; -誦>Shou; -誨>Kai; -説>Setsu; -読>Toku; -誰>Sui; -課>Ka; -誹>Hi; -誼>Gi; -調>Chou; -è«‚>Ten; -è«„>Jun; -談>Dan; -è«‹>Sei; -è«Œ>Kan; -è«>Sou; -è«>Shu; -è«’>Ryou; -è«–>Ron; -è«š>Jou; -è«›>Yu; -è«œ>Chou; -è«ž>Hen; -è« >Ken; -è«¡>Shi; -è«¢>Kon; -諤>Gaku; -諦>Tei; -諧>Kai; -è««>Kan; -è«­>Yu; -è«®>Shi; -諱>Ki; -諳>An; -è«·>Fuu; -諸>Sho; -諺>Gen; -諾>Daku; -謀>Bou; -è¬>Etsu; -謂>I; -謄>Tou; -謇>Ken; -謌>Ka; -謎>Mei; -è¬>Hitsu; -謔>Gyaku; -謖>Shoku; -謗>Bou; -謙>Ken; -謚>Shi; -講>Kou; -è¬>Sha; -謠>You; -謡>You; -謦>Kei; -謨>Bo; -謫>Taku; -謬>Byou; -謳>Ou; -謹>Kin; -謾>Ban; -è­>Ka; -è­‰>Shou; -è­Œ>Ka; -è­Ž>Kitsu; -è­>Ki; -è­–>Shin; -è­˜>Shiki; -è­š>Tan; -è­›>Shin; -è­œ>Fu; -è­Ÿ>Sou; -è­¦>Kei; -è­«>Sen; -è­¬>Hi; -è­¯>Yaku; -è­°>Gi; -è­±>Zen; -è­²>Jou; -è­´>Ken; -è­·>Go; -è­½>Yo; -讀>Toku; -讃>San; -變>Hen; -讌>En; -讎>Shuu; -è®>Shuu; -è®’>San; -讓>Jou; -è®–>Shin; -è®™>Kan; -讚>San; -è°·>Koku; -è°º>Ka; -è°¿>Kei; -è±>Katsu; -豆>Tou; -豈>Ki; -豊>Hou; -豌>En; -豎>Ju; -è±>Hou; -豕>Shi; -豚>Ton; -象>Shou; -è±¢>Ken; -豪>Gou; -豫>Yo; -豬>Cho; -豸>Chi; -è±¹>Hou; -豺>Sai; -è±¼>Hi; -貂>Chou; -è²…>Kyuu; -貉>Kaku; -貊>Haku; -貌>Bou; -è²>Ri; -貎>Gei; -è²”>Hi; -貘>Baku; -è²>Bai; -貞>Tei; -è² >Fu; -財>Zai; -è²¢>Kou; -貧>Hin; -貨>Ka; -販>Han; -貪>Don; -貫>Kan; -責>Seki; -è²­>Shitsu; -è²®>Ni; -貯>Cho; -è²°>Sei; -è²²>Shi; -è²³>Ni; -è²´>Ki; -貶>Hen; -è²·>Bai; -貸>Tai; -è²»>Hi; -è²¼>Ten; -è²½>I; -貿>Bou; -è³€>Ga; -è³>Hi; -賂>Ro; -賃>Chin; -賄>Wai; -資>Shi; -賈>Ko; -賊>Zoku; -è³>Sou; -賎>Sen; -賑>Shin; -賓>Hin; -賚>Rai; -è³›>San; -賜>Shi; -賞>Shou; -è³ >Bai; -è³¢>Ken; -è³£>Bai; -賤>Sen; -賦>Fu; -質>Shitsu; -è³­>To; -賺>Tan; -è³»>Fu; -è³¼>Kou; -è³½>Sai; -è´„>Shi; -è´…>Zei; -è´‡>In; -è´ˆ>Zou; -è´Š>San; -è´‹>Gan; -è´>Sen; -è´>Ei; -è´>Shin; -è´“>Zou; -è´”>Hi; -è´–>Shoku; -赤>Seki; -赦>Sha; -赧>Tan; -赫>Kaku; -èµ­>Sha; -èµ°>Sou; -èµ±>Sou; -èµ³>Kyuu; -èµ´>Fu; -èµ·>Ki; -è¶>Chin; -超>Chou; -越>Etsu; -趙>Chou; -趣>Shu; -趨>Suu; -足>Soku; -趺>Fu; -趾>Shi; -è·‚>Ki; -è·‹>Batsu; -è·Œ>Tetsu; -è·>Ka; -è·–>Seki; -è·š>San; -è·›>Ha; -è·>Kyo; -è·Ÿ>Kon; -è·¡>Seki; -è·£>Sen; -è·¨>Ko; -è·ª>Ki; -è·«>Kyou; -è·¯>Ro; -è·³>Chou; -è·µ>Sen; -è·¼>Kyoku; -è·¿>To; -踈>Sho; -踉>Ryou; -踊>You; -è¸>Tou; -è¸>Sen; -è¸>Ka; -踞>Kyo; -踟>Chi; -踪>Shou; -踰>Yu; -踴>You; -踵>Shou; -蹂>Juu; -蹄>Tei; -蹇>Ken; -蹈>Tou; -蹉>Sa; -蹊>Kei; -蹌>Shou; -è¹>Seki; -蹕>Hitsu; -è¹™>Shuku; -蹟>Seki; -è¹ >Seki; -è¹£>Man; -蹤>Shou; -è¹²>Son; -è¹´>Shuu; -蹶>Ketsu; -è¹¼>Boku; -èº>Sou; -躄>Heki; -躅>Choku; -躇>Cho; -躊>Chuu; -躋>Sei; -èº>Yaku; -躑>Teki; -躓>Chi; -躔>Ten; -躙>Rin; -躡>Jou; -躪>Rin; -身>Shin; -躬>Kyuu; -躯>Ku; -躰>Tei; -躱>Ta; -軆>Tei; -車>Sha; -軋>Atsu; -軌>Ki; -è»>Gun; -è»’>Ken; -è»›>Aku; -軟>Nan; -転>Ten; -軣>Gou; -軫>Shin; -軸>Jiku; -è»»>Ka; -軼>Itsu; -軽>Kei; -軾>Shoku; -較>Kaku; -è¼…>Ro; -載>Sai; -輊>Chi; -輌>Ryou; -è¼’>Chou; -輓>Ban; -è¼”>Fu; -輕>Kei; -è¼™>Chou; -è¼›>Ryou; -輜>Shi; -è¼>Ki; -輟>Tetsu; -輦>Ren; -輩>Hai; -輪>Rin; -輯>Shuu; -è¼³>Sou; -輸>Yu; -è¼¹>Fuku; -è¼»>Fuku; -è¼¾>Ten; -輿>Yo; -轂>Koku; -轄>Katsu; -è½…>En; -轆>Roku; -轉>Ten; -è½>Tetsu; -轎>Kyou; -è½—>Kan; -轜>Ji; -轟>Gou; -轡>Hi; -è½¢>Reki; -è½£>Reki; -轤>Ro; -è¾›>Shin; -辜>Ko; -辞>Ji; -辟>Heki; -è¾£>Ratsu; -辧>Ben; -辨>Ben; -è¾­>Ji; -è¾®>Hen; -辯>Ben; -è¾°>Shin; -è¾±>Joku; -è¾²>Nou; -辺>Hen; -辿>Ten; -è¿‚>U; -è¿„>Kitsu; -è¿…>Jin; -è¿Ž>Gei; -è¿‘>Kin; -è¿”>Hen; -è¿¢>Chou; -è¿¥>Kei; -迦>Ka; -è¿©>Ji; -迪>Teki; -è¿«>Haku; -è¿­>Tetsu; -迯>Tou; -è¿°>Jutsu; -è¿´>Kai; -è¿·>Mei; -迸>Hou; -迹>Seki; -迺>Dai; -追>Tsui; -退>Tai; -é€>Sou; -逃>Tou; -逅>Kou; -逆>Gyaku; -逋>Ho; -é€>Shou; -逎>Shuu; -é€>Tou; -é€>Chiku; -逑>Kyuu; -逓>Tei; -途>To; -逕>Kei; -逖>Teki; -逗>Tou; -這>Gen; -通>Ts; -é€>Sei; -逞>Tei; -速>Soku; -造>Zou; -逡>Shun; -逢>Hou; -連>Ren; -逮>Tai; -週>Shuu; -進>Shin; -逵>Ki; -逶>I; -逸>Itsu; -逹>Tatsu; -逼>Hitsu; -逾>Yu; -é>Ton; -é‚>Sui; -é…>Chi; -é‡>Guu; -é‰>Tei; -éŠ>Yuu; -é‹>Un; -é>Hen; -éŽ>Ka; -é>Atsu; -é>Ka; -é‘>Kou; -é’>Shuu; -é“>Dou; -é”>Tatsu; -é•>I; -é˜>Kou; -é™>You; -éœ>Son; -éž>Tei; -é >En; -é¡>So; -é£>Ken; -é¥>You; -é¨>Gou; -é©>Teki; -é­>Sou; -é®>Sha; -é¯>Ton; -é²>Chi; -éµ>Jun; -é¶>Jou; -é·>Sen; -é¸>Sen; -éº>I; -é¼>Ryou; -é½>Kyo; -é¿>Hi; -é‚€>You; -é‚>Bai; -é‚‚>Kai; -邃>Sui; -é‚„>Kan; -邇>Ji; -邉>Hen; -é‚Š>Hen; -é‚>Ra; -é‚‘>Yuu; -é‚£>Da; -邦>Hou; -邨>Son; -邪>Ya; -邯>Kan; -邱>Kyuu; -邵>Shou; -邸>Tei; -éƒ>Iku; -郊>Kou; -郎>Rou; -郛>Fu; -郡>Gun; -郢>Ei; -郤>Geki; -部>Bu; -郭>Kaku; -郵>Yuu; -郷>Kyou; -都>To; -é„‚>Gaku; -é„’>Suu; -é„™>Hi; -é„­>Tei; -é„°>Rin; -鄲>Tan; -é…‰>Yuu; -é…Š>Tei; -é…‹>Shuu; -é…Œ>Shaku; -é…>Hai; -é…Ž>Chuu; -é…’>Shu; -é…”>Sui; -é…–>Tan; -é…˜>Tou; -é…¢>Saku; -é…£>Kan; -é…¥>So; -é…©>Mei; -é…ª>Raku; -é…¬>Shuu; -é…²>Tei; -é…³>In; -é…µ>Kou; -é…·>Koku; -é…¸>San; -醂>Rin; -醇>Shun; -醉>Sui; -醋>Saku; -é†>Tei; -é†>Ko; -醒>Sei; -醗>Hatsu; -醜>Shuu; -醢>Kai; -醤>Shou; -醪>Rou; -醫>I; -醯>Kei; -醴>Rei; -醵>Kyo; -醸>Jou; -醺>Kun; -釀>Jou; -é‡>Kin; -釆>Han; -采>Sai; -釈>Shaku; -釉>Yuu; -釋>Shaku; -里>Ri; -é‡>Chou; -野>Ya; -é‡>Ryou; -é‡>Ri; -金>Kin; -釖>Tou; -釘>Tei; -釛>Koku; -釜>Fu; -é‡>Shin; -釟>Hatsu; -釡>Fu; -釣>Chou; -釦>Kou; -釧>Sen; -釵>Sa; -釶>Shi; -釼>Ken; -釿>Kin; -éˆ>Don; -鈎>Kou; -鈑>Han; -鈔>Shou; -鈕>Chuu; -鈞>Kin; -鈩>Ro; -鈬>Taku; -鈴>Rei; -鈷>Ko; -鈿>Ten; -鉄>Tetsu; -鉅>Kyo; -鉈>Sha; -鉉>Ken; -鉋>Hou; -é‰>Seki; -鉗>Kan; -鉚>Ryuu; -鉛>En; -鉞>Etsu; -鉢>Hachi; -鉤>Kou; -鉦>Sei; -鉱>Kou; -鉾>Bou; -銀>Gin; -銃>Juu; -銅>Dou; -銑>Sen; -銓>Sen; -銕>Tetsu; -銖>Shu; -銘>Mei; -銚>You; -銛>Sen; -銜>Kan; -銭>Sen; -銷>Shou; -銹>Shuu; -é‹>Kyou; -é‹’>Hou; -鋤>Jo; -é‹©>Bou; -鋪>Ho; -é‹­>Ei; -鋳>Chuu; -鋸>Kyo; -鋺>En; -鋼>Kou; -錆>Sei; -éŒ>A; -éŒ>Sui; -錘>Tsui; -錙>Shi; -錚>Sou; -錠>Jou; -錢>Sen; -錣>Tei; -錦>Kin; -錨>Byou; -錫>Seki; -錬>Ren; -錮>Ko; -錯>Saku; -録>Roku; -錻>Bu; -é„>Kei; -é‹>Ka; -é>To; -é”>Gaku; -é–>Chin; -é›>Tan; -éœ>Ka; -é >Kou; -é¬>Shuu; -é®>Chuu; -éµ>Ken; -é¼>Shin; -é¾>Shou; -鎌>Ren; -鎔>You; -鎖>Sa; -鎗>Sou; -鎚>Tsui; -鎧>Gai; -鎬>Kou; -鎭>Chin; -鎮>Chin; -鎰>Itsu; -éƒ>Zoku; -éˆ>Ren; -é>Ryuu; -é‘>Teki; -é–>Ou; -é—>Kou; -é˜>Shou; -é>Man; -é¡>Kyou; -é¤>Rou; -é¥>Shuu; -é¨>San; -éƒ>Dou; -é‡>Han; -é>Ryou; -é“>Tai; -é”>Shin; -é˜>Shou; -é™>Tou; -éš>A; -é¡>Tetsu; -é«>Sen; -éµ>Tetsu; -é¶>Kan; -é¸>Taku; -éº>Tou; -é‘>Ban; -é‘„>Chuu; -é‘‘>Kan; -é‘’>Kan; -é‘š>San; -é‘›>Kou; -é‘ž>Rou; -é‘ >Shaku; -é‘¢>Ryo; -鑪>Ro; -é‘°>Yaku; -鑵>Kan; -é‘·>Jou; -鑼>Ra; -鑽>San; -鑾>Ran; -é‘¿>Saku; -é’>Kaku; -é•·>Chou; -é–€>Mon; -é–‚>San; -é–ƒ>Sen; -é–‡>Hei; -é–‰>Hei; -é–‹>Kai; -é–>Jun; -é–‘>Kan; -é–“>Kan; -é–”>Bin; -é–˜>Kou; -é–™>Tou; -é–¢>Kan; -é–£>Kaku; -é–¤>Kou; -é–¥>Batsu; -é–§>Kou; -é–¨>Kei; -é–­>Ro; -é–²>Etsu; -é–¹>En; -é–»>En; -é–¼>A; -é–¾>Yoku; -é—ƒ>Geki; -é—‡>An; -é—Š>Katsu; -é—Œ>Ran; -é—>To; -é—”>Kou; -é—•>Ketsu; -é—–>Chin; -é—˜>Tou; -é—œ>Kan; -é—¡>Sen; -é—¢>Heki; -é—¥>Tatsu; -阜>Fu; -阡>Sen; -阨>Aku; -阪>Han; -阮>Gen; -阯>Shi; -防>Bou; -阻>So; -阿>A; -陀>Da; -陂>Ha; -附>Fu; -陋>Rou; -陌>Haku; -é™>Kou; -é™>Ta; -é™>Gen; -é™›>Hei; -陜>Kou; -é™>Sen; -陞>Shou; -陟>Choku; -院>In; -陣>Jin; -除>Jo; -陥>Kan; -陦>Tou; -陪>Bai; -陬>Suu; -é™°>In; -陲>Sui; -陳>Chin; -陵>Ryou; -陶>Tou; -é™·>Kan; -陸>Riku; -険>Ken; -陽>You; -éš…>Guu; -隆>Ryuu; -隈>Wai; -隊>Tai; -éš‹>Ta; -éš>Kou; -階>Kai; -éš>Zui; -éš”>Kaku; -éš•>In; -éš—>Kai; -隘>Ai; -éš™>Geki; -éš›>Sai; -éšœ>Shou; -éš >In; -隣>Rin; -隧>Sui; -隨>Zui; -險>Ken; -éš°>Shitsu; -éš±>In; -éš²>Shitsu; -éš´>Rou; -隶>Tai; -éš·>Rei; -隸>Rei; -éš¹>Sui; -éš»>Seki; -éš¼>Jun; -雀>Jaku; -é›>Gan; -雄>Yuu; -é›…>Ga; -集>Shuu; -雇>Ko; -雉>Chi; -雋>Sen; -雌>Shi; -é›>You; -雎>Sho; -雑>Zatsu; -雕>Chou; -é›–>Sui; -é›™>Sou; -é››>Suu; -雜>Zatsu; -離>Ri; -難>Nan; -雨>U; -雪>Setsu; -雫>Da; -é›°>Fun; -雲>Un; -零>Rei; -é›·>Rai; -雹>Haku; -é›»>Den; -需>Ju; -霄>Shou; -霆>Tei; -震>Shin; -霈>Hai; -霊>Rei; -éœ>Kaku; -霎>Sou; -éœ>Hi; -霑>Ten; -霓>Gei; -霖>Rin; -霙>Ei; -霜>Sou; -霞>Ka; -霤>Ryuu; -霧>Mu; -霪>In; -霰>San; -露>Ro; -霸>Haku; -霹>Heki; -霽>Sei; -霾>Bai; -é‚>Reki; -é„>Ai; -é†>Tai; -éˆ>Rei; -é‰>Ai; -é’>Sei; -é–>Sei; -é™>Sei; -éœ>Sei; -éž>Hi; -é >Kou; -é¡>Hi; -é¢>Men; -é¤>Hou; -é¦>Ten; -é¨>You; -é©>Kaku; -é«>Sai; -é­>Jin; -é±>Jin; -é´>Ka; -é¹>Ketsu; -éº>Matsu; -é¼>Tan; -éž>Hi; -éž„>Hou; -éž…>Ou; -éž‹>Ai; -éž>An; -éž>Kyou; -鞘>Sou; -éžœ>Tou; -éž >Kiku; -鞣>Juu; -鞦>Shuu; -鞨>Katsu; -éž«>Kiku; -éž­>Hen; -éž³>Tou; -éž´>Fuku; -韃>Datsu; -韆>Sen; -韈>Betsu; -韋>I; -韓>Kan; -韜>Tou; -韭>Kyuu; -韮>Kyou; -韲>Sei; -音>On; -韵>In; -韶>Shou; -韻>In; -響>Kyou; -é >Ketsu; -é ‚>Chou; -é ƒ>Kei; -é …>Kou; -é †>Jun; -é ˆ>Shu; -é Œ>Shou; -é >Kou; -é >Yo; -é ‘>Gan; -é ’>Han; -é “>Ton; -é —>Ha; -é ˜>Ryou; -é š>Kei; -é ¡>Kitsu; -é ¤>I; -é ¬>Kyou; -é ­>Tou; -é ´>Ei; -é ·>Kan; -é ¸>Kei; -é »>Hin; -é ¼>Rai; -é ½>Tai; -顆>Ka; -é¡‹>Sai; -é¡Œ>Dai; -é¡>Gaku; -é¡Ž>Gaku; -é¡>Gan; -é¡”>Gan; -é¡•>Ken; -願>Gan; -é¡›>Ten; -é¡ž>Rui; -顧>Ko; -é¡«>Sen; -顯>Ken; -é¡°>Hin; -顱>Ro; -顳>Shou; -é¡´>Kan; -風>Fuu; -颯>Satsu; -颱>Tai; -颶>Ku; -飃>Hyou; -飄>Hyou; -飆>Hyou; -飛>Hi; -飜>Hon; -食>Shoku; -飢>Ki; -飩>Ton; -飫>Yo; -飭>Choku; -飮>In; -飯>Han; -飲>In; -飴>I; -飼>Shi; -飽>Hou; -飾>Shoku; -餃>Kou; -餅>Hei; -餉>Shou; -養>You; -餌>Ji; -é¤>San; -餒>Dai; -餓>Ga; -餔>Ho; -餘>Yo; -é¤>Shoku; -餞>Sen; -餠>Hei; -餡>Kan; -餤>Tan; -館>Kan; -餬>Ko; -餮>Tetsu; -餽>Ki; -餾>Ryuu; -饂>Un; -饅>Man; -饉>Kin; -饋>Ki; -饌>Sen; -é¥>I; -饑>Ki; -饒>Jou; -饕>Tou; -饗>Kyou; -首>Shu; -馗>Ki; -馘>Kaku; -香>Kou; -馥>Fuku; -馨>Kei; -馬>Ba; -馭>Gyo; -馮>Hyou; -馳>Chi; -馴>Shun; -馼>Bun; -é§>Baku; -駄>Ta; -駅>Eki; -駆>Ku; -駈>Ku; -é§>Chuu; -駑>Do; -駒>Ku; -駕>Ga; -駘>Tai; -駛>Shi; -é§>Ta; -駟>Shi; -駢>Hen; -駭>Kai; -駮>Haku; -駱>Raku; -駸>Shin; -駻>Kan; -駿>Shun; -é¨>Tei; -騅>Sui; -騎>Ki; -é¨>Ki; -騒>Sou; -験>Ken; -騙>Hen; -騨>Tan; -騫>Ken; -騰>Tou; -騷>Sou; -騾>Ra; -é©€>Baku; -é©‚>San; -驃>Hyou; -é©…>Ku; -é©>Gyou; -é©•>Kyou; -é©—>Ken; -é©š>Kyou; -é©›>Eki; -é©Ÿ>Shuu; -é©¢>Ryo; -驤>Jou; -é©¥>Ki; -é©©>Kan; -驪>Ri; -é©«>Hyuu; -骨>Kotsu; -骭>Kan; -骰>Tou; -骸>Kai; -骼>Kaku; -é«€>Hi; -é«„>Zui; -é«>Rou; -é«‘>Toku; -é«“>Zui; -é«”>Tei; -高>Kou; -é«ž>Sou; -é«Ÿ>Hyou; -é«¢>Tei; -é«£>Hou; -髦>Bou; -髪>Hatsu; -é««>Chou; -é«­>Shi; -é«®>Hatsu; -髯>Zen; -髱>Hou; -é«´>Futsu; -é«·>Kyoku; -é«»>Kei; -鬆>Shou; -鬘>Ban; -鬚>Shu; -鬟>Kan; -鬢>Hin; -鬣>Ryou; -鬥>Tou; -鬧>Tou; -鬨>Kou; -鬩>Geki; -鬪>Tou; -鬮>Kyuu; -鬯>Chou; -鬱>Utsu; -鬲>Reki; -鬻>Shuku; -鬼>Ki; -é­>Kai; -é­‚>Kon; -é­ƒ>Batsu; -é­„>Haku; -é­…>Mi; -é­>Bou; -é­Ž>Ryou; -é­>Gi; -é­‘>Chi; -é­”>Ma; -é­˜>En; -é­š>Gyo; -é­¯>Ro; -é­´>Hou; -鮃>Hyou; -鮎>Nen; -鮑>Hou; -é®’>Fu; -鮓>Sa; -鮟>An; -é® >Gai; -鮨>Shi; -鮪>I; -鮫>Kou; -é®­>Kei; -é®®>Sen; -鮹>Sou; -鯀>Kon; -鯆>Ho; -鯉>Ri; -鯊>Sa; -鯔>Shi; -鯖>Sei; -鯛>Chou; -鯡>Hi; -鯢>Gei; -鯣>Eki; -鯤>Kon; -鯨>Gei; -鯰>Nen; -鯵>Sou; -é°„>I; -é°†>Shun; -é°ˆ>Chou; -é°‰>Kou; -é°Š>Ren; -é°Œ>Shuu; -é°>Shuu; -é°>Gaku; -é°’>Fuku; -é°“>Sai; -é°”>Kan; -é°•>Ka; -é°›>On; -é°¡>Ryuu; -é°¤>Shi; -é°¥>Kan; -é°­>Ki; -é°®>On; -é°²>Gou; -é°¹>Ken; -é°º>Sou; -é°»>Ban; -é°¾>Hyou; -鱆>Shou; -鱇>Kou; -鱈>Setsu; -é±’>Son; -é±—>Rin; -é± >Kai; -鱧>Rei; -鱶>Shou; -鱸>Ro; -é³¥>Chou; -鳧>Fu; -鳩>Kyuu; -鳫>Gan; -鳬>Fu; -é³³>Hou; -é³´>Mei; -鳶>En; -é´ƒ>Ketsu; -é´†>Chin; -é´‡>Hou; -é´ˆ>Gan; -é´‰>A; -é´Ž>Ou; -é´’>Rei; -é´•>Ta; -é´›>En; -é´Ÿ>Shi; -é´£>Ko; -é´¦>You; -é´¨>Ou; -é´ª>Itsu; -é´¬>Ou; -é´»>Kou; -é´¾>Bou; -é´¿>Kou; -éµ>Kou; -鵄>Shi; -éµ>Bu; -鵑>Ken; -éµ™>Geki; -鵜>Tei; -éµ>Ga; -鵞>Ga; -éµ >Koku; -鵡>Bu; -鵬>Hou; -鵯>Hi; -éµ²>Jaku; -鵺>Ya; -鶇>Tou; -鶉>Shun; -é¶>Kei; -鶚>Gaku; -鶤>Kon; -鶩>Boku; -鶯>Ou; -鶲>Ou; -鶴>Kaku; -鶸>Jaku; -鶺>Seki; -鶻>Kotsu; -é·>Geki; -é·‚>You; -é·„>Kei; -é·†>Ten; -é·>Ten; -é·“>Sha; -é·™>Shi; -é·¦>Shou; -é·­>Ban; -é·¯>Ryou; -é·²>Shuu; -é·¸>Itsu; -é·¹>You; -é·º>Ro; -é·½>Kaku; -鸚>Ou; -鸛>Kan; -鸞>Ran; -é¹µ>Ro; -鹸>Ken; -é¹¹>Kan; -é¹½>En; -鹿>Roku; -éº>So; -麈>Shu; -麋>Bi; -麌>Gu; -麑>Gei; -麒>Ki; -麓>Roku; -麕>Kin; -麗>Rei; -éº>Sha; -麟>Rin; -麥>Baku; -麦>Baku; -麩>Fu; -麪>Men; -麭>Hou; -麸>Fu; -麹>Kiku; -麺>Men; -麻>Ma; -麼>Ma; -麾>Ki; -麿>Ro; -黄>Kou; -黌>Kou; -é»>Sho; -黎>Rei; -é»>Nen; -é»>Chi; -é»’>Koku; -é»”>Ken; -默>Moku; -é»™>Moku; -é»›>Tai; -黜>Chutsu; -é»>Yuu; -點>Ten; -é» >Katsu; -黥>Gei; -黨>Tou; -黯>An; -é»´>Bai; -黶>En; -é»·>Toku; -黹>Chi; -é»»>Futsu; -黼>Ho; -黽>Bou; -鼇>Gou; -鼈>Betsu; -鼎>Tei; -鼓>Ko; -鼕>Tou; -é¼ >So; -鼡>Sho; -鼬>Yuu; -é¼»>Bi; -é¼¾>Kan; -齊>Sei; -齋>Sai; -齎>Sei; -é½>Sei; -é½’>Shi; -é½”>Shin; -齟>So; -é½ >Chou; -齡>Rei; -é½¢>Rei; -é½£>Shutsu; -齦>Gin; -齧>Ketsu; -齪>Soku; -齬>Gyo; -é½²>Ku; -齶>Gaku; -é½·>Aku; -é¾>Ryuu; -龕>Gan; -龜>Ki; -é¾>Shuu; -é¾ >Yaku; - -# eof diff --git a/icu4j/src/com/ibm/icu/demo/components/AppletFrame.java b/icu4j/src/com/ibm/icu/demo/components/AppletFrame.java deleted file mode 100755 index 169be2db4d..0000000000 --- a/icu4j/src/com/ibm/icu/demo/components/AppletFrame.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/demo/components/Attic/AppletFrame.java,v $ - * $Date: 2001/12/03 17:49:03 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ -package com.ibm.icu.demo.components; -import java.applet.*; -import java.net.URL; -import java.util.Enumeration; -import java.util.Iterator; -import java.awt.*; -import java.awt.event.*; -import java.io.InputStream; -import java.io.IOException; - -/** - *

A Frame that runs an Applet within itself, making it possible - * for an applet to run as an application. Usage: - * - *

- * public class MyApplet extends Applet {
- *     public static void main(String args[]) {
- *         MyApplet applet = new MyApplet();
- *         new AppletFrame("My Applet Running As An App", applet, 640, 480);
- *     }
- *     ...
- * }
- * 
- *
- * 

Copyright © IBM Corporation 1999. All rights reserved. - * - * @author Alan Liu - * @version $RCSfile: AppletFrame.java,v $ $Revision: 1.3 $ $Date: 2001/12/03 17:49:03 $ - */ -public class AppletFrame extends Frame implements AppletStub, AppletContext { - - Applet applet; - - private static final String COPYRIGHT = - "\u00A9 IBM Corporation 1999. All rights reserved."; - - /** - * Construct a Frame running the given Applet with the default size - * of 640 by 480. - * When the Frame is closed, the applet's stop() method is called, - * the Frame is dispose()d of, and System.exit(0) is called. - * - * @param name the Frame title - * @param applet the applet to be run - */ - public AppletFrame(String name, Applet applet) { - this(name, applet, 640, 480); - } - - /** - * Construct a Frame running the given Applet with the given size. - * When the Frame is closed, the applet's stop() method is called, - * the Frame is dispose()d of, and System.exit(0) is called. - * - * @param name the Frame title - * @param applet the applet to be run - * @param width width of the Frame - * @param height height of the Frame - */ - public AppletFrame(String name, Applet applet, int width, int height) { - super(name); - this.applet = applet; - applet.setStub(this); - - setSize(width, height); - add("Center", applet); - show(); - addWindowListener(new WindowAdapter() { - public void windowClosing(WindowEvent e) { - AppletFrame.this.applet.stop(); - dispose(); - System.exit(0); - } - }); - - applet.init(); - applet.start(); - } - - // AppletStub API - public void appletResize(int width, int height) { - setSize(width, height); - } - - public AppletContext getAppletContext() { - return this; - } - - public URL getCodeBase() { - return null; - } - - public URL getDocumentBase() { - return null; - } - - public String getParameter(String name) { - return "PARAMETER"; - } - - public boolean isActive() { - return true; - } - - - // AppletContext API - public Applet getApplet(String name) { - return applet; - } - - public Enumeration getApplets() { - return null; - } - - public AudioClip getAudioClip(URL url) { - return null; - } - - public Image getImage(URL url) { - return null; - } - - public void showDocument(URL url) {} - public void showDocument(URL url, String target) {} - - public void showStatus(String status) { - System.out.println(status); - } - - public void setStream(String key, InputStream stream) throws IOException { - } - - public InputStream getStream(String key) { - return null; - } - - public Iterator getStreamKeys() { - return null; - } -} diff --git a/icu4j/src/com/ibm/icu/demo/components/DumbTextComponent.java b/icu4j/src/com/ibm/icu/demo/components/DumbTextComponent.java deleted file mode 100755 index 66024df8a7..0000000000 --- a/icu4j/src/com/ibm/icu/demo/components/DumbTextComponent.java +++ /dev/null @@ -1,796 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/demo/components/Attic/DumbTextComponent.java,v $ - * $Date: 2001/11/29 17:28:37 $ - * $Revision: 1.4 $ - * - ***************************************************************************************** - */ -package com.ibm.icu.demo.components; -import java.awt.*; -import java.awt.event.*; -import java.text.*; -import java.awt.datatransfer.*; - -// LIU: Changed from final to non-final -public class DumbTextComponent extends Canvas - implements KeyListener, MouseListener, MouseMotionListener, FocusListener - { - private transient static final String copyright = - "Copyright \u00A9 1998, Mark Davis. All Rights Reserved."; - private transient static boolean DEBUG = false; - - private String contents = ""; - private Selection selection = new Selection(); - private int activeStart = -1; - private boolean editable = true; - - private transient Selection tempSelection = new Selection(); - private transient boolean focus; - private transient BreakIterator lineBreaker = BreakIterator.getLineInstance(); - private transient BreakIterator wordBreaker = BreakIterator.getWordInstance(); - private transient BreakIterator charBreaker = BreakIterator.getCharacterInstance(); - private transient int lineAscent; - private transient int lineHeight; - private transient int lineLeading; - private transient int lastHeight = 10; - private transient int lastWidth = 50; - private static final int MAX_LINES = 200; // LIU: Use symbolic name - private transient int[] lineStarts = new int[MAX_LINES]; // LIU - private transient int lineCount = 1; - - private transient boolean valid = false; - private transient FontMetrics fm; - private transient boolean redoLines = true; - private transient boolean doubleClick = false; - private transient TextListener textListener; - private transient ActionListener selectionListener; - private transient Image cacheImage; - private transient Dimension mySize; - private transient int xInset = 5; - private transient int yInset = 5; - private transient Point startPoint = new Point(); - private transient Point endPoint = new Point(); - private transient Point caretPoint = new Point(); - private transient Point activePoint = new Point(); - - //private transient static String clipBoard; - - private static final char CR = '\015'; // LIU - - // ============================================ - - public DumbTextComponent() { - addMouseListener(this); - addMouseMotionListener(this); - addKeyListener(this); - addFocusListener(this); - setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); - - } - -// ================ Events ==================== - - public boolean isFocusTraversable() { return true; } - - public void addActionListener(ActionListener l) { - selectionListener = AWTEventMulticaster.add(selectionListener, l); - } - - public void removeActionListener(ActionListener l) { - selectionListener = AWTEventMulticaster.remove(selectionListener, l); - } - - public void addTextListener(TextListener l) { - textListener = AWTEventMulticaster.add(textListener, l); - } - - public void removeTextListener(TextListener l) { - textListener = AWTEventMulticaster.remove(textListener, l); - } - - private transient boolean pressed; - - public void mousePressed(MouseEvent e) { - if (DEBUG) System.out.println("mousePressed"); - if (pressed) { - select(e,false); - } else { - doubleClick = e.getClickCount() > 1; - requestFocus(); - select(e, true); - pressed = true; - } - } - - public void mouseDragged(MouseEvent e) { - if (DEBUG) System.out.println("mouseDragged"); - select(e, false); - } - - public void mouseReleased(MouseEvent e) { - if (DEBUG) System.out.println("mouseReleased"); - pressed = false; - } - - public void mouseEntered(MouseEvent e) { - //if (pressed) select(e, false); - } - - public void mouseExited(MouseEvent e){ - //if (pressed) select(e, false); - } - - public void mouseClicked(MouseEvent e) {} - public void mouseMoved(MouseEvent e) {} - - - public void focusGained(FocusEvent e) { - if (DEBUG) System.out.println("focusGained"); - focus = true; - valid = false; - repaint(16); - } - public void focusLost(FocusEvent e) { - if (DEBUG) System.out.println("focusLost"); - focus = false; - valid = false; - repaint(16); - } - - public void select(MouseEvent e, boolean first) { - setKeyStart(-1); - point2Offset(e.getPoint(), tempSelection); - if (first) { - if ((e.getModifiers() & InputEvent.SHIFT_MASK) == 0) { - tempSelection.anchor = tempSelection.caret; - } - } - // fix words - if (doubleClick) { - tempSelection.expand(wordBreaker); - } - select(tempSelection); - } - - public void keyPressed(KeyEvent e) { - int code = e.getKeyCode(); - if (DEBUG) System.out.println("keyPressed " - + hex((char)code) + ", " + hex((char)e.getModifiers())); - int start = selection.getStart(); - int end = selection.getEnd(); - boolean shift = (e.getModifiers() & KeyEvent.SHIFT_MASK) != 0; - boolean ctrl = (e.getModifiers() & KeyEvent.CTRL_MASK) != 0; - - switch (code) { - case KeyEvent.VK_Q: - if (!ctrl || !editable) break; - setKeyStart(-1); - fixHex(); - break; - case KeyEvent.VK_V: - if (!ctrl) break; - if (!editable) { - this.getToolkit().beep(); - } else { - paste(); - } - break; - case KeyEvent.VK_C: - if (!ctrl) break; - copy(); - break; - case KeyEvent.VK_X: - if (!ctrl) break; - if (!editable) { - this.getToolkit().beep(); - } else { - copy(); - insertText(""); - } - break; - case KeyEvent.VK_A: - if (!ctrl) break; - setKeyStart(-1); - select(Integer.MAX_VALUE, 0, false); - break; - case KeyEvent.VK_RIGHT: - setKeyStart(-1); - tempSelection.set(selection); - tempSelection.nextBound(ctrl ? wordBreaker : charBreaker, +1, shift); - select(tempSelection); - break; - case KeyEvent.VK_LEFT: - setKeyStart(-1); - tempSelection.set(selection); - tempSelection.nextBound(ctrl ? wordBreaker : charBreaker, -1, shift); - select(tempSelection); - break; - case KeyEvent.VK_UP: // LIU: Add support for up arrow - setKeyStart(-1); - tempSelection.set(selection); - tempSelection.caret = lineDelta(tempSelection.caret, -1); - if (!shift) { - tempSelection.anchor = tempSelection.caret; - } - select(tempSelection); - break; - case KeyEvent.VK_DOWN: // LIU: Add support for down arrow - setKeyStart(-1); - tempSelection.set(selection); - tempSelection.caret = lineDelta(tempSelection.caret, +1); - if (!shift) { - tempSelection.anchor = tempSelection.caret; - } - select(tempSelection); - break; - case KeyEvent.VK_DELETE: // LIU: Add delete key support - if (!editable) break; - setKeyStart(-1); - if (contents.length() == 0) break; - start = selection.getStart(); - end = selection.getEnd(); - if (start == end) { - ++end; - if (end > contents.length()) { - getToolkit().beep(); - return; - } - } - replaceRange("", start, end); - break; - } - } - - void copy() { - Clipboard cb = this.getToolkit().getSystemClipboard(); - StringSelection ss = new StringSelection( - contents.substring(selection.getStart(), selection.getEnd())); - cb.setContents(ss, ss); - } - - void paste () { - Clipboard cb = this.getToolkit().getSystemClipboard(); - Transferable t = cb.getContents(this); - if (t == null) { - this.getToolkit().beep(); - return; - } - try { - String temp = (String) t.getTransferData(DataFlavor.stringFlavor); - insertText(temp); - } catch (Exception e) { - this.getToolkit().beep(); - } - } - - /** - * LIU: Given an offset into contents, moves up or down by lines, - * according to lineStarts[]. - * @param off the offset into contents - * @param delta how many lines to move up (< 0) or down (> 0) - * @return the new offset into contents - */ - private int lineDelta(int off, int delta) { - int line = findLine(off, false); - int posInLine = off - lineStarts[line]; - // System.out.println("off=" + off + " at " + line + ":" + posInLine); - line += delta; - if (line < 0) { - line = posInLine = 0; - } else if (line >= lineCount) { - return contents.length(); - } - off = lineStarts[line] + posInLine; - if (off >= lineStarts[line+1]) { - off = lineStarts[line+1] - 1; - } - return off; - } - - public void keyReleased(KeyEvent e) { - int code = e.getKeyCode(); - if (DEBUG) System.out.println("keyReleased " - + hex((char)code) + ", " + hex((char)e.getModifiers())); - } - - public void keyTyped(KeyEvent e) { - char ch = e.getKeyChar(); - if (DEBUG) System.out.println("keyTyped " - + hex((char)ch) + ", " + hex((char)e.getModifiers())); - if ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0) return; - int start, end; - switch (ch) { - case KeyEvent.CHAR_UNDEFINED: - break; - case KeyEvent.VK_BACK_SPACE: - setKeyStart(-1); - if (!editable) break; - if (contents.length() == 0) break; - start = selection.getStart(); - end = selection.getEnd(); - if (start == end) { - --start; - if (start < 0) { - getToolkit().beep(); // LIU: Add audio feedback of NOP - return; - } - } - replaceRange("", start, end); - break; - case KeyEvent.VK_DELETE: - setKeyStart(-1); - if (!editable) break; - if (contents.length() == 0) break; - start = selection.getStart(); - end = selection.getEnd(); - if (start == end) { - ++end; - if (end > contents.length()) { - getToolkit().beep(); // LIU: Add audio feedback of NOP - return; - } - } - replaceRange("", start, end); - break; - default: - if (!editable) break; - // LIU: Dispatch to subclass API - handleKeyTyped(e); - break; - } - } - - // LIU: Subclass API for handling of key typing - protected void handleKeyTyped(KeyEvent e) { - insertText(String.valueOf(e.getKeyChar())); - } - - protected void setKeyStart(int keyStart) { - if (activeStart != keyStart) { - activeStart = keyStart; - repaint(10); - } - } - - protected int getKeyStart() { - return activeStart; - } - -// ===================== Control ====================== - - public synchronized void setEditable(boolean b) { - editable = b; - } - - public boolean isEditable() { - return editable; - } - - public void select(Selection newSelection) { - newSelection.pin(contents); - if (!selection.equals(newSelection)) { - selection.set(newSelection); - if (selectionListener != null) { - selectionListener.actionPerformed( - new ActionEvent(this, ActionEvent.ACTION_PERFORMED, - "Selection Changed", 0)); - } - repaint(10); - valid = false; - } - } - - public void select(int start, int end) { - select(start, end, false); - } - - public void select(int start, int end, boolean clickAfter) { - tempSelection.set(start, end, clickAfter); - select(tempSelection); - } - - public int getSelectionStart() { - return selection.getStart(); - } - - public int getSelectionEnd() { - return selection.getEnd(); - } - - public void setBounds(int x, int y, int w, int h) { - super.setBounds(x,y,w,h); - redoLines = true; - } - - public Dimension getPreferredSize() { - return new Dimension(lastWidth,lastHeight); - } - - public Dimension getMaximumSize() { - return new Dimension(lastWidth,lastHeight); - } - - public Dimension getMinimumSize() { - return new Dimension(lastHeight,lastHeight); - } - - public void setText(String text) { - setText2(text); - select(tempSelection.set(selection).pin(contents)); - } - - public void setText2(String text) { - contents = text; - charBreaker.setText(text); - wordBreaker.setText(text); - lineBreaker.setText(text); - redoLines = true; - if (textListener != null) - textListener.textValueChanged( - new TextEvent(this, TextEvent.TEXT_VALUE_CHANGED)); - repaint(16); - } - - public void insertText(String text) { - if (activeStart == -1) activeStart = selection.getStart(); - replaceRange(text, selection.getStart(), selection.getEnd()); - } - - public void replaceRange(String s, int start, int end) { - setText2(contents.substring(0,start) + s - + contents.substring(end)); - select(tempSelection.set(selection). - fixAfterReplace(start, end, s.length())); - } - - public String getText() { - return contents; - } - - public void setFont(Font font) { - super.setFont(font); - redoLines = true; - repaint(16); - } - - // ================== Graphics ====================== - - public void update(Graphics g) { - if (DEBUG) System.out.println("update"); - paint(g); - } - - public void paint(Graphics g) { - mySize = getSize(); - if (cacheImage == null - || cacheImage.getHeight(this) != mySize.height - || cacheImage.getWidth(this) != mySize.width) { - cacheImage = createImage(mySize.width, mySize.height); - valid = false; - } - if (!valid || redoLines) { - if (DEBUG) System.out.println("painting"); - paint2(cacheImage.getGraphics()); - valid = true; - } - //getToolkit().sync(); - if (DEBUG) System.out.println("copying"); - g.drawImage(cacheImage, - 0, 0, mySize.width, mySize.height, - 0, 0, mySize.width, mySize.height, - this); - } - - public void paint2(Graphics g) { - g.clearRect(0, 0, mySize.width, mySize.height); - if (DEBUG) System.out.println("print"); - if (focus) g.setColor(Color.black); - else g.setColor(Color.gray); - g.drawRect(0,0,mySize.width-1,mySize.height-1); - g.setClip(1,1, - mySize.width-2,mySize.height-2); - g.setColor(Color.black); - g.setFont(getFont()); - fm = g.getFontMetrics(); - lineAscent = fm.getAscent(); - lineLeading = fm.getLeading(); - lineHeight = lineAscent + fm.getDescent() + lineLeading; - int y = yInset + lineAscent; - String lastSubstring = ""; - if (redoLines) fixLineStarts(mySize.width-xInset-xInset); - for (int i = 0; i < lineCount; y += lineHeight, ++i) { - // LIU: Don't display terminating ^M characters - int lim = lineStarts[i+1]; - if (lim > 0 && contents.length() > 0 && - contents.charAt(lim-1) == CR) --lim; - lastSubstring = contents.substring(lineStarts[i],lim); - g.drawString(lastSubstring, xInset, y); - } - drawSelection(g, lastSubstring); - lastHeight = y + yInset - lineHeight + yInset; - lastWidth = mySize.width-xInset-xInset; - } - - void paintRect(Graphics g, int x, int y, int w, int h) { - if (focus) { - g.fillRect(x, y, w, h); - } else { - g.drawRect(x, y, w-1, h-1); - } - } - - public void drawSelection(Graphics g, String lastSubstring) { - g.setXORMode(Color.black); - if (activeStart != -1) { - offset2Point(activeStart, false, activePoint); - g.setColor(Color.magenta); - int line = activePoint.x - 1; - g.fillRect(line, activePoint.y, 1, lineHeight); - } - if (selection.isCaret()) { - offset2Point(selection.caret, selection.clickAfter, caretPoint); - } else { - if (focus) g.setColor(Color.blue); - else g.setColor(Color.yellow); - offset2Point(selection.getStart(), true, startPoint); - offset2Point(selection.getEnd(), false, endPoint); - if (selection.getStart() == selection.caret) - caretPoint.setLocation(startPoint); - else caretPoint.setLocation(endPoint); - if (startPoint.y == endPoint.y) { - paintRect(g, startPoint.x, startPoint.y, - Math.max(1,endPoint.x-startPoint.x), lineHeight); - } else { - paintRect(g, startPoint.x, startPoint.y, - (mySize.width-xInset)-startPoint.x, lineHeight); - if (startPoint.y + lineHeight < endPoint.y) - paintRect(g, xInset, startPoint.y + lineHeight, - (mySize.width-xInset)-xInset, endPoint.y - startPoint.y - lineHeight); - paintRect(g, xInset, endPoint.y, endPoint.x-xInset, lineHeight); - } - } - if (focus || selection.isCaret()) { - if (focus) g.setColor(Color.green); - else g.setColor(Color.red); - int line = caretPoint.x - (selection.clickAfter ? 0 : 1); - g.fillRect(line, caretPoint.y, 1, lineHeight); - int w = lineHeight/12 + 1; - int braces = line - (selection.clickAfter ? -1 : w); - g.fillRect(braces, caretPoint.y, w, 1); - g.fillRect(braces, caretPoint.y + lineHeight - 1, w, 1); - } - } - - public Point offset2Point(int off, boolean start, Point p) { - int line = findLine(off, start); - int width = 0; - try { - width = fm.stringWidth( - contents.substring(lineStarts[line], off)); - } catch (Exception e) { - System.out.println(e); - } - p.x = width + xInset; - if (p.x > mySize.width - xInset) - p.x = mySize.width - xInset; - p.y = lineHeight * line + yInset; - return p; - } - - private int findLine(int off, boolean start) { - // if it is start, then go to the next line! - if (start) ++off; - for (int i = 1; i < lineCount; ++i) { - // LIU: This was <= ; changed to < to make caret after - // final CR in line appear at START of next line. - if (off < lineStarts[i]) return i-1; - } - // LIU: Check for special case; after CR at end of the last line - if (off == lineStarts[lineCount] && - off > 0 && contents.length() > 0 && contents.charAt(off-1) == CR) { - return lineCount; - } - return lineCount-1; - } - - // offsets on any line will go from start,true to end,false - // excluding start,false and end,true - public Selection point2Offset(Point p, Selection o) { - if (p.y < yInset) { - o.caret = 0; - o.clickAfter = true; - return o; - } - int line = (p.y - yInset)/lineHeight; - if (line >= lineCount) { - o.caret = contents.length(); - o.clickAfter = false; - return o; - } - int target = p.x - xInset; - if (target <= 0) { - o.caret = lineStarts[line]; - o.clickAfter = true; - return o; - } - int lowGuess = lineStarts[line]; - int lowWidth = 0; - int highGuess = lineStarts[line+1]; - int highWidth = fm.stringWidth(contents.substring(lineStarts[line],highGuess)); - if (target >= highWidth) { - o.caret = lineStarts[line+1]; - o.clickAfter = false; - return o; - } - while (lowGuess < highGuess - 1) { - int guess = (lowGuess + highGuess)/2; - int width = fm.stringWidth(contents.substring(lineStarts[line],guess)); - if (width <= target) { - lowGuess = guess; - lowWidth = width; - if (width == target) break; - } else { - highGuess = guess; - highWidth = width; - } - } - // at end, either lowWidth < target < width(low+1), or lowWidth = target - int highBound = charBreaker.following(lowGuess); - int lowBound = charBreaker.previous(); - // we are now at character boundaries - if (lowBound != lowGuess) - lowWidth = fm.stringWidth(contents.substring(lineStarts[line],lowBound)); - if (highBound != highGuess) - highWidth = fm.stringWidth(contents.substring(lineStarts[line],highBound)); - // we now have the right widths - if (target - lowWidth < highWidth - target) { - o.caret = lowBound; - o.clickAfter = true; - } else { - o.caret = highBound; - o.clickAfter = false; - } - // we now have the closest! - return o; - } - - private void fixLineStarts(int width) { - lineCount = 1; - lineStarts[0] = 0; - if (contents.length() == 0) { - lineStarts[1] = 0; - return; - } - int end = 0; - // LIU: Add check for MAX_LINES - for (int start = 0; start < contents.length() && lineCount < MAX_LINES; - start = end) { - end = nextLine(fm, start, width); - lineStarts[lineCount++] = end; - if (end == start) { // LIU: Assertion - throw new RuntimeException("nextLine broken"); - } - } - --lineCount; - redoLines = false; - } - - // LIU: Enhanced to wrap long lines. Bug with return of start fixed. - public int nextLine(FontMetrics fm, int start, int width) { - int len = contents.length(); - for (int i = start; i < len; ++i) { - // check for line separator - char ch = (contents.charAt(i)); - if (ch >= 0x000A && ch <= 0x000D || ch == 0x2028 || ch == 0x2029) { - len = i + 1; - if (ch == 0x000D && i+1 < len && contents.charAt(i+1) == 0x000A) // crlf - ++len; // grab extra char - break; - } - } - String subject = contents.substring(start,len); - if (visibleWidth(fm, subject) <= width) - return len; - - // LIU: Remainder of this method rewritten to accomodate lines - // longer than the component width by first trying to break - // into lines; then words; finally chars. - int n = findFittingBreak(fm, subject, width, lineBreaker); - if (n == 0) { - n = findFittingBreak(fm, subject, width, wordBreaker); - } - if (n == 0) { - n = findFittingBreak(fm, subject, width, charBreaker); - } - return n > 0 ? start + n : len; - } - - /** - * LIU: Finds the longest substring that fits a given width - * composed of subunits returned by a BreakIterator. If the smallest - * subunit is too long, returns 0. - * @param fm metrics to use - * @param line the string to be fix into width - * @param width line.substring(0, result) must be <= width - * @param breaker the BreakIterator that will be used to find subunits - * @return maximum characters, at boundaries returned by breaker, - * that fit into width, or zero on failure - */ - private int findFittingBreak(FontMetrics fm, String line, int width, - BreakIterator breaker) { - breaker.setText(line); - int last = breaker.first(); - int end = breaker.next(); - while (end != BreakIterator.DONE && - visibleWidth(fm, line.substring(0, end)) <= width) { - last = end; - end = breaker.next(); - } - return last; - } - - public int visibleWidth(FontMetrics fm, String s) { - int i; - for (i = s.length()-1; i >= 0; --i) { - char ch = s.charAt(i); - if (!(ch == ' ' || ch >= 0x000A && ch <= 0x000D || ch == 0x2028 || ch == 0x2029)) - return fm.stringWidth(s.substring(0,i+1));; - } - return 0; - } - -// =============== Utility ==================== - - private void fixHex() { - if (selection.getEnd() == 0) return; - int store = 0; - int places = 1; - int count = 0; - int min = Math.min(8,selection.getEnd()); - for (int i = 0; i < min; ++i) { - char ch = contents.charAt(selection.getEnd()-1-i); - int value = Character.getNumericValue(ch); - if (value < 0 || value > 15) break; - store += places * value; - ++count; - places *= 16; - } - String add = ""; - int bottom = store & 0xFFFF; - if (store >= 0xD8000000 && store < 0xDC000000 - && bottom >= 0xDC00 && bottom < 0xE000) { // surrogates - add = "" + (char)(store >> 16) + (char)bottom; - } else if (store > 0xFFFF && store <= 0x10FFFF) { - store -= 0x10000; - add = "" + (char)(((store >> 10) & 0x3FF) + 0xD800) - + (char)((store & 0x3FF) + 0xDC00); - - } else if (count >= 4) { - count = 4; - add = ""+(char)(store & 0xFFFF); - } else { - count = 1; - char ch = contents.charAt(selection.getEnd()-1); - add = hex(ch); - if (ch >= 0xDC00 && ch <= 0xDFFF && selection.getEnd() > 1) { - ch = contents.charAt(selection.getEnd()-2); - if (ch >= 0xD800 && ch <= 0xDBFF) { - count = 2; - add = hex(ch) + add; - } - } - } - replaceRange(add, selection.getEnd()-count, selection.getEnd()); - } - - public static String hex(char ch) { - String result = Integer.toString(ch,16).toUpperCase(); - result = "0000".substring(result.length(),4) + result; - return result; - } -} diff --git a/icu4j/src/com/ibm/icu/demo/components/Selection.java b/icu4j/src/com/ibm/icu/demo/components/Selection.java deleted file mode 100755 index 2db0d6c257..0000000000 --- a/icu4j/src/com/ibm/icu/demo/components/Selection.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/demo/components/Attic/Selection.java,v $ - * $Date: 2001/11/28 19:27:09 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.icu.demo.components; -import java.text.*; - -public final class Selection { - - public int anchor; - public int caret; - public boolean clickAfter; - - public int getStart() { - return anchor < caret ? anchor : caret; - } - - public int getEnd() { - return anchor > caret ? anchor : caret; - } - - public boolean isCaret() { - return anchor == caret; - } - - public Selection set(Selection other) { - anchor = other.anchor; - caret = other.caret; - clickAfter = other.clickAfter; - return this; - } - - public Selection set(int anchor, int caret, boolean clickAfter) { - this.anchor = anchor; - this.caret = caret; - this.clickAfter = clickAfter; - return this; - } - - public boolean equals(Object other) { - Selection other2 = (Selection)other; - return anchor == other2.anchor - && caret == other2.caret - && clickAfter == other2.clickAfter; - } - - public boolean isLessThan(Selection other) { - return getStart() < other.getEnd(); - } - - public Selection pin(String text) { - if (anchor > text.length()) { - anchor = text.length(); - } else if (anchor < 0) { - anchor = 0; - } - if (caret > text.length()) { - caret = text.length(); - clickAfter = true; - } else if (caret < 0) { - caret = 0; - clickAfter = false; - } - return this; - } - - public Selection swap(Selection after) { - int temp = anchor; - anchor = after.anchor; - after.anchor = temp; - temp = caret; - caret = after.caret; - after.caret = temp; - boolean b = clickAfter; - clickAfter = after.clickAfter; - after.clickAfter = b; - return this; - } - - public Selection fixAfterReplace(int start, int end, int len) { - if (anchor >= start) { - if (anchor < end) anchor = end; - anchor = start + len + anchor - end; - } - if (caret >= start) { - if (caret < end) caret = end; - caret = start + len + caret - end; - } - return this; - } - - // Mac & Windows considerably different - // Mac: end++. If start!=end, start=end - // SHIFT: move end right - // CTL: no different - // Windows: - // UNSHIFTED: if start!=end, start = end, else start=end=end+1; - // anchor = tip = start - // SHIFT: tip++ - // CTL: if start!=end, start = end = nextbound(end-1), - // else start=end=nextbound(end) - // anchor = tip = start - // CTL/SHIFT: tip = nextbound(tip) - - public Selection nextBound(BreakIterator breaker, - int direction, boolean extend) { - if (!extend && anchor != caret) caret -= direction; - caret = next(caret, breaker, direction, true); - if (!extend) anchor = caret; - clickAfter = false; - return this; - } - - // expand start and end to word breaks--if they are not already on one - public void expand(BreakIterator breaker) { - if (anchor <= caret) { - anchor = next(anchor,breaker,-1,false); - caret = next(caret,breaker,1,false); - /* - try { - breaker.following(anchor); - anchor = breaker.previous(); - } catch (Exception e) {} - try { - caret = breaker.following(caret-1); - } catch (Exception e) {} - */ - } else { - anchor = next(anchor,breaker,1,false); - caret = next(caret,breaker,-1,false); - /* - try { - breaker.following(caret); - caret = breaker.previous(); - } catch (Exception e) {} - try { - anchor = breaker.following(anchor-1); - } catch (Exception e) {} - */ - } - } - - // different = false - move to next boundary, unless on one - // true - move to next boundary, even if on one - public static int next(int position, BreakIterator breaker, - int direction, boolean different) { - if (!different) position -= direction; - try { - if (direction > 0) { - position = breaker.following(position); - } else { - breaker.following(position-1); - position = breaker.previous(); - } - } catch (Exception e) {} - return position; - } -} - diff --git a/icu4j/src/com/ibm/icu/demo/components/TransliteratingTextComponent.java b/icu4j/src/com/ibm/icu/demo/components/TransliteratingTextComponent.java deleted file mode 100755 index 016eb976a1..0000000000 --- a/icu4j/src/com/ibm/icu/demo/components/TransliteratingTextComponent.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/demo/components/Attic/TransliteratingTextComponent.java,v $ - * $Date: 2001/11/28 22:24:29 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.icu.demo.components; - -import java.awt.*; -import java.awt.event.*; -import java.text.*; -import java.awt.datatransfer.*; -import com.ibm.text.*; - -/** - * A subclass of {@link DumbTextComponent} that passes key events through - * a {@link com.ibm.text.Transliterator}. - * - *

Copyright © IBM Corporation 1999. All rights reserved. - * - * @author Alan Liu - * @version $RCSfile: TransliteratingTextComponent.java,v $ $Revision: 1.2 $ $Date: 2001/11/28 22:24:29 $ - */ -public class TransliteratingTextComponent extends DumbTextComponent { - - private static boolean DEBUG = true; - - private Transliterator translit = null; - - // NOTE: DISABLE THE START AND CURSOR UNTIL WE CAN GET IT TO WORK AT ALL - - // Index into getText() where the start of transliteration is. - // As we commit text during transliteration, we advance - // this. - //private int start = 0; - - // Index into getText() where the cursor is; cursor >= start - //private int cursor = 0; - - private static final String COPYRIGHT = - "\u00A9 IBM Corporation 1999. All rights reserved."; - - /** - * Constructor. - */ - public TransliteratingTextComponent() { - super(); - /* - addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - // We get an ActionEvent only when the selection changes - resetTransliterationStart(); - } - }); - */ - } - - /** - * {@link DumbTextComponent} API. Framework method that is called - * when a KeyEvent is received. This implementation - * runs the new character through the current - * Transliterator, if one is set, and inserts the - * transliterated text into the buffer. - */ - protected void handleKeyTyped(KeyEvent e) { - char ch = e.getKeyChar(); - - if (translit == null) { - setKeyStart(-1); - super.handleKeyTyped(e); - return; - } - - transliterate(ch, false); - } - - public void flush() { - if (translit != null) transliterate('\uFFFF', true); - } - - - protected void transliterate(char ch, boolean flush) { - - // ------------------------------------------------------------ - // The following case motivates the two lines that recompute - // start and cursor below. - - // " " - // a b c q r|s t u m m - // 0 1 2 3 4 5 6 7 8 9 - // 0 1 2 - - // start 3, cursor 5, sel 6 -> { 0, 3, 2 } - // : new int[] { 0, sel - start, cursor - start }; - - // sz>99|9 - - // " { " - // a b c q r 9 9|9 t u m m - // 0 1 2 3 4 5 6 7 8 9 a b - // 0 1 2 3 4 - - // { 3, 5, 4 } -> start 6, cursor 7, sel 8 - // : start += index[0]; - // : cursor = start + index[2] - index[0]; - // ------------------------------------------------------------ - - // Need to save start because calls to replaceRange will update - // start and cursor. - //int saveStart = start; - - int end = flush ? getSelectionEnd() : getSelectionStart(); - String sourceText = getText().substring(0,end); - ReplaceableString buf = new ReplaceableString(sourceText); - /*buf.replace(0, 1, getText().substring(start, - getSelectionStart()));*/ - - Transliterator.Position index = new Transliterator.Position(); - index.contextLimit = buf.length(); - index.contextStart = 0; - index.start = getKeyStart(); - if (index.start == -1) index.start = getSelectionStart(); - index.limit = buf.length(); - - StringBuffer log = null; - if (DEBUG) { - System.out.println("Transliterator: " + translit.getID()); - System.out.println("From:\t" + '"' + buf.toString() + '"' - + "; {cs: " + index.contextStart - + ", s: " + index.start - + ", l: " + index.limit - + ", cl: " + index.contextLimit - + "}" + "; '" + ch + "'" - + " " + getKeyStart() - ); - } - - if (flush) { - translit.finishTransliteration(buf, index); - } else { - translit.transliterate(buf, index, ch); - } - - if (DEBUG) { - System.out.println("To:\t" + '"' + buf.toString() + '"' - + "; {cs: " + index.contextStart - + ", s: " + index.start - + ", l: " + index.limit - + ", cl: " + index.contextLimit - + "}" - ); - System.out.println(); - } - /* - buf.replace(buf.length(), buf.length(), String.valueOf(ch)); - translit.transliterate(buf); - */ - - String result = buf.toString(); - //if (result.equals(sourceText + ch)) return; - - replaceRange(result, 0, getSelectionEnd()); - setKeyStart(index.start); - - // At this point start has been changed by the callback to - // resetTransliteratorStart() via replaceRange() -- so use our - // local copy, saveStart. - - // The START index is zero-based. On entry to transliterate(), - // it was zero. We can therefore just add it to our original - // getText()-based index value of start (in saveStart) to get - // the new getText()-based start. -// start = saveStart + index.contextStart; - - // Make the cursor getText()-based. The CURSOR index is zero-based. -// cursor = start + index.start - index.contextStart; - -/* - if (DEBUG) { - String out = buf.toString(); - log.append(out.substring(0, index.contextStart)). - append('{'). - append(out.substring(index.contextStart, index.start)). - append('|'). - append(out.substring(index.start)). - append('"'); - log.append(", {" + index.contextStart + ", " + index.contextLimit + ", " + index.start + "}, "); -// log.append("start " + start + ", cursor " + cursor); - log.append(", sel " + getSelectionStart()); - System.out.println(escape(log.toString())); - } - */ - } - - /** - * Set the {@link com.ibm.text.Transliterator} and direction to - * use to process incoming KeyEvents. - * @param t the {@link com.ibm.text.Transliterator} to use - */ - public void setTransliterator(Transliterator t) { - /* - if (translit != t) { // [sic] pointer compare ok; singletons - resetTransliterationStart(); - } - */ - translit = t; - } - - public Transliterator getTransliterator() { - return translit; - } - - /** - * Reset the start point at which transliteration begins. This - * needs to be done when the user moves the cursor or when the - * current {@link com.ibm.text.Transliterator} is changed. - */ - /* - private void resetTransliterationStart() { - start = getSelectionStart(); - cursor = start; - } - */ - - /** - * Escape non-ASCII characters as Unicode. - * JUST FOR DEBUGGING OUTPUT. - */ - public static final String escape(String s) { - StringBuffer buf = new StringBuffer(); - for (int i=0; i= ' ' && c <= 0x007F) { - if (c == '\\') { - buf.append("\\\\"); // That is, "\\" - } else { - buf.append(c); - } - } else { - buf.append("\\u"); - if (c < 0x1000) { - buf.append('0'); - if (c < 0x100) { - buf.append('0'); - if (c < 0x10) { - buf.append('0'); - } - } - } - buf.append(Integer.toHexString(c)); - } - } - return buf.toString(); - } -} diff --git a/icu4j/src/com/ibm/icu/demo/components/package.html b/icu4j/src/com/ibm/icu/demo/components/package.html deleted file mode 100755 index 73833753d9..0000000000 --- a/icu4j/src/com/ibm/icu/demo/components/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -GUI components for use with Transliterator. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/icu/internal/ICUBinary.java b/icu4j/src/com/ibm/icu/internal/ICUBinary.java deleted file mode 100755 index c7835a068c..0000000000 --- a/icu4j/src/com/ibm/icu/internal/ICUBinary.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/internal/Attic/ICUBinary.java,v $ - * $Date: 2002/02/08 23:22:40 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.icu.internal; - -import java.io.InputStream; -import java.io.DataInputStream; -import java.io.IOException; -import java.util.Arrays; - -public final class ICUBinary -{ - /** - *

ICU data header reader method. - * Takes a ICU generated big-endian input stream, parse the ICU standard - * file header and authenticates them.

- *

Header format: - *

    - *
  • Header size (char) - *
  • Magic number 1 (byte) - *
  • Magic number 2 (byte) - *
  • Rest of the header size (char) - *
  • Reserved word (char) - *
  • Big endian indicator (byte) - *
  • Character set family indicator (byte) - *
  • Size of a char (byte) for c++ and c use - *
  • Reserved byte (byte) - *
  • Data format identifier (4 bytes), each ICU data has its own - * identifier to distinguish them. [0] major [1] minor - * [2] milli [3] micro - *
  • Data version (4 bytes), the change version of the ICU data - * [0] major [1] minor [2] milli [3] micro - *
  • Unicode version (4 bytes) this ICU is based on. - *
- *

- *

- * Example of use:
- *

-    * try {
-    *    FileInputStream input = new FileInputStream(filename);
-    *    If (Utility.readICUDataHeader(input, dataformat, dataversion, 
-    *                                  unicode) {
-    *        System.out.println("Verified file header, this is a ICU data file");
-    *    }
-    * } catch (IOException e) {
-    *    System.out.println("This is not a ICU data file");
-    * }
-    * 
- *

- * @param inputStream input stream that contains the ICU data header - * @param dataFormatIDExpected Data format expected. An array of 4 bytes - * information about the data format. - * E.g. data format ID 1.2.3.4. will became an array of - * {1, 2, 3, 4} - * @param dataVersionExpected Data version expected. An array of 4 bytes - * information about the data version. - * E.g. data version 1.2.3.4. will became an array of - * {1, 2, 3, 4} - * @param unicodeVersionExpected Unicode version expected. An array of 4 - * bytes information about the unicode - * version this set of data belongs to. - * E.g. unicode version 3.1.1.0. will became an array - * of {3, 1, 1, 0} - * @exception IOException thrown if there is a read error or - * when header authentication fails. - * @draft 2.1 - */ - public static final void readHeader(InputStream inputStream, - byte dataFormatIDExpected[], - byte dataVersionExpected[], - byte unicodeVersionExpected[]) - throws IOException - { - DataInputStream input = new DataInputStream(inputStream); - char headersize = input.readChar(); - headersize -= 2; - //reading the header format - byte magic1 = input.readByte(); - headersize --; - byte magic2 = input.readByte(); - headersize --; - if (magic1 != MAGIC1 || magic2 != MAGIC2) { - throw new IOException(MAGIC_NUMBER_AUTHENTICATION_FAILED_); - } - - input.readChar(); // reading size - headersize -= 2; - input.readChar(); // reading reserved word - headersize -= 2; - byte bigendian = input.readByte(); - headersize --; - byte charset = input.readByte(); - headersize --; - byte charsize = input.readByte(); - headersize --; - input.readByte(); // reading reserved byte - headersize --; - - byte dataFormatID[] = new byte[4]; - input.readFully(dataFormatID); - headersize -= 4; - byte dataVersion[] = new byte[4]; - input.readFully(dataVersion); - headersize -= 4; - byte unicodeVersion[] = new byte[4]; - input.readFully(unicodeVersion); - headersize -= 4; - input.skipBytes(headersize); - - if (bigendian != BIG_ENDIAN_ || charset != CHAR_SET_ || - charsize != CHAR_SIZE_ || - !Arrays.equals(dataFormatIDExpected, dataFormatID) || - !Arrays.equals(dataVersionExpected, dataVersion) || - !Arrays.equals(unicodeVersionExpected, unicodeVersion)) { - throw new IOException(HEADER_AUTHENTICATION_FAILED_); - } - } - - // private variables ------------------------------------------------- - - /** - * Magic numbers to authenticate the data file - */ - private static final byte MAGIC1 = (byte)0xda; - private static final byte MAGIC2 = (byte)0x27; - - /** - * File format authentication values - */ - private static final byte BIG_ENDIAN_ = 1; - private static final byte CHAR_SET_ = 0; - private static final byte CHAR_SIZE_ = 2; - - /** - * Error messages - */ - private static final String MAGIC_NUMBER_AUTHENTICATION_FAILED_ = - "ICU data file error: Not an ICU data file"; - private static final String HEADER_AUTHENTICATION_FAILED_ = - "ICU data file error: Header authentication failed, please check if you have the most updated ICU data file"; -} diff --git a/icu4j/src/com/ibm/icu/internal/UInfo.java b/icu4j/src/com/ibm/icu/internal/UInfo.java deleted file mode 100755 index 05927f0e77..0000000000 --- a/icu4j/src/com/ibm/icu/internal/UInfo.java +++ /dev/null @@ -1,610 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/internal/Attic/UInfo.java,v $ - * $Date: 2001/09/08 01:13:38 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ - -package com.ibm.icu.internal; - -import java.io.*; -import java.util.*; -import com.ibm.util.Utility; - -public final class UInfo { - static final boolean DEBUG = false; - static final int UINFO_VERSION = 5; - - // these values are aligned with the java.lang.Character constants - - public static final byte - UNASSIGNED = 0, - UPPERCASE_LETTER = 1, - LOWERCASE_LETTER = 2, - TITLECASE_LETTER = 3, - MODIFIER_LETTER = 4, - OTHER_LETTER = 5, - NON_SPACING_MARK = 6, - ENCLOSING_MARK = 7, - COMBINING_SPACING_MARK = 8, - DECIMAL_DIGIT_NUMBER = 9, - LETTER_NUMBER = 10, - OTHER_NUMBER = 11, - SPACE_SEPARATOR = 12, - LINE_SEPARATOR = 13, - PARAGRAPH_SEPARATOR = 14, - CONTROL = 15, - FORMAT = 16, - PRIVATE_USE = 18, - SURROGATE = 19, - DASH_PUNCTUATION = 20, - START_PUNCTUATION = 21, - END_PUNCTUATION = 22, - CONNECTOR_PUNCTUATION = 23, - OTHER_PUNCTUATION = 24, - MATH_SYMBOL = 25, - CURRENCY_SYMBOL = 26, - MODIFIER_SYMBOL = 27, - OTHER_SYMBOL = 28; - - public String getName(char ch) {return getInfo(ch).name;} - public String getDecomposition(char ch) {return getInfo(ch).decomposition;} - public String getName10(char ch) {return getInfo(ch).name10;} - public String getComment(char ch) {return getInfo(ch).comment;} - - public float getNumeric(char ch) {return getInfo(ch).numeric;} - - public short getCanonicalClass(char ch) {return getInfo(ch).canonical;} - public short getDecimal(char ch) {return getInfo(ch).decimal;} - public short getDigit(char ch) {return getInfo(ch).digit;} - - public char getUppercase(char ch) {return getInfo(ch).uppercase;} - public char getLowercase(char ch) {return getInfo(ch).lowercase;} - public char getTitlecase(char ch) {return getInfo(ch).titlecase;} - - public byte getCategory(char ch) {return getInfo(ch).category;} - public byte getBidiClass(char ch) {return getInfo(ch).bidi;} - public boolean getMirrored(char ch) {return getInfo(ch).mirrored;} - - public boolean isDisparaged(char ch) { return getDecomposition(ch).length() == 4; } - - public boolean isLetter(char ch) { - return (0 != ((1<= 0 - || getCanonicalClass(getDecompositionChars(ch).charAt(0)) != 0; - } - - - - public String getName(String s) { - return getName(s,true); - } - - public String getName(String s, boolean shortVersion) { - StringBuffer temp = new StringBuffer(); - for (int i = 0; i < s.length(); ++i) { - if (i != 0) temp.append(", "); - temp.append(getName(s.charAt(i), shortVersion)); - } - return temp.toString(); - } - - public String getName(char ch, boolean shortVersion) { - String result = getName(ch); - if (!shortVersion) return result; - result = replace(result,"LETTER ",""); - result = replace(result,"CHARACTER ",""); - result = replace(result,"SIGN ",""); - result = replace(result,"CAPITAL ","UC "); - if (getCategory(ch) == LOWERCASE_LETTER) - result = replace(result,"SMALL ","LC "); - result = replace(result,"COMBINING ","-"); - result = replace(result,"WITH ",""); - result = replace(result,"AND ",""); - result = replace(result,"VARIA","GRAVE"); - result = replace(result,"OXIA","ACUTE"); - result = replace(result,"VRACHY","BREVE"); - result = replace(result,"VERTICAL LINE ABOVE","TONOS"); - result = replace(result,"PSILI","SMOOTH"); - result = replace(result,"DASIA","ROUGH"); - result = replace(result,"COMMA ABOVE","SMOOTH"); - result = replace(result,"REVERSED COMMA ABOVE","ROUGH"); - result = replace(result,"YPOGEGRAMMENI","IOTA-SUB"); - result = replace(result,"PROSGEGRAMMENI","IOTA-AD"); - result = replace(result,"DIALYTIKA","DIAERESIS"); - result = replace(result,"PERISPOMENI","CIRCUMFLEX"); - result = replace(result,"VOICED SOUND MARK","VOICED SIGN"); - result = replace(result,"PROLONGED SOUND MARK","VOICED SIGN"); - result = replace(result,"KATAKANA-HIRAGANA","KANA"); - result = replace(result,"COMPATIBILITY IDEOGRAPH-",""); - result = replace(result,"CHOSEONG","INITIAL"); - result = replace(result,"JUNGSEONG","MEDIAL"); - result = replace(result,"JONGSEONG","FINAL"); - - return result.substring(0,1) - + result.substring(1,result.length()).toLowerCase(); - } - - public String replace(String source, - String replacee, String replacer) { - int p = source.indexOf(replacee); - if (p == -1) return source; - return source.substring(0,p) - + replacer - + source.substring(p+replacee.length(),source.length()); - } - - public boolean isCCS(String s) { - if (s.length() < 2) return false; - if (isMark(s.charAt(0))) return false; - for (int i = 1; i < s.length(); ++i) { - if (!isMark(s.charAt(i))) return false; - } - return true; - } - - // combining base sequence := + * - public boolean isCBS(String s) { - if (s.length() == 0) return false; - if (getCanonicalClass(s.charAt(0)) != 0) return false; - boolean gotGreater = false; - for (int i = 1; i < s.length(); ++i) { - if (getCanonicalClass(s.charAt(i)) == 0) { - if (gotGreater) return false; - } else { - gotGreater = true; - } - } - return true; - } - - public boolean hasCanonicalDecomposition(char ch) { - String decomp = getDecomposition(ch); - return (decomp.length() != 0 && decomp.indexOf('<') == -1); - } - - public boolean hasCompatibilityDecomposition(char ch) { - String decomp = getDecomposition(ch); - return (decomp.length() != 0 && decomp.indexOf('<') != -1); - } - - public boolean isEquivalent( - String a, String b, boolean canonical) { - return getFullDecomposition(a, canonical).equals( - getFullDecomposition(b, canonical)); - } - - // use very dumb algorithm. Don't need lower order one. - - public String getFullDecomposition( - String s, boolean canonical) { - StringBuffer output = new StringBuffer(); - for (int i = 0; i < s.length(); ++i) { - getFullDecomp2(s.charAt(i),canonical,output); - } - return fixCanonical(output).toString(); - } - - public StringBuffer getFullDecomposition( - char ch, boolean canonical, StringBuffer output) { - - StringBuffer result = getFullDecomp2(ch,canonical,output); - return fixCanonical(result); - } - - public String getFullDecomposition( - char ch, boolean canonical) { - return getFullDecomposition(ch, canonical, new StringBuffer()).toString(); - } - - /** - * Given a decomposed string of characters, put it in canonical - * order by finding and processing all exchangeable pairs. - */ - public StringBuffer fixCanonical(StringBuffer target) { - for (int i = 1; i < target.length(); ++i) { - char ch = target.charAt(i); - short canClass = getCanonicalClass(ch); - char chPrev = target.charAt(i-1); - short canClassPrev = getCanonicalClass(chPrev); - if (canClass != 0 && canClass < canClassPrev) { - target.setCharAt(i-1, ch); - target.setCharAt(i, chPrev); - if (i > 1) i -= 2; // backup (-1 to compensate for loop) - } - } - return target; - } - - public String fixCanonical(String source) { - return fixCanonical(new StringBuffer(source)).toString(); - } - - - // ============================================ - // PRIVATES - // ============================================ - - static class CharData { - public CharData() { - }; - - String name = ""; - String decomposition = ""; - String name10 = ""; - String comment = ""; - - float numeric = Float.MIN_VALUE; - - short canonical = 0; - short decimal = Short.MIN_VALUE; - short digit = Short.MIN_VALUE; - - char uppercase; - char lowercase; - char titlecase; - - byte category; - byte bidi = 0; - - boolean mirrored; - }; - - private static final CharData UNASSIGNED_INFO = new CharData(); - private static char cachedChar = 0xFFFF; - - private CharData getInfo(char ch) { - if (ch == cachedChar) return UNASSIGNED_INFO; - // remap special ranges - if (ch >= 0x4E00 && ch < 0xF900) { - if (ch <= 0x9FA5) ch = 0x4E00; - else if (ch >= 0xAC00 && ch <= 0xD7A3) ch = 0xAC00; - else if (ch >= 0xD800 && ch <= 0xDFFF) ch = 0xD800; - else if (ch >= 0xE000) ch = 0xE000; - } - Object value = cache[ch]; - CharData result; - if (value == null) { - result = UNASSIGNED_INFO; - } else if (value instanceof String) { - result = updateCache((String)value); - } else { - result = (CharData)value; - } - return result; - } - - private StringBuffer getFullDecomp2( - char ch, boolean canonical, StringBuffer output) { - - String decomp = getDecomposition(ch); - if (decomp.length() == 0 - || (canonical && decomp.indexOf('<') != -1)) { - output.append(ch); - return output; - } - boolean inBrackets = false; - for (int i = 0; i < decomp.length(); ++i) { - char c = decomp.charAt(i); - if (c == '<') inBrackets = true; - else if (c == '>') inBrackets = false; - else if (inBrackets) ; // skip - else if (c == ' ') ; // skip - else { - String tempString = decomp.substring(i,i+4); - char temp = (char)Integer.parseInt(tempString,16); - getFullDecomposition(temp,canonical,output); - i+= 3; - } - } - return output; - } - - public String getDecompositionChars(char ch) { - StringBuffer output = new StringBuffer(); - String decomp = getDecomposition(ch); - if (decomp.length() == 0) { - output.append(ch); - return output.toString(); - } - boolean inBrackets = false; - for (int i = 0; i < decomp.length(); ++i) { - char c = decomp.charAt(i); - if (c == '<') inBrackets = true; - else if (c == '>') inBrackets = false; - else if (inBrackets) ; // skip - else if (c == ' ') ; // skip - else { - String tempString = decomp.substring(i,i+4); - char temp = (char)Integer.parseInt(tempString,16); - output.append(temp); - i+= 3; - } - } - return output.toString(); - } - - public UInfo(String fileName, String composeExcludeFileName) { - // not used long startTime,endTime; - - BufferedReader input = null; - String line = null; - try { - input = new BufferedReader(new FileReader(fileName),64*1024); - for (int count = 0;;++count) { - line = input.readLine(); - if (line == null) break; - if (line.length() == 0) continue; - char ch = charFrom(line.substring(0,4)); - if (DEBUG) if ((count % 100) == 0) - System.out.println("[" + count + "," + Utility.hex(ch) + ']'); - cache[ch] = line; - } - - // Read composition exlusions - input = new BufferedReader(new FileReader(composeExcludeFileName),64*1024); - StringBuffer ce = new StringBuffer(); - for (;;) { - line = input.readLine(); - if (line == null) break; - if (line.length() == 0 || - Character.digit(line.charAt(0), 16) < 0) continue; - ce.append(charFrom(line.substring(0,4))); - } - composeExclude = ce.toString(); - } catch (Exception ex) { - try { - input.close(); - } catch (Exception ex2) { - System.out.print(""); - } - ex.printStackTrace(); - throw new IllegalArgumentException("Couldn't read file " - + ex.getClass().getName() + " " + ex.getMessage() - + " line = " + line - ); - } - } - - public UInfo() { - // FIX - // This is bad...this path must be correct relative to the - // user's current directory. I have changed it so that it's - // relative to the root icu4j directory, so it works as long - // as code is run from that directory, e.g., "java -classpath - // classes...". A better way to do this might be to get it - // from a system property that is defined on the command line, - // e.g., "java -Dicu4j=D:/icu4j..." - liu - this("src/data/unicode/UnicodeData-3.0.0.txt", - "src/data/unicode/CompositionExclusions-1.txt"); - } - - /* - 0 Code value in 4-digit hexadecimal format. - 1 Unicode 2.1 Character Name. These names match exactly the - 2 General Category. This is a useful breakdown into various "character - 3 Canonical Combining Classes. The classes used for the - 4 Bidirectional Category. See the list below for an explanation of the - 5 Character Decomposition. In the Unicode Standard, not all of - 6 Decimal digit value. This is a numeric field. If the character - 7 Digit value. This is a numeric field. If the character represents a - 8 Numeric value. This is a numeric field. If the character has the - 9 If the characters has been identified as a "mirrored" character in - 10 Unicode 1.0 Name. This is the old name as published in Unicode 1.0. - 11 10646 Comment field. This field is informative. - 12 Upper case equivalent mapping. If a character is part of an - 13 Lower case equivalent mapping. Similar to 12. This field is informative. - 14 Title case equivalent mapping. Similar to 12. This field is informative. - */ - - private CharData updateCache(String line) { - try { - String[] parts = new String[30]; - Utility.split(line,';',parts); - CharData info = new CharData(); - char ch = charFrom(parts[0]); - info.name = parts[1]; - info.category = (byte)Utility.lookup(parts[2], CATEGORY_TABLE); - info.canonical = shortFrom(parts[3]); - info.bidi = (byte)Utility.lookup(parts[4], BIDI_TABLE); - info.decomposition = parts[5]; - info.decimal = shortFrom(parts[6]); - info.digit = shortFrom(parts[7]); - info.numeric = floatFrom(parts[8]); - info.mirrored = charFrom(parts[9]) == 'Y'; - info.name10 = parts[10]; - info.comment = parts[11]; - info.uppercase = charFrom(parts[12]); - if (info.uppercase == 0) info.uppercase = ch; - info.lowercase = charFrom(parts[13]); - if (info.lowercase == 0) info.lowercase = ch; - info.titlecase = charFrom(parts[14]); - if (info.titlecase == 0) info.titlecase = info.uppercase; - String trial = Utility.hex(ch) + ";" + info; - if (DEBUG) if (!trial.equals(line)) { - System.out.println("Difference between:"); - System.out.println(line); - System.out.println(trial); - } - cache[ch] = info; - return info; - } - catch (NumberFormatException e) { - System.out.println("updateCache: error parsing '" + line + "'"); - throw e; - } - } - - private static CharData typeInfo = new CharData(); - - private boolean latin1(char c) { - return ((c >= 20 && c <= 0x7F) || c > 0xA0); - } - - private static final String[] YN_TABLE = {"N", "Y"}; - - private static final String[] CATEGORY_TABLE = { - "Cn", // = Other, Not Assigned - - "Lu", // = Letter, Uppercase - "Ll", // = Letter, Lowercase - "Lt", // = Letter, Titlecase - "Lm", // = Letter, Modifier - "Lo", // = Letter, Other - - "Mn", // = Mark, Non-Spacing - "Me", // = Mark, Enclosing - "Mc", // = Mark, Spacing Combining - - "Nd", // = Number, Decimal Digit - "Nl", // = Number, Letter - "No", // = Number, Other - - "Zs", // = Separator, Space - "Zl", // = Separator, Line - "Zp", // = Separator, Paragraph - - "Cc", // = Other, Control - "Cf", // = Other, Format - "", // unused - "Co", // = Other, Private Use - "Cs", // = Other, Surrogate - - - "Pd", // = Punctuation, Dash - "Ps", // = Punctuation, Open - "Pe", // = Punctuation, Close - "Pc", // = Punctuation, Connector - "Po", // = Punctuation, Other - - "Sm", // = Symbol, Math - "Sc", // = Symbol, Currency - "Sk", // = Symbol, Modifier - "So", // = Symbol, Other - - "Pi", // = Punctuation, Initial quote (may behave like Ps or Pe depending on usage) - "Pf", // = Punctuation, Final quote (may behave like Ps or Pe dependingon usage) - }; - - private static String[] BIDI_TABLE = { - "L", // Left-Right; Most alphabetic, syllabic, and logographic characters (e.g., CJK ideographs) - "R", // Right-Left; Arabic, Hebrew, and punctuation specific to those scripts - "EN", // European Number - "ES", // European Number Separator - "ET", // European Number Terminator - "AN", // Arabic Number - "CS", // Common Number Separator - "B", // Block Separator - "S", // Segment Separator - "WS", // Whitespace - "ON" // Other Neutrals ; All other characters: punctuation, symbols - }; - - private static short shortFrom(String p) { - if (p.length() == 0) return Short.MIN_VALUE; - return Short.parseShort(p); - } - - private static float floatFrom(String p) { - try { - if (p.length() == 0) return Float.MIN_VALUE; - int fract = p.indexOf('/'); - if (fract == -1) return Float.valueOf(p).floatValue(); - String q = p.substring(0,fract); - float num = 0; - if (q.length() != 0) num = Integer.parseInt(q); - p = p.substring(fract+1,p.length()); - float den = 0; - if (p.length() != 0) den = Integer.parseInt(p); - return num/den; - } - catch (NumberFormatException e) { - System.out.println("floatFrom: error parsing '" + p + "'"); - throw e; - } - } - - private static char charFrom(String p) { - if (p.length() == 0) return '\u0000'; - else if (p.length() == 1) return p.charAt(0); - int temp = Integer.parseInt(p, 16); - if (temp < 0 || temp > 0xFFFF) - throw new NumberFormatException( - "Hex char out of range: " + p); - return (char)temp; - } - - - private Object[] cache = new Object[65536]; -} diff --git a/icu4j/src/com/ibm/icu/internal/util/Trie.java b/icu4j/src/com/ibm/icu/internal/util/Trie.java deleted file mode 100755 index 6cbe8de2ff..0000000000 --- a/icu4j/src/com/ibm/icu/internal/util/Trie.java +++ /dev/null @@ -1,391 +0,0 @@ -/* -****************************************************************************** -* Copyright (C) 1996-2002, International Business Machines Corporation and * -* others. All Rights Reserved. * -****************************************************************************** -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/internal/util/Attic/Trie.java,v $ -* $Date: 2002/02/08 01:08:38 $ -* $Revision: 1.1 $ -* -****************************************************************************** -*/ - -package com.ibm.icu.internal.util; - -import java.io.InputStream; -import java.io.DataInputStream; -import java.io.IOException; -import com.ibm.text.UTF16; -import com.ibm.text.UCharacter; - -/** - *

A trie is a kind of compressed, serializable table of values - * associated with Unicode code points (0..0x10ffff).

- *

This class defines the basic structure of a trie and provides methods - * to retrieve the offsets to the actual data.

- *

Data will be the form of an array of basic types, char or int.

- *

The actual data format will have to be specified by the user in the - * inner static interface com.ibm.icu.util.Trie.DataManipulate.

- *

This trie implementation is optimized for getting offset while walking - * forward through a UTF-16 string. - * Therefore, the simplest and fastest access macros are the - * fromLead() and fromOffsetTrail() methods. - * The fromBMP() method are a little more complicated; they get offsets even - * for lead surrogate codepoints, while the fromLead() method get special - * "folded" offsets for lead surrogate code units if there is relevant data - * associated with them. - * From such a folded offsets, an offset needs to be extracted to supply - * to the fromOffsetTrail() methods. - * To handle such supplementary codepoints, some offset information are kept - * in the data.

- *

Methods in com.ibm.icu.util.Trie.DataManipulate are called to retrieve that - * offset from the folded value for the lead surrogate unit.

- *

For examples of use, see com.ibm.icu.util.CharTrie or - * com.ibm.icu.util.IntTrie.

- * @author synwee - * @see com.ibm.icu.util.CharTrie - * @see com.ibm.icu.util.IntTrie - * @since release 2.1, Jan 01 2002 - */ -public abstract class Trie -{ - // public class declaration ---------------------------------------- - - /** - * Character data in com.ibm.util.Trie have different user-specified format - * for different purposes. - * This interface specifies methods to be implemented in order for - * com.ibm.util.Trie, to surrogate offset information encapsulated within - * the data. - * @draft 2.1 - */ - public static interface DataManipulate - { - /** - * Called by com.ibm.icu.util.Trie to extract from a lead surrogate's - * data - * the index array offset of the indexes for that lead surrogate. - * @param value data value for a surrogate from the trie, including the - * folding offset - * @return data offset or 0 if there is no data for the lead surrogate - * @draft 2.1 - */ - public int getFoldingOffset(int value); - } - - // protected constructor ------------------------------------------- - - /** - * Trie constructor for CharTrie use. - * @param inputStream ICU data file input stream which contains the - * trie - * @param datamanipulate object containing the information to parse the - * trie data - * @exception IOException thrown when input stream does not have the - * right header. - * @draft 2.1 - */ - protected Trie(InputStream inputStream, - DataManipulate dataManipulate) throws IOException - { - DataInputStream input = new DataInputStream(inputStream); - // Magic number to authenticate the data. - int signature = input.readInt(); - m_options_ = input.readInt(); - - if (!checkHeader(signature)) { - throw new IllegalArgumentException("ICU data file error: Trie header authentication failed, please check if you have the most updated ICU data file"); - } - - m_dataManipulate_ = dataManipulate; - m_isLatin1Linear_ = (m_options_ & - HEADER_OPTIONS_LATIN1_IS_LINEAR_MASK_) != 0; - m_dataOffset_ = input.readInt(); - m_dataLength_ = input.readInt(); - unserialize(inputStream); - } - - // protected data members ------------------------------------------ - - /** - * Shift size for shifting right the input index. 1..9 - * @draft 2.1 - */ - protected static final int INDEX_STAGE_1_SHIFT_ = 5; - /** - * Shift size for shifting left the index array values. - * Increases possible data size with 16-bit index values at the cost - * of compactability. - * This requires blocks of stage 2 data to be aligned by - * DATA_GRANULARITY. - * 0..INDEX_STAGE_1_SHIFT - * @draft 2.1 - */ - protected static final int INDEX_STAGE_2_SHIFT_ = 2; - /** - * Mask for getting the lower bits from the input index. - * DATA_BLOCK_LENGTH_ - 1. - * @draft 2.1 - */ - protected static final int INDEX_STAGE_3_MASK_ = - (1 << INDEX_STAGE_1_SHIFT_) - 1; - /** - * Surrogate mask to use when shifting offset to retrieve supplementary - * values - * @draft 2.1 - */ - protected static final int SURROGATE_MASK_ = 0x3FF; - /** - * Index or UTF16 characters - * @draft 2.1 - */ - protected char m_index_[]; - /** - * Internal TrieValue which handles the parsing of the data value. - * This class is to be implemented by the user - * @draft 2.1 - */ - protected DataManipulate m_dataManipulate_; - /** - * Start index of the data portion of the trie. CharTrie combines - * index and data into a char array, so this is used to indicate the - * initial offset to the data portion. - * @draft 2.1 - */ - protected int m_dataOffset_; - /** - * Length of the data array - */ - protected int m_dataLength_; - - // protected methods ----------------------------------------------- - - /** - * Gets the offset to the data which the surrogate pair points to. - * @param lead lead surrogate - * @param trail trailing surrogate - * @return offset to data - * @draft 2.1 - */ - protected abstract int getSurrogateOffset(char lead, char trail); - - /** - * Gets the value at the argument index - * @param index value at index will be retrieved - * @return 32 bit value - * @draft 2.1 - */ - protected abstract int getValue(int index); - - /** - * Gets the default initial value - * @return 32 bit value - * @draft 2.1 - */ - protected abstract int getInitialValue(); - - /** - * Gets the offset to the data which the index ch after variable offset - * points to. - * Note for locating a non-supplementary character data offset, calling - *

- * getRawOffset(0, ch); - *

- * will do. Otherwise if it is a supplementary character formed by - * surrogates lead and trail. Then we would have to call getRawOffset() - * with getFoldingIndexOffset(). See getSurrogateOffset(). - * This is different from the C macro, because macros does not need to - * handle types. - * @param offset index offset which ch is to start from - * @param ch index to be used after offset - * @return offset to the data - * @draft 2.1 - */ - protected final int getRawOffset(int offset, char ch) - { - return (m_index_[offset + (ch >> INDEX_STAGE_1_SHIFT_)] << - INDEX_STAGE_2_SHIFT_) + (ch & INDEX_STAGE_3_MASK_); - } - - /** - * Gets the offset to data which the BMP character points to - * Treats a lead surrogate as a normal code point. - * @param ch BMP character - * @return offset to data - * @draft 2.1 - */ - protected final int getBMPOffset(char ch) - { - int offset = 0; - if (UTF16.isLeadSurrogate(ch)) { - offset = LEAD_INDEX_OFFSET_; - } - return getRawOffset(offset, ch); - } - - /** - * Gets the offset to the data which this lead surrogate character points - * to. - * Data at the returned offset may contain folding offset information for - * the next trailing surrogate character. - * @param ch lead surrogate character - * @return offset to data - * @draft 2.1 - */ - protected final int getLeadOffset(char ch) - { - return getRawOffset(0, ch); - } - - /** - * Internal trie getter from a code point. - * Could be faster(?) but longer with - * if((c32)<=0xd7ff) { (result)=_TRIE_GET_RAW(trie, data, 0, c32); } - * Gets the offset to data which the codepoint points to - * @param ch codepoint - * @return offset to data - * @draft 2.1 - */ - protected final int getCodePointOffset(int ch) - { - if (UCharacter.isBMP(ch)) { - // BMP codepoint - return getBMPOffset((char)ch); - } - if (ch <= UCharacter.MAX_VALUE) - { - char lead = UTF16.getLeadSurrogate(ch); - // look at the construction of supplementary characters - // trail forms the ends of it. - return getSurrogateOffset(lead, (char)(ch & SURROGATE_MASK_)); - } - // return -1 if there is an error, in this case we return the default - // value: m_initialValue_ - return -1; - } - - /** - *

Parses the inputstream and creates the trie index with it.

- *

This is overwritten by the child classes. - * @param inputStream input stream containing the trie information - * @exception IOException thrown when data reading fails. - * @draft 2.1 - */ - protected void unserialize(InputStream inputStream) throws IOException - { - //indexLength is a multiple of 1024 >> INDEX_STAGE_2_SHIFT_ - m_index_ = new char[m_dataOffset_]; - DataInputStream input = new DataInputStream(inputStream); - for (int i = 0; i < m_dataOffset_; i ++) { - m_index_[i] = input.readChar(); - } - } - - /** - * Determines if this is a 32 bit trie - * @return true if options specifies this is a 32 bit trie - * @draft 2.1 - */ - protected final boolean isIntTrie() - { - return (m_options_ & HEADER_OPTIONS_DATA_IS_32_BIT_) != 0; - } - - /** - * Determines if this is a 16 bit trie - * @return true if this is a 16 bit trie - * @draft 2.1 - */ - protected final boolean isCharTrie() - { - return (m_options_ & HEADER_OPTIONS_DATA_IS_32_BIT_) == 0; - } - - // private data members -------------------------------------------- - - /** - * Lead surrogate code points' index displacement in the index array. - * 0x10000-0xd800=0x2800 - * 0x2800 >> INDEX_STAGE_1_SHIFT_ - */ - private static final int LEAD_INDEX_OFFSET_ = - 0x2800 >> 5; - /** - * Signature index - */ - private static final int HEADER_SIGNATURE_INDEX_ = 0; - /** - * Options index - */ - private static final int HEADER_OPTIONS_INDEX_ = 1 << 1; - /** - * Index length index - */ - private static final int HEADER_INDEX_LENGTH_INDEX_ = 2 << 1; - /** - * Data length index - */ - private static final int HEADER_DATA_LENGTH_INDEX_ = 3 << 1; - /** - * Size of header - */ - private static final int HEADER_LENGTH_ = 4 << 1; - /** - * Latin 1 option mask - */ - private static final int HEADER_OPTIONS_LATIN1_IS_LINEAR_MASK_ = 0x200; - /** - * Constant number to authenticate the byte block - */ - private static final int HEADER_SIGNATURE_ = 0x54726965; - /** - * Header option formatting - */ - private static final int HEADER_OPTIONS_SHIFT_MASK_ = 0xF; - private static final int HEADER_OPTIONS_INDEX_SHIFT_ = 4; - private static final int HEADER_OPTIONS_DATA_IS_32_BIT_ = 0x100; - - /** - * Flag indicator for Latin quick access data block - */ - private boolean m_isLatin1Linear_; - - /** - *

Trie options field.

- *

options bit field:
- * 9 1 = Latin-1 data is stored linearly at data + DATA_BLOCK_LENGTH
- * 8 0 = 16-bit data, 1=32-bit data
- * 7..4 INDEX_STAGE_1_SHIFT // 0..INDEX_STAGE_2_SHIFT
- * 3..0 INDEX_STAGE_2_SHIFT // 1..9
- */ - private int m_options_; - - // private methods --------------------------------------------------- - - /** - * Authenticates raw data header. - * Checking the header information, signature and options. - * @param rawdata array of char data to be checked - * @return true if the header is authenticated valid - * @draft 2.1 - */ - private final boolean checkHeader(int signature) - { - // check the signature - // Trie in big-endian US-ASCII (0x54726965). - // Magic number to authenticate the data. - if (signature != HEADER_SIGNATURE_) { - return false; - } - - if ((m_options_ & HEADER_OPTIONS_SHIFT_MASK_) != - INDEX_STAGE_1_SHIFT_ || - ((m_options_ >> HEADER_OPTIONS_INDEX_SHIFT_) & - HEADER_OPTIONS_SHIFT_MASK_) - != INDEX_STAGE_2_SHIFT_) { - return false; - } - return true; - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/icu/internal/util/TrieIterator.java b/icu4j/src/com/ibm/icu/internal/util/TrieIterator.java deleted file mode 100755 index 86c6ebb414..0000000000 --- a/icu4j/src/com/ibm/icu/internal/util/TrieIterator.java +++ /dev/null @@ -1,477 +0,0 @@ -/* -****************************************************************************** -* Copyright (C) 1996-2002, International Business Machines Corporation and * -* others. All Rights Reserved. * -****************************************************************************** -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/internal/util/Attic/TrieIterator.java,v $ -* $Date: 2002/02/08 23:44:22 $ -* $Revision: 1.2 $ -* -****************************************************************************** -*/ - -package com.ibm.icu.internal.util; - -import com.ibm.text.UCharacter; -import com.ibm.text.UTF16; -import com.ibm.icu.util.RangeValueIterator; - -/** - *

Class enabling iteration of the values in a Trie.

- *

Result of each iteration contains the interval of codepoints that have - * the same value type and the value type itself.

- *

The comparison of each codepoint value is done via extract(), which the - * default implementation is to return the value as it is.

- *

Method extract() can be overwritten to perform manipulations on - * codepoint values in order to perform specialized comparison.

- *

TrieIterator is designed to be a generic iterator for the CharTrie - * and the IntTrie, hence to accommodate both types of data, the return - * result will be in terms of int (32 bit) values.

- *

See com.ibm.icu.text.UCharacterTypeIterator for examples of use.

- * @author synwee - * @see com.ibm.icu.util.Trie - * @see com.ibm.icu.text.UCharacterTypeIterator - * @since release 2.1, Jan 17 2002 - */ -public class TrieIterator implements RangeValueIterator - -{ - // public constructor --------------------------------------------- - - /** - * TrieEnumeration constructor - * @param trie to be used - * @exception IllegalArgumentException throw when argument is null. - * @draft 2.1 - */ - protected TrieIterator(Trie trie) - { - if (trie == null) { - throw new IllegalArgumentException( - "Argument trie cannot be null"); - } - m_trie_ = trie; - // synwee: check that extract belongs to the child class - m_initialValue_ = extract(m_trie_.getInitialValue()); - reset(); - } - - // public methods ------------------------------------------------- - - /** - *

Returns true if we are not at the end of the iteration, false - * otherwise.

- *

The next set of codepoints with the same value type will be - * calculated during this call and returned in the arguement element.

- * @param element return result - * @return true if we are not at the end of the iteration, false otherwise. - * @exception NoSuchElementException - if no more elements exist. - * @see #getStart() - * @see #getLimit() - * @see #getValue() - * @draft 2.1 - */ - public final boolean next(Element element) - { - if (m_nextCodepoint_ > UCharacter.MAX_VALUE) { - return false; - } - if (m_nextCodepoint_ < UCharacter.SUPPLEMENTARY_MIN_VALUE && - calculateNextBMPElement(element)) { - return true; - } - calculateNextSupplementaryElement(element); - return true; - } - - /** - * Resets the iterator to the beginning of the iteration - * @draft 2.1 - */ - public final void reset() - { - m_currentCodepoint_ = 0; - m_nextCodepoint_ = 0; - m_nextIndex_ = 0; - m_nextBlock_ = m_trie_.m_index_[0] << Trie.INDEX_STAGE_2_SHIFT_; - if (m_nextBlock_ == 0) { - m_nextValue_ = m_initialValue_; - } - else { - m_nextValue_ = extract(m_trie_.getValue(m_nextBlock_)); - } - m_nextBlockIndex_ = 0; - m_nextTrailIndexOffset_ = TRAIL_SURROGATE_INDEX_BLOCK_LENGTH_; - } - - // protected methods ---------------------------------------------- - - /** - * Called by next() to extracts a 32 bit value from a trie value - * used for comparison. - * This method is to be overwritten if special manipulation is to be done - * to retrieve a relevant comparison. - * The default function is to return the value as it is. - * @param value a value from the trie - * @return extracted value - * @draft 2.1 - */ - protected int extract(int value) - { - return value; - } - - // private methods ------------------------------------------------ - - /** - * Set the result values - * @param element return result object - * @param start codepoint of range - * @param limit (end + 1) codepoint of range - * @param value common value of range - */ - private final void setResult(Element element, int start, int limit, - int value) - { - element.start = start; - element.limit = limit; - element.value = value; - } - - /** - * Finding the next element. - * This method is called just before returning the result of - * next(). - * We always store the next element before it is requested. - * In the case that we have to continue calculations into the - * supplementary planes, a false will be returned. - * @param element return result object - * @return true if the next range is found, false if we have to proceed to - * the supplementary range. - */ - private final boolean calculateNextBMPElement(Element element) - { - int currentBlock = m_nextBlock_; - int currentValue = m_nextValue_; - m_currentCodepoint_ = m_nextCodepoint_; - m_nextCodepoint_ ++; - m_nextBlockIndex_ ++; - if (!checkBlockDetail(currentValue)) { - setResult(element, m_currentCodepoint_, m_nextCodepoint_, - currentValue); - return true; - } - // enumerate BMP - the main loop enumerates data blocks - while (m_nextCodepoint_ < UCharacter.SUPPLEMENTARY_MIN_VALUE) { - m_nextIndex_ ++; - // because of the way the character is split to form the index - // the lead surrogate and trail surrogate can not be in the - // mid of a block - if (m_nextCodepoint_ == LEAD_SURROGATE_MIN_VALUE_) { - // skip lead surrogate code units, - // go to lead surrogate codepoints - m_nextIndex_ = BMP_INDEX_LENGTH_; - } - else if (m_nextCodepoint_ == TRAIL_SURROGATE_MIN_VALUE_) { - // go back to regular BMP code points - m_nextIndex_ = m_nextCodepoint_ >> Trie.INDEX_STAGE_1_SHIFT_; - } - - m_nextBlockIndex_ = 0; - if (!checkBlock(currentBlock, currentValue)) { - setResult(element, m_currentCodepoint_, m_nextCodepoint_, - currentValue); - return true; - } - } - m_nextCodepoint_ --; // step one back since this value has not been - m_nextBlockIndex_ --; // retrieved yet. - return false; - } - - /** - * Finds the next supplementary element. - * For each entry in the trie, the value to be delivered is passed through - * extract(). - * We always store the next element before it is requested. - * Called after calculateNextBMP() completes its round of BMP characters. - * There is a slight difference in the usage of m_currentCodepoint_ - * here as compared to calculateNextBMP(). Though both represents the - * lower bound of the next element, in calculateNextBMP() it gets set - * at the start of any loop, where-else, in calculateNextSupplementary() - * since m_currentCodepoint_ already contains the lower bound of the - * next element (passed down from calculateNextBMP()), we keep it till - * the end before resetting it to the new value. - * Note, if there are no more iterations, it will never get to here. - * Blocked out by next(). - * @param element return result object - * @draft 2.1 - */ - private final void calculateNextSupplementaryElement(Element element) - { - int currentValue = m_nextValue_; - int currentBlock = m_nextBlock_; - m_nextCodepoint_ ++; - m_nextBlockIndex_ ++; - - if (!checkNullNextTrailIndex() && !checkBlockDetail(currentValue)) { - setResult(element, m_currentCodepoint_, m_nextCodepoint_, - currentValue); - m_currentCodepoint_ = m_nextCodepoint_; - return; - } - // we have cleared one block - m_nextIndex_ ++; - m_nextTrailIndexOffset_ ++; - if (!checkTrailBlock(currentBlock, currentValue)) { - setResult(element, m_currentCodepoint_, m_nextCodepoint_, - currentValue); - m_currentCodepoint_ = m_nextCodepoint_; - return; - } - - int nextLead = UTF16.getLeadSurrogate(m_nextCodepoint_); - // enumerate supplementary code points - while (nextLead < TRAIL_SURROGATE_MIN_VALUE_) { - // lead surrogate access - int leadBlock = - m_trie_.m_index_[nextLead >> Trie.INDEX_STAGE_1_SHIFT_] << - Trie.INDEX_STAGE_2_SHIFT_; - if (leadBlock == m_trie_.m_dataOffset_) { - // no entries for a whole block of lead surrogates - nextLead += DATA_BLOCK_LENGTH_; - // number of total affected supplementary codepoints in one - // block - m_nextCodepoint_ += DATA_BLOCK_SUPPLEMENTARY_LENGTH_; - continue; - } - if (m_trie_.m_dataManipulate_ == null) { - throw new NullPointerException( - "The field DataManipulate in this Trie is null"); - } - // enumerate trail surrogates for this lead surrogate - m_nextIndex_ = m_trie_.m_dataManipulate_.getFoldingOffset( - m_trie_.getValue(leadBlock + - (nextLead & Trie.INDEX_STAGE_3_MASK_))); - if (m_nextIndex_ <= 0) { - // no data for this lead surrogate - if (currentValue != m_initialValue_) { - m_nextValue_ = m_initialValue_; - m_nextBlock_ = 0; - m_nextBlockIndex_ = 0; - setResult(element, m_currentCodepoint_, m_nextCodepoint_, - currentValue); - m_currentCodepoint_ = m_nextCodepoint_; - return; - } - m_nextCodepoint_ += TRAIL_SURROGATE_COUNT_; - } else { - m_nextTrailIndexOffset_ = 0; - if (!checkTrailBlock(currentBlock, currentValue)) { - setResult(element, m_currentCodepoint_, m_nextCodepoint_, - currentValue); - m_currentCodepoint_ = m_nextCodepoint_; - return; - } - } - nextLead ++; - } - - // deliver last range - setResult(element, m_currentCodepoint_, UCharacter.MAX_VALUE + 1, - currentValue); - } - - /** - * Internal block value calculations - * Performs calculations on a data block to find codepoints in m_nextBlock_ - * after the index m_nextBlockIndex_ that has the same value. - * Note m_*_ variables at this point is the next codepoint whose value - * has not been calculated. - * But when returned with false, it will be the last codepoint whose - * value has been calculated. - * @param currentValue the value which other codepoints are tested against - * @return true if the whole block has the same value as currentValue or if - * the whole block has been calculated, false otherwise. - */ - private final boolean checkBlockDetail(int currentValue) - { - while (m_nextBlockIndex_ < DATA_BLOCK_LENGTH_) { - m_nextValue_ = extract(m_trie_.getValue(m_nextBlock_ + - m_nextBlockIndex_)); - if (m_nextValue_ != currentValue) { - return false; - } - ++ m_nextBlockIndex_; - ++ m_nextCodepoint_; - } - return true; - } - - /** - * Internal block value calculations - * Performs calculations on a data block to find codepoints in m_nextBlock_ - * that has the same value. - * Will call checkBlockDetail() if highlevel check fails. - * Note m_*_ variables at this point is the next codepoint whose value - * has not been calculated. - * @param currentBlock the initial block containing all currentValue - * @param currentValue the value which other codepoints are tested against - * @return true if the whole block has the same value as currentValue or if - * the whole block has been calculated, false otherwise. - */ - private final boolean checkBlock(int currentBlock, int currentValue) - { - m_nextBlock_ = m_trie_.m_index_[m_nextIndex_] << - Trie.INDEX_STAGE_2_SHIFT_; - if (m_nextBlock_ == currentBlock) { - // the block is the same as the previous one, filled with - // currentValue - m_nextCodepoint_ += DATA_BLOCK_LENGTH_; - } - else if (m_nextBlock_ == 0) { - // this is the all-initial-value block - if (currentValue != m_initialValue_) { - m_nextValue_ = m_initialValue_; - m_nextBlockIndex_ = 0; - return false; - } - m_nextCodepoint_ += DATA_BLOCK_LENGTH_; - } - else { - if (!checkBlockDetail(currentValue)) { - return false; - } - } - return true; - } - - /** - * Internal block value calculations - * Performs calculations on multiple data blocks for a set of trail - * surrogates to find codepoints in m_nextBlock_ that has the same value. - * Will call checkBlock() for internal block checks. - * Note m_*_ variables at this point is the next codepoint whose value - * has not been calculated. - * @param currentBlock the initial block containing all currentValue - * @param currentValue the value which other codepoints are tested against - * @return true if the whole block has the same value as currentValue or if - * the whole block has been calculated, false otherwise. - */ - private final boolean checkTrailBlock(int currentBlock, - int currentValue) - { - // enumerate code points for this lead surrogate - while (m_nextTrailIndexOffset_ < TRAIL_SURROGATE_INDEX_BLOCK_LENGTH_) - { - // if we ever reach here, we are at the start of a new block - m_nextBlockIndex_ = 0; - // copy of most of the body of the BMP loop - if (!checkBlock(currentBlock, currentValue)) { - return false; - } - m_nextTrailIndexOffset_ ++; - m_nextIndex_ ++; - } - return true; - } - - /** - * Checks if we are beginning at the start of a initial block. - * If we are then the rest of the codepoints in this initial block - * has the same values. - * We increment m_nextCodepoint_ and relevant data members if so. - * This is used only in for the supplementary codepoints because - * the offset to the trail indexes could be 0. - * @return true if we are at the start of a initial block. - */ - private final boolean checkNullNextTrailIndex() - { - if (m_nextIndex_ <= 0) { - m_nextCodepoint_ += TRAIL_SURROGATE_COUNT_ - 1; - int nextLead = UTF16.getLeadSurrogate(m_nextCodepoint_); - int leadBlock = - m_trie_.m_index_[nextLead >> Trie.INDEX_STAGE_1_SHIFT_] << - Trie.INDEX_STAGE_2_SHIFT_; - if (m_trie_.m_dataManipulate_ == null) { - throw new NullPointerException( - "The field DataManipulate in this Trie is null"); - } - m_nextIndex_ = m_trie_.m_dataManipulate_.getFoldingOffset( - m_trie_.getValue(leadBlock + - (nextLead & Trie.INDEX_STAGE_3_MASK_))); - m_nextIndex_ --; - m_nextBlockIndex_ = DATA_BLOCK_LENGTH_; - return true; - } - return false; - } - - // private data members -------------------------------------------- - - /** - * Size of the stage 1 BMP indexes - */ - private static final int BMP_INDEX_LENGTH_ = - 0x10000 >> Trie.INDEX_STAGE_1_SHIFT_; - /** - * Lead surrogate minimum value - */ - private static final int LEAD_SURROGATE_MIN_VALUE_ = 0xD800; - /** - * Trail surrogate minimum value - */ - private static final int TRAIL_SURROGATE_MIN_VALUE_ = 0xDC00; - /** - * Trail surrogate maximum value - */ - private static final int TRAIL_SURROGATE_MAX_VALUE_ = 0xDFFF; - /** - * Number of trail surrogate - */ - private static final int TRAIL_SURROGATE_COUNT_ = 0x400; - /** - * Number of stage 1 indexes for supplementary calculations that maps to - * each lead surrogate character. - * See second pass into getRawOffset for the trail surrogate character. - * 10 for significant number of bits for trail surrogates, 5 for what we - * discard during shifting. - */ - private static final int TRAIL_SURROGATE_INDEX_BLOCK_LENGTH_ = - 1 << (10 - Trie.INDEX_STAGE_1_SHIFT_); - /** - * Number of data values in a stage 2 (data array) block. - */ - private static final int DATA_BLOCK_LENGTH_ = - 1 << Trie.INDEX_STAGE_1_SHIFT_; - /** - * Number of codepoints in a stage 2 block - */ - private static final int DATA_BLOCK_SUPPLEMENTARY_LENGTH_ = - DATA_BLOCK_LENGTH_ << 10; - /** - * Trie instance - */ - private Trie m_trie_; - /** - * Initial value for trie values - */ - private int m_initialValue_; - /** - * Next element results and data. - */ - private int m_currentCodepoint_; - private int m_nextCodepoint_; - private int m_nextValue_; - private int m_nextIndex_; - private int m_nextBlock_; - private int m_nextBlockIndex_; - private int m_nextTrailIndexOffset_; - /** - * This is the return result element - */ - private int m_start_; - private int m_limit_; - private int m_value_; -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/icu/test/format/DateFormatMiscTests.java b/icu4j/src/com/ibm/icu/test/format/DateFormatMiscTests.java deleted file mode 100755 index 76f288a794..0000000000 --- a/icu4j/src/com/ibm/icu/test/format/DateFormatMiscTests.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/format/Attic/DateFormatMiscTests.java,v $ - * $Date: 2001/10/29 12:49:02 $ - * $Revision: 1.4 $ - * - ***************************************************************************************** - */ - -/** - * Port From: ICU4C v1.8.1 : format : DateFormatMiscTests - * Source File: $ICU4CRoot/source/test/intltest/miscdtfm.cpp - **/ - -package com.ibm.icu.test.format; - -import com.ibm.text.*; -import com.ibm.util.*; -import java.text.FieldPosition; -import java.text.ParseException; -import java.util.Locale; -import java.util.Date; - -/** - * Performs miscellaneous tests for DateFormat, SimpleDateFormat, DateFormatSymbols - **/ -public class DateFormatMiscTests extends com.ibm.test.TestFmwk { - - public static void main(String[] args) throws Exception{ - new DateFormatMiscTests().run(args); - } - - /* - * @bug 4097450 - */ - public void Test4097450() { - // - // Date parse requiring 4 digit year. - // - String dstring[] = { - "97", "1997", "97", "1997", "01", "2001", "01", "2001", - "1", "1", "11", "11", "111", "111"}; - - String dformat[] = - { - "yy", "yy", "yyyy", "yyyy", "yy", "yy", "yyyy", "yyyy", - "yy", "yyyy", "yy", "yyyy", "yy", "yyyy"}; - - SimpleDateFormat formatter; - SimpleDateFormat resultFormatter = new SimpleDateFormat("yyyy"); - logln("Format\tSource\tResult"); - logln("-------\t-------\t-------"); - for (int i = 0; i < dstring.length ; i++) { - log(dformat[i] + "\t" + dstring[i] + "\t"); - formatter = new SimpleDateFormat(dformat[i]); - try { - StringBuffer str = new StringBuffer(""); - FieldPosition pos = new FieldPosition(0); - logln(resultFormatter.format(formatter.parse(dstring[i]), str, pos).toString()); - } - catch (ParseException exception) { - errln("exception --> " + exception); - } - logln(""); - } - } - - /* @Bug 4099975 - * SimpleDateFormat constructor SimpleDateFormat(String, DateFormatSymbols) - * should clone the DateFormatSymbols parameter - */ - public void Test4099975new() { - Date d = new Date(); - //test SimpleDateFormat Constructor - { - DateFormatSymbols symbols = new DateFormatSymbols(Locale.US); - SimpleDateFormat df = new SimpleDateFormat("E hh:mm", symbols); - SimpleDateFormat dfClone = (SimpleDateFormat) df.clone(); - - logln(df.toLocalizedPattern()); - String s0 = df.format(d); - String s_dfClone = dfClone.format(d); - - symbols.setLocalPatternChars("abcdefghijklmonpqr"); // change value of field - logln(df.toLocalizedPattern()); - String s1 = df.format(d); - - if (!s1.equals(s0) || !s1.equals(s_dfClone)) { - errln("Constructor: the formats are not equal"); - } - if (!df.equals(dfClone)) { - errln("The Clone Object does not equal with the orignal source"); - } - } - //test SimpleDateFormat.setDateFormatSymbols() - { - DateFormatSymbols symbols = new DateFormatSymbols(Locale.US); - SimpleDateFormat df = new SimpleDateFormat("E hh:mm"); - df.setDateFormatSymbols(symbols); - SimpleDateFormat dfClone = (SimpleDateFormat) df.clone(); - - logln(df.toLocalizedPattern()); - String s0 = df.format(d); - String s_dfClone = dfClone.format(d); - - symbols.setLocalPatternChars("abcdefghijklmonpqr"); // change value of field - logln(df.toLocalizedPattern()); - String s1 = df.format(d); - - if (!s1.equals(s0) || !s1.equals(s_dfClone)) { - errln("setDateFormatSymbols: the formats are not equal"); - } - if (!df.equals(dfClone)) { - errln("The Clone Object does not equal with the orignal source"); - } - } - } - - /* - * @bug 4117335 - */ - public void Test4117335() { - //char bcC[] = {0x7D00, 0x5143, 0x524D}; - String bc = "\u7D00\u5143\u524D"; - String ad = "\u897f\u66a6"; - //char adC[] = {0x897F, 0x66A6}; - String jstLong = "\u65e5\u672c\u6a19\u6e96\u6642"; - //char jstLongC[] = {0x65e5, 0x672c, 0x6a19, 0x6e96, 0x6642}; //The variable is never used - String jstShort = "JST"; - - DateFormatSymbols symbols = new DateFormatSymbols(Locale.JAPAN); - final String[] eras = symbols.getEras(); - //int eraCount = eras.length; //The variable is never used - logln("BC = " + eras[0]); - if (!eras[0].equals(bc)) { - errln("*** Should have been " + bc); - } - - logln("AD = " + eras[1]); - if (!eras[1].equals(ad)) { - errln("*** Should have been " + ad); - } - - final String zones[][] = symbols.getZoneStrings(); - //int rowCount = zones.length, colCount = zones[0].length; //The variable is never used - logln("Long zone name = " + zones[0][1]); - if (!zones[0][1].equals(jstLong)) { - errln("*** Should have been " + jstLong); - } - logln("Short zone name = " + zones[0][2]); - if (!zones[0][2].equals(jstShort)) { - errln("*** Should have been " + jstShort); - } - logln("Long zone name = " + zones[0][3]); - if (zones[0][3] != jstLong) { - errln("*** Should have been " + jstLong); - } - logln("SHORT zone name = " + zones[0][4]); - if (zones[0][4] != jstShort) { - errln("*** Should have been " + jstShort); - } - } -} diff --git a/icu4j/src/com/ibm/icu/test/format/DateFormatRegressionTest.java b/icu4j/src/com/ibm/icu/test/format/DateFormatRegressionTest.java deleted file mode 100755 index 34d1a99179..0000000000 --- a/icu4j/src/com/ibm/icu/test/format/DateFormatRegressionTest.java +++ /dev/null @@ -1,882 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/format/Attic/DateFormatRegressionTest.java,v $ - * $Date: 2001/10/23 13:08:50 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ - -/** - * Port From: ICU4C v1.8.1 : format : DateFormatRegressionTest - * Source File: $ICU4CRoot/source/test/intltest/dtfmrgts.cpp - **/ - -package com.ibm.icu.test.format; - -import com.ibm.text.*; -import com.ibm.util.*; -import java.util.Date; -import java.util.Locale; -import java.util.ResourceBundle; -import java.text.FieldPosition; -import java.text.ParseException; -import java.text.ParsePosition; -import java.text.Format; -import java.io.*; - -/** - * Performs regression test for DateFormat - **/ -public class DateFormatRegressionTest extends com.ibm.test.TestFmwk { - - public static void main(String[] args) throws Exception{ - new DateFormatRegressionTest().run(args); - } - - /** - * @bug 4029195 - */ - public void Test4029195() { - Calendar cal = Calendar.getInstance(); - Date today = cal.getTime(); - logln("today: " + today); - SimpleDateFormat sdf = (SimpleDateFormat) DateFormat.getDateInstance(); - String pat = sdf.toPattern(); - logln("pattern: " + pat); - StringBuffer fmtd = new StringBuffer(""); - FieldPosition pos = new FieldPosition(0); - fmtd = sdf.format(today, fmtd, pos); - logln("today: " + fmtd); - - sdf.applyPattern("G yyyy DDD"); - StringBuffer todayS = new StringBuffer(""); - todayS = sdf.format(today, todayS, pos); - logln("today: " + todayS); - try { - today = sdf.parse(todayS.toString()); - logln("today date: " + today); - } catch (Exception e) { - errln("Error reparsing date: " + e.getMessage()); - } - - try { - StringBuffer rt = new StringBuffer(""); - rt = sdf.format(sdf.parse(todayS.toString()), rt, pos); - logln("round trip: " + rt); - if (!rt.toString().equals(todayS.toString())) - errln("Fail: Want " + todayS + " Got " + rt); - } catch (ParseException e) { - errln("Fail: " + e); - e.printStackTrace(); - } - } - - /** - * @bug 4052408 - */ - public void Test4052408() { - - DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.US); - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(97 + 1900, Calendar.MAY, 3, 8, 55); - Date dt = cal.getTime(); - String str = fmt.format(dt); - logln(str); - - if (!str.equals("5/3/97 8:55 AM")) - errln("Fail: Test broken; Want 5/3/97 8:55 AM Got " + str); - - String expected[] = { - "", //"ERA_FIELD", - "97", //"YEAR_FIELD", - "5", //"MONTH_FIELD", - "3", //"DATE_FIELD", - "", //"HOUR_OF_DAY1_FIELD", - "", //"HOUR_OF_DAY0_FIELD", - "55", //"MINUTE_FIELD", - "", //"SECOND_FIELD", - "", //"MILLISECOND_FIELD", - "", //"DAY_OF_WEEK_FIELD", - "", //"DAY_OF_YEAR_FIELD", - "", //"DAY_OF_WEEK_IN_MONTH_FIELD", - "", //"WEEK_OF_YEAR_FIELD", - "", //"WEEK_OF_MONTH_FIELD", - "AM", //"AM_PM_FIELD", - "8", //"HOUR1_FIELD", - "", //"HOUR0_FIELD", - "" //"TIMEZONE_FIELD" - }; - String fieldNames[] = { - "ERA_FIELD", - "YEAR_FIELD", - "MONTH_FIELD", - "DATE_FIELD", - "HOUR_OF_DAY1_FIELD", - "HOUR_OF_DAY0_FIELD", - "MINUTE_FIELD", - "SECOND_FIELD", - "MILLISECOND_FIELD", - "DAY_OF_WEEK_FIELD", - "DAY_OF_YEAR_FIELD", - "DAY_OF_WEEK_IN_MONTH_FIELD", - "WEEK_OF_YEAR_FIELD", - "WEEK_OF_MONTH_FIELD", - "AM_PM_FIELD", - "HOUR1_FIELD", - "HOUR0_FIELD", - "TIMEZONE_FIELD"}; - - boolean pass = true; - for (int i = 0; i <= 17; ++i) { - FieldPosition pos = new FieldPosition(i); - StringBuffer buf = new StringBuffer(""); - fmt.format(dt, buf, pos); - //char[] dst = new char[pos.getEndIndex() - pos.getBeginIndex()]; - String dst = buf.substring(pos.getBeginIndex(), pos.getEndIndex()); - str = dst; - log(i + ": " + fieldNames[i] + ", \"" + str + "\", " - + pos.getBeginIndex() + ", " + pos.getEndIndex()); - String exp = expected[i]; - if ((exp.length() == 0 && str.length() == 0) || str.equals(exp)) - logln(" ok"); - else { - logln(" expected " + exp); - pass = false; - } - } - if (!pass) - errln("Fail: FieldPosition not set right by DateFormat"); - } - - /** - * @bug 4056591 - * Verify the function of the [s|g]et2DigitYearStart() API. - */ - public void Test4056591() { - - try { - SimpleDateFormat fmt = new SimpleDateFormat("yyMMdd", Locale.US); - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(1809, Calendar.DECEMBER, 25); - Date start = cal.getTime(); - fmt.set2DigitYearStart(start); - if ((fmt.get2DigitYearStart() != start)) - errln("get2DigitYearStart broken"); - cal.clear(); - cal.set(1809, Calendar.DECEMBER, 25); - Date d1 = cal.getTime(); - cal.clear(); - cal.set(1909, Calendar.DECEMBER, 24); - Date d2 = cal.getTime(); - cal.clear(); - cal.set(1809, Calendar.DECEMBER, 26); - Date d3 = cal.getTime(); - cal.clear(); - cal.set(1861, Calendar.DECEMBER, 25); - Date d4 = cal.getTime(); - - Date dates[] = {d1, d2, d3, d4}; - - String strings[] = {"091225", "091224", "091226", "611225"}; - - for (int i = 0; i < 4; i++) { - String s = strings[i]; - Date exp = dates[i]; - Date got = fmt.parse(s); - logln(s + " . " + got + "; exp " + exp); - if (got.getTime() != exp.getTime()) - errln("set2DigitYearStart broken"); - } - } catch (ParseException e) { - errln("Fail: " + e); - e.printStackTrace(); - } - } - - /** - * @bug 4059917 - */ - public void Test4059917() { - SimpleDateFormat fmt; - String myDate; - fmt = new SimpleDateFormat("yyyy/MM/dd"); - myDate = "1997/01/01"; - aux917( fmt, myDate ); - fmt = new SimpleDateFormat("yyyyMMdd"); - myDate = "19970101"; - aux917( fmt, myDate ); - } - - public void aux917(SimpleDateFormat fmt, String str) { - - String pat = fmt.toPattern(); - logln("=================="); - logln("testIt: pattern=" + pat + " string=" + str); - ParsePosition pos = new ParsePosition(0); - Object o = fmt.parseObject(str, pos); - //logln( UnicodeString("Parsed object: ") + o ); - - StringBuffer formatted = new StringBuffer(""); - FieldPosition poss = new FieldPosition(0); - formatted = fmt.format(o, formatted, poss); - - logln("Formatted string: " + formatted); - if (!formatted.toString().equals(str)) - errln("Fail: Want " + str + " Got " + formatted); - } - - /** - * @bug 4060212 - */ - public void Test4060212() { - String dateString = "1995-040.05:01:29"; - logln("dateString= " + dateString); - logln("Using yyyy-DDD.hh:mm:ss"); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-DDD.hh:mm:ss"); - ParsePosition pos = new ParsePosition(0); - Date myDate = formatter.parse(dateString, pos); - DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.LONG); - String myString = fmt.format(myDate); - logln(myString); - Calendar cal = new GregorianCalendar(); - cal.setTime(myDate); - if ((cal.get(Calendar.DAY_OF_YEAR) != 40)) - errln("Fail: Got " + cal.get(Calendar.DAY_OF_YEAR) + " Want 40"); - - logln("Using yyyy-ddd.hh:mm:ss"); - formatter = new SimpleDateFormat("yyyy-ddd.hh:mm:ss"); - pos.setIndex(0); - myDate = formatter.parse(dateString, pos); - myString = fmt.format(myDate); - logln(myString); - cal.setTime(myDate); - if ((cal.get(Calendar.DAY_OF_YEAR) != 40)) - errln("Fail: Got " + cal.get(Calendar.DAY_OF_YEAR) + " Want 40"); - } - /** - * @bug 4061287 - */ - public void Test4061287() { - - SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy"); - try { - logln(df.parse("35/01/1971").toString()); - } catch (ParseException e) { - errln("Fail: " + e); - e.printStackTrace(); - } - df.setLenient(false); - boolean ok = false; - try { - logln(df.parse("35/01/1971").toString()); - } catch (ParseException e) { - ok = true; - } - if (!ok) - errln("Fail: Lenient not working"); - } - - /** - * @bug 4065240 - */ - public void Test4065240() { - Date curDate; - DateFormat shortdate, fulldate; - String strShortDate, strFullDate; - Locale saveLocale = Locale.getDefault(); - TimeZone saveZone = TimeZone.getDefault(); - - try { - Locale curLocale = new Locale("de", "DE"); - Locale.setDefault(curLocale); - // {sfb} adoptDefault instead of setDefault - //TimeZone.setDefault(TimeZone.createTimeZone("EST")); - TimeZone.setDefault(TimeZone.getTimeZone("EST")); - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(98 + 1900, 0, 1); - curDate = cal.getTime(); - shortdate = DateFormat.getDateInstance(DateFormat.SHORT); - fulldate = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); - strShortDate = "The current date (short form) is "; - String temp; - temp = shortdate.format(curDate); - strShortDate += temp; - strFullDate = "The current date (long form) is "; - String temp2 = fulldate.format(curDate); - strFullDate += temp2; - - logln(strShortDate); - logln(strFullDate); - - // {sfb} What to do with resource bundle stuff????? - - // Check to see if the resource is present; if not, we can't test - //ResourceBundle bundle = //The variable is never used - // ResourceBundle.getBundle("java.text.resources.DateFormatZoneData", curLocale); - - // {sfb} API change to ResourceBundle -- add getLocale() - /*if (bundle.getLocale().getLanguage().equals("de")) { - // UPDATE THIS AS ZONE NAME RESOURCE FOR in de_DE is updated - if (!strFullDate.endsWith("GMT-05:00")) - errln("Fail: Want GMT-05:00"); - } else { - logln("*** TEST COULD NOT BE COMPLETED BECAUSE DateFormatZoneData ***"); - logln("*** FOR LOCALE de OR de_DE IS MISSING ***"); - }*/ - } catch (Exception e) { - logln(e.getMessage()); - } finally { - Locale.setDefault(saveLocale); - TimeZone.setDefault(saveZone); - } - - } - - /* - DateFormat.equals is too narrowly defined. As a result, MessageFormat - does not work correctly. DateFormat.equals needs to be written so - that the Calendar sub-object is not compared using Calendar.equals, - but rather compared for equivalency. This may necessitate adding a - (package private) method to Calendar to test for equivalency. - - Currently this bug breaks MessageFormat.toPattern - */ - /** - * @bug 4071441 - */ - public void Test4071441() { - DateFormat fmtA = DateFormat.getInstance(); - DateFormat fmtB = DateFormat.getInstance(); - - // {sfb} Is it OK to cast away const here? - Calendar calA = fmtA.getCalendar(); - Calendar calB = fmtB.getCalendar(); - calA.clear(); - calA.set(1900, 0 ,0); - calB.clear(); - calB.set(1900, 0, 0); - if (!calA.equals(calB)) - errln("Fail: Can't complete test; Calendar instances unequal"); - if (!fmtA.equals(fmtB)) - errln("Fail: DateFormat unequal when Calendars equal"); - calB.clear(); - calB.set(1961, Calendar.DECEMBER, 25); - if (calA.equals(calB)) - errln("Fail: Can't complete test; Calendar instances equal"); - if (!fmtA.equals(fmtB)) - errln("Fail: DateFormat unequal when Calendars equivalent"); - logln("DateFormat.equals ok"); - } - - /* The java.text.DateFormat.parse(String) method expects for the - US locale a string formatted according to mm/dd/yy and parses it - correctly. - - When given a string mm/dd/yyyy it only parses up to the first - two y's, typically resulting in a date in the year 1919. - - Please extend the parsing method(s) to handle strings with - four-digit year values (probably also applicable to various - other locales. */ - /** - * @bug 4073003 - */ - public void Test4073003() { - try { - DateFormat fmt = DateFormat.getDateInstance(DateFormat.SHORT, Locale.US); - String tests[] = {"12/25/61", "12/25/1961", "4/3/2010", "4/3/10"}; - for (int i = 0; i < 4; i += 2) { - Date d = fmt.parse(tests[i]); - Date dd = fmt.parse(tests[i + 1]); - String s; - s = fmt.format(d); - String ss; - ss = fmt.format(dd); - if (d.getTime() != dd.getTime()) - errln("Fail: " + d + " != " + dd); - if (!s.equals(ss)) - errln("Fail: " + s + " != " + ss); - logln("Ok: " + s + " " + d); - } - } catch (ParseException e) { - errln("Fail: " + e); - e.printStackTrace(); - } - } - - /** - * @bug 4089106 - */ - public void Test4089106() { - TimeZone def = TimeZone.getDefault(); - try { - TimeZone z = new SimpleTimeZone((int) (1.25 * 3600000), "FAKEZONE"); - TimeZone.setDefault(z); - SimpleDateFormat f = new SimpleDateFormat(); - if (!f.getTimeZone().equals(z)) - errln("Fail: SimpleTimeZone should use TimeZone.getDefault()"); - } finally { - TimeZone.setDefault(def); - } - } - - /** - * @bug 4100302 - */ - public void Test4100302() { - - Locale locales[] = { - Locale.CANADA, Locale.CANADA_FRENCH, Locale.CHINA, - Locale.CHINESE, Locale.ENGLISH, Locale.FRANCE, Locale.FRENCH, - Locale.GERMAN, Locale.GERMANY, Locale.ITALIAN, Locale.ITALY, - Locale.JAPAN, Locale.JAPANESE, Locale.KOREA, Locale.KOREAN, - Locale.PRC, Locale.SIMPLIFIED_CHINESE, Locale.TAIWAN, - Locale.TRADITIONAL_CHINESE, Locale.UK, Locale.US}; - try { - boolean pass = true; - for (int i = 0; i < 21; i++) { - Format format = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, locales[i]); - byte[] bytes; - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(format); - oos.flush(); - baos.close(); - bytes = baos.toByteArray(); - ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bytes)); - Object o = ois.readObject(); - if (!format.equals(o)) { - pass = false; - logln("DateFormat instance for locale " + locales[i] + " is incorrectly serialized/deserialized."); - } else { - logln("DateFormat instance for locale " + locales[i] + " is OKAY."); - } - } - if (!pass) - errln("Fail: DateFormat serialization/equality bug"); - } catch (OptionalDataException e) { - errln("Fail: " + e); - } catch (IOException e) { - errln("Fail: " + e); - } catch (ClassNotFoundException e) { - errln("Fail: " + e); - } catch (Exception e) { - errln("Fail: " + e); - } - - } - - /** - * @bug 4101483 - */ - public void Test4101483() { - SimpleDateFormat sdf = new SimpleDateFormat("z", Locale.US); - FieldPosition fp = new FieldPosition(DateFormat.TIMEZONE_FIELD); - Date d = new Date(9234567890L); - StringBuffer buf = new StringBuffer(""); - sdf.format(d, buf, fp); - logln(sdf.format(d, buf, fp).toString()); - logln("beginIndex = " + fp.getBeginIndex()); - logln("endIndex = " + fp.getEndIndex()); - if (fp.getBeginIndex() == fp.getEndIndex()) - errln("Fail: Empty field"); - } - - /** - * @bug 4103340 - * @bug 4138203 - * This bug really only works in Locale.US, since that's what the locale - * used for Date.toString() is. Bug 4138203 reports that it fails on Korean - * NT; it would actually have failed on any non-US locale. Now it should - * work on all locales. - */ - public void Test4103340() { - - // choose a date that is the FIRST of some month - // and some arbitrary time - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(1997, 3, 1, 1, 1, 1); - Date d = cal.getTime(); - SimpleDateFormat df = new SimpleDateFormat("MMMM", Locale.US); - String s = d.toString(); - StringBuffer s2 = new StringBuffer(""); - FieldPosition pos = new FieldPosition(0); - s2 = df.format(d, s2, pos); - logln("Date=" + s); - logln("DF=" + s2); - String substr = s2.substring(0,2); - if (s.indexOf(substr) == -1) - errln("Months should match"); - } - - /** - * @bug 4103341 - */ - public void Test4103341() { - TimeZone saveZone = TimeZone.getDefault(); - try { - // {sfb} changed from adoptDefault to setDefault - TimeZone.setDefault(TimeZone.getTimeZone("CST")); - SimpleDateFormat simple = new SimpleDateFormat("MM/dd/yyyy HH:mm"); - TimeZone temp = TimeZone.getDefault(); - if (!simple.getTimeZone().equals(temp)) - errln("Fail: SimpleDateFormat not using default zone"); - } finally { - TimeZone.setDefault(saveZone); - } - } - - /** - * @bug 4104136 - */ - public void Test4104136() { - SimpleDateFormat sdf = new SimpleDateFormat(); - String pattern = "'time' hh:mm"; - sdf.applyPattern(pattern); - logln("pattern: \"" + pattern + "\""); - String strings[] = {"time 10:30", "time 10:x", "time 10x"}; - ParsePosition ppos[] = {new ParsePosition(10), new ParsePosition(0), new ParsePosition(0)}; - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(1970, Calendar.JANUARY, 1, 10, 30); - Date dates[] = {cal.getTime(), new Date(-1), new Date(-1)}; - for (int i = 0; i < 3; i++) { - String text = strings[i]; - ParsePosition finish = ppos[i]; - Date exp = dates[i]; - ParsePosition pos = new ParsePosition(0); - Date d = sdf.parse(text, pos); - logln(" text: \"" + text + "\""); - logln(" index: %d" + pos.getIndex()); - logln(" result: " + d); - if (pos.getIndex() != finish.getIndex()) - errln("Fail: Expected pos " + finish.getIndex()); - if (!((d == null && exp.equals(new Date(-1))) || (d.equals(exp)))) - errln( "Fail: Expected result " + exp); - } - } - - /** - * @bug 4104522 - * CANNOT REPRODUCE - * According to the bug report, this test should throw a - * StringIndexOutOfBoundsException during the second parse. However, - * this is not seen. - */ - public void Test4104522() { - SimpleDateFormat sdf = new SimpleDateFormat(); - String pattern = "'time' hh:mm"; - sdf.applyPattern(pattern); - logln("pattern: \"" + pattern + "\""); - // works correctly - ParsePosition pp = new ParsePosition(0); - String text = "time "; - Date dt = sdf.parse(text, pp); - logln(" text: \"" + text + "\"" + " date: " + dt); - // works wrong - pp.setIndex(0); - text = "time"; - dt = sdf.parse(text, pp); - logln(" text: \"" + text + "\"" + " date: " + dt); - } - - /** - * @bug 4106807 - */ - public void Test4106807() { - Date dt; - DateFormat df = DateFormat.getDateTimeInstance(); - - SimpleDateFormat sdfs[] = { - new SimpleDateFormat("yyyyMMddHHmmss"), - new SimpleDateFormat("yyyyMMddHHmmss'Z'"), - new SimpleDateFormat("yyyyMMddHHmmss''"), - new SimpleDateFormat("yyyyMMddHHmmss'a''a'"), - new SimpleDateFormat("yyyyMMddHHmmss %")}; - String strings[] = { - "19980211140000", - "19980211140000", - "19980211140000", - "19980211140000a", - "19980211140000 "}; - GregorianCalendar gc = new GregorianCalendar(); - TimeZone timeZone = TimeZone.getDefault(); - TimeZone gmt = (TimeZone) timeZone.clone(); - gmt.setRawOffset(0); - for (int i = 0; i < 5; i++) { - SimpleDateFormat format = sdfs[i]; - String dateString = strings[i]; - try { - format.setTimeZone(gmt); - dt = format.parse(dateString); - // {sfb} some of these parses will fail purposely - - StringBuffer fmtd = new StringBuffer(""); - FieldPosition pos = new FieldPosition(0); - fmtd = df.format(dt, fmtd, pos); - logln(fmtd.toString()); - //logln(df.format(dt)); - gc.setTime(dt); - logln("" + gc.get(Calendar.ZONE_OFFSET)); - StringBuffer s = new StringBuffer(""); - s = format.format(dt, s, pos); - logln(s.toString()); - } catch (ParseException e) { - logln("No way Jose"); - } - } - } - - /* - Synopsis: Chinese time zone CTT is not recogonized correctly. - Description: Platform Chinese Windows 95 - ** Time zone set to CST ** - */ - /** - * @bug 4108407 - */ - - // {sfb} what to do with this one ?? - public void Test4108407() { - /* - long l = System.currentTimeMillis(); - logln("user.timezone = " + System.getProperty("user.timezone", "?")); - logln("Time Zone :" + - DateFormat.getDateInstance().getTimeZone().getID()); - logln("Default format :" + - DateFormat.getDateInstance().format(new Date(l))); - logln("Full format :" + - DateFormat.getDateInstance(DateFormat.FULL).format(new - Date(l))); - logln("*** Set host TZ to CST ***"); - logln("*** THE RESULTS OF THIS TEST MUST BE VERIFIED MANUALLY ***"); - */ - } - - /** - * @bug 4134203 - * SimpleDateFormat won't parse "GMT" - */ - public void Test4134203() { - String dateFormat = "MM/dd/yy HH:mm:ss zzz"; - SimpleDateFormat fmt = new SimpleDateFormat(dateFormat); - - ParsePosition p0 = new ParsePosition(0); - Date d = fmt.parse("01/22/92 04:52:00 GMT", p0); - logln(d.toString()); - if(p0.equals(new ParsePosition(0))) - errln("Fail: failed to parse 'GMT'"); - // In the failure case an exception is thrown by parse(); - // if no exception is thrown, the test passes. - } - - /** - * @bug 4151631 - * SimpleDateFormat incorrect handling of 2 single quotes in format() - */ - public void Test4151631() { - String pattern = - "'TO_DATE('''dd'-'MM'-'yyyy HH:mm:ss''' , ''DD-MM-YYYY HH:MI:SS'')'"; - logln("pattern=" + pattern); - SimpleDateFormat format = new SimpleDateFormat(pattern, Locale.US); - StringBuffer result = new StringBuffer(""); - FieldPosition pos = new FieldPosition(0); - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(1998, Calendar.JUNE, 30, 13, 30, 0); - Date d = cal.getTime(); - result = format.format(d, result, pos); - if (!result.toString().equals("TO_DATE('30-06-1998 13:30:00' , 'DD-MM-YYYY HH:MI:SS')")) { - errln("Fail: result=" + result); - } else { - logln("Pass: result=" + result); - } - } - - /** - * @bug 4151706 - * 'z' at end of date format throws index exception in SimpleDateFormat - * CANNOT REPRODUCE THIS BUG ON 1.2FCS - */ - public void Test4151706() { - String dateString = "Thursday, 31-Dec-98 23:00:00 GMT"; - SimpleDateFormat fmt = new SimpleDateFormat("EEEE, dd-MMM-yy HH:mm:ss z", Locale.US); - Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.US); - cal.clear(); - cal.set(1998, Calendar.DECEMBER, 31, 23, 0, 0); - Date d = new Date(); - try { - d = fmt.parse(dateString); - // {sfb} what about next two lines? - if (d.getTime() != cal.getTime().getTime()) - errln("Incorrect value: " + d); - } catch (Exception e) { - errln("Fail: " + e); - } - StringBuffer temp = new StringBuffer(""); - FieldPosition pos = new FieldPosition(0); - logln(dateString + " . " + fmt.format(d, temp, pos)); - } - - /** - * @bug 4162071 - * Cannot reproduce this bug under 1.2 FCS -- it may be a convoluted duplicate - * of some other bug that has been fixed. - */ - public void Test4162071() { - String dateString = "Thu, 30-Jul-1999 11:51:14 GMT"; - String format = "EEE', 'dd-MMM-yyyy HH:mm:ss z"; // RFC 822/1123 - SimpleDateFormat df = new SimpleDateFormat(format, Locale.US); - try { - Date x = df.parse(dateString); - StringBuffer temp = new StringBuffer(""); - FieldPosition pos = new FieldPosition(0); - logln(dateString + " -> " + df.format(x, temp, pos)); - } catch (Exception e) { - errln("Parse format \"" + format + "\" failed."); - } - } - - /** - * DateFormat shouldn't parse year "-1" as a two-digit year (e.g., "-1" . 1999). - */ - public void Test4182066() { - SimpleDateFormat fmt = new SimpleDateFormat("MM/dd/yy", Locale.US); - SimpleDateFormat dispFmt = new SimpleDateFormat("MMM dd yyyy HH:mm:ss GG", Locale.US); - /* We expect 2-digit year formats to put 2-digit years in the right - * window. Out of range years, that is, anything less than "00" or - * greater than "99", are treated as literal years. So "1/2/3456" - * becomes 3456 AD. Likewise, "1/2/-3" becomes -3 AD == 2 BC. - */ - final String STRINGS[] = - {"02/29/00", "01/23/01", "04/05/-1", "01/23/-9", "11/12/1314", "10/31/1", "09/12/+1", "09/12/001",}; - int STRINGS_COUNT = STRINGS.length; - - Calendar cal = Calendar.getInstance(); - Date FAIL_DATE = cal.getTime(); - cal.clear(); - cal.set(2000, Calendar.FEBRUARY, 29); - Date d0 = cal.getTime(); - cal.clear(); - cal.set(2001, Calendar.JANUARY, 23); - Date d1 = cal.getTime(); - cal.clear(); - cal.set(-1, Calendar.APRIL, 5); - Date d2 = cal.getTime(); - cal.clear(); - cal.set(-9, Calendar.JANUARY, 23); - Date d3 = cal.getTime(); - cal.clear(); - cal.set(1314, Calendar.NOVEMBER, 12); - Date d4 = cal.getTime(); - cal.clear(); - cal.set(1, Calendar.OCTOBER, 31); - Date d5 = cal.getTime(); - cal.clear(); - cal.set(1, Calendar.SEPTEMBER, 12); - Date d7 = cal.getTime(); - Date DATES[] = {d0, d1, d2, d3, d4, d5, FAIL_DATE, d7}; - - String out = ""; - boolean pass = true; - for (int i = 0; i < STRINGS_COUNT; ++i) { - String str = STRINGS[i]; - Date expected = DATES[i]; - Date actual = null; - try { - actual = fmt.parse(str); - } catch (ParseException e) { - actual = FAIL_DATE; - } - String actStr = ""; - if ((actual.getTime()) == FAIL_DATE.getTime()) { - actStr += "null"; - } else { - // Yuck: See j25 - actStr = ((DateFormat) dispFmt).format(actual); - } - - if (expected.getTime() == (actual.getTime())) { - out += str + " => " + actStr + "\n"; - } else { - String expStr = ""; - if (expected.getTime() == FAIL_DATE.getTime()) { - expStr += "null"; - } else { - // Yuck: See j25 - expStr = ((DateFormat) dispFmt).format(expected); - } - out += "FAIL: " + str + " => " + actStr + ", expected " + expStr + "\n"; - pass = false; - } - } - if (pass) { - log(out); - } else { - err(out); - } - } - - /** - * j32 {JDK Bug 4210209 4209272} - * DateFormat cannot parse Feb 29 2000 when setLenient(false) - */ - public void Test4210209() { - - String pattern = "MMM d, yyyy"; - SimpleDateFormat sfmt = new SimpleDateFormat(pattern, Locale.US); - SimpleDateFormat sdisp = new SimpleDateFormat("MMM dd yyyy GG", Locale.US); - DateFormat fmt = (DateFormat) sfmt; // Yuck: See j25 - DateFormat disp = (DateFormat) sdisp; // Yuck: See j25 - - Calendar calx = (Calendar) fmt.getCalendar(); // cast away const! - calx.setLenient(false); - Calendar calendar = Calendar.getInstance(); - calendar.clear(); - calendar.set(2000, Calendar.FEBRUARY, 29); - Date d = calendar.getTime(); - String s = fmt.format(d); - logln(disp.format(d) + " f> " + pattern + " => \"" + s + "\""); - ParsePosition pos = new ParsePosition(0); - d = fmt.parse(s, pos); - logln("\"" + s + "\" p> " + pattern + " => " + disp.format(d)); - logln("Parse pos = " + pos.getIndex() + ", error pos = " + pos.getErrorIndex()); - if (pos.getErrorIndex() != -1) { - errln("FAIL: Error index should be -1"); - } - - // The underlying bug is in GregorianCalendar. If the following lines - // succeed, the bug is fixed. If the bug isn't fixed, they will throw - // an exception. - GregorianCalendar cal = new GregorianCalendar(); - cal.clear(); - cal.setLenient(false); - cal.set(2000, Calendar.FEBRUARY, 29); // This should work! - logln("Attempt to set Calendar to Feb 29 2000: " + disp.format(cal.getTime())); - } - - public void Test714() { - //TimeZone Offset - TimeZone defaultTZ = TimeZone.getDefault(); - TimeZone PST = TimeZone.getTimeZone("PST"); - int defaultOffset = defaultTZ.getRawOffset(); - int PSTOffset = PST.getRawOffset(); - Date d = new Date(978103543000l - (defaultOffset - PSTOffset)); - d = new Date(d.getTime() - (defaultTZ.inDaylightTime(d) ? 3600000 : 0)); - DateFormat fmt = DateFormat.getDateTimeInstance(-1, DateFormat.MEDIUM, Locale.US); - String tests = "7:25:43 AM"; - String s = fmt.format(d); - if (!s.equals(tests)) { - errln("Fail: " + s + " != " + tests); - } else { - logln("OK: " + s + " == " + tests); - } - } -} diff --git a/icu4j/src/com/ibm/icu/test/format/DateFormatRegressionTestJ.java b/icu4j/src/com/ibm/icu/test/format/DateFormatRegressionTestJ.java deleted file mode 100755 index 9583e83164..0000000000 --- a/icu4j/src/com/ibm/icu/test/format/DateFormatRegressionTestJ.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/format/Attic/DateFormatRegressionTestJ.java,v $ - * $Date: 2001/10/23 13:10:05 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ - -/* - * New added, 2001-10-17 [Jing/GCL] - */ - -package com.ibm.icu.test.format; - -import com.ibm.text.*; -import com.ibm.util.*; -import java.util.Date; -import java.text.ParseException; -import java.text.ParsePosition; -import java.util.Locale; -import java.text.FieldPosition; - -public class DateFormatRegressionTestJ extends com.ibm.test.TestFmwk { - - static final String TIME_STRING = "2000/11/17 08:01:00"; - static final long UTC_LONG = 974476860000L; - static SimpleDateFormat sdf_ = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); - - public static void main(String[] args) throws Exception { - new DateFormatRegressionTestJ().run(args); - } - - //Return value of getAmPmStrings - public void Test4103926() { - String act_Ampms[]; - String exp_Ampms[]={"AM","PM"}; - Locale.setDefault(Locale.US); - - DateFormatSymbols dfs = new DateFormatSymbols(); - act_Ampms = dfs.getAmPmStrings(); - if(act_Ampms.length != exp_Ampms.length) { - errln("The result is not expected!"); - } else { - for(int i =0; i" + str); - - d = sdf.parse(str, new ParsePosition(0)); - logln(" after parse----->" + d.toString()); - - str = sdf.format(d); - logln(" after format----->" + str); - - d = sdf.parse(str, new ParsePosition(0)); - logln(" after parse----->" + d.toString()); - - str = sdf.format(d); - logln(" after format----->" + str); - } - } - - //Class used by Test4407042 - class DateParseThread extends Thread { - public void run() { - SimpleDateFormat sdf = (SimpleDateFormat) sdf_.clone(); - TimeZone defaultTZ = TimeZone.getDefault(); - TimeZone PST = TimeZone.getTimeZone("PST"); - int defaultOffset = defaultTZ.getRawOffset(); - int PSTOffset = PST.getRawOffset(); - int offset = defaultOffset - PSTOffset; - long ms = UTC_LONG - offset; - try { - int i = 0; - while (i < 10000) { - Date date = sdf.parse(TIME_STRING); - long t = date.getTime(); - i++; - if (t != ms) { - throw new ParseException("Parse Error: " + i + " (" + sdf.format(date) - + ") " + t + " != " + ms, 0); - } - } - } catch (Exception e) { - errln("parse error: " + e.getMessage()); - } - } - } - - //Class used by Test4407042 - class DateFormatThread extends Thread { - public void run() { - SimpleDateFormat sdf = (SimpleDateFormat) sdf_.clone(); - TimeZone tz = TimeZone.getTimeZone("PST"); - sdf.setTimeZone(tz); - int i = 0; - while (i < 10000) { - i++; - String s = sdf.format(new Date(UTC_LONG)); - if (!s.equals(TIME_STRING)) { - errln("Format Error: " + i + " " + s + " != " - + TIME_STRING); - } - } - } - } - -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/icu/test/format/DateFormatRoundTripTest.java b/icu4j/src/com/ibm/icu/test/format/DateFormatRoundTripTest.java deleted file mode 100755 index dc29b1a292..0000000000 --- a/icu4j/src/com/ibm/icu/test/format/DateFormatRoundTripTest.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/format/Attic/DateFormatRoundTripTest.java,v $ - * $Date: 2001/11/06 11:07:16 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -/** - * Port From: ICU4C v1.8.1 : format : DateFormatRoundTripTest - * Source File: $ICU4CRoot/source/test/intltest/dtfmtrtts.cpp - **/ - -package com.ibm.icu.test.format; - -import com.ibm.text.*; -import com.ibm.util.*; -import java.util.Locale; -import java.util.Date; -import java.util.Random; -import java.text.FieldPosition; -import java.text.ParseException; - -/** - * Performs round-trip tests for DateFormat - **/ -public class DateFormatRoundTripTest extends com.ibm.test.TestFmwk { - public boolean INFINITE = false; - public boolean quick = true; - private SimpleDateFormat dateFormat; - private Calendar getFieldCal; - private int SPARSENESS = 18; - private int TRIALS = 4; - private int DEPTH = 5; - private Random ran = new Random(); - - public static void main(String[] args) throws Exception { - new DateFormatRoundTripTest().run(args); - } - - public void TestDateFormatRoundTrip() { - dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss.SSS zzz yyyy G"); - getFieldCal = Calendar.getInstance(); - - final Locale[] avail = DateFormat.getAvailableLocales(); - int locCount = avail.length; - logln("DateFormat available locales: " + locCount); - if (quick) { - if (locCount > 5) - locCount = 5; - logln("Quick mode: only testing first 5 Locales"); - } - TimeZone tz = TimeZone.getDefault(); - logln("Default TimeZone: " + tz.getID()); - - if (INFINITE) { - // Special infinite loop test mode for finding hard to reproduce errors - Locale loc = Locale.getDefault(); - logln("ENTERING INFINITE TEST LOOP FOR Locale: " + loc.getDisplayName()); - for (;;) { - _test(loc); - } - } else { - _test(Locale.getDefault()); - for (int i = 0; i < locCount; ++i) { - _test(avail[i]); - } - } - } - - public String styleName(int s) { - switch (s) { - case DateFormat.SHORT : - return "SHORT"; - case DateFormat.MEDIUM : - return "MEDIUM"; - case DateFormat.LONG : - return "LONG"; - case DateFormat.FULL : - return "FULL"; - default : - return "Unknown"; - } - } - - public void _test(Locale loc) { - if (!INFINITE) { - logln("Locale: " + loc.getDisplayName()); - } - // Total possibilities = 24 - // 4 date - // 4 time - // 16 date-time - boolean[] TEST_TABLE = new boolean[24]; - int i = 0; - for (i = 0; i < 24; ++i) - TEST_TABLE[i] = true; - - // If we have some sparseness, implement it here. Sparseness decreases - // test time by eliminating some tests, up to 23. - for (i = 0; i < SPARSENESS; i++) { - int random = (int) (ran.nextDouble() * 24); - if (random >= 0 && random < 24 && TEST_TABLE[i]) { - TEST_TABLE[random] = false; - } - } - - int itable = 0; - int style = 0; - for (style = DateFormat.FULL; style <= DateFormat.SHORT; ++style) { - if (TEST_TABLE[itable++]) { - logln("Testing style " + styleName(style)); - DateFormat df = DateFormat.getDateInstance(style, loc); - _test(df, false); - } - } - - for (style = DateFormat.FULL; style <= DateFormat.SHORT; ++style) { - if (TEST_TABLE[itable++]) { - logln("Testing style " + styleName(style)); - DateFormat df = DateFormat.getTimeInstance(style, loc); - _test(df, true); - } - } - - for (int dstyle = DateFormat.FULL; dstyle <= DateFormat.SHORT; ++dstyle) { - for (int tstyle = DateFormat.FULL; tstyle <= DateFormat.SHORT; ++tstyle) { - if (TEST_TABLE[itable++]) { - logln("Testing dstyle " + styleName(dstyle) + ", tstyle " + styleName(tstyle)); - DateFormat df = DateFormat.getDateTimeInstance(dstyle, tstyle, loc); - _test(df, false); - } - } - } - } - - public void _test(DateFormat fmt, boolean timeOnly) { - - if (!(fmt instanceof SimpleDateFormat)) { - errln("DateFormat wasn't a SimpleDateFormat"); - return; - } - - String pat = ((SimpleDateFormat) fmt).toPattern(); - logln(pat); - - // NOTE TO MAINTAINER - // This indexOf check into the pattern needs to be refined to ignore - // quoted characters. Currently, this isn't a problem with the locale - // patterns we have, but it may be a problem later. - - boolean hasEra = (pat.indexOf("G") != -1); - boolean hasZone = (pat.indexOf("z") != -1); - - // Because patterns contain incomplete data representing the Date, - // we must be careful of how we do the roundtrip. We start with - // a randomly generated Date because they're easier to generate. - // From this we get a string. The string is our real starting point, - // because this string should parse the same way all the time. Note - // that it will not necessarily parse back to the original date because - // of incompleteness in patterns. For example, a time-only pattern won't - // parse back to the same date. - - try { - for (int i = 0; i < TRIALS; ++i) { - Date[] d = new Date[DEPTH]; - String[] s = new String[DEPTH]; - - d[0] = generateDate(); - - // We go through this loop until we achieve a match or until - // the maximum loop count is reached. We record the points at - // which the date and the string starts to match. Once matching - // starts, it should continue. - int loop; - int dmatch = 0; // d[dmatch].getTime() == d[dmatch-1].getTime() - int smatch = 0; // s[smatch].equals(s[smatch-1]) - for (loop = 0; loop < DEPTH; ++loop) { - if (loop > 0) { - d[loop] = fmt.parse(s[loop - 1]); - } - - s[loop] = fmt.format(d[loop]); - - if (loop > 0) { - if (smatch == 0) { - boolean match = s[loop].equals(s[loop - 1]); - if (smatch == 0) { - if (match) - smatch = loop; - } else - if (!match) - errln("FAIL: String mismatch after match"); - } - - if (dmatch == 0) { - // {sfb} watch out here, this might not work - boolean match = d[loop].getTime() == d[loop - 1].getTime(); - if (dmatch == 0) { - if (match) - dmatch = loop; - } else - if (!match) - errln("FAIL: Date mismatch after match"); - } - - if (smatch != 0 && dmatch != 0) - break; - } - } - // At this point loop == DEPTH if we've failed, otherwise loop is the - // max(smatch, dmatch), that is, the index at which we have string and - // date matching. - - // Date usually matches in 2. Exceptions handled below. - int maxDmatch = 2; - int maxSmatch = 1; - if (dmatch > maxDmatch || smatch > maxSmatch) { - //If the Date is BC - if (!timeOnly && !hasEra && getField(d[0], Calendar.ERA) == GregorianCalendar.BC) { - maxDmatch = 3; - maxSmatch = 2; - } - if (hasZone && (fmt.getTimeZone().inDaylightTime(d[0]) || fmt.getTimeZone().inDaylightTime(d[1]) )) { - maxSmatch = 2; - if (timeOnly) { - maxDmatch = 3; - } - } - } - - if (dmatch > maxDmatch || smatch > maxSmatch) { - SimpleDateFormat sdf = new SimpleDateFormat("EEEE, MMMM d, yyyy HH:mm:ss, z G", Locale.US); - logln("Date = " + sdf.format(d[0]) + "; ms = " + d[0].getTime()); - logln("Dmatch: " + dmatch + " maxD: " + maxDmatch + " Smatch:" + smatch + " maxS:" + maxSmatch); - errln("Pattern: " + pat + " failed to match" + "; ms = " + d[0].getTime()); - for (int j = 0; j <= loop && j < DEPTH; ++j) { - StringBuffer temp = new StringBuffer(""); - FieldPosition pos = new FieldPosition(0); - logln((j > 0 ? " P> " : " ") + dateFormat.format(d[j], temp, pos) - + " F> " + s[j] + (j > 0 && d[j].getTime() == d[j - 1].getTime() ? " d==" : "") - + (j > 0 && s[j].equals(s[j - 1]) ? " s==" : "")); - } - } - } - } catch (ParseException e) { - errln("Exception: " + e.getMessage()); - logln(e.toString()); - } - } - - public int getField(Date d, int f) { - getFieldCal.setTime(d); - int ret = getFieldCal.get(f); - return ret; - } - - public Date generateDate() { - double a = ran.nextDouble(); - // Now 'a' ranges from 0..1; scale it to range from 0 to 8000 years - a *= 8000; - // Range from (4000-1970) BC to (8000-1970) AD - a -= 4000; - // Now scale up to ms - a *= 365.25 * 24 * 60 * 60 * 1000; - return new Date((long)a); - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/icu/test/format/DateFormatTest.java b/icu4j/src/com/ibm/icu/test/format/DateFormatTest.java deleted file mode 100755 index 2795fce202..0000000000 --- a/icu4j/src/com/ibm/icu/test/format/DateFormatTest.java +++ /dev/null @@ -1,763 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/format/Attic/DateFormatTest.java,v $ - * $Date: 2001/12/07 17:32:27 $ - * $Revision: 1.5 $ - * - ***************************************************************************************** - */ - -/** - * Port From: ICU4C v1.8.1 : format : DateFormatTest - * Source File: $ICU4CRoot/source/test/intltest/dtfmttst.cpp - **/ - -package com.ibm.icu.test.format; - -import com.ibm.text.*; -import com.ibm.util.*; -import java.util.Date; -import java.text.ParseException; -import java.text.ParsePosition; -import java.util.Locale; -import java.text.FieldPosition; - -public class DateFormatTest extends com.ibm.test.TestFmwk { - - public static void main(String[] args) throws Exception { - new DateFormatTest().run(args); - } - - // Test written by Wally Wedel and emailed to me. - public void TestWallyWedel() { - /* - * Instantiate a TimeZone so we can get the ids. - */ - //TimeZone tz = new SimpleTimeZone(7, ""); //The variable is never used - /* - * Computational variables. - */ - int offset, hours, minutes; - /* - * Instantiate a SimpleDateFormat set up to produce a full time - zone name. - */ - SimpleDateFormat sdf = new SimpleDateFormat("zzzz"); - /* - * A String array for the time zone ids. - */ - - final String[] ids = TimeZone.getAvailableIDs(); - int ids_length = ids.length; //when fixed the bug should comment it out - - /* - * How many ids do we have? - */ - logln("Time Zone IDs size:" + ids_length); - /* - * Column headings (sort of) - */ - logln("Ordinal ID offset(h:m) name"); - /* - * Loop through the tzs. - */ - Date today = new Date(); - Calendar cal = Calendar.getInstance(); - for (int i = 0; i < ids_length; i++) { - logln(i + " " + ids[i]); - TimeZone ttz = TimeZone.getTimeZone(ids[i]); - // offset = ttz.getRawOffset(); - cal.setTimeZone(ttz); - cal.setTime(today); - offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET); - // logln(i + " " + ids[i] + " offset " + offset); - String sign = "+"; - if (offset < 0) { - sign = "-"; - offset = -offset; - } - hours = offset / 3600000; - minutes = (offset % 3600000) / 60000; - String dstOffset = sign + (hours < 10 ? "0" : "") + hours - + ":" + (minutes < 10 ? "0" : "") + minutes; - /* - * Instantiate a date so we can display the time zone name. - */ - sdf.setTimeZone(ttz); - /* - * Format the output. - */ - StringBuffer fmtOffset = new StringBuffer(""); - FieldPosition pos = new FieldPosition(0); - - try { - fmtOffset = sdf.format(today, fmtOffset, pos); - } catch (Exception e) { - logln("Exception:" + e); - continue; - } - // UnicodeString fmtOffset = tzS.toString(); - String fmtDstOffset = null; - if (fmtOffset.toString().startsWith("GMT")) { - //fmtDstOffset = fmtOffset.substring(3); - fmtDstOffset = fmtOffset.substring(3, fmtOffset.length()); - } - /* - * Show our result. - */ - - boolean ok = fmtDstOffset == null || fmtDstOffset.equals(dstOffset); - //fix the jdk resources differences between jdk 1.2/1.3.0 and jdk 1.3.1 - String javaVersion = System.getProperty("java.version"); - ok = ok || ((javaVersion.startsWith("1.2") || javaVersion.startsWith("1.3.0")) && (fmtDstOffset != null) && fmtDstOffset.equals("")); - if (ok) { - logln(i + " " + ids[i] + " " + dstOffset + " " - + fmtOffset + (fmtDstOffset != null ? " ok" : " ?")); - } else { - errln(i + " " + ids[i] + " " + dstOffset + " " + fmtOffset + " *** FAIL ***"); - } - - } - } - - public void TestEquals() { - DateFormat fmtA = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.FULL); - DateFormat fmtB = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.FULL); - if (!fmtA.equals(fmtB)) - errln("FAIL"); - } - - /** - * Test the parsing of 2-digit years. - */ - public void TestTwoDigitYearDSTParse() { - - SimpleDateFormat fullFmt = new SimpleDateFormat("EEE MMM dd HH:mm:ss.SSS zzz yyyy G"); - SimpleDateFormat fmt = new SimpleDateFormat("dd-MMM-yy h:mm:ss 'o''clock' a z", Locale.ENGLISH); - String s = "03-Apr-04 2:20:47 o'clock AM PST"; - - /* - * SimpleDateFormat(pattern, locale) Construct a SimpleDateDateFormat using - * the givening pattern, the locale and using the TimeZone.getDefault(); - * So it need to add the timezone offset on hour field. - * ps. the Method Calendar.getTime() used by SimpleDateFormat.parse() always - * return Date vaule with TimeZone.getDefault() [Richard/GCL] - */ - - TimeZone defaultTZ = TimeZone.getDefault(); - TimeZone PST = TimeZone.getTimeZone("PST"); - int defaultOffset = defaultTZ.getRawOffset(); - int PSTOffset = PST.getRawOffset(); - int hour = 2 + (defaultOffset - PSTOffset) / (60*60*1000); - hour = (hour < 0) ? hour + 24 : hour; - try { - Date d = fmt.parse(s); - Calendar cal = Calendar.getInstance(); - cal.setTime(d); - //DSTOffset - hour += defaultTZ.inDaylightTime(d) ? 1 : 0; - - logln(s + " P> " + ((DateFormat) fullFmt).format(d)); - int hr = cal.get(Calendar.HOUR_OF_DAY); - if (hr != hour) - errln("FAIL: Should parse to hour " + hour); - } catch (ParseException e) { - errln("Parse Error:" + e.getMessage()); - } - - } - - /** - * Verify that returned field position indices are correct. - */ - public void TestFieldPosition() { - DateFormat[] dateFormats = new DateFormat[4]; - int dateFormats_length = dateFormats.length; - String fieldNames[] = { - "ERA", "YEAR", "MONTH", "WEEK_OF_YEAR", "WEEK_OF_MONTH", "DAY_OF_MONTH", "DAY_OF_YEAR", - "DAY_OF_WEEK", "DAY_OF_WEEK_IN_MONTH", "AM_PM", "HOUR","HOUR_OF_DAY","MINUTE", - "SECOND", "MILLISECOND", "ZONE_OFFSET" }; - /* {sfb} This test was coded incorrectly. - / FieldPosition uses the fields in the class you are formatting with - / So, for example, to get the DATE field from a DateFormat use - / DateFormat.DATE_FIELD, __not__ Calendar.DATE - / The ordering of the expected values used previously was wrong. - / instead of re-ordering this mess of strings, just transform the index values */ - - /* field values, in Calendar order */ - final String[] expected = - { "", "1997", "August", "", "", "13", "", "Wednesday", "", "PM", "2", "", "34", "12", "", "PDT", - /* Following two added by weiv for two new fields */"", "1997", "#", - /* # is a marker for "ao\xfbt" == "aou^t" */ - "", "", "13", "", "mercredi", "", "", "", "14", "34", "", "", "PDT", - /* Following two added by weiv for two new fields */ - "AD", "1997", "8", "33", "3", "13", "225", "Wed", "2", "PM", "2", "14", "34", "12", "513", "PDT", - /* Following two added by weiv for two new fields */ - "AD", "1997", "August", "0033", "0003", "0013", "0225", "Wednesday", "0002", - "PM", "0002", "0014", "0034", "0012", "0513", "Pacific Daylight Time", - /* Following two added by weiv for two new fields */ "1997", "0004", "" }; - - Date someDate = new Date((long) 871508052513.0); - int j, exp; - - dateFormats[0] = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, Locale.US); - dateFormats[1] = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, Locale.FRANCE); - dateFormats[2] = new SimpleDateFormat("G, y, M, d, k, H, m, s, S, E, D, F, w, W, a, h, K, z, y, E", Locale.US); - dateFormats[3] = new SimpleDateFormat("GGGG, yyyy, MMMM, dddd, kkkk, HHHH, mmmm, ssss, SSSS, EEEE, DDDD, FFFF, wwww, WWWW, aaaa, hhhh, KKKK, zzzz, yyyy, EEEE", Locale.US); - //fix the jdk resources differences between jdk 1.2 and jdk 1.3 - String javaVersion = System.getProperty("java.version"); - - for (j = 0, exp = 0; j < dateFormats_length; ++j) { - String str; - DateFormat df = dateFormats[j]; - TimeZone tz = TimeZone.getTimeZone("PST"); - ((SimpleTimeZone)tz).setDSTSavings(3600000); - df.setTimeZone(tz); - logln(" Pattern = " + ((SimpleDateFormat) df).toPattern()); - str = ""; - try { - logln(" Result = " + df.format(someDate)); - } catch (Exception e) { - System.out.println(e); - } - for (int i = 0; i < fieldNames.length; ++i) { - String field = getFieldText(df, i, someDate); - String expStr = ""; - if (!expected[exp].substring(0).equals("#")) { - expStr = expected[exp]; - } else { - // we cannot have latin-1 characters in source code, therefore we fix up the string for "aou^t" - expStr = expStr + "\u0061" + "\u006f" + "\u00fb" + "\u0074"; - } - if (javaVersion.startsWith("1.2") && (exp==31)) { - expStr = "GMT-07:00"; - } - if (!field.equals(expStr)) - errln("FAIL: field #" + i + " " + fieldNames[i] + " = \"" + field + "\", expected \"" + expStr + "\""); - ++exp; - } - } - } - - // internal utility function - public String getFieldText(DateFormat df, int field, Date date) { - final int[] fgCalendarToDateFormatField ={ - DateFormat.ERA_FIELD, - DateFormat.YEAR_FIELD, - DateFormat.MONTH_FIELD, - DateFormat.WEEK_OF_YEAR_FIELD, - DateFormat.WEEK_OF_MONTH_FIELD, - DateFormat.DATE_FIELD, - DateFormat.DAY_OF_YEAR_FIELD, - DateFormat.DAY_OF_WEEK_FIELD, - DateFormat.DAY_OF_WEEK_IN_MONTH_FIELD, - DateFormat.AM_PM_FIELD, - DateFormat.HOUR1_FIELD, - DateFormat.HOUR_OF_DAY0_FIELD, - DateFormat.MINUTE_FIELD, - DateFormat.SECOND_FIELD, - DateFormat.MILLISECOND_FIELD, - DateFormat.TIMEZONE_FIELD - }; - StringBuffer formatResult = new StringBuffer(""); - // {sfb} added to convert Calendar Fields to DateFormat fields - FieldPosition pos = new FieldPosition(fgCalendarToDateFormatField[field]); - formatResult = df.format(date, formatResult, pos); - return formatResult.substring(pos.getBeginIndex(), pos.getEndIndex()); - } - - /** - * Verify that strings which contain incomplete specifications are parsed - * correctly. In some instances, this means not being parsed at all, and - * returning an appropriate error. - */ - public void TestPartialParse994() { - - SimpleDateFormat f = new SimpleDateFormat(); - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(1997, 1 - 1, 17, 10, 11, 42); - Date date = null; - tryPat994(f, "yy/MM/dd HH:mm:ss", "97/01/17 10:11:42", cal.getTime()); - tryPat994(f, "yy/MM/dd HH:mm:ss", "97/01/17 10:", date); - tryPat994(f, "yy/MM/dd HH:mm:ss", "97/01/17 10", date); - tryPat994(f, "yy/MM/dd HH:mm:ss", "97/01/17 ", date); - tryPat994(f, "yy/MM/dd HH:mm:ss", "97/01/17", date); - } - - // internal test subroutine, used by TestPartialParse994 - public void tryPat994(SimpleDateFormat format, String pat, String str, Date expected) { - Date Null = null; - logln("Pattern \"" + pat + "\" String \"" + str + "\""); - try { - format.applyPattern(pat); - Date date = format.parse(str); - String f = ((DateFormat) format).format(date); - logln(" parse(" + str + ") -> " + date); - logln(" format -> " + f); - if (expected.equals(Null) || !date.equals(expected)) - errln("FAIL: Expected null"); //" + expected); - if (!f.equals(str)) - errln("FAIL: Expected " + str); - } catch (ParseException e) { - logln("ParseException: " + e.getMessage()); - if (!(expected ==Null)) - errln("FAIL: Expected " + expected); - } catch (Exception e) { - errln("*** Exception:"); - e.printStackTrace(); - } - } - - /** - * Verify the behavior of patterns in which digits for different fields run together - * without intervening separators. - */ - public void TestRunTogetherPattern985() { - String format = "yyyyMMddHHmmssSSS"; - String now, then; - //UBool flag; - SimpleDateFormat formatter = new SimpleDateFormat(format); - Date date1 = new Date(); - now = ((DateFormat) formatter).format(date1); - logln(now); - ParsePosition pos = new ParsePosition(0); - Date date2 = formatter.parse(now, pos); - if (date2 == null) - then = "Parse stopped at " + pos.getIndex(); - else - then = ((DateFormat) formatter).format(date2); - logln(then); - if (!date2.equals(date1)) - errln("FAIL"); - } - - /** - * Verify the behavior of patterns in which digits for different fields run together - * without intervening separators. - */ - public void TestRunTogetherPattern917() { - SimpleDateFormat fmt; - String myDate; - fmt = new SimpleDateFormat("yyyy/MM/dd"); - myDate = "1997/02/03"; - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(1997, 2 - 1, 3); - _testIt917(fmt, myDate, cal.getTime()); - fmt = new SimpleDateFormat("yyyyMMdd"); - myDate = "19970304"; - cal.clear(); - cal.set(1997, 3 - 1, 4); - _testIt917(fmt, myDate, cal.getTime()); - - } - - // internal test subroutine, used by TestRunTogetherPattern917 - public void _testIt917(SimpleDateFormat fmt, String str, Date expected) { - logln("pattern=" + fmt.toPattern() + " string=" + str); - Date o = new Date(); - o = (Date) ((DateFormat) fmt).parseObject(str, new ParsePosition(0)); - logln("Parsed object: " + o); - if (!o.equals(expected)) - errln("FAIL: Expected " + expected); - String formatted = ((DateFormat) fmt).format(o); - logln( "Formatted string: " + formatted); - if (!formatted.equals(str)) - errln( "FAIL: Expected " + str); - } - - /** - * Verify the handling of Czech June and July, which have the unique attribute that - * one is a proper prefix substring of the other. - */ - public void TestCzechMonths459() { - DateFormat fmt = DateFormat.getDateInstance(DateFormat.FULL, new Locale("cs", "", "")); - logln("Pattern " + ((SimpleDateFormat) fmt).toPattern()); - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(1997, Calendar.JUNE, 15); - Date june = cal.getTime(); - cal.clear(); - cal.set(1997, Calendar.JULY, 15); - Date july = cal.getTime(); - String juneStr = fmt.format(june); - String julyStr = fmt.format(july); - try { - logln("format(June 15 1997) = " + juneStr); - Date d = fmt.parse(juneStr); - String s = fmt.format(d); - int month, yr, day, hr, min, sec; - cal.setTime(d); - yr = cal.get(Calendar.YEAR) - 1900; - month = cal.get(Calendar.MONTH); - day = cal.get(Calendar.DAY_OF_WEEK); - hr = cal.get(Calendar.HOUR_OF_DAY); - min = cal.get(Calendar.MINUTE); - sec = cal.get(Calendar.SECOND); - logln(" . parse . " + s + " (month = " + month + ")"); - if (month != Calendar.JUNE) - errln("FAIL: Month should be June"); - logln("format(July 15 1997) = " + julyStr); - d = fmt.parse(julyStr); - s = fmt.format(d); - cal.setTime(d); - yr = cal.get(Calendar.YEAR) - 1900; - month = cal.get(Calendar.MONTH); - day = cal.get(Calendar.DAY_OF_WEEK); - hr = cal.get(Calendar.HOUR_OF_DAY); - min = cal.get(Calendar.MINUTE); - sec = cal.get(Calendar.SECOND); - logln(" . parse . " + s + " (month = " + month + ")"); - if (month != Calendar.JULY) - errln("FAIL: Month should be July"); - } catch (ParseException e) { - errln(e.getMessage()); - } - } - - /** - * Test the handling of 'D' in patterns. - */ - public void TestLetterDPattern212() { - String dateString = "1995-040.05:01:29"; - String bigD = "yyyy-DDD.hh:mm:ss"; - String littleD = "yyyy-ddd.hh:mm:ss"; - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(1995, 0, 1, 5, 1, 29); - Date expLittleD = cal.getTime(); - Date expBigD = new Date((long) (expLittleD.getTime() + 39 * 24 * 3600000.0)); - expLittleD = expBigD; // Expect the same, with default lenient parsing - logln("dateString= " + dateString); - SimpleDateFormat formatter = new SimpleDateFormat(bigD); - ParsePosition pos = new ParsePosition(0); - Date myDate = formatter.parse(dateString, pos); - logln("Using " + bigD + " . " + myDate); - if (!myDate.equals(expBigD)) - errln("FAIL: Expected " + expBigD); - formatter = new SimpleDateFormat(littleD); - pos = new ParsePosition(0); - myDate = formatter.parse(dateString, pos); - logln("Using " + littleD + " . " + myDate); - if (!myDate.equals(expLittleD)) - errln("FAIL: Expected " + expLittleD); - } - - /** - * Test the day of year pattern. - */ - public void TestDayOfYearPattern195() { - Calendar cal = Calendar.getInstance(); - Date today = cal.getTime(); - int year,month,day; - year = cal.get(Calendar.YEAR); - month = cal.get(Calendar.MONTH); - day = cal.get(Calendar.DAY_OF_MONTH); - cal.clear(); - cal.set(year, month, day); - Date expected = cal.getTime(); - logln("Test Date: " + today); - SimpleDateFormat sdf = (SimpleDateFormat)DateFormat.getDateInstance(); - tryPattern(sdf, today, null, expected); - tryPattern(sdf, today, "G yyyy DDD", expected); - } - - // interl test subroutine, used by TestDayOfYearPattern195 - public void tryPattern(SimpleDateFormat sdf, Date d, String pattern, Date expected) { - if (pattern != null) - sdf.applyPattern(pattern); - logln("pattern: " + sdf.toPattern()); - String formatResult = ((DateFormat) sdf).format(d); - logln(" format -> " + formatResult); - try { - Date d2 = sdf.parse(formatResult); - logln(" parse(" + formatResult + ") -> " + d2); - if (!d2.equals(expected)) - errln("FAIL: Expected " + expected); - String format2 = ((DateFormat) sdf).format(d2); - logln(" format -> " + format2); - if (!formatResult.equals(format2)) - errln("FAIL: Round trip drift"); - } catch (Exception e) { - errln(e.getMessage()); - } - } - - /** - * Test the handling of single quotes in patterns. - */ - public void TestQuotePattern161() { - SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy 'at' hh:mm:ss a zzz", Locale.US); - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(1997, Calendar.AUGUST, 13, 10, 42, 28); - Date currentTime_1 = cal.getTime(); - String dateString = ((DateFormat) formatter).format(currentTime_1); - String exp = "08/13/1997 at 10:42:28 AM "; - logln("format(" + currentTime_1 + ") = " + dateString); - if (!dateString.substring(0, exp.length()).equals(exp)) - errln("FAIL: Expected " + exp); - - } - - /** - * Verify the correct behavior when handling invalid input strings. - */ - public void TestBadInput135() { - int looks[] = {DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, DateFormat.FULL}; - int looks_length = looks.length; - final String[] strings = {"Mar 15", "Mar 15 1997", "asdf", "3/1/97 1:23:", "3/1/00 1:23:45 AM"}; - int strings_length = strings.length; - DateFormat full = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, Locale.US); - String expected = "March 1, 2000 1:23:45 AM "; - for (int i = 0; i < strings_length; ++i) { - final String text = strings[i]; - for (int j = 0; j < looks_length; ++j) { - int dateLook = looks[j]; - for (int k = 0; k < looks_length; ++k) { - int timeLook = looks[k]; - DateFormat df = DateFormat.getDateTimeInstance(dateLook, timeLook, Locale.US); - String prefix = text + ", " + dateLook + "/" + timeLook + ": "; - try { - Date when = df.parse(text); - if (when == null) { - errln(prefix + "SHOULD NOT HAPPEN: parse returned null."); - continue; - } - if (when != null) { - String format; - format = full.format(when); - logln(prefix + "OK: " + format); - if (!format.substring(0, expected.length()).equals(expected)) - errln("FAIL: Expected " + expected); - } - } catch(java.text.ParseException e) { - logln(e.getMessage()); - } - } - } - } - } - - /** - * Verify the correct behavior when parsing an array of inputs against an - * array of patterns, with known results. The results are encoded after - * the input strings in each row. - */ - public void TestBadInput135a() { - - SimpleDateFormat dateParse = new SimpleDateFormat("", Locale.US); - final String ss; - Date date; - String[] parseFormats ={"MMMM d, yyyy", "MMMM d yyyy", "M/d/yy", - "d MMMM, yyyy", "d MMMM yyyy", "d MMMM", - "MMMM d", "yyyy", "h:mm a MMMM d, yyyy" }; - String[] inputStrings = { - "bogus string", null, null, null, null, null, null, null, null, null, - "April 1, 1997", "April 1, 1997", null, null, null, null, null, "April 1", null, null, - "Jan 1, 1970", "January 1, 1970", null, null, null, null, null, "January 1", null, null, - "Jan 1 2037", null, "January 1 2037", null, null, null, null, "January 1", null, null, - "1/1/70", null, null, "1/1/70", null, null, null, null, "0001", null, - "5 May 1997", null, null, null, null, "5 May 1997", "5 May", null, "0005", null, - "16 May", null, null, null, null, null, "16 May", null, "0016", null, - "April 30", null, null, null, null, null, null, "April 30", null, null, - "1998", null, null, null, null, null, null, null, "1998", null, - "1", null, null, null, null, null, null, null, "0001", null, - "3:00 pm Jan 1, 1997", null, null, null, null, null, null, null, "0003", "3:00 PM January 1, 1997", - }; - final int PF_LENGTH = parseFormats.length; - final int INPUT_LENGTH = inputStrings.length; - - dateParse.applyPattern("d MMMM, yyyy"); - dateParse.setTimeZone(TimeZone.getDefault()); - ss = "not parseable"; - // String thePat; - logln("Trying to parse \"" + ss + "\" with " + dateParse.toPattern()); - try { - date = dateParse.parse(ss); - } catch (Exception ex) { - logln("FAIL:" + ex); - } - for (int i = 0; i < INPUT_LENGTH; i += (PF_LENGTH + 1)) { - ParsePosition parsePosition = new ParsePosition(0); - String s = inputStrings[i]; - for (int index = 0; index < PF_LENGTH; ++index) { - final String expected = inputStrings[i + 1 + index]; - dateParse.applyPattern(parseFormats[index]); - dateParse.setTimeZone(TimeZone.getDefault()); - try { - parsePosition.setIndex(0); - date = dateParse.parse(s, parsePosition); - if (parsePosition.getIndex() != 0) { - String s1, s2; - s1 = s.substring(0, parsePosition.getIndex()); - s2 = s.substring(parsePosition.getIndex(), s.length()); - if (date == null) { - errln("ERROR: null result fmt=\"" + parseFormats[index] - + "\" pos=" + parsePosition.getIndex() - + " " + s1 + "|" + s2); - } else { - String result = ((DateFormat) dateParse).format(date); - logln("Parsed \"" + s + "\" using \"" + dateParse.toPattern() + "\" to: " + result); - if (expected == null) - errln("FAIL: Expected parse failure"); - else - if (!result.equals(expected)) - errln("FAIL: Expected " + expected); - } - } else - if (expected != null) { - errln("FAIL: Expected " + expected + " from \"" + s - + "\" with \"" + dateParse.toPattern()+ "\""); - } - } catch (Exception ex) { - logln("FAIL:" + ex); - } - } - } - - } - - /** - * Test the parsing of two-digit years. - */ - public void TestTwoDigitYear() { - DateFormat fmt = DateFormat.getDateInstance(DateFormat.SHORT, Locale.US); - Calendar cal = Calendar.getInstance(); - cal.clear(); - cal.set(117 + 1900, Calendar.JUNE, 5); - parse2DigitYear(fmt, "6/5/17", cal.getTime()); - cal.clear(); - cal.set(34 + 1900, Calendar.JUNE, 4); - parse2DigitYear(fmt, "6/4/34", cal.getTime()); - } - - // internal test subroutine, used by TestTwoDigitYear - public void parse2DigitYear(DateFormat fmt, String str, Date expected) { - try { - Date d = fmt.parse(str); - logln("Parsing \""+ str+ "\" with "+ ((SimpleDateFormat) fmt).toPattern() - + " => "+ d); - if (!d.equals(expected)) - errln( "FAIL: Expected " + expected); - } catch (ParseException e) { - errln(e.getMessage()); - } - } - - /** - * Test the formatting of time zones. - */ - public void TestDateFormatZone061() { - Date date; - DateFormat formatter; - date = new Date(859248000000l); - logln("Date 1997/3/25 00:00 GMT: " + date); - formatter = new SimpleDateFormat("dd-MMM-yyyyy HH:mm", Locale.UK); - formatter.setTimeZone(TimeZone.getTimeZone("GMT")); - String temp = formatter.format(date); - logln("Formatted in GMT to: " + temp); - try { - Date tempDate = formatter.parse(temp); - logln("Parsed to: " + tempDate); - if (!tempDate.equals(date)) - errln("FAIL: Expected " + date); - } catch (Throwable t) { - System.out.println(t); - } - - } - - /** - * Test the formatting of time zones. - */ - public void TestDateFormatZone146() { - TimeZone saveDefault = TimeZone.getDefault(); - - //try { - TimeZone thedefault = TimeZone.getTimeZone("GMT"); - TimeZone.setDefault(thedefault); - // java.util.Locale.setDefault(new java.util.Locale("ar", "", "")); - - // check to be sure... its GMT all right - TimeZone testdefault = TimeZone.getDefault(); - String testtimezone = testdefault.getID(); - if (testtimezone.equals("GMT")) - logln("Test timezone = " + testtimezone); - else - errln("Test timezone should be GMT, not " + testtimezone); - - // now try to use the default GMT time zone - GregorianCalendar greenwichcalendar = new GregorianCalendar(1997, 3, 4, 23, 0); - //*****************************greenwichcalendar.setTimeZone(TimeZone.getDefault()); - //greenwichcalendar.set(1997, 3, 4, 23, 0); - // try anything to set hour to 23:00 !!! - greenwichcalendar.set(Calendar.HOUR_OF_DAY, 23); - // get time - Date greenwichdate = greenwichcalendar.getTime(); - // format every way - String DATA[] = { - "simple format: ", "04/04/97 23:00 GMT", - "MM/dd/yy HH:mm z", "full format: ", - "Friday, April 4, 1997 11:00:00 o'clock PM GMT", - "EEEE, MMMM d, yyyy h:mm:ss 'o''clock' a z", - "long format: ", "April 4, 1997 11:00:00 PM GMT", - "MMMM d, yyyy h:mm:ss a z", "default format: ", - "04-Apr-97 11:00:00 PM", "dd-MMM-yy h:mm:ss a", - "short format: ", "4/4/97 11:00 PM", - "M/d/yy h:mm a"}; - int DATA_length = DATA.length; - - for (int i = 0; i < DATA_length; i += 3) { - DateFormat fmt = new SimpleDateFormat(DATA[i + 2], Locale.ENGLISH); - fmt.setCalendar(greenwichcalendar); - String result = fmt.format(greenwichdate); - logln(DATA[i] + result); - if (!result.equals(DATA[i + 1])) - errln("FAIL: Expected " + DATA[i + 1] + ", got " + result); - } - //} - //finally { - TimeZone.setDefault(saveDefault); - //} - - } - - /** - * Test the formatting of dates in different locales. - */ - public void TestLocaleDateFormat() { - - Date testDate = new Date(874306800000l); //Mon Sep 15 00:00:00 PDT 1997 - DateFormat dfFrench = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, Locale.FRENCH); - DateFormat dfUS = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, Locale.US); - //Set TimeZone = PDT - TimeZone tz = TimeZone.getTimeZone("PST"); - ((SimpleTimeZone)tz).setDSTSavings(3600000); - dfFrench.setTimeZone(tz); - dfUS.setTimeZone(tz); - String expectedFRENCH_JDK12 = "lundi 15 septembre 1997 00 h 00 GMT-07:00"; - String expectedFRENCH = "lundi 15 septembre 1997 00 h 00 PDT"; - String expectedUS = "Monday, September 15, 1997 12:00:00 AM PDT"; - logln("Date set to : " + testDate); - String out = dfFrench.format(testDate); - logln("Date Formated with French Locale " + out); - //fix the jdk resources differences between jdk 1.2 and jdk 1.3 - String javaVersion = System.getProperty("java.version"); - if (javaVersion.startsWith("1.2")) { - if (!out.equals(expectedFRENCH_JDK12)) - errln("FAIL: Expected " + expectedFRENCH_JDK12); - } else { - if (!out.equals(expectedFRENCH)) - errln("FAIL: Expected " + expectedFRENCH); - } - out = dfUS.format(testDate); - logln("Date Formated with US Locale " + out); - if (!out.equals(expectedUS)) - errln("FAIL: Expected " + expectedUS); - } -} diff --git a/icu4j/src/com/ibm/icu/test/format/IntlTestDateFormat.java b/icu4j/src/com/ibm/icu/test/format/IntlTestDateFormat.java deleted file mode 100755 index c7f93401ee..0000000000 --- a/icu4j/src/com/ibm/icu/test/format/IntlTestDateFormat.java +++ /dev/null @@ -1,270 +0,0 @@ -/*************************************************************************************** - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/format/Attic/IntlTestDateFormat.java,v $ - * $Date: 2001/10/23 13:11:35 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ - -/** - * Port From: JDK 1.4b1 : java.text.Format.IntlTestDateFormat - * Source File: java/text/format/IntlTestDateFormat.java - **/ - -/* - @test 1.4 98/03/06 - @summary test International Date Format -*/ -/* -(C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved -(C) Copyright IBM Corp. 1996, 1997, 2001 - All Rights Reserved - - The original version of this source code and documentation is copyrighted and -owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These materials are -provided under terms of a License Agreement between Taligent and Sun. This -technology is protected by multiple US and International patents. This notice and -attribution to Taligent may not be removed. - Taligent is a registered trademark of Taligent, Inc. -*/ - -package com.ibm.icu.test.format; - -import com.ibm.text.*; -import com.ibm.util.*; -import java.text.FieldPosition; -import java.text.ParseException; -import java.util.Locale; -import java.util.Random; -import java.util.Date; - -public class IntlTestDateFormat extends com.ibm.test.TestFmwk { - // Values in milliseconds (== Date) - private static final long ONESECOND = 1000; - private static final long ONEMINUTE = 60 * ONESECOND; - private static final long ONEHOUR = 60 * ONEMINUTE; - private static final long ONEDAY = 24 * ONEHOUR; - //private static final double ONEYEAR = 365.25 * ONEDAY; // Approximate //The variable is never used - - // EModes - //private static final byte GENERIC = 0; - //private static final byte TIME = GENERIC + 1; //The variable is never used - //private static final byte DATE = TIME + 1; //The variable is never used - //private static final byte DATE_TIME = DATE + 1; //The variable is never used - - private DateFormat fFormat = DateFormat.getInstance(); - private String fTestName = new String("getInstance"); - private int fLimit = 3; // How many iterations it should take to reach convergence - - public IntlTestDateFormat() { - //Constructure - } - - public static void main(String[] args) throws Exception { - new IntlTestDateFormat().run(args); - } - - public void TestLocale() { - localeTest(Locale.getDefault(), "Default Locale"); - } - - // This test does round-trip testing (format -> parse -> format -> parse -> etc.) of DateFormat. - public void localeTest(final Locale locale, final String localeName) { - int timeStyle, dateStyle; - - // For patterns including only time information and a timezone, it may take - // up to three iterations, since the timezone may shift as the year number - // is determined. For other patterns, 2 iterations should suffice. - fLimit = 3; - - for(timeStyle = 0; timeStyle < 4; timeStyle++) { - fTestName = new String("Time test " + timeStyle + " (" + localeName + ")"); - try { - fFormat = DateFormat.getTimeInstance(timeStyle, locale); - } - catch(StringIndexOutOfBoundsException e) { - errln("FAIL: localeTest time getTimeInstance exception"); - throw e; - } - TestFormat(); - } - - fLimit = 2; - - for(dateStyle = 0; dateStyle < 4; dateStyle++) { - fTestName = new String("Date test " + dateStyle + " (" + localeName + ")"); - try { - fFormat = DateFormat.getDateInstance(dateStyle, locale); - } - catch(StringIndexOutOfBoundsException e) { - errln("FAIL: localeTest date getTimeInstance exception"); - throw e; - } - TestFormat(); - } - - for(dateStyle = 0; dateStyle < 4; dateStyle++) { - for(timeStyle = 0; timeStyle < 4; timeStyle++) { - fTestName = new String("DateTime test " + dateStyle + "/" + timeStyle + " (" + localeName + ")"); - try { - fFormat = DateFormat.getDateTimeInstance(dateStyle, timeStyle, locale); - } - catch(StringIndexOutOfBoundsException e) { - errln("FAIL: localeTest date/time getDateTimeInstance exception"); - throw e; - } - TestFormat(); - } - } - } - - public void TestFormat() { - if (fFormat == null) { - errln("FAIL: DateFormat creation failed"); - return; - } - // logln("TestFormat: " + fTestName); - Date now = new Date(); - tryDate(new Date(0)); - tryDate(new Date((long) 1278161801778.0)); - tryDate(now); - // Shift 6 months into the future, AT THE SAME TIME OF DAY. - // This will test the DST handling. - tryDate(new Date(now.getTime() + 6*30*ONEDAY)); - - Date limit = new Date(now.getTime() * 10); // Arbitrary limit - for (int i=0; i<2; ++i) - // tryDate(new Date(floor(randDouble() * limit))); - tryDate(new Date((long) (randDouble() * limit.getTime()))); - } - - private void describeTest() { - if (fFormat == null) { - errln("FAIL: no DateFormat"); - return; - } - - // Assume it's a SimpleDateFormat and get some info - SimpleDateFormat s = (SimpleDateFormat) fFormat; - logln(fTestName + " Pattern " + s.toPattern()); - } - - private void tryDate(Date theDate) { - final int DEPTH = 10; - Date[] date = new Date[DEPTH]; - StringBuffer[] string = new StringBuffer[DEPTH]; - - int dateMatch = 0; - int stringMatch = 0; - boolean dump = false; - int i; - for (i=0; i 0) { - if (dateMatch == 0 && date[i] == date[i-1]) dateMatch = i; - else if (dateMatch > 0 && date[i] != date[i-1]) { - describeTest(); - errln("********** FAIL: Date mismatch after match."); - dump = true; - break; - } - if (stringMatch == 0 && string[i] == string[i-1]) stringMatch = i; - else if (stringMatch > 0 && string[i] != string[i-1]) { - describeTest(); - errln("********** FAIL: String mismatch after match."); - dump = true; - break; - } - } - if (dateMatch > 0 && stringMatch > 0) break; - } - if (i == DEPTH) --i; - - if (stringMatch > fLimit || dateMatch > fLimit) { - describeTest(); - errln("********** FAIL: No string and/or date match within " + fLimit + " iterations."); - dump = true; - } - - if (dump) { - for (int k=0; k<=i; ++k) { - logln("" + k + ": " + date[k] + " F> " + string[k] + " P> "); - } - } - } - - // Return a random double from 0.01 to 1, inclusive - private double randDouble() { - // Assume 8-bit (or larger) rand values. Also assume - // that the system rand() function is very poor, which it always is. - // double d; - // int i; - // do { - // for (i=0; i < sizeof(double); ++i) - // { - // char poke = (char*)&d; - // poke[i] = (rand() & 0xFF); - // } - // } while (TPlatformUtilities.isNaN(d) || TPlatformUtilities.isInfinite(d)); - - // if (d < 0.0) d = -d; - // if (d > 0.0) - // { - // double e = floor(log10(d)); - // if (e < -2.0) d *= pow(10.0, -e-2); - // else if (e > -1.0) d /= pow(10.0, e+1); - // } - // return d; - Random rand = new Random(); - return rand.nextDouble(); - } - - public void TestAvailableLocales() { - final Locale[] locales = DateFormat.getAvailableLocales(); - long count = locales.length; - logln("" + count + " available locales"); - if (locales != null && count != 0) { - StringBuffer all = new StringBuffer(); - for (int i=0; i"; - verify(message, resultStr, result[i++]); - message = ""; - resultStr = ""; - - //for -2.55 with RoundingIncrement=1.0 - resultStr = pat.format(Roundingnumber1); - message = "round(" + (double) Roundingnumber1 - + "," + mode + ",FALSE) with RoundingIncrement=1.0==>"; - verify(message, resultStr, result[i++]); - message = ""; - resultStr = ""; - } - } - - /*Helper functions */ - public void verify(String message, String got, double expected) { - logln(message + got + " Expected : " + (long)expected); - String expectedStr = ""; - expectedStr=expectedStr + (long)expected; - if(!got.equals(expectedStr) ) { - errln("ERROR: Round() failed: " + message + got + " Expected : " + expectedStr); - } - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/icu/test/format/IntlTestDecimalFormatSymbols.java b/icu4j/src/com/ibm/icu/test/format/IntlTestDecimalFormatSymbols.java deleted file mode 100755 index a418ed5f4d..0000000000 --- a/icu4j/src/com/ibm/icu/test/format/IntlTestDecimalFormatSymbols.java +++ /dev/null @@ -1,132 +0,0 @@ -/***************************************************************************************** - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/format/Attic/IntlTestDecimalFormatSymbols.java,v $ - * $Date: 2001/10/23 13:12:49 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - **/ - -/** - * Port From: JDK 1.4b1 : java.text.Format.IntlTestDecimalFormatSymbols - * Source File: java/text/format/IntlTestDecimalFormatSymbols.java - **/ - -/* - @test 1.4 98/03/06 - @summary test International Decimal Format Symbols -*/ -/* -(C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved -(C) Copyright IBM Corp. 1996, 1997, 2001 - All Rights Reserved - - The original version of this source code and documentation is copyrighted and -owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These materials are -provided under terms of a License Agreement between Taligent and Sun. This -technology is protected by multiple US and International patents. This notice and -attribution to Taligent may not be removed. - Taligent is a registered trademark of Taligent, Inc. -*/ - -package com.ibm.icu.test.format; - -import com.ibm.text.*; -import com.ibm.util.*; -import java.util.Locale; -import java.text.FieldPosition; - -public class IntlTestDecimalFormatSymbols extends com.ibm.test.TestFmwk -{ - public static void main(String[] args) throws Exception { - new IntlTestDecimalFormatSymbols().run(args); - } - - // Test the API of DecimalFormatSymbols; primarily a simple get/set set. - public void TestSymbols() - { - DecimalFormatSymbols fr = new DecimalFormatSymbols(Locale.FRENCH); - - DecimalFormatSymbols en = new DecimalFormatSymbols(Locale.ENGLISH); - - if(en.equals(fr)) { - errln("ERROR: English DecimalFormatSymbols equal to French"); - } - - // just do some VERY basic tests to make sure that get/set work - - char zero = en.getZeroDigit(); - fr.setZeroDigit(zero); - if(fr.getZeroDigit() != en.getZeroDigit()) { - errln("ERROR: get/set ZeroDigit failed"); - } - - char group = en.getGroupingSeparator(); - fr.setGroupingSeparator(group); - if(fr.getGroupingSeparator() != en.getGroupingSeparator()) { - errln("ERROR: get/set GroupingSeparator failed"); - } - - char decimal = en.getDecimalSeparator(); - fr.setDecimalSeparator(decimal); - if(fr.getDecimalSeparator() != en.getDecimalSeparator()) { - errln("ERROR: get/set DecimalSeparator failed"); - } - - char perMill = en.getPerMill(); - fr.setPerMill(perMill); - if(fr.getPerMill() != en.getPerMill()) { - errln("ERROR: get/set PerMill failed"); - } - - char percent = en.getPercent(); - fr.setPercent(percent); - if(fr.getPercent() != en.getPercent()) { - errln("ERROR: get/set Percent failed"); - } - - char digit = en.getDigit(); - fr.setDigit(digit); - if(fr.getPercent() != en.getPercent()) { - errln("ERROR: get/set Percent failed"); - } - - char patternSeparator = en.getPatternSeparator(); - fr.setPatternSeparator(patternSeparator); - if(fr.getPatternSeparator() != en.getPatternSeparator()) { - errln("ERROR: get/set PatternSeparator failed"); - } - - String infinity = en.getInfinity(); - fr.setInfinity(infinity); - String infinity2 = fr.getInfinity(); - if(! infinity.equals(infinity2)) { - errln("ERROR: get/set Infinity failed"); - } - - String nan = en.getNaN(); - fr.setNaN(nan); - String nan2 = fr.getNaN(); - if(! nan.equals(nan2)) { - errln("ERROR: get/set NaN failed"); - } - - char minusSign = en.getMinusSign(); - fr.setMinusSign(minusSign); - if(fr.getMinusSign() != en.getMinusSign()) { - errln("ERROR: get/set MinusSign failed"); - } - -// char exponential = en.getExponentialSymbol(); -// fr.setExponentialSymbol(exponential); -// if(fr.getExponentialSymbol() != en.getExponentialSymbol()) { -// errln("ERROR: get/set Exponential failed"); -// } - - //DecimalFormatSymbols foo = new DecimalFormatSymbols(); //The variable is never used - - en = (DecimalFormatSymbols) fr.clone(); - - if(! en.equals(fr)) { - errln("ERROR: Clone failed"); - } - } -} diff --git a/icu4j/src/com/ibm/icu/test/format/IntlTestDecimalFormatSymbolsC.java b/icu4j/src/com/ibm/icu/test/format/IntlTestDecimalFormatSymbolsC.java deleted file mode 100755 index 34f095b8b6..0000000000 --- a/icu4j/src/com/ibm/icu/test/format/IntlTestDecimalFormatSymbolsC.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/format/Attic/IntlTestDecimalFormatSymbolsC.java,v $ - * $Date: 2001/10/23 13:13:25 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -/** - * Port From: ICU4C v1.8.1 : format : IntlTestDecimalFormatSymbols - * Source File: $ICU4CRoot/source/test/intltest/tsdcfmsy.cpp - **/ - -package com.ibm.icu.test.format; - -import java.text.FieldPosition; -import com.ibm.util.*; -import java.util.Locale; -import com.ibm.text.*; - -/** - * Tests for DecimalFormatSymbols - **/ -public class IntlTestDecimalFormatSymbolsC extends com.ibm.test.TestFmwk { - - public static void main(String[] args) throws Exception { - new IntlTestDecimalFormatSymbolsC().run(args); - } - - /** - * Test the API of DecimalFormatSymbols; primarily a simple get/set set. - */ - public void TestSymbols() { - DecimalFormatSymbols fr = new DecimalFormatSymbols(Locale.FRENCH); - DecimalFormatSymbols en = new DecimalFormatSymbols(Locale.ENGLISH); - - if (en.equals(fr)) { - errln("ERROR: English DecimalFormatSymbols equal to French"); - } - - // just do some VERY basic tests to make sure that get/set work - - char zero = en.getZeroDigit(); - fr.setZeroDigit(zero); - if (fr.getZeroDigit() != en.getZeroDigit()) { - errln("ERROR: get/set ZeroDigit failed"); - } - - char group = en.getGroupingSeparator(); - fr.setGroupingSeparator(group); - if (fr.getGroupingSeparator() != en.getGroupingSeparator()) { - errln("ERROR: get/set GroupingSeparator failed"); - } - - char decimal = en.getDecimalSeparator(); - fr.setDecimalSeparator(decimal); - if (fr.getDecimalSeparator() != en.getDecimalSeparator()) { - errln("ERROR: get/set DecimalSeparator failed"); - } - - char perMill = en.getPerMill(); - fr.setPerMill(perMill); - if (fr.getPerMill() != en.getPerMill()) { - errln("ERROR: get/set PerMill failed"); - } - - char percent = en.getPercent(); - fr.setPercent(percent); - if (fr.getPercent() != en.getPercent()) { - errln("ERROR: get/set Percent failed"); - } - - char digit = en.getDigit(); - fr.setDigit(digit); - if (fr.getPercent() != en.getPercent()) { - errln("ERROR: get/set Percent failed"); - } - - char patternSeparator = en.getPatternSeparator(); - fr.setPatternSeparator(patternSeparator); - if (fr.getPatternSeparator() != en.getPatternSeparator()) { - errln("ERROR: get/set PatternSeparator failed"); - } - - String infinity = en.getInfinity(); - fr.setInfinity(infinity); - String infinity2 = fr.getInfinity(); - if (!infinity.equals(infinity2)) { - errln("ERROR: get/set Infinity failed"); - } - - String nan = en.getNaN(); - fr.setNaN(nan); - String nan2 = fr.getNaN(); - if (!nan.equals(nan2)) { - errln("ERROR: get/set NaN failed"); - } - - char minusSign = en.getMinusSign(); - fr.setMinusSign(minusSign); - if (fr.getMinusSign() != en.getMinusSign()) { - errln("ERROR: get/set MinusSign failed"); - } - - // char exponential = en.getExponentialSymbol(); - // fr.setExponentialSymbol(exponential); - // if(fr.getExponentialSymbol() != en.getExponentialSymbol()) { - // errln("ERROR: get/set Exponential failed"); - // } - - //DecimalFormatSymbols foo = new DecimalFormatSymbols(); //The variable is never used - - en = (DecimalFormatSymbols) fr.clone(); - - if (!en.equals(fr)) { - errln("ERROR: Clone failed"); - } - - DecimalFormatSymbols sym = new DecimalFormatSymbols(Locale.US); - - verify(34.5, "00.00", sym, "34.50"); - sym.setDecimalSeparator('S'); - verify(34.5, "00.00", sym, "34S50"); - sym.setPercent('P'); - verify(34.5, "00 %", sym, "3450 P"); - sym.setCurrencySymbol("D"); - verify(34.5, "\u00a4##.##", sym, "D34.5"); - sym.setGroupingSeparator('|'); - verify(3456.5, "0,000.##", sym, "3|456S5"); - } - - /** helper functions**/ - public void verify(double value, String pattern, DecimalFormatSymbols sym, String expected) { - DecimalFormat df = new DecimalFormat(pattern, sym); - StringBuffer buffer = new StringBuffer(""); - FieldPosition pos = new FieldPosition(-1); - buffer = df.format(value, buffer, pos); - if(!buffer.toString().equals(expected)){ - errln("ERROR: format failed after setSymbols()\n Expected" + - expected + ", Got " + buffer); - } - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/icu/test/format/IntlTestNumberFormat.java b/icu4j/src/com/ibm/icu/test/format/IntlTestNumberFormat.java deleted file mode 100755 index 027b9a8e91..0000000000 --- a/icu4j/src/com/ibm/icu/test/format/IntlTestNumberFormat.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/format/Attic/IntlTestNumberFormat.java,v $ - * $Date: 2001/10/23 13:13:49 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -/** - * Port From: ICU4C v1.8.1 : format : IntlTestNumberFormat - * Source File: $ICU4CRoot/source/test/intltest/tsnmfmt.cpp - **/ - -package com.ibm.icu.test.format; - -import com.ibm.text.*; -import com.ibm.util.*; - -/** - * This test does round-trip testing (format -> parse -> format -> parse -> etc.) of - * NumberFormat. - */ -public class IntlTestNumberFormat extends com.ibm.test.TestFmwk { - - public NumberFormat fNumberFormat = NumberFormat.getInstance(); - - public static void main(String[] args) throws Exception { - new IntlTestNumberFormat().run(args); - } - - /* - * Internal use - **/ - public void _testLocale(java.util.Locale locale, String localeName) { - String name; - // locale = java.util.Locale.getDefault(); - // localeName = locale.getDisplayName(); - - name = "Number test"; - logln(name + " ( " + localeName + " ) "); - fNumberFormat = NumberFormat.getInstance(locale); - TestFormat(); - - name = "Currency test"; - logln(name + " (" + localeName + ")"); - fNumberFormat = NumberFormat.getCurrencyInstance(locale); - TestFormat(/* par */); - - name = "Percent test"; - logln(name + " (" + localeName + ")"); - fNumberFormat = NumberFormat.getPercentInstance(locale); - TestFormat(/* par */); - - } - - /** - * call TestFormat for currency, percent and plain number instances - **/ - public void TestLocale() { - String name; - String localeName; - java.util.Locale locale = java.util.Locale.getDefault(); - localeName = locale.getDisplayName(); - - name = "Number test"; - logln(name + " ( " + localeName + " ) "); - fNumberFormat = NumberFormat.getInstance(); - TestFormat(); - - name = "Currency test"; - logln(name + " (" + localeName + ")"); - fNumberFormat = NumberFormat.getCurrencyInstance(); - TestFormat(/* par */); - - name = "Percent test"; - logln(name + " (" + localeName + ")"); - fNumberFormat = NumberFormat.getPercentInstance(); - TestFormat(/* par */); - - } - - /** - * call tryIt with many variations, called by testLocale - **/ - public void TestFormat() { - - if (fNumberFormat == null){ - errln("**** FAIL: Null format returned by createXxxInstance."); - return; - } - DecimalFormat s = (DecimalFormat)fNumberFormat; - logln("pattern :" + s.toPattern()); - - tryIt(-2.02147304840132e-68); - tryIt(3.88057859588817e-68); - tryIt(-2.64651110485945e+65); - tryIt(9.29526819488338e+64); - - tryIt(-2.02147304840132e-100); - tryIt(3.88057859588817e-096); - tryIt(-2.64651110485945e+306); - tryIt(9.29526819488338e+250); - - tryIt(-9.18228054496402e+64); - tryIt(-9.69413034454191e+64); - - tryIt(-9.18228054496402e+255); - tryIt(-9.69413034454191e+273); - - - tryIt(1.234e-200); - tryIt(-2.3e-168); - - tryIt(Double.NaN); - tryIt(Double.POSITIVE_INFINITY); - tryIt(Double.NEGATIVE_INFINITY); - - tryIt(251887531); - tryIt(5e-20 / 9); - tryIt(5e20 / 9); - tryIt(1.234e-50); - tryIt(9.99999999999996); - tryIt(9.999999999999996); - - tryIt(Integer.MIN_VALUE); - tryIt(Integer.MAX_VALUE); - tryIt((double)Integer.MIN_VALUE); - tryIt((double)Integer.MAX_VALUE); - tryIt((double)Integer.MIN_VALUE - 1.0); - tryIt((double)Integer.MAX_VALUE + 1.0); - - tryIt(5.0 / 9.0 * 1e-20); - tryIt(4.0 / 9.0 * 1e-20); - tryIt(5.0 / 9.0 * 1e+20); - tryIt(4.0 / 9.0 * 1e+20); - - tryIt(2147483647.); - tryIt(0); - tryIt(0.0); - tryIt(1); - tryIt(10); - tryIt(100); - tryIt(-1); - tryIt(-10); - tryIt(-100); - tryIt(-1913860352); - - for (int j = 0; j < 10; j++) { - double d = Math.random()*2e10 - 1e10; - tryIt(d); - - } - } - - /** - * perform tests using aNumber and fNumberFormat, called in many variations - **/ - public void tryIt(double aNumber) { - final int DEPTH = 10; - double[] number = new double[DEPTH]; - String[] string = new String[DEPTH]; - int numberMatch = 0; - int stringMatch = 0; - boolean dump = false; - int i; - - for (i = 0; i < DEPTH; i++) { - if (i == 0) { - number[i] = aNumber; - } else { - try { - number[i - 1] = fNumberFormat.parse(string[i - 1]).doubleValue(); - } catch(java.text.ParseException pe) { - errln("**** FAIL: Parse of " + string[i-1] + " failed."); - dump = true; - break; - } - } - - string[i] = fNumberFormat.format(number[i]); - if (i > 0) - { - if (numberMatch == 0 && number[i] == number[i-1]) - numberMatch = i; - else if (numberMatch > 0 && number[i] != number[i-1]) - { - errln("**** FAIL: Numeric mismatch after match."); - dump = true; - break; - } - if (stringMatch == 0 && string[i] == string[i-1]) - stringMatch = i; - else if (stringMatch > 0 && string[i] != string[i-1]) - { - errln("**** FAIL: String mismatch after match."); - dump = true; - break; - } - } - if (numberMatch > 0 && stringMatch > 0) - break; - - if (i == DEPTH) - --i; - - if (stringMatch > 2 || numberMatch > 2) - { - errln("**** FAIL: No string and/or number match within 2 iterations."); - dump = true; - } - - if (dump) - { - for (int k=0; k<=i; ++k) - { - logln(k + ": " + number[k] + " F> " + - string[k] + " P> "); - } - } - } - } - - /** - * perform tests using aNumber and fNumberFormat, called in many variations - **/ - public void tryIt(int aNumber) { - long number;; - - String stringNum = fNumberFormat.format(aNumber); - try { - number = fNumberFormat.parse(stringNum).longValue(); - } catch (java.text.ParseException pe) { - errln("**** FAIL: Parse of " + stringNum + " failed."); - return; - } - - if (number != aNumber) { - errln("**** FAIL: Parse of " + stringNum + " failed. Got:" + number - + " Expected:" + aNumber); - } - - } - - /** - * test NumberFormat::getAvailableLocales - **/ - public void TestAvailableLocales() { - final java.util.Locale[] locales = NumberFormat.getAvailableLocales(); - int count = locales.length; - logln(count + " available locales"); - if (count != 0) - { - String all = ""; - for (int i = 0; i< count; ++i) - { - if (i!=0) - all += ", "; - all += locales[i].getDisplayName(); - } - logln(all); - } - else - errln("**** FAIL: Zero available locales or null array pointer"); - } - - /** - * call testLocale for all locales - **/ - public void TestMonster() { - final String SEP = "============================================================\n"; - int count; - final java.util.Locale[] locales = NumberFormat.getAvailableLocales(); - count = locales.length; - if (count != 0) - { - count = 3; // just test 3 locales - for (int i=0; i " + outString); - } - } - - /** - * Test getIntegerInstance(); - */ - public void Test4408066() { - - NumberFormat nf1 = NumberFormat.getIntegerInstance(); - NumberFormat nf2 = NumberFormat.getIntegerInstance(Locale.CHINA); - - //test isParseIntegerOnly - if (!nf1.isParseIntegerOnly() || !nf2.isParseIntegerOnly()) { - errln("Failed : Integer Number Format Instance should set setParseIntegerOnly(true)"); - } - - //Test format - { - double[] data = { - -3.75, -2.5, -1.5, - -1.25, 0, 1.0, - 1.25, 1.5, 2.5, - 3.75, 10.0, 255.5 - }; - String[] expected = { - "-4", "-2", "-2", - "-1", "0", "1", - "1", "2", "2", - "4", "10", "256" - }; - - for (int i = 0; i < data.length; ++i) { - String result = nf1.format(data[i]); - if (!result.equals(expected[i])) { - errln("Failed => Source: " + Double.toString(data[i]) - + ";Formatted : " + result - + ";but expectted: " + expected[i]); - } - } - } - //Test parse, Parsing should stop at "." - { - String data[] = { - "-3.75", "-2.5", "-1.5", - "-1.25", "0", "1.0", - "1.25", "1.5", "2.5", - "3.75", "10.0", "255.5" - }; - long[] expected = { - -3, -2, -1, - -1, 0, 1, - 1, 1, 2, - 3, 10, 255 - }; - - for (int i = 0; i < data.length; ++i) { - Number n = null; - try { - n = nf1.parse(data[i]); - } catch (ParseException e) { - errln("Failed: " + e.getMessage()); - } - if (!(n instanceof Long) || (n instanceof Integer)) { - errln("Failed: Integer Number Format should parse string to Long/Integer"); - } - if (n.longValue() != expected[i]) { - errln("Failed=> Source: " + data[i] - + ";result : " + n.toString() - + ";expected :" + Long.toString(expected[i])); - } - } - } - } - - //Test New serialized DecimalFormat(2.0) read old serialized forms of DecimalFormat(1.3.1.1) - public void TestSerialization() throws IOException, ClassNotFoundException{ - byte[][] contents = NumberFormatSerialTestData.getContent(); - double data = 1234.56; - String[] expected = { - "1,234.56", "$1,234.56", "123,456%", "1.23456E3"}; - for (int i = 0; i < 4; ++i) { - ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(contents[i])); - try { - NumberFormat format = (NumberFormat) ois.readObject(); - String result = format.format(data); - if (result.equals(expected[i])) { - logln("OK: Deserialized bogus NumberFormat(new version read old version)"); - } else { - errln("FAIL: the test data formats are not euqal"); - } - } catch (Exception e) { - errln("FAIL: " + e.getMessage()); - } - } - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/icu/test/format/NumberFormatRoundTripTest.java b/icu4j/src/com/ibm/icu/test/format/NumberFormatRoundTripTest.java deleted file mode 100755 index fc0540df8d..0000000000 --- a/icu4j/src/com/ibm/icu/test/format/NumberFormatRoundTripTest.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/format/Attic/NumberFormatRoundTripTest.java,v $ - * $Date: 2001/10/19 12:14:56 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ - -/** - * Porting From: ICU4C v1.8.1 : format : NumberFormatRoundTripTest - * Source File: $ICU4CRoot/source/test/intltest/nmfmtrt.cpp - **/ - -package com.ibm.icu.test.format; - -import com.ibm.text.*; -import com.ibm.util.*; -import java.util.Locale; - -/** - * Performs round-trip tests for NumberFormat - **/ -public class NumberFormatRoundTripTest extends com.ibm.test.TestFmwk { - - public double MAX_ERROR = 1e-14; - public double max_numeric_error = 0.0; - public double min_numeric_error = 1.0; - public boolean verbose = false; - public boolean STRING_COMPARE = false; - public boolean EXACT_NUMERIC_COMPARE = false; - public boolean DEBUG = false; - public boolean quick = true; - - public static void main(String[] args) throws Exception { - new NumberFormatRoundTripTest().run(args); - } - - public void TestNumberFormatRoundTrip() { - - NumberFormat fmt = null; - - logln("Default Locale"); - - logln("Default Number format"); - fmt = NumberFormat.getInstance(); - _test(fmt); - - logln("Currency Format"); - fmt = NumberFormat.getCurrencyInstance(); - _test(fmt); - - logln("Percent Format"); - fmt = NumberFormat.getPercentInstance(); - _test(fmt); - - - int locCount = 0; - final Locale[] loc = NumberFormat.getAvailableLocales(); - if(quick) { - if(locCount > 5) - locCount = 5; - logln("Quick mode: only _testing first 5 Locales"); - } - for(int i = 0; i < locCount; ++i) { - logln(loc[i].getDisplayName()); - - fmt = NumberFormat.getInstance(loc[i]); - _test(fmt); - - fmt = NumberFormat.getCurrencyInstance(loc[i]); - _test(fmt); - - fmt = NumberFormat.getPercentInstance(loc[i]); - _test(fmt); - } - - logln("Numeric error " + min_numeric_error + " to " + max_numeric_error); - } - - /** - * Return a random value from -range..+range. - */ - public double randomDouble(double range) { - return Math.random() * range; - } - - public void _test(NumberFormat fmt) { - - _test(fmt, Double.NaN); - _test(fmt, Double.POSITIVE_INFINITY); - _test(fmt, Double.NEGATIVE_INFINITY); - - _test(fmt, 500); - _test(fmt, 0); - _test(fmt, -0); - _test(fmt, 0.0); - double negZero = 0.0; - negZero /= -1.0; - _test(fmt, negZero); - _test(fmt, 9223372036854775808.0d); - _test(fmt, -9223372036854775809.0d); - //_test(fmt, 6.936065876100493E74d); - - // _test(fmt, 6.212122845281909E48d); - for (int i = 0; i < 10; ++i) { - - _test(fmt, randomDouble(1)); - - _test(fmt, randomDouble(10000)); - - _test(fmt, Math.floor((randomDouble(10000)))); - - _test(fmt, randomDouble(1e50)); - - _test(fmt, randomDouble(1e-50)); - - _test(fmt, randomDouble(1e100)); - - _test(fmt, randomDouble(1e75)); - - _test(fmt, randomDouble(1e308) / ((DecimalFormat) fmt).getMultiplier()); - - _test(fmt, randomDouble(1e75) / ((DecimalFormat) fmt).getMultiplier()); - - _test(fmt, randomDouble(1e65) / ((DecimalFormat) fmt).getMultiplier()); - - _test(fmt, randomDouble(1e-292)); - - _test(fmt, randomDouble(1e-78)); - - _test(fmt, randomDouble(1e-323)); - - _test(fmt, randomDouble(1e-100)); - - _test(fmt, randomDouble(1e-78)); - } - } - - public void _test(NumberFormat fmt, double value) { - _test(fmt, new Double(value)); - } - - public void _test(NumberFormat fmt, long value) { - _test(fmt, new Long(value)); - } - - public void _test(NumberFormat fmt, Number value) { - logln("test data = " + value); - fmt.setMaximumFractionDigits(999); - String s, s2; - if (value.getClass().getName().equalsIgnoreCase("java.lang.Double")) - s = fmt.format(value.doubleValue()); - else - s = fmt.format(value.longValue()); - - Number n = new Double(0); - boolean show = verbose; - if (DEBUG) - logln( - /*value.getString(temp) +*/ " F> " + s); - try { - n = fmt.parse(s); - } catch (java.text.ParseException e) { - System.out.println(e); - } - - if (DEBUG) - logln(s + " P> " /*+ n.getString(temp)*/); - - if (value.getClass().getName().equalsIgnoreCase("java.lang.Double")) - s2 = fmt.format(n.doubleValue()); - else - s2 = fmt.format(n.longValue()); - - if (DEBUG) - logln(/*n.getString(temp) +*/ " F> " + s2); - - if (STRING_COMPARE) { - if (!s.equals(s2)) { - errln("*** STRING ERROR \"" + s + "\" != \"" + s2 + "\""); - show = true; - } - } - - if (EXACT_NUMERIC_COMPARE) { - if (value != n) { - errln("*** NUMERIC ERROR"); - show = true; - } - } else { - // Compute proportional error - double error = proportionalError(value, n); - - if (error > MAX_ERROR) { - errln("*** NUMERIC ERROR " + error); - show = true; - } - - if (error > max_numeric_error) - max_numeric_error = error; - if (error < min_numeric_error) - min_numeric_error = error; - } - - if (show) - logln( - /*value.getString(temp) +*/ value.getClass().getName() + " F> " + s + " P> " + - /*n.getString(temp) +*/ n.getClass().getName() + " F> " + s2); - - } - - public double proportionalError(Number a, Number b) { - double aa,bb; - - if(a.getClass().getName().equalsIgnoreCase("java.lang.Double")) - aa = a.doubleValue(); - else - aa = a.longValue(); - - if(a.getClass().getName().equalsIgnoreCase("java.lang.Double")) - bb = b.doubleValue(); - else - bb = b.longValue(); - - double error = aa - bb; - if(aa != 0 && bb != 0) - error /= aa; - - return Math.abs(error); - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/icu/test/format/NumberFormatSerialTestData.java b/icu4j/src/com/ibm/icu/test/format/NumberFormatSerialTestData.java deleted file mode 100755 index d4ed4aa33a..0000000000 --- a/icu4j/src/com/ibm/icu/test/format/NumberFormatSerialTestData.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/format/Attic/NumberFormatSerialTestData.java,v $ - * $Date: 2001/10/26 06:30:22 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ - -package com.ibm.icu.test.format; - -public class NumberFormatSerialTestData { - //get Content - public static byte[][] getContent() { - return content; - } - - //NumberFormat.getInstance(Locale.US) - static byte[] generalInstance = { - -84,-19, 0, 5, 115, 114, 0, 26, 99, 111, 109, 46, 105, 98, 109, 46, 116, 101, 120, 116, 46, - 68, 101, 99, 105, 109, 97, 108, 70, 111, 114, 109, 97, 116, 11, -1, 3, 98, -40, 114, 48, - 58, 2, 0, 18, 90, 0, 27, 100, 101, 99, 105, 109, 97, 108, 83, 101, 112, 97, 114, 97, - 116, 111, 114, 65, 108, 119, 97, 121, 115, 83, 104, 111, 119, 110, 90, 0, 23, 101, 120, 112, - 111, 110, 101, 110, 116, 83, 105, 103, 110, 65, 108, 119, 97, 121, 115, 83, 104, 111, 119, 110, - 73, 0, 11, 102, 111, 114, 109, 97, 116, 87, 105, 100, 116, 104, 66, 0, 12, 103, 114, 111, - 117, 112, 105, 110, 103, 83, 105, 122, 101, 66, 0, 13, 103, 114, 111, 117, 112, 105, 110, 103, - 83, 105, 122, 101, 50, 66, 0, 17, 109, 105, 110, 69, 120, 112, 111, 110, 101, 110, 116, 68, - 105, 103, 105, 116, 115, 73, 0, 10, 109, 117, 108, 116, 105, 112, 108, 105, 101, 114, 67, 0, - 3, 112, 97, 100, 73, 0, 11, 112, 97, 100, 80, 111, 115, 105, 116, 105, 111, 110, 73, 0, - 12, 114, 111, 117, 110, 100, 105, 110, 103, 77, 111, 100, 101, 73, 0, 21, 115, 101, 114, 105, - 97, 108, 86, 101, 114, 115, 105, 111, 110, 79, 110, 83, 116, 114, 101, 97, 109, 90, 0, 22, - 117, 115, 101, 69, 120, 112, 111, 110, 101, 110, 116, 105, 97, 108, 78, 111, 116, 97, 116, 105, - 111, 110, 76, 0, 14, 110, 101, 103, 97, 116, 105, 118, 101, 80, 114, 101, 102, 105, 120, 116, - 0, 18, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, - 76, 0, 14, 110, 101, 103, 97, 116, 105, 118, 101, 83, 117, 102, 102, 105, 120, 113, 0, 126, - 0, 1, 76, 0, 14, 112, 111, 115, 105, 116, 105, 118, 101, 80, 114, 101, 102, 105, 120, 113, - 0, 126, 0, 1, 76, 0, 14, 112, 111, 115, 105, 116, 105, 118, 101, 83, 117, 102, 102, 105, - 120, 113, 0, 126, 0, 1, 76, 0, 17, 114, 111, 117, 110, 100, 105, 110, 103, 73, 110, 99, - 114, 101, 109, 101, 110, 116, 116, 0, 22, 76, 106, 97, 118, 97, 47, 109, 97, 116, 104, 47, - 66, 105, 103, 68, 101, 99, 105, 109, 97, 108, 59, 76, 0, 7, 115, 121, 109, 98, 111, 108, - 115, 116, 0, 35, 76, 99, 111, 109, 47, 105, 98, 109, 47, 116, 101, 120, 116, 47, 68, 101, - 99, 105, 109, 97, 108, 70, 111, 114, 109, 97, 116, 83, 121, 109, 98, 111, 108, 115, 59, 120, - 114, 0, 25, 99, 111, 109, 46, 105, 98, 109, 46, 116, 101, 120, 116, 46, 78, 117, 109, 98, - 101, 114, 70, 111, 114, 109, 97, 116, -33, -10, -77, -65, 19, 125, 7, -24, 3, 0, 11, 90, - 0, 12, 103, 114, 111, 117, 112, 105, 110, 103, 85, 115, 101, 100, 66, 0, 17, 109, 97, 120, - 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, 105, 116, 115, 66, 0, 16, 109, 97, 120, - 73, 110, 116, 101, 103, 101, 114, 68, 105, 103, 105, 116, 115, 73, 0, 21, 109, 97, 120, 105, - 109, 117, 109, 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, 105, 116, 115, 73, 0, 20, - 109, 97, 120, 105, 109, 117, 109, 73, 110, 116, 101, 103, 101, 114, 68, 105, 103, 105, 116, 115, - 66, 0, 17, 109, 105, 110, 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, 105, 116, 115, - 66, 0, 16, 109, 105, 110, 73, 110, 116, 101, 103, 101, 114, 68, 105, 103, 105, 116, 115, 73, - 0, 21, 109, 105, 110, 105, 109, 117, 109, 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, - 105, 116, 115, 73, 0, 20, 109, 105, 110, 105, 109, 117, 109, 73, 110, 116, 101, 103, 101, 114, - 68, 105, 103, 105, 116, 115, 90, 0, 16, 112, 97, 114, 115, 101, 73, 110, 116, 101, 103, 101, - 114, 79, 110, 108, 121, 73, 0, 21, 115, 101, 114, 105, 97, 108, 86, 101, 114, 115, 105, 111, - 110, 79, 110, 83, 116, 114, 101, 97, 109, 120, 114, 0, 16, 106, 97, 118, 97, 46, 116, 101, - 120, 116, 46, 70, 111, 114, 109, 97, 116, -5, -40, -68, 18, -23, 15, 24, 67, 2, 0, 0, - 120, 112, 1, 3, 127, 0, 0, 0, 3, 127, -1, -1, -1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 1, 120, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, - 0, 1, 0, 32, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 2, 0, 116, 0, 1, - 45, 116, 0, 0, 116, 0, 0, 116, 0, 0, 112, 115, 114, 0, 33, 99, 111, 109, 46, 105, - 98, 109, 46, 116, 101, 120, 116, 46, 68, 101, 99, 105, 109, 97, 108, 70, 111, 114, 109, 97, - 116, 83, 121, 109, 98, 111, 108, 115, 80, 29, 23, -103, 8, 104, -109, -100, 2, 0, 18, 67, - 0, 16, 100, 101, 99, 105, 109, 97, 108, 83, 101, 112, 97, 114, 97, 116, 111, 114, 67, 0, - 5, 100, 105, 103, 105, 116, 67, 0, 11, 101, 120, 112, 111, 110, 101, 110, 116, 105, 97, 108, - 67, 0, 17, 103, 114, 111, 117, 112, 105, 110, 103, 83, 101, 112, 97, 114, 97, 116, 111, 114, - 67, 0, 9, 109, 105, 110, 117, 115, 83, 105, 103, 110, 67, 0, 17, 109, 111, 110, 101, 116, - 97, 114, 121, 83, 101, 112, 97, 114, 97, 116, 111, 114, 67, 0, 9, 112, 97, 100, 69, 115, - 99, 97, 112, 101, 67, 0, 16, 112, 97, 116, 116, 101, 114, 110, 83, 101, 112, 97, 114, 97, - 116, 111, 114, 67, 0, 7, 112, 101, 114, 77, 105, 108, 108, 67, 0, 7, 112, 101, 114, 99, - 101, 110, 116, 67, 0, 8, 112, 108, 117, 115, 83, 105, 103, 110, 73, 0, 21, 115, 101, 114, - 105, 97, 108, 86, 101, 114, 115, 105, 111, 110, 79, 110, 83, 116, 114, 101, 97, 109, 67, 0, - 9, 122, 101, 114, 111, 68, 105, 103, 105, 116, 76, 0, 3, 78, 97, 78, 113, 0, 126, 0, - 1, 76, 0, 14, 99, 117, 114, 114, 101, 110, 99, 121, 83, 121, 109, 98, 111, 108, 113, 0, - 126, 0, 1, 76, 0, 17, 101, 120, 112, 111, 110, 101, 110, 116, 83, 101, 112, 97, 114, 97, - 116, 111, 114, 113, 0, 126, 0, 1, 76, 0, 8, 105, 110, 102, 105, 110, 105, 116, 121, 113, - 0, 126, 0, 1, 76, 0, 18, 105, 110, 116, 108, 67, 117, 114, 114, 101, 110, 99, 121, 83, - 121, 109, 98, 111, 108, 113, 0, 126, 0, 1, 120, 112, 0, 46, 0, 35, 0, 0, 0, 44, - 0, 45, 0, 46, 0, 42, 0, 59, 32, 48, 0, 37, 0, 43, 0, 0, 0, 2, 0, 48, - 116, 0, 3, -17, -65, -67, 116, 0, 1, 36, 116, 0, 1, 69, 116, 0, 3, -30, -120, -98, - 116, 0, 3, 85, 83, 68}; - - //NumberFormat.getCurrencyInstance(Locale.US); - static byte[] currencyInstance = { - -84, -19, 0, 5, 115, 114, 0, 26, 99, 111, 109, 46, 105, 98, 109, 46, 116, 101, 120, 116, 46, - 68, 101, 99, 105, 109, 97, 108, 70, 111, 114, 109, 97, 116, 11, -1, 3, 98, -40, 114, 48, - 58, 2, 0, 18, 90, 0, 27, 100, 101, 99, 105, 109, 97, 108, 83, 101, 112, 97, 114, 97, - 116, 111, 114, 65, 108, 119, 97, 121, 115, 83, 104, 111, 119, 110, 90, 0, 23, 101, 120, 112, - 111, 110, 101, 110, 116, 83, 105, 103, 110, 65, 108, 119, 97, 121, 115, 83, 104, 111, 119, 110, - 73, 0, 11, 102, 111, 114, 109, 97, 116, 87, 105, 100, 116, 104, 66, 0, 12, 103, 114, 111, - 117, 112, 105, 110, 103, 83, 105, 122, 101, 66, 0, 13, 103, 114, 111, 117, 112, 105, 110, 103, - 83, 105, 122, 101, 50, 66, 0, 17, 109, 105, 110, 69, 120, 112, 111, 110, 101, 110, 116, 68, - 105, 103, 105, 116, 115, 73, 0, 10, 109, 117, 108, 116, 105, 112, 108, 105, 101, 114, 67, 0, - 3, 112, 97, 100, 73, 0, 11, 112, 97, 100, 80, 111, 115, 105, 116, 105, 111, 110, 73, 0, - 12, 114, 111, 117, 110, 100, 105, 110, 103, 77, 111, 100, 101, 73, 0, 21, 115, 101, 114, 105, - 97, 108, 86, 101, 114, 115, 105, 111, 110, 79, 110, 83, 116, 114, 101, 97, 109, 90, 0, 22, - 117, 115, 101, 69, 120, 112, 111, 110, 101, 110, 116, 105, 97, 108, 78, 111, 116, 97, 116, 105, - 111, 110, 76, 0, 14, 110, 101, 103, 97, 116, 105, 118, 101, 80, 114, 101, 102, 105, 120, 116, - 0, 18, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, - 76, 0, 14, 110, 101, 103, 97, 116, 105, 118, 101, 83, 117, 102, 102, 105, 120, 113, 0, 126, - 0, 1, 76, 0, 14, 112, 111, 115, 105, 116, 105, 118, 101, 80, 114, 101, 102, 105, 120, 113, - 0, 126, 0, 1, 76, 0, 14, 112, 111, 115, 105, 116, 105, 118, 101, 83, 117, 102, 102, 105, - 120, 113, 0, 126, 0, 1, 76, 0, 17, 114, 111, 117, 110, 100, 105, 110, 103, 73, 110, 99, - 114, 101, 109, 101, 110, 116, 116, 0, 22, 76, 106, 97, 118, 97, 47, 109, 97, 116, 104, 47, - 66, 105, 103, 68, 101, 99, 105, 109, 97, 108, 59, 76, 0, 7, 115, 121, 109, 98, 111, 108, - 115, 116, 0, 35, 76, 99, 111, 109, 47, 105, 98, 109, 47, 116, 101, 120, 116, 47, 68, 101, - 99, 105, 109, 97, 108, 70, 111, 114, 109, 97, 116, 83, 121, 109, 98, 111, 108, 115, 59, 120, - 114, 0, 25, 99, 111, 109, 46, 105, 98, 109, 46, 116, 101, 120, 116, 46, 78, 117, 109, 98, - 101, 114, 70, 111, 114, 109, 97, 116, -33, -10, -77, -65, 19, 125, 7, -24, 3, 0, 11, 90, - 0, 12, 103, 114, 111, 117, 112, 105, 110, 103, 85, 115, 101, 100, 66, 0, 17, 109, 97, 120, - 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, 105, 116, 115, 66, 0, 16, 109, 97, 120, - 73, 110, 116, 101, 103, 101, 114, 68, 105, 103, 105, 116, 115, 73, 0, 21, 109, 97, 120, 105, - 109, 117, 109, 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, 105, 116, 115, 73, 0, 20, - 109, 97, 120, 105, 109, 117, 109, 73, 110, 116, 101, 103, 101, 114, 68, 105, 103, 105, 116, 115, - 66, 0, 17, 109, 105, 110, 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, 105, 116, 115, - 66, 0, 16, 109, 105, 110, 73, 110, 116, 101, 103, 101, 114, 68, 105, 103, 105, 116, 115, 73, - 0, 21, 109, 105, 110, 105, 109, 117, 109, 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, - 105, 116, 115, 73, 0, 20, 109, 105, 110, 105, 109, 117, 109, 73, 110, 116, 101, 103, 101, 114, - 68, 105, 103, 105, 116, 115, 90, 0, 16, 112, 97, 114, 115, 101, 73, 110, 116, 101, 103, 101, - 114, 79, 110, 108, 121, 73, 0, 21, 115, 101, 114, 105, 97, 108, 86, 101, 114, 115, 105, 111, - 110, 79, 110, 83, 116, 114, 101, 97, 109, 120, 114, 0, 16, 106, 97, 118, 97, 46, 116, 101, - 120, 116, 46, 70, 111, 114, 109, 97, 116, -5, -40, -68, 18, -23, 15, 24, 67, 2, 0, 0, - 120, 112, 1, 2, 127, 0, 0, 0, 2, 127, -1, -1, -1, 2, 1, 0, 0, 0, 2, 0, - 0, 0, 1, 0, 0, 0, 0, 1, 120, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, - 0, 1, 0, 32, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 2, 0, 116, 0, 2, - 40, 36, 116, 0, 1, 41, 116, 0, 1, 36, 116, 0, 0, 112, 115, 114, 0, 33, 99, 111, - 109, 46, 105, 98, 109, 46, 116, 101, 120, 116, 46, 68, 101, 99, 105, 109, 97, 108, 70, 111, - 114, 109, 97, 116, 83, 121, 109, 98, 111, 108, 115, 80, 29, 23, -103, 8, 104, -109, -100, 2, - 0, 18, 67, 0, 16, 100, 101, 99, 105, 109, 97, 108, 83, 101, 112, 97, 114, 97, 116, 111, - 114, 67, 0, 5, 100, 105, 103, 105, 116, 67, 0, 11, 101, 120, 112, 111, 110, 101, 110, 116, - 105, 97, 108, 67, 0, 17, 103, 114, 111, 117, 112, 105, 110, 103, 83, 101, 112, 97, 114, 97, - 116, 111, 114, 67, 0, 9, 109, 105, 110, 117, 115, 83, 105, 103, 110, 67, 0, 17, 109, 111, - 110, 101, 116, 97, 114, 121, 83, 101, 112, 97, 114, 97, 116, 111, 114, 67, 0, 9, 112, 97, - 100, 69, 115, 99, 97, 112, 101, 67, 0, 16, 112, 97, 116, 116, 101, 114, 110, 83, 101, 112, - 97, 114, 97, 116, 111, 114, 67, 0, 7, 112, 101, 114, 77, 105, 108, 108, 67, 0, 7, 112, - 101, 114, 99, 101, 110, 116, 67, 0, 8, 112, 108, 117, 115, 83, 105, 103, 110, 73, 0, 21, - 115, 101, 114, 105, 97, 108, 86, 101, 114, 115, 105, 111, 110, 79, 110, 83, 116, 114, 101, 97, - 109, 67, 0, 9, 122, 101, 114, 111, 68, 105, 103, 105, 116, 76, 0, 3, 78, 97, 78, 113, - 0, 126, 0, 1, 76, 0, 14, 99, 117, 114, 114, 101, 110, 99, 121, 83, 121, 109, 98, 111, - 108, 113, 0, 126, 0, 1, 76, 0, 17, 101, 120, 112, 111, 110, 101, 110, 116, 83, 101, 112, - 97, 114, 97, 116, 111, 114, 113, 0, 126, 0, 1, 76, 0, 8, 105, 110, 102, 105, 110, 105, - 116, 121, 113, 0, 126, 0, 1, 76, 0, 18, 105, 110, 116, 108, 67, 117, 114, 114, 101, 110, - 99, 121, 83, 121, 109, 98, 111, 108, 113, 0, 126, 0, 1, 120, 112, 0, 46, 0, 35, 0, - 0, 0, 44, 0, 45, 0, 46, 0, 42, 0, 59, 32, 48, 0, 37, 0, 43, 0, 0, 0, - 2, 0, 48, 116, 0, 3, -17, -65, -67, 116, 0, 1, 36, 116, 0, 1, 69, 116, 0, 3, - -30, -120, -98, 116, 0, 3, 85, 83, 68}; - - //NumberFormat.getPercentInstance(Locale.US) - static byte[] percentInstance = { - -84, -19, 0, 5, 115, 114, 0, 26, 99, 111, 109, 46, 105, 98, 109, 46, 116, 101, 120, 116, 46, - 68, 101, 99, 105, 109, 97, 108, 70, 111, 114, 109, 97, 116, 11, -1, 3, 98, -40, 114, 48, - 58, 2, 0, 18, 90, 0, 27, 100, 101, 99, 105, 109, 97, 108, 83, 101, 112, 97, 114, 97, - 116, 111, 114, 65, 108, 119, 97, 121, 115, 83, 104, 111, 119, 110, 90, 0, 23, 101, 120, 112, - 111, 110, 101, 110, 116, 83, 105, 103, 110, 65, 108, 119, 97, 121, 115, 83, 104, 111, 119, 110, - 73, 0, 11, 102, 111, 114, 109, 97, 116, 87, 105, 100, 116, 104, 66, 0, 12, 103, 114, 111, - 117, 112, 105, 110, 103, 83, 105, 122, 101, 66, 0, 13, 103, 114, 111, 117, 112, 105, 110, 103, - 83, 105, 122, 101, 50, 66, 0, 17, 109, 105, 110, 69, 120, 112, 111, 110, 101, 110, 116, 68, - 105, 103, 105, 116, 115, 73, 0, 10, 109, 117, 108, 116, 105, 112, 108, 105, 101, 114, 67, 0, - 3, 112, 97, 100, 73, 0, 11, 112, 97, 100, 80, 111, 115, 105, 116, 105, 111, 110, 73, 0, - 12, 114, 111, 117, 110, 100, 105, 110, 103, 77, 111, 100, 101, 73, 0, 21, 115, 101, 114, 105, - 97, 108, 86, 101, 114, 115, 105, 111, 110, 79, 110, 83, 116, 114, 101, 97, 109, 90, 0, 22, - 117, 115, 101, 69, 120, 112, 111, 110, 101, 110, 116, 105, 97, 108, 78, 111, 116, 97, 116, 105, - 111, 110, 76, 0, 14, 110, 101, 103, 97, 116, 105, 118, 101, 80, 114, 101, 102, 105, 120, 116, - 0, 18, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, - 76, 0, 14, 110, 101, 103, 97, 116, 105, 118, 101, 83, 117, 102, 102, 105, 120, 113, 0, 126, - 0, 1, 76, 0, 14, 112, 111, 115, 105, 116, 105, 118, 101, 80, 114, 101, 102, 105, 120, 113, - 0, 126, 0, 1, 76, 0, 14, 112, 111, 115, 105, 116, 105, 118, 101, 83, 117, 102, 102, 105, - 120, 113, 0, 126, 0, 1, 76, 0, 17, 114, 111, 117, 110, 100, 105, 110, 103, 73, 110, 99, - 114, 101, 109, 101, 110, 116, 116, 0, 22, 76, 106, 97, 118, 97, 47, 109, 97, 116, 104, 47, - 66, 105, 103, 68, 101, 99, 105, 109, 97, 108, 59, 76, 0, 7, 115, 121, 109, 98, 111, 108, - 115, 116, 0, 35, 76, 99, 111, 109, 47, 105, 98, 109, 47, 116, 101, 120, 116, 47, 68, 101, - 99, 105, 109, 97, 108, 70, 111, 114, 109, 97, 116, 83, 121, 109, 98, 111, 108, 115, 59, 120, - 114, 0, 25, 99, 111, 109, 46, 105, 98, 109, 46, 116, 101, 120, 116, 46, 78, 117, 109, 98, - 101, 114, 70, 111, 114, 109, 97, 116, -33, -10, -77, -65, 19, 125, 7, -24, 3, 0, 11, 90, - 0, 12, 103, 114, 111, 117, 112, 105, 110, 103, 85, 115, 101, 100, 66, 0, 17, 109, 97, 120, - 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, 105, 116, 115, 66, 0, 16, 109, 97, 120, - 73, 110, 116, 101, 103, 101, 114, 68, 105, 103, 105, 116, 115, 73, 0, 21, 109, 97, 120, 105, - 109, 117, 109, 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, 105, 116, 115, 73, 0, 20, - 109, 97, 120, 105, 109, 117, 109, 73, 110, 116, 101, 103, 101, 114, 68, 105, 103, 105, 116, 115, - 66, 0, 17, 109, 105, 110, 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, 105, 116, 115, - 66, 0, 16, 109, 105, 110, 73, 110, 116, 101, 103, 101, 114, 68, 105, 103, 105, 116, 115, 73, - 0, 21, 109, 105, 110, 105, 109, 117, 109, 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, - 105, 116, 115, 73, 0, 20, 109, 105, 110, 105, 109, 117, 109, 73, 110, 116, 101, 103, 101, 114, - 68, 105, 103, 105, 116, 115, 90, 0, 16, 112, 97, 114, 115, 101, 73, 110, 116, 101, 103, 101, - 114, 79, 110, 108, 121, 73, 0, 21, 115, 101, 114, 105, 97, 108, 86, 101, 114, 115, 105, 111, - 110, 79, 110, 83, 116, 114, 101, 97, 109, 120, 114, 0, 16, 106, 97, 118, 97, 46, 116, 101, - 120, 116, 46, 70, 111, 114, 109, 97, 116, -5, -40, -68, 18, -23, 15, 24, 67, 2, 0, 0, - 120, 112, 1, 0, 127, 0, 0, 0, 0, 127, -1, -1, -1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 1, 120, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, - 0, 100, 0, 32, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 2, 0, 116, 0, 1, - 45, 116, 0, 1, 37, 116, 0, 0, 113, 0, 126, 0, 8, 112, 115, 114, 0, 33, 99, 111, - 109, 46, 105, 98, 109, 46, 116, 101, 120, 116, 46, 68, 101, 99, 105, 109, 97, 108, 70, 111, - 114, 109, 97, 116, 83, 121, 109, 98, 111, 108, 115, 80, 29, 23, -103, 8, 104, -109, -100, 2, - 0, 18, 67, 0, 16, 100, 101, 99, 105, 109, 97, 108, 83, 101, 112, 97, 114, 97, 116, 111, - 114, 67, 0, 5, 100, 105, 103, 105, 116, 67, 0, 11, 101, 120, 112, 111, 110, 101, 110, 116, - 105, 97, 108, 67, 0, 17, 103, 114, 111, 117, 112, 105, 110, 103, 83, 101, 112, 97, 114, 97, - 116, 111, 114, 67, 0, 9, 109, 105, 110, 117, 115, 83, 105, 103, 110, 67, 0, 17, 109, 111, - 110, 101, 116, 97, 114, 121, 83, 101, 112, 97, 114, 97, 116, 111, 114, 67, 0, 9, 112, 97, - 100, 69, 115, 99, 97, 112, 101, 67, 0, 16, 112, 97, 116, 116, 101, 114, 110, 83, 101, 112, - 97, 114, 97, 116, 111, 114, 67, 0, 7, 112, 101, 114, 77, 105, 108, 108, 67, 0, 7, 112, - 101, 114, 99, 101, 110, 116, 67, 0, 8, 112, 108, 117, 115, 83, 105, 103, 110, 73, 0, 21, - 115, 101, 114, 105, 97, 108, 86, 101, 114, 115, 105, 111, 110, 79, 110, 83, 116, 114, 101, 97, - 109, 67, 0, 9, 122, 101, 114, 111, 68, 105, 103, 105, 116, 76, 0, 3, 78, 97, 78, 113, - 0, 126, 0, 1, 76, 0, 14, 99, 117, 114, 114, 101, 110, 99, 121, 83, 121, 109, 98, 111, - 108, 113, 0, 126, 0, 1, 76, 0, 17, 101, 120, 112, 111, 110, 101, 110, 116, 83, 101, 112, - 97, 114, 97, 116, 111, 114, 113, 0, 126, 0, 1, 76, 0, 8, 105, 110, 102, 105, 110, 105, - 116, 121, 113, 0, 126, 0, 1, 76, 0, 18, 105, 110, 116, 108, 67, 117, 114, 114, 101, 110, - 99, 121, 83, 121, 109, 98, 111, 108, 113, 0, 126, 0, 1, 120, 112, 0, 46, 0, 35, 0, - 0, 0, 44, 0, 45, 0, 46, 0, 42, 0, 59, 32, 48, 0, 37, 0, 43, 0, 0, 0, - 2, 0, 48, 116, 0, 3, -17, -65, -67, 116, 0, 1, 36, 116, 0, 1, 69, 116, 0, 3, - -30, -120, -98, 116, 0, 3, 85, 83, 68}; - //NumberFormat.getScientificInstance(Locale.US) - static byte[] scientificInstance = { - -84, -19, 0, 5, 115, 114, 0, 26, 99, 111, 109, 46, 105, 98, 109, 46, 116, 101, 120, 116, 46, - 68, 101, 99, 105, 109, 97, 108, 70, 111, 114, 109, 97, 116, 11, -1, 3, 98, -40, 114, 48, - 58, 2, 0, 18, 90, 0, 27, 100, 101, 99, 105, 109, 97, 108, 83, 101, 112, 97, 114, 97, - 116, 111, 114, 65, 108, 119, 97, 121, 115, 83, 104, 111, 119, 110, 90, 0, 23, 101, 120, 112, - 111, 110, 101, 110, 116, 83, 105, 103, 110, 65, 108, 119, 97, 121, 115, 83, 104, 111, 119, 110, - 73, 0, 11, 102, 111, 114, 109, 97, 116, 87, 105, 100, 116, 104, 66, 0, 12, 103, 114, 111, - 117, 112, 105, 110, 103, 83, 105, 122, 101, 66, 0, 13, 103, 114, 111, 117, 112, 105, 110, 103, - 83, 105, 122, 101, 50, 66, 0, 17, 109, 105, 110, 69, 120, 112, 111, 110, 101, 110, 116, 68, - 105, 103, 105, 116, 115, 73, 0, 10, 109, 117, 108, 116, 105, 112, 108, 105, 101, 114, 67, 0, - 3, 112, 97, 100, 73, 0, 11, 112, 97, 100, 80, 111, 115, 105, 116, 105, 111, 110, 73, 0, - 12, 114, 111, 117, 110, 100, 105, 110, 103, 77, 111, 100, 101, 73, 0, 21, 115, 101, 114, 105, - 97, 108, 86, 101, 114, 115, 105, 111, 110, 79, 110, 83, 116, 114, 101, 97, 109, 90, 0, 22, - 117, 115, 101, 69, 120, 112, 111, 110, 101, 110, 116, 105, 97, 108, 78, 111, 116, 97, 116, 105, - 111, 110, 76, 0, 14, 110, 101, 103, 97, 116, 105, 118, 101, 80, 114, 101, 102, 105, 120, 116, - 0, 18, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, - 76, 0, 14, 110, 101, 103, 97, 116, 105, 118, 101, 83, 117, 102, 102, 105, 120, 113, 0, 126, - 0, 1, 76, 0, 14, 112, 111, 115, 105, 116, 105, 118, 101, 80, 114, 101, 102, 105, 120, 113, - 0, 126, 0, 1, 76, 0, 14, 112, 111, 115, 105, 116, 105, 118, 101, 83, 117, 102, 102, 105, - 120, 113, 0, 126, 0, 1, 76, 0, 17, 114, 111, 117, 110, 100, 105, 110, 103, 73, 110, 99, - 114, 101, 109, 101, 110, 116, 116, 0, 22, 76, 106, 97, 118, 97, 47, 109, 97, 116, 104, 47, - 66, 105, 103, 68, 101, 99, 105, 109, 97, 108, 59, 76, 0, 7, 115, 121, 109, 98, 111, 108, - 115, 116, 0, 35, 76, 99, 111, 109, 47, 105, 98, 109, 47, 116, 101, 120, 116, 47, 68, 101, - 99, 105, 109, 97, 108, 70, 111, 114, 109, 97, 116, 83, 121, 109, 98, 111, 108, 115, 59, 120, - 114, 0, 25, 99, 111, 109, 46, 105, 98, 109, 46, 116, 101, 120, 116, 46, 78, 117, 109, 98, - 101, 114, 70, 111, 114, 109, 97, 116, -33, -10, -77, -65, 19, 125, 7, -24, 3, 0, 11, 90, - 0, 12, 103, 114, 111, 117, 112, 105, 110, 103, 85, 115, 101, 100, 66, 0, 17, 109, 97, 120, - 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, 105, 116, 115, 66, 0, 16, 109, 97, 120, - 73, 110, 116, 101, 103, 101, 114, 68, 105, 103, 105, 116, 115, 73, 0, 21, 109, 97, 120, 105, - 109, 117, 109, 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, 105, 116, 115, 73, 0, 20, - 109, 97, 120, 105, 109, 117, 109, 73, 110, 116, 101, 103, 101, 114, 68, 105, 103, 105, 116, 115, - 66, 0, 17, 109, 105, 110, 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, 105, 116, 115, - 66, 0, 16, 109, 105, 110, 73, 110, 116, 101, 103, 101, 114, 68, 105, 103, 105, 116, 115, 73, - 0, 21, 109, 105, 110, 105, 109, 117, 109, 70, 114, 97, 99, 116, 105, 111, 110, 68, 105, 103, - 105, 116, 115, 73, 0, 20, 109, 105, 110, 105, 109, 117, 109, 73, 110, 116, 101, 103, 101, 114, - 68, 105, 103, 105, 116, 115, 90, 0, 16, 112, 97, 114, 115, 101, 73, 110, 116, 101, 103, 101, - 114, 79, 110, 108, 121, 73, 0, 21, 115, 101, 114, 105, 97, 108, 86, 101, 114, 115, 105, 111, - 110, 79, 110, 83, 116, 114, 101, 97, 109, 120, 114, 0, 16, 106, 97, 118, 97, 46, 116, 101, - 120, 116, 46, 70, 111, 114, 109, 97, 116, -5, -40, -68, 18, -23, 15, 24, 67, 2, 0, 0, - 120, 112, 0, 6, 1, 0, 0, 0, 6, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, 0, 1, 120, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, - 0, 1, 0, 32, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 2, 1, 116, 0, 1, - 45, 116, 0, 0, 116, 0, 0, 113, 0, 126, 0, 8, 112, 115, 114, 0, 33, 99, 111, 109, - 46, 105, 98, 109, 46, 116, 101, 120, 116, 46, 68, 101, 99, 105, 109, 97, 108, 70, 111, 114, - 109, 97, 116, 83, 121, 109, 98, 111, 108, 115, 80, 29, 23, -103, 8, 104, -109, -100, 2, 0, - 18, 67, 0, 16, 100, 101, 99, 105, 109, 97, 108, 83, 101, 112, 97, 114, 97, 116, 111, 114, - 67, 0, 5, 100, 105, 103, 105, 116, 67, 0, 11, 101, 120, 112, 111, 110, 101, 110, 116, 105, - 97, 108, 67, 0, 17, 103, 114, 111, 117, 112, 105, 110, 103, 83, 101, 112, 97, 114, 97, 116, - 111, 114, 67, 0, 9, 109, 105, 110, 117, 115, 83, 105, 103, 110, 67, 0, 17, 109, 111, 110, - 101, 116, 97, 114, 121, 83, 101, 112, 97, 114, 97, 116, 111, 114, 67, 0, 9, 112, 97, 100, - 69, 115, 99, 97, 112, 101, 67, 0, 16, 112, 97, 116, 116, 101, 114, 110, 83, 101, 112, 97, - 114, 97, 116, 111, 114, 67, 0, 7, 112, 101, 114, 77, 105, 108, 108, 67, 0, 7, 112, 101, - 114, 99, 101, 110, 116, 67, 0, 8, 112, 108, 117, 115, 83, 105, 103, 110, 73, 0, 21, 115, - 101, 114, 105, 97, 108, 86, 101, 114, 115, 105, 111, 110, 79, 110, 83, 116, 114, 101, 97, 109, - 67, 0, 9, 122, 101, 114, 111, 68, 105, 103, 105, 116, 76, 0, 3, 78, 97, 78, 113, 0, - 126, 0, 1, 76, 0, 14, 99, 117, 114, 114, 101, 110, 99, 121, 83, 121, 109, 98, 111, 108, - 113, 0, 126, 0, 1, 76, 0, 17, 101, 120, 112, 111, 110, 101, 110, 116, 83, 101, 112, 97, - 114, 97, 116, 111, 114, 113, 0, 126, 0, 1, 76, 0, 8, 105, 110, 102, 105, 110, 105, 116, - 121, 113, 0, 126, 0, 1, 76, 0, 18, 105, 110, 116, 108, 67, 117, 114, 114, 101, 110, 99, - 121, 83, 121, 109, 98, 111, 108, 113, 0, 126, 0, 1, 120, 112, 0, 46, 0, 35, 0, 0, - 0, 44, 0, 45, 0, 46, 0, 42, 0, 59, 32, 48, 0, 37, 0, 43, 0, 0, 0, 2, - 0, 48, 116, 0, 3, -17, -65, -67, 116, 0, 1, 36, 116, 0, 1, 69, 116, 0, 3, -30, - -120, -98, 116, 0, 3, 85, 83, 68}; - - //content - final static byte[][] content = {generalInstance, currencyInstance, percentInstance, scientificInstance}; -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/icu/test/format/NumberFormatTest.java b/icu4j/src/com/ibm/icu/test/format/NumberFormatTest.java deleted file mode 100755 index f4a23bfaa2..0000000000 --- a/icu4j/src/com/ibm/icu/test/format/NumberFormatTest.java +++ /dev/null @@ -1,695 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/format/Attic/NumberFormatTest.java,v $ - * $Date: 2001/10/23 13:14:40 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -/** - * Port From: ICU4C v1.8.1 : format : NumberFormatTest - * Source File: $ICU4CRoot/source/test/intltest/numfmtst.cpp - **/ - -package com.ibm.icu.test.format; - -import com.ibm.text.*; -import com.ibm.util.*; -import java.util.Locale; -import java.text.ParsePosition; -import java.text.ParseException; -import java.text.FieldPosition; - -public class NumberFormatTest extends com.ibm.test.TestFmwk { - - public static void main(String[] args) throws Exception { - new NumberFormatTest().run(args); - } - - // Test various patterns - public void TestPatterns() { - - DecimalFormatSymbols sym = new DecimalFormatSymbols(Locale.US); - final String pat[] = { "#.#", "#.", ".#", "#" }; - int pat_length = pat.length; - final String newpat[] = { "#0.#", "#0.", "#.0", "#" }; - final String num[] = { "0", "0.", ".0", "0" }; - for (int i=0; i \"" + fmt.toPattern() + "\""); - int v; - for (v = 0; v < val_length; ++v) { - String s; - s = ((NumberFormat) fmt).format(val[v]); - logln(" " + val[v] + " -format-> " + s); - if (!s.equals(valFormat[v + ival])) - errln("FAIL: Expected " + valFormat[v + ival]); - - ParsePosition pos = new ParsePosition(0); - double a = fmt.parse(s, pos).doubleValue(); - if (pos.getIndex() == s.length()) { - logln(" -parse-> " + Double.toString(a)); - // Use epsilon comparison as necessary - } else - errln("FAIL: Partial parse (" + pos.getIndex() + " chars) -> " + a); - } - for (v = 0; v < lval_length; ++v) { - String s; - s = ((NumberFormat) fmt).format(lval[v]); - logln(" " + lval[v] + "L -format-> " + s); - if (!s.equals(lvalFormat[v + ilval])) - errln("ERROR: Expected " + lvalFormat[v + ilval] + " Got: " + s); - - ParsePosition pos = new ParsePosition(0); - long a = 0; - Number A = fmt.parse(s, pos); - if (A != null) { - a = A.longValue(); - if (pos.getIndex() == s.length()) { - logln(" -parse-> " + a); - if (a != lvalParse[v + ilval]) - errln("FAIL: Expected " + lvalParse[v + ilval]); - } else - errln("FAIL: Partial parse (" + pos.getIndex() + " chars) -> " + Long.toString(a)); - } else { - errln("Fail to parse the string: " + s); - } - } - ival += val_length; - ilval += lval_length; - } - } - - // Test the handling of quotes - public void TestQuotes() { - - StringBuffer pat; - DecimalFormatSymbols sym = new DecimalFormatSymbols(Locale.US); - pat = new StringBuffer("a'fo''o'b#"); - DecimalFormat fmt = new DecimalFormat(pat.toString(), sym); - String s = ((NumberFormat)fmt).format(123); - logln("Pattern \"" + pat + "\""); - logln(" Format 123 . " + s); - if (!s.equals("afo'ob123")) - errln("FAIL: Expected afo'ob123"); - - s =""; - pat = new StringBuffer("a''b#"); - fmt = new DecimalFormat(pat.toString(), sym); - s = ((NumberFormat)fmt).format(123); - logln("Pattern \"" + pat + "\""); - logln(" Format 123 . " + s); - if (!s.equals("a'b123")) - errln("FAIL: Expected a'b123"); - } - - /** - * Test the handling of the currency symbol in patterns. - **/ - public void TestCurrencySign() { - DecimalFormatSymbols sym = new DecimalFormatSymbols(Locale.US); - StringBuffer pat = new StringBuffer(""); - char currency = 0x00A4; - // "\xA4#,##0.00;-\xA4#,##0.00" - pat.append(currency).append("#,##0.00;-").append(currency).append("#,##0.00"); - DecimalFormat fmt = new DecimalFormat(pat.toString(), sym); - String s = ((NumberFormat) fmt).format(1234.56); - pat = new StringBuffer(""); - logln("Pattern \"" + fmt.toPattern() + "\""); - logln(" Format " + 1234.56 + " . " + s); - if (!s.equals("$1,234.56")) - errln("FAIL: Expected $1,234.56"); - s = ""; - s = ((NumberFormat) fmt).format(-1234.56); - logln(" Format " + Double.toString(-1234.56) + " . " + s); - if (!s.equals("-$1,234.56")) - errln("FAIL: Expected -$1,234.56"); - - pat = new StringBuffer(""); - // "\xA4\xA4 #,##0.00;\xA4\xA4 -#,##0.00" - pat.append(currency).append(currency).append(" #,##0.00;").append(currency).append(currency).append(" -#,##0.00"); - fmt = new DecimalFormat(pat.toString(), sym); - s = ""; - s = ((NumberFormat) fmt).format(1234.56); - logln("Pattern \"" + fmt.toPattern() + "\""); - logln(" Format " + Double.toString(1234.56) + " . " + s); - - if (!s.equals("USD 1,234.56")) - errln("FAIL: Expected USD 1,234.56"); - s = ""; - s = ((NumberFormat) fmt).format(-1234.56); - logln(" Format " + Double.toString(-1234.56) + " . " + s); - if (!s.equals("USD -1,234.56")) - errln("FAIL: Expected USD -1,234.56"); - - } - - /** - * Test localized currency patterns. - */ - public void TestCurrency() { - NumberFormat currencyFmt = - NumberFormat.getCurrencyInstance(Locale.CANADA_FRENCH); - - String s; - s = currencyFmt.format(1.50); - logln("Un pauvre ici a..........." + s); - - if (!s.equals("1,50 $")) - errln("FAIL: Expected 1,50 $"); - s = ""; - currencyFmt = NumberFormat.getCurrencyInstance(Locale.GERMANY); - s = currencyFmt.format(1.50); - logln("Un pauvre en Allemagne a.." + s); - if (!s.equals("1,50 DM")) - errln("FAIL: Expected 1,50 DM"); - s = ""; - currencyFmt = NumberFormat.getCurrencyInstance(Locale.FRANCE); - s = currencyFmt.format(1.50); - logln("Un pauvre en France a....." + s); - if (!s.equals("1,50 F")) - errln("FAIL: Expected 1,50 F"); - - } - - /** - * Do rudimentary testing of parsing. - */ - public void TestParse() { - String arg = "0.0"; - DecimalFormat format = new DecimalFormat("00"); - double aNumber = 0l; - try { - aNumber = format.parse(arg).doubleValue(); - } catch (java.text.ParseException e) { - System.out.println(e); - } - logln("parse(" + arg + ") = " + aNumber); - } - - /** - * Test proper rounding by the format method. - */ - public void TestRounding487() { - - NumberFormat nf = NumberFormat.getInstance(); - roundingTest(nf, 0.00159999, 4, "0.0016"); - roundingTest(nf, 0.00995, 4, "0.01"); - - roundingTest(nf, 12.3995, 3, "12.4"); - - roundingTest(nf, 12.4999, 0, "12"); - roundingTest(nf, - 19.5, 0, "-20"); - - } - - /** - * Test the functioning of the secondary grouping value. - */ - public void TestSecondaryGrouping() { - - DecimalFormatSymbols US = new DecimalFormatSymbols(Locale.US); - DecimalFormat f = new DecimalFormat("#,##,###", US); - - expect(f, 123456789L, "12,34,56,789"); - expectPat(f, "#,##,###"); - f.applyPattern("#,###"); - - f.setSecondaryGroupingSize(4); - expect(f, 123456789L, "12,3456,789"); - expectPat(f, "#,####,###"); - NumberFormat g = NumberFormat.getInstance(new Locale("hi", "IN")); - - String out = ""; - long l = 1876543210L; - out = g.format(l); - - // expect "1,87,65,43,210", but with Hindi digits - // 01234567890123 - boolean ok = true; - if (out.length() != 14) { - ok = false; - } else { - for (int i = 0; i < out.length(); ++i) { - boolean expectGroup = false; - switch (i) { - case 1 : - case 4 : - case 7 : - case 10 : - expectGroup = true; - break; - } - // Later -- fix this to get the actual grouping - // character from the resource bundle. - boolean isGroup = (out.charAt(i) == 0x002C); - if (isGroup != expectGroup) { - ok = false; - break; - } - } - } - if (!ok) { - errln("FAIL Expected "+ l + " x hi_IN . \"1,87,65,43,210\" (with Hindi digits), got \"" - + out + "\""); - } else { - logln("Ok " + l + " x hi_IN . \"" + out + "\""); - } - } - - public void roundingTest(NumberFormat nf, double x, int maxFractionDigits, final String expected) { - nf.setMaximumFractionDigits(maxFractionDigits); - String out = nf.format(x); - logln(x + " formats with " + maxFractionDigits + " fractional digits to " + out); - if (!out.equals(expected)) - errln("FAIL: Expected " + expected); - } - - /** - * Upgrade to alphaWorks - */ - public void expect(NumberFormat fmt, String str, int n) { - Long num = new Long(0); - try { - num = (Long)fmt.parse(str); - } catch (java.text.ParseException e) { - logln(e.getMessage()); - } - String pat = ((DecimalFormat)fmt).toPattern(); - if (num.longValue() == n) { - logln("Ok \"" + str + "\" x " + - pat + " = " + - num.toString()); - } else { - errln("FAIL \"" + str + "\" x " + - pat + " = " + - num.toString() + ", expected " + n + "L"); - } - } - - /** - * Upgrade to alphaWorks - */ - public void expect(NumberFormat fmt, final double n, final String exp) { - StringBuffer saw = new StringBuffer(""); - FieldPosition pos = new FieldPosition(0); - saw = fmt.format(n, saw, pos); - String pat = ((DecimalFormat)fmt).toPattern(); - if (saw.toString().equals(exp)) { - logln("Ok " + Double.toString(n) + " x " + - pat + " = \"" + - saw + "\""); - } else { - errln("FAIL " + Double.toString(n) + " x " + - pat + " = \"" + - saw + "\", expected \"" + exp + "\""); - } - } - - /** - * Upgrade to alphaWorks - */ - public void TestExponent() { - DecimalFormatSymbols US = new DecimalFormatSymbols(Locale.US); - DecimalFormat fmt1 = new DecimalFormat("0.###E0", US); - DecimalFormat fmt2 = new DecimalFormat("0.###E+0", US); - int n = 1234; - expect(fmt1, n, "1.234E3"); - expect(fmt2, n, "1.234E+3"); - expect(fmt1, "1.234E3", n); - expect(fmt1, "1.234E+3", n); // Either format should parse "E+3" - expect(fmt2, "1.234E+3", n); - } - - /** - * Upgrade to alphaWorks - */ - public void TestScientific() { - - DecimalFormatSymbols US = new DecimalFormatSymbols(Locale.US); - - // Test pattern round-trip - final String PAT[] = { "#E0", "0.####E0", "00.000E00", "##0.####E000", "0.###E0;[0.###E0]" }; - int PAT_length = PAT.length; - int DIGITS[] = { - // min int, max int, min frac, max frac - 0, 1, 0, 0, // "#E0" - 1, 1, 0, 4, // "0.####E0" - 2, 2, 3, 3, // "00.000E00" - 1, 3, 0, 4, // "##0.####E000" - 1, 1, 0, 3, // "0.###E0;[0.###E0]" - }; - for (int i = 0; i < PAT_length; ++i) { - String pat = PAT[i]; - DecimalFormat df = new DecimalFormat(pat, US); - String pat2 = df.toPattern(); - if (pat.equals(pat2)) { - logln("Ok Pattern rt \"" + pat + "\" . \"" + pat2 + "\""); - } else { - errln("FAIL Pattern rt \"" + pat + "\" . \"" + pat2 + "\""); - } - // Make sure digit counts match what we expect - if (df.getMinimumIntegerDigits() != DIGITS[4 * i] - || df.getMaximumIntegerDigits() != DIGITS[4 * i + 1] - || df.getMinimumFractionDigits() != DIGITS[4 * i + 2] - || df.getMaximumFractionDigits() != DIGITS[4 * i + 3]) { - errln("FAIL \""+ pat+ "\" min/max int; min/max frac = " - + df.getMinimumIntegerDigits() + "/" - + df.getMaximumIntegerDigits() + ";" - + df.getMinimumFractionDigits() + "/" - + df.getMaximumFractionDigits() + ", expect " - + DIGITS[4 * i] + "/" - + DIGITS[4 * i + 1] + ";" - + DIGITS[4 * i + 2] + "/" - + DIGITS[4 * i + 3]); - } - } - - expect(new DecimalFormat("#E0", US), 12345.0, "1.2345E4"); - expect(new DecimalFormat("0E0", US), 12345.0, "1E4"); - - // pattern of NumberFormat.getScientificInstance(Locale.US) = "0.######E0" not "#E0" - // so result = 1.234568E4 not 1.2345678901E4 - //when the pattern problem is finalized, delete comment mark'//' - //of the following code - expect(NumberFormat.getScientificInstance(Locale.US), 12345.678901, "1.2345678901E4"); - - expect(new DecimalFormat("##0.###E0", US), 12345.0, "12.34E3"); - expect(new DecimalFormat("##0.###E0", US), 12345.00001, "12.35E3"); - expect(new DecimalFormat("##0.####E0", US), 12345, "12.345E3"); - - // pattern of NumberFormat.getScientificInstance(Locale.US) = "0.######E0" not "#E0" - // so result = 1.234568E4 not 1.2345678901E4 - expect(NumberFormat.getScientificInstance(Locale.FRANCE), 12345.678901, "1,2345678901E4"); - - expect(new DecimalFormat("##0.####E0", US), 789.12345e-9, "789.12E-9"); - expect(new DecimalFormat("##0.####E0", US), 780.e-9, "780E-9"); - expect(new DecimalFormat(".###E0", US), 45678.0, ".457E5"); - expect(new DecimalFormat(".###E0", US), 0, ".0E0"); - /* - expect(new DecimalFormat[] { new DecimalFormat("#E0", US), - new DecimalFormat("##E0", US), - new DecimalFormat("####E0", US), - new DecimalFormat("0E0", US), - new DecimalFormat("00E0", US), - new DecimalFormat("000E0", US), - }, - new Long(45678000), - new String[] { "4.5678E7", - "45.678E6", - "4567.8E4", - "5E7", - "46E6", - "457E5", - } - ); - ! - ! Unroll this test into individual tests below... - ! - */ - expect(new DecimalFormat("#E0", US), 45678000, "4.5678E7"); - expect(new DecimalFormat("##E0", US), 45678000, "45.678E6"); - expect(new DecimalFormat("####E0", US), 45678000, "4567.8E4"); - expect(new DecimalFormat("0E0", US), 45678000, "5E7"); - expect(new DecimalFormat("00E0", US), 45678000, "46E6"); - expect(new DecimalFormat("000E0", US), 45678000, "457E5"); - /* - expect(new DecimalFormat("###E0", US, status), - new Object[] { new Double(0.0000123), "12.3E-6", - new Double(0.000123), "123E-6", - new Double(0.00123), "1.23E-3", - new Double(0.0123), "12.3E-3", - new Double(0.123), "123E-3", - new Double(1.23), "1.23E0", - new Double(12.3), "12.3E0", - new Double(123), "123E0", - new Double(1230), "1.23E3", - }); - ! - ! Unroll this test into individual tests below... - ! - */ - expect(new DecimalFormat("###E0", US), 0.0000123, "12.3E-6"); - expect(new DecimalFormat("###E0", US), 0.000123, "123E-6"); - expect(new DecimalFormat("###E0", US), 0.00123, "1.23E-3"); - expect(new DecimalFormat("###E0", US), 0.0123, "12.3E-3"); - expect(new DecimalFormat("###E0", US), 0.123, "123E-3"); - expect(new DecimalFormat("###E0", US), 1.23, "1.23E0"); - expect(new DecimalFormat("###E0", US), 12.3, "12.3E0"); - expect(new DecimalFormat("###E0", US), 123.0, "123E0"); - expect(new DecimalFormat("###E0", US), 1230.0, "1.23E3"); - /* - expect(new DecimalFormat("0.#E+00", US, status), - new Object[] { new Double(0.00012), "1.2E-04", - new Long(12000), "1.2E+04", - }); - ! - ! Unroll this test into individual tests below... - ! - */ - expect(new DecimalFormat("0.#E+00", US), 0.00012, "1.2E-04"); - expect(new DecimalFormat("0.#E+00", US), 12000, "1.2E+04"); - } - - /** - * Upgrade to alphaWorks - */ - public void TestPad() { - - DecimalFormatSymbols US = new DecimalFormatSymbols(Locale.US); - expect(new DecimalFormat("*^##.##", US), 0, "^^^^0"); - expect(new DecimalFormat("*^##.##", US), -1.3, "^-1.3"); - expect( - new DecimalFormat("##0.0####E0*_ g-m/s^2", US), - 0, - "0.0E0______ g-m/s^2"); - expect( - new DecimalFormat("##0.0####E0*_ g-m/s^2", US), - 1.0 / 3, - "333.333E-3_ g-m/s^2"); - expect(new DecimalFormat("##0.0####*_ g-m/s^2", US), 0, "0.0______ g-m/s^2"); - expect( - new DecimalFormat("##0.0####*_ g-m/s^2", US), - 1.0 / 3, - "0.33333__ g-m/s^2"); - - // Test padding before a sign - final String formatStr = "*x#,###,###,##0.0#;*x(###,###,##0.0#)"; - expect(new DecimalFormat(formatStr, US), -10, "xxxxxxxxxx(10.0)"); - expect(new DecimalFormat(formatStr, US), -1000, "xxxxxxx(1,000.0)"); - expect(new DecimalFormat(formatStr, US), -1000000, "xxx(1,000,000.0)"); - expect(new DecimalFormat(formatStr, US), -100.37, "xxxxxxxx(100.37)"); - expect(new DecimalFormat(formatStr, US), -10456.37, "xxxxx(10,456.37)"); - expect(new DecimalFormat(formatStr, US), -1120456.37, "xx(1,120,456.37)"); - expect(new DecimalFormat(formatStr, US), -112045600.37, "(112,045,600.37)"); - expect(new DecimalFormat(formatStr, US), -1252045600.37, "(1,252,045,600.37)"); - - expect(new DecimalFormat(formatStr, US), 10, "xxxxxxxxxxxx10.0"); - expect(new DecimalFormat(formatStr, US), 1000, "xxxxxxxxx1,000.0"); - expect(new DecimalFormat(formatStr, US), 1000000, "xxxxx1,000,000.0"); - expect(new DecimalFormat(formatStr, US), 100.37, "xxxxxxxxxx100.37"); - expect(new DecimalFormat(formatStr, US), 10456.37, "xxxxxxx10,456.37"); - expect(new DecimalFormat(formatStr, US), 1120456.37, "xxxx1,120,456.37"); - expect(new DecimalFormat(formatStr, US), 112045600.37, "xx112,045,600.37"); - expect(new DecimalFormat(formatStr, US), 10252045600.37, "10,252,045,600.37"); - - // Test padding between a sign and a number - final String formatStr2 = "#,###,###,##0.0#*x;(###,###,##0.0#*x)"; - expect(new DecimalFormat(formatStr2, US), -10, "(10.0xxxxxxxxxx)"); - expect(new DecimalFormat(formatStr2, US), -1000, "(1,000.0xxxxxxx)"); - expect(new DecimalFormat(formatStr2, US), -1000000, "(1,000,000.0xxx)"); - expect(new DecimalFormat(formatStr2, US), -100.37, "(100.37xxxxxxxx)"); - expect(new DecimalFormat(formatStr2, US), -10456.37, "(10,456.37xxxxx)"); - expect(new DecimalFormat(formatStr2, US), -1120456.37, "(1,120,456.37xx)"); - expect(new DecimalFormat(formatStr2, US), -112045600.37, "(112,045,600.37)"); - expect(new DecimalFormat(formatStr2, US), -1252045600.37, "(1,252,045,600.37)"); - - expect(new DecimalFormat(formatStr2, US), 10, "10.0xxxxxxxxxxxx"); - expect(new DecimalFormat(formatStr2, US), 1000, "1,000.0xxxxxxxxx"); - expect(new DecimalFormat(formatStr2, US), 1000000, "1,000,000.0xxxxx"); - expect(new DecimalFormat(formatStr2, US), 100.37, "100.37xxxxxxxxxx"); - expect(new DecimalFormat(formatStr2, US), 10456.37, "10,456.37xxxxxxx"); - expect(new DecimalFormat(formatStr2, US), 1120456.37, "1,120,456.37xxxx"); - expect(new DecimalFormat(formatStr2, US), 112045600.37, "112,045,600.37xx"); - expect(new DecimalFormat(formatStr2, US), 10252045600.37, "10,252,045,600.37"); - - //testing the setPadCharacter(UnicodeString) and getPadCharacterString() - DecimalFormat fmt = new DecimalFormat("#", US); - char padString = 'P'; - fmt.setPadCharacter(padString); - expectPad(fmt, "*P##.##", DecimalFormat.PAD_BEFORE_PREFIX, 5, padString); - fmt.setPadCharacter('^'); - expectPad(fmt, "*^#", DecimalFormat.PAD_BEFORE_PREFIX, 1, '^'); - //commented untill implementation is complete - /* fmt.setPadCharacter((UnicodeString)"^^^"); - expectPad(fmt, "*^^^#", DecimalFormat.kPadBeforePrefix, 3, (UnicodeString)"^^^"); - padString.remove(); - padString.append((UChar)0x0061); - padString.append((UChar)0x0302); - fmt.setPadCharacter(padString); - UChar patternChars[]={0x002a, 0x0061, 0x0302, 0x0061, 0x0302, 0x0023, 0x0000}; - UnicodeString pattern(patternChars); - expectPad(fmt, pattern , DecimalFormat.kPadBeforePrefix, 4, padString); - */ - } - - /** - * Upgrade to alphaWorks - */ - public void TestPatterns2() { - DecimalFormatSymbols US = new DecimalFormatSymbols(Locale.US); - DecimalFormat fmt = new DecimalFormat("#", US); - - char hat = 0x005E; /*^*/ - - expectPad(fmt, "*^#", DecimalFormat.PAD_BEFORE_PREFIX, 1, hat); - expectPad(fmt, "$*^#", DecimalFormat.PAD_AFTER_PREFIX, 2, hat); - expectPad(fmt, "#*^", DecimalFormat.PAD_BEFORE_SUFFIX, 1, hat); - expectPad(fmt, "#$*^", DecimalFormat.PAD_AFTER_SUFFIX, 2, hat); - expectPad(fmt, "$*^$#", -1); - expectPad(fmt, "#$*^$", -1); - expectPad(fmt, "'pre'#,##0*x'post'", DecimalFormat.PAD_BEFORE_SUFFIX, 12, (char) 0x0078 /*x*/); - expectPad(fmt, "''#0*x", DecimalFormat.PAD_BEFORE_SUFFIX, 3, (char) 0x0078 /*x*/); - expectPad(fmt, "'I''ll'*a###.##", DecimalFormat.PAD_AFTER_PREFIX, 10, (char) 0x0061 /*a*/); - - fmt.applyPattern("AA#,##0.00ZZ"); - fmt.setPadCharacter(hat); - - fmt.setFormatWidth(10); - - fmt.setPadPosition(DecimalFormat.PAD_BEFORE_PREFIX); - expectPat(fmt, "*^AA#,##0.00ZZ"); - - fmt.setPadPosition(DecimalFormat.PAD_BEFORE_SUFFIX); - expectPat(fmt, "AA#,##0.00*^ZZ"); - - fmt.setPadPosition(DecimalFormat.PAD_AFTER_SUFFIX); - expectPat(fmt, "AA#,##0.00ZZ*^"); - - // 12 3456789012 - String exp = "AA*^#,##0.00ZZ"; - fmt.setFormatWidth(12); - fmt.setPadPosition(DecimalFormat.PAD_AFTER_PREFIX); - expectPat(fmt, exp); - - fmt.setFormatWidth(13); - // 12 34567890123 - expectPat(fmt, "AA*^##,##0.00ZZ"); - - fmt.setFormatWidth(14); - // 12 345678901234 - expectPat(fmt, "AA*^###,##0.00ZZ"); - - fmt.setFormatWidth(15); - // 12 3456789012345 - expectPat(fmt, "AA*^####,##0.00ZZ"); // This is the interesting case - - fmt.setFormatWidth(16); - // 12 34567890123456 - expectPat(fmt, "AA*^#,###,##0.00ZZ"); - } - - public void expectPad(DecimalFormat fmt, String pat, int pos) { - expectPad(fmt, pat, pos, 0, (char)0); - } - - public void expectPad(DecimalFormat fmt, final String pat, int pos, int width, final char pad) { - int apos = 0, awidth = 0; - char apadStr; - try { - fmt.applyPattern(pat); - apos = fmt.getPadPosition(); - awidth = fmt.getFormatWidth(); - apadStr = fmt.getPadCharacter(); - } catch (Exception e) { - apos = -1; - awidth = width; - apadStr = pad; - } - - if (apos == pos && awidth == width && apadStr == pad) { - logln("Ok \"" + pat + "\" pos=" - + apos + ((pos == -1) ? "" : " width=" + awidth + " pad=" + apadStr)); - } else { - errln("FAIL \"" + pat + "\" pos=" + apos + " width=" - + awidth + " pad=" + apadStr + ", expected " - + pos + " " + width + " " + pad); - } - } - - public void expectPat(DecimalFormat fmt, final String exp) { - String pat = fmt.toPattern(); - if (pat.equals(exp)) { - logln("Ok \"" + pat + "\""); - } else { - errln("FAIL \"" + pat + "\", expected \"" + exp + "\""); - } - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/icu/test/format/NumberRegression.java b/icu4j/src/com/ibm/icu/test/format/NumberRegression.java deleted file mode 100755 index 32977d8c5d..0000000000 --- a/icu4j/src/com/ibm/icu/test/format/NumberRegression.java +++ /dev/null @@ -1,1749 +0,0 @@ -/***************************************************************************************** - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/format/Attic/NumberRegression.java,v $ - * $Date: 2001/10/25 06:37:15 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - **/ - -/** - * Port From: JDK 1.4b1 : java.text.Format.NumberRegression - * Source File: java/text/format/NumberRegression.java - **/ - -/** - * @test 1.49 01/05/21 - * @bug 4052223 4059870 4061302 4062486 4066646 4068693 4070798 4071005 4071014 - * 4071492 4071859 4074454 4074620 4075713 4083018 4086575 4087244 4087245 - * 4087251 4087535 4088161 4088503 4090489 4090504 4092480 4092561 4095713 - * 4098741 4099404 4101481 4106658 4106662 4106664 4108738 4110936 4122840 - * 4125885 4134034 4134300 4140009 4141750 4145457 4147295 4147706 4162198 - * 4162852 4167494 4170798 4176114 4179818 4185761 4212072 4212073 4216742 - * 4217661 4243011 4243108 4330377 4233840 - * @summary Regression tests for NumberFormat and associated classes - */ - -/* -(C) Copyright Taligent, Inc. 1996 - All Rights Reserved -(C) Copyright IBM Corp. 1996, 2001 - All Rights Reserved - - The original version of this source code and documentation is copyrighted and -owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These materials are -provided under terms of a License Agreement between Taligent and Sun. This -technology is protected by multiple US and International patents. This notice and -attribution to Taligent may not be removed. - Taligent is a registered trademark of Taligent, Inc. -*/ - -package com.ibm.icu.test.format; - -import com.ibm.text.*; -import com.ibm.util.*; -import java.math.BigDecimal; -import java.io.*; -import java.math.BigInteger; -import java.text.ParsePosition; -import java.util.Locale; -import java.text.FieldPosition; -import java.text.ParseException; -import java.util.Date; -import java.util.ResourceBundle; - -public class NumberRegression extends com.ibm.test.TestFmwk { - - public static void main(String[] args) throws Exception { - new NumberRegression().run(args); - } - - /** - * NumberFormat.equals comparing with null should always return false. - */ - public void Test4075713(){ - - try { - MyNumberFormatTest tmp = new MyNumberFormatTest(); - if (!tmp.equals(null)) - logln("NumberFormat.equals passed"); - } catch (NullPointerException e) { - errln("(new MyNumberFormatTest()).equals(null) throws unexpected exception"); - } - } - - /** - * NumberFormat.equals comparing two obj equal even the setGroupingUsed - * flag is different. - */ - public void Test4074620() { - - MyNumberFormatTest nf1 = new MyNumberFormatTest(); - MyNumberFormatTest nf2 = new MyNumberFormatTest(); - - nf1.setGroupingUsed(false); - nf2.setGroupingUsed(true); - - if (nf1.equals(nf2)) errln("Test for bug 4074620 failed"); - else logln("Test for bug 4074620 passed."); - return; - } - - - /** - * DecimalFormat.format() incorrectly uses maxFractionDigits setting. - */ - - public void Test4088161 (){ - DecimalFormat df = new DecimalFormat(); - double d = 100; - df.setMinimumFractionDigits(0); - df.setMaximumFractionDigits(16); - StringBuffer sBuf1 = new StringBuffer(""); - FieldPosition fp1 = new FieldPosition(0); - logln("d = " + d); - logln("maxFractionDigits = " + df.getMaximumFractionDigits()); - logln(" format(d) = '" + df.format(d, sBuf1, fp1) + "'"); - df.setMaximumFractionDigits(17); - StringBuffer sBuf2 = new StringBuffer(""); - FieldPosition fp2 = new FieldPosition(0); - logln("maxFractionDigits = " + df.getMaximumFractionDigits()); - df.format(d, sBuf2, fp2); - if (!sBuf2.toString().equals("100")) - errln(" format(d) = '" + sBuf2 + "'"); - } - /** - * DecimalFormatSymbols should be cloned in the ctor DecimalFormat. - * DecimalFormat(String, DecimalFormatSymbols). - */ - public void Test4087245 (){ - DecimalFormatSymbols symbols = new DecimalFormatSymbols(); - DecimalFormat df = new DecimalFormat("#,##0.0", symbols); - long n = 123; - StringBuffer buf1 = new StringBuffer(); - StringBuffer buf2 = new StringBuffer(); - logln("format(" + n + ") = " + - df.format(n, buf1, new FieldPosition(0))); - symbols.setDecimalSeparator('p'); // change value of field - logln("format(" + n + ") = " + - df.format(n, buf2, new FieldPosition(0))); - if (!buf1.toString().equals(buf2.toString())) - errln("Test for bug 4087245 failed"); - } - /** - * DecimalFormat.format() incorrectly formats 0.0 - */ - public void Test4087535 () - { - DecimalFormat df = new DecimalFormat(); - df.setMinimumIntegerDigits(0); - - double n = 0; - String buffer = new String(); - buffer = df.format(n); - if (buffer.length() == 0) - errln(n + ": '" + buffer + "'"); - n = 0.1; - buffer = df.format(n); - if (buffer.length() == 0) - errln(n + ": '" + buffer + "'"); - } - - /** - * DecimalFormat.format fails when groupingSize is set to 0. - */ - public void Test4088503 (){ - DecimalFormat df = new DecimalFormat(); - df.setGroupingSize(0); - StringBuffer sBuf = new StringBuffer(""); - FieldPosition fp = new FieldPosition(0); - try { - logln(df.format(123, sBuf, fp).toString()); - } catch (Exception foo) { - errln("Test for bug 4088503 failed."); - } - - } - /** - * NumberFormat.getCurrencyInstance is wrong. - */ - public void Test4066646 () { - //float returnfloat = 0.0f; //The variable is never used - assignFloatValue(2.04f); - assignFloatValue(2.03f); - assignFloatValue(2.02f); - assignFloatValue(0.0f); - } - - public float assignFloatValue(float returnfloat) - { - logln(" VALUE " + returnfloat); - NumberFormat nfcommon = NumberFormat.getCurrencyInstance(Locale.US); - nfcommon.setGroupingUsed(false); - - String stringValue = nfcommon.format(returnfloat).substring(1); - if (Float.valueOf(stringValue).floatValue() != returnfloat) - errln(" DISPLAYVALUE " + stringValue); - return returnfloat; - } // End Of assignFloatValue() - - /** - * DecimalFormat throws exception when parsing "0" - */ - public void Test4059870() { - DecimalFormat format = new DecimalFormat("00"); - try { - logln(format.parse("0").toString()); - } catch (Exception e) { errln("Test for bug 4059870 failed : " + e); } - } - /** - * DecimalFormatSymbol.equals should always return false when - * comparing with null. - */ - - public void Test4083018 (){ - DecimalFormatSymbols dfs = new DecimalFormatSymbols(); - try { - if (!dfs.equals(null)) - logln("Test Passed!"); - } catch (Exception foo) { - errln("Test for bug 4083018 failed => Message : " + foo.getMessage()); - } - } - /** - * DecimalFormat does not round up correctly. - */ - public void Test4071492 (){ - double x = 0.00159999; - NumberFormat nf = NumberFormat.getInstance(); - nf.setMaximumFractionDigits(4); - String out = nf.format(x); - logln("0.00159999 formats with 4 fractional digits to " + out); - String expected = "0.0016"; - if (!out.equals(expected)) - errln("FAIL: Expected " + expected); - } - - /** - * A space as a group separator for localized pattern causes - * wrong format. WorkAround : use non-breaking space. - */ - public void Test4086575() { - - NumberFormat nf = NumberFormat.getInstance(Locale.FRANCE); - logln("nf toPattern1: " + ((DecimalFormat)nf).toPattern()); - logln("nf toLocPattern1: " + ((DecimalFormat)nf).toLocalizedPattern()); - - // No group separator - logln("...applyLocalizedPattern ###,00;(###,00) "); - ((DecimalFormat)nf).applyLocalizedPattern("###,00;(###,00)"); - logln("nf toPattern2: " + ((DecimalFormat)nf).toPattern()); - logln("nf toLocPattern2: " + ((DecimalFormat)nf).toLocalizedPattern()); - - logln("nf: " + nf.format(1234)); // 1234,00 - logln("nf: " + nf.format(-1234)); // (1234,00) - - // Space as group separator - - logln("...applyLocalizedPattern # ###,00;(# ###,00) "); - ((DecimalFormat)nf).applyLocalizedPattern("#\u00a0###,00;(#\u00a0###,00)"); - logln("nf toPattern2: " + ((DecimalFormat)nf).toPattern()); - logln("nf toLocPattern2: " + ((DecimalFormat)nf).toLocalizedPattern()); - String buffer = nf.format(1234); - if (!buffer.equals("1\u00a0234,00")) - errln("nf : " + buffer); // Expect 1 234,00 - buffer = nf.format(-1234); - if (!buffer.equals("(1\u00a0234,00)")) - errln("nf : " + buffer); // Expect (1 234,00) - - // Erroneously prints: - // 1234,00 , - // (1234,00 ,) - - } - /** - * DecimalFormat.parse returns wrong value - */ - public void Test4068693() - { - logln("----- Test Application -----"); - ParsePosition pos; - DecimalFormat df = new DecimalFormat(); - Number d = df.parse("123.55456", pos=new ParsePosition(0)); - if (!d.toString().equals("123.55456")) { - errln("Result -> " + d.doubleValue()); - } - } - - /* bugs 4069754, 4067878 - * null pointer thrown when accessing a deserialized DecimalFormat - * object. - */ - public void Test4069754() - { - try { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - myformat it = new myformat(); - logln(it.Now()); - oos.writeObject(it); - oos.flush(); - baos.close(); - logln("Save OK!"); - byte [] bytes = baos.toByteArray(); - ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bytes)); - myformat o = (myformat)ois.readObject(); - ois.close(); - it.Now(); - logln("Load OK!"); - if (!o._dateFormat.equals(it._dateFormat)) { - throw new Exception("The saved and loaded object are not equals!"); - } - logln("Compare OK!"); - } catch (Exception foo) { - errln("Test for bug 4069754 or 4057878 failed => Exception: " + foo.getMessage()); - } - } - - /** - * DecimalFormat.applyPattern(String) allows illegal patterns - */ - public void Test4087251 (){ - DecimalFormat df = new DecimalFormat(); - try { - df.applyPattern("#.#.#"); - logln("toPattern() returns \"" + df.toPattern() + "\""); - errln("applyPattern(\"#.#.#\") doesn't throw IllegalArgumentException"); - } catch (IllegalArgumentException e) { - logln("Caught Illegal Argument Error !"); - } - // Second test; added 5/11/98 when reported to fail on 1.2b3 - try { - df.applyPattern("#0.0#0#0"); - logln("toPattern() returns \"" + df.toPattern() + "\""); - errln("applyPattern(\"#0.0#0#0\") doesn't throw IllegalArgumentException"); - } catch (IllegalArgumentException e) { - logln("Ok - IllegalArgumentException for #0.0#0#0"); - } - } - - /** - * DecimalFormat.format() loses precision - */ - public void Test4090489 (){ - DecimalFormat df = new DecimalFormat(); - df.setMinimumFractionDigits(10); - df.setGroupingUsed(false); - double d = 1.000000000000001E7; - BigDecimal bd = new BigDecimal(d); - StringBuffer sb = new StringBuffer(""); - FieldPosition fp = new FieldPosition(0); - logln("d = " + d); - logln("BigDecimal.toString(): " + bd.toString()); - df.format(d, sb, fp); - if (!sb.toString().equals("10000000.0000000100")) { - errln("DecimalFormat.format(): " + sb.toString()); - } - } - - /** - * DecimalFormat.format() loses precision - */ - public void Test4090504 () - { - double d = 1; - logln("d = " + d); - DecimalFormat df = new DecimalFormat(); - StringBuffer sb; - FieldPosition fp; - try { - for (int i = 17; i <= 20; i++) { - df.setMaximumFractionDigits(i); - sb = new StringBuffer(""); - fp = new FieldPosition(0); - logln(" getMaximumFractionDigits() = " + i); - logln(" formated: " + df.format(d, sb, fp)); - } - } catch (Exception foo) { - errln("Bug 4090504 regression test failed. Message : " + foo.getMessage()); - } - } - /** - * DecimalFormat.parse(String str, ParsePosition pp) loses precision - */ - public void Test4095713 () - { - DecimalFormat df = new DecimalFormat(); - String str = "0.1234"; - Double d1 = new Double(str); - Number d2 = df.parse(str, new ParsePosition(0)); - logln(d1.toString()); - if (d2.doubleValue() != d1.doubleValue()) - errln("Bug 4095713 test failed, new double value : " + d2.doubleValue()); - } - - /** - * DecimalFormat.parse() fails when multiplier is not set to 1 - */ - public void Test4092561 () - { - Locale savedLocale = Locale.getDefault(); - Locale.setDefault(Locale.US); - DecimalFormat df = new DecimalFormat(); - String str = Long.toString(Long.MIN_VALUE); - logln("Long.MIN_VALUE : " + df.parse(str, new ParsePosition(0)).toString()); - df.setMultiplier(100); - Number num = df.parse(str, new ParsePosition(0)); - if (num.doubleValue() != -9.223372036854776E16) { - errln("Bug 4092561 test failed when multiplier is set to not 1."); - } - Locale.setDefault(savedLocale); - } - - /** - * DecimalFormat: Negative format ignored. - */ - public void Test4092480 () - { - DecimalFormat dfFoo = new DecimalFormat("000"); - - try { - dfFoo.applyPattern("0000;-000"); - if (!dfFoo.toPattern().equals("#0000")) - errln("dfFoo.toPattern : " + dfFoo.toPattern()); - logln(dfFoo.format(42)); - logln(dfFoo.format(-42)); - dfFoo.applyPattern("000;-000"); - if (!dfFoo.toPattern().equals("#000")) - errln("dfFoo.toPattern : " + dfFoo.toPattern()); - logln(dfFoo.format(42)); - logln(dfFoo.format(-42)); - - dfFoo.applyPattern("000;-0000"); - if (!dfFoo.toPattern().equals("#000")) - errln("dfFoo.toPattern : " + dfFoo.toPattern()); - logln(dfFoo.format(42)); - logln(dfFoo.format(-42)); - - dfFoo.applyPattern("0000;-000"); - if (!dfFoo.toPattern().equals("#0000")) - errln("dfFoo.toPattern : " + dfFoo.toPattern()); - logln(dfFoo.format(42)); - logln(dfFoo.format(-42)); - } catch (Exception foo) { - errln("Message " + foo.getMessage()); - } - } - /** - * NumberFormat.getCurrencyInstance() produces format that uses - * decimal separator instead of monetary decimal separator. - * - * Rewrote this test not to depend on the actual pattern. Pattern should - * never contain the monetary separator! Decimal separator in pattern is - * interpreted as monetary separator if currency symbol is seen! - */ - public void Test4087244 () { - Locale de = new Locale("pt", "PT"); - DecimalFormat df = (DecimalFormat) NumberFormat.getCurrencyInstance(de); - DecimalFormatSymbols sym = df.getDecimalFormatSymbols(); - sym.setMonetaryDecimalSeparator('$'); - df.setDecimalFormatSymbols(sym); - char decSep = sym.getDecimalSeparator(); - char monSep = sym.getMonetaryDecimalSeparator(); - //char zero = sym.getZeroDigit(); //The variable is never used - if (decSep == monSep) { - errln("ERROR in test: want decimal sep != monetary sep"); - } else { - df.setMinimumIntegerDigits(1); - df.setMinimumFractionDigits(2); - String str = df.format(1.23); - String monStr = "1" + monSep + "23"; - String decStr = "1" + decSep + "23"; - if (str.indexOf(monStr) >= 0 && str.indexOf(decStr) < 0) { - logln("OK: 1.23 -> \"" + str + "\" contains \"" + - monStr + "\" and not \"" + decStr + '"'); - } else { - errln("FAIL: 1.23 -> \"" + str + "\", should contain \"" + - monStr + - "\" and not \"" + decStr + '"'); - } - } - } - /** - * Number format data rounding errors for locale FR - */ - public void Test4070798 () { - NumberFormat formatter; - String tempString; - /* User error : - String expectedDefault = "-5\u00a0789,987"; - String expectedCurrency = "5\u00a0789,98 F"; - String expectedPercent = "-578\u00a0998%"; - */ - String expectedDefault = "-5\u00a0789,988"; - String expectedCurrency = "5\u00a0789,99 F"; - String expectedPercent = "-578\u00a0999%"; - - formatter = NumberFormat.getNumberInstance(Locale.FRANCE); - tempString = formatter.format (-5789.9876); - - if (tempString.equals(expectedDefault)) { - logln ("Bug 4070798 default test passed."); - } else { - errln("Failed:" + - " Expected " + expectedDefault + - " Received " + tempString ); - } - - - formatter = NumberFormat.getCurrencyInstance(Locale.FRANCE); - tempString = formatter.format( 5789.9876 ); - - if (tempString.equals(expectedCurrency) ) { - logln ("Bug 4070798 currency test assed."); - } else { - errln("Failed:" + - " Expected " + expectedCurrency + - " Received " + tempString ); - } - - - formatter = NumberFormat.getPercentInstance(Locale.FRANCE); - tempString = formatter.format (-5789.9876); - - if (tempString.equals(expectedPercent) ) { - logln ("Bug 4070798 percentage test passed."); - } else { - errln("Failed:" + - " Expected " + expectedPercent + - " Received " + tempString ); - } - } - /** - * Data rounding errors for French (Canada) locale - */ - public void Test4071005 () { - - NumberFormat formatter; - String tempString; - /* user error : - String expectedDefault = "-5 789,987"; - String expectedCurrency = "5 789,98 $"; - String expectedPercent = "-578 998%"; - */ - String expectedDefault = "-5\u00a0789,988"; - String expectedCurrency = "5\u00a0789,99 $"; - String expectedPercent = "-578\u00a0999%"; - - formatter = NumberFormat.getNumberInstance(Locale.CANADA_FRENCH); - tempString = formatter.format (-5789.9876); - if (tempString.equals(expectedDefault)) { - logln ("Bug 4071005 default test passed."); - } else { - errln("Failed:" + - " Expected " + expectedDefault + - " Received " + tempString ); - } - - formatter = NumberFormat.getCurrencyInstance(Locale.CANADA_FRENCH); - tempString = formatter.format( 5789.9876 ) ; - - if (tempString.equals(expectedCurrency) ) { - logln ("Bug 4071005 currency test passed."); - } else { - errln("Failed:" + - " Expected " + expectedCurrency + - " Received " + tempString ); - } - formatter = NumberFormat.getPercentInstance(Locale.CANADA_FRENCH); - tempString = formatter.format (-5789.9876); - - if (tempString.equals(expectedPercent) ) { - logln ("Bug 4071005 percentage test passed."); - } else { - errln("Failed:" + - " Expected " + expectedPercent + - " Received " + tempString ); - } - } - - /** - * Data rounding errors for German (Germany) locale - */ - public void Test4071014 () { - NumberFormat formatter; - String tempString; - /* user error : - String expectedDefault = "-5.789,987"; - String expectedCurrency = "5.789,98 DM"; - String expectedPercent = "-578.998%"; - */ - String expectedDefault = "-5.789,988"; - String expectedCurrency = "5.789,99 DM"; - String expectedPercent = "-578.999%"; - - formatter = NumberFormat.getNumberInstance(Locale.GERMANY); - tempString = formatter.format (-5789.9876); - - if (tempString.equals(expectedDefault)) { - logln ("Bug 4071014 default test passed."); - } else { - errln("Failed:" + - " Expected " + expectedDefault + - " Received " + tempString ); - } - - formatter = NumberFormat.getCurrencyInstance(Locale.GERMANY); - tempString = formatter.format( 5789.9876 ) ; - - if (tempString.equals(expectedCurrency) ) { - logln ("Bug 4071014 currency test passed."); - } else { - errln("Failed:" + - " Expected " + expectedCurrency + - " Received " + tempString ); - } - - formatter = NumberFormat.getPercentInstance(Locale.GERMANY); - tempString = formatter.format (-5789.9876); - - if (tempString.equals(expectedPercent) ) { - logln ("Bug 4071014 percentage test passed."); - } else { - errln("Failed:" + - " Expected " + expectedPercent + - " Received " + tempString ); - } - - } - /** - * Data rounding errors for Italian locale number formats - */ - public void Test4071859 () { - NumberFormat formatter; - String tempString; - /* user error : - String expectedDefault = "-5.789,987"; - String expectedCurrency = "-L. 5.789,98"; - String expectedPercent = "-578.998%"; - */ - String expectedDefault = "-5.789,988"; - String expectedCurrency = "-L. 5.790"; - String expectedPercent = "-578.999%"; - - formatter = NumberFormat.getNumberInstance(Locale.ITALY); - tempString = formatter.format (-5789.9876); - - if (tempString.equals(expectedDefault)) { - logln ("Bug 4071859 default test passed."); - } else { - errln("Failed:" + - " Expected " + expectedDefault + - " Received " + tempString ); - } - - formatter = NumberFormat.getCurrencyInstance(Locale.ITALY); - tempString = formatter.format( -5789.9876 ) ; - - if (tempString.equals(expectedCurrency) ) { - logln ("Bug 4071859 currency test passed."); - } else { - errln("Failed:" + - " Expected " + expectedCurrency + - " Received " + tempString ); - } - - formatter = NumberFormat.getPercentInstance(Locale.ITALY); - tempString = formatter.format (-5789.9876); - - if (tempString.equals(expectedPercent) ) { - logln ("Bug 4071859 percentage test passed."); - } else { - errln("Failed:" + - " Expected " + expectedPercent + - " Received " + tempString ); - } - - } - /* bug 4071859 - * Test rounding for nearest even. - */ - public void Test4093610() - { - DecimalFormat df = new DecimalFormat("#0.#"); - roundingTest(df, 12.35, "12.4"); - roundingTest(df, 12.45, "12.4"); - roundingTest(df, 12.452,"12.5"); - roundingTest(df, 12.55, "12.6"); - roundingTest(df, 12.65, "12.6"); - roundingTest(df, 12.652,"12.7"); - roundingTest(df, 12.75, "12.8"); - roundingTest(df, 12.752,"12.8"); - roundingTest(df, 12.85, "12.8"); - roundingTest(df, 12.852,"12.9"); - roundingTest(df, 12.95, "13"); - roundingTest(df, 12.952,"13"); - - } - void roundingTest(DecimalFormat df, double x, String expected) - { - String out = df.format(x); - logln("" + x + " formats with 1 fractional digits to " + out); - if (!out.equals(expected)) errln("FAIL: Expected " + expected); - } - /** - * Tests the setMaximumFractionDigits limit. - */ - public void Test4098741() - { - try { - NumberFormat fmt = NumberFormat.getPercentInstance(); - fmt.setMaximumFractionDigits(20); - logln(fmt.format(.001)); - } catch (Exception foo) { - errln("Bug 4098471 failed with exception thrown : " + foo.getMessage()); - } - } - /** - * Tests illegal pattern exception. - * Fix comment : HShih A31 Part1 will not be fixed and javadoc needs to be updated. - * Part2 has been fixed. - */ - public void Test4074454() - { - try { - DecimalFormat fmt = new DecimalFormat("#,#00.00;-#.#"); - logln("format 3456.78: " + fmt.format(3456.78)); //fix "The variable 'fmt' is never used" - logln("Inconsistent negative pattern is fine."); - DecimalFormat newFmt = new DecimalFormat("#,#00.00 p''ieces;-#,#00.00 p''ieces"); - String tempString = newFmt.format(3456.78); - if (!tempString.equals("3,456.78 p'ieces")) - errln("Failed! 3456.78 p'ieces expected, but got : " + tempString); - } catch (Exception foo) { - errln("An exception was thrown for any inconsistent negative pattern."); - } - } - /** - * Tests all different comments. - * Response to some comments : - * [1] DecimalFormat.parse API documentation is more than just one line. - * This is not a reproducable doc error in 116 source code. - * [2] See updated javadoc. - * [3] Fixed. - * [4] NumberFormat.parse(String, ParsePosition) : If parsing fails, - * a null object will be returned. The unchanged parse position also - * reflects an error. - * NumberFormat.parse(String) : If parsing fails, an ParseException - * will be thrown. - * See updated javadoc for more details. - * [5] See updated javadoc. - * [6] See updated javadoc. - * [7] This is a correct behavior if the DateFormat object is linient. - * Otherwise, an IllegalArgumentException will be thrown when formatting - * "January 35". See GregorianCalendar class javadoc for more details. - */ - public void Test4099404() - { - try { - DecimalFormat fmt = new DecimalFormat("000.0#0"); - logln("format 3456.78: " + fmt.format(3456.78)); //fix "The variable 'fmt' is never used" - errln("Bug 4099404 failed applying illegal pattern \"000.0#0\""); - } catch (Exception foo) { - logln("Bug 4099404 pattern \"000.0#0\" passed"); - } - try { - DecimalFormat fmt = new DecimalFormat("0#0.000"); - logln("format 3456.78: " + fmt.format(3456.78)); //fix "The variable 'fmt' is never used" - errln("Bug 4099404 failed applying illegal pattern \"0#0.000\""); - } catch (Exception foo) { - logln("Bug 4099404 pattern \"0#0.000\" passed"); - } - } - /** - * DecimalFormat.applyPattern doesn't set minimum integer digits - */ - public void Test4101481() - { - DecimalFormat sdf = new DecimalFormat("#,##0"); - if (sdf.getMinimumIntegerDigits() != 1) - errln("Minimum integer digits : " + sdf.getMinimumIntegerDigits()); - } - /** - * Tests ParsePosition.setErrorPosition() and ParsePosition.getErrorPosition(). - */ - public void Test4052223() - { - try { - DecimalFormat fmt = new DecimalFormat("#,#00.00"); - Number num = fmt.parse("abc3"); - errln("Bug 4052223 failed : can't parse string \"a\". Got " + num); - } catch (ParseException foo) { - logln("Caught expected ParseException : " + foo.getMessage() + " at index : " + foo.getErrorOffset()); - } - } - /** - * API tests for API addition request A9. - */ - public void Test4061302() - { - DecimalFormatSymbols fmt = new DecimalFormatSymbols(); - String currency = fmt.getCurrencySymbol(); - String intlCurrency = fmt.getInternationalCurrencySymbol(); - char monDecSeparator = fmt.getMonetaryDecimalSeparator(); - if (currency.equals("") || - intlCurrency.equals("") || - monDecSeparator == 0) { - errln("getCurrencySymbols failed, got empty string."); - } - logln("Before set ==> Currency : " + currency + " Intl Currency : " + intlCurrency + " Monetary Decimal Separator : " + monDecSeparator); - fmt.setCurrencySymbol("XYZ"); - fmt.setInternationalCurrencySymbol("ABC"); - fmt.setMonetaryDecimalSeparator('*'); - currency = fmt.getCurrencySymbol(); - intlCurrency = fmt.getInternationalCurrencySymbol(); - monDecSeparator = fmt.getMonetaryDecimalSeparator(); - if (!currency.equals("XYZ") || - !intlCurrency.equals("ABC") || - monDecSeparator != '*') { - errln("setCurrencySymbols failed."); - } - logln("After set ==> Currency : " + currency + " Intl Currency : " + intlCurrency + " Monetary Decimal Separator : " + monDecSeparator); - } - /** - * API tests for API addition request A23. FieldPosition.getBeginIndex and - * FieldPosition.getEndIndex. - */ - public void Test4062486() - { - DecimalFormat fmt = new DecimalFormat("#,##0.00"); - StringBuffer formatted = new StringBuffer(); - FieldPosition field = new FieldPosition(0); - Double num = new Double(1234.5); - fmt.format(num, formatted, field); - if (field.getBeginIndex() != 0 && field.getEndIndex() != 5) - errln("Format 1234.5 failed. Begin index: " + field.getBeginIndex() + " End index: " + field.getEndIndex()); - field.setBeginIndex(7); - field.setEndIndex(4); - if (field.getBeginIndex() != 7 && field.getEndIndex() != 4) - errln("Set begin/end field indexes failed. Begin index: " + field.getBeginIndex() + " End index: " + field.getEndIndex()); - } - - /** - * DecimalFormat.parse incorrectly works with a group separator. - */ - public void Test4108738() - { - - DecimalFormat df = new DecimalFormat("#,##0.###", new - DecimalFormatSymbols(java.util.Locale.US)); - String text = "1.222,111"; - Number num = df.parse(text,new ParsePosition(0)); - if (!num.toString().equals("1.222")) - errln("\"" + text + "\" is parsed as " + num); - text = "1.222x111"; - num = df.parse(text,new ParsePosition(0)); - if (!num.toString().equals("1.222")) - errln("\"" + text + "\" is parsed as " + num); - } - - /** - * DecimalFormat.format() incorrectly formats negative doubles. - */ - public void Test4106658() - { - Locale savedLocale = Locale.getDefault(); - Locale.setDefault(Locale.US); - DecimalFormat df = new DecimalFormat(); // Corrected; see 4147706 - double d1 = -0.0; - double d2 = -0.0001; - StringBuffer buffer = new StringBuffer(); - logln("pattern: \"" + df.toPattern() + "\""); - df.format(d1, buffer, new FieldPosition(0)); - if (!buffer.toString().equals("-0")) { // Corrected; see 4147706 - errln(d1 + " is formatted as " + buffer); - } - buffer.setLength(0); - df.format(d2, buffer, new FieldPosition(0)); - if (!buffer.toString().equals("-0")) { // Corrected; see 4147706 - errln(d2 + " is formatted as " + buffer); - } - Locale.setDefault(savedLocale); - } - - /** - * DecimalFormat.parse returns 0 if string parameter is incorrect. - */ - public void Test4106662() - { - DecimalFormat df = new DecimalFormat(); - String text = "x"; - ParsePosition pos1 = new ParsePosition(0), pos2 = new ParsePosition(0); - - logln("pattern: \"" + df.toPattern() + "\""); - Number num = df.parse(text, pos1); - if (num != null) { - errln("Test Failed: \"" + text + "\" is parsed as " + num); - } - df = null; - df = new DecimalFormat("$###.00"); - num = df.parse("$", pos2); - if (num != null){ - errln("Test Failed: \"$\" is parsed as " + num); - } - } - - /** - * NumberFormat.parse doesn't return null - */ - public void Test4114639() - { - NumberFormat format = NumberFormat.getInstance(); - String text = "time 10:x"; - ParsePosition pos = new ParsePosition(8); - Number result = format.parse(text, pos); - if (result != null) errln("Should return null but got : " + result); // Should be null; it isn't - } - - /** - * DecimalFormat.format(long n) fails if n * multiplier > MAX_LONG. - */ - public void Test4106664() - { - DecimalFormat df = new DecimalFormat(); - long n = 1234567890123456L; - int m = 12345678; - BigInteger bigN = BigInteger.valueOf(n); - bigN = bigN.multiply(BigInteger.valueOf(m)); - df.setMultiplier(m); - df.setGroupingUsed(false); - logln("formated: " + - df.format(n, new StringBuffer(), new FieldPosition(0))); - logln("expected: " + bigN.toString()); - } - /** - * DecimalFormat.format incorrectly formats -0.0. - */ - public void Test4106667() - { - Locale savedLocale = Locale.getDefault(); - Locale.setDefault(Locale.US); - DecimalFormat df = new DecimalFormat(); - df.setPositivePrefix("+"); - double d = -0.0; - logln("pattern: \"" + df.toPattern() + "\""); - StringBuffer buffer = new StringBuffer(); - df.format(d, buffer, new FieldPosition(0)); - if (!buffer.toString().equals("-0")) { // Corrected; see 4147706 - errln(d + " is formatted as " + buffer); - } - Locale.setDefault(savedLocale); - } - - /** - * DecimalFormat.setMaximumIntegerDigits() works incorrectly. - */ - public void Test4110936() - { - NumberFormat nf = NumberFormat.getInstance(); - nf.setMaximumIntegerDigits(128); - logln("setMaximumIntegerDigits(128)"); - if (nf.getMaximumIntegerDigits() != 128) - errln("getMaximumIntegerDigits() returns " + - nf.getMaximumIntegerDigits()); - } - - /** - * Locale data should use generic currency symbol - * - * 1) Make sure that all currency formats use the generic currency symbol. - * 2) Make sure we get the same results using the generic symbol or a - * hard-coded one. - */ - public void Test4122840() - { - Locale[] locales = NumberFormat.getAvailableLocales(); - - for (int i = 0; i < locales.length; i++) { - ResourceBundle rb = ResourceBundle.getBundle( - "java.text.resources.LocaleElements", locales[i]); - // - // Get the currency pattern for this locale. We have to fish it - // out of the ResourceBundle directly, since DecimalFormat.toPattern - // will return the localized symbol, not \00a4 - // - String[] numPatterns = (String[])rb.getObject("NumberPatterns"); - String pattern = numPatterns[1]; - - if (pattern.indexOf("\u00A4") == -1 ) { - errln("Currency format for " + locales[i] + - " does not contain generic currency symbol:" + - pattern ); - } - - // Create a DecimalFormat using the pattern we got and format a number - DecimalFormatSymbols symbols = new DecimalFormatSymbols(locales[i]); - DecimalFormat fmt1 = new DecimalFormat(pattern, symbols); - - String result1 = fmt1.format(1.111); - - // - // Now substitute in the locale's currency symbol and create another - // pattern. Replace the decimal separator with the monetary separator. - // - //char decSep = symbols.getDecimalSeparator(); //The variable is never used - char monSep = symbols.getMonetaryDecimalSeparator(); - StringBuffer buf = new StringBuffer(pattern); - for (int j = 0; j < buf.length(); j++) { - if (buf.charAt(j) == '\u00a4') { - String cur = "'" + symbols.getCurrencySymbol() + "'"; - buf.replace(j, j+1, cur); - j += cur.length() - 1; - } - } - symbols.setDecimalSeparator(monSep); - DecimalFormat fmt2 = new DecimalFormat(buf.toString(), symbols); - - String result2 = fmt2.format(1.111); - - if (!result1.equals(result2)) { - errln("Results for " + locales[i] + " differ: " + - result1 + " vs " + result2); - } - } - } - - /** - * DecimalFormat.format() delivers wrong string. - */ - public void Test4125885() - { - double rate = 12.34; - DecimalFormat formatDec = new DecimalFormat ("000.00"); - logln("toPattern: " + formatDec.toPattern()); - String rateString= formatDec.format(rate); - if (!rateString.equals("012.34")) - errln("result : " + rateString + " expected : 012.34"); - rate = 0.1234; - formatDec = null; - formatDec = new DecimalFormat ("+000.00%;-000.00%"); - logln("toPattern: " + formatDec.toPattern()); - rateString= formatDec.format(rate); - if (!rateString.equals("+012.34%")) - errln("result : " + rateString + " expected : +012.34%"); - } - - /** - ** - * DecimalFormat produces extra zeros when formatting numbers. - */ - public void Test4134034() { - DecimalFormat nf = new DecimalFormat("##,###,###.00"); - - String f = nf.format(9.02); - if (f.equals("9.02")) logln(f + " ok"); else errln("9.02 -> " + f + "; want 9.02"); - - f = nf.format(0); - if (f.equals(".00")) logln(f + " ok"); else errln("0 -> " + f + "; want .00"); - } - - /** - * CANNOT REPRODUCE - This bug could not be reproduced. It may be - * a duplicate of 4134034. - * - * JDK 1.1.6 Bug, did NOT occur in 1.1.5 - * Possibly related to bug 4125885. - * - * This class demonstrates a regression in version 1.1.6 - * of DecimalFormat class. - * - * 1.1.6 Results - * Value 1.2 Format #.00 Result '01.20' !!!wrong - * Value 1.2 Format 0.00 Result '001.20' !!!wrong - * Value 1.2 Format 00.00 Result '0001.20' !!!wrong - * Value 1.2 Format #0.0# Result '1.2' - * Value 1.2 Format #0.00 Result '001.20' !!!wrong - * - * 1.1.5 Results - * Value 1.2 Format #.00 Result '1.20' - * Value 1.2 Format 0.00 Result '1.20' - * Value 1.2 Format 00.00 Result '01.20' - * Value 1.2 Format #0.0# Result '1.2' - * Value 1.2 Format #0.00 Result '1.20' - */ - public void Test4134300() { - String[] DATA = { - // Pattern Expected string - "#.00", "1.20", - "0.00", "1.20", - "00.00", "01.20", - "#0.0#", "1.2", - "#0.00", "1.20", - }; - for (int i=0; i " + s); - s = f.format(-123.456); - if (!s.equals("-123.456")) - errln("Fail: Format empty pattern x -123.456 => " + s); - } - } - - /** - * BigDecimal numbers get their fractions truncated by NumberFormat. - */ - public void Test4141750() { - try { - String str = "12345.67"; - BigDecimal bd = new BigDecimal(str); - String sd = NumberFormat.getInstance(Locale.US).format(bd); - if (!sd.endsWith("67")) errln("Fail: " + str + " x format -> " + sd); - } - catch (Exception e) { - errln(e.toString()); - e.printStackTrace(); - } - } - - /** - * DecimalFormat toPattern() doesn't quote special characters or handle - * single quotes. - */ - public void Test4145457() { - try { - DecimalFormat nf = (DecimalFormat)NumberFormat.getInstance(); - DecimalFormatSymbols sym = nf.getDecimalFormatSymbols(); - sym.setDecimalSeparator('\''); - nf.setDecimalFormatSymbols(sym); - double pi = 3.14159; - - String[] PATS = { "#.00 'num''ber'", "''#.00''" }; - - for (int i=0; i \"" + pat + '"'); - - if (val == val2 && out.equals(out2)) { - logln("Ok " + pi + " x \"" + PATS[i] + "\" -> \"" + - out + "\" -> " + val + " -> \"" + - out2 + "\" -> " + val2); - } - else { - errln("Fail " + pi + " x \"" + PATS[i] + "\" -> \"" + - out + "\" -> " + val + " -> \"" + - out2 + "\" -> " + val2); - } - } - } - catch (ParseException e) { - errln("Fail: " + e); - e.printStackTrace(); - } - } - - /** - * DecimalFormat.applyPattern() sets minimum integer digits incorrectly. - * CANNOT REPRODUCE - * This bug is a duplicate of 4139344, which is a duplicate of 4134300 - */ - public void Test4147295() { - DecimalFormat sdf = new DecimalFormat(); - String pattern = "#,###"; - logln("Applying pattern \"" + pattern + "\""); - sdf.applyPattern(pattern); - int minIntDig = sdf.getMinimumIntegerDigits(); - if (minIntDig != 0) { - errln("Test failed"); - errln(" Minimum integer digits : " + minIntDig); - errln(" new pattern: " + sdf.toPattern()); - } else { - logln("Test passed"); - logln(" Minimum integer digits : " + minIntDig); - } - } - - /** - * DecimalFormat formats -0.0 as +0.0 - * See also older related bug 4106658, 4106667 - */ - public void Test4147706() { - DecimalFormat df = new DecimalFormat("#,##0.0##"); - df.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.ENGLISH)); - double d1 = -0.0; - double d2 = -0.0001; - StringBuffer f1 = df.format(d1, new StringBuffer(), new FieldPosition(0)); - StringBuffer f2 = df.format(d2, new StringBuffer(), new FieldPosition(0)); - if (!f1.toString().equals("-0.0")) { - errln(d1 + " x \"" + df.toPattern() + "\" is formatted as \"" + f1 + '"'); - } - if (!f2.toString().equals("-0.0")) { - errln(d2 + " x \"" + df.toPattern() + "\" is formatted as \"" + f2 + '"'); - } - } - - /** - * NumberFormat cannot format Double.MAX_VALUE - */ - public void Test4162198() { - double dbl = Double.MAX_VALUE; - NumberFormat f = NumberFormat.getInstance(); - f.setMaximumFractionDigits(Integer.MAX_VALUE); - f.setMaximumIntegerDigits(Integer.MAX_VALUE); - String s = f.format(dbl); - logln("The number " + dbl + " formatted to " + s); - Number n = null; - try { - n = f.parse(s); - } catch (java.text.ParseException e) { - errln("Caught a ParseException:"); - e.printStackTrace(); - } - logln("The string " + s + " parsed as " + n); - if (n.doubleValue() != dbl) { - errln("Round trip failure"); - } - } - - /** - * NumberFormat does not parse negative zero. - */ - public void Test4162852() throws ParseException { - for (int i=0; i<2; ++i) { - NumberFormat f = (i == 0) ? NumberFormat.getInstance() - : NumberFormat.getPercentInstance(); - double d = -0.0; - String s = f.format(d); - double e = f.parse(s).doubleValue(); - logln("" + - d + " -> " + - '"' + s + '"' + " -> " + - e); - if (e != 0.0 || 1.0/e > 0.0) { - logln("Failed to parse negative zero"); - } - } - } - - /** - * NumberFormat truncates data - */ - public void Test4167494() throws Exception { - NumberFormat fmt = NumberFormat.getInstance(Locale.US); - - double a = Double.MAX_VALUE; - String s = fmt.format(a); - double b = fmt.parse(s).doubleValue(); - boolean match = a == b; - if (match) { - logln("" + a + " -> \"" + s + "\" -> " + b + " ok"); - } else { - errln("" + a + " -> \"" + s + "\" -> " + b + " FAIL"); - } - - // We don't test Double.MIN_VALUE because the locale data for the US - // currently doesn't specify enough digits to display Double.MIN_VALUE. - // This is correct for now; however, we leave this here as a reminder - // in case we want to address this later. - if (false) { - a = Double.MIN_VALUE; - s = fmt.format(a); - b = fmt.parse(s).doubleValue(); - match = a == b; - if (match) { - logln("" + a + " -> \"" + s + "\" -> " + b + " ok"); - } else { - errln("" + a + " -> \"" + s + "\" -> " + b + " FAIL"); - } - } - } - - /** - * DecimalFormat.parse() fails when ParseIntegerOnly set to true - */ - public void Test4170798() { - Locale savedLocale = Locale.getDefault(); - Locale.setDefault(Locale.US); - DecimalFormat df = new DecimalFormat(); - df.setParseIntegerOnly(true); - Number n = df.parse("-0.0", new ParsePosition(0)); - if (!(n instanceof Double) - || n.intValue() != 0) { - errln("FAIL: parse(\"-0.0\") returns " + - n + " (" + n.getClass().getName() + ')'); - } - Locale.setDefault(savedLocale); - } - - /** - * toPattern only puts the first grouping separator in. - */ - public void Test4176114() { - String[] DATA = { - "00", "#00", - "000", "#000", // No grouping - "#000", "#000", // No grouping - "#,##0", "#,##0", - "#,000", "#,000", - "0,000", "#0,000", - "00,000", "#00,000", - "000,000", "#,000,000", - "0,000,000,000,000.0000", "#0,000,000,000,000.0000", // Reported - }; - for (int i=0; i " + s + ", want " + DATA[i+1]); - } - } - } - - /** - * DecimalFormat is incorrectly rounding numbers like 1.2501 to 1.2 - */ - public void Test4179818() { - String DATA[] = { - // Input Pattern Expected output - "1.2511", "#.#", "1.3", - "1.2501", "#.#", "1.3", - "0.9999", "#", "1", - }; - DecimalFormat fmt = new DecimalFormat("#", - new DecimalFormatSymbols(Locale.US)); - for (int i=0; i " + fmt.format(-1) + - ", exp ^1"); - } - if (!fmt.getNegativePrefix().equals("^")) { - errln("FAIL: (minus=^).getNegativePrefix -> " + - fmt.getNegativePrefix() + ", exp ^"); - } - sym.setMinusSign('-'); - - fmt.applyPattern("#%"); - sym.setPercent('^'); - fmt.setDecimalFormatSymbols(sym); - if (!fmt.format(0.25).equals("25^")) { - errln("FAIL: 0.25 x (percent=^) -> " + fmt.format(0.25) + - ", exp 25^"); - } - if (!fmt.getPositiveSuffix().equals("^")) { - errln("FAIL: (percent=^).getPositiveSuffix -> " + - fmt.getPositiveSuffix() + ", exp ^"); - } - sym.setPercent('%'); - - fmt.applyPattern("#\u2030"); - sym.setPerMill('^'); - fmt.setDecimalFormatSymbols(sym); - if (!fmt.format(0.25).equals("250^")) { - errln("FAIL: 0.25 x (permill=^) -> " + fmt.format(0.25) + - ", exp 250^"); - } - if (!fmt.getPositiveSuffix().equals("^")) { - errln("FAIL: (permill=^).getPositiveSuffix -> " + - fmt.getPositiveSuffix() + ", exp ^"); - } - sym.setPerMill('\u2030'); - - fmt.applyPattern("\u00A4#.00"); - sym.setCurrencySymbol("usd"); - fmt.setDecimalFormatSymbols(sym); - if (!fmt.format(12.5).equals("usd12.50")) { - errln("FAIL: 12.5 x (currency=usd) -> " + fmt.format(12.5) + - ", exp usd12.50"); - } - if (!fmt.getPositivePrefix().equals("usd")) { - errln("FAIL: (currency=usd).getPositivePrefix -> " + - fmt.getPositivePrefix() + ", exp usd"); - } - sym.setCurrencySymbol("$"); - - fmt.applyPattern("\u00A4\u00A4#.00"); - sym.setInternationalCurrencySymbol("DOL"); - fmt.setDecimalFormatSymbols(sym); - if (!fmt.format(12.5).equals("DOL12.50")) { - errln("FAIL: 12.5 x (intlcurrency=DOL) -> " + fmt.format(12.5) + - ", exp DOL12.50"); - } - if (!fmt.getPositivePrefix().equals("DOL")) { - errln("FAIL: (intlcurrency=DOL).getPositivePrefix -> " + - fmt.getPositivePrefix() + ", exp DOL"); - } - sym.setInternationalCurrencySymbol("USD"); - - // Since the pattern logic has changed, make sure that patterns round - // trip properly. Test stream in/out integrity too. - Locale[] avail = NumberFormat.getAvailableLocales(); - for (int i=0; i \"" + pat + - "\" -> \"" + f2.toPattern() + '"'); - } - - // Test toLocalizedPattern/applyLocalizedPattern round trip - pat = df.toLocalizedPattern(); - f2.applyLocalizedPattern(pat); - if (!df.equals(f2)) { - errln("FAIL: " + avail[i] + " -> localized \"" + pat + - "\" -> \"" + f2.toPattern() + '"'); - } - - // Test writeObject/readObject round trip - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(df); - oos.flush(); - baos.close(); - byte[] bytes = baos.toByteArray(); - ObjectInputStream ois = - new ObjectInputStream(new ByteArrayInputStream(bytes)); - f2 = (DecimalFormat) ois.readObject(); - if (!df.equals(f2)) { - errln("FAIL: Stream in/out " + avail[i] + " -> \"" + pat + - "\" -> " + - (f2 != null ? ("\""+f2.toPattern()+'"') : "null")); - } - - } - } - } - - /** - * DecimalFormat.parse() fails for mulipliers 2^n. - */ - public void Test4216742() throws ParseException { - DecimalFormat fmt = (DecimalFormat) NumberFormat.getInstance(Locale.US); - long[] DATA = { Long.MIN_VALUE, Long.MAX_VALUE, -100000000L, 100000000L}; - for (int i=0; i 0 != DATA[i] > 0) { - errln("\"" + str + "\" parse(x " + fmt.getMultiplier() + - ") => " + n); - } - } - } - } - - /** - * DecimalFormat formats 1.001 to "1.00" instead of "1" with 2 fraction - * digits. - */ - public void Test4217661() { - Object[] DATA = { - new Double(0.001), "0", - new Double(1.001), "1", - new Double(0.006), "0.01", - new Double(1.006), "1.01", - }; - NumberFormat fmt = NumberFormat.getInstance(Locale.US); - fmt.setMaximumFractionDigits(2); - for (int i=0; i 0x7e) { - buf.append("\\u"); - if (ch < 0x1000) { - buf.append('0'); - } - if (ch < 0x100) { - buf.append('0'); - } - if (ch < 0x10) { - buf.append('0'); - } - buf.append(Integer.toHexString(ch)); - } else { - buf.append(ch); - } - } - return buf.toString(); - } - - private static String parseText(String text) { - // process unicode escapes (only) - StringBuffer buf = new StringBuffer(); - char[] chars = text.toCharArray(); - for (int i = 0; i < chars.length; ++i) { - char ch = chars[i]; - if (ch == '\\') { - if ((i < chars.length - 1) && - (chars[i+1] == 'u')) { - int val = Integer.parseInt(text.substring(i+2, i+6), 16); - buf.append((char)val); - i += 5; - } else { - buf.append('\\'); - } - } else { - buf.append(ch); - } - } - return buf.toString(); - } -} diff --git a/icu4j/src/com/ibm/icu/test/text/TestUScript.java b/icu4j/src/com/ibm/icu/test/text/TestUScript.java deleted file mode 100755 index bc9bd656f4..0000000000 --- a/icu4j/src/com/ibm/icu/test/text/TestUScript.java +++ /dev/null @@ -1,269 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -*/ - -package com.ibm.icu.test.text; - -import com.ibm.text.UScript; -import com.ibm.test.TestFmwk; -import java.util.Locale; - -public class TestUScript extends TestFmwk{ - - /** - * Constructor - */ - public TestUScript() - { - } - - public static void main(String[] args) throws Exception { - new TestUScript().run(args); - } - public void TestLocaleGetCode(){ - final Locale[] testNames={ - /* test locale */ - new Locale("en",""), new Locale("en","US"), - new Locale("sr",""), new Locale("ta","") , - new Locale("te","IN"), - new Locale("hi",""), - new Locale("he",""), new Locale("ar",""), - new Locale("abcde",""), - new Locale("abcde","cdef") - }; - final int[] expected ={ - /* locales should return */ - UScript.LATIN, UScript.LATIN, - UScript.CYRILLIC, UScript.TAMIL, - UScript.TELUGU,UScript.DEVANAGARI, - UScript.HEBREW, UScript.ARABIC, - UScript.INVALID_CODE,UScript.INVALID_CODE - }; - int i =0; - int numErrors =0; - - for( ; i0 ){ - errln("Number of Errors in UScript.getCode() : " + numErrors); - } - } - public void TestMultipleCode(){ - final String[] testNames = { "ja" ,"ko_KR","zh","zh_TW"}; - final int[][] expected = { - {UScript.KATAKANA,UScript.HIRAGANA,UScript.HAN}, - {UScript.HANGUL, UScript.HAN}, - {UScript.HAN}, - {UScript.HAN,UScript.BOPOMOFO} - }; - for(int i=0; i0 ){ - errln("Number of Errors in UScript.getCode() : " + numErrors); - } - } - public void TestGetName(){ - - final int[] testCodes={ - /* names should return */ - UScript.CYRILLIC, UScript.DESERET, UScript.DEVANAGARI, UScript.ETHIOPIC, UScript.GEORGIAN, - UScript.GOTHIC, UScript.GREEK, UScript.GUJARATI, - }; - - final String[] expectedNames={ - - /* test names */ - "CYRILLIC","DESERET","DEVANAGARI","ETHIOPIC","GEORGIAN", - "GOTHIC", "GREEK", "GUJARATI", - }; - int i =0; - - while(i< testCodes.length){ - String scriptName = UScript.getName(testCodes[i]); - int numErrors=0; - if(!expectedNames[i].equals(scriptName)){ - logln("Error getting abbreviations Got: " +scriptName +" Expected: "+expectedNames[i]); - numErrors++; - } - if(numErrors > 0){ - if(numErrors >0 ){ - errln("Errors UScript.getShorName() : " + numErrors); - } - } - i++; - } - - } - public void TestGetShortName(){ - final int[] testCodes={ - /* abbr should return */ - UScript.HAN, UScript.HANGUL, UScript.HEBREW, UScript.HIRAGANA, - UScript.KANNADA, UScript.KATAKANA, UScript.KHMER, UScript.LAO, - UScript.LATIN, - UScript.MALAYALAM, UScript.MONGOLIAN, - }; - - final String[] expectedAbbr={ - /* test abbr */ - "Hani", "Hang","Hebr","Hira", - "Knda","Kana","Khmr","Lao", - "Latn", - "Mlym", "Mong", - }; - int i=0; - while(i 0){ - if(numErrors >0 ){ - errln("Errors UChar.getScriptAbbr() : "+numErrors); - } - } - i++; - } - - } - public void TestGetScript(){ - int codepoints[] = { - 0x0000FF9D, - 0x0000FFBE, - 0x0000FFC7, - 0x0000FFCF, - 0x0000FFD7, - 0x0000FFDC, - 0x00010300, - 0x00010330, - 0x0001034A, - 0x00010400, - 0x00010428, - 0x0001D167, - 0x0001D17B, - 0x0001D185, - 0x0001D1AA, - 0x00020000, - 0x00000D02, - 0x00000D00, - 0x00000000, - 0x0001D169, - 0x0001D182, - 0x0001D18B, - 0x0001D1AD, - }; - - int expected[] = { - UScript.KATAKANA , - UScript.HANGUL , - UScript.HANGUL , - UScript.HANGUL , - UScript.HANGUL , - UScript.HANGUL , - UScript.OLD_ITALIC, - UScript.GOTHIC , - UScript.GOTHIC , - UScript.DESERET , - UScript.DESERET , - UScript.INHERITED, - UScript.INHERITED, - UScript.INHERITED, - UScript.INHERITED, - UScript.HAN , - UScript.MALAYALAM, - UScript.INVALID_CODE, - UScript.COMMON, - UScript.INHERITED , - UScript.INHERITED , - UScript.INHERITED , - UScript.INHERITED , - }; - int i =0; - int code = UScript.INVALID_CODE; - boolean passed = true; - - while(i< codepoints.length){ - code = UScript.getScript(codepoints[i]); - - if(code != expected[i]){ - logln("UScript.getScript for codepoint 0x"+ hex(codepoints[i])+" failed\n"); - passed = false; - } - - i++; - } - if(!passed){ - errln("UScript.getScript failed."); - } - } - } \ No newline at end of file diff --git a/icu4j/src/com/ibm/icu/test/text/UCharacterCompare.java b/icu4j/src/com/ibm/icu/test/text/UCharacterCompare.java deleted file mode 100755 index 124108cd2d..0000000000 --- a/icu4j/src/com/ibm/icu/test/text/UCharacterCompare.java +++ /dev/null @@ -1,313 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/text/Attic/UCharacterCompare.java,v $ -* $Date: 2001/03/23 19:52:03 $ -* $Revision: 1.6 $ -* -******************************************************************************* -*/ - -package com.ibm.icu.test.text; - -import com.ibm.text.UCharacter; -import com.ibm.text.UCharacterCategory; -import java.io.FileWriter; -import java.io.PrintWriter; -import java.util.Hashtable; -import java.util.Enumeration; - -/** -* A class to compare the difference in methods between java.lang.Character and -* UCharacter -* @author Syn Wee Quek -* @since oct 06 2000 -* @see com.ibm.text.UCharacter -*/ - -public final class UCharacterCompare -{ - // private variables ================================================ - - private static Hashtable m_hashtable_ = new Hashtable(); - - // public methods ====================================================== - - /** - * Main testing method - */ - public static void main(String arg[]) - { - try - { - FileWriter f; - if (arg.length == 0) - f = new FileWriter("compare.txt"); - else - f = new FileWriter(arg[0]); - PrintWriter p = new PrintWriter(f); - p.print("char character name "); - p.println("method name ucharacter character"); - for (char i = Character.MIN_VALUE; i < Character.MAX_VALUE; i ++) - { - if (UCharacter.isDefined(i) != Character.isDefined(i)) - trackDifference(p, i, "isDefined()", "" + UCharacter.isDefined(i), - "" + Character.isDefined(i)); - else - { - if (UCharacter.digit(i, 10) != Character.digit(i, 10)) - trackDifference(p, i, "digit()", "" + UCharacter.digit(i, 10), - "" + Character.digit(i, 10)); - if (UCharacter.getNumericValue(i) != Character.getNumericValue(i)) - trackDifference(p, i, "getNumericValue()", - "" + UCharacter.getNumericValue(i), - "" + Character.getNumericValue(i)); - if (!compareType(UCharacter.getType(i), Character.getType(i))) - trackDifference(p, i, "getType()", "" + UCharacter.getType(i), - "" + Character.getType(i)); - if (UCharacter.isDigit(i) != Character.isDigit(i)) - trackDifference(p, i, "isDigit()", - "" + UCharacter.isDigit(i), - "" + Character.isDigit(i)); - if (UCharacter.isISOControl(i) != Character.isISOControl(i)) - trackDifference(p, i, "isISOControl()", - "" + UCharacter.isISOControl(i), - "" + Character.isISOControl(i)); - if (UCharacter.isLetter(i) != Character.isLetter(i)) - trackDifference(p, i, "isLetter()", "" + UCharacter.isLetter(i), - "" + Character.isLetter(i)); - if (UCharacter.isLetterOrDigit(i) != Character.isLetterOrDigit(i)) - trackDifference(p, i, "isLetterOrDigit()", - "" + UCharacter.isLetterOrDigit(i), - "" + Character.isLetterOrDigit(i)); - if (UCharacter.isLowerCase(i) != Character.isLowerCase(i)) - trackDifference(p, i, "isLowerCase()", - "" + UCharacter.isLowerCase(i), - "" + Character.isLowerCase(i)); - if (UCharacter.isWhitespace(i) != Character.isWhitespace(i)) - trackDifference(p, i, "isWhitespace()", - "" + UCharacter.isWhitespace(i), - "" + Character.isWhitespace(i)); - if (UCharacter.isSpaceChar(i) != Character.isSpaceChar(i)) - trackDifference(p, i, "isSpaceChar()", - "" + UCharacter.isSpaceChar(i), - "" + Character.isSpaceChar(i)); - if (UCharacter.isTitleCase(i) != Character.isTitleCase(i)) - trackDifference(p, i, "isTitleChar()", - "" + UCharacter.isTitleCase(i), - "" + Character.isTitleCase(i)); - if (UCharacter.isUnicodeIdentifierPart(i) != - Character.isUnicodeIdentifierPart(i)) - trackDifference(p, i, "isUnicodeIdentifierPart()", - "" + UCharacter.isUnicodeIdentifierPart(i), - "" + Character.isUnicodeIdentifierPart(i)); - if (UCharacter.isUnicodeIdentifierStart(i) != - Character.isUnicodeIdentifierStart(i)) - trackDifference(p, i, "isUnicodeIdentifierStart()", - "" + UCharacter.isUnicodeIdentifierStart(i), - "" + Character.isUnicodeIdentifierStart(i)); - if (UCharacter.isIdentifierIgnorable(i) != - Character.isIdentifierIgnorable(i)) - trackDifference(p, i, "isIdentifierIgnorable()", - "" + UCharacter.isIdentifierIgnorable(i), - "" + Character.isIdentifierIgnorable(i)); - if (UCharacter.isUpperCase(i) != Character.isUpperCase(i)) - trackDifference(p, i, "isUpperCase()", - "" + UCharacter.isUpperCase(i), - "" + Character.isUpperCase(i)); - if (UCharacter.toLowerCase(i) != Character.toLowerCase(i)) - trackDifference(p, i, "toLowerCase()", - Integer.toHexString(UCharacter.toLowerCase(i)), - Integer.toHexString(Character.toLowerCase(i))); - if (!UCharacter.toString(i).equals(new Character(i).toString())) - trackDifference(p, i, "toString()", - UCharacter.toString(i), - new Character(i).toString()); - if (UCharacter.toTitleCase(i) != Character.toTitleCase(i)) - trackDifference(p, i, "toTitleCase()", - Integer.toHexString(UCharacter.toTitleCase(i)), - Integer.toHexString(Character.toTitleCase(i))); - if (UCharacter.toUpperCase(i) != Character.toUpperCase(i)) - trackDifference(p, i, "toUpperCase()", - Integer.toHexString(UCharacter.toUpperCase(i)), - Integer.toHexString(Character.toUpperCase(i))); - } - } - summary(p); - p.close(); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - - // private methods =================================================== - - /** - * Comparing types - * @param uchartype UCharacter type - * @param jchartype java.lang.Character type - */ - private static boolean compareType(int uchartype, int jchartype) - { - if (uchartype == UCharacterCategory.UNASSIGNED && - jchartype == Character.UNASSIGNED) - return true; - if (uchartype == UCharacterCategory.UPPERCASE_LETTER && - jchartype == Character.UPPERCASE_LETTER) - return true; - if (uchartype == UCharacterCategory.LOWERCASE_LETTER && - jchartype == Character.LOWERCASE_LETTER) - return true; - if (uchartype == UCharacterCategory.TITLECASE_LETTER && - jchartype == Character.TITLECASE_LETTER) - return true; - if (uchartype == UCharacterCategory.MODIFIER_LETTER && - jchartype == Character.MODIFIER_LETTER) - return true; - if (uchartype == UCharacterCategory.OTHER_LETTER && - jchartype == Character.OTHER_LETTER) - return true; - if (uchartype == UCharacterCategory.NON_SPACING_MARK && - jchartype == Character.NON_SPACING_MARK) - return true; - if (uchartype == UCharacterCategory.ENCLOSING_MARK && - jchartype == Character.ENCLOSING_MARK) - return true; - if (uchartype == UCharacterCategory.COMBINING_SPACING_MARK && - jchartype == Character.COMBINING_SPACING_MARK) - return true; - if (uchartype == UCharacterCategory.DECIMAL_DIGIT_NUMBER && - jchartype == Character.DECIMAL_DIGIT_NUMBER) - return true; - if (uchartype == UCharacterCategory.LETTER_NUMBER && - jchartype == Character.LETTER_NUMBER) - return true; - if (uchartype == UCharacterCategory.OTHER_NUMBER && - jchartype == Character.OTHER_NUMBER) - return true; - if (uchartype == UCharacterCategory.SPACE_SEPARATOR && - jchartype == Character.SPACE_SEPARATOR) - return true; - if (uchartype == UCharacterCategory.LINE_SEPARATOR && - jchartype == Character.LINE_SEPARATOR) - return true; - if (uchartype == UCharacterCategory.PARAGRAPH_SEPARATOR && - jchartype == Character.PARAGRAPH_SEPARATOR) - return true; - if (uchartype == UCharacterCategory.CONTROL && - jchartype == Character.CONTROL) - return true; - if (uchartype == UCharacterCategory.FORMAT && - jchartype == Character.FORMAT) - return true; - if (uchartype == UCharacterCategory.PRIVATE_USE && - jchartype == Character.PRIVATE_USE) - return true; - if (uchartype == UCharacterCategory.SURROGATE && - jchartype == Character.SURROGATE) - return true; - if (uchartype == UCharacterCategory.DASH_PUNCTUATION && - jchartype == Character.DASH_PUNCTUATION) - return true; - if (uchartype == UCharacterCategory.START_PUNCTUATION && - jchartype == Character.START_PUNCTUATION) - return true; - if (uchartype == UCharacterCategory.END_PUNCTUATION && - jchartype == Character.END_PUNCTUATION) - return true; - if (uchartype == UCharacterCategory.CONNECTOR_PUNCTUATION && - jchartype == Character.CONNECTOR_PUNCTUATION) - return true; - if (uchartype == UCharacterCategory.OTHER_PUNCTUATION && - jchartype == Character.OTHER_PUNCTUATION) - return true; - if (uchartype == UCharacterCategory.MATH_SYMBOL && - jchartype == Character.MATH_SYMBOL) - return true; - if (uchartype == UCharacterCategory.CURRENCY_SYMBOL && - jchartype == Character.CURRENCY_SYMBOL) - return true; - if (uchartype == UCharacterCategory.MODIFIER_SYMBOL && - jchartype == Character.MODIFIER_SYMBOL) - return true; - if (uchartype == UCharacterCategory.OTHER_SYMBOL && - jchartype == Character.OTHER_SYMBOL) - return true; - if (uchartype == UCharacterCategory.INITIAL_PUNCTUATION && - jchartype == Character.START_PUNCTUATION) - return true; - if (uchartype == UCharacterCategory.FINAL_PUNCTUATION && - jchartype == Character.END_PUNCTUATION) - return true; - /*if (uchartype == UCharacterCategory.GENERAL_OTHER_TYPES && - jchartype == Character.GENERAL_OTHER_TYPES) - return true;*/ - return false; - } - - /** - * Difference writing to file - * @param f file outputstream - * @param ch code point - * @param method for testing - * @param ucharval UCharacter value after running method - * @param charval Character value after running method - * @exception thrown when error occur in writing to file - */ - private static void trackDifference(PrintWriter f, int ch, String method, - String ucharval, String charval) - throws Exception - { - if (m_hashtable_.containsKey(method)) - { - Integer value = (Integer)m_hashtable_.get(method); - m_hashtable_.put(method, new Integer(value.intValue() + 1)); - } - else - m_hashtable_.put(method, new Integer(1)); - - String temp = Integer.toHexString(ch); - StringBuffer s = new StringBuffer(temp); - for (int i = 0; i < 6 - temp.length(); i ++) - s.append(' '); - temp = UCharacter.getName(ch); - if (temp == null) - temp = " "; - s.append(temp); - for (int i = 0; i < 73 - temp.length(); i ++) - s.append(' '); - - s.append(method); - for (int i = 0; i < 27 - method.length(); i ++) - s.append(' '); - s.append(ucharval); - for (int i = 0; i < 11 - ucharval.length(); i ++) - s.append(' '); - s.append(charval); - f.println(s.toString()); - } - - /** - * Does up a summary of the differences - * @param f file outputstream - */ - private static void summary(PrintWriter f) - { - f.println("=================================================="); - f.println("Summary of differences"); - for (Enumeration e = m_hashtable_.keys() ; e.hasMoreElements() ;) - { - StringBuffer method = new StringBuffer((String)e.nextElement()); - int count = ((Integer)m_hashtable_.get(method.toString())).intValue(); - for (int i = 30 - method.length(); i > 0; i --) - method.append(' '); - f.println(method + " " + count); - } - } -} - diff --git a/icu4j/src/com/ibm/icu/test/text/UCharacterTest.java b/icu4j/src/com/ibm/icu/test/text/UCharacterTest.java deleted file mode 100755 index 1ed8e2862e..0000000000 --- a/icu4j/src/com/ibm/icu/test/text/UCharacterTest.java +++ /dev/null @@ -1,1061 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/text/Attic/UCharacterTest.java,v $ -* $Date: 2002/02/15 02:53:32 $ -* $Revision: 1.22 $ -* -******************************************************************************* -*/ - -package com.ibm.icu.test.text; - -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.FileNotFoundException; -import java.util.Locale; -import java.io.File; -import java.util.Vector; -import com.ibm.test.TestFmwk; -import com.ibm.text.UCharacter; -import com.ibm.text.UCharacterCategory; -import com.ibm.text.UCharacterDirection; -import com.ibm.icu.util.RangeValueIterator; -import com.ibm.text.UTF16; -import com.ibm.util.Utility; - -/** -* Testing class for UCharacter -* Mostly following the test cases for ICU -* @author Syn Wee Quek -* @since nov 04 2000 -*/ -public final class UCharacterTest extends TestFmwk -{ - // private variables ============================================= - - /** - * ICU4J data version number - */ - private final String VERSION_ = "3.1.1.0"; - - // constructor =================================================== - - /** - * Constructor - */ - public UCharacterTest() - { - } - - // public methods ================================================ - - /** - * Testing the uppercase and lowercase function of UCharacter - */ - public void TestUpperLower() - { - // variables to test the uppercase and lowercase characters - int upper[] = {0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0xb1, 0xb2, - 0xb3, 0x48, 0x49, 0x4a, 0x2e, 0x3f, 0x3a, 0x4b, 0x4c, - 0x4d, 0x4e, 0x4f, 0x01c4, 0x01c8, 0x000c, 0x0000}; - int lower[] = {0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0xb1, 0x00b2, - 0xb3, 0x68, 0x69, 0x6a, 0x2e, 0x3f, 0x3a, 0x6b, 0x6c, - 0x6d, 0x6e, 0x6f, 0x01c6, 0x01c9, 0x000c, 0x0000}; - - int size = upper.length; - - for (int i = 0; i < size; i ++) - { - if (UCharacter.isLetter(lower[i]) && !UCharacter.isLowerCase(lower[i])) - { - errln("FAIL isLowerCase test for \\u" + hex(lower[i])); - break; - } - if (UCharacter.isLetter(upper[i]) && !(UCharacter.isUpperCase(upper[i]) - || UCharacter.isTitleCase(upper[i]))) - { - errln("FAIL isUpperCase test for \\u" + hex(upper[i])); - break; - } - if (lower[i] != UCharacter.toLowerCase(upper[i]) || - (upper[i] != UCharacter.toUpperCase(lower[i]) && - upper[i] != UCharacter.toTitleCase(lower[i]))) - { - errln("FAIL case conversion test for \\u" + hex(upper[i]) + " to \\u" - + hex(lower[i])); - break; - } - if (lower[i] != UCharacter.toLowerCase(lower[i])) - { - errln("FAIL lower case conversion test for \\u" + hex(lower[i])); - break; - } - if (upper[i] != UCharacter.toUpperCase(upper[i]) && - upper[i] != UCharacter.toTitleCase(upper[i])) - { - errln("FAIL upper case conversion test for \\u" + hex(upper[i])); - break; - } - logln("Ok \\u" + hex(upper[i]) + " and \\u" + hex(lower[i])); - } - } - - /** - * Testing the letter and number determination in UCharacter - */ - public void TestLetterNumber() - { - for (int i = 0x0041; i < 0x005B; i ++) - if (!UCharacter.isLetter(i)) - errln("FAIL \\u" + hex(i) + " expected to be a letter"); - - for (int i = 0x0660; i < 0x066A; i ++) - if (UCharacter.isLetter(i)) - errln("FAIL \\u" + hex(i) + " expected not to be a letter"); - - for (int i = 0x0660; i < 0x066A; i ++) - if (!UCharacter.isDigit(i)) - errln("FAIL \\u" + hex(i) + " expected to be a digit"); - - for (int i = 0x0041; i < 0x005B; i ++) - if (!UCharacter.isLetterOrDigit(i)) - errln("FAIL \\u" + hex(i) + " expected not to be a digit"); - - for (int i = 0x0660; i < 0x066A; i ++) - if (!UCharacter.isLetterOrDigit(i)) - errln("FAIL \\u" + hex(i) + - "expected to be either a letter or a digit"); - } - - /** - * Tests for space determination in UCharacter - */ - public void TestSpaces() - { - int spaces[] = {0x0020, 0x00a0, 0x2000, 0x2001, 0x2005}; - int nonspaces[] = {0x61, 0x62, 0x63, 0x64, 0x74}; - int whitespaces[] = {0x2008, 0x2009, 0x200a, 0x001c, 0x000c}; - int nonwhitespaces[] = {0x61, 0x62, 0x3c, 0x28, 0x3f}; - - int size = spaces.length; - for (int i = 0; i < size; i ++) - { - if (!UCharacter.isSpaceChar(spaces[i])) - { - errln("FAIL \\u" + hex(spaces[i]) + - " expected to be a space character"); - break; - } - - if (UCharacter.isSpaceChar(nonspaces[i])) - { - errln("FAIL \\u" + hex(nonspaces[i]) + - " expected not to be space character"); - break; - } - - if (!UCharacter.isWhitespace(whitespaces[i])) - { - errln("FAIL \\u" + hex(whitespaces[i]) + - " expected to be a white space character"); - break; - } - if (UCharacter.isWhitespace(nonwhitespaces[i])) - { - errln("FAIL \\u" + hex(nonwhitespaces[i]) + - " expected not to be a space character"); - break; - } - logln("Ok \\u" + hex(spaces[i]) + " and \\u" + hex(nonspaces[i]) + - " and \\u" + hex(whitespaces[i]) + " and \\u" + - hex(nonwhitespaces[i])); - } - } - - /** - * Tests for defined and undefined characters - */ - public void TestDefined() - { - int undefined[] = {0xfff1, 0xfff7, 0xfa30}; - int defined[] = {0x523E, 0x4f88, 0xfffd}; - - int size = undefined.length; - for (int i = 0; i < size; i ++) - { - if (UCharacter.isDefined(undefined[i])) - { - errln("FAIL \\u" + hex(undefined[i]) + - " expected not to be defined"); - break; - } - if (!UCharacter.isDefined(defined[i])) - { - errln("FAIL \\u" + hex(defined[i]) + " expected defined"); - break; - } - } - } - - /** - * Tests for base characters and their cellwidth - */ - public void TestBase() - { - int base[] = {0x0061, 0x0031, 0x03d2}; - int nonbase[] = {0x002B, 0x0020, 0x203B}; - int size = base.length; - for (int i = 0; i < size; i ++) - { - if (UCharacter.isBaseForm(nonbase[i])) - { - errln("FAIL \\u" + hex(nonbase[i]) + - " expected not to be a base character"); - break; - } - if (!UCharacter.isBaseForm(base[i])) - { - errln("FAIL \\u" + hex(base[i]) + " expected to be a base character"); - break; - } - } - } - - /** - * Tests for digit characters - */ - public void TestDigits() - { - int digits[] = {0x0030, 0x0662, 0x0F23, 0x0ED5, 0x2160}; - - //special characters not in the properties table - int digits2[] = {0x3007, 0x4e00, 0x4e8c, 0x4e09, 0x56d8, 0x4e94, 0x516d, - 0x4e03, 0x516b, 0x4e5d}; - int nondigits[] = {0x0010, 0x0041, 0x0122, 0x68FE}; - - int digitvalues[] = {0, 2, 3, 5, 1}; - int digitvalues2[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; - - int size = digits.length; - for (int i = 0; i < size; i ++) - if (UCharacter.isDigit(digits[i]) && - UCharacter.digit(digits[i]) != digitvalues[i]) - { - errln("FAIL \\u" + hex(digits[i]) + - " expected digit with value " + digitvalues[i]); - break; - } - - size = nondigits.length; - for (int i = 0; i < size; i ++) - if (UCharacter.isDigit(nondigits[i])) - { - errln("FAIL \\u" + hex(nondigits[i]) + " expected nondigit"); - break; - } - - size = digits2.length; - for (int i = 0; i < 10; i ++) - if (UCharacter.isDigit(digits2[i]) && - UCharacter.digit(digits2[i]) != digitvalues2[i]) - { - errln("FAIL \\u" + hex(digits2[i]) + - " expected digit with value " + digitvalues2[i]); - break; - } - } - - /** - * Tests for version - */ - public void TestVersion() - { - String version = UCharacter.getUnicodeVersion(); - if (!version.equals(VERSION_)) - errln("FAIL expected " + VERSION_); - } - - /** - * Tests for control characters - */ - /* isControl is deprecated - public void TestControl() - { - int control[] = {0x001b, 0x0097, 0x0082}; - int noncontrol[] = {0x61, 0x0031, 0x00e2}; - - int size = control.length; - for (int i = 0; i < size; i ++) - { - if (!UCharacter.isControl(control[i])) - { - errln("FAIL 0x" + Integer.toHexString(control[i]) + - " expected to be a control character"); - break; - } - if (UCharacter.isControl(noncontrol[i])) - { - errln("FAIL 0x" + Integer.toHexString(noncontrol[i]) + - " expected to be not a control character"); - break; - } - - logln("Ok 0x" + Integer.toHexString(control[i]) + " and 0x" + - Integer.toHexString(noncontrol[i])); - } - } - */ - - /** - * Tests for printable characters - */ - public void TestPrint() - { - int printable[] = {0x0042, 0x005f, 0x2014}; - int nonprintable[] = {0x200c, 0x009f, 0x001b}; - - int size = printable.length; - for (int i = 0; i < size; i ++) - { - if (!UCharacter.isPrintable(printable[i])) - { - errln("FAIL \\u" + hex(printable[i]) + - " expected to be a printable character"); - break; - } - if (UCharacter.isPrintable(nonprintable[i])) - { - errln("FAIL \\u" + hex(nonprintable[i]) + - " expected not to be a printable character"); - break; - } - logln("Ok \\u" + hex(printable[i]) + " and \\u" + - hex(nonprintable[i])); - } - - // test all ISO 8 controls - for (int ch = 0; ch <= 0x9f; ++ ch) { - if (ch == 0x20) { - // skip ASCII graphic characters and continue with DEL - ch = 0x7f; - } - if (UCharacter.isPrintable(ch)) { - errln("Fail \\u" + hex(ch) + - " is a ISO 8 control character hence not printable\n"); - } - } - - /* test all Latin-1 graphic characters */ - for (int ch = 0x20; ch <= 0xff; ++ ch) { - if (ch == 0x7f) { - ch = 0xa0; - } - if (!UCharacter.isPrintable(ch)) { - errln("Fail \\u" + hex(ch) + " is a Latin-1 graphic character\n"); - } - } - } - - /** - * Testing for identifier characters - */ - public void TestIdentifier() - { - int unicodeidstart[] = {0x0250, 0x00e2, 0x0061}; - int nonunicodeidstart[] = {0x2000, 0x000a, 0x2019}; - int unicodeidpart[] = {0x005f, 0x0032, 0x0045}; - int nonunicodeidpart[] = {0x2030, 0x00a3, 0x0020}; - int idignore[] = {0x070F, 0x180B, 0x180C}; - int nonidignore[] = {0x0075, 0x00a3, 0x0061}; - - int size = unicodeidstart.length; - for (int i = 0; i < size; i ++) - { - if (!UCharacter.isUnicodeIdentifierStart(unicodeidstart[i])) - { - errln("FAIL \\u" + hex(unicodeidstart[i]) + - " expected to be a unicode identifier start character"); - break; - } - if (UCharacter.isUnicodeIdentifierStart(nonunicodeidstart[i])) - { - errln("FAIL \\u" + hex(nonunicodeidstart[i]) + - " expected not to be a unicode identifier start character"); - break; - } - if (!UCharacter.isUnicodeIdentifierPart(unicodeidpart[i])) - { - errln("FAIL \\u" + hex(unicodeidpart[i]) + - " expected to be a unicode identifier part character"); - break; - } - if (UCharacter.isUnicodeIdentifierPart(nonunicodeidpart[i])) - { - errln("FAIL \\u" + hex(nonunicodeidpart[i]) + - " expected not to be a unicode identifier part character"); - break; - } - if (!UCharacter.isIdentifierIgnorable(idignore[i])) - { - errln("FAIL \\u" + hex(idignore[i]) + - " expected to be a ignorable unicode character"); - break; - } - if (UCharacter.isIdentifierIgnorable(nonidignore[i])) - { - errln("FAIL \\u" + hex(nonidignore[i]) + - " expected not to be a ignorable unicode character"); - break; - } - logln("Ok \\u" + hex(unicodeidstart[i]) + " and \\u" + - hex(nonunicodeidstart[i]) + " and \\u" + hex(unicodeidpart[i]) + - " and \\u" + hex(nonunicodeidpart[i]) + " and \\u" + - hex(idignore[i]) + " and \\u" + hex(nonidignore[i])); - } - } - - /** - * Tests for the character types, direction.
- * This method reads in UnicodeData.txt file for testing purposes. A default - * path is provided relative to the src path, however the user could - * set a system property to change the directory path.
- * e.g. java -DUnicodeData="data_directory_path" - * com.ibm.test.text.UCharacterTest - */ - public void TestUnicodeData() - { - // this is the 2 char category types used in the UnicodeData file - final String TYPE = - "LuLlLtLmLoMnMeMcNdNlNoZsZlZpCcCfCoCsPdPsPePcPoSmScSkSoPiPf"; - - // directory types used in the UnicodeData file - // padded by spaces to make each type size 4 - final String DIR = - "L R EN ES ET AN CS B S WS ON LRE LRO AL RLE RLO PDF NSM BN "; - - // default unicode data file name - final String UNICODE_DATA_FILE = "src//data//unicode//UnicodeData.txt"; - - // unicode data file path system name - final String UNICODE_DATA_SYSTEM_NAME = "UnicodeData"; - String s = System.getProperty(UNICODE_DATA_SYSTEM_NAME); - if (s == null) { - // assuming runtime directory is on the same level as the source - s = System.getProperty("user.dir") + "//..//" + UNICODE_DATA_FILE; - } - else { - StringBuffer tempfilename = new StringBuffer(s); - if (tempfilename.charAt(tempfilename.length() - 1) != - File.pathSeparatorChar) { - tempfilename.append(File.separatorChar); - } - tempfilename.append("UnicodeData.txt"); - s = tempfilename.toString(); - } - - final int LASTUNICODECHAR = 0xFFFD; - int ch = 0, - index = 0, - type = 0, - dir = 0; - - try - { - // reading in the UnicodeData file - FileReader fr = new FileReader(s); - BufferedReader input = new BufferedReader(fr); - - while (ch != LASTUNICODECHAR) - { - s= input.readLine(); - - // geting the unicode character, its type and its direction - ch = Integer.parseInt(s.substring(0, 4), 16); - index = s.indexOf(';', 5); - String t = s.substring(index + 1, index + 3); - index += 4; - int cc = Integer.parseInt(s.substring(index, s.indexOf(';', index))); - index = s.indexOf(';', index); - String d = s.substring(index + 1, s.indexOf(';', index + 1)); - - // testing the category - // we override the general category of some control characters - if (ch == 9 || ch == 0xb || ch == 0x1f) - type = UCharacterCategory.SPACE_SEPARATOR; - else - if (ch == 0xc) - type = UCharacterCategory.LINE_SEPARATOR; - else - if (ch == 0xa || ch == 0xd || ch == 0x1c || ch == 0x1d || - ch == 0x1e || ch == 0x85) - type = UCharacterCategory.PARAGRAPH_SEPARATOR; - else - { - type = TYPE.indexOf(t); - if (type < 0) - type = 0; - else - type = (type >> 1) + 1; - } - - if (UCharacter.getType(ch) != type) - { - errln("FAIL \\u" + hex(ch) + " expected type " + - type); - break; - } - - // testing combining class - if (UCharacter.getCombiningClass(ch) != cc) - { - errln("FAIL \\u" + hex(ch) + " expected combining " + - "class " + cc); - break; - } - - // testing the direction - if (d.length() == 1) - d = d + " "; - - dir = DIR.indexOf(d) >> 2; - if (UCharacter.getDirection(ch) != dir) - { - errln("FAIL \\u" + hex(ch) + - " expected wrong direction " + dir); - break; - } - } - input.close(); - } - catch (FileNotFoundException e) - { - errln("FAIL UnicodeData.txt not found\n" + - "Configure the system setting UnicodeData to the right path\n" + - "e.g. java -DUnicodeData=\"data_dir_path\" " + - "com.ibm.icu.test.text.UCharacterTest"); - } - catch (Exception e) - { - e.printStackTrace(); - } - - if (UCharacter.getDirection(0x10001) != - UCharacterDirection.LEFT_TO_RIGHT) - errln("FAIL 0x10001 expected direction " + - UCharacterDirection.toString(UCharacterDirection.LEFT_TO_RIGHT)); - } - - - /** - * Test for the character names - */ - public void TestNames() - { - int c[] = {0x0061, 0x0284, 0x3401, 0x7fed, 0xac00, 0xd7a3, 0xd800, 0xdc00, - 0xff08, 0xffe5, 0xffff, 0x23456, 0x9}; - String name[] = {"LATIN SMALL LETTER A", - "LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK", - "CJK UNIFIED IDEOGRAPH-3401", - "CJK UNIFIED IDEOGRAPH-7FED", "HANGUL SYLLABLE GA", - "HANGUL SYLLABLE HIH", "", "", - "FULLWIDTH LEFT PARENTHESIS", - "FULLWIDTH YEN SIGN", "", "CJK UNIFIED IDEOGRAPH-23456", - ""}; - String oldname[] = {"", "LATIN SMALL LETTER DOTLESS J BAR HOOK", "", "", - "", "", "", "", "FULLWIDTH OPENING PARENTHESIS", "", - "", "", "HORIZONTAL TABULATION"}; - String extendedname[] = {"LATIN SMALL LETTER A", - "LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK", - "CJK UNIFIED IDEOGRAPH-3401", - "CJK UNIFIED IDEOGRAPH-7FED", - "HANGUL SYLLABLE GA", - "HANGUL SYLLABLE HIH", - "", - "", - "FULLWIDTH LEFT PARENTHESIS", - "FULLWIDTH YEN SIGN", - "", - "CJK UNIFIED IDEOGRAPH-23456", - "HORIZONTAL TABULATION"}; - - int size = c.length; - String str; - int uc; - - for (int i = 0; i < size; i ++) - { - // modern Unicode character name - str = UCharacter.getName(c[i]); - if ((str == null && name[i].length() > 0) || - (str != null && !str.equals(name[i]))) - { - errln("FAIL \\u" + hex(c[i]) + " expected name " + - name[i]); - break; - } - - // 1.0 Unicode character name - str = UCharacter.getName1_0(c[i]); - if ((str == null && oldname[i].length() > 0) || - (str != null && !str.equals(oldname[i]))) - { - errln("FAIL \\u" + hex(c[i]) + " expected 1.0 name " + - oldname[i]); - break; - } - - // extended character name - str = UCharacter.getExtendedName(c[i]); - if (str == null || !str.equals(extendedname[i])) - { - errln("FAIL \\u" + hex(c[i]) + " expected extended name " + - extendedname[i]); - break; - } - - // retrieving unicode character from modern name - uc = UCharacter.getCharFromName(name[i]); - if (uc != c[i] && name[i].length() != 0) - { - errln("FAIL " + name[i] + " expected character \\u" + hex(c[i])); - break; - } - - //retrieving unicode character from 1.0 name - uc = UCharacter.getCharFromName1_0(oldname[i]); - if (uc != c[i] && oldname[i].length() != 0) - { - errln("FAIL " + oldname[i] + " expected 1.0 character \\u" + hex(c[i])); - break; - } - - //retrieving unicode character from 1.0 name - uc = UCharacter.getCharFromExtendedName(extendedname[i]); - if (uc != c[i] && i != 0 && (i == 1 || i == 6)) - { - errln("FAIL " + extendedname[i] + " expected extended character \\u" + hex(c[i])); - break; - } - } - - // test getName works with mixed-case names (new in 2.0) - if (0x61 != UCharacter.getCharFromName("LATin smALl letTER A")) { - errln( - "FAIL: 'LATin smALl letTER A' should result in character U+0061"); - } - - - // extra testing different from icu - for (int i = UCharacter.MIN_VALUE; i < UCharacter.MAX_VALUE; i ++) - { - str = UCharacter.getName(i); - if (str != null && UCharacter.getCharFromName(str) != i) - { - errln("FAIL \\u" + hex(i) + " " + str + - " retrieval of name and vice versa" ); - break; - } - } - } - - /** - * Testing the for illegal characters - */ - public void TestIsLegal() - { - int illegal[] = {0xFFFE, 0xFFFF, 0x5FFFE, 0x5FFFF, 0x10FFFE, 0x10FFFF, - 0x110000, 0xFDD0, 0xFDDF, 0xFDE0, 0xFDEF}; - int legal[] = {0x61, 0xFFFD, 0x10000, 0x5FFFD, 0x60000, 0x10FFFD, - 0xFDCF, 0xFDF0}; - for (int count = 0; count < illegal.length; count ++) { - if (UCharacter.isLegal(illegal[count])) { - errln("FAIL \\u" + hex(illegal[count]) + - " is not a legal character"); - } - } - - for (int count = 0; count < legal.length; count ++) { - if (!UCharacter.isLegal(legal[count])) { - errln("FAIL \\u" + hex(legal[count]) + " is a legal character"); - } - } - } - - public void TestCaseFolding() - { - int simple[] = { - // input, default, exclude special i - 0x61, 0x61, 0x61, - 0x49, 0x69, 0x69, - 0x131, 0x69, 0x131, - 0xdf, 0xdf, 0xdf, - 0xfb03, 0xfb03, 0xfb03, - 0x5ffff,0x5ffff,0x5ffff - }; - - // TODO after ICU 1.8: if u_getUnicodeVersion() >= 3.1.0.0 then test - // exclude-special-i cases as well - - // test simple case folding - for (int i = 0; i < simple.length; i += 3) { - if (UCharacter.foldCase(simple[i], true) != simple[i + 1]) { - errln("FAIL: foldCase(\\u" + hex(simple[i]) + - ", true) should be \\u" + hex(simple[i + 1])); - return; - } - } - - // test full string case folding with default option and separate buffers - String mixed = "\u0061\u0042\u0131\u03d0\u00df\ufb03\ud93f\udfff", - // not used foldedExcludeSpecialI = "\u0061\u0062\u0131\u03c2\u0073\u0073\u0066\u0066\u0069\ud93f\udfff", - foldedDefault = "\u0061\u0062\u0069\u03b2\u0073\u0073\u0066\u0066\u0069\ud93f\udfff"; - // foldedExcludeSpecialI = "\u0061\u0062\u0131\u03b2\u0073\u0073\u0066\u0066\u0069\ud93f\udfff"; - String foldedstr = UCharacter.foldCase(mixed, true); - if (!foldedDefault.equals(foldedstr)) { - errln("FAIL: foldCase(\\uabcd, true) should be " + foldedDefault); - } - - String str1 = "A\u00df\u00b5\ufb03\uD801\uDC0C\u0131", - str2 = "ass\u03bcffi\uD801\uDC34i", - str3 = "ass\u03bcffi\uD801\uDC34\u0131"; - if (!str2.equals(UCharacter.foldCase(str1, true))) { - errln("FAIL: foldCase(" + hex(str1) + ") should be " + hex(str2)); - } - - // alternate handling for dotted I/dotless i (U+0130, U+0131) - if (!str3.equals(UCharacter.foldCase(str1, false))) { - errln("FAIL: foldCase(" + hex(str1) + " should be " + hex(str3)); - } - - // ### TODO: add the following tests similar to TestCaseMapping, follow icu's test cases - - // test full string case folding with default option and in the same buffer - - // test preflighting - - // test error handling - } - - /** - * Testing the strings case mapping methods - */ - public void TestCaseMapping() - { - String beforeLower = "\u0061\u0042\u0049\u03a3\u00df\u03a3\u002f\ud93f\udfff", - lowerRoot = "\u0061\u0062\u0069\u03c3\u00df\u03c2\u002f\ud93f\udfff", - lowerTurkish = "\u0061\u0062\u0131\u03c3\u00df\u03c2\u002f\ud93f\udfff", - beforeUpper = "\u0061\u0042\u0069\u03c2\u00df\u03c3\u002f\ufb03\ud93f\udfff", - upperRoot = "\u0041\u0042\u0049\u03a3\u0053\u0053\u03a3\u002f\u0046\u0046\u0049\ud93f\udfff", - upperTurkish = "\u0041\u0042\u0130\u03a3\u0053\u0053\u03a3\u002f\u0046\u0046\u0049\ud93f\udfff"; - - String result = UCharacter.toLowerCase(beforeLower); - if (!lowerRoot.equals(result)) - errln("Fail " + beforeLower + " after lowercase should be " + lowerRoot); - - // lowercase with turkish locale - result = UCharacter.toLowerCase(new Locale("tr", "TR"), beforeLower); - if (!lowerTurkish.equals(result)) - errln("Fail " + beforeLower + " after turkish-sensitive lowercase " + - "should be " + lowerRoot); - - // uppercase with root locale and in the same buffer - result = UCharacter.toUpperCase(beforeUpper); - if (!upperRoot.equals(result)) - errln("Fail " + beforeUpper + " after uppercase should be " + upperRoot); - - // uppercase with turkish locale and separate buffers - result = UCharacter.toUpperCase(new Locale("tr", "TR"), beforeUpper); - if (!upperTurkish.equals(result)) - errln("Fail " + beforeUpper + " after turkish-sensitive uppercase " + - "should be " + upperTurkish); - - // test preflighting - result = UCharacter.toLowerCase(beforeLower); - if (!lowerRoot.equals(result)) - errln("Fail " + beforeLower + " after lower case should be " + - lowerRoot); - - // testing titlecase, since toTitleCase is a simple API that makes use of - // the transliterator, which has its own test, the test here will be - // simple - /* - String beforeTitle = "the chinese name for a very happy cat is \u5f00\u5fc3\u732b"; - String afterTitle = "The Chinese Name For A Very Happy Cat Is \u5f00\u5fc3\u732b"; - if (!afterTitle.equals(UCharacter.toTitleCase(beforeTitle))) { - errln("Fail " + beforeTitle + " after titlecase " + "should be " + - afterTitle); - } - */ - } - - /** - * Tests for case mapping in the file SpecialCasing.txt - * This method reads in SpecialCasing.txt file for testing purposes. - * A default path is provided relative to the src path, however the user - * could set a system property to change the directory path.
- * e.g. java -DUnicodeData="data_dir_path" com.ibm.test.text.UCharacterTest - */ - public void TestSpecialCasing() - { - // default unicode data file name - final String SPECIALCASING_FILE = "src//data//unicode//SpecialCasing.txt"; - - // unicode data file path system name - final String UNICODE_DATA_SYSTEM_NAME = "UnicodeData"; - String s = System.getProperty(UNICODE_DATA_SYSTEM_NAME); - if (s == null) { - // assuming runtime directory is on the same level as the source - s = System.getProperty("user.dir") + "//..//" + SPECIALCASING_FILE; - } - else { - StringBuffer tempfilename = new StringBuffer(s); - if (tempfilename.charAt(tempfilename.length() - 1) != - File.pathSeparatorChar) { - tempfilename.append(File.separatorChar); - } - tempfilename.append("SpecialCasing.txt"); - s = tempfilename.toString(); - } - - try - { - // reading in the SpecialCasing file - FileReader fr = new FileReader(s); - BufferedReader input = new BufferedReader(fr); - - while (true) - { - s = input.readLine(); - if (s == null) { - break; - } - if (s.length() == 0 || s.charAt(0) == '#') { - continue; - } - String chstr[] = getUnicodeStrings(s); - if (chstr.length == 5) { - StringBuffer strbuffer = new StringBuffer(chstr[0]); - StringBuffer lowerbuffer = new StringBuffer(chstr[1]); - StringBuffer upperbuffer = new StringBuffer(chstr[3]); - - if (chstr[4].indexOf("AFTER_i NOT_MORE_ABOVE") != -1) { - strbuffer.insert(0, 'i'); - lowerbuffer.insert(0, strbuffer); - upperbuffer.insert(0, (char)(0x130)); - } - else { - if (chstr[4].indexOf("MORE_ABOVE") != -1) { - strbuffer.append((char)0x300); - lowerbuffer.append((char)0x300); - upperbuffer.append((char)0x300); - } - if (chstr[4].indexOf("AFTER_i") != -1) { - strbuffer.insert(0, 'i'); - lowerbuffer.insert(0, 'i'); - upperbuffer.insert(0, 'I'); - } - if (chstr[4].indexOf("FINAL_SIGMA") != -1) { - strbuffer.insert(0, 'c'); - lowerbuffer.insert(0, 'c'); - upperbuffer.insert(0, 'C'); - } - } - if (UCharacter.isLowerCase(chstr[4].charAt(0))) { - Locale locale = new Locale(chstr[4].substring(0, 2), ""); - if (!UCharacter.toLowerCase(locale, - strbuffer.toString()).equals(lowerbuffer.toString())) { - errln(s); - errln("Fail: toLowerCase for locale " + locale + - ", character " + Utility.escape(strbuffer.toString()) + - ", expected " + Utility.escape(lowerbuffer.toString()) - + " but resulted in " + - Utility.escape(UCharacter.toLowerCase(locale, - strbuffer.toString()))); - } - if (!UCharacter.toUpperCase(locale, - strbuffer.toString()).equals(upperbuffer.toString())) { - errln(s); - errln("Fail: toUpperCase for locale " + locale + - ", character " + Utility.escape(strbuffer.toString()) - + ", expected " - + Utility.escape(upperbuffer.toString()) + - " but resulted in " + - Utility.escape(UCharacter.toUpperCase(locale, - strbuffer.toString()))); - } - } - else { - if (!UCharacter.toLowerCase(strbuffer.toString()).equals( - lowerbuffer.toString())) { - errln(s); - errln("Fail: toLowerCase for character " + - Utility.escape(strbuffer.toString()) + ", expected " - + Utility.escape(lowerbuffer.toString()) - + " but resulted in " + - Utility.escape(UCharacter.toLowerCase( - strbuffer.toString()))); - } - if (!UCharacter.toUpperCase(strbuffer.toString()).equals( - upperbuffer.toString())) { - errln(s); - errln("Fail: toUpperCase for character " + - Utility.escape(strbuffer.toString()) + ", expected " - + Utility.escape(upperbuffer.toString()) + - " but resulted in " + - Utility.escape(UCharacter.toUpperCase( - strbuffer.toString()))); - } - } - } - else { - if (!UCharacter.toLowerCase(chstr[0]).equals(chstr[1])) { - errln(s); - errln("Fail: toLowerCase for character " + - Utility.escape(chstr[0]) + ", expected " - + Utility.escape(chstr[1]) + " but resulted in " + - Utility.escape(UCharacter.toLowerCase(chstr[0]))); - } - if (!UCharacter.toUpperCase(chstr[0]).equals(chstr[3])) { - errln(s); - errln("Fail: toUpperCase for character " + - Utility.escape(chstr[0]) + ", expected " - + Utility.escape(chstr[3]) + " but resulted in " + - Utility.escape(UCharacter.toUpperCase(chstr[0]))); - } - } - } - input.close(); - } - catch (FileNotFoundException e) - { - errln("FAIL SpecialCasing.txt not found\n" + - "Configure the system setting UnicodeData to the right path\n" + - "e.g. java -DUnicodeData=\"data_dir_path\" " + - "com.ibm.icu.test.text.UCharacterTest"); - } - catch (Exception e) - { - e.printStackTrace(); - } - - String special = "ab'cD \uFB00i\u0131I\u0130 \u01C7\u01C8\u01C9 " + - UTF16.valueOf(0x1043C) + UTF16.valueOf(0x10414); - String specialUpper = "AB'CD FFIII\u0130 \u01C7\u01C7\u01C7 " + - UTF16.valueOf(0x10414) + UTF16.valueOf(0x10414); - String specialLower = "ab'cd \uFB00i\u0131ii \u01C9\u01C9\u01C9 " + - UTF16.valueOf(0x1043C) + UTF16.valueOf(0x1043C); - String result = UCharacter.toUpperCase(special); - if (!result.equals(specialUpper)) { - errln("Error getting uppercase in special string"); - } - result = UCharacter.toLowerCase(special); - if (!result.equals(specialLower)) { - errln("Error getting lowercase in special string"); - } - } - - /** - * This method is alittle different from the type test in icu4c. - * But combined with testUnicodeData, they basically do the same thing. - */ - public void TestIteration() - { - int limit = 0; - int prevtype = -1; - RangeValueIterator iterator = UCharacter.getTypeIterator(); - RangeValueIterator.Element result = new RangeValueIterator.Element(); - while (iterator.next(result)) { - if (result.start != limit) { - errln("UCharacterEnumeration failed: Ranges not continuous " + - "0x" + Integer.toHexString(result.start)); - } - - limit = result.limit; - if (result.value == prevtype) { - errln("Type of the next set of enumeration should be different"); - } - prevtype = result.value; - /* - System.out.println("start and end " + Integer.toHexString(start) + - " " + Integer.toHexString(end)); - */ - for (int i = result.start; i < limit; i ++) { - int temptype = UCharacter.getType(i); - if (temptype != result.value) { - errln("UCharacterEnumeration failed: Codepoint \\u" + - Integer.toHexString(i) + " should be of type " + - UCharacter.getType(i) + " not " + result.value); - } - } - } - - iterator.reset(); - if (iterator.next(result) == false || result.start != 0) { - System.out.println("result " + result.start); - errln("UCharacterEnumeration reset() failed"); - } - } - - /** - * Converting the hex numbers represented betwee n ';' to Unicode strings - * @param str string to break up into Unicode strings - * @return array of Unicode strings ending with a null - */ - private String[] getUnicodeStrings(String str) - { - Vector v = new Vector(10); - int end = str.indexOf("; "); - int start = 0; - while (end != -1) { - StringBuffer buffer = new StringBuffer(10); - int tempstart = start; - int tempend = str.indexOf(' ', tempstart); - while (tempend != -1 && tempend < end) { - buffer.append((char)Integer.parseInt(str.substring(tempstart, - tempend), 16)); - tempstart = tempend + 1; - tempend = str.indexOf(' ', tempstart); - } - String s = str.substring(tempstart, end); - try { - if (s.length() != 0) { - buffer.append((char)Integer.parseInt(s, 16)); - } - } catch (NumberFormatException e) { - buffer.append(s); - } - start = end + 2; - end = str.indexOf("; ", start); - v.addElement(buffer.toString()); - } - String s = str.substring(start); - if (s.charAt(0) != '#') { - v.addElement(s); - } - int size = v.size(); - String result[] = new String[size]; - for (int i = 0; i < size; i ++) { - result[i] = (String)v.elementAt(i); - } - return result; - } - - public static void main(String[] arg) - { - try - { - UCharacterTest test = new UCharacterTest(); - test.TestNames(); - //test.run(arg); - } - catch (Exception e) - { - e.printStackTrace(); - } - } -} - diff --git a/icu4j/src/com/ibm/icu/test/text/UTF16Test.java b/icu4j/src/com/ibm/icu/test/text/UTF16Test.java deleted file mode 100755 index 4d2a33440d..0000000000 --- a/icu4j/src/com/ibm/icu/test/text/UTF16Test.java +++ /dev/null @@ -1,1083 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/text/Attic/UTF16Test.java,v $ -* $Date: 2002/02/08 01:13:42 $ -* $Revision: 1.10 $ -* -******************************************************************************* -*/ - -package com.ibm.icu.test.text; - -import com.ibm.test.TestFmwk; -import com.ibm.text.UCharacter; -import com.ibm.text.UTF16; -import com.ibm.util.Utility; - -/** -* Testing class for UTF16 -* @author Syn Wee Quek -* @since feb 09 2001 -*/ -public final class UTF16Test extends TestFmwk -{ - // constructor =================================================== - - /** - * Constructor - */ - public UTF16Test() - { - } - - // public methods ================================================ - - /** - * Testing UTF16 class methods append - */ - public void TestAppend() - { - StringBuffer strbuff = new StringBuffer("this is a string "); - char array[] = new char[UCharacter.MAX_VALUE >> 2]; - int strsize = strbuff.length(); - int arraysize = strsize; - - Utility.getChars(strbuff, 0, strsize, array, 0); - for (int i = 1; i < UCharacter.MAX_VALUE; i += 100) - { - UTF16.append(strbuff, i); - arraysize = UTF16.append(array, arraysize, i); - - String arraystr = new String(array, 0, arraysize); - if (!arraystr.equals(strbuff.toString())) { - errln("FAIL Comparing char array append and string append with " - + " 0x" + Integer.toHexString(i)); - } - - // this is to cater for the combination of 0xDBXX 0xDC50 which forms - // a supplementary character - if (i == 0xDC51) { - strsize --; - } - - if (UTF16.countCodePoint(strbuff) != strsize + (i / 100) + 1) { - errln("FAIL Counting code points in string appended with " + - " 0x" + Integer.toHexString(i)); - break; - } - } - } - - /** - * Testing UTF16 class methods bounds - */ - public void TestBounds() - { - StringBuffer strbuff = - //0 12345 6 7 8 9 - new StringBuffer("\udc000123\ud800\udc00\ud801\udc01\ud802"); - String str = strbuff.toString(); - char array[] = str.toCharArray(); - int boundtype[] = {UTF16.SINGLE_CHAR_BOUNDARY, - UTF16.SINGLE_CHAR_BOUNDARY, - UTF16.SINGLE_CHAR_BOUNDARY, - UTF16.SINGLE_CHAR_BOUNDARY, - UTF16.SINGLE_CHAR_BOUNDARY, - UTF16.LEAD_SURROGATE_BOUNDARY, - UTF16.TRAIL_SURROGATE_BOUNDARY, - UTF16.LEAD_SURROGATE_BOUNDARY, - UTF16.TRAIL_SURROGATE_BOUNDARY, - UTF16.SINGLE_CHAR_BOUNDARY}; - int length = str.length(); - for (int i = 0; i < length; i ++) { - if (UTF16.bounds(str, i) != boundtype[i]) { - errln("FAIL checking bound type at index " + i); - } - if (UTF16.bounds(strbuff, i) != boundtype[i]) { - errln("FAIL checking bound type at index " + i); - } - if (UTF16.bounds(array, 0, length, i) != boundtype[i]) { - errln("FAIL checking bound type at index " + i); - } - } - // does not straddle between supplementary character - int start = 4; - int limit = 9; - int subboundtype1[] = {UTF16.SINGLE_CHAR_BOUNDARY, - UTF16.LEAD_SURROGATE_BOUNDARY, - UTF16.TRAIL_SURROGATE_BOUNDARY, - UTF16.LEAD_SURROGATE_BOUNDARY, - UTF16.TRAIL_SURROGATE_BOUNDARY}; - try { - UTF16.bounds(array, start, limit, -1); - errln("FAIL Out of bounds index in bounds should fail"); - } catch (Exception e) { - // getting rid of warnings - System.out.print(""); - } - - for (int i = 0; i < limit - start; i ++) { - if (UTF16.bounds(array, start, limit, i) != subboundtype1[i]) { - errln("FAILED Subarray bounds in [" + start + ", " + limit + - "] expected " + subboundtype1[i] + " at offset " + i); - } - } - - // starts from the mid of a supplementary character - int subboundtype2[] = {UTF16.SINGLE_CHAR_BOUNDARY, - UTF16.LEAD_SURROGATE_BOUNDARY, - UTF16.TRAIL_SURROGATE_BOUNDARY}; - - start = 6; - limit = 9; - for (int i = 0; i < limit - start; i ++) { - if (UTF16.bounds(array, start, limit, i) != subboundtype2[i]) { - errln("FAILED Subarray bounds in [" + start + ", " + limit + - "] expected " + subboundtype2[i] + " at offset " + i); - } - } - - // ends in the mid of a supplementary character - int subboundtype3[] = {UTF16.LEAD_SURROGATE_BOUNDARY, - UTF16.TRAIL_SURROGATE_BOUNDARY, - UTF16.SINGLE_CHAR_BOUNDARY}; - start = 5; - limit = 8; - for (int i = 0; i < limit - start; i ++) { - if (UTF16.bounds(array, start, limit, i) != subboundtype3[i]) { - errln("FAILED Subarray bounds in [" + start + ", " + limit + - "] expected " + subboundtype3[i] + " at offset " + i); - } - } - } - - /** - * Testing UTF16 class methods charAt and charAtCodePoint - */ - public void TestCharAt() - { - StringBuffer strbuff = - new StringBuffer("12345\ud800\udc0167890\ud800\udc02"); - if (UTF16.charAt(strbuff, 0) != '1' || UTF16.charAt(strbuff, 2) != '3' || - UTF16.charAt(strbuff, 5) != 0x10001 || - UTF16.charAt(strbuff, 6) != 0x10001 || - UTF16.charAt(strbuff, 12) != 0x10002 || - UTF16.charAt(strbuff, 13) != 0x10002) { - errln("FAIL Getting character from string buffer error" ); - } - String str = strbuff.toString(); - if (UTF16.charAt(str, 0) != '1' || UTF16.charAt(str, 2) != '3' || - UTF16.charAt(str, 5) != 0x10001 || UTF16.charAt(str, 6) != 0x10001 || - UTF16.charAt(str, 12) != 0x10002 || UTF16.charAt(str, 13) != 0x10002) - { - errln("FAIL Getting character from string error" ); - } - char array[] = str.toCharArray(); - int start = 0; - int limit = str.length(); - if (UTF16.charAt(array, start, limit, 0) != '1' || - UTF16.charAt(array, start, limit, 2) != '3' || - UTF16.charAt(array, start, limit, 5) != 0x10001 || - UTF16.charAt(array, start, limit, 6) != 0x10001 || - UTF16.charAt(array, start, limit, 12) != 0x10002 || - UTF16.charAt(array, start, limit, 13) != 0x10002) { - errln("FAIL Getting character from array error" ); - } - - // check the sub array here. - start = 6; - limit = 13; - try { - UTF16.charAt(array, start, limit, -1); - errln("FAIL out of bounds error expected"); - } catch (Exception e) { - System.out.print(""); - } - try { - UTF16.charAt(array, start, limit, 8); - errln("FAIL out of bounds error expected"); - } catch (Exception e) { - System.out.print(""); - } - if (UTF16.charAt(array, start, limit, 0) != 0xdc01) { - errln("FAIL Expected result in subarray 0xdc01"); - } - if (UTF16.charAt(array, start, limit, 6) != 0xd800) { - errln("FAIL Expected result in subarray 0xd800"); - } - } - - /** - * Testing UTF16 class methods countCodePoint - */ - public void TestCountCodePoint() - { - StringBuffer strbuff = new StringBuffer(""); - if (UTF16.countCodePoint(strbuff) != 0 || - UTF16.countCodePoint("") != 0) { - errln("FAIL Counting code points for empty strings"); - } - - strbuff = new StringBuffer("this is a string "); - String str = strbuff.toString(); - char array[] = str.toCharArray(); - int size = str.length(); - - if (UTF16.countCodePoint(array, 0, 0) != 0) { - errln("FAIL Counting code points for 0 offset array"); - } - - if (UTF16.countCodePoint(str) != size || - UTF16.countCodePoint(strbuff) != size || - UTF16.countCodePoint(array, 0, size) != size) { - errln("FAIL Counting code points"); - } - - UTF16.append(strbuff, 0x10000); - str = strbuff.toString(); - array = str.toCharArray(); - if (UTF16.countCodePoint(str) != size + 1 || - UTF16.countCodePoint(strbuff) != size + 1 || - UTF16.countCodePoint(array, 0, size + 1) != size + 1 || - UTF16.countCodePoint(array, 0, size + 2) != size + 1) { - errln("FAIL Counting code points"); - } - UTF16.append(strbuff, 0x61); - str = strbuff.toString(); - array = str.toCharArray(); - if (UTF16.countCodePoint(str) != size + 2 || - UTF16.countCodePoint(strbuff) != size + 2 || - UTF16.countCodePoint(array, 0, size + 1) != size + 1 || - UTF16.countCodePoint(array, 0, size + 2) != size + 1 || - UTF16.countCodePoint(array, 0, size + 3) != size + 2) { - errln("FAIL Counting code points"); - } - } - - /** - * Testing UTF16 class methods delete - */ - public void TestDelete() - { //01234567890123456 - StringBuffer strbuff = new StringBuffer("these are strings"); - int size = strbuff.length(); - char array[] = strbuff.toString().toCharArray(); - - UTF16.delete(strbuff, 3); - UTF16.delete(strbuff, 3); - UTF16.delete(strbuff, 3); - UTF16.delete(strbuff, 3); - UTF16.delete(strbuff, 3); - UTF16.delete(strbuff, 3); - try { - UTF16.delete(strbuff, strbuff.length()); - errln("FAIL deleting out of bounds character should fail"); - } catch (Exception e) { - System.out.print(""); - } - UTF16.delete(strbuff, strbuff.length() - 1); - if (!strbuff.toString().equals("the string")) { - errln("FAIL expected result after deleting characters is " + - "\"the string\""); - } - - size = UTF16.delete(array, size, 3); - size = UTF16.delete(array, size, 3); - size = UTF16.delete(array, size, 3); - size = UTF16.delete(array, size, 3); - size = UTF16.delete(array, size, 3); - size = UTF16.delete(array, size, 3); - try { - UTF16.delete(array, size, size); - errln("FAIL deleting out of bounds character should fail"); - } catch (Exception e) { - System.out.print(""); - } - size = UTF16.delete(array, size, size - 1); - String str = new String(array, 0, size); - if (!str.equals("the string")) { - errln("FAIL expected result after deleting characters is " + - "\"the string\""); - } - //012345678 9 01 2 3 4 - strbuff = new StringBuffer("string: \ud800\udc00 \ud801\udc01 \ud801\udc01"); - size = strbuff.length(); - array = strbuff.toString().toCharArray(); - - UTF16.delete(strbuff, 8); - UTF16.delete(strbuff, 8); - UTF16.delete(strbuff, 9); - UTF16.delete(strbuff, 8); - UTF16.delete(strbuff, 9); - UTF16.delete(strbuff, 6); - UTF16.delete(strbuff, 6); - if (!strbuff.toString().equals("string")) { - errln("FAIL expected result after deleting characters is \"string\""); - } - - size = UTF16.delete(array, size, 8); - size = UTF16.delete(array, size, 8); - size = UTF16.delete(array, size, 9); - size = UTF16.delete(array, size, 8); - size = UTF16.delete(array, size, 9); - size = UTF16.delete(array, size, 6); - size = UTF16.delete(array, size, 6); - str = new String(array, 0, size); - if (!str.equals("string")) { - errln("FAIL expected result after deleting characters is \"string\""); - } - } - - /** - * Testing findOffsetFromCodePoint and findCodePointOffset - */ - public void TestfindOffset() - { - // jitterbug 47 - String str = "a\uD800\uDC00b"; - StringBuffer strbuff = new StringBuffer(str); - char array[] = str.toCharArray(); - int limit = str.length(); - if (UTF16.findCodePointOffset(str, 0) != 0 || - UTF16.findOffsetFromCodePoint(str, 0) != 0 || - UTF16.findCodePointOffset(strbuff, 0) != 0 || - UTF16.findOffsetFromCodePoint(strbuff, 0) != 0 || - UTF16.findCodePointOffset(array, 0, limit, 0) != 0 || - UTF16.findOffsetFromCodePoint(array, 0, limit, 0) != 0) { - errln("FAIL Getting the first codepoint offset to a string with " + - "supplementary characters"); - } - if (UTF16.findCodePointOffset(str, 1) != 1 || - UTF16.findOffsetFromCodePoint(str, 1) != 1 || - UTF16.findCodePointOffset(strbuff, 1) != 1 || - UTF16.findOffsetFromCodePoint(strbuff, 1) != 1 || - UTF16.findCodePointOffset(array, 0, limit, 1) != 1 || - UTF16.findOffsetFromCodePoint(array, 0, limit, 1) != 1) { - errln("FAIL Getting the second codepoint offset to a string with " + - "supplementary characters"); - } - if (UTF16.findCodePointOffset(str, 2) != 1 || - UTF16.findOffsetFromCodePoint(str, 2) != 3 || - UTF16.findCodePointOffset(strbuff, 2) != 1 || - UTF16.findOffsetFromCodePoint(strbuff, 2) != 3 || - UTF16.findCodePointOffset(array, 0, limit, 2) != 1 || - UTF16.findOffsetFromCodePoint(array, 0, limit, 2) != 3) { - errln("FAIL Getting the third codepoint offset to a string with " + - "supplementary characters"); - } - if (UTF16.findCodePointOffset(str, 3) != 2 || - UTF16.findOffsetFromCodePoint(str, 3) != 4 || - UTF16.findCodePointOffset(strbuff, 3) != 2 || - UTF16.findOffsetFromCodePoint(strbuff, 3) != 4 || - UTF16.findCodePointOffset(array, 0, limit, 3) != 2 || - UTF16.findOffsetFromCodePoint(array, 0, limit, 3) != 4) { - errln("FAIL Getting the last codepoint offset to a string with " + - "supplementary characters"); - } - if (UTF16.findCodePointOffset(str, 4) != 3 || - UTF16.findCodePointOffset(strbuff, 4) != 3 || - UTF16.findCodePointOffset(array, 0, limit, 4) != 3) { - errln("FAIL Getting the length offset to a string with " + - "supplementary characters"); - } - try { - UTF16.findCodePointOffset(str, 5); - errln("FAIL Getting the a non-existence codepoint to a string with " + - "supplementary characters"); - } catch (Exception e) { - // this is a success - logln("Passed out of bounds codepoint offset"); - } - try { - UTF16.findOffsetFromCodePoint(str, 4); - errln("FAIL Getting the a non-existence codepoint to a string with " + - "supplementary characters"); - } catch (Exception e) { - // this is a success - logln("Passed out of bounds codepoint offset"); - } - try { - UTF16.findCodePointOffset(strbuff, 5); - errln("FAIL Getting the a non-existence codepoint to a string with " + - "supplementary characters"); - } catch (Exception e) { - // this is a success - logln("Passed out of bounds codepoint offset"); - } - try { - UTF16.findOffsetFromCodePoint(strbuff, 4); - errln("FAIL Getting the a non-existence codepoint to a string with " + - "supplementary characters"); - } catch (Exception e) { - // this is a success - logln("Passed out of bounds codepoint offset"); - } - try { - UTF16.findCodePointOffset(array, 0, limit, 5); - errln("FAIL Getting the a non-existence codepoint to a string with " + - "supplementary characters"); - } catch (Exception e) { - // this is a success - logln("Passed out of bounds codepoint offset"); - } - try { - UTF16.findOffsetFromCodePoint(array, 0, limit, 4); - errln("FAIL Getting the a non-existence codepoint to a string with " + - "supplementary characters"); - } catch (Exception e) { - // this is a success - logln("Passed out of bounds codepoint offset"); - } - - if (UTF16.findCodePointOffset(array, 1, 3, 0) != 0 || - UTF16.findOffsetFromCodePoint(array, 1, 3, 0) != 0 || - UTF16.findCodePointOffset(array, 1, 3, 1) != 0 || - UTF16.findCodePointOffset(array, 1, 3, 2) != 1 || - UTF16.findOffsetFromCodePoint(array, 1, 3, 1) != 2) { - errln("FAIL Getting valid codepoint offset in sub array"); - } - } - - /** - * Testing UTF16 class methods getCharCount, *Surrogate - */ - public void TestGetCharCountSurrogate() - { - if (UTF16.getCharCount(0x61) != 1 || - UTF16.getCharCount(0x10000) != 2) { - errln("FAIL getCharCount result failure"); - } - if (UTF16.getLeadSurrogate(0x61) != 0 || - UTF16.getTrailSurrogate(0x61) != 0x61 || - UTF16.isLeadSurrogate((char)0x61) || - UTF16.isTrailSurrogate((char)0x61) || - UTF16.getLeadSurrogate(0x10000) != 0xd800 || - UTF16.getTrailSurrogate(0x10000) != 0xdc00 || - UTF16.isLeadSurrogate((char)0xd800) != true || - UTF16.isTrailSurrogate((char)0xd800) || - UTF16.isLeadSurrogate((char)0xdc00) || - UTF16.isTrailSurrogate((char)0xdc00) != true) { - errln("FAIL *Surrogate result failure"); - } - - if (UTF16.isSurrogate((char)0x61) || !UTF16.isSurrogate((char)0xd800) || - !UTF16.isSurrogate((char)0xdc00)) { - errln("FAIL isSurrogate result failure"); - } - } - - /** - * Testing UTF16 class method insert - */ - public void TestInsert() - { - StringBuffer strbuff = new StringBuffer("0123456789"); - char array[] = new char[128]; - Utility.getChars(strbuff, 0, strbuff.length(), array, 0); - int length = 10; - UTF16.insert(strbuff, 5, 't'); - UTF16.insert(strbuff, 5, 's'); - UTF16.insert(strbuff, 5, 'e'); - UTF16.insert(strbuff, 5, 't'); - if (!(strbuff.toString().equals("01234test56789"))) { - errln("FAIL inserting \"test\""); - } - length = UTF16.insert(array, length, 5, 't'); - length = UTF16.insert(array, length, 5, 's'); - length = UTF16.insert(array, length, 5, 'e'); - length = UTF16.insert(array, length, 5, 't'); - String str = new String(array, 0, length); - if (!(str.equals("01234test56789"))) { - errln("FAIL inserting \"test\""); - } - UTF16.insert(strbuff, 0, 0x10000); - UTF16.insert(strbuff, 11, 0x10000); - UTF16.insert(strbuff, strbuff.length(), 0x10000); - if (!(strbuff.toString().equals( - "\ud800\udc0001234test\ud800\udc0056789\ud800\udc00"))) { - errln("FAIL inserting supplementary characters"); - } - length = UTF16.insert(array, length, 0, 0x10000); - length = UTF16.insert(array, length, 11, 0x10000); - length = UTF16.insert(array, length, length, 0x10000); - str = new String(array, 0, length); - if (!(str.equals("\ud800\udc0001234test\ud800\udc0056789\ud800\udc00"))) { - errln("FAIL inserting supplementary characters"); - } - - try { - UTF16.insert(strbuff, -1, 0); - errln("FAIL invalid insertion offset"); - } catch (Exception e) { - System.out.print(""); - } - try { - UTF16.insert(strbuff, 64, 0); - errln("FAIL invalid insertion offset"); - } catch (Exception e) { - System.out.print(""); - } - try { - UTF16.insert(array, length, -1, 0); - errln("FAIL invalid insertion offset"); - } catch (Exception e) { - System.out.print(""); - } - try { - UTF16.insert(array, length, 64, 0); - errln("FAIL invalid insertion offset"); - } catch (Exception e) { - System.out.print(""); - } - } - - /* - * Testing moveCodePointOffset APIs - */ - public void TestMoveCodePointOffset() - { - //01234567890 1 2 3 45678901234 - String str = new String("0123456789\ud800\udc00\ud801\udc010123456789"); - int move1[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 12, 14, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24}; - int move2[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 14, 15, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24}; - int move3[] = {3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 15, 16, 16, 17, 18, - 19, 20, 21, 22, 23, 24}; - int size = str.length(); - for (int i = 0; i < size; i ++) { - if (UTF16.moveCodePointOffset(str, i, 1) != move1[i]) { - errln("FAIL: Moving offset " + i + - " by 1 codepoint expected result " + move1[i]); - } - try { - if (UTF16.moveCodePointOffset(str, i, 2) != move2[i]) { - errln("FAIL: Moving offset " + i + - " by 2 codepoint expected result " + move2[i]); - } - } catch (IndexOutOfBoundsException e) { - if (i <= 22) { - throw e; - } - } - try - { - if (UTF16.moveCodePointOffset(str, i, 3) != move3[i]) { - errln("FAIL: Moving offset " + i + - " by 3 codepoint expected result " + move3[i]); - } - } catch (IndexOutOfBoundsException e) { - if (i <= 21) { - throw e; - } - } - } - - StringBuffer strbuff = new StringBuffer(str); - for (int i = 0; i < size; i ++) { - if (UTF16.moveCodePointOffset(strbuff, i, 1) != move1[i]) { - errln("FAIL: Moving offset " + i + - " by 1 codepoint expected result " + move1[i]); - } - try { - if (UTF16.moveCodePointOffset(strbuff, i, 2) != move2[i]) { - errln("FAIL: Moving offset " + i + - " by 2 codepoint expected result " + move2[i]); - } - } catch (IndexOutOfBoundsException e) { - if (i <= 22) { - throw e; - } - } - try - { - if (UTF16.moveCodePointOffset(strbuff, i, 3) != move3[i]) { - errln("FAIL: Moving offset " + i + - " by 3 codepoint expected result " + move3[i]); - } - } catch (IndexOutOfBoundsException e) { - if (i <= 21) { - throw e; - } - } - } - - char strarray[] = str.toCharArray(); - for (int i = 0; i < size; i ++) { - if (UTF16.moveCodePointOffset(strarray, 0, size, i, 1) != move1[i]) { - errln("FAIL: Moving offset " + i + - " by 1 codepoint expected result " + move1[i]); - } - try { - if (UTF16.moveCodePointOffset(strarray, 0, size, i, 2) != - move2[i]) { - errln("FAIL: Moving offset " + i + - " by 2 codepoint expected result " + move2[i]); - } - } catch (IndexOutOfBoundsException e) { - if (i <= 22) { - throw e; - } - } - try - { - if (UTF16.moveCodePointOffset(strarray, 0, size, i, 3) != - move3[i]) { - errln("FAIL: Moving offset " + i + - " by 3 codepoint expected result " + move3[i]); - } - } catch (IndexOutOfBoundsException e) { - if (i <= 21) { - throw e; - } - } - } - - if (UTF16.moveCodePointOffset(strarray, 9, 13, 0, 2) != 3) { - errln("FAIL: Moving offset 0 by 2 codepoint in subarray [9, 13] " + - "expected result 3"); - } - if (UTF16.moveCodePointOffset(strarray, 9, 13, 1, 2) != 4) { - errln("FAIL: Moving offset 1 by 2 codepoint in subarray [9, 13] " + - "expected result 4"); - } - if (UTF16.moveCodePointOffset(strarray, 11, 14, 0, 2) != 3) { - errln("FAIL: Moving offset 0 by 2 codepoint in subarray [11, 14] " + - "expected result 3"); - } - } - - /** - * Testing UTF16 class methods setCharAt - */ - public void TestSetCharAt() - { - StringBuffer strbuff = new StringBuffer("012345"); - char array[] = new char[128]; - Utility.getChars(strbuff, 0, strbuff.length(), array, 0); - int length = 6; - for (int i = 0; i < length; i ++) { - UTF16.setCharAt(strbuff, i, '0'); - UTF16.setCharAt(array, length, i, '0'); - } - String str = new String(array, 0, length); - if (!(strbuff.toString().equals("000000")) || - !(str.equals("000000"))) { - errln("FAIL: setChar to '0' failed"); - } - UTF16.setCharAt(strbuff, 0, 0x10000); - UTF16.setCharAt(strbuff, 4, 0x10000); - UTF16.setCharAt(strbuff, 7, 0x10000); - if (!(strbuff.toString().equals( - "\ud800\udc0000\ud800\udc000\ud800\udc00"))) { - errln("FAIL: setChar to 0x10000 failed"); - } - length = UTF16.setCharAt(array, length, 0, 0x10000); - length = UTF16.setCharAt(array, length, 4, 0x10000); - length = UTF16.setCharAt(array, length, 7, 0x10000); - str = new String(array, 0, length); - if (!(str.equals("\ud800\udc0000\ud800\udc000\ud800\udc00"))) { - errln("FAIL: setChar to 0x10000 failed"); - } - try { - UTF16.setCharAt(strbuff, -1, 0); - errln("FAIL: setting character at invalid offset"); - } catch (Exception e) { - System.out.print(""); - } - try { - UTF16.setCharAt(array, length, -1, 0); - errln("FAIL: setting character at invalid offset"); - } catch (Exception e) { - System.out.print(""); - } - try { - UTF16.setCharAt(strbuff, length, 0); - errln("FAIL: setting character at invalid offset"); - } catch (Exception e) { - System.out.print(""); - } - try { - UTF16.setCharAt(array, length, length, 0); - errln("FAIL: setting character at invalid offset"); - } catch (Exception e) { - System.out.print(""); - } - } - - /** - * Testing UTF16 valueof APIs - */ - public void TestValueOf() - { - if (!UTF16.valueOf(0x61).equals("a") || - !UTF16.valueOf(0x10000).equals("\ud800\udc00")) { - errln("FAIL: valueof(char32)"); - } - String str = new String("01234\ud800\udc0056789"); - StringBuffer strbuff = new StringBuffer(str); - char array[] = str.toCharArray(); - int length = str.length(); - - String expected[] = {"0", "1", "2", "3", "4", "\ud800\udc00", - "\ud800\udc00", "5", "6", "7", "8", "9"}; - for (int i = 0; i < length; i ++) { - if (!UTF16.valueOf(str, i).equals(expected[i]) || - !UTF16.valueOf(strbuff, i).equals(expected[i]) || - !UTF16.valueOf(array, 0, length, i).equals(expected[i])) { - errln("FAIL: valueOf() expected " + expected[i]); - } - } - try { - UTF16.valueOf(str, -1); - errln("FAIL: out of bounds error expected"); - } catch (Exception e) { - System.out.print(""); - } - try { - UTF16.valueOf(strbuff, -1); - errln("FAIL: out of bounds error expected"); - } catch (Exception e) { - System.out.print(""); - } - try { - UTF16.valueOf(array, 0, length, -1); - errln("FAIL: out of bounds error expected"); - } catch (Exception e) { - System.out.print(""); - } - try { - UTF16.valueOf(str, length); - errln("FAIL: out of bounds error expected"); - } catch (Exception e) { - System.out.print(""); - } - try { - UTF16.valueOf(strbuff, length); - errln("FAIL: out of bounds error expected"); - } catch (Exception e) { - System.out.print(""); - } - try { - UTF16.valueOf(array, 0, length, length); - errln("FAIL: out of bounds error expected"); - } catch (Exception e) { - System.out.print(""); - } - if (!UTF16.valueOf(array, 6, length, 0).equals("\udc00") || - !UTF16.valueOf(array, 0, 6, 5).equals("\ud800")) { - errln("FAIL: error getting partial supplementary character"); - } - try { - UTF16.valueOf(array, 3, 5, -1); - errln("FAIL: out of bounds error expected"); - } catch (Exception e) { - System.out.print(""); - } - try { - UTF16.valueOf(array, 3, 5, 3); - errln("FAIL: out of bounds error expected"); - } catch (Exception e) { - System.out.print(""); - } - } - - public void TestIndexOf() - { - //012345678901234567890123456789012345 - String test1 = "test test ttest tetest testesteststt"; - String test2 = "test"; - int testChar1 = 0x74; - int testChar2 = 0x20402; - String test3 = "\ud841\udc02\u0071\udc02\ud841\u0071\ud841\udc02\u0071\u0072\ud841\udc02\u0071\ud841\udc02\u0071\udc02\ud841\u0073"; - String test4 = UCharacter.toString(testChar2); - - if (UTF16.indexOf(test1, test2) != 0) { - errln("indexOf failed: expected to find '" + test2 + - "' at position 0 in text '" + test1 + "'"); - } - if (UTF16.indexOf(test1, testChar1) != 0) { - errln("indexOf failed: expected to find 0x" + - Integer.toHexString(testChar1) + - " at position 0 in text '" + test1 + "'"); - } - if (UTF16.indexOf(test3, testChar2) != 0) { - errln("indexOf failed: expected to find 0x" + - Integer.toHexString(testChar2) + - " at position 0 in text '" + Utility.hex(test3) + "'"); - } - String test5 = "\ud841\ud841\udc02"; - if (UTF16.indexOf(test5, testChar2) != 1) { - errln("indexOf failed: expected to find 0x" + - Integer.toHexString(testChar2) + - " at position 0 in text '" + Utility.hex(test3) + "'"); - } - if (UTF16.lastIndexOf(test1, test2) != 29) { - errln("lastIndexOf failed: expected to find '" + test2 + - "' at position 29 in text '" + test1 + "'"); - } - if (UTF16.lastIndexOf(test1, testChar1) != 35) { - errln("lastIndexOf failed: expected to find 0x" + - Integer.toHexString(testChar1) + - " at position 35 in text '" + test1 + "'"); - } - if (UTF16.lastIndexOf(test3, testChar2) != 13) { - errln("indexOf failed: expected to find 0x" + - Integer.toHexString(testChar2) + - " at position 13 in text '" + Utility.hex(test3) + "'"); - } - int occurrences = 0; - for (int startPos = 0; startPos != -1 && startPos < test1.length();) - { - startPos = UTF16.indexOf(test1, test2, startPos); - if (startPos >= 0) { - ++ occurrences; - startPos += 4; - } - } - if (occurrences != 6) { - errln("indexOf failed: expected to find 6 occurrences, found " - + occurrences); - } - - occurrences = 0; - for (int startPos = 10; startPos != -1 && startPos < test1.length();) - { - startPos = UTF16.indexOf(test1, test2, startPos); - if (startPos >= 0) { - ++ occurrences; - startPos += 4; - } - } - if (occurrences != 4) { - errln("indexOf with starting offset failed: expected to find 4 occurrences, found " - + occurrences); - } - - occurrences = 0; - for (int startPos = 0; - startPos != -1 && startPos < test3.length();) { - startPos = UTF16.indexOf(test3, test4, startPos); - if (startPos != -1) { - ++ occurrences; - startPos += 2; - } - } - if (occurrences != 4) { - errln("indexOf failed: expected to find 4 occurrences, found " - + occurrences); - } - - occurrences = 0; - for (int startPos = 10; - startPos != -1 && startPos < test3.length();) { - startPos = UTF16.indexOf(test3, test4, startPos); - if (startPos != -1) { - ++ occurrences; - startPos += 2; - } - } - if (occurrences != 2) { - errln("indexOf failed: expected to find 2 occurrences, found " - + occurrences); - } - - occurrences = 0; - for (int startPos = 0; - startPos != -1 && startPos < test1.length();) { - startPos = UTF16.indexOf(test1, testChar1, startPos); - if (startPos != -1) { - ++ occurrences; - startPos += 1; - } - } - if (occurrences != 16) { - errln("indexOf with character failed: expected to find 16 occurrences, found " - + occurrences); - } - - occurrences = 0; - for (int startPos = 10; - startPos != -1 && startPos < test1.length();) { - startPos = UTF16.indexOf(test1, testChar1, startPos); - if (startPos != -1) { - ++ occurrences; - startPos += 1; - } - } - if (occurrences != 12) { - errln("indexOf with character & start offset failed: expected to find 12 occurrences, found " - + occurrences); - } - - occurrences = 0; - for (int startPos = 0; - startPos != -1 && startPos < test3.length();) { - startPos = UTF16.indexOf(test3, testChar2, startPos); - if (startPos != -1) { - ++ occurrences; - startPos += 1; - } - } - if (occurrences != 4) { - errln("indexOf failed: expected to find 4 occurrences, found " - + occurrences); - } - - occurrences = 0; - for (int startPos = 5; startPos != -1 && startPos < test3.length();) { - startPos = UTF16.indexOf(test3, testChar2, startPos); - if (startPos != -1) { - ++ occurrences; - startPos += 1; - } - } - if (occurrences != 3) { - errln("indexOf with character & start & end offsets failed: expected to find 2 occurrences, found " - + occurrences); - } - occurrences = 0; - for (int startPos = 32; startPos != -1;) { - startPos = UTF16.lastIndexOf(test1, test2, startPos); - if (startPos != -1) { - ++ occurrences; - startPos -= 5; - } - } - if (occurrences != 6) { - errln("lastIndexOf with starting and ending offsets failed: expected to find 4 occurrences, found " - + occurrences); - } - occurrences = 0; - for (int startPos = 32; startPos != -1;) { - startPos = UTF16.lastIndexOf(test1, testChar1, startPos); - if (startPos != -1) { - ++ occurrences; - startPos -= 5; - } - } - if (occurrences != 7) { - errln("lastIndexOf with character & start & end offsets failed: expected to find 11 occurrences, found " - + occurrences); - } - - //testing UChar32 - occurrences = 0; - for (int startPos = test3.length(); startPos != -1;) { - startPos = UTF16.lastIndexOf(test3, testChar2, startPos - 5); - if (startPos != -1) { - ++ occurrences; - } - } - if (occurrences != 3) { - errln("lastIndexOf with character & start & end offsets failed: expected to find 3 occurrences, found " - + occurrences); - } - } - - public void TestReplace() - { - String test1 = "One potato, two potato, three potato, four\n"; - String test2 = "potato"; - String test3 = "MISSISSIPPI"; - - String result = UTF16.replace(test1, test2, test3); - String expectedValue = - "One MISSISSIPPI, two MISSISSIPPI, three MISSISSIPPI, four\n"; - if (!result.equals(expectedValue)) { - errln("findAndReplace failed: expected \"" + expectedValue + - "\", got \"" + test1 + "\"."); - } - result = UTF16.replace(test1, test3, test2); - expectedValue = test1; - if (!result.equals(expectedValue)) { - errln("findAndReplace failed: expected \"" + expectedValue + - "\", got \"" + test1 + "\"."); - } - - result = UTF16.replace(test1, ',', 'e'); - expectedValue = "One potatoe two potatoe three potatoe four\n"; - if (!result.equals(expectedValue)) { - errln("findAndReplace failed: expected \"" + expectedValue + - "\", got \"" + test1 + "\"."); - } - - result = UTF16.replace(test1, ',', 0x10000); - expectedValue = "One potato\ud800\udc00 two potato\ud800\udc00 three potato\ud800\udc00 four\n"; - if (!result.equals(expectedValue)) { - errln("findAndReplace failed: expected \"" + expectedValue + - "\", got \"" + test1 + "\"."); - } - - result = UTF16.replace(test1, "potato", "\ud800\udc00\ud801\udc01"); - expectedValue = "One \ud800\udc00\ud801\udc01, two \ud800\udc00\ud801\udc01, three \ud800\udc00\ud801\udc01, four\n"; - if (!result.equals(expectedValue)) { - errln("findAndReplace failed: expected \"" + expectedValue + - "\", got \"" + test1 + "\"."); - } - - String test4 = "\ud800\ud800\udc00\ud800\udc00\udc00\ud800\ud800\udc00\ud800\udc00\udc00"; - result = UTF16.replace(test4, 0xd800, 'A'); - expectedValue = "A\ud800\udc00\ud800\udc00\udc00A\ud800\udc00\ud800\udc00\udc00"; - if (!result.equals(expectedValue)) { - errln("findAndReplace failed: expected \"" + expectedValue + - "\", got \"" + test1 + "\"."); - } - - result = UTF16.replace(test4, 0xdC00, 'A'); - expectedValue = "\ud800\ud800\udc00\ud800\udc00A\ud800\ud800\udc00\ud800\udc00A"; - if (!result.equals(expectedValue)) { - errln("findAndReplace failed: expected \"" + expectedValue + - "\", got \"" + test1 + "\"."); - } - - result = UTF16.replace(test4, 0x10000, 'A'); - expectedValue = "\ud800AA\udc00\ud800AA\udc00"; - if (!result.equals(expectedValue)) { - errln("findAndReplace failed: expected \"" + expectedValue + - "\", got \"" + test1 + "\"."); - } - } - - public void TestReverse() - { - StringBuffer test = new StringBuffer( - "backwards words say to used I"); - - StringBuffer result = UTF16.reverse(test); - if (!result.toString().equals("I desu ot yas sdrow sdrawkcab")) { - errln("reverse() failed: Expected \"I desu ot yas sdrow sdrawkcab\",\n got \"" - + result + "\""); - } - StringBuffer testbuffer = new StringBuffer(); - UTF16.append(testbuffer, 0x2f999); - UTF16.append(testbuffer, 0x1d15f); - UTF16.append(testbuffer, 0x00c4); - UTF16.append(testbuffer, 0x1ed0); - result = UTF16.reverse(testbuffer); - if (result.charAt(0) != 0x1ed0 || - result.charAt(1) != 0xc4 || - UTF16.charAt(result, 2) != 0x1d15f || - UTF16.charAt(result, 4)!=0x2f999) { - errln("reverse() failed with supplementary characters"); - } - } - - public static void main(String[] arg) - { - try - { - UTF16Test test = new UTF16Test(); - test.run(arg); - } - catch (Exception e) - { - e.printStackTrace(); - } - } -} - diff --git a/icu4j/src/com/ibm/icu/test/util/TrieTest.java b/icu4j/src/com/ibm/icu/test/util/TrieTest.java deleted file mode 100755 index 1bd3cea663..0000000000 --- a/icu4j/src/com/ibm/icu/test/util/TrieTest.java +++ /dev/null @@ -1,653 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2002, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/test/util/Attic/TrieTest.java,v $ -* $Date: 2002/02/08 01:31:18 $ -* $Revision: 1.1 $ -* -******************************************************************************* -*/ - -package com.ibm.icu.test.util; - -import com.ibm.test.TestFmwk; -import com.ibm.icu.internal.util.Trie; -import com.ibm.icu.util.IntTrie; -import com.ibm.text.UTF16; -import com.ibm.text.UCharacter; -import java.io.ByteArrayInputStream; - -/** -* Testing class for Trie -* @author Syn Wee Quek -* @since release 2.1 Jan 01 2002 -*/ -public final class TrieTest extends TestFmwk -{ - // constructor --------------------------------------------------- - - /** - * Constructor - */ - public TrieTest() - { - } - - // public methods ----------------------------------------------- - - public static void main(String arg[]) - { - TrieTest test = new TrieTest(); - test.TestValues(); - } - - public void TestValues() - { - byte array[] = new byte[TRIE_1_DATA_.length << 1]; - for (int i = 0; i < TRIE_1_DATA_.length; i ++) { - array[i << 1] = (byte)((TRIE_1_DATA_[i] >> 8) & 0xFF); - array[(i << 1) + 1] = (byte)(TRIE_1_DATA_[i] & 0xFF); - } - ByteArrayInputStream inputStream = new ByteArrayInputStream(array); - IntTrie trie = null; - try { - trie = new IntTrie(inputStream, new IntDataManipulate()); - } catch (Exception e) { - errln("Failed reading trie data"); - } - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < STRING_1_.length; i ++) { - UTF16.append(buffer, STRING_1_[i]); - } - String str = buffer.toString(); - int values[] = VALUE_1_; - internalTestValues(trie, str, values); - - // testing invalid codepoints - int result = 0; - result = trie.getCodePointValue(0x110000); - if (result != 0) { - errln("Error: Expected value for illegal codepoint should be 0"); - } - } - - // private class ------------------------------------------------ - - private static class IntDataManipulate implements Trie.DataManipulate - { - public int getFoldingOffset(int data) - { - return data >> 16; - } - } - - // private data members ----------------------------------------- - - // trie data, generated from icu4c - private final char TRIE_1_DATA_[] = { - 0x5472, 0x6965, 0x0, 0x125, 0x0, 0x8c0, 0x0, 0x18c, 0x0, 0x8, 0x8, 0x8, -0x8, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x1e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4d, 0x4f, 0x4f, 0x4f, -0x4f, 0x4f, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x29, 0x29, 0x29, 0x29, 0x29, -0x5b, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, -0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, -0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, -0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, -0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, -0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, -0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, -0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, -0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, -0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, -0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, -0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, -0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x2e, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -0x20, 0x20, 0x22, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, -0x32, 0x32, 0x32, 0x32, 0x36, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, -0x17, 0x17, 0x3d, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x45, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1234, 0x0, 0x1234, -0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, -0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, -0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, -0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, -0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, -0x0, 0x1234, 0x0, 0x1234, 0x0, 0x1234, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x6162, 0x0, 0x6162, -0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, -0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, -0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, -0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, -0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, -0x0, 0x6162, 0x0, 0x6162, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, -0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, -0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, -0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, -0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, -0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, -0x0, 0x3132, 0x0, 0x3132, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, -0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, -0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, -0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, -0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, -0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, -0x0, 0x27, 0x0, 0x27, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, -0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, -0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, -0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, -0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, -0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, -0x0, 0x1, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, -0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, -0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x6162, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, -0x0, 0x10, 0x0, 0x10, 0x0, 0x11, 0x0, 0x12, 0x0, 0x12, 0x0, 0x12, -0x0, 0x12, 0x0, 0x12, 0x0, 0x12, 0x0, 0x12, 0x0, 0x12, 0x0, 0x12, -0x0, 0x12, 0x0, 0x12, 0x0, 0x12, 0x0, 0x12, 0x0, 0x12, 0x0, 0x12, -0x0, 0x12, 0x0, 0x12, 0x0, 0x12, 0x0, 0x12, 0x0, 0x12, 0x0, 0x12, -0x0, 0x12, 0x0, 0x12, 0x0, 0x12, 0x0, 0x12, 0x820, 0x1, 0x820, 0x1, -0x820, 0x1, 0x820, 0x1, 0x840, 0x6163, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, -0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, -0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, -0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, -0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, -0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, -0x860, 0x6162, 0x860, 0x6162, 0x860, 0x6162, 0x880, 0x6162, 0x0, 0x3132, 0x0, 0x3132, -0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, -0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, 0x0, 0x3132, -0x8a0, 0x1f, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, -0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, -0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, -0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, -0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, 0x0, 0x27, -0x0, 0x27, 0x0, 0x27, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 - }; - - private final int STRING_1_[] = {0, 0x20, 0xa7, 0x3400, 0x9fa6, 0xdada, - 0xeeee, 0x11111, 0x44444, 0xf0003, - 0xf0004, 0xf0006, 0xf0007, 0xf0020}; - private final int VALUE_1_[] = {0, 0x1234, 0, 0x6162, 0x3132, 0x27, 1, - 0x6162, 0, 0xf, 0x10, 0x11, 0x12, 0}; - - - // private methods ---------------------------------------------- - - private void internalTestValues(IntTrie trie, String str, int values[]) - { - // try forward - int count = 0; - int valueindex = 0; - while (count < str.length()) { - int value; - char c = str.charAt(count ++); - char c2 = UTF16.isLeadSurrogate(c) && count < str.length() && - UTF16.isTrailSurrogate(str.charAt(count)) - ? str.charAt(count ++) : 0; - if (c2 != 0) { - value = trie.getSurrogateValue(c, c2); - } - else { - value = trie.getBMPValue(c); - } - if (value != values[valueindex]) { - errln("Error: Expected value should be " + values[valueindex] + - " not " + value); - } - value = trie.getLeadValue(c); - if (c2 != 0) { - value = trie.getTrailValue(value, c2); - } - if (value != values[valueindex]) { - errln("Error: Expected value should be " + values[valueindex] + - " not " + value); - } - if (c2!=0) { - int codepoint = UCharacter.getCodePoint(c, c2); - value = trie.getCodePointValue(codepoint); - } - else { - value = trie.getBMPValue(c); - } - if (value != values[valueindex]) { - errln("Error: Expected value should be " + values[valueindex] + - " not " + value); - } - valueindex ++; - } - } -} - diff --git a/icu4j/src/com/ibm/icu/util/CharTrie.java b/icu4j/src/com/ibm/icu/util/CharTrie.java deleted file mode 100755 index 756f5d2905..0000000000 --- a/icu4j/src/com/ibm/icu/util/CharTrie.java +++ /dev/null @@ -1,216 +0,0 @@ -/* -****************************************************************************** -* Copyright (C) 1996-2002, International Business Machines Corporation and * -* others. All Rights Reserved. * -****************************************************************************** -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/Attic/CharTrie.java,v $ -* $Date: 2002/02/08 01:08:38 $ -* $Revision: 1.1 $ -* -****************************************************************************** -*/ - -package com.ibm.icu.util; - -import java.io.InputStream; -import java.io.DataInputStream; -import java.io.IOException; -import com.ibm.icu.internal.util.Trie; - -/** - * Trie implementation which stores data in char, 16 bits. - * @author synwee - * @see com.ibm.icu.util.Trie - * @since release 2.1, Jan 01 2002 - */ - - // note that i need to handle the block calculations later, since chartrie - // in icu4c uses the same index array. -public class CharTrie extends Trie -{ - // public constructors --------------------------------------------- - - /** - *

Creates a new Trie with the settings for the trie data.

- *

Unserialize the 32-bit-aligned input stream and use the data for the - * trie.

- * @param inputStream file input stream to a ICU data file, containing - * the trie - * @param dataManipulate, object which provides methods to parse the char - * data - * @exception IOException thrown when data reading fails - * @draft 2.1 - */ - public CharTrie(InputStream inputStream, - DataManipulate dataManipulate) throws IOException - { - super(inputStream, dataManipulate); - - if (!isCharTrie()) { - throw new IllegalArgumentException( - "Data given does not belong to a char trie."); - } - } - - // public methods -------------------------------------------------- - - /** - * Gets the value associated with the codepoint. - * If no value is associated with the codepoint, a default value will be - * returned. - * @param ch codepoint - * @return offset to data - * @draft 2.1 - */ - public final char getCodePointValue(int ch) - { - int offset = getCodePointOffset(ch); - if (offset > 0) { - return m_data_[offset]; - } - return m_initialValue_; - } - - /** - * Gets the value to the data which this lead surrogate character points - * to. - * Returned data may contain folding offset information for the next - * trailing surrogate character. - * This method does not guarantee correct results for trail surrogates. - * @param ch lead surrogate character - * @return data value - * @draft 2.1 - */ - public final char getLeadValue(char ch) - { - return m_data_[getLeadOffset(ch)]; - } - - /** - * Get the value associated with the BMP code point. - * Lead surrogate code points are treated as normal code points, with - * unfolded values that may differ from getLeadValue() results. - * @param ch the input BMP code point - * @return trie data value associated with the BMP codepoint - * @draft 2.1 - */ - public final char getBMPValue(char ch) - { - return m_data_[getBMPOffset(ch)]; - } - - /** - * Get the value associated with a pair of surrogates. - * @param lead a lead surrogate - * @param trail a trail surrogate - * @param trie data value associated with the surrogate characters - * @draft 2.1 - */ - public final char getSurrogateValue(char lead, char trail) - { - return m_data_[getSurrogateOffset(lead, trail)]; - } - - /** - * Get a value from a folding offset (from the value of a lead surrogate) - * and a trail surrogate. - * @param leadvalue value associated with the lead surrogate which contains - * the folding offset - * @param trail surrogate - * @return trie data value associated with the trail character - * @draft 2.1 - */ - public final char getTrailValue(int leadvalue, char trail) - { - if (m_dataManipulate_ == null) { - throw new NullPointerException( - "The field DataManipulate in this Trie is null"); - } - return m_data_[getRawOffset( - m_dataManipulate_.getFoldingOffset(leadvalue), - (char)(trail & SURROGATE_MASK_))]; - } - - // protected methods ----------------------------------------------- - - /** - *

Parses the input stream and stores its trie content into a index and - * data array

- * @param inputStream data input stream containing trie data - * @exception IOException thrown when data reading fails - */ - protected final void unserialize(InputStream inputStream) - throws IOException - { - DataInputStream input = new DataInputStream(inputStream); - int indexDataLength = m_dataOffset_ + m_dataLength_; - m_index_ = new char[indexDataLength]; - for (int i = 0; i < indexDataLength; i ++) { - m_index_[i] = input.readChar(); - } - m_data_ = m_index_; - m_initialValue_ = m_data_[m_dataOffset_]; - } - - /** - * Gets the offset to the data which the surrogate pair points to. - * @param lead lead surrogate - * @param trail trailing surrogate - * @return offset to data - * @draft 2.1 - */ - protected final int getSurrogateOffset(char lead, char trail) - { - if (m_dataManipulate_ == null) { - throw new NullPointerException( - "The field DataManipulate in this Trie is null"); - } - - // get fold position for the next trail surrogate - int offset = m_dataManipulate_.getFoldingOffset(getLeadValue(lead)); - - // get the real data from the folded lead/trail units - if (offset > 0) { - return getRawOffset(offset, (char)(trail & SURROGATE_MASK_)); - } - - // return -1 if there is an error, in this case we return the default - // value: m_initialValue_ - return -1; - } - - /** - * Gets the value at the argument index. - * For use internally in com.ibm.icu.util.TrieEnumeration. - * @param index value at index will be retrieved - * @return 32 bit value - * @see com.ibm.icu.util.TrieEnumeration - * @draft 2.1 - */ - protected final int getValue(int index) - { - return m_data_[index]; - } - - /** - * Gets the default initial value - * @return 32 bit value - * @draft 2.1 - */ - protected final int getInitialValue() - { - return m_initialValue_; - } - - // private data members -------------------------------------------- - - /** - * Default value - */ - private char m_initialValue_; - /** - * Array of char data - */ - protected char m_data_[]; -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/icu/util/IntTrie.java b/icu4j/src/com/ibm/icu/util/IntTrie.java deleted file mode 100755 index 9e050ce6fb..0000000000 --- a/icu4j/src/com/ibm/icu/util/IntTrie.java +++ /dev/null @@ -1,246 +0,0 @@ -/* -****************************************************************************** -* Copyright (C) 1996-2002, International Business Machines Corporation and * -* others. All Rights Reserved. * -****************************************************************************** -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/icu/util/Attic/IntTrie.java,v $ -* $Date: 2002/02/08 01:08:38 $ -* $Revision: 1.1 $ -* -****************************************************************************** -*/ - -package com.ibm.icu.util; - -import java.io.InputStream; -import java.io.DataInputStream; -import java.io.IOException; -import com.ibm.text.UTF16; -import com.ibm.icu.internal.util.Trie; - -/** - * Trie implementation which stores data in int, 32 bits. - * @author synwee - * @see com.ibm.icu.util.Trie - * @since release 2.1, Jan 01 2002 - */ -public class IntTrie extends Trie -{ - // public constructors --------------------------------------------- - - /** - *

Creates a new Trie with the settings for the trie data.

- *

Unserialize the 32-bit-aligned input stream and use the data for the - * trie.

- * @param inputStream file input stream to a ICU data file, containing - * the trie - * @param dataManipulate, object which provides methods to parse the char - * data - * @exception IOException thrown when data reading fails - * @draft 2.1 - */ - public IntTrie(InputStream inputStream, DataManipulate datamanipulate) - throws IOException - { - super(inputStream, datamanipulate); - if (!isIntTrie()) { - throw new IllegalArgumentException( - "Data given does not belong to a int trie."); - } - } - - // public methods -------------------------------------------------- - - // to be removed - public String toString() - { - StringBuffer result = new StringBuffer(super.toString()); - result.append("\ndata length "); - int length = m_data_.length; - result.append(length); - result.append("\ndata-------------------\n"); - - for (int i = 0; i < length;) { - result.append("0x"); - result.append(Integer.toHexString(m_data_[i])); - result.append(", "); - i ++; - if ((i % 15) == 0) { - result.append("\n"); - } - } - return result.toString(); - } - - /** - * Gets the value associated with the codepoint. - * If no value is associated with the codepoint, a default value will be - * returned. - * @param ch codepoint - * @return offset to data - * @draft 2.1 - */ - public final int getCodePointValue(int ch) - { - int offset = getCodePointOffset(ch); - if (offset > 0) { - return m_data_[offset]; - } - return m_initialValue_; - } - - /** - * Gets the value to the data which this lead surrogate character points - * to. - * Returned data may contain folding offset information for the next - * trailing surrogate character. - * This method does not guarantee correct results for trail surrogates. - * @param ch lead surrogate character - * @return data value - * @draft 2.1 - */ - public final int getLeadValue(char ch) - { - return m_data_[getLeadOffset(ch)]; - } - - /** - * Get the value associated with the BMP code point. - * Lead surrogate code points are treated as normal code points, with - * unfolded values that may differ from getLeadValue() results. - * @param ch the input BMP code point - * @return trie data value associated with the BMP codepoint - * @draft 2.1 - */ - public final int getBMPValue(char ch) - { - return m_data_[getBMPOffset(ch)]; - } - - /** - * Get the value associated with a pair of surrogates. - * @param lead a lead surrogate - * @param trail a trail surrogate - * @param trie data value associated with the surrogate characters - * @draft 2.1 - */ - public final int getSurrogateValue(char lead, char trail) - { - if (!UTF16.isLeadSurrogate(lead) || !UTF16.isTrailSurrogate(trail)) { - throw new IllegalArgumentException( - "Argument characters do not form a supplementary character"); - } - // get fold position for the next trail surrogate - int offset = getSurrogateOffset(lead, trail); - - // get the real data from the folded lead/trail units - if (offset > 0) { - return m_data_[offset]; - } - - // return m_initialValue_ if there is an error - return m_initialValue_; - } - - /** - * Get a value from a folding offset (from the value of a lead surrogate) - * and a trail surrogate. - * @param leadvalue the value of a lead surrogate that contains the - * folding offset - * @param trail surrogate - * @return trie data value associated with the trail character - * @draft 2.1 - */ - public final int getTrailValue(int leadvalue, char trail) - { - if (m_dataManipulate_ == null) { - throw new NullPointerException( - "The field DataManipulate in this Trie is null"); - } - return m_data_[getRawOffset( - m_dataManipulate_.getFoldingOffset(leadvalue), - (char)(trail & SURROGATE_MASK_))]; - } - - // protected methods ----------------------------------------------- - - /** - *

Parses the input stream and stores its trie content into a index and - * data array

- * @param inputStream data input stream containing trie data - * @exception IOException thrown when data reading fails - */ - protected final void unserialize(InputStream inputStream) - throws IOException - { - super.unserialize(inputStream); - // one used for initial value - m_data_ = new int[m_dataLength_]; - DataInputStream input = new DataInputStream(inputStream); - for (int i = 0; i < m_dataLength_; i ++) { - m_data_[i] = input.readInt(); - } - m_initialValue_ = m_data_[0]; - } - - /** - * Gets the offset to the data which the surrogate pair points to. - * @param lead lead surrogate - * @param trail trailing surrogate - * @return offset to data - * @draft 2.1 - */ - protected final int getSurrogateOffset(char lead, char trail) - { - if (m_dataManipulate_ == null) { - throw new NullPointerException( - "The field DataManipulate in this Trie is null"); - } - // get fold position for the next trail surrogate - int offset = m_dataManipulate_.getFoldingOffset(getLeadValue(lead)); - - // get the real data from the folded lead/trail units - if (offset > 0) { - return getRawOffset(offset, (char)(trail & SURROGATE_MASK_)); - } - - // return -1 if there is an error, in this case we return the default - // value: m_initialValue_ - return -1; - } - - /** - * Gets the value at the argument index. - * For use internally in com.ibm.icu.util.TrieEnumeration. - * @param index value at index will be retrieved - * @return 32 bit value - * @see com.ibm.icu.util.TrieEnumeration - * @draft 2.1 - */ - protected final int getValue(int index) - { - return m_data_[index]; - } - - /** - * Gets the default initial value - * @return 32 bit value - * @draft 2.1 - */ - protected final int getInitialValue() - { - return m_initialValue_; - } - - // private data members -------------------------------------------- - - /** - * Default value - */ - private int m_initialValue_; - /** - * Array of char data - */ - private int m_data_[]; -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/math/BigDecimal.java b/icu4j/src/com/ibm/math/BigDecimal.java deleted file mode 100755 index 4b40d28717..0000000000 --- a/icu4j/src/com/ibm/math/BigDecimal.java +++ /dev/null @@ -1,4359 +0,0 @@ -/* Generated from 'BigDecimal.nrx' 8 Sep 2000 11:10:50 [v2.00] */ -/* Options: Binary Comments Crossref Format Java Logo Strictargs Strictcase Trace2 Verbose3 */ -package com.ibm.math; -import java.math.BigInteger; -import com.ibm.util.Utility; - -/* ------------------------------------------------------------------ */ -/* BigDecimal -- Decimal arithmetic for Java */ -/* ------------------------------------------------------------------ */ -/* Copyright IBM Corporation, 1996, 2000. All Rights Reserved. */ -/* */ -/* The BigDecimal class provides immutable arbitrary-precision */ -/* floating point (including integer) decimal numbers. */ -/* */ -/* As the numbers are decimal, there is an exact correspondence */ -/* between an instance of a BigDecimal object and its String */ -/* representation; the BigDecimal class provides direct conversions */ -/* to and from String and character array objects, and well as */ -/* conversions to and from the Java primitive types (which may not */ -/* be exact). */ -/* ------------------------------------------------------------------ */ -/* Notes: */ -/* */ -/* 1. A BigDecimal object is never changed in value once constructed; */ -/* this avoids the need for locking. Note in particular that the */ -/* mantissa array may be shared between many BigDecimal objects, */ -/* so that once exposed it must not be altered. */ -/* */ -/* 2. This class looks at MathContext class fields directly (for */ -/* performance). It must not and does not change them. */ -/* */ -/* 3. Exponent checking is delayed until finish(), as we know */ -/* intermediate calculations cannot cause 31-bit overflow. */ -/* [This assertion depends on MAX_DIGITS in MathContext.] */ -/* */ -/* 4. Comments for the public API now follow the javadoc conventions. */ -/* The NetRexx -comments option is used to pass these comments */ -/* through to the generated Java code (with -format, if desired). */ -/* */ -/* 5. System.arraycopy is faster than explicit loop as follows */ -/* Mean length 4: equal */ -/* Mean length 8: x2 */ -/* Mean length 16: x3 */ -/* Mean length 24: x4 */ -/* From prior experience, we expect mean length a little below 8, */ -/* but arraycopy is still the one to use, in general, until later */ -/* measurements suggest otherwise. */ -/* */ -/* 6. 'DMSRCN' referred to below is the original (1981) IBM S/370 */ -/* assembler code implementation of the algorithms below; it is */ -/* now called IXXRCN and is available with the OS/390 and VM/ESA */ -/* operating systems. */ -/* ------------------------------------------------------------------ */ -/* Change History: */ -/* 1997.09.02 Initial version (derived from netrexx.lang classes) */ -/* 1997.09.12 Add lostDigits checking */ -/* 1997.10.06 Change mantissa to a byte array */ -/* 1997.11.22 Rework power [did not prepare arguments, etc.] */ -/* 1997.12.13 multiply did not prepare arguments */ -/* 1997.12.14 add did not prepare and align arguments correctly */ -/* 1998.05.02 0.07 packaging changes suggested by Sun and Oracle */ -/* 1998.05.21 adjust remainder operator finalization */ -/* 1998.06.04 rework to pass MathContext to finish() and round() */ -/* 1998.06.06 change format to use round(); support rounding modes */ -/* 1998.06.25 rename to BigDecimal and begin merge */ -/* zero can now have trailing zeros (i.e., exp\=0) */ -/* 1998.06.28 new methods: movePointXxxx, scale, toBigInteger */ -/* unscaledValue, valueof */ -/* 1998.07.01 improve byteaddsub to allow array reuse, etc. */ -/* 1998.07.01 make null testing explicit to avoid JIT bug [Win32] */ -/* 1998.07.07 scaled division [divide(BigDecimal, int, int)] */ -/* 1998.07.08 setScale, faster equals */ -/* 1998.07.11 allow 1E6 (no sign) ; new double/float conversion */ -/* 1998.10.12 change package to com.ibm.math */ -/* 1998.12.14 power operator no longer rounds RHS [to match ANSI] */ -/* add toBigDecimal() and BigDecimal(java.math.BigDecimal) */ -/* 1998.12.29 improve byteaddsub by using table lookup */ -/* 1999.02.04 lostdigits=0 behaviour rounds instead of digits+1 guard */ -/* 1999.02.05 cleaner code for BigDecimal(char[]) */ -/* 1999.02.06 add javadoc comments */ -/* 1999.02.11 format() changed from 7 to 2 method form */ -/* 1999.03.05 null pointer checking is no longer explicit */ -/* 1999.03.05 simplify; changes from discussion with J. Bloch: */ -/* null no longer permitted for MathContext; drop boolean, */ -/* byte, char, float, short constructor, deprecate double */ -/* constructor, no blanks in string constructor, add */ -/* offset and length version of char[] constructor; */ -/* add valueOf(double); drop booleanValue, charValue; */ -/* add ...Exact versions of remaining convertors */ -/* 1999.03.13 add toBigIntegerExact */ -/* 1999.03.13 1.00 release to IBM Centre for Java Technology */ -/* 1999.05.27 1.01 correct 0-0.2 bug under scaled arithmetic */ -/* 1999.06.29 1.02 constructors should not allow exponent > 9 digits */ -/* 1999.07.03 1.03 lost digits should not be checked if digits=0 */ -/* 1999.07.06 lost digits Exception message changed */ -/* 1999.07.10 1.04 more work on 0-0.2 (scaled arithmetic) */ -/* 1999.07.17 improve messages from pow method */ -/* 1999.08.08 performance tweaks */ -/* 1999.08.15 fastpath in multiply */ -/* 1999.11.05 1.05 fix problem in intValueExact [e.g., 5555555555] */ -/* 1999.12.22 1.06 remove multiply fastpath, and improve performance */ -/* 2000.01.01 copyright update [Y2K has arrived] */ -/* 2000.06.18 1.08 no longer deprecate BigDecimal(double) */ -/* ------------------------------------------------------------------ */ - - - - - -/** - * The BigDecimal class implements immutable - * arbitrary-precision decimal numbers. The methods of the - * BigDecimal class provide operations for fixed and - * floating point arithmetic, comparison, format conversions, and - * hashing. - *

- * As the numbers are decimal, there is an exact correspondence between - * an instance of a BigDecimal object and its - * String representation; the BigDecimal class - * provides direct conversions to and from String and - * character array (char[]) objects, as well as conversions - * to and from the Java primitive types (which may not be exact) and - * BigInteger. - *

- * In the descriptions of constructors and methods in this documentation, - * the value of a BigDecimal number object is shown as the - * result of invoking the toString() method on the object. - * The internal representation of a decimal number is neither defined - * nor exposed, and is not permitted to affect the result of any - * operation. - *

- * The floating point arithmetic provided by this class is defined by - * the ANSI X3.274-1996 standard, and is also documented at - * http://www2.hursley.ibm.com/decimal - *
[This URL will change.] - * - *

Operator methods

- *

- * Operations on BigDecimal numbers are controlled by a - * {@link MathContext} object, which provides the context (precision and - * other information) for the operation. Methods that can take a - * MathContext parameter implement the standard arithmetic - * operators for BigDecimal objects and are known as - * operator methods. The default settings provided by the - * constant {@link MathContext#DEFAULT} (digits=9, - * form=SCIENTIFIC, lostDigits=false, roundingMode=ROUND_HALF_UP) - * perform general-purpose floating point arithmetic to nine digits of - * precision. The MathContext parameter must not be - * null. - *

- * Each operator method also has a version provided which does - * not take a MathContext parameter. For this version of - * each method, the context settings used are digits=0, - * form=PLAIN, lostDigits=false, roundingMode=ROUND_HALF_UP; - * these settings perform fixed point arithmetic with unlimited - * precision, as defined for the original BigDecimal class in Java 1.1 - * and Java 1.2. - *

- * For monadic operators, only the optional MathContext - * parameter is present; the operation acts upon the current object. - *

- * For dyadic operators, a BigDecimal parameter is always - * present; it must not be null. - * The operation acts with the current object being the left-hand operand - * and the BigDecimal parameter being the right-hand operand. - *

- * For example, adding two BigDecimal objects referred to - * by the names award and extra could be - * written as any of: - *

- * award.add(extra) - *
award.add(extra, MathContext.DEFAULT) - *
award.add(extra, acontext) - *
- *

- * (where acontext is a MathContext object), - * which would return a BigDecimal object whose value is - * the result of adding award and extra under - * the appropriate context settings. - *

- * When a BigDecimal operator method is used, a set of - * rules define what the result will be (and, by implication, how the - * result would be represented as a character string). - * These rules are defined in the BigDecimal arithmetic documentation - * (see the URL above), but in summary: - *

    - *
  • Results are normally calculated with up to some maximum number of - * significant digits. - * For example, if the MathContext parameter for an operation - * were MathContext.DEFAULT then the result would be - * rounded to 9 digits; the division of 2 by 3 would then result in - * 0.666666667. - *
    - * You can change the default of 9 significant digits by providing the - * method with a suitable MathContext object. This lets you - * calculate using as many digits as you need -- thousands, if necessary. - * Fixed point (scaled) arithmetic is indicated by using a - * digits setting of 0 (or omitting the - * MathContext parameter). - *
    - * Similarly, you can change the algorithm used for rounding from the - * default "classic" algorithm. - *
  • - * In standard arithmetic (that is, when the form setting - * is not PLAIN), a zero result is always expressed as the - * single digit '0' (that is, with no sign, decimal point, - * or exponent part). - *
  • - * Except for the division and power operators in standard arithmetic, - * trailing zeros are preserved (this is in contrast to binary floating - * point operations and most electronic calculators, which lose the - * information about trailing zeros in the fractional part of results). - *
    - * So, for example: - *

    - * new BigDecimal("2.40").add( new BigDecimal("2")) => "4.40" - *
    new BigDecimal("2.40").subtract(new BigDecimal("2")) => "0.40" - *
    new BigDecimal("2.40").multiply(new BigDecimal("2")) => "4.80" - *
    new BigDecimal("2.40").divide( new BigDecimal("2"), def) => "1.2" - *
    - *

    where the value on the right of the => would be the - * result of the operation, expressed as a String, and - * def (in this and following examples) refers to - * MathContext.DEFAULT). - * This preservation of trailing zeros is desirable for most - * calculations (including financial calculations). - * If necessary, trailing zeros may be easily removed using division by 1. - *

  • - * In standard arithmetic, exponential form is used for a result - * depending on its value and the current setting of digits - * (the default is 9 digits). - * If the number of places needed before the decimal point exceeds the - * digits setting, or the absolute value of the number is - * less than 0.000001, then the number will be expressed in - * exponential notation; thus - *

    - * new BigDecimal("1e+6").multiply(new BigDecimal("1e+6"), def) - * - *

    results in 1E+12 instead of - * 1000000000000, and - *

    - * new BigDecimal("1").divide(new BigDecimal("3E+10"), def) - * - *

    results in 3.33333333E-11 instead of - * 0.0000000000333333333. - *

    - * The form of the exponential notation (scientific or engineering) is - * determined by the form setting. - * - *

    - * The names of methods in this class follow the conventions established - * by java.lang.Number, java.math.BigInteger, - * and java.math.BigDecimal in Java 1.1 and Java 1.2. - * - * @see MathContext - * @version 1.08 2000.06.18 - * @author Mike Cowlishaw - */ - -public class BigDecimal extends java.lang.Number implements java.io.Serializable,java.lang.Comparable{ - private static final java.lang.String $0="BigDecimal.nrx"; - - - - /* ----- Constants ----- */ - /* properties constant public */ // useful to others - /** - * The BigDecimal constant "0". - * - * @see #ONE - * @see #TEN - * @since IBM JDK 1.1.8 - */ - public static final com.ibm.math.BigDecimal ZERO=new com.ibm.math.BigDecimal((long)0); // use long as we want the int constructor - // .. to be able to use this, for speed - - /** - * The BigDecimal constant "1". - * - * @see #TEN - * @see #ZERO - * @since IBM JDK 1.1.8 - */ - public static final com.ibm.math.BigDecimal ONE=new com.ibm.math.BigDecimal((long)1); // use long as we want the int constructor - // .. to be able to use this, for speed - - /** - * The BigDecimal constant "10". - * - * @see #ONE - * @see #ZERO - * @since IBM JDK 1.1.8 - */ - public static final com.ibm.math.BigDecimal TEN=new com.ibm.math.BigDecimal(10); - - // the rounding modes (copied here for upwards compatibility) - /** - * Rounding mode to round to a more positive number. - * See {@Link MathContext#ROUND_CEILING}. - */ - public static final int ROUND_CEILING=com.ibm.math.MathContext.ROUND_CEILING; - - /** - * Rounding mode to round towards zero. - * See {@Link MathContext#ROUND_DOWN}. - */ - public static final int ROUND_DOWN=com.ibm.math.MathContext.ROUND_DOWN; - - /** - * Rounding mode to round to a more negative number. - * See {@Link MathContext#ROUND_FLOOR}. - */ - public static final int ROUND_FLOOR=com.ibm.math.MathContext.ROUND_FLOOR; - - /** - * Rounding mode to round to nearest neighbor, where an equidistant - * value is rounded down. - * See {@Link MathContext#ROUND_HALF_DOWN}. - */ - public static final int ROUND_HALF_DOWN=com.ibm.math.MathContext.ROUND_HALF_DOWN; - - /** - * Rounding mode to round to nearest neighbor, where an equidistant - * value is rounded to the nearest even neighbor. - * See {@Link MathContext#ROUND_HALF_EVEN}. - */ - public static final int ROUND_HALF_EVEN=com.ibm.math.MathContext.ROUND_HALF_EVEN; - - /** - * Rounding mode to round to nearest neighbor, where an equidistant - * value is rounded up. - * See {@Link MathContext#ROUND_HALF_UP}. - */ - public static final int ROUND_HALF_UP=com.ibm.math.MathContext.ROUND_HALF_UP; - - /** - * Rounding mode to assert that no rounding is necessary. - * See {@Link MathContext#ROUND_UNNECESSARY}. - */ - public static final int ROUND_UNNECESSARY=com.ibm.math.MathContext.ROUND_UNNECESSARY; - - /** - * Rounding mode to round away from zero. - * See {@Link MathContext#ROUND_UP}. - */ - public static final int ROUND_UP=com.ibm.math.MathContext.ROUND_UP; - - /* properties constant private */ // locals - private static final byte ispos=1; // ind: indicates positive (must be 1) - private static final byte iszero=0; // ind: indicates zero (must be 0) - private static final byte isneg=-1; // ind: indicates negative (must be -1) - // [later could add NaN, +/- infinity, here] - - private static final int MinExp=-999999999; // minimum exponent allowed - private static final int MaxExp=999999999; // maximum exponent allowed - private static final int MinArg=-999999999; // minimum argument integer - private static final int MaxArg=999999999; // maximum argument integer - - private static final com.ibm.math.MathContext plainMC=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN); // context for plain unlimited math - - /* properties constant private unused */ // present but not referenced - - // Serialization version - private static final long serialVersionUID=8245355804974198832L; - - private static final java.lang.String copyright=" Copyright (c) IBM Corporation 1996, 2000. All rights reserved. "; - - /* properties static private */ - // Precalculated constant arrays (used by byteaddsub) - private static byte bytecar[]=new byte[(90+99)+1]; // carry/borrow array - private static byte bytedig[]=diginit(); // next digit array - - /* ----- Instance properties [all private and immutable] ----- */ - /* properties private */ - - /** - * The indicator. This may take the values: - *

      - *
    • ispos -- the number is positive - *
    • iszero -- the number is zero - *
    • isneg -- the number is negative - *
    - * - * @serial - */ - private byte ind; // assumed undefined - // Note: some code below assumes IND = Sign [-1, 0, 1], at present. - // We only need two bits for this, but use a byte [also permits - // smooth future extension]. - - /** - * The formatting style. This may take the values: - *
      - *
    • MathContext.PLAIN -- no exponent needed - *
    • MathContext.SCIENTIFIC -- scientific notation required - *
    • MathContext.ENGINEERING -- engineering notation required - *
    - *

    - * This property is an optimization; it allows us to defer number - * layout until it is actually needed as a string, hence avoiding - * unnecessary formatting. - * - * @serial - */ - private byte form=(byte)com.ibm.math.MathContext.PLAIN; // assumed PLAIN - // We only need two bits for this, at present, but use a byte - // [again, to allow for smooth future extension] - - /** - * The value of the mantissa. - *

    - * Once constructed, this may become shared between several BigDecimal - * objects, so must not be altered. - *

    - * For efficiency (speed), this is a byte array, with each byte - * taking a value of 0 -> 9. - *

    - * If the first byte is 0 then the value of the number is zero (and - * mant.length=1, except when constructed from a plain number, for - * example, 0.000). - * - * @serial - */ - private byte mant[]; // assumed null - - /** - * The exponent. - *

    - * For fixed point arithmetic, scale is -exp, and can - * apply to zero. - * - * Note that this property can have a value less than MinExp when - * the mantissa has more than one digit. - * - * @serial - */ - private int exp; - // assumed 0 - - /* ---------------------------------------------------------------- */ - /* Constructors */ - /* ---------------------------------------------------------------- */ - - /** - * Constructs a BigDecimal object from a - * java.math.BigDecimal. - *

    - * Constructs a BigDecimal as though the parameter had - * been represented as a String (using its - * toString method) and the - * {@link #BigDecimal(java.lang.String)} constructor had then been - * used. - * The parameter must not be null. - *

    - * (Note: this constructor is provided only in the - * com.ibm.math version of the BigDecimal class. - * It would not be present in a java.math version.) - * - * @param bd The BigDecimal to be translated. - * @since IBM JDK 1.1.8 - */ - - public BigDecimal(java.math.BigDecimal bd){ - this(bd.toString()); - return;} - - /** - * Constructs a BigDecimal object from a - * BigInteger, with scale 0. - *

    - * Constructs a BigDecimal which is the exact decimal - * representation of the BigInteger, with a scale of - * zero. - * The value of the BigDecimal is identical to the value - * of the BigInteger. - * The parameter must not be null. - *

    - * The BigDecimal will contain only decimal digits, - * prefixed with a leading minus sign (hyphen) if the - * BigInteger is negative. A leading zero will be - * present only if the BigInteger is zero. - * - * @param bi The BigInteger to be converted. - */ - - public BigDecimal(java.math.BigInteger bi){ - this(bi.toString(10)); - return;} - // exp remains 0 - - /** - * Constructs a BigDecimal object from a - * BigInteger and a scale. - *

    - * Constructs a BigDecimal which is the exact decimal - * representation of the BigInteger, scaled by the - * second parameter, which may not be negative. - * The value of the BigDecimal is the - * BigInteger divided by ten to the power of the scale. - * The BigInteger parameter must not be - * null. - *

    - * The BigDecimal will contain only decimal digits, (with - * an embedded decimal point followed by scale decimal - * digits if the scale is positive), prefixed with a leading minus - * sign (hyphen) if the BigInteger is negative. A - * leading zero will be present only if the BigInteger is - * zero. - * - * @param bi The BigInteger to be converted. - * @param scale The int specifying the scale. - * @throws NumberFormatException if the scale is negative. - */ - - public BigDecimal(java.math.BigInteger bi,int scale){ - this(bi.toString(10)); - if (scale<0) - throw new java.lang.NumberFormatException("Negative scale:"+" "+scale); - exp=(int)-scale; // exponent is -scale - return;} - - /** - * Constructs a BigDecimal object from an array of characters. - *

    - * Constructs a BigDecimal as though a - * String had been constructed from the character array - * and the {@link #BigDecimal(java.lang.String)} constructor had then - * been used. The parameter must not be null. - *

    - * Using this constructor is faster than using the - * BigDecimal(String) constructor if the string is - * already available in character array form. - * - * @param inchars The char[] array containing the number - * to be converted. - * @throws NumberFormatException if the parameter is not a valid - * number. - * @since IBM JDK 1.1.8 - */ - - public BigDecimal(char inchars[]){ - this(inchars,0,inchars.length); - return;} - - /** - * Constructs a BigDecimal object from an array of characters. - *

    - * Constructs a BigDecimal as though a - * String had been constructed from the character array - * (or a subarray of that array) and the - * {@link #BigDecimal(java.lang.String)} constructor had then been - * used. The first parameter must not be null, and the - * subarray must be wholly contained within it. - *

    - * Using this constructor is faster than using the - * BigDecimal(String) constructor if the string is - * already available within a character array. - * - * @param inchars The char[] array containing the number - * to be converted. - * @param offset The int offset into the array of the - * start of the number to be converted. - * @param length The int length of the number. - * @throws NumberFormatException if the parameter is not a valid - * number for any reason. - * @since IBM JDK 1.1.8 - */ - - public BigDecimal(char inchars[],int offset,int length){super(); - boolean exotic; - boolean hadexp; - int d; - int dotoff; - int last; - int i=0; - char si=0; - boolean eneg=false; - int k=0; - int elen=0; - int j=0; - char sj=0; - int dvalue=0; - int mag=0; - // This is the primary constructor; all incoming strings end up - // here; it uses explicit (inline) parsing for speed and to avoid - // generating intermediate (temporary) objects of any kind. - // 1998.06.25: exponent form built only if E/e in string - // 1998.06.25: trailing zeros not removed for zero - // 1999.03.06: no embedded blanks; allow offset and length - if (length<=0) - bad(inchars); // bad conversion (empty string) - // [bad offset will raise array bounds exception] - - /* Handle and step past sign */ - ind=ispos; // assume positive - if (inchars[0]==('-')) - { - length--; - if (length==0) - bad(inchars); // nothing after sign - ind=isneg; - offset++; - } - else - if (inchars[0]==('+')) - { - length--; - if (length==0) - bad(inchars); // nothing after sign - offset++; - } - - /* We're at the start of the number */ - exotic=false; // have extra digits - hadexp=false; // had explicit exponent - d=0; // count of digits found - dotoff=-1; // offset where dot was found - last=-1; // last character of mantissa - {int $1=length;i=offset;i:for(;$1>0;$1--,i++){ - si=inchars[i]; - if (si>='0') // test for Arabic digit - if (si<='9') - { - last=i; - d++; // still in mantissa - continue i; - } - if (si=='.') - { // record and ignore - if (dotoff>=0) - bad(inchars); // two dots - dotoff=i-offset; // offset into mantissa - continue i; - } - if (si!='e') - if (si!='E') - { // expect an extra digit - if ((!(java.lang.Character.isDigit(si)))) - bad(inchars); // not a number - // defer the base 10 check until later to avoid extra method call - exotic=true; // will need conversion later - last=i; - d++; // still in mantissa - continue i; - } - /* Found 'e' or 'E' -- now process explicit exponent */ - // 1998.07.11: sign no longer required - if ((i-offset)>(length-2)) - bad(inchars); // no room for even one digit - eneg=false; - if ((inchars[i+1])==('-')) - { - eneg=true; - k=i+2; - } - else - if ((inchars[i+1])==('+')) - k=i+2; - else - k=i+1; - // k is offset of first expected digit - elen=length-((k-offset)); // possible number of digits - if ((elen==0)|(elen>9)) - bad(inchars); // 0 or more than 9 digits - {int $2=elen;j=k;j:for(;$2>0;$2--,j++){ - sj=inchars[j]; - if (sj<'0') - bad(inchars); // always bad - if (sj>'9') - { // maybe an exotic digit - if ((!(java.lang.Character.isDigit(sj)))) - bad(inchars); // not a number - dvalue=java.lang.Character.digit(sj,10); // check base - if (dvalue<0) - bad(inchars); // not base 10 - } - else - dvalue=((int)(sj))-((int)('0')); - exp=(exp*10)+dvalue; - } - }/*j*/ - if (eneg) - exp=(int)-exp; // was negative - hadexp=true; // remember we had one - break i; // we are done - } - }/*i*/ - - /* Here when all inspected */ - if (d==0) - bad(inchars); // no mantissa digits - if (dotoff>=0) - exp=(exp+dotoff)-d; // adjust exponent if had dot - - /* strip leading zeros/dot (leave final if all 0's) */ - {int $3=last-1;i=offset;i:for(;i<=$3;i++){ - si=inchars[i]; - if (si=='0') - { - offset++; - dotoff--; - d--; - } - else - if (si=='.') - { - offset++; // step past dot - dotoff--; - } - else - if (si<='9') - break i;/* non-0 */ - else - {/* exotic */ - if ((java.lang.Character.digit(si,10))!=0) - break i; // non-0 or bad - // is 0 .. strip like '0' - offset++; - dotoff--; - d--; - } - } - }/*i*/ - - /* Create the mantissa array */ - mant=new byte[d]; // we know the length - j=offset; // input offset - if (exotic) - {exotica:do{ // slow: check for exotica - {int $4=d;i=0;i:for(;$4>0;$4--,i++){ - if (i==dotoff) - j++; // at dot - sj=inchars[j]; - if (sj<='9') - mant[i]=(byte)(((int)(sj))-((int)('0')));/* easy */ - else - { - dvalue=java.lang.Character.digit(sj,10); - if (dvalue<0) - bad(inchars); // not a number after all - mant[i]=(byte)dvalue; - } - j++; - } - }/*i*/ - }while(false);}/*exotica*/ - else - {simple:do{ - {int $5=d;i=0;i:for(;$5>0;$5--,i++){ - if (i==dotoff) - j++; - mant[i]=(byte)(((int)(inchars[j]))-((int)('0'))); - j++; - } - }/*i*/ - }while(false);}/*simple*/ - - /* Looks good. Set the sign indicator and form, as needed. */ - // Trailing zeros are preserved - // The rule here for form is: - // If no E-notation, then request plain notation - // Otherwise act as though add(0,DEFAULT) and request scientific notation - // [form is already PLAIN] - if (mant[0]==0) - { - ind=iszero; // force to show zero - // negative exponent is significant (e.g., -3 for 0.000) if plain - if (exp>0) - exp=0; // positive exponent can be ignored - if (hadexp) - { // zero becomes single digit from add - mant=ZERO.mant; - exp=0; - } - } - else - { // non-zero - // [ind was set earlier] - // now determine form - if (hadexp) - { - form=(byte)com.ibm.math.MathContext.SCIENTIFIC; - // 1999.06.29 check for overflow - mag=(exp+mant.length)-1; // true exponent in scientific notation - if ((magMaxExp)) - bad(inchars); - } - } - // say 'BD(c[]): mant[0] mantlen exp ind form:' mant[0] mant.length exp ind form - return; - } - - /** - * Constructs a BigDecimal object directly from a - * double. - *

    - * Constructs a BigDecimal which is the exact decimal - * representation of the 64-bit signed binary floating point - * parameter. - *

    - * Note that this constructor it an exact conversion; it does not give - * the same result as converting num to a - * String using the Double.toString() method - * and then using the {@link #BigDecimal(java.lang.String)} - * constructor. - * To get that result, use the static {@link #valueOf(double)} - * method to construct a BigDecimal from a - * double. - * - * @param num The double to be converted. - * @throws NumberFormatException if the parameter is infinite or - * not a number. - */ - - public BigDecimal(double num){ - // 1999.03.06: use exactly the old algorithm - // 2000.01.01: note that this constructor does give an exact result, - // so perhaps it should not be deprecated - // 2000.06.18: no longer deprecated - this((new java.math.BigDecimal(num)).toString()); - return;} - - /** - * Constructs a BigDecimal object directly from a - * int. - *

    - * Constructs a BigDecimal which is the exact decimal - * representation of the 32-bit signed binary integer parameter. - * The BigDecimal will contain only decimal digits, - * prefixed with a leading minus sign (hyphen) if the parameter is - * negative. - * A leading zero will be present only if the parameter is zero. - * - * @param num The int to be converted. - * @since IBM JDK 1.1.8 - */ - - public BigDecimal(int num){super(); - int mun; - int i=0; - // We fastpath commoners - if (num<=9) - if (num>=(-9)) - {singledigit:do{ - // very common single digit case - {/*select*/ - if (num==0) - { - mant=ZERO.mant; - ind=iszero; - } - else if (num==1) - { - mant=ONE.mant; - ind=ispos; - } - else if (num==(-1)) - { - mant=ONE.mant; - ind=isneg; - } - else{ - { - mant=new byte[1]; - if (num>0) - { - mant[0]=(byte)num; - ind=ispos; - } - else - { // num<-1 - mant[0]=(byte)((int)-num); - ind=isneg; - } - } - } - } - return; - }while(false);}/*singledigit*/ - - /* We work on negative numbers so we handle the most negative number */ - if (num>0) - { - ind=ispos; - num=(int)-num; - } - else - ind=isneg;/* negative */ // [0 case already handled] - // [it is quicker, here, to pre-calculate the length with - // one loop, then allocate exactly the right length of byte array, - // then re-fill it with another loop] - mun=num; // working copy - {i=9;i:for(;;i--){ - mun=mun/10; - if (mun==0) - break i; - } - }/*i*/ - // i is the position of the leftmost digit placed - mant=new byte[10-i]; - {i=(10-i)-1;i:for(;;i--){ - mant[i]=(byte)-(((byte)(num%10))); - num=num/10; - if (num==0) - break i; - } - }/*i*/ - return; - } - - /** - * Constructs a BigDecimal object directly from a - * long. - *

    - * Constructs a BigDecimal which is the exact decimal - * representation of the 64-bit signed binary integer parameter. - * The BigDecimal will contain only decimal digits, - * prefixed with a leading minus sign (hyphen) if the parameter is - * negative. - * A leading zero will be present only if the parameter is zero. - * - * @param num The long to be converted. - * @since IBM JDK 1.1.8 - */ - - public BigDecimal(long num){super(); - long mun; - int i=0; - // Not really worth fastpathing commoners in this constructor [also, - // we use this to construct the static constants]. - // This is much faster than: this(String.valueOf(num).toCharArray()) - /* We work on negative num so we handle the most negative number */ - if (num>0) - { - ind=ispos; - num=(long)-num; - } - else - if (num==0) - ind=iszero; - else - ind=isneg;/* negative */ - mun=num; - {i=18;i:for(;;i--){ - mun=mun/10; - if (mun==0) - break i; - } - }/*i*/ - // i is the position of the leftmost digit placed - mant=new byte[19-i]; - {i=(19-i)-1;i:for(;;i--){ - mant[i]=(byte)-(((byte)(num%10))); - num=num/10; - if (num==0) - break i; - } - }/*i*/ - return; - } - - /** - * Constructs a BigDecimal object from a String. - *

    - * Constructs a BigDecimal from the parameter, which must - * not be null and must represent a valid number, - * as described formally in the documentation referred to - * {@link BigDecimal above}. - *

    - * In summary, numbers in String form must have at least - * one digit, may have a leading sign, may have a decimal point, and - * exponential notation may be used. They follow conventional syntax, - * and may not contain blanks. - *

    - * Some valid strings from which a BigDecimal might - * be constructed are: - *

    -  *       "0"         -- Zero
    -  *      "12"         -- A whole number
    -  *     "-76"         -- A signed whole number
    -  *      "12.70"      -- Some decimal places
    -  *     "+0.003"      -- Plus sign is allowed
    -  *      "17."        -- The same as 17
    -  *        ".5"       -- The same as 0.5
    -  *      "4E+9"       -- Exponential notation
    -  *       "0.73e-7"   -- Exponential notation
    -  * 
    - *

    - * (Exponential notation means that the number includes an optional - * sign and a power of ten following an 'E' that - * indicates how the decimal point will be shifted. Thus the - * "4E+9" above is just a short way of writing - * 4000000000, and the "0.73e-7" is short - * for 0.000000073.) - *

    - * The BigDecimal constructed from the String is in a - * standard form, with no blanks, as though the - * {@link #add(BigDecimal)} method had been used to add zero to the - * number with unlimited precision. - * If the string uses exponential notation (that is, includes an - * e or an E), then the - * BigDecimal number will be expressed in scientific - * notation (where the power of ten is adjusted so there is a single - * non-zero digit to the left of the decimal point); in this case if - * the number is zero then it will be expressed as the single digit 0, - * and if non-zero it will have an exponent unless that exponent would - * be 0. The exponent must fit in nine digits both before and after it - * is expressed in scientific notation. - *

    - * Any digits in the parameter must be decimal; that is, - * Character.digit(c, 10) (where c is the - * character in question) would not return -1. - * - * @param string The String to be converted. - * @throws NumberFormatException if the parameter is not a valid - * number. - */ - - public BigDecimal(java.lang.String string){ - this(string.toCharArray(),0,string.length()); - return;} - - /* Make a default BigDecimal object for local use. */ - - private BigDecimal(){super(); - return; - } - - /* ---------------------------------------------------------------- */ - /* Operator methods [methods which take a context parameter] */ - /* ---------------------------------------------------------------- */ - - /** - * Returns a plain BigDecimal whose value is the absolute - * value of this BigDecimal. - *

    - * The same as {@link #abs(MathContext)}, where the context is - * new MathContext(0, MathContext.PLAIN). - *

    - * The length of the decimal part (the scale) of the result will - * be this.scale() - * - * @return A BigDecimal whose value is the absolute - * value of this BigDecimal. - */ - - public com.ibm.math.BigDecimal abs(){ - return this.abs(plainMC); - } - - /** - * Returns a BigDecimal whose value is the absolute value - * of this BigDecimal. - *

    - * If the current object is zero or positive, then the same result as - * invoking the {@link #plus(MathContext)} method with the same - * parameter is returned. - * Otherwise, the same result as invoking the - * {@link #negate(MathContext)} method with the same parameter is - * returned. - * - * @param set The MathContext arithmetic settings. - * @return A BigDecimal whose value is the absolute - * value of this BigDecimal. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal abs(com.ibm.math.MathContext set){ - if (this.ind==isneg) - return this.negate(set); - return this.plus(set); - } - - /** - * Returns a plain BigDecimal whose value is - * this+rhs, using fixed point arithmetic. - *

    - * The same as {@link #add(BigDecimal, MathContext)}, - * where the BigDecimal is rhs, - * and the context is new MathContext(0, MathContext.PLAIN). - *

    - * The length of the decimal part (the scale) of the result will be - * the maximum of the scales of the two operands. - * - * @param rhs The BigDecimal for the right hand side of - * the addition. - * @return A BigDecimal whose value is - * this+rhs, using fixed point arithmetic. - */ - - public com.ibm.math.BigDecimal add(com.ibm.math.BigDecimal rhs){ - return this.add(rhs,plainMC); - } - - /** - * Returns a BigDecimal whose value is this+rhs. - *

    - * Implements the addition (+) operator - * (as defined in the decimal documentation, see {@link BigDecimal - * class header}), - * and returns the result as a BigDecimal object. - * - * @param rhs The BigDecimal for the right hand side of - * the addition. - * @param set The MathContext arithmetic settings. - * @return A BigDecimal whose value is - * this+rhs. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal add(com.ibm.math.BigDecimal rhs,com.ibm.math.MathContext set){ - com.ibm.math.BigDecimal lhs; - int reqdig; - com.ibm.math.BigDecimal res; - byte usel[]; - int usellen; - byte user[]; - int userlen; - int newlen=0; - int tlen=0; - int mult=0; - byte t[]=null; - int ia=0; - int ib=0; - int ea=0; - int eb=0; - byte ca=0; - byte cb=0; - /* determine requested digits and form */ - if (set.lostDigits) - checkdigits(rhs,set.digits); - lhs=this; // name for clarity and proxy - - /* Quick exit for add floating 0 */ - // plus() will optimize to return same object if possible - if (lhs.ind==0) - if (set.form!=com.ibm.math.MathContext.PLAIN) - return rhs.plus(set); - if (rhs.ind==0) - if (set.form!=com.ibm.math.MathContext.PLAIN) - return lhs.plus(set); - - /* Prepare numbers (round, unless unlimited precision) */ - reqdig=set.digits; // local copy (heavily used) - if (reqdig>0) - { - if (lhs.mant.length>reqdig) - lhs=clone(lhs).round(set); - if (rhs.mant.length>reqdig) - rhs=clone(rhs).round(set); - // [we could reuse the new LHS for result in this case] - } - - res=new com.ibm.math.BigDecimal(); // build result here - - /* Now see how much we have to pad or truncate lhs or rhs in order - to align the numbers. If one number is much larger than the - other, then the smaller cannot affect the answer [but we may - still need to pad with up to DIGITS trailing zeros]. */ - // Note sign may be 0 if digits (reqdig) is 0 - // usel and user will be the byte arrays passed to the adder; we'll - // use them on all paths except quick exits - usel=lhs.mant; - usellen=lhs.mant.length; - user=rhs.mant; - userlen=rhs.mant.length; - {padder:do{/*select*/ - if (lhs.exp==rhs.exp) - {/* no padding needed */ - // This is the most common, and fastest, path - res.exp=lhs.exp; - } - else if (lhs.exp>rhs.exp) - { // need to pad lhs and/or truncate rhs - newlen=(usellen+lhs.exp)-rhs.exp; - /* If, after pad, lhs would be longer than rhs by digits+1 or - more (and digits>0) then rhs cannot affect answer, so we only - need to pad up to a length of DIGITS+1. */ - if (newlen>=((userlen+reqdig)+1)) - if (reqdig>0) - { - // LHS is sufficient - res.mant=usel; - res.exp=lhs.exp; - res.ind=lhs.ind; - if (usellen(reqdig+1)) - if (reqdig>0) - { - // LHS will be max; RHS truncated - tlen=(newlen-reqdig)-1; // truncation length - userlen=userlen-tlen; - res.exp=res.exp+tlen; - newlen=reqdig+1; - } - if (newlen>usellen) - usellen=newlen; // need to pad LHS - } - else{ // need to pad rhs and/or truncate lhs - newlen=(userlen+rhs.exp)-lhs.exp; - if (newlen>=((usellen+reqdig)+1)) - if (reqdig>0) - { - // RHS is sufficient - res.mant=user; - res.exp=rhs.exp; - res.ind=rhs.ind; - if (userlen(reqdig+1)) - if (reqdig>0) - { - // RHS will be max; LHS truncated - tlen=(newlen-reqdig)-1; // truncation length - usellen=usellen-tlen; - res.exp=res.exp+tlen; - newlen=reqdig+1; - } - if (newlen>userlen) - userlen=newlen; // need to pad RHS - } - }while(false);}/*padder*/ - - /* OK, we have aligned mantissas. Now add or subtract. */ - // 1998.06.27 Sign may now be 0 [e.g., 0.000] .. treat as positive - // 1999.05.27 Allow for 00 on lhs [is not larger than 2 on rhs] - // 1999.07.10 Allow for 00 on rhs [is not larger than 2 on rhs] - if (lhs.ind==iszero) - res.ind=ispos; - else - res.ind=lhs.ind; // likely sign, all paths - if (((lhs.ind==isneg)?1:0)==((rhs.ind==isneg)?1:0)) // same sign, 0 non-negative - mult=1; - else - {signdiff:do{ // different signs, so subtraction is needed - mult=-1; // will cause subtract - /* Before we can subtract we must determine which is the larger, - as our add/subtract routine only handles non-negative results - so we may need to swap the operands. */ - {swaptest:do{/*select*/ - if (rhs.ind==iszero) - ; // original A bigger - else if ((usellenuserlen) - ; // original A bigger - else{ - {/* logical lengths the same */ // need compare - /* may still need to swap: compare the strings */ - ia=0; - ib=0; - ea=usel.length-1; - eb=user.length-1; - {compare:for(;;){ - if (ia<=ea) - ca=usel[ia]; - else - { - if (ib>eb) - {/* identical */ - if (set.form!=com.ibm.math.MathContext.PLAIN) - return ZERO; - // [if PLAIN we must do the subtract, in case of 0.000 results] - break compare; - } - ca=(byte)0; - } - if (ib<=eb) - cb=user[ib]; - else - cb=(byte)0; - if (ca!=cb) - { - if (ca B if subtracting */ - // add [A+B*1] or subtract [A+(B*-1)] - res.mant=byteaddsub(usel,usellen,user,userlen,mult,false); - // [reuse possible only after chop; accounting makes not worthwhile] - - // Finish() rounds before stripping leading 0's, then sets form, etc. - return res.finish(set,false); - } - - /** - * Compares this BigDecimal to another, using unlimited - * precision. - *

    - * The same as {@link #compareTo(BigDecimal, MathContext)}, - * where the BigDecimal is rhs, - * and the context is new MathContext(0, MathContext.PLAIN). - * - * @param rhs The BigDecimal for the right hand side of - * the comparison. - * @return An int whose value is -1, 0, or 1 as - * this is numerically less than, equal to, - * or greater than rhs. - * @see #compareTo(Object) - */ - - public int compareTo(com.ibm.math.BigDecimal rhs){ - return this.compareTo(rhs,plainMC); - } - - /** - * Compares this BigDecimal to another. - *

    - * Implements numeric comparison, - * (as defined in the decimal documentation, see {@link BigDecimal - * class header}), - * and returns a result of type int. - *

    - * The result will be: - * - * - * - * - * - * - * - * - * - *
    -1if the current object is less than the first parameter
    0if the current object is equal to the first parameter
    1if the current object is greater than the first parameter.
    - *

    - * A {@link #compareTo(Object)} method is also provided. - * - * @param rhs The BigDecimal for the right hand side of - * the comparison. - * @param set The MathContext arithmetic settings. - * @return An int whose value is -1, 0, or 1 as - * this is numerically less than, equal to, - * or greater than rhs. - * @see #compareTo(Object) - * @since IBM JDK 1.1.8 - */ - - public int compareTo(com.ibm.math.BigDecimal rhs,com.ibm.math.MathContext set){ - int thislength=0; - int i=0; - com.ibm.math.BigDecimal newrhs; - // rhs=null will raise NullPointerException, as per Comparable interface - if (set.lostDigits) - checkdigits(rhs,set.digits); - // [add will recheck in slowpath cases .. but would report -rhs] - if ((this.ind==rhs.ind)&(this.exp==rhs.exp)) - { - /* sign & exponent the same [very common] */ - thislength=this.mant.length; - if (thislengthrhs.mant.length) - return this.ind; - /* lengths are the same; we can do a straight mantissa compare - unless maybe rounding [rounding is very unusual] */ - if ((thislength<=set.digits)|(set.digits==0)) - { - {int $6=thislength;i=0;i:for(;$6>0;$6--,i++){ - if (this.mant[i]rhs.mant[i]) - return this.ind; - } - }/*i*/ - return 0; // identical - } - /* drop through for full comparison */ - } - else - { - /* More fastpaths possible */ - if (this.indrhs.ind) - return 1; - } - /* carry out a subtract to make the comparison */ - newrhs=clone(rhs); // safe copy - newrhs.ind=(byte)-newrhs.ind; // prepare to subtract - return this.add(newrhs,set).ind; // add, and return sign of result - } - - /** - * Returns a plain BigDecimal whose value is - * this/rhs, using fixed point arithmetic. - *

    - * The same as {@link #divide(BigDecimal, int)}, - * where the BigDecimal is rhs, - * and the rounding mode is {@link MathContext#ROUND_HALF_UP}. - * - * The length of the decimal part (the scale) of the result will be - * the same as the scale of the current object, if the latter were - * formatted without exponential notation. - * - * @param rhs The BigDecimal for the right hand side of - * the division. - * @return A plain BigDecimal whose value is - * this/rhs, using fixed point arithmetic. - * @throws ArithmeticException if rhs is zero. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal divide(com.ibm.math.BigDecimal rhs){ - return this.dodivide('D',rhs,plainMC,-1); - } - - /** - * Returns a plain BigDecimal whose value is - * this/rhs, using fixed point arithmetic and a - * rounding mode. - *

    - * The same as {@link #divide(BigDecimal, int, int)}, - * where the BigDecimal is rhs, - * and the second parameter is this.scale(), and - * the third is round. - *

    - * The length of the decimal part (the scale) of the result will - * therefore be the same as the scale of the current object, if the - * latter were formatted without exponential notation. - *

    - * @param rhs The BigDecimal for the right hand side of - * the division. - * @param round The int rounding mode to be used for - * the division (see the {@link MathContext} class). - * @return A plain BigDecimal whose value is - * this/rhs, using fixed point arithmetic - * and the specified rounding mode. - * @throws IllegalArgumentException if round is not a - * valid rounding mode. - * @throws ArithmeticException if rhs is zero. - * @throws ArithmeticException if round is {@link - * MathContext#ROUND_UNNECESSARY} and - * this.scale() is insufficient to - * represent the result exactly. - */ - - public com.ibm.math.BigDecimal divide(com.ibm.math.BigDecimal rhs,int round){ - com.ibm.math.MathContext set; - set=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,round); // [checks round, too] - return this.dodivide('D',rhs,set,-1); // take scale from LHS - } - - /** - * Returns a plain BigDecimal whose value is - * this/rhs, using fixed point arithmetic and a - * given scale and rounding mode. - *

    - * The same as {@link #divide(BigDecimal, MathContext)}, - * where the BigDecimal is rhs, - * new MathContext(0, MathContext.PLAIN, false, round), - * except that the length of the decimal part (the scale) to be used - * for the result is explicit rather than being taken from - * this. - *

    - * The length of the decimal part (the scale) of the result will be - * the same as the scale of the current object, if the latter were - * formatted without exponential notation. - *

    - * @param rhs The BigDecimal for the right hand side of - * the division. - * @param scale The int scale to be used for the result. - * @param round The int rounding mode to be used for - * the division (see the {@link MathContext} class). - * @return A plain BigDecimal whose value is - * this/rhs, using fixed point arithmetic - * and the specified rounding mode. - * @throws IllegalArgumentException if round is not a - * valid rounding mode. - * @throws ArithmeticException if rhs is zero. - * @throws ArithmeticException if scale is negative. - * @throws ArithmeticException if round is {@link - * MathContext#ROUND_UNNECESSARY} and scale - * is insufficient to represent the result exactly. - */ - - public com.ibm.math.BigDecimal divide(com.ibm.math.BigDecimal rhs,int scale,int round){ - com.ibm.math.MathContext set; - if (scale<0) - throw new java.lang.ArithmeticException("Negative scale:"+" "+scale); - set=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,round); // [checks round] - return this.dodivide('D',rhs,set,scale); - } - - /** - * Returns a BigDecimal whose value is this/rhs. - *

    - * Implements the division (/) operator - * (as defined in the decimal documentation, see {@link BigDecimal - * class header}), - * and returns the result as a BigDecimal object. - * - * @param rhs The BigDecimal for the right hand side of - * the division. - * @param set The MathContext arithmetic settings. - * @return A BigDecimal whose value is - * this/rhs. - * @throws ArithmeticException if rhs is zero. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal divide(com.ibm.math.BigDecimal rhs,com.ibm.math.MathContext set){ - return this.dodivide('D',rhs,set,-1); - } - - /** - * Returns a plain BigDecimal whose value is the integer - * part of this/rhs. - *

    - * The same as {@link #divideInteger(BigDecimal, MathContext)}, - * where the BigDecimal is rhs, - * and the context is new MathContext(0, MathContext.PLAIN). - * - * @param rhs The BigDecimal for the right hand side of - * the integer division. - * @return A BigDecimal whose value is the integer - * part of this/rhs. - * @throws ArithmeticException if rhs is zero. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal divideInteger(com.ibm.math.BigDecimal rhs){ - // scale 0 to drop .000 when plain - return this.dodivide('I',rhs,plainMC,0); - } - - /** - * Returns a BigDecimal whose value is the integer - * part of this/rhs. - *

    - * Implements the integer division operator - * (as defined in the decimal documentation, see {@link BigDecimal - * class header}), - * and returns the result as a BigDecimal object. - * - * @param rhs The BigDecimal for the right hand side of - * the integer division. - * @param set The MathContext arithmetic settings. - * @return A BigDecimal whose value is the integer - * part of this/rhs. - * @throws ArithmeticException if rhs is zero. - * @throws ArithmeticException if the result will not fit in the - * number of digits specified for the context. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal divideInteger(com.ibm.math.BigDecimal rhs,com.ibm.math.MathContext set){ - // scale 0 to drop .000 when plain - return this.dodivide('I',rhs,set,0); - } - - /** - * Returns a plain BigDecimal whose value is - * the maximum of this and rhs. - *

    - * The same as {@link #max(BigDecimal, MathContext)}, - * where the BigDecimal is rhs, - * and the context is new MathContext(0, MathContext.PLAIN). - * - * @param rhs The BigDecimal for the right hand side of - * the comparison. - * @return A BigDecimal whose value is - * the maximum of this and rhs. - */ - - public com.ibm.math.BigDecimal max(com.ibm.math.BigDecimal rhs){ - return this.max(rhs,plainMC); - } - - /** - * Returns a BigDecimal whose value is - * the maximum of this and rhs. - *

    - * Returns the larger of the current object and the first parameter. - *

    - * If calling the {@link #compareTo(BigDecimal, MathContext)} method - * with the same parameters would return 1 or - * 0, then the result of calling the - * {@link #plus(MathContext)} method on the current object (using the - * same MathContext parameter) is returned. - * Otherwise, the result of calling the {@link #plus(MathContext)} - * method on the first parameter object (using the same - * MathContext parameter) is returned. - * - * @param rhs The BigDecimal for the right hand side of - * the comparison. - * @param set The MathContext arithmetic settings. - * @return A BigDecimal whose value is - * the maximum of this and rhs. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal max(com.ibm.math.BigDecimal rhs,com.ibm.math.MathContext set){ - if ((this.compareTo(rhs,set))>=0) - return this.plus(set); - else - return rhs.plus(set); - } - - /** - * Returns a plain BigDecimal whose value is - * the minimum of this and rhs. - *

    - * The same as {@link #min(BigDecimal, MathContext)}, - * where the BigDecimal is rhs, - * and the context is new MathContext(0, MathContext.PLAIN). - * - * @param rhs The BigDecimal for the right hand side of - * the comparison. - * @return A BigDecimal whose value is - * the minimum of this and rhs. - */ - - public com.ibm.math.BigDecimal min(com.ibm.math.BigDecimal rhs){ - return this.min(rhs,plainMC); - } - - /** - * Returns a BigDecimal whose value is - * the minimum of this and rhs. - *

    - * Returns the smaller of the current object and the first parameter. - *

    - * If calling the {@link #compareTo(BigDecimal, MathContext)} method - * with the same parameters would return -1 or - * 0, then the result of calling the - * {@link #plus(MathContext)} method on the current object (using the - * same MathContext parameter) is returned. - * Otherwise, the result of calling the {@link #plus(MathContext)} - * method on the first parameter object (using the same - * MathContext parameter) is returned. - * - * @param rhs The BigDecimal for the right hand side of - * the comparison. - * @param set The MathContext arithmetic settings. - * @return A BigDecimal whose value is - * the minimum of this and rhs. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal min(com.ibm.math.BigDecimal rhs,com.ibm.math.MathContext set){ - if ((this.compareTo(rhs,set))<=0) - return this.plus(set); - else - return rhs.plus(set); - } - - /** - * Returns a plain BigDecimal whose value is - * this*rhs, using fixed point arithmetic. - *

    - * The same as {@link #add(BigDecimal, MathContext)}, - * where the BigDecimal is rhs, - * and the context is new MathContext(0, MathContext.PLAIN). - *

    - * The length of the decimal part (the scale) of the result will be - * the sum of the scales of the operands, if they were formatted - * without exponential notation. - * - * @param rhs The BigDecimal for the right hand side of - * the multiplication. - * @return A BigDecimal whose value is - * this*rhs, using fixed point arithmetic. - */ - - public com.ibm.math.BigDecimal multiply(com.ibm.math.BigDecimal rhs){ - return this.multiply(rhs,plainMC); - } - - /** - * Returns a BigDecimal whose value is this*rhs. - *

    - * Implements the multiplication (*) operator - * (as defined in the decimal documentation, see {@link BigDecimal - * class header}), - * and returns the result as a BigDecimal object. - * - * @param rhs The BigDecimal for the right hand side of - * the multiplication. - * @param set The MathContext arithmetic settings. - * @return A BigDecimal whose value is - * this*rhs. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal multiply(com.ibm.math.BigDecimal rhs,com.ibm.math.MathContext set){ - com.ibm.math.BigDecimal lhs; - int padding; - int reqdig; - byte multer[]=null; - byte multand[]=null; - int multandlen; - int acclen=0; - com.ibm.math.BigDecimal res; - byte acc[]; - int n=0; - byte mult=0; - if (set.lostDigits) - checkdigits(rhs,set.digits); - lhs=this; // name for clarity and proxy - - /* Prepare numbers (truncate, unless unlimited precision) */ - padding=0; // trailing 0's to add - reqdig=set.digits; // local copy - if (reqdig>0) - { - if (lhs.mant.length>reqdig) - lhs=clone(lhs).round(set); - if (rhs.mant.length>reqdig) - rhs=clone(rhs).round(set); - // [we could reuse the new LHS for result in this case] - } - else - {/* unlimited */ - // fixed point arithmetic will want every trailing 0; we add these - // after the calculation rather than before, for speed. - if (lhs.exp>0) - padding=padding+lhs.exp; - if (rhs.exp>0) - padding=padding+rhs.exp; - } - - // For best speed, as in DMSRCN, we use the shorter number as the - // multiplier and the longer as the multiplicand. - // 1999.12.22: We used to special case when the result would fit in - // a long, but with Java 1.3 this gave no advantage. - if (lhs.mant.length9) - acclen=multandlen+1; - else - acclen=multandlen; - - /* Now the main long multiplication loop */ - res=new com.ibm.math.BigDecimal(); // where we'll build result - acc=new byte[acclen]; // accumulator, all zeros - // 1998.07.01: calculate from left to right so that accumulator goes - // to likely final length on first addition; this avoids a one-digit - // extension (and object allocation) each time around the loop. - // Initial number therefore has virtual zeros added to right. - {int $7=multer.length;n=0;n:for(;$7>0;$7--,n++){ - mult=multer[n]; - if (mult!=0) - { // [optimization] - // accumulate [accumulator is reusable array] - acc=byteaddsub(acc,acc.length,multand,multandlen,mult,true); - } - // divide multiplicand by 10 for next digit to right - multandlen--; // 'virtual length' - } - }/*n*/ - - res.ind=(byte)(lhs.ind*rhs.ind); // final sign - res.exp=(lhs.exp+rhs.exp)-padding; // final exponent - // [overflow is checked by finish] - - /* add trailing zeros to the result, if necessary */ - if (padding==0) - res.mant=acc; - else - res.mant=extend(acc,acc.length+padding); // add trailing 0s - return res.finish(set,false); - } - - /** - * Returns a plain BigDecimal whose value is - * -this. - *

    - * The same as {@link #negate(MathContext)}, where the context is - * new MathContext(0, MathContext.PLAIN). - *

    - * The length of the decimal part (the scale) of the result will be - * be this.scale() - * - * - * @return A BigDecimal whose value is - * -this. - */ - - public com.ibm.math.BigDecimal negate(){ - return this.negate(plainMC); - } - - /** - * Returns a BigDecimal whose value is -this. - *

    - * Implements the negation (Prefix -) operator - * (as defined in the decimal documentation, see {@link BigDecimal - * class header}), - * and returns the result as a BigDecimal object. - * - * @param set The MathContext arithmetic settings. - * @return A BigDecimal whose value is - * -this. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal negate(com.ibm.math.MathContext set){ - com.ibm.math.BigDecimal res; - // Originally called minus(), changed to matched Java precedents - // This simply clones, flips the sign, and possibly rounds - if (set.lostDigits) - checkdigits((com.ibm.math.BigDecimal)null,set.digits); - res=clone(this); // safe copy - res.ind=(byte)-res.ind; - return res.finish(set,false); - } - - /** - * Returns a plain BigDecimal whose value is - * +this. - * Note that this is not necessarily a - * plain BigDecimal, but the result will always be. - *

    - * The same as {@link #plus(MathContext)}, where the context is - * new MathContext(0, MathContext.PLAIN). - *

    - * The length of the decimal part (the scale) of the result will be - * be this.scale() - * - * @return A BigDecimal whose value is - * +this. - */ - - public com.ibm.math.BigDecimal plus(){ - return this.plus(plainMC); - } - - /** - * Returns a BigDecimal whose value is - * +this. - *

    - * Implements the plus (Prefix +) operator - * (as defined in the decimal documentation, see {@link BigDecimal - * class header}), - * and returns the result as a BigDecimal object. - *

    - * This method is useful for rounding or otherwise applying a context - * to a decimal value. - * - * @param set The MathContext arithmetic settings. - * @return A BigDecimal whose value is - * +this. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal plus(com.ibm.math.MathContext set){ - // This clones and forces the result to the new settings - // May return same object - if (set.lostDigits) - checkdigits((com.ibm.math.BigDecimal)null,set.digits); - // Optimization: returns same object for some common cases - if (set.form==com.ibm.math.MathContext.PLAIN) - if (this.form==com.ibm.math.MathContext.PLAIN) - { - if (this.mant.length<=set.digits) - return this; - if (set.digits==0) - return this; - } - return clone(this).finish(set,false); - } - - /** - * Returns a plain BigDecimal whose value is - * this**rhs, using fixed point arithmetic. - *

    - * The same as {@link #pow(BigDecimal, MathContext)}, - * where the BigDecimal is rhs, - * and the context is new MathContext(0, MathContext.PLAIN). - *

    - * The parameter is the power to which the this will be - * raised; it must be in the range 0 through 999999999, and must - * have a decimal part of zero. Note that these restrictions may be - * removed in the future, so they should not be used as a test for a - * whole number. - *

    - * In addition, the power must not be negative, as no - * MathContext is used and so the result would then - * always be 0. - * - * @param rhs The BigDecimal for the right hand side of - * the operation (the power). - * @return A BigDecimal whose value is - * this**rhs, using fixed point arithmetic. - * @throws ArithmeticException if rhs is out of range or - * is not a whole number. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal pow(com.ibm.math.BigDecimal rhs){ - return this.pow(rhs,plainMC); - } - // The name for this method is inherited from the precedent set by the - // BigInteger and Math classes. - - /** - * Returns a BigDecimal whose value is this**rhs. - *

    - * Implements the power (**) operator - * (as defined in the decimal documentation, see {@link BigDecimal - * class header}), - * and returns the result as a BigDecimal object. - *

    - * The first parameter is the power to which the this - * will be raised; it must be in the range -999999999 through - * 999999999, and must have a decimal part of zero. Note that these - * restrictions may be removed in the future, so they should not be - * used as a test for a whole number. - *

    - * If the digits setting of the MathContext - * parameter is 0, the power must be zero or positive. - * - * @param rhs The BigDecimal for the right hand side of - * the operation (the power). - * @param set The MathContext arithmetic settings. - * @return A BigDecimal whose value is - * this**rhs. - * @throws ArithmeticException if rhs is out of range or - * is not a whole number. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal pow(com.ibm.math.BigDecimal rhs,com.ibm.math.MathContext set){ - int n; - com.ibm.math.BigDecimal lhs; - int reqdig; - int workdigits=0; - int L=0; - com.ibm.math.MathContext workset; - com.ibm.math.BigDecimal res; - boolean seenbit; - int i=0; - if (set.lostDigits) - checkdigits(rhs,set.digits); - n=rhs.intcheck(MinArg,MaxArg); // check RHS by the rules - lhs=this; // clarified name - - reqdig=set.digits; // local copy (heavily used) - if (reqdig==0) - { - if (rhs.ind==isneg) - throw new java.lang.ArithmeticException("Negative power:"+" "+rhs.toString()); - workdigits=0; - } - else - {/* non-0 digits */ - if ((rhs.mant.length+rhs.exp)>reqdig) - throw new java.lang.ArithmeticException("Too many digits:"+" "+rhs.toString()); - - /* Round the lhs to DIGITS if need be */ - if (lhs.mant.length>reqdig) - lhs=clone(lhs).round(set); - - /* L for precision calculation [see ANSI X3.274-1996] */ - L=rhs.mant.length+rhs.exp; // length without decimal zeros/exp - workdigits=(reqdig+L)+1; // calculate the working DIGITS - } - - /* Create a copy of set for working settings */ - // Note: no need to check for lostDigits again. - // 1999.07.17 Note: this construction must follow RHS check - workset=new com.ibm.math.MathContext(workdigits,set.form,false,set.roundingMode); - - res=ONE; // accumulator - if (n==0) - return res; // x**0 == 1 - if (n<0) - n=(int)-n; // [rhs.ind records the sign] - seenbit=false; // set once we've seen a 1-bit - {i=1;i:for(;;i++){ // for each bit [top bit ignored] - n=n+n; // shift left 1 bit - if (n<0) - { // top bit is set - seenbit=true; // OK, we're off - res=res.multiply(lhs,workset); // acc=acc*x - } - if (i==31) - break i; // that was the last bit - if ((!seenbit)) - continue i; // we don't have to square 1 - res=res.multiply(res,workset); // acc=acc*acc [square] - } - }/*i*/ // 32 bits - if (rhs.ind<0) // was a **-n [hence digits>0] - res=ONE.divide(res,workset); // .. so acc=1/acc - return res.finish(set,true); // round and strip [original digits] - } - - /** - * Returns a plain BigDecimal whose value is - * the remainder of this/rhs, using fixed point arithmetic. - *

    - * The same as {@link #remainder(BigDecimal, MathContext)}, - * where the BigDecimal is rhs, - * and the context is new MathContext(0, MathContext.PLAIN). - *

    - * This is not the modulo operator -- the result may be negative. - * - * @param rhs The BigDecimal for the right hand side of - * the remainder operation. - * @return A BigDecimal whose value is the remainder - * of this/rhs, using fixed point arithmetic. - * @throws ArithmeticException if rhs is zero. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal remainder(com.ibm.math.BigDecimal rhs){ - return this.dodivide('R',rhs,plainMC,-1); - } - - /** - * Returns a BigDecimal whose value is the remainder of - * this/rhs. - *

    - * Implements the remainder operator - * (as defined in the decimal documentation, see {@link BigDecimal - * class header}), - * and returns the result as a BigDecimal object. - *

    - * This is not the modulo operator -- the result may be negative. - * - * @param rhs The BigDecimal for the right hand side of - * the remainder operation. - * @param set The MathContext arithmetic settings. - * @return A BigDecimal whose value is the remainder - * of this+rhs. - * @throws ArithmeticException if rhs is zero. - * @throws ArithmeticException if the integer part of the result will - * not fit in the number of digits specified for the - * context. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal remainder(com.ibm.math.BigDecimal rhs,com.ibm.math.MathContext set){ - return this.dodivide('R',rhs,set,-1); - } - - /** - * Returns a plain BigDecimal whose value is - * this-rhs, using fixed point arithmetic. - *

    - * The same as {@link #subtract(BigDecimal, MathContext)}, - * where the BigDecimal is rhs, - * and the context is new MathContext(0, MathContext.PLAIN). - *

    - * The length of the decimal part (the scale) of the result will be - * the maximum of the scales of the two operands. - * - * @param rhs The BigDecimal for the right hand side of - * the subtraction. - * @return A BigDecimal whose value is - * this-rhs, using fixed point arithmetic. - */ - - public com.ibm.math.BigDecimal subtract(com.ibm.math.BigDecimal rhs){ - return this.subtract(rhs,plainMC); - } - - /** - * Returns a BigDecimal whose value is this-rhs. - *

    - * Implements the subtraction (-) operator - * (as defined in the decimal documentation, see {@link BigDecimal - * class header}), - * and returns the result as a BigDecimal object. - * - * @param rhs The BigDecimal for the right hand side of - * the subtraction. - * @param set The MathContext arithmetic settings. - * @return A BigDecimal whose value is - * this-rhs. - * @since IBM JDK 1.1.8 - */ - - public com.ibm.math.BigDecimal subtract(com.ibm.math.BigDecimal rhs,com.ibm.math.MathContext set){ - com.ibm.math.BigDecimal newrhs; - if (set.lostDigits) - checkdigits(rhs,set.digits); - // [add will recheck .. but would report -rhs] - /* carry out the subtraction */ - // we could fastpath -0, but it is too rare. - newrhs=clone(rhs); // safe copy - newrhs.ind=(byte)-newrhs.ind; // prepare to subtract - return this.add(newrhs,set); // arithmetic - } - - /* ---------------------------------------------------------------- */ - /* Other methods */ - /* ---------------------------------------------------------------- */ - - /** - * Converts this BigDecimal to a byte. - * If the BigDecimal has a non-zero decimal part or is - * out of the possible range for a byte (8-bit signed - * integer) result then an ArithmeticException is thrown. - * - * @return A byte equal in value to this. - * @throws ArithmeticException if this has a non-zero - * decimal part, or will not fit in a byte. - * @since IBM JDK 1.1.8 - */ - - public byte byteValueExact(){ - int num; - num=this.intValueExact(); // will check decimal part too - if ((num>127)|(num<(-128))) - throw new java.lang.ArithmeticException("Conversion overflow:"+" "+this.toString()); - return (byte)num; - } - - /** - * Compares this BigDecimal with the value of the parameter. - *

    - * If the parameter is null, or is not an instance of the - * BigDecimal type, an exception is thrown. - * Otherwise, the parameter is cast to type BigDecimal - * and the result of the {@link #compareTo(BigDecimal)} method, - * using the cast parameter, is returned. - *

    - * The {@link #compareTo(BigDecimal, MathContext)} method should be - * used when a MathContext is needed for the comparison. - * - * @param rhs The Object for the right hand side of - * the comparison. - * @return An int whose value is -1, 0, or 1 as - * this is numerically less than, equal to, - * or greater than rhs. - * @throws ClassCastException if rhs cannot be cast to - * a BigDecimal object. - * @see #compareTo(BigDecimal) - * @since JDK1.2 - */ - - public int compareTo(java.lang.Object rhsobj){ - // the cast in the next line will raise ClassCastException if necessary - return compareTo((com.ibm.math.BigDecimal)rhsobj,plainMC); - } - - /** - * Converts this BigDecimal to a double. - * If the BigDecimal is out of the possible range for a - * double (64-bit signed floating point) result then an - * ArithmeticException is thrown. - *

    - * The double produced is identical to result of expressing the - * BigDecimal as a String and then - * converting it using the Double(String) constructor; - * this can result in values of Double.NEGATIVE_INFINITY - * or Double.POSITIVE_INFINITY. - * - * @return A double corresponding to this. - */ - - public double doubleValue(){ - // We go via a String [as does BigDecimal in JDK 1.2] - // Next line could possibly raise NumberFormatException - return java.lang.Double.valueOf(this.toString()).doubleValue(); - } - - /** - * Compares this BigDecimal with rhs for - * equality. - *

    - * If the parameter is null, or is not an instance of the - * BigDecimal type, or is not exactly equal to the current - * BigDecimal object, then false is returned. - * Otherwise, true is returned. - *

    - * "Exactly equal", here, means that the String - * representations of the BigDecimal numbers are - * identical (they have the same characters in the same sequence). - *

    - * The {@link #compareTo(BigDecimal, MathContext)} method should be - * used for more general comparisons. - * @param rhs The Object for the right hand side of - * the comparison. - * @return A boolean whose value true if and - * only if the operands have identical string representations. - * @throws ClassCastException if rhs cannot be cast to - * a BigDecimal object. - * @see #compareTo(Object) - * @see #compareTo(BigDecimal) - * @see #compareTo(BigDecimal, MathContext) - */ - - public boolean equals(java.lang.Object obj){ - com.ibm.math.BigDecimal rhs; - int i=0; - char lca[]=null; - char rca[]=null; - // We are equal iff toString of both are exactly the same - if (obj==null) - return false; // not equal - if ((!(((obj instanceof com.ibm.math.BigDecimal))))) - return false; // not a decimal - rhs=(com.ibm.math.BigDecimal)obj; // cast; we know it will work - if (this.ind!=rhs.ind) - return false; // different signs never match - if (((this.mant.length==rhs.mant.length)&(this.exp==rhs.exp))&(this.form==rhs.form)) - - { // mantissas say all - // here with equal-length byte arrays to compare - {int $8=this.mant.length;i=0;i:for(;$8>0;$8--,i++){ - if (this.mant[i]!=rhs.mant[i]) - return false; - } - }/*i*/ - } - else - { // need proper layout - lca=this.layout(); // layout to character array - rca=rhs.layout(); - if (lca.length!=rca.length) - return false; // mismatch - // here with equal-length character arrays to compare - {int $9=lca.length;i=0;i:for(;$9>0;$9--,i++){ - if (lca[i]!=rca[i]) - return false; - } - }/*i*/ - } - return true; // arrays have identical content - } - - /** - * Converts this BigDecimal to a float. - * If the BigDecimal is out of the possible range for a - * float (32-bit signed floating point) result then an - * ArithmeticException is thrown. - *

    - * The float produced is identical to result of expressing the - * BigDecimal as a String and then - * converting it using the Float(String) constructor; - * this can result in values of Float.NEGATIVE_INFINITY - * or Float.POSITIVE_INFINITY. - * - * @return A float corresponding to this. - */ - - public float floatValue(){ - return java.lang.Float.valueOf(this.toString()).floatValue(); - } - - /** - * Returns the String representation of this - * BigDecimal, modified by layout parameters. - *

    - * This method is provided as a primitive for use by more - * sophisticated classes, such as DecimalFormat, that - * can apply locale-sensitive editing of the result. The level of - * formatting that it provides is a necessary part of the BigDecimal - * class as it is sensitive to and must follow the calculation and - * rounding rules for BigDecimal arithmetic. - * However, if the function is provided elsewhere, it may be removed - * from this class. - *

    - * The parameters, for both forms of the format method - * are all of type int. - * A value of -1 for any parameter indicates that the default action - * or value for that parameter should be used. - *

    - * The parameters, before and after, - * specify the number of characters to be used for the integer part - * and decimal part of the result respectively. Exponential notation - * is not used. If either parameter is -1 (which indicates the default - * action), the number of characters used will be exactly as many as - * are needed for that part. - *

    - * before must be a positive number; if it is larger than - * is needed to contain the integer part, that part is padded on the - * left with blanks to the requested length. If before is - * not large enough to contain the integer part of the number - * (including the sign, for negative numbers) an exception is thrown. - *

    - * after must be a non-negative number; if it is not the - * same size as the decimal part of the number, the number will be - * rounded (or extended with zeros) to fit. Specifying 0 for - * after will cause the number to be rounded to an - * integer (that is, it will have no decimal part or decimal point). - * The rounding method will be the default, - * MathContext.ROUND_HALF_UP. - *

    - * Other rounding methods, and the use of exponential notation, can - * be selected by using {@link #format(int,int,int,int,int,int)}. - * Using the two-parameter form of the method has exactly the same - * effect as using the six-parameter form with the final four - * parameters all being -1. - * - * @param before The int specifying the number of places - * before the decimal point. Use -1 for 'as many as - * are needed'. - * @param after The int specifying the number of places - * after the decimal point. Use -1 for 'as many as are - * needed'. - * @return A String representing this - * BigDecimal, laid out according to the - * specified parameters - * @throws ArithmeticException if the number cannot be laid out as - * requested. - * @throws IllegalArgumentException if a parameter is out of range. - * @see #toString - * @see #toCharArray - * @since IBM JDK 1.1.8 - */ - - public java.lang.String format(int before,int after){ - return format(before,after,-1,-1,com.ibm.math.MathContext.SCIENTIFIC,ROUND_HALF_UP); - } - - /** - * Returns the String representation of this - * BigDecimal, modified by layout parameters and allowing - * exponential notation. - *

    - * This method is provided as a primitive for use by more - * sophisticated classes, such as DecimalFormat, that - * can apply locale-sensitive editing of the result. The level of - * formatting that it provides is a necessary part of the BigDecimal - * class as it is sensitive to and must follow the calculation and - * rounding rules for BigDecimal arithmetic. - * However, if the function is provided elsewhere, it may be removed - * from this class. - *

    - * The parameters are all of type int. - * A value of -1 for any parameter indicates that the default action - * or value for that parameter should be used. - *

    - * The first two parameters (before and - * after) specify the number of characters to be used for - * the integer part and decimal part of the result respectively, as - * defined for {@link #format(int,int)}. - * If either of these is -1 (which indicates the default action), the - * number of characters used will be exactly as many as are needed for - * that part. - *

    - * The remaining parameters control the use of exponential notation - * and rounding. Three (explaces, exdigits, - * and exform) control the exponent part of the result. - * As before, the default action for any of these parameters may be - * selected by using the value -1. - *

    - * explaces must be a positive number; it sets the number - * of places (digits after the sign of the exponent) to be used for - * any exponent part, the default (when explaces is -1) - * being to use as many as are needed. - * If explaces is not -1, space is always reserved for - * an exponent; if one is not needed (for example, if the exponent - * will be 0) then explaces+2 blanks are appended to the - * result. - * - * If explaces is not -1 and is not large enough to - * contain the exponent, an exception is thrown. - *

    - * exdigits sets the trigger point for use of exponential - * notation. If, before any rounding, the number of places needed - * before the decimal point exceeds exdigits, or if the - * absolute value of the result is less than 0.000001, - * then exponential form will be used, provided that - * exdigits was specified. - * When exdigits is -1, exponential notation will never - * be used. If 0 is specified for exdigits, exponential - * notation is always used unless the exponent would be 0. - *

    - * exform sets the form for exponential notation (if - * needed). - * It may be either {@link MathContext#SCIENTIFIC} or - * {@link MathContext#ENGINEERING}. - * If the latter, engineering, form is requested, up to three digits - * (plus sign, if negative) may be needed for the integer part of the - * result (before). Otherwise, only one digit (plus - * sign, if negative) is needed. - *

    - * Finally, the sixth argument, exround, selects the - * rounding algorithm to be used, and must be one of the values - * indicated by a public constant in the {@link MathContext} class - * whose name starts with ROUND_. - * The default (ROUND_HALF_UP) may also be selected by - * using the value -1, as before. - *

    - * The special value MathContext.ROUND_UNNECESSARY may be - * used to detect whether non-zero digits are discarded -- if - * exround has this value than if non-zero digits would - * be discarded (rounded) during formatting then an - * ArithmeticException is thrown. - * - * @param before The int specifying the number of places - * before the decimal point. - * Use -1 for 'as many as are needed'. - * @param after The int specifying the number of places - * after the decimal point. - * Use -1 for 'as many as are needed'. - * @param explaces The int specifying the number of places - * to be used for any exponent. - * Use -1 for 'as many as are needed'. - * @param exdigits The int specifying the trigger - * (digits before the decimal point) which if - * exceeded causes exponential notation to be used. - * Use 0 to force exponential notation. - * Use -1 to force plain notation (no exponential - * notation). - * @param exform The int specifying the form of - * exponential notation to be used - * ({@link MathContext#SCIENTIFIC} or - * {@link MathContext#ENGINEERING}). - * @param exround The int specifying the rounding mode - * to use. - * Use -1 for the default, {@link MathContext#ROUND_HALF_UP}. - * @return A String representing this - * BigDecimal, laid out according to the - * specified parameters - * @throws ArithmeticException if the number cannot be laid out as - * requested. - * @throws IllegalArgumentException if a parameter is out of range. - * @see #toString - * @see #toCharArray - * @since IBM JDK 1.1.8 - */ - - public java.lang.String format(int before,int after,int explaces,int exdigits,int exformint,int exround){ - com.ibm.math.BigDecimal num; - int mag=0; - int thisafter=0; - int lead=0; - byte newmant[]=null; - int chop=0; - int need=0; - int oldexp=0; - char a[]; - int p=0; - char newa[]=null; - int i=0; - int places=0; - - - /* Check arguments */ - if ((before<(-1))|(before==0)) - badarg("format",1,java.lang.String.valueOf(before)); - if (after<(-1)) - badarg("format",2,java.lang.String.valueOf(after)); - if ((explaces<(-1))|(explaces==0)) - badarg("format",3,java.lang.String.valueOf(explaces)); - if (exdigits<(-1)) - badarg("format",4,java.lang.String.valueOf(explaces)); - {/*select*/ - if (exformint==com.ibm.math.MathContext.SCIENTIFIC) - ; - else if (exformint==com.ibm.math.MathContext.ENGINEERING) - ; - else if (exformint==(-1)) - exformint=com.ibm.math.MathContext.SCIENTIFIC; - // note PLAIN isn't allowed - else{ - badarg("format",5,java.lang.String.valueOf(exformint)); - } - } - // checking the rounding mode is done by trying to construct a - // MathContext object with that mode; it will fail if bad - if (exround!=ROUND_HALF_UP) - {try{ // if non-default... - if (exround==(-1)) - exround=ROUND_HALF_UP; - else - new com.ibm.math.MathContext(9,com.ibm.math.MathContext.SCIENTIFIC,false,exround); - } - catch (java.lang.IllegalArgumentException $10){ - badarg("format",6,java.lang.String.valueOf(exround)); - }} - - num=clone(this); // make private copy - - /* Here: - num is BigDecimal to format - before is places before point [>0] - after is places after point [>=0] - explaces is exponent places [>0] - exdigits is exponent digits [>=0] - exformint is exponent form [one of two] - exround is rounding mode [one of eight] - 'before' through 'exdigits' are -1 if not specified - */ - - /* determine form */ - {setform:do{/*select*/ - if (exdigits==(-1)) - num.form=(byte)com.ibm.math.MathContext.PLAIN; - else if (num.ind==iszero) - num.form=(byte)com.ibm.math.MathContext.PLAIN; - else{ - // determine whether triggers - mag=num.exp+num.mant.length; - if (mag>exdigits) - num.form=(byte)exformint; - else - if (mag<(-5)) - num.form=(byte)exformint; - else - num.form=(byte)com.ibm.math.MathContext.PLAIN; - } - }while(false);}/*setform*/ - - /* If 'after' was specified then we may need to adjust the - mantissa. This is a little tricky, as we must conform to the - rules of exponential layout if necessary (e.g., we cannot end up - with 10.0 if scientific). */ - if (after>=0) - {setafter:for(;;){ - // calculate the current after-length - {/*select*/ - if (num.form==com.ibm.math.MathContext.PLAIN) - thisafter=(int)-num.exp; // has decimal part - else if (num.form==com.ibm.math.MathContext.SCIENTIFIC) - thisafter=num.mant.length-1; - else{ // engineering - lead=(((num.exp+num.mant.length)-1))%3; // exponent to use - if (lead<0) - lead=3+lead; // negative exponent case - lead++; // number of leading digits - if (lead>=num.mant.length) - thisafter=0; - else - thisafter=num.mant.length-lead; - } - } - if (thisafter==after) - break setafter; // we're in luck - if (thisafter0] - if (chop>num.mant.length) - { // all digits go, no chance of carry - // carry on with zero - num.mant=ZERO.mant; - num.ind=iszero; - num.exp=0; - continue setafter; // recheck: we may need trailing zeros - } - // we have a digit to inspect from existing mantissa - // round the number as required - need=num.mant.length-chop; // digits to end up with [may be 0] - oldexp=num.exp; // save old exponent - num.round(need,exround); - // if the exponent grew by more than the digits we chopped, then - // we must have had a carry, so will need to recheck the layout - if ((num.exp-oldexp)==chop) - break setafter; // number did not have carry - // mantissa got extended .. so go around and check again - } - }/*setafter*/ - - a=num.layout(); // lay out, with exponent if required, etc. - - /* Here we have laid-out number in 'a' */ - // now apply 'before' and 'explaces' as needed - if (before>0) - { - // look for '.' or 'E' - {int $11=a.length;p=0;p:for(;$11>0;$11--,p++){ - if (a[p]=='.') - break p; - if (a[p]=='E') - break p; - } - }/*p*/ - // p is now offset of '.', 'E', or character after end of array - // that is, the current length of before part - if (p>before) - badarg("format",1,java.lang.String.valueOf(before)); // won't fit - if (p0;$12--,i++){ - newa[i]=' '; - } - }/*i*/ - java.lang.System.arraycopy((java.lang.Object)a,0,(java.lang.Object)newa,i,a.length); - a=newa; - } - // [if p=before then it's just the right length] - } - - if (explaces>0) - { - // look for 'E' [cannot be at offset 0] - {int $13=a.length-1;p=a.length-1;p:for(;$13>0;$13--,p--){ - if (a[p]=='E') - break p; - } - }/*p*/ - // p is now offset of 'E', or 0 - if (p==0) - { // no E part; add trailing blanks - newa=new char[(a.length+explaces)+2]; - java.lang.System.arraycopy((java.lang.Object)a,0,(java.lang.Object)newa,0,a.length); - {int $14=explaces+2;i=a.length;i:for(;$14>0;$14--,i++){ - newa[i]=' '; - } - }/*i*/ - a=newa; - } - else - {/* found E */ // may need to insert zeros - places=(a.length-p)-2; // number so far - if (places>explaces) - badarg("format",3,java.lang.String.valueOf(explaces)); - if (places0;$15--,i++){ - newa[i]='0'; - } - }/*i*/ - java.lang.System.arraycopy((java.lang.Object)a,p+2,(java.lang.Object)newa,i,places); // remainder of exponent - a=newa; - } - // [if places=explaces then it's just the right length] - } - } - return new java.lang.String(a); - } - - /** - * Returns the hashcode for this BigDecimal. - * This hashcode is suitable for use by the - * java.util.Hashtable class. - *

    - * Note that two BigDecimal objects are only guaranteed - * to produce the same hashcode if they are exactly equal (that is, - * the String representations of the - * BigDecimal numbers are identical -- they have the same - * characters in the same sequence). - * - * @return An int that is the hashcode for this. - */ - - public int hashCode(){ - // Maybe calculate ourselves, later. If so, note that there can be - // more than one internal representation for a given toString() result. - return this.toString().hashCode(); - } - - /** - * Converts this BigDecimal to an int. - * If the BigDecimal has a non-zero decimal part it is - * discarded. If the BigDecimal is out of the possible - * range for an int (32-bit signed integer) result then - * only the low-order 32 bits are used. (That is, the number may be - * decapitated.) To avoid unexpected errors when these - * conditions occur, use the {@link #intValueExact} method. - * - * @return An int converted from this, - * truncated and decapitated if necessary. - */ - - public int intValue(){ - return toBigInteger().intValue(); - } - - /** - * Converts this BigDecimal to an int. - * If the BigDecimal has a non-zero decimal part or is - * out of the possible range for an int (32-bit signed - * integer) result then an ArithmeticException is thrown. - * - * @return An int equal in value to this. - * @throws ArithmeticException if this has a non-zero - * decimal part, or will not fit in an - * int. - * @since IBM JDK 1.1.8 - */ - - public int intValueExact(){ - int lodigit; - int useexp=0; - int result; - int i=0; - int topdig=0; - // This does not use longValueExact() as the latter can be much - // slower. - // intcheck (from pow) relies on this to check decimal part - if (ind==iszero) - return 0; // easy, and quite common - /* test and drop any trailing decimal part */ - lodigit=mant.length-1; - if (exp<0) - { - lodigit=lodigit+exp; // reduces by -(-exp) - /* all decimal places must be 0 */ - if ((!(allzero(mant,lodigit+1)))) - throw new java.lang.ArithmeticException("Decimal part non-zero:"+" "+this.toString()); - if (lodigit<0) - return 0; // -1=0 */ - if ((exp+lodigit)>9) // early exit - throw new java.lang.ArithmeticException("Conversion overflow:"+" "+this.toString()); - useexp=exp; - } - /* convert the mantissa to binary, inline for speed */ - result=0; - {int $16=lodigit+useexp;i=0;i:for(;i<=$16;i++){ - result=result*10; - if (i<=lodigit) - result=result+mant[i]; - } - }/*i*/ - - /* Now, if the risky length, check for overflow */ - if ((lodigit+useexp)==9) - { - // note we cannot just test for -ve result, as overflow can move a - // zero into the top bit [consider 5555555555] - topdig=result/1000000000; // get top digit, preserving sign - if (topdig!=mant[0]) - { // digit must match and be positive - // except in the special case ... - if (result==java.lang.Integer.MIN_VALUE) // looks like the special - if (ind==isneg) // really was negative - if (mant[0]==2) - return result; // really had top digit 2 - throw new java.lang.ArithmeticException("Conversion overflow:"+" "+this.toString()); - } - } - - /* Looks good */ - if (ind==ispos) - return result; - return (int)-result; - } - - /** - * Converts this BigDecimal to a long. - * If the BigDecimal has a non-zero decimal part it is - * discarded. If the BigDecimal is out of the possible - * range for a long (64-bit signed integer) result then - * only the low-order 64 bits are used. (That is, the number may be - * decapitated.) To avoid unexpected errors when these - * conditions occur, use the {@link #longValueExact} method. - * - * @return A long converted from this, - * truncated and decapitated if necessary. - */ - - public long longValue(){ - return toBigInteger().longValue(); - } - - /** - * Converts this BigDecimal to a long. - * If the BigDecimal has a non-zero decimal part or is - * out of the possible range for a long (64-bit signed - * integer) result then an ArithmeticException is thrown. - * - * @return A long equal in value to this. - * @throws ArithmeticException if this has a non-zero - * decimal part, or will not fit in a - * long. - * @since IBM JDK 1.1.8 - */ - - public long longValueExact(){ - int lodigit; - int cstart=0; - int useexp=0; - long result; - int i=0; - long topdig=0; - // Identical to intValueExact except for result=long, and exp>=20 test - if (ind==0) - return 0; // easy, and quite common - lodigit=mant.length-1; // last included digit - if (exp<0) - { - lodigit=lodigit+exp; // -(-exp) - /* all decimal places must be 0 */ - if (lodigit<0) - cstart=0; - else - cstart=lodigit+1; - if ((!(allzero(mant,cstart)))) - throw new java.lang.ArithmeticException("Decimal part non-zero:"+" "+this.toString()); - if (lodigit<0) - return 0; // -1=0 */ - if ((exp+mant.length)>18) // early exit - throw new java.lang.ArithmeticException("Conversion overflow:"+" "+this.toString()); - useexp=exp; - } - - /* convert the mantissa to binary, inline for speed */ - // note that we could safely use the 'test for wrap to negative' - // algorithm here, but instead we parallel the intValueExact - // algorithm for ease of checking and maintenance. - result=(long)0; - {int $17=lodigit+useexp;i=0;i:for(;i<=$17;i++){ - result=result*10; - if (i<=lodigit) - result=result+mant[i]; - } - }/*i*/ - - /* Now, if the risky length, check for overflow */ - if ((lodigit+useexp)==18) - { - topdig=result/1000000000000000000L; // get top digit, preserving sign - if (topdig!=mant[0]) - { // digit must match and be positive - // except in the special case ... - if (result==java.lang.Long.MIN_VALUE) // looks like the special - if (ind==isneg) // really was negative - if (mant[0]==9) - return result; // really had top digit 9 - throw new java.lang.ArithmeticException("Conversion overflow:"+" "+this.toString()); - } - } - - /* Looks good */ - if (ind==ispos) - return result; - return (long)-result; - } - - /** - * Returns a plain BigDecimal whose decimal point has - * been moved to the left by a specified number of positions. - * The parameter, n, specifies the number of positions to - * move the decimal point. - * That is, if n is 0 or positive, the number returned is - * given by: - *

    - * this.multiply(TEN.pow(new BigDecimal(-n))) - * - *

    - * n may be negative, in which case the method returns - * the same result as movePointRight(-n). - * - * @param n The int specifying the number of places to - * move the decimal point leftwards. - * @return A BigDecimal derived from - * this, with the decimal point moved - * n places to the left. - */ - - public com.ibm.math.BigDecimal movePointLeft(int n){ - com.ibm.math.BigDecimal res; - // very little point in optimizing for shift of 0 - res=clone(this); - res.exp=res.exp-n; - return res.finish(plainMC,false); // finish sets form and checks exponent - } - - /** - * Returns a plain BigDecimal whose decimal point has - * been moved to the right by a specified number of positions. - * The parameter, n, specifies the number of positions to - * move the decimal point. - * That is, if n is 0 or positive, the number returned is - * given by: - *

    - * this.multiply(TEN.pow(new BigDecimal(n))) - * - *

    - * n may be negative, in which case the method returns - * the same result as movePointLeft(-n). - * - * @param n The int specifying the number of places to - * move the decimal point rightwards. - * @return A BigDecimal derived from - * this, with the decimal point moved - * n places to the right. - */ - - public com.ibm.math.BigDecimal movePointRight(int n){ - com.ibm.math.BigDecimal res; - res=clone(this); - res.exp=res.exp+n; - return res.finish(plainMC,false); - } - - /** - * Returns the scale of this BigDecimal. - * Returns a non-negative int which is the scale of the - * number. The scale is the number of digits in the decimal part of - * the number if the number were formatted without exponential - * notation. - * - * @return An int whose value is the scale of this - * BigDecimal. - */ - - public int scale(){ - if (exp>=0) - return 0; // scale can never be negative - return (int)-exp; - } - - /** - * Returns a plain BigDecimal with a given scale. - *

    - * If the given scale (which must be zero or positive) is the same as - * or greater than the length of the decimal part (the scale) of this - * BigDecimal then trailing zeros will be added to the - * decimal part as necessary. - *

    - * If the given scale is less than the length of the decimal part (the - * scale) of this BigDecimal then trailing digits - * will be removed, and in this case an - * ArithmeticException is thrown if any discarded digits - * are non-zero. - *

    - * The same as {@link #setScale(int, int)}, where the first parameter - * is the scale, and the second is - * MathContext.ROUND_UNNECESSARY. - * - * @param scale The int specifying the scale of the - * resulting BigDecimal. - * @return A plain BigDecimal with the given scale. - * @throws ArithmeticException if scale is negative. - * @throws ArithmeticException if reducing scale would discard - * non-zero digits. - */ - - public com.ibm.math.BigDecimal setScale(int scale){ - return setScale(scale,ROUND_UNNECESSARY); - } - - /** - * Returns a plain BigDecimal with a given scale. - *

    - * If the given scale (which must be zero or positive) is the same as - * or greater than the length of the decimal part (the scale) of this - * BigDecimal then trailing zeros will be added to the - * decimal part as necessary. - *

    - * If the given scale is less than the length of the decimal part (the - * scale) of this BigDecimal then trailing digits - * will be removed, and the rounding mode given by the second - * parameter is used to determine if the remaining digits are - * affected by a carry. - * In this case, an IllegalArgumentException is thrown if - * round is not a valid rounding mode. - *

    - * If round is MathContext.ROUND_UNNECESSARY, - * an ArithmeticException is thrown if any discarded - * digits are non-zero. - * - * @param scale The int specifying the scale of the - * resulting BigDecimal. - * @param round The int rounding mode to be used for - * the division (see the {@link MathContext} class). - * @return A plain BigDecimal with the given scale. - * @throws IllegalArgumentException if round is not a - * valid rounding mode. - * @throws ArithmeticException if scale is negative. - * @throws ArithmeticException if round is - * MathContext.ROUND_UNNECESSARY, and - * reducing scale would discard non-zero digits. - */ - - public com.ibm.math.BigDecimal setScale(int scale,int round){ - int ourscale; - com.ibm.math.BigDecimal res; - int padding=0; - int newlen=0; - // at present this naughtily only checks the round value if it is - // needed (used), for speed - ourscale=this.scale(); - if (ourscale==scale) // already correct scale - if (this.form==com.ibm.math.MathContext.PLAIN) // .. and form - return this; - res=clone(this); // need copy - if (ourscale<=scale) - { // simply zero-padding/changing form - // if ourscale is 0 we may have lots of 0s to add - if (ourscale==0) - padding=res.exp+scale; - else - padding=scale-ourscale; - res.mant=extend(res.mant,res.mant.length+padding); - res.exp=(int)-scale; // as requested - } - else - {/* ourscale>scale: shortening, probably */ - if (scale<0) - throw new java.lang.ArithmeticException("Negative scale:"+" "+scale); - // [round() will raise exception if invalid round] - newlen=res.mant.length-((ourscale-scale)); // [<=0 is OK] - res=res.round(newlen,round); // round to required length - // This could have shifted left if round (say) 0.9->1[.0] - // Repair if so by adding a zero and reducing exponent - if (res.exp!=((int)-scale)) - { - res.mant=extend(res.mant,res.mant.length+1); - res.exp=res.exp-1; - } - } - res.form=(byte)com.ibm.math.MathContext.PLAIN; // by definition - return res; - } - - /** - * Converts this BigDecimal to a short. - * If the BigDecimal has a non-zero decimal part or is - * out of the possible range for a short (16-bit signed - * integer) result then an ArithmeticException is thrown. - * - * @return A short equal in value to this. - * @throws ArithmeticException if this has a non-zero - * decimal part, or will not fit in a - * short. - * @since IBM JDK 1.1.8 - */ - - public short shortValueExact(){ - int num; - num=this.intValueExact(); // will check decimal part too - if ((num>32767)|(num<(-32768))) - throw new java.lang.ArithmeticException("Conversion overflow:"+" "+this.toString()); - return (short)num; - } - - /** - * Returns the sign of this BigDecimal, as an - * int. - * This returns the signum function value that represents the - * sign of this BigDecimal. - * That is, -1 if the BigDecimal is negative, 0 if it is - * numerically equal to zero, or 1 if it is positive. - * - * @return An int which is -1 if the - * BigDecimal is negative, 0 if it is - * numerically equal to zero, or 1 if it is positive. - */ - - public int signum(){ - return (int)this.ind; // [note this assumes values for ind.] - } - - /** - * Converts this BigDecimal to a - * java.math.BigDecimal. - *

    - * This is an exact conversion; the result is the same as if the - * BigDecimal were formatted as a plain number without - * any rounding or exponent and then the - * java.math.BigDecimal(java.lang.String) constructor - * were used to construct the result. - *

    - * (Note: this method is provided only in the - * com.ibm.math version of the BigDecimal class. - * It would not be present in a java.math version.) - * - * @return The java.math.BigDecimal equal in value - * to this BigDecimal. - * @since IBM JDK 1.1.8 - */ - - public java.math.BigDecimal toBigDecimal(){ - return new java.math.BigDecimal(this.unscaledValue(),this.scale()); - } - - /** - * Converts this BigDecimal to a - * java.math.BigInteger. - *

    - * Any decimal part is truncated (discarded). - * If an exception is desired should the decimal part be non-zero, - * use {@link #toBigIntegerExact()}. - * - * @return The java.math.BigInteger equal in value - * to the integer part of this BigDecimal. - */ - - public java.math.BigInteger toBigInteger(){ - com.ibm.math.BigDecimal res=null; - int newlen=0; - byte newmant[]=null; - {/*select*/ - if ((exp>=0)&(form==com.ibm.math.MathContext.PLAIN)) - res=this; // can layout simply - else if (exp>=0) - { - res=clone(this); // safe copy - res.form=(byte)com.ibm.math.MathContext.PLAIN; // .. and request PLAIN - } - else{ - { // exp<0; scale to be truncated - // we could use divideInteger, but we may as well be quicker - if (((int)-this.exp)>=this.mant.length) - res=ZERO; // all blows away - else - { - res=clone(this); // safe copy - newlen=res.mant.length+res.exp; - newmant=new byte[newlen]; // [shorter] - java.lang.System.arraycopy((java.lang.Object)res.mant,0,(java.lang.Object)newmant,0,newlen); - res.mant=newmant; - res.form=(byte)com.ibm.math.MathContext.PLAIN; - res.exp=0; - } - } - } - } - return new BigInteger(new java.lang.String(res.layout())); - } - - /** - * Converts this BigDecimal to a - * java.math.BigInteger. - *

    - * An exception is thrown if the decimal part (if any) is non-zero. - * - * @return The java.math.BigInteger equal in value - * to the integer part of this BigDecimal. - * @throws ArithmeticException if this has a non-zero - * decimal part. - * @since IBM JDK 1.1.8 - */ - - public java.math.BigInteger toBigIntegerExact(){ - /* test any trailing decimal part */ - if (exp<0) - { // possible decimal part - /* all decimal places must be 0; note exp<0 */ - if ((!(allzero(mant,mant.length+exp)))) - throw new java.lang.ArithmeticException("Decimal part non-zero:"+" "+this.toString()); - } - return toBigInteger(); - } - - /** - * Returns the BigDecimal as a character array. - * The result of this method is the same as using the - * sequence toString().toCharArray(), but avoids creating - * the intermediate String and char[] - * objects. - * - * @return The char[] array corresponding to this - * BigDecimal. - * @since IBM JDK 1.1.8 - */ - - public char[] toCharArray(){ - return layout(); - } - - /** - * Returns the BigDecimal as a String. - * This returns a String that exactly represents this - * BigDecimal, as defined in the decimal documentation - * (see {@link BigDecimal class header}). - *

    - * By definition, using the {@link #BigDecimal(String)} constructor - * on the result String will create a - * BigDecimal that is exactly equal to the original - * BigDecimal. - * - * @return The String exactly corresponding to this - * BigDecimal. - * @see #format(int, int) - * @see #format(int, int, int, int, int, int) - * @see #toCharArray() - */ - - public java.lang.String toString(){ - return new java.lang.String(layout()); - } - - /** - * Returns the number as a BigInteger after removing the - * scale. - * That is, the number is expressed as a plain number, any decimal - * point is then removed (retaining the digits of any decimal part), - * and the result is then converted to a BigInteger. - * - * @return The java.math.BigInteger equal in value to - * this BigDecimal multiplied by ten to the - * power of this.scale(). - * @since JDK1.2 - */ - - public java.math.BigInteger unscaledValue(){ - com.ibm.math.BigDecimal res=null; - if (exp>=0) - res=this; - else - { - res=clone(this); // safe copy - res.exp=0; // drop scale - } - return res.toBigInteger(); - } - - /** - * Translates a double to a BigDecimal. - *

    - * Returns a BigDecimal which is the decimal - * representation of the 64-bit signed binary floating point - * parameter. If the parameter is infinite, or is not a number (NaN), - * a NumberFormatException is thrown. - *

    - * The number is constructed as though num had been - * converted to a String using the - * Double.toString() method and the - * {@link #BigDecimal(java.lang.String)} constructor had then been used. - * This is typically not an exact conversion. - * - * @param dub The double to be translated. - * @return The BigDecimal equal in value to - * dub. - * @throws NumberFormatException if the parameter is infinite or - * not a number. - * @since IBM JDK 1.1.8 - */ - - public static com.ibm.math.BigDecimal valueOf(double dub){ - // Reminder: a zero double returns '0.0', so we cannot fastpath to - // use the constant ZERO. This might be important enough to justify - // a factory approach, a cache, or a few private constants, later. - return new com.ibm.math.BigDecimal((new java.lang.Double(dub)).toString()); - } - - /** - * Translates a long to a BigDecimal. - * That is, returns a plain BigDecimal whose value is - * equal to the given long. - * - * @param lint The long to be translated. - * @return The BigDecimal equal in value to - * lint. - */ - - public static com.ibm.math.BigDecimal valueOf(long lint){ - return valueOf(lint,0); - } - - /** - * Translates a long to a BigDecimal with a - * given scale. - * That is, returns a plain BigDecimal whose unscaled - * value is equal to the given long, adjusted by the - * second parameter, scale. - *

    - * The result is given by: - *

    - * (new BigDecimal(lint)).divide(TEN.pow(new BigDecimal(scale))) - * - *

    - * A NumberFormatException is thrown if scale - * is negative. - * - * @param lint The long to be translated. - * @param scale The int scale to be applied. - * @return The BigDecimal equal in value to - * lint. - * @throws NumberFormatException if the scale is negative. - */ - - public static com.ibm.math.BigDecimal valueOf(long lint,int scale){ - com.ibm.math.BigDecimal res=null; - {/*select*/ - if (lint==0) - res=ZERO; - else if (lint==1) - res=ONE; - else if (lint==10) - res=TEN; - else{ - res=new com.ibm.math.BigDecimal(lint); - } - } - if (scale==0) - return res; - if (scale<0) - throw new java.lang.NumberFormatException("Negative scale:"+" "+scale); - res=clone(res); // safe copy [do not mutate] - res.exp=(int)-scale; // exponent is -scale - return res; - } - - /* ---------------------------------------------------------------- */ - /* Private methods */ - /* ---------------------------------------------------------------- */ - - /* Return char array value of a BigDecimal (conversion from - BigDecimal to laid-out canonical char array). -

    The mantissa will either already have been rounded (following an - operation) or will be of length appropriate (in the case of - construction from an int, for example). -

    We must not alter the mantissa, here. -

    'form' describes whether we are to use exponential notation (and - if so, which), or if we are to lay out as a plain/pure numeric. - */ - - private char[] layout(){ - char cmant[]; - int i=0; - java.lang.StringBuffer sb=null; - int euse=0; - int sig=0; - char csign=0; - char rec[]=null; - int needsign; - int mag; - int len=0; - cmant=new char[mant.length]; // copy byte[] to a char[] - {int $18=mant.length;i=0;i:for(;$18>0;$18--,i++){ - cmant[i]=(char)(mant[i]+((int)('0'))); - } - }/*i*/ - - if (form!=com.ibm.math.MathContext.PLAIN) - {/* exponential notation needed */ - sb=new java.lang.StringBuffer(cmant.length+15); // -x.xxxE+999999999 - if (ind==isneg) - sb.append('-'); - euse=(exp+cmant.length)-1; // exponent to use - /* setup sig=significant digits and copy to result */ - if (form==com.ibm.math.MathContext.SCIENTIFIC) - { // [default] - sb.append(cmant[0]); // significant character - if (cmant.length>1) // have decimal part - sb.append('.').append(cmant,1,cmant.length-1); - } - else - {engineering:do{ - sig=euse%3; // common - if (sig<0) - sig=3+sig; // negative exponent - euse=euse-sig; - sig++; - if (sig>=cmant.length) - { // zero padding may be needed - sb.append(cmant,0,cmant.length); - {int $19=sig-cmant.length;for(;$19>0;$19--){ - sb.append('0'); - } - } - } - else - { // decimal point needed - sb.append(cmant,0,sig).append('.').append(cmant,sig,cmant.length-sig); - } - }while(false);}/*engineering*/ - if (euse!=0) - { - if (euse<0) - { - csign='-'; - euse=(int)-euse; - } - else - csign='+'; - sb.append('E').append(csign).append(euse); - } - rec=new char[sb.length()]; - Utility.getChars(sb, 0,sb.length(),rec,0); - return rec; - } - - /* Here for non-exponential (plain) notation */ - if (exp==0) - {/* easy */ - if (ind>=0) - return cmant; // non-negative integer - rec=new char[cmant.length+1]; - rec[0]='-'; - java.lang.System.arraycopy((java.lang.Object)cmant,0,(java.lang.Object)rec,1,cmant.length); - return rec; - } - - /* Need a '.' and/or some zeros */ - needsign=(int)((ind==isneg)?1:0); // space for sign? 0 or 1 - - /* MAG is the position of the point in the mantissa (index of the - character it follows) */ - mag=exp+cmant.length; - - if (mag<1) - {/* 0.00xxxx form */ - len=(needsign+2)-exp; // needsign+2+(-mag)+cmant.length - rec=new char[len]; - if (needsign!=0) - rec[0]='-'; - rec[needsign]='0'; - rec[needsign+1]='.'; - {int $20=(int)-mag;i=needsign+2;i:for(;$20>0;$20--,i++){ // maybe none - rec[i]='0'; - } - }/*i*/ - java.lang.System.arraycopy((java.lang.Object)cmant,0,(java.lang.Object)rec,(needsign+2)-mag,cmant.length); - return rec; - } - - if (mag>cmant.length) - {/* xxxx0000 form */ - len=needsign+mag; - rec=new char[len]; - if (needsign!=0) - rec[0]='-'; - java.lang.System.arraycopy((java.lang.Object)cmant,0,(java.lang.Object)rec,needsign,cmant.length); - {int $21=mag-cmant.length;i=needsign+cmant.length;i:for(;$21>0;$21--,i++){ // never 0 - rec[i]='0'; - } - }/*i*/ - return rec; - } - - /* decimal point is in the middle of the mantissa */ - len=(needsign+1)+cmant.length; - rec=new char[len]; - if (needsign!=0) - rec[0]='-'; - java.lang.System.arraycopy((java.lang.Object)cmant,0,(java.lang.Object)rec,needsign,mag); - rec[needsign+mag]='.'; - java.lang.System.arraycopy((java.lang.Object)cmant,mag,(java.lang.Object)rec,(needsign+mag)+1,cmant.length-mag); - return rec; - } - - /* Checks a BigDecimal argument to ensure it's a true integer - in a given range. -

    If OK, returns it as an int. */ - // [currently only used by pow] - - private int intcheck(int min,int max){ - int i; - i=this.intValueExact(); // [checks for non-0 decimal part] - // Use same message as though intValueExact failed due to size - if ((imax)) - throw new java.lang.ArithmeticException("Conversion overflow:"+" "+i); - return i; - } - - /* Carry out division operations. */ - /* - Arg1 is operation code: D=divide, I=integer divide, R=remainder - Arg2 is the rhs. - Arg3 is the context. - Arg4 is explicit scale iff code='D' or 'I' (-1 if none). - - Underlying algorithm (complications for Remainder function and - scaled division are omitted for clarity): - - Test for x/0 and then 0/x - Exp =Exp1 - Exp2 - Exp =Exp +len(var1) -len(var2) - Sign=Sign1 * Sign2 - Pad accumulator (Var1) to double-length with 0's (pad1) - Pad Var2 to same length as Var1 - B2B=1st two digits of var2, +1 to allow for roundup - have=0 - Do until (have=digits+1 OR residue=0) - if exp<0 then if integer divide/residue then leave - this_digit=0 - Do forever - compare numbers - if <0 then leave inner_loop - if =0 then (- quick exit without subtract -) do - this_digit=this_digit+1; output this_digit - leave outer_loop; end - Compare lengths of numbers (mantissae): - If same then CA=first_digit_of_Var1 - else CA=first_two_digits_of_Var1 - mult=ca*10/b2b -- Good and safe guess at divisor - if mult=0 then mult=1 - this_digit=this_digit+mult - subtract - end inner_loop - if have\=0 | this_digit\=0 then do - output this_digit - have=have+1; end - var2=var2/10 - exp=exp-1 - end outer_loop - exp=exp+1 -- set the proper exponent - if have=0 then generate answer=0 - Return to FINISHED - Result defined by MATHV1 - - For extended commentary, see DMSRCN. - */ - - private com.ibm.math.BigDecimal dodivide(char code,com.ibm.math.BigDecimal rhs,com.ibm.math.MathContext set,int scale){ - com.ibm.math.BigDecimal lhs; - int reqdig; - int newexp; - com.ibm.math.BigDecimal res; - int newlen; - byte var1[]; - int var1len; - byte var2[]; - int var2len; - int b2b; - int have; - int thisdigit=0; - int i=0; - byte v2=0; - int ba=0; - int mult=0; - int start=0; - int padding=0; - int d=0; - byte newvar1[]=null; - byte lasthave=0; - int actdig=0; - byte newmant[]=null; - - if (set.lostDigits) - checkdigits(rhs,set.digits); - lhs=this; // name for clarity - - // [note we must have checked lostDigits before the following checks] - if (rhs.ind==0) - throw new java.lang.ArithmeticException("Divide by 0"); // includes 0/0 - if (lhs.ind==0) - { // 0/x => 0 [possibly with .0s] - if (set.form!=com.ibm.math.MathContext.PLAIN) - return ZERO; - if (scale==(-1)) - return lhs; - return lhs.setScale(scale); - } - - /* Prepare numbers according to BigDecimal rules */ - reqdig=set.digits; // local copy (heavily used) - if (reqdig>0) - { - if (lhs.mant.length>reqdig) - lhs=clone(lhs).round(set); - if (rhs.mant.length>reqdig) - rhs=clone(rhs).round(set); - } - else - {/* scaled divide */ - if (scale==(-1)) - scale=lhs.scale(); - // set reqdig to be at least large enough for the computation - reqdig=lhs.mant.length; // base length - // next line handles both positive lhs.exp and also scale mismatch - if (scale!=((int)-lhs.exp)) - reqdig=(reqdig+scale)+lhs.exp; - reqdig=(reqdig-((rhs.mant.length-1)))-rhs.exp; // reduce by RHS effect - if (reqdig1) - b2b=b2b+var2[1]; - - /* start the long-division loops */ - have=0; - {outer:for(;;){ - thisdigit=0; - /* find the next digit */ - {inner:for(;;){ - if (var1len0;$22--,i++){ - // var1len is always <= var1.length - if (iv2) - break compare; // OK to subtract - } - }/*i*/ - /* reach here if lhs and rhs are identical; subtraction will - increase digit by one, and the residue will be 0 so we - are done; leave the loop with residue set to 0 (in case - code is 'R' or ROUND_UNNECESSARY or a ROUND_HALF_xxxx is - being checked) */ - thisdigit++; - res.mant[have]=(byte)thisdigit; - have++; - var1[0]=(byte)0; // residue to 0 [this is all we'll test] - // var1len=1 -- [optimized out] - break outer; - }while(false);}/*compare*/ - /* prepare for subtraction. Estimate BA (lengths the same) */ - ba=(int)var1[0]; // use only first digit - } // lengths the same - else - {/* lhs longer than rhs */ - /* use first two digits for estimate */ - ba=var1[0]*10; - if (var1len>1) - ba=ba+var1[1]; - } - /* subtraction needed; V1>=V2 */ - mult=(ba*10)/b2b; - if (mult==0) - mult=1; - thisdigit=thisdigit+mult; - // subtract; var1 reusable - var1=byteaddsub(var1,var1len,var2,var2len,(int)-mult,true); - if (var1[0]!=0) - continue inner; // maybe another subtract needed - /* V1 now probably has leading zeros, remove leading 0's and try - again. (It could be longer than V2) */ - {int $23=var1len-2;start=0;start:for(;start<=$23;start++){ - if (var1[start]!=0) - break start; - var1len--; - } - }/*start*/ - if (start==0) - continue inner; - // shift left - java.lang.System.arraycopy((java.lang.Object)var1,start,(java.lang.Object)var1,0,var1len); - } - }/*inner*/ - - /* We have the next digit */ - if ((have!=0)|(thisdigit!=0)) - { // put the digit we got - res.mant[have]=(byte)thisdigit; - have++; - if (have==(reqdig+1)) - break outer; // we have all we need - if (var1[0]==0) - break outer; // residue now 0 - } - /* can leave now if a scaled divide and exponent is small enough */ - if (scale>=0) - if (((int)-res.exp)>scale) - break outer; - /* can leave now if not Divide and no integer part left */ - if (code!='D') - if (res.exp<=0) - break outer; - res.exp=res.exp-1; // reduce the exponent - /* to get here, V1 is less than V2, so divide V2 by 10 and go for - the next digit */ - var2len--; - } - }/*outer*/ - - /* here when we have finished dividing, for some reason */ - // have is the number of digits we collected in res.mant - if (have==0) - have=1; // res.mant[0] is 0; we always want a digit - - if ((code=='I')|(code=='R')) - {/* check for integer overflow needed */ - if ((have+res.exp)>reqdig) - throw new java.lang.ArithmeticException("Integer overflow"); - - if (code=='R') - {remainder:do{ - /* We were doing Remainder -- return the residue */ - if (res.mant[0]==0) // no integer part was found - return clone(lhs).finish(set,false); // .. so return lhs, canonical - if (var1[0]==0) - return ZERO; // simple 0 residue - res.ind=lhs.ind; // sign is always as LHS - /* Calculate the exponent by subtracting the number of padding zeros - we added and adding the original exponent */ - padding=((reqdig+reqdig)+1)-lhs.mant.length; - res.exp=(res.exp-padding)+lhs.exp; - - /* strip insignificant padding zeros from residue, and create/copy - the resulting mantissa if need be */ - d=var1len; - {i=d-1;i:for(;i>=1;i--){if(!((res.exp=0) - {scaled:do{ - // say 'scale have res.exp len' scale have res.exp res.mant.length - if (have!=res.mant.length) - // already padded with 0's, so just adjust exponent - res.exp=res.exp-((res.mant.length-have)); - // calculate number of digits we really want [may be 0] - actdig=res.mant.length-((((int)-res.exp)-scale)); - res.round(actdig,set.roundingMode); // round to desired length - // This could have shifted left if round (say) 0.9->1[.0] - // Repair if so by adding a zero and reducing exponent - if (res.exp!=((int)-scale)) - { - res.mant=extend(res.mant,res.mant.length+1); - res.exp=res.exp-1; - } - return res.finish(set,true); // [strip if not PLAIN] - }while(false);}/*scaled*/ - - // reach here only if a non-scaled - if (have==res.mant.length) - { // got digits+1 digits - res.round(set); - have=reqdig; - } - else - {/* have<=reqdig */ - if (res.mant[0]==0) - return ZERO; // fastpath - // make the mantissa truly just 'have' long - // [we could let finish do this, during strip, if we adjusted - // the exponent; however, truncation avoids the strip loop] - newmant=new byte[have]; // shorten - java.lang.System.arraycopy((java.lang.Object)res.mant,0,(java.lang.Object)newmant,0,have); - res.mant=newmant; - } - return res.finish(set,true); - } - - - /* Report a conversion exception. */ - - private void bad(char s[]){ - throw new java.lang.NumberFormatException("Not a number:"+" "+java.lang.String.valueOf(s)); - } - - /* Report a bad argument to a method. - Arg1 is method name - Arg2 is argument position - Arg3 is what was found */ - - private void badarg(java.lang.String name,int pos,java.lang.String value){ - throw new java.lang.IllegalArgumentException("Bad argument"+" "+pos+" "+"to"+" "+name+":"+" "+value); - } - - /* Extend byte array to given length, padding with 0s. If no - extension is required then return the same array. - - Arg1 is the source byte array - Arg2 is the new length (longer) - */ - - private static final byte[] extend(byte inarr[],int newlen){ - byte newarr[]; - if (inarr.length==newlen) - return inarr; - newarr=new byte[newlen]; - java.lang.System.arraycopy((java.lang.Object)inarr,0,(java.lang.Object)newarr,0,inarr.length); - // 0 padding is carried out by the JVM on allocation initialization - return newarr; - } - - /* Add or subtract two >=0 integers in byte arrays -

    This routine performs the calculation: -

    -    C=A+(B*M)
    -    
    - Where M is in the range -9 through +9 -

    - If M<0 then A>=B must be true, so the result is always - non-negative. - - Leading zeros are not removed after a subtraction. The result is - either the same length as the longer of A and B, or 1 longer than - that (if a carry occurred). - - A is not altered unless Arg6 is 1. - B is never altered. - - Arg1 is A - Arg2 is A length to use (if longer than A, pad with 0's) - Arg3 is B - Arg4 is B length to use (if longer than B, pad with 0's) - Arg5 is M, the multiplier - Arg6 is 1 if A can be used to build the result (if it fits) - - This routine is severely performance-critical; *any* change here - must be measured (timed) to assure no performance degradation. - */ - // 1996.02.20 -- enhanced version of DMSRCN algorithm (1981) - // 1997.10.05 -- changed to byte arrays (from char arrays) - // 1998.07.01 -- changed to allow destructive reuse of LHS - // 1998.07.01 -- changed to allow virtual lengths for the arrays - // 1998.12.29 -- use lookaside for digit/carry calculation - // 1999.08.07 -- avoid multiply when mult=1, and make db an int - // 1999.12.22 -- special case m=-1, also drop 0 special case - - private static final byte[] byteaddsub(byte a[],int avlen,byte b[],int bvlen,int m,boolean reuse){ - int alength; - int blength; - int ap; - int bp; - int maxarr; - byte reb[]; - boolean quickm; - int digit; - int op=0; - int dp90=0; - byte newarr[]; - int i=0; - - - - - // We'll usually be right if we assume no carry - alength=a.length; // physical lengths - blength=b.length; // .. - ap=avlen-1; // -> final (rightmost) digit - bp=bvlen-1; // .. - maxarr=bp; - if (maxarr=0;op--){ - if (ap>=0) - { - if (ap=0) - { - if (bp0) - digit=digit+b[bp]; // most common - else - digit=digit-b[bp]; // also common - } - else - digit=digit+(b[bp]*m); - } - bp--; - } - /* result so far (digit) could be -90 through 99 */ - if (digit<10) - if (digit>=0) - {quick:do{ // 0-9 - reb[op]=(byte)digit; - digit=0; // no carry - continue op; - }while(false);}/*quick*/ - dp90=digit+90; - reb[op]=bytedig[dp90]; // this digit - digit=bytecar[dp90]; // carry or borrow - } - }/*op*/ - - if (digit==0) - return reb; // no carry - // following line will become an Assert, later - // if digit<0 then signal ArithmeticException("internal.error ["digit"]") - - /* We have carry -- need to make space for the extra digit */ - newarr=(byte[])null; - if (reuse) - if ((maxarr+2)==a.length) - newarr=a; // OK to reuse A - if (newarr==null) - newarr=new byte[maxarr+2]; - newarr[0]=(byte)digit; // the carried digit .. - // .. and all the rest [use local loop for short numbers] - if (maxarr<10) - {int $24=maxarr+1;i=0;i:for(;$24>0;$24--,i++){ - newarr[i+1]=reb[i]; - } - }/*i*/ - else - java.lang.System.arraycopy((java.lang.Object)reb,0,(java.lang.Object)newarr,1,maxarr+1); - return newarr; - } - - /* Initializer for digit array properties (lookaside). - Returns the digit array, and initializes the carry array. */ - - private static final byte[] diginit(){ - byte work[]; - int op=0; - int digit=0; - work=new byte[(90+99)+1]; - {op=0;op:for(;op<=(90+99);op++){ - digit=op-90; - if (digit>=0) - { - work[op]=(byte)(digit%10); - bytecar[op]=(byte)(digit/10); // calculate carry - continue op; - } - // borrowing... - digit=digit+100; // yes, this is right [consider -50] - work[op]=(byte)(digit%10); - bytecar[op]=(byte)((digit/10)-10); // calculate borrow [NB: - after %] - } - }/*op*/ - return work; - } - - /* Create a copy of BigDecimal object for local use. -

    This does NOT make a copy of the mantissa array. - - Arg1 is the BigDecimal to clone (non-null) - */ - - private static final com.ibm.math.BigDecimal clone(com.ibm.math.BigDecimal dec){ - com.ibm.math.BigDecimal copy; - copy=new com.ibm.math.BigDecimal(); - copy.ind=dec.ind; - copy.exp=dec.exp; - copy.form=dec.form; - copy.mant=dec.mant; - return copy; - } - - /* Check one or two numbers for lost digits. - Arg1 is RHS (or null, if none) - Arg2 is current DIGITS setting - returns quietly or throws an exception */ - - private void checkdigits(com.ibm.math.BigDecimal rhs,int dig){ - if (dig==0) - return; // don't check if digits=0 - // first check lhs... - if (this.mant.length>dig) - if ((!(allzero(this.mant,dig)))) - throw new java.lang.ArithmeticException("Too many digits:"+" "+this.toString()); - if (rhs==null) - return; // monadic - if (rhs.mant.length>dig) - if ((!(allzero(rhs.mant,dig)))) - throw new java.lang.ArithmeticException("Too many digits:"+" "+rhs.toString()); - return; - } - - /* Round to specified digits, if necessary. - Arg1 is requested MathContext [with length and rounding mode] - returns this, for convenience */ - - private com.ibm.math.BigDecimal round(com.ibm.math.MathContext set){ - return round(set.digits,set.roundingMode); - } - - /* Round to specified digits, if necessary. - Arg1 is requested length (digits to round to) - [may be <=0 when called from format, dodivide, etc.] - Arg2 is rounding mode - returns this, for convenience - - ind and exp are adjusted, but not cleared for a mantissa of zero - - The length of the mantissa returned will be Arg1, except when Arg1 - is 0, in which case the returned mantissa length will be 1. - - */ - - private com.ibm.math.BigDecimal round(int len,int mode){ - int adjust; - int sign; - byte oldmant[]; - boolean reuse=false; - byte first=0; - int increment; - byte newmant[]=null; - adjust=mant.length-len; - if (adjust<=0) - return this; // nowt to do - - exp=exp+adjust; // exponent of result - sign=(int)ind; // save [assumes -1, 0, 1] - oldmant=mant; // save - if (len>0) - { - // remove the unwanted digits - mant=new byte[len]; - java.lang.System.arraycopy((java.lang.Object)oldmant,0,(java.lang.Object)mant,0,len); - reuse=true; // can reuse mantissa - first=oldmant[len]; // first of discarded digits - } - else - {/* len<=0 */ - mant=ZERO.mant; - ind=iszero; - reuse=false; // cannot reuse mantissa - if (len==0) - first=oldmant[0]; - else - first=(byte)0; // [virtual digit] - } - - // decide rounding adjustment depending on mode, sign, and discarded digits - increment=0; // bumper - {modes:do{/*select*/ - if (mode==ROUND_HALF_UP) - { // default first [most common] - if (first>=5) - increment=sign; - } - else if (mode==ROUND_UNNECESSARY) - { // default for setScale() - // discarding any non-zero digits is an error - if ((!(allzero(oldmant,len)))) - throw new java.lang.ArithmeticException("Rounding necessary"); - } - else if (mode==ROUND_HALF_DOWN) - { // 0.5000 goes down - if (first>5) - increment=sign; - else - if (first==5) - if ((!(allzero(oldmant,len+1)))) - increment=sign; - } - else if (mode==ROUND_HALF_EVEN) - { // 0.5000 goes down if left digit even - if (first>5) - increment=sign; - else - if (first==5) - { - if ((!(allzero(oldmant,len+1)))) - increment=sign; - else /* 0.5000 */ - if ((((mant[mant.length-1])%2))==1) - increment=sign; - } - } - else if (mode==ROUND_DOWN) - ; // never increment - else if (mode==ROUND_UP) - { // increment if discarded non-zero - if ((!(allzero(oldmant,len)))) - increment=sign; - } - else if (mode==ROUND_CEILING) - { // more positive - if (sign>0) - if ((!(allzero(oldmant,len)))) - increment=sign; - } - else if (mode==ROUND_FLOOR) - { // more negative - if (sign<0) - if ((!(allzero(oldmant,len)))) - increment=sign; - } - else{ - throw new java.lang.IllegalArgumentException("Bad round value:"+" "+mode); - } - }while(false);}/*modes*/ - - if (increment!=0) - {bump:do{ - if (ind==iszero) - { - // we must not subtract from 0, but result is trivial anyway - mant=ONE.mant; - ind=(byte)increment; - } - else - { - // mantissa is non-0; we can safely add or subtract 1 - if (ind==isneg) - increment=(int)-increment; - newmant=byteaddsub(mant,mant.length,ONE.mant,1,increment,reuse); - if (newmant.length>mant.length) - { // had a carry - // drop rightmost digit and raise exponent - exp++; - // mant is already the correct length - java.lang.System.arraycopy((java.lang.Object)newmant,0,(java.lang.Object)mant,0,mant.length); - } - else - mant=newmant; - } - }while(false);}/*bump*/ - // rounding can increase exponent significantly - if (exp>MaxExp) - throw new java.lang.ArithmeticException("Exponent Overflow:"+" "+exp); - return this; - } - - /* Test if rightmost digits are all 0. - Arg1 is a mantissa array to test - Arg2 is the offset of first digit to check - [may be negative; if so, digits to left are 0's] - returns 1 if all the digits starting at Arg2 are 0 - - Arg2 may be beyond array bounds, in which case 1 is returned - */ - - private static final boolean allzero(byte array[],int start){ - int i=0; - if (start<0) - start=0; - {int $25=array.length-1;i=start;i:for(;i<=$25;i++){ - if (array[i]!=0) - return false; - } - }/*i*/ - return true; - } - - /* Carry out final checks and canonicalization -

    - This finishes off the current number by: - 1. Rounding if necessary (NB: length includes leading zeros) - 2. Stripping trailing zeros (if requested and \PLAIN) - 3. Stripping leading zeros (always) - 4. Selecting exponential notation (if required) - 5. Converting a zero result to just '0' (if \PLAIN) - In practice, these operations overlap and share code. - It always sets form. - - Arg1 is requested MathContext (length to round to, trigger, and FORM) - Arg2 is 1 if trailing insignificant zeros should be removed after - round (for division, etc.), provided that set.form isn't PLAIN. - returns this, for convenience - */ - - private com.ibm.math.BigDecimal finish(com.ibm.math.MathContext set,boolean strip){ - int d=0; - int i=0; - byte newmant[]=null; - int mag=0; - int sig=0; - /* Round if mantissa too long and digits requested */ - if (set.digits!=0) - if (this.mant.length>set.digits) - this.round(set); - - /* If strip requested (and standard formatting), remove - insignificant trailing zeros. */ - if (strip) - if (set.form!=com.ibm.math.MathContext.PLAIN) - { - d=this.mant.length; - /* see if we need to drop any trailing zeros */ - {i=d-1;i:for(;i>=1;i--){ - if (this.mant[i]!=0) - break i; - d--; - exp++; - } - }/*i*/ - if (d0;$26--,i++){ - if (this.mant[i]!=0) - { - // non-0 result; ind will be correct - // remove leading zeros [e.g., after subtract] - if (i>0) - {delead:do{ - newmant=new byte[this.mant.length-i]; - java.lang.System.arraycopy((java.lang.Object)this.mant,i,(java.lang.Object)newmant,0,this.mant.length-i); - this.mant=newmant; - }while(false);}/*delead*/ - // now determine form if not PLAIN - mag=exp+mant.length; - if (mag>0) - { // most common path - if (mag>set.digits) - if (set.digits!=0) - form=(byte)set.form; - if ((mag-1)<=MaxExp) - return this; // no overflow; quick return - } - else - if (mag<(-5)) - form=(byte)set.form; - /* check for overflow */ - mag--; - if ((magMaxExp)) - {overflow:do{ - // possible reprieve if form is engineering - if (form==com.ibm.math.MathContext.ENGINEERING) - { - sig=mag%3; // leftover - if (sig<0) - sig=3+sig; // negative exponent - mag=mag-sig; // exponent to use - // 1999.06.29: second test here must be MaxExp - if (mag>=MinExp) - if (mag<=MaxExp) - break overflow; - } - throw new java.lang.ArithmeticException("Exponent Overflow:"+" "+mag); - }while(false);}/*overflow*/ - return this; - } - } - }/*i*/ - - // Drop through to here only if mantissa is all zeros - ind=iszero; - {/*select*/ - if (set.form!=com.ibm.math.MathContext.PLAIN) - exp=0; // standard result; go to '0' - else if (exp>0) - exp=0; // +ve exponent also goes to '0' - else{ - // a plain number with -ve exponent; preserve and check exponent - if (exp0 (floating point): ANSI X3.274-1996 + errata */ -/* */ -/* ------------------------------------------------------------------ */ -/* Change list */ -/* 1997.09.05 Initial implementation, from DiagRexx [NetRexx tests] */ -/* 1998.05.02 0.07 changes (e.g., compareTo) */ -/* 1998.06.06 Rounding modes and format additions */ -/* 1998.06.25 Rename from DiagDecimal; make stand-alone [add */ -/* DiagException as a Minor class] */ -/* 1998.06.27 Start adding testcases for DIGITS=0/FORM=PLAIN cases */ -/* Reorganize for faster trace compilation */ -/* 1998.06.28 new: valueof, scale, movePointX, unscaledValue, etc. */ -/* 1998.07.07 Scaled divide */ -/* 1998.07.08 setScale */ -/* 1998.07.15 new scaffolding (Minor Test class) -- see diagabs */ -/* 1998.12.14 add toBigDecimal and BigDecimal(java.math.BigDecimal) */ -/* 1999.02.04 number preparation rounds instead of digits+1 trunc */ -/* 1999.02.09 format method now only has two signatures */ -/* 1999.02.27 no longer use Rexx class or RexxIO class */ -/* 1999.03.05 add MathContext tests */ -/* 1999.03.05 update for 0.96 [no null settings, etc.] */ -/* drop sundry constructors; no blanks; char[] gets ints */ -/* drop sundry converters, add Exact converters */ -/* 1999.05.27 additional tests for scaled arithmetic */ -/* 1999.06.29 additional tests for exponent overflows */ -/* 1999.07.03 add 'continue' option */ -/* 1999.07.10 additional tests for scaled arithmetic */ -/* 1999.07.18 randomly-generated tests added for base operators */ -/* 1999.10.28 weird intValueExact bad cases */ -/* 1999.12.21 multiplication fast path failure and edge cases */ -/* 2000.01.01 copyright update */ -/* 2000.03.26 cosmetic updates; add extra format() testcases */ -/* 2000.03.27 1.00 move to com.ibm.math package; open source release; */ -/* change to javadoc comments */ -/* ------------------------------------------------------------------ */ - -// note BINARY for conversions checking - - - - -/** - * The DiagBigDecimal class forms a standalone test suite - * for the com.ibm.math.BigDecimal and - * com.ibm.math.MathContext classes (or, by changing the - * package statement, other classes of the same names and - * definition in other packages). It may also be used as a constructed - * object to embed the tests in an external test harness. - *

    - * The tests are collected into groups, each corresponding to a - * tested method or a more general grouping. By default, when run from - * the static {@link #main(java.lang.String[])} method, the run will end - * if any test fails in a group. The continue argument may - * be specified to force the tests to run to completion. - *

    - * Two minor (inner) classes are used; {@link - * DiagBigDecimal.DiagException} is used to signal the failure of a test - * group, and {@link DiagBigDecimal.Test}, a dependent minor class, is - * used to register tests so that a summary of failures (or success) can be - * presented as each group is completed. - * - * @see com.ibm.math.BigDecimal - * @see com.ibm.math.MathContext - * @version 1.00 2000.03.27 - * @author Mike Cowlishaw - */ - -public class DiagBigDecimal{ - private static final java.lang.String $0="DiagBigDecimal.nrx"; - - /* properties shared */ - java.util.Vector Tests=new java.util.Vector(100); // scaffolding - - /* properties private */ - private int totalcount=0; // counts tests run - - /* properties constant private */ - - /* Count of test groups */ - private static final int testcount=38; - - private static final com.ibm.math.BigDecimal zero=com.ibm.math.BigDecimal.ZERO; - private static final com.ibm.math.BigDecimal one=com.ibm.math.BigDecimal.ONE; - private static final com.ibm.math.BigDecimal two=new com.ibm.math.BigDecimal(2); - private static final com.ibm.math.BigDecimal ten=com.ibm.math.BigDecimal.TEN; - private static final com.ibm.math.BigDecimal tenlong=new com.ibm.math.BigDecimal((long)1234554321); // 10-digiter - - /* Some context objects -- [some of these are checked later] */ - private static final com.ibm.math.MathContext mcdef=com.ibm.math.MathContext.DEFAULT; - private static final com.ibm.math.MathContext mc3=new com.ibm.math.MathContext(3); - private static final com.ibm.math.MathContext mc6=new com.ibm.math.MathContext(6); - private static final com.ibm.math.MathContext mc9=new com.ibm.math.MathContext(9); - private static final com.ibm.math.MathContext mc50=new com.ibm.math.MathContext(50); - private static final com.ibm.math.MathContext mcs=new com.ibm.math.MathContext(9,com.ibm.math.MathContext.SCIENTIFIC); - private static final com.ibm.math.MathContext mce=new com.ibm.math.MathContext(9,com.ibm.math.MathContext.ENGINEERING); - private static final com.ibm.math.MathContext mcld=new com.ibm.math.MathContext(9,com.ibm.math.MathContext.SCIENTIFIC,true); // lost digits - private static final com.ibm.math.MathContext mcld0=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.SCIENTIFIC,true); // lost digits, digits=0 - private static final com.ibm.math.MathContext mcfd=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN); // fixed decimal style - - /* boundary primitive values */ - private static final byte bmin=-128; - private static final byte bmax=127; - private static final byte bzer=0; - private static final byte bneg=-1; - private static final byte bpos=1; - private static final int imin=-2147483648; - private static final int imax=2147483647; - private static final int izer=0; - private static final int ineg=-1; - private static final int ipos=1; - private static final long lmin=-9223372036854775808L; - private static final long lmax=9223372036854775807L; - private static final long lzer=(long)0; - private static final long lneg=(long)-1; - private static final long lpos=(long)1; - private static final short smin=-32768; - private static final short smax=32767; - private static final short szer=(short)0; - private static final short sneg=(short)(-1); - private static final short spos=(short)1; - - - /* properties constant private unused */ // present but not referenced - private static final java.lang.String copyright=" Copyright (c) IBM Corporation 1996, 2000. All rights reserved. "; - - - /** Constructs a DiagBigDecimal test suite. - *

    - * Invoke its {@link #diagrun} method to run the tests. - */ - - public DiagBigDecimal(){super(); - return; - } - - /** Run the tests in the test suite. - * - * @param isContinue The boolean which determines whether - * to stop running after a group fails. If 1 (true) - * then the tests should be run to completion if - * possible; if 0 (false) then the run will end if a - * group fails. - * @return an int which is 0 if all tests were - * successful, >0 (the count of failures) if some failures were - * detected, or <0 if an unexpected Exception was signalled. - */ - - public int diagrun(boolean isContinue){ - int fails; - int num=0; - com.ibm.math.DiagBigDecimal.DiagException de=null; - java.lang.RuntimeException e=null; - java.lang.String rest=null; - - fails=0; // count of failures - {try{num=1;num:for(;num<=testcount;num++){ // [testcount is constant set above] - {try{ - dotest(num); - } - catch (com.ibm.math.DiagBigDecimal.DiagException $1){de=$1; - say(); - say("**** Failed:"+" "+de.getMessage()+" "+"****"); - say(); - fails=fails+de.failcount; - if ((!isContinue)) - break num; - }} - } - } - catch (java.lang.RuntimeException $2){e=$2; // any other exception is total failure; just show trace and quit - say(); - say("**** Failed: unexpected exception ****"); - e.printStackTrace(); - return -1; - }}/*num*/ - - if (fails==0) - say("--- All OK ---"+" "+right("["+totalcount+" "+"tests]",15)); - else - { - if (isContinue) - { - if (fails>1) - rest="tests"; - else - rest="test"; - say("--- All run ---"+" "+right("["+totalcount+" "+"tests,",14)+" "+"failed"+" "+fails+" "+rest+"]"); - - } - } - - return fails; - } - - /* Run test by number -- method for development/private switching */ - - private void dotest(int num){ - {/*select*/switch(num){ - /* -------------------------------------------------------------- */ - /* MathContext */ - /* -------------------------------------------------------------- */ - case 1: - diagmathcontext();break; - - /* -------------------------------------------------------------- */ - /* Constructors */ - /* -------------------------------------------------------------- */ - case 2: - diagconstructors();break; - - /* -------------------------------------------------------------- */ - /* Operator methods */ - /* -------------------------------------------------------------- */ - case 3: - diagabs();break; - case 4: - diagadd();break; - case 5: - diagcompareto();break; - case 6: - diagdivide();break; - case 7: - diagdivideInteger();break; - case 8: - diagmax();break; - case 9: - diagmin();break; - case 10: - diagmultiply();break; - case 11: - diagnegate();break; - case 12: - diagplus();break; - case 13: - diagpow();break; - case 14: - diagremainder();break; - case 15: - diagsubtract();break; - case 16: - diagmath();break; // general math - - /* -------------------------------------------------------------- */ - /* Other methods */ - /* -------------------------------------------------------------- */ - case 17: - diagbyteValue();break; - case 18: - diagcomparetoObj();break; - case 19: - diagdoublevalue();break; - case 20: - diagequals();break; - case 21: - diagfloatvalue();break; - case 22: - diagformat();break; - case 23: - diaghashcode();break; - case 24: - diagintvalue();break; - case 25: - diaglongvalue();break; - case 26: - diagmovepointleft();break; - case 27: - diagmovepointright();break; - case 28: - diagscale();break; - case 29: - diagsetscale();break; - case 30: - diagshortvalue();break; - case 31: - diagsignum();break; - case 32: - diagtobigdecimal();break; - case 33: - diagtobiginteger();break; - case 34: - diagtochararray();break; - case 35: - diagtostring();break; - case 36: - diagunscaledvalue();break; - case 37: - diagvalueof();break; - - /* -------------------------------------------------------------- */ - /* Mutation test [must be the last test] */ - /* -------------------------------------------------------------- */ - case 38: - diagmutation();break; - // if any more, increase testcount above - default:{ - say("*** dotest case not found:"+" "+num+" "+"***"); - }} - } - return; - } - - /*--------------------------------------------------------------------*/ - /* Diagnostic group methods */ - /*--------------------------------------------------------------------*/ - - /** Test constructors (and {@link #toString()} for equalities). */ - - public void diagconstructors(){ - boolean flag=false; - java.lang.String num; - java.math.BigInteger bip; - java.math.BigInteger biz; - java.math.BigInteger bin; - com.ibm.math.BigDecimal bda; - com.ibm.math.BigDecimal bdb; - com.ibm.math.BigDecimal bmc; - com.ibm.math.BigDecimal bmd; - com.ibm.math.BigDecimal bme; - java.lang.RuntimeException e=null; - char ca[]; - double dzer; - double dpos; - double dneg; - double dpos5; - double dneg5; - double dmin; - double dmax; - double d; - java.lang.String badstrings[]; - int i=0; - - // constants [statically-called constructors] - (new com.ibm.math.DiagBigDecimal.Test("con001")).ok=(com.ibm.math.BigDecimal.ZERO.toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("con002")).ok=(com.ibm.math.BigDecimal.ONE.toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("con003")).ok=(com.ibm.math.BigDecimal.TEN.toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("con004")).ok=(com.ibm.math.BigDecimal.ZERO.intValueExact())==0; - (new com.ibm.math.DiagBigDecimal.Test("con005")).ok=(com.ibm.math.BigDecimal.ONE.intValueExact())==1; - (new com.ibm.math.DiagBigDecimal.Test("con006")).ok=(com.ibm.math.BigDecimal.TEN.intValueExact())==10; - - // [java.math.] BigDecimal - (new com.ibm.math.DiagBigDecimal.Test("cbd001")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("0"))).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("cbd002")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("1"))).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("cbd003")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("10"))).toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("cbd004")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("1000"))).toString()).equals("1000"); - (new com.ibm.math.DiagBigDecimal.Test("cbd005")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("10.0"))).toString()).equals("10.0"); - (new com.ibm.math.DiagBigDecimal.Test("cbd006")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("10.1"))).toString()).equals("10.1"); - (new com.ibm.math.DiagBigDecimal.Test("cbd007")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("-1.1"))).toString()).equals("-1.1"); - (new com.ibm.math.DiagBigDecimal.Test("cbd008")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("-9.0"))).toString()).equals("-9.0"); - (new com.ibm.math.DiagBigDecimal.Test("cbd009")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("0.9"))).toString()).equals("0.9"); - - num="123456789.123456789"; - (new com.ibm.math.DiagBigDecimal.Test("cbd010")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal(num))).toString()).equals(num); - num="123456789.000000000"; - (new com.ibm.math.DiagBigDecimal.Test("cbd011")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal(num))).toString()).equals(num); - num="123456789000000000"; - (new com.ibm.math.DiagBigDecimal.Test("cbd012")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal(num))).toString()).equals(num); - num="0.00000123456789"; - (new com.ibm.math.DiagBigDecimal.Test("cbd013")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal(num))).toString()).equals(num); - num="0.000000123456789"; - (new com.ibm.math.DiagBigDecimal.Test("cbd014")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal(num))).toString()).equals(num); - - {try{checknull:do{ - new com.ibm.math.BigDecimal((java.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $3){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("cbi015")).ok=flag; - - // BigInteger - bip=new BigInteger("987654321987654321987654321"); // biggie +ve - biz=new BigInteger("0"); // biggie 0 - bin=new BigInteger("-12345678998765432112345678"); // biggie -ve - (new com.ibm.math.DiagBigDecimal.Test("cbi001")).ok=((new com.ibm.math.BigDecimal(bip)).toString()).equals(bip.toString()); - (new com.ibm.math.DiagBigDecimal.Test("cbi002")).ok=((new com.ibm.math.BigDecimal(biz)).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("cbi003")).ok=((new com.ibm.math.BigDecimal(bin)).toString()).equals(bin.toString()); - {try{checknull:do{ - new com.ibm.math.BigDecimal((java.math.BigInteger)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $4){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("cbi004")).ok=flag; - - // BigInteger with scale - bip=new BigInteger("123456789"); // bigish - bda=new com.ibm.math.BigDecimal(bip); - bdb=new com.ibm.math.BigDecimal(bip,5); - bmc=new com.ibm.math.BigDecimal(bip,15); - (new com.ibm.math.DiagBigDecimal.Test("cbs001")).ok=(bda.toString()).equals("123456789"); - (new com.ibm.math.DiagBigDecimal.Test("cbs002")).ok=(bdb.toString()).equals("1234.56789"); - (new com.ibm.math.DiagBigDecimal.Test("cbs003")).ok=(bmc.toString()).equals("0.000000123456789"); - bip=new BigInteger("123456789123456789123456789"); // biggie - bda=new com.ibm.math.BigDecimal(bip); - bdb=new com.ibm.math.BigDecimal(bip,7); - bmc=new com.ibm.math.BigDecimal(bip,13); - bmd=new com.ibm.math.BigDecimal(bip,19); - bme=new com.ibm.math.BigDecimal(bip,29); - (new com.ibm.math.DiagBigDecimal.Test("cbs011")).ok=(bda.toString()).equals("123456789123456789123456789"); - (new com.ibm.math.DiagBigDecimal.Test("cbs012")).ok=(bdb.toString()).equals("12345678912345678912.3456789"); - (new com.ibm.math.DiagBigDecimal.Test("cbs013")).ok=(bmc.toString()).equals("12345678912345.6789123456789"); - (new com.ibm.math.DiagBigDecimal.Test("cbs014")).ok=(bmd.toString()).equals("12345678.9123456789123456789"); - (new com.ibm.math.DiagBigDecimal.Test("cbs015")).ok=(bme.toString()).equals("0.00123456789123456789123456789"); - {try{checknull:do{ - new com.ibm.math.BigDecimal((java.math.BigInteger)null,1); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $5){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("cbs004")).ok=flag; - {try{checkscale:do{ - new com.ibm.math.BigDecimal(bip,-8); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $6){e=$6; - flag=(e.getMessage()).equals("Negative scale: -8"); - }}/*checkscale*/ - (new com.ibm.math.DiagBigDecimal.Test("cbs005")).ok=flag; - - // char[] - // We just test it's there - // Functionality is tested by BigDecimal(String). - ca=("123.45").toCharArray(); - (new com.ibm.math.DiagBigDecimal.Test("cca001")).ok=((new com.ibm.math.BigDecimal(ca)).toString()).equals("123.45"); - {try{checknull:do{ - new com.ibm.math.BigDecimal((char[])null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $7){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("cca010")).ok=flag; - - // char[],int,int - // We just test it's there, and that offsets work. - // Functionality is tested by BigDecimal(String). - ca=("123.45").toCharArray(); - (new com.ibm.math.DiagBigDecimal.Test("cca101")).ok=((new com.ibm.math.BigDecimal(ca,0,6)).toString()).equals("123.45"); - (new com.ibm.math.DiagBigDecimal.Test("cca102")).ok=((new com.ibm.math.BigDecimal(ca,1,5)).toString()).equals("23.45"); - (new com.ibm.math.DiagBigDecimal.Test("cca103")).ok=((new com.ibm.math.BigDecimal(ca,2,4)).toString()).equals("3.45"); - (new com.ibm.math.DiagBigDecimal.Test("cca104")).ok=((new com.ibm.math.BigDecimal(ca,3,3)).toString()).equals("0.45"); - (new com.ibm.math.DiagBigDecimal.Test("cca105")).ok=((new com.ibm.math.BigDecimal(ca,4,2)).toString()).equals("45"); - (new com.ibm.math.DiagBigDecimal.Test("cca106")).ok=((new com.ibm.math.BigDecimal(ca,5,1)).toString()).equals("5"); - - (new com.ibm.math.DiagBigDecimal.Test("cca110")).ok=((new com.ibm.math.BigDecimal(ca,0,1)).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("cca111")).ok=((new com.ibm.math.BigDecimal(ca,1,1)).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("cca112")).ok=((new com.ibm.math.BigDecimal(ca,2,1)).toString()).equals("3"); - (new com.ibm.math.DiagBigDecimal.Test("cca113")).ok=((new com.ibm.math.BigDecimal(ca,4,1)).toString()).equals("4"); - - (new com.ibm.math.DiagBigDecimal.Test("cca120")).ok=((new com.ibm.math.BigDecimal(ca,0,2)).toString()).equals("12"); - (new com.ibm.math.DiagBigDecimal.Test("cca121")).ok=((new com.ibm.math.BigDecimal(ca,1,2)).toString()).equals("23"); - (new com.ibm.math.DiagBigDecimal.Test("cca122")).ok=((new com.ibm.math.BigDecimal(ca,2,2)).toString()).equals("3"); - (new com.ibm.math.DiagBigDecimal.Test("cca123")).ok=((new com.ibm.math.BigDecimal(ca,3,2)).toString()).equals("0.4"); - - (new com.ibm.math.DiagBigDecimal.Test("cca130")).ok=((new com.ibm.math.BigDecimal(ca,0,3)).toString()).equals("123"); - (new com.ibm.math.DiagBigDecimal.Test("cca131")).ok=((new com.ibm.math.BigDecimal(ca,1,3)).toString()).equals("23"); - (new com.ibm.math.DiagBigDecimal.Test("cca132")).ok=((new com.ibm.math.BigDecimal(ca,2,3)).toString()).equals("3.4"); - - (new com.ibm.math.DiagBigDecimal.Test("cca140")).ok=((new com.ibm.math.BigDecimal(ca,0,4)).toString()).equals("123"); - (new com.ibm.math.DiagBigDecimal.Test("cca141")).ok=((new com.ibm.math.BigDecimal(ca,1,4)).toString()).equals("23.4"); - - (new com.ibm.math.DiagBigDecimal.Test("cca150")).ok=((new com.ibm.math.BigDecimal(ca,0,5)).toString()).equals("123.4"); - - // a couple of oddies - ca=("x23.4x").toCharArray(); - (new com.ibm.math.DiagBigDecimal.Test("cca160")).ok=((new com.ibm.math.BigDecimal(ca,1,4)).toString()).equals("23.4"); - (new com.ibm.math.DiagBigDecimal.Test("cca161")).ok=((new com.ibm.math.BigDecimal(ca,1,1)).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("cca162")).ok=((new com.ibm.math.BigDecimal(ca,4,1)).toString()).equals("4"); - - ca=("0123456789.9876543210").toCharArray(); - (new com.ibm.math.DiagBigDecimal.Test("cca163")).ok=((new com.ibm.math.BigDecimal(ca,0,21)).toString()).equals("123456789.9876543210"); - (new com.ibm.math.DiagBigDecimal.Test("cca164")).ok=((new com.ibm.math.BigDecimal(ca,1,20)).toString()).equals("123456789.9876543210"); - (new com.ibm.math.DiagBigDecimal.Test("cca165")).ok=((new com.ibm.math.BigDecimal(ca,2,19)).toString()).equals("23456789.9876543210"); - (new com.ibm.math.DiagBigDecimal.Test("cca166")).ok=((new com.ibm.math.BigDecimal(ca,2,18)).toString()).equals("23456789.987654321"); - (new com.ibm.math.DiagBigDecimal.Test("cca167")).ok=((new com.ibm.math.BigDecimal(ca,2,17)).toString()).equals("23456789.98765432"); - (new com.ibm.math.DiagBigDecimal.Test("cca168")).ok=((new com.ibm.math.BigDecimal(ca,2,16)).toString()).equals("23456789.9876543"); - - {try{checknull:do{ - new com.ibm.math.BigDecimal((char[])null,0,1); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $8){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("cca200")).ok=flag; - - {try{checklen:do{ - new com.ibm.math.BigDecimal("123".toCharArray(),0,0); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $9){ - flag=true; - }}/*checklen*/ - (new com.ibm.math.DiagBigDecimal.Test("cca201")).ok=flag; - - {try{checkbound:do{ - new com.ibm.math.BigDecimal("123".toCharArray(),2,4); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $10){ // anything OK - flag=true; - }}/*checkbound*/ - (new com.ibm.math.DiagBigDecimal.Test("cca202")).ok=flag; - {try{checkbound2:do{ - new com.ibm.math.BigDecimal("123".toCharArray(),-1,2); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $11){ // anything OK - flag=true; - }}/*checkbound2*/ - (new com.ibm.math.DiagBigDecimal.Test("cca203")).ok=flag; - {try{checkbound3:do{ - new com.ibm.math.BigDecimal("123".toCharArray(),1,-2); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $12){ // anything OK - flag=true; - }}/*checkbound3*/ - (new com.ibm.math.DiagBigDecimal.Test("cca204")).ok=flag; - - // double [deprecated] - // Note that many of these differ from the valueOf(double) results. - dzer=(double)0; - dpos=(double)1; - dpos=dpos/((double)10); - dneg=(double)-dpos; - (new com.ibm.math.DiagBigDecimal.Test("cdo001")).ok=((new com.ibm.math.BigDecimal(dneg)).toString()).equals("-0.1000000000000000055511151231257827021181583404541015625"); - - (new com.ibm.math.DiagBigDecimal.Test("cdo002")).ok=((new com.ibm.math.BigDecimal(dzer)).toString()).equals("0"); // NB, not '0.0' - (new com.ibm.math.DiagBigDecimal.Test("cdo003")).ok=((new com.ibm.math.BigDecimal(dpos)).toString()).equals("0.1000000000000000055511151231257827021181583404541015625"); - - dpos5=(double)0.5D; - dneg5=(double)-dpos5; - (new com.ibm.math.DiagBigDecimal.Test("cdo004")).ok=((new com.ibm.math.BigDecimal(dneg5)).toString()).equals("-0.5"); - (new com.ibm.math.DiagBigDecimal.Test("cdo005")).ok=((new com.ibm.math.BigDecimal(dpos5)).toString()).equals("0.5"); - dmin=java.lang.Double.MIN_VALUE; - dmax=java.lang.Double.MAX_VALUE; - (new com.ibm.math.DiagBigDecimal.Test("cdo006")).ok=((new com.ibm.math.BigDecimal(dmin)).toString()).equals("0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004940656458412465441765687928682213723650598026143247644255856825006755072702087518652998363616359923797965646954457177309266567103559397963987747960107818781263007131903114045278458171678489821036887186360569987307230500063874091535649843873124733972731696151400317153853980741262385655911710266585566867681870395603106249319452715914924553293054565444011274801297099995419319894090804165633245247571478690147267801593552386115501348035264934720193790268107107491703332226844753335720832431936092382893458368060106011506169809753078342277318329247904982524730776375927247874656084778203734469699533647017972677717585125660551199131504891101451037862738167250955837389733598993664809941164205702637090279242767544565229087538682506419718265533447265625"); - - (new com.ibm.math.DiagBigDecimal.Test("cdo007")).ok=((new com.ibm.math.BigDecimal(dmax)).toString()).equals("179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368"); - - - // nasties - d=(double)9; - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("cdo010")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.90000000000000002220446049250313080847263336181640625"); - - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("cdo011")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.0899999999999999966693309261245303787291049957275390625"); - - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("cdo012")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.00899999999999999931998839741709161899052560329437255859375"); - - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("cdo013")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.00089999999999999997536692664112933925935067236423492431640625"); - - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("cdo014")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.00008999999999999999211568180168541175589780323207378387451171875"); - - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("cdo015")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.00000899999999999999853394182236510090433512232266366481781005859375"); - - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("cdo016")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.000000899999999999999853394182236510090433512232266366481781005859375"); - - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("cdo017")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.0000000899999999999999853394182236510090433512232266366481781005859375"); - - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("cdo018")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.000000008999999999999997872197332322678764437995369007694534957408905029296875"); - - - {try{checkpin:do{ - new com.ibm.math.BigDecimal(java.lang.Double.POSITIVE_INFINITY); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $13){ - flag=true; - }}/*checkpin*/ - (new com.ibm.math.DiagBigDecimal.Test("cdo101")).ok=flag; - {try{checknin:do{ - new com.ibm.math.BigDecimal(java.lang.Double.NEGATIVE_INFINITY); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $14){ - flag=true; - }}/*checknin*/ - (new com.ibm.math.DiagBigDecimal.Test("cdo102")).ok=flag; - {try{checknan:do{ - new com.ibm.math.BigDecimal(java.lang.Double.NaN); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $15){ - flag=true; - }}/*checknan*/ - (new com.ibm.math.DiagBigDecimal.Test("cdo103")).ok=flag; - - // int - (new com.ibm.math.DiagBigDecimal.Test("cin001")).ok=((new com.ibm.math.BigDecimal(imin)).toString()).equals("-2147483648"); - (new com.ibm.math.DiagBigDecimal.Test("cin002")).ok=((new com.ibm.math.BigDecimal(imax)).toString()).equals("2147483647"); - (new com.ibm.math.DiagBigDecimal.Test("cin003")).ok=((new com.ibm.math.BigDecimal(ineg)).toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("cin004")).ok=((new com.ibm.math.BigDecimal(izer)).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("cin005")).ok=((new com.ibm.math.BigDecimal(ipos)).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("cin006")).ok=((new com.ibm.math.BigDecimal(10)).toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("cin007")).ok=((new com.ibm.math.BigDecimal(9)).toString()).equals("9"); - (new com.ibm.math.DiagBigDecimal.Test("cin008")).ok=((new com.ibm.math.BigDecimal(5)).toString()).equals("5"); - (new com.ibm.math.DiagBigDecimal.Test("cin009")).ok=((new com.ibm.math.BigDecimal(2)).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("cin010")).ok=((new com.ibm.math.BigDecimal(-2)).toString()).equals("-2"); - (new com.ibm.math.DiagBigDecimal.Test("cin011")).ok=((new com.ibm.math.BigDecimal(-5)).toString()).equals("-5"); - (new com.ibm.math.DiagBigDecimal.Test("cin012")).ok=((new com.ibm.math.BigDecimal(-9)).toString()).equals("-9"); - (new com.ibm.math.DiagBigDecimal.Test("cin013")).ok=((new com.ibm.math.BigDecimal(-10)).toString()).equals("-10"); - (new com.ibm.math.DiagBigDecimal.Test("cin014")).ok=((new com.ibm.math.BigDecimal(-11)).toString()).equals("-11"); - (new com.ibm.math.DiagBigDecimal.Test("cin015")).ok=((new com.ibm.math.BigDecimal(-99)).toString()).equals("-99"); - (new com.ibm.math.DiagBigDecimal.Test("cin016")).ok=((new com.ibm.math.BigDecimal(-100)).toString()).equals("-100"); - (new com.ibm.math.DiagBigDecimal.Test("cin017")).ok=((new com.ibm.math.BigDecimal(-999)).toString()).equals("-999"); - (new com.ibm.math.DiagBigDecimal.Test("cin018")).ok=((new com.ibm.math.BigDecimal(-1000)).toString()).equals("-1000"); - - (new com.ibm.math.DiagBigDecimal.Test("cin019")).ok=((new com.ibm.math.BigDecimal(11)).toString()).equals("11"); - (new com.ibm.math.DiagBigDecimal.Test("cin020")).ok=((new com.ibm.math.BigDecimal(99)).toString()).equals("99"); - (new com.ibm.math.DiagBigDecimal.Test("cin021")).ok=((new com.ibm.math.BigDecimal(100)).toString()).equals("100"); - (new com.ibm.math.DiagBigDecimal.Test("cin022")).ok=((new com.ibm.math.BigDecimal(999)).toString()).equals("999"); - (new com.ibm.math.DiagBigDecimal.Test("cin023")).ok=((new com.ibm.math.BigDecimal(1000)).toString()).equals("1000"); - - // long - (new com.ibm.math.DiagBigDecimal.Test("clo001")).ok=((new com.ibm.math.BigDecimal(lmin)).toString()).equals("-9223372036854775808"); - (new com.ibm.math.DiagBigDecimal.Test("clo002")).ok=((new com.ibm.math.BigDecimal(lmax)).toString()).equals("9223372036854775807"); - (new com.ibm.math.DiagBigDecimal.Test("clo003")).ok=((new com.ibm.math.BigDecimal(lneg)).toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("clo004")).ok=((new com.ibm.math.BigDecimal(lzer)).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("clo005")).ok=((new com.ibm.math.BigDecimal(lpos)).toString()).equals("1"); - - // String [many more examples are elsewhere] - // strings without E cannot generate E in result - (new com.ibm.math.DiagBigDecimal.Test("cst001")).ok=((new com.ibm.math.BigDecimal("12")).toString()).equals("12"); - (new com.ibm.math.DiagBigDecimal.Test("cst002")).ok=((new com.ibm.math.BigDecimal("-76")).toString()).equals("-76"); - (new com.ibm.math.DiagBigDecimal.Test("cst003")).ok=((new com.ibm.math.BigDecimal("12.76")).toString()).equals("12.76"); - (new com.ibm.math.DiagBigDecimal.Test("cst004")).ok=((new com.ibm.math.BigDecimal("+12.76")).toString()).equals("12.76"); - (new com.ibm.math.DiagBigDecimal.Test("cst005")).ok=((new com.ibm.math.BigDecimal("012.76")).toString()).equals("12.76"); - (new com.ibm.math.DiagBigDecimal.Test("cst006")).ok=((new com.ibm.math.BigDecimal("+0.003")).toString()).equals("0.003"); - (new com.ibm.math.DiagBigDecimal.Test("cst007")).ok=((new com.ibm.math.BigDecimal("17.")).toString()).equals("17"); - (new com.ibm.math.DiagBigDecimal.Test("cst008")).ok=((new com.ibm.math.BigDecimal(".5")).toString()).equals("0.5"); - (new com.ibm.math.DiagBigDecimal.Test("cst009")).ok=((new com.ibm.math.BigDecimal("044")).toString()).equals("44"); - (new com.ibm.math.DiagBigDecimal.Test("cst010")).ok=((new com.ibm.math.BigDecimal("0044")).toString()).equals("44"); - (new com.ibm.math.DiagBigDecimal.Test("cst011")).ok=((new com.ibm.math.BigDecimal("0.0005")).toString()).equals("0.0005"); - (new com.ibm.math.DiagBigDecimal.Test("cst012")).ok=((new com.ibm.math.BigDecimal("00.00005")).toString()).equals("0.00005"); - (new com.ibm.math.DiagBigDecimal.Test("cst013")).ok=((new com.ibm.math.BigDecimal("0.000005")).toString()).equals("0.000005"); - (new com.ibm.math.DiagBigDecimal.Test("cst014")).ok=((new com.ibm.math.BigDecimal("0.0000005")).toString()).equals("0.0000005"); // \NR - (new com.ibm.math.DiagBigDecimal.Test("cst015")).ok=((new com.ibm.math.BigDecimal("0.00000005")).toString()).equals("0.00000005"); // \NR - (new com.ibm.math.DiagBigDecimal.Test("cst016")).ok=((new com.ibm.math.BigDecimal("12345678.876543210")).toString()).equals("12345678.876543210"); - (new com.ibm.math.DiagBigDecimal.Test("cst017")).ok=((new com.ibm.math.BigDecimal("2345678.876543210")).toString()).equals("2345678.876543210"); - (new com.ibm.math.DiagBigDecimal.Test("cst018")).ok=((new com.ibm.math.BigDecimal("345678.876543210")).toString()).equals("345678.876543210"); - (new com.ibm.math.DiagBigDecimal.Test("cst019")).ok=((new com.ibm.math.BigDecimal("0345678.87654321")).toString()).equals("345678.87654321"); - (new com.ibm.math.DiagBigDecimal.Test("cst020")).ok=((new com.ibm.math.BigDecimal("345678.8765432")).toString()).equals("345678.8765432"); - (new com.ibm.math.DiagBigDecimal.Test("cst021")).ok=((new com.ibm.math.BigDecimal("+345678.8765432")).toString()).equals("345678.8765432"); - (new com.ibm.math.DiagBigDecimal.Test("cst022")).ok=((new com.ibm.math.BigDecimal("+0345678.8765432")).toString()).equals("345678.8765432"); - (new com.ibm.math.DiagBigDecimal.Test("cst023")).ok=((new com.ibm.math.BigDecimal("+00345678.8765432")).toString()).equals("345678.8765432"); - (new com.ibm.math.DiagBigDecimal.Test("cst024")).ok=((new com.ibm.math.BigDecimal("-345678.8765432")).toString()).equals("-345678.8765432"); - (new com.ibm.math.DiagBigDecimal.Test("cst025")).ok=((new com.ibm.math.BigDecimal("-0345678.8765432")).toString()).equals("-345678.8765432"); - (new com.ibm.math.DiagBigDecimal.Test("cst026")).ok=((new com.ibm.math.BigDecimal("-00345678.8765432")).toString()).equals("-345678.8765432"); - - // exotics -- - (new com.ibm.math.DiagBigDecimal.Test("cst035")).ok=((new com.ibm.math.BigDecimal("\u0e57.\u0e50")).toString()).equals("7.0"); - (new com.ibm.math.DiagBigDecimal.Test("cst036")).ok=((new com.ibm.math.BigDecimal("\u0b66.\u0b67")).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("cst037")).ok=((new com.ibm.math.BigDecimal("\u0b66\u0b66")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("cst038")).ok=((new com.ibm.math.BigDecimal("\u0b6a\u0b66")).toString()).equals("40"); - - // strings with E - (new com.ibm.math.DiagBigDecimal.Test("cst040")).ok=((new com.ibm.math.BigDecimal("1E+9")).toString()).equals("1E+9"); - (new com.ibm.math.DiagBigDecimal.Test("cst041")).ok=((new com.ibm.math.BigDecimal("1e+09")).toString()).equals("1E+9"); - (new com.ibm.math.DiagBigDecimal.Test("cst042")).ok=((new com.ibm.math.BigDecimal("1E+90")).toString()).equals("1E+90"); - (new com.ibm.math.DiagBigDecimal.Test("cst043")).ok=((new com.ibm.math.BigDecimal("+1E+009")).toString()).equals("1E+9"); - (new com.ibm.math.DiagBigDecimal.Test("cst044")).ok=((new com.ibm.math.BigDecimal("0E+9")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("cst045")).ok=((new com.ibm.math.BigDecimal("1E+9")).toString()).equals("1E+9"); - (new com.ibm.math.DiagBigDecimal.Test("cst046")).ok=((new com.ibm.math.BigDecimal("1E+09")).toString()).equals("1E+9"); - (new com.ibm.math.DiagBigDecimal.Test("cst047")).ok=((new com.ibm.math.BigDecimal("1e+90")).toString()).equals("1E+90"); - (new com.ibm.math.DiagBigDecimal.Test("cst048")).ok=((new com.ibm.math.BigDecimal("1E+009")).toString()).equals("1E+9"); - (new com.ibm.math.DiagBigDecimal.Test("cst049")).ok=((new com.ibm.math.BigDecimal("0E+9")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("cst050")).ok=((new com.ibm.math.BigDecimal("1E9")).toString()).equals("1E+9"); - (new com.ibm.math.DiagBigDecimal.Test("cst051")).ok=((new com.ibm.math.BigDecimal("1e09")).toString()).equals("1E+9"); - (new com.ibm.math.DiagBigDecimal.Test("cst052")).ok=((new com.ibm.math.BigDecimal("1E90")).toString()).equals("1E+90"); - (new com.ibm.math.DiagBigDecimal.Test("cst053")).ok=((new com.ibm.math.BigDecimal("1E009")).toString()).equals("1E+9"); - (new com.ibm.math.DiagBigDecimal.Test("cst054")).ok=((new com.ibm.math.BigDecimal("0E9")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("cst055")).ok=((new com.ibm.math.BigDecimal("0.000e+0")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("cst056")).ok=((new com.ibm.math.BigDecimal("0.000E-1")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("cst057")).ok=((new com.ibm.math.BigDecimal("4E+9")).toString()).equals("4E+9"); - (new com.ibm.math.DiagBigDecimal.Test("cst058")).ok=((new com.ibm.math.BigDecimal("44E+9")).toString()).equals("4.4E+10"); - (new com.ibm.math.DiagBigDecimal.Test("cst059")).ok=((new com.ibm.math.BigDecimal("0.73e-7")).toString()).equals("7.3E-8"); - (new com.ibm.math.DiagBigDecimal.Test("cst060")).ok=((new com.ibm.math.BigDecimal("00E+9")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("cst061")).ok=((new com.ibm.math.BigDecimal("00E-9")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("cst062")).ok=((new com.ibm.math.BigDecimal("10E+9")).toString()).equals("1.0E+10"); - (new com.ibm.math.DiagBigDecimal.Test("cst063")).ok=((new com.ibm.math.BigDecimal("10E+09")).toString()).equals("1.0E+10"); - (new com.ibm.math.DiagBigDecimal.Test("cst064")).ok=((new com.ibm.math.BigDecimal("10e+90")).toString()).equals("1.0E+91"); - (new com.ibm.math.DiagBigDecimal.Test("cst065")).ok=((new com.ibm.math.BigDecimal("10E+009")).toString()).equals("1.0E+10"); - (new com.ibm.math.DiagBigDecimal.Test("cst066")).ok=((new com.ibm.math.BigDecimal("100e+9")).toString()).equals("1.00E+11"); - (new com.ibm.math.DiagBigDecimal.Test("cst067")).ok=((new com.ibm.math.BigDecimal("100e+09")).toString()).equals("1.00E+11"); - (new com.ibm.math.DiagBigDecimal.Test("cst068")).ok=((new com.ibm.math.BigDecimal("100E+90")).toString()).equals("1.00E+92"); - (new com.ibm.math.DiagBigDecimal.Test("cst069")).ok=((new com.ibm.math.BigDecimal("100e+009")).toString()).equals("1.00E+11"); - - (new com.ibm.math.DiagBigDecimal.Test("cst070")).ok=((new com.ibm.math.BigDecimal("1.265")).toString()).equals("1.265"); - (new com.ibm.math.DiagBigDecimal.Test("cst071")).ok=((new com.ibm.math.BigDecimal("1.265E-20")).toString()).equals("1.265E-20"); - (new com.ibm.math.DiagBigDecimal.Test("cst072")).ok=((new com.ibm.math.BigDecimal("1.265E-8")).toString()).equals("1.265E-8"); - (new com.ibm.math.DiagBigDecimal.Test("cst073")).ok=((new com.ibm.math.BigDecimal("1.265E-4")).toString()).equals("1.265E-4"); - (new com.ibm.math.DiagBigDecimal.Test("cst074")).ok=((new com.ibm.math.BigDecimal("1.265E-3")).toString()).equals("1.265E-3"); - (new com.ibm.math.DiagBigDecimal.Test("cst075")).ok=((new com.ibm.math.BigDecimal("1.265E-2")).toString()).equals("1.265E-2"); - (new com.ibm.math.DiagBigDecimal.Test("cst076")).ok=((new com.ibm.math.BigDecimal("1.265E-1")).toString()).equals("1.265E-1"); - (new com.ibm.math.DiagBigDecimal.Test("cst077")).ok=((new com.ibm.math.BigDecimal("1.265E-0")).toString()).equals("1.265"); - (new com.ibm.math.DiagBigDecimal.Test("cst078")).ok=((new com.ibm.math.BigDecimal("1.265E+1")).toString()).equals("1.265E+1"); - (new com.ibm.math.DiagBigDecimal.Test("cst079")).ok=((new com.ibm.math.BigDecimal("1.265E+2")).toString()).equals("1.265E+2"); - (new com.ibm.math.DiagBigDecimal.Test("cst080")).ok=((new com.ibm.math.BigDecimal("1.265E+3")).toString()).equals("1.265E+3"); - (new com.ibm.math.DiagBigDecimal.Test("cst081")).ok=((new com.ibm.math.BigDecimal("1.265E+4")).toString()).equals("1.265E+4"); - (new com.ibm.math.DiagBigDecimal.Test("cst082")).ok=((new com.ibm.math.BigDecimal("1.265E+8")).toString()).equals("1.265E+8"); - (new com.ibm.math.DiagBigDecimal.Test("cst083")).ok=((new com.ibm.math.BigDecimal("1.265E+20")).toString()).equals("1.265E+20"); - - (new com.ibm.math.DiagBigDecimal.Test("cst090")).ok=((new com.ibm.math.BigDecimal("12.65")).toString()).equals("12.65"); - (new com.ibm.math.DiagBigDecimal.Test("cst091")).ok=((new com.ibm.math.BigDecimal("12.65E-20")).toString()).equals("1.265E-19"); - (new com.ibm.math.DiagBigDecimal.Test("cst092")).ok=((new com.ibm.math.BigDecimal("12.65E-8")).toString()).equals("1.265E-7"); - (new com.ibm.math.DiagBigDecimal.Test("cst093")).ok=((new com.ibm.math.BigDecimal("12.65E-4")).toString()).equals("1.265E-3"); - (new com.ibm.math.DiagBigDecimal.Test("cst094")).ok=((new com.ibm.math.BigDecimal("12.65E-3")).toString()).equals("1.265E-2"); - (new com.ibm.math.DiagBigDecimal.Test("cst095")).ok=((new com.ibm.math.BigDecimal("12.65E-2")).toString()).equals("1.265E-1"); - (new com.ibm.math.DiagBigDecimal.Test("cst096")).ok=((new com.ibm.math.BigDecimal("12.65E-1")).toString()).equals("1.265"); - (new com.ibm.math.DiagBigDecimal.Test("cst097")).ok=((new com.ibm.math.BigDecimal("12.65E-0")).toString()).equals("1.265E+1"); - (new com.ibm.math.DiagBigDecimal.Test("cst098")).ok=((new com.ibm.math.BigDecimal("12.65E+1")).toString()).equals("1.265E+2"); - (new com.ibm.math.DiagBigDecimal.Test("cst099")).ok=((new com.ibm.math.BigDecimal("12.65E+2")).toString()).equals("1.265E+3"); - (new com.ibm.math.DiagBigDecimal.Test("cst100")).ok=((new com.ibm.math.BigDecimal("12.65E+3")).toString()).equals("1.265E+4"); - (new com.ibm.math.DiagBigDecimal.Test("cst101")).ok=((new com.ibm.math.BigDecimal("12.65E+4")).toString()).equals("1.265E+5"); - (new com.ibm.math.DiagBigDecimal.Test("cst102")).ok=((new com.ibm.math.BigDecimal("12.65E+8")).toString()).equals("1.265E+9"); - (new com.ibm.math.DiagBigDecimal.Test("cst103")).ok=((new com.ibm.math.BigDecimal("12.65E+20")).toString()).equals("1.265E+21"); - - (new com.ibm.math.DiagBigDecimal.Test("cst110")).ok=((new com.ibm.math.BigDecimal("126.5")).toString()).equals("126.5"); - (new com.ibm.math.DiagBigDecimal.Test("cst111")).ok=((new com.ibm.math.BigDecimal("126.5E-20")).toString()).equals("1.265E-18"); - (new com.ibm.math.DiagBigDecimal.Test("cst112")).ok=((new com.ibm.math.BigDecimal("126.5E-8")).toString()).equals("1.265E-6"); - (new com.ibm.math.DiagBigDecimal.Test("cst113")).ok=((new com.ibm.math.BigDecimal("126.5E-4")).toString()).equals("1.265E-2"); - (new com.ibm.math.DiagBigDecimal.Test("cst114")).ok=((new com.ibm.math.BigDecimal("126.5E-3")).toString()).equals("1.265E-1"); - (new com.ibm.math.DiagBigDecimal.Test("cst115")).ok=((new com.ibm.math.BigDecimal("126.5E-2")).toString()).equals("1.265"); - (new com.ibm.math.DiagBigDecimal.Test("cst116")).ok=((new com.ibm.math.BigDecimal("126.5E-1")).toString()).equals("1.265E+1"); - (new com.ibm.math.DiagBigDecimal.Test("cst117")).ok=((new com.ibm.math.BigDecimal("126.5E-0")).toString()).equals("1.265E+2"); - (new com.ibm.math.DiagBigDecimal.Test("cst118")).ok=((new com.ibm.math.BigDecimal("126.5E+1")).toString()).equals("1.265E+3"); - (new com.ibm.math.DiagBigDecimal.Test("cst119")).ok=((new com.ibm.math.BigDecimal("126.5E+2")).toString()).equals("1.265E+4"); - (new com.ibm.math.DiagBigDecimal.Test("cst120")).ok=((new com.ibm.math.BigDecimal("126.5E+3")).toString()).equals("1.265E+5"); - (new com.ibm.math.DiagBigDecimal.Test("cst121")).ok=((new com.ibm.math.BigDecimal("126.5E+4")).toString()).equals("1.265E+6"); - (new com.ibm.math.DiagBigDecimal.Test("cst122")).ok=((new com.ibm.math.BigDecimal("126.5E+8")).toString()).equals("1.265E+10"); - (new com.ibm.math.DiagBigDecimal.Test("cst123")).ok=((new com.ibm.math.BigDecimal("126.5E+20")).toString()).equals("1.265E+22"); - - (new com.ibm.math.DiagBigDecimal.Test("cst130")).ok=((new com.ibm.math.BigDecimal("1265")).toString()).equals("1265"); - (new com.ibm.math.DiagBigDecimal.Test("cst131")).ok=((new com.ibm.math.BigDecimal("1265E-20")).toString()).equals("1.265E-17"); - (new com.ibm.math.DiagBigDecimal.Test("cst132")).ok=((new com.ibm.math.BigDecimal("1265E-8")).toString()).equals("1.265E-5"); - (new com.ibm.math.DiagBigDecimal.Test("cst133")).ok=((new com.ibm.math.BigDecimal("1265E-4")).toString()).equals("1.265E-1"); - (new com.ibm.math.DiagBigDecimal.Test("cst134")).ok=((new com.ibm.math.BigDecimal("1265E-3")).toString()).equals("1.265"); - (new com.ibm.math.DiagBigDecimal.Test("cst135")).ok=((new com.ibm.math.BigDecimal("1265E-2")).toString()).equals("1.265E+1"); - (new com.ibm.math.DiagBigDecimal.Test("cst136")).ok=((new com.ibm.math.BigDecimal("1265E-1")).toString()).equals("1.265E+2"); - (new com.ibm.math.DiagBigDecimal.Test("cst137")).ok=((new com.ibm.math.BigDecimal("1265E-0")).toString()).equals("1.265E+3"); - (new com.ibm.math.DiagBigDecimal.Test("cst138")).ok=((new com.ibm.math.BigDecimal("1265E+1")).toString()).equals("1.265E+4"); - (new com.ibm.math.DiagBigDecimal.Test("cst139")).ok=((new com.ibm.math.BigDecimal("1265E+2")).toString()).equals("1.265E+5"); - (new com.ibm.math.DiagBigDecimal.Test("cst140")).ok=((new com.ibm.math.BigDecimal("1265E+3")).toString()).equals("1.265E+6"); - (new com.ibm.math.DiagBigDecimal.Test("cst141")).ok=((new com.ibm.math.BigDecimal("1265E+4")).toString()).equals("1.265E+7"); - (new com.ibm.math.DiagBigDecimal.Test("cst142")).ok=((new com.ibm.math.BigDecimal("1265E+8")).toString()).equals("1.265E+11"); - (new com.ibm.math.DiagBigDecimal.Test("cst143")).ok=((new com.ibm.math.BigDecimal("1265E+20")).toString()).equals("1.265E+23"); - - (new com.ibm.math.DiagBigDecimal.Test("cst150")).ok=((new com.ibm.math.BigDecimal("0.1265")).toString()).equals("0.1265"); - (new com.ibm.math.DiagBigDecimal.Test("cst151")).ok=((new com.ibm.math.BigDecimal("0.1265E-20")).toString()).equals("1.265E-21"); - (new com.ibm.math.DiagBigDecimal.Test("cst152")).ok=((new com.ibm.math.BigDecimal("0.1265E-8")).toString()).equals("1.265E-9"); - (new com.ibm.math.DiagBigDecimal.Test("cst153")).ok=((new com.ibm.math.BigDecimal("0.1265E-4")).toString()).equals("1.265E-5"); - (new com.ibm.math.DiagBigDecimal.Test("cst154")).ok=((new com.ibm.math.BigDecimal("0.1265E-3")).toString()).equals("1.265E-4"); - (new com.ibm.math.DiagBigDecimal.Test("cst155")).ok=((new com.ibm.math.BigDecimal("0.1265E-2")).toString()).equals("1.265E-3"); - (new com.ibm.math.DiagBigDecimal.Test("cst156")).ok=((new com.ibm.math.BigDecimal("0.1265E-1")).toString()).equals("1.265E-2"); - (new com.ibm.math.DiagBigDecimal.Test("cst157")).ok=((new com.ibm.math.BigDecimal("0.1265E-0")).toString()).equals("1.265E-1"); - (new com.ibm.math.DiagBigDecimal.Test("cst158")).ok=((new com.ibm.math.BigDecimal("0.1265E+1")).toString()).equals("1.265"); - (new com.ibm.math.DiagBigDecimal.Test("cst159")).ok=((new com.ibm.math.BigDecimal("0.1265E+2")).toString()).equals("1.265E+1"); - (new com.ibm.math.DiagBigDecimal.Test("cst160")).ok=((new com.ibm.math.BigDecimal("0.1265E+3")).toString()).equals("1.265E+2"); - (new com.ibm.math.DiagBigDecimal.Test("cst161")).ok=((new com.ibm.math.BigDecimal("0.1265E+4")).toString()).equals("1.265E+3"); - (new com.ibm.math.DiagBigDecimal.Test("cst162")).ok=((new com.ibm.math.BigDecimal("0.1265E+8")).toString()).equals("1.265E+7"); - (new com.ibm.math.DiagBigDecimal.Test("cst163")).ok=((new com.ibm.math.BigDecimal("0.1265E+20")).toString()).equals("1.265E+19"); - - (new com.ibm.math.DiagBigDecimal.Test("cst170")).ok=((new com.ibm.math.BigDecimal("0.09e999999999")).toString()).equals("9E+999999997"); - (new com.ibm.math.DiagBigDecimal.Test("cst171")).ok=((new com.ibm.math.BigDecimal("0.9e999999999")).toString()).equals("9E+999999998"); - (new com.ibm.math.DiagBigDecimal.Test("cst172")).ok=((new com.ibm.math.BigDecimal("9e999999999")).toString()).equals("9E+999999999"); - (new com.ibm.math.DiagBigDecimal.Test("cst173")).ok=((new com.ibm.math.BigDecimal("9.9e999999999")).toString()).equals("9.9E+999999999"); - (new com.ibm.math.DiagBigDecimal.Test("cst174")).ok=((new com.ibm.math.BigDecimal("9.99e999999999")).toString()).equals("9.99E+999999999"); - (new com.ibm.math.DiagBigDecimal.Test("cst175")).ok=((new com.ibm.math.BigDecimal("9.99e-999999999")).toString()).equals("9.99E-999999999"); - (new com.ibm.math.DiagBigDecimal.Test("cst176")).ok=((new com.ibm.math.BigDecimal("9.9e-999999999")).toString()).equals("9.9E-999999999"); - (new com.ibm.math.DiagBigDecimal.Test("cst177")).ok=((new com.ibm.math.BigDecimal("9e-999999999")).toString()).equals("9E-999999999"); - (new com.ibm.math.DiagBigDecimal.Test("cst179")).ok=((new com.ibm.math.BigDecimal("99e-999999999")).toString()).equals("9.9E-999999998"); - (new com.ibm.math.DiagBigDecimal.Test("cst180")).ok=((new com.ibm.math.BigDecimal("999e-999999999")).toString()).equals("9.99E-999999997"); - - // baddies -- - badstrings=new java.lang.String[]{"1..2",".","..","++1","--1","-+1","+-1","12e","12e++","12f4"," +1","+ 1","12 "," + 1"," - 1 ","x","-1-","12-","3+","","1e-","7e1000000000","","e100","\u0e5a","\u0b65","99e999999999","999e999999999","0.9e-999999999","0.09e-999999999","0.1e1000000000","10e-1000000000","0.9e9999999999","99e-9999999999","111e9999999999","1111e-9999999999"+" "+"111e*123","111e123-","111e+12+","111e1-3-","111e1*23","111e1e+3","1e1.0","1e123e","ten","ONE","1e.1","1e1.","1ee","e+1"}; // 200-203 - // 204-207 - // 208-211 - // 211-214 - // 215-219 - // 220-222 - // 223-224 - // 225-226 - // 227-228 - // 229-230 - // 231-232 - // 233-234 - // 235-237 - // 238-240 - // 241-244 - // 245-248 - - // watch out for commas on continuation lines - - {int $16=badstrings.length;i=0;i:for(;$16>0;$16--,i++){ - {try{ - new com.ibm.math.BigDecimal(badstrings[i]); - say(">>> cst"+(200+i)+":"+" "+badstrings[i]+" "+(new com.ibm.math.BigDecimal(badstrings[i])).toString()); - flag=false; - } - catch (java.lang.NumberFormatException $17){ - flag=true; - }} - (new com.ibm.math.DiagBigDecimal.Test("cst"+(200+i))).ok=flag; - } - }/*i*/ - - {try{checknull:do{ - new com.ibm.math.BigDecimal((java.lang.String)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $18){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("cst301")).ok=flag; - - summary("Constructors"); - return; - } - - /** Mutation tests (checks that contents of constant objects are unchanged). */ - - public void diagmutation(){ - /* ---------------------------------------------------------------- */ - /* Final tests -- check constants haven't mutated */ - /* -- also that MC objects haven't mutated */ - /* ---------------------------------------------------------------- */ - (new com.ibm.math.DiagBigDecimal.Test("cuc001")).ok=(com.ibm.math.BigDecimal.ZERO.toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("cuc002")).ok=(com.ibm.math.BigDecimal.ONE.toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("cuc003")).ok=(com.ibm.math.BigDecimal.TEN.toString()).equals("10"); - - (new com.ibm.math.DiagBigDecimal.Test("cuc010")).ok=com.ibm.math.BigDecimal.ROUND_CEILING==com.ibm.math.MathContext.ROUND_CEILING; - (new com.ibm.math.DiagBigDecimal.Test("cuc011")).ok=com.ibm.math.BigDecimal.ROUND_DOWN==com.ibm.math.MathContext.ROUND_DOWN; - (new com.ibm.math.DiagBigDecimal.Test("cuc012")).ok=com.ibm.math.BigDecimal.ROUND_FLOOR==com.ibm.math.MathContext.ROUND_FLOOR; - (new com.ibm.math.DiagBigDecimal.Test("cuc013")).ok=com.ibm.math.BigDecimal.ROUND_HALF_DOWN==com.ibm.math.MathContext.ROUND_HALF_DOWN; - (new com.ibm.math.DiagBigDecimal.Test("cuc014")).ok=com.ibm.math.BigDecimal.ROUND_HALF_EVEN==com.ibm.math.MathContext.ROUND_HALF_EVEN; - (new com.ibm.math.DiagBigDecimal.Test("cuc015")).ok=com.ibm.math.BigDecimal.ROUND_HALF_UP==com.ibm.math.MathContext.ROUND_HALF_UP; - (new com.ibm.math.DiagBigDecimal.Test("cuc016")).ok=com.ibm.math.BigDecimal.ROUND_UNNECESSARY==com.ibm.math.MathContext.ROUND_UNNECESSARY; - (new com.ibm.math.DiagBigDecimal.Test("cuc017")).ok=com.ibm.math.BigDecimal.ROUND_UP==com.ibm.math.MathContext.ROUND_UP; - - (new com.ibm.math.DiagBigDecimal.Test("cuc020")).ok=(com.ibm.math.MathContext.DEFAULT.getDigits())==9; - (new com.ibm.math.DiagBigDecimal.Test("cuc021")).ok=(com.ibm.math.MathContext.DEFAULT.getForm())==com.ibm.math.MathContext.SCIENTIFIC; - (new com.ibm.math.DiagBigDecimal.Test("cuc022")).ok=(com.ibm.math.MathContext.DEFAULT.getLostDigits()?1:0)==0; - (new com.ibm.math.DiagBigDecimal.Test("cuc023")).ok=(com.ibm.math.MathContext.DEFAULT.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - - // mc9 =MathContext(9) - // mcld =MathContext(9, SCIENTIFIC, 1) - // mcfd =MathContext(0, PLAIN) - (new com.ibm.math.DiagBigDecimal.Test("cuc030")).ok=(mc9.getDigits())==9; - (new com.ibm.math.DiagBigDecimal.Test("cuc031")).ok=(mc9.getForm())==com.ibm.math.MathContext.SCIENTIFIC; - (new com.ibm.math.DiagBigDecimal.Test("cuc032")).ok=(mc9.getLostDigits()?1:0)==0; - (new com.ibm.math.DiagBigDecimal.Test("cuc033")).ok=(mc9.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - (new com.ibm.math.DiagBigDecimal.Test("cuc034")).ok=(mcld.getDigits())==9; - (new com.ibm.math.DiagBigDecimal.Test("cuc035")).ok=(mcld.getForm())==com.ibm.math.MathContext.SCIENTIFIC; - (new com.ibm.math.DiagBigDecimal.Test("cuc036")).ok=(mcld.getLostDigits()?1:0)==1; - (new com.ibm.math.DiagBigDecimal.Test("cuc037")).ok=(mcld.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - (new com.ibm.math.DiagBigDecimal.Test("cuc038")).ok=(mcfd.getDigits())==0; - (new com.ibm.math.DiagBigDecimal.Test("cuc039")).ok=(mcfd.getForm())==com.ibm.math.MathContext.PLAIN; - (new com.ibm.math.DiagBigDecimal.Test("cuc040")).ok=(mcfd.getLostDigits()?1:0)==0; - (new com.ibm.math.DiagBigDecimal.Test("cuc041")).ok=(mcfd.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - - summary("No mutation"); - return;} - - - /* ----------------------------------------------------------------- */ - /* Operator test methods */ - /* ----------------------------------------------------------------- */ - // The use of context in these tests are primarily to show that they - // are correctly passed to the methods, except that we check that - // each method checks for lostDigits. - - /** Test the {@link BigDecimal#abs} method. */ - - public void diagabs(){ - boolean flag=false; - java.lang.ArithmeticException ae=null; - - // most of the function of this is tested by add - (new com.ibm.math.DiagBigDecimal.Test("abs001")).ok=((new com.ibm.math.BigDecimal("2")).abs().toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("abs002")).ok=((new com.ibm.math.BigDecimal("-2")).abs().toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("abs003")).ok=((new com.ibm.math.BigDecimal("+0.000")).abs().toString()).equals("0.000"); - (new com.ibm.math.DiagBigDecimal.Test("abs004")).ok=((new com.ibm.math.BigDecimal("00.000")).abs().toString()).equals("0.000"); - (new com.ibm.math.DiagBigDecimal.Test("abs005")).ok=((new com.ibm.math.BigDecimal("-0.000")).abs().toString()).equals("0.000"); - (new com.ibm.math.DiagBigDecimal.Test("abs006")).ok=((new com.ibm.math.BigDecimal("+0.000")).abs(mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("abs007")).ok=((new com.ibm.math.BigDecimal("00.000")).abs(mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("abs008")).ok=((new com.ibm.math.BigDecimal("-0.000")).abs(mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("abs009")).ok=((new com.ibm.math.BigDecimal("-2000000")).abs().toString()).equals("2000000"); - (new com.ibm.math.DiagBigDecimal.Test("abs010")).ok=((new com.ibm.math.BigDecimal("-2000000")).abs(mcdef).toString()).equals("2000000"); - (new com.ibm.math.DiagBigDecimal.Test("abs011")).ok=((new com.ibm.math.BigDecimal("-2000000")).abs(mc6).toString()).equals("2.00000E+6"); - (new com.ibm.math.DiagBigDecimal.Test("abs012")).ok=((new com.ibm.math.BigDecimal("2000000")).abs(mc6).toString()).equals("2.00000E+6"); - (new com.ibm.math.DiagBigDecimal.Test("abs013")).ok=((new com.ibm.math.BigDecimal("0.2")).abs().toString()).equals("0.2"); - (new com.ibm.math.DiagBigDecimal.Test("abs014")).ok=((new com.ibm.math.BigDecimal("-0.2")).abs().toString()).equals("0.2"); - (new com.ibm.math.DiagBigDecimal.Test("abs015")).ok=((new com.ibm.math.BigDecimal("0.01")).abs().toString()).equals("0.01"); - (new com.ibm.math.DiagBigDecimal.Test("abs016")).ok=((new com.ibm.math.BigDecimal("-0.01")).abs().toString()).equals("0.01"); - {try{checkdigits:do{ - tenlong.abs(mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $19){ae=$19; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("abs020")).ok=flag; - // check lostdigits not raised if digits=0 [monadic method] - {try{checkdigits:do{ - tenlong.abs(mcld0); - flag=true; - }while(false);} - catch (java.lang.ArithmeticException $20){ae=$20; - flag=false; - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("abs021")).ok=flag; - {try{checknull:do{ - com.ibm.math.BigDecimal.TEN.abs((com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $21){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("abs022")).ok=flag; - - summary("abs"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#add} method. */ - - public void diagadd(){ - boolean flag=false; - com.ibm.math.BigDecimal alhs; - com.ibm.math.BigDecimal arhs; - java.lang.ArithmeticException ae=null; - - // [first group are 'quick confidence check'] - (new com.ibm.math.DiagBigDecimal.Test("add001")).ok=((new com.ibm.math.BigDecimal(2)).add(new com.ibm.math.BigDecimal(3),mcdef).toString()).equals("5"); - (new com.ibm.math.DiagBigDecimal.Test("add003")).ok=((new com.ibm.math.BigDecimal("5.75")).add(new com.ibm.math.BigDecimal("3.3"),mcdef).toString()).equals("9.05"); - (new com.ibm.math.DiagBigDecimal.Test("add004")).ok=((new com.ibm.math.BigDecimal("5")).add(new com.ibm.math.BigDecimal("-3"),mcdef).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("add005")).ok=((new com.ibm.math.BigDecimal("-5")).add(new com.ibm.math.BigDecimal("-3"),mcdef).toString()).equals("-8"); - (new com.ibm.math.DiagBigDecimal.Test("add006")).ok=((new com.ibm.math.BigDecimal("-7")).add(new com.ibm.math.BigDecimal("2.5"),mcdef).toString()).equals("-4.5"); - (new com.ibm.math.DiagBigDecimal.Test("add007")).ok=((new com.ibm.math.BigDecimal("0.7")).add(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("1.0"); - (new com.ibm.math.DiagBigDecimal.Test("add008")).ok=((new com.ibm.math.BigDecimal("1.25")).add(new com.ibm.math.BigDecimal("1.25"),mcdef).toString()).equals("2.50"); - (new com.ibm.math.DiagBigDecimal.Test("add009")).ok=((new com.ibm.math.BigDecimal("1.23456789")).add(new com.ibm.math.BigDecimal("1.00000000"),mcdef).toString()).equals("2.23456789"); - - (new com.ibm.math.DiagBigDecimal.Test("add010")).ok=((new com.ibm.math.BigDecimal("1.23456789")).add(new com.ibm.math.BigDecimal("1.00000011"),mcdef).toString()).equals("2.23456800"); - - - (new com.ibm.math.DiagBigDecimal.Test("add011")).ok=((new com.ibm.math.BigDecimal("0.4444444444")).add(new com.ibm.math.BigDecimal("0.5555555555"),mcdef).toString()).equals("1.00000000"); - - (new com.ibm.math.DiagBigDecimal.Test("add012")).ok=((new com.ibm.math.BigDecimal("0.4444444440")).add(new com.ibm.math.BigDecimal("0.5555555555"),mcdef).toString()).equals("1.00000000"); - - (new com.ibm.math.DiagBigDecimal.Test("add013")).ok=((new com.ibm.math.BigDecimal("0.4444444444")).add(new com.ibm.math.BigDecimal("0.5555555550"),mcdef).toString()).equals("0.999999999"); - - (new com.ibm.math.DiagBigDecimal.Test("add014")).ok=((new com.ibm.math.BigDecimal("0.4444444444999")).add(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("0.444444444"); - - (new com.ibm.math.DiagBigDecimal.Test("add015")).ok=((new com.ibm.math.BigDecimal("0.4444444445000")).add(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("0.444444445"); - - - (new com.ibm.math.DiagBigDecimal.Test("add016")).ok=((new com.ibm.math.BigDecimal("70")).add(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("1.00000000E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("add017")).ok=((new com.ibm.math.BigDecimal("700")).add(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("1.00000000E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("add018")).ok=((new com.ibm.math.BigDecimal("7000")).add(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("1.00000000E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("add019")).ok=((new com.ibm.math.BigDecimal("70000")).add(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("1.00000001E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("add020")).ok=((new com.ibm.math.BigDecimal("700000")).add(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("1.00000007E+13"); - - - // [Now the same group with fixed arithmetic] - (new com.ibm.math.DiagBigDecimal.Test("add030")).ok=((new com.ibm.math.BigDecimal(2)).add(new com.ibm.math.BigDecimal(3)).toString()).equals("5"); - (new com.ibm.math.DiagBigDecimal.Test("add031")).ok=((new com.ibm.math.BigDecimal("5.75")).add(new com.ibm.math.BigDecimal("3.3")).toString()).equals("9.05"); - (new com.ibm.math.DiagBigDecimal.Test("add032")).ok=((new com.ibm.math.BigDecimal("5")).add(new com.ibm.math.BigDecimal("-3")).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("add033")).ok=((new com.ibm.math.BigDecimal("-5")).add(new com.ibm.math.BigDecimal("-3")).toString()).equals("-8"); - (new com.ibm.math.DiagBigDecimal.Test("add034")).ok=((new com.ibm.math.BigDecimal("-7")).add(new com.ibm.math.BigDecimal("2.5")).toString()).equals("-4.5"); - (new com.ibm.math.DiagBigDecimal.Test("add035")).ok=((new com.ibm.math.BigDecimal("0.7")).add(new com.ibm.math.BigDecimal("0.3")).toString()).equals("1.0"); - (new com.ibm.math.DiagBigDecimal.Test("add036")).ok=((new com.ibm.math.BigDecimal("1.25")).add(new com.ibm.math.BigDecimal("1.25")).toString()).equals("2.50"); - (new com.ibm.math.DiagBigDecimal.Test("add037")).ok=((new com.ibm.math.BigDecimal("1.23456789")).add(new com.ibm.math.BigDecimal("1.00000000")).toString()).equals("2.23456789"); - - (new com.ibm.math.DiagBigDecimal.Test("add038")).ok=((new com.ibm.math.BigDecimal("1.23456789")).add(new com.ibm.math.BigDecimal("1.00000011")).toString()).equals("2.23456800"); - - - (new com.ibm.math.DiagBigDecimal.Test("add039")).ok=((new com.ibm.math.BigDecimal("0.4444444444")).add(new com.ibm.math.BigDecimal("0.5555555555")).toString()).equals("0.9999999999"); - - (new com.ibm.math.DiagBigDecimal.Test("add040")).ok=((new com.ibm.math.BigDecimal("0.4444444440")).add(new com.ibm.math.BigDecimal("0.5555555555")).toString()).equals("0.9999999995"); - - (new com.ibm.math.DiagBigDecimal.Test("add041")).ok=((new com.ibm.math.BigDecimal("0.4444444444")).add(new com.ibm.math.BigDecimal("0.5555555550")).toString()).equals("0.9999999994"); - - (new com.ibm.math.DiagBigDecimal.Test("add042")).ok=((new com.ibm.math.BigDecimal("0.4444444444999")).add(new com.ibm.math.BigDecimal("0")).toString()).equals("0.4444444444999"); - - (new com.ibm.math.DiagBigDecimal.Test("add043")).ok=((new com.ibm.math.BigDecimal("0.4444444445000")).add(new com.ibm.math.BigDecimal("0")).toString()).equals("0.4444444445000"); - - - (new com.ibm.math.DiagBigDecimal.Test("add044")).ok=((new com.ibm.math.BigDecimal("70")).add(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("10000000000070"); - - (new com.ibm.math.DiagBigDecimal.Test("add045")).ok=((new com.ibm.math.BigDecimal("700")).add(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("10000000000700"); - - (new com.ibm.math.DiagBigDecimal.Test("add046")).ok=((new com.ibm.math.BigDecimal("7000")).add(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("10000000007000"); - - (new com.ibm.math.DiagBigDecimal.Test("add047")).ok=((new com.ibm.math.BigDecimal("70000")).add(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("10000000070000"); - - (new com.ibm.math.DiagBigDecimal.Test("add048")).ok=((new com.ibm.math.BigDecimal("700000")).add(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("10000000700000"); - - - // symmetry: - (new com.ibm.math.DiagBigDecimal.Test("add049")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70"),mcdef).toString()).equals("1.00000000E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("add050")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("700"),mcdef).toString()).equals("1.00000000E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("add051")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("7000"),mcdef).toString()).equals("1.00000000E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("add052")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70000"),mcdef).toString()).equals("1.00000001E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("add053")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("700000"),mcdef).toString()).equals("1.00000007E+13"); - - - (new com.ibm.math.DiagBigDecimal.Test("add054")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70")).toString()).equals("10000000000070"); - - (new com.ibm.math.DiagBigDecimal.Test("add055")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("700")).toString()).equals("10000000000700"); - - (new com.ibm.math.DiagBigDecimal.Test("add056")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("7000")).toString()).equals("10000000007000"); - - (new com.ibm.math.DiagBigDecimal.Test("add057")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70000")).toString()).equals("10000000070000"); - - (new com.ibm.math.DiagBigDecimal.Test("add058")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("700000")).toString()).equals("10000000700000"); - - // some rounding effects - (new com.ibm.math.DiagBigDecimal.Test("add059")).ok=((new com.ibm.math.BigDecimal("0.9998")).add(new com.ibm.math.BigDecimal("0.0000")).toString()).equals("0.9998"); - - (new com.ibm.math.DiagBigDecimal.Test("add060")).ok=((new com.ibm.math.BigDecimal("0.9998")).add(new com.ibm.math.BigDecimal("0.0001")).toString()).equals("0.9999"); - - (new com.ibm.math.DiagBigDecimal.Test("add061")).ok=((new com.ibm.math.BigDecimal("0.9998")).add(new com.ibm.math.BigDecimal("0.0002")).toString()).equals("1.0000"); - - (new com.ibm.math.DiagBigDecimal.Test("add062")).ok=((new com.ibm.math.BigDecimal("0.9998")).add(new com.ibm.math.BigDecimal("0.0003")).toString()).equals("1.0001"); - - - // MC - (new com.ibm.math.DiagBigDecimal.Test("add070")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70000"),mcfd).toString()).equals("10000000070000"); - - (new com.ibm.math.DiagBigDecimal.Test("add071")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70000"),mcdef).toString()).equals("1.00000001E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("add072")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70000"),mc6).toString()).equals("1.00000E+13"); - - - // zero preservation - (new com.ibm.math.DiagBigDecimal.Test("add080")).ok=(com.ibm.math.BigDecimal.ONE.add(new com.ibm.math.BigDecimal("0.0001"),mc6).toString()).equals("1.0001"); - - (new com.ibm.math.DiagBigDecimal.Test("add081")).ok=(com.ibm.math.BigDecimal.ONE.add(new com.ibm.math.BigDecimal("0.00001"),mc6).toString()).equals("1.00001"); - - (new com.ibm.math.DiagBigDecimal.Test("add082")).ok=(com.ibm.math.BigDecimal.ONE.add(new com.ibm.math.BigDecimal("0.000001"),mc6).toString()).equals("1.00000"); - - (new com.ibm.math.DiagBigDecimal.Test("add083")).ok=(com.ibm.math.BigDecimal.ONE.add(new com.ibm.math.BigDecimal("0.0000001"),mc6).toString()).equals("1.00000"); - - (new com.ibm.math.DiagBigDecimal.Test("add084")).ok=(com.ibm.math.BigDecimal.ONE.add(new com.ibm.math.BigDecimal("0.00000001"),mc6).toString()).equals("1.00000"); - - - // more fixed, LHS swaps - (new com.ibm.math.DiagBigDecimal.Test("add090")).ok=((new com.ibm.math.BigDecimal("-56267E-10")).add(zero).toString()).equals("-0.0000056267"); - (new com.ibm.math.DiagBigDecimal.Test("add091")).ok=((new com.ibm.math.BigDecimal("-56267E-6")).add(zero).toString()).equals("-0.056267"); - (new com.ibm.math.DiagBigDecimal.Test("add092")).ok=((new com.ibm.math.BigDecimal("-56267E-5")).add(zero).toString()).equals("-0.56267"); - (new com.ibm.math.DiagBigDecimal.Test("add093")).ok=((new com.ibm.math.BigDecimal("-56267E-4")).add(zero).toString()).equals("-5.6267"); - (new com.ibm.math.DiagBigDecimal.Test("add094")).ok=((new com.ibm.math.BigDecimal("-56267E-3")).add(zero).toString()).equals("-56.267"); - (new com.ibm.math.DiagBigDecimal.Test("add095")).ok=((new com.ibm.math.BigDecimal("-56267E-2")).add(zero).toString()).equals("-562.67"); - (new com.ibm.math.DiagBigDecimal.Test("add096")).ok=((new com.ibm.math.BigDecimal("-56267E-1")).add(zero).toString()).equals("-5626.7"); - (new com.ibm.math.DiagBigDecimal.Test("add097")).ok=((new com.ibm.math.BigDecimal("-56267E-0")).add(zero).toString()).equals("-56267"); - (new com.ibm.math.DiagBigDecimal.Test("add098")).ok=((new com.ibm.math.BigDecimal("-5E-10")).add(zero).toString()).equals("-0.0000000005"); - (new com.ibm.math.DiagBigDecimal.Test("add099")).ok=((new com.ibm.math.BigDecimal("-5E-5")).add(zero).toString()).equals("-0.00005"); - (new com.ibm.math.DiagBigDecimal.Test("add100")).ok=((new com.ibm.math.BigDecimal("-5E-1")).add(zero).toString()).equals("-0.5"); - (new com.ibm.math.DiagBigDecimal.Test("add101")).ok=((new com.ibm.math.BigDecimal("-5E-10")).add(zero).toString()).equals("-0.0000000005"); - (new com.ibm.math.DiagBigDecimal.Test("add102")).ok=((new com.ibm.math.BigDecimal("-5E-5")).add(zero).toString()).equals("-0.00005"); - (new com.ibm.math.DiagBigDecimal.Test("add103")).ok=((new com.ibm.math.BigDecimal("-5E-1")).add(zero).toString()).equals("-0.5"); - (new com.ibm.math.DiagBigDecimal.Test("add104")).ok=((new com.ibm.math.BigDecimal("-5E10")).add(zero).toString()).equals("-50000000000"); - (new com.ibm.math.DiagBigDecimal.Test("add105")).ok=((new com.ibm.math.BigDecimal("-5E5")).add(zero).toString()).equals("-500000"); - (new com.ibm.math.DiagBigDecimal.Test("add106")).ok=((new com.ibm.math.BigDecimal("-5E1")).add(zero).toString()).equals("-50"); - (new com.ibm.math.DiagBigDecimal.Test("add107")).ok=((new com.ibm.math.BigDecimal("-5E0")).add(zero).toString()).equals("-5"); - - // more fixed, RHS swaps - (new com.ibm.math.DiagBigDecimal.Test("add108")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-10")).toString()).equals("-0.0000056267"); - (new com.ibm.math.DiagBigDecimal.Test("add109")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-6")).toString()).equals("-0.056267"); - (new com.ibm.math.DiagBigDecimal.Test("add110")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-5")).toString()).equals("-0.56267"); - (new com.ibm.math.DiagBigDecimal.Test("add111")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-4")).toString()).equals("-5.6267"); - (new com.ibm.math.DiagBigDecimal.Test("add112")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-3")).toString()).equals("-56.267"); - (new com.ibm.math.DiagBigDecimal.Test("add113")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-2")).toString()).equals("-562.67"); - (new com.ibm.math.DiagBigDecimal.Test("add114")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-1")).toString()).equals("-5626.7"); - (new com.ibm.math.DiagBigDecimal.Test("add115")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-0")).toString()).equals("-56267"); - (new com.ibm.math.DiagBigDecimal.Test("add116")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E-10")).toString()).equals("-0.0000000005"); - (new com.ibm.math.DiagBigDecimal.Test("add117")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E-5")).toString()).equals("-0.00005"); - (new com.ibm.math.DiagBigDecimal.Test("add118")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E-1")).toString()).equals("-0.5"); - (new com.ibm.math.DiagBigDecimal.Test("add129")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E-10")).toString()).equals("-0.0000000005"); - (new com.ibm.math.DiagBigDecimal.Test("add130")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E-5")).toString()).equals("-0.00005"); - (new com.ibm.math.DiagBigDecimal.Test("add131")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E-1")).toString()).equals("-0.5"); - (new com.ibm.math.DiagBigDecimal.Test("add132")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E10")).toString()).equals("-50000000000"); - (new com.ibm.math.DiagBigDecimal.Test("add133")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E5")).toString()).equals("-500000"); - (new com.ibm.math.DiagBigDecimal.Test("add134")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E1")).toString()).equals("-50"); - (new com.ibm.math.DiagBigDecimal.Test("add135")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E0")).toString()).equals("-5"); - - // [some of the next group are really constructor tests] - (new com.ibm.math.DiagBigDecimal.Test("add140")).ok=((new com.ibm.math.BigDecimal("00.0")).add(new com.ibm.math.BigDecimal("0.00"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("add141")).ok=((new com.ibm.math.BigDecimal("0.00")).add(new com.ibm.math.BigDecimal("00.0"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("add142")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("3.3"); - (new com.ibm.math.DiagBigDecimal.Test("add143")).ok=((new com.ibm.math.BigDecimal("3.")).add(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("3.3"); - (new com.ibm.math.DiagBigDecimal.Test("add144")).ok=((new com.ibm.math.BigDecimal("3.0")).add(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("3.3"); - (new com.ibm.math.DiagBigDecimal.Test("add145")).ok=((new com.ibm.math.BigDecimal("3.00")).add(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("3.30"); - (new com.ibm.math.DiagBigDecimal.Test("add146")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("6"); - (new com.ibm.math.DiagBigDecimal.Test("add147")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal("+3"),mcdef).toString()).equals("6"); - (new com.ibm.math.DiagBigDecimal.Test("add148")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal("-3"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("add149")).ok=((new com.ibm.math.BigDecimal("0.03")).add(new com.ibm.math.BigDecimal("-0.03"),mcdef).toString()).equals("0"); - - (new com.ibm.math.DiagBigDecimal.Test("add150")).ok=((new com.ibm.math.BigDecimal("00.0")).add(new com.ibm.math.BigDecimal("0.00")).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("add151")).ok=((new com.ibm.math.BigDecimal("0.00")).add(new com.ibm.math.BigDecimal("00.0")).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("add152")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal(".3")).toString()).equals("3.3"); - (new com.ibm.math.DiagBigDecimal.Test("add153")).ok=((new com.ibm.math.BigDecimal("3.")).add(new com.ibm.math.BigDecimal(".3")).toString()).equals("3.3"); - (new com.ibm.math.DiagBigDecimal.Test("add154")).ok=((new com.ibm.math.BigDecimal("3.0")).add(new com.ibm.math.BigDecimal(".3")).toString()).equals("3.3"); - (new com.ibm.math.DiagBigDecimal.Test("add155")).ok=((new com.ibm.math.BigDecimal("3.00")).add(new com.ibm.math.BigDecimal(".3")).toString()).equals("3.30"); - (new com.ibm.math.DiagBigDecimal.Test("add156")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal("3")).toString()).equals("6"); - (new com.ibm.math.DiagBigDecimal.Test("add157")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal("+3")).toString()).equals("6"); - (new com.ibm.math.DiagBigDecimal.Test("add158")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal("-3")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("add159")).ok=((new com.ibm.math.BigDecimal("0.3")).add(new com.ibm.math.BigDecimal("-0.3")).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("add160")).ok=((new com.ibm.math.BigDecimal("0.03")).add(new com.ibm.math.BigDecimal("-0.03")).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("add161")).ok=((new com.ibm.math.BigDecimal("7E+12")).add(new com.ibm.math.BigDecimal("-1"),mcfd).toString()).equals("6999999999999"); - - (new com.ibm.math.DiagBigDecimal.Test("add162")).ok=((new com.ibm.math.BigDecimal("7E+12")).add(new com.ibm.math.BigDecimal("1.11"),mcfd).toString()).equals("7000000000001.11"); - - (new com.ibm.math.DiagBigDecimal.Test("add163")).ok=((new com.ibm.math.BigDecimal("1.11")).add(new com.ibm.math.BigDecimal("7E+12"),mcfd).toString()).equals("7000000000001.11"); - - - // input preparation tests - alhs=new com.ibm.math.BigDecimal("12345678900000"); - arhs=new com.ibm.math.BigDecimal("9999999999999"); - (new com.ibm.math.DiagBigDecimal.Test("add170")).ok=(alhs.add(arhs,mc3).toString()).equals("2.23E+13"); - (new com.ibm.math.DiagBigDecimal.Test("add171")).ok=(arhs.add(alhs,mc3).toString()).equals("2.23E+13"); - (new com.ibm.math.DiagBigDecimal.Test("add172")).ok=((new com.ibm.math.BigDecimal("12E+3")).add(new com.ibm.math.BigDecimal("3456"),mc3).toString()).equals("1.55E+4"); - // next was 1.54E+4 under old [truncate to digits+1] rules - (new com.ibm.math.DiagBigDecimal.Test("add173")).ok=((new com.ibm.math.BigDecimal("12E+3")).add(new com.ibm.math.BigDecimal("3446"),mc3).toString()).equals("1.55E+4"); - (new com.ibm.math.DiagBigDecimal.Test("add174")).ok=((new com.ibm.math.BigDecimal("12E+3")).add(new com.ibm.math.BigDecimal("3454"),mc3).toString()).equals("1.55E+4"); - (new com.ibm.math.DiagBigDecimal.Test("add175")).ok=((new com.ibm.math.BigDecimal("12E+3")).add(new com.ibm.math.BigDecimal("3444"),mc3).toString()).equals("1.54E+4"); - - (new com.ibm.math.DiagBigDecimal.Test("add176")).ok=((new com.ibm.math.BigDecimal("3456")).add(new com.ibm.math.BigDecimal("12E+3"),mc3).toString()).equals("1.55E+4"); - // next was 1.54E+4 under old [truncate to digits+1] rules - (new com.ibm.math.DiagBigDecimal.Test("add177")).ok=((new com.ibm.math.BigDecimal("3446")).add(new com.ibm.math.BigDecimal("12E+3"),mc3).toString()).equals("1.55E+4"); - (new com.ibm.math.DiagBigDecimal.Test("add178")).ok=((new com.ibm.math.BigDecimal("3454")).add(new com.ibm.math.BigDecimal("12E+3"),mc3).toString()).equals("1.55E+4"); - (new com.ibm.math.DiagBigDecimal.Test("add179")).ok=((new com.ibm.math.BigDecimal("3444")).add(new com.ibm.math.BigDecimal("12E+3"),mc3).toString()).equals("1.54E+4"); - - {try{checknull:do{ - ten.add((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $22){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("add200")).ok=flag; - {try{checknull2:do{ - ten.add(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $23){ - flag=true; - }}/*checknull2*/ - (new com.ibm.math.DiagBigDecimal.Test("add201")).ok=flag; - - {try{checkdigits:do{ - tenlong.add(com.ibm.math.BigDecimal.ZERO,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $24){ae=$24; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("add202")).ok=flag; - {try{checkdigits:do{ - com.ibm.math.BigDecimal.ZERO.add(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $25){ae=$25; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("add203")).ok=flag; - - // check lostdigits not raised if digits=0 [dyadic method] - {try{checkdigits:do{ - tenlong.add(com.ibm.math.BigDecimal.ZERO,mcld0); - flag=true; - }while(false);} - catch (java.lang.ArithmeticException $26){ae=$26; - flag=false; - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("add204")).ok=flag; - {try{checkdigits:do{ - com.ibm.math.BigDecimal.ZERO.add(tenlong,mcld0); - flag=true; - }while(false);} - catch (java.lang.ArithmeticException $27){ae=$27; - flag=false; - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("add205")).ok=flag; - - summary("add"); - return;} - - /* ----------------------------------------------------------------- */ - /** Test the {@link BigDecimal#compareTo(BigDecimal)} method. */ - - public void diagcompareto(){ - boolean flag=false; - java.lang.ArithmeticException ae=null; - // we assume add/subtract test function; this just - // tests existence, exceptions, and possible results - - (new com.ibm.math.DiagBigDecimal.Test("cpt001")).ok=((new com.ibm.math.BigDecimal("5")).compareTo(new com.ibm.math.BigDecimal("2")))==1; - (new com.ibm.math.DiagBigDecimal.Test("cpt002")).ok=((new com.ibm.math.BigDecimal("5")).compareTo(new com.ibm.math.BigDecimal("5")))==0; - (new com.ibm.math.DiagBigDecimal.Test("cpt003")).ok=((new com.ibm.math.BigDecimal("5")).compareTo(new com.ibm.math.BigDecimal("5.00")))==0; - (new com.ibm.math.DiagBigDecimal.Test("cpt004")).ok=((new com.ibm.math.BigDecimal("0.5")).compareTo(new com.ibm.math.BigDecimal("0.5")))==0; - (new com.ibm.math.DiagBigDecimal.Test("cpt005")).ok=((new com.ibm.math.BigDecimal("2")).compareTo(new com.ibm.math.BigDecimal("5")))==(-1); - (new com.ibm.math.DiagBigDecimal.Test("cpt006")).ok=((new com.ibm.math.BigDecimal("2")).compareTo(new com.ibm.math.BigDecimal("5"),mcdef))==(-1); - (new com.ibm.math.DiagBigDecimal.Test("cpt007")).ok=((new com.ibm.math.BigDecimal("2")).compareTo(new com.ibm.math.BigDecimal("5"),mc6))==(-1); - (new com.ibm.math.DiagBigDecimal.Test("cpt008")).ok=((new com.ibm.math.BigDecimal("2")).compareTo(new com.ibm.math.BigDecimal("5"),mcfd))==(-1); - {try{checknull:do{ - ten.compareTo((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $28){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("cpt100")).ok=flag; - {try{checknull2:do{ - ten.compareTo(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $29){ - flag=true; - }}/*checknull2*/ - (new com.ibm.math.DiagBigDecimal.Test("cpt101")).ok=flag; - - {try{checkdigits:do{ - tenlong.compareTo(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $30){ae=$30; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("cpt102")).ok=flag; - {try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.compareTo(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $31){ae=$31; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("cpt103")).ok=flag; - - summary("compareTo"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#divide} method. */ - - public void diagdivide(){ - boolean flag=false; - com.ibm.math.MathContext rmcd; - int rhu; - int rd; - int ru; - java.lang.RuntimeException e=null; - java.lang.ArithmeticException ae=null; - - (new com.ibm.math.DiagBigDecimal.Test("div301")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("0.333333333"); - (new com.ibm.math.DiagBigDecimal.Test("div302")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("0.666666667"); - (new com.ibm.math.DiagBigDecimal.Test("div303")).ok=((new com.ibm.math.BigDecimal("2.4")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("2.4"); - (new com.ibm.math.DiagBigDecimal.Test("div304")).ok=((new com.ibm.math.BigDecimal("2.4")).divide(new com.ibm.math.BigDecimal("-1"),mcdef).toString()).equals("-2.4"); - (new com.ibm.math.DiagBigDecimal.Test("div305")).ok=((new com.ibm.math.BigDecimal("-2.4")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("-2.4"); - (new com.ibm.math.DiagBigDecimal.Test("div306")).ok=((new com.ibm.math.BigDecimal("-2.4")).divide(new com.ibm.math.BigDecimal("-1"),mcdef).toString()).equals("2.4"); - (new com.ibm.math.DiagBigDecimal.Test("div307")).ok=((new com.ibm.math.BigDecimal("2.40")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("2.4"); - (new com.ibm.math.DiagBigDecimal.Test("div308")).ok=((new com.ibm.math.BigDecimal("2.400")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("2.4"); - (new com.ibm.math.DiagBigDecimal.Test("div309")).ok=((new com.ibm.math.BigDecimal("2.4")).divide(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1.2"); - (new com.ibm.math.DiagBigDecimal.Test("div310")).ok=((new com.ibm.math.BigDecimal("2.400")).divide(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1.2"); - (new com.ibm.math.DiagBigDecimal.Test("div311")).ok=((new com.ibm.math.BigDecimal("2.")).divide(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("div312")).ok=((new com.ibm.math.BigDecimal("20")).divide(new com.ibm.math.BigDecimal("20"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("div313")).ok=((new com.ibm.math.BigDecimal("187")).divide(new com.ibm.math.BigDecimal("187"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("div314")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("2.5"); - (new com.ibm.math.DiagBigDecimal.Test("div315")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("2.0"),mcdef).toString()).equals("2.5"); - (new com.ibm.math.DiagBigDecimal.Test("div316")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("2.000"),mcdef).toString()).equals("2.5"); - (new com.ibm.math.DiagBigDecimal.Test("div317")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("0.200"),mcdef).toString()).equals("25"); - (new com.ibm.math.DiagBigDecimal.Test("div318")).ok=((new com.ibm.math.BigDecimal("999999999")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("999999999"); - (new com.ibm.math.DiagBigDecimal.Test("div319")).ok=((new com.ibm.math.BigDecimal("999999999.4")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("999999999"); - (new com.ibm.math.DiagBigDecimal.Test("div320")).ok=((new com.ibm.math.BigDecimal("999999999.5")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("1E+9"); - (new com.ibm.math.DiagBigDecimal.Test("div321")).ok=((new com.ibm.math.BigDecimal("999999999.9")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("1E+9"); - (new com.ibm.math.DiagBigDecimal.Test("div322")).ok=((new com.ibm.math.BigDecimal("999999999.999")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("1E+9"); - (new com.ibm.math.DiagBigDecimal.Test("div323")).ok=((new com.ibm.math.BigDecimal("0.0000E-50")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("0"); - // MC - (new com.ibm.math.DiagBigDecimal.Test("div325")).ok=((new com.ibm.math.BigDecimal("999999999")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("999999999"); - (new com.ibm.math.DiagBigDecimal.Test("div326")).ok=((new com.ibm.math.BigDecimal("999999999")).divide(new com.ibm.math.BigDecimal("1"),mc6).toString()).equals("1E+9"); - (new com.ibm.math.DiagBigDecimal.Test("div327")).ok=((new com.ibm.math.BigDecimal("9999999")).divide(new com.ibm.math.BigDecimal("1"),mc6).toString()).equals("1E+7"); - (new com.ibm.math.DiagBigDecimal.Test("div328")).ok=((new com.ibm.math.BigDecimal("999999")).divide(new com.ibm.math.BigDecimal("1"),mc6).toString()).equals("999999"); - - // check rounding explicitly [note: digits+1 truncation] - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_CEILING); - (new com.ibm.math.DiagBigDecimal.Test("div330")).ok=((new com.ibm.math.BigDecimal("1.50")).divide(one,rmcd).toString()).equals("1.5"); - (new com.ibm.math.DiagBigDecimal.Test("div331")).ok=((new com.ibm.math.BigDecimal("1.51")).divide(one,rmcd).toString()).equals("1.6"); - (new com.ibm.math.DiagBigDecimal.Test("div332")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.6"); - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_DOWN); - (new com.ibm.math.DiagBigDecimal.Test("div333")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.5"); - (new com.ibm.math.DiagBigDecimal.Test("div334")).ok=((new com.ibm.math.BigDecimal("1.59")).divide(one,rmcd).toString()).equals("1.5"); - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_FLOOR); - (new com.ibm.math.DiagBigDecimal.Test("div335")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.5"); - (new com.ibm.math.DiagBigDecimal.Test("div336")).ok=((new com.ibm.math.BigDecimal("1.59")).divide(one,rmcd).toString()).equals("1.5"); - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_HALF_DOWN); - (new com.ibm.math.DiagBigDecimal.Test("div337")).ok=((new com.ibm.math.BigDecimal("1.45")).divide(one,rmcd).toString()).equals("1.4"); - (new com.ibm.math.DiagBigDecimal.Test("div338")).ok=((new com.ibm.math.BigDecimal("1.50")).divide(one,rmcd).toString()).equals("1.5"); - (new com.ibm.math.DiagBigDecimal.Test("div339")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.5"); - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_HALF_EVEN); - (new com.ibm.math.DiagBigDecimal.Test("div340")).ok=((new com.ibm.math.BigDecimal("1.45")).divide(one,rmcd).toString()).equals("1.4"); - (new com.ibm.math.DiagBigDecimal.Test("div341")).ok=((new com.ibm.math.BigDecimal("1.50")).divide(one,rmcd).toString()).equals("1.5"); - (new com.ibm.math.DiagBigDecimal.Test("div342")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.6"); - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_HALF_UP); - (new com.ibm.math.DiagBigDecimal.Test("div343")).ok=((new com.ibm.math.BigDecimal("1.45")).divide(one,rmcd).toString()).equals("1.5"); - (new com.ibm.math.DiagBigDecimal.Test("div344")).ok=((new com.ibm.math.BigDecimal("1.50")).divide(one,rmcd).toString()).equals("1.5"); - (new com.ibm.math.DiagBigDecimal.Test("div345")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.6"); - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_UP); - (new com.ibm.math.DiagBigDecimal.Test("div346")).ok=((new com.ibm.math.BigDecimal("1.50")).divide(one,rmcd).toString()).equals("1.5"); - (new com.ibm.math.DiagBigDecimal.Test("div347")).ok=((new com.ibm.math.BigDecimal("1.51")).divide(one,rmcd).toString()).equals("1.6"); - (new com.ibm.math.DiagBigDecimal.Test("div348")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.6"); - - // fixed point... - (new com.ibm.math.DiagBigDecimal.Test("div350")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div351")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("div352")).ok=((new com.ibm.math.BigDecimal("2.4")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("2.4"); - (new com.ibm.math.DiagBigDecimal.Test("div353")).ok=((new com.ibm.math.BigDecimal("2.4")).divide(new com.ibm.math.BigDecimal("-1")).toString()).equals("-2.4"); - (new com.ibm.math.DiagBigDecimal.Test("div354")).ok=((new com.ibm.math.BigDecimal("-2.4")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("-2.4"); - (new com.ibm.math.DiagBigDecimal.Test("div355")).ok=((new com.ibm.math.BigDecimal("-2.4")).divide(new com.ibm.math.BigDecimal("-1")).toString()).equals("2.4"); - (new com.ibm.math.DiagBigDecimal.Test("div356")).ok=((new com.ibm.math.BigDecimal("2.40")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("2.40"); - (new com.ibm.math.DiagBigDecimal.Test("div357")).ok=((new com.ibm.math.BigDecimal("2.400")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("2.400"); - (new com.ibm.math.DiagBigDecimal.Test("div358")).ok=((new com.ibm.math.BigDecimal("2.4")).divide(new com.ibm.math.BigDecimal("2")).toString()).equals("1.2"); - (new com.ibm.math.DiagBigDecimal.Test("div359")).ok=((new com.ibm.math.BigDecimal("2.400")).divide(new com.ibm.math.BigDecimal("2")).toString()).equals("1.200"); - (new com.ibm.math.DiagBigDecimal.Test("div360")).ok=((new com.ibm.math.BigDecimal("2.")).divide(new com.ibm.math.BigDecimal("2")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("div361")).ok=((new com.ibm.math.BigDecimal("20")).divide(new com.ibm.math.BigDecimal("20")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("div362")).ok=((new com.ibm.math.BigDecimal("187")).divide(new com.ibm.math.BigDecimal("187")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("div363")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("2")).toString()).equals("3"); - (new com.ibm.math.DiagBigDecimal.Test("div364")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("2.0")).toString()).equals("3"); - (new com.ibm.math.DiagBigDecimal.Test("div365")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("2.000")).toString()).equals("3"); - (new com.ibm.math.DiagBigDecimal.Test("div366")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("0.200")).toString()).equals("25"); - (new com.ibm.math.DiagBigDecimal.Test("div367")).ok=((new com.ibm.math.BigDecimal("5.0")).divide(new com.ibm.math.BigDecimal("2")).toString()).equals("2.5"); - (new com.ibm.math.DiagBigDecimal.Test("div368")).ok=((new com.ibm.math.BigDecimal("5.0")).divide(new com.ibm.math.BigDecimal("2.0")).toString()).equals("2.5"); - (new com.ibm.math.DiagBigDecimal.Test("div369")).ok=((new com.ibm.math.BigDecimal("5.0")).divide(new com.ibm.math.BigDecimal("2.000")).toString()).equals("2.5"); - (new com.ibm.math.DiagBigDecimal.Test("div370")).ok=((new com.ibm.math.BigDecimal("5.0")).divide(new com.ibm.math.BigDecimal("0.200")).toString()).equals("25.0"); - (new com.ibm.math.DiagBigDecimal.Test("div371")).ok=((new com.ibm.math.BigDecimal("999999999")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("999999999"); - (new com.ibm.math.DiagBigDecimal.Test("div372")).ok=((new com.ibm.math.BigDecimal("999999999.4")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("999999999.4"); - (new com.ibm.math.DiagBigDecimal.Test("div373")).ok=((new com.ibm.math.BigDecimal("999999999.5")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("999999999.5"); - (new com.ibm.math.DiagBigDecimal.Test("div374")).ok=((new com.ibm.math.BigDecimal("999999999.9")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("999999999.9"); - (new com.ibm.math.DiagBigDecimal.Test("div375")).ok=((new com.ibm.math.BigDecimal("999999999.999")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("999999999.999"); - (new com.ibm.math.DiagBigDecimal.Test("div376")).ok=((new com.ibm.math.BigDecimal("0.0000E-5")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div377")).ok=((new com.ibm.math.BigDecimal("0.000000000")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("0.000000000"); - - //- Fixed point; explicit scales & rounds [old BigDecimal divides] - rhu=com.ibm.math.MathContext.ROUND_HALF_UP; - rd=com.ibm.math.MathContext.ROUND_DOWN; - (new com.ibm.math.DiagBigDecimal.Test("div001")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div002")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3"),rhu).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div003")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3"),0,rhu).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div004")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3"),1,rhu).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("div005")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3"),2,rhu).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("div006")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3"),3,rhu).toString()).equals("0.000"); - (new com.ibm.math.DiagBigDecimal.Test("div007")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3"),4,rhu).toString()).equals("0.0000"); - (new com.ibm.math.DiagBigDecimal.Test("div008")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div009")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),rhu).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div010")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),0,rhu).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div011")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),1,rhu).toString()).equals("0.3"); - (new com.ibm.math.DiagBigDecimal.Test("div012")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),2,rhu).toString()).equals("0.33"); - (new com.ibm.math.DiagBigDecimal.Test("div013")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),3,rhu).toString()).equals("0.333"); - (new com.ibm.math.DiagBigDecimal.Test("div014")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),4,rhu).toString()).equals("0.3333"); - (new com.ibm.math.DiagBigDecimal.Test("div015")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("div016")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),rhu).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("div017")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),0,rhu).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("div018")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),1,rhu).toString()).equals("0.7"); - (new com.ibm.math.DiagBigDecimal.Test("div019")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),2,rhu).toString()).equals("0.67"); - (new com.ibm.math.DiagBigDecimal.Test("div020")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),3,rhu).toString()).equals("0.667"); - (new com.ibm.math.DiagBigDecimal.Test("div021")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),4,rhu).toString()).equals("0.6667"); - - (new com.ibm.math.DiagBigDecimal.Test("div030")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("2000"),4,rhu).toString()).equals("0.5000"); - (new com.ibm.math.DiagBigDecimal.Test("div031")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("2000"),3,rhu).toString()).equals("0.500"); - (new com.ibm.math.DiagBigDecimal.Test("div032")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("2000"),2,rhu).toString()).equals("0.50"); - (new com.ibm.math.DiagBigDecimal.Test("div033")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("2000"),1,rhu).toString()).equals("0.5"); - (new com.ibm.math.DiagBigDecimal.Test("div034")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("2000"),0,rhu).toString()).equals("1"); - - (new com.ibm.math.DiagBigDecimal.Test("div035")).ok=((new com.ibm.math.BigDecimal("100")).divide(new com.ibm.math.BigDecimal("5000"),4,rhu).toString()).equals("0.0200"); - (new com.ibm.math.DiagBigDecimal.Test("div036")).ok=((new com.ibm.math.BigDecimal("100")).divide(new com.ibm.math.BigDecimal("5000"),3,rhu).toString()).equals("0.020"); - (new com.ibm.math.DiagBigDecimal.Test("div037")).ok=((new com.ibm.math.BigDecimal("100")).divide(new com.ibm.math.BigDecimal("5000"),2,rhu).toString()).equals("0.02"); - (new com.ibm.math.DiagBigDecimal.Test("div038")).ok=((new com.ibm.math.BigDecimal("100")).divide(new com.ibm.math.BigDecimal("5000"),1,rhu).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("div039")).ok=((new com.ibm.math.BigDecimal("100")).divide(new com.ibm.math.BigDecimal("5000"),0,rhu).toString()).equals("0"); - - (new com.ibm.math.DiagBigDecimal.Test("div040")).ok=((new com.ibm.math.BigDecimal("9.99999999")).divide(new com.ibm.math.BigDecimal("9.77777777"),4,rhu).toString()).equals("1.0227"); - (new com.ibm.math.DiagBigDecimal.Test("div041")).ok=((new com.ibm.math.BigDecimal("9.9999999")).divide(new com.ibm.math.BigDecimal("9.7777777"),4,rhu).toString()).equals("1.0227"); - (new com.ibm.math.DiagBigDecimal.Test("div042")).ok=((new com.ibm.math.BigDecimal("9.999999")).divide(new com.ibm.math.BigDecimal("9.777777"),4,rhu).toString()).equals("1.0227"); - (new com.ibm.math.DiagBigDecimal.Test("div043")).ok=((new com.ibm.math.BigDecimal("9.77777777")).divide(new com.ibm.math.BigDecimal("9.99999999"),4,rhu).toString()).equals("0.9778"); - (new com.ibm.math.DiagBigDecimal.Test("div044")).ok=((new com.ibm.math.BigDecimal("9.7777777")).divide(new com.ibm.math.BigDecimal("9.9999999"),4,rhu).toString()).equals("0.9778"); - (new com.ibm.math.DiagBigDecimal.Test("div045")).ok=((new com.ibm.math.BigDecimal("9.777777")).divide(new com.ibm.math.BigDecimal("9.999999"),4,rhu).toString()).equals("0.9778"); - (new com.ibm.math.DiagBigDecimal.Test("div046")).ok=((new com.ibm.math.BigDecimal("9.77777")).divide(new com.ibm.math.BigDecimal("9.99999"),4,rhu).toString()).equals("0.9778"); - (new com.ibm.math.DiagBigDecimal.Test("div047")).ok=((new com.ibm.math.BigDecimal("9.7777")).divide(new com.ibm.math.BigDecimal("9.9999"),4,rhu).toString()).equals("0.9778"); - (new com.ibm.math.DiagBigDecimal.Test("div048")).ok=((new com.ibm.math.BigDecimal("9.777")).divide(new com.ibm.math.BigDecimal("9.999"),4,rhu).toString()).equals("0.9778"); - (new com.ibm.math.DiagBigDecimal.Test("div049")).ok=((new com.ibm.math.BigDecimal("9.77")).divide(new com.ibm.math.BigDecimal("9.99"),4,rhu).toString()).equals("0.9780"); - (new com.ibm.math.DiagBigDecimal.Test("div050")).ok=((new com.ibm.math.BigDecimal("9.7")).divide(new com.ibm.math.BigDecimal("9.9"),4,rhu).toString()).equals("0.9798"); - (new com.ibm.math.DiagBigDecimal.Test("div051")).ok=((new com.ibm.math.BigDecimal("9.")).divide(new com.ibm.math.BigDecimal("9."),4,rhu).toString()).equals("1.0000"); - - (new com.ibm.math.DiagBigDecimal.Test("div060")).ok=((new com.ibm.math.BigDecimal("9.99999999")).divide(new com.ibm.math.BigDecimal("9.77777777"),rhu).toString()).equals("1.02272727"); - (new com.ibm.math.DiagBigDecimal.Test("div061")).ok=((new com.ibm.math.BigDecimal("9.9999999")).divide(new com.ibm.math.BigDecimal("9.7777777"),rhu).toString()).equals("1.0227273"); - (new com.ibm.math.DiagBigDecimal.Test("div062")).ok=((new com.ibm.math.BigDecimal("9.999999")).divide(new com.ibm.math.BigDecimal("9.777777"),rhu).toString()).equals("1.022727"); - (new com.ibm.math.DiagBigDecimal.Test("div063")).ok=((new com.ibm.math.BigDecimal("9.77777777")).divide(new com.ibm.math.BigDecimal("9.99999999"),rhu).toString()).equals("0.97777778"); - (new com.ibm.math.DiagBigDecimal.Test("div064")).ok=((new com.ibm.math.BigDecimal("9.7777777")).divide(new com.ibm.math.BigDecimal("9.9999999"),rhu).toString()).equals("0.9777778"); - (new com.ibm.math.DiagBigDecimal.Test("div065")).ok=((new com.ibm.math.BigDecimal("9.777777")).divide(new com.ibm.math.BigDecimal("9.999999"),rhu).toString()).equals("0.977778"); - (new com.ibm.math.DiagBigDecimal.Test("div066")).ok=((new com.ibm.math.BigDecimal("9.77777")).divide(new com.ibm.math.BigDecimal("9.99999"),rhu).toString()).equals("0.97778"); - (new com.ibm.math.DiagBigDecimal.Test("div067")).ok=((new com.ibm.math.BigDecimal("9.7777")).divide(new com.ibm.math.BigDecimal("9.9999"),rhu).toString()).equals("0.9778"); - (new com.ibm.math.DiagBigDecimal.Test("div068")).ok=((new com.ibm.math.BigDecimal("9.777")).divide(new com.ibm.math.BigDecimal("9.999"),rhu).toString()).equals("0.978"); - (new com.ibm.math.DiagBigDecimal.Test("div069")).ok=((new com.ibm.math.BigDecimal("9.77")).divide(new com.ibm.math.BigDecimal("9.99"),rhu).toString()).equals("0.98"); - (new com.ibm.math.DiagBigDecimal.Test("div070")).ok=((new com.ibm.math.BigDecimal("9.7")).divide(new com.ibm.math.BigDecimal("9.9"),rhu).toString()).equals("1.0"); - (new com.ibm.math.DiagBigDecimal.Test("div071")).ok=((new com.ibm.math.BigDecimal("9.")).divide(new com.ibm.math.BigDecimal("9."),rhu).toString()).equals("1"); - - rd=com.ibm.math.MathContext.ROUND_DOWN; // test this is actually being used - (new com.ibm.math.DiagBigDecimal.Test("div080")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),0,rd).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div081")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),1,rd).toString()).equals("0.6"); - (new com.ibm.math.DiagBigDecimal.Test("div082")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),2,rd).toString()).equals("0.66"); - (new com.ibm.math.DiagBigDecimal.Test("div083")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),3,rd).toString()).equals("0.666"); - (new com.ibm.math.DiagBigDecimal.Test("div084")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),4,rd).toString()).equals("0.6666"); - - ru=com.ibm.math.MathContext.ROUND_UNNECESSARY; // check for some 0 residues - (new com.ibm.math.DiagBigDecimal.Test("div090")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("5"),4,ru).toString()).equals("200.0000"); - (new com.ibm.math.DiagBigDecimal.Test("div091")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("50"),4,ru).toString()).equals("20.0000"); - (new com.ibm.math.DiagBigDecimal.Test("div092")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("500"),4,ru).toString()).equals("2.0000"); - (new com.ibm.math.DiagBigDecimal.Test("div093")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("5000"),4,ru).toString()).equals("0.2000"); - (new com.ibm.math.DiagBigDecimal.Test("div094")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("5000"),3,ru).toString()).equals("0.200"); - (new com.ibm.math.DiagBigDecimal.Test("div095")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("5000"),2,ru).toString()).equals("0.20"); - (new com.ibm.math.DiagBigDecimal.Test("div096")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("5000"),1,ru).toString()).equals("0.2"); - - // check rounding explicitly - (new com.ibm.math.DiagBigDecimal.Test("div101")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_CEILING).toString()).equals("0.06"); - (new com.ibm.math.DiagBigDecimal.Test("div102")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_CEILING).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("div103")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_CEILING).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("div104")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_DOWN).toString()).equals("0.05"); - (new com.ibm.math.DiagBigDecimal.Test("div105")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_DOWN).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("div106")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_DOWN).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div107")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_FLOOR).toString()).equals("0.05"); - (new com.ibm.math.DiagBigDecimal.Test("div108")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_FLOOR).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("div109")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_FLOOR).toString()).equals("0"); - - (new com.ibm.math.DiagBigDecimal.Test("div110")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.04"); - (new com.ibm.math.DiagBigDecimal.Test("div111")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("div112")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div113")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.05"); - (new com.ibm.math.DiagBigDecimal.Test("div114")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("div115")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div116")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.05"); - (new com.ibm.math.DiagBigDecimal.Test("div117")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("div118")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0"); - - (new com.ibm.math.DiagBigDecimal.Test("div120")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.04"); - (new com.ibm.math.DiagBigDecimal.Test("div121")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("div122")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div123")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.05"); - (new com.ibm.math.DiagBigDecimal.Test("div124")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("div125")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div126")).ok=((new com.ibm.math.BigDecimal("0.150")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.15"); - (new com.ibm.math.DiagBigDecimal.Test("div127")).ok=((new com.ibm.math.BigDecimal("0.150")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.2"); - (new com.ibm.math.DiagBigDecimal.Test("div128")).ok=((new com.ibm.math.BigDecimal("0.150")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div129")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.06"); - (new com.ibm.math.DiagBigDecimal.Test("div130")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("div131")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0"); - - (new com.ibm.math.DiagBigDecimal.Test("div140")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.05"); - (new com.ibm.math.DiagBigDecimal.Test("div141")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("div142")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div143")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.05"); - (new com.ibm.math.DiagBigDecimal.Test("div144")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("div145")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("div146")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.06"); - (new com.ibm.math.DiagBigDecimal.Test("div147")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("div148")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0"); - - (new com.ibm.math.DiagBigDecimal.Test("div150")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_UP).toString()).equals("0.06"); - (new com.ibm.math.DiagBigDecimal.Test("div151")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_UP).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("div52.")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_UP).toString()).equals("1"); - - //- error conditions --- - {try{checknull:do{ - ten.divide((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $32){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("div201")).ok=flag; - {try{checknull2:do{ - ten.divide(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $33){ - flag=true; - }}/*checknull2*/ - (new com.ibm.math.DiagBigDecimal.Test("div202")).ok=flag; - - {try{checkscale:do{ - (new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),-8,0); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $34){e=$34; - flag=flag&(e.getMessage()).equals("Negative scale: -8"); - }}/*checkscale*/ - (new com.ibm.math.DiagBigDecimal.Test("div203")).ok=flag; - - {try{rounn:do{ - (new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("5000"),0,com.ibm.math.MathContext.ROUND_UNNECESSARY); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $35){ae=$35; - flag=(ae.getMessage()).equals("Rounding necessary"); - }}/*rounn*/ - (new com.ibm.math.DiagBigDecimal.Test("div204")).ok=flag; - {try{rounn:do{ - (new com.ibm.math.BigDecimal("1001")).divide(new com.ibm.math.BigDecimal("10"),0,com.ibm.math.MathContext.ROUND_UNNECESSARY); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $36){ae=$36; - flag=(ae.getMessage()).equals("Rounding necessary"); - }}/*rounn*/ - (new com.ibm.math.DiagBigDecimal.Test("div205")).ok=flag; - {try{rounn:do{ - (new com.ibm.math.BigDecimal("1001")).divide(new com.ibm.math.BigDecimal("100"),1,com.ibm.math.MathContext.ROUND_UNNECESSARY); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $37){ae=$37; - flag=(ae.getMessage()).equals("Rounding necessary"); - }}/*rounn*/ - (new com.ibm.math.DiagBigDecimal.Test("div206")).ok=flag; - {try{rounn:do{ - (new com.ibm.math.BigDecimal("10001")).divide(new com.ibm.math.BigDecimal("10000"),1,com.ibm.math.MathContext.ROUND_UNNECESSARY); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $38){ae=$38; - flag=(ae.getMessage()).equals("Rounding necessary"); - }}/*rounn*/ - (new com.ibm.math.DiagBigDecimal.Test("div207")).ok=flag; - {try{rounn:do{ - (new com.ibm.math.BigDecimal("1.0001")).divide(new com.ibm.math.BigDecimal("1"),1,com.ibm.math.MathContext.ROUND_UNNECESSARY); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $39){ae=$39; - flag=(ae.getMessage()).equals("Rounding necessary"); - }}/*rounn*/ - (new com.ibm.math.DiagBigDecimal.Test("div208")).ok=flag; - - {try{div0:do{ - (new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("0.00")); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $40){ae=$40; - flag=(ae.getMessage()).equals("Divide by 0"); - }}/*div0*/ - (new com.ibm.math.DiagBigDecimal.Test("div209")).ok=flag; - - {try{checkdigits:do{ - tenlong.divide(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $41){ae=$41; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("div210")).ok=flag; - {try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.divide(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $42){ae=$42; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("div211")).ok=flag; - - summary("divide"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#divideInteger} method. */ - - public void diagdivideInteger(){ - boolean flag=false; - java.lang.ArithmeticException ae=null; - - (new com.ibm.math.DiagBigDecimal.Test("dvI001")).ok=((new com.ibm.math.BigDecimal("101.3")).divideInteger(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("101"); - (new com.ibm.math.DiagBigDecimal.Test("dvI002")).ok=((new com.ibm.math.BigDecimal("101.0")).divideInteger(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("101"); - (new com.ibm.math.DiagBigDecimal.Test("dvI003")).ok=((new com.ibm.math.BigDecimal("101.3")).divideInteger(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("33"); - (new com.ibm.math.DiagBigDecimal.Test("dvI004")).ok=((new com.ibm.math.BigDecimal("101.0")).divideInteger(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("33"); - (new com.ibm.math.DiagBigDecimal.Test("dvI005")).ok=((new com.ibm.math.BigDecimal("2.4")).divideInteger(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("dvI006")).ok=((new com.ibm.math.BigDecimal("2.400")).divideInteger(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("dvI007")).ok=((new com.ibm.math.BigDecimal("18")).divideInteger(new com.ibm.math.BigDecimal("18"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("dvI008")).ok=((new com.ibm.math.BigDecimal("1120")).divideInteger(new com.ibm.math.BigDecimal("1000"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("dvI009")).ok=((new com.ibm.math.BigDecimal("2.4")).divideInteger(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("dvI010")).ok=((new com.ibm.math.BigDecimal("2.400")).divideInteger(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("dvI011")).ok=((new com.ibm.math.BigDecimal("0.5")).divideInteger(new com.ibm.math.BigDecimal("2.000"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("dvI012")).ok=((new com.ibm.math.BigDecimal("8.005")).divideInteger(new com.ibm.math.BigDecimal("7"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("dvI013")).ok=((new com.ibm.math.BigDecimal("5")).divideInteger(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("dvI014")).ok=((new com.ibm.math.BigDecimal("0")).divideInteger(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("dvI015")).ok=((new com.ibm.math.BigDecimal("0.00")).divideInteger(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0"); - // MC - (new com.ibm.math.DiagBigDecimal.Test("dvI016")).ok=((new com.ibm.math.BigDecimal("5")).divideInteger(new com.ibm.math.BigDecimal("2"),mce).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("dvI017")).ok=((new com.ibm.math.BigDecimal("5")).divideInteger(new com.ibm.math.BigDecimal("2"),mc6).toString()).equals("2"); - - // Fixed -- - (new com.ibm.math.DiagBigDecimal.Test("dvI021")).ok=((new com.ibm.math.BigDecimal("101.3")).divideInteger(new com.ibm.math.BigDecimal("1")).toString()).equals("101"); - (new com.ibm.math.DiagBigDecimal.Test("dvI022")).ok=((new com.ibm.math.BigDecimal("101.0")).divideInteger(new com.ibm.math.BigDecimal("1")).toString()).equals("101"); - (new com.ibm.math.DiagBigDecimal.Test("dvI023")).ok=((new com.ibm.math.BigDecimal("101.3")).divideInteger(new com.ibm.math.BigDecimal("3")).toString()).equals("33"); - (new com.ibm.math.DiagBigDecimal.Test("dvI024")).ok=((new com.ibm.math.BigDecimal("101.0")).divideInteger(new com.ibm.math.BigDecimal("3")).toString()).equals("33"); - (new com.ibm.math.DiagBigDecimal.Test("dvI025")).ok=((new com.ibm.math.BigDecimal("2.4")).divideInteger(new com.ibm.math.BigDecimal("1")).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("dvI026")).ok=((new com.ibm.math.BigDecimal("2.400")).divideInteger(new com.ibm.math.BigDecimal("1")).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("dvI027")).ok=((new com.ibm.math.BigDecimal("18")).divideInteger(new com.ibm.math.BigDecimal("18")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("dvI028")).ok=((new com.ibm.math.BigDecimal("1120")).divideInteger(new com.ibm.math.BigDecimal("1000")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("dvI029")).ok=((new com.ibm.math.BigDecimal("2.4")).divideInteger(new com.ibm.math.BigDecimal("2")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("dvI030")).ok=((new com.ibm.math.BigDecimal("2.400")).divideInteger(new com.ibm.math.BigDecimal("2")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("dvI031")).ok=((new com.ibm.math.BigDecimal("0.5")).divideInteger(new com.ibm.math.BigDecimal("2.000")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("dvI032")).ok=((new com.ibm.math.BigDecimal("8.005")).divideInteger(new com.ibm.math.BigDecimal("7")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("dvI033")).ok=((new com.ibm.math.BigDecimal("5")).divideInteger(new com.ibm.math.BigDecimal("2")).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("dvI034")).ok=((new com.ibm.math.BigDecimal("0")).divideInteger(new com.ibm.math.BigDecimal("2")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("dvI035")).ok=((new com.ibm.math.BigDecimal("0.00")).divideInteger(new com.ibm.math.BigDecimal("2")).toString()).equals("0"); - - {try{checknull:do{ - ten.divideInteger((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $43){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("dvI101")).ok=flag; - {try{checknull2:do{ - ten.divideInteger(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $44){ - flag=true; - }}/*checknull2*/ - (new com.ibm.math.DiagBigDecimal.Test("dvI102")).ok=flag; - - {try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.divideInteger(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $45){ae=$45; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("dvI103")).ok=flag; - - {try{checkdigits:do{ - tenlong.divideInteger(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $46){ae=$46; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("dvI104")).ok=flag; - - summary("divideInteger"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#max} method. */ - - public void diagmax(){ - boolean flag=false; - java.lang.ArithmeticException ae=null; - - // we assume add/subtract test function; this and min just - // test existence and test the truth table - (new com.ibm.math.DiagBigDecimal.Test("max001")).ok=((new com.ibm.math.BigDecimal("5")).max(new com.ibm.math.BigDecimal("2")).toString()).equals("5"); - (new com.ibm.math.DiagBigDecimal.Test("max002")).ok=((new com.ibm.math.BigDecimal("5")).max(new com.ibm.math.BigDecimal("5")).toString()).equals("5"); - (new com.ibm.math.DiagBigDecimal.Test("max003")).ok=((new com.ibm.math.BigDecimal("2")).max(new com.ibm.math.BigDecimal("7")).toString()).equals("7"); - (new com.ibm.math.DiagBigDecimal.Test("max004")).ok=((new com.ibm.math.BigDecimal("2")).max(new com.ibm.math.BigDecimal("7"),mcdef).toString()).equals("7"); - (new com.ibm.math.DiagBigDecimal.Test("max005")).ok=((new com.ibm.math.BigDecimal("2")).max(new com.ibm.math.BigDecimal("7"),mc6).toString()).equals("7"); - (new com.ibm.math.DiagBigDecimal.Test("max006")).ok=((new com.ibm.math.BigDecimal("2E+3")).max(new com.ibm.math.BigDecimal("7")).toString()).equals("2000"); - (new com.ibm.math.DiagBigDecimal.Test("max007")).ok=((new com.ibm.math.BigDecimal("2E+3")).max(new com.ibm.math.BigDecimal("7"),mc3).toString()).equals("2E+3"); - (new com.ibm.math.DiagBigDecimal.Test("max008")).ok=((new com.ibm.math.BigDecimal("7")).max(new com.ibm.math.BigDecimal("2E+3")).toString()).equals("2000"); - (new com.ibm.math.DiagBigDecimal.Test("max009")).ok=((new com.ibm.math.BigDecimal("7")).max(new com.ibm.math.BigDecimal("2E+3"),mc3).toString()).equals("2E+3"); - {try{checknull:do{ - ten.max((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $47){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("max010")).ok=flag; - {try{checknull2:do{ - ten.max(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $48){ - flag=true; - }}/*checknull2*/ - (new com.ibm.math.DiagBigDecimal.Test("max011")).ok=flag; - {try{checkdigits:do{ - tenlong.max(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $49){ae=$49; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("max012")).ok=flag; - {try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.max(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $50){ae=$50; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("max013")).ok=flag; - summary("max"); - return;} - - /** Test the {@link BigDecimal#min} method. */ - - public void diagmin(){ - boolean flag=false; - com.ibm.math.BigDecimal minx=null; - java.lang.ArithmeticException ae=null; - // we assume add/subtract test function; this and max just - // test existence and test the truth table - - (new com.ibm.math.DiagBigDecimal.Test("min001")).ok=((new com.ibm.math.BigDecimal("5")).min(new com.ibm.math.BigDecimal("2")).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("min002")).ok=((new com.ibm.math.BigDecimal("5")).min(new com.ibm.math.BigDecimal("5")).toString()).equals("5"); - (new com.ibm.math.DiagBigDecimal.Test("min003")).ok=((new com.ibm.math.BigDecimal("2")).min(new com.ibm.math.BigDecimal("7")).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("min004")).ok=((new com.ibm.math.BigDecimal("2")).min(new com.ibm.math.BigDecimal("7"),mcdef).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("min005")).ok=((new com.ibm.math.BigDecimal("1")).min(new com.ibm.math.BigDecimal("7"),mc6).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("min006")).ok=((new com.ibm.math.BigDecimal("-2E+3")).min(new com.ibm.math.BigDecimal("7")).toString()).equals("-2000"); - (new com.ibm.math.DiagBigDecimal.Test("min007")).ok=((new com.ibm.math.BigDecimal("-2E+3")).min(new com.ibm.math.BigDecimal("7"),mc3).toString()).equals("-2E+3"); - (new com.ibm.math.DiagBigDecimal.Test("min008")).ok=((new com.ibm.math.BigDecimal("7")).min(new com.ibm.math.BigDecimal("-2E+3")).toString()).equals("-2000"); - (new com.ibm.math.DiagBigDecimal.Test("min009")).ok=((new com.ibm.math.BigDecimal("7")).min(new com.ibm.math.BigDecimal("-2E+3"),mc3).toString()).equals("-2E+3"); - {try{checknull:do{ - minx=ten; - minx.min((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $51){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("min010")).ok=flag; - {try{checknull2:do{ - minx=ten; - minx.min(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $52){ - flag=true; - }}/*checknull2*/ - (new com.ibm.math.DiagBigDecimal.Test("min011")).ok=flag; - - {try{checkdigits:do{ - tenlong.min(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $53){ae=$53; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("min012")).ok=flag; - {try{checkdigits:do{ - (new com.ibm.math.BigDecimal(9)).min(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $54){ae=$54; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("min013")).ok=flag; - summary("min"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#multiply} method. */ - - public void diagmultiply(){ - boolean flag=false; - com.ibm.math.BigDecimal l9; - com.ibm.math.BigDecimal l77e; - com.ibm.math.BigDecimal l12345; - com.ibm.math.BigDecimal edge; - com.ibm.math.BigDecimal tenedge; - com.ibm.math.BigDecimal hunedge; - com.ibm.math.BigDecimal opo; - com.ibm.math.BigDecimal d1=null; - com.ibm.math.BigDecimal d2=null; - java.lang.ArithmeticException oe=null; - java.lang.ArithmeticException ae=null; - - (new com.ibm.math.DiagBigDecimal.Test("mul001")).ok=((new com.ibm.math.BigDecimal("2")).multiply(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("6"); - (new com.ibm.math.DiagBigDecimal.Test("mul002")).ok=((new com.ibm.math.BigDecimal("5")).multiply(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("5"); - (new com.ibm.math.DiagBigDecimal.Test("mul003")).ok=((new com.ibm.math.BigDecimal("5")).multiply(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("mul004")).ok=((new com.ibm.math.BigDecimal("1.20")).multiply(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("2.40"); - (new com.ibm.math.DiagBigDecimal.Test("mul005")).ok=((new com.ibm.math.BigDecimal("1.20")).multiply(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("mul006")).ok=((new com.ibm.math.BigDecimal("1.20")).multiply(new com.ibm.math.BigDecimal("-2"),mcdef).toString()).equals("-2.40"); - (new com.ibm.math.DiagBigDecimal.Test("mul007")).ok=((new com.ibm.math.BigDecimal("-1.20")).multiply(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("-2.40"); - (new com.ibm.math.DiagBigDecimal.Test("mul008")).ok=((new com.ibm.math.BigDecimal("-1.20")).multiply(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("mul009")).ok=((new com.ibm.math.BigDecimal("-1.20")).multiply(new com.ibm.math.BigDecimal("-2"),mcdef).toString()).equals("2.40"); - (new com.ibm.math.DiagBigDecimal.Test("mul010")).ok=((new com.ibm.math.BigDecimal("5.09")).multiply(new com.ibm.math.BigDecimal("7.1"),mcdef).toString()).equals("36.139"); - (new com.ibm.math.DiagBigDecimal.Test("mul011")).ok=((new com.ibm.math.BigDecimal("2.5")).multiply(new com.ibm.math.BigDecimal("4"),mcdef).toString()).equals("10.0"); - (new com.ibm.math.DiagBigDecimal.Test("mul012")).ok=((new com.ibm.math.BigDecimal("2.50")).multiply(new com.ibm.math.BigDecimal("4"),mcdef).toString()).equals("10.00"); - (new com.ibm.math.DiagBigDecimal.Test("mul013")).ok=((new com.ibm.math.BigDecimal("1.23456789")).multiply(new com.ibm.math.BigDecimal("1.00000000"),mcdef).toString()).equals("1.23456789"); - - (new com.ibm.math.DiagBigDecimal.Test("mul014")).ok=((new com.ibm.math.BigDecimal("9.999999999")).multiply(new com.ibm.math.BigDecimal("9.999999999"),mcdef).toString()).equals("100.000000"); - - (new com.ibm.math.DiagBigDecimal.Test("mul015")).ok=((new com.ibm.math.BigDecimal("2.50")).multiply(new com.ibm.math.BigDecimal("4"),mcdef).toString()).equals("10.00"); - (new com.ibm.math.DiagBigDecimal.Test("mul016")).ok=((new com.ibm.math.BigDecimal("2.50")).multiply(new com.ibm.math.BigDecimal("4"),mc6).toString()).equals("10.00"); - (new com.ibm.math.DiagBigDecimal.Test("mul017")).ok=((new com.ibm.math.BigDecimal("9.999999999")).multiply(new com.ibm.math.BigDecimal("9.999999999"),mc6).toString()).equals("100.000"); - - - (new com.ibm.math.DiagBigDecimal.Test("mul020")).ok=((new com.ibm.math.BigDecimal("2")).multiply(new com.ibm.math.BigDecimal("3")).toString()).equals("6"); - (new com.ibm.math.DiagBigDecimal.Test("mul021")).ok=((new com.ibm.math.BigDecimal("5")).multiply(new com.ibm.math.BigDecimal("1")).toString()).equals("5"); - (new com.ibm.math.DiagBigDecimal.Test("mul022")).ok=((new com.ibm.math.BigDecimal("5")).multiply(new com.ibm.math.BigDecimal("2")).toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("mul023")).ok=((new com.ibm.math.BigDecimal("1.20")).multiply(new com.ibm.math.BigDecimal("2")).toString()).equals("2.40"); - (new com.ibm.math.DiagBigDecimal.Test("mul024")).ok=((new com.ibm.math.BigDecimal("1.20")).multiply(new com.ibm.math.BigDecimal("0")).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("mul025")).ok=((new com.ibm.math.BigDecimal("1.20")).multiply(new com.ibm.math.BigDecimal("-2")).toString()).equals("-2.40"); - (new com.ibm.math.DiagBigDecimal.Test("mul026")).ok=((new com.ibm.math.BigDecimal("-1.20")).multiply(new com.ibm.math.BigDecimal("2")).toString()).equals("-2.40"); - (new com.ibm.math.DiagBigDecimal.Test("mul027")).ok=((new com.ibm.math.BigDecimal("-1.20")).multiply(new com.ibm.math.BigDecimal("0")).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("mul028")).ok=((new com.ibm.math.BigDecimal("-1.20")).multiply(new com.ibm.math.BigDecimal("-2")).toString()).equals("2.40"); - (new com.ibm.math.DiagBigDecimal.Test("mul029")).ok=((new com.ibm.math.BigDecimal("5.09")).multiply(new com.ibm.math.BigDecimal("7.1")).toString()).equals("36.139"); - (new com.ibm.math.DiagBigDecimal.Test("mul030")).ok=((new com.ibm.math.BigDecimal("2.5")).multiply(new com.ibm.math.BigDecimal("4")).toString()).equals("10.0"); - (new com.ibm.math.DiagBigDecimal.Test("mul031")).ok=((new com.ibm.math.BigDecimal("2.50")).multiply(new com.ibm.math.BigDecimal("4")).toString()).equals("10.00"); - (new com.ibm.math.DiagBigDecimal.Test("mul032")).ok=((new com.ibm.math.BigDecimal("1.23456789")).multiply(new com.ibm.math.BigDecimal("1.00000000")).toString()).equals("1.2345678900000000"); - - (new com.ibm.math.DiagBigDecimal.Test("mul033")).ok=((new com.ibm.math.BigDecimal("1234.56789")).multiply(new com.ibm.math.BigDecimal("-1000.00000")).toString()).equals("-1234567.8900000000"); - - (new com.ibm.math.DiagBigDecimal.Test("mul034")).ok=((new com.ibm.math.BigDecimal("-1234.56789")).multiply(new com.ibm.math.BigDecimal("1000.00000")).toString()).equals("-1234567.8900000000"); - - (new com.ibm.math.DiagBigDecimal.Test("mul035")).ok=((new com.ibm.math.BigDecimal("9.999999999")).multiply(new com.ibm.math.BigDecimal("9.999999999")).toString()).equals("99.999999980000000001"); - - (new com.ibm.math.DiagBigDecimal.Test("mul036")).ok=((new com.ibm.math.BigDecimal("5.00")).multiply(new com.ibm.math.BigDecimal("1E-3")).toString()).equals("0.00500"); - (new com.ibm.math.DiagBigDecimal.Test("mul037")).ok=((new com.ibm.math.BigDecimal("00.00")).multiply(new com.ibm.math.BigDecimal("0.000")).toString()).equals("0.00000"); - (new com.ibm.math.DiagBigDecimal.Test("mul038")).ok=((new com.ibm.math.BigDecimal("00.00")).multiply(new com.ibm.math.BigDecimal("0E-3")).toString()).equals("0.00"); // rhs is '0' - // 1999.12.21: next one is a edge case if intermediate longs are used - (new com.ibm.math.DiagBigDecimal.Test("mul039")).ok=((new com.ibm.math.BigDecimal("999999999999")).multiply(new com.ibm.math.BigDecimal("9765625")).toString()).equals("9765624999990234375"); - - l9=new com.ibm.math.BigDecimal("123456789E+10"); - l77e=new com.ibm.math.BigDecimal("77E-20"); - (new com.ibm.math.DiagBigDecimal.Test("mul040")).ok=(l9.multiply(new com.ibm.math.BigDecimal("3456757")).toString()).equals("4267601195732730000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul041")).ok=(l9.multiply(new com.ibm.math.BigDecimal("3456757"),mc3).toString()).equals("4.26E+24"); - (new com.ibm.math.DiagBigDecimal.Test("mul042")).ok=(l9.multiply(l77e).toString()).equals("0.95061727530000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul043")).ok=(l9.multiply(l77e,mc3).toString()).equals("0.947"); - (new com.ibm.math.DiagBigDecimal.Test("mul044")).ok=(l77e.multiply(l9,mc3).toString()).equals("0.947"); - - l12345=new com.ibm.math.BigDecimal("123.45"); - (new com.ibm.math.DiagBigDecimal.Test("mul050")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e11"),mcdef).toString()).equals("1.2345E+13"); - (new com.ibm.math.DiagBigDecimal.Test("mul051")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e11"),mcs).toString()).equals("1.2345E+13"); - (new com.ibm.math.DiagBigDecimal.Test("mul052")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e+9"),mce).toString()).equals("123.45E+9"); - (new com.ibm.math.DiagBigDecimal.Test("mul053")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e10"),mce).toString()).equals("1.2345E+12"); - (new com.ibm.math.DiagBigDecimal.Test("mul054")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e11"),mce).toString()).equals("12.345E+12"); - (new com.ibm.math.DiagBigDecimal.Test("mul055")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e12"),mce).toString()).equals("123.45E+12"); - (new com.ibm.math.DiagBigDecimal.Test("mul056")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e13"),mce).toString()).equals("1.2345E+15"); - - // test some cases that are close to exponent overflow - (new com.ibm.math.DiagBigDecimal.Test("mul060")).ok=(one.multiply(new com.ibm.math.BigDecimal("9e999999999"),mcs).toString()).equals("9E+999999999"); - (new com.ibm.math.DiagBigDecimal.Test("mul061")).ok=(one.multiply(new com.ibm.math.BigDecimal("9.9e999999999"),mcs).toString()).equals("9.9E+999999999"); - (new com.ibm.math.DiagBigDecimal.Test("mul062")).ok=(one.multiply(new com.ibm.math.BigDecimal("9.99e999999999"),mcs).toString()).equals("9.99E+999999999"); - (new com.ibm.math.DiagBigDecimal.Test("mul063")).ok=(ten.multiply(new com.ibm.math.BigDecimal("9e999999999"),mce).toString()).equals("90E+999999999"); - (new com.ibm.math.DiagBigDecimal.Test("mul064")).ok=(ten.multiply(new com.ibm.math.BigDecimal("9.9e999999999"),mce).toString()).equals("99.0E+999999999"); - edge=new com.ibm.math.BigDecimal("9.999e999999999"); - tenedge=ten.multiply(edge,mce); - (new com.ibm.math.DiagBigDecimal.Test("mul065")).ok=(tenedge.toString()).equals("99.990E+999999999"); - hunedge=ten.multiply(tenedge,mce); - (new com.ibm.math.DiagBigDecimal.Test("mul066")).ok=(hunedge.toString()).equals("999.900E+999999999"); - opo=new com.ibm.math.BigDecimal("0.1"); // one tenth - (new com.ibm.math.DiagBigDecimal.Test("mul067")).ok=(opo.multiply(new com.ibm.math.BigDecimal("9e-999999998"),mcs).toString()).equals("9E-999999999"); - (new com.ibm.math.DiagBigDecimal.Test("mul068")).ok=(opo.multiply(new com.ibm.math.BigDecimal("99e-999999998"),mcs).toString()).equals("9.9E-999999998"); - (new com.ibm.math.DiagBigDecimal.Test("mul069")).ok=(opo.multiply(new com.ibm.math.BigDecimal("999e-999999998"),mcs).toString()).equals("9.99E-999999997"); - - (new com.ibm.math.DiagBigDecimal.Test("mul070")).ok=(opo.multiply(new com.ibm.math.BigDecimal("9e-999999998"),mce).toString()).equals("9E-999999999"); - (new com.ibm.math.DiagBigDecimal.Test("mul071")).ok=(opo.multiply(new com.ibm.math.BigDecimal("99e-999999998"),mce).toString()).equals("99E-999999999"); - (new com.ibm.math.DiagBigDecimal.Test("mul072")).ok=(opo.multiply(new com.ibm.math.BigDecimal("999e-999999998"),mce).toString()).equals("999E-999999999"); - (new com.ibm.math.DiagBigDecimal.Test("mul073")).ok=(opo.multiply(new com.ibm.math.BigDecimal("999e-999999997"),mce).toString()).equals("9.99E-999999996"); - (new com.ibm.math.DiagBigDecimal.Test("mul074")).ok=(opo.multiply(new com.ibm.math.BigDecimal("9999e-999999997"),mce).toString()).equals("99.99E-999999996"); - (new com.ibm.math.DiagBigDecimal.Test("mul074")).ok=(opo.multiply(new com.ibm.math.BigDecimal("99999e-999999997"),mce).toString()).equals("999.99E-999999996"); - - // test some intermediate lengths - (new com.ibm.math.DiagBigDecimal.Test("mul080")).ok=(opo.multiply(new com.ibm.math.BigDecimal("123456789"),mcs).toString()).equals("12345678.9"); - (new com.ibm.math.DiagBigDecimal.Test("mul081")).ok=(opo.multiply(new com.ibm.math.BigDecimal("12345678901234"),mcs).toString()).equals("1.23456789E+12"); - (new com.ibm.math.DiagBigDecimal.Test("mul082")).ok=(opo.multiply(new com.ibm.math.BigDecimal("123456789123456789"),mcs).toString()).equals("1.23456789E+16"); - (new com.ibm.math.DiagBigDecimal.Test("mul083")).ok=(opo.multiply(new com.ibm.math.BigDecimal("123456789"),mcfd).toString()).equals("12345678.9"); - (new com.ibm.math.DiagBigDecimal.Test("mul084")).ok=(opo.multiply(new com.ibm.math.BigDecimal("12345678901234"),mcfd).toString()).equals("1234567890123.4"); - (new com.ibm.math.DiagBigDecimal.Test("mul085")).ok=(opo.multiply(new com.ibm.math.BigDecimal("123456789123456789"),mcfd).toString()).equals("12345678912345678.9"); - - (new com.ibm.math.DiagBigDecimal.Test("mul090")).ok=((new com.ibm.math.BigDecimal("123456789")).multiply(opo,mcs).toString()).equals("12345678.9"); - (new com.ibm.math.DiagBigDecimal.Test("mul091")).ok=((new com.ibm.math.BigDecimal("12345678901234")).multiply(opo,mcs).toString()).equals("1.23456789E+12"); - (new com.ibm.math.DiagBigDecimal.Test("mul092")).ok=((new com.ibm.math.BigDecimal("123456789123456789")).multiply(opo,mcs).toString()).equals("1.23456789E+16"); - (new com.ibm.math.DiagBigDecimal.Test("mul093")).ok=((new com.ibm.math.BigDecimal("123456789")).multiply(opo,mcfd).toString()).equals("12345678.9"); - (new com.ibm.math.DiagBigDecimal.Test("mul094")).ok=((new com.ibm.math.BigDecimal("12345678901234")).multiply(opo,mcfd).toString()).equals("1234567890123.4"); - (new com.ibm.math.DiagBigDecimal.Test("mul095")).ok=((new com.ibm.math.BigDecimal("123456789123456789")).multiply(opo,mcfd).toString()).equals("12345678912345678.9"); - - // test some more edge cases and carries - (new com.ibm.math.DiagBigDecimal.Test("mul101")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9")).toString()).equals("81"); - (new com.ibm.math.DiagBigDecimal.Test("mul102")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90")).toString()).equals("810"); - (new com.ibm.math.DiagBigDecimal.Test("mul103")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900")).toString()).equals("8100"); - (new com.ibm.math.DiagBigDecimal.Test("mul104")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000")).toString()).equals("81000"); - (new com.ibm.math.DiagBigDecimal.Test("mul105")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000")).toString()).equals("810000"); - (new com.ibm.math.DiagBigDecimal.Test("mul106")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900000")).toString()).equals("8100000"); - (new com.ibm.math.DiagBigDecimal.Test("mul107")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000000")).toString()).equals("81000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul108")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000000")).toString()).equals("810000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul109")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900000000")).toString()).equals("8100000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul110")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000000000")).toString()).equals("81000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul111")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000000000")).toString()).equals("810000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul112")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900000000000")).toString()).equals("8100000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul113")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000000000000")).toString()).equals("81000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul114")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000000000000")).toString()).equals("810000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul115")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900000000000000")).toString()).equals("8100000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul116")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000000000000000")).toString()).equals("81000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul117")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000000000000000")).toString()).equals("810000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul118")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900000000000000000")).toString()).equals("8100000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul119")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000000000000000000")).toString()).equals("81000000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul120")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000000000000000000")).toString()).equals("810000000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul121")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900000000000000000000")).toString()).equals("8100000000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul122")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000000000000000000000")).toString()).equals("81000000000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul123")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000000000000000000000")).toString()).equals("810000000000000000000000"); - // test some more edge cases without carries - (new com.ibm.math.DiagBigDecimal.Test("mul131")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3")).toString()).equals("9"); - (new com.ibm.math.DiagBigDecimal.Test("mul132")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30")).toString()).equals("90"); - (new com.ibm.math.DiagBigDecimal.Test("mul133")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300")).toString()).equals("900"); - (new com.ibm.math.DiagBigDecimal.Test("mul134")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000")).toString()).equals("9000"); - (new com.ibm.math.DiagBigDecimal.Test("mul135")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000")).toString()).equals("90000"); - (new com.ibm.math.DiagBigDecimal.Test("mul136")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300000")).toString()).equals("900000"); - (new com.ibm.math.DiagBigDecimal.Test("mul137")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000000")).toString()).equals("9000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul138")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000000")).toString()).equals("90000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul139")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300000000")).toString()).equals("900000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul140")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000000000")).toString()).equals("9000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul141")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000000000")).toString()).equals("90000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul142")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300000000000")).toString()).equals("900000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul143")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000000000000")).toString()).equals("9000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul144")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000000000000")).toString()).equals("90000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul145")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300000000000000")).toString()).equals("900000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul146")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000000000000000")).toString()).equals("9000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul147")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000000000000000")).toString()).equals("90000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul148")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300000000000000000")).toString()).equals("900000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul149")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000000000000000000")).toString()).equals("9000000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul150")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000000000000000000")).toString()).equals("90000000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul151")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300000000000000000000")).toString()).equals("900000000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul152")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000000000000000000000")).toString()).equals("9000000000000000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mul153")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000000000000000000000")).toString()).equals("90000000000000000000000"); - - {try{checknull:do{ - ten.multiply((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $55){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("mul200")).ok=flag; - {try{checknull2:do{ - ten.multiply(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $56){ - flag=true; - }}/*checknull2*/ - (new com.ibm.math.DiagBigDecimal.Test("mul201")).ok=flag; - - {try{checkover:do{ - d1=new com.ibm.math.BigDecimal("-1.23456789012345E-0"); - d2=new com.ibm.math.BigDecimal("9E+999999999"); - d1.multiply(d2,mcdef); // marginal overflow - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $57){oe=$57; - flag=(oe.getMessage()).equals("Exponent Overflow: 1000000000"); - }}/*checkover*/ - (new com.ibm.math.DiagBigDecimal.Test("mul202")).ok=flag; - {try{checkover:do{ - d1=new com.ibm.math.BigDecimal("112"); - d2=new com.ibm.math.BigDecimal("9E+999999999"); - d1.multiply(d2,mce); // marginal overflow, engineering - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $58){oe=$58; - flag=(oe.getMessage()).equals("Exponent Overflow: 1000000002"); - }}/*checkover*/ - (new com.ibm.math.DiagBigDecimal.Test("mul203")).ok=flag; - - {try{checkover:do{ - d1=new com.ibm.math.BigDecimal("0.9"); - d2=new com.ibm.math.BigDecimal("1E-999999999"); - d1.multiply(d2,mcdef); // marginal negative overflow - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $59){oe=$59; - flag=(oe.getMessage()).equals("Exponent Overflow: -1000000000"); - }}/*checkover*/ - (new com.ibm.math.DiagBigDecimal.Test("mul204")).ok=flag; - {try{checkover:do{ - d1=new com.ibm.math.BigDecimal("0.9"); - d2=new com.ibm.math.BigDecimal("1E-999999999"); - d1.multiply(d2,mce); // marginal negative overflow, engineering - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $60){oe=$60; - flag=(oe.getMessage()).equals("Exponent Overflow: -1000000002"); - }}/*checkover*/ - (new com.ibm.math.DiagBigDecimal.Test("mul205")).ok=flag; - - {try{checkdigits:do{ - tenlong.multiply(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $61){ae=$61; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("mul206")).ok=flag; - {try{checkdigits:do{ - com.ibm.math.BigDecimal.TEN.multiply(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $62){ae=$62; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("mul207")).ok=flag; - - summary("multiply"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#negate} method. */ - - public void diagnegate(){ - boolean flag=false; - java.lang.ArithmeticException ae=null; - - (new com.ibm.math.DiagBigDecimal.Test("neg001")).ok=((new com.ibm.math.BigDecimal("2")).negate().toString()).equals("-2"); - (new com.ibm.math.DiagBigDecimal.Test("neg002")).ok=((new com.ibm.math.BigDecimal("-2")).negate().toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("neg003")).ok=((new com.ibm.math.BigDecimal("2.00")).negate(mcdef).toString()).equals("-2.00"); - (new com.ibm.math.DiagBigDecimal.Test("neg004")).ok=((new com.ibm.math.BigDecimal("-2.00")).negate(mcdef).toString()).equals("2.00"); - (new com.ibm.math.DiagBigDecimal.Test("neg005")).ok=((new com.ibm.math.BigDecimal("0")).negate(mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("neg006")).ok=((new com.ibm.math.BigDecimal("0.00")).negate(mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("neg007")).ok=((new com.ibm.math.BigDecimal("00.0")).negate(mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("neg008")).ok=((new com.ibm.math.BigDecimal("00")).negate(mcdef).toString()).equals("0"); - - (new com.ibm.math.DiagBigDecimal.Test("neg010")).ok=((new com.ibm.math.BigDecimal("2.00")).negate().toString()).equals("-2.00"); - (new com.ibm.math.DiagBigDecimal.Test("neg011")).ok=((new com.ibm.math.BigDecimal("-2.00")).negate().toString()).equals("2.00"); - (new com.ibm.math.DiagBigDecimal.Test("neg012")).ok=((new com.ibm.math.BigDecimal("0")).negate().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("neg013")).ok=((new com.ibm.math.BigDecimal("0.00")).negate().toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("neg014")).ok=((new com.ibm.math.BigDecimal("00.0")).negate().toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("neg015")).ok=((new com.ibm.math.BigDecimal("00.00")).negate().toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("neg016")).ok=((new com.ibm.math.BigDecimal("00")).negate().toString()).equals("0"); - - (new com.ibm.math.DiagBigDecimal.Test("neg020")).ok=((new com.ibm.math.BigDecimal("-2000000")).negate().toString()).equals("2000000"); - (new com.ibm.math.DiagBigDecimal.Test("neg021")).ok=((new com.ibm.math.BigDecimal("-2000000")).negate(mcdef).toString()).equals("2000000"); - (new com.ibm.math.DiagBigDecimal.Test("neg022")).ok=((new com.ibm.math.BigDecimal("-2000000")).negate(mc6).toString()).equals("2.00000E+6"); - (new com.ibm.math.DiagBigDecimal.Test("neg023")).ok=((new com.ibm.math.BigDecimal("2000000")).negate(mc6).toString()).equals("-2.00000E+6"); - - {try{checknull:do{ - ten.negate((com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $63){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("neg100")).ok=flag; - - {try{checkdigits:do{ - tenlong.negate(mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $64){ae=$64; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("neg101")).ok=flag; - summary("negate"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#plus} method. */ - - public void diagplus(){ - boolean flag=false; - com.ibm.math.MathContext mche1; - java.lang.ArithmeticException ae=null; - - (new com.ibm.math.DiagBigDecimal.Test("plu001")).ok=((new com.ibm.math.BigDecimal("2")).plus(mcdef).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("plu002")).ok=((new com.ibm.math.BigDecimal("-2")).plus(mcdef).toString()).equals("-2"); - (new com.ibm.math.DiagBigDecimal.Test("plu003")).ok=((new com.ibm.math.BigDecimal("2.00")).plus(mcdef).toString()).equals("2.00"); - (new com.ibm.math.DiagBigDecimal.Test("plu004")).ok=((new com.ibm.math.BigDecimal("-2.00")).plus(mcdef).toString()).equals("-2.00"); - (new com.ibm.math.DiagBigDecimal.Test("plu005")).ok=((new com.ibm.math.BigDecimal("0")).plus(mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("plu006")).ok=((new com.ibm.math.BigDecimal("0.00")).plus(mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("plu007")).ok=((new com.ibm.math.BigDecimal("00.0")).plus(mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("plu008")).ok=((new com.ibm.math.BigDecimal("00")).plus(mcdef).toString()).equals("0"); - - (new com.ibm.math.DiagBigDecimal.Test("plu010")).ok=((new com.ibm.math.BigDecimal("2")).plus().toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("plu011")).ok=((new com.ibm.math.BigDecimal("-2")).plus().toString()).equals("-2"); - (new com.ibm.math.DiagBigDecimal.Test("plu012")).ok=((new com.ibm.math.BigDecimal("2.00")).plus().toString()).equals("2.00"); - (new com.ibm.math.DiagBigDecimal.Test("plu013")).ok=((new com.ibm.math.BigDecimal("-2.00")).plus().toString()).equals("-2.00"); - (new com.ibm.math.DiagBigDecimal.Test("plu014")).ok=((new com.ibm.math.BigDecimal("0")).plus().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("plu015")).ok=((new com.ibm.math.BigDecimal("0.00")).plus().toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("plu016")).ok=((new com.ibm.math.BigDecimal("00.0")).plus().toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("plu017")).ok=((new com.ibm.math.BigDecimal("00.00")).plus().toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("plu018")).ok=((new com.ibm.math.BigDecimal("00")).plus().toString()).equals("0"); - - (new com.ibm.math.DiagBigDecimal.Test("plu020")).ok=((new com.ibm.math.BigDecimal("-2000000")).plus().toString()).equals("-2000000"); - (new com.ibm.math.DiagBigDecimal.Test("plu021")).ok=((new com.ibm.math.BigDecimal("-2000000")).plus(mcdef).toString()).equals("-2000000"); - (new com.ibm.math.DiagBigDecimal.Test("plu022")).ok=((new com.ibm.math.BigDecimal("-2000000")).plus(mc6).toString()).equals("-2.00000E+6"); - (new com.ibm.math.DiagBigDecimal.Test("plu023")).ok=((new com.ibm.math.BigDecimal("2000000")).plus(mc6).toString()).equals("2.00000E+6"); - - // try some exotic but silly rounding [format checks more varieties] - // [this mostly ensures we can set up and pass the setting] - mche1=new com.ibm.math.MathContext(1,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_HALF_EVEN); - (new com.ibm.math.DiagBigDecimal.Test("plu030")).ok=((new com.ibm.math.BigDecimal("0.24")).plus(mche1).toString()).equals("0.2"); - (new com.ibm.math.DiagBigDecimal.Test("plu031")).ok=((new com.ibm.math.BigDecimal("0.25")).plus(mche1).toString()).equals("0.2"); - (new com.ibm.math.DiagBigDecimal.Test("plu032")).ok=((new com.ibm.math.BigDecimal("0.26")).plus(mche1).toString()).equals("0.3"); - (new com.ibm.math.DiagBigDecimal.Test("plu033")).ok=((new com.ibm.math.BigDecimal("0.14")).plus(mche1).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("plu034")).ok=((new com.ibm.math.BigDecimal("0.15")).plus(mche1).toString()).equals("0.2"); - (new com.ibm.math.DiagBigDecimal.Test("plu035")).ok=((new com.ibm.math.BigDecimal("0.16")).plus(mche1).toString()).equals("0.2"); - - (new com.ibm.math.DiagBigDecimal.Test("plu040")).ok=((new com.ibm.math.BigDecimal("0.251")).plus(mche1).toString()).equals("0.3"); - (new com.ibm.math.DiagBigDecimal.Test("plu041")).ok=((new com.ibm.math.BigDecimal("0.151")).plus(mche1).toString()).equals("0.2"); - - (new com.ibm.math.DiagBigDecimal.Test("plu050")).ok=((new com.ibm.math.BigDecimal("-0.24")).plus(mche1).toString()).equals("-0.2"); - (new com.ibm.math.DiagBigDecimal.Test("plu051")).ok=((new com.ibm.math.BigDecimal("-0.25")).plus(mche1).toString()).equals("-0.2"); - (new com.ibm.math.DiagBigDecimal.Test("plu052")).ok=((new com.ibm.math.BigDecimal("-0.26")).plus(mche1).toString()).equals("-0.3"); - (new com.ibm.math.DiagBigDecimal.Test("plu053")).ok=((new com.ibm.math.BigDecimal("-0.14")).plus(mche1).toString()).equals("-0.1"); - (new com.ibm.math.DiagBigDecimal.Test("plu054")).ok=((new com.ibm.math.BigDecimal("-0.15")).plus(mche1).toString()).equals("-0.2"); - (new com.ibm.math.DiagBigDecimal.Test("plu055")).ok=((new com.ibm.math.BigDecimal("-0.16")).plus(mche1).toString()).equals("-0.2"); - - // more fixed, potential LHS swaps if done by add 0 - (new com.ibm.math.DiagBigDecimal.Test("plu060")).ok=((new com.ibm.math.BigDecimal("-56267E-10")).plus().toString()).equals("-0.0000056267"); - (new com.ibm.math.DiagBigDecimal.Test("plu061")).ok=((new com.ibm.math.BigDecimal("-56267E-5")).plus().toString()).equals("-0.56267"); - (new com.ibm.math.DiagBigDecimal.Test("plu062")).ok=((new com.ibm.math.BigDecimal("-56267E-2")).plus().toString()).equals("-562.67"); - (new com.ibm.math.DiagBigDecimal.Test("plu063")).ok=((new com.ibm.math.BigDecimal("-56267E-1")).plus().toString()).equals("-5626.7"); - (new com.ibm.math.DiagBigDecimal.Test("plu065")).ok=((new com.ibm.math.BigDecimal("-56267E-0")).plus().toString()).equals("-56267"); - - {try{checknull:do{ - ten.plus((com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $65){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("plu100")).ok=flag; - - {try{checkdigits:do{ - tenlong.plus(mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $66){ae=$66; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("plu101")).ok=flag; - summary("plus"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#pow} method. */ - - public void diagpow(){ - boolean flag; - com.ibm.math.BigDecimal x; - com.ibm.math.BigDecimal temp; - int n=0; - com.ibm.math.BigDecimal vx; - com.ibm.math.BigDecimal vn; - java.lang.ArithmeticException ae=null; - flag=true; - (new com.ibm.math.DiagBigDecimal.Test("pow001")).ok="1".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("0"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow002")).ok="0.3".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("1"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow003")).ok="0.3".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("1.00"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow004")).ok="0.09".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("2.00"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow005")).ok="0.09".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("2.000000000"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow006")).ok=("1E-8").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-8"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow007")).ok=("1E-7").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-7"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow008")).ok="0.000001".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-6"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow009")).ok="0.00001".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-5"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow010")).ok="0.0001".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-4"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow011")).ok="0.001".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-3"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow012")).ok="0.01".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-2"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow013")).ok="0.1".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-1"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow014")).ok="1".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("0"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow015")).ok="10".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("1"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow016")).ok="100000000".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("8"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow017")).ok=("1E+9").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("9"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow018")).ok=("1E+99").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("99"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow019")).ok=("1E+999999999").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("999999999"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow020")).ok=("1E+999999998").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("999999998"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow021")).ok=("1E+999999997").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("999999997"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow022")).ok=("1E+333333333").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("333333333"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow023")).ok=("1E-333333333").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-333333333"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow024")).ok=("1E-999999998").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-999999998"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow025")).ok=("1E-999999999").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-999999999"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow026")).ok="0.5".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("-1"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow027")).ok="0.25".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("-2"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow028")).ok="0.0625".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("-4"),mcdef).toString()); - - (new com.ibm.math.DiagBigDecimal.Test("pow050")).ok=((new com.ibm.math.BigDecimal("0")).pow(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("pow051")).ok=((new com.ibm.math.BigDecimal("0")).pow(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("pow052")).ok=((new com.ibm.math.BigDecimal("0")).pow(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("pow053")).ok=((new com.ibm.math.BigDecimal("1")).pow(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("pow054")).ok=((new com.ibm.math.BigDecimal("1")).pow(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("pow055")).ok=((new com.ibm.math.BigDecimal("1")).pow(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("pow056")).ok=((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("pow057")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("999999999"),mcdef).toString()).equals("1E+999999999"); - (new com.ibm.math.DiagBigDecimal.Test("pow058")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("999999998"),mcdef).toString()).equals("1E+999999998"); - (new com.ibm.math.DiagBigDecimal.Test("pow059")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("999999997"),mcdef).toString()).equals("1E+999999997"); - (new com.ibm.math.DiagBigDecimal.Test("pow060")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("333333333"),mcdef).toString()).equals("1E+333333333"); - (new com.ibm.math.DiagBigDecimal.Test("pow061")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("77"),mcdef).toString()).equals("1E+77"); - (new com.ibm.math.DiagBigDecimal.Test("pow062")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("22"),mcdef).toString()).equals("1E+22"); - (new com.ibm.math.DiagBigDecimal.Test("pow063")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-77"),mcdef).toString()).equals("1E-77"); - (new com.ibm.math.DiagBigDecimal.Test("pow064")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-22"),mcdef).toString()).equals("1E-22"); - (new com.ibm.math.DiagBigDecimal.Test("pow065")).ok=((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("-1"),mcdef).toString()).equals("0.5"); - (new com.ibm.math.DiagBigDecimal.Test("pow066")).ok=((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("-2"),mcdef).toString()).equals("0.25"); - (new com.ibm.math.DiagBigDecimal.Test("pow067")).ok=((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("-4"),mcdef).toString()).equals("0.0625"); - (new com.ibm.math.DiagBigDecimal.Test("pow068")).ok=((new com.ibm.math.BigDecimal("6.0")).pow(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("36"); - (new com.ibm.math.DiagBigDecimal.Test("pow069")).ok=((new com.ibm.math.BigDecimal("-3")).pow(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("9");/* from book */ - (new com.ibm.math.DiagBigDecimal.Test("pow070")).ok=((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("2"),mcdef).pow(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("64");/* from book */ - - // 1998.12.14 Next test removed as pow() no longer rounds RHS [as per ANSI] - // Test('pow071').ok=BigDecimal('2').pow(BigDecimal('2.000000001'),mcdef).toString == '4'/* check input rounding */ - - /* General tests from original Rexx diagnostics */ - x=new com.ibm.math.BigDecimal("0.5"); - temp=com.ibm.math.BigDecimal.ONE; - flag=true; - {n=1;n:for(;n<=10;n++){ - temp=temp.multiply(x).divide(com.ibm.math.BigDecimal.ONE); - flag=flag&(x.pow(new com.ibm.math.BigDecimal(n),mcdef).toString()).equals(temp.toString()); - } - }/*n*/ - (new com.ibm.math.DiagBigDecimal.Test("pow080")).ok=flag; - - x=new com.ibm.math.BigDecimal("2"); - temp=com.ibm.math.BigDecimal.ONE; - flag=true; - {n=1;n:for(;n<=29;n++){ - temp=temp.multiply(x).divide(com.ibm.math.BigDecimal.ONE); - flag=flag&(x.pow(new com.ibm.math.BigDecimal(n),mcdef).toString()).equals(temp.toString()); - flag=flag&(x.pow(new com.ibm.math.BigDecimal((int)-n),mcdef).toString()).equals(com.ibm.math.BigDecimal.ONE.divide(temp,mcdef).toString()); - /* Note that rounding errors are possible for larger "n" */ - /* due to the information content of the exponent */ - } - }/*n*/ - (new com.ibm.math.DiagBigDecimal.Test("pow081")).ok=flag; - - /* The Vienna case. Checks both setup and 1/acc working precision */ - // Modified 1998.12.14 as RHS no longer rounded before use (must fit) - // Modified 1990.02.04 as LHS is now rounded (instead of truncated to guard) - vx=new com.ibm.math.BigDecimal("123456789E+10"); // lhs .. rounded to 1.23E+18 - vn=new com.ibm.math.BigDecimal("-1.23000e+2"); // rhs .. [was: -1.23455e+2, rounds to -123] - (new com.ibm.math.DiagBigDecimal.Test("pow090")).ok=(vx.pow(vn,mc3).toString()).equals("8.74E-2226"); - - //- fixed point versions --- - (new com.ibm.math.DiagBigDecimal.Test("pow101")).ok="1".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("0")).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow102")).ok="0.3".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("1")).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow103")).ok="0.3".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("1.00")).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow104")).ok="0.09".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("2")).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow105")).ok="0.09".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("2.00")).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow106")).ok="10".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("1")).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow107")).ok="100000000".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("8")).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow108")).ok="1000000000".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("9")).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow109")).ok="10000000000".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("10")).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow110")).ok="1".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("0")).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow111")).ok="16".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("4")).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow112")).ok="256".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("8")).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow113")).ok="1024".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("10")).toString()); - (new com.ibm.math.DiagBigDecimal.Test("pow114")).ok="1.0510100501".equals((new com.ibm.math.BigDecimal("1.01")).pow(new com.ibm.math.BigDecimal("5")).toString()); - - (new com.ibm.math.DiagBigDecimal.Test("pow120")).ok=((new com.ibm.math.BigDecimal("0")).pow(new com.ibm.math.BigDecimal("0")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("pow121")).ok=((new com.ibm.math.BigDecimal("0")).pow(new com.ibm.math.BigDecimal("1")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("pow122")).ok=((new com.ibm.math.BigDecimal("0")).pow(new com.ibm.math.BigDecimal("2")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("pow123")).ok=((new com.ibm.math.BigDecimal("1")).pow(new com.ibm.math.BigDecimal("0")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("pow144")).ok=((new com.ibm.math.BigDecimal("1")).pow(new com.ibm.math.BigDecimal("1")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("pow125")).ok=((new com.ibm.math.BigDecimal("1")).pow(new com.ibm.math.BigDecimal("2")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("pow126")).ok=((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("0")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("pow127")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("7")).toString()).equals("10000000"); - (new com.ibm.math.DiagBigDecimal.Test("pow128")).ok=((new com.ibm.math.BigDecimal("6.0")).pow(new com.ibm.math.BigDecimal("2")).toString()).equals("36.00"); - (new com.ibm.math.DiagBigDecimal.Test("pow129")).ok=((new com.ibm.math.BigDecimal("6.00")).pow(new com.ibm.math.BigDecimal("2")).toString()).equals("36.0000"); - (new com.ibm.math.DiagBigDecimal.Test("pow130")).ok=((new com.ibm.math.BigDecimal("6.000")).pow(new com.ibm.math.BigDecimal("2")).toString()).equals("36.000000"); - (new com.ibm.math.DiagBigDecimal.Test("pow131")).ok=((new com.ibm.math.BigDecimal("-3")).pow(new com.ibm.math.BigDecimal("2")).toString()).equals("9"); - (new com.ibm.math.DiagBigDecimal.Test("pow132")).ok=((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("3")).toString()).equals("64"); - - /* errors */ - {try{checknull:do{ - ten.pow((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $67){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("pow150")).ok=flag; - {try{checknull2:do{ - ten.pow(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $68){ - flag=true; - }}/*checknull2*/ - (new com.ibm.math.DiagBigDecimal.Test("pow151")).ok=flag; - - flag=true; - {try{checkdigits:do{ - tenlong.pow(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $69){ae=$69; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("pow152")).ok=flag; - - {try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.pow(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $70){ae=$70; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("pow153")).ok=flag; - - {try{checkpos:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("-71")); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $71){ae=$71; - flag=(ae.getMessage()).equals("Negative power: -71"); - }}/*checkpos*/ - (new com.ibm.math.DiagBigDecimal.Test("pow154")).ok=flag; - - {try{checkwhole:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("1234"),mc3); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $72){ae=$72; - flag=(ae.getMessage()).equals("Too many digits: 1234"); - }}/*checkwhole*/ - (new com.ibm.math.DiagBigDecimal.Test("pow155")).ok=flag; - - {try{checkwhole1:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("12.34e+2"),mc3); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $73){ae=$73; - flag=(ae.getMessage()).equals("Too many digits: 1.234E+3"); - }}/*checkwhole1*/ - (new com.ibm.math.DiagBigDecimal.Test("pow156")).ok=flag; - - {try{checkwhole2:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("12.4"),mcdef); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $74){ae=$74; - flag=(ae.getMessage()).equals("Decimal part non-zero: 12.4"); - }}/*checkwhole2*/ - (new com.ibm.math.DiagBigDecimal.Test("pow157")).ok=flag; - - {try{checkwhole3:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("1.01"),mcdef); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $75){ae=$75; - flag=(ae.getMessage()).equals("Decimal part non-zero: 1.01"); - }}/*checkwhole3*/ - (new com.ibm.math.DiagBigDecimal.Test("pow158")).ok=flag; - - {try{checkwhole4:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("1.000000001"),mcdef); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $76){ae=$76; - flag=(ae.getMessage()).equals("Decimal part non-zero: 1.000000001"); - }}/*checkwhole4*/ - (new com.ibm.math.DiagBigDecimal.Test("pow159")).ok=flag; - - {try{checkwhole5:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("1.000000001"),mc3); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $77){ae=$77; - flag=(ae.getMessage()).equals("Decimal part non-zero: 1.000000001"); - }}/*checkwhole5*/ - (new com.ibm.math.DiagBigDecimal.Test("pow160")).ok=flag; - - {try{checkwhole6:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("5.67E-987654321"),mc3); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $78){ae=$78; - flag=(ae.getMessage()).equals("Decimal part non-zero: 5.67E-987654321"); - }}/*checkwhole6*/ - (new com.ibm.math.DiagBigDecimal.Test("pow161")).ok=flag; - - summary("pow"); - return;} - - /*--------------------------------------------------------------------*/ - - /** Test the {@link BigDecimal#remainder} method. */ - - public void diagremainder(){ - boolean flag=false; - java.lang.ArithmeticException ae=null; - - (new com.ibm.math.DiagBigDecimal.Test("rem001")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("rem002")).ok=((new com.ibm.math.BigDecimal("5")).remainder(new com.ibm.math.BigDecimal("5"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("rem003")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("10"),mcdef).toString()).equals("3"); - (new com.ibm.math.DiagBigDecimal.Test("rem004")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("50"),mcdef).toString()).equals("13"); - (new com.ibm.math.DiagBigDecimal.Test("rem005")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("100"),mcdef).toString()).equals("13"); - (new com.ibm.math.DiagBigDecimal.Test("rem006")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("1000"),mcdef).toString()).equals("13"); - (new com.ibm.math.DiagBigDecimal.Test("rem007")).ok=((new com.ibm.math.BigDecimal(".13")).remainder(one).toString()).equals("0.13"); - (new com.ibm.math.DiagBigDecimal.Test("rem008")).ok=((new com.ibm.math.BigDecimal("0.133")).remainder(one).toString()).equals("0.133"); - (new com.ibm.math.DiagBigDecimal.Test("rem009")).ok=((new com.ibm.math.BigDecimal("0.1033")).remainder(one).toString()).equals("0.1033"); - (new com.ibm.math.DiagBigDecimal.Test("rem010")).ok=((new com.ibm.math.BigDecimal("1.033")).remainder(one).toString()).equals("0.033"); - (new com.ibm.math.DiagBigDecimal.Test("rem011")).ok=((new com.ibm.math.BigDecimal("10.33")).remainder(one).toString()).equals("0.33"); - (new com.ibm.math.DiagBigDecimal.Test("rem012")).ok=((new com.ibm.math.BigDecimal("10.33")).remainder(com.ibm.math.BigDecimal.TEN).toString()).equals("0.33"); - (new com.ibm.math.DiagBigDecimal.Test("rem013")).ok=((new com.ibm.math.BigDecimal("103.3")).remainder(com.ibm.math.BigDecimal.ONE).toString()).equals("0.3"); - (new com.ibm.math.DiagBigDecimal.Test("rem014")).ok=((new com.ibm.math.BigDecimal("133")).remainder(com.ibm.math.BigDecimal.TEN).toString()).equals("3"); - (new com.ibm.math.DiagBigDecimal.Test("rem015")).ok=((new com.ibm.math.BigDecimal("1033")).remainder(com.ibm.math.BigDecimal.TEN).toString()).equals("3"); - (new com.ibm.math.DiagBigDecimal.Test("rem016")).ok=((new com.ibm.math.BigDecimal("1033")).remainder(new com.ibm.math.BigDecimal(50),mcdef).toString()).equals("33"); - (new com.ibm.math.DiagBigDecimal.Test("rem017")).ok=((new com.ibm.math.BigDecimal("101.0")).remainder(new com.ibm.math.BigDecimal(3),mcdef).toString()).equals("2.0"); - (new com.ibm.math.DiagBigDecimal.Test("rem018")).ok=((new com.ibm.math.BigDecimal("102.0")).remainder(new com.ibm.math.BigDecimal(3),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("rem019")).ok=((new com.ibm.math.BigDecimal("103.0")).remainder(new com.ibm.math.BigDecimal(3),mcdef).toString()).equals("1.0"); - (new com.ibm.math.DiagBigDecimal.Test("rem020")).ok=((new com.ibm.math.BigDecimal("2.40")).remainder(one).toString()).equals("0.40"); - (new com.ibm.math.DiagBigDecimal.Test("rem021")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(one).toString()).equals("0.400"); - (new com.ibm.math.DiagBigDecimal.Test("rem022")).ok=((new com.ibm.math.BigDecimal("2.4")).remainder(one).toString()).equals("0.4"); - (new com.ibm.math.DiagBigDecimal.Test("rem023")).ok=((new com.ibm.math.BigDecimal("2.4")).remainder(new com.ibm.math.BigDecimal(2),mcdef).toString()).equals("0.4"); - (new com.ibm.math.DiagBigDecimal.Test("rem024")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(new com.ibm.math.BigDecimal(2),mcdef).toString()).equals("0.400"); - (new com.ibm.math.DiagBigDecimal.Test("rem025")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("rem026")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.30"),mcdef).toString()).equals("0.10"); - (new com.ibm.math.DiagBigDecimal.Test("rem027")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.300"),mcdef).toString()).equals("0.100"); - (new com.ibm.math.DiagBigDecimal.Test("rem028")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.3000"),mcdef).toString()).equals("0.1000"); - (new com.ibm.math.DiagBigDecimal.Test("rem029")).ok=((new com.ibm.math.BigDecimal("1.0")).remainder(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("rem030")).ok=((new com.ibm.math.BigDecimal("1.00")).remainder(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.10"); - (new com.ibm.math.DiagBigDecimal.Test("rem031")).ok=((new com.ibm.math.BigDecimal("1.000")).remainder(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.100"); - (new com.ibm.math.DiagBigDecimal.Test("rem032")).ok=((new com.ibm.math.BigDecimal("1.0000")).remainder(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.1000"); - (new com.ibm.math.DiagBigDecimal.Test("rem033")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("2.001"),mcdef).toString()).equals("0.5"); - - (new com.ibm.math.DiagBigDecimal.Test("rem040")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.5000001"),mcdef).toString()).equals("0.5"); - (new com.ibm.math.DiagBigDecimal.Test("rem041")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.50000001"),mcdef).toString()).equals("0.5"); - (new com.ibm.math.DiagBigDecimal.Test("rem042")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.500000001"),mcdef).toString()).equals("0.5"); - (new com.ibm.math.DiagBigDecimal.Test("rem043")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.5000000001"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("rem044")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.50000000001"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("rem045")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.4999999"),mcdef).toString()).equals("1E-7"); - (new com.ibm.math.DiagBigDecimal.Test("rem046")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.49999999"),mcdef).toString()).equals("1E-8"); - (new com.ibm.math.DiagBigDecimal.Test("rem047")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.499999999"),mcdef).toString()).equals("1E-9"); - (new com.ibm.math.DiagBigDecimal.Test("rem048")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.4999999999"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("rem049")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.49999999999"),mcdef).toString()).equals("0"); - - (new com.ibm.math.DiagBigDecimal.Test("rem050")).ok=((new com.ibm.math.BigDecimal("0.03")).remainder(new com.ibm.math.BigDecimal("7"),mcdef).toString()).equals("0.03"); - (new com.ibm.math.DiagBigDecimal.Test("rem051")).ok=((new com.ibm.math.BigDecimal("5")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("rem052")).ok=((new com.ibm.math.BigDecimal("4.1")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("rem053")).ok=((new com.ibm.math.BigDecimal("4.01")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0.01"); - (new com.ibm.math.DiagBigDecimal.Test("rem054")).ok=((new com.ibm.math.BigDecimal("4.001")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0.001"); - (new com.ibm.math.DiagBigDecimal.Test("rem055")).ok=((new com.ibm.math.BigDecimal("4.0001")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0.0001"); - (new com.ibm.math.DiagBigDecimal.Test("rem056")).ok=((new com.ibm.math.BigDecimal("4.00001")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0.00001"); - (new com.ibm.math.DiagBigDecimal.Test("rem057")).ok=((new com.ibm.math.BigDecimal("4.000001")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0.000001"); - (new com.ibm.math.DiagBigDecimal.Test("rem058")).ok=((new com.ibm.math.BigDecimal("4.0000001")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1E-7"); - - (new com.ibm.math.DiagBigDecimal.Test("rem060")).ok=((new com.ibm.math.BigDecimal("1.2")).remainder(new com.ibm.math.BigDecimal("0.7345"),mcdef).toString()).equals("0.4655"); - (new com.ibm.math.DiagBigDecimal.Test("rem061")).ok=((new com.ibm.math.BigDecimal("0.8")).remainder(new com.ibm.math.BigDecimal("12"),mcdef).toString()).equals("0.8"); - (new com.ibm.math.DiagBigDecimal.Test("rem062")).ok=((new com.ibm.math.BigDecimal("0.8")).remainder(new com.ibm.math.BigDecimal("0.2"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("rem063")).ok=((new com.ibm.math.BigDecimal("0.8")).remainder(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.2"); - (new com.ibm.math.DiagBigDecimal.Test("rem064")).ok=((new com.ibm.math.BigDecimal("0.800")).remainder(new com.ibm.math.BigDecimal("12"),mcdef).toString()).equals("0.800"); - (new com.ibm.math.DiagBigDecimal.Test("rem065")).ok=((new com.ibm.math.BigDecimal("0.800")).remainder(new com.ibm.math.BigDecimal("1.7"),mcdef).toString()).equals("0.800"); - (new com.ibm.math.DiagBigDecimal.Test("rem066")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(new com.ibm.math.BigDecimal(2),mcdef).toString()).equals("0.400"); - - // MC -- - (new com.ibm.math.DiagBigDecimal.Test("rem071")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(new com.ibm.math.BigDecimal(2),mc6).toString()).equals("0.400"); - (new com.ibm.math.DiagBigDecimal.Test("rem072")).ok=((new com.ibm.math.BigDecimal("12345678900000")).remainder(new com.ibm.math.BigDecimal("12e+12"),mc3).toString()).equals("3E+11"); - - // Fixed -- - (new com.ibm.math.DiagBigDecimal.Test("rem101")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("3")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("rem102")).ok=((new com.ibm.math.BigDecimal("5")).remainder(new com.ibm.math.BigDecimal("5")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("rem103")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("10")).toString()).equals("3"); - (new com.ibm.math.DiagBigDecimal.Test("rem104")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("50")).toString()).equals("13"); - (new com.ibm.math.DiagBigDecimal.Test("rem105")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("100")).toString()).equals("13"); - (new com.ibm.math.DiagBigDecimal.Test("rem106")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("1000")).toString()).equals("13"); - (new com.ibm.math.DiagBigDecimal.Test("rem107")).ok=((new com.ibm.math.BigDecimal(".13")).remainder(one).toString()).equals("0.13"); - (new com.ibm.math.DiagBigDecimal.Test("rem108")).ok=((new com.ibm.math.BigDecimal("0.133")).remainder(one).toString()).equals("0.133"); - (new com.ibm.math.DiagBigDecimal.Test("rem109")).ok=((new com.ibm.math.BigDecimal("0.1033")).remainder(one).toString()).equals("0.1033"); - (new com.ibm.math.DiagBigDecimal.Test("rem110")).ok=((new com.ibm.math.BigDecimal("1.033")).remainder(one).toString()).equals("0.033"); - (new com.ibm.math.DiagBigDecimal.Test("rem111")).ok=((new com.ibm.math.BigDecimal("10.33")).remainder(one).toString()).equals("0.33"); - (new com.ibm.math.DiagBigDecimal.Test("rem112")).ok=((new com.ibm.math.BigDecimal("10.33")).remainder(com.ibm.math.BigDecimal.TEN).toString()).equals("0.33"); - (new com.ibm.math.DiagBigDecimal.Test("rem113")).ok=((new com.ibm.math.BigDecimal("103.3")).remainder(com.ibm.math.BigDecimal.ONE).toString()).equals("0.3"); - (new com.ibm.math.DiagBigDecimal.Test("rem114")).ok=((new com.ibm.math.BigDecimal("133")).remainder(com.ibm.math.BigDecimal.TEN).toString()).equals("3"); - (new com.ibm.math.DiagBigDecimal.Test("rem115")).ok=((new com.ibm.math.BigDecimal("1033")).remainder(com.ibm.math.BigDecimal.TEN).toString()).equals("3"); - (new com.ibm.math.DiagBigDecimal.Test("rem116")).ok=((new com.ibm.math.BigDecimal("1033")).remainder(new com.ibm.math.BigDecimal(50)).toString()).equals("33"); - (new com.ibm.math.DiagBigDecimal.Test("rem117")).ok=((new com.ibm.math.BigDecimal("101.0")).remainder(new com.ibm.math.BigDecimal(3)).toString()).equals("2.0"); - (new com.ibm.math.DiagBigDecimal.Test("rem118")).ok=((new com.ibm.math.BigDecimal("102.0")).remainder(new com.ibm.math.BigDecimal(3)).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("rem119")).ok=((new com.ibm.math.BigDecimal("103.0")).remainder(new com.ibm.math.BigDecimal(3)).toString()).equals("1.0"); - (new com.ibm.math.DiagBigDecimal.Test("rem120")).ok=((new com.ibm.math.BigDecimal("2.40")).remainder(one).toString()).equals("0.40"); - (new com.ibm.math.DiagBigDecimal.Test("rem121")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(one).toString()).equals("0.400"); - (new com.ibm.math.DiagBigDecimal.Test("rem122")).ok=((new com.ibm.math.BigDecimal("2.4")).remainder(one).toString()).equals("0.4"); - (new com.ibm.math.DiagBigDecimal.Test("rem123")).ok=((new com.ibm.math.BigDecimal("2.4")).remainder(new com.ibm.math.BigDecimal(2)).toString()).equals("0.4"); - (new com.ibm.math.DiagBigDecimal.Test("rem124")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(new com.ibm.math.BigDecimal(2)).toString()).equals("0.400"); - (new com.ibm.math.DiagBigDecimal.Test("rem125")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("rem126")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.30")).toString()).equals("0.10"); - (new com.ibm.math.DiagBigDecimal.Test("rem127")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.300")).toString()).equals("0.100"); - (new com.ibm.math.DiagBigDecimal.Test("rem128")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.3000")).toString()).equals("0.1000"); - (new com.ibm.math.DiagBigDecimal.Test("rem129")).ok=((new com.ibm.math.BigDecimal("1.0")).remainder(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("rem130")).ok=((new com.ibm.math.BigDecimal("1.00")).remainder(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.10"); - (new com.ibm.math.DiagBigDecimal.Test("rem131")).ok=((new com.ibm.math.BigDecimal("1.000")).remainder(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.100"); - (new com.ibm.math.DiagBigDecimal.Test("rem132")).ok=((new com.ibm.math.BigDecimal("1.0000")).remainder(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.1000"); - (new com.ibm.math.DiagBigDecimal.Test("rem133")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("2.001")).toString()).equals("0.5"); - (new com.ibm.math.DiagBigDecimal.Test("rem134")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.500000001")).toString()).equals("0.5"); - (new com.ibm.math.DiagBigDecimal.Test("rem135")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.5000000001")).toString()).equals("0.5"); - (new com.ibm.math.DiagBigDecimal.Test("rem136")).ok=((new com.ibm.math.BigDecimal("0.03")).remainder(new com.ibm.math.BigDecimal("7")).toString()).equals("0.03"); - (new com.ibm.math.DiagBigDecimal.Test("rem137")).ok=((new com.ibm.math.BigDecimal("5")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("rem138")).ok=((new com.ibm.math.BigDecimal("4.1")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("rem139")).ok=((new com.ibm.math.BigDecimal("4.01")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.01"); - (new com.ibm.math.DiagBigDecimal.Test("rem140")).ok=((new com.ibm.math.BigDecimal("4.001")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.001"); - (new com.ibm.math.DiagBigDecimal.Test("rem141")).ok=((new com.ibm.math.BigDecimal("4.0001")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.0001"); - (new com.ibm.math.DiagBigDecimal.Test("rem142")).ok=((new com.ibm.math.BigDecimal("4.00001")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.00001"); - (new com.ibm.math.DiagBigDecimal.Test("rem143")).ok=((new com.ibm.math.BigDecimal("4.000001")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.000001"); - (new com.ibm.math.DiagBigDecimal.Test("rem144")).ok=((new com.ibm.math.BigDecimal("4.0000001")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.0000001"); // 1E-7, plain - (new com.ibm.math.DiagBigDecimal.Test("rem145")).ok=((new com.ibm.math.BigDecimal("1.2")).remainder(new com.ibm.math.BigDecimal("0.7345")).toString()).equals("0.4655"); - (new com.ibm.math.DiagBigDecimal.Test("rem146")).ok=((new com.ibm.math.BigDecimal("0.8")).remainder(new com.ibm.math.BigDecimal("12")).toString()).equals("0.8"); - (new com.ibm.math.DiagBigDecimal.Test("rem147")).ok=((new com.ibm.math.BigDecimal("0.8")).remainder(new com.ibm.math.BigDecimal("0.2")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("rem148")).ok=((new com.ibm.math.BigDecimal("0.8")).remainder(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.2"); - (new com.ibm.math.DiagBigDecimal.Test("rem149")).ok=((new com.ibm.math.BigDecimal("0.800")).remainder(new com.ibm.math.BigDecimal("12")).toString()).equals("0.800"); - (new com.ibm.math.DiagBigDecimal.Test("rem150")).ok=((new com.ibm.math.BigDecimal("0.800")).remainder(new com.ibm.math.BigDecimal("1.7")).toString()).equals("0.800"); - (new com.ibm.math.DiagBigDecimal.Test("rem151")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(new com.ibm.math.BigDecimal(2),mcdef).toString()).equals("0.400"); - - {try{checknull:do{ - ten.remainder((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $79){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("rem200")).ok=flag; - {try{checknull2:do{ - ten.remainder(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $80){ - flag=true; - }}/*checknull2*/ - (new com.ibm.math.DiagBigDecimal.Test("rem201")).ok=flag; - - {try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.remainder(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $81){ae=$81; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("rem202")).ok=flag; - - {try{checkdigits:do{ - tenlong.remainder(one,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $82){ae=$82; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("rem203")).ok=flag; - - summary("remainder"); - return;} -/*--------------------------------------------------------------------*/ - - /** Test the {@link BigDecimal#subtract} method. */ - - public void diagsubtract(){ - boolean flag=false; - com.ibm.math.BigDecimal alhs; - com.ibm.math.BigDecimal arhs; - java.lang.ArithmeticException ae=null; - - // [first group are 'quick confidence check'] - (new com.ibm.math.DiagBigDecimal.Test("sub301")).ok=((new com.ibm.math.BigDecimal(2)).subtract(new com.ibm.math.BigDecimal(3),mcdef).toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("sub302")).ok=((new com.ibm.math.BigDecimal("5.75")).subtract(new com.ibm.math.BigDecimal("3.3"),mcdef).toString()).equals("2.45"); - (new com.ibm.math.DiagBigDecimal.Test("sub303")).ok=((new com.ibm.math.BigDecimal("5")).subtract(new com.ibm.math.BigDecimal("-3"),mcdef).toString()).equals("8"); - (new com.ibm.math.DiagBigDecimal.Test("sub304")).ok=((new com.ibm.math.BigDecimal("-5")).subtract(new com.ibm.math.BigDecimal("-3"),mcdef).toString()).equals("-2"); - (new com.ibm.math.DiagBigDecimal.Test("sub305")).ok=((new com.ibm.math.BigDecimal("-7")).subtract(new com.ibm.math.BigDecimal("2.5"),mcdef).toString()).equals("-9.5"); - (new com.ibm.math.DiagBigDecimal.Test("sub306")).ok=((new com.ibm.math.BigDecimal("0.7")).subtract(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.4"); - (new com.ibm.math.DiagBigDecimal.Test("sub307")).ok=((new com.ibm.math.BigDecimal("1.3")).subtract(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("1.0"); - (new com.ibm.math.DiagBigDecimal.Test("sub308")).ok=((new com.ibm.math.BigDecimal("1.25")).subtract(new com.ibm.math.BigDecimal("1.25"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("sub309")).ok=((new com.ibm.math.BigDecimal("1.23456789")).subtract(new com.ibm.math.BigDecimal("1.00000000"),mcdef).toString()).equals("0.23456789"); - - (new com.ibm.math.DiagBigDecimal.Test("sub310")).ok=((new com.ibm.math.BigDecimal("1.23456789")).subtract(new com.ibm.math.BigDecimal("1.00000089"),mcdef).toString()).equals("0.23456700"); - - (new com.ibm.math.DiagBigDecimal.Test("sub311")).ok=((new com.ibm.math.BigDecimal("0.5555555559")).subtract(new com.ibm.math.BigDecimal("0.0000000001"),mcdef).toString()).equals("0.555555556"); - - (new com.ibm.math.DiagBigDecimal.Test("sub312")).ok=((new com.ibm.math.BigDecimal("0.5555555559")).subtract(new com.ibm.math.BigDecimal("0.0000000005"),mcdef).toString()).equals("0.555555556"); - - (new com.ibm.math.DiagBigDecimal.Test("sub313")).ok=((new com.ibm.math.BigDecimal("0.4444444444")).subtract(new com.ibm.math.BigDecimal("0.1111111111"),mcdef).toString()).equals("0.333333333"); - - (new com.ibm.math.DiagBigDecimal.Test("sub314")).ok=((new com.ibm.math.BigDecimal("1.0000000000")).subtract(new com.ibm.math.BigDecimal("0.00000001"),mcdef).toString()).equals("0.99999999"); - - (new com.ibm.math.DiagBigDecimal.Test("sub315")).ok=((new com.ibm.math.BigDecimal("0.4444444444999")).subtract(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("0.444444444"); - - (new com.ibm.math.DiagBigDecimal.Test("sub316")).ok=((new com.ibm.math.BigDecimal("0.4444444445000")).subtract(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("0.444444445"); - - - (new com.ibm.math.DiagBigDecimal.Test("sub317")).ok=((new com.ibm.math.BigDecimal("70")).subtract(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("-1.00000000E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("sub318")).ok=((new com.ibm.math.BigDecimal("700")).subtract(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("-1.00000000E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("sub319")).ok=((new com.ibm.math.BigDecimal("7000")).subtract(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("-1.00000000E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("sub320")).ok=((new com.ibm.math.BigDecimal("70000")).subtract(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("-9.9999999E+12"); - - (new com.ibm.math.DiagBigDecimal.Test("sub321")).ok=((new com.ibm.math.BigDecimal("700000")).subtract(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("-9.9999993E+12"); - - // symmetry: - (new com.ibm.math.DiagBigDecimal.Test("sub322")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("70"),mcdef).toString()).equals("1.00000000E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("sub323")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("700"),mcdef).toString()).equals("1.00000000E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("sub324")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("7000"),mcdef).toString()).equals("1.00000000E+13"); - - (new com.ibm.math.DiagBigDecimal.Test("sub325")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("70000"),mcdef).toString()).equals("9.9999999E+12"); - - (new com.ibm.math.DiagBigDecimal.Test("sub326")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("700000"),mcdef).toString()).equals("9.9999993E+12"); - - - // [same with fixed point arithmetic] - (new com.ibm.math.DiagBigDecimal.Test("sub001")).ok=((new com.ibm.math.BigDecimal(2)).subtract(new com.ibm.math.BigDecimal(3)).toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("sub002")).ok=((new com.ibm.math.BigDecimal("5.75")).subtract(new com.ibm.math.BigDecimal("3.3")).toString()).equals("2.45"); - (new com.ibm.math.DiagBigDecimal.Test("sub003")).ok=((new com.ibm.math.BigDecimal("5")).subtract(new com.ibm.math.BigDecimal("-3")).toString()).equals("8"); - (new com.ibm.math.DiagBigDecimal.Test("sub004")).ok=((new com.ibm.math.BigDecimal("-5")).subtract(new com.ibm.math.BigDecimal("-3")).toString()).equals("-2"); - (new com.ibm.math.DiagBigDecimal.Test("sub005")).ok=((new com.ibm.math.BigDecimal("-7")).subtract(new com.ibm.math.BigDecimal("2.5")).toString()).equals("-9.5"); - (new com.ibm.math.DiagBigDecimal.Test("sub006")).ok=((new com.ibm.math.BigDecimal("0.7")).subtract(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.4"); - (new com.ibm.math.DiagBigDecimal.Test("sub007")).ok=((new com.ibm.math.BigDecimal("1.3")).subtract(new com.ibm.math.BigDecimal("0.3")).toString()).equals("1.0"); - (new com.ibm.math.DiagBigDecimal.Test("sub008")).ok=((new com.ibm.math.BigDecimal("1.25")).subtract(new com.ibm.math.BigDecimal("1.25")).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("sub009")).ok=((new com.ibm.math.BigDecimal("0.02")).subtract(new com.ibm.math.BigDecimal("0.02")).toString()).equals("0.00"); - - (new com.ibm.math.DiagBigDecimal.Test("sub010")).ok=((new com.ibm.math.BigDecimal("1.23456789")).subtract(new com.ibm.math.BigDecimal("1.00000000")).toString()).equals("0.23456789"); - - (new com.ibm.math.DiagBigDecimal.Test("sub011")).ok=((new com.ibm.math.BigDecimal("1.23456789")).subtract(new com.ibm.math.BigDecimal("1.00000089")).toString()).equals("0.23456700"); - - (new com.ibm.math.DiagBigDecimal.Test("sub012")).ok=((new com.ibm.math.BigDecimal("0.5555555559")).subtract(new com.ibm.math.BigDecimal("0.0000000001")).toString()).equals("0.5555555558"); - - (new com.ibm.math.DiagBigDecimal.Test("sub013")).ok=((new com.ibm.math.BigDecimal("0.5555555559")).subtract(new com.ibm.math.BigDecimal("0.0000000005")).toString()).equals("0.5555555554"); - - (new com.ibm.math.DiagBigDecimal.Test("sub014")).ok=((new com.ibm.math.BigDecimal("0.4444444444")).subtract(new com.ibm.math.BigDecimal("0.1111111111")).toString()).equals("0.3333333333"); - - (new com.ibm.math.DiagBigDecimal.Test("sub015")).ok=((new com.ibm.math.BigDecimal("1.0000000000")).subtract(new com.ibm.math.BigDecimal("0.00000001")).toString()).equals("0.9999999900"); - - (new com.ibm.math.DiagBigDecimal.Test("sub016")).ok=((new com.ibm.math.BigDecimal("0.4444444444999")).subtract(new com.ibm.math.BigDecimal("0")).toString()).equals("0.4444444444999"); - - (new com.ibm.math.DiagBigDecimal.Test("sub017")).ok=((new com.ibm.math.BigDecimal("0.4444444445000")).subtract(new com.ibm.math.BigDecimal("0")).toString()).equals("0.4444444445000"); - - - (new com.ibm.math.DiagBigDecimal.Test("sub018")).ok=((new com.ibm.math.BigDecimal("70")).subtract(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("-9999999999930"); - - (new com.ibm.math.DiagBigDecimal.Test("sub019")).ok=((new com.ibm.math.BigDecimal("700")).subtract(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("-9999999999300"); - - (new com.ibm.math.DiagBigDecimal.Test("sub020")).ok=((new com.ibm.math.BigDecimal("7000")).subtract(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("-9999999993000"); - - (new com.ibm.math.DiagBigDecimal.Test("sub021")).ok=((new com.ibm.math.BigDecimal("70000")).subtract(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("-9999999930000"); - - (new com.ibm.math.DiagBigDecimal.Test("sub022")).ok=((new com.ibm.math.BigDecimal("700000")).subtract(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("-9999999300000"); - - // symmetry: - (new com.ibm.math.DiagBigDecimal.Test("sub023")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("70")).toString()).equals("9999999999930"); - - (new com.ibm.math.DiagBigDecimal.Test("sub024")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("700")).toString()).equals("9999999999300"); - - (new com.ibm.math.DiagBigDecimal.Test("sub025")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("7000")).toString()).equals("9999999993000"); - - (new com.ibm.math.DiagBigDecimal.Test("sub026")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("70000")).toString()).equals("9999999930000"); - - (new com.ibm.math.DiagBigDecimal.Test("sub027")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("700000")).toString()).equals("9999999300000"); - - // MC - (new com.ibm.math.DiagBigDecimal.Test("sub030")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("70000"),mcdef).toString()).equals("9.9999999E+12"); - - (new com.ibm.math.DiagBigDecimal.Test("sub031")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("70000"),mc6).toString()).equals("1.00000E+13"); - - - // some of the next group are really constructor tests - (new com.ibm.math.DiagBigDecimal.Test("sub040")).ok=((new com.ibm.math.BigDecimal("00.0")).subtract(new com.ibm.math.BigDecimal("0.0")).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("sub041")).ok=((new com.ibm.math.BigDecimal("00.0")).subtract(new com.ibm.math.BigDecimal("0.00")).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("sub042")).ok=((new com.ibm.math.BigDecimal("0.00")).subtract(new com.ibm.math.BigDecimal("00.0")).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("sub043")).ok=((new com.ibm.math.BigDecimal("00.0")).subtract(new com.ibm.math.BigDecimal("0.00"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("sub044")).ok=((new com.ibm.math.BigDecimal("0.00")).subtract(new com.ibm.math.BigDecimal("00.0"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("sub045")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("2.7"); - (new com.ibm.math.DiagBigDecimal.Test("sub046")).ok=((new com.ibm.math.BigDecimal("3.")).subtract(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("2.7"); - (new com.ibm.math.DiagBigDecimal.Test("sub047")).ok=((new com.ibm.math.BigDecimal("3.0")).subtract(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("2.7"); - (new com.ibm.math.DiagBigDecimal.Test("sub048")).ok=((new com.ibm.math.BigDecimal("3.00")).subtract(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("2.70"); - (new com.ibm.math.DiagBigDecimal.Test("sub049")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("sub050")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal("+3"),mcdef).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("sub051")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal("-3"),mcdef).toString()).equals("6"); - (new com.ibm.math.DiagBigDecimal.Test("sub052")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal(".3")).toString()).equals("2.7"); - (new com.ibm.math.DiagBigDecimal.Test("sub053")).ok=((new com.ibm.math.BigDecimal("3.")).subtract(new com.ibm.math.BigDecimal(".3")).toString()).equals("2.7"); - (new com.ibm.math.DiagBigDecimal.Test("sub054")).ok=((new com.ibm.math.BigDecimal("3.0")).subtract(new com.ibm.math.BigDecimal(".3")).toString()).equals("2.7"); - (new com.ibm.math.DiagBigDecimal.Test("sub055")).ok=((new com.ibm.math.BigDecimal("3.00")).subtract(new com.ibm.math.BigDecimal(".3")).toString()).equals("2.70"); - (new com.ibm.math.DiagBigDecimal.Test("sub056")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal("3")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("sub057")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal("+3")).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("sub058")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal("-3")).toString()).equals("6"); - - // the above all from add; massaged and extended. Now some new ones... - // [particularly important for comparisons] - // NB: -1E-7 below were non-exponents pre-ANSI - (new com.ibm.math.DiagBigDecimal.Test("sub080")).ok=("-1E-7").equals((new com.ibm.math.BigDecimal("10.23456784")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub081")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456785")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub082")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456786")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub083")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456787")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub084")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456788")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub085")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456789")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub086")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456790")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub087")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456791")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub088")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456792")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub089")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456793")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub090")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456794")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub091")).ok=("-1E-7").equals((new com.ibm.math.BigDecimal("10.23456781")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub092")).ok=("-1E-7").equals((new com.ibm.math.BigDecimal("10.23456782")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub093")).ok=("-1E-7").equals((new com.ibm.math.BigDecimal("10.23456783")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub094")).ok=("-1E-7").equals((new com.ibm.math.BigDecimal("10.23456784")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub095")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456785")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub096")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456786")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub097")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456787")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub098")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456788")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub099")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456789")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub100")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456790")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub101")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456791")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub102")).ok="0".equals(com.ibm.math.BigDecimal.ONE.subtract(new com.ibm.math.BigDecimal("0.999999999"),mcdef).toString()); - (new com.ibm.math.DiagBigDecimal.Test("sub103")).ok="0".equals((new com.ibm.math.BigDecimal("0.999999999")).subtract(com.ibm.math.BigDecimal.ONE,mcdef).toString()); - - alhs=new com.ibm.math.BigDecimal("12345678900000"); - arhs=new com.ibm.math.BigDecimal("9999999999999"); - (new com.ibm.math.DiagBigDecimal.Test("sub110")).ok=(alhs.subtract(arhs,mc3).toString()).equals("2.3E+12"); - (new com.ibm.math.DiagBigDecimal.Test("sub111")).ok=(arhs.subtract(alhs,mc3).toString()).equals("-2.3E+12"); - (new com.ibm.math.DiagBigDecimal.Test("sub112")).ok=(alhs.subtract(arhs).toString()).equals("2345678900001"); - (new com.ibm.math.DiagBigDecimal.Test("sub113")).ok=(arhs.subtract(alhs).toString()).equals("-2345678900001"); - - // additional scaled arithmetic tests [0.97 problem] - (new com.ibm.math.DiagBigDecimal.Test("sub120")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".1")).toString()).equals("-0.1"); - (new com.ibm.math.DiagBigDecimal.Test("sub121")).ok=((new com.ibm.math.BigDecimal("00")).subtract(new com.ibm.math.BigDecimal(".97983")).toString()).equals("-0.97983"); - (new com.ibm.math.DiagBigDecimal.Test("sub122")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".9")).toString()).equals("-0.9"); - (new com.ibm.math.DiagBigDecimal.Test("sub123")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("0.102")).toString()).equals("-0.102"); - (new com.ibm.math.DiagBigDecimal.Test("sub124")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".4")).toString()).equals("-0.4"); - (new com.ibm.math.DiagBigDecimal.Test("sub125")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".307")).toString()).equals("-0.307"); - (new com.ibm.math.DiagBigDecimal.Test("sub126")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".43822")).toString()).equals("-0.43822"); - (new com.ibm.math.DiagBigDecimal.Test("sub127")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".911")).toString()).equals("-0.911"); - (new com.ibm.math.DiagBigDecimal.Test("sub128")).ok=((new com.ibm.math.BigDecimal(".0")).subtract(new com.ibm.math.BigDecimal(".02")).toString()).equals("-0.02"); - (new com.ibm.math.DiagBigDecimal.Test("sub129")).ok=((new com.ibm.math.BigDecimal("00")).subtract(new com.ibm.math.BigDecimal(".392")).toString()).equals("-0.392"); - (new com.ibm.math.DiagBigDecimal.Test("sub130")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".26")).toString()).equals("-0.26"); - (new com.ibm.math.DiagBigDecimal.Test("sub131")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("0.51")).toString()).equals("-0.51"); - (new com.ibm.math.DiagBigDecimal.Test("sub132")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".2234")).toString()).equals("-0.2234"); - (new com.ibm.math.DiagBigDecimal.Test("sub133")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".2")).toString()).equals("-0.2"); - (new com.ibm.math.DiagBigDecimal.Test("sub134")).ok=((new com.ibm.math.BigDecimal(".0")).subtract(new com.ibm.math.BigDecimal(".0008")).toString()).equals("-0.0008"); - // 0. on left - (new com.ibm.math.DiagBigDecimal.Test("sub140")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.1")).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("sub141")).ok=((new com.ibm.math.BigDecimal("0.00")).subtract(new com.ibm.math.BigDecimal("-.97983")).toString()).equals("0.97983"); - (new com.ibm.math.DiagBigDecimal.Test("sub142")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.9")).toString()).equals("0.9"); - (new com.ibm.math.DiagBigDecimal.Test("sub143")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-0.102")).toString()).equals("0.102"); - (new com.ibm.math.DiagBigDecimal.Test("sub144")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.4")).toString()).equals("0.4"); - (new com.ibm.math.DiagBigDecimal.Test("sub145")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.307")).toString()).equals("0.307"); - (new com.ibm.math.DiagBigDecimal.Test("sub146")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.43822")).toString()).equals("0.43822"); - (new com.ibm.math.DiagBigDecimal.Test("sub147")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.911")).toString()).equals("0.911"); - (new com.ibm.math.DiagBigDecimal.Test("sub148")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.02")).toString()).equals("0.02"); - (new com.ibm.math.DiagBigDecimal.Test("sub149")).ok=((new com.ibm.math.BigDecimal("0.00")).subtract(new com.ibm.math.BigDecimal("-.392")).toString()).equals("0.392"); - (new com.ibm.math.DiagBigDecimal.Test("sub150")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.26")).toString()).equals("0.26"); - (new com.ibm.math.DiagBigDecimal.Test("sub151")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-0.51")).toString()).equals("0.51"); - (new com.ibm.math.DiagBigDecimal.Test("sub152")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.2234")).toString()).equals("0.2234"); - (new com.ibm.math.DiagBigDecimal.Test("sub153")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.2")).toString()).equals("0.2"); - (new com.ibm.math.DiagBigDecimal.Test("sub154")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.0008")).toString()).equals("0.0008"); - // negatives of same - (new com.ibm.math.DiagBigDecimal.Test("sub160")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.1")).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("sub161")).ok=((new com.ibm.math.BigDecimal("00")).subtract(new com.ibm.math.BigDecimal("-.97983")).toString()).equals("0.97983"); - (new com.ibm.math.DiagBigDecimal.Test("sub162")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.9")).toString()).equals("0.9"); - (new com.ibm.math.DiagBigDecimal.Test("sub163")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-0.102")).toString()).equals("0.102"); - (new com.ibm.math.DiagBigDecimal.Test("sub164")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.4")).toString()).equals("0.4"); - (new com.ibm.math.DiagBigDecimal.Test("sub165")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.307")).toString()).equals("0.307"); - (new com.ibm.math.DiagBigDecimal.Test("sub166")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.43822")).toString()).equals("0.43822"); - (new com.ibm.math.DiagBigDecimal.Test("sub167")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.911")).toString()).equals("0.911"); - (new com.ibm.math.DiagBigDecimal.Test("sub168")).ok=((new com.ibm.math.BigDecimal(".0")).subtract(new com.ibm.math.BigDecimal("-.02")).toString()).equals("0.02"); - (new com.ibm.math.DiagBigDecimal.Test("sub169")).ok=((new com.ibm.math.BigDecimal("00")).subtract(new com.ibm.math.BigDecimal("-.392")).toString()).equals("0.392"); - (new com.ibm.math.DiagBigDecimal.Test("sub170")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.26")).toString()).equals("0.26"); - (new com.ibm.math.DiagBigDecimal.Test("sub171")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-0.51")).toString()).equals("0.51"); - (new com.ibm.math.DiagBigDecimal.Test("sub172")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.2234")).toString()).equals("0.2234"); - (new com.ibm.math.DiagBigDecimal.Test("sub173")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.2")).toString()).equals("0.2"); - (new com.ibm.math.DiagBigDecimal.Test("sub174")).ok=((new com.ibm.math.BigDecimal(".0")).subtract(new com.ibm.math.BigDecimal("-.0008")).toString()).equals("0.0008"); - - // more fixed, LHS swaps [really same as testcases under add] - (new com.ibm.math.DiagBigDecimal.Test("sub180")).ok=((new com.ibm.math.BigDecimal("-56267E-10")).subtract(zero).toString()).equals("-0.0000056267"); - (new com.ibm.math.DiagBigDecimal.Test("sub181")).ok=((new com.ibm.math.BigDecimal("-56267E-5")).subtract(zero).toString()).equals("-0.56267"); - (new com.ibm.math.DiagBigDecimal.Test("sub182")).ok=((new com.ibm.math.BigDecimal("-56267E-2")).subtract(zero).toString()).equals("-562.67"); - (new com.ibm.math.DiagBigDecimal.Test("sub183")).ok=((new com.ibm.math.BigDecimal("-56267E-1")).subtract(zero).toString()).equals("-5626.7"); - (new com.ibm.math.DiagBigDecimal.Test("sub185")).ok=((new com.ibm.math.BigDecimal("-56267E-0")).subtract(zero).toString()).equals("-56267"); - - {try{checknull:do{ - ten.subtract((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $83){ - flag=true; - }}/*checknull*/ - (new com.ibm.math.DiagBigDecimal.Test("sub200")).ok=flag; - {try{checknull2:do{ - ten.subtract(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $84){ - flag=true; - }}/*checknull2*/ - (new com.ibm.math.DiagBigDecimal.Test("sub201")).ok=flag; - - {try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.subtract(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $85){ae=$85; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("sub202")).ok=flag; - {try{checkdigits:do{ - tenlong.subtract(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $86){ae=$86; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }}/*checkdigits*/ - (new com.ibm.math.DiagBigDecimal.Test("sub203")).ok=flag; - summary("subtract"); - return;} -/* ----------------------------------------------------------------- */ - - /* ----------------------------------------------------------------- */ - /* Other methods */ - /* ----------------------------------------------------------------- */ - - /** Test the BigDecimal.byteValue() method. */ - - public void diagbyteValue(){ - boolean flag=false; - java.lang.String v=null; - java.lang.ArithmeticException ae=null; - java.lang.String badstrings[]; - int i=0; - java.lang.String norm=null; - - - (new com.ibm.math.DiagBigDecimal.Test("byv001")).ok=((((byte)-128)))==((new com.ibm.math.BigDecimal("-128")).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv002")).ok=((0))==((new com.ibm.math.BigDecimal("0")).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv003")).ok=((1))==((new com.ibm.math.BigDecimal("1")).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv004")).ok=((99))==((new com.ibm.math.BigDecimal("99")).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv005")).ok=((127))==((new com.ibm.math.BigDecimal("127")).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv006")).ok=((-128))==((new com.ibm.math.BigDecimal("128")).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv007")).ok=((-127))==((new com.ibm.math.BigDecimal("129")).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv008")).ok=((127))==((new com.ibm.math.BigDecimal("-129")).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv009")).ok=((126))==((new com.ibm.math.BigDecimal("-130")).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv010")).ok=((bmax))==((new com.ibm.math.BigDecimal(bmax)).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv011")).ok=((bmin))==((new com.ibm.math.BigDecimal(bmin)).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv012")).ok=((bneg))==((new com.ibm.math.BigDecimal(bneg)).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv013")).ok=((bzer))==((new com.ibm.math.BigDecimal(bzer)).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv014")).ok=((bpos))==((new com.ibm.math.BigDecimal(bpos)).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv015")).ok=((bmin))==((new com.ibm.math.BigDecimal(bmax+1)).byteValue()); - (new com.ibm.math.DiagBigDecimal.Test("byv016")).ok=((bmax))==((new com.ibm.math.BigDecimal(bmin-1)).byteValue()); - - (new com.ibm.math.DiagBigDecimal.Test("byv021")).ok=((((byte)-128)))==((new com.ibm.math.BigDecimal("-128")).byteValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("byv022")).ok=((0))==((new com.ibm.math.BigDecimal("0")).byteValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("byv023")).ok=((1))==((new com.ibm.math.BigDecimal("1")).byteValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("byv024")).ok=((99))==((new com.ibm.math.BigDecimal("99")).byteValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("byv025")).ok=((127))==((new com.ibm.math.BigDecimal("127")).byteValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("byv026")).ok=((bmax))==((new com.ibm.math.BigDecimal(bmax)).byteValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("byv027")).ok=((bmin))==((new com.ibm.math.BigDecimal(bmin)).byteValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("byv028")).ok=((bneg))==((new com.ibm.math.BigDecimal(bneg)).byteValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("byv029")).ok=((bzer))==((new com.ibm.math.BigDecimal(bzer)).byteValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("byv030")).ok=((bpos))==((new com.ibm.math.BigDecimal(bpos)).byteValueExact()); - {try{ - v="-129"; - (new com.ibm.math.BigDecimal(v)).byteValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $87){ae=$87; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - }} - (new com.ibm.math.DiagBigDecimal.Test("byv100")).ok=flag; - {try{ - v="128"; - (new com.ibm.math.BigDecimal(v)).byteValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $88){ae=$88; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - }} - (new com.ibm.math.DiagBigDecimal.Test("byv101")).ok=flag; - {try{ - v="1.5"; - (new com.ibm.math.BigDecimal(v)).byteValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $89){ae=$89; - flag=(ae.getMessage()).equals("Decimal part non-zero:"+" "+v); - }} - (new com.ibm.math.DiagBigDecimal.Test("byv102")).ok=flag; - - badstrings=new java.lang.String[]{"1234",(new com.ibm.math.BigDecimal(bmax)).add(one).toString(),(new com.ibm.math.BigDecimal(bmin)).subtract(one).toString(),"170","270","370","470","570","670","770","870","970","-170","-270","-370","-470","-570","-670","-770","-870","-970",(new com.ibm.math.BigDecimal(bmin)).multiply(two).toString(),(new com.ibm.math.BigDecimal(bmax)).multiply(two).toString(),(new com.ibm.math.BigDecimal(bmin)).multiply(ten).toString(),(new com.ibm.math.BigDecimal(bmax)).multiply(ten).toString(),"-1234"}; // 220 - // 221 - // 222 - // 223 - // 224 - // 225 - // 226 - // 227 - // 228 - // 229 - // 230 - // 231 - // 232 - // 233 - // 234 - // 235 - // 236 - // 237 - // 238 - // 239 - // 240 - // 241 - // 242 - // 243 - // 244 - // 245 - {int $90=badstrings.length;i=0;i:for(;$90>0;$90--,i++){ - {try{ - v=badstrings[i]; - (new com.ibm.math.BigDecimal(v)).byteValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $91){ae=$91; - norm=(new com.ibm.math.BigDecimal(v)).toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - }} - (new com.ibm.math.DiagBigDecimal.Test("byv"+(220+i))).ok=flag; - } - }/*i*/ - - summary("byteValue+"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#compareTo(java.lang.Object)} method. */ - - public void diagcomparetoObj(){ - boolean flag=false; - com.ibm.math.BigDecimal d; - com.ibm.math.BigDecimal long1; - com.ibm.math.BigDecimal long2; - - d=new com.ibm.math.BigDecimal(17); - (new com.ibm.math.DiagBigDecimal.Test("cto001")).ok=(d.compareTo((java.lang.Object)(new com.ibm.math.BigDecimal(66))))==(-1); - (new com.ibm.math.DiagBigDecimal.Test("cto002")).ok=(d.compareTo((java.lang.Object)((new com.ibm.math.BigDecimal(10)).add(new com.ibm.math.BigDecimal(7)))))==0; - (new com.ibm.math.DiagBigDecimal.Test("cto003")).ok=(d.compareTo((java.lang.Object)(new com.ibm.math.BigDecimal(10))))==1; - long1=new com.ibm.math.BigDecimal("12345678903"); - long2=new com.ibm.math.BigDecimal("12345678900"); - (new com.ibm.math.DiagBigDecimal.Test("cto004")).ok=(long1.compareTo((java.lang.Object)long2))==1; - (new com.ibm.math.DiagBigDecimal.Test("cto005")).ok=(long2.compareTo((java.lang.Object)long1))==(-1); - (new com.ibm.math.DiagBigDecimal.Test("cto006")).ok=(long2.compareTo((java.lang.Object)long2))==0; - {try{ - d.compareTo((java.lang.Object)null); - flag=false; - } - catch (java.lang.NullPointerException $92){ - flag=true; // should get here - }} - (new com.ibm.math.DiagBigDecimal.Test("cto101")).ok=flag; - {try{ - d.compareTo((java.lang.Object)"foo"); - flag=false; - } - catch (java.lang.ClassCastException $93){ - flag=true; // should get here - }} - (new com.ibm.math.DiagBigDecimal.Test("cto102")).ok=flag; - summary("compareTo(Obj)"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#doubleValue} method. */ - - public void diagdoublevalue(){ - java.lang.String val; - // 1999.03.07 Infinities no longer errors - val="-1"; - (new com.ibm.math.DiagBigDecimal.Test("dov001")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==((new java.lang.Double(val)).doubleValue()); - val="-0.1"; - (new com.ibm.math.DiagBigDecimal.Test("dov002")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==((new java.lang.Double(val)).doubleValue()); - val="0"; - (new com.ibm.math.DiagBigDecimal.Test("dov003")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==((new java.lang.Double(val)).doubleValue()); - val="0.1"; - (new com.ibm.math.DiagBigDecimal.Test("dov004")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==((new java.lang.Double(val)).doubleValue()); - val="1"; - (new com.ibm.math.DiagBigDecimal.Test("dov005")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==((new java.lang.Double(val)).doubleValue()); - val="1e1000"; - (new com.ibm.math.DiagBigDecimal.Test("dov006")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==java.lang.Double.POSITIVE_INFINITY; - val="-1e1000"; - (new com.ibm.math.DiagBigDecimal.Test("dov007")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==java.lang.Double.NEGATIVE_INFINITY; - summary("doubleValue"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#equals} method. */ - - public void diagequals(){ - com.ibm.math.BigDecimal d; - d=new com.ibm.math.BigDecimal(17); - (new com.ibm.math.DiagBigDecimal.Test("equ001")).ok=(!(d.equals((java.lang.Object)null))); - (new com.ibm.math.DiagBigDecimal.Test("equ002")).ok=(!(d.equals((java.lang.Object)"foo"))); - (new com.ibm.math.DiagBigDecimal.Test("equ003")).ok=(!(d.equals((java.lang.Object)(new com.ibm.math.BigDecimal(66))))); - (new com.ibm.math.DiagBigDecimal.Test("equ004")).ok=d.equals((java.lang.Object)d); - (new com.ibm.math.DiagBigDecimal.Test("equ005")).ok=d.equals((java.lang.Object)((new com.ibm.math.BigDecimal(10)).add(new com.ibm.math.BigDecimal(7)))); - summary("equals"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#floatValue} method. */ - - public void diagfloatvalue(){ - java.lang.String val; - // 1999.03.07 Infinities no longer errors - val="-1"; - (new com.ibm.math.DiagBigDecimal.Test("flv001")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==((new java.lang.Float(val)).floatValue()); - val="-0.1"; - (new com.ibm.math.DiagBigDecimal.Test("flv002")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==((new java.lang.Float(val)).floatValue()); - val="0"; - (new com.ibm.math.DiagBigDecimal.Test("flv003")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==((new java.lang.Float(val)).floatValue()); - val="0.1"; - (new com.ibm.math.DiagBigDecimal.Test("flv004")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==((new java.lang.Float(val)).floatValue()); - val="1"; - (new com.ibm.math.DiagBigDecimal.Test("flv005")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==((new java.lang.Float(val)).floatValue()); - val="1e200"; - (new com.ibm.math.DiagBigDecimal.Test("flv006")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==java.lang.Float.POSITIVE_INFINITY; - val="-1e200"; - (new com.ibm.math.DiagBigDecimal.Test("flv007")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==java.lang.Float.NEGATIVE_INFINITY; - val="1e1000"; - (new com.ibm.math.DiagBigDecimal.Test("flv008")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==java.lang.Float.POSITIVE_INFINITY; - val="-1e1000"; - (new com.ibm.math.DiagBigDecimal.Test("flv009")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==java.lang.Float.NEGATIVE_INFINITY; - summary("floatValue"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#format} method. */ - - public void diagformat(){ - boolean flag=false; - int eng; - int sci; - com.ibm.math.BigDecimal d04; - com.ibm.math.BigDecimal d05; - com.ibm.math.BigDecimal d06; - com.ibm.math.BigDecimal d15; - java.lang.IllegalArgumentException iae=null; - com.ibm.math.BigDecimal d050; - com.ibm.math.BigDecimal d150; - com.ibm.math.BigDecimal m050; - com.ibm.math.BigDecimal m150; - com.ibm.math.BigDecimal d051; - com.ibm.math.BigDecimal d151; - com.ibm.math.BigDecimal d000; - com.ibm.math.BigDecimal d500; - java.lang.ArithmeticException ae=null; - // 1999.02.09 now only two signatures for format(), so some tests below - // may now be redundant - - (new com.ibm.math.DiagBigDecimal.Test("for001")).ok=((new com.ibm.math.BigDecimal("12.3")).format(-1,-1)).equals("12.3"); - (new com.ibm.math.DiagBigDecimal.Test("for002")).ok=((new com.ibm.math.BigDecimal("-12.73")).format(-1,-1)).equals("-12.73"); - (new com.ibm.math.DiagBigDecimal.Test("for003")).ok=((new com.ibm.math.BigDecimal("0.000")).format(-1,-1)).equals("0.000"); - (new com.ibm.math.DiagBigDecimal.Test("for004")).ok=((new com.ibm.math.BigDecimal("3E+3")).format(-1,-1)).equals("3000"); - (new com.ibm.math.DiagBigDecimal.Test("for005")).ok=((new com.ibm.math.BigDecimal("3")).format(4,-1)).equals(" 3"); - (new com.ibm.math.DiagBigDecimal.Test("for006")).ok=((new com.ibm.math.BigDecimal("1.73")).format(4,0)).equals(" 2"); - (new com.ibm.math.DiagBigDecimal.Test("for007")).ok=((new com.ibm.math.BigDecimal("1.73")).format(4,1)).equals(" 1.7"); - (new com.ibm.math.DiagBigDecimal.Test("for008")).ok=((new com.ibm.math.BigDecimal("1.75")).format(4,1)).equals(" 1.8"); - (new com.ibm.math.DiagBigDecimal.Test("for009")).ok=((new com.ibm.math.BigDecimal("0.5")).format(4,1)).equals(" 0.5"); - (new com.ibm.math.DiagBigDecimal.Test("for010")).ok=((new com.ibm.math.BigDecimal("0.05")).format(4,1)).equals(" 0.1"); - (new com.ibm.math.DiagBigDecimal.Test("for011")).ok=((new com.ibm.math.BigDecimal("0.04")).format(4,1)).equals(" 0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for012")).ok=((new com.ibm.math.BigDecimal("0")).format(4,0)).equals(" 0"); - (new com.ibm.math.DiagBigDecimal.Test("for013")).ok=((new com.ibm.math.BigDecimal("0")).format(4,1)).equals(" 0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for014")).ok=((new com.ibm.math.BigDecimal("0")).format(4,2)).equals(" 0.00"); - (new com.ibm.math.DiagBigDecimal.Test("for015")).ok=((new com.ibm.math.BigDecimal("0")).format(4,3)).equals(" 0.000"); - (new com.ibm.math.DiagBigDecimal.Test("for016")).ok=((new com.ibm.math.BigDecimal("0")).format(4,4)).equals(" 0.0000"); - (new com.ibm.math.DiagBigDecimal.Test("for017")).ok=((new com.ibm.math.BigDecimal("0.005")).format(4,0)).equals(" 0"); - (new com.ibm.math.DiagBigDecimal.Test("for018")).ok=((new com.ibm.math.BigDecimal("0.005")).format(4,1)).equals(" 0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for019")).ok=((new com.ibm.math.BigDecimal("0.005")).format(4,2)).equals(" 0.01"); - (new com.ibm.math.DiagBigDecimal.Test("for020")).ok=((new com.ibm.math.BigDecimal("0.004")).format(4,2)).equals(" 0.00"); - (new com.ibm.math.DiagBigDecimal.Test("for021")).ok=((new com.ibm.math.BigDecimal("0.005")).format(4,3)).equals(" 0.005"); - (new com.ibm.math.DiagBigDecimal.Test("for022")).ok=((new com.ibm.math.BigDecimal("0.005")).format(4,4)).equals(" 0.0050"); - - (new com.ibm.math.DiagBigDecimal.Test("for023")).ok=((new com.ibm.math.BigDecimal("1.73")).format(4,2)).equals(" 1.73"); - (new com.ibm.math.DiagBigDecimal.Test("for024")).ok=((new com.ibm.math.BigDecimal("1.73")).format(4,3)).equals(" 1.730"); - (new com.ibm.math.DiagBigDecimal.Test("for025")).ok=((new com.ibm.math.BigDecimal("-.76")).format(4,1)).equals(" -0.8"); - (new com.ibm.math.DiagBigDecimal.Test("for026")).ok=((new com.ibm.math.BigDecimal("-12.73")).format(-1,4)).equals("-12.7300"); - - (new com.ibm.math.DiagBigDecimal.Test("for027")).ok=((new com.ibm.math.BigDecimal("3.03")).format(4,-1)).equals(" 3.03"); - (new com.ibm.math.DiagBigDecimal.Test("for028")).ok=((new com.ibm.math.BigDecimal("3.03")).format(4,1)).equals(" 3.0"); - (new com.ibm.math.DiagBigDecimal.Test("for029")).ok=((new com.ibm.math.BigDecimal("3.03")).format(4,-1,3,-1,-1,-1)).equals(" 3.03 "); - (new com.ibm.math.DiagBigDecimal.Test("for030")).ok=((new com.ibm.math.BigDecimal("3.03")).format(-1,-1,3,-1,-1,-1)).equals("3.03 "); - (new com.ibm.math.DiagBigDecimal.Test("for031")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,-1,-1,4,-1,-1)).equals("1.234573E+4"); - (new com.ibm.math.DiagBigDecimal.Test("for032")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,-1,-1,5,-1,-1)).equals("12345.73"); - (new com.ibm.math.DiagBigDecimal.Test("for033")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,-1,-1,6,-1,-1)).equals("12345.73"); - - (new com.ibm.math.DiagBigDecimal.Test("for034")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,8,-1,3,-1,-1)).equals("1.23457300E+4"); - (new com.ibm.math.DiagBigDecimal.Test("for035")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,7,-1,3,-1,-1)).equals("1.2345730E+4"); - (new com.ibm.math.DiagBigDecimal.Test("for036")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,6,-1,3,-1,-1)).equals("1.234573E+4"); - (new com.ibm.math.DiagBigDecimal.Test("for037")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,5,-1,3,-1,-1)).equals("1.23457E+4"); - (new com.ibm.math.DiagBigDecimal.Test("for038")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,4,-1,3,-1,-1)).equals("1.2346E+4"); - (new com.ibm.math.DiagBigDecimal.Test("for039")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,3,-1,3,-1,-1)).equals("1.235E+4"); - (new com.ibm.math.DiagBigDecimal.Test("for040")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,2,-1,3,-1,-1)).equals("1.23E+4"); - (new com.ibm.math.DiagBigDecimal.Test("for041")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,1,-1,3,-1,-1)).equals("1.2E+4"); - (new com.ibm.math.DiagBigDecimal.Test("for042")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,0,-1,3,-1,-1)).equals("1E+4"); - - (new com.ibm.math.DiagBigDecimal.Test("for043")).ok=((new com.ibm.math.BigDecimal("99999.99")).format(-1,6,-1,3,-1,-1)).equals("9.999999E+4"); - (new com.ibm.math.DiagBigDecimal.Test("for044")).ok=((new com.ibm.math.BigDecimal("99999.99")).format(-1,5,-1,3,-1,-1)).equals("1.00000E+5"); - (new com.ibm.math.DiagBigDecimal.Test("for045")).ok=((new com.ibm.math.BigDecimal("99999.99")).format(-1,2,-1,3,-1,-1)).equals("1.00E+5"); - (new com.ibm.math.DiagBigDecimal.Test("for046")).ok=((new com.ibm.math.BigDecimal("99999.99")).format(-1,0,-1,3,-1,-1)).equals("1E+5"); - (new com.ibm.math.DiagBigDecimal.Test("for047")).ok=((new com.ibm.math.BigDecimal("99999.99")).format(3,0,-1,3,-1,-1)).equals(" 1E+5"); - - (new com.ibm.math.DiagBigDecimal.Test("for048")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,-1,2,2,-1,-1)).equals("1.234573E+04"); - (new com.ibm.math.DiagBigDecimal.Test("for049")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,3,-1,0,-1,-1)).equals("1.235E+4"); - (new com.ibm.math.DiagBigDecimal.Test("for050")).ok=((new com.ibm.math.BigDecimal("1.234573")).format(-1,3,-1,0,-1,-1)).equals("1.235"); - (new com.ibm.math.DiagBigDecimal.Test("for051")).ok=((new com.ibm.math.BigDecimal("123.45")).format(-1,3,2,0,-1,-1)).equals("1.235E+02"); - - (new com.ibm.math.DiagBigDecimal.Test("for052")).ok=((new com.ibm.math.BigDecimal("0.444")).format(-1,0)).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("for053")).ok=((new com.ibm.math.BigDecimal("-0.444")).format(-1,0)).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("for054")).ok=((new com.ibm.math.BigDecimal("0.4")).format(-1,0)).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("for055")).ok=((new com.ibm.math.BigDecimal("-0.4")).format(-1,0)).equals("0"); - - eng=com.ibm.math.MathContext.ENGINEERING; - sci=com.ibm.math.MathContext.SCIENTIFIC; - (new com.ibm.math.DiagBigDecimal.Test("for060")).ok=((new com.ibm.math.BigDecimal("1234.5")).format(-1,3,2,0,eng,-1)).equals("1.235E+03"); - (new com.ibm.math.DiagBigDecimal.Test("for061")).ok=((new com.ibm.math.BigDecimal("12345")).format(-1,3,3,0,eng,-1)).equals("12.345E+003"); - (new com.ibm.math.DiagBigDecimal.Test("for062")).ok=((new com.ibm.math.BigDecimal("12345")).format(-1,3,3,0,sci,-1)).equals("1.235E+004"); - (new com.ibm.math.DiagBigDecimal.Test("for063")).ok=((new com.ibm.math.BigDecimal("1234.5")).format(4,3,2,0,eng,-1)).equals(" 1.235E+03"); - (new com.ibm.math.DiagBigDecimal.Test("for064")).ok=((new com.ibm.math.BigDecimal("12345")).format(5,3,3,0,eng,-1)).equals(" 12.345E+003"); - (new com.ibm.math.DiagBigDecimal.Test("for065")).ok=((new com.ibm.math.BigDecimal("12345")).format(6,3,3,0,sci,-1)).equals(" 1.235E+004"); - - (new com.ibm.math.DiagBigDecimal.Test("for066")).ok=((new com.ibm.math.BigDecimal("1.2345")).format(-1,3,2,0,-1,-1)).equals("1.235 "); - (new com.ibm.math.DiagBigDecimal.Test("for067")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,-1,3,6,-1,-1)).equals("12345.73 "); - (new com.ibm.math.DiagBigDecimal.Test("for068")).ok=((new com.ibm.math.BigDecimal("12345e+5")).format(-1,0)).equals("1234500000"); - (new com.ibm.math.DiagBigDecimal.Test("for069")).ok=((new com.ibm.math.BigDecimal("12345e+5")).format(-1,1)).equals("1234500000.0"); - (new com.ibm.math.DiagBigDecimal.Test("for070")).ok=((new com.ibm.math.BigDecimal("12345e+5")).format(-1,2)).equals("1234500000.00"); - (new com.ibm.math.DiagBigDecimal.Test("for071")).ok=((new com.ibm.math.BigDecimal("12345e+5")).format(-1,3)).equals("1234500000.000"); - (new com.ibm.math.DiagBigDecimal.Test("for072")).ok=((new com.ibm.math.BigDecimal("12345e+5")).format(-1,4)).equals("1234500000.0000"); - - // some from ANSI Dallas [Nov 1998] - (new com.ibm.math.DiagBigDecimal.Test("for073")).ok=((new com.ibm.math.BigDecimal("99.999")).format(-1,2,-1,2,-1,-1)).equals("100.00"); - (new com.ibm.math.DiagBigDecimal.Test("for074")).ok=((new com.ibm.math.BigDecimal("0.99999")).format(-1,4,2,2,-1,-1)).equals("1.0000 "); - - // try some rounding modes [default ROUND_HALF_UP widely tested above] - // the first few also tests that defaults are accepted for the others - d04=new com.ibm.math.BigDecimal("0.04"); - d05=new com.ibm.math.BigDecimal("0.05"); - d06=new com.ibm.math.BigDecimal("0.06"); - d15=new com.ibm.math.BigDecimal("0.15"); - (new com.ibm.math.DiagBigDecimal.Test("for080")).ok=(d05.format(-1,1)).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("for081")).ok=(d05.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_UP)).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("for082")).ok=(d05.format(-1,1,-1,-1,-1,-1)).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("for083")).ok=(d05.format(-1,-1,-1,-1,-1,-1)).equals("0.05"); - (new com.ibm.math.DiagBigDecimal.Test("for084")).ok=(d05.format(-1,-1)).equals("0.05"); - {try{ - d05.format(-1,-1,-1,-1,-1,30); // bad mode - flag=false; // shouldn't get here - } - catch (java.lang.IllegalArgumentException $94){iae=$94; - flag=(iae.getMessage()).equals("Bad argument 6 to format: 30"); - }} - (new com.ibm.math.DiagBigDecimal.Test("for085")).ok=flag; - - (new com.ibm.math.DiagBigDecimal.Test("for090")).ok=(d04.format(-1,1)).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for091")).ok=(d06.format(-1,1)).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("for092")).ok=(d04.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_DOWN)).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for093")).ok=(d05.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_DOWN)).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for094")).ok=(d06.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_DOWN)).equals("0.1"); - - (new com.ibm.math.DiagBigDecimal.Test("for095")).ok=(d04.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for096")).ok=(d05.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for097")).ok=(d06.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("for098")).ok=(d15.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.2"); - d050=new com.ibm.math.BigDecimal("0.050"); - d150=new com.ibm.math.BigDecimal("0.150"); - (new com.ibm.math.DiagBigDecimal.Test("for099")).ok=(d050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for100")).ok=(d150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.2"); - m050=new com.ibm.math.BigDecimal("-0.050"); - m150=new com.ibm.math.BigDecimal("-0.150"); - (new com.ibm.math.DiagBigDecimal.Test("for101")).ok=(m050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for102")).ok=(m150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("-0.2"); - d051=new com.ibm.math.BigDecimal("0.051"); - d151=new com.ibm.math.BigDecimal("0.151"); - (new com.ibm.math.DiagBigDecimal.Test("for103")).ok=(d051.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("for104")).ok=(d151.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.2"); - - (new com.ibm.math.DiagBigDecimal.Test("for105")).ok=(m050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_CEILING)).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for106")).ok=(m150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_CEILING)).equals("-0.1"); - (new com.ibm.math.DiagBigDecimal.Test("for107")).ok=(d050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_CEILING)).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("for108")).ok=(d150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_CEILING)).equals("0.2"); - - (new com.ibm.math.DiagBigDecimal.Test("for109")).ok=(m050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_FLOOR)).equals("-0.1"); - (new com.ibm.math.DiagBigDecimal.Test("for110")).ok=(m150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_FLOOR)).equals("-0.2"); - (new com.ibm.math.DiagBigDecimal.Test("for111")).ok=(d050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_FLOOR)).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for112")).ok=(d150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_FLOOR)).equals("0.1"); - - (new com.ibm.math.DiagBigDecimal.Test("for113")).ok=(m050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UP)).equals("-0.1"); - (new com.ibm.math.DiagBigDecimal.Test("for114")).ok=(m150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UP)).equals("-0.2"); - (new com.ibm.math.DiagBigDecimal.Test("for115")).ok=(d050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UP)).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("for116")).ok=(d150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UP)).equals("0.2"); - - (new com.ibm.math.DiagBigDecimal.Test("for117")).ok=(m050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_DOWN)).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for118")).ok=(m150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_DOWN)).equals("-0.1"); - (new com.ibm.math.DiagBigDecimal.Test("for119")).ok=(d050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_DOWN)).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for120")).ok=(d150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_DOWN)).equals("0.1"); - - d000=new com.ibm.math.BigDecimal("0.000"); - d500=new com.ibm.math.BigDecimal("0.500"); - (new com.ibm.math.DiagBigDecimal.Test("for121")).ok=(d000.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("for122")).ok=(d000.format(-1,2,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("for123")).ok=(d000.format(-1,3,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.000"); - {try{ // this should trap.. - d050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY); - flag=false; - } - catch (java.lang.ArithmeticException $95){ae=$95; - flag=(ae.getMessage()).equals("Rounding necessary"); - }} - (new com.ibm.math.DiagBigDecimal.Test("for124")).ok=flag; - (new com.ibm.math.DiagBigDecimal.Test("for125")).ok=(d050.format(-1,2,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.05"); - (new com.ibm.math.DiagBigDecimal.Test("for126")).ok=(d050.format(-1,3,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.050"); - (new com.ibm.math.DiagBigDecimal.Test("for127")).ok=(d500.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.5"); - (new com.ibm.math.DiagBigDecimal.Test("for128")).ok=(d500.format(-1,2,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.50"); - (new com.ibm.math.DiagBigDecimal.Test("for129")).ok=(d500.format(-1,3,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.500"); - - // bad negs -- - {try{ - d050.format(-2,-1,-1,-1,-1,-1); - flag=false; - } - catch (java.lang.IllegalArgumentException $96){ - flag=true; - }} - (new com.ibm.math.DiagBigDecimal.Test("for131")).ok=flag; - {try{ - d050.format(-1,-2,-1,-1,-1,-1); - flag=false; - } - catch (java.lang.IllegalArgumentException $97){ - flag=true; - }} - (new com.ibm.math.DiagBigDecimal.Test("for132")).ok=flag; - {try{ - d050.format(-1,-1,-2,-1,-1,-1); - flag=false; - } - catch (java.lang.IllegalArgumentException $98){ - flag=true; - }} - (new com.ibm.math.DiagBigDecimal.Test("for133")).ok=flag; - {try{ - d050.format(-1,-1,-1,-2,-1,-1); - flag=false; - } - catch (java.lang.IllegalArgumentException $99){ - flag=true; - }} - (new com.ibm.math.DiagBigDecimal.Test("for134")).ok=flag; - {try{ - d050.format(-1,-1,-1,-1,-2,-1); - flag=false; - } - catch (java.lang.IllegalArgumentException $100){ - flag=true; - }} - (new com.ibm.math.DiagBigDecimal.Test("for135")).ok=flag; - {try{ - d050.format(-1,-1,-1,-1,-1,-2); - flag=false; - } - catch (java.lang.IllegalArgumentException $101){ - flag=true; - }} - (new com.ibm.math.DiagBigDecimal.Test("for136")).ok=flag; - - summary("format"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#hashCode} method. */ - - public void diaghashcode(){ - java.lang.String hs; - com.ibm.math.BigDecimal d; - hs="27827817"; - d=new com.ibm.math.BigDecimal(hs); - (new com.ibm.math.DiagBigDecimal.Test("has001")).ok=(d.hashCode())==(hs.hashCode()); - hs="1.265E+200"; - d=new com.ibm.math.BigDecimal(hs); - (new com.ibm.math.DiagBigDecimal.Test("has002")).ok=(d.hashCode())==(hs.hashCode()); - hs="126.5E+200"; - d=new com.ibm.math.BigDecimal(hs); - (new com.ibm.math.DiagBigDecimal.Test("has003")).ok=(d.hashCode())!=(hs.hashCode()); - summary("hashCode"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#intValue} method. */ - - public void diagintvalue(){ - boolean flag=false; - java.lang.String v=null; - java.lang.ArithmeticException ae=null; - java.lang.String badstrings[]; - int i=0; - java.lang.String norm=null; - com.ibm.math.BigDecimal dimax; - com.ibm.math.BigDecimal num=null; - com.ibm.math.BigDecimal dv=null; - com.ibm.math.BigDecimal dimin; - - - // intValue -- - - (new com.ibm.math.DiagBigDecimal.Test("inv001")).ok=imin==((new com.ibm.math.BigDecimal(imin)).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv002")).ok=((99))==((new com.ibm.math.BigDecimal("99")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv003")).ok=((1))==((new com.ibm.math.BigDecimal("1")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv004")).ok=((0))==((new com.ibm.math.BigDecimal("0")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv005")).ok=((-1))==((new com.ibm.math.BigDecimal("-1")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv006")).ok=((-99))==((new com.ibm.math.BigDecimal("-99")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv007")).ok=imax==((new com.ibm.math.BigDecimal(imax)).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv008")).ok=((5))==((new com.ibm.math.BigDecimal("5.0")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv009")).ok=((5))==((new com.ibm.math.BigDecimal("5.3")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv010")).ok=((5))==((new com.ibm.math.BigDecimal("5.5")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv011")).ok=((5))==((new com.ibm.math.BigDecimal("5.7")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv012")).ok=((5))==((new com.ibm.math.BigDecimal("5.9")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv013")).ok=((-5))==((new com.ibm.math.BigDecimal("-5.0")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv014")).ok=((-5))==((new com.ibm.math.BigDecimal("-5.3")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv015")).ok=((-5))==((new com.ibm.math.BigDecimal("-5.5")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv016")).ok=((-5))==((new com.ibm.math.BigDecimal("-5.7")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv017")).ok=((-5))==((new com.ibm.math.BigDecimal("-5.9")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv018")).ok=((new com.ibm.math.BigDecimal("88888888888")).intValue())==(-1305424328); // ugh - (new com.ibm.math.DiagBigDecimal.Test("inv019")).ok=((new com.ibm.math.BigDecimal("-88888888888")).intValue())==1305424328; // ugh - (new com.ibm.math.DiagBigDecimal.Test("inv020")).ok=((imin))==((new com.ibm.math.BigDecimal((((long)imax))+1)).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv021")).ok=((imax))==((new com.ibm.math.BigDecimal((((long)imin))-1)).intValue()); - - // intValueExact -- - - (new com.ibm.math.DiagBigDecimal.Test("inv101")).ok=imin==((new com.ibm.math.BigDecimal(imin)).intValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("inv102")).ok=((99))==((new com.ibm.math.BigDecimal("99")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv103")).ok=((1))==((new com.ibm.math.BigDecimal("1")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv104")).ok=((0))==((new com.ibm.math.BigDecimal("0")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv105")).ok=((-1))==((new com.ibm.math.BigDecimal("-1")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv106")).ok=((-99))==((new com.ibm.math.BigDecimal("-99")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv107")).ok=imax==((new com.ibm.math.BigDecimal(imax)).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv108")).ok=((5))==((new com.ibm.math.BigDecimal("5.0")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv109")).ok=((-5))==((new com.ibm.math.BigDecimal("-5.0")).intValue()); - (new com.ibm.math.DiagBigDecimal.Test("inv110")).ok=imax==((new com.ibm.math.BigDecimal(imax)).intValueExact()); - - {try{ - v="-88588688888"; - (new com.ibm.math.BigDecimal(v)).intValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $102){ae=$102; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - }} - (new com.ibm.math.DiagBigDecimal.Test("inv200")).ok=flag; - - // this one could raise either overflow or bad decimal part - {try{ - v="88088818888.00001"; - (new com.ibm.math.BigDecimal(v)).intValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $103){ - flag=true; - }} - (new com.ibm.math.DiagBigDecimal.Test("inv201")).ok=flag; - - // 1999.10.28: the testcases marked '*' failed - badstrings=new java.lang.String[]{"12345678901",(new com.ibm.math.BigDecimal(imax)).add(one).toString(),(new com.ibm.math.BigDecimal(imin)).subtract(one).toString(),"3731367293","4731367293","5731367293","6731367293","7731367293","8731367293","9731367293","-3731367293","-4731367293","-5731367293","-6731367293","-7731367293","-8731367293","-9731367293",(new com.ibm.math.BigDecimal(imin)).multiply(two).toString(),(new com.ibm.math.BigDecimal(imax)).multiply(two).toString(),(new com.ibm.math.BigDecimal(imin)).multiply(ten).toString(),(new com.ibm.math.BigDecimal(imax)).multiply(ten).toString(),"4731367293","4831367293","4931367293","5031367293","5131367293","5231367293","5331367293","5431367293","5531367293","5631367293","5731367293","5831367293","5931367293","6031367293","6131367293","6231367293","6331367293","6431367293","6531367293","6631367293","6731367293","2200000000","2300000000","2400000000","2500000000","2600000000","2700000000","2800000000","2900000000","-2200000000","-2300000000","-2400000000","-2500000000","-2600000000","-2700000000","-2800000000","-2900000000","25E+8","-25E+8","-12345678901"}; // 220 - // 221 - // 222 - // 223 - // 224 - // 225 * - // 226 - // 227 - // 228 - // 229 * - // 230 - // 231 - // 232 * - // 233 - // 234 - // 235 - // 236 * - // 237 - // 238 - // 239 - // 240 - // 241 - // 242 * - // 243 * - // 244 * - // 245 * - // 246 * - // 247 * - // 248 * - // 249 * - // 250 * - // 251 * - // 252 * - // 253 * - // 254 * - // 255 * - // 256 * - // 257 * - // 258 * - // 259 - // 260 - // 261 - // 262 - // 263 - // 264 - // 265 - // 266 - // 267 - // 268 - // 269 - // 270 - // 271 - // 272 - // 273 - // 274 - // 275 - // 276 - // 277 - // 278 - // 279 - // 280 - {int $104=badstrings.length;i=0;i:for(;$104>0;$104--,i++){ - {try{ - v=badstrings[i]; - (new com.ibm.math.BigDecimal(v)).intValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $105){ae=$105; - norm=(new com.ibm.math.BigDecimal(v)).toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - }} - (new com.ibm.math.DiagBigDecimal.Test("inv"+(220+i))).ok=flag; - } - }/*i*/ - - // now slip in some single bits... - dimax=new com.ibm.math.BigDecimal(imax); - {i=0;i:for(;i<=49;i++){ - {try{ - num=two.pow(new com.ibm.math.BigDecimal(i),mc50); - dv=dimax.add(num,mc50); - dv.intValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $106){ae=$106; - norm=dv.toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - }} - (new com.ibm.math.DiagBigDecimal.Test("inv"+(300+i))).ok=flag; - } - }/*i*/ - dimin=new com.ibm.math.BigDecimal(imin); - {i=50;i:for(;i<=99;i++){ - {try{ - num=two.pow(new com.ibm.math.BigDecimal(i),mc50); - dv=dimin.subtract(num,mc50); - dv.intValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $107){ae=$107; - norm=dv.toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - }} - (new com.ibm.math.DiagBigDecimal.Test("inv"+(300+i))).ok=flag; - } - }/*i*/ - - // the following should all raise bad-decimal-part exceptions - badstrings=new java.lang.String[]{"0.09","0.9","0.01","0.1","-0.01","-0.1","1.01","-1.01","-1.1","-111.111","+111.111","1.09","1.05","1.04","1.99","1.9","1.5","1.4","-1.09","-1.05","-1.04","-1.99","-1.9","-1.5","-1.4","1E-1000","-1E-1000","11E-1","1.5"}; // 400-403 - // 404-407 - // 408-411 - // 412-416 - // 417-420 - // 421-424 - // 425-428 - - {int $108=badstrings.length;i=0;i:for(;$108>0;$108--,i++){ - {try{ - v=badstrings[i]; - (new com.ibm.math.BigDecimal(v)).intValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $109){ae=$109; - norm=(new com.ibm.math.BigDecimal(v)).toString(); - flag=(ae.getMessage()).equals("Decimal part non-zero:"+" "+norm); - }} - (new com.ibm.math.DiagBigDecimal.Test("inv"+(400+i))).ok=flag; - } - }/*i*/ - - summary("intValue+"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#longValue} method. */ - - public void diaglongvalue(){ - boolean flag=false; - java.lang.String v=null; - java.lang.ArithmeticException ae=null; - java.lang.String badstrings[]; - int i=0; - java.lang.String norm=null; - com.ibm.math.BigDecimal dlmax; - com.ibm.math.BigDecimal num=null; - com.ibm.math.BigDecimal dv=null; - com.ibm.math.BigDecimal dlmin; - - - // longValue -- - - (new com.ibm.math.DiagBigDecimal.Test("lov001")).ok=lmin==((new com.ibm.math.BigDecimal(lmin)).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov002")).ok=(((long)99))==((new com.ibm.math.BigDecimal("99")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov003")).ok=(((long)1))==((new com.ibm.math.BigDecimal("1")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov004")).ok=(((long)0))==((new com.ibm.math.BigDecimal("0")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov005")).ok=(((long)-1))==((new com.ibm.math.BigDecimal("-1")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov006")).ok=(((long)-99))==((new com.ibm.math.BigDecimal("-99")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov007")).ok=lmax==((new com.ibm.math.BigDecimal(lmax)).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov008")).ok=(((long)5))==((new com.ibm.math.BigDecimal("5.0")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov009")).ok=(((long)5))==((new com.ibm.math.BigDecimal("5.3")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov010")).ok=(((long)5))==((new com.ibm.math.BigDecimal("5.5")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov011")).ok=(((long)5))==((new com.ibm.math.BigDecimal("5.7")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov012")).ok=(((long)5))==((new com.ibm.math.BigDecimal("5.9")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov013")).ok=(((long)-5))==((new com.ibm.math.BigDecimal("-5.0")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov014")).ok=(((long)-5))==((new com.ibm.math.BigDecimal("-5.3")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov015")).ok=(((long)-5))==((new com.ibm.math.BigDecimal("-5.5")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov016")).ok=(((long)-5))==((new com.ibm.math.BigDecimal("-5.7")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov017")).ok=(((long)-5))==((new com.ibm.math.BigDecimal("-5.9")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov018")).ok=((new com.ibm.math.BigDecimal("888888888899999999998")).longValue())==3445173361941522430L; // ugh - (new com.ibm.math.DiagBigDecimal.Test("lov019")).ok=((new com.ibm.math.BigDecimal("-888888888899999999998")).longValue())==(-3445173361941522430L); // ugh - - // longValueExact -- - - (new com.ibm.math.DiagBigDecimal.Test("lov101")).ok=lmin==((new com.ibm.math.BigDecimal(lmin)).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov102")).ok=(((long)99))==((new com.ibm.math.BigDecimal("99")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov103")).ok=(((long)1))==((new com.ibm.math.BigDecimal("1")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov104")).ok=(((long)0))==((new com.ibm.math.BigDecimal("0")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov105")).ok=(((long)-1))==((new com.ibm.math.BigDecimal("-1")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov106")).ok=(((long)-99))==((new com.ibm.math.BigDecimal("-99")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov107")).ok=lmax==((new com.ibm.math.BigDecimal(lmax)).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov108")).ok=(((long)5))==((new com.ibm.math.BigDecimal("5.0")).longValue()); - (new com.ibm.math.DiagBigDecimal.Test("lov109")).ok=(((long)-5))==((new com.ibm.math.BigDecimal("-5.0")).longValue()); - - {try{ - v="-888888888899999999998"; - (new com.ibm.math.BigDecimal(v)).longValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $110){ae=$110; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - }} - (new com.ibm.math.DiagBigDecimal.Test("lov200")).ok=flag; - {try{ - v="88888887487487479488888"; - (new com.ibm.math.BigDecimal(v)).longValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $111){ae=$111; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - }} - (new com.ibm.math.DiagBigDecimal.Test("lov201")).ok=flag; - {try{ - v="1.5"; - (new com.ibm.math.BigDecimal(v)).longValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $112){ae=$112; - flag=(ae.getMessage()).equals("Decimal part non-zero:"+" "+v); - }} - (new com.ibm.math.DiagBigDecimal.Test("lov202")).ok=flag; - - badstrings=new java.lang.String[]{"1234567890110987654321","-1234567890110987654321",(new com.ibm.math.BigDecimal(lmax)).add(one).toString(),(new com.ibm.math.BigDecimal(lmin)).subtract(one).toString(),(new com.ibm.math.BigDecimal(lmin)).multiply(two).toString(),(new com.ibm.math.BigDecimal(lmax)).multiply(two).toString(),(new com.ibm.math.BigDecimal(lmin)).multiply(ten).toString(),(new com.ibm.math.BigDecimal(lmax)).multiply(ten).toString(),"9223372036854775818","9323372036854775818","9423372036854775818","9523372036854775818","9623372036854775818","9723372036854775818","9823372036854775818","9923372036854775818","-9223372036854775818","-9323372036854775818","-9423372036854775818","-9523372036854775818","-9623372036854775818","-9723372036854775818","-9823372036854775818","-9923372036854775818","12345678901234567890"}; // 220 - // 221 - // 222 - // 223 - // 224 - // 225 - // 226 - // 227 - // 228 - // 229 - // 230 - // 231 - // 232 - // 233 - // 234 - // 235 - // 236 - // 237 - // 238 - // 239 - // 240 - // 241 - // 242 - // 243 - // 244 - {int $113=badstrings.length;i=0;i:for(;$113>0;$113--,i++){ - {try{ - v=badstrings[i]; - (new com.ibm.math.BigDecimal(v)).longValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $114){ae=$114; - norm=(new com.ibm.math.BigDecimal(v)).toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - }} - (new com.ibm.math.DiagBigDecimal.Test("lov"+(220+i))).ok=flag; - } - }/*i*/ - - // now slip in some single bits... - dlmax=new com.ibm.math.BigDecimal(lmax); - {i=0;i:for(;i<=99;i++){ - {try{ - num=two.pow(new com.ibm.math.BigDecimal(i),mc50); - dv=dlmax.add(num,mc50); - dv.longValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $115){ae=$115; - norm=dv.toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - }} - (new com.ibm.math.DiagBigDecimal.Test("lov"+(300+i))).ok=flag; - } - }/*i*/ - dlmin=new com.ibm.math.BigDecimal(lmin); - {i=0;i:for(;i<=99;i++){ - {try{ - num=two.pow(new com.ibm.math.BigDecimal(i),mc50); - dv=dlmin.subtract(num,mc50); - dv.longValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $116){ae=$116; - norm=dv.toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - }} - (new com.ibm.math.DiagBigDecimal.Test("lov"+(400+i))).ok=flag; - } - }/*i*/ - - summary("longValue+"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#movePointLeft} method. */ - - public void diagmovepointleft(){ - (new com.ibm.math.DiagBigDecimal.Test("mpl001")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(-10).toString()).equals("-10000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mpl002")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(-5).toString()).equals("-100000"); - (new com.ibm.math.DiagBigDecimal.Test("mpl003")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(-1).toString()).equals("-10"); - (new com.ibm.math.DiagBigDecimal.Test("mpl004")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(0).toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("mpl005")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(+1).toString()).equals("-0.1"); - (new com.ibm.math.DiagBigDecimal.Test("mpl006")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(+5).toString()).equals("-0.00001"); - (new com.ibm.math.DiagBigDecimal.Test("mpl007")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(+10).toString()).equals("-0.0000000001"); - - (new com.ibm.math.DiagBigDecimal.Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(-10).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(-5).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(-1).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(0).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(+1).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(+5).toString()).equals("0.00000"); - (new com.ibm.math.DiagBigDecimal.Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(+10).toString()).equals("0.0000000000"); - - (new com.ibm.math.DiagBigDecimal.Test("mpl020")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(-10).toString()).equals("10000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mpl021")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(-5).toString()).equals("100000"); - (new com.ibm.math.DiagBigDecimal.Test("mpl022")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(-1).toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("mpl023")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(0).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("mpl024")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(+1).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("mpl025")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(+5).toString()).equals("0.00001"); - (new com.ibm.math.DiagBigDecimal.Test("mpl026")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(+10).toString()).equals("0.0000000001"); - - (new com.ibm.math.DiagBigDecimal.Test("mpl030")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(-10).toString()).equals("50000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mpl031")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(-5).toString()).equals("500000"); - (new com.ibm.math.DiagBigDecimal.Test("mpl032")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(-1).toString()).equals("50"); - (new com.ibm.math.DiagBigDecimal.Test("mpl033")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(0).toString()).equals("5"); - (new com.ibm.math.DiagBigDecimal.Test("mpl034")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(+1).toString()).equals("0.5"); - (new com.ibm.math.DiagBigDecimal.Test("mpl035")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(+5).toString()).equals("0.00005"); - (new com.ibm.math.DiagBigDecimal.Test("mpl036")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(+10).toString()).equals("0.0000000005"); - - summary("movePointLeft"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#movePointRight} method. */ - - public void diagmovepointright(){ - (new com.ibm.math.DiagBigDecimal.Test("mpr001")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(+10).toString()).equals("-10000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mpr002")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(+5).toString()).equals("-100000"); - (new com.ibm.math.DiagBigDecimal.Test("mpr003")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(+1).toString()).equals("-10"); - (new com.ibm.math.DiagBigDecimal.Test("mpr004")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(0).toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("mpr005")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(-1).toString()).equals("-0.1"); - (new com.ibm.math.DiagBigDecimal.Test("mpr006")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(-5).toString()).equals("-0.00001"); - (new com.ibm.math.DiagBigDecimal.Test("mpr007")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(-10).toString()).equals("-0.0000000001"); - - (new com.ibm.math.DiagBigDecimal.Test("mpr010")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(+10).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("mpr011")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(+5).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("mpr012")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(+1).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("mpr013")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(0).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("mpr014")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(-1).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("mpr015")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(-5).toString()).equals("0.00000"); - (new com.ibm.math.DiagBigDecimal.Test("mpr016")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(-10).toString()).equals("0.0000000000"); - - (new com.ibm.math.DiagBigDecimal.Test("mpr020")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(+10).toString()).equals("10000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mpr021")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(+5).toString()).equals("100000"); - (new com.ibm.math.DiagBigDecimal.Test("mpr022")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(+1).toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("mpr023")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(0).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("mpr024")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(-1).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("mpr025")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(-5).toString()).equals("0.00001"); - (new com.ibm.math.DiagBigDecimal.Test("mpr026")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(-10).toString()).equals("0.0000000001"); - - (new com.ibm.math.DiagBigDecimal.Test("mpr030")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(+10).toString()).equals("50000000000"); - (new com.ibm.math.DiagBigDecimal.Test("mpr031")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(+5).toString()).equals("500000"); - (new com.ibm.math.DiagBigDecimal.Test("mpr032")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(+1).toString()).equals("50"); - (new com.ibm.math.DiagBigDecimal.Test("mpr033")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(0).toString()).equals("5"); - (new com.ibm.math.DiagBigDecimal.Test("mpr034")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(-1).toString()).equals("0.5"); - (new com.ibm.math.DiagBigDecimal.Test("mpr035")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(-5).toString()).equals("0.00005"); - (new com.ibm.math.DiagBigDecimal.Test("mpr036")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(-10).toString()).equals("0.0000000005"); - - summary("movePointRight"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#scale} method. */ - - public void diagscale(){ - (new com.ibm.math.DiagBigDecimal.Test("sca001")).ok=((new com.ibm.math.BigDecimal("-1")).scale())==0; - (new com.ibm.math.DiagBigDecimal.Test("sca002")).ok=((new com.ibm.math.BigDecimal("-10")).scale())==0; - (new com.ibm.math.DiagBigDecimal.Test("sca003")).ok=((new com.ibm.math.BigDecimal("+1")).scale())==0; - (new com.ibm.math.DiagBigDecimal.Test("sca004")).ok=((new com.ibm.math.BigDecimal("+10")).scale())==0; - (new com.ibm.math.DiagBigDecimal.Test("sca005")).ok=((new com.ibm.math.BigDecimal("1E+10")).scale())==0; - (new com.ibm.math.DiagBigDecimal.Test("sca006")).ok=((new com.ibm.math.BigDecimal("1E-10")).scale())==10; - (new com.ibm.math.DiagBigDecimal.Test("sca007")).ok=((new com.ibm.math.BigDecimal("0E-10")).scale())==0; - (new com.ibm.math.DiagBigDecimal.Test("sca008")).ok=((new com.ibm.math.BigDecimal("0.000")).scale())==3; - (new com.ibm.math.DiagBigDecimal.Test("sca009")).ok=((new com.ibm.math.BigDecimal("0.00")).scale())==2; - (new com.ibm.math.DiagBigDecimal.Test("sca010")).ok=((new com.ibm.math.BigDecimal("0.0")).scale())==1; - (new com.ibm.math.DiagBigDecimal.Test("sca011")).ok=((new com.ibm.math.BigDecimal("0.1")).scale())==1; - (new com.ibm.math.DiagBigDecimal.Test("sca012")).ok=((new com.ibm.math.BigDecimal("0.12")).scale())==2; - (new com.ibm.math.DiagBigDecimal.Test("sca013")).ok=((new com.ibm.math.BigDecimal("0.123")).scale())==3; - (new com.ibm.math.DiagBigDecimal.Test("sca014")).ok=((new com.ibm.math.BigDecimal("-0.0")).scale())==1; - (new com.ibm.math.DiagBigDecimal.Test("sca015")).ok=((new com.ibm.math.BigDecimal("-0.1")).scale())==1; - (new com.ibm.math.DiagBigDecimal.Test("sca016")).ok=((new com.ibm.math.BigDecimal("-0.12")).scale())==2; - (new com.ibm.math.DiagBigDecimal.Test("sca017")).ok=((new com.ibm.math.BigDecimal("-0.123")).scale())==3; - summary("scale"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#setScale} method. */ - - public void diagsetscale(){ - boolean flag=false; - java.lang.RuntimeException e=null; - - (new com.ibm.math.DiagBigDecimal.Test("ssc001")).ok=((new com.ibm.math.BigDecimal("-1")).setScale(0).toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("ssc002")).ok=((new com.ibm.math.BigDecimal("-1")).setScale(1).toString()).equals("-1.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc003")).ok=((new com.ibm.math.BigDecimal("-1")).setScale(2).toString()).equals("-1.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc004")).ok=((new com.ibm.math.BigDecimal("0")).setScale(0).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc005")).ok=((new com.ibm.math.BigDecimal("0")).setScale(1).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc006")).ok=((new com.ibm.math.BigDecimal("0")).setScale(2).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc007")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(0).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("ssc008")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(1).toString()).equals("1.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc009")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(2).toString()).equals("1.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc010")).ok=((new com.ibm.math.BigDecimal("-1")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("ssc011")).ok=((new com.ibm.math.BigDecimal("-1")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("-1.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc012")).ok=((new com.ibm.math.BigDecimal("-1")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("-1.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc013")).ok=((new com.ibm.math.BigDecimal("0")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc014")).ok=((new com.ibm.math.BigDecimal("0")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc015")).ok=((new com.ibm.math.BigDecimal("0")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc016")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("ssc017")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc018")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.00"); - - (new com.ibm.math.DiagBigDecimal.Test("ssc020")).ok=((new com.ibm.math.BigDecimal("1.04")).setScale(3,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.040"); - (new com.ibm.math.DiagBigDecimal.Test("ssc021")).ok=((new com.ibm.math.BigDecimal("1.04")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.04"); - (new com.ibm.math.DiagBigDecimal.Test("ssc022")).ok=((new com.ibm.math.BigDecimal("1.04")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc023")).ok=((new com.ibm.math.BigDecimal("1.04")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("ssc024")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(3,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.050"); - (new com.ibm.math.DiagBigDecimal.Test("ssc025")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.05"); - (new com.ibm.math.DiagBigDecimal.Test("ssc026")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.1"); - (new com.ibm.math.DiagBigDecimal.Test("ssc027")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("ssc028")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(3,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("1.050"); - (new com.ibm.math.DiagBigDecimal.Test("ssc029")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("1.05"); - (new com.ibm.math.DiagBigDecimal.Test("ssc030")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("1.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc031")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("ssc032")).ok=((new com.ibm.math.BigDecimal("1.06")).setScale(3,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.060"); - (new com.ibm.math.DiagBigDecimal.Test("ssc033")).ok=((new com.ibm.math.BigDecimal("1.06")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.06"); - (new com.ibm.math.DiagBigDecimal.Test("ssc034")).ok=((new com.ibm.math.BigDecimal("1.06")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.1"); - (new com.ibm.math.DiagBigDecimal.Test("ssc035")).ok=((new com.ibm.math.BigDecimal("1.06")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1"); - - (new com.ibm.math.DiagBigDecimal.Test("ssc040")).ok=((new com.ibm.math.BigDecimal("-10")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("-10.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc041")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc042")).ok=((new com.ibm.math.BigDecimal("+10")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("10.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc043")).ok=((new com.ibm.math.BigDecimal("1E+10")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("10000000000.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc044")).ok=((new com.ibm.math.BigDecimal("1E-10")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc045")).ok=((new com.ibm.math.BigDecimal("1E-2")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.01"); - (new com.ibm.math.DiagBigDecimal.Test("ssc046")).ok=((new com.ibm.math.BigDecimal("0E-10")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.00"); - - // check rounding - (new com.ibm.math.DiagBigDecimal.Test("ssc050")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_CEILING).toString()).equals("0.01"); - (new com.ibm.math.DiagBigDecimal.Test("ssc051")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_CEILING).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("ssc052")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_CEILING).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("ssc053")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_DOWN).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc054")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_DOWN).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc055")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_DOWN).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc056")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_FLOOR).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc057")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_FLOOR).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc058")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_FLOOR).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc059")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc060")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc061")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc062")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("ssc063")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc064")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc065")).ok=((new com.ibm.math.BigDecimal("0.015")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.02"); - (new com.ibm.math.DiagBigDecimal.Test("ssc066")).ok=((new com.ibm.math.BigDecimal("0.015")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc067")).ok=((new com.ibm.math.BigDecimal("0.015")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc068")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.01"); - (new com.ibm.math.DiagBigDecimal.Test("ssc069")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc070")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc071")).ok=((new com.ibm.math.BigDecimal("0.095")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.10"); - (new com.ibm.math.DiagBigDecimal.Test("ssc072")).ok=((new com.ibm.math.BigDecimal("0.095")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("ssc073")).ok=((new com.ibm.math.BigDecimal("0.095")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("ssc074")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_UP).toString()).equals("0.01"); - (new com.ibm.math.DiagBigDecimal.Test("ssc075")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_UP).toString()).equals("0.1"); - (new com.ibm.math.DiagBigDecimal.Test("ssc076")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_UP).toString()).equals("1"); - - {try{checkscale:do{ - (new com.ibm.math.BigDecimal(1)).setScale(-8); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $117){e=$117; - flag=(e.getMessage()).equals("Negative scale: -8"); - }}/*checkscale*/ - (new com.ibm.math.DiagBigDecimal.Test("ssc100")).ok=flag; - {try{checkrunn:do{ - (new com.ibm.math.BigDecimal(1.0001D)).setScale(3); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $118){e=$118; - flag=(e.getMessage()).equals("Rounding necessary"); - }}/*checkrunn*/ - (new com.ibm.math.DiagBigDecimal.Test("ssc101")).ok=flag; - {try{checkrunn:do{ - (new com.ibm.math.BigDecimal(1E-8D)).setScale(3); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $119){e=$119; - flag=(e.getMessage()).equals("Rounding necessary"); - }}/*checkrunn*/ - (new com.ibm.math.DiagBigDecimal.Test("ssc102")).ok=flag; - summary("setScale"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the BigDecimal.shortValue() method. */ - - public void diagshortvalue(){ - boolean flag=false; - java.lang.String v=null; - java.lang.ArithmeticException ae=null; - java.lang.String badstrings[]; - int i=0; - java.lang.String norm=null; - - (new com.ibm.math.DiagBigDecimal.Test("shv002")).ok=(((short)0))==((new com.ibm.math.BigDecimal("0")).shortValue()); - (new com.ibm.math.DiagBigDecimal.Test("shv003")).ok=(((short)1))==((new com.ibm.math.BigDecimal("1")).shortValue()); - (new com.ibm.math.DiagBigDecimal.Test("shv004")).ok=(((short)99))==((new com.ibm.math.BigDecimal("99")).shortValue()); - (new com.ibm.math.DiagBigDecimal.Test("shv006")).ok=((smax))==((new com.ibm.math.BigDecimal(smax)).shortValue()); - (new com.ibm.math.DiagBigDecimal.Test("shv007")).ok=((smin))==((new com.ibm.math.BigDecimal(smin)).shortValue()); - (new com.ibm.math.DiagBigDecimal.Test("shv008")).ok=((sneg))==((new com.ibm.math.BigDecimal(sneg)).shortValue()); - (new com.ibm.math.DiagBigDecimal.Test("shv009")).ok=((szer))==((new com.ibm.math.BigDecimal(szer)).shortValue()); - (new com.ibm.math.DiagBigDecimal.Test("shv010")).ok=((spos))==((new com.ibm.math.BigDecimal(spos)).shortValue()); - (new com.ibm.math.DiagBigDecimal.Test("shv011")).ok=((smin))==((new com.ibm.math.BigDecimal(smax+1)).shortValue()); - (new com.ibm.math.DiagBigDecimal.Test("shv012")).ok=((smax))==((new com.ibm.math.BigDecimal(smin-1)).shortValue()); - - (new com.ibm.math.DiagBigDecimal.Test("shv022")).ok=(((short)0))==((new com.ibm.math.BigDecimal("0")).shortValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("shv023")).ok=(((short)1))==((new com.ibm.math.BigDecimal("1")).shortValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("shv024")).ok=(((short)99))==((new com.ibm.math.BigDecimal("99")).shortValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("shv026")).ok=((smax))==((new com.ibm.math.BigDecimal(smax)).shortValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("shv027")).ok=((smin))==((new com.ibm.math.BigDecimal(smin)).shortValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("shv028")).ok=((sneg))==((new com.ibm.math.BigDecimal(sneg)).shortValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("shv029")).ok=((szer))==((new com.ibm.math.BigDecimal(szer)).shortValueExact()); - (new com.ibm.math.DiagBigDecimal.Test("shv030")).ok=((spos))==((new com.ibm.math.BigDecimal(spos)).shortValueExact()); - {try{ - v="-88888888888"; - (new com.ibm.math.BigDecimal(v)).shortValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $120){ae=$120; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - }} - (new com.ibm.math.DiagBigDecimal.Test("shv100")).ok=flag; - {try{ - v="88888888888"; - (new com.ibm.math.BigDecimal(v)).shortValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $121){ae=$121; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - }} - (new com.ibm.math.DiagBigDecimal.Test("shv101")).ok=flag; - {try{ - v="1.5"; - (new com.ibm.math.BigDecimal(v)).shortValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $122){ae=$122; - flag=(ae.getMessage()).equals("Decimal part non-zero:"+" "+v); - }} - (new com.ibm.math.DiagBigDecimal.Test("shv102")).ok=flag; - - badstrings=new java.lang.String[]{"123456",(new com.ibm.math.BigDecimal(smax)).add(one).toString(),(new com.ibm.math.BigDecimal(smin)).subtract(one).toString(),"71111","81111","91111","-71111","-81111","-91111",(new com.ibm.math.BigDecimal(smin)).multiply(two).toString(),(new com.ibm.math.BigDecimal(smax)).multiply(two).toString(),(new com.ibm.math.BigDecimal(smin)).multiply(ten).toString(),(new com.ibm.math.BigDecimal(smax)).multiply(ten).toString(),"-123456"}; // 220 - // 221 - // 222 - // 223 - // 224 - // 225 - // 226 - // 227 - // 228 - // 229 - // 230 - // 231 - // 232 - // 233 - {int $123=badstrings.length;i=0;i:for(;$123>0;$123--,i++){ - {try{ - v=badstrings[i]; - (new com.ibm.math.BigDecimal(v)).shortValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $124){ae=$124; - norm=(new com.ibm.math.BigDecimal(v)).toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - }} - (new com.ibm.math.DiagBigDecimal.Test("shv"+(220+i))).ok=flag; - } - }/*i*/ - - - summary("shortValue+"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#signum} method. */ - - public void diagsignum(){ - // necessarily checks some obscure constructions, too - (new com.ibm.math.DiagBigDecimal.Test("sig001")).ok=(-1)==((new com.ibm.math.BigDecimal("-1")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig002")).ok=(-1)==((new com.ibm.math.BigDecimal("-0.0010")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig003")).ok=(-1)==((new com.ibm.math.BigDecimal("-0.001")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig004")).ok=0==((new com.ibm.math.BigDecimal("-0.00")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig005")).ok=0==((new com.ibm.math.BigDecimal("-0")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig006")).ok=0==((new com.ibm.math.BigDecimal("0")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig007")).ok=0==((new com.ibm.math.BigDecimal("00")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig008")).ok=0==((new com.ibm.math.BigDecimal("00.0")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig009")).ok=1==((new com.ibm.math.BigDecimal("00.01")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig010")).ok=1==((new com.ibm.math.BigDecimal("00.01")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig011")).ok=1==((new com.ibm.math.BigDecimal("00.010")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig012")).ok=1==((new com.ibm.math.BigDecimal("01.01")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig013")).ok=1==((new com.ibm.math.BigDecimal("+0.01")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig014")).ok=1==((new com.ibm.math.BigDecimal("+0.001")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig015")).ok=1==((new com.ibm.math.BigDecimal("1")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig016")).ok=1==((new com.ibm.math.BigDecimal("1e+12")).signum()); - (new com.ibm.math.DiagBigDecimal.Test("sig017")).ok=0==((new com.ibm.math.BigDecimal("00e+12")).signum()); - summary("signum"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#toBigDecimal} method. */ - - public void diagtobigdecimal(){ - (new com.ibm.math.DiagBigDecimal.Test("tbd001")).ok=((new com.ibm.math.BigDecimal("0")).toBigDecimal().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbd002")).ok=((new com.ibm.math.BigDecimal("-1")).toBigDecimal().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbd003")).ok=((new com.ibm.math.BigDecimal("+1")).toBigDecimal().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbd004")).ok=((new com.ibm.math.BigDecimal("1")).toBigDecimal().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbd005")).ok=((new com.ibm.math.BigDecimal("1E+2")).toBigDecimal().toString()).equals("100"); - (new com.ibm.math.DiagBigDecimal.Test("tbd006")).ok=((new com.ibm.math.BigDecimal("1E-2")).toBigDecimal().toString()).equals("0.01"); - (new com.ibm.math.DiagBigDecimal.Test("tbd007")).ok=((new com.ibm.math.BigDecimal("1E-8")).toBigDecimal().toString()).equals("0.00000001"); - (new com.ibm.math.DiagBigDecimal.Test("tbd008")).ok=((new com.ibm.math.BigDecimal("1E-9")).toBigDecimal().toString()).equals("0.000000001"); - (new com.ibm.math.DiagBigDecimal.Test("tbd009")).ok=((new com.ibm.math.BigDecimal("1E10")).toBigDecimal().toString()).equals("10000000000"); - (new com.ibm.math.DiagBigDecimal.Test("tbd010")).ok=((new com.ibm.math.BigDecimal("1E12")).toBigDecimal().toString()).equals("1000000000000"); - summary("toBigDecimal"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#toBigInteger} method. */ - - public void diagtobiginteger(){ - boolean flag=false; - java.lang.String badstrings[]; - int i=0; - (new com.ibm.math.DiagBigDecimal.Test("tbi001")).ok=((new com.ibm.math.BigDecimal("-1")).toBigInteger().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi002")).ok=((new com.ibm.math.BigDecimal("0")).toBigInteger().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi003")).ok=((new com.ibm.math.BigDecimal("+1")).toBigInteger().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi004")).ok=((new com.ibm.math.BigDecimal("10")).toBigInteger().toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("tbi005")).ok=((new com.ibm.math.BigDecimal("1000")).toBigInteger().toString()).equals("1000"); - (new com.ibm.math.DiagBigDecimal.Test("tbi006")).ok=((new com.ibm.math.BigDecimal("-1E+0")).toBigInteger().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi007")).ok=((new com.ibm.math.BigDecimal("0E+0")).toBigInteger().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi008")).ok=((new com.ibm.math.BigDecimal("+1E+0")).toBigInteger().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi009")).ok=((new com.ibm.math.BigDecimal("10E+0")).toBigInteger().toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("tbi010")).ok=((new com.ibm.math.BigDecimal("1E+3")).toBigInteger().toString()).equals("1000"); - (new com.ibm.math.DiagBigDecimal.Test("tbi011")).ok=((new com.ibm.math.BigDecimal("0.00")).toBigInteger().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi012")).ok=((new com.ibm.math.BigDecimal("0.01")).toBigInteger().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi013")).ok=((new com.ibm.math.BigDecimal("0.0")).toBigInteger().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi014")).ok=((new com.ibm.math.BigDecimal("0.1")).toBigInteger().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi015")).ok=((new com.ibm.math.BigDecimal("-0.00")).toBigInteger().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi016")).ok=((new com.ibm.math.BigDecimal("-0.01")).toBigInteger().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi017")).ok=((new com.ibm.math.BigDecimal("-0.0")).toBigInteger().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi018")).ok=((new com.ibm.math.BigDecimal("-0.1")).toBigInteger().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi019")).ok=((new com.ibm.math.BigDecimal("1.00")).toBigInteger().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi020")).ok=((new com.ibm.math.BigDecimal("1.01")).toBigInteger().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi021")).ok=((new com.ibm.math.BigDecimal("1.0")).toBigInteger().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi022")).ok=((new com.ibm.math.BigDecimal("1.1")).toBigInteger().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi023")).ok=((new com.ibm.math.BigDecimal("-1.00")).toBigInteger().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi024")).ok=((new com.ibm.math.BigDecimal("-1.01")).toBigInteger().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi025")).ok=((new com.ibm.math.BigDecimal("-1.0")).toBigInteger().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi026")).ok=((new com.ibm.math.BigDecimal("-1.1")).toBigInteger().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi027")).ok=((new com.ibm.math.BigDecimal("-111.111")).toBigInteger().toString()).equals("-111"); - (new com.ibm.math.DiagBigDecimal.Test("tbi028")).ok=((new com.ibm.math.BigDecimal("+111.111")).toBigInteger().toString()).equals("111"); - (new com.ibm.math.DiagBigDecimal.Test("tbi029")).ok=((new com.ibm.math.BigDecimal("0.09")).toBigInteger().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi030")).ok=((new com.ibm.math.BigDecimal("0.9")).toBigInteger().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi031")).ok=((new com.ibm.math.BigDecimal("1.09")).toBigInteger().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi032")).ok=((new com.ibm.math.BigDecimal("1.05")).toBigInteger().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi033")).ok=((new com.ibm.math.BigDecimal("1.04")).toBigInteger().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi034")).ok=((new com.ibm.math.BigDecimal("1.99")).toBigInteger().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi034")).ok=((new com.ibm.math.BigDecimal("1.9")).toBigInteger().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi035")).ok=((new com.ibm.math.BigDecimal("1.5")).toBigInteger().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi036")).ok=((new com.ibm.math.BigDecimal("1.4")).toBigInteger().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi037")).ok=((new com.ibm.math.BigDecimal("-1.09")).toBigInteger().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi038")).ok=((new com.ibm.math.BigDecimal("-1.05")).toBigInteger().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi039")).ok=((new com.ibm.math.BigDecimal("-1.04")).toBigInteger().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi040")).ok=((new com.ibm.math.BigDecimal("-1.99")).toBigInteger().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi041")).ok=((new com.ibm.math.BigDecimal("-1.9")).toBigInteger().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi042")).ok=((new com.ibm.math.BigDecimal("-1.5")).toBigInteger().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi043")).ok=((new com.ibm.math.BigDecimal("-1.4")).toBigInteger().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi044")).ok=((new com.ibm.math.BigDecimal("1E-1000")).toBigInteger().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi045")).ok=((new com.ibm.math.BigDecimal("-1E-1000")).toBigInteger().toString()).equals("0"); - - // Exact variety -- - (new com.ibm.math.DiagBigDecimal.Test("tbi101")).ok=((new com.ibm.math.BigDecimal("-1")).toBigIntegerExact().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi102")).ok=((new com.ibm.math.BigDecimal("0")).toBigIntegerExact().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi103")).ok=((new com.ibm.math.BigDecimal("+1")).toBigIntegerExact().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi104")).ok=((new com.ibm.math.BigDecimal("10")).toBigIntegerExact().toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("tbi105")).ok=((new com.ibm.math.BigDecimal("1000")).toBigIntegerExact().toString()).equals("1000"); - (new com.ibm.math.DiagBigDecimal.Test("tbi106")).ok=((new com.ibm.math.BigDecimal("-1E+0")).toBigIntegerExact().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi107")).ok=((new com.ibm.math.BigDecimal("0E+0")).toBigIntegerExact().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi108")).ok=((new com.ibm.math.BigDecimal("+1E+0")).toBigIntegerExact().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi109")).ok=((new com.ibm.math.BigDecimal("10E+0")).toBigIntegerExact().toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("tbi110")).ok=((new com.ibm.math.BigDecimal("1E+3")).toBigIntegerExact().toString()).equals("1000"); - (new com.ibm.math.DiagBigDecimal.Test("tbi111")).ok=((new com.ibm.math.BigDecimal("0.00")).toBigIntegerExact().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi112")).ok=((new com.ibm.math.BigDecimal("0.0")).toBigIntegerExact().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi113")).ok=((new com.ibm.math.BigDecimal("-0.00")).toBigIntegerExact().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi114")).ok=((new com.ibm.math.BigDecimal("-0.0")).toBigIntegerExact().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("tbi115")).ok=((new com.ibm.math.BigDecimal("1.00")).toBigIntegerExact().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi116")).ok=((new com.ibm.math.BigDecimal("1.0")).toBigIntegerExact().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi117")).ok=((new com.ibm.math.BigDecimal("-1.00")).toBigIntegerExact().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi118")).ok=((new com.ibm.math.BigDecimal("-1.0")).toBigIntegerExact().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("tbi119")).ok=((new com.ibm.math.BigDecimal("1.00000000000000000000000000000")).toBigIntegerExact().toString()).equals("1"); - - // the following should all raise exceptions - - badstrings=new java.lang.String[]{"0.09","0.9","0.01","0.1","-0.01","-0.1","1.01","-1.01","-1.1","-111.111","+111.111","1.09","1.05","1.04","1.99","1.9","1.5","1.4","-1.09","-1.05","-1.04","-1.99","-1.9","-1.5","-1.4","1E-1000","-1E-1000","11E-1","1.1","127623156123656561356123512315631231551312356.000001","0.000000000000000000000000000000000000000000000001"}; // 300-303 - // 304-307 - // 308-311 - // 312-316 - // 317-320 - // 321-324 - // 325-328 - // 329 - // 330 - - {int $125=badstrings.length;i=0;i:for(;$125>0;$125--,i++){ - {try{ - (new com.ibm.math.BigDecimal(badstrings[i])).toBigIntegerExact(); - flag=false; - } - catch (java.lang.ArithmeticException $126){ - flag=true; - }} - (new com.ibm.math.DiagBigDecimal.Test("tbi"+(300+i))).ok=flag; - } - }/*i*/ - - summary("toBigInteger+"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#toCharArray} method. */ - - public void diagtochararray(){ - java.lang.String str; - char car[]; - com.ibm.math.BigDecimal d; - char ca[]; - // the function of this has been tested above, this is simply an - // existence proof and type-check - str="-123.45"; - car=(str).toCharArray(); - d=new com.ibm.math.BigDecimal(str); - ca=d.toCharArray(); - (new com.ibm.math.DiagBigDecimal.Test("tca001")).ok=ca.length==car.length; - (new com.ibm.math.DiagBigDecimal.Test("tca002")).ok=(new java.lang.String(ca)).equals((java.lang.Object)(new java.lang.String(car))); - (new com.ibm.math.DiagBigDecimal.Test("tca003")).ok=(d.toCharArray() instanceof char[]); - (new com.ibm.math.DiagBigDecimal.Test("tca004")).ok=(ca instanceof char[]); - summary("toCharArray"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#toString} method. */ - - public void diagtostring(){ - java.lang.String str; - char car[]; - com.ibm.math.BigDecimal d; - char ca[]; - java.lang.String cs; - // the function of this has been tested above, this is simply an - // existence proof and type-check - str="123.45"; - car=(str).toCharArray(); - d=new com.ibm.math.BigDecimal(car,0,car.length); - ca=d.toCharArray(); - cs=d.toString(); - (new com.ibm.math.DiagBigDecimal.Test("tos001")).ok=(str.toCharArray().length)==ca.length; - (new com.ibm.math.DiagBigDecimal.Test("tos002")).ok=(str.length())==(cs.length()); - (new com.ibm.math.DiagBigDecimal.Test("tos003")).ok=str.equals((java.lang.Object)(new java.lang.String(ca))); - (new com.ibm.math.DiagBigDecimal.Test("tos004")).ok=str.equals((java.lang.Object)cs); - (new com.ibm.math.DiagBigDecimal.Test("tos005")).ok=(cs instanceof java.lang.String); - (new com.ibm.math.DiagBigDecimal.Test("tos006")).ok=(d.toString() instanceof java.lang.String); - summary("toString"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#unscaledValue} method. */ - - public void diagunscaledvalue(){ - // just like toBigInteger, but scaly bits are preserved [without dots] - (new com.ibm.math.DiagBigDecimal.Test("uns001")).ok=((new com.ibm.math.BigDecimal("-1")).unscaledValue().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("uns002")).ok=((new com.ibm.math.BigDecimal("0")).unscaledValue().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("uns003")).ok=((new com.ibm.math.BigDecimal("+1")).unscaledValue().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("uns004")).ok=((new com.ibm.math.BigDecimal("10")).unscaledValue().toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("uns005")).ok=((new com.ibm.math.BigDecimal("1000")).unscaledValue().toString()).equals("1000"); - (new com.ibm.math.DiagBigDecimal.Test("uns006")).ok=((new com.ibm.math.BigDecimal("-1E+0")).unscaledValue().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("uns007")).ok=((new com.ibm.math.BigDecimal("0E+0")).unscaledValue().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("uns008")).ok=((new com.ibm.math.BigDecimal("+1E+0")).unscaledValue().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("uns009")).ok=((new com.ibm.math.BigDecimal("10E+0")).unscaledValue().toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("uns010")).ok=((new com.ibm.math.BigDecimal("1E+3")).unscaledValue().toString()).equals("1000"); - (new com.ibm.math.DiagBigDecimal.Test("uns011")).ok=((new com.ibm.math.BigDecimal("0.00")).unscaledValue().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("uns012")).ok=((new com.ibm.math.BigDecimal("0.01")).unscaledValue().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("uns013")).ok=((new com.ibm.math.BigDecimal("0.0")).unscaledValue().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("uns014")).ok=((new com.ibm.math.BigDecimal("0.1")).unscaledValue().toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("uns015")).ok=((new com.ibm.math.BigDecimal("-0.00")).unscaledValue().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("uns016")).ok=((new com.ibm.math.BigDecimal("-0.01")).unscaledValue().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("uns017")).ok=((new com.ibm.math.BigDecimal("-0.0")).unscaledValue().toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("uns018")).ok=((new com.ibm.math.BigDecimal("-0.1")).unscaledValue().toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("uns019")).ok=((new com.ibm.math.BigDecimal("1.00")).unscaledValue().toString()).equals("100"); - (new com.ibm.math.DiagBigDecimal.Test("uns020")).ok=((new com.ibm.math.BigDecimal("1.01")).unscaledValue().toString()).equals("101"); - (new com.ibm.math.DiagBigDecimal.Test("uns021")).ok=((new com.ibm.math.BigDecimal("1.0")).unscaledValue().toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("uns022")).ok=((new com.ibm.math.BigDecimal("1.1")).unscaledValue().toString()).equals("11"); - (new com.ibm.math.DiagBigDecimal.Test("uns023")).ok=((new com.ibm.math.BigDecimal("-1.00")).unscaledValue().toString()).equals("-100"); - (new com.ibm.math.DiagBigDecimal.Test("uns024")).ok=((new com.ibm.math.BigDecimal("-1.01")).unscaledValue().toString()).equals("-101"); - (new com.ibm.math.DiagBigDecimal.Test("uns025")).ok=((new com.ibm.math.BigDecimal("-1.0")).unscaledValue().toString()).equals("-10"); - (new com.ibm.math.DiagBigDecimal.Test("uns026")).ok=((new com.ibm.math.BigDecimal("-1.1")).unscaledValue().toString()).equals("-11"); - (new com.ibm.math.DiagBigDecimal.Test("uns027")).ok=((new com.ibm.math.BigDecimal("-111.111")).unscaledValue().toString()).equals("-111111"); - (new com.ibm.math.DiagBigDecimal.Test("uns028")).ok=((new com.ibm.math.BigDecimal("+111.111")).unscaledValue().toString()).equals("111111"); - summary("unscaledValue"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#valueOf} method [long and double]. */ - - public void diagvalueof(){ - boolean flag=false; - java.lang.NumberFormatException e=null; - double dzer; - double dpos; - double dneg; - double dpos5; - double dneg5; - double dmin; - double dmax; - double d; - - // valueOf(long [,scale]) -- - - (new com.ibm.math.DiagBigDecimal.Test("val001")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)-2)).toString()).equals("-2"); - (new com.ibm.math.DiagBigDecimal.Test("val002")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)-1)).toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("val003")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)-0)).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("val004")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)+1)).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("val005")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)+2)).toString()).equals("2"); - (new com.ibm.math.DiagBigDecimal.Test("val006")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)10)).toString()).equals("10"); - (new com.ibm.math.DiagBigDecimal.Test("val007")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)11)).toString()).equals("11"); - (new com.ibm.math.DiagBigDecimal.Test("val008")).ok=(com.ibm.math.BigDecimal.valueOf(lmin).toString()).equals("-9223372036854775808"); - (new com.ibm.math.DiagBigDecimal.Test("val009")).ok=(com.ibm.math.BigDecimal.valueOf(lmax).toString()).equals("9223372036854775807"); - (new com.ibm.math.DiagBigDecimal.Test("val010")).ok=(com.ibm.math.BigDecimal.valueOf(lneg).toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("val011")).ok=(com.ibm.math.BigDecimal.valueOf(lzer).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("val012")).ok=(com.ibm.math.BigDecimal.valueOf(lpos).toString()).equals("1"); - (new com.ibm.math.DiagBigDecimal.Test("val013")).ok=(com.ibm.math.BigDecimal.valueOf(lmin,0).toString()).equals("-9223372036854775808"); - (new com.ibm.math.DiagBigDecimal.Test("val014")).ok=(com.ibm.math.BigDecimal.valueOf(lmax,0).toString()).equals("9223372036854775807"); - (new com.ibm.math.DiagBigDecimal.Test("val015")).ok=(com.ibm.math.BigDecimal.valueOf(lneg,0).toString()).equals("-1"); - (new com.ibm.math.DiagBigDecimal.Test("val016")).ok=(com.ibm.math.BigDecimal.valueOf(lpos,0).toString()).equals("1"); - - (new com.ibm.math.DiagBigDecimal.Test("val017")).ok=(com.ibm.math.BigDecimal.valueOf(lzer,0).toString()).equals("0"); - (new com.ibm.math.DiagBigDecimal.Test("val018")).ok=(com.ibm.math.BigDecimal.valueOf(lzer,1).toString()).equals("0.0"); - (new com.ibm.math.DiagBigDecimal.Test("val019")).ok=(com.ibm.math.BigDecimal.valueOf(lzer,2).toString()).equals("0.00"); - (new com.ibm.math.DiagBigDecimal.Test("val020")).ok=(com.ibm.math.BigDecimal.valueOf(lzer,3).toString()).equals("0.000"); - (new com.ibm.math.DiagBigDecimal.Test("val021")).ok=(com.ibm.math.BigDecimal.valueOf(lzer,10).toString()).equals("0.0000000000"); - - (new com.ibm.math.DiagBigDecimal.Test("val022")).ok=(com.ibm.math.BigDecimal.valueOf(lmin,7).toString()).equals("-922337203685.4775808"); - (new com.ibm.math.DiagBigDecimal.Test("val023")).ok=(com.ibm.math.BigDecimal.valueOf(lmax,11).toString()).equals("92233720.36854775807"); - - - {try{checkscale:do{ - com.ibm.math.BigDecimal.valueOf((long)23,-8); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $127){e=$127; - flag=(e.getMessage()).equals("Negative scale: -8"); - }}/*checkscale*/ - (new com.ibm.math.DiagBigDecimal.Test("val100")).ok=flag; - - // valueOf(double) -- - - dzer=(double)0; - dpos=(double)1; - dpos=dpos/((double)10); - dneg=(double)-dpos; - (new com.ibm.math.DiagBigDecimal.Test("val201")).ok=(com.ibm.math.BigDecimal.valueOf(dneg).toString()).equals("-0.1"); - (new com.ibm.math.DiagBigDecimal.Test("val202")).ok=(com.ibm.math.BigDecimal.valueOf(dzer).toString()).equals("0.0"); // cf. constructor - (new com.ibm.math.DiagBigDecimal.Test("val203")).ok=(com.ibm.math.BigDecimal.valueOf(dpos).toString()).equals("0.1"); - dpos5=(double)0.5D; - dneg5=(double)-dpos5; - (new com.ibm.math.DiagBigDecimal.Test("val204")).ok=(com.ibm.math.BigDecimal.valueOf(dneg5).toString()).equals("-0.5"); - (new com.ibm.math.DiagBigDecimal.Test("val205")).ok=(com.ibm.math.BigDecimal.valueOf(dpos5).toString()).equals("0.5"); - dmin=java.lang.Double.MIN_VALUE; - dmax=java.lang.Double.MAX_VALUE; - (new com.ibm.math.DiagBigDecimal.Test("val206")).ok=(com.ibm.math.BigDecimal.valueOf(dmin).toString()).equals("4.9E-324"); - (new com.ibm.math.DiagBigDecimal.Test("val207")).ok=(com.ibm.math.BigDecimal.valueOf(dmax).toString()).equals("1.7976931348623157E+308"); - - // nasties - d=(double)9; - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("val210")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("0.9"); - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("val211")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("0.09"); - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("val212")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("0.0090"); - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("val213")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("9.0E-4"); - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("val214")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("8.999999999999999E-5"); - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("val215")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("8.999999999999999E-6"); - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("val216")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("8.999999999999999E-7"); - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("val217")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("8.999999999999999E-8"); - d=d/((double)10); - (new com.ibm.math.DiagBigDecimal.Test("val218")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("8.999999999999998E-9"); - - {try{checkpin:do{ - com.ibm.math.BigDecimal.valueOf(java.lang.Double.POSITIVE_INFINITY); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $128){ - flag=true; - }}/*checkpin*/ - (new com.ibm.math.DiagBigDecimal.Test("val301")).ok=flag; - {try{checknin:do{ - com.ibm.math.BigDecimal.valueOf(java.lang.Double.NEGATIVE_INFINITY); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $129){ - flag=true; - }}/*checknin*/ - (new com.ibm.math.DiagBigDecimal.Test("val302")).ok=flag; - {try{checknan:do{ - com.ibm.math.BigDecimal.valueOf(java.lang.Double.NaN); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $130){ - flag=true; - }}/*checknan*/ - (new com.ibm.math.DiagBigDecimal.Test("val303")).ok=flag; - - summary("valueOf"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link MathContext} class. */ - - public void diagmathcontext(){ - com.ibm.math.MathContext mccon1; - com.ibm.math.MathContext mccon2; - com.ibm.math.MathContext mccon3; - com.ibm.math.MathContext mccon4; - com.ibm.math.MathContext mcrmc; - com.ibm.math.MathContext mcrmd; - com.ibm.math.MathContext mcrmf; - com.ibm.math.MathContext mcrmhd; - com.ibm.math.MathContext mcrmhe; - com.ibm.math.MathContext mcrmhu; - com.ibm.math.MathContext mcrmun; - com.ibm.math.MathContext mcrmu; - boolean flag=false; - java.lang.IllegalArgumentException e=null; - // these tests are mostly existence checks - (new com.ibm.math.DiagBigDecimal.Test("mcn001")).ok=(com.ibm.math.MathContext.DEFAULT.getDigits())==9; - (new com.ibm.math.DiagBigDecimal.Test("mcn002")).ok=(com.ibm.math.MathContext.DEFAULT.getForm())==com.ibm.math.MathContext.SCIENTIFIC; - (new com.ibm.math.DiagBigDecimal.Test("mcn003")).ok=(com.ibm.math.MathContext.DEFAULT.getForm())!=com.ibm.math.MathContext.ENGINEERING; - (new com.ibm.math.DiagBigDecimal.Test("mcn004")).ok=(com.ibm.math.MathContext.DEFAULT.getForm())!=com.ibm.math.MathContext.PLAIN; - (new com.ibm.math.DiagBigDecimal.Test("mcn005")).ok=(com.ibm.math.MathContext.DEFAULT.getLostDigits()?1:0)==0; - (new com.ibm.math.DiagBigDecimal.Test("mcn006")).ok=(com.ibm.math.MathContext.DEFAULT.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - - (new com.ibm.math.DiagBigDecimal.Test("mcn010")).ok=com.ibm.math.MathContext.ROUND_CEILING>=0; - (new com.ibm.math.DiagBigDecimal.Test("mcn011")).ok=com.ibm.math.MathContext.ROUND_DOWN>=0; - (new com.ibm.math.DiagBigDecimal.Test("mcn012")).ok=com.ibm.math.MathContext.ROUND_FLOOR>=0; - (new com.ibm.math.DiagBigDecimal.Test("mcn013")).ok=com.ibm.math.MathContext.ROUND_HALF_DOWN>=0; - (new com.ibm.math.DiagBigDecimal.Test("mcn014")).ok=com.ibm.math.MathContext.ROUND_HALF_EVEN>=0; - (new com.ibm.math.DiagBigDecimal.Test("mcn015")).ok=com.ibm.math.MathContext.ROUND_HALF_UP>=0; - (new com.ibm.math.DiagBigDecimal.Test("mcn016")).ok=com.ibm.math.MathContext.ROUND_UNNECESSARY>=0; - (new com.ibm.math.DiagBigDecimal.Test("mcn017")).ok=com.ibm.math.MathContext.ROUND_UP>=0; - - mccon1=new com.ibm.math.MathContext(111); - (new com.ibm.math.DiagBigDecimal.Test("mcn021")).ok=(mccon1.getDigits())==111; - (new com.ibm.math.DiagBigDecimal.Test("mcn022")).ok=(mccon1.getForm())==com.ibm.math.MathContext.SCIENTIFIC; - (new com.ibm.math.DiagBigDecimal.Test("mcn023")).ok=(mccon1.getLostDigits()?1:0)==0; - (new com.ibm.math.DiagBigDecimal.Test("mcn024")).ok=(mccon1.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - - mccon2=new com.ibm.math.MathContext(78,com.ibm.math.MathContext.ENGINEERING); - (new com.ibm.math.DiagBigDecimal.Test("mcn031")).ok=(mccon2.getDigits())==78; - (new com.ibm.math.DiagBigDecimal.Test("mcn032")).ok=(mccon2.getForm())==com.ibm.math.MathContext.ENGINEERING; - (new com.ibm.math.DiagBigDecimal.Test("mcn033")).ok=(mccon2.getLostDigits()?1:0)==0; - (new com.ibm.math.DiagBigDecimal.Test("mcn034")).ok=(mccon2.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - - mccon3=new com.ibm.math.MathContext(5,com.ibm.math.MathContext.PLAIN,true); - (new com.ibm.math.DiagBigDecimal.Test("mcn041")).ok=(mccon3.getDigits())==5; - (new com.ibm.math.DiagBigDecimal.Test("mcn042")).ok=(mccon3.getForm())==com.ibm.math.MathContext.PLAIN; - (new com.ibm.math.DiagBigDecimal.Test("mcn043")).ok=(mccon3.getLostDigits()?1:0)==1; - (new com.ibm.math.DiagBigDecimal.Test("mcn044")).ok=(mccon3.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - - mccon4=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_FLOOR); - (new com.ibm.math.DiagBigDecimal.Test("mcn051")).ok=(mccon4.getDigits())==0; - (new com.ibm.math.DiagBigDecimal.Test("mcn052")).ok=(mccon4.getForm())==com.ibm.math.MathContext.SCIENTIFIC; - (new com.ibm.math.DiagBigDecimal.Test("mcn053")).ok=(mccon4.getLostDigits()?1:0)==0; - (new com.ibm.math.DiagBigDecimal.Test("mcn054")).ok=(mccon4.getRoundingMode())==com.ibm.math.MathContext.ROUND_FLOOR; - - (new com.ibm.math.DiagBigDecimal.Test("mcn061")).ok=(mccon1.toString()).equals("digits=111 form=SCIENTIFIC lostDigits=0 roundingMode=ROUND_HALF_UP"); - - (new com.ibm.math.DiagBigDecimal.Test("mcn062")).ok=(mccon2.toString()).equals("digits=78 form=ENGINEERING lostDigits=0 roundingMode=ROUND_HALF_UP"); - - (new com.ibm.math.DiagBigDecimal.Test("mcn063")).ok=(mccon3.toString()).equals("digits=5 form=PLAIN lostDigits=1 roundingMode=ROUND_HALF_UP"); - - (new com.ibm.math.DiagBigDecimal.Test("mcn064")).ok=(mccon4.toString()).equals("digits=0 form=SCIENTIFIC lostDigits=0 roundingMode=ROUND_FLOOR"); - - - // complete testing rounding modes round trips - mcrmc=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_CEILING); - mcrmd=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_DOWN); - mcrmf=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_FLOOR); - mcrmhd=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_HALF_DOWN); - mcrmhe=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_HALF_EVEN); - mcrmhu=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_HALF_UP); - mcrmun=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_UNNECESSARY); - mcrmu=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_UP); - - (new com.ibm.math.DiagBigDecimal.Test("mcn071")).ok=(mcrmc.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_CEILING"); - - (new com.ibm.math.DiagBigDecimal.Test("mcn072")).ok=(mcrmd.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_DOWN"); - - (new com.ibm.math.DiagBigDecimal.Test("mcn073")).ok=(mcrmf.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_FLOOR"); - - (new com.ibm.math.DiagBigDecimal.Test("mcn074")).ok=(mcrmhd.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_HALF_DOWN"); - - (new com.ibm.math.DiagBigDecimal.Test("mcn075")).ok=(mcrmhe.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_HALF_EVEN"); - - (new com.ibm.math.DiagBigDecimal.Test("mcn076")).ok=(mcrmhu.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_HALF_UP"); - - (new com.ibm.math.DiagBigDecimal.Test("mcn077")).ok=(mcrmun.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_UNNECESSARY"); - - (new com.ibm.math.DiagBigDecimal.Test("mcn078")).ok=(mcrmu.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_UP"); - - - // [get methods tested already] - - // errors... - - {try{checkdig:do{ - new com.ibm.math.MathContext(-1); - flag=false; - }while(false);} - catch (java.lang.IllegalArgumentException $131){e=$131; - flag=(e.getMessage()).equals("Digits too small: -1"); - }}/*checkdig*/ - (new com.ibm.math.DiagBigDecimal.Test("mcn101")).ok=flag; - {try{checkdigbig:do{ - new com.ibm.math.MathContext(1000000000); - flag=false; - }while(false);} - catch (java.lang.IllegalArgumentException $132){e=$132; - flag=(e.getMessage()).equals("Digits too large: 1000000000"); - }}/*checkdigbig*/ - (new com.ibm.math.DiagBigDecimal.Test("mcn102")).ok=flag; - - {try{checkform:do{ - new com.ibm.math.MathContext(0,5); - flag=false; - }while(false);} - catch (java.lang.IllegalArgumentException $133){e=$133; - flag=(e.getMessage()).equals("Bad form value: 5"); - }}/*checkform*/ - (new com.ibm.math.DiagBigDecimal.Test("mcn111")).ok=flag; - {try{checkformneg:do{ - new com.ibm.math.MathContext(0,-1); - flag=false; - }while(false);} - catch (java.lang.IllegalArgumentException $134){e=$134; - flag=(e.getMessage()).equals("Bad form value: -1"); - }}/*checkformneg*/ - (new com.ibm.math.DiagBigDecimal.Test("mcn112")).ok=flag; - - // [lostDigits cannot be invalid] - - {try{checkround:do{ - new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,12); - flag=false; - }while(false);} - catch (java.lang.IllegalArgumentException $135){e=$135; - flag=(e.getMessage()).equals("Bad roundingMode value: 12"); - }}/*checkround*/ - (new com.ibm.math.DiagBigDecimal.Test("mcn121")).ok=flag; - {try{checkroundneg:do{ - new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,-1); - flag=false; - }while(false);} - catch (java.lang.IllegalArgumentException $136){e=$136; - flag=(e.getMessage()).equals("Bad roundingMode value: -1"); - }}/*checkroundneg*/ - (new com.ibm.math.DiagBigDecimal.Test("mcn122")).ok=flag; - - summary("MathContext"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test general arithmetic (base operators). - *

    Unlike the specific method tests, these tests were randomly - * generated by an IBM Object Rexx procedure, then manually corrected - * for known differences from ANSI X3-274. These differences are: - *

      - *
    1. the trigger point in exponential notation is fixed in ANSI - * X3-274 but varies with DIGITS in Classic and Object Rexx - *
    2. some trailing zeros were missing (e.g., 1.3 + 1E-60 should show - * seven trailing zeros) - *
    3. the power operator is less accurate in Object Rexx - *
    4. ANSI X3-274 [errata 1999] rounds input numbers to DIGITS (rather - * than truncating to DIGITS+1). - *
    - */ - - public void diagmath(){ - com.ibm.math.MathContext def; - def=com.ibm.math.MathContext.DEFAULT; - mathtest(1,def,"-9375284.42","5516.99832E+27276984","5.51699832E+27276987","-5.51699832E+27276987","-5.17234284E+27276994","-1.69934516E-27276981","0","-9375284.42","6.79057752E+41"); - mathtest(2,def,"-410.832710","99.3588243E-502740862","-410.832710","-410.832710","-4.08198550E-502740858","-4.13483868E+502740862","","","1.36977786E+26"); - mathtest(3,def,"80025.2340","-8.03097581","80017.2030","80033.2650","-642680.718","-9964.57167","-9964","4.59102916","5.94544517E-40"); - mathtest(4,def,"81052020.2","-464525495","-383473475","545577515","-3.76507298E+16","-0.17448347","0","81052020.2",""); - mathtest(5,def,"715.069294E-26923151","85.4404128E+796388557","8.54404128E+796388558","-8.54404128E+796388558","6.10958157E+769465410","8.36921628E-823311708","0","7.15069294E-26923149","4.88802213E-242308334"); - mathtest(6,def,"-21971575.0E+31454441","-70944960.3E+111238221","-7.09449603E+111238228","7.09449603E+111238228","1.55877252E+142692677","3.09698884E-79783781","0","-2.19715750E+31454448","-4.04549502E-220181139"); - mathtest(7,def,"682.25316","54470185.6","54470867.9","-54469503.4","3.71624563E+10","0.0000125252586","0","682.25316","3.48578699E+154365541"); - mathtest(8,def,"-257586757.","2082888.71","-255503868","-259669646","-5.36524548E+14","-123.668036","-123","-1391445.67","-1.26879515E+17519020"); - mathtest(9,def,"319577540.E+242599761","60.7124561","3.19577540E+242599769","3.19577540E+242599769","1.94023374E+242599771","5.26378869E+242599767","","",""); - mathtest(10,def,"-13769977.0","24371.3381","-13745605.7","-13794348.3","-3.35592765E+11","-565.007015","-565","-170.9735","-8.73734001E+173982"); - mathtest(11,def,"-475.434972E-725464311","-3.22214066E-865476836","-4.75434972E-725464309","-4.75434972E-725464309","","1.47552519E+140012527","","",""); - mathtest(12,def,"842.01250","197199893","197200735","-197199051","1.66044775E+11","0.00000426984258","0","842.01250","7.00674164E+576872502"); - mathtest(13,def,"572.173103E+280128428","-7140.19428","5.72173103E+280128430","5.72173103E+280128430","-4.08542712E+280128434","-8.01341085E+280128426","","",""); - mathtest(14,def,"674235.954E+476135291","9684.82245","6.74235954E+476135296","6.74235954E+476135296","6.52985550E+476135300","6.96177919E+476135292","","",""); - mathtest(15,def,"-360557.921E+437116514","930428850","-3.60557921E+437116519","-3.60557921E+437116519","-3.35473492E+437116528","-3.87517993E+437116510","","",""); - mathtest(16,def,"957165918E-394595705","1676.59073E-829618944","9.57165918E-394595697","9.57165918E-394595697","","5.70900161E+435023244","","","9.16166595E-789191393"); - mathtest(17,def,"-2610864.40","31245912.7","28635048.3","-33856777.1","-8.15788411E+13","-0.0835585897","0","-2610864.40","-3.12008905E+200498284"); - mathtest(18,def,"959.548461","98.994577E+776775426","9.89945770E+776775427","-9.89945770E+776775427","9.49900940E+776775430","9.69293965E-776775426","0","959.548461","6.61712185E+29"); - mathtest(19,def,"-41085.0268","3115477.61","3074392.58","-3156562.64","-1.27999481E+11","-0.0131873927","0","-41085.0268","4.73844173E+14373829"); - mathtest(20,def,"-723420285.","2681660.35","-720738625","-726101945","-1.93996749E+15","-269.765813","-269","-2053650.85","4.14324113E+23757873"); - mathtest(21,def,"63542018.0E-817732230","-8836243.22","-8836243.22","8836243.22","-5.61472726E-817732216","-7.19106711E-817732230","0","6.35420180E-817732223",""); - mathtest(22,def,"-96051.7108","-291201.955","-387253.666","195150.244","2.79704460E+10","0.329845694","0","-96051.7108","3.53617153E-1450916"); - mathtest(23,def,"108490.853","91685996.5","91794487.4","-91577505.7","9.94709197E+12","0.00118328706","0","108490.853","6.98124265E+461675038"); - mathtest(24,def,"-27489.1735","-9835835.4E-506411649","-27489.1735","-27489.1735","2.70378986E-506411638","2.79479804E+506411646","","","4.05866472E-45"); - mathtest(25,def,"-89220406.6","993391.008E-611041175","-89220406.6","-89220406.6","-8.86307496E-611041162","-8.98139865E+611041176","","","3.19625913E+79"); - mathtest(26,def,"4.75502020","-17089144.9","-17089140.2","17089149.7","-81259229.2","-2.78247989E-7","0","4.75502020","1.0630191E-11571955"); - mathtest(27,def,"68027916.2","-796883.839","67231032.4","68824800.0","-5.42103470E+13","-85.3674185","-85","292789.885","8.29415374E-6241744"); - mathtest(28,def,"-8.01969439E+788605478","92154156.0","-8.01969439E+788605478","-8.01969439E+788605478","-7.39048168E+788605486","-8.70247717E+788605470","","",""); - mathtest(29,def,"-8012.98341","96188.8651","88175.8817","-104201.849","-770759780","-0.0833046881","0","-8012.98341","-1.16010156E+375502"); - mathtest(30,def,"21761476E+592330677","-9.70744506","2.17614760E+592330684","2.17614760E+592330684","-2.11248333E+592330685","-2.24173053E+592330683","","",""); - mathtest(31,def,"-9840778.51","-17907.219","-9858685.73","-9822871.29","1.76220976E+11","549.542534","549","-9715.279","-6.62997437E-125225"); - mathtest(32,def,"-4.1097614","-819.225776E-145214751","-4.10976140","-4.10976140","3.36682247E-145214748","5.01664074E+145214748","","","0.0000122876018"); - mathtest(33,def,"-448.880985","-394.087374E-442511435","-448.880985","-448.880985","1.76898329E-442511430","1.13903925E+442511435","","","2.46306099E-11"); - mathtest(34,def,"779.445304E+882688544","-797868519","7.79445304E+882688546","7.79445304E+882688546","-6.21894870E+882688555","-9.7690946E+882688537","","",""); - mathtest(35,def,"799995477","-6.23675208E+156309440","-6.23675208E+156309440","6.23675208E+156309440","-4.98937346E+156309449","-1.28271169E-156309432","0","799995477","3.81482667E-54"); - mathtest(36,def,"-51932.8170","591840275E-278480289","-51932.8170","-51932.8170","-3.07359327E-278480276","-8.7748028E+278480284","","","1.96178443E+28"); - mathtest(37,def,"70.3552392","-4228656.73","-4228586.38","4228727.09","-297508156","-0.0000166377277","0","70.3552392","9.14742382E-7811584"); - mathtest(38,def,"1588359.34","-12232799.2","-10644439.9","13821158.5","-1.94300809E+13","-0.129844307","0","1588359.34","1.56910086E-75854960"); - mathtest(39,def,"2842.16206","-3.23234345","2838.92972","2845.39440","-9186.84392","-879.288388","-879","0.93216745","4.35565514E-11"); - mathtest(40,def,"29960.2305","45.2735747E-95205475","29960.2305","29960.2305","1.35640673E-95205469","6.61759773E+95205477","","","2.413936E+22"); - mathtest(41,def,"2916565.77","1151935.43E-787118724","2916565.77","2916565.77","3.35969544E-787118712","2.53188303E+787118724","","","2916565.77"); - mathtest(42,def,"-52723012.9E-967143787","79.4088237","79.4088237","-79.4088237","-4.18667244E-967143778","-6.63944011E-967143782","0","-5.27230129E-967143780",""); - mathtest(43,def,"-167473465","793646.597","-166679819","-168267112","-1.32914746E+14","-211.017682","-211","-14033.033","-1.19053789E+6526910"); - mathtest(44,def,"-31769071.0","133.4360","-31768937.6","-31769204.4","-4.23913776E+9","-238084.707","-238084","-94.3760","-5.84252432E+997"); - mathtest(45,def,"45960.6383","-93352.7468","-47392.1085","139313.385","-4.29055183E+9","-0.492333004","0","45960.6383","1.88335323E-435248"); - mathtest(46,def,"606.175648","5.28528458E-981983620","606.175648","606.175648","3.20381081E-981983617","1.14691203E+981983622","","","8.18450516E+13"); - mathtest(47,def,"171578.617E+643006110","-407774.293","1.71578617E+643006115","1.71578617E+643006115","-6.99653492E+643006120","-4.20768597E+643006109","","",""); - mathtest(48,def,"-682286332.","-464.871699","-682286797","-682285867","3.17175606E+11","1467687.39","1467687","-182.709787","-1.6050843E-4108"); - mathtest(49,def,"492088.428","653.72170","492742.150","491434.706","321688884","752.74911","752","489.70960","3.94658596E+3722"); - mathtest(50,def,"74303782.5","1141.68058","74304924.2","74302640.8","8.48311855E+10","65082.812","65082","926.99244","4.94849869E+8988"); - mathtest(51,def,"74.7794084E+119375329","-34799355.6","7.47794084E+119375330","7.47794084E+119375330","-2.60227522E+119375338","-2.14887337E+119375323","","",""); - mathtest(52,def,"-9432.08369","33735.5058","24303.4221","-43167.5895","-318196114","-0.279589218","0","-9432.08369","2.309567E+134087"); - mathtest(53,def,"4249198.78E-112433155","418673051.","418673051","-418673051","1.77902502E-112433140","1.01492054E-112433157","0","4.24919878E-112433149",""); - mathtest(54,def,"-2960933.02","-207933.38","-3168866.40","-2752999.64","6.15676811E+11","14.2398158","14","-49865.70","-2.75680397E-1345624"); - mathtest(55,def,"29317.7519E+945600035","1.43555750","2.93177519E+945600039","2.93177519E+945600039","4.20873186E+945600039","2.04225549E+945600039","","","2.93177519E+945600039"); - mathtest(56,def,"-51.1693770","-638055.414","-638106.583","638004.245","32648898.0","0.0000801958198","0","-51.1693770","-3.48266075E-1090443"); - mathtest(57,def,"-756343055.","-68.9248344E+217100975","-6.89248344E+217100976","6.89248344E+217100976","5.21308198E+217100985","1.09734475E-217100968","0","-756343055","-7.06265897E-63"); - mathtest(58,def,"2538.80406E+694185197","-3386499.65","2.53880406E+694185200","2.53880406E+694185200","-8.59765906E+694185206","-7.49683839E+694185193","","",""); - mathtest(59,def,"-54344.0672","-8086.45235","-62430.5196","-46257.6149","439450710","6.72038427","6","-5825.35310","3.62916861E-38289"); - mathtest(60,def,"3.31600054","217481648","217481651","-217481645","721169262","1.5247266E-8","0","3.31600054","3.73134969E+113224119"); - mathtest(61,def,"681832.671","320341.161E+629467560","3.20341161E+629467565","-3.20341161E+629467565","2.18419069E+629467571","2.12845789E-629467560","0","681832.671","3.16981139E+17"); - mathtest(62,def,"832689481","348040024E-882122501","832689481","832689481","2.89809267E-882122484","2.3925107E+882122501","","","5.77363381E+26"); - mathtest(63,def,"14.5512326E+257500811","60.9979577E-647314724","1.45512326E+257500812","1.45512326E+257500812","8.87595471E-389813911","2.38552784E+904815534","","",""); - mathtest(64,def,"-901.278844","449461667.","449460766","-449462568","-4.05090292E+11","-0.00000200524074","0","-901.278844",""); - mathtest(65,def,"-5.32627675","-738860216E-238273224","-5.32627675","-5.32627675","3.93537399E-238273215","7.20877459E+238273215","","","-0.00000822306838"); - mathtest(66,def,"-505383463.","3.18756328","-505383460","-505383466","-1.61094177E+9","-158548527","-158548527","-0.23671144","-1.29081226E+26"); - mathtest(67,def,"769241.44E-720927320","-145382631.","-145382631","145382631","-1.11834344E-720927306","-5.29115091E-720927323","0","7.6924144E-720927315",""); - mathtest(68,def,"-6.45038910","56736.4411E+440937167","5.67364411E+440937171","-5.67364411E+440937171","-3.65972121E+440937172","-1.13690407E-440937171","0","-6.45038910","72030.3421"); - mathtest(69,def,"58.4721075","-712186829","-712186771","712186887","-4.16430648E+10","-8.21022028E-8","0","58.4721075",""); - mathtest(70,def,"8244.08357","245.302828E+652007959","2.45302828E+652007961","-2.45302828E+652007961","2.02229701E+652007965","3.36077804E-652007958","0","8244.08357","67964913.9"); - mathtest(71,def,"45.5361397","-76579063.9","-76579018.4","76579109.4","-3.48711495E+9","-5.94629098E-7","0","45.5361397","3.98335374E-126995367"); - mathtest(72,def,"594420.54E+685263039","-952420.179","5.94420540E+685263044","5.94420540E+685263044","-5.66138117E+685263050","-6.24115861E+685263038","","",""); - mathtest(73,def,"-841310701.","9398110.4","-831912591","-850708811","-7.90673085E+15","-89.5191337","-89","-4878875.4","1.30001466E+83877722"); - mathtest(74,def,"904392146E-140100276","168116093.","168116093","-168116093","1.52042874E-140100259","5.37956914E-140100276","0","9.04392146E-140100268",""); - mathtest(75,def,"-907324792E+685539670","-15.6902171","-9.07324792E+685539678","-9.07324792E+685539678","1.42361230E+685539680","5.78274211E+685539677","","",""); - mathtest(76,def,"987013606.","-26818.3572E+560907442","-2.68183572E+560907446","2.68183572E+560907446","-2.64700834E+560907455","-3.68036565E-560907438","0","987013606","1.0399934E-27"); - mathtest(77,def,"-741317564","630.241530E-212782946","-741317564","-741317564","-4.67209116E-212782935","-1.1762436E+212782952","","","1.65968527E+53"); - mathtest(78,def,"61867907.2","-139204670","-77336763","201072577","-8.61230161E+15","-0.444438446","0","61867907.2",""); - mathtest(79,def,"-273.622743E+531282717","-4543.68684","-2.73622743E+531282719","-2.73622743E+531282719","1.24325606E+531282723","6.02204229E+531282715","","",""); - mathtest(80,def,"-383588949.","-428640583.","-812229532","45051634","1.64421791E+17","0.89489648","0","-383588949",""); - mathtest(81,def,"-56182.2686","32.7741649","-56149.4944","-56215.0428","-1841326.94","-1714.22426","-1714","-7.3499614","-5.45476402E+156"); - mathtest(82,def,"-6366384.30","332014.980","-6034369.32","-6698399.28","-2.11373496E+12","-19.1749911","-19","-58099.680","-3.05392399E+2258994"); - mathtest(83,def,"-1.27897702","-8213776.03E-686519123","-1.27897702","-1.27897702","1.05052308E-686519116","1.55711212E+686519116","","","0.139668371"); - mathtest(84,def,"65.4059036","401162145E+884155506","4.01162145E+884155514","-4.01162145E+884155514","2.62383726E+884155516","1.63041066E-884155513","0","65.4059036","18300704.1"); - mathtest(85,def,"-20630916.8","158987411.E-480500612","-20630916.8","-20630916.8","-3.28005605E-480500597","-1.29764468E+480500611","","","4.25634728E+14"); - mathtest(86,def,"-4.72705853","-97626742.4","-97626747.1","97626737.7","461487325","4.84197097E-8","0","-4.72705853","2.92654449E-65858120"); - mathtest(87,def,"8.43528169","-4573.45752","-4565.02224","4581.89280","-38578.4025","-0.00184439927","0","8.43528169","8.84248688E-4236"); - mathtest(88,def,"1.91075189","-704247089.","-704247087","704247091","-1.34564146E+9","-2.71318394E-9","0","1.91075189","6.84547494E-198037309"); - mathtest(89,def,"31997198E-551746308","326.892584","326.892584","-326.892584","1.04596467E-551746298","9.78829119E-551746304","0","3.1997198E-551746301",""); - mathtest(90,def,"127589.213","84184304.","84311893.2","-84056714.8","1.07410091E+13","0.00151559385","0","127589.213","2.87917042E+429829394"); - mathtest(91,def,"714494248","-7025063.59","707469185","721519312","-5.01936753E+15","-101.706446","-101","4962825.41","1.65018516E-62199908"); - mathtest(92,def,"-52987680.2E+279533503","-42014114.8","-5.29876802E+279533510","-5.29876802E+279533510","2.22623048E+279533518","1.26118759E+279533503","","",""); - mathtest(93,def,"-8795.0513","-225294.394E-884414238","-8795.05130","-8795.05130","1.98147575E-884414229","3.90380388E+884414236","","","1.2927759E-8"); - mathtest(94,def,"83280.1394","161566354.","161649634","-161483074","1.34552685E+13","0.000515454718","0","83280.1394","5.30774809E+794993940"); - mathtest(95,def,"112.877897","-9.96481666","102.913080","122.842714","-1124.80755","-11.3276441","-11","3.26491374","2.97790545E-21"); - mathtest(96,def,"-572542.121E+847487397","433.843420","-5.72542121E+847487402","-5.72542121E+847487402","-2.48393632E+847487405","-1.3196976E+847487400","","",""); - mathtest(97,def,"4709649.89","20949266.4","25658916.3","-16239616.5","9.86637102E+13","0.224812163","0","4709649.89","4.85293644E+139794213"); - mathtest(98,def,"-9475.19322","-30885.2475E+584487341","-3.08852475E+584487345","3.08852475E+584487345","2.92643688E+584487349","3.06787026E-584487342","0","-9475.19322","-1.17553557E-12"); - mathtest(99,def,"-213230447.","864.815822E+127783046","8.64815822E+127783048","-8.64815822E+127783048","-1.84405064E+127783057","-2.46561686E-127783041","0","-213230447","-9.11261361E+74"); - mathtest(100,def,"-89.1168786E+403375873","6464.05744","-8.91168786E+403375874","-8.91168786E+403375874","-5.76056622E+403375878","-1.37865233E+403375871","","",""); - mathtest(101,def,"61774.4958","-14000.7706","47773.7252","75775.2664","-864890545","-4.41222112","-4","5771.4134","7.59030407E-67077"); - mathtest(102,def,"1.60731414","7.04330293E-427033419","1.60731414","1.60731414","1.13208004E-427033418","2.28204602E+427033418","","","27.7143921"); - mathtest(103,def,"7955012.51","-230117662.","-222162650","238072675","-1.83058888E+15","-0.0345693261","0","7955012.51",""); - mathtest(104,def,"4086661.08","1.77621994","4086662.86","4086659.30","7258808.90","2300762.98","2300762","1.73840572","1.67007988E+13"); - mathtest(105,def,"-610.076931","-207.658306","-817.735237","-402.418625","126687.542","2.93788841","2","-194.760319","4.36518377E-580"); - mathtest(106,def,"-98.6353697","-99253.3899E-716309653","-98.6353697","-98.6353697","9.78989481E-716309647","9.93773309E+716309649","","","1.14729007E-20"); - mathtest(107,def,"-959923730","409.125542E-900295528","-959923730","-959923730","-3.92729316E-900295517","-2.3462816E+900295534","","","8.49076677E+35"); - mathtest(108,def,"379965133","-8.15869657","379965125","379965141","-3.10002023E+9","-46571793.6","-46571793","5.19214999","2.30170697E-69"); - mathtest(109,def,"833.646797","1389499.46E-443407251","833.646797","833.646797","1.15835177E-443407242","5.99961944E+443407247","","","833.646797"); - mathtest(110,def,"2314933.4E-646489194","-7401538.17","-7401538.17","7401538.17","-1.71340679E-646489181","-3.12763826E-646489195","0","2.3149334E-646489188",""); - mathtest(111,def,"808525347","-5959.74667E+58232168","-5.95974667E+58232171","5.95974667E+58232171","-4.81860624E+58232180","-1.35664382E-58232163","0","808525347","3.5796302E-54"); - mathtest(112,def,"-17220490.6E+726428704","19.9855688","-1.72204906E+726428711","-1.72204906E+726428711","-3.44161300E+726428712","-8.61646259E+726428709","","",""); - mathtest(113,def,"59015.9705","-72070405.4E+322957279","-7.20704054E+322957286","7.20704054E+322957286","-4.25330492E+322957291","-8.18865527E-322957283","0","59015.9705","4.01063488E-34"); - mathtest(114,def,"16411470E+578192008","497470.005E-377473621","1.64114700E+578192015","1.64114700E+578192015","8.16421406E+200718399","3.29898684E+955665630","","",""); - mathtest(115,def,"-107.353544E+609689808","-659.50136E-456711743","-1.07353544E+609689810","-1.07353544E+609689810","7.07998083E+152978069","","","",""); - mathtest(116,def,"786.134163","-53.0292275E-664419768","786.134163","786.134163","-4.16880874E-664419764","-1.48245449E+664419769","","","3.33055532E-15"); - mathtest(117,def,"23.5414714","5000786.91","5000810.45","-5000763.37","117725882","0.0000047075534","0","23.5414714","4.4895618E+6860247"); - mathtest(118,def,"-69775.6113","561292120.","561222344","-561361896","-3.91645008E+13","-0.000124312473","0","-69775.6113",""); - mathtest(119,def,"919043.871","-71606613.7","-70687569.8","72525657.6","-6.58096194E+13","-0.0128346227","0","919043.871","3.05862429E-427014317"); - mathtest(120,def,"-27667.1915","-293455.107E-789181924","-27667.1915","-27667.1915","8.11907864E-789181915","9.42808315E+789181922","","","-4.72176938E-14"); - mathtest(121,def,"-908603625.","-982.409273E+449441134","-9.82409273E+449441136","9.82409273E+449441136","8.92620627E+449441145","9.2487281E-449441129","0","-908603625","2.60768632E-90"); - mathtest(122,def,"847.113351","5.71511268","852.828464","841.398238","4841.34825","148.223386","148","1.27667436","3.69529538E+17"); - mathtest(123,def,"-992140475","3.82918218","-992140471","-992140479","-3.79908663E+9","-259099836","-259099836","-0.14787752","9.68930595E+35"); - mathtest(124,def,"-12606437.5","268123145E+362798858","2.68123145E+362798866","-2.68123145E+362798866","-3.38007767E+362798873","-4.70173416E-362798860","0","-12606437.5","-2.00344362E+21"); - mathtest(125,def,"3799470.64","-264.703992","3799205.94","3799735.34","-1.00573505E+9","-14353.6583","-14353","174.242824","2.3625466E-1744"); - mathtest(126,def,"-8.11070247","-931284056.E-654288974","-8.11070247","-8.11070247","7.55336789E-654288965","8.70916067E+654288965","","","-6.58375662E-9"); - mathtest(127,def,"-242660177.","-6.09832715E-943742415","-242660177","-242660177","1.47982115E-943742406","3.97912692E+943742422","","","4.89788901E-51"); - mathtest(128,def,"76.1463803","-45.6758006E-636907996","76.1463803","76.1463803","-3.47804688E-636907993","-1.66710554E+636907996","","","3.90619287E-10"); - mathtest(129,def,"761185.862","-70878470.9E+221214712","-7.08784709E+221214719","7.08784709E+221214719","-5.39516900E+221214725","-1.07393099E-221214714","0","761185.862","6.75406144E-42"); - mathtest(130,def,"6203606.54","-195.92748E-833512061","6203606.54","6203606.54","-1.21545700E-833512052","-3.1662769E+833512065","","","2.59843292E-14"); - mathtest(131,def,"-163274837.","95.0448550E+887876533","9.50448550E+887876534","-9.50448550E+887876534","-1.55184332E+887876543","-1.71787139E-887876527","0","-163274837","1.34645731E+82"); - mathtest(132,def,"2.38638190","-807986179.","-807986177","807986181","-1.92816359E+9","-2.95349347E-9","0","2.38638190","1.19029305E-305208656"); - mathtest(133,def,"-109022296E-811981158","7.19685680","7.19685680","-7.19685680","-7.84617852E-811981150","-1.51485988E-811981151","0","-1.09022296E-811981150",""); - mathtest(134,def,"-559250.780E-273710421","-393780811.","-393780811","393780811","2.20222226E-273710407","1.42020831E-273710424","0","-5.59250780E-273710416",""); - mathtest(135,def,"-88021.9966E+555334642","7599686.64E+818884053","7.59968664E+818884059","-7.59968664E+818884059","","-1.15823192E-263549413","0","-8.80219966E+555334646",""); - mathtest(136,def,"194.317648E-197450009","-930.979064","-930.979064","930.979064","-1.80905662E-197450004","-2.08723972E-197450010","0","1.94317648E-197450007",""); - mathtest(137,def,"9495479.65","7405697.96","16901177.6","2089781.69","7.03206543E+13","1.28218565","1","2089781.69","1.0135446E+51673383"); - mathtest(138,def,"-1656.28925","-163050511E-682882380","-1656.28925","-1656.28925","2.70058809E-682882369","1.01581359E+682882375","","","3.64525265E-7"); - mathtest(139,def,"95581.3784E+64262149","-99.2879365","9.55813784E+64262153","9.55813784E+64262153","-9.49007783E+64262155","-9.62668596E+64262151","","",""); - mathtest(140,def,"643761.452","3.73446939","643765.186","643757.718","2404107.44","172383.647","172383","2.41514363","1.71751236E+23"); - mathtest(141,def,"7960.49866E-129827423","3220.22850","3220.22850","-3220.22850","2.56346247E-129827416","2.47202913E-129827423","0","7.96049866E-129827420",""); - mathtest(142,def,"-6356.64112E-707203818","1805054.98","1805054.98","-1805054.98","-1.14740867E-707203808","-3.52157756E-707203821","0","-6.35664112E-707203815",""); - mathtest(143,def,"2.3904042","8476.52006","8478.91046","-8474.12966","20262.3092","0.000282003013","0","2.3904042","2.00251752E+3208"); - mathtest(144,def,"-713298.658","-957.782729","-714256.441","-712340.875","683185135","744.739528","744","-708.307624","3.68122321E-5608"); - mathtest(145,def,"607779233.E-820497365","-20.1188742E-857318323","6.07779233E-820497357","6.07779233E-820497357","","-3.02094057E+36820965","","",""); - mathtest(146,def,"-205888251","-908.792922E+250680613","-9.08792922E+250680615","9.08792922E+250680615","1.87109785E+250680624","2.26551336E-250680608","0","-205888251","-1.5042358E-75"); - mathtest(147,def,"51542399.1","-23212.2414","51519186.9","51565611.3","-1.19641461E+12","-2220.4835","-2220","11223.1920","1.71641348E-179015"); - mathtest(148,def,"4.44287230","158923023","158923027","-158923019","706074697","2.79561275E-8","0","4.44287230","7.12573416E+102928693"); - mathtest(149,def,"-79123682.6","-3.8571770","-79123686.5","-79123678.8","305194049","20513365.8","20513365","-2.9293950","2.55137345E-32"); - mathtest(150,def,"-80.3324347E-569715030","883142.351","883142.351","-883142.351","-7.09449752E-569715023","-9.09620455E-569715035","0","-8.03324347E-569715029",""); - mathtest(151,def,"13637.483","-52798.5631","-39161.0801","66436.0461","-720039507","-0.258292692","0","13637.483","1.47163791E-218310"); - mathtest(152,def,"6.42934843E-276476458","84057440.0E-388039782","6.42934843E-276476458","6.42934843E-276476458","5.40434570E-664516232","7.64875593E+111563316","","",""); - mathtest(153,def,"-5.64133087","-17401297.","-17401302.6","17401291.4","98166473.9","3.24190253E-7","0","-5.64133087","-1.25908916E-13075014"); - mathtest(154,def,"95469.7057E+865733824","198.829749","9.54697057E+865733828","9.54697057E+865733828","1.89822176E+865733831","4.80158056E+865733826","","",""); - mathtest(155,def,"-416466.209","-930153427","-930569893","929736961","3.87377472E+14","0.000447739262","0","-416466.209",""); - mathtest(156,def,"-1541733.85","-1.99208708","-1541735.84","-1541731.86","3071268.08","773928.944","773928","-1.88034976","4.20708401E-13"); - mathtest(157,def,"-39152691.8","-645131748.","-684284440","605979056","2.52586445E+16","0.0606894513","0","-39152691.8",""); - mathtest(158,def,"113.939979","-58282550.4","-58282436.5","58282664.3","-6.64071257E+9","-0.0000019549587","0","113.939979","2.106557E-119868330"); - mathtest(159,def,"-324971.736","-9517.15154","-334488.888","-315454.585","3.09280526E+9","34.1459033","34","-1388.58364","-5.82795263E-52457"); - mathtest(160,def,"-76.9436744","-9548122.75E-273599728","-76.9436744","-76.9436744","7.34667648E-273599720","8.05851332E+273599722","","","1.37489895E-19"); - mathtest(161,def,"-430393.282","-70.2551505","-430463.537","-430323.027","30237344.8","6126.14561","6126","-10.2300370","4.26006409E-395"); - mathtest(162,def,"-3308051.90","-349433799.E+397813188","-3.49433799E+397813196","3.49433799E+397813196","1.15594514E+397813203","9.46689161E-397813191","0","-3308051.90","-2.76237768E-20"); - mathtest(163,def,"23.1543212E-655822712","5848.20853","5848.20853","-5848.20853","1.35411299E-655822707","3.95921607E-655822715","0","2.31543212E-655822711",""); - mathtest(164,def,"-174.261308E-82902077","-200096204.","-200096204","200096204","3.48690262E-82902067","8.70887626E-82902084","0","-1.74261308E-82902075",""); - mathtest(165,def,"-50669105.2","9105789.01E+609889700","9.10578901E+609889706","-9.10578901E+609889706","-4.61382181E+609889714","-5.56449366E-609889700","0","-50669105.2","-2.20135008E+69"); - mathtest(166,def,"424768856.","-971.71757","424767884","424769828","-4.12755361E+11","-437132.012","-437132","11.19076","2.72651473E-8387"); - mathtest(167,def,"7181.2767","999117.918","1006299.19","-991936.641","7.17494223E+9","0.00718761677","0","7181.2767","3.09655124E+3852800"); - mathtest(168,def,"8096417.07E-433694528","-68.4863363","-68.4863363","68.4863363","-5.54493942E-433694520","-1.18219451E-433694523","0","8.09641707E-433694522",""); - mathtest(169,def,"1236287.5","-7119.97299E-176200498","1236287.50","1236287.50","-8.80233361E-176200489","-1.73636544E+176200500","","","2.26549784E-43"); - mathtest(170,def,"-752995833E-654401067","-15.2736930E+803939983","-1.52736930E+803939984","1.52736930E+803939984","1.15010272E+149538926","","0","-7.52995833E-654401059",""); - mathtest(171,def,"702992.459","-312.689474","702679.770","703305.148","-219818342","-2248.21274","-2248","66.521448","8.02493322E-1831"); - mathtest(172,def,"-4414.38805","-17680.4630E-584364536","-4414.38805","-4414.38805","7.80484246E-584364529","2.49676044E+584364535","","","5.13167312E-8"); - mathtest(173,def,"9.46350807","7826.65424","7836.11775","-7817.19073","74067.6056","0.00120913839","0","9.46350807","3.63271495E+7639"); - mathtest(174,def,"2078153.7","-16934607.3E+233594439","-1.69346073E+233594446","1.69346073E+233594446","-3.51927168E+233594452","-1.2271638E-233594440","0","2078153.7","2.31549939E-13"); - mathtest(175,def,"-9359.74629","7.07761788E+252457696","7.07761788E+252457696","-7.07761788E+252457696","-6.62447077E+252457700","-1.32244301E-252457693","0","-9359.74629","-6.29286677E+27"); - mathtest(176,def,"66.2319284E+730468479","25.9391685E+221147044","6.62319284E+730468480","6.62319284E+730468480","1.71800115E+951615526","2.55335588E+509321435","","",""); - mathtest(177,def,"317997088.E-90968742","-977426.461","-977426.461","977426.461","-3.10818768E-90968728","-3.2534119E-90968740","0","3.17997088E-90968734",""); - mathtest(178,def,"227473386","-6759.61390","227466626","227480146","-1.53763226E+12","-33651.8312","-33651","5618.65110","1.40992627E-56493"); - mathtest(179,def,"-392019.462","-245456.503","-637475.965","-146562.959","9.62237263E+10","1.59710359","1","-146562.959","-3.08656533E-1372917"); - mathtest(180,def,"-3619556.28E+587673583","-3.45236972","-3.61955628E+587673589","-3.61955628E+587673589","1.24960465E+587673590","1.04842661E+587673589","","",""); - mathtest(181,def,"-249.400704E-923930848","831102.919","831102.919","-831102.919","-2.07277653E-923930840","-3.00084019E-923930852","0","-2.49400704E-923930846",""); - mathtest(182,def,"65234.2739E+154949914","-694581895","6.52342739E+154949918","6.52342739E+154949918","-4.53105456E+154949927","-9.39187652E+154949909","","",""); - mathtest(183,def,"45.2316213","-88775083.4","-88775038.2","88775128.6","-4.01544095E+9","-5.09508069E-7","0","45.2316213","1.92314254E-146962015"); - mathtest(184,def,"331100375.","442.343378","331100817","331099933","1.46460058E+11","748514.37","748514","163.759708","6.64011043E+3765"); - mathtest(185,def,"81.8162765","5.61239515E+467372163","5.61239515E+467372163","-5.61239515E+467372163","4.59185273E+467372165","1.45777826E-467372162","0","81.8162765","2.99942677E+11"); - mathtest(186,def,"-5738.13069E+789464078","33969715.0","-5.73813069E+789464081","-5.73813069E+789464081","-1.94922664E+789464089","-1.68919012E+789464074","","",""); - mathtest(187,def,"-7413.03911","2.70630320E-254858264","-7413.03911","-7413.03911","-2.00619315E-254858260","-2.73917539E+254858267","","","-4.07369842E+11"); - mathtest(188,def,"-417696.182","27400.6002","-390295.582","-445096.782","-1.14451261E+10","-15.2440523","-15","-6687.1790","-1.58020334E+154017"); - mathtest(189,def,"68.8538735E+655647287","3198.17933E-132454826","6.88538735E+655647288","6.88538735E+655647288","2.20207035E+523192466","2.15290846E+788102111","","",""); - mathtest(190,def,"-6817.04246","434420.439","427603.397","-441237.481","-2.96146258E+9","-0.0156922692","0","-6817.04246","5.94143518E+1665390"); - mathtest(191,def,"8578.27511","647042.341E-490924334","8578.27511","8578.27511","5.55050721E-490924325","1.3257672E+490924332","","","3.98473846E+23"); - mathtest(192,def,"4124.11615E+733109424","597385828E+375928745","4.12411615E+733109427","4.12411615E+733109427","","6.9036056E+357180673","","",""); - mathtest(193,def,"102.714400","-919017.468","-918914.754","919120.182","-94396327.8","-0.000111765449","0","102.714400","4.04295689E-1848724"); - mathtest(194,def,"-4614.33015E+996778733","-433.560812E+22860599","-4.61433015E+996778736","-4.61433015E+996778736","","1.06428672E+973918135","","",""); - mathtest(195,def,"457455170.","3709230.48E+677010879","3.70923048E+677010885","-3.70923048E+677010885","1.69680666E+677010894","1.23328861E-677010877","0","457455170","4.37919376E+34"); - mathtest(196,def,"-2522468.15","-48482043.5","-51004511.7","45959575.4","1.22294411E+14","0.0520289156","0","-2522468.15","1.42348178E-310373595"); - mathtest(197,def,"-659811384","62777.6118","-659748606","-659874162","-4.14213829E+13","-10510.2976","-10510","-18683.9820","3.4393524E+553665"); - mathtest(198,def,"4424.94176","-825848.20","-821423.258","830273.142","-3.65433019E+9","-0.00535805704","0","4424.94176","3.42152775E-3010966"); - mathtest(199,def,"43.6441884","-6509.89663E-614169377","43.6441884","43.6441884","-2.84119155E-614169372","-6.70428286E+614169374","","","3.31524056E-12"); - mathtest(200,def,"897.388381E-843864876","84195.1369","84195.1369","-84195.1369","7.55557376E-843864869","1.06584348E-843864878","0","8.97388381E-843864874",""); - mathtest(201,def,"796199825","496.76834","796200322","796199328","3.95526865E+11","1602758.79","1602758","393.91828","6.42647264E+4423"); - mathtest(202,def,"573583582","1598.69521","573585181","573581983","9.16985325E+11","358782.323","358782","517.16578","9.91156302E+14004"); - mathtest(203,def,"-783144270.","6347.71496","-783137922","-783150618","-4.97117660E+12","-123374.202","-123374","-1284.52496","1.28110803E+56458"); - mathtest(204,def,"26909234.7","52411.5081","26961646.2","26856823.2","1.41035357E+12","513.422255","513","22131.0447","9.75836528E+389415"); - mathtest(205,def,"8.21915282","24859.7841E-843282959","8.21915282","8.21915282","2.04326365E-843282954","3.30620443E+843282955","","","67.5544731"); - mathtest(206,def,"-688.387710","82783.5207E-831870858","-688.387710","-688.387710","-5.69871582E-831870851","-8.31551623E+831870855","","","5.04272012E+22"); - mathtest(207,def,"-9792232.","-1749.01166","-9793981.01","-9790482.99","1.71267279E+10","5598.72311","5598","-1264.72732","-8.86985674E-12228"); - mathtest(208,def,"-130.765600","8.67437427","-122.091226","-139.439974","-1134.30976","-15.0749317","-15","-0.64998595","-1.11799947E+19"); - mathtest(209,def,"917.259102","-368640.426","-367723.167","369557.685","-338138786","-0.00248822169","0","917.259102","8.67104255E-1092094"); - mathtest(210,def,"-4.9725631","-294563717.","-294563722","294563712","1.46473667E+9","1.6881112E-8","0","-4.9725631","-6.27962584E-205187284"); - mathtest(211,def,"-60962887.2E-514249661","-243021.407","-243021.407","243021.407","1.48152866E-514249648","2.5085398E-514249659","0","-6.09628872E-514249654",""); - mathtest(212,def,"-55389219.8","-3772200E+981866393","-3.77220000E+981866399","3.77220000E+981866399","2.08939215E+981866407","1.46835321E-981866392","0","-55389219.8","1.06242678E-31"); - mathtest(213,def,"681.666010","626886700","626887382","-626886018","4.27327356E+11","0.00000108738311","0","681.666010",""); - mathtest(214,def,"6.42652138","53465894.5","53465900.9","-53465888.1","343599714","1.2019852E-7","0","6.42652138","4.61155532E+43199157"); - mathtest(215,def,"561546656","651408.476","562198064","560895248","3.65796251E+14","862.049968","862","32549.688","8.6052377E+5699419"); - mathtest(216,def,"7845778.36E-79951139","9.45859047","9.45859047","-9.45859047","7.42100044E-79951132","8.29487056E-79951134","0","7.84577836E-79951133","1.12648216E-719560189"); - mathtest(217,def,"54486.2112","10.7565078","54496.9677","54475.4547","586081.356","5065.41828","5065","4.4991930","1.25647168E+52"); - mathtest(218,def,"16576482.5","-2217720.83","14358761.7","18794203.3","-3.67620105E+13","-7.47455779","-7","1052436.69","1.38259374E-16010820"); - mathtest(219,def,"61.2793787E-392070111","6.22575651","6.22575651","-6.22575651","3.81510491E-392070109","9.84288072E-392070111","0","6.12793787E-392070110",""); - mathtest(220,def,"5115136.39","-653674372.","-648559236","658789508","-3.34363357E+15","-0.00782520565","0","5115136.39",""); - mathtest(221,def,"-7.84238366E-416477339","-37432758.9E+97369393","-3.74327589E+97369400","3.74327589E+97369400","2.93562057E-319107938","2.09505895E-513846739","0","-7.84238366E-416477339",""); - mathtest(222,def,"-387781.3E+284108380","-218085.592","-3.87781300E+284108385","-3.87781300E+284108385","8.45695144E+284108390","1.77811517E+284108380","","",""); - mathtest(223,def,"-5353.17736","3.39332346E+546685359","3.39332346E+546685359","-3.39332346E+546685359","-1.81650623E+546685363","-1.57756177E-546685356","0","-5353.17736","-1.53403369E+11"); - mathtest(224,def,"-20837.2900E-168652772","-8236.78305E-712819173","-2.08372900E-168652768","-2.08372900E-168652768","1.71632237E-881471937","2.52978497E+544166401","","",""); - mathtest(225,def,"-98573.8722E+829022366","309011.007","-9.85738722E+829022370","-9.85738722E+829022370","-3.04604115E+829022376","-3.18997932E+829022365","","",""); - mathtest(226,def,"49730750.7","-5315.10636E-299586991","49730750.7","49730750.7","-2.64324229E-299586980","-9.35649211E+299586994","","","3.28756936E-39"); - mathtest(227,def,"1539523.40","-962388.581","577134.82","2501911.98","-1.48161974E+12","-1.59969001","-1","577134.819","3.10144834E-5954673"); - mathtest(228,def,"81596.2121","-37600.9653","43995.2468","119197.177","-3.06809634E+9","-2.17005631","-2","6394.2815","1.97878299E-184684"); - mathtest(229,def,"590146199","-1425404.61","588720794","591571604","-8.41197113E+14","-414.020128","-414","28690.46","2.04650994E-12502170"); - mathtest(230,def,"196.05543","505.936305","701.991735","-309.880875","99191.5598","0.387510104","0","196.05543","8.78437397E+1159"); - mathtest(231,def,"77.8058449","-642.275274","-564.469429","720.081119","-49972.7704","-0.121140963","0","77.8058449","9.33582626E-1215"); - mathtest(232,def,"1468.60684","10068.138","11536.7448","-8599.5312","14786136.3","0.145866777","0","1468.60684","2.54122484E+31884"); - mathtest(233,def,"4.98774767E-387968632","4.41731439E-578812376","4.98774767E-387968632","4.98774767E-387968632","2.20324496E-966781007","1.12913577E+190843744","","",""); - mathtest(234,def,"981.091059","-92238.9930","-91257.9020","93220.0841","-90494851.3","-0.0106364025","0","981.091059","5.29943342E-275953"); - mathtest(235,def,"-3606.24992","8290224.70","8286618.45","-8293830.95","-2.98966222E+10","-0.000435000262","0","-3606.24992","-1.23747107E+29488793"); - mathtest(236,def,"-8978571.35","92243.4796","-8886327.87","-9070814.83","-8.28214663E+11","-97.3355666","-97","-30953.8288","-4.95762813E+641384"); - mathtest(237,def,"-61968.1992E+810060478","474294671.E+179263414","-6.19681992E+810060482","-6.19681992E+810060482","-2.93911867E+989323905","-1.30653374E+630797060","","",""); - mathtest(238,def,"61298431.6E-754429041","-2584862.79","-2584862.79","2584862.79","-1.58448035E-754429027","-2.37143851E-754429040","0","6.12984316E-754429034",""); - mathtest(239,def,"621039.064","-5351539.62","-4730500.56","5972578.68","-3.32351516E+12","-0.116048672","0","621039.064","2.41163312E-31002108"); - mathtest(240,def,"-19.6007605","-57905696.","-57905715.6","57905676.4","1.13499568E+9","3.38494515E-7","0","-19.6007605","1.05663646E-74829963"); - mathtest(241,def,"3626.13109E+687030346","189.896004","3.62613109E+687030349","3.62613109E+687030349","6.88587804E+687030351","1.90953523E+687030347","","",""); - mathtest(242,def,"-249334.026","-7.54735834E-14137188","-249334.026","-249334.026","1.88181324E-14137182","3.30359332E+14137192","","","6.69495408E-44"); - mathtest(243,def,"417613928.","-925213.216","416688715","418539141","-3.86381925E+14","-451.370474","-451","342767.584","8.38430085E-7976054"); - mathtest(244,def,"23.8320309","-50074996.1","-50074972.3","50075019.9","-1.19338885E+9","-4.75926765E-7","0","23.8320309","5.81466387E-68961335"); - mathtest(245,def,"49789677.7","-131827812E+156412534","-1.31827812E+156412542","1.31827812E+156412542","-6.56366427E+156412549","-3.77687204E-156412535","0","49789677.7","2.00844843E-8"); - mathtest(246,def,"-8907163.61E-741867246","773651.288E-472033282","7.73651288E-472033277","-7.73651288E-472033277","","-1.15131504E-269833963","0","-8.90716361E-741867240",""); - mathtest(247,def,"514021711.E+463536646","617441659.","5.14021711E+463536654","5.14021711E+463536654","3.17378418E+463536663","8.32502478E+463536645","","",""); - mathtest(248,def,"998175750","2.39285478","998175752","998175748","2.38848961E+9","417148487","417148486","1.30513692","9.96354828E+17"); - mathtest(249,def,"873575426.","647853.152E+497450781","6.47853152E+497450786","-6.47853152E+497450786","5.65948593E+497450795","1.3484158E-497450778","0","873575426","4.44429064E+53"); - mathtest(250,def,"4352626.8","-130338048.E-744560911","4352626.80","4352626.80","-5.67312881E-744560897","-3.33949055E+744560909","","","2.29746322E-7"); - mathtest(251,def,"437.286960","7.37560835","444.662568","429.911352","3225.25735","59.2882565","59","2.12606735","3.05749452E+18"); - mathtest(252,def,"8498280.45E+220511522","588617612","8.49828045E+220511528","8.49828045E+220511528","5.00223754E+220511537","1.44376931E+220511520","","",""); - mathtest(253,def,"-5320387.77","-7673237.46","-12993625.2","2352849.69","4.08245987E+13","0.693369363","0","-5320387.77","-1.30113745E-51609757"); - mathtest(254,def,"587655375","-4.9748366","587655370","587655380","-2.92348947E+9","-118125563","-118125563","0.7919942","1.42687667E-44"); - mathtest(255,def,"1266098.44","-2661.64904E-642601142","1266098.44","1266098.44","-3.36990970E-642601133","-4.75681963E+642601144","","","4.92717036E-19"); - mathtest(256,def,"3.92737463E+482873483","-685.522747","3.92737463E+482873483","3.92737463E+482873483","-2.69230464E+482873486","-5.72902161E+482873480","","",""); - mathtest(257,def,"22826494.1","986189474.","1.00901597E+9","-963362980","2.25112482E+16","0.0231461547","0","22826494.1",""); - mathtest(258,def,"-647342.380","-498816386","-499463728","498169044","3.22904986E+14","0.00129775685","0","-647342.380",""); - mathtest(259,def,"393092373.","-25.7226822","393092347","393092399","-1.01113902E+10","-15281935.6","-15281935","15.5939430","3.49252839E-224"); - mathtest(260,def,"2.96253492","20.7444888","23.7070237","-17.7819539","61.4562725","0.142810698","0","2.96253492","8.03402246E+9"); - mathtest(261,def,"53553.3750E+386955423","-732470876","5.35533750E+386955427","5.35533750E+386955427","-3.92262875E+386955436","-7.31133165E+386955418","","",""); - mathtest(262,def,"-696451.406E-286535917","-73086090.8","-73086090.8","73086090.8","5.09009107E-286535904","9.52919219E-286535920","0","-6.96451406E-286535912",""); - mathtest(263,def,"1551.29957","-580358622.E+117017265","-5.80358622E+117017273","5.80358622E+117017273","-9.00310081E+117017276","-2.67300168E-117017271","0","1551.29957","7.17506711E-20"); - mathtest(264,def,"-205123006.E-213752799","-78638468.6","-78638468.6","78638468.6","1.61305591E-213752783","2.60843083E-213752799","0","-2.05123006E-213752791",""); - mathtest(265,def,"77632.8073","-3378542.88E+677441319","-3.37854288E+677441325","3.37854288E+677441325","-2.62285768E+677441330","-2.29781921E-677441321","0","77632.8073","2.13729331E-15"); - mathtest(266,def,"3068999.37","2.21006212","3069001.58","3068997.16","6782679.25","1388648.46","1388648","1.02718624","9.41875713E+12"); - mathtest(267,def,"625524274.","55.2468624","625524329","625524219","3.45582535E+10","11322349.3","11322349","16.7522224","6.21482943E+483"); - mathtest(268,def,"61269134.9","-845761303.","-784492168","907030438","-5.18190634E+16","-0.0724425848","0","61269134.9",""); - mathtest(269,def,"-2840.12099","-2856.76731E-82743650","-2840.12099","-2840.12099","8.11356480E-82743644","9.94173022E+82743649","","","-4.36505254E-11"); - mathtest(270,def,"8.9538781","-7.56603391","1.38784419","16.5199120","-67.7453453","-1.18343087","-1","1.38784419","2.42053061E-8"); - mathtest(271,def,"-56233547.2","509752530","453518983","-565986077","-2.86651930E+16","-0.110315386","0","-56233547.2",""); - mathtest(272,def,"-3167.47853E-854859497","-110852115","-110852115","110852115","3.51121694E-854859486","2.85739116E-854859502","0","-3.16747853E-854859494",""); - mathtest(273,def,"-5652.52092","-632243244.","-632248897","632237592","3.57376816E+12","0.00000894042123","0","-5652.52092",""); - mathtest(274,def,"-946.009928","820090.66E-589278015","-946.009928","-946.009928","-7.75813906E-589278007","-1.15354311E+589278012","","","6.41454053E+23"); - mathtest(275,def,"-367.757758","-959.626016","-1327.38377","591.868258","352909.912","0.383230292","0","-367.757758","1.14982199E-2463"); - mathtest(276,def,"809926721.E-744611554","-67.6560549","-67.6560549","67.6560549","-5.47964467E-744611544","-1.19712378E-744611547","0","8.09926721E-744611546",""); - mathtest(277,def,"-1725.08555","75586.3031","73861.2176","-77311.3887","-130392839","-0.0228227269","0","-1725.08555","3.70540587E+244657"); - mathtest(278,def,"2659.84191E+29314492","-74372.4551E+518196680","-7.43724551E+518196684","7.43724551E+518196684","-1.97818973E+547511180","-3.5763804E-488882190","0","2.65984191E+29314495","1.06171811E-205201468"); - mathtest(279,def,"-91.1431113","12147507.0","12147415.9","-12147598.1","-1.10716158E+9","-0.00000750303015","0","-91.1431113","-1.52417006E+23805759"); - mathtest(280,def,"-1136778.91E+697783878","-801552569.","-1.13677891E+697783884","-1.13677891E+697783884","9.11188056E+697783892","1.41822128E+697783875","","",""); - mathtest(281,def,"73123773.0E+433334149","63.3548930","7.31237730E+433334156","7.31237730E+433334156","4.63274881E+433334158","1.15419298E+433334155","","",""); - mathtest(282,def,"-9765484.8","7979.90802E-234029715","-9765484.80","-9765484.80","-7.79276705E-234029705","-1.22375907E+234029718","","","8.27085614E+55"); - mathtest(283,def,"-695010288","-8.26582820","-695010296","-695010280","5.74483564E+9","84082353.4","84082353","-3.45024540","1.83683495E-71"); - mathtest(284,def,"23975643.3E-155955264","-505547.692E+137258948","-5.05547692E+137258953","5.05547692E+137258953","-1.21208311E-18696303","-4.7425087E-293214211","0","2.39756433E-155955257","1.26225952E+779776283"); - mathtest(285,def,"2862.95921","-32601248.6E-605861333","2862.95921","2862.95921","-9.33360449E-605861323","-8.78174712E+605861328","","","4.26142175E-11"); - mathtest(286,def,"-13.133518E+246090516","-8.71269925E-945092108","-1.31335180E+246090517","-1.31335180E+246090517","1.14428392E-699001590","","","",""); - mathtest(287,def,"-34671.2232","817710.762","783039.539","-852381.985","-2.83510323E+10","-0.0424003508","0","-34671.2232","-5.30788828E+3712382"); - mathtest(288,def,"-22464769","62.4366060","-22464706.6","-22464831.4","-1.40262393E+9","-359801.252","-359801","-15.7245940","6.21042536E+455"); - mathtest(289,def,"-9458.60887E-563051963","5676056.01","5676056.01","-5676056.01","-5.36875937E-563051953","-1.66640513E-563051966","0","-9.45860887E-563051960",""); - mathtest(290,def,"-591.924123E-95331874","-134.596188","-134.596188","134.596188","7.96707305E-95331870","4.39777777E-95331874","0","-5.91924123E-95331872",""); - mathtest(291,def,"-182566085.E+68870646","-960345993.","-1.82566085E+68870654","-1.82566085E+68870654","1.75326608E+68870663","1.9010449E+68870645","","",""); - mathtest(292,def,"8232.54893","-99822004E+891979845","-9.98220040E+891979852","9.98220040E+891979852","-8.21789532E+891979856","-8.24722867E-891979850","0","8232.54893","6.99289156E-40"); - mathtest(293,def,"-4336.94317","-819373.601E+563233430","-8.19373601E+563233435","8.19373601E+563233435","3.55357674E+563233439","5.29299841E-563233433","0","-4336.94317","7.98969405E-30"); - mathtest(294,def,"-2.09044362E-876527908","-6515463.33","-6515463.33","6515463.33","1.36202087E-876527901","3.20843433E-876527915","0","-2.09044362E-876527908",""); - mathtest(295,def,"-194343.344","1.95929977","-194341.385","-194345.303","-380776.869","-99190.2041","-99190","-0.39981370","3.77693354E+10"); - mathtest(296,def,"-326002.927","4215.99030","-321786.937","-330218.917","-1.37442518E+9","-77.3253503","-77","-1371.67390","5.51875821E+23243"); - mathtest(297,def,"-12037.8590E+876429044","314.81827","-1.20378590E+876429048","-1.20378590E+876429048","-3.78973794E+876429050","-3.82374854E+876429045","","",""); - mathtest(298,def,"21036045.4E-162804809","-91.7149219","-91.7149219","91.7149219","-1.92931926E-162804800","-2.2936339E-162804804","0","2.10360454E-162804802",""); - mathtest(299,def,"-947019.534","9916.29280","-937103.241","-956935.827","-9.39092299E+9","-95.5013686","-95","-4971.71800","3.76029022E+59261"); - mathtest(300,def,"-5985.84136","-12.4090184E-12364204","-5985.84136","-5985.84136","7.42784156E-12364200","4.82378313E+12364206","","","-0.000167060893"); - mathtest(301,def,"-85344379.4","-6783.08669E+218840215","-6.78308669E+218840218","6.78308669E+218840218","5.78898324E+218840226","1.25819385E-218840211","0","-85344379.4","-3.03232347E-56"); - mathtest(302,def,"-94.1947070E-938257103","15003.240","15003.2400","-15003.2400","-1.41322580E-938257097","-6.27829102E-938257106","0","-9.41947070E-938257102",""); - mathtest(303,def,"-4846233.6","-8289769.76","-13136003.4","3443536.16","4.01741607E+13","0.584604125","0","-4846233.6","4.25077524E-55420465"); - mathtest(304,def,"67.9147198","-108373645.E+291715415","-1.08373645E+291715423","1.08373645E+291715423","-7.36016573E+291715424","-6.26671916E-291715422","0","67.9147198","0.0147243485"); - mathtest(305,def,"1958.77994","5.57285137E+690137826","5.57285137E+690137826","-5.57285137E+690137826","1.09159895E+690137830","3.51486126E-690137824","0","1958.77994","5.64824968E+19"); - mathtest(306,def,"22780314.3","8805279.83","31585594.1","13975034.5","2.00587042E+14","2.58711986","2","5169754.64","2.39132169E+64785373"); - mathtest(307,def,"596745.184","197602423.","198199168","-197005678","1.17918294E+14","0.00301992848","0","596745.184",""); - mathtest(308,def,"171.340497","-480349.924","-480178.584","480521.264","-82303394.7","-0.000356699332","0","171.340497","2.17914102E-1073035"); - mathtest(309,def,"824.65555","-379287.530","-378462.875","380112.186","-312781567","-0.00217422268","0","824.65555","6.35829256E-1106108"); - mathtest(310,def,"19.3164031","-9207644.24E+988115069","-9.20764424E+988115075","9.20764424E+988115075","-1.77858568E+988115077","-2.09786592E-988115075","0","19.3164031","2.67093711E-12"); - mathtest(311,def,"-3123.77646E+177814265","973284435.E+383256112","9.73284435E+383256120","-9.73284435E+383256120","-3.04032301E+561070389","-3.20952062E-205441853","0","-3.12377646E+177814268",""); - mathtest(312,def,"-850.123915E+662955309","6774849.81E-846576865","-8.50123915E+662955311","-8.50123915E+662955311","-5.75946184E-183621547","","","",""); - mathtest(313,def,"-23349.7724","2921.35355","-20428.4189","-26271.1260","-68212940.5","-7.99279238","-7","-2900.29755","-5.6705546E+12759"); - mathtest(314,def,"18886653.3","568707476.","587594129","-549820823","1.07409809E+16","0.0332097855","0","18886653.3",""); - mathtest(315,def,"-90552818.0","-542.03563E-986606878","-90552818.0","-90552818.0","4.90828538E-986606868","1.67060638E+986606883","","","-1.64244241E-40"); - mathtest(316,def,"41501126.1E+791838765","-69.6651675E+204268348","4.15011261E+791838772","4.15011261E+791838772","-2.89118290E+996107122","-5.95722763E+587570422","","",""); - mathtest(317,def,"76783193.3E-271488154","3765.01829E-520346003","7.67831933E-271488147","7.67831933E-271488147","2.89090127E-791834146","2.03938434E+248857853","","",""); - mathtest(318,def,"4192.9928","987822007E-146560989","4192.99280","4192.99280","4.14193056E-146560977","4.24468454E+146560983","","","1.67973653E+36"); - mathtest(319,def,"-891845.629","48277955.","47386109.4","-49169800.6","-4.30564831E+13","-0.0184731443","0","-891845.629","-6.32964147E+287267817"); - mathtest(320,def,"334.901176","-7609296.55E+447340228","-7.60929655E+447340234","7.60929655E+447340234","-2.54836236E+447340237","-4.40121073E-447340233","0","334.901176","6.31926575E-21"); - mathtest(321,def,"4.49868636","-341880896E-447251873","4.49868636","4.49868636","-1.53801492E-447251864","-1.31586363E+447251865","","","0.010983553"); - mathtest(322,def,"807615.58","-314286480","-313478865","315094096","-2.53822658E+14","-0.00256967968","0","807615.58",""); - mathtest(323,def,"-37.7457954","53277.8129E-859225538","-37.7457954","-37.7457954","-2.01101343E-859225532","-7.08471188E+859225534","","","-76620134.1"); - mathtest(324,def,"-28671081.","98.8819623","-28670982.1","-28671179.9","-2.83505275E+9","-289952.589","-289952","-58.2671904","-1.93625566E+738"); - mathtest(325,def,"-89752.2106E-469496896","99.9879961","99.9879961","-99.9879961","-8.97414368E-469496890","-8.97629857E-469496894","0","-8.97522106E-469496892",""); - mathtest(326,def,"-497983567E-13538052","39.4578742","39.4578742","-39.4578742","-1.96493729E-13538042","-1.26206385E-13538045","0","-4.97983567E-13538044","-1.55376543E-527983689"); - mathtest(327,def,"845739221E-654202565","-33313.1551","-33313.1551","33313.1551","-2.81742418E-654202552","-2.53875449E-654202561","0","8.45739221E-654202557",""); - mathtest(328,def,"742.332067E+537827843","-4532.70023E-855387414","7.42332067E+537827845","7.42332067E+537827845","-3.36476873E-317559565","","","",""); - mathtest(329,def,"-893.48654","670389960","670389067","-670390853","-5.98984406E+11","-0.00000133278628","0","-893.48654",""); - mathtest(330,def,"1.37697162","-915.737474E-351578724","1.37697162","1.37697162","-1.26094451E-351578721","-1.50367508E+351578721","","","0.0561920784"); - mathtest(331,def,"-65.2839808E+550288403","-121389.306","-6.52839808E+550288404","-6.52839808E+550288404","7.92477712E+550288409","5.37806689E+550288399","","",""); - mathtest(332,def,"-30346603.E+346067390","792661.544","-3.03466030E+346067397","-3.03466030E+346067397","-2.40545852E+346067403","-3.82844396E+346067391","","",""); - mathtest(333,def,"-61170.7065","-453731131.","-453792302","453669960","2.77550538E+13","0.000134817081","0","-61170.7065",""); - mathtest(334,def,"6569.51133","13.8706351E+399434914","1.38706351E+399434915","-1.38706351E+399434915","9.11232944E+399434918","4.73627291E-399434912","0","6569.51133","6569.51133"); - mathtest(335,def,"300703925.","-3156736.8","297547188","303860662","-9.49243146E+14","-95.2578387","-95","813929.0","4.18609114E-26763256"); - mathtest(336,def,"192138216E+353011592","-473.080633","1.92138216E+353011600","1.92138216E+353011600","-9.08968688E+353011602","-4.06142637E+353011597","","",""); - mathtest(337,def,"8607.64794","-34740.3367","-26132.6888","43347.9846","-299032588","-0.247770999","0","8607.64794","1.29604519E-136698"); - mathtest(338,def,"-67913.8241","-93815.4229","-161729.247","25901.5988","6.37136413E+9","0.723908948","0","-67913.8241","-6.96355203E-453311"); - mathtest(339,def,"34.5559455","-998799398.","-998799364","998799433","-3.45144576E+10","-3.45974833E-8","0","34.5559455",""); - mathtest(340,def,"387995.328","990199543.E-124623607","387995.328","387995.328","3.84192796E-124623593","3.91835495E+124623603","","","7.73152138E+55"); - mathtest(341,def,"-471.09166E-83521919","-441222368","-441222368","441222368","2.07856178E-83521908","1.06769669E-83521925","0","-4.7109166E-83521917",""); - mathtest(342,def,"-97834.3858","70779789.8E+502166065","7.07797898E+502166072","-7.07797898E+502166072","-6.92469726E+502166077","-1.38223617E-502166068","0","-97834.3858","-8.57907886E+34"); - mathtest(343,def,"7732331.06","-952719.482E+115325505","-9.52719482E+115325510","9.52719482E+115325510","-7.36674244E+115325517","-8.11606271E-115325505","0","7732331.06","1.30886724E-69"); - mathtest(344,def,"23.2745547","2.23194245E-221062592","23.2745547","23.2745547","5.19474666E-221062591","1.04279368E+221062593","","","541.704896"); - mathtest(345,def,"671.083363E-218324205","-787150031","-787150031","787150031","-5.28243290E-218324194","-8.52548227E-218324212","0","6.71083363E-218324203",""); - mathtest(346,def,"365167.80","-80263.6516","284904.148","445431.452","-2.93097011E+10","-4.54960362","-4","44113.1936","1.27052227E-446468"); - mathtest(347,def,"-1.43297604E-65129780","56.598733E-135581942","-1.43297604E-65129780","-1.43297604E-65129780","-8.11046283E-200711721","-2.53181646E+70452160","","","8.65831881E-390778680"); - mathtest(348,def,"416998859.","260.220323E-349285593","416998859","416998859","1.08511578E-349285582","1.60248383E+349285599","","","7.25111178E+25"); - mathtest(349,def,"7267.17611E+862630607","4021.56861","7.26717611E+862630610","7.26717611E+862630610","2.92254473E+862630614","1.80705014E+862630607","","",""); - mathtest(350,def,"12.2142434E+593908740","5.27236571E-396050748","1.22142434E+593908741","1.22142434E+593908741","6.43979581E+197857993","2.3166533E+989959488","","",""); - mathtest(351,def,"-28.591932","-1.79153238E-817064576","-28.5919320","-28.5919320","5.12233720E-817064575","1.59594838E+817064577","","","0.00122324372"); - mathtest(352,def,"590.849666","753424.306E+277232744","7.53424306E+277232749","-7.53424306E+277232749","4.45160500E+277232752","7.84219014E-277232748","0","590.849666","1.48530607E+22"); - mathtest(353,def,"1.7270628","-1325026.67","-1325024.94","1325028.40","-2288404.27","-0.00000130341739","0","1.7270628","2.09260036E-314440"); - mathtest(354,def,"33402118.","-5534.83745","33396583.2","33407652.8","-1.84875294E+11","-6034.8869","-6034","4908.82670","8.14473913E-41645"); - mathtest(355,def,"-439842.506","-775110.807","-1214953.31","335268.301","3.40926680E+11","0.567457584","0","-439842.506","-1.84678472E-4374182"); - mathtest(356,def,"-248664.779","-440890.44E+666433944","-4.40890440E+666433949","4.40890440E+666433949","1.09633924E+666433955","5.64005831E-666433945","0","-248664.779","2.61542877E-22"); - mathtest(357,def,"-14161.9142","8306.49493","-5855.4193","-22468.4091","-117635869","-1.70492059","-1","-5855.41927","1.65573372E+34479"); - mathtest(358,def,"-6417227.13","16679.8842","-6400547.25","-6433907.01","-1.07038605E+11","-384.728518","-384","-12151.5972","3.58767978E+113546"); - mathtest(359,def,"514825024.","-25.0446345E-103809457","514825024","514825024","-1.28936046E-103809447","-2.05563002E+103809464","","","7.32860062E-27"); - mathtest(360,def,"525948196","219450390","745398586","306497806","1.15419537E+17","2.39666102","2","87047416",""); - mathtest(361,def,"-638509.181","45580189.0E+269212559","4.55801890E+269212566","-4.55801890E+269212566","-2.91033691E+269212572","-1.40084803E-269212561","0","-638509.181","-1.06129405E+29"); - mathtest(362,def,"330590422","74.359928E+535377965","7.43599280E+535377966","-7.43599280E+535377966","2.45826800E+535377975","4.44581418E-535377959","0","330590422","4.31550742E+59"); - mathtest(363,def,"-3.48593871E-940579904","-20265.9640E-322988987","-2.02659640E-322988983","2.02659640E-322988983","","1.72009519E-617590921","0","-3.48593871E-940579904",""); - mathtest(364,def,"-328103480.","-721.949371E-923938665","-328103480","-328103480","2.36874101E-923938654","4.54468822E+923938670","","","-2.4430038E-60"); - mathtest(365,def,"-1857.01448","19081578.1","19079721.1","-19083435.1","-3.54347668E+10","-0.0000973197537","0","-1857.01448","8.44397087E+62374153"); - mathtest(366,def,"347.28720E+145930771","-62821.9906E-676564106","3.47287200E+145930773","3.47287200E+145930773","-2.18172732E-530633328","-5.52811518E+822494874","","","5.69990135E-875584642"); - mathtest(367,def,"-643.211399E+441807003","-50733419.2","-6.43211399E+441807005","-6.43211399E+441807005","3.26323135E+441807013","1.26782584E+441806998","","",""); - mathtest(368,def,"-53991661.4E-843339554","20718.7346","20718.7346","-20718.7346","-1.11863890E-843339542","-2.60593431E-843339551","0","-5.39916614E-843339547",""); - mathtest(369,def,"-900181424","-105763982.","-1.00594541E+9","-794417442","9.52067719E+16","8.51122856","8","-54069568","1.32627061E-947045602"); - mathtest(370,def,"94218.7462E+563233951","19262.6382E+765263890","1.92626382E+765263894","-1.92626382E+765263894","","4.89126906E-202029939","0","9.42187462E+563233955",""); - mathtest(371,def,"28549.271E+921331828","-2150590.40","2.85492710E+921331832","2.85492710E+921331832","-6.13977881E+921331838","-1.32750853E+921331826","","",""); - mathtest(372,def,"810.7080E+779625763","5957.94044","8.10708000E+779625765","8.10708000E+779625765","4.83014998E+779625769","1.36071854E+779625762","","",""); - mathtest(373,def,"-23.7357549E+77116908","351.100649E+864348022","3.51100649E+864348024","-3.51100649E+864348024","-8.33363895E+941464933","-6.7603848E-787231116","0","-2.37357549E+77116909","3.17403853E+308467637"); - mathtest(374,def,"40216102.2E+292724544","661.025962","4.02161022E+292724551","4.02161022E+292724551","2.65838876E+292724554","6.08389148E+292724548","","",""); - mathtest(375,def,"22785024.3E+783719168","399.505989E+137478666","2.27850243E+783719175","2.27850243E+783719175","9.10275367E+921197843","5.70329981E+646240506","","",""); - mathtest(376,def,"515.591819E+821371364","-692137914.E-149498690","5.15591819E+821371366","5.15591819E+821371366","-3.56860646E+671872685","-7.44926421E+970870047","","",""); - mathtest(377,def,"-536883072E+477911251","624996.301","-5.36883072E+477911259","-5.36883072E+477911259","-3.35549934E+477911265","-8.59017999E+477911253","","",""); - mathtest(378,def,"-399492.914E-334369192","5202119.87E+442442258","5.20211987E+442442264","-5.20211987E+442442264","-2.07821003E+108073078","-7.67942539E-776811452","0","-3.99492914E-334369187",""); - mathtest(379,def,"762.071184","9851631.37","9852393.44","-9850869.30","7.50764438E+9","0.0000773548213","0","762.071184","4.02198436E+28392356"); - mathtest(380,def,"5626.12471","72989818.3","72995444.4","-72984192.2","4.10649820E+11","0.0000770809524","0","5626.12471","1.79814757E+273727098"); - mathtest(381,def,"-47207260.1","-2073.3152","-47209333.4","-47205186.8","9.78755299E+10","22768.9741","22768","-2019.6264","-6.02238319E-15909"); - mathtest(382,def,"207.740860","-51.0390090","156.701851","258.779869","-10602.8876","-4.07023694","-4","3.5848240","6.40297515E-119"); - mathtest(383,def,"-572.812464E-745934021","-182805872.E+604508681","-1.82805872E+604508689","1.82805872E+604508689","1.04713482E-141425329","","0","-5.72812464E-745934019",""); - mathtest(384,def,"-6418504E+3531407","8459416.1","-6.41850400E+3531413","-6.41850400E+3531413","-5.42967961E+3531420","-7.58740784E+3531406","","",""); - mathtest(385,def,"280689.531","-128212543","-127931854","128493233","-3.59879186E+13","-0.00218925173","0","280689.531","1.42173809E-698530938"); - mathtest(386,def,"15.803551E-783422793","239108038E-489186308","2.39108038E-489186300","-2.39108038E-489186300","","6.60937672E-294236493","0","1.5803551E-783422792",""); - mathtest(387,def,"26.515922","-9418242.96E-105481628","26.5159220","26.5159220","-2.49733396E-105481620","-2.81537885E+105481622","","","1.54326108E-13"); - mathtest(388,def,"-88.1094557","-54029934.1","-54030022.2","54029846.0","4.76054809E+9","0.0000016307526","0","-88.1094557","5.05289826E-105089439"); - mathtest(389,def,"6770.68602E-498420397","-6.11248908E-729616908","6.77068602E-498420394","6.77068602E-498420394","","-1.10768067E+231196514","","",""); - mathtest(390,def,"-892973818.E-781904441","555201299.","555201299","-555201299","-4.95780224E-781904424","-1.60837847E-781904441","0","-8.92973818E-781904433",""); - mathtest(391,def,"670175802E+135430680","27355195.4","6.70175802E+135430688","6.70175802E+135430688","1.83327900E+135430696","2.44990318E+135430681","","",""); - mathtest(392,def,"-440950.26","205.477469E-677345561","-440950.260","-440950.260","-9.06053434E-677345554","-2.14597864E+677345564","","","1.94437132E+11"); - mathtest(393,def,"-8.2335779","573665010E+742722075","5.73665010E+742722083","-5.73665010E+742722083","-4.72331555E+742722084","-1.43525886E-742722083","0","-8.2335779","311552.753"); - mathtest(394,def,"452943.863","7022.23629","459966.099","445921.627","3.18067883E+9","64.5013703","64","3520.74044","5.54158976E+39716"); - mathtest(395,def,"62874.1079","-52719654.1","-52656780.0","52782528.2","-3.31470122E+12","-0.0011926123","0","62874.1079","1.18819936E-252973775"); - mathtest(396,def,"-7428.41741E+609772037","-46024819.3","-7.42841741E+609772040","-7.42841741E+609772040","3.41891569E+609772048","1.61400251E+609772033","","",""); - mathtest(397,def,"2.27959297","41937.019","41939.2986","-41934.7394","95599.3337","0.0000543575348","0","2.27959297","2.89712423E+15007"); - mathtest(398,def,"508692408E-671967782","8491989.20","8491989.20","-8491989.20","4.31981043E-671967767","5.99026207E-671967781","0","5.08692408E-671967774",""); - mathtest(399,def,"940.533705E-379310421","-4.01176961E+464620037","-4.01176961E+464620037","4.01176961E+464620037","-3.77320453E+85309619","-2.34443599E-843930456","0","9.40533705E-379310419",""); - mathtest(400,def,"97.0649652","-92.4485649E-151989098","97.0649652","97.0649652","-8.97351673E-151989095","-1.0499348E+151989098","","","1.30748728E-18"); - mathtest(401,def,"297544.536E+360279473","8.80275007","2.97544536E+360279478","2.97544536E+360279478","2.61921019E+360279479","3.38013159E+360279477","","",""); - mathtest(402,def,"-28861028.","82818.820E+138368758","8.28188200E+138368762","-8.28188200E+138368762","-2.39023628E+138368770","-3.48483932E-138368756","0","-28861028","4.81387013E+59"); - mathtest(403,def,"36.2496238E+68828039","49243.00","3.62496238E+68828040","3.62496238E+68828040","1.78504022E+68828045","7.36137599E+68828035","","",""); - mathtest(404,def,"22.447828E-476014683","-56067.5520","-56067.5520","56067.5520","-1.25859476E-476014677","-4.00371109E-476014687","0","2.2447828E-476014682",""); - mathtest(405,def,"282688.791E+75011952","5.99789051","2.82688791E+75011957","2.82688791E+75011957","1.69553642E+75011958","4.7131369E+75011956","","","5.10330507E+450071744"); - mathtest(406,def,"-981.860310E-737387002","-994046289","-994046289","994046289","9.76014597E-737386991","9.87741035E-737387009","0","-9.81860310E-737387000",""); - mathtest(407,def,"-702.91210","-6444903.55","-6445606.46","6444200.64","4.53020069E+9","0.000109064797","0","-702.91210","1.70866703E-18348004"); - mathtest(408,def,"972456720E-17536823","16371.2590","16371.2590","-16371.2590","1.59203408E-17536810","5.94002404E-17536819","0","9.72456720E-17536815",""); - mathtest(409,def,"71471.2045","-74303278.4","-74231807.2","74374749.6","-5.31054481E+12","-0.00096188494","0","71471.2045","2.14535374E-360677853"); - mathtest(410,def,"643.103951E+439708441","788251925.","6.43103951E+439708443","6.43103951E+439708443","5.06927927E+439708452","8.15860933E+439708434","","",""); - mathtest(411,def,"4.30838663","-7.43110827","-3.12272164","11.7394949","-32.0160875","-0.579777131","0","4.30838663","0.0000362908645"); - mathtest(412,def,"823.678025","-513.581840E-324453141","823.678025","823.678025","-4.23026076E-324453136","-1.60379118E+324453141","","","2.63762228E-15"); - mathtest(413,def,"4461.81162","3.22081680","4465.03244","4458.59080","14370.6778","1385.30438","1385","0.98035200","8.8824688E+10"); - mathtest(414,def,"-4458527.10","-99072605","-103531132","94614077.9","4.41717894E+14","0.0450026231","0","-4458527.10","-6.23928099E-658752715"); - mathtest(415,def,"-577964618","487424368.","-90540250","-1.06538899E+9","-2.81714039E+17","-1.18575241","-1","-90540250",""); - mathtest(416,def,"-867.036184","-57.1768608","-924.213045","-809.859323","49574.4072","15.1641096","15","-9.3832720","-3.40312837E-168"); - mathtest(417,def,"771871921E-330504770","5.34285236","5.34285236","-5.34285236","4.12399771E-330504761","1.44468136E-330504762","0","7.71871921E-330504762",""); - mathtest(418,def,"-338683.062E-728777518","166441931","166441931","-166441931","-5.63710628E-728777505","-2.03484218E-728777521","0","-3.38683062E-728777513",""); - mathtest(419,def,"-512568743","-416376887.E-965945295","-512568743","-512568743","2.13421778E-965945278","1.23102112E+965945295","","","1.44874358E-35"); - mathtest(420,def,"7447181.99","5318438.52","12765620.5","2128743.47","3.96073796E+13","1.40025723","1","2128743.47","1.21634782E+36548270"); - mathtest(421,def,"54789.8207","93165435.2","93220225.0","-93110645.4","5.10451749E+12","0.000588091716","0","54789.8207","3.80769825E+441483035"); - mathtest(422,def,"41488.5960","146.797094","41635.3931","41341.7989","6090405.33","282.625459","282","91.815492","6.84738153E+678"); - mathtest(423,def,"785741.663E+56754529","-461.531732","7.85741663E+56754534","7.85741663E+56754534","-3.62644711E+56754537","-1.70246509E+56754532","","",""); - mathtest(424,def,"-4.95436786","-3132.4233","-3137.37767","3127.46893","15519.1773","0.0015816406","0","-4.95436786","1.98062422E-2177"); - mathtest(425,def,"77321.8478E+404626874","82.4797688","7.73218478E+404626878","7.73218478E+404626878","6.37748813E+404626880","9.3746441E+404626876","","",""); - mathtest(426,def,"-7.99307725","-29153.7273","-29161.7204","29145.7342","233027.994","0.000274169994","0","-7.99307725","1.88688028E-26318"); - mathtest(427,def,"-61.6337401E+474999517","5254.87092","-6.16337401E+474999518","-6.16337401E+474999518","-3.23877349E+474999522","-1.1728878E+474999515","","",""); - mathtest(428,def,"-16.4043088","35.0064812","18.6021724","-51.4107900","-574.257128","-0.468607762","0","-16.4043088","-3.33831843E+42"); - mathtest(429,def,"-8.41156520","-56508958.9","-56508967.3","56508950.5","475328792","1.48853657E-7","0","-8.41156520","-8.86365458E-52263827"); - mathtest(430,def,"-360165.79E+503559835","-196688.515","-3.60165790E+503559840","-3.60165790E+503559840","7.08404744E+503559845","1.83114805E+503559835","","",""); - mathtest(431,def,"-653236480.E+565648495","-930.445274","-6.53236480E+565648503","-6.53236480E+565648503","6.07800796E+565648506","7.02068674E+565648500","","",""); - mathtest(432,def,"-3.73342903","855.029289","851.295860","-858.762718","-3192.19117","-0.00436643408","0","-3.73342903","-1.41988961E+489"); - mathtest(433,def,"-5.14890532E+562048011","10847127.8E-390918910","-5.14890532E+562048011","-5.14890532E+562048011","-5.58508340E+171129108","-4.74679142E+952966914","","","-5.14890532E+562048011"); - mathtest(434,def,"653311907","-810.036965E+744537823","-8.10036965E+744537825","8.10036965E+744537825","-5.29206794E+744537834","-8.06521104E-744537818","0","653311907","3.01325171E-71"); - mathtest(435,def,"-1.31557907","98.9139300E-579281802","-1.31557907","-1.31557907","-1.30129096E-579281800","-1.33002406E+579281800","","","15.529932"); - mathtest(436,def,"-875192389","-72071565.6","-947263955","-803120823","6.30764857E+16","12.1433797","12","-10333601.8","1.25564408E-644471405"); - mathtest(437,def,"-72838078.8","-391.398423","-72838470.2","-72837687.4","2.85087092E+10","186097.017","186097","-6.474969","-6.574057E-3075"); - mathtest(438,def,"29186560.9","-79.7419988","29186481.2","29186640.6","-2.32739470E+9","-366012.407","-366012","32.4352144","6.10050869E-598"); - mathtest(439,def,"-329801660E-730249465","-6489.9256","-6489.92560","6489.92560","2.14038824E-730249453","5.08174793E-730249461","0","-3.29801660E-730249457",""); - mathtest(440,def,"91.8429117E+103164883","7131455.16","9.18429117E+103164884","9.18429117E+103164884","6.54973607E+103164891","1.28785654E+103164878","","",""); - mathtest(441,def,"3943866.38E+150855113","-31927007.3","3.94386638E+150855119","3.94386638E+150855119","-1.25915851E+150855127","-1.23527594E+150855112","","",""); - mathtest(442,def,"-7002.0468E-795962156","-5937891.05","-5937891.05","5937891.05","4.15773910E-795962146","1.17921443E-795962159","0","-7.0020468E-795962153",""); - mathtest(443,def,"696504605.","54506.4617","696559111","696450099","3.79640016E+13","12778.386","12778","21037.3974","2.6008532E+481992"); - mathtest(444,def,"-5115.76467","690.960979E+815126701","6.90960979E+815126703","-6.90960979E+815126703","-3.53479376E+815126707","-7.4038402E-815126701","0","-5115.76467","-9.17009655E+25"); - mathtest(445,def,"-261.279392","-613.079357","-874.358749","351.799965","160185.002","0.426175484","0","-261.279392","-2.06318841E-1482"); - mathtest(446,def,"-591407763","-80145822.8","-671553586","-511261940","4.73988618E+16","7.37914644","7","-30387003.4","-2.79334522E-703030105"); - mathtest(447,def,"615630407","-69.4661869","615630338","615630476","-4.27654969E+10","-8862303.15","-8862303","10.4375693","3.44283102E-607"); - mathtest(448,def,"1078757.50","27402569.0E-713742082","1078757.50","1078757.50","2.95607268E-713742069","3.93670207E+713742080","","","1.25536924E+18"); - mathtest(449,def,"-4865.60358E-401116515","66952.5315","66952.5315","-66952.5315","-3.25764477E-401116507","-7.26724363E-401116517","0","-4.86560358E-401116512",""); - mathtest(450,def,"-87805.3921E-934896690","-1875.14745","-1875.14745","1875.14745","1.64648057E-934896682","4.68258601E-934896689","0","-8.78053921E-934896686",""); - mathtest(451,def,"-232540609.E+602702520","68.0834223","-2.32540609E+602702528","-2.32540609E+602702528","-1.58321605E+602702530","-3.41552468E+602702526","","",""); - mathtest(452,def,"-320610803.","-863871235.","-1.18448204E+9","543260432","2.76966450E+17","0.37113263","0","-320610803",""); - mathtest(453,def,"-303956364E+278139979","229537.920E+479603725","2.29537920E+479603730","-2.29537920E+479603730","-6.97695116E+757743717","-1.3242098E-201463743","0","-3.03956364E+278139987","9.23894712E+556279974"); - mathtest(454,def,"-439.747348","74.9494457E-353117582","-439.747348","-439.747348","-3.29588200E-353117578","-5.86725284E+353117582","","","-3.17996693E+18"); - mathtest(455,def,"-89702231.9","1.28993993","-89702230.6","-89702233.2","-115710491","-69539852.1","-69539852","-0.07890964","-89702231.9"); - mathtest(456,def,"-5856939.14","-6743375.34","-12600314.5","886436.20","3.94955390E+13","0.868547107","0","-5856939.14","-3.29213248E-45636942"); - mathtest(457,def,"733317.669E+100381349","-13832.6792E+174055607","-1.38326792E+174055611","1.38326792E+174055611","-1.01437481E+274436966","-5.30134227E-73674257","0","7.33317669E+100381354","1.36366549E-100381355"); - mathtest(458,def,"87.4798787E-80124704","108497.32","108497.320","-108497.320","9.49133239E-80124698","8.06286079E-80124708","0","8.74798787E-80124703",""); - mathtest(459,def,"-694562052","310681.319E+549445264","3.10681319E+549445269","-3.10681319E+549445269","-2.15787454E+549445278","-2.23560932E-549445261","0","-694562052","-3.35068155E+26"); - mathtest(460,def,"-9744135.85","1797016.04","-7947119.81","-11541151.9","-1.75103684E+13","-5.42239782","-5","-759055.65","3.83848006E+12558883"); - mathtest(461,def,"3625.87308","-50.2208536E+658627487","-5.02208536E+658627488","5.02208536E+658627488","-1.82094441E+658627492","-7.21985554E-658627486","0","3625.87308","1.5956477E-18"); - mathtest(462,def,"365347.52","-3655414.47","-3290066.95","4020761.99","-1.33549661E+12","-0.099946948","0","365347.52","1.02663257E-20333994"); - mathtest(463,def,"-19706333.6E-816923050","-383858032.","-383858032","383858032","7.56443443E-816923035","5.1337557E-816923052","0","-1.97063336E-816923043",""); - mathtest(464,def,"-86346.2616","-98.8063785","-86445.0680","-86247.4552","8531561.41","873.893598","873","-88.2931695","-2.05064086E-489"); - mathtest(465,def,"-445588.160E-496592215","328.822976","328.822976","-328.822976","-1.46519625E-496592207","-1.35510044E-496592212","0","-4.45588160E-496592210",""); - mathtest(466,def,"-9709213.71","-34.6690137","-9709248.38","-9709179.04","336608863","280054.512","280054","-17.7472602","-2.80903974E-245"); - mathtest(467,def,"742395536.","-43533.6889","742352002","742439070","-3.23192163E+13","-17053.3569","-17053","15539.1883","5.7622734E-386175"); - mathtest(468,def,"-878849193.","-5842982.47E-972537342","-878849193","-878849193","5.13510043E-972537327","1.50411061E+972537344","","","2.17027042E-54"); - mathtest(469,def,"-78014142.1","-624658.522","-78638800.6","-77389483.6","4.87321987E+13","124.890863","124","-556485.372","-7.86063865E-4929918"); - mathtest(470,def,"857039.371","454.379672","857493.751","856584.991","389421268","1886.17454","1886","79.309608","3.82253101E+2693"); - mathtest(471,def,"166534010.","-173.012236","166533837","166534183","-2.88124214E+10","-962556.255","-962556","44.164784","4.78620664E-1423"); - mathtest(472,def,"-810.879063","43776.610","42965.7309","-44587.4891","-35497536.5","-0.0185231123","0","-810.879063","-2.34758691E+127345"); - mathtest(473,def,"-327.127935","93458944","93458616.9","-93459271.1","-3.05730314E+10","-0.00000350023145","0","-327.127935","2.29323021E+235022854"); - mathtest(474,def,"539295218.","-9587941.10E-309643098","539295218","539295218","-5.17073079E-309643083","-5.62472394E+309643099","","","4.80545269E-88"); - mathtest(475,def,"-3862702.65","879616.733","-2983085.92","-4742319.38","-3.39769789E+12","-4.3913474","-4","-344235.718","-3.50650167E+5793941"); - mathtest(476,def,"-8.25290500","992.091584E+256070257","9.92091584E+256070259","-9.92091584E+256070259","-8.18763759E+256070260","-8.31869268E-256070260","0","-8.25290500","1.46577888E+9"); - mathtest(477,def,"546875205.","447.52857E+557357101","4.47528570E+557357103","-4.47528570E+557357103","2.44742278E+557357112","1.22198948E-557357095","0","546875205","8.94443542E+34"); - mathtest(478,def,"177623437","-7779116.14","169844321","185402553","-1.38175335E+15","-22.83337","-22","6482881.92","2.90085309E-64173820"); - mathtest(479,def,"377204735.","13768.1401","377218503","377190967","5.19340764E+12","27396.9274","27396","12768.8204","2.06065297E+118082"); - mathtest(480,def,"-2435.49239","-11732.0640E-23331504","-2435.49239","-2435.49239","2.85733526E-23331497","2.07592832E+23331503","","","-0.00041059459"); - mathtest(481,def,"-6128465.14E-137123294","-5742264.27","-5742264.27","5742264.27","3.51912664E-137123281","1.06725585E-137123294","0","-6.12846514E-137123288",""); - mathtest(482,def,"-2898065.44","-5.11638105","-2898070.56","-2898060.32","14827607.1","566428.773","566428","-3.95461060","-4.89169151E-33"); - mathtest(483,def,"1851395.31E+594383160","-550301.475","1.85139531E+594383166","1.85139531E+594383166","-1.01882557E+594383172","-3.36432918E+594383160","","",""); - mathtest(484,def,"536412589.E+379583977","899.601161","5.36412589E+379583985","5.36412589E+379583985","4.82557388E+379583988","5.96278231E+379583982","","",""); - mathtest(485,def,"185.85297","867419480.","867419666","-867419294","1.61212487E+11","2.14259622E-7","0","185.85297",""); - mathtest(486,def,"-5.26631053","-3815941.35E+183291763","-3.81594135E+183291769","3.81594135E+183291769","2.00959321E+183291770","1.38008162E-183291769","0","-5.26631053","0.00130009218"); - mathtest(487,def,"-8.11587021E-245942806","4553.06753E+943412048","4.55306753E+943412051","-4.55306753E+943412051","-3.69521051E+697469246","","0","-8.11587021E-245942806",""); - mathtest(488,def,"-405765.352","854963231","854557466","-855368996","-3.46914456E+14","-0.000474599769","0","-405765.352",""); - mathtest(489,def,"-159.609757","-43356.7567","-43516.3665","43197.1470","6920161.40","0.00368131219","0","-159.609757","-8.95397849E-95519"); - mathtest(490,def,"-564240.241E-501316672","-557.781977","-557.781977","557.781977","3.14723037E-501316664","1.01157847E-501316669","0","-5.64240241E-501316667",""); - mathtest(491,def,"318847.270","582107878.E+399633412","5.82107878E+399633420","-5.82107878E+399633420","1.85603508E+399633426","5.47746014E-399633416","0","318847.270","1.0507423E+33"); - mathtest(492,def,"-4426.59663","95.1096765","-4331.48695","-4521.70631","-421012.173","-46.5420217","-46","-51.5515110","-2.38037379E+346"); - mathtest(493,def,"6037.28310","578264.105","584301.388","-572226.822","3.49114411E+9","0.010440356","0","6037.28310","3.57279483E+2186324"); - mathtest(494,def,"-66.9556692","-53.8519404","-120.807610","-13.1037288","3605.69271","1.24332881","1","-13.1037288","2.55554086E-99"); - mathtest(495,def,"-92486.0222","-59935.8544","-152421.877","-32550.1678","5.54322876E+9","1.5430834","1","-32550.1678","1.83152656E-297647"); - mathtest(496,def,"852136219.E+917787351","9246221.91","8.52136219E+917787359","8.52136219E+917787359","7.87904058E+917787366","9.21604767E+917787352","","",""); - mathtest(497,def,"-2120096.16E-269253718","9437.00514","9437.00514","-9437.00514","-2.00073584E-269253708","-2.24657731E-269253716","0","-2.12009616E-269253712",""); - mathtest(498,def,"-524653.169E-865784226","228054.698","228054.698","-228054.698","-1.19649620E-865784215","-2.30055848E-865784226","0","-5.24653169E-865784221",""); - mathtest(499,def,"-288193133","-312268737.","-600461870","24075604","8.99937057E+16","0.922901011","0","-288193133",""); - mathtest(500,def,"-373484759E-113589964","844101958E-852538240","-3.73484759E-113589956","-3.73484759E-113589956","-3.15259216E-966128187","-4.42464036E+738948275","","","3.78602147E-908719644"); - - summary("Arithmetic"); - return;} - - /* mathtest -- general arithmetic test routine - Arg1 is test number - Arg2 is MathContext - Arg3 is left hand side (LHS) - Arg4 is right hand side (RHS) - Arg5 is the expected result for add - Arg6 is the expected result for subtract - Arg7 is the expected result for multiply - Arg8 is the expected result for divide - Arg9 is the expected result for integerDivide - Arg10 is the expected result for remainder - Arg11 is the expected result for power - - For power RHS, 0 is added to the number, any exponent is removed and - the number is then rounded to an integer, using format(rhs+0,,0) - - If an error should result for an operation, the 'expected result' is - an empty string. - */ - - private void mathtest(int test,com.ibm.math.MathContext mc,java.lang.String slhs,java.lang.String srhs,java.lang.String add,java.lang.String sub,java.lang.String mul,java.lang.String div,java.lang.String idv,java.lang.String rem,java.lang.String pow){ - com.ibm.math.BigDecimal lhs; - com.ibm.math.BigDecimal rhs; - java.lang.String res=null; - java.lang.String sn=null; - int e=0; - - - - lhs=new com.ibm.math.BigDecimal(slhs); - rhs=new com.ibm.math.BigDecimal(srhs); - - {try{ - res=lhs.add(rhs,mc).toString(); - } - catch (java.lang.ArithmeticException $137){ - res=""; - }} - mathtestcheck(test,lhs,rhs,"add",res,add); - - {try{ - res=lhs.subtract(rhs,mc).toString(); - } - catch (java.lang.ArithmeticException $138){ - res=""; - }} - mathtestcheck(test,lhs,rhs,"sub",res,sub); - - {try{ - res=lhs.multiply(rhs,mc).toString(); - } - catch (java.lang.ArithmeticException $139){ - res=""; - }} - mathtestcheck(test,lhs,rhs,"mul",res,mul); - - {try{ - res=lhs.divide(rhs,mc).toString(); - } - catch (java.lang.ArithmeticException $140){ - res=""; - }} - mathtestcheck(test,lhs,rhs,"div",res,div); - - {try{ - res=lhs.divideInteger(rhs,mc).toString(); - } - catch (java.lang.ArithmeticException $141){ - res=""; - }} - mathtestcheck(test,lhs,rhs,"idv",res,idv); - - {try{ - res=lhs.remainder(rhs,mc).toString(); - } - catch (java.lang.ArithmeticException $142){ - res=""; - }} - mathtestcheck(test,lhs,rhs,"rem",res,rem); - - {try{ - // prepare an integer from the rhs - // in Rexx: - // n=rhs+0 - // e=pos('E', n) - // if e>0 then n=left(n,e-1) - // n=format(n,,0) - - sn=rhs.plus(mc).toString(); - e=sn.indexOf("E",0); - if (e>0) - sn=sn.substring(0,e); - sn=(new com.ibm.math.BigDecimal(sn)).format(-1,0); - - res=lhs.pow(new com.ibm.math.BigDecimal(sn),mc).toString(); - } - catch (java.lang.ArithmeticException $143){ - res=""; - }} - mathtestcheck(test,lhs,rhs,"pow",res,pow); - return; - } - - /* mathtestcheck -- check for general mathtest error - Arg1 is test number - Arg2 is left hand side (LHS) - Arg3 is right hand side (RHS) - Arg4 is the operation - Arg5 is the actual result - Arg6 is the expected result - Show error message if a problem, otherwise return quietly - */ - - private void mathtestcheck(int test,com.ibm.math.BigDecimal lhs,com.ibm.math.BigDecimal rhs,java.lang.String op,java.lang.String got,java.lang.String want){ - boolean flag; - java.lang.String testnum; - - flag=want.equals((java.lang.Object)got); - - if ((!flag)) - say(">"+test+">"+" "+lhs.toString()+" "+op+" "+rhs.toString()+" "+"="+" "+want+" "+"[got"+" "+got+"]"); - - testnum="gen"+right((new com.ibm.math.BigDecimal(test+1000)).toString(),3); - - (new com.ibm.math.DiagBigDecimal.Test(testnum)).ok=flag; - return; - } - - - /* ------------------------------------------------------------------ */ - /* Support routines and minor classes follow */ - /* ------------------------------------------------------------------ */ - - /* ----------------------------------------------------------------- */ - /* Method called to summarise pending tests */ - /* ----------------------------------------------------------------- */ - /* Arg1 is section name */ - - private void summary(java.lang.String section){ - int bad; - int count; - int i=0; - com.ibm.math.DiagBigDecimal.Test item=null; - bad=0; - count=Tests.size(); - {int $144=count;i=0;i:for(;$144>0;$144--,i++){ - item=(com.ibm.math.DiagBigDecimal.Test)(Tests.elementAt(i)); - if ((!item.ok)) - { - bad++; - say("Failed:"+" "+item.name); - } - } - }/*i*/ - totalcount=totalcount+count; - Tests=new java.util.Vector(100); // reinitialize - if (bad==0) - say("OK"+" "+left(section,14)+" "+right("["+count+" "+"tests]",12)); - else - throw new com.ibm.math.DiagBigDecimal.DiagException(section+" "+"[failed"+" "+bad+" "+"of"+" "+count+" "+"tests]",bad); - return;} - - - /* ----------------------------------------------------------------- */ - /* right - Utility to do a 'right' on a Java String */ - /* ----------------------------------------------------------------- */ - /* Arg1 is string to right-justify */ - /* Arg2 is desired length */ - - private static java.lang.String right(java.lang.String s,int len){ - int slen; - slen=s.length(); - if (slen==len) - return s; // length just right - if (slen>len) - return s.substring(slen-len); // truncate on left - // too short - return (new java.lang.String(new char[len-slen])).replace('\000',' ').concat(s); - } - - /* ----------------------------------------------------------------- */ - /* left - Utility to do a 'left' on a Java String */ - /* ----------------------------------------------------------------- */ - /* Arg1 is string to left-justify */ - /* Arg2 is desired length */ - - private static java.lang.String left(java.lang.String s,int len){ - int slen; - slen=s.length(); - if (slen==len) - return s; // length just right - if (slen>len) - return s.substring(0,len); // truncate on right - // too short - return s.concat((new java.lang.String(new char[len-slen])).replace('\000',' ')); - } - - /* ----------------------------------------------------------------- */ - /* say - Utility to do a display */ - /* ----------------------------------------------------------------- */ - /* Arg1 is string to display, omitted if none */ - /* [null or omitted gives blank line] */ - // this version doesn't heed continuation final character - - private static void say(){ - say((java.lang.String)null);return; - } - private static void say(java.lang.String s){ - if (s==null) - s=""; - java.lang.System.out.println(s); - return;} - - /* ----------------------------------------------------------------- */ - /* Scaffolding for stand-alone run */ - /* ----------------------------------------------------------------- */ - /** Entry point for stand-alone run. It constructs a - * DiagBigDecimal object and then invokes its - * {@link #diagrun(boolean)} method to run the test - * suite. - * - * @param args The command line argument string array. - * if the first word is 'continue' then try and run - * all tests, otherwise stop after the first failing test group. - */ - - public static void main(java.lang.String args[]){ - boolean $continue; - com.ibm.math.DiagBigDecimal dbd; - int fails; - $continue=false; - if (args.length>0) - $continue=args[0].equals("continue"); - dbd=new com.ibm.math.DiagBigDecimal(); // make the runner - fails=dbd.diagrun($continue); // and run the tests - if (fails==0) - {System.exit(0);return;} - {System.exit(1);return;} - } - -/* ------------------------------------------------------------------ */ -/* Test -- represents a test and its status */ -/* ------------------------------------------------------------------ */ -/* Copyright IBM Corporation 1998, 2000. All rights reserved. */ -/* Author: Mike Cowlishaw */ -/* ------------------------------------------------------------------ */ -/* 1998.07.15 Initial version */ -/* 2000.03.27 Change to javadoc comments */ - -/** - * The Test class is used to record a specific test. - * When constructed, it notes the name of the test and adds the test - * to the list of tests held by the parent. - * - * Its ok is assigned directly to record whether the - * test succeeded (1) or failed (0). - * - * @see com.ibm.math.DiagBigDecimal - * @version 1.00 2000.03.27 - * @author Mike Cowlishaw - */ - - public class Test{ - private final transient java.lang.String $0="DiagBigDecimal.nrx"; - /* properties shared transient */ - /** The name of the test. */ - transient java.lang.String name; - /** Success flag; will be set to 1 (true) if the test succeeded, or 0 - * (false) if the test failed. - */ - transient boolean ok; - - - /** - * Constructs a new Test with a specified name. - * - * @param testname The String naming the test. - */ - - public Test(java.lang.String testname){super(); - name=testname; // save the name - DiagBigDecimal.this.Tests.addElement((java.lang.Object)this); // and add to parent's list - return;} - } - - /* ------------------------------------------------------------------ */ - /* DiagException */ - /* ------------------------------------------------------------------ */ - /* Copyright IBM Corporation 1996, 2000. All rights reserved. */ - /* Author: Mike Cowlishaw */ - /* ------------------------------------------------------------------ */ - /* 1996.05.27 Initial version in NetRexx (as DiagX) */ - /* 1998.06.25 Copied from NetRexx test suite */ - /* 1999.07.03 Add fail count */ - /* 2000.03.27 Change to javadoc comments */ - - /** - * The DiagException class is used to signal the failure - * of a test group. It records the number of failures in the group. - * - * @see com.ibm.math.DiagBigDecimal - * @version 1.00 2000.03.27 - * @author Mike Cowlishaw - */ - - public static class DiagException extends java.lang.RuntimeException{ - private final transient java.lang.String $0="DiagBigDecimal.nrx"; - - /* properties shared transient */ - /** the count of failed tests in the group which signalled this - * exception. - */ - transient int failcount=0; - // number of tests which failed - - /** - * Constructs a new DiagException with a message and - * failure count. This is thrown when a group of tests fails. - * - * @param message The String message describing the group. - * @param fails The int number of failed tests in the group. - */ - - public DiagException(java.lang.String message,int fails){ - super(message); - failcount=fails; - return;} - }} diff --git a/icu4j/src/com/ibm/math/MathContext.java b/icu4j/src/com/ibm/math/MathContext.java deleted file mode 100755 index b5a1d184cc..0000000000 --- a/icu4j/src/com/ibm/math/MathContext.java +++ /dev/null @@ -1,582 +0,0 @@ -/* Generated from 'MathContext.nrx' 8 Sep 2000 11:07:48 [v2.00] */ -/* Options: Binary Comments Crossref Format Java Logo Strictargs Strictcase Trace2 Verbose3 */ -package com.ibm.math; - -/* ------------------------------------------------------------------ */ -/* MathContext -- Math context settings */ -/* ------------------------------------------------------------------ */ -/* Copyright IBM Corporation, 1997, 2000. All Rights Reserved. */ -/* */ -/* The MathContext object encapsulates the settings used by the */ -/* BigDecimal class; it could also be used by other arithmetics. */ -/* ------------------------------------------------------------------ */ -/* Notes: */ -/* */ -/* 1. The properties are checked for validity on construction, so */ -/* the BigDecimal class may assume that they are correct. */ -/* ------------------------------------------------------------------ */ -/* Author: Mike Cowlishaw */ -/* 1997.09.03 Initial version (edited from netrexx.lang.RexxSet) */ -/* 1997.09.12 Add lostDigits property */ -/* 1998.05.02 Make the class immutable and final; drop set methods */ -/* 1998.06.05 Add Round (rounding modes) property */ -/* 1998.06.25 Rename from DecimalContext; allow digits=0 */ -/* 1998.10.12 change to com.ibm.math package */ -/* 1999.02.06 add javadoc comments */ -/* 1999.03.05 simplify; changes from discussion with J. Bloch */ -/* 1999.03.13 1.00 release to IBM Centre for Java Technology */ -/* 1999.07.10 1.04 flag serialization unused */ -/* 2000.01.01 1.06 copyright update */ -/* ------------------------------------------------------------------ */ - - - - -/** - * The MathContext immutable class encapsulates the - * settings understood by the operator methods of the {@link BigDecimal} - * class (and potentially other classes). Operator methods are those - * that effect an operation on a number or a pair of numbers. - *

    - * The settings, which are not base-dependent, comprise: - *

      - *
    1. digits: - * the number of digits (precision) to be used for an operation - *
    2. form: - * the form of any exponent that results from the operation - *
    3. lostDigits: - * whether checking for lost digits is enabled - *
    4. roundingMode: - * the algorithm to be used for rounding. - *
    - *

    - * When provided, a MathContext object supplies the - * settings for an operation directly. - *

    - * When MathContext.DEFAULT is provided for a - * MathContext parameter then the default settings are used - * (9, SCIENTIFIC, false, ROUND_HALF_UP). - *

    - * In the BigDecimal class, all methods which accept a - * MathContext object defaults) also have a version of the - * method which does not accept a MathContext parameter. These versions - * carry out unlimited precision fixed point arithmetic (as though the - * settings were (0, PLAIN, false, ROUND_HALF_UP). - *

    - * The instance variables are shared with default access (so they are - * directly accessible to the BigDecimal class), but must - * never be changed. - *

    - * The rounding mode constants have the same names and values as the - * constants of the same name in java.math.BigDecimal, to - * maintain compatibility with earlier versions of - * BigDecimal. - * - * @see BigDecimal - * @version 1.08 2000.06.18 - * @author Mike Cowlishaw - */ - -public final class MathContext implements java.io.Serializable{ - private static final java.lang.String $0="MathContext.nrx"; - - /* ----- Properties ----- */ - /* properties public constant */ - /** - * Plain (fixed point) notation, without any exponent. - * Used as a setting to control the form of the result of a - * BigDecimal operation. - * A zero result in plain form may have a decimal part of one or - * more zeros. - * - * @see #ENGINEERING - * @see #SCIENTIFIC - */ - public static final int PLAIN=0; // [no exponent] - - /** - * Standard floating point notation (with scientific exponential - * format, where there is one digit before any decimal point). - * Used as a setting to control the form of the result of a - * BigDecimal operation. - * A zero result in plain form may have a decimal part of one or - * more zeros. - * - * @see #ENGINEERING - * @see #PLAIN - */ - public static final int SCIENTIFIC=1; // 1 digit before . - - /** - * Standard floating point notation (with engineering exponential - * format, where the power of ten is a multiple of 3). - * Used as a setting to control the form of the result of a - * BigDecimal operation. - * A zero result in plain form may have a decimal part of one or - * more zeros. - * - * @see #PLAIN - * @see #SCIENTIFIC - */ - public static final int ENGINEERING=2; // 1-3 digits before . - - // The rounding modes match the original BigDecimal class values - /** - * Rounding mode to round to a more positive number. - * Used as a setting to control the rounding mode used during a - * BigDecimal operation. - *

    - * If any of the discarded digits are non-zero then the result - * should be rounded towards the next more positive digit. - */ - public static final int ROUND_CEILING=2; - - /** - * Rounding mode to round towards zero. - * Used as a setting to control the rounding mode used during a - * BigDecimal operation. - *

    - * All discarded digits are ignored (truncated). The result is - * neither incremented nor decremented. - */ - public static final int ROUND_DOWN=1; - - /** - * Rounding mode to round to a more negative number. - * Used as a setting to control the rounding mode used during a - * BigDecimal operation. - *

    - * If any of the discarded digits are non-zero then the result - * should be rounded towards the next more negative digit. - */ - public static final int ROUND_FLOOR=3; - - /** - * Rounding mode to round to nearest neighbor, where an equidistant - * value is rounded down. - * Used as a setting to control the rounding mode used during a - * BigDecimal operation. - *

    - * If the discarded digits represent greater than half (0.5 times) - * the value of a one in the next position then the result should be - * rounded up (away from zero). Otherwise the discarded digits are - * ignored. - */ - public static final int ROUND_HALF_DOWN=5; - - /** - * Rounding mode to round to nearest neighbor, where an equidistant - * value is rounded to the nearest even neighbor. - * Used as a setting to control the rounding mode used during a - * BigDecimal operation. - *

    - * If the discarded digits represent greater than half (0.5 times) - * the value of a one in the next position then the result should be - * rounded up (away from zero). If they represent less than half, - * then the result should be rounded down. - *

    - * Otherwise (they represent exactly half) the result is rounded - * down if its rightmost digit is even, or rounded up if its - * rightmost digit is odd (to make an even digit). - */ - public static final int ROUND_HALF_EVEN=6; - - /** - * Rounding mode to round to nearest neighbor, where an equidistant - * value is rounded up. - * Used as a setting to control the rounding mode used during a - * BigDecimal operation. - *

    - * If the discarded digits represent greater than or equal to half - * (0.5 times) the value of a one in the next position then the result - * should be rounded up (away from zero). Otherwise the discarded - * digits are ignored. - */ - public static final int ROUND_HALF_UP=4; - - /** - * Rounding mode to assert that no rounding is necessary. - * Used as a setting to control the rounding mode used during a - * BigDecimal operation. - *

    - * Rounding (potential loss of information) is not permitted. - * If any of the discarded digits are non-zero then an - * ArithmeticException should be thrown. - */ - public static final int ROUND_UNNECESSARY=7; - - /** - * Rounding mode to round away from zero. - * Used as a setting to control the rounding mode used during a - * BigDecimal operation. - *

    - * If any of the discarded digits are non-zero then the result will - * be rounded up (away from zero). - */ - public static final int ROUND_UP=0; - - - /* properties shared */ - /** - * The number of digits (precision) to be used for an operation. - * A value of 0 indicates that unlimited precision (as many digits - * as are required) will be used. - *

    - * The {@link BigDecimal} operator methods use this value to - * determine the precision of results. - * Note that leading zeros (in the integer part of a number) are - * never significant. - *

    - * digits will always be non-negative. - * - * @serial - */ - int digits; - - /** - * The form of results from an operation. - *

    - * The {@link BigDecimal} operator methods use this value to - * determine the form of results, in particular whether and how - * exponential notation should be used. - * - * @see #ENGINEERING - * @see #PLAIN - * @see #SCIENTIFIC - * @serial - */ - int form; // values for this must fit in a byte - - /** - * Controls whether lost digits checking is enabled for an - * operation. - * Set to true to enable checking, or - * to false to disable checking. - *

    - * When enabled, the {@link BigDecimal} operator methods check - * the precision of their operand or operands, and throw an - * ArithmeticException if an operand is more precise - * than the digits setting (that is, digits would be lost). - * When disabled, operands are rounded to the specified digits. - * - * @serial - */ - boolean lostDigits; - - /** - * The rounding algorithm to be used for an operation. - *

    - * The {@link BigDecimal} operator methods use this value to - * determine the algorithm to be used when non-zero digits have to - * be discarded in order to reduce the precision of a result. - * The value must be one of the public constants whose name starts - * with ROUND_. - * - * @see #ROUND_CEILING - * @see #ROUND_DOWN - * @see #ROUND_FLOOR - * @see #ROUND_HALF_DOWN - * @see #ROUND_HALF_EVEN - * @see #ROUND_HALF_UP - * @see #ROUND_UNNECESSARY - * @see #ROUND_UP - * @serial - */ - int roundingMode; - - /* properties private constant */ - // default settings - private static final int DEFAULT_FORM=SCIENTIFIC; - private static final int DEFAULT_DIGITS=9; - private static final boolean DEFAULT_LOSTDIGITS=false; - private static final int DEFAULT_ROUNDINGMODE=ROUND_HALF_UP; - - /* properties private constant */ - - private static final int MIN_DIGITS=0; // smallest value for DIGITS. - private static final int MAX_DIGITS=999999999; // largest value for DIGITS. If increased, - // the BigDecimal class may need update. - // list of valid rounding mode values, most common two first - private static final int ROUNDS[]=new int[]{ROUND_HALF_UP,ROUND_UNNECESSARY,ROUND_CEILING,ROUND_DOWN,ROUND_FLOOR,ROUND_HALF_DOWN,ROUND_HALF_EVEN,ROUND_UP}; - - - private static final java.lang.String ROUNDWORDS[]=new java.lang.String[]{"ROUND_HALF_UP","ROUND_UNNECESSARY","ROUND_CEILING","ROUND_DOWN","ROUND_FLOOR","ROUND_HALF_DOWN","ROUND_HALF_EVEN","ROUND_UP"}; // matching names of the ROUNDS values - - - - - /* properties private constant unused */ - - // Serialization version - private static final long serialVersionUID=7163376998892515376L; - - /* properties public constant */ - /** - * A MathContext object initialized to the default - * settings for general-purpose arithmetic. That is, - * digits=9 form=SCIENTIFIC lostDigits=false - * roundingMode=ROUND_HALF_UP. - * - * @see #SCIENTIFIC - * @see #ROUND_HALF_UP - */ - public static final com.ibm.math.MathContext DEFAULT=new com.ibm.math.MathContext(DEFAULT_DIGITS,DEFAULT_FORM,DEFAULT_LOSTDIGITS,DEFAULT_ROUNDINGMODE); - - - - - /* ----- Constructors ----- */ - - /** - * Constructs a new MathContext with a specified - * precision. - * The other settings are set to the default values - * (see {@link #DEFAULT}). - * - * An IllegalArgumentException is thrown if the - * setdigits parameter is out of range - * (<0 or >999999999). - * - * @param setdigits The int digits setting - * for this MathContext. - * @throws IllegalArgumentException parameter out of range. - */ - - public MathContext(int setdigits){ - this(setdigits,DEFAULT_FORM,DEFAULT_LOSTDIGITS,DEFAULT_ROUNDINGMODE); - return;} - - - /** - * Constructs a new MathContext with a specified - * precision and form. - * The other settings are set to the default values - * (see {@link #DEFAULT}). - * - * An IllegalArgumentException is thrown if the - * setdigits parameter is out of range - * (<0 or >999999999), or if the value given for the - * setform parameter is not one of the appropriate - * constants. - * - * @param setdigits The int digits setting - * for this MathContext. - * @param setform The int form setting - * for this MathContext. - * @throws IllegalArgumentException parameter out of range. - */ - - public MathContext(int setdigits,int setform){ - this(setdigits,setform,DEFAULT_LOSTDIGITS,DEFAULT_ROUNDINGMODE); - return;} - - /** - * Constructs a new MathContext with a specified - * precision, form, and lostDigits setting. - * The roundingMode setting is set to its default value - * (see {@link #DEFAULT}). - * - * An IllegalArgumentException is thrown if the - * setdigits parameter is out of range - * (<0 or >999999999), or if the value given for the - * setform parameter is not one of the appropriate - * constants. - * - * @param setdigits The int digits setting - * for this MathContext. - * @param setform The int form setting - * for this MathContext. - * @param setlostdigits The boolean lostDigits - * setting for this MathContext. - * @throws IllegalArgumentException parameter out of range. - */ - - public MathContext(int setdigits,int setform,boolean setlostdigits){ - this(setdigits,setform,setlostdigits,DEFAULT_ROUNDINGMODE); - return;} - - /** - * Constructs a new MathContext with a specified - * precision, form, lostDigits, and roundingMode setting. - * - * An IllegalArgumentException is thrown if the - * setdigits parameter is out of range - * (<0 or >999999999), or if the value given for the - * setform or setroundingmode parameters is - * not one of the appropriate constants. - * - * @param setdigits The int digits setting - * for this MathContext. - * @param setform The int form setting - * for this MathContext. - * @param setlostdigits The boolean lostDigits - * setting for this MathContext. - * @param setroundingmode The int roundingMode setting - * for this MathContext. - * @throws IllegalArgumentException parameter out of range. - */ - - public MathContext(int setdigits,int setform,boolean setlostdigits,int setroundingmode){super(); - - - // set values, after checking - if (setdigits!=DEFAULT_DIGITS) - { - if (setdigitsMAX_DIGITS) - throw new java.lang.IllegalArgumentException("Digits too large:"+" "+setdigits); - } - {/*select*/ - if (setform==SCIENTIFIC) - ; // [most common] - else if (setform==ENGINEERING) - ; - else if (setform==PLAIN) - ; - else{ - throw new java.lang.IllegalArgumentException("Bad form value:"+" "+setform); - } - } - if ((!(isValidRound(setroundingmode)))) - throw new java.lang.IllegalArgumentException("Bad roundingMode value:"+" "+setroundingmode); - digits=setdigits; - form=setform; - lostDigits=setlostdigits; // [no bad value possible] - roundingMode=setroundingmode; - return;} - - /** - * Returns the digits setting. - * This value is always non-negative. - * - * @return an int which is the value of the digits - * setting - */ - - public int getDigits(){ - return digits; - } - - /** - * Returns the form setting. - * This will be one of - * {@link #ENGINEERING}, - * {@link #PLAIN}, or - * {@link #SCIENTIFIC}. - * - * @return an int which is the value of the form setting - */ - - public int getForm(){ - return form; - } - - /** - * Returns the lostDigits setting. - * This will be either true (enabled) or - * false (disabled). - * - * @return a boolean which is the value of the lostDigits - * setting - */ - - public boolean getLostDigits(){ - return lostDigits; - } - - /** - * Returns the roundingMode setting. - * This will be one of - * {@link #ROUND_CEILING}, - * {@link #ROUND_DOWN}, - * {@link #ROUND_FLOOR}, - * {@link #ROUND_HALF_DOWN}, - * {@link #ROUND_HALF_EVEN}, - * {@link #ROUND_HALF_UP}, - * {@link #ROUND_UNNECESSARY}, or - * {@link #ROUND_UP}. - * - * @return an int which is the value of the roundingMode - * setting - */ - - public int getRoundingMode(){ - return roundingMode; - } - - /** Returns the MathContext as a readable string. - * The String returned represents the settings of the - * MathContext object as four blank-delimited words - * separated by a single blank and with no leading or trailing blanks, - * as follows: - *

      - *
    1. - * digits=, immediately followed by - * the value of the digits setting as a numeric word. - *
    2. - * form=, immediately followed by - * the value of the form setting as an uppercase word - * (one of SCIENTIFIC, PLAIN, or - * ENGINEERING). - *
    3. - * lostDigits=, immediately followed by - * the value of the lostDigits setting - * (1 if enabled, 0 if disabled). - *
    4. - * roundingMode=, immediately followed by - * the value of the roundingMode setting as a word. - * This word will be the same as the name of the corresponding public - * constant. - *
    - *

    - * For example: - *
    - * digits=9 form=SCIENTIFIC lostDigits=0 roundingMode=ROUND_HALF_UP - * - *

    - * Additional words may be appended to the result of - * toString in the future if more properties are added - * to the class. - * - * @return a String representing the context settings. - */ - - public java.lang.String toString(){ - java.lang.String formstr=null; - int r=0; - java.lang.String roundword=null; - {/*select*/ - if (form==SCIENTIFIC) - formstr="SCIENTIFIC"; - else if (form==ENGINEERING) - formstr="ENGINEERING"; - else{ - formstr="PLAIN";/* form=PLAIN */ - } - } - {int $1=ROUNDS.length;r=0;r:for(;$1>0;$1--,r++){ - if (roundingMode==ROUNDS[r]) - { - roundword=ROUNDWORDS[r]; - break r; - } - } - }/*r*/ - return "digits="+digits+" "+"form="+formstr+" "+"lostDigits="+(lostDigits?"1":"0")+" "+"roundingMode="+roundword; - } - - - /* Test whether round is valid. */ - // This could be made shared for use by BigDecimal for setScale. - - private static boolean isValidRound(int testround){ - int r=0; - {int $2=ROUNDS.length;r=0;r:for(;$2>0;$2--,r++){ - if (testround==ROUNDS[r]) - return true; - } - }/*r*/ - return false; - } - } diff --git a/icu4j/src/com/ibm/math/package.html b/icu4j/src/com/ibm/math/package.html deleted file mode 100755 index 3fb5563180..0000000000 --- a/icu4j/src/com/ibm/math/package.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - -C:\cvs\icu4j\src\com\ibm\demo\package.html - - - - -

    IBM BigDecimal support.

    - - diff --git a/icu4j/src/com/ibm/richtext/tests/Declaration.java b/icu4j/src/com/ibm/richtext/tests/Declaration.java deleted file mode 100755 index e5ff6e4740..0000000000 --- a/icu4j/src/com/ibm/richtext/tests/Declaration.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * @(#)$RCSfile: Declaration.java,v $ $Revision: 1.1 $ $Date: 2000/04/20 17:46:57 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -package com.ibm.richtext.tests; - -import com.ibm.richtext.styledtext.MConstText; -import com.ibm.richtext.styledtext.StyledText; -import com.ibm.textlayout.attributes.AttributeMap; - -/** - * This class contains the first four paragraphs of the Declaration - * of Independence, as both styled and unstyled text. The views - * expressed therein are not necessarily those of the programmer or of - * his/her employer. No criticism of any monarchy, oligarchy, dictatorship, - * autocracy, plutocracy, theocracy, anarchist territory, colonial power, - * or any other nondemocratic form of government is intended. This document - * is provided "as-is" without any warranty expressed or implied. - */ -public final class Declaration { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - public static final String fgDeclarationStr = "In Congress, July 4, 1776, THE UNANIMOUS DECLARATION OF THE THIRTEEN UNITED STATES OF AMERICA\n" + - "\n" + - "When in the Course of human Events, it becomes necessary for one People to dissolve the Political Bands which have connected them with another, and to assume among the Powers of the Earth, the separate and equal Station to which the Laws of Nature and of Nature's God entitle them, a decent Respect to the Opinions of Mankind requires that they should declare the causes which impel them to the Separation.\n" + - "\n" + - "We hold these Truths to be self-evident, that all Men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty, and the Pursuit of Happiness.\n" + - "\n" + - "That to secure these Rights, Governments are instituted among Men, deriving their just Powers from the Consent of the Governed, that whenever any Form of Government becomes destructive of these Ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its Foundation on such Principles, and organizing its Powers in such Form, as to them shall seem most likely to effect their Safety and Happiness. Prudence, indeed, will dictate that Governments long established should not be changed for light and transient Causes; and accordingly all Experience hath shewn, that Mankind are more disposed to suffer, while Evils are sufferable, than to right themselves by abolishing the Forms to which they are accustomed. But when a long Train of Abuses and Usurpations, pursuing invariably the same Object, evinces a Design to reduce them under absolute Despotism, it is their Right, it is their Duty, to throw off such Government, and to provide new Guards for their future Security.\n" + - "\n"; - - public static final MConstText fgDeclaration = new StyledText(fgDeclarationStr, AttributeMap.EMPTY_ATTRIBUTE_MAP); -} diff --git a/icu4j/src/com/ibm/richtext/tests/ITestTextPanel.java b/icu4j/src/com/ibm/richtext/tests/ITestTextPanel.java deleted file mode 100755 index 485342248f..0000000000 --- a/icu4j/src/com/ibm/richtext/tests/ITestTextPanel.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * @(#)$RCSfile: ITestTextPanel.java,v $ $Revision: 1.2 $ $Date: 2000/04/22 03:31:34 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -package com.ibm.richtext.tests; - -import java.awt.Button; -import java.awt.Frame; -import java.awt.GridLayout; -import java.awt.datatransfer.Clipboard; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowEvent; -import java.awt.event.WindowAdapter; - -import java.util.Date; -import java.text.DateFormat; - -import com.ibm.richtext.textpanel.MTextPanel; -import com.ibm.richtext.textpanel.TextPanel; -import com.ibm.richtext.awtui.TextFrame; - -public class ITestTextPanel extends Frame implements ActionListener { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - private static long fgOpCount = 0; - - private TestTextPanel fTest; - - private MTextPanel fTextPanel; - private Frame fTextFrame; - private Clipboard fClipboard; - private Button fExersize, fStressTest, fResize; - - public static void main(String[] args) { - - Date startDate = new Date(); - - try { - Clipboard clipboard = new Clipboard("ITextTestPanel"); - TextFrame frame = new TextFrame(null, "Interactive Test", clipboard); - MTextPanel panel = frame.getTextPanel(); - - new ITestTextPanel(panel, frame, clipboard).show(); - } - finally { - DateFormat df = DateFormat.getDateTimeInstance(); - System.out.println("Start time: " + df.format(startDate)); - System.out.println("End Time: " + df.format(new Date())); - System.out.println("Op count: " + fgOpCount); - } - } - - public ITestTextPanel(MTextPanel panel, - Frame frame, - Clipboard clipboard) { - - fTextPanel = panel; - fTest = new TestTextPanel(fTextPanel); - fClipboard = clipboard; - - setLayout(new GridLayout(0, 1)); - - fTextFrame = frame; - fTextFrame.setSize(350, 500); - fTextFrame.show(); - - // initialize UI: - fExersize = new Button("Exercise"); - fExersize.addActionListener(this); - add(fExersize); - - fStressTest = new Button("Stress Test"); - fStressTest.addActionListener(this); - add(fStressTest); - - pack(); - - addWindowListener(new WindowAdapter() { - public void windowActivated(WindowEvent e) { - //activateTextFrame(); - } - public void windowClosing(WindowEvent e) { - System.exit(0); - } - }); - - setSize(280, 150); - } - - private void activateTextFrame() { - - fTextFrame.toFront(); - } - - public void actionPerformed(ActionEvent event) { - - Object source = event.getSource(); - activateTextFrame(); - Date startDate = new Date(); - boolean exitedNormally = false; - - try { - if (source == fExersize) { - fTest.incRandSeed(); - for (int i=0; i < 100; i++) { - selectOperation(fTextFrame, fClipboard); - } - } - else if (source == fStressTest) { - fTest.incRandSeed(); - while (true) { - selectOperation(fTextFrame, fClipboard); - } - } - exitedNormally = true; - } - finally { - if (!exitedNormally) { - DateFormat df = DateFormat.getDateTimeInstance(); - System.out.println("Start time: " + df.format(startDate)); - System.out.println("End Time: " + df.format(new Date())); - System.out.println("Rand seed: " + fTest.getRandSeed()); - System.out.println("Op count: " + fgOpCount); - } - } - } - - /** - * Perform a random operation on the MTextPanel. Frame can - * be null. - */ - private static final int OP_COUNT = 15; - - public void selectOperation(Frame frame, - Clipboard fClipboard) { - - int op = fTest.randInt(OP_COUNT); - - switch (op) { - - case 0: - fTest._testSetSelection(); - break; - - case 1: - fTest._testModifications(fTest.MOD_TEXT, - true); - break; - - case 2: - fTest._testEditMenuOperations(fClipboard); - break; - - case 3: - fTest._testModFlag(fTextPanel.getCommandLogSize()); - break; - - case 4: - fTest.applyCharacterStyle(); - break; - - case 5: - fTest.applyParagraphStyle(); - break; - - case 6: - case 7: - case 8: - case 9: - fTest.typeKeys(); - break; - - case 10: - fTest.selectText(); - break; - - case 11: - fTest.undoRedo(); - break; - - case 12: - //if (frame != null) { - // fTest.resizeFrame(frame); - // break; - //} - - case 13: - fTest.applyKeyRemap(); - break; - - case 14: - fTest._testCommandLogControl(); - break; - - default: - throw new Error("OP_COUNT is incorrect"); - } - fgOpCount++; - } - - -} diff --git a/icu4j/src/com/ibm/richtext/tests/TestTextPanel.java b/icu4j/src/com/ibm/richtext/tests/TestTextPanel.java deleted file mode 100755 index 87552ee8a3..0000000000 --- a/icu4j/src/com/ibm/richtext/tests/TestTextPanel.java +++ /dev/null @@ -1,846 +0,0 @@ -/* - * @(#)$RCSfile: TestTextPanel.java,v $ $Revision: 1.7 $ $Date: 2000/04/24 21:11:45 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -package com.ibm.richtext.tests; - -import java.util.Random; -import java.awt.Color; -import java.awt.Frame; -import java.awt.event.KeyEvent; - -import java.awt.datatransfer.Clipboard; -import java.awt.datatransfer.ClipboardOwner; -import java.awt.datatransfer.StringSelection; -import java.awt.datatransfer.Transferable; - -import com.ibm.richtext.textpanel.KeyRemap; -import com.ibm.richtext.textpanel.KeyEventForwarder; -import com.ibm.richtext.textpanel.MTextPanel; -import com.ibm.richtext.textpanel.TextPanel; -import com.ibm.richtext.textpanel.TextPanelEvent; -import com.ibm.richtext.textpanel.TextPanelListener; - -import com.ibm.richtext.styledtext.MConstText; -import com.ibm.richtext.styledtext.StyledText; -import com.ibm.textlayout.attributes.TextAttribute; -import com.ibm.textlayout.attributes.AttributeMap; - -import com.ibm.richtext.styledtext.StyleModifier; -import com.ibm.textlayout.attributes.AttributeSet; -import com.ibm.textlayout.attributes.TextAttribute; -import com.ibm.textlayout.attributes.AttributeMap; - -// Note: this used to be a TestFmwk test. If you add -// more tests to it, be sure to add them to -// com.ibm.test.richtext.FmwkTestTextPanel.test() - -// otherwise they won't get run! - -public class TestTextPanel /*extends TestFmwk*/ { - - private final class TestListener implements TextPanelListener { - - private int NO_WAY = 0; - private int DEFINITELY = 1; - private int MAYBE = 2; - - private final int[] status; - - TestListener(MTextPanel textPanel) { - - int length = TextPanelEvent.TEXT_PANEL_LAST - - TextPanelEvent.TEXT_PANEL_FIRST + 1; - status = new int[length]; - textPanel.addListener(this); - allowAll(); - } - - void refuseAll() { - - for (int i=0; i < status.length; i++) { - status[i] = NO_WAY; - } - } - - void allowAll() { - - for (int i=0; i < status.length; i++) { - status[i] = MAYBE; - } - } - - void expectEvent(int type) { - - int index = type - TextPanelEvent.TEXT_PANEL_FIRST; - status[index] = DEFINITELY; - } - - void allowEvent(int type) { - int index = type - TextPanelEvent.TEXT_PANEL_FIRST; - status[index] = MAYBE; - } - - void assertNotExpectingEvents() { - assertNotExpectingEvents(false, 0, false); - } - - void assertNotExpectingEvents(int iterationCount, boolean exp) { - assertNotExpectingEvents(true, iterationCount, exp); - } - - private void assertNotExpectingEvents(boolean logDetails, int iterationCount, boolean exp) { - - boolean e = false; - for (int i=0; i < status.length; i++) { - if (status[i] == DEFINITELY) { - if (logDetails) { - logMessage("Expecting event " + - (i+TextPanelEvent.TEXT_PANEL_FIRST)); - logMessage("iterationCount="+iterationCount+"; expexting="+exp); - } - e = true; - } - } - if (e) { - reportError("Some events pending"); - } - } - - public void textEventOccurred(TextPanelEvent event) { - - int index = event.getID() - TextPanelEvent.TEXT_PANEL_FIRST; - if (status[index] == NO_WAY) { - reportError("Unexpected event: " + event); - } - else if (status[index] == DEFINITELY) { - status[index] = NO_WAY; - } - } - - public boolean respondsToEventType(int type) { - - return true; - } - } - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - - private static final String STRING_CONTENT = "Some content"; - private static final int TEST_ITERS = 2; - public static final MConstText MOD_TEXT = - new StyledText("Styled", AttributeMap.EMPTY_ATTRIBUTE_MAP); - - private Clipboard fClipboard; - private MTextPanel fTextPanel = null; - private TestListener fListener = null; - private int fRandSeed = 0; - private Random rand; - - private static final int BIG_COMMAND_LOG_SIZE = 40; - private static final int SMALL_COMMAND_LOG_SIZE = 8; - - private static final StyleModifier[] paraMods = { - StyleModifier.createAddModifier( - new AttributeMap(TextAttribute.LINE_FLUSH, - TextAttribute.FLUSH_LEADING)), - StyleModifier.createAddModifier(TextAttribute.LINE_FLUSH, - TextAttribute.FLUSH_CENTER), - StyleModifier.createAddModifier(TextAttribute.LINE_FLUSH, - TextAttribute.FLUSH_TRAILING), - StyleModifier.createAddModifier(TextAttribute.LINE_FLUSH, - TextAttribute.FULLY_JUSTIFIED), - StyleModifier.createAddModifier(TextAttribute.RUN_DIRECTION, - TextAttribute.RUN_DIRECTION_RTL), - StyleModifier.createAddModifier(TextAttribute.RUN_DIRECTION, - TextAttribute.RUN_DIRECTION_LTR), - StyleModifier.createRemoveModifier( - new AttributeSet(TextAttribute.LINE_FLUSH)), - StyleModifier.createRemoveModifier( - new AttributeSet(TextAttribute.RUN_DIRECTION)) - }; - - private static final int SELECT = 0; - private static final int SET_CARET_POS = 1; - private static final int SET_START = 2; - private static final int SET_END = 3; - - // using both styles of add modifier: AttributeMap and - // key-value, just for variety... - private static final StyleModifier[] charMods = { - StyleModifier.createAddModifier( - new AttributeMap(TextAttribute.WEIGHT, - TextAttribute.WEIGHT_BOLD)), - StyleModifier.createAddModifier(TextAttribute.FOREGROUND, - Color.green), - StyleModifier.createAddModifier( - new AttributeMap(TextAttribute.UNDERLINE, - TextAttribute.UNDERLINE_ON).addAttributes( - new AttributeMap(TextAttribute.SIZE, new Float(6)))), - StyleModifier.createReplaceModifier( - new AttributeMap(TextAttribute.FAMILY, "Dialog")), - StyleModifier.createRemoveModifier( - new AttributeSet( - new Object[] { TextAttribute.WEIGHT, - TextAttribute.POSTURE, - TextAttribute.UNDERLINE, - TextAttribute.STRIKETHROUGH, - TextAttribute.SUPERSCRIPT })), - StyleModifier.IDENTITY - }; - - private static final char[] TYPED_CHARS = new char[128 - ' ' + 3]; - static { - TYPED_CHARS[0] = 8; // backspace - TYPED_CHARS[1] = '\t'; - TYPED_CHARS[2] = '\n'; - for (int i=3; i < TYPED_CHARS.length; i++) { - TYPED_CHARS[i] = (char) (' ' + i - 3); - } - } - - public TestTextPanel() { - - fClipboard = new Clipboard("TestTextPanel"); - incRandSeed(); - } - - protected void reportError(String message) { - - System.err.println(message); - throw new RuntimeException(message); - //super.errln(message); - } - - protected void logMessage(String message) { - - System.err.println(message); - //super.logMessage(message); - } - - public TestTextPanel(MTextPanel panel) { - - this(); - setTextPanel(panel); - } - - void incRandSeed() { - - rand = new Random(++fRandSeed); - } - - int getRandSeed() { - - return fRandSeed; - } - - int randInt(int limit) { - - return randInt(0, limit); - } - - int randInt(int start, int limit) { - - if (start > limit) { - throw new IllegalArgumentException("Range is 0-length."); - } - else if (start == limit) { - return start; - } - - return start + (Math.abs(rand.nextInt())%(limit-start)) ; - } - - public void test() { - - AttributeMap bold = new AttributeMap(TextAttribute.WEIGHT, - TextAttribute.WEIGHT_BOLD); - MConstText text1 = new StyledText("Test contents. 1234\nHow about it?", - AttributeMap.EMPTY_ATTRIBUTE_MAP); - MConstText text2 = new StyledText("Another test string.", bold); - - _testWithText(text1); - _testWithText(text2); - _testWithText(new StyledText()); - - StyledText big1 = new StyledText(); - for (int i=0; i < 50; i++) { - big1.append(text1); - } - - _testWithText(big1); - StyledText big2 = new StyledText(text1); - for (int i=0; i < 80; i++) { - big2.append(text2); - } - - _testWithText(big2); - } - - private void setTextPanel(MTextPanel panel) { - - fTextPanel = panel; - fListener = new TestListener(panel); - } - - private void _testWithText(MConstText text) { - - setTextPanel(new TextPanel(text, fClipboard)); - - for (int i=0; i < TEST_ITERS; i++) { - _testSetSelection(); - _testModifications(MOD_TEXT, true); - _testEditMenuOperations(fClipboard); - _testModFlag(fTextPanel.getCommandLogSize()); - _testCommandLogControl(); - } - } - - private void _testSelection(int function, - final int aStart, - final int aLimit) { - - int oldStart = fTextPanel.getSelectionStart(); - int oldLimit = fTextPanel.getSelectionEnd(); - - final int length = fTextPanel.getTextLength(); - - int start = aStart; - int limit = aLimit; - - if (start < 0) { - start = 0; - } - else if (start > length) { - start = length; - } - - if (limit < start) { - limit = start; - } - else if (limit > length) { - limit = length; - } - - fListener.refuseAll(); - - if (oldStart != start || oldLimit != limit) { - fListener.expectEvent(TextPanelEvent.SELECTION_RANGE_CHANGED); - fListener.allowEvent(TextPanelEvent.SELECTION_STYLES_CHANGED); - } - if ((oldStart==oldLimit) != (start==limit)) { - fListener.expectEvent(TextPanelEvent.SELECTION_EMPTY_CHANGED); - } - if (oldStart==oldLimit) { - fListener.allowEvent(TextPanelEvent.UNDO_STATE_CHANGED); - } - - switch(function) { - case SELECT: - fTextPanel.select(aStart, aLimit); - break; - case SET_CARET_POS: - fTextPanel.setCaretPosition(aStart); - break; - case SET_START: - fTextPanel.setSelectionStart(aStart); - break; - case SET_END: - fTextPanel.setSelectionEnd(aLimit); - break; - default: - throw new IllegalArgumentException("Invalid function"); - } - - if (fTextPanel.getSelectionStart() != start) { - reportError("getSelectionStart is incorrect after set"); - } - if (fTextPanel.getSelectionEnd() != limit) { - reportError("getSelectionEnd is incorrect after set"); - } - fListener.assertNotExpectingEvents(); - fListener.allowAll(); - } - - private void setAndTestSelection(int start, int limit) { - - _testSelection(SELECT, start, limit); - } - - private void setAndTestCaret(int caretPos) { - - _testSelection(SET_CARET_POS, caretPos, caretPos); - } - - private void setAndTestSelectionStart(int selStart) { - - int limit = fTextPanel.getSelectionEnd(); - _testSelection(SET_START, selStart, limit); - } - - private void setAndTestSelectionEnd(int selEnd) { - - int start = fTextPanel.getSelectionStart(); - _testSelection(SET_END, start, selEnd); - } - - public void _testSetSelection() { - - int textLength = fTextPanel.getTextLength(); - if (textLength != fTextPanel.getText().length()) { - reportError("Text panel length is not correct"); - } - - setAndTestSelection(0, textLength / 2); - setAndTestSelection(textLength / 2, textLength); - setAndTestSelection(0, textLength); - setAndTestSelection(-1, textLength+1); - if (textLength > 0) { - setAndTestSelection(0, textLength - 1); - setAndTestSelection(0, 1); - } - - final int incAmount = Math.max(1, textLength/5); - for (int index = 0; index <= textLength; index += incAmount) { - - setAndTestCaret(index); - setAndTestSelectionStart(textLength-index); - setAndTestSelectionEnd(textLength); - setAndTestSelectionStart(0); - setAndTestSelectionEnd(textLength-index); - } - } - - /** - * Text must be editable to pass this test. - */ - public void _testModifications(MConstText insertionText, - boolean restoreOldText) { - - MConstText oldText = new StyledText(fTextPanel.getText()); - final int insLength = insertionText.length(); - - fListener.allowAll(); - fListener.expectEvent(TextPanelEvent.TEXT_CHANGED); - fListener.expectEvent(TextPanelEvent.SELECTION_RANGE_CHANGED); - fTextPanel.append(insertionText); - fListener.assertNotExpectingEvents(); - - if (fTextPanel.getSelectionStart() != oldText.length() + insLength) { - reportError("Append didn't result in correct selection"); - } - - fListener.expectEvent(TextPanelEvent.TEXT_CHANGED); - fListener.expectEvent(TextPanelEvent.SELECTION_RANGE_CHANGED); - fTextPanel.insert(insertionText, 0); - fListener.assertNotExpectingEvents(); - fListener.allowAll(); - - if (fTextPanel.getSelectionStart() != insLength) { - reportError("Insert didn't result in correct selection"); - } - - fTextPanel.replaceRange(insertionText, insLength, insLength+oldText.length()); - if (fTextPanel.getSelectionStart() != insLength*2) { - reportError("Replace didn't result in correct selection"); - } - if (fTextPanel.getSelectionEnd() != insLength*2) { - reportError("Replace didn't result in correct selection"); - } - if (fTextPanel.getTextLength() != insLength*3) { - reportError("textLength is incorrect"); - } - - if (restoreOldText) { - fTextPanel.setText(oldText); - if (fTextPanel.getSelectionStart() != oldText.length()) { - reportError("setText didn't result in correct selection"); - } - if (fTextPanel.getTextLength() != oldText.length()) { - reportError("length incorrect after setText"); - } - } - - fListener.allowAll(); - } - - private static int iterationCount = 0; - public void _testCommandLogControl() { - - fListener.refuseAll(); - iterationCount++; - boolean exp = false; - if (fTextPanel.canRedo() || BIG_COMMAND_LOG_SIZE==0) { - fListener.expectEvent(TextPanelEvent.UNDO_STATE_CHANGED); - exp = true; - } - //try { - fTextPanel.setCommandLogSize(BIG_COMMAND_LOG_SIZE); - - if (fTextPanel.canRedo()) { - reportError("canRedo after setCommandLogSize"); - } - fListener.assertNotExpectingEvents(iterationCount, exp); - //} - //catch(Error e) { - // logMessage("iterationCount="+iterationCount+"; expexting="+exp); - // throw e; - //} - - MConstText insText = new StyledText("7", - AttributeMap.EMPTY_ATTRIBUTE_MAP); - - final int origLength = fTextPanel.getTextLength(); - int start = origLength / 3; - - fListener.allowEvent(TextPanelEvent.SELECTION_RANGE_CHANGED); - fListener.allowEvent(TextPanelEvent.SELECTION_STYLES_CHANGED); - - for (int i=start; i < BIG_COMMAND_LOG_SIZE+start; i++) { - fListener.expectEvent(TextPanelEvent.UNDO_STATE_CHANGED); - fListener.expectEvent(TextPanelEvent.TEXT_CHANGED); - if (fTextPanel.getSelectionStart() != fTextPanel.getSelectionEnd()) { - fListener.expectEvent(TextPanelEvent.SELECTION_EMPTY_CHANGED); - } - fTextPanel.insert(insText, i); - fListener.assertNotExpectingEvents(); - } - - fListener.allowEvent(TextPanelEvent.SELECTION_EMPTY_CHANGED); - - for (int i=0; i < BIG_COMMAND_LOG_SIZE-1; i++) { - fListener.expectEvent(TextPanelEvent.UNDO_STATE_CHANGED); - fListener.expectEvent(TextPanelEvent.TEXT_CHANGED); - fTextPanel.undo(); - fListener.assertNotExpectingEvents(); - } - if (!fTextPanel.canUndo()) { - reportError("Command log is too small"); - } - - fListener.allowAll(); - fTextPanel.undo(); - if (fTextPanel.canUndo()) { - reportError("Command log is too large"); - } - - if (fTextPanel.getTextLength() != origLength * insText.length()) { - reportError("Text length was not restored"); - } - - for (int i=0; i < BIG_COMMAND_LOG_SIZE; i++) { - fTextPanel.redo(); - } - - if (fTextPanel.getTextLength() != origLength+BIG_COMMAND_LOG_SIZE) { - reportError("Text length was not restored after redo"); - } - - if (fTextPanel.canRedo()) { - reportError("Should not be able to redo"); - } - - fTextPanel.undo(); - - fTextPanel.setCommandLogSize(SMALL_COMMAND_LOG_SIZE); - - if (fTextPanel.canRedo()) { - reportError("canRedo after setCommandLogSize(small)"); - } - - for (int i=0; i < SMALL_COMMAND_LOG_SIZE; i++) { - if (!fTextPanel.canUndo()) { - reportError("should be able to undo"); - } - fTextPanel.undo(); - } - if (fTextPanel.canUndo()) { - reportError("should not be able to undo after setCommandLogSize(small)"); - } - if (!fTextPanel.canRedo()) { - reportError("why can't this redo???"); - } - fTextPanel.redo(); - - fTextPanel.clearCommandLog(); - - if (fTextPanel.canUndo() || fTextPanel.canRedo()) { - reportError("Command log wasn't cleared"); - } - } - - /** - * Test cut, copy, paste, undo, redo, clear, canUndo, canRedo. - * Text must be editable to pass this test. - */ - public void _testEditMenuOperations(Clipboard clipboard) { - - if (clipboard != null) { - // test paste and undo / redo - Transferable tr = new StringSelection(STRING_CONTENT); - clipboard.setContents(tr, new ClipboardOwner() { - public void lostOwnership(Clipboard c, Transferable t) { - } - }); - if (!fTextPanel.clipboardNotEmpty()) { - reportError("MTextPanel doesn't recognize string content."); - } - - fTextPanel.setCaretPosition(fTextPanel.getSelectionStart()); - int oldLength = fTextPanel.getTextLength(); - fTextPanel.paste(); - if (fTextPanel.getTextLength() != oldLength + STRING_CONTENT.length()) { - reportError("Text length is wrong after paste."); - } - - if (!fTextPanel.canUndo()) { - reportError("canUndo should be true"); - } - fTextPanel.undo(); - if (fTextPanel.getTextLength() != oldLength) { - reportError("Length is wrong after undo"); - } - if (!fTextPanel.canRedo()) { - reportError("canRedo should be true"); - } - fTextPanel.redo(); - if (fTextPanel.getTextLength() != oldLength + STRING_CONTENT.length()) { - reportError("Text length is wrong after redo."); - } - } - - int origLength = fTextPanel.getTextLength(); - fTextPanel.selectAll(); - fTextPanel.clear(); - if (fTextPanel.getTextLength() != 0) { - reportError("Length is nonzero after clear"); - } - if (!fTextPanel.canUndo()) { - reportError("canUndo should be true"); - } - fTextPanel.undo(); - if (fTextPanel.getTextLength() != origLength) { - reportError("Old text not restored"); - } - - if (origLength > 0) { - - fTextPanel.select(0, 1); - fTextPanel.cut(); - if (fTextPanel.getTextLength() != origLength-1) { - reportError("Length wrong after cut"); - } - fTextPanel.paste(); - if (fTextPanel.getTextLength() != origLength) { - reportError("Length wrong after paste"); - } - fTextPanel.select(0, origLength); - fTextPanel.copy(); - fTextPanel.setCaretPosition(0); - fTextPanel.paste(); - if (fTextPanel.getTextLength() != 2*origLength) { - reportError("Length wrong after paste"); - } - fTextPanel.undo(); - if (fTextPanel.getTextLength() != origLength) { - reportError("Length wrong after undo"); - } - } - } - - private void setAndTestModFlag(final int depth, - boolean modified) { - - fTextPanel.setModified(modified); - for (int i=0; i < depth; i++) { - if (!fTextPanel.canUndo()) { - reportError("Panel cannot undo at valid depth. Depth=" + i); - } - fTextPanel.undo(); - fTextPanel.setModified(modified); - } - - // check that all mod flags are false: - if (fTextPanel.isModified() != modified) { - reportError("isModified is not correct"); - } - - for (int i=0; i < depth; i++) { - fTextPanel.redo(); - if (fTextPanel.isModified() != modified) { - reportError("isModified is not correct"); - } - } - } - - /** - * Make depth modifications to the text in textfTextPanel. - * Set the modified flag on each operation, and then retrieve its - * value. Finally, undo the modifications. - */ - public void _testModFlag(final int depth) { - - final int oldLength = fTextPanel.getTextLength(); - - for (int i=0; i < depth; i++) { - fTextPanel.insert(MOD_TEXT, 0); - } - - setAndTestModFlag(depth, false); - setAndTestModFlag(depth, true); - - for (int i=0; i < depth; i++) { - fTextPanel.undo(); - } - - if (fTextPanel.getTextLength() != oldLength) { - reportError("Undo did not restore old text."); - } - } - - void applyCharacterStyle() { - - StyleModifier stMod = charMods[randInt(charMods.length)]; - fListener.refuseAll(); - fListener.expectEvent(TextPanelEvent.SELECTION_STYLES_CHANGED); - if (fTextPanel.getSelectionStart() != fTextPanel.getSelectionEnd()) { - fListener.expectEvent(TextPanelEvent.TEXT_CHANGED); - fListener.allowEvent(TextPanelEvent.SELECTION_RANGE_CHANGED); - } - fListener.allowEvent(TextPanelEvent.UNDO_STATE_CHANGED); - fTextPanel.modifyCharacterStyleOnSelection(stMod); - fListener.assertNotExpectingEvents(); - fListener.allowAll(); - } - - - void applyParagraphStyle() { - - fListener.refuseAll(); - fListener.expectEvent(TextPanelEvent.SELECTION_STYLES_CHANGED); - fListener.expectEvent(TextPanelEvent.TEXT_CHANGED); - fListener.allowEvent(TextPanelEvent.UNDO_STATE_CHANGED); - fListener.allowEvent(TextPanelEvent.SELECTION_RANGE_CHANGED); - StyleModifier stMod = paraMods[randInt(paraMods.length)]; - fTextPanel.modifyParagraphStyleOnSelection(stMod); - fListener.assertNotExpectingEvents(); - fListener.allowAll(); - } - - void applyKeyRemap() { - - fListener.refuseAll(); - fListener.expectEvent(TextPanelEvent.KEYREMAP_CHANGED); - int op = randInt(5); - switch (op) { - - case 0: - fTextPanel.setKeyRemap(KeyRemap.getIdentityRemap()); - break; - - case 1: - fTextPanel.setKeyRemap(KeyRemap.getArabicTransliteration()); - break; - - case 2: - fTextPanel.setKeyRemap(KeyRemap.getHebrewTransliteration()); - break; - - case 3: - fTextPanel.setKeyRemap(KeyRemap.getIsraelNikud()); - break; - - case 4: - //fTextPanel.setKeyRemap(KeyRemap.getThaiKetmanee()); - fTextPanel.setKeyRemap(KeyRemap.getIsraelNikud()); - break; - - default: - reportError("Invalid operation!"); - } - fListener.assertNotExpectingEvents(); - fListener.allowAll(); - } - - void resizeFrame(Frame frame) { - - fListener.refuseAll(); - fListener.allowEvent(TextPanelEvent.FORMAT_WIDTH_CHANGED); - int wd = randInt(50, 1000); - int ht = randInt(20, 800); - - frame.setSize(wd, ht); - fListener.allowAll(); - } - - void selectText() { - - int selStart = randInt(-10, fTextPanel.getTextLength()); - int selLimit = randInt(0, fTextPanel.getTextLength() + 10); - _testSelection(SELECT, selStart, selLimit); - } - - void undoRedo() { - - final int opCount = randInt(-10, 15); - - for (int i=opCount; i <= 0; i++) { - fTextPanel.redo(); - } - for (int i=0; i < opCount; i++) { - fTextPanel.undo(); - } - } - - void typeKeys() { - - final int keyCount = randInt(1, 100); - TextPanel textPanel = (TextPanel) fTextPanel; - - KeyEventForwarder forwarder = new KeyEventForwarder(textPanel); - - fListener.refuseAll(); - fListener.allowEvent(TextPanelEvent.UNDO_STATE_CHANGED); - - if (fTextPanel.getSelectionStart() != fTextPanel.getSelectionEnd()) { - fListener.expectEvent(TextPanelEvent.SELECTION_EMPTY_CHANGED); - } - - for (int i=0; i < keyCount; i++) { - char typedChar = TYPED_CHARS[randInt(TYPED_CHARS.length)]; - KeyEvent event = new KeyEvent(textPanel, - KeyEvent.KEY_TYPED, - 0, - 0, - KeyEvent.VK_UNDEFINED, - typedChar); - if (typedChar == 8 || typedChar == 0x7f) { - fListener.allowEvent(TextPanelEvent.TEXT_CHANGED); - fListener.allowEvent(TextPanelEvent.SELECTION_RANGE_CHANGED); - } - else { - fListener.expectEvent(TextPanelEvent.TEXT_CHANGED); - fListener.expectEvent(TextPanelEvent.SELECTION_RANGE_CHANGED); - } - forwarder.handleKeyEvent(event); - //try { - fListener.assertNotExpectingEvents(i, false); - //} - //catch(Error e) { - // logMessage("i="+i+"; typedChar="+Integer.toHexString(typedChar)); - // throw e; - //} - } - fListener.allowAll(); - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/richtext/tests/TypingPerfTest.java b/icu4j/src/com/ibm/richtext/tests/TypingPerfTest.java deleted file mode 100755 index 838fff3738..0000000000 --- a/icu4j/src/com/ibm/richtext/tests/TypingPerfTest.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * @(#)$RCSfile: TypingPerfTest.java,v $ $Revision: 1.3 $ $Date: 2001/09/08 01:14:52 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -package com.ibm.richtext.tests; - -import java.awt.Button; -import java.awt.GridLayout; -import java.awt.Frame; -import java.awt.Toolkit; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.io.IOException; - -import java.text.DateFormat; -import java.util.Date; - -import com.ibm.richtext.textpanel.KeyEventForwarder; -import com.ibm.richtext.textpanel.TextPanel; -import com.ibm.richtext.awtui.TextFrame; -import com.ibm.richtext.styledtext.MConstText; - -import com.ibm.richtext.demo.EditDemo; -import com.ibm.richtext.demo.TextDocument; - -public class TypingPerfTest implements ActionListener { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - private TextFrame fTextFrame; - private KeyEventForwarder fKeyEventForwarder; - private PrintWriter fOut; - - private static final String fgAtStartCommand = "Insert at start"; - private static final String fgAtEndCommand = "Insert at end"; - private static final String fgFwdDelete = "Forward delete"; - private static final String fgBackspace = "Backspace"; - private static final String fgAtCurrentPosCommand = "Insert at current position"; - private static final String fgLotsOfTextCommand = "Insert a lot of text"; - - private static final String USAGE = "Usage: java com.ibm.richtext.tests.TypingPerfTest [file] [-insertionText text]"; - private char[] fInsText; - - public static void main(String[] args) throws IOException { - - // not used OutputStream outStream = null; - PrintWriter writer = new PrintWriter(System.out); - - MConstText text = Declaration.fgDeclaration; - char[] insText = "The quick brown fox jumps over the lazy dog. The end. ".toCharArray(); - - int index = 0; - while (index < args.length) { - if (args[index].equals("-insertionText")) { - if (args.length == ++index) { - throw new Error(USAGE); - } - insText = args[index++].toCharArray(); - } - else { - // This will try MConstText first, then plain text. - TextDocument doc = EditDemo.getDocumentFromFile(new File(args[index++])); - if (doc == null) { - throw new Error("Couldn't open file "+args[index-1]); - } - text = doc.getText(); - } - } - - if (index != args.length) { - throw new Error(USAGE); - } - - new TypingPerfTest(writer, text, insText); - } - - public TypingPerfTest(PrintWriter out, MConstText text, char[] insText) throws IOException { - - fInsText = insText; - fTextFrame = new TextFrame(text, "", null); - TextPanel textPanel = (TextPanel) fTextFrame.getTextPanel(); - fKeyEventForwarder = new KeyEventForwarder(textPanel); - fOut = out; - - DateFormat df = DateFormat.getDateTimeInstance(); - out.println("Test date: " + df.format(new Date())); - - fTextFrame.setSize(500, 700); - fTextFrame.show(); - - Frame f = new Frame("Typing Perf Test"); - f.setLayout(new GridLayout(0, 1)); - Button b; -/* - b = new Button(fgAtStartCmd); - b.addActionListener(this); - f.add(b); - - b = new Button(fgAtEndCmd); - b.addActionListener(this); - f.add(b); -*/ - b = new Button(fgAtCurrentPosCommand); - b.addActionListener(this); - f.add(b); - - b = new Button(fgLotsOfTextCommand); - b.addActionListener(this); - f.add(b); - - b = new Button(fgFwdDelete); - b.addActionListener(this); - f.add(b); - - b = new Button(fgBackspace); - b.addActionListener(this); - f.add(b); - - f.doLayout(); - WindowAdapter closer = new WindowAdapter() { - public void windowClosing(WindowEvent e) { - fOut.close(); - System.exit(0); - } - }; - - f.addWindowListener(closer); - fTextFrame.addWindowListener(closer); - - f.setSize(200, 80); - f.show(); - } - - public void actionPerformed(ActionEvent evt) { - - try { - if (evt.getActionCommand().equals(fgAtCurrentPosCommand)) { - - insertAtCurrentPos(1); - } - else if (evt.getActionCommand().equals(fgLotsOfTextCommand)) { - - insertAtCurrentPos(8); - } - else if (evt.getActionCommand().equals(fgFwdDelete)) { - - forwardDelete(1); - } - else if (evt.getActionCommand().equals(fgBackspace)) { - - backspace(1); - } - } - catch(IOException e) { - System.out.println("Caught exception: " + e); - } - } - - private void insertAtCurrentPos(final int times) throws IOException { - - fTextFrame.toFront(); - - System.gc(); - - long startTime = System.currentTimeMillis(); - - for (int t=0; t < times; t++) { - for (int i=0; i < fInsText.length; i++) { - - KeyEvent event = new KeyEvent(fTextFrame, KeyEvent.KEY_TYPED, 0, 0, 0, fInsText[i]); - fKeyEventForwarder.handleKeyEvent(event); - } - } - - long time = System.currentTimeMillis() - startTime; - - fOut.println("Total time: " + time); - fOut.println("Millis per character: " + (time / (fInsText.length*times))); - fOut.flush(); - } - - private void forwardDelete(final int times) throws IOException { - - System.gc(); - - long startTime = System.currentTimeMillis(); - - for (int t=0; t < times; t++) { - for (int i=0; i < fInsText.length; i++) { - - KeyEvent event = new KeyEvent(fTextFrame, 0, 0, 0, KeyEvent.VK_DELETE, '\u00FF'); - fKeyEventForwarder.handleKeyEvent(event); - } - } - - long time = System.currentTimeMillis() - startTime; - - fOut.println("Total time: " + time); - fOut.println("Millis per character: " + (time / (fInsText.length*times))); - fOut.flush(); - } - - private void backspace(final int times) throws IOException { - - System.gc(); - - long startTime = System.currentTimeMillis(); - - for (int t=0; t < times; t++) { - for (int i=0; i < fInsText.length; i++) { - - KeyEvent event = new KeyEvent(fTextFrame, 0, 0, 0, KeyEvent.VK_BACK_SPACE, '\u0010'); - fKeyEventForwarder.handleKeyEvent(event); - } - } - - long time = System.currentTimeMillis() - startTime; - - fOut.println("Total time: " + time); - fOut.println("Millis per character: " + (time / (fInsText.length*times))); - fOut.flush(); - } -} diff --git a/icu4j/src/com/ibm/test/TestAll.java b/icu4j/src/com/ibm/test/TestAll.java deleted file mode 100755 index a888b9c1b2..0000000000 --- a/icu4j/src/com/ibm/test/TestAll.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/Attic/TestAll.java,v $ - * $Date: 2002/02/08 01:12:45 $ - * $Revision: 1.19 $ - * - ***************************************************************************************** - */ -package com.ibm.test; -import com.ibm.test.TestFmwk; -import java.text.*; -import java.util.*; - -/** - * Top level test used to run all other tests as a batch. - */ - -public class TestAll extends TestFmwk { - - public static void main(String[] args) throws Exception { - new TestAll().run(args); - } - - public void TestBigNumberFormat() throws Exception{ - run(new com.ibm.test.bnf.BigNumberFormatTest()); - } - - public void TestCompression() throws Exception{ - run(new TestFmwk[] { - new com.ibm.test.compression.DecompressionTest(), - new com.ibm.test.compression.ExhaustiveTest() - }); - } - - public void TestNormalizer() throws Exception{ - run(new TestFmwk[] { - new com.ibm.test.normalizer.BasicTest(), - new com.ibm.test.normalizer.ExhaustiveTest(), - new com.ibm.test.normalizer.ConformanceTest(), - }); - } - - public void TestRuleBasedNumberFormat() throws Exception { - run(new TestFmwk[] { - new com.ibm.test.rbnf.RbnfTest(), - new com.ibm.test.rbnf.RbnfRoundTripTest() - }); - } - - public void TestRuleBasedBreakIterator() throws Exception { - run(new TestFmwk[] { - new com.ibm.test.rbbi.SimpleBITest(), - new com.ibm.test.rbbi.BreakIteratorTest(), - new com.ibm.test.rbbi.RBBITest(), - new com.ibm.test.rbbi.RBBIAPITest() - }); - } - - public void TestTranslit() throws Exception { - run(new TestFmwk[] { - new com.ibm.test.translit.TransliteratorTest(), - new com.ibm.test.translit.UnicodeSetTest(), - new com.ibm.test.translit.UnicodeFilterLogicTest(), - new com.ibm.test.translit.CompoundTransliteratorTest(), - new com.ibm.test.translit.UnicodeToHexTransliteratorTest(), - new com.ibm.test.translit.HexToUnicodeTransliteratorTest(), - new com.ibm.test.translit.JamoTest(), - new com.ibm.test.translit.ErrorTest(), - new com.ibm.test.translit.RoundTripTest(), - new com.ibm.test.translit.ReplaceableTest() - }); - } - - public void TestSearch() throws Exception { - run(new com.ibm.test.search.SearchTest()); - } - - public void TestRichEdit() throws Exception { - run(new com.ibm.test.richtext.TestAll()); - } - - public void TestArabicShaping() throws Exception { - run(new com.ibm.icu.test.text.ArabicShapingRegTest()); - } - - public void TestCalendar() throws Exception { - run(new TestFmwk[] { - new com.ibm.test.calendar.AstroTest(), - new com.ibm.test.calendar.CalendarRegression(), - new com.ibm.test.calendar.CompatibilityTest(), - new com.ibm.test.calendar.HebrewTest(), - new com.ibm.test.calendar.IBMCalendarTest(), - new com.ibm.test.calendar.IslamicTest(), - new com.ibm.test.calendar.ChineseTest() - }); - } - - public void TestTimeZone() throws Exception { - run(new TestFmwk[] { - new com.ibm.test.timezone.TimeZoneTest(), - new com.ibm.test.timezone.TimeZoneRegression(), - new com.ibm.test.timezone.TimeZoneBoundaryTest() - }); - } - - public void TestCharacter() throws Exception { - run(new TestFmwk[] { - new com.ibm.icu.test.text.UCharacterTest(), - new com.ibm.icu.test.text.UTF16Test() - }); - } - - public void TestTrie() throws Exception { - run(new TestFmwk[] { - new com.ibm.icu.test.util.TrieTest() - }); - } - - public void TestUScript() throws Exception { - run( new TestFmwk[] { - new com.ibm.icu.test.text.TestUScript(), - }); - } - - public void TestNumberFormat() throws Exception { - run(new TestFmwk[] { - new com.ibm.icu.test.format.IntlTestNumberFormat(), - new com.ibm.icu.test.format.IntlTestNumberFormatAPI(), - new com.ibm.icu.test.format.NumberFormatTest(), - new com.ibm.icu.test.format.NumberFormatRoundTripTest(), - new com.ibm.icu.test.format.NumberRegression(), - new com.ibm.icu.test.format.NumberFormatRegressionTest(), - new com.ibm.icu.test.format.IntlTestDecimalFormatAPI(), - new com.ibm.icu.test.format.IntlTestDecimalFormatAPIC(), - new com.ibm.icu.test.format.IntlTestDecimalFormatSymbols(), - new com.ibm.icu.test.format.IntlTestDecimalFormatSymbolsC() - }); - } - - public void TestDateFormat() throws Exception { - run(new TestFmwk[] { - new com.ibm.icu.test.format.DateFormatMiscTests(), - new com.ibm.icu.test.format.DateFormatRegressionTest(), - new com.ibm.icu.test.format.DateFormatRoundTripTest(), - new com.ibm.icu.test.format.DateFormatTest(), - new com.ibm.icu.test.format.IntlTestDateFormat(), - new com.ibm.icu.test.format.IntlTestDateFormatAPI(), - new com.ibm.icu.test.format.IntlTestDateFormatAPIC(), - new com.ibm.icu.test.format.IntlTestDateFormatSymbols(), - new com.ibm.icu.test.format.IntlTestSimpleDateFormatAPI(), - new com.ibm.icu.test.format.DateFormatRegressionTestJ() - }); - } -} diff --git a/icu4j/src/com/ibm/test/TestFmwk.java b/icu4j/src/com/ibm/test/TestFmwk.java deleted file mode 100755 index 4e09174bd1..0000000000 --- a/icu4j/src/com/ibm/test/TestFmwk.java +++ /dev/null @@ -1,428 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/Attic/TestFmwk.java,v $ - * $Date: 2001/12/03 21:48:07 $ - * $Revision: 1.26 $ - * - ***************************************************************************************** - */ -package com.ibm.test; - -import java.lang.reflect.*; -import java.util.Hashtable; -import java.util.Enumeration; -import java.util.Vector; -import java.util.Comparator; -import java.io.*; -import java.text.*; -import com.ibm.text.UTF16; -import com.ibm.util.Utility; -import com.ibm.text.UnicodeSet; - - -/** - * TestFmwk is a base class for tests that can be run conveniently from - * the command line as well as under the Java test harness. - *

    - * Sub-classes implement a set of methods named Test. Each - * of these methods performs some test. Test methods should indicate - * errors by calling either err or errln. This will increment the - * errorCount field and may optionally print a message to the log. - * Debugging information may also be added to the log via the log - * and logln methods. These methods will add their arguments to the - * log only if the test is being run in verbose mode. - */ - -public class TestFmwk implements TestLog { - - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - //------------------------------------------------------------------------ - // Everything below here is boilerplate code that makes it possible - // to add a new test by simply adding a function to an existing class - //------------------------------------------------------------------------ - - protected TestFmwk() { - // Create a hashtable containing all the test methods. - testMethods = new Hashtable(); - Method[] methods = getClass().getDeclaredMethods(); - for( int i=0; i= 1) { - methodsToRun = testsToRun.elements(); - } else { - methodsToRun = testMethods.elements(); - } - - methodsToRun = new SortedEnumeration(methodsToRun, - new Comparator() { - public int compare(Object a, Object b) { - return ((Method)a).getName().compareToIgnoreCase( - ((Method)b).getName()); - } - public boolean equals(Object o) { - return false; - } - }); - - int oldClassCount = params.errorCount; - - // Run the list of tests given in the test arguments - while (methodsToRun.hasMoreElements()) { - int oldCount = params.errorCount; - - Method testMethod = (Method)methodsToRun.nextElement(); - writeTestName(testMethod.getName()); - - try { - testMethod.invoke(this, new Object[0]); - } catch( IllegalAccessException e ) { - errln("Can't access test method " + testMethod.getName()); - } catch( InvocationTargetException e ) { - errln("Uncaught exception \""+e+"\" thrown in test method " - + testMethod.getName()); - e.getTargetException().printStackTrace(this.params.log); - } - writeTestResult(params.errorCount - oldCount); - } - params.indentLevel--; - writeTestResult(params.errorCount - oldClassCount); - } - - public void run(String[] args) throws Exception { - if (params == null) params = new TestParams(); - // Parse the test arguments. They can be either the flag - // "-verbose" or names of test methods. Create a list of - // tests to be run. - testsToRun = new Vector(args.length); - for (int i = 0; i < args.length; i++) { - if (args[i].equals("-verbose") || args[i].equals("-v")) { - params.verbose = true; - } - else if (args[i].equals("-prompt")) { - params.prompt = true; - } else if (args[i].equals("-nothrow")) { - params.nothrow = true; - } else if (args[i].startsWith("-e")) { - params.inclusion = (args[i].length() == 2) ? 5 : Integer.parseInt(args[i].substring(2)); - } else if (args[i].toLowerCase().startsWith("-filter:")) { - params.filter = args[i].substring(8); - } else { - Object m = testMethods.get(args[i]); - if (m != null) { - testsToRun.addElement(m); - } else { - usage(); - return; - } - } - } - - if (params == null) params = new TestParams(); - _run(); - - if (params.prompt) { - System.out.println("Hit RETURN to exit..."); - try { - System.in.read(); - } catch (IOException e) { - System.out.println("Exception: " + e.toString() + e.getMessage()); - } - } - if (params.nothrow) { - System.exit(params.errorCount); - } - } - - protected void run(TestFmwk childTest) throws Exception { - run(new TestFmwk[] { childTest }); - } - - protected void run(TestFmwk[] tests) throws Exception { - for (int i=0; i0 (floating point): ANSI X3.274-1996 + errata */ -/* */ -/* ------------------------------------------------------------------ */ -/* Change list */ -/* 1997.09.05 Initial implementation, from DiagRexx [NetRexx tests] */ -/* 1998.05.02 0.07 changes (e.g., compareTo) */ -/* 1998.06.06 Rounding modes and format additions */ -/* 1998.06.25 Rename from DiagDecimal; make stand-alone [add */ -/* DiagException as a Minor class] */ -/* 1998.06.27 Start adding testcases for DIGITS=0/FORM=PLAIN cases */ -/* Reorganize for faster trace compilation */ -/* 1998.06.28 new: valueof, scale, movePointX, unscaledValue, etc. */ -/* 1998.07.07 Scaled divide */ -/* 1998.07.08 setScale */ -/* 1998.07.15 new scaffolding (Minor Test class) -- see diagabs */ -/* 1998.12.14 add toBigDecimal and BigDecimal(java.math.BigDecimal) */ -/* 1999.02.04 number preparation rounds instead of digits+1 trunc */ -/* 1999.02.09 format method now only has two signatures */ -/* 1999.02.27 no longer use Rexx class or RexxIO class */ -/* 1999.03.05 add MathContext tests */ -/* 1999.03.05 update for 0.96 [no null settings, etc.] */ -/* drop sundry constructors; no blanks; char[] gets ints */ -/* drop sundry converters, add Exact converters */ -/* 1999.05.27 additional tests for scaled arithmetic */ -/* 1999.06.29 additional tests for exponent overflows */ -/* 1999.07.03 add 'continue' option */ -/* 1999.07.10 additional tests for scaled arithmetic */ -/* 1999.07.18 randomly-generated tests added for base operators */ -/* 1999.10.28 weird intValueExact bad cases */ -/* 1999.12.21 multiplication fast path failure and edge cases */ -/* 2000.01.01 copyright update */ -/* 2000.03.26 cosmetic updates; add extra format() testcases */ -/* 2000.03.27 1.00 move to com.ibm.math package; open source release; */ -/* change to javadoc comments */ -/* ------------------------------------------------------------------ */ - -// note BINARY for conversions checking - - - - -/** - * The DiagBigDecimal class forms a standalone test suite - * for the com.ibm.math.BigDecimal and - * com.ibm.math.MathContext classes (or, by changing the - * package statement, other classes of the same names and - * definition in other packages). It may also be used as a constructed - * object to embed the tests in an external test harness. - *

    - * The tests are collected into groups, each corresponding to a - * tested method or a more general grouping. By default, when run from - * the static {@link #main(java.lang.String[])} method, the run will end - * if any test fails in a group. The continue argument may - * be specified to force the tests to run to completion. - *

    - * Two minor (inner) classes are used; {@link - * DiagBigDecimal.DiagException} is used to signal the failure of a test - * group, and {@link DiagBigDecimal.Test}, a dependent minor class, is - * used to register tests so that a summary of failures (or success) can be - * presented as each group is completed. - * - * @see com.ibm.math.BigDecimal - * @see com.ibm.math.MathContext - * @version 1.00 2000.03.27 - * @author Mike Cowlishaw - */ - -public class DiagBigDecimal{ - private static final java.lang.String $0="DiagBigDecimal.nrx"; - - /* properties shared */ - java.util.Vector Tests=new java.util.Vector(100); // scaffolding - - /* properties private */ - private int totalcount=0; // counts tests run - - /* properties constant private */ - - /* Count of test groups */ - private static final int testcount=38; - - private static final com.ibm.math.BigDecimal zero=com.ibm.math.BigDecimal.ZERO; - private static final com.ibm.math.BigDecimal one=com.ibm.math.BigDecimal.ONE; - private static final com.ibm.math.BigDecimal two=new com.ibm.math.BigDecimal(2); - private static final com.ibm.math.BigDecimal ten=com.ibm.math.BigDecimal.TEN; - private static final com.ibm.math.BigDecimal tenlong=new com.ibm.math.BigDecimal((long)1234554321); // 10-digiter - - /* Some context objects -- [some of these are checked later] */ - private static final com.ibm.math.MathContext mcdef=com.ibm.math.MathContext.DEFAULT; - private static final com.ibm.math.MathContext mc3=new com.ibm.math.MathContext(3); - private static final com.ibm.math.MathContext mc6=new com.ibm.math.MathContext(6); - private static final com.ibm.math.MathContext mc9=new com.ibm.math.MathContext(9); - private static final com.ibm.math.MathContext mc50=new com.ibm.math.MathContext(50); - private static final com.ibm.math.MathContext mcs=new com.ibm.math.MathContext(9,com.ibm.math.MathContext.SCIENTIFIC); - private static final com.ibm.math.MathContext mce=new com.ibm.math.MathContext(9,com.ibm.math.MathContext.ENGINEERING); - private static final com.ibm.math.MathContext mcld=new com.ibm.math.MathContext(9,com.ibm.math.MathContext.SCIENTIFIC,true); // lost digits - private static final com.ibm.math.MathContext mcld0=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.SCIENTIFIC,true); // lost digits, digits=0 - private static final com.ibm.math.MathContext mcfd=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN); // fixed decimal style - - /* boundary primitive values */ - private static final byte bmin=-128; - private static final byte bmax=127; - private static final byte bzer=0; - private static final byte bneg=-1; - private static final byte bpos=1; - private static final int imin=-2147483648; - private static final int imax=2147483647; - private static final int izer=0; - private static final int ineg=-1; - private static final int ipos=1; - private static final long lmin=-9223372036854775808L; - private static final long lmax=9223372036854775807L; - private static final long lzer=(long)0; - private static final long lneg=(long)-1; - private static final long lpos=(long)1; - private static final short smin=-32768; - private static final short smax=32767; - private static final short szer=(short)0; - private static final short sneg=(short)(-1); - private static final short spos=(short)1; - - - /* properties constant private unused */ // present but not referenced - private static final java.lang.String copyright=" Copyright (c) IBM Corporation 1996, 2000. All rights reserved. "; - - - /** Constructs a DiagBigDecimal test suite. - *

    - * Invoke its {@link #diagrun} method to run the tests. - */ - - public DiagBigDecimal(){super(); - return; - } - - /** Run the tests in the test suite. - * - * @param isContinue The boolean which determines whether - * to stop running after a group fails. If 1 (true) - * then the tests should be run to completion if - * possible; if 0 (false) then the run will end if a - * group fails. - * @return an int which is 0 if all tests were - * successful, >0 (the count of failures) if some failures were - * detected, or <0 if an unexpected Exception was signalled. - */ - - public int diagrun(boolean isContinue){ - int fails; - int num=0; - DiagException de=null; - java.lang.RuntimeException e=null; - java.lang.String rest=null; - - fails=0; // count of failures - try{num=1;num:for(;num<=testcount;num++){ // [testcount is constant set above] - try{ - dotest(num); - } - catch (DiagException $1){de=$1; - say(); - say("**** Failed:"+" "+de.getMessage()+" "+"****"); - say(); - fails=fails+de.failcount; - if ((!isContinue)) - break num; - } - } - } - catch (java.lang.RuntimeException $2){e=$2; // any other exception is total failure; just show trace and quit - say(); - say("**** Failed: unexpected exception ****"); - e.printStackTrace(); - return -1; - }/*num*/ - - if (fails==0) - say("--- All OK ---"+" "+right("["+totalcount+" "+"tests]",15)); - else - { - if (isContinue) - { - if (fails>1) - rest="tests"; - else - rest="test"; - say("--- All run ---"+" "+right("["+totalcount+" "+"tests,",14)+" "+"failed"+" "+fails+" "+rest+"]"); - - } - } - - return fails; - } - - /* Run test by number -- method for development/private switching */ - - private void dotest(int num){ - {/*select*/switch(num){ - /* -------------------------------------------------------------- */ - /* MathContext */ - /* -------------------------------------------------------------- */ - case 1: - diagmathcontext();break; - - /* -------------------------------------------------------------- */ - /* Constructors */ - /* -------------------------------------------------------------- */ - case 2: - diagconstructors();break; - - /* -------------------------------------------------------------- */ - /* Operator methods */ - /* -------------------------------------------------------------- */ - case 3: - diagabs();break; - case 4: - diagadd();break; - case 5: - diagcompareto();break; - case 6: - diagdivide();break; - case 7: - diagdivideInteger();break; - case 8: - diagmax();break; - case 9: - diagmin();break; - case 10: - diagmultiply();break; - case 11: - diagnegate();break; - case 12: - diagplus();break; - case 13: - diagpow();break; - case 14: - diagremainder();break; - case 15: - diagsubtract();break; - case 16: - diagmath();break; // general math - - /* -------------------------------------------------------------- */ - /* Other methods */ - /* -------------------------------------------------------------- */ - case 17: - diagbyteValue();break; - case 18: - diagcomparetoObj();break; - case 19: - diagdoublevalue();break; - case 20: - diagequals();break; - case 21: - diagfloatvalue();break; - case 22: - diagformat();break; - case 23: - diaghashcode();break; - case 24: - diagintvalue();break; - case 25: - diaglongvalue();break; - case 26: - diagmovepointleft();break; - case 27: - diagmovepointright();break; - case 28: - diagscale();break; - case 29: - diagsetscale();break; - case 30: - diagshortvalue();break; - case 31: - diagsignum();break; - case 32: - diagtobigdecimal();break; - case 33: - diagtobiginteger();break; - case 34: - diagtochararray();break; - case 35: - diagtostring();break; - case 36: - diagunscaledvalue();break; - case 37: - diagvalueof();break; - - /* -------------------------------------------------------------- */ - /* Mutation test [must be the last test] */ - /* -------------------------------------------------------------- */ - case 38: - diagmutation();break; - // if any more, increase testcount above - default:{ - say("*** dotest case not found:"+" "+num+" "+"***"); - }} - } - return; - } - - /*--------------------------------------------------------------------*/ - /* Diagnostic group methods */ - /*--------------------------------------------------------------------*/ - - /** Test constructors (and {@link #toString()} for equalities). */ - - public void diagconstructors(){ - boolean flag=false; - java.lang.String num; - java.math.BigInteger bip; - java.math.BigInteger biz; - java.math.BigInteger bin; - com.ibm.math.BigDecimal bda; - com.ibm.math.BigDecimal bdb; - com.ibm.math.BigDecimal bmc; - com.ibm.math.BigDecimal bmd; - com.ibm.math.BigDecimal bme; - java.lang.RuntimeException e=null; - char ca[]; - double dzer; - double dpos; - double dneg; - double dpos5; - double dneg5; - double dmin; - double dmax; - double d; - java.lang.String badstrings[]; - int i=0; - - // constants [statically-called constructors] - (new Test("con001")).ok=(com.ibm.math.BigDecimal.ZERO.toString()).equals("0"); - (new Test("con002")).ok=(com.ibm.math.BigDecimal.ONE.toString()).equals("1"); - (new Test("con003")).ok=(com.ibm.math.BigDecimal.TEN.toString()).equals("10"); - (new Test("con004")).ok=(com.ibm.math.BigDecimal.ZERO.intValueExact())==0; - (new Test("con005")).ok=(com.ibm.math.BigDecimal.ONE.intValueExact())==1; - (new Test("con006")).ok=(com.ibm.math.BigDecimal.TEN.intValueExact())==10; - - // [java.math.] BigDecimal - (new Test("cbd001")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("0"))).toString()).equals("0"); - (new Test("cbd002")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("1"))).toString()).equals("1"); - (new Test("cbd003")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("10"))).toString()).equals("10"); - (new Test("cbd004")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("1000"))).toString()).equals("1000"); - (new Test("cbd005")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("10.0"))).toString()).equals("10.0"); - (new Test("cbd006")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("10.1"))).toString()).equals("10.1"); - (new Test("cbd007")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("-1.1"))).toString()).equals("-1.1"); - (new Test("cbd008")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("-9.0"))).toString()).equals("-9.0"); - (new Test("cbd009")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal("0.9"))).toString()).equals("0.9"); - - num="123456789.123456789"; - (new Test("cbd010")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal(num))).toString()).equals(num); - num="123456789.000000000"; - (new Test("cbd011")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal(num))).toString()).equals(num); - num="123456789000000000"; - (new Test("cbd012")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal(num))).toString()).equals(num); - num="0.00000123456789"; - (new Test("cbd013")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal(num))).toString()).equals(num); - num="0.000000123456789"; - (new Test("cbd014")).ok=((new com.ibm.math.BigDecimal(new java.math.BigDecimal(num))).toString()).equals(num); - - try{checknull:do{ - new com.ibm.math.BigDecimal((java.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $3){ - flag=true; - }/*checknull*/ - (new Test("cbi015")).ok=flag; - - // BigInteger - bip=new BigInteger("987654321987654321987654321"); // biggie +ve - biz=new BigInteger("0"); // biggie 0 - bin=new BigInteger("-12345678998765432112345678"); // biggie -ve - (new Test("cbi001")).ok=((new com.ibm.math.BigDecimal(bip)).toString()).equals(bip.toString()); - (new Test("cbi002")).ok=((new com.ibm.math.BigDecimal(biz)).toString()).equals("0"); - (new Test("cbi003")).ok=((new com.ibm.math.BigDecimal(bin)).toString()).equals(bin.toString()); - try{checknull:do{ - new com.ibm.math.BigDecimal((java.math.BigInteger)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $4){ - flag=true; - }/*checknull*/ - (new Test("cbi004")).ok=flag; - - // BigInteger with scale - bip=new BigInteger("123456789"); // bigish - bda=new com.ibm.math.BigDecimal(bip); - bdb=new com.ibm.math.BigDecimal(bip,5); - bmc=new com.ibm.math.BigDecimal(bip,15); - (new Test("cbs001")).ok=(bda.toString()).equals("123456789"); - (new Test("cbs002")).ok=(bdb.toString()).equals("1234.56789"); - (new Test("cbs003")).ok=(bmc.toString()).equals("0.000000123456789"); - bip=new BigInteger("123456789123456789123456789"); // biggie - bda=new com.ibm.math.BigDecimal(bip); - bdb=new com.ibm.math.BigDecimal(bip,7); - bmc=new com.ibm.math.BigDecimal(bip,13); - bmd=new com.ibm.math.BigDecimal(bip,19); - bme=new com.ibm.math.BigDecimal(bip,29); - (new Test("cbs011")).ok=(bda.toString()).equals("123456789123456789123456789"); - (new Test("cbs012")).ok=(bdb.toString()).equals("12345678912345678912.3456789"); - (new Test("cbs013")).ok=(bmc.toString()).equals("12345678912345.6789123456789"); - (new Test("cbs014")).ok=(bmd.toString()).equals("12345678.9123456789123456789"); - (new Test("cbs015")).ok=(bme.toString()).equals("0.00123456789123456789123456789"); - try{checknull:do{ - new com.ibm.math.BigDecimal((java.math.BigInteger)null,1); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $5){ - flag=true; - }/*checknull*/ - (new Test("cbs004")).ok=flag; - try{checkscale:do{ - new com.ibm.math.BigDecimal(bip,-8); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $6){e=$6; - flag=(e.getMessage()).equals("Negative scale: -8"); - }/*checkscale*/ - (new Test("cbs005")).ok=flag; - - // char[] - // We just test it's there - // Functionality is tested by BigDecimal(String). - ca=("123.45").toCharArray(); - (new Test("cca001")).ok=((new com.ibm.math.BigDecimal(ca)).toString()).equals("123.45"); - try{checknull:do{ - new com.ibm.math.BigDecimal((char[])null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $7){ - flag=true; - }/*checknull*/ - (new Test("cca010")).ok=flag; - - // char[],int,int - // We just test it's there, and that offsets work. - // Functionality is tested by BigDecimal(String). - ca=("123.45").toCharArray(); - (new Test("cca101")).ok=((new com.ibm.math.BigDecimal(ca,0,6)).toString()).equals("123.45"); - (new Test("cca102")).ok=((new com.ibm.math.BigDecimal(ca,1,5)).toString()).equals("23.45"); - (new Test("cca103")).ok=((new com.ibm.math.BigDecimal(ca,2,4)).toString()).equals("3.45"); - (new Test("cca104")).ok=((new com.ibm.math.BigDecimal(ca,3,3)).toString()).equals("0.45"); - (new Test("cca105")).ok=((new com.ibm.math.BigDecimal(ca,4,2)).toString()).equals("45"); - (new Test("cca106")).ok=((new com.ibm.math.BigDecimal(ca,5,1)).toString()).equals("5"); - - (new Test("cca110")).ok=((new com.ibm.math.BigDecimal(ca,0,1)).toString()).equals("1"); - (new Test("cca111")).ok=((new com.ibm.math.BigDecimal(ca,1,1)).toString()).equals("2"); - (new Test("cca112")).ok=((new com.ibm.math.BigDecimal(ca,2,1)).toString()).equals("3"); - (new Test("cca113")).ok=((new com.ibm.math.BigDecimal(ca,4,1)).toString()).equals("4"); - - (new Test("cca120")).ok=((new com.ibm.math.BigDecimal(ca,0,2)).toString()).equals("12"); - (new Test("cca121")).ok=((new com.ibm.math.BigDecimal(ca,1,2)).toString()).equals("23"); - (new Test("cca122")).ok=((new com.ibm.math.BigDecimal(ca,2,2)).toString()).equals("3"); - (new Test("cca123")).ok=((new com.ibm.math.BigDecimal(ca,3,2)).toString()).equals("0.4"); - - (new Test("cca130")).ok=((new com.ibm.math.BigDecimal(ca,0,3)).toString()).equals("123"); - (new Test("cca131")).ok=((new com.ibm.math.BigDecimal(ca,1,3)).toString()).equals("23"); - (new Test("cca132")).ok=((new com.ibm.math.BigDecimal(ca,2,3)).toString()).equals("3.4"); - - (new Test("cca140")).ok=((new com.ibm.math.BigDecimal(ca,0,4)).toString()).equals("123"); - (new Test("cca141")).ok=((new com.ibm.math.BigDecimal(ca,1,4)).toString()).equals("23.4"); - - (new Test("cca150")).ok=((new com.ibm.math.BigDecimal(ca,0,5)).toString()).equals("123.4"); - - // a couple of oddies - ca=("x23.4x").toCharArray(); - (new Test("cca160")).ok=((new com.ibm.math.BigDecimal(ca,1,4)).toString()).equals("23.4"); - (new Test("cca161")).ok=((new com.ibm.math.BigDecimal(ca,1,1)).toString()).equals("2"); - (new Test("cca162")).ok=((new com.ibm.math.BigDecimal(ca,4,1)).toString()).equals("4"); - - ca=("0123456789.9876543210").toCharArray(); - (new Test("cca163")).ok=((new com.ibm.math.BigDecimal(ca,0,21)).toString()).equals("123456789.9876543210"); - (new Test("cca164")).ok=((new com.ibm.math.BigDecimal(ca,1,20)).toString()).equals("123456789.9876543210"); - (new Test("cca165")).ok=((new com.ibm.math.BigDecimal(ca,2,19)).toString()).equals("23456789.9876543210"); - (new Test("cca166")).ok=((new com.ibm.math.BigDecimal(ca,2,18)).toString()).equals("23456789.987654321"); - (new Test("cca167")).ok=((new com.ibm.math.BigDecimal(ca,2,17)).toString()).equals("23456789.98765432"); - (new Test("cca168")).ok=((new com.ibm.math.BigDecimal(ca,2,16)).toString()).equals("23456789.9876543"); - - try{checknull:do{ - new com.ibm.math.BigDecimal((char[])null,0,1); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $8){ - flag=true; - }/*checknull*/ - (new Test("cca200")).ok=flag; - - try{checklen:do{ - new com.ibm.math.BigDecimal("123".toCharArray(),0,0); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $9){ - flag=true; - }/*checklen*/ - (new Test("cca201")).ok=flag; - - try{checkbound:do{ - new com.ibm.math.BigDecimal("123".toCharArray(),2,4); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $10){ // anything OK - flag=true; - }/*checkbound*/ - (new Test("cca202")).ok=flag; - try{checkbound2:do{ - new com.ibm.math.BigDecimal("123".toCharArray(),-1,2); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $11){ // anything OK - flag=true; - }/*checkbound2*/ - (new Test("cca203")).ok=flag; - try{checkbound3:do{ - new com.ibm.math.BigDecimal("123".toCharArray(),1,-2); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $12){ // anything OK - flag=true; - }/*checkbound3*/ - (new Test("cca204")).ok=flag; - - // double [deprecated] - // Note that many of these differ from the valueOf(double) results. - dzer=(double)0; - dpos=(double)1; - dpos=dpos/((double)10); - dneg=(double)-dpos; - (new Test("cdo001")).ok=((new com.ibm.math.BigDecimal(dneg)).toString()).equals("-0.1000000000000000055511151231257827021181583404541015625"); - - (new Test("cdo002")).ok=((new com.ibm.math.BigDecimal(dzer)).toString()).equals("0"); // NB, not '0.0' - (new Test("cdo003")).ok=((new com.ibm.math.BigDecimal(dpos)).toString()).equals("0.1000000000000000055511151231257827021181583404541015625"); - - dpos5=(double)0.5D; - dneg5=(double)-dpos5; - (new Test("cdo004")).ok=((new com.ibm.math.BigDecimal(dneg5)).toString()).equals("-0.5"); - (new Test("cdo005")).ok=((new com.ibm.math.BigDecimal(dpos5)).toString()).equals("0.5"); - dmin=java.lang.Double.MIN_VALUE; - dmax=java.lang.Double.MAX_VALUE; - (new Test("cdo006")).ok=((new com.ibm.math.BigDecimal(dmin)).toString()).equals("0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004940656458412465441765687928682213723650598026143247644255856825006755072702087518652998363616359923797965646954457177309266567103559397963987747960107818781263007131903114045278458171678489821036887186360569987307230500063874091535649843873124733972731696151400317153853980741262385655911710266585566867681870395603106249319452715914924553293054565444011274801297099995419319894090804165633245247571478690147267801593552386115501348035264934720193790268107107491703332226844753335720832431936092382893458368060106011506169809753078342277318329247904982524730776375927247874656084778203734469699533647017972677717585125660551199131504891101451037862738167250955837389733598993664809941164205702637090279242767544565229087538682506419718265533447265625"); - - (new Test("cdo007")).ok=((new com.ibm.math.BigDecimal(dmax)).toString()).equals("179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368"); - - - // nasties - d=(double)9; - d=d/((double)10); - (new Test("cdo010")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.90000000000000002220446049250313080847263336181640625"); - - d=d/((double)10); - (new Test("cdo011")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.0899999999999999966693309261245303787291049957275390625"); - - d=d/((double)10); - (new Test("cdo012")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.00899999999999999931998839741709161899052560329437255859375"); - - d=d/((double)10); - (new Test("cdo013")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.00089999999999999997536692664112933925935067236423492431640625"); - - d=d/((double)10); - (new Test("cdo014")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.00008999999999999999211568180168541175589780323207378387451171875"); - - d=d/((double)10); - (new Test("cdo015")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.00000899999999999999853394182236510090433512232266366481781005859375"); - - d=d/((double)10); - (new Test("cdo016")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.000000899999999999999853394182236510090433512232266366481781005859375"); - - d=d/((double)10); - (new Test("cdo017")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.0000000899999999999999853394182236510090433512232266366481781005859375"); - - d=d/((double)10); - (new Test("cdo018")).ok=((new com.ibm.math.BigDecimal(d)).toString()).equals("0.000000008999999999999997872197332322678764437995369007694534957408905029296875"); - - - try{checkpin:do{ - new com.ibm.math.BigDecimal(java.lang.Double.POSITIVE_INFINITY); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $13){ - flag=true; - }/*checkpin*/ - (new Test("cdo101")).ok=flag; - try{checknin:do{ - new com.ibm.math.BigDecimal(java.lang.Double.NEGATIVE_INFINITY); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $14){ - flag=true; - }/*checknin*/ - (new Test("cdo102")).ok=flag; - try{checknan:do{ - new com.ibm.math.BigDecimal(java.lang.Double.NaN); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $15){ - flag=true; - }/*checknan*/ - (new Test("cdo103")).ok=flag; - - // int - (new Test("cin001")).ok=((new com.ibm.math.BigDecimal(imin)).toString()).equals("-2147483648"); - (new Test("cin002")).ok=((new com.ibm.math.BigDecimal(imax)).toString()).equals("2147483647"); - (new Test("cin003")).ok=((new com.ibm.math.BigDecimal(ineg)).toString()).equals("-1"); - (new Test("cin004")).ok=((new com.ibm.math.BigDecimal(izer)).toString()).equals("0"); - (new Test("cin005")).ok=((new com.ibm.math.BigDecimal(ipos)).toString()).equals("1"); - (new Test("cin006")).ok=((new com.ibm.math.BigDecimal(10)).toString()).equals("10"); - (new Test("cin007")).ok=((new com.ibm.math.BigDecimal(9)).toString()).equals("9"); - (new Test("cin008")).ok=((new com.ibm.math.BigDecimal(5)).toString()).equals("5"); - (new Test("cin009")).ok=((new com.ibm.math.BigDecimal(2)).toString()).equals("2"); - (new Test("cin010")).ok=((new com.ibm.math.BigDecimal(-2)).toString()).equals("-2"); - (new Test("cin011")).ok=((new com.ibm.math.BigDecimal(-5)).toString()).equals("-5"); - (new Test("cin012")).ok=((new com.ibm.math.BigDecimal(-9)).toString()).equals("-9"); - (new Test("cin013")).ok=((new com.ibm.math.BigDecimal(-10)).toString()).equals("-10"); - (new Test("cin014")).ok=((new com.ibm.math.BigDecimal(-11)).toString()).equals("-11"); - (new Test("cin015")).ok=((new com.ibm.math.BigDecimal(-99)).toString()).equals("-99"); - (new Test("cin016")).ok=((new com.ibm.math.BigDecimal(-100)).toString()).equals("-100"); - (new Test("cin017")).ok=((new com.ibm.math.BigDecimal(-999)).toString()).equals("-999"); - (new Test("cin018")).ok=((new com.ibm.math.BigDecimal(-1000)).toString()).equals("-1000"); - - (new Test("cin019")).ok=((new com.ibm.math.BigDecimal(11)).toString()).equals("11"); - (new Test("cin020")).ok=((new com.ibm.math.BigDecimal(99)).toString()).equals("99"); - (new Test("cin021")).ok=((new com.ibm.math.BigDecimal(100)).toString()).equals("100"); - (new Test("cin022")).ok=((new com.ibm.math.BigDecimal(999)).toString()).equals("999"); - (new Test("cin023")).ok=((new com.ibm.math.BigDecimal(1000)).toString()).equals("1000"); - - // long - (new Test("clo001")).ok=((new com.ibm.math.BigDecimal(lmin)).toString()).equals("-9223372036854775808"); - (new Test("clo002")).ok=((new com.ibm.math.BigDecimal(lmax)).toString()).equals("9223372036854775807"); - (new Test("clo003")).ok=((new com.ibm.math.BigDecimal(lneg)).toString()).equals("-1"); - (new Test("clo004")).ok=((new com.ibm.math.BigDecimal(lzer)).toString()).equals("0"); - (new Test("clo005")).ok=((new com.ibm.math.BigDecimal(lpos)).toString()).equals("1"); - - // String [many more examples are elsewhere] - // strings without E cannot generate E in result - (new Test("cst001")).ok=((new com.ibm.math.BigDecimal("12")).toString()).equals("12"); - (new Test("cst002")).ok=((new com.ibm.math.BigDecimal("-76")).toString()).equals("-76"); - (new Test("cst003")).ok=((new com.ibm.math.BigDecimal("12.76")).toString()).equals("12.76"); - (new Test("cst004")).ok=((new com.ibm.math.BigDecimal("+12.76")).toString()).equals("12.76"); - (new Test("cst005")).ok=((new com.ibm.math.BigDecimal("012.76")).toString()).equals("12.76"); - (new Test("cst006")).ok=((new com.ibm.math.BigDecimal("+0.003")).toString()).equals("0.003"); - (new Test("cst007")).ok=((new com.ibm.math.BigDecimal("17.")).toString()).equals("17"); - (new Test("cst008")).ok=((new com.ibm.math.BigDecimal(".5")).toString()).equals("0.5"); - (new Test("cst009")).ok=((new com.ibm.math.BigDecimal("044")).toString()).equals("44"); - (new Test("cst010")).ok=((new com.ibm.math.BigDecimal("0044")).toString()).equals("44"); - (new Test("cst011")).ok=((new com.ibm.math.BigDecimal("0.0005")).toString()).equals("0.0005"); - (new Test("cst012")).ok=((new com.ibm.math.BigDecimal("00.00005")).toString()).equals("0.00005"); - (new Test("cst013")).ok=((new com.ibm.math.BigDecimal("0.000005")).toString()).equals("0.000005"); - (new Test("cst014")).ok=((new com.ibm.math.BigDecimal("0.0000005")).toString()).equals("0.0000005"); // \NR - (new Test("cst015")).ok=((new com.ibm.math.BigDecimal("0.00000005")).toString()).equals("0.00000005"); // \NR - (new Test("cst016")).ok=((new com.ibm.math.BigDecimal("12345678.876543210")).toString()).equals("12345678.876543210"); - (new Test("cst017")).ok=((new com.ibm.math.BigDecimal("2345678.876543210")).toString()).equals("2345678.876543210"); - (new Test("cst018")).ok=((new com.ibm.math.BigDecimal("345678.876543210")).toString()).equals("345678.876543210"); - (new Test("cst019")).ok=((new com.ibm.math.BigDecimal("0345678.87654321")).toString()).equals("345678.87654321"); - (new Test("cst020")).ok=((new com.ibm.math.BigDecimal("345678.8765432")).toString()).equals("345678.8765432"); - (new Test("cst021")).ok=((new com.ibm.math.BigDecimal("+345678.8765432")).toString()).equals("345678.8765432"); - (new Test("cst022")).ok=((new com.ibm.math.BigDecimal("+0345678.8765432")).toString()).equals("345678.8765432"); - (new Test("cst023")).ok=((new com.ibm.math.BigDecimal("+00345678.8765432")).toString()).equals("345678.8765432"); - (new Test("cst024")).ok=((new com.ibm.math.BigDecimal("-345678.8765432")).toString()).equals("-345678.8765432"); - (new Test("cst025")).ok=((new com.ibm.math.BigDecimal("-0345678.8765432")).toString()).equals("-345678.8765432"); - (new Test("cst026")).ok=((new com.ibm.math.BigDecimal("-00345678.8765432")).toString()).equals("-345678.8765432"); - - // exotics -- - (new Test("cst035")).ok=((new com.ibm.math.BigDecimal("\u0e57.\u0e50")).toString()).equals("7.0"); - (new Test("cst036")).ok=((new com.ibm.math.BigDecimal("\u0b66.\u0b67")).toString()).equals("0.1"); - (new Test("cst037")).ok=((new com.ibm.math.BigDecimal("\u0b66\u0b66")).toString()).equals("0"); - (new Test("cst038")).ok=((new com.ibm.math.BigDecimal("\u0b6a\u0b66")).toString()).equals("40"); - - // strings with E - (new Test("cst040")).ok=((new com.ibm.math.BigDecimal("1E+9")).toString()).equals("1E+9"); - (new Test("cst041")).ok=((new com.ibm.math.BigDecimal("1e+09")).toString()).equals("1E+9"); - (new Test("cst042")).ok=((new com.ibm.math.BigDecimal("1E+90")).toString()).equals("1E+90"); - (new Test("cst043")).ok=((new com.ibm.math.BigDecimal("+1E+009")).toString()).equals("1E+9"); - (new Test("cst044")).ok=((new com.ibm.math.BigDecimal("0E+9")).toString()).equals("0"); - (new Test("cst045")).ok=((new com.ibm.math.BigDecimal("1E+9")).toString()).equals("1E+9"); - (new Test("cst046")).ok=((new com.ibm.math.BigDecimal("1E+09")).toString()).equals("1E+9"); - (new Test("cst047")).ok=((new com.ibm.math.BigDecimal("1e+90")).toString()).equals("1E+90"); - (new Test("cst048")).ok=((new com.ibm.math.BigDecimal("1E+009")).toString()).equals("1E+9"); - (new Test("cst049")).ok=((new com.ibm.math.BigDecimal("0E+9")).toString()).equals("0"); - (new Test("cst050")).ok=((new com.ibm.math.BigDecimal("1E9")).toString()).equals("1E+9"); - (new Test("cst051")).ok=((new com.ibm.math.BigDecimal("1e09")).toString()).equals("1E+9"); - (new Test("cst052")).ok=((new com.ibm.math.BigDecimal("1E90")).toString()).equals("1E+90"); - (new Test("cst053")).ok=((new com.ibm.math.BigDecimal("1E009")).toString()).equals("1E+9"); - (new Test("cst054")).ok=((new com.ibm.math.BigDecimal("0E9")).toString()).equals("0"); - (new Test("cst055")).ok=((new com.ibm.math.BigDecimal("0.000e+0")).toString()).equals("0"); - (new Test("cst056")).ok=((new com.ibm.math.BigDecimal("0.000E-1")).toString()).equals("0"); - (new Test("cst057")).ok=((new com.ibm.math.BigDecimal("4E+9")).toString()).equals("4E+9"); - (new Test("cst058")).ok=((new com.ibm.math.BigDecimal("44E+9")).toString()).equals("4.4E+10"); - (new Test("cst059")).ok=((new com.ibm.math.BigDecimal("0.73e-7")).toString()).equals("7.3E-8"); - (new Test("cst060")).ok=((new com.ibm.math.BigDecimal("00E+9")).toString()).equals("0"); - (new Test("cst061")).ok=((new com.ibm.math.BigDecimal("00E-9")).toString()).equals("0"); - (new Test("cst062")).ok=((new com.ibm.math.BigDecimal("10E+9")).toString()).equals("1.0E+10"); - (new Test("cst063")).ok=((new com.ibm.math.BigDecimal("10E+09")).toString()).equals("1.0E+10"); - (new Test("cst064")).ok=((new com.ibm.math.BigDecimal("10e+90")).toString()).equals("1.0E+91"); - (new Test("cst065")).ok=((new com.ibm.math.BigDecimal("10E+009")).toString()).equals("1.0E+10"); - (new Test("cst066")).ok=((new com.ibm.math.BigDecimal("100e+9")).toString()).equals("1.00E+11"); - (new Test("cst067")).ok=((new com.ibm.math.BigDecimal("100e+09")).toString()).equals("1.00E+11"); - (new Test("cst068")).ok=((new com.ibm.math.BigDecimal("100E+90")).toString()).equals("1.00E+92"); - (new Test("cst069")).ok=((new com.ibm.math.BigDecimal("100e+009")).toString()).equals("1.00E+11"); - - (new Test("cst070")).ok=((new com.ibm.math.BigDecimal("1.265")).toString()).equals("1.265"); - (new Test("cst071")).ok=((new com.ibm.math.BigDecimal("1.265E-20")).toString()).equals("1.265E-20"); - (new Test("cst072")).ok=((new com.ibm.math.BigDecimal("1.265E-8")).toString()).equals("1.265E-8"); - (new Test("cst073")).ok=((new com.ibm.math.BigDecimal("1.265E-4")).toString()).equals("1.265E-4"); - (new Test("cst074")).ok=((new com.ibm.math.BigDecimal("1.265E-3")).toString()).equals("1.265E-3"); - (new Test("cst075")).ok=((new com.ibm.math.BigDecimal("1.265E-2")).toString()).equals("1.265E-2"); - (new Test("cst076")).ok=((new com.ibm.math.BigDecimal("1.265E-1")).toString()).equals("1.265E-1"); - (new Test("cst077")).ok=((new com.ibm.math.BigDecimal("1.265E-0")).toString()).equals("1.265"); - (new Test("cst078")).ok=((new com.ibm.math.BigDecimal("1.265E+1")).toString()).equals("1.265E+1"); - (new Test("cst079")).ok=((new com.ibm.math.BigDecimal("1.265E+2")).toString()).equals("1.265E+2"); - (new Test("cst080")).ok=((new com.ibm.math.BigDecimal("1.265E+3")).toString()).equals("1.265E+3"); - (new Test("cst081")).ok=((new com.ibm.math.BigDecimal("1.265E+4")).toString()).equals("1.265E+4"); - (new Test("cst082")).ok=((new com.ibm.math.BigDecimal("1.265E+8")).toString()).equals("1.265E+8"); - (new Test("cst083")).ok=((new com.ibm.math.BigDecimal("1.265E+20")).toString()).equals("1.265E+20"); - - (new Test("cst090")).ok=((new com.ibm.math.BigDecimal("12.65")).toString()).equals("12.65"); - (new Test("cst091")).ok=((new com.ibm.math.BigDecimal("12.65E-20")).toString()).equals("1.265E-19"); - (new Test("cst092")).ok=((new com.ibm.math.BigDecimal("12.65E-8")).toString()).equals("1.265E-7"); - (new Test("cst093")).ok=((new com.ibm.math.BigDecimal("12.65E-4")).toString()).equals("1.265E-3"); - (new Test("cst094")).ok=((new com.ibm.math.BigDecimal("12.65E-3")).toString()).equals("1.265E-2"); - (new Test("cst095")).ok=((new com.ibm.math.BigDecimal("12.65E-2")).toString()).equals("1.265E-1"); - (new Test("cst096")).ok=((new com.ibm.math.BigDecimal("12.65E-1")).toString()).equals("1.265"); - (new Test("cst097")).ok=((new com.ibm.math.BigDecimal("12.65E-0")).toString()).equals("1.265E+1"); - (new Test("cst098")).ok=((new com.ibm.math.BigDecimal("12.65E+1")).toString()).equals("1.265E+2"); - (new Test("cst099")).ok=((new com.ibm.math.BigDecimal("12.65E+2")).toString()).equals("1.265E+3"); - (new Test("cst100")).ok=((new com.ibm.math.BigDecimal("12.65E+3")).toString()).equals("1.265E+4"); - (new Test("cst101")).ok=((new com.ibm.math.BigDecimal("12.65E+4")).toString()).equals("1.265E+5"); - (new Test("cst102")).ok=((new com.ibm.math.BigDecimal("12.65E+8")).toString()).equals("1.265E+9"); - (new Test("cst103")).ok=((new com.ibm.math.BigDecimal("12.65E+20")).toString()).equals("1.265E+21"); - - (new Test("cst110")).ok=((new com.ibm.math.BigDecimal("126.5")).toString()).equals("126.5"); - (new Test("cst111")).ok=((new com.ibm.math.BigDecimal("126.5E-20")).toString()).equals("1.265E-18"); - (new Test("cst112")).ok=((new com.ibm.math.BigDecimal("126.5E-8")).toString()).equals("1.265E-6"); - (new Test("cst113")).ok=((new com.ibm.math.BigDecimal("126.5E-4")).toString()).equals("1.265E-2"); - (new Test("cst114")).ok=((new com.ibm.math.BigDecimal("126.5E-3")).toString()).equals("1.265E-1"); - (new Test("cst115")).ok=((new com.ibm.math.BigDecimal("126.5E-2")).toString()).equals("1.265"); - (new Test("cst116")).ok=((new com.ibm.math.BigDecimal("126.5E-1")).toString()).equals("1.265E+1"); - (new Test("cst117")).ok=((new com.ibm.math.BigDecimal("126.5E-0")).toString()).equals("1.265E+2"); - (new Test("cst118")).ok=((new com.ibm.math.BigDecimal("126.5E+1")).toString()).equals("1.265E+3"); - (new Test("cst119")).ok=((new com.ibm.math.BigDecimal("126.5E+2")).toString()).equals("1.265E+4"); - (new Test("cst120")).ok=((new com.ibm.math.BigDecimal("126.5E+3")).toString()).equals("1.265E+5"); - (new Test("cst121")).ok=((new com.ibm.math.BigDecimal("126.5E+4")).toString()).equals("1.265E+6"); - (new Test("cst122")).ok=((new com.ibm.math.BigDecimal("126.5E+8")).toString()).equals("1.265E+10"); - (new Test("cst123")).ok=((new com.ibm.math.BigDecimal("126.5E+20")).toString()).equals("1.265E+22"); - - (new Test("cst130")).ok=((new com.ibm.math.BigDecimal("1265")).toString()).equals("1265"); - (new Test("cst131")).ok=((new com.ibm.math.BigDecimal("1265E-20")).toString()).equals("1.265E-17"); - (new Test("cst132")).ok=((new com.ibm.math.BigDecimal("1265E-8")).toString()).equals("1.265E-5"); - (new Test("cst133")).ok=((new com.ibm.math.BigDecimal("1265E-4")).toString()).equals("1.265E-1"); - (new Test("cst134")).ok=((new com.ibm.math.BigDecimal("1265E-3")).toString()).equals("1.265"); - (new Test("cst135")).ok=((new com.ibm.math.BigDecimal("1265E-2")).toString()).equals("1.265E+1"); - (new Test("cst136")).ok=((new com.ibm.math.BigDecimal("1265E-1")).toString()).equals("1.265E+2"); - (new Test("cst137")).ok=((new com.ibm.math.BigDecimal("1265E-0")).toString()).equals("1.265E+3"); - (new Test("cst138")).ok=((new com.ibm.math.BigDecimal("1265E+1")).toString()).equals("1.265E+4"); - (new Test("cst139")).ok=((new com.ibm.math.BigDecimal("1265E+2")).toString()).equals("1.265E+5"); - (new Test("cst140")).ok=((new com.ibm.math.BigDecimal("1265E+3")).toString()).equals("1.265E+6"); - (new Test("cst141")).ok=((new com.ibm.math.BigDecimal("1265E+4")).toString()).equals("1.265E+7"); - (new Test("cst142")).ok=((new com.ibm.math.BigDecimal("1265E+8")).toString()).equals("1.265E+11"); - (new Test("cst143")).ok=((new com.ibm.math.BigDecimal("1265E+20")).toString()).equals("1.265E+23"); - - (new Test("cst150")).ok=((new com.ibm.math.BigDecimal("0.1265")).toString()).equals("0.1265"); - (new Test("cst151")).ok=((new com.ibm.math.BigDecimal("0.1265E-20")).toString()).equals("1.265E-21"); - (new Test("cst152")).ok=((new com.ibm.math.BigDecimal("0.1265E-8")).toString()).equals("1.265E-9"); - (new Test("cst153")).ok=((new com.ibm.math.BigDecimal("0.1265E-4")).toString()).equals("1.265E-5"); - (new Test("cst154")).ok=((new com.ibm.math.BigDecimal("0.1265E-3")).toString()).equals("1.265E-4"); - (new Test("cst155")).ok=((new com.ibm.math.BigDecimal("0.1265E-2")).toString()).equals("1.265E-3"); - (new Test("cst156")).ok=((new com.ibm.math.BigDecimal("0.1265E-1")).toString()).equals("1.265E-2"); - (new Test("cst157")).ok=((new com.ibm.math.BigDecimal("0.1265E-0")).toString()).equals("1.265E-1"); - (new Test("cst158")).ok=((new com.ibm.math.BigDecimal("0.1265E+1")).toString()).equals("1.265"); - (new Test("cst159")).ok=((new com.ibm.math.BigDecimal("0.1265E+2")).toString()).equals("1.265E+1"); - (new Test("cst160")).ok=((new com.ibm.math.BigDecimal("0.1265E+3")).toString()).equals("1.265E+2"); - (new Test("cst161")).ok=((new com.ibm.math.BigDecimal("0.1265E+4")).toString()).equals("1.265E+3"); - (new Test("cst162")).ok=((new com.ibm.math.BigDecimal("0.1265E+8")).toString()).equals("1.265E+7"); - (new Test("cst163")).ok=((new com.ibm.math.BigDecimal("0.1265E+20")).toString()).equals("1.265E+19"); - - (new Test("cst170")).ok=((new com.ibm.math.BigDecimal("0.09e999999999")).toString()).equals("9E+999999997"); - (new Test("cst171")).ok=((new com.ibm.math.BigDecimal("0.9e999999999")).toString()).equals("9E+999999998"); - (new Test("cst172")).ok=((new com.ibm.math.BigDecimal("9e999999999")).toString()).equals("9E+999999999"); - (new Test("cst173")).ok=((new com.ibm.math.BigDecimal("9.9e999999999")).toString()).equals("9.9E+999999999"); - (new Test("cst174")).ok=((new com.ibm.math.BigDecimal("9.99e999999999")).toString()).equals("9.99E+999999999"); - (new Test("cst175")).ok=((new com.ibm.math.BigDecimal("9.99e-999999999")).toString()).equals("9.99E-999999999"); - (new Test("cst176")).ok=((new com.ibm.math.BigDecimal("9.9e-999999999")).toString()).equals("9.9E-999999999"); - (new Test("cst177")).ok=((new com.ibm.math.BigDecimal("9e-999999999")).toString()).equals("9E-999999999"); - (new Test("cst179")).ok=((new com.ibm.math.BigDecimal("99e-999999999")).toString()).equals("9.9E-999999998"); - (new Test("cst180")).ok=((new com.ibm.math.BigDecimal("999e-999999999")).toString()).equals("9.99E-999999997"); - - // baddies -- - badstrings=new java.lang.String[]{"1..2",".","..","++1","--1","-+1","+-1","12e","12e++","12f4"," +1","+ 1","12 "," + 1"," - 1 ","x","-1-","12-","3+","","1e-","7e1000000000","","e100","\u0e5a","\u0b65","99e999999999","999e999999999","0.9e-999999999","0.09e-999999999","0.1e1000000000","10e-1000000000","0.9e9999999999","99e-9999999999","111e9999999999","1111e-9999999999"+" "+"111e*123","111e123-","111e+12+","111e1-3-","111e1*23","111e1e+3","1e1.0","1e123e","ten","ONE","1e.1","1e1.","1ee","e+1"}; // 200-203 - // 204-207 - // 208-211 - // 211-214 - // 215-219 - // 220-222 - // 223-224 - // 225-226 - // 227-228 - // 229-230 - // 231-232 - // 233-234 - // 235-237 - // 238-240 - // 241-244 - // 245-248 - - // watch out for commas on continuation lines - - {int $16=badstrings.length;i=0;i:for(;$16>0;$16--,i++){ - try{ - new com.ibm.math.BigDecimal(badstrings[i]); - say(">>> cst"+(200+i)+":"+" "+badstrings[i]+" "+(new com.ibm.math.BigDecimal(badstrings[i])).toString()); - flag=false; - } - catch (java.lang.NumberFormatException $17){ - flag=true; - } - (new Test("cst"+(200+i))).ok=flag; - } - }/*i*/ - - try{checknull:do{ - new com.ibm.math.BigDecimal((java.lang.String)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $18){ - flag=true; - }/*checknull*/ - (new Test("cst301")).ok=flag; - - summary("Constructors"); - return; - } - - /** Mutation tests (checks that contents of constant objects are unchanged). */ - - public void diagmutation(){ - /* ---------------------------------------------------------------- */ - /* Final tests -- check constants haven't mutated */ - /* -- also that MC objects haven't mutated */ - /* ---------------------------------------------------------------- */ - (new Test("cuc001")).ok=(com.ibm.math.BigDecimal.ZERO.toString()).equals("0"); - (new Test("cuc002")).ok=(com.ibm.math.BigDecimal.ONE.toString()).equals("1"); - (new Test("cuc003")).ok=(com.ibm.math.BigDecimal.TEN.toString()).equals("10"); - - (new Test("cuc010")).ok=com.ibm.math.BigDecimal.ROUND_CEILING==com.ibm.math.MathContext.ROUND_CEILING; - (new Test("cuc011")).ok=com.ibm.math.BigDecimal.ROUND_DOWN==com.ibm.math.MathContext.ROUND_DOWN; - (new Test("cuc012")).ok=com.ibm.math.BigDecimal.ROUND_FLOOR==com.ibm.math.MathContext.ROUND_FLOOR; - (new Test("cuc013")).ok=com.ibm.math.BigDecimal.ROUND_HALF_DOWN==com.ibm.math.MathContext.ROUND_HALF_DOWN; - (new Test("cuc014")).ok=com.ibm.math.BigDecimal.ROUND_HALF_EVEN==com.ibm.math.MathContext.ROUND_HALF_EVEN; - (new Test("cuc015")).ok=com.ibm.math.BigDecimal.ROUND_HALF_UP==com.ibm.math.MathContext.ROUND_HALF_UP; - (new Test("cuc016")).ok=com.ibm.math.BigDecimal.ROUND_UNNECESSARY==com.ibm.math.MathContext.ROUND_UNNECESSARY; - (new Test("cuc017")).ok=com.ibm.math.BigDecimal.ROUND_UP==com.ibm.math.MathContext.ROUND_UP; - - (new Test("cuc020")).ok=(com.ibm.math.MathContext.DEFAULT.getDigits())==9; - (new Test("cuc021")).ok=(com.ibm.math.MathContext.DEFAULT.getForm())==com.ibm.math.MathContext.SCIENTIFIC; - (new Test("cuc022")).ok=(com.ibm.math.MathContext.DEFAULT.getLostDigits()?1:0)==0; - (new Test("cuc023")).ok=(com.ibm.math.MathContext.DEFAULT.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - - // mc9 =MathContext(9) - // mcld =MathContext(9, SCIENTIFIC, 1) - // mcfd =MathContext(0, PLAIN) - (new Test("cuc030")).ok=(mc9.getDigits())==9; - (new Test("cuc031")).ok=(mc9.getForm())==com.ibm.math.MathContext.SCIENTIFIC; - (new Test("cuc032")).ok=(mc9.getLostDigits()?1:0)==0; - (new Test("cuc033")).ok=(mc9.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - (new Test("cuc034")).ok=(mcld.getDigits())==9; - (new Test("cuc035")).ok=(mcld.getForm())==com.ibm.math.MathContext.SCIENTIFIC; - (new Test("cuc036")).ok=(mcld.getLostDigits()?1:0)==1; - (new Test("cuc037")).ok=(mcld.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - (new Test("cuc038")).ok=(mcfd.getDigits())==0; - (new Test("cuc039")).ok=(mcfd.getForm())==com.ibm.math.MathContext.PLAIN; - (new Test("cuc040")).ok=(mcfd.getLostDigits()?1:0)==0; - (new Test("cuc041")).ok=(mcfd.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - - summary("No mutation"); - return;} - - - /* ----------------------------------------------------------------- */ - /* Operator test methods */ - /* ----------------------------------------------------------------- */ - // The use of context in these tests are primarily to show that they - // are correctly passed to the methods, except that we check that - // each method checks for lostDigits. - - /** Test the {@link BigDecimal#abs} method. */ - - public void diagabs(){ - boolean flag=false; - java.lang.ArithmeticException ae=null; - - // most of the function of this is tested by add - (new Test("abs001")).ok=((new com.ibm.math.BigDecimal("2")).abs().toString()).equals("2"); - (new Test("abs002")).ok=((new com.ibm.math.BigDecimal("-2")).abs().toString()).equals("2"); - (new Test("abs003")).ok=((new com.ibm.math.BigDecimal("+0.000")).abs().toString()).equals("0.000"); - (new Test("abs004")).ok=((new com.ibm.math.BigDecimal("00.000")).abs().toString()).equals("0.000"); - (new Test("abs005")).ok=((new com.ibm.math.BigDecimal("-0.000")).abs().toString()).equals("0.000"); - (new Test("abs006")).ok=((new com.ibm.math.BigDecimal("+0.000")).abs(mcdef).toString()).equals("0"); - (new Test("abs007")).ok=((new com.ibm.math.BigDecimal("00.000")).abs(mcdef).toString()).equals("0"); - (new Test("abs008")).ok=((new com.ibm.math.BigDecimal("-0.000")).abs(mcdef).toString()).equals("0"); - (new Test("abs009")).ok=((new com.ibm.math.BigDecimal("-2000000")).abs().toString()).equals("2000000"); - (new Test("abs010")).ok=((new com.ibm.math.BigDecimal("-2000000")).abs(mcdef).toString()).equals("2000000"); - (new Test("abs011")).ok=((new com.ibm.math.BigDecimal("-2000000")).abs(mc6).toString()).equals("2.00000E+6"); - (new Test("abs012")).ok=((new com.ibm.math.BigDecimal("2000000")).abs(mc6).toString()).equals("2.00000E+6"); - (new Test("abs013")).ok=((new com.ibm.math.BigDecimal("0.2")).abs().toString()).equals("0.2"); - (new Test("abs014")).ok=((new com.ibm.math.BigDecimal("-0.2")).abs().toString()).equals("0.2"); - (new Test("abs015")).ok=((new com.ibm.math.BigDecimal("0.01")).abs().toString()).equals("0.01"); - (new Test("abs016")).ok=((new com.ibm.math.BigDecimal("-0.01")).abs().toString()).equals("0.01"); - try{checkdigits:do{ - tenlong.abs(mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $19){ae=$19; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("abs020")).ok=flag; - // check lostdigits not raised if digits=0 [monadic method] - try{checkdigits:do{ - tenlong.abs(mcld0); - flag=true; - }while(false);} - catch (java.lang.ArithmeticException $20){ae=$20; - flag=false; - }/*checkdigits*/ - (new Test("abs021")).ok=flag; - try{checknull:do{ - com.ibm.math.BigDecimal.TEN.abs((com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $21){ - flag=true; - }/*checknull*/ - (new Test("abs022")).ok=flag; - - summary("abs"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#add} method. */ - - public void diagadd(){ - boolean flag=false; - com.ibm.math.BigDecimal alhs; - com.ibm.math.BigDecimal arhs; - java.lang.ArithmeticException ae=null; - - // [first group are 'quick confidence check'] - (new Test("add001")).ok=((new com.ibm.math.BigDecimal(2)).add(new com.ibm.math.BigDecimal(3),mcdef).toString()).equals("5"); - (new Test("add003")).ok=((new com.ibm.math.BigDecimal("5.75")).add(new com.ibm.math.BigDecimal("3.3"),mcdef).toString()).equals("9.05"); - (new Test("add004")).ok=((new com.ibm.math.BigDecimal("5")).add(new com.ibm.math.BigDecimal("-3"),mcdef).toString()).equals("2"); - (new Test("add005")).ok=((new com.ibm.math.BigDecimal("-5")).add(new com.ibm.math.BigDecimal("-3"),mcdef).toString()).equals("-8"); - (new Test("add006")).ok=((new com.ibm.math.BigDecimal("-7")).add(new com.ibm.math.BigDecimal("2.5"),mcdef).toString()).equals("-4.5"); - (new Test("add007")).ok=((new com.ibm.math.BigDecimal("0.7")).add(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("1.0"); - (new Test("add008")).ok=((new com.ibm.math.BigDecimal("1.25")).add(new com.ibm.math.BigDecimal("1.25"),mcdef).toString()).equals("2.50"); - (new Test("add009")).ok=((new com.ibm.math.BigDecimal("1.23456789")).add(new com.ibm.math.BigDecimal("1.00000000"),mcdef).toString()).equals("2.23456789"); - - (new Test("add010")).ok=((new com.ibm.math.BigDecimal("1.23456789")).add(new com.ibm.math.BigDecimal("1.00000011"),mcdef).toString()).equals("2.23456800"); - - - (new Test("add011")).ok=((new com.ibm.math.BigDecimal("0.4444444444")).add(new com.ibm.math.BigDecimal("0.5555555555"),mcdef).toString()).equals("1.00000000"); - - (new Test("add012")).ok=((new com.ibm.math.BigDecimal("0.4444444440")).add(new com.ibm.math.BigDecimal("0.5555555555"),mcdef).toString()).equals("1.00000000"); - - (new Test("add013")).ok=((new com.ibm.math.BigDecimal("0.4444444444")).add(new com.ibm.math.BigDecimal("0.5555555550"),mcdef).toString()).equals("0.999999999"); - - (new Test("add014")).ok=((new com.ibm.math.BigDecimal("0.4444444444999")).add(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("0.444444444"); - - (new Test("add015")).ok=((new com.ibm.math.BigDecimal("0.4444444445000")).add(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("0.444444445"); - - - (new Test("add016")).ok=((new com.ibm.math.BigDecimal("70")).add(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("1.00000000E+13"); - - (new Test("add017")).ok=((new com.ibm.math.BigDecimal("700")).add(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("1.00000000E+13"); - - (new Test("add018")).ok=((new com.ibm.math.BigDecimal("7000")).add(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("1.00000000E+13"); - - (new Test("add019")).ok=((new com.ibm.math.BigDecimal("70000")).add(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("1.00000001E+13"); - - (new Test("add020")).ok=((new com.ibm.math.BigDecimal("700000")).add(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("1.00000007E+13"); - - - // [Now the same group with fixed arithmetic] - (new Test("add030")).ok=((new com.ibm.math.BigDecimal(2)).add(new com.ibm.math.BigDecimal(3)).toString()).equals("5"); - (new Test("add031")).ok=((new com.ibm.math.BigDecimal("5.75")).add(new com.ibm.math.BigDecimal("3.3")).toString()).equals("9.05"); - (new Test("add032")).ok=((new com.ibm.math.BigDecimal("5")).add(new com.ibm.math.BigDecimal("-3")).toString()).equals("2"); - (new Test("add033")).ok=((new com.ibm.math.BigDecimal("-5")).add(new com.ibm.math.BigDecimal("-3")).toString()).equals("-8"); - (new Test("add034")).ok=((new com.ibm.math.BigDecimal("-7")).add(new com.ibm.math.BigDecimal("2.5")).toString()).equals("-4.5"); - (new Test("add035")).ok=((new com.ibm.math.BigDecimal("0.7")).add(new com.ibm.math.BigDecimal("0.3")).toString()).equals("1.0"); - (new Test("add036")).ok=((new com.ibm.math.BigDecimal("1.25")).add(new com.ibm.math.BigDecimal("1.25")).toString()).equals("2.50"); - (new Test("add037")).ok=((new com.ibm.math.BigDecimal("1.23456789")).add(new com.ibm.math.BigDecimal("1.00000000")).toString()).equals("2.23456789"); - - (new Test("add038")).ok=((new com.ibm.math.BigDecimal("1.23456789")).add(new com.ibm.math.BigDecimal("1.00000011")).toString()).equals("2.23456800"); - - - (new Test("add039")).ok=((new com.ibm.math.BigDecimal("0.4444444444")).add(new com.ibm.math.BigDecimal("0.5555555555")).toString()).equals("0.9999999999"); - - (new Test("add040")).ok=((new com.ibm.math.BigDecimal("0.4444444440")).add(new com.ibm.math.BigDecimal("0.5555555555")).toString()).equals("0.9999999995"); - - (new Test("add041")).ok=((new com.ibm.math.BigDecimal("0.4444444444")).add(new com.ibm.math.BigDecimal("0.5555555550")).toString()).equals("0.9999999994"); - - (new Test("add042")).ok=((new com.ibm.math.BigDecimal("0.4444444444999")).add(new com.ibm.math.BigDecimal("0")).toString()).equals("0.4444444444999"); - - (new Test("add043")).ok=((new com.ibm.math.BigDecimal("0.4444444445000")).add(new com.ibm.math.BigDecimal("0")).toString()).equals("0.4444444445000"); - - - (new Test("add044")).ok=((new com.ibm.math.BigDecimal("70")).add(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("10000000000070"); - - (new Test("add045")).ok=((new com.ibm.math.BigDecimal("700")).add(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("10000000000700"); - - (new Test("add046")).ok=((new com.ibm.math.BigDecimal("7000")).add(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("10000000007000"); - - (new Test("add047")).ok=((new com.ibm.math.BigDecimal("70000")).add(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("10000000070000"); - - (new Test("add048")).ok=((new com.ibm.math.BigDecimal("700000")).add(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("10000000700000"); - - - // symmetry: - (new Test("add049")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70"),mcdef).toString()).equals("1.00000000E+13"); - - (new Test("add050")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("700"),mcdef).toString()).equals("1.00000000E+13"); - - (new Test("add051")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("7000"),mcdef).toString()).equals("1.00000000E+13"); - - (new Test("add052")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70000"),mcdef).toString()).equals("1.00000001E+13"); - - (new Test("add053")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("700000"),mcdef).toString()).equals("1.00000007E+13"); - - - (new Test("add054")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70")).toString()).equals("10000000000070"); - - (new Test("add055")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("700")).toString()).equals("10000000000700"); - - (new Test("add056")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("7000")).toString()).equals("10000000007000"); - - (new Test("add057")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70000")).toString()).equals("10000000070000"); - - (new Test("add058")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("700000")).toString()).equals("10000000700000"); - - // some rounding effects - (new Test("add059")).ok=((new com.ibm.math.BigDecimal("0.9998")).add(new com.ibm.math.BigDecimal("0.0000")).toString()).equals("0.9998"); - - (new Test("add060")).ok=((new com.ibm.math.BigDecimal("0.9998")).add(new com.ibm.math.BigDecimal("0.0001")).toString()).equals("0.9999"); - - (new Test("add061")).ok=((new com.ibm.math.BigDecimal("0.9998")).add(new com.ibm.math.BigDecimal("0.0002")).toString()).equals("1.0000"); - - (new Test("add062")).ok=((new com.ibm.math.BigDecimal("0.9998")).add(new com.ibm.math.BigDecimal("0.0003")).toString()).equals("1.0001"); - - - // MC - (new Test("add070")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70000"),mcfd).toString()).equals("10000000070000"); - - (new Test("add071")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70000"),mcdef).toString()).equals("1.00000001E+13"); - - (new Test("add072")).ok=((new com.ibm.math.BigDecimal("10000e+9")).add(new com.ibm.math.BigDecimal("70000"),mc6).toString()).equals("1.00000E+13"); - - - // zero preservation - (new Test("add080")).ok=(com.ibm.math.BigDecimal.ONE.add(new com.ibm.math.BigDecimal("0.0001"),mc6).toString()).equals("1.0001"); - - (new Test("add081")).ok=(com.ibm.math.BigDecimal.ONE.add(new com.ibm.math.BigDecimal("0.00001"),mc6).toString()).equals("1.00001"); - - (new Test("add082")).ok=(com.ibm.math.BigDecimal.ONE.add(new com.ibm.math.BigDecimal("0.000001"),mc6).toString()).equals("1.00000"); - - (new Test("add083")).ok=(com.ibm.math.BigDecimal.ONE.add(new com.ibm.math.BigDecimal("0.0000001"),mc6).toString()).equals("1.00000"); - - (new Test("add084")).ok=(com.ibm.math.BigDecimal.ONE.add(new com.ibm.math.BigDecimal("0.00000001"),mc6).toString()).equals("1.00000"); - - - // more fixed, LHS swaps - (new Test("add090")).ok=((new com.ibm.math.BigDecimal("-56267E-10")).add(zero).toString()).equals("-0.0000056267"); - (new Test("add091")).ok=((new com.ibm.math.BigDecimal("-56267E-6")).add(zero).toString()).equals("-0.056267"); - (new Test("add092")).ok=((new com.ibm.math.BigDecimal("-56267E-5")).add(zero).toString()).equals("-0.56267"); - (new Test("add093")).ok=((new com.ibm.math.BigDecimal("-56267E-4")).add(zero).toString()).equals("-5.6267"); - (new Test("add094")).ok=((new com.ibm.math.BigDecimal("-56267E-3")).add(zero).toString()).equals("-56.267"); - (new Test("add095")).ok=((new com.ibm.math.BigDecimal("-56267E-2")).add(zero).toString()).equals("-562.67"); - (new Test("add096")).ok=((new com.ibm.math.BigDecimal("-56267E-1")).add(zero).toString()).equals("-5626.7"); - (new Test("add097")).ok=((new com.ibm.math.BigDecimal("-56267E-0")).add(zero).toString()).equals("-56267"); - (new Test("add098")).ok=((new com.ibm.math.BigDecimal("-5E-10")).add(zero).toString()).equals("-0.0000000005"); - (new Test("add099")).ok=((new com.ibm.math.BigDecimal("-5E-5")).add(zero).toString()).equals("-0.00005"); - (new Test("add100")).ok=((new com.ibm.math.BigDecimal("-5E-1")).add(zero).toString()).equals("-0.5"); - (new Test("add101")).ok=((new com.ibm.math.BigDecimal("-5E-10")).add(zero).toString()).equals("-0.0000000005"); - (new Test("add102")).ok=((new com.ibm.math.BigDecimal("-5E-5")).add(zero).toString()).equals("-0.00005"); - (new Test("add103")).ok=((new com.ibm.math.BigDecimal("-5E-1")).add(zero).toString()).equals("-0.5"); - (new Test("add104")).ok=((new com.ibm.math.BigDecimal("-5E10")).add(zero).toString()).equals("-50000000000"); - (new Test("add105")).ok=((new com.ibm.math.BigDecimal("-5E5")).add(zero).toString()).equals("-500000"); - (new Test("add106")).ok=((new com.ibm.math.BigDecimal("-5E1")).add(zero).toString()).equals("-50"); - (new Test("add107")).ok=((new com.ibm.math.BigDecimal("-5E0")).add(zero).toString()).equals("-5"); - - // more fixed, RHS swaps - (new Test("add108")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-10")).toString()).equals("-0.0000056267"); - (new Test("add109")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-6")).toString()).equals("-0.056267"); - (new Test("add110")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-5")).toString()).equals("-0.56267"); - (new Test("add111")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-4")).toString()).equals("-5.6267"); - (new Test("add112")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-3")).toString()).equals("-56.267"); - (new Test("add113")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-2")).toString()).equals("-562.67"); - (new Test("add114")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-1")).toString()).equals("-5626.7"); - (new Test("add115")).ok=(zero.add(new com.ibm.math.BigDecimal("-56267E-0")).toString()).equals("-56267"); - (new Test("add116")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E-10")).toString()).equals("-0.0000000005"); - (new Test("add117")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E-5")).toString()).equals("-0.00005"); - (new Test("add118")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E-1")).toString()).equals("-0.5"); - (new Test("add129")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E-10")).toString()).equals("-0.0000000005"); - (new Test("add130")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E-5")).toString()).equals("-0.00005"); - (new Test("add131")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E-1")).toString()).equals("-0.5"); - (new Test("add132")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E10")).toString()).equals("-50000000000"); - (new Test("add133")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E5")).toString()).equals("-500000"); - (new Test("add134")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E1")).toString()).equals("-50"); - (new Test("add135")).ok=(zero.add(new com.ibm.math.BigDecimal("-5E0")).toString()).equals("-5"); - - // [some of the next group are really constructor tests] - (new Test("add140")).ok=((new com.ibm.math.BigDecimal("00.0")).add(new com.ibm.math.BigDecimal("0.00"),mcdef).toString()).equals("0"); - (new Test("add141")).ok=((new com.ibm.math.BigDecimal("0.00")).add(new com.ibm.math.BigDecimal("00.0"),mcdef).toString()).equals("0"); - (new Test("add142")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("3.3"); - (new Test("add143")).ok=((new com.ibm.math.BigDecimal("3.")).add(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("3.3"); - (new Test("add144")).ok=((new com.ibm.math.BigDecimal("3.0")).add(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("3.3"); - (new Test("add145")).ok=((new com.ibm.math.BigDecimal("3.00")).add(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("3.30"); - (new Test("add146")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("6"); - (new Test("add147")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal("+3"),mcdef).toString()).equals("6"); - (new Test("add148")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal("-3"),mcdef).toString()).equals("0"); - (new Test("add149")).ok=((new com.ibm.math.BigDecimal("0.03")).add(new com.ibm.math.BigDecimal("-0.03"),mcdef).toString()).equals("0"); - - (new Test("add150")).ok=((new com.ibm.math.BigDecimal("00.0")).add(new com.ibm.math.BigDecimal("0.00")).toString()).equals("0.00"); - (new Test("add151")).ok=((new com.ibm.math.BigDecimal("0.00")).add(new com.ibm.math.BigDecimal("00.0")).toString()).equals("0.00"); - (new Test("add152")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal(".3")).toString()).equals("3.3"); - (new Test("add153")).ok=((new com.ibm.math.BigDecimal("3.")).add(new com.ibm.math.BigDecimal(".3")).toString()).equals("3.3"); - (new Test("add154")).ok=((new com.ibm.math.BigDecimal("3.0")).add(new com.ibm.math.BigDecimal(".3")).toString()).equals("3.3"); - (new Test("add155")).ok=((new com.ibm.math.BigDecimal("3.00")).add(new com.ibm.math.BigDecimal(".3")).toString()).equals("3.30"); - (new Test("add156")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal("3")).toString()).equals("6"); - (new Test("add157")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal("+3")).toString()).equals("6"); - (new Test("add158")).ok=((new com.ibm.math.BigDecimal("3")).add(new com.ibm.math.BigDecimal("-3")).toString()).equals("0"); - (new Test("add159")).ok=((new com.ibm.math.BigDecimal("0.3")).add(new com.ibm.math.BigDecimal("-0.3")).toString()).equals("0.0"); - (new Test("add160")).ok=((new com.ibm.math.BigDecimal("0.03")).add(new com.ibm.math.BigDecimal("-0.03")).toString()).equals("0.00"); - (new Test("add161")).ok=((new com.ibm.math.BigDecimal("7E+12")).add(new com.ibm.math.BigDecimal("-1"),mcfd).toString()).equals("6999999999999"); - - (new Test("add162")).ok=((new com.ibm.math.BigDecimal("7E+12")).add(new com.ibm.math.BigDecimal("1.11"),mcfd).toString()).equals("7000000000001.11"); - - (new Test("add163")).ok=((new com.ibm.math.BigDecimal("1.11")).add(new com.ibm.math.BigDecimal("7E+12"),mcfd).toString()).equals("7000000000001.11"); - - - // input preparation tests - alhs=new com.ibm.math.BigDecimal("12345678900000"); - arhs=new com.ibm.math.BigDecimal("9999999999999"); - (new Test("add170")).ok=(alhs.add(arhs,mc3).toString()).equals("2.23E+13"); - (new Test("add171")).ok=(arhs.add(alhs,mc3).toString()).equals("2.23E+13"); - (new Test("add172")).ok=((new com.ibm.math.BigDecimal("12E+3")).add(new com.ibm.math.BigDecimal("3456"),mc3).toString()).equals("1.55E+4"); - // next was 1.54E+4 under old [truncate to digits+1] rules - (new Test("add173")).ok=((new com.ibm.math.BigDecimal("12E+3")).add(new com.ibm.math.BigDecimal("3446"),mc3).toString()).equals("1.55E+4"); - (new Test("add174")).ok=((new com.ibm.math.BigDecimal("12E+3")).add(new com.ibm.math.BigDecimal("3454"),mc3).toString()).equals("1.55E+4"); - (new Test("add175")).ok=((new com.ibm.math.BigDecimal("12E+3")).add(new com.ibm.math.BigDecimal("3444"),mc3).toString()).equals("1.54E+4"); - - (new Test("add176")).ok=((new com.ibm.math.BigDecimal("3456")).add(new com.ibm.math.BigDecimal("12E+3"),mc3).toString()).equals("1.55E+4"); - // next was 1.54E+4 under old [truncate to digits+1] rules - (new Test("add177")).ok=((new com.ibm.math.BigDecimal("3446")).add(new com.ibm.math.BigDecimal("12E+3"),mc3).toString()).equals("1.55E+4"); - (new Test("add178")).ok=((new com.ibm.math.BigDecimal("3454")).add(new com.ibm.math.BigDecimal("12E+3"),mc3).toString()).equals("1.55E+4"); - (new Test("add179")).ok=((new com.ibm.math.BigDecimal("3444")).add(new com.ibm.math.BigDecimal("12E+3"),mc3).toString()).equals("1.54E+4"); - - try{checknull:do{ - ten.add((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $22){ - flag=true; - }/*checknull*/ - (new Test("add200")).ok=flag; - try{checknull2:do{ - ten.add(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $23){ - flag=true; - }/*checknull2*/ - (new Test("add201")).ok=flag; - - try{checkdigits:do{ - tenlong.add(com.ibm.math.BigDecimal.ZERO,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $24){ae=$24; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("add202")).ok=flag; - try{checkdigits:do{ - com.ibm.math.BigDecimal.ZERO.add(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $25){ae=$25; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("add203")).ok=flag; - - // check lostdigits not raised if digits=0 [dyadic method] - try{checkdigits:do{ - tenlong.add(com.ibm.math.BigDecimal.ZERO,mcld0); - flag=true; - }while(false);} - catch (java.lang.ArithmeticException $26){ae=$26; - flag=false; - }/*checkdigits*/ - (new Test("add204")).ok=flag; - try{checkdigits:do{ - com.ibm.math.BigDecimal.ZERO.add(tenlong,mcld0); - flag=true; - }while(false);} - catch (java.lang.ArithmeticException $27){ae=$27; - flag=false; - }/*checkdigits*/ - (new Test("add205")).ok=flag; - - summary("add"); - return;} - - /* ----------------------------------------------------------------- */ - /** Test the {@link BigDecimal#compareTo(BigDecimal)} method. */ - - public void diagcompareto(){ - boolean flag=false; - java.lang.ArithmeticException ae=null; - // we assume add/subtract test function; this just - // tests existence, exceptions, and possible results - - (new Test("cpt001")).ok=((new com.ibm.math.BigDecimal("5")).compareTo(new com.ibm.math.BigDecimal("2")))==1; - (new Test("cpt002")).ok=((new com.ibm.math.BigDecimal("5")).compareTo(new com.ibm.math.BigDecimal("5")))==0; - (new Test("cpt003")).ok=((new com.ibm.math.BigDecimal("5")).compareTo(new com.ibm.math.BigDecimal("5.00")))==0; - (new Test("cpt004")).ok=((new com.ibm.math.BigDecimal("0.5")).compareTo(new com.ibm.math.BigDecimal("0.5")))==0; - (new Test("cpt005")).ok=((new com.ibm.math.BigDecimal("2")).compareTo(new com.ibm.math.BigDecimal("5")))==(-1); - (new Test("cpt006")).ok=((new com.ibm.math.BigDecimal("2")).compareTo(new com.ibm.math.BigDecimal("5"),mcdef))==(-1); - (new Test("cpt007")).ok=((new com.ibm.math.BigDecimal("2")).compareTo(new com.ibm.math.BigDecimal("5"),mc6))==(-1); - (new Test("cpt008")).ok=((new com.ibm.math.BigDecimal("2")).compareTo(new com.ibm.math.BigDecimal("5"),mcfd))==(-1); - try{checknull:do{ - ten.compareTo((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $28){ - flag=true; - }/*checknull*/ - (new Test("cpt100")).ok=flag; - try{checknull2:do{ - ten.compareTo(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $29){ - flag=true; - }/*checknull2*/ - (new Test("cpt101")).ok=flag; - - try{checkdigits:do{ - tenlong.compareTo(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $30){ae=$30; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("cpt102")).ok=flag; - try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.compareTo(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $31){ae=$31; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("cpt103")).ok=flag; - - summary("compareTo"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#divide} method. */ - - public void diagdivide(){ - boolean flag=false; - com.ibm.math.MathContext rmcd; - int rhu; - int rd; - int ru; - java.lang.RuntimeException e=null; - java.lang.ArithmeticException ae=null; - - (new Test("div301")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("0.333333333"); - (new Test("div302")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("0.666666667"); - (new Test("div303")).ok=((new com.ibm.math.BigDecimal("2.4")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("2.4"); - (new Test("div304")).ok=((new com.ibm.math.BigDecimal("2.4")).divide(new com.ibm.math.BigDecimal("-1"),mcdef).toString()).equals("-2.4"); - (new Test("div305")).ok=((new com.ibm.math.BigDecimal("-2.4")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("-2.4"); - (new Test("div306")).ok=((new com.ibm.math.BigDecimal("-2.4")).divide(new com.ibm.math.BigDecimal("-1"),mcdef).toString()).equals("2.4"); - (new Test("div307")).ok=((new com.ibm.math.BigDecimal("2.40")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("2.4"); - (new Test("div308")).ok=((new com.ibm.math.BigDecimal("2.400")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("2.4"); - (new Test("div309")).ok=((new com.ibm.math.BigDecimal("2.4")).divide(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1.2"); - (new Test("div310")).ok=((new com.ibm.math.BigDecimal("2.400")).divide(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1.2"); - (new Test("div311")).ok=((new com.ibm.math.BigDecimal("2.")).divide(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1"); - (new Test("div312")).ok=((new com.ibm.math.BigDecimal("20")).divide(new com.ibm.math.BigDecimal("20"),mcdef).toString()).equals("1"); - (new Test("div313")).ok=((new com.ibm.math.BigDecimal("187")).divide(new com.ibm.math.BigDecimal("187"),mcdef).toString()).equals("1"); - (new Test("div314")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("2.5"); - (new Test("div315")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("2.0"),mcdef).toString()).equals("2.5"); - (new Test("div316")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("2.000"),mcdef).toString()).equals("2.5"); - (new Test("div317")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("0.200"),mcdef).toString()).equals("25"); - (new Test("div318")).ok=((new com.ibm.math.BigDecimal("999999999")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("999999999"); - (new Test("div319")).ok=((new com.ibm.math.BigDecimal("999999999.4")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("999999999"); - (new Test("div320")).ok=((new com.ibm.math.BigDecimal("999999999.5")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("1E+9"); - (new Test("div321")).ok=((new com.ibm.math.BigDecimal("999999999.9")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("1E+9"); - (new Test("div322")).ok=((new com.ibm.math.BigDecimal("999999999.999")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("1E+9"); - (new Test("div323")).ok=((new com.ibm.math.BigDecimal("0.0000E-50")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("0"); - // MC - (new Test("div325")).ok=((new com.ibm.math.BigDecimal("999999999")).divide(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("999999999"); - (new Test("div326")).ok=((new com.ibm.math.BigDecimal("999999999")).divide(new com.ibm.math.BigDecimal("1"),mc6).toString()).equals("1E+9"); - (new Test("div327")).ok=((new com.ibm.math.BigDecimal("9999999")).divide(new com.ibm.math.BigDecimal("1"),mc6).toString()).equals("1E+7"); - (new Test("div328")).ok=((new com.ibm.math.BigDecimal("999999")).divide(new com.ibm.math.BigDecimal("1"),mc6).toString()).equals("999999"); - - // check rounding explicitly [note: digits+1 truncation] - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_CEILING); - (new Test("div330")).ok=((new com.ibm.math.BigDecimal("1.50")).divide(one,rmcd).toString()).equals("1.5"); - (new Test("div331")).ok=((new com.ibm.math.BigDecimal("1.51")).divide(one,rmcd).toString()).equals("1.6"); - (new Test("div332")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.6"); - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_DOWN); - (new Test("div333")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.5"); - (new Test("div334")).ok=((new com.ibm.math.BigDecimal("1.59")).divide(one,rmcd).toString()).equals("1.5"); - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_FLOOR); - (new Test("div335")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.5"); - (new Test("div336")).ok=((new com.ibm.math.BigDecimal("1.59")).divide(one,rmcd).toString()).equals("1.5"); - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_HALF_DOWN); - (new Test("div337")).ok=((new com.ibm.math.BigDecimal("1.45")).divide(one,rmcd).toString()).equals("1.4"); - (new Test("div338")).ok=((new com.ibm.math.BigDecimal("1.50")).divide(one,rmcd).toString()).equals("1.5"); - (new Test("div339")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.5"); - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_HALF_EVEN); - (new Test("div340")).ok=((new com.ibm.math.BigDecimal("1.45")).divide(one,rmcd).toString()).equals("1.4"); - (new Test("div341")).ok=((new com.ibm.math.BigDecimal("1.50")).divide(one,rmcd).toString()).equals("1.5"); - (new Test("div342")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.6"); - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_HALF_UP); - (new Test("div343")).ok=((new com.ibm.math.BigDecimal("1.45")).divide(one,rmcd).toString()).equals("1.5"); - (new Test("div344")).ok=((new com.ibm.math.BigDecimal("1.50")).divide(one,rmcd).toString()).equals("1.5"); - (new Test("div345")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.6"); - rmcd=new com.ibm.math.MathContext(2,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_UP); - (new Test("div346")).ok=((new com.ibm.math.BigDecimal("1.50")).divide(one,rmcd).toString()).equals("1.5"); - (new Test("div347")).ok=((new com.ibm.math.BigDecimal("1.51")).divide(one,rmcd).toString()).equals("1.6"); - (new Test("div348")).ok=((new com.ibm.math.BigDecimal("1.55")).divide(one,rmcd).toString()).equals("1.6"); - - // fixed point... - (new Test("div350")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3")).toString()).equals("0"); - (new Test("div351")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3")).toString()).equals("1"); - (new Test("div352")).ok=((new com.ibm.math.BigDecimal("2.4")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("2.4"); - (new Test("div353")).ok=((new com.ibm.math.BigDecimal("2.4")).divide(new com.ibm.math.BigDecimal("-1")).toString()).equals("-2.4"); - (new Test("div354")).ok=((new com.ibm.math.BigDecimal("-2.4")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("-2.4"); - (new Test("div355")).ok=((new com.ibm.math.BigDecimal("-2.4")).divide(new com.ibm.math.BigDecimal("-1")).toString()).equals("2.4"); - (new Test("div356")).ok=((new com.ibm.math.BigDecimal("2.40")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("2.40"); - (new Test("div357")).ok=((new com.ibm.math.BigDecimal("2.400")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("2.400"); - (new Test("div358")).ok=((new com.ibm.math.BigDecimal("2.4")).divide(new com.ibm.math.BigDecimal("2")).toString()).equals("1.2"); - (new Test("div359")).ok=((new com.ibm.math.BigDecimal("2.400")).divide(new com.ibm.math.BigDecimal("2")).toString()).equals("1.200"); - (new Test("div360")).ok=((new com.ibm.math.BigDecimal("2.")).divide(new com.ibm.math.BigDecimal("2")).toString()).equals("1"); - (new Test("div361")).ok=((new com.ibm.math.BigDecimal("20")).divide(new com.ibm.math.BigDecimal("20")).toString()).equals("1"); - (new Test("div362")).ok=((new com.ibm.math.BigDecimal("187")).divide(new com.ibm.math.BigDecimal("187")).toString()).equals("1"); - (new Test("div363")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("2")).toString()).equals("3"); - (new Test("div364")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("2.0")).toString()).equals("3"); - (new Test("div365")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("2.000")).toString()).equals("3"); - (new Test("div366")).ok=((new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("0.200")).toString()).equals("25"); - (new Test("div367")).ok=((new com.ibm.math.BigDecimal("5.0")).divide(new com.ibm.math.BigDecimal("2")).toString()).equals("2.5"); - (new Test("div368")).ok=((new com.ibm.math.BigDecimal("5.0")).divide(new com.ibm.math.BigDecimal("2.0")).toString()).equals("2.5"); - (new Test("div369")).ok=((new com.ibm.math.BigDecimal("5.0")).divide(new com.ibm.math.BigDecimal("2.000")).toString()).equals("2.5"); - (new Test("div370")).ok=((new com.ibm.math.BigDecimal("5.0")).divide(new com.ibm.math.BigDecimal("0.200")).toString()).equals("25.0"); - (new Test("div371")).ok=((new com.ibm.math.BigDecimal("999999999")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("999999999"); - (new Test("div372")).ok=((new com.ibm.math.BigDecimal("999999999.4")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("999999999.4"); - (new Test("div373")).ok=((new com.ibm.math.BigDecimal("999999999.5")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("999999999.5"); - (new Test("div374")).ok=((new com.ibm.math.BigDecimal("999999999.9")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("999999999.9"); - (new Test("div375")).ok=((new com.ibm.math.BigDecimal("999999999.999")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("999999999.999"); - (new Test("div376")).ok=((new com.ibm.math.BigDecimal("0.0000E-5")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("0"); - (new Test("div377")).ok=((new com.ibm.math.BigDecimal("0.000000000")).divide(new com.ibm.math.BigDecimal("1")).toString()).equals("0.000000000"); - - //- Fixed point; explicit scales & rounds [old BigDecimal divides] - rhu=com.ibm.math.MathContext.ROUND_HALF_UP; - rd=com.ibm.math.MathContext.ROUND_DOWN; - (new Test("div001")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3")).toString()).equals("0"); - (new Test("div002")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3"),rhu).toString()).equals("0"); - (new Test("div003")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3"),0,rhu).toString()).equals("0"); - (new Test("div004")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3"),1,rhu).toString()).equals("0.0"); - (new Test("div005")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3"),2,rhu).toString()).equals("0.00"); - (new Test("div006")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3"),3,rhu).toString()).equals("0.000"); - (new Test("div007")).ok=((new com.ibm.math.BigDecimal("0")).divide(new com.ibm.math.BigDecimal("3"),4,rhu).toString()).equals("0.0000"); - (new Test("div008")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3")).toString()).equals("0"); - (new Test("div009")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),rhu).toString()).equals("0"); - (new Test("div010")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),0,rhu).toString()).equals("0"); - (new Test("div011")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),1,rhu).toString()).equals("0.3"); - (new Test("div012")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),2,rhu).toString()).equals("0.33"); - (new Test("div013")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),3,rhu).toString()).equals("0.333"); - (new Test("div014")).ok=((new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),4,rhu).toString()).equals("0.3333"); - (new Test("div015")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3")).toString()).equals("1"); - (new Test("div016")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),rhu).toString()).equals("1"); - (new Test("div017")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),0,rhu).toString()).equals("1"); - (new Test("div018")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),1,rhu).toString()).equals("0.7"); - (new Test("div019")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),2,rhu).toString()).equals("0.67"); - (new Test("div020")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),3,rhu).toString()).equals("0.667"); - (new Test("div021")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),4,rhu).toString()).equals("0.6667"); - - (new Test("div030")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("2000"),4,rhu).toString()).equals("0.5000"); - (new Test("div031")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("2000"),3,rhu).toString()).equals("0.500"); - (new Test("div032")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("2000"),2,rhu).toString()).equals("0.50"); - (new Test("div033")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("2000"),1,rhu).toString()).equals("0.5"); - (new Test("div034")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("2000"),0,rhu).toString()).equals("1"); - - (new Test("div035")).ok=((new com.ibm.math.BigDecimal("100")).divide(new com.ibm.math.BigDecimal("5000"),4,rhu).toString()).equals("0.0200"); - (new Test("div036")).ok=((new com.ibm.math.BigDecimal("100")).divide(new com.ibm.math.BigDecimal("5000"),3,rhu).toString()).equals("0.020"); - (new Test("div037")).ok=((new com.ibm.math.BigDecimal("100")).divide(new com.ibm.math.BigDecimal("5000"),2,rhu).toString()).equals("0.02"); - (new Test("div038")).ok=((new com.ibm.math.BigDecimal("100")).divide(new com.ibm.math.BigDecimal("5000"),1,rhu).toString()).equals("0.0"); - (new Test("div039")).ok=((new com.ibm.math.BigDecimal("100")).divide(new com.ibm.math.BigDecimal("5000"),0,rhu).toString()).equals("0"); - - (new Test("div040")).ok=((new com.ibm.math.BigDecimal("9.99999999")).divide(new com.ibm.math.BigDecimal("9.77777777"),4,rhu).toString()).equals("1.0227"); - (new Test("div041")).ok=((new com.ibm.math.BigDecimal("9.9999999")).divide(new com.ibm.math.BigDecimal("9.7777777"),4,rhu).toString()).equals("1.0227"); - (new Test("div042")).ok=((new com.ibm.math.BigDecimal("9.999999")).divide(new com.ibm.math.BigDecimal("9.777777"),4,rhu).toString()).equals("1.0227"); - (new Test("div043")).ok=((new com.ibm.math.BigDecimal("9.77777777")).divide(new com.ibm.math.BigDecimal("9.99999999"),4,rhu).toString()).equals("0.9778"); - (new Test("div044")).ok=((new com.ibm.math.BigDecimal("9.7777777")).divide(new com.ibm.math.BigDecimal("9.9999999"),4,rhu).toString()).equals("0.9778"); - (new Test("div045")).ok=((new com.ibm.math.BigDecimal("9.777777")).divide(new com.ibm.math.BigDecimal("9.999999"),4,rhu).toString()).equals("0.9778"); - (new Test("div046")).ok=((new com.ibm.math.BigDecimal("9.77777")).divide(new com.ibm.math.BigDecimal("9.99999"),4,rhu).toString()).equals("0.9778"); - (new Test("div047")).ok=((new com.ibm.math.BigDecimal("9.7777")).divide(new com.ibm.math.BigDecimal("9.9999"),4,rhu).toString()).equals("0.9778"); - (new Test("div048")).ok=((new com.ibm.math.BigDecimal("9.777")).divide(new com.ibm.math.BigDecimal("9.999"),4,rhu).toString()).equals("0.9778"); - (new Test("div049")).ok=((new com.ibm.math.BigDecimal("9.77")).divide(new com.ibm.math.BigDecimal("9.99"),4,rhu).toString()).equals("0.9780"); - (new Test("div050")).ok=((new com.ibm.math.BigDecimal("9.7")).divide(new com.ibm.math.BigDecimal("9.9"),4,rhu).toString()).equals("0.9798"); - (new Test("div051")).ok=((new com.ibm.math.BigDecimal("9.")).divide(new com.ibm.math.BigDecimal("9."),4,rhu).toString()).equals("1.0000"); - - (new Test("div060")).ok=((new com.ibm.math.BigDecimal("9.99999999")).divide(new com.ibm.math.BigDecimal("9.77777777"),rhu).toString()).equals("1.02272727"); - (new Test("div061")).ok=((new com.ibm.math.BigDecimal("9.9999999")).divide(new com.ibm.math.BigDecimal("9.7777777"),rhu).toString()).equals("1.0227273"); - (new Test("div062")).ok=((new com.ibm.math.BigDecimal("9.999999")).divide(new com.ibm.math.BigDecimal("9.777777"),rhu).toString()).equals("1.022727"); - (new Test("div063")).ok=((new com.ibm.math.BigDecimal("9.77777777")).divide(new com.ibm.math.BigDecimal("9.99999999"),rhu).toString()).equals("0.97777778"); - (new Test("div064")).ok=((new com.ibm.math.BigDecimal("9.7777777")).divide(new com.ibm.math.BigDecimal("9.9999999"),rhu).toString()).equals("0.9777778"); - (new Test("div065")).ok=((new com.ibm.math.BigDecimal("9.777777")).divide(new com.ibm.math.BigDecimal("9.999999"),rhu).toString()).equals("0.977778"); - (new Test("div066")).ok=((new com.ibm.math.BigDecimal("9.77777")).divide(new com.ibm.math.BigDecimal("9.99999"),rhu).toString()).equals("0.97778"); - (new Test("div067")).ok=((new com.ibm.math.BigDecimal("9.7777")).divide(new com.ibm.math.BigDecimal("9.9999"),rhu).toString()).equals("0.9778"); - (new Test("div068")).ok=((new com.ibm.math.BigDecimal("9.777")).divide(new com.ibm.math.BigDecimal("9.999"),rhu).toString()).equals("0.978"); - (new Test("div069")).ok=((new com.ibm.math.BigDecimal("9.77")).divide(new com.ibm.math.BigDecimal("9.99"),rhu).toString()).equals("0.98"); - (new Test("div070")).ok=((new com.ibm.math.BigDecimal("9.7")).divide(new com.ibm.math.BigDecimal("9.9"),rhu).toString()).equals("1.0"); - (new Test("div071")).ok=((new com.ibm.math.BigDecimal("9.")).divide(new com.ibm.math.BigDecimal("9."),rhu).toString()).equals("1"); - - rd=com.ibm.math.MathContext.ROUND_DOWN; // test this is actually being used - (new Test("div080")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),0,rd).toString()).equals("0"); - (new Test("div081")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),1,rd).toString()).equals("0.6"); - (new Test("div082")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),2,rd).toString()).equals("0.66"); - (new Test("div083")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),3,rd).toString()).equals("0.666"); - (new Test("div084")).ok=((new com.ibm.math.BigDecimal("2")).divide(new com.ibm.math.BigDecimal("3"),4,rd).toString()).equals("0.6666"); - - ru=com.ibm.math.MathContext.ROUND_UNNECESSARY; // check for some 0 residues - (new Test("div090")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("5"),4,ru).toString()).equals("200.0000"); - (new Test("div091")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("50"),4,ru).toString()).equals("20.0000"); - (new Test("div092")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("500"),4,ru).toString()).equals("2.0000"); - (new Test("div093")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("5000"),4,ru).toString()).equals("0.2000"); - (new Test("div094")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("5000"),3,ru).toString()).equals("0.200"); - (new Test("div095")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("5000"),2,ru).toString()).equals("0.20"); - (new Test("div096")).ok=((new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("5000"),1,ru).toString()).equals("0.2"); - - // check rounding explicitly - (new Test("div101")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_CEILING).toString()).equals("0.06"); - (new Test("div102")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_CEILING).toString()).equals("0.1"); - (new Test("div103")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_CEILING).toString()).equals("1"); - (new Test("div104")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_DOWN).toString()).equals("0.05"); - (new Test("div105")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_DOWN).toString()).equals("0.0"); - (new Test("div106")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_DOWN).toString()).equals("0"); - (new Test("div107")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_FLOOR).toString()).equals("0.05"); - (new Test("div108")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_FLOOR).toString()).equals("0.0"); - (new Test("div109")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_FLOOR).toString()).equals("0"); - - (new Test("div110")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.04"); - (new Test("div111")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.0"); - (new Test("div112")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0"); - (new Test("div113")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.05"); - (new Test("div114")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.0"); - (new Test("div115")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0"); - (new Test("div116")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.05"); - (new Test("div117")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.1"); - (new Test("div118")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0"); - - (new Test("div120")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.04"); - (new Test("div121")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.0"); - (new Test("div122")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0"); - (new Test("div123")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.05"); - (new Test("div124")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.0"); - (new Test("div125")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0"); - (new Test("div126")).ok=((new com.ibm.math.BigDecimal("0.150")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.15"); - (new Test("div127")).ok=((new com.ibm.math.BigDecimal("0.150")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.2"); - (new Test("div128")).ok=((new com.ibm.math.BigDecimal("0.150")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0"); - (new Test("div129")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.06"); - (new Test("div130")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.1"); - (new Test("div131")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0"); - - (new Test("div140")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.05"); - (new Test("div141")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.0"); - (new Test("div142")).ok=((new com.ibm.math.BigDecimal("0.045")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0"); - (new Test("div143")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.05"); - (new Test("div144")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.1"); - (new Test("div145")).ok=((new com.ibm.math.BigDecimal("0.050")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0"); - (new Test("div146")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.06"); - (new Test("div147")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.1"); - (new Test("div148")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0"); - - (new Test("div150")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,2,com.ibm.math.MathContext.ROUND_UP).toString()).equals("0.06"); - (new Test("div151")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,1,com.ibm.math.MathContext.ROUND_UP).toString()).equals("0.1"); - (new Test("div52.")).ok=((new com.ibm.math.BigDecimal("0.055")).divide(one,0,com.ibm.math.MathContext.ROUND_UP).toString()).equals("1"); - - //- error conditions --- - try{checknull:do{ - ten.divide((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $32){ - flag=true; - }/*checknull*/ - (new Test("div201")).ok=flag; - try{checknull2:do{ - ten.divide(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $33){ - flag=true; - }/*checknull2*/ - (new Test("div202")).ok=flag; - - try{checkscale:do{ - (new com.ibm.math.BigDecimal("1")).divide(new com.ibm.math.BigDecimal("3"),-8,0); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $34){e=$34; - flag=flag&(e.getMessage()).equals("Negative scale: -8"); - }/*checkscale*/ - (new Test("div203")).ok=flag; - - try{rounn:do{ - (new com.ibm.math.BigDecimal("1000")).divide(new com.ibm.math.BigDecimal("5000"),0,com.ibm.math.MathContext.ROUND_UNNECESSARY); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $35){ae=$35; - flag=(ae.getMessage()).equals("Rounding necessary"); - }/*rounn*/ - (new Test("div204")).ok=flag; - try{rounn:do{ - (new com.ibm.math.BigDecimal("1001")).divide(new com.ibm.math.BigDecimal("10"),0,com.ibm.math.MathContext.ROUND_UNNECESSARY); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $36){ae=$36; - flag=(ae.getMessage()).equals("Rounding necessary"); - }/*rounn*/ - (new Test("div205")).ok=flag; - try{rounn:do{ - (new com.ibm.math.BigDecimal("1001")).divide(new com.ibm.math.BigDecimal("100"),1,com.ibm.math.MathContext.ROUND_UNNECESSARY); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $37){ae=$37; - flag=(ae.getMessage()).equals("Rounding necessary"); - }/*rounn*/ - (new Test("div206")).ok=flag; - try{rounn:do{ - (new com.ibm.math.BigDecimal("10001")).divide(new com.ibm.math.BigDecimal("10000"),1,com.ibm.math.MathContext.ROUND_UNNECESSARY); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $38){ae=$38; - flag=(ae.getMessage()).equals("Rounding necessary"); - }/*rounn*/ - (new Test("div207")).ok=flag; - try{rounn:do{ - (new com.ibm.math.BigDecimal("1.0001")).divide(new com.ibm.math.BigDecimal("1"),1,com.ibm.math.MathContext.ROUND_UNNECESSARY); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $39){ae=$39; - flag=(ae.getMessage()).equals("Rounding necessary"); - }/*rounn*/ - (new Test("div208")).ok=flag; - - try{div0:do{ - (new com.ibm.math.BigDecimal("5")).divide(new com.ibm.math.BigDecimal("0.00")); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $40){ae=$40; - flag=(ae.getMessage()).equals("Divide by 0"); - }/*div0*/ - (new Test("div209")).ok=flag; - - try{checkdigits:do{ - tenlong.divide(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $41){ae=$41; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("div210")).ok=flag; - try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.divide(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $42){ae=$42; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("div211")).ok=flag; - - summary("divide"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#divideInteger} method. */ - - public void diagdivideInteger(){ - boolean flag=false; - java.lang.ArithmeticException ae=null; - - (new Test("dvI001")).ok=((new com.ibm.math.BigDecimal("101.3")).divideInteger(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("101"); - (new Test("dvI002")).ok=((new com.ibm.math.BigDecimal("101.0")).divideInteger(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("101"); - (new Test("dvI003")).ok=((new com.ibm.math.BigDecimal("101.3")).divideInteger(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("33"); - (new Test("dvI004")).ok=((new com.ibm.math.BigDecimal("101.0")).divideInteger(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("33"); - (new Test("dvI005")).ok=((new com.ibm.math.BigDecimal("2.4")).divideInteger(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("2"); - (new Test("dvI006")).ok=((new com.ibm.math.BigDecimal("2.400")).divideInteger(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("2"); - (new Test("dvI007")).ok=((new com.ibm.math.BigDecimal("18")).divideInteger(new com.ibm.math.BigDecimal("18"),mcdef).toString()).equals("1"); - (new Test("dvI008")).ok=((new com.ibm.math.BigDecimal("1120")).divideInteger(new com.ibm.math.BigDecimal("1000"),mcdef).toString()).equals("1"); - (new Test("dvI009")).ok=((new com.ibm.math.BigDecimal("2.4")).divideInteger(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1"); - (new Test("dvI010")).ok=((new com.ibm.math.BigDecimal("2.400")).divideInteger(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1"); - (new Test("dvI011")).ok=((new com.ibm.math.BigDecimal("0.5")).divideInteger(new com.ibm.math.BigDecimal("2.000"),mcdef).toString()).equals("0"); - (new Test("dvI012")).ok=((new com.ibm.math.BigDecimal("8.005")).divideInteger(new com.ibm.math.BigDecimal("7"),mcdef).toString()).equals("1"); - (new Test("dvI013")).ok=((new com.ibm.math.BigDecimal("5")).divideInteger(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("2"); - (new Test("dvI014")).ok=((new com.ibm.math.BigDecimal("0")).divideInteger(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0"); - (new Test("dvI015")).ok=((new com.ibm.math.BigDecimal("0.00")).divideInteger(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0"); - // MC - (new Test("dvI016")).ok=((new com.ibm.math.BigDecimal("5")).divideInteger(new com.ibm.math.BigDecimal("2"),mce).toString()).equals("2"); - (new Test("dvI017")).ok=((new com.ibm.math.BigDecimal("5")).divideInteger(new com.ibm.math.BigDecimal("2"),mc6).toString()).equals("2"); - - // Fixed -- - (new Test("dvI021")).ok=((new com.ibm.math.BigDecimal("101.3")).divideInteger(new com.ibm.math.BigDecimal("1")).toString()).equals("101"); - (new Test("dvI022")).ok=((new com.ibm.math.BigDecimal("101.0")).divideInteger(new com.ibm.math.BigDecimal("1")).toString()).equals("101"); - (new Test("dvI023")).ok=((new com.ibm.math.BigDecimal("101.3")).divideInteger(new com.ibm.math.BigDecimal("3")).toString()).equals("33"); - (new Test("dvI024")).ok=((new com.ibm.math.BigDecimal("101.0")).divideInteger(new com.ibm.math.BigDecimal("3")).toString()).equals("33"); - (new Test("dvI025")).ok=((new com.ibm.math.BigDecimal("2.4")).divideInteger(new com.ibm.math.BigDecimal("1")).toString()).equals("2"); - (new Test("dvI026")).ok=((new com.ibm.math.BigDecimal("2.400")).divideInteger(new com.ibm.math.BigDecimal("1")).toString()).equals("2"); - (new Test("dvI027")).ok=((new com.ibm.math.BigDecimal("18")).divideInteger(new com.ibm.math.BigDecimal("18")).toString()).equals("1"); - (new Test("dvI028")).ok=((new com.ibm.math.BigDecimal("1120")).divideInteger(new com.ibm.math.BigDecimal("1000")).toString()).equals("1"); - (new Test("dvI029")).ok=((new com.ibm.math.BigDecimal("2.4")).divideInteger(new com.ibm.math.BigDecimal("2")).toString()).equals("1"); - (new Test("dvI030")).ok=((new com.ibm.math.BigDecimal("2.400")).divideInteger(new com.ibm.math.BigDecimal("2")).toString()).equals("1"); - (new Test("dvI031")).ok=((new com.ibm.math.BigDecimal("0.5")).divideInteger(new com.ibm.math.BigDecimal("2.000")).toString()).equals("0"); - (new Test("dvI032")).ok=((new com.ibm.math.BigDecimal("8.005")).divideInteger(new com.ibm.math.BigDecimal("7")).toString()).equals("1"); - (new Test("dvI033")).ok=((new com.ibm.math.BigDecimal("5")).divideInteger(new com.ibm.math.BigDecimal("2")).toString()).equals("2"); - (new Test("dvI034")).ok=((new com.ibm.math.BigDecimal("0")).divideInteger(new com.ibm.math.BigDecimal("2")).toString()).equals("0"); - (new Test("dvI035")).ok=((new com.ibm.math.BigDecimal("0.00")).divideInteger(new com.ibm.math.BigDecimal("2")).toString()).equals("0"); - - try{checknull:do{ - ten.divideInteger((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $43){ - flag=true; - }/*checknull*/ - (new Test("dvI101")).ok=flag; - try{checknull2:do{ - ten.divideInteger(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $44){ - flag=true; - }/*checknull2*/ - (new Test("dvI102")).ok=flag; - - try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.divideInteger(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $45){ae=$45; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("dvI103")).ok=flag; - - try{checkdigits:do{ - tenlong.divideInteger(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $46){ae=$46; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("dvI104")).ok=flag; - - summary("divideInteger"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#max} method. */ - - public void diagmax(){ - boolean flag=false; - java.lang.ArithmeticException ae=null; - - // we assume add/subtract test function; this and min just - // test existence and test the truth table - (new Test("max001")).ok=((new com.ibm.math.BigDecimal("5")).max(new com.ibm.math.BigDecimal("2")).toString()).equals("5"); - (new Test("max002")).ok=((new com.ibm.math.BigDecimal("5")).max(new com.ibm.math.BigDecimal("5")).toString()).equals("5"); - (new Test("max003")).ok=((new com.ibm.math.BigDecimal("2")).max(new com.ibm.math.BigDecimal("7")).toString()).equals("7"); - (new Test("max004")).ok=((new com.ibm.math.BigDecimal("2")).max(new com.ibm.math.BigDecimal("7"),mcdef).toString()).equals("7"); - (new Test("max005")).ok=((new com.ibm.math.BigDecimal("2")).max(new com.ibm.math.BigDecimal("7"),mc6).toString()).equals("7"); - (new Test("max006")).ok=((new com.ibm.math.BigDecimal("2E+3")).max(new com.ibm.math.BigDecimal("7")).toString()).equals("2000"); - (new Test("max007")).ok=((new com.ibm.math.BigDecimal("2E+3")).max(new com.ibm.math.BigDecimal("7"),mc3).toString()).equals("2E+3"); - (new Test("max008")).ok=((new com.ibm.math.BigDecimal("7")).max(new com.ibm.math.BigDecimal("2E+3")).toString()).equals("2000"); - (new Test("max009")).ok=((new com.ibm.math.BigDecimal("7")).max(new com.ibm.math.BigDecimal("2E+3"),mc3).toString()).equals("2E+3"); - try{checknull:do{ - ten.max((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $47){ - flag=true; - }/*checknull*/ - (new Test("max010")).ok=flag; - try{checknull2:do{ - ten.max(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $48){ - flag=true; - }/*checknull2*/ - (new Test("max011")).ok=flag; - try{checkdigits:do{ - tenlong.max(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $49){ae=$49; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("max012")).ok=flag; - try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.max(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $50){ae=$50; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("max013")).ok=flag; - summary("max"); - return;} - - /** Test the {@link BigDecimal#min} method. */ - - public void diagmin(){ - boolean flag=false; - com.ibm.math.BigDecimal minx=null; - java.lang.ArithmeticException ae=null; - // we assume add/subtract test function; this and max just - // test existence and test the truth table - - (new Test("min001")).ok=((new com.ibm.math.BigDecimal("5")).min(new com.ibm.math.BigDecimal("2")).toString()).equals("2"); - (new Test("min002")).ok=((new com.ibm.math.BigDecimal("5")).min(new com.ibm.math.BigDecimal("5")).toString()).equals("5"); - (new Test("min003")).ok=((new com.ibm.math.BigDecimal("2")).min(new com.ibm.math.BigDecimal("7")).toString()).equals("2"); - (new Test("min004")).ok=((new com.ibm.math.BigDecimal("2")).min(new com.ibm.math.BigDecimal("7"),mcdef).toString()).equals("2"); - (new Test("min005")).ok=((new com.ibm.math.BigDecimal("1")).min(new com.ibm.math.BigDecimal("7"),mc6).toString()).equals("1"); - (new Test("min006")).ok=((new com.ibm.math.BigDecimal("-2E+3")).min(new com.ibm.math.BigDecimal("7")).toString()).equals("-2000"); - (new Test("min007")).ok=((new com.ibm.math.BigDecimal("-2E+3")).min(new com.ibm.math.BigDecimal("7"),mc3).toString()).equals("-2E+3"); - (new Test("min008")).ok=((new com.ibm.math.BigDecimal("7")).min(new com.ibm.math.BigDecimal("-2E+3")).toString()).equals("-2000"); - (new Test("min009")).ok=((new com.ibm.math.BigDecimal("7")).min(new com.ibm.math.BigDecimal("-2E+3"),mc3).toString()).equals("-2E+3"); - try{checknull:do{ - minx=ten; - minx.min((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $51){ - flag=true; - }/*checknull*/ - (new Test("min010")).ok=flag; - try{checknull2:do{ - minx=ten; - minx.min(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $52){ - flag=true; - }/*checknull2*/ - (new Test("min011")).ok=flag; - - try{checkdigits:do{ - tenlong.min(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $53){ae=$53; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("min012")).ok=flag; - try{checkdigits:do{ - (new com.ibm.math.BigDecimal(9)).min(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $54){ae=$54; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("min013")).ok=flag; - summary("min"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#multiply} method. */ - - public void diagmultiply(){ - boolean flag=false; - com.ibm.math.BigDecimal l9; - com.ibm.math.BigDecimal l77e; - com.ibm.math.BigDecimal l12345; - com.ibm.math.BigDecimal edge; - com.ibm.math.BigDecimal tenedge; - com.ibm.math.BigDecimal hunedge; - com.ibm.math.BigDecimal opo; - com.ibm.math.BigDecimal d1=null; - com.ibm.math.BigDecimal d2=null; - java.lang.ArithmeticException oe=null; - java.lang.ArithmeticException ae=null; - - (new Test("mul001")).ok=((new com.ibm.math.BigDecimal("2")).multiply(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("6"); - (new Test("mul002")).ok=((new com.ibm.math.BigDecimal("5")).multiply(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("5"); - (new Test("mul003")).ok=((new com.ibm.math.BigDecimal("5")).multiply(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("10"); - (new Test("mul004")).ok=((new com.ibm.math.BigDecimal("1.20")).multiply(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("2.40"); - (new Test("mul005")).ok=((new com.ibm.math.BigDecimal("1.20")).multiply(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("0"); - (new Test("mul006")).ok=((new com.ibm.math.BigDecimal("1.20")).multiply(new com.ibm.math.BigDecimal("-2"),mcdef).toString()).equals("-2.40"); - (new Test("mul007")).ok=((new com.ibm.math.BigDecimal("-1.20")).multiply(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("-2.40"); - (new Test("mul008")).ok=((new com.ibm.math.BigDecimal("-1.20")).multiply(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("0"); - (new Test("mul009")).ok=((new com.ibm.math.BigDecimal("-1.20")).multiply(new com.ibm.math.BigDecimal("-2"),mcdef).toString()).equals("2.40"); - (new Test("mul010")).ok=((new com.ibm.math.BigDecimal("5.09")).multiply(new com.ibm.math.BigDecimal("7.1"),mcdef).toString()).equals("36.139"); - (new Test("mul011")).ok=((new com.ibm.math.BigDecimal("2.5")).multiply(new com.ibm.math.BigDecimal("4"),mcdef).toString()).equals("10.0"); - (new Test("mul012")).ok=((new com.ibm.math.BigDecimal("2.50")).multiply(new com.ibm.math.BigDecimal("4"),mcdef).toString()).equals("10.00"); - (new Test("mul013")).ok=((new com.ibm.math.BigDecimal("1.23456789")).multiply(new com.ibm.math.BigDecimal("1.00000000"),mcdef).toString()).equals("1.23456789"); - - (new Test("mul014")).ok=((new com.ibm.math.BigDecimal("9.999999999")).multiply(new com.ibm.math.BigDecimal("9.999999999"),mcdef).toString()).equals("100.000000"); - - (new Test("mul015")).ok=((new com.ibm.math.BigDecimal("2.50")).multiply(new com.ibm.math.BigDecimal("4"),mcdef).toString()).equals("10.00"); - (new Test("mul016")).ok=((new com.ibm.math.BigDecimal("2.50")).multiply(new com.ibm.math.BigDecimal("4"),mc6).toString()).equals("10.00"); - (new Test("mul017")).ok=((new com.ibm.math.BigDecimal("9.999999999")).multiply(new com.ibm.math.BigDecimal("9.999999999"),mc6).toString()).equals("100.000"); - - - (new Test("mul020")).ok=((new com.ibm.math.BigDecimal("2")).multiply(new com.ibm.math.BigDecimal("3")).toString()).equals("6"); - (new Test("mul021")).ok=((new com.ibm.math.BigDecimal("5")).multiply(new com.ibm.math.BigDecimal("1")).toString()).equals("5"); - (new Test("mul022")).ok=((new com.ibm.math.BigDecimal("5")).multiply(new com.ibm.math.BigDecimal("2")).toString()).equals("10"); - (new Test("mul023")).ok=((new com.ibm.math.BigDecimal("1.20")).multiply(new com.ibm.math.BigDecimal("2")).toString()).equals("2.40"); - (new Test("mul024")).ok=((new com.ibm.math.BigDecimal("1.20")).multiply(new com.ibm.math.BigDecimal("0")).toString()).equals("0.00"); - (new Test("mul025")).ok=((new com.ibm.math.BigDecimal("1.20")).multiply(new com.ibm.math.BigDecimal("-2")).toString()).equals("-2.40"); - (new Test("mul026")).ok=((new com.ibm.math.BigDecimal("-1.20")).multiply(new com.ibm.math.BigDecimal("2")).toString()).equals("-2.40"); - (new Test("mul027")).ok=((new com.ibm.math.BigDecimal("-1.20")).multiply(new com.ibm.math.BigDecimal("0")).toString()).equals("0.00"); - (new Test("mul028")).ok=((new com.ibm.math.BigDecimal("-1.20")).multiply(new com.ibm.math.BigDecimal("-2")).toString()).equals("2.40"); - (new Test("mul029")).ok=((new com.ibm.math.BigDecimal("5.09")).multiply(new com.ibm.math.BigDecimal("7.1")).toString()).equals("36.139"); - (new Test("mul030")).ok=((new com.ibm.math.BigDecimal("2.5")).multiply(new com.ibm.math.BigDecimal("4")).toString()).equals("10.0"); - (new Test("mul031")).ok=((new com.ibm.math.BigDecimal("2.50")).multiply(new com.ibm.math.BigDecimal("4")).toString()).equals("10.00"); - (new Test("mul032")).ok=((new com.ibm.math.BigDecimal("1.23456789")).multiply(new com.ibm.math.BigDecimal("1.00000000")).toString()).equals("1.2345678900000000"); - - (new Test("mul033")).ok=((new com.ibm.math.BigDecimal("1234.56789")).multiply(new com.ibm.math.BigDecimal("-1000.00000")).toString()).equals("-1234567.8900000000"); - - (new Test("mul034")).ok=((new com.ibm.math.BigDecimal("-1234.56789")).multiply(new com.ibm.math.BigDecimal("1000.00000")).toString()).equals("-1234567.8900000000"); - - (new Test("mul035")).ok=((new com.ibm.math.BigDecimal("9.999999999")).multiply(new com.ibm.math.BigDecimal("9.999999999")).toString()).equals("99.999999980000000001"); - - (new Test("mul036")).ok=((new com.ibm.math.BigDecimal("5.00")).multiply(new com.ibm.math.BigDecimal("1E-3")).toString()).equals("0.00500"); - (new Test("mul037")).ok=((new com.ibm.math.BigDecimal("00.00")).multiply(new com.ibm.math.BigDecimal("0.000")).toString()).equals("0.00000"); - (new Test("mul038")).ok=((new com.ibm.math.BigDecimal("00.00")).multiply(new com.ibm.math.BigDecimal("0E-3")).toString()).equals("0.00"); // rhs is '0' - // 1999.12.21: next one is a edge case if intermediate longs are used - (new Test("mul039")).ok=((new com.ibm.math.BigDecimal("999999999999")).multiply(new com.ibm.math.BigDecimal("9765625")).toString()).equals("9765624999990234375"); - - l9=new com.ibm.math.BigDecimal("123456789E+10"); - l77e=new com.ibm.math.BigDecimal("77E-20"); - (new Test("mul040")).ok=(l9.multiply(new com.ibm.math.BigDecimal("3456757")).toString()).equals("4267601195732730000000000"); - (new Test("mul041")).ok=(l9.multiply(new com.ibm.math.BigDecimal("3456757"),mc3).toString()).equals("4.26E+24"); - (new Test("mul042")).ok=(l9.multiply(l77e).toString()).equals("0.95061727530000000000"); - (new Test("mul043")).ok=(l9.multiply(l77e,mc3).toString()).equals("0.947"); - (new Test("mul044")).ok=(l77e.multiply(l9,mc3).toString()).equals("0.947"); - - l12345=new com.ibm.math.BigDecimal("123.45"); - (new Test("mul050")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e11"),mcdef).toString()).equals("1.2345E+13"); - (new Test("mul051")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e11"),mcs).toString()).equals("1.2345E+13"); - (new Test("mul052")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e+9"),mce).toString()).equals("123.45E+9"); - (new Test("mul053")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e10"),mce).toString()).equals("1.2345E+12"); - (new Test("mul054")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e11"),mce).toString()).equals("12.345E+12"); - (new Test("mul055")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e12"),mce).toString()).equals("123.45E+12"); - (new Test("mul056")).ok=(l12345.multiply(new com.ibm.math.BigDecimal("1e13"),mce).toString()).equals("1.2345E+15"); - - // test some cases that are close to exponent overflow - (new Test("mul060")).ok=(one.multiply(new com.ibm.math.BigDecimal("9e999999999"),mcs).toString()).equals("9E+999999999"); - (new Test("mul061")).ok=(one.multiply(new com.ibm.math.BigDecimal("9.9e999999999"),mcs).toString()).equals("9.9E+999999999"); - (new Test("mul062")).ok=(one.multiply(new com.ibm.math.BigDecimal("9.99e999999999"),mcs).toString()).equals("9.99E+999999999"); - (new Test("mul063")).ok=(ten.multiply(new com.ibm.math.BigDecimal("9e999999999"),mce).toString()).equals("90E+999999999"); - (new Test("mul064")).ok=(ten.multiply(new com.ibm.math.BigDecimal("9.9e999999999"),mce).toString()).equals("99.0E+999999999"); - edge=new com.ibm.math.BigDecimal("9.999e999999999"); - tenedge=ten.multiply(edge,mce); - (new Test("mul065")).ok=(tenedge.toString()).equals("99.990E+999999999"); - hunedge=ten.multiply(tenedge,mce); - (new Test("mul066")).ok=(hunedge.toString()).equals("999.900E+999999999"); - opo=new com.ibm.math.BigDecimal("0.1"); // one tenth - (new Test("mul067")).ok=(opo.multiply(new com.ibm.math.BigDecimal("9e-999999998"),mcs).toString()).equals("9E-999999999"); - (new Test("mul068")).ok=(opo.multiply(new com.ibm.math.BigDecimal("99e-999999998"),mcs).toString()).equals("9.9E-999999998"); - (new Test("mul069")).ok=(opo.multiply(new com.ibm.math.BigDecimal("999e-999999998"),mcs).toString()).equals("9.99E-999999997"); - - (new Test("mul070")).ok=(opo.multiply(new com.ibm.math.BigDecimal("9e-999999998"),mce).toString()).equals("9E-999999999"); - (new Test("mul071")).ok=(opo.multiply(new com.ibm.math.BigDecimal("99e-999999998"),mce).toString()).equals("99E-999999999"); - (new Test("mul072")).ok=(opo.multiply(new com.ibm.math.BigDecimal("999e-999999998"),mce).toString()).equals("999E-999999999"); - (new Test("mul073")).ok=(opo.multiply(new com.ibm.math.BigDecimal("999e-999999997"),mce).toString()).equals("9.99E-999999996"); - (new Test("mul074")).ok=(opo.multiply(new com.ibm.math.BigDecimal("9999e-999999997"),mce).toString()).equals("99.99E-999999996"); - (new Test("mul074")).ok=(opo.multiply(new com.ibm.math.BigDecimal("99999e-999999997"),mce).toString()).equals("999.99E-999999996"); - - // test some intermediate lengths - (new Test("mul080")).ok=(opo.multiply(new com.ibm.math.BigDecimal("123456789"),mcs).toString()).equals("12345678.9"); - (new Test("mul081")).ok=(opo.multiply(new com.ibm.math.BigDecimal("12345678901234"),mcs).toString()).equals("1.23456789E+12"); - (new Test("mul082")).ok=(opo.multiply(new com.ibm.math.BigDecimal("123456789123456789"),mcs).toString()).equals("1.23456789E+16"); - (new Test("mul083")).ok=(opo.multiply(new com.ibm.math.BigDecimal("123456789"),mcfd).toString()).equals("12345678.9"); - (new Test("mul084")).ok=(opo.multiply(new com.ibm.math.BigDecimal("12345678901234"),mcfd).toString()).equals("1234567890123.4"); - (new Test("mul085")).ok=(opo.multiply(new com.ibm.math.BigDecimal("123456789123456789"),mcfd).toString()).equals("12345678912345678.9"); - - (new Test("mul090")).ok=((new com.ibm.math.BigDecimal("123456789")).multiply(opo,mcs).toString()).equals("12345678.9"); - (new Test("mul091")).ok=((new com.ibm.math.BigDecimal("12345678901234")).multiply(opo,mcs).toString()).equals("1.23456789E+12"); - (new Test("mul092")).ok=((new com.ibm.math.BigDecimal("123456789123456789")).multiply(opo,mcs).toString()).equals("1.23456789E+16"); - (new Test("mul093")).ok=((new com.ibm.math.BigDecimal("123456789")).multiply(opo,mcfd).toString()).equals("12345678.9"); - (new Test("mul094")).ok=((new com.ibm.math.BigDecimal("12345678901234")).multiply(opo,mcfd).toString()).equals("1234567890123.4"); - (new Test("mul095")).ok=((new com.ibm.math.BigDecimal("123456789123456789")).multiply(opo,mcfd).toString()).equals("12345678912345678.9"); - - // test some more edge cases and carries - (new Test("mul101")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9")).toString()).equals("81"); - (new Test("mul102")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90")).toString()).equals("810"); - (new Test("mul103")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900")).toString()).equals("8100"); - (new Test("mul104")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000")).toString()).equals("81000"); - (new Test("mul105")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000")).toString()).equals("810000"); - (new Test("mul106")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900000")).toString()).equals("8100000"); - (new Test("mul107")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000000")).toString()).equals("81000000"); - (new Test("mul108")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000000")).toString()).equals("810000000"); - (new Test("mul109")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900000000")).toString()).equals("8100000000"); - (new Test("mul110")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000000000")).toString()).equals("81000000000"); - (new Test("mul111")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000000000")).toString()).equals("810000000000"); - (new Test("mul112")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900000000000")).toString()).equals("8100000000000"); - (new Test("mul113")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000000000000")).toString()).equals("81000000000000"); - (new Test("mul114")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000000000000")).toString()).equals("810000000000000"); - (new Test("mul115")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900000000000000")).toString()).equals("8100000000000000"); - (new Test("mul116")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000000000000000")).toString()).equals("81000000000000000"); - (new Test("mul117")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000000000000000")).toString()).equals("810000000000000000"); - (new Test("mul118")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900000000000000000")).toString()).equals("8100000000000000000"); - (new Test("mul119")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000000000000000000")).toString()).equals("81000000000000000000"); - (new Test("mul120")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000000000000000000")).toString()).equals("810000000000000000000"); - (new Test("mul121")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("900000000000000000000")).toString()).equals("8100000000000000000000"); - (new Test("mul122")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("9000000000000000000000")).toString()).equals("81000000000000000000000"); - (new Test("mul123")).ok=((new com.ibm.math.BigDecimal("9")).multiply(new com.ibm.math.BigDecimal("90000000000000000000000")).toString()).equals("810000000000000000000000"); - // test some more edge cases without carries - (new Test("mul131")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3")).toString()).equals("9"); - (new Test("mul132")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30")).toString()).equals("90"); - (new Test("mul133")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300")).toString()).equals("900"); - (new Test("mul134")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000")).toString()).equals("9000"); - (new Test("mul135")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000")).toString()).equals("90000"); - (new Test("mul136")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300000")).toString()).equals("900000"); - (new Test("mul137")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000000")).toString()).equals("9000000"); - (new Test("mul138")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000000")).toString()).equals("90000000"); - (new Test("mul139")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300000000")).toString()).equals("900000000"); - (new Test("mul140")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000000000")).toString()).equals("9000000000"); - (new Test("mul141")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000000000")).toString()).equals("90000000000"); - (new Test("mul142")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300000000000")).toString()).equals("900000000000"); - (new Test("mul143")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000000000000")).toString()).equals("9000000000000"); - (new Test("mul144")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000000000000")).toString()).equals("90000000000000"); - (new Test("mul145")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300000000000000")).toString()).equals("900000000000000"); - (new Test("mul146")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000000000000000")).toString()).equals("9000000000000000"); - (new Test("mul147")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000000000000000")).toString()).equals("90000000000000000"); - (new Test("mul148")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300000000000000000")).toString()).equals("900000000000000000"); - (new Test("mul149")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000000000000000000")).toString()).equals("9000000000000000000"); - (new Test("mul150")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000000000000000000")).toString()).equals("90000000000000000000"); - (new Test("mul151")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("300000000000000000000")).toString()).equals("900000000000000000000"); - (new Test("mul152")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("3000000000000000000000")).toString()).equals("9000000000000000000000"); - (new Test("mul153")).ok=((new com.ibm.math.BigDecimal("3")).multiply(new com.ibm.math.BigDecimal("30000000000000000000000")).toString()).equals("90000000000000000000000"); - - try{checknull:do{ - ten.multiply((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $55){ - flag=true; - }/*checknull*/ - (new Test("mul200")).ok=flag; - try{checknull2:do{ - ten.multiply(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $56){ - flag=true; - }/*checknull2*/ - (new Test("mul201")).ok=flag; - - try{checkover:do{ - d1=new com.ibm.math.BigDecimal("-1.23456789012345E-0"); - d2=new com.ibm.math.BigDecimal("9E+999999999"); - d1.multiply(d2,mcdef); // marginal overflow - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $57){oe=$57; - flag=(oe.getMessage()).equals("Exponent Overflow: 1000000000"); - }/*checkover*/ - (new Test("mul202")).ok=flag; - try{checkover:do{ - d1=new com.ibm.math.BigDecimal("112"); - d2=new com.ibm.math.BigDecimal("9E+999999999"); - d1.multiply(d2,mce); // marginal overflow, engineering - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $58){oe=$58; - flag=(oe.getMessage()).equals("Exponent Overflow: 1000000002"); - }/*checkover*/ - (new Test("mul203")).ok=flag; - - try{checkover:do{ - d1=new com.ibm.math.BigDecimal("0.9"); - d2=new com.ibm.math.BigDecimal("1E-999999999"); - d1.multiply(d2,mcdef); // marginal negative overflow - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $59){oe=$59; - flag=(oe.getMessage()).equals("Exponent Overflow: -1000000000"); - }/*checkover*/ - (new Test("mul204")).ok=flag; - try{checkover:do{ - d1=new com.ibm.math.BigDecimal("0.9"); - d2=new com.ibm.math.BigDecimal("1E-999999999"); - d1.multiply(d2,mce); // marginal negative overflow, engineering - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $60){oe=$60; - flag=(oe.getMessage()).equals("Exponent Overflow: -1000000002"); - }/*checkover*/ - (new Test("mul205")).ok=flag; - - try{checkdigits:do{ - tenlong.multiply(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $61){ae=$61; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("mul206")).ok=flag; - try{checkdigits:do{ - com.ibm.math.BigDecimal.TEN.multiply(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $62){ae=$62; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("mul207")).ok=flag; - - summary("multiply"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#negate} method. */ - - public void diagnegate(){ - boolean flag=false; - java.lang.ArithmeticException ae=null; - - (new Test("neg001")).ok=((new com.ibm.math.BigDecimal("2")).negate().toString()).equals("-2"); - (new Test("neg002")).ok=((new com.ibm.math.BigDecimal("-2")).negate().toString()).equals("2"); - (new Test("neg003")).ok=((new com.ibm.math.BigDecimal("2.00")).negate(mcdef).toString()).equals("-2.00"); - (new Test("neg004")).ok=((new com.ibm.math.BigDecimal("-2.00")).negate(mcdef).toString()).equals("2.00"); - (new Test("neg005")).ok=((new com.ibm.math.BigDecimal("0")).negate(mcdef).toString()).equals("0"); - (new Test("neg006")).ok=((new com.ibm.math.BigDecimal("0.00")).negate(mcdef).toString()).equals("0"); - (new Test("neg007")).ok=((new com.ibm.math.BigDecimal("00.0")).negate(mcdef).toString()).equals("0"); - (new Test("neg008")).ok=((new com.ibm.math.BigDecimal("00")).negate(mcdef).toString()).equals("0"); - - (new Test("neg010")).ok=((new com.ibm.math.BigDecimal("2.00")).negate().toString()).equals("-2.00"); - (new Test("neg011")).ok=((new com.ibm.math.BigDecimal("-2.00")).negate().toString()).equals("2.00"); - (new Test("neg012")).ok=((new com.ibm.math.BigDecimal("0")).negate().toString()).equals("0"); - (new Test("neg013")).ok=((new com.ibm.math.BigDecimal("0.00")).negate().toString()).equals("0.00"); - (new Test("neg014")).ok=((new com.ibm.math.BigDecimal("00.0")).negate().toString()).equals("0.0"); - (new Test("neg015")).ok=((new com.ibm.math.BigDecimal("00.00")).negate().toString()).equals("0.00"); - (new Test("neg016")).ok=((new com.ibm.math.BigDecimal("00")).negate().toString()).equals("0"); - - (new Test("neg020")).ok=((new com.ibm.math.BigDecimal("-2000000")).negate().toString()).equals("2000000"); - (new Test("neg021")).ok=((new com.ibm.math.BigDecimal("-2000000")).negate(mcdef).toString()).equals("2000000"); - (new Test("neg022")).ok=((new com.ibm.math.BigDecimal("-2000000")).negate(mc6).toString()).equals("2.00000E+6"); - (new Test("neg023")).ok=((new com.ibm.math.BigDecimal("2000000")).negate(mc6).toString()).equals("-2.00000E+6"); - - try{checknull:do{ - ten.negate((com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $63){ - flag=true; - }/*checknull*/ - (new Test("neg100")).ok=flag; - - try{checkdigits:do{ - tenlong.negate(mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $64){ae=$64; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("neg101")).ok=flag; - summary("negate"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#plus} method. */ - - public void diagplus(){ - boolean flag=false; - com.ibm.math.MathContext mche1; - java.lang.ArithmeticException ae=null; - - (new Test("plu001")).ok=((new com.ibm.math.BigDecimal("2")).plus(mcdef).toString()).equals("2"); - (new Test("plu002")).ok=((new com.ibm.math.BigDecimal("-2")).plus(mcdef).toString()).equals("-2"); - (new Test("plu003")).ok=((new com.ibm.math.BigDecimal("2.00")).plus(mcdef).toString()).equals("2.00"); - (new Test("plu004")).ok=((new com.ibm.math.BigDecimal("-2.00")).plus(mcdef).toString()).equals("-2.00"); - (new Test("plu005")).ok=((new com.ibm.math.BigDecimal("0")).plus(mcdef).toString()).equals("0"); - (new Test("plu006")).ok=((new com.ibm.math.BigDecimal("0.00")).plus(mcdef).toString()).equals("0"); - (new Test("plu007")).ok=((new com.ibm.math.BigDecimal("00.0")).plus(mcdef).toString()).equals("0"); - (new Test("plu008")).ok=((new com.ibm.math.BigDecimal("00")).plus(mcdef).toString()).equals("0"); - - (new Test("plu010")).ok=((new com.ibm.math.BigDecimal("2")).plus().toString()).equals("2"); - (new Test("plu011")).ok=((new com.ibm.math.BigDecimal("-2")).plus().toString()).equals("-2"); - (new Test("plu012")).ok=((new com.ibm.math.BigDecimal("2.00")).plus().toString()).equals("2.00"); - (new Test("plu013")).ok=((new com.ibm.math.BigDecimal("-2.00")).plus().toString()).equals("-2.00"); - (new Test("plu014")).ok=((new com.ibm.math.BigDecimal("0")).plus().toString()).equals("0"); - (new Test("plu015")).ok=((new com.ibm.math.BigDecimal("0.00")).plus().toString()).equals("0.00"); - (new Test("plu016")).ok=((new com.ibm.math.BigDecimal("00.0")).plus().toString()).equals("0.0"); - (new Test("plu017")).ok=((new com.ibm.math.BigDecimal("00.00")).plus().toString()).equals("0.00"); - (new Test("plu018")).ok=((new com.ibm.math.BigDecimal("00")).plus().toString()).equals("0"); - - (new Test("plu020")).ok=((new com.ibm.math.BigDecimal("-2000000")).plus().toString()).equals("-2000000"); - (new Test("plu021")).ok=((new com.ibm.math.BigDecimal("-2000000")).plus(mcdef).toString()).equals("-2000000"); - (new Test("plu022")).ok=((new com.ibm.math.BigDecimal("-2000000")).plus(mc6).toString()).equals("-2.00000E+6"); - (new Test("plu023")).ok=((new com.ibm.math.BigDecimal("2000000")).plus(mc6).toString()).equals("2.00000E+6"); - - // try some exotic but silly rounding [format checks more varieties] - // [this mostly ensures we can set up and pass the setting] - mche1=new com.ibm.math.MathContext(1,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_HALF_EVEN); - (new Test("plu030")).ok=((new com.ibm.math.BigDecimal("0.24")).plus(mche1).toString()).equals("0.2"); - (new Test("plu031")).ok=((new com.ibm.math.BigDecimal("0.25")).plus(mche1).toString()).equals("0.2"); - (new Test("plu032")).ok=((new com.ibm.math.BigDecimal("0.26")).plus(mche1).toString()).equals("0.3"); - (new Test("plu033")).ok=((new com.ibm.math.BigDecimal("0.14")).plus(mche1).toString()).equals("0.1"); - (new Test("plu034")).ok=((new com.ibm.math.BigDecimal("0.15")).plus(mche1).toString()).equals("0.2"); - (new Test("plu035")).ok=((new com.ibm.math.BigDecimal("0.16")).plus(mche1).toString()).equals("0.2"); - - (new Test("plu040")).ok=((new com.ibm.math.BigDecimal("0.251")).plus(mche1).toString()).equals("0.3"); - (new Test("plu041")).ok=((new com.ibm.math.BigDecimal("0.151")).plus(mche1).toString()).equals("0.2"); - - (new Test("plu050")).ok=((new com.ibm.math.BigDecimal("-0.24")).plus(mche1).toString()).equals("-0.2"); - (new Test("plu051")).ok=((new com.ibm.math.BigDecimal("-0.25")).plus(mche1).toString()).equals("-0.2"); - (new Test("plu052")).ok=((new com.ibm.math.BigDecimal("-0.26")).plus(mche1).toString()).equals("-0.3"); - (new Test("plu053")).ok=((new com.ibm.math.BigDecimal("-0.14")).plus(mche1).toString()).equals("-0.1"); - (new Test("plu054")).ok=((new com.ibm.math.BigDecimal("-0.15")).plus(mche1).toString()).equals("-0.2"); - (new Test("plu055")).ok=((new com.ibm.math.BigDecimal("-0.16")).plus(mche1).toString()).equals("-0.2"); - - // more fixed, potential LHS swaps if done by add 0 - (new Test("plu060")).ok=((new com.ibm.math.BigDecimal("-56267E-10")).plus().toString()).equals("-0.0000056267"); - (new Test("plu061")).ok=((new com.ibm.math.BigDecimal("-56267E-5")).plus().toString()).equals("-0.56267"); - (new Test("plu062")).ok=((new com.ibm.math.BigDecimal("-56267E-2")).plus().toString()).equals("-562.67"); - (new Test("plu063")).ok=((new com.ibm.math.BigDecimal("-56267E-1")).plus().toString()).equals("-5626.7"); - (new Test("plu065")).ok=((new com.ibm.math.BigDecimal("-56267E-0")).plus().toString()).equals("-56267"); - - try{checknull:do{ - ten.plus((com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $65){ - flag=true; - }/*checknull*/ - (new Test("plu100")).ok=flag; - - try{checkdigits:do{ - tenlong.plus(mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $66){ae=$66; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("plu101")).ok=flag; - summary("plus"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#pow} method. */ - - public void diagpow(){ - boolean flag; - com.ibm.math.BigDecimal x; - com.ibm.math.BigDecimal temp; - int n=0; - com.ibm.math.BigDecimal vx; - com.ibm.math.BigDecimal vn; - java.lang.ArithmeticException ae=null; - flag=true; - (new Test("pow001")).ok="1".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("0"),mcdef).toString()); - (new Test("pow002")).ok="0.3".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("1"),mcdef).toString()); - (new Test("pow003")).ok="0.3".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("1.00"),mcdef).toString()); - (new Test("pow004")).ok="0.09".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("2.00"),mcdef).toString()); - (new Test("pow005")).ok="0.09".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("2.000000000"),mcdef).toString()); - (new Test("pow006")).ok=("1E-8").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-8"),mcdef).toString()); - (new Test("pow007")).ok=("1E-7").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-7"),mcdef).toString()); - (new Test("pow008")).ok="0.000001".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-6"),mcdef).toString()); - (new Test("pow009")).ok="0.00001".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-5"),mcdef).toString()); - (new Test("pow010")).ok="0.0001".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-4"),mcdef).toString()); - (new Test("pow011")).ok="0.001".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-3"),mcdef).toString()); - (new Test("pow012")).ok="0.01".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-2"),mcdef).toString()); - (new Test("pow013")).ok="0.1".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-1"),mcdef).toString()); - (new Test("pow014")).ok="1".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("0"),mcdef).toString()); - (new Test("pow015")).ok="10".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("1"),mcdef).toString()); - (new Test("pow016")).ok="100000000".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("8"),mcdef).toString()); - (new Test("pow017")).ok=("1E+9").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("9"),mcdef).toString()); - (new Test("pow018")).ok=("1E+99").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("99"),mcdef).toString()); - (new Test("pow019")).ok=("1E+999999999").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("999999999"),mcdef).toString()); - (new Test("pow020")).ok=("1E+999999998").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("999999998"),mcdef).toString()); - (new Test("pow021")).ok=("1E+999999997").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("999999997"),mcdef).toString()); - (new Test("pow022")).ok=("1E+333333333").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("333333333"),mcdef).toString()); - (new Test("pow023")).ok=("1E-333333333").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-333333333"),mcdef).toString()); - (new Test("pow024")).ok=("1E-999999998").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-999999998"),mcdef).toString()); - (new Test("pow025")).ok=("1E-999999999").equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-999999999"),mcdef).toString()); - (new Test("pow026")).ok="0.5".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("-1"),mcdef).toString()); - (new Test("pow027")).ok="0.25".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("-2"),mcdef).toString()); - (new Test("pow028")).ok="0.0625".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("-4"),mcdef).toString()); - - (new Test("pow050")).ok=((new com.ibm.math.BigDecimal("0")).pow(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("1"); - (new Test("pow051")).ok=((new com.ibm.math.BigDecimal("0")).pow(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("0"); - (new Test("pow052")).ok=((new com.ibm.math.BigDecimal("0")).pow(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0"); - (new Test("pow053")).ok=((new com.ibm.math.BigDecimal("1")).pow(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("1"); - (new Test("pow054")).ok=((new com.ibm.math.BigDecimal("1")).pow(new com.ibm.math.BigDecimal("1"),mcdef).toString()).equals("1"); - (new Test("pow055")).ok=((new com.ibm.math.BigDecimal("1")).pow(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1"); - (new Test("pow056")).ok=((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("1"); - (new Test("pow057")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("999999999"),mcdef).toString()).equals("1E+999999999"); - (new Test("pow058")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("999999998"),mcdef).toString()).equals("1E+999999998"); - (new Test("pow059")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("999999997"),mcdef).toString()).equals("1E+999999997"); - (new Test("pow060")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("333333333"),mcdef).toString()).equals("1E+333333333"); - (new Test("pow061")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("77"),mcdef).toString()).equals("1E+77"); - (new Test("pow062")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("22"),mcdef).toString()).equals("1E+22"); - (new Test("pow063")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-77"),mcdef).toString()).equals("1E-77"); - (new Test("pow064")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("-22"),mcdef).toString()).equals("1E-22"); - (new Test("pow065")).ok=((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("-1"),mcdef).toString()).equals("0.5"); - (new Test("pow066")).ok=((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("-2"),mcdef).toString()).equals("0.25"); - (new Test("pow067")).ok=((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("-4"),mcdef).toString()).equals("0.0625"); - (new Test("pow068")).ok=((new com.ibm.math.BigDecimal("6.0")).pow(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("36"); - (new Test("pow069")).ok=((new com.ibm.math.BigDecimal("-3")).pow(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("9");/* from book */ - (new Test("pow070")).ok=((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("2"),mcdef).pow(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("64");/* from book */ - - // 1998.12.14 Next test removed as pow() no longer rounds RHS [as per ANSI] - // Test('pow071').ok=BigDecimal('2').pow(BigDecimal('2.000000001'),mcdef).toString == '4'/* check input rounding */ - - /* General tests from original Rexx diagnostics */ - x=new com.ibm.math.BigDecimal("0.5"); - temp=com.ibm.math.BigDecimal.ONE; - flag=true; - {n=1;n:for(;n<=10;n++){ - temp=temp.multiply(x).divide(com.ibm.math.BigDecimal.ONE); - flag=flag&(x.pow(new com.ibm.math.BigDecimal(n),mcdef).toString()).equals(temp.toString()); - } - }/*n*/ - (new Test("pow080")).ok=flag; - - x=new com.ibm.math.BigDecimal("2"); - temp=com.ibm.math.BigDecimal.ONE; - flag=true; - {n=1;n:for(;n<=29;n++){ - temp=temp.multiply(x).divide(com.ibm.math.BigDecimal.ONE); - flag=flag&(x.pow(new com.ibm.math.BigDecimal(n),mcdef).toString()).equals(temp.toString()); - flag=flag&(x.pow(new com.ibm.math.BigDecimal((int)-n),mcdef).toString()).equals(com.ibm.math.BigDecimal.ONE.divide(temp,mcdef).toString()); - /* Note that rounding errors are possible for larger "n" */ - /* due to the information content of the exponent */ - } - }/*n*/ - (new Test("pow081")).ok=flag; - - /* The Vienna case. Checks both setup and 1/acc working precision */ - // Modified 1998.12.14 as RHS no longer rounded before use (must fit) - // Modified 1990.02.04 as LHS is now rounded (instead of truncated to guard) - vx=new com.ibm.math.BigDecimal("123456789E+10"); // lhs .. rounded to 1.23E+18 - vn=new com.ibm.math.BigDecimal("-1.23000e+2"); // rhs .. [was: -1.23455e+2, rounds to -123] - (new Test("pow090")).ok=(vx.pow(vn,mc3).toString()).equals("8.74E-2226"); - - //- fixed point versions --- - (new Test("pow101")).ok="1".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("0")).toString()); - (new Test("pow102")).ok="0.3".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("1")).toString()); - (new Test("pow103")).ok="0.3".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("1.00")).toString()); - (new Test("pow104")).ok="0.09".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("2")).toString()); - (new Test("pow105")).ok="0.09".equals((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("2.00")).toString()); - (new Test("pow106")).ok="10".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("1")).toString()); - (new Test("pow107")).ok="100000000".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("8")).toString()); - (new Test("pow108")).ok="1000000000".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("9")).toString()); - (new Test("pow109")).ok="10000000000".equals((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("10")).toString()); - (new Test("pow110")).ok="1".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("0")).toString()); - (new Test("pow111")).ok="16".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("4")).toString()); - (new Test("pow112")).ok="256".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("8")).toString()); - (new Test("pow113")).ok="1024".equals((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("10")).toString()); - (new Test("pow114")).ok="1.0510100501".equals((new com.ibm.math.BigDecimal("1.01")).pow(new com.ibm.math.BigDecimal("5")).toString()); - - (new Test("pow120")).ok=((new com.ibm.math.BigDecimal("0")).pow(new com.ibm.math.BigDecimal("0")).toString()).equals("1"); - (new Test("pow121")).ok=((new com.ibm.math.BigDecimal("0")).pow(new com.ibm.math.BigDecimal("1")).toString()).equals("0"); - (new Test("pow122")).ok=((new com.ibm.math.BigDecimal("0")).pow(new com.ibm.math.BigDecimal("2")).toString()).equals("0"); - (new Test("pow123")).ok=((new com.ibm.math.BigDecimal("1")).pow(new com.ibm.math.BigDecimal("0")).toString()).equals("1"); - (new Test("pow144")).ok=((new com.ibm.math.BigDecimal("1")).pow(new com.ibm.math.BigDecimal("1")).toString()).equals("1"); - (new Test("pow125")).ok=((new com.ibm.math.BigDecimal("1")).pow(new com.ibm.math.BigDecimal("2")).toString()).equals("1"); - (new Test("pow126")).ok=((new com.ibm.math.BigDecimal("0.3")).pow(new com.ibm.math.BigDecimal("0")).toString()).equals("1"); - (new Test("pow127")).ok=((new com.ibm.math.BigDecimal("10")).pow(new com.ibm.math.BigDecimal("7")).toString()).equals("10000000"); - (new Test("pow128")).ok=((new com.ibm.math.BigDecimal("6.0")).pow(new com.ibm.math.BigDecimal("2")).toString()).equals("36.00"); - (new Test("pow129")).ok=((new com.ibm.math.BigDecimal("6.00")).pow(new com.ibm.math.BigDecimal("2")).toString()).equals("36.0000"); - (new Test("pow130")).ok=((new com.ibm.math.BigDecimal("6.000")).pow(new com.ibm.math.BigDecimal("2")).toString()).equals("36.000000"); - (new Test("pow131")).ok=((new com.ibm.math.BigDecimal("-3")).pow(new com.ibm.math.BigDecimal("2")).toString()).equals("9"); - (new Test("pow132")).ok=((new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("2")).pow(new com.ibm.math.BigDecimal("3")).toString()).equals("64"); - - /* errors */ - try{checknull:do{ - ten.pow((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $67){ - flag=true; - }/*checknull*/ - (new Test("pow150")).ok=flag; - try{checknull2:do{ - ten.pow(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $68){ - flag=true; - }/*checknull2*/ - (new Test("pow151")).ok=flag; - - flag=true; - try{checkdigits:do{ - tenlong.pow(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $69){ae=$69; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("pow152")).ok=flag; - - try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.pow(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $70){ae=$70; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("pow153")).ok=flag; - - try{checkpos:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("-71")); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $71){ae=$71; - flag=(ae.getMessage()).equals("Negative power: -71"); - }/*checkpos*/ - (new Test("pow154")).ok=flag; - - try{checkwhole:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("1234"),mc3); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $72){ae=$72; - flag=(ae.getMessage()).equals("Too many digits: 1234"); - }/*checkwhole*/ - (new Test("pow155")).ok=flag; - - try{checkwhole1:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("12.34e+2"),mc3); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $73){ae=$73; - flag=(ae.getMessage()).equals("Too many digits: 1.234E+3"); - }/*checkwhole1*/ - (new Test("pow156")).ok=flag; - - try{checkwhole2:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("12.4"),mcdef); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $74){ae=$74; - flag=(ae.getMessage()).equals("Decimal part non-zero: 12.4"); - }/*checkwhole2*/ - (new Test("pow157")).ok=flag; - - try{checkwhole3:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("1.01"),mcdef); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $75){ae=$75; - flag=(ae.getMessage()).equals("Decimal part non-zero: 1.01"); - }/*checkwhole3*/ - (new Test("pow158")).ok=flag; - - try{checkwhole4:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("1.000000001"),mcdef); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $76){ae=$76; - flag=(ae.getMessage()).equals("Decimal part non-zero: 1.000000001"); - }/*checkwhole4*/ - (new Test("pow159")).ok=flag; - - try{checkwhole5:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("1.000000001"),mc3); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $77){ae=$77; - flag=(ae.getMessage()).equals("Decimal part non-zero: 1.000000001"); - }/*checkwhole5*/ - (new Test("pow160")).ok=flag; - - try{checkwhole6:do{ - com.ibm.math.BigDecimal.ONE.pow(new com.ibm.math.BigDecimal("5.67E-987654321"),mc3); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $78){ae=$78; - flag=(ae.getMessage()).equals("Decimal part non-zero: 5.67E-987654321"); - }/*checkwhole6*/ - (new Test("pow161")).ok=flag; - - summary("pow"); - return;} - - /*--------------------------------------------------------------------*/ - - /** Test the {@link BigDecimal#remainder} method. */ - - public void diagremainder(){ - boolean flag=false; - java.lang.ArithmeticException ae=null; - - (new Test("rem001")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("1"); - (new Test("rem002")).ok=((new com.ibm.math.BigDecimal("5")).remainder(new com.ibm.math.BigDecimal("5"),mcdef).toString()).equals("0"); - (new Test("rem003")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("10"),mcdef).toString()).equals("3"); - (new Test("rem004")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("50"),mcdef).toString()).equals("13"); - (new Test("rem005")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("100"),mcdef).toString()).equals("13"); - (new Test("rem006")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("1000"),mcdef).toString()).equals("13"); - (new Test("rem007")).ok=((new com.ibm.math.BigDecimal(".13")).remainder(one).toString()).equals("0.13"); - (new Test("rem008")).ok=((new com.ibm.math.BigDecimal("0.133")).remainder(one).toString()).equals("0.133"); - (new Test("rem009")).ok=((new com.ibm.math.BigDecimal("0.1033")).remainder(one).toString()).equals("0.1033"); - (new Test("rem010")).ok=((new com.ibm.math.BigDecimal("1.033")).remainder(one).toString()).equals("0.033"); - (new Test("rem011")).ok=((new com.ibm.math.BigDecimal("10.33")).remainder(one).toString()).equals("0.33"); - (new Test("rem012")).ok=((new com.ibm.math.BigDecimal("10.33")).remainder(com.ibm.math.BigDecimal.TEN).toString()).equals("0.33"); - (new Test("rem013")).ok=((new com.ibm.math.BigDecimal("103.3")).remainder(com.ibm.math.BigDecimal.ONE).toString()).equals("0.3"); - (new Test("rem014")).ok=((new com.ibm.math.BigDecimal("133")).remainder(com.ibm.math.BigDecimal.TEN).toString()).equals("3"); - (new Test("rem015")).ok=((new com.ibm.math.BigDecimal("1033")).remainder(com.ibm.math.BigDecimal.TEN).toString()).equals("3"); - (new Test("rem016")).ok=((new com.ibm.math.BigDecimal("1033")).remainder(new com.ibm.math.BigDecimal(50),mcdef).toString()).equals("33"); - (new Test("rem017")).ok=((new com.ibm.math.BigDecimal("101.0")).remainder(new com.ibm.math.BigDecimal(3),mcdef).toString()).equals("2.0"); - (new Test("rem018")).ok=((new com.ibm.math.BigDecimal("102.0")).remainder(new com.ibm.math.BigDecimal(3),mcdef).toString()).equals("0"); - (new Test("rem019")).ok=((new com.ibm.math.BigDecimal("103.0")).remainder(new com.ibm.math.BigDecimal(3),mcdef).toString()).equals("1.0"); - (new Test("rem020")).ok=((new com.ibm.math.BigDecimal("2.40")).remainder(one).toString()).equals("0.40"); - (new Test("rem021")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(one).toString()).equals("0.400"); - (new Test("rem022")).ok=((new com.ibm.math.BigDecimal("2.4")).remainder(one).toString()).equals("0.4"); - (new Test("rem023")).ok=((new com.ibm.math.BigDecimal("2.4")).remainder(new com.ibm.math.BigDecimal(2),mcdef).toString()).equals("0.4"); - (new Test("rem024")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(new com.ibm.math.BigDecimal(2),mcdef).toString()).equals("0.400"); - (new Test("rem025")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.1"); - (new Test("rem026")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.30"),mcdef).toString()).equals("0.10"); - (new Test("rem027")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.300"),mcdef).toString()).equals("0.100"); - (new Test("rem028")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.3000"),mcdef).toString()).equals("0.1000"); - (new Test("rem029")).ok=((new com.ibm.math.BigDecimal("1.0")).remainder(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.1"); - (new Test("rem030")).ok=((new com.ibm.math.BigDecimal("1.00")).remainder(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.10"); - (new Test("rem031")).ok=((new com.ibm.math.BigDecimal("1.000")).remainder(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.100"); - (new Test("rem032")).ok=((new com.ibm.math.BigDecimal("1.0000")).remainder(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.1000"); - (new Test("rem033")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("2.001"),mcdef).toString()).equals("0.5"); - - (new Test("rem040")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.5000001"),mcdef).toString()).equals("0.5"); - (new Test("rem041")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.50000001"),mcdef).toString()).equals("0.5"); - (new Test("rem042")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.500000001"),mcdef).toString()).equals("0.5"); - (new Test("rem043")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.5000000001"),mcdef).toString()).equals("0"); - (new Test("rem044")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.50000000001"),mcdef).toString()).equals("0"); - (new Test("rem045")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.4999999"),mcdef).toString()).equals("1E-7"); - (new Test("rem046")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.49999999"),mcdef).toString()).equals("1E-8"); - (new Test("rem047")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.499999999"),mcdef).toString()).equals("1E-9"); - (new Test("rem048")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.4999999999"),mcdef).toString()).equals("0"); - (new Test("rem049")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.49999999999"),mcdef).toString()).equals("0"); - - (new Test("rem050")).ok=((new com.ibm.math.BigDecimal("0.03")).remainder(new com.ibm.math.BigDecimal("7"),mcdef).toString()).equals("0.03"); - (new Test("rem051")).ok=((new com.ibm.math.BigDecimal("5")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1"); - (new Test("rem052")).ok=((new com.ibm.math.BigDecimal("4.1")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0.1"); - (new Test("rem053")).ok=((new com.ibm.math.BigDecimal("4.01")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0.01"); - (new Test("rem054")).ok=((new com.ibm.math.BigDecimal("4.001")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0.001"); - (new Test("rem055")).ok=((new com.ibm.math.BigDecimal("4.0001")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0.0001"); - (new Test("rem056")).ok=((new com.ibm.math.BigDecimal("4.00001")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0.00001"); - (new Test("rem057")).ok=((new com.ibm.math.BigDecimal("4.000001")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("0.000001"); - (new Test("rem058")).ok=((new com.ibm.math.BigDecimal("4.0000001")).remainder(new com.ibm.math.BigDecimal("2"),mcdef).toString()).equals("1E-7"); - - (new Test("rem060")).ok=((new com.ibm.math.BigDecimal("1.2")).remainder(new com.ibm.math.BigDecimal("0.7345"),mcdef).toString()).equals("0.4655"); - (new Test("rem061")).ok=((new com.ibm.math.BigDecimal("0.8")).remainder(new com.ibm.math.BigDecimal("12"),mcdef).toString()).equals("0.8"); - (new Test("rem062")).ok=((new com.ibm.math.BigDecimal("0.8")).remainder(new com.ibm.math.BigDecimal("0.2"),mcdef).toString()).equals("0"); - (new Test("rem063")).ok=((new com.ibm.math.BigDecimal("0.8")).remainder(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.2"); - (new Test("rem064")).ok=((new com.ibm.math.BigDecimal("0.800")).remainder(new com.ibm.math.BigDecimal("12"),mcdef).toString()).equals("0.800"); - (new Test("rem065")).ok=((new com.ibm.math.BigDecimal("0.800")).remainder(new com.ibm.math.BigDecimal("1.7"),mcdef).toString()).equals("0.800"); - (new Test("rem066")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(new com.ibm.math.BigDecimal(2),mcdef).toString()).equals("0.400"); - - // MC -- - (new Test("rem071")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(new com.ibm.math.BigDecimal(2),mc6).toString()).equals("0.400"); - (new Test("rem072")).ok=((new com.ibm.math.BigDecimal("12345678900000")).remainder(new com.ibm.math.BigDecimal("12e+12"),mc3).toString()).equals("3E+11"); - - // Fixed -- - (new Test("rem101")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("3")).toString()).equals("1"); - (new Test("rem102")).ok=((new com.ibm.math.BigDecimal("5")).remainder(new com.ibm.math.BigDecimal("5")).toString()).equals("0"); - (new Test("rem103")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("10")).toString()).equals("3"); - (new Test("rem104")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("50")).toString()).equals("13"); - (new Test("rem105")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("100")).toString()).equals("13"); - (new Test("rem106")).ok=((new com.ibm.math.BigDecimal("13")).remainder(new com.ibm.math.BigDecimal("1000")).toString()).equals("13"); - (new Test("rem107")).ok=((new com.ibm.math.BigDecimal(".13")).remainder(one).toString()).equals("0.13"); - (new Test("rem108")).ok=((new com.ibm.math.BigDecimal("0.133")).remainder(one).toString()).equals("0.133"); - (new Test("rem109")).ok=((new com.ibm.math.BigDecimal("0.1033")).remainder(one).toString()).equals("0.1033"); - (new Test("rem110")).ok=((new com.ibm.math.BigDecimal("1.033")).remainder(one).toString()).equals("0.033"); - (new Test("rem111")).ok=((new com.ibm.math.BigDecimal("10.33")).remainder(one).toString()).equals("0.33"); - (new Test("rem112")).ok=((new com.ibm.math.BigDecimal("10.33")).remainder(com.ibm.math.BigDecimal.TEN).toString()).equals("0.33"); - (new Test("rem113")).ok=((new com.ibm.math.BigDecimal("103.3")).remainder(com.ibm.math.BigDecimal.ONE).toString()).equals("0.3"); - (new Test("rem114")).ok=((new com.ibm.math.BigDecimal("133")).remainder(com.ibm.math.BigDecimal.TEN).toString()).equals("3"); - (new Test("rem115")).ok=((new com.ibm.math.BigDecimal("1033")).remainder(com.ibm.math.BigDecimal.TEN).toString()).equals("3"); - (new Test("rem116")).ok=((new com.ibm.math.BigDecimal("1033")).remainder(new com.ibm.math.BigDecimal(50)).toString()).equals("33"); - (new Test("rem117")).ok=((new com.ibm.math.BigDecimal("101.0")).remainder(new com.ibm.math.BigDecimal(3)).toString()).equals("2.0"); - (new Test("rem118")).ok=((new com.ibm.math.BigDecimal("102.0")).remainder(new com.ibm.math.BigDecimal(3)).toString()).equals("0"); - (new Test("rem119")).ok=((new com.ibm.math.BigDecimal("103.0")).remainder(new com.ibm.math.BigDecimal(3)).toString()).equals("1.0"); - (new Test("rem120")).ok=((new com.ibm.math.BigDecimal("2.40")).remainder(one).toString()).equals("0.40"); - (new Test("rem121")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(one).toString()).equals("0.400"); - (new Test("rem122")).ok=((new com.ibm.math.BigDecimal("2.4")).remainder(one).toString()).equals("0.4"); - (new Test("rem123")).ok=((new com.ibm.math.BigDecimal("2.4")).remainder(new com.ibm.math.BigDecimal(2)).toString()).equals("0.4"); - (new Test("rem124")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(new com.ibm.math.BigDecimal(2)).toString()).equals("0.400"); - (new Test("rem125")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.1"); - (new Test("rem126")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.30")).toString()).equals("0.10"); - (new Test("rem127")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.300")).toString()).equals("0.100"); - (new Test("rem128")).ok=((new com.ibm.math.BigDecimal("1")).remainder(new com.ibm.math.BigDecimal("0.3000")).toString()).equals("0.1000"); - (new Test("rem129")).ok=((new com.ibm.math.BigDecimal("1.0")).remainder(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.1"); - (new Test("rem130")).ok=((new com.ibm.math.BigDecimal("1.00")).remainder(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.10"); - (new Test("rem131")).ok=((new com.ibm.math.BigDecimal("1.000")).remainder(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.100"); - (new Test("rem132")).ok=((new com.ibm.math.BigDecimal("1.0000")).remainder(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.1000"); - (new Test("rem133")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("2.001")).toString()).equals("0.5"); - (new Test("rem134")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.500000001")).toString()).equals("0.5"); - (new Test("rem135")).ok=((new com.ibm.math.BigDecimal("0.5")).remainder(new com.ibm.math.BigDecimal("0.5000000001")).toString()).equals("0.5"); - (new Test("rem136")).ok=((new com.ibm.math.BigDecimal("0.03")).remainder(new com.ibm.math.BigDecimal("7")).toString()).equals("0.03"); - (new Test("rem137")).ok=((new com.ibm.math.BigDecimal("5")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("1"); - (new Test("rem138")).ok=((new com.ibm.math.BigDecimal("4.1")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.1"); - (new Test("rem139")).ok=((new com.ibm.math.BigDecimal("4.01")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.01"); - (new Test("rem140")).ok=((new com.ibm.math.BigDecimal("4.001")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.001"); - (new Test("rem141")).ok=((new com.ibm.math.BigDecimal("4.0001")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.0001"); - (new Test("rem142")).ok=((new com.ibm.math.BigDecimal("4.00001")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.00001"); - (new Test("rem143")).ok=((new com.ibm.math.BigDecimal("4.000001")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.000001"); - (new Test("rem144")).ok=((new com.ibm.math.BigDecimal("4.0000001")).remainder(new com.ibm.math.BigDecimal("2")).toString()).equals("0.0000001"); // 1E-7, plain - (new Test("rem145")).ok=((new com.ibm.math.BigDecimal("1.2")).remainder(new com.ibm.math.BigDecimal("0.7345")).toString()).equals("0.4655"); - (new Test("rem146")).ok=((new com.ibm.math.BigDecimal("0.8")).remainder(new com.ibm.math.BigDecimal("12")).toString()).equals("0.8"); - (new Test("rem147")).ok=((new com.ibm.math.BigDecimal("0.8")).remainder(new com.ibm.math.BigDecimal("0.2")).toString()).equals("0"); - (new Test("rem148")).ok=((new com.ibm.math.BigDecimal("0.8")).remainder(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.2"); - (new Test("rem149")).ok=((new com.ibm.math.BigDecimal("0.800")).remainder(new com.ibm.math.BigDecimal("12")).toString()).equals("0.800"); - (new Test("rem150")).ok=((new com.ibm.math.BigDecimal("0.800")).remainder(new com.ibm.math.BigDecimal("1.7")).toString()).equals("0.800"); - (new Test("rem151")).ok=((new com.ibm.math.BigDecimal("2.400")).remainder(new com.ibm.math.BigDecimal(2),mcdef).toString()).equals("0.400"); - - try{checknull:do{ - ten.remainder((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $79){ - flag=true; - }/*checknull*/ - (new Test("rem200")).ok=flag; - try{checknull2:do{ - ten.remainder(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $80){ - flag=true; - }/*checknull2*/ - (new Test("rem201")).ok=flag; - - try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.remainder(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $81){ae=$81; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("rem202")).ok=flag; - - try{checkdigits:do{ - tenlong.remainder(one,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $82){ae=$82; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("rem203")).ok=flag; - - summary("remainder"); - return;} -/*--------------------------------------------------------------------*/ - - /** Test the {@link BigDecimal#subtract} method. */ - - public void diagsubtract(){ - boolean flag=false; - com.ibm.math.BigDecimal alhs; - com.ibm.math.BigDecimal arhs; - java.lang.ArithmeticException ae=null; - - // [first group are 'quick confidence check'] - (new Test("sub301")).ok=((new com.ibm.math.BigDecimal(2)).subtract(new com.ibm.math.BigDecimal(3),mcdef).toString()).equals("-1"); - (new Test("sub302")).ok=((new com.ibm.math.BigDecimal("5.75")).subtract(new com.ibm.math.BigDecimal("3.3"),mcdef).toString()).equals("2.45"); - (new Test("sub303")).ok=((new com.ibm.math.BigDecimal("5")).subtract(new com.ibm.math.BigDecimal("-3"),mcdef).toString()).equals("8"); - (new Test("sub304")).ok=((new com.ibm.math.BigDecimal("-5")).subtract(new com.ibm.math.BigDecimal("-3"),mcdef).toString()).equals("-2"); - (new Test("sub305")).ok=((new com.ibm.math.BigDecimal("-7")).subtract(new com.ibm.math.BigDecimal("2.5"),mcdef).toString()).equals("-9.5"); - (new Test("sub306")).ok=((new com.ibm.math.BigDecimal("0.7")).subtract(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("0.4"); - (new Test("sub307")).ok=((new com.ibm.math.BigDecimal("1.3")).subtract(new com.ibm.math.BigDecimal("0.3"),mcdef).toString()).equals("1.0"); - (new Test("sub308")).ok=((new com.ibm.math.BigDecimal("1.25")).subtract(new com.ibm.math.BigDecimal("1.25"),mcdef).toString()).equals("0"); - (new Test("sub309")).ok=((new com.ibm.math.BigDecimal("1.23456789")).subtract(new com.ibm.math.BigDecimal("1.00000000"),mcdef).toString()).equals("0.23456789"); - - (new Test("sub310")).ok=((new com.ibm.math.BigDecimal("1.23456789")).subtract(new com.ibm.math.BigDecimal("1.00000089"),mcdef).toString()).equals("0.23456700"); - - (new Test("sub311")).ok=((new com.ibm.math.BigDecimal("0.5555555559")).subtract(new com.ibm.math.BigDecimal("0.0000000001"),mcdef).toString()).equals("0.555555556"); - - (new Test("sub312")).ok=((new com.ibm.math.BigDecimal("0.5555555559")).subtract(new com.ibm.math.BigDecimal("0.0000000005"),mcdef).toString()).equals("0.555555556"); - - (new Test("sub313")).ok=((new com.ibm.math.BigDecimal("0.4444444444")).subtract(new com.ibm.math.BigDecimal("0.1111111111"),mcdef).toString()).equals("0.333333333"); - - (new Test("sub314")).ok=((new com.ibm.math.BigDecimal("1.0000000000")).subtract(new com.ibm.math.BigDecimal("0.00000001"),mcdef).toString()).equals("0.99999999"); - - (new Test("sub315")).ok=((new com.ibm.math.BigDecimal("0.4444444444999")).subtract(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("0.444444444"); - - (new Test("sub316")).ok=((new com.ibm.math.BigDecimal("0.4444444445000")).subtract(new com.ibm.math.BigDecimal("0"),mcdef).toString()).equals("0.444444445"); - - - (new Test("sub317")).ok=((new com.ibm.math.BigDecimal("70")).subtract(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("-1.00000000E+13"); - - (new Test("sub318")).ok=((new com.ibm.math.BigDecimal("700")).subtract(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("-1.00000000E+13"); - - (new Test("sub319")).ok=((new com.ibm.math.BigDecimal("7000")).subtract(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("-1.00000000E+13"); - - (new Test("sub320")).ok=((new com.ibm.math.BigDecimal("70000")).subtract(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("-9.9999999E+12"); - - (new Test("sub321")).ok=((new com.ibm.math.BigDecimal("700000")).subtract(new com.ibm.math.BigDecimal("10000e+9"),mcdef).toString()).equals("-9.9999993E+12"); - - // symmetry: - (new Test("sub322")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("70"),mcdef).toString()).equals("1.00000000E+13"); - - (new Test("sub323")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("700"),mcdef).toString()).equals("1.00000000E+13"); - - (new Test("sub324")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("7000"),mcdef).toString()).equals("1.00000000E+13"); - - (new Test("sub325")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("70000"),mcdef).toString()).equals("9.9999999E+12"); - - (new Test("sub326")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("700000"),mcdef).toString()).equals("9.9999993E+12"); - - - // [same with fixed point arithmetic] - (new Test("sub001")).ok=((new com.ibm.math.BigDecimal(2)).subtract(new com.ibm.math.BigDecimal(3)).toString()).equals("-1"); - (new Test("sub002")).ok=((new com.ibm.math.BigDecimal("5.75")).subtract(new com.ibm.math.BigDecimal("3.3")).toString()).equals("2.45"); - (new Test("sub003")).ok=((new com.ibm.math.BigDecimal("5")).subtract(new com.ibm.math.BigDecimal("-3")).toString()).equals("8"); - (new Test("sub004")).ok=((new com.ibm.math.BigDecimal("-5")).subtract(new com.ibm.math.BigDecimal("-3")).toString()).equals("-2"); - (new Test("sub005")).ok=((new com.ibm.math.BigDecimal("-7")).subtract(new com.ibm.math.BigDecimal("2.5")).toString()).equals("-9.5"); - (new Test("sub006")).ok=((new com.ibm.math.BigDecimal("0.7")).subtract(new com.ibm.math.BigDecimal("0.3")).toString()).equals("0.4"); - (new Test("sub007")).ok=((new com.ibm.math.BigDecimal("1.3")).subtract(new com.ibm.math.BigDecimal("0.3")).toString()).equals("1.0"); - (new Test("sub008")).ok=((new com.ibm.math.BigDecimal("1.25")).subtract(new com.ibm.math.BigDecimal("1.25")).toString()).equals("0.00"); - (new Test("sub009")).ok=((new com.ibm.math.BigDecimal("0.02")).subtract(new com.ibm.math.BigDecimal("0.02")).toString()).equals("0.00"); - - (new Test("sub010")).ok=((new com.ibm.math.BigDecimal("1.23456789")).subtract(new com.ibm.math.BigDecimal("1.00000000")).toString()).equals("0.23456789"); - - (new Test("sub011")).ok=((new com.ibm.math.BigDecimal("1.23456789")).subtract(new com.ibm.math.BigDecimal("1.00000089")).toString()).equals("0.23456700"); - - (new Test("sub012")).ok=((new com.ibm.math.BigDecimal("0.5555555559")).subtract(new com.ibm.math.BigDecimal("0.0000000001")).toString()).equals("0.5555555558"); - - (new Test("sub013")).ok=((new com.ibm.math.BigDecimal("0.5555555559")).subtract(new com.ibm.math.BigDecimal("0.0000000005")).toString()).equals("0.5555555554"); - - (new Test("sub014")).ok=((new com.ibm.math.BigDecimal("0.4444444444")).subtract(new com.ibm.math.BigDecimal("0.1111111111")).toString()).equals("0.3333333333"); - - (new Test("sub015")).ok=((new com.ibm.math.BigDecimal("1.0000000000")).subtract(new com.ibm.math.BigDecimal("0.00000001")).toString()).equals("0.9999999900"); - - (new Test("sub016")).ok=((new com.ibm.math.BigDecimal("0.4444444444999")).subtract(new com.ibm.math.BigDecimal("0")).toString()).equals("0.4444444444999"); - - (new Test("sub017")).ok=((new com.ibm.math.BigDecimal("0.4444444445000")).subtract(new com.ibm.math.BigDecimal("0")).toString()).equals("0.4444444445000"); - - - (new Test("sub018")).ok=((new com.ibm.math.BigDecimal("70")).subtract(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("-9999999999930"); - - (new Test("sub019")).ok=((new com.ibm.math.BigDecimal("700")).subtract(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("-9999999999300"); - - (new Test("sub020")).ok=((new com.ibm.math.BigDecimal("7000")).subtract(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("-9999999993000"); - - (new Test("sub021")).ok=((new com.ibm.math.BigDecimal("70000")).subtract(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("-9999999930000"); - - (new Test("sub022")).ok=((new com.ibm.math.BigDecimal("700000")).subtract(new com.ibm.math.BigDecimal("10000e+9")).toString()).equals("-9999999300000"); - - // symmetry: - (new Test("sub023")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("70")).toString()).equals("9999999999930"); - - (new Test("sub024")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("700")).toString()).equals("9999999999300"); - - (new Test("sub025")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("7000")).toString()).equals("9999999993000"); - - (new Test("sub026")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("70000")).toString()).equals("9999999930000"); - - (new Test("sub027")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("700000")).toString()).equals("9999999300000"); - - // MC - (new Test("sub030")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("70000"),mcdef).toString()).equals("9.9999999E+12"); - - (new Test("sub031")).ok=((new com.ibm.math.BigDecimal("10000e+9")).subtract(new com.ibm.math.BigDecimal("70000"),mc6).toString()).equals("1.00000E+13"); - - - // some of the next group are really constructor tests - (new Test("sub040")).ok=((new com.ibm.math.BigDecimal("00.0")).subtract(new com.ibm.math.BigDecimal("0.0")).toString()).equals("0.0"); - (new Test("sub041")).ok=((new com.ibm.math.BigDecimal("00.0")).subtract(new com.ibm.math.BigDecimal("0.00")).toString()).equals("0.00"); - (new Test("sub042")).ok=((new com.ibm.math.BigDecimal("0.00")).subtract(new com.ibm.math.BigDecimal("00.0")).toString()).equals("0.00"); - (new Test("sub043")).ok=((new com.ibm.math.BigDecimal("00.0")).subtract(new com.ibm.math.BigDecimal("0.00"),mcdef).toString()).equals("0"); - (new Test("sub044")).ok=((new com.ibm.math.BigDecimal("0.00")).subtract(new com.ibm.math.BigDecimal("00.0"),mcdef).toString()).equals("0"); - (new Test("sub045")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("2.7"); - (new Test("sub046")).ok=((new com.ibm.math.BigDecimal("3.")).subtract(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("2.7"); - (new Test("sub047")).ok=((new com.ibm.math.BigDecimal("3.0")).subtract(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("2.7"); - (new Test("sub048")).ok=((new com.ibm.math.BigDecimal("3.00")).subtract(new com.ibm.math.BigDecimal(".3"),mcdef).toString()).equals("2.70"); - (new Test("sub049")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal("3"),mcdef).toString()).equals("0"); - (new Test("sub050")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal("+3"),mcdef).toString()).equals("0"); - (new Test("sub051")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal("-3"),mcdef).toString()).equals("6"); - (new Test("sub052")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal(".3")).toString()).equals("2.7"); - (new Test("sub053")).ok=((new com.ibm.math.BigDecimal("3.")).subtract(new com.ibm.math.BigDecimal(".3")).toString()).equals("2.7"); - (new Test("sub054")).ok=((new com.ibm.math.BigDecimal("3.0")).subtract(new com.ibm.math.BigDecimal(".3")).toString()).equals("2.7"); - (new Test("sub055")).ok=((new com.ibm.math.BigDecimal("3.00")).subtract(new com.ibm.math.BigDecimal(".3")).toString()).equals("2.70"); - (new Test("sub056")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal("3")).toString()).equals("0"); - (new Test("sub057")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal("+3")).toString()).equals("0"); - (new Test("sub058")).ok=((new com.ibm.math.BigDecimal("3")).subtract(new com.ibm.math.BigDecimal("-3")).toString()).equals("6"); - - // the above all from add; massaged and extended. Now some new ones... - // [particularly important for comparisons] - // NB: -1E-7 below were non-exponents pre-ANSI - (new Test("sub080")).ok=("-1E-7").equals((new com.ibm.math.BigDecimal("10.23456784")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new Test("sub081")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456785")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new Test("sub082")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456786")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new Test("sub083")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456787")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new Test("sub084")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456788")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new Test("sub085")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456789")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new Test("sub086")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456790")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new Test("sub087")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456791")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new Test("sub088")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456792")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new Test("sub089")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456793")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new Test("sub090")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456794")).subtract(new com.ibm.math.BigDecimal("10.23456789"),mcdef).toString()); - (new Test("sub091")).ok=("-1E-7").equals((new com.ibm.math.BigDecimal("10.23456781")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new Test("sub092")).ok=("-1E-7").equals((new com.ibm.math.BigDecimal("10.23456782")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new Test("sub093")).ok=("-1E-7").equals((new com.ibm.math.BigDecimal("10.23456783")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new Test("sub094")).ok=("-1E-7").equals((new com.ibm.math.BigDecimal("10.23456784")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new Test("sub095")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456785")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new Test("sub096")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456786")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new Test("sub097")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456787")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new Test("sub098")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456788")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new Test("sub099")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456789")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new Test("sub100")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456790")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new Test("sub101")).ok="0".equals((new com.ibm.math.BigDecimal("10.23456791")).subtract(new com.ibm.math.BigDecimal("10.23456786"),mcdef).toString()); - (new Test("sub102")).ok="0".equals(com.ibm.math.BigDecimal.ONE.subtract(new com.ibm.math.BigDecimal("0.999999999"),mcdef).toString()); - (new Test("sub103")).ok="0".equals((new com.ibm.math.BigDecimal("0.999999999")).subtract(com.ibm.math.BigDecimal.ONE,mcdef).toString()); - - alhs=new com.ibm.math.BigDecimal("12345678900000"); - arhs=new com.ibm.math.BigDecimal("9999999999999"); - (new Test("sub110")).ok=(alhs.subtract(arhs,mc3).toString()).equals("2.3E+12"); - (new Test("sub111")).ok=(arhs.subtract(alhs,mc3).toString()).equals("-2.3E+12"); - (new Test("sub112")).ok=(alhs.subtract(arhs).toString()).equals("2345678900001"); - (new Test("sub113")).ok=(arhs.subtract(alhs).toString()).equals("-2345678900001"); - - // additional scaled arithmetic tests [0.97 problem] - (new Test("sub120")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".1")).toString()).equals("-0.1"); - (new Test("sub121")).ok=((new com.ibm.math.BigDecimal("00")).subtract(new com.ibm.math.BigDecimal(".97983")).toString()).equals("-0.97983"); - (new Test("sub122")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".9")).toString()).equals("-0.9"); - (new Test("sub123")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("0.102")).toString()).equals("-0.102"); - (new Test("sub124")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".4")).toString()).equals("-0.4"); - (new Test("sub125")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".307")).toString()).equals("-0.307"); - (new Test("sub126")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".43822")).toString()).equals("-0.43822"); - (new Test("sub127")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".911")).toString()).equals("-0.911"); - (new Test("sub128")).ok=((new com.ibm.math.BigDecimal(".0")).subtract(new com.ibm.math.BigDecimal(".02")).toString()).equals("-0.02"); - (new Test("sub129")).ok=((new com.ibm.math.BigDecimal("00")).subtract(new com.ibm.math.BigDecimal(".392")).toString()).equals("-0.392"); - (new Test("sub130")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".26")).toString()).equals("-0.26"); - (new Test("sub131")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("0.51")).toString()).equals("-0.51"); - (new Test("sub132")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".2234")).toString()).equals("-0.2234"); - (new Test("sub133")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal(".2")).toString()).equals("-0.2"); - (new Test("sub134")).ok=((new com.ibm.math.BigDecimal(".0")).subtract(new com.ibm.math.BigDecimal(".0008")).toString()).equals("-0.0008"); - // 0. on left - (new Test("sub140")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.1")).toString()).equals("0.1"); - (new Test("sub141")).ok=((new com.ibm.math.BigDecimal("0.00")).subtract(new com.ibm.math.BigDecimal("-.97983")).toString()).equals("0.97983"); - (new Test("sub142")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.9")).toString()).equals("0.9"); - (new Test("sub143")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-0.102")).toString()).equals("0.102"); - (new Test("sub144")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.4")).toString()).equals("0.4"); - (new Test("sub145")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.307")).toString()).equals("0.307"); - (new Test("sub146")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.43822")).toString()).equals("0.43822"); - (new Test("sub147")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.911")).toString()).equals("0.911"); - (new Test("sub148")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.02")).toString()).equals("0.02"); - (new Test("sub149")).ok=((new com.ibm.math.BigDecimal("0.00")).subtract(new com.ibm.math.BigDecimal("-.392")).toString()).equals("0.392"); - (new Test("sub150")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.26")).toString()).equals("0.26"); - (new Test("sub151")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-0.51")).toString()).equals("0.51"); - (new Test("sub152")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.2234")).toString()).equals("0.2234"); - (new Test("sub153")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.2")).toString()).equals("0.2"); - (new Test("sub154")).ok=((new com.ibm.math.BigDecimal("0.0")).subtract(new com.ibm.math.BigDecimal("-.0008")).toString()).equals("0.0008"); - // negatives of same - (new Test("sub160")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.1")).toString()).equals("0.1"); - (new Test("sub161")).ok=((new com.ibm.math.BigDecimal("00")).subtract(new com.ibm.math.BigDecimal("-.97983")).toString()).equals("0.97983"); - (new Test("sub162")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.9")).toString()).equals("0.9"); - (new Test("sub163")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-0.102")).toString()).equals("0.102"); - (new Test("sub164")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.4")).toString()).equals("0.4"); - (new Test("sub165")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.307")).toString()).equals("0.307"); - (new Test("sub166")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.43822")).toString()).equals("0.43822"); - (new Test("sub167")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.911")).toString()).equals("0.911"); - (new Test("sub168")).ok=((new com.ibm.math.BigDecimal(".0")).subtract(new com.ibm.math.BigDecimal("-.02")).toString()).equals("0.02"); - (new Test("sub169")).ok=((new com.ibm.math.BigDecimal("00")).subtract(new com.ibm.math.BigDecimal("-.392")).toString()).equals("0.392"); - (new Test("sub170")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.26")).toString()).equals("0.26"); - (new Test("sub171")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-0.51")).toString()).equals("0.51"); - (new Test("sub172")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.2234")).toString()).equals("0.2234"); - (new Test("sub173")).ok=((new com.ibm.math.BigDecimal("0")).subtract(new com.ibm.math.BigDecimal("-.2")).toString()).equals("0.2"); - (new Test("sub174")).ok=((new com.ibm.math.BigDecimal(".0")).subtract(new com.ibm.math.BigDecimal("-.0008")).toString()).equals("0.0008"); - - // more fixed, LHS swaps [really same as testcases under add] - (new Test("sub180")).ok=((new com.ibm.math.BigDecimal("-56267E-10")).subtract(zero).toString()).equals("-0.0000056267"); - (new Test("sub181")).ok=((new com.ibm.math.BigDecimal("-56267E-5")).subtract(zero).toString()).equals("-0.56267"); - (new Test("sub182")).ok=((new com.ibm.math.BigDecimal("-56267E-2")).subtract(zero).toString()).equals("-562.67"); - (new Test("sub183")).ok=((new com.ibm.math.BigDecimal("-56267E-1")).subtract(zero).toString()).equals("-5626.7"); - (new Test("sub185")).ok=((new com.ibm.math.BigDecimal("-56267E-0")).subtract(zero).toString()).equals("-56267"); - - try{checknull:do{ - ten.subtract((com.ibm.math.BigDecimal)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $83){ - flag=true; - }/*checknull*/ - (new Test("sub200")).ok=flag; - try{checknull2:do{ - ten.subtract(ten,(com.ibm.math.MathContext)null); - flag=false; - }while(false);} - catch (java.lang.NullPointerException $84){ - flag=true; - }/*checknull2*/ - (new Test("sub201")).ok=flag; - - try{checkdigits:do{ - com.ibm.math.BigDecimal.ONE.subtract(tenlong,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $85){ae=$85; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("sub202")).ok=flag; - try{checkdigits:do{ - tenlong.subtract(com.ibm.math.BigDecimal.ONE,mcld); - flag=false; - }while(false);} - catch (java.lang.ArithmeticException $86){ae=$86; - flag=(ae.getMessage()).equals("Too many digits:"+" "+tenlong.toString()); - }/*checkdigits*/ - (new Test("sub203")).ok=flag; - summary("subtract"); - return;} -/* ----------------------------------------------------------------- */ - - /* ----------------------------------------------------------------- */ - /* Other methods */ - /* ----------------------------------------------------------------- */ - - /** Test the BigDecimal.byteValue() method. */ - - public void diagbyteValue(){ - boolean flag=false; - java.lang.String v=null; - java.lang.ArithmeticException ae=null; - java.lang.String badstrings[]; - int i=0; - java.lang.String norm=null; - - - (new Test("byv001")).ok=((((byte)-128)))==((new com.ibm.math.BigDecimal("-128")).byteValue()); - (new Test("byv002")).ok=((0))==((new com.ibm.math.BigDecimal("0")).byteValue()); - (new Test("byv003")).ok=((1))==((new com.ibm.math.BigDecimal("1")).byteValue()); - (new Test("byv004")).ok=((99))==((new com.ibm.math.BigDecimal("99")).byteValue()); - (new Test("byv005")).ok=((127))==((new com.ibm.math.BigDecimal("127")).byteValue()); - (new Test("byv006")).ok=((-128))==((new com.ibm.math.BigDecimal("128")).byteValue()); - (new Test("byv007")).ok=((-127))==((new com.ibm.math.BigDecimal("129")).byteValue()); - (new Test("byv008")).ok=((127))==((new com.ibm.math.BigDecimal("-129")).byteValue()); - (new Test("byv009")).ok=((126))==((new com.ibm.math.BigDecimal("-130")).byteValue()); - (new Test("byv010")).ok=((bmax))==((new com.ibm.math.BigDecimal(bmax)).byteValue()); - (new Test("byv011")).ok=((bmin))==((new com.ibm.math.BigDecimal(bmin)).byteValue()); - (new Test("byv012")).ok=((bneg))==((new com.ibm.math.BigDecimal(bneg)).byteValue()); - (new Test("byv013")).ok=((bzer))==((new com.ibm.math.BigDecimal(bzer)).byteValue()); - (new Test("byv014")).ok=((bpos))==((new com.ibm.math.BigDecimal(bpos)).byteValue()); - (new Test("byv015")).ok=((bmin))==((new com.ibm.math.BigDecimal(bmax+1)).byteValue()); - (new Test("byv016")).ok=((bmax))==((new com.ibm.math.BigDecimal(bmin-1)).byteValue()); - - (new Test("byv021")).ok=((((byte)-128)))==((new com.ibm.math.BigDecimal("-128")).byteValueExact()); - (new Test("byv022")).ok=((0))==((new com.ibm.math.BigDecimal("0")).byteValueExact()); - (new Test("byv023")).ok=((1))==((new com.ibm.math.BigDecimal("1")).byteValueExact()); - (new Test("byv024")).ok=((99))==((new com.ibm.math.BigDecimal("99")).byteValueExact()); - (new Test("byv025")).ok=((127))==((new com.ibm.math.BigDecimal("127")).byteValueExact()); - (new Test("byv026")).ok=((bmax))==((new com.ibm.math.BigDecimal(bmax)).byteValueExact()); - (new Test("byv027")).ok=((bmin))==((new com.ibm.math.BigDecimal(bmin)).byteValueExact()); - (new Test("byv028")).ok=((bneg))==((new com.ibm.math.BigDecimal(bneg)).byteValueExact()); - (new Test("byv029")).ok=((bzer))==((new com.ibm.math.BigDecimal(bzer)).byteValueExact()); - (new Test("byv030")).ok=((bpos))==((new com.ibm.math.BigDecimal(bpos)).byteValueExact()); - try{ - v="-129"; - (new com.ibm.math.BigDecimal(v)).byteValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $87){ae=$87; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - } - (new Test("byv100")).ok=flag; - try{ - v="128"; - (new com.ibm.math.BigDecimal(v)).byteValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $88){ae=$88; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - } - (new Test("byv101")).ok=flag; - try{ - v="1.5"; - (new com.ibm.math.BigDecimal(v)).byteValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $89){ae=$89; - flag=(ae.getMessage()).equals("Decimal part non-zero:"+" "+v); - } - (new Test("byv102")).ok=flag; - - badstrings=new java.lang.String[]{"1234",(new com.ibm.math.BigDecimal(bmax)).add(one).toString(),(new com.ibm.math.BigDecimal(bmin)).subtract(one).toString(),"170","270","370","470","570","670","770","870","970","-170","-270","-370","-470","-570","-670","-770","-870","-970",(new com.ibm.math.BigDecimal(bmin)).multiply(two).toString(),(new com.ibm.math.BigDecimal(bmax)).multiply(two).toString(),(new com.ibm.math.BigDecimal(bmin)).multiply(ten).toString(),(new com.ibm.math.BigDecimal(bmax)).multiply(ten).toString(),"-1234"}; // 220 - // 221 - // 222 - // 223 - // 224 - // 225 - // 226 - // 227 - // 228 - // 229 - // 230 - // 231 - // 232 - // 233 - // 234 - // 235 - // 236 - // 237 - // 238 - // 239 - // 240 - // 241 - // 242 - // 243 - // 244 - // 245 - {int $90=badstrings.length;i=0;i:for(;$90>0;$90--,i++){ - try{ - v=badstrings[i]; - (new com.ibm.math.BigDecimal(v)).byteValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $91){ae=$91; - norm=(new com.ibm.math.BigDecimal(v)).toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - } - (new Test("byv"+(220+i))).ok=flag; - } - }/*i*/ - - summary("byteValue+"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#compareTo(java.lang.Object)} method. */ - - public void diagcomparetoObj(){ - boolean flag=false; - com.ibm.math.BigDecimal d; - com.ibm.math.BigDecimal long1; - com.ibm.math.BigDecimal long2; - - d=new com.ibm.math.BigDecimal(17); - (new Test("cto001")).ok=(d.compareTo((java.lang.Object)(new com.ibm.math.BigDecimal(66))))==(-1); - (new Test("cto002")).ok=(d.compareTo((java.lang.Object)((new com.ibm.math.BigDecimal(10)).add(new com.ibm.math.BigDecimal(7)))))==0; - (new Test("cto003")).ok=(d.compareTo((java.lang.Object)(new com.ibm.math.BigDecimal(10))))==1; - long1=new com.ibm.math.BigDecimal("12345678903"); - long2=new com.ibm.math.BigDecimal("12345678900"); - (new Test("cto004")).ok=(long1.compareTo((java.lang.Object)long2))==1; - (new Test("cto005")).ok=(long2.compareTo((java.lang.Object)long1))==(-1); - (new Test("cto006")).ok=(long2.compareTo((java.lang.Object)long2))==0; - try{ - d.compareTo((java.lang.Object)null); - flag=false; - } - catch (java.lang.NullPointerException $92){ - flag=true; // should get here - } - (new Test("cto101")).ok=flag; - try{ - d.compareTo((java.lang.Object)"foo"); - flag=false; - } - catch (java.lang.ClassCastException $93){ - flag=true; // should get here - } - (new Test("cto102")).ok=flag; - summary("compareTo(Obj)"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#doubleValue} method. */ - - public void diagdoublevalue(){ - java.lang.String val; - // 1999.03.07 Infinities no longer errors - val="-1"; - (new Test("dov001")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==((new java.lang.Double(val)).doubleValue()); - val="-0.1"; - (new Test("dov002")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==((new java.lang.Double(val)).doubleValue()); - val="0"; - (new Test("dov003")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==((new java.lang.Double(val)).doubleValue()); - val="0.1"; - (new Test("dov004")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==((new java.lang.Double(val)).doubleValue()); - val="1"; - (new Test("dov005")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==((new java.lang.Double(val)).doubleValue()); - val="1e1000"; - (new Test("dov006")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==java.lang.Double.POSITIVE_INFINITY; - val="-1e1000"; - (new Test("dov007")).ok=((new com.ibm.math.BigDecimal(val)).doubleValue())==java.lang.Double.NEGATIVE_INFINITY; - summary("doubleValue"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#equals} method. */ - - public void diagequals(){ - com.ibm.math.BigDecimal d; - d=new com.ibm.math.BigDecimal(17); - (new Test("equ001")).ok=(!(d.equals((java.lang.Object)null))); - (new Test("equ002")).ok=(!(d.equals((java.lang.Object)"foo"))); - (new Test("equ003")).ok=(!(d.equals((java.lang.Object)(new com.ibm.math.BigDecimal(66))))); - (new Test("equ004")).ok=d.equals((java.lang.Object)d); - (new Test("equ005")).ok=d.equals((java.lang.Object)((new com.ibm.math.BigDecimal(10)).add(new com.ibm.math.BigDecimal(7)))); - summary("equals"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#floatValue} method. */ - - public void diagfloatvalue(){ - java.lang.String val; - // 1999.03.07 Infinities no longer errors - val="-1"; - (new Test("flv001")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==((new java.lang.Float(val)).floatValue()); - val="-0.1"; - (new Test("flv002")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==((new java.lang.Float(val)).floatValue()); - val="0"; - (new Test("flv003")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==((new java.lang.Float(val)).floatValue()); - val="0.1"; - (new Test("flv004")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==((new java.lang.Float(val)).floatValue()); - val="1"; - (new Test("flv005")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==((new java.lang.Float(val)).floatValue()); - val="1e200"; - (new Test("flv006")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==java.lang.Float.POSITIVE_INFINITY; - val="-1e200"; - (new Test("flv007")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==java.lang.Float.NEGATIVE_INFINITY; - val="1e1000"; - (new Test("flv008")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==java.lang.Float.POSITIVE_INFINITY; - val="-1e1000"; - (new Test("flv009")).ok=((new com.ibm.math.BigDecimal(val)).floatValue())==java.lang.Float.NEGATIVE_INFINITY; - summary("floatValue"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#format} method. */ - - public void diagformat(){ - boolean flag=false; - int eng; - int sci; - com.ibm.math.BigDecimal d04; - com.ibm.math.BigDecimal d05; - com.ibm.math.BigDecimal d06; - com.ibm.math.BigDecimal d15; - java.lang.IllegalArgumentException iae=null; - com.ibm.math.BigDecimal d050; - com.ibm.math.BigDecimal d150; - com.ibm.math.BigDecimal m050; - com.ibm.math.BigDecimal m150; - com.ibm.math.BigDecimal d051; - com.ibm.math.BigDecimal d151; - com.ibm.math.BigDecimal d000; - com.ibm.math.BigDecimal d500; - java.lang.ArithmeticException ae=null; - // 1999.02.09 now only two signatures for format(), so some tests below - // may now be redundant - - (new Test("for001")).ok=((new com.ibm.math.BigDecimal("12.3")).format(-1,-1)).equals("12.3"); - (new Test("for002")).ok=((new com.ibm.math.BigDecimal("-12.73")).format(-1,-1)).equals("-12.73"); - (new Test("for003")).ok=((new com.ibm.math.BigDecimal("0.000")).format(-1,-1)).equals("0.000"); - (new Test("for004")).ok=((new com.ibm.math.BigDecimal("3E+3")).format(-1,-1)).equals("3000"); - (new Test("for005")).ok=((new com.ibm.math.BigDecimal("3")).format(4,-1)).equals(" 3"); - (new Test("for006")).ok=((new com.ibm.math.BigDecimal("1.73")).format(4,0)).equals(" 2"); - (new Test("for007")).ok=((new com.ibm.math.BigDecimal("1.73")).format(4,1)).equals(" 1.7"); - (new Test("for008")).ok=((new com.ibm.math.BigDecimal("1.75")).format(4,1)).equals(" 1.8"); - (new Test("for009")).ok=((new com.ibm.math.BigDecimal("0.5")).format(4,1)).equals(" 0.5"); - (new Test("for010")).ok=((new com.ibm.math.BigDecimal("0.05")).format(4,1)).equals(" 0.1"); - (new Test("for011")).ok=((new com.ibm.math.BigDecimal("0.04")).format(4,1)).equals(" 0.0"); - (new Test("for012")).ok=((new com.ibm.math.BigDecimal("0")).format(4,0)).equals(" 0"); - (new Test("for013")).ok=((new com.ibm.math.BigDecimal("0")).format(4,1)).equals(" 0.0"); - (new Test("for014")).ok=((new com.ibm.math.BigDecimal("0")).format(4,2)).equals(" 0.00"); - (new Test("for015")).ok=((new com.ibm.math.BigDecimal("0")).format(4,3)).equals(" 0.000"); - (new Test("for016")).ok=((new com.ibm.math.BigDecimal("0")).format(4,4)).equals(" 0.0000"); - (new Test("for017")).ok=((new com.ibm.math.BigDecimal("0.005")).format(4,0)).equals(" 0"); - (new Test("for018")).ok=((new com.ibm.math.BigDecimal("0.005")).format(4,1)).equals(" 0.0"); - (new Test("for019")).ok=((new com.ibm.math.BigDecimal("0.005")).format(4,2)).equals(" 0.01"); - (new Test("for020")).ok=((new com.ibm.math.BigDecimal("0.004")).format(4,2)).equals(" 0.00"); - (new Test("for021")).ok=((new com.ibm.math.BigDecimal("0.005")).format(4,3)).equals(" 0.005"); - (new Test("for022")).ok=((new com.ibm.math.BigDecimal("0.005")).format(4,4)).equals(" 0.0050"); - - (new Test("for023")).ok=((new com.ibm.math.BigDecimal("1.73")).format(4,2)).equals(" 1.73"); - (new Test("for024")).ok=((new com.ibm.math.BigDecimal("1.73")).format(4,3)).equals(" 1.730"); - (new Test("for025")).ok=((new com.ibm.math.BigDecimal("-.76")).format(4,1)).equals(" -0.8"); - (new Test("for026")).ok=((new com.ibm.math.BigDecimal("-12.73")).format(-1,4)).equals("-12.7300"); - - (new Test("for027")).ok=((new com.ibm.math.BigDecimal("3.03")).format(4,-1)).equals(" 3.03"); - (new Test("for028")).ok=((new com.ibm.math.BigDecimal("3.03")).format(4,1)).equals(" 3.0"); - (new Test("for029")).ok=((new com.ibm.math.BigDecimal("3.03")).format(4,-1,3,-1,-1,-1)).equals(" 3.03 "); - (new Test("for030")).ok=((new com.ibm.math.BigDecimal("3.03")).format(-1,-1,3,-1,-1,-1)).equals("3.03 "); - (new Test("for031")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,-1,-1,4,-1,-1)).equals("1.234573E+4"); - (new Test("for032")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,-1,-1,5,-1,-1)).equals("12345.73"); - (new Test("for033")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,-1,-1,6,-1,-1)).equals("12345.73"); - - (new Test("for034")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,8,-1,3,-1,-1)).equals("1.23457300E+4"); - (new Test("for035")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,7,-1,3,-1,-1)).equals("1.2345730E+4"); - (new Test("for036")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,6,-1,3,-1,-1)).equals("1.234573E+4"); - (new Test("for037")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,5,-1,3,-1,-1)).equals("1.23457E+4"); - (new Test("for038")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,4,-1,3,-1,-1)).equals("1.2346E+4"); - (new Test("for039")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,3,-1,3,-1,-1)).equals("1.235E+4"); - (new Test("for040")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,2,-1,3,-1,-1)).equals("1.23E+4"); - (new Test("for041")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,1,-1,3,-1,-1)).equals("1.2E+4"); - (new Test("for042")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,0,-1,3,-1,-1)).equals("1E+4"); - - (new Test("for043")).ok=((new com.ibm.math.BigDecimal("99999.99")).format(-1,6,-1,3,-1,-1)).equals("9.999999E+4"); - (new Test("for044")).ok=((new com.ibm.math.BigDecimal("99999.99")).format(-1,5,-1,3,-1,-1)).equals("1.00000E+5"); - (new Test("for045")).ok=((new com.ibm.math.BigDecimal("99999.99")).format(-1,2,-1,3,-1,-1)).equals("1.00E+5"); - (new Test("for046")).ok=((new com.ibm.math.BigDecimal("99999.99")).format(-1,0,-1,3,-1,-1)).equals("1E+5"); - (new Test("for047")).ok=((new com.ibm.math.BigDecimal("99999.99")).format(3,0,-1,3,-1,-1)).equals(" 1E+5"); - - (new Test("for048")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,-1,2,2,-1,-1)).equals("1.234573E+04"); - (new Test("for049")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,3,-1,0,-1,-1)).equals("1.235E+4"); - (new Test("for050")).ok=((new com.ibm.math.BigDecimal("1.234573")).format(-1,3,-1,0,-1,-1)).equals("1.235"); - (new Test("for051")).ok=((new com.ibm.math.BigDecimal("123.45")).format(-1,3,2,0,-1,-1)).equals("1.235E+02"); - - (new Test("for052")).ok=((new com.ibm.math.BigDecimal("0.444")).format(-1,0)).equals("0"); - (new Test("for053")).ok=((new com.ibm.math.BigDecimal("-0.444")).format(-1,0)).equals("0"); - (new Test("for054")).ok=((new com.ibm.math.BigDecimal("0.4")).format(-1,0)).equals("0"); - (new Test("for055")).ok=((new com.ibm.math.BigDecimal("-0.4")).format(-1,0)).equals("0"); - - eng=com.ibm.math.MathContext.ENGINEERING; - sci=com.ibm.math.MathContext.SCIENTIFIC; - (new Test("for060")).ok=((new com.ibm.math.BigDecimal("1234.5")).format(-1,3,2,0,eng,-1)).equals("1.235E+03"); - (new Test("for061")).ok=((new com.ibm.math.BigDecimal("12345")).format(-1,3,3,0,eng,-1)).equals("12.345E+003"); - (new Test("for062")).ok=((new com.ibm.math.BigDecimal("12345")).format(-1,3,3,0,sci,-1)).equals("1.235E+004"); - (new Test("for063")).ok=((new com.ibm.math.BigDecimal("1234.5")).format(4,3,2,0,eng,-1)).equals(" 1.235E+03"); - (new Test("for064")).ok=((new com.ibm.math.BigDecimal("12345")).format(5,3,3,0,eng,-1)).equals(" 12.345E+003"); - (new Test("for065")).ok=((new com.ibm.math.BigDecimal("12345")).format(6,3,3,0,sci,-1)).equals(" 1.235E+004"); - - (new Test("for066")).ok=((new com.ibm.math.BigDecimal("1.2345")).format(-1,3,2,0,-1,-1)).equals("1.235 "); - (new Test("for067")).ok=((new com.ibm.math.BigDecimal("12345.73")).format(-1,-1,3,6,-1,-1)).equals("12345.73 "); - (new Test("for068")).ok=((new com.ibm.math.BigDecimal("12345e+5")).format(-1,0)).equals("1234500000"); - (new Test("for069")).ok=((new com.ibm.math.BigDecimal("12345e+5")).format(-1,1)).equals("1234500000.0"); - (new Test("for070")).ok=((new com.ibm.math.BigDecimal("12345e+5")).format(-1,2)).equals("1234500000.00"); - (new Test("for071")).ok=((new com.ibm.math.BigDecimal("12345e+5")).format(-1,3)).equals("1234500000.000"); - (new Test("for072")).ok=((new com.ibm.math.BigDecimal("12345e+5")).format(-1,4)).equals("1234500000.0000"); - - // some from ANSI Dallas [Nov 1998] - (new Test("for073")).ok=((new com.ibm.math.BigDecimal("99.999")).format(-1,2,-1,2,-1,-1)).equals("100.00"); - (new Test("for074")).ok=((new com.ibm.math.BigDecimal("0.99999")).format(-1,4,2,2,-1,-1)).equals("1.0000 "); - - // try some rounding modes [default ROUND_HALF_UP widely tested above] - // the first few also tests that defaults are accepted for the others - d04=new com.ibm.math.BigDecimal("0.04"); - d05=new com.ibm.math.BigDecimal("0.05"); - d06=new com.ibm.math.BigDecimal("0.06"); - d15=new com.ibm.math.BigDecimal("0.15"); - (new Test("for080")).ok=(d05.format(-1,1)).equals("0.1"); - (new Test("for081")).ok=(d05.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_UP)).equals("0.1"); - (new Test("for082")).ok=(d05.format(-1,1,-1,-1,-1,-1)).equals("0.1"); - (new Test("for083")).ok=(d05.format(-1,-1,-1,-1,-1,-1)).equals("0.05"); - (new Test("for084")).ok=(d05.format(-1,-1)).equals("0.05"); - try{ - d05.format(-1,-1,-1,-1,-1,30); // bad mode - flag=false; // shouldn't get here - } - catch (java.lang.IllegalArgumentException $94){iae=$94; - flag=(iae.getMessage()).equals("Bad argument 6 to format: 30"); - } - (new Test("for085")).ok=flag; - - (new Test("for090")).ok=(d04.format(-1,1)).equals("0.0"); - (new Test("for091")).ok=(d06.format(-1,1)).equals("0.1"); - (new Test("for092")).ok=(d04.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_DOWN)).equals("0.0"); - (new Test("for093")).ok=(d05.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_DOWN)).equals("0.0"); - (new Test("for094")).ok=(d06.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_DOWN)).equals("0.1"); - - (new Test("for095")).ok=(d04.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.0"); - (new Test("for096")).ok=(d05.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.0"); - (new Test("for097")).ok=(d06.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.1"); - (new Test("for098")).ok=(d15.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.2"); - d050=new com.ibm.math.BigDecimal("0.050"); - d150=new com.ibm.math.BigDecimal("0.150"); - (new Test("for099")).ok=(d050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.0"); - (new Test("for100")).ok=(d150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.2"); - m050=new com.ibm.math.BigDecimal("-0.050"); - m150=new com.ibm.math.BigDecimal("-0.150"); - (new Test("for101")).ok=(m050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.0"); - (new Test("for102")).ok=(m150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("-0.2"); - d051=new com.ibm.math.BigDecimal("0.051"); - d151=new com.ibm.math.BigDecimal("0.151"); - (new Test("for103")).ok=(d051.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.1"); - (new Test("for104")).ok=(d151.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_HALF_EVEN)).equals("0.2"); - - (new Test("for105")).ok=(m050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_CEILING)).equals("0.0"); - (new Test("for106")).ok=(m150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_CEILING)).equals("-0.1"); - (new Test("for107")).ok=(d050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_CEILING)).equals("0.1"); - (new Test("for108")).ok=(d150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_CEILING)).equals("0.2"); - - (new Test("for109")).ok=(m050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_FLOOR)).equals("-0.1"); - (new Test("for110")).ok=(m150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_FLOOR)).equals("-0.2"); - (new Test("for111")).ok=(d050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_FLOOR)).equals("0.0"); - (new Test("for112")).ok=(d150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_FLOOR)).equals("0.1"); - - (new Test("for113")).ok=(m050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UP)).equals("-0.1"); - (new Test("for114")).ok=(m150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UP)).equals("-0.2"); - (new Test("for115")).ok=(d050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UP)).equals("0.1"); - (new Test("for116")).ok=(d150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UP)).equals("0.2"); - - (new Test("for117")).ok=(m050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_DOWN)).equals("0.0"); - (new Test("for118")).ok=(m150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_DOWN)).equals("-0.1"); - (new Test("for119")).ok=(d050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_DOWN)).equals("0.0"); - (new Test("for120")).ok=(d150.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_DOWN)).equals("0.1"); - - d000=new com.ibm.math.BigDecimal("0.000"); - d500=new com.ibm.math.BigDecimal("0.500"); - (new Test("for121")).ok=(d000.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.0"); - (new Test("for122")).ok=(d000.format(-1,2,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.00"); - (new Test("for123")).ok=(d000.format(-1,3,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.000"); - try{ // this should trap.. - d050.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY); - flag=false; - } - catch (java.lang.ArithmeticException $95){ae=$95; - flag=(ae.getMessage()).equals("Rounding necessary"); - } - (new Test("for124")).ok=flag; - (new Test("for125")).ok=(d050.format(-1,2,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.05"); - (new Test("for126")).ok=(d050.format(-1,3,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.050"); - (new Test("for127")).ok=(d500.format(-1,1,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.5"); - (new Test("for128")).ok=(d500.format(-1,2,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.50"); - (new Test("for129")).ok=(d500.format(-1,3,-1,-1,-1,com.ibm.math.MathContext.ROUND_UNNECESSARY)).equals("0.500"); - - // bad negs -- - try{ - d050.format(-2,-1,-1,-1,-1,-1); - flag=false; - } - catch (java.lang.IllegalArgumentException $96){ - flag=true; - } - (new Test("for131")).ok=flag; - try{ - d050.format(-1,-2,-1,-1,-1,-1); - flag=false; - } - catch (java.lang.IllegalArgumentException $97){ - flag=true; - } - (new Test("for132")).ok=flag; - try{ - d050.format(-1,-1,-2,-1,-1,-1); - flag=false; - } - catch (java.lang.IllegalArgumentException $98){ - flag=true; - } - (new Test("for133")).ok=flag; - try{ - d050.format(-1,-1,-1,-2,-1,-1); - flag=false; - } - catch (java.lang.IllegalArgumentException $99){ - flag=true; - } - (new Test("for134")).ok=flag; - try{ - d050.format(-1,-1,-1,-1,-2,-1); - flag=false; - } - catch (java.lang.IllegalArgumentException $100){ - flag=true; - } - (new Test("for135")).ok=flag; - try{ - d050.format(-1,-1,-1,-1,-1,-2); - flag=false; - } - catch (java.lang.IllegalArgumentException $101){ - flag=true; - } - (new Test("for136")).ok=flag; - - summary("format"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#hashCode} method. */ - - public void diaghashcode(){ - java.lang.String hs; - com.ibm.math.BigDecimal d; - hs="27827817"; - d=new com.ibm.math.BigDecimal(hs); - (new Test("has001")).ok=(d.hashCode())==(hs.hashCode()); - hs="1.265E+200"; - d=new com.ibm.math.BigDecimal(hs); - (new Test("has002")).ok=(d.hashCode())==(hs.hashCode()); - hs="126.5E+200"; - d=new com.ibm.math.BigDecimal(hs); - (new Test("has003")).ok=(d.hashCode())!=(hs.hashCode()); - summary("hashCode"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#intValue} method. */ - - public void diagintvalue(){ - boolean flag=false; - java.lang.String v=null; - java.lang.ArithmeticException ae=null; - java.lang.String badstrings[]; - int i=0; - java.lang.String norm=null; - com.ibm.math.BigDecimal dimax; - com.ibm.math.BigDecimal num=null; - com.ibm.math.BigDecimal dv=null; - com.ibm.math.BigDecimal dimin; - - - // intValue -- - - (new Test("inv001")).ok=imin==((new com.ibm.math.BigDecimal(imin)).intValue()); - (new Test("inv002")).ok=((99))==((new com.ibm.math.BigDecimal("99")).intValue()); - (new Test("inv003")).ok=((1))==((new com.ibm.math.BigDecimal("1")).intValue()); - (new Test("inv004")).ok=((0))==((new com.ibm.math.BigDecimal("0")).intValue()); - (new Test("inv005")).ok=((-1))==((new com.ibm.math.BigDecimal("-1")).intValue()); - (new Test("inv006")).ok=((-99))==((new com.ibm.math.BigDecimal("-99")).intValue()); - (new Test("inv007")).ok=imax==((new com.ibm.math.BigDecimal(imax)).intValue()); - (new Test("inv008")).ok=((5))==((new com.ibm.math.BigDecimal("5.0")).intValue()); - (new Test("inv009")).ok=((5))==((new com.ibm.math.BigDecimal("5.3")).intValue()); - (new Test("inv010")).ok=((5))==((new com.ibm.math.BigDecimal("5.5")).intValue()); - (new Test("inv011")).ok=((5))==((new com.ibm.math.BigDecimal("5.7")).intValue()); - (new Test("inv012")).ok=((5))==((new com.ibm.math.BigDecimal("5.9")).intValue()); - (new Test("inv013")).ok=((-5))==((new com.ibm.math.BigDecimal("-5.0")).intValue()); - (new Test("inv014")).ok=((-5))==((new com.ibm.math.BigDecimal("-5.3")).intValue()); - (new Test("inv015")).ok=((-5))==((new com.ibm.math.BigDecimal("-5.5")).intValue()); - (new Test("inv016")).ok=((-5))==((new com.ibm.math.BigDecimal("-5.7")).intValue()); - (new Test("inv017")).ok=((-5))==((new com.ibm.math.BigDecimal("-5.9")).intValue()); - (new Test("inv018")).ok=((new com.ibm.math.BigDecimal("88888888888")).intValue())==(-1305424328); // ugh - (new Test("inv019")).ok=((new com.ibm.math.BigDecimal("-88888888888")).intValue())==1305424328; // ugh - (new Test("inv020")).ok=((imin))==((new com.ibm.math.BigDecimal((((long)imax))+1)).intValue()); - (new Test("inv021")).ok=((imax))==((new com.ibm.math.BigDecimal((((long)imin))-1)).intValue()); - - // intValueExact -- - - (new Test("inv101")).ok=imin==((new com.ibm.math.BigDecimal(imin)).intValueExact()); - (new Test("inv102")).ok=((99))==((new com.ibm.math.BigDecimal("99")).intValue()); - (new Test("inv103")).ok=((1))==((new com.ibm.math.BigDecimal("1")).intValue()); - (new Test("inv104")).ok=((0))==((new com.ibm.math.BigDecimal("0")).intValue()); - (new Test("inv105")).ok=((-1))==((new com.ibm.math.BigDecimal("-1")).intValue()); - (new Test("inv106")).ok=((-99))==((new com.ibm.math.BigDecimal("-99")).intValue()); - (new Test("inv107")).ok=imax==((new com.ibm.math.BigDecimal(imax)).intValue()); - (new Test("inv108")).ok=((5))==((new com.ibm.math.BigDecimal("5.0")).intValue()); - (new Test("inv109")).ok=((-5))==((new com.ibm.math.BigDecimal("-5.0")).intValue()); - (new Test("inv110")).ok=imax==((new com.ibm.math.BigDecimal(imax)).intValueExact()); - - try{ - v="-88588688888"; - (new com.ibm.math.BigDecimal(v)).intValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $102){ae=$102; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - } - (new Test("inv200")).ok=flag; - - // this one could raise either overflow or bad decimal part - try{ - v="88088818888.00001"; - (new com.ibm.math.BigDecimal(v)).intValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $103){ - flag=true; - } - (new Test("inv201")).ok=flag; - - // 1999.10.28: the testcases marked '*' failed - badstrings=new java.lang.String[]{"12345678901",(new com.ibm.math.BigDecimal(imax)).add(one).toString(),(new com.ibm.math.BigDecimal(imin)).subtract(one).toString(),"3731367293","4731367293","5731367293","6731367293","7731367293","8731367293","9731367293","-3731367293","-4731367293","-5731367293","-6731367293","-7731367293","-8731367293","-9731367293",(new com.ibm.math.BigDecimal(imin)).multiply(two).toString(),(new com.ibm.math.BigDecimal(imax)).multiply(two).toString(),(new com.ibm.math.BigDecimal(imin)).multiply(ten).toString(),(new com.ibm.math.BigDecimal(imax)).multiply(ten).toString(),"4731367293","4831367293","4931367293","5031367293","5131367293","5231367293","5331367293","5431367293","5531367293","5631367293","5731367293","5831367293","5931367293","6031367293","6131367293","6231367293","6331367293","6431367293","6531367293","6631367293","6731367293","2200000000","2300000000","2400000000","2500000000","2600000000","2700000000","2800000000","2900000000","-2200000000","-2300000000","-2400000000","-2500000000","-2600000000","-2700000000","-2800000000","-2900000000","25E+8","-25E+8","-12345678901"}; // 220 - // 221 - // 222 - // 223 - // 224 - // 225 * - // 226 - // 227 - // 228 - // 229 * - // 230 - // 231 - // 232 * - // 233 - // 234 - // 235 - // 236 * - // 237 - // 238 - // 239 - // 240 - // 241 - // 242 * - // 243 * - // 244 * - // 245 * - // 246 * - // 247 * - // 248 * - // 249 * - // 250 * - // 251 * - // 252 * - // 253 * - // 254 * - // 255 * - // 256 * - // 257 * - // 258 * - // 259 - // 260 - // 261 - // 262 - // 263 - // 264 - // 265 - // 266 - // 267 - // 268 - // 269 - // 270 - // 271 - // 272 - // 273 - // 274 - // 275 - // 276 - // 277 - // 278 - // 279 - // 280 - {int $104=badstrings.length;i=0;i:for(;$104>0;$104--,i++){ - try{ - v=badstrings[i]; - (new com.ibm.math.BigDecimal(v)).intValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $105){ae=$105; - norm=(new com.ibm.math.BigDecimal(v)).toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - } - (new Test("inv"+(220+i))).ok=flag; - } - }/*i*/ - - // now slip in some single bits... - dimax=new com.ibm.math.BigDecimal(imax); - {i=0;i:for(;i<=49;i++){ - try{ - num=two.pow(new com.ibm.math.BigDecimal(i),mc50); - dv=dimax.add(num,mc50); - dv.intValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $106){ae=$106; - norm=dv.toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - } - (new Test("inv"+(300+i))).ok=flag; - } - }/*i*/ - dimin=new com.ibm.math.BigDecimal(imin); - {i=50;i:for(;i<=99;i++){ - try{ - num=two.pow(new com.ibm.math.BigDecimal(i),mc50); - dv=dimin.subtract(num,mc50); - dv.intValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $107){ae=$107; - norm=dv.toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - } - (new Test("inv"+(300+i))).ok=flag; - } - }/*i*/ - - // the following should all raise bad-decimal-part exceptions - badstrings=new java.lang.String[]{"0.09","0.9","0.01","0.1","-0.01","-0.1","1.01","-1.01","-1.1","-111.111","+111.111","1.09","1.05","1.04","1.99","1.9","1.5","1.4","-1.09","-1.05","-1.04","-1.99","-1.9","-1.5","-1.4","1E-1000","-1E-1000","11E-1","1.5"}; // 400-403 - // 404-407 - // 408-411 - // 412-416 - // 417-420 - // 421-424 - // 425-428 - - {int $108=badstrings.length;i=0;i:for(;$108>0;$108--,i++){ - try{ - v=badstrings[i]; - (new com.ibm.math.BigDecimal(v)).intValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $109){ae=$109; - norm=(new com.ibm.math.BigDecimal(v)).toString(); - flag=(ae.getMessage()).equals("Decimal part non-zero:"+" "+norm); - } - (new Test("inv"+(400+i))).ok=flag; - } - }/*i*/ - - summary("intValue+"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#longValue} method. */ - - public void diaglongvalue(){ - boolean flag=false; - java.lang.String v=null; - java.lang.ArithmeticException ae=null; - java.lang.String badstrings[]; - int i=0; - java.lang.String norm=null; - com.ibm.math.BigDecimal dlmax; - com.ibm.math.BigDecimal num=null; - com.ibm.math.BigDecimal dv=null; - com.ibm.math.BigDecimal dlmin; - - - // longValue -- - - (new Test("lov001")).ok=lmin==((new com.ibm.math.BigDecimal(lmin)).longValue()); - (new Test("lov002")).ok=(((long)99))==((new com.ibm.math.BigDecimal("99")).longValue()); - (new Test("lov003")).ok=(((long)1))==((new com.ibm.math.BigDecimal("1")).longValue()); - (new Test("lov004")).ok=(((long)0))==((new com.ibm.math.BigDecimal("0")).longValue()); - (new Test("lov005")).ok=(((long)-1))==((new com.ibm.math.BigDecimal("-1")).longValue()); - (new Test("lov006")).ok=(((long)-99))==((new com.ibm.math.BigDecimal("-99")).longValue()); - (new Test("lov007")).ok=lmax==((new com.ibm.math.BigDecimal(lmax)).longValue()); - (new Test("lov008")).ok=(((long)5))==((new com.ibm.math.BigDecimal("5.0")).longValue()); - (new Test("lov009")).ok=(((long)5))==((new com.ibm.math.BigDecimal("5.3")).longValue()); - (new Test("lov010")).ok=(((long)5))==((new com.ibm.math.BigDecimal("5.5")).longValue()); - (new Test("lov011")).ok=(((long)5))==((new com.ibm.math.BigDecimal("5.7")).longValue()); - (new Test("lov012")).ok=(((long)5))==((new com.ibm.math.BigDecimal("5.9")).longValue()); - (new Test("lov013")).ok=(((long)-5))==((new com.ibm.math.BigDecimal("-5.0")).longValue()); - (new Test("lov014")).ok=(((long)-5))==((new com.ibm.math.BigDecimal("-5.3")).longValue()); - (new Test("lov015")).ok=(((long)-5))==((new com.ibm.math.BigDecimal("-5.5")).longValue()); - (new Test("lov016")).ok=(((long)-5))==((new com.ibm.math.BigDecimal("-5.7")).longValue()); - (new Test("lov017")).ok=(((long)-5))==((new com.ibm.math.BigDecimal("-5.9")).longValue()); - (new Test("lov018")).ok=((new com.ibm.math.BigDecimal("888888888899999999998")).longValue())==3445173361941522430L; // ugh - (new Test("lov019")).ok=((new com.ibm.math.BigDecimal("-888888888899999999998")).longValue())==(-3445173361941522430L); // ugh - - // longValueExact -- - - (new Test("lov101")).ok=lmin==((new com.ibm.math.BigDecimal(lmin)).longValue()); - (new Test("lov102")).ok=(((long)99))==((new com.ibm.math.BigDecimal("99")).longValue()); - (new Test("lov103")).ok=(((long)1))==((new com.ibm.math.BigDecimal("1")).longValue()); - (new Test("lov104")).ok=(((long)0))==((new com.ibm.math.BigDecimal("0")).longValue()); - (new Test("lov105")).ok=(((long)-1))==((new com.ibm.math.BigDecimal("-1")).longValue()); - (new Test("lov106")).ok=(((long)-99))==((new com.ibm.math.BigDecimal("-99")).longValue()); - (new Test("lov107")).ok=lmax==((new com.ibm.math.BigDecimal(lmax)).longValue()); - (new Test("lov108")).ok=(((long)5))==((new com.ibm.math.BigDecimal("5.0")).longValue()); - (new Test("lov109")).ok=(((long)-5))==((new com.ibm.math.BigDecimal("-5.0")).longValue()); - - try{ - v="-888888888899999999998"; - (new com.ibm.math.BigDecimal(v)).longValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $110){ae=$110; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - } - (new Test("lov200")).ok=flag; - try{ - v="88888887487487479488888"; - (new com.ibm.math.BigDecimal(v)).longValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $111){ae=$111; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - } - (new Test("lov201")).ok=flag; - try{ - v="1.5"; - (new com.ibm.math.BigDecimal(v)).longValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $112){ae=$112; - flag=(ae.getMessage()).equals("Decimal part non-zero:"+" "+v); - } - (new Test("lov202")).ok=flag; - - badstrings=new java.lang.String[]{"1234567890110987654321","-1234567890110987654321",(new com.ibm.math.BigDecimal(lmax)).add(one).toString(),(new com.ibm.math.BigDecimal(lmin)).subtract(one).toString(),(new com.ibm.math.BigDecimal(lmin)).multiply(two).toString(),(new com.ibm.math.BigDecimal(lmax)).multiply(two).toString(),(new com.ibm.math.BigDecimal(lmin)).multiply(ten).toString(),(new com.ibm.math.BigDecimal(lmax)).multiply(ten).toString(),"9223372036854775818","9323372036854775818","9423372036854775818","9523372036854775818","9623372036854775818","9723372036854775818","9823372036854775818","9923372036854775818","-9223372036854775818","-9323372036854775818","-9423372036854775818","-9523372036854775818","-9623372036854775818","-9723372036854775818","-9823372036854775818","-9923372036854775818","12345678901234567890"}; // 220 - // 221 - // 222 - // 223 - // 224 - // 225 - // 226 - // 227 - // 228 - // 229 - // 230 - // 231 - // 232 - // 233 - // 234 - // 235 - // 236 - // 237 - // 238 - // 239 - // 240 - // 241 - // 242 - // 243 - // 244 - {int $113=badstrings.length;i=0;i:for(;$113>0;$113--,i++){ - try{ - v=badstrings[i]; - (new com.ibm.math.BigDecimal(v)).longValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $114){ae=$114; - norm=(new com.ibm.math.BigDecimal(v)).toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - } - (new Test("lov"+(220+i))).ok=flag; - } - }/*i*/ - - // now slip in some single bits... - dlmax=new com.ibm.math.BigDecimal(lmax); - {i=0;i:for(;i<=99;i++){ - try{ - num=two.pow(new com.ibm.math.BigDecimal(i),mc50); - dv=dlmax.add(num,mc50); - dv.longValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $115){ae=$115; - norm=dv.toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - } - (new Test("lov"+(300+i))).ok=flag; - } - }/*i*/ - dlmin=new com.ibm.math.BigDecimal(lmin); - {i=0;i:for(;i<=99;i++){ - try{ - num=two.pow(new com.ibm.math.BigDecimal(i),mc50); - dv=dlmin.subtract(num,mc50); - dv.longValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $116){ae=$116; - norm=dv.toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - } - (new Test("lov"+(400+i))).ok=flag; - } - }/*i*/ - - summary("longValue+"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#movePointLeft} method. */ - - public void diagmovepointleft(){ - (new Test("mpl001")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(-10).toString()).equals("-10000000000"); - (new Test("mpl002")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(-5).toString()).equals("-100000"); - (new Test("mpl003")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(-1).toString()).equals("-10"); - (new Test("mpl004")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(0).toString()).equals("-1"); - (new Test("mpl005")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(+1).toString()).equals("-0.1"); - (new Test("mpl006")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(+5).toString()).equals("-0.00001"); - (new Test("mpl007")).ok=((new com.ibm.math.BigDecimal("-1")).movePointLeft(+10).toString()).equals("-0.0000000001"); - - (new Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(-10).toString()).equals("0"); - (new Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(-5).toString()).equals("0"); - (new Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(-1).toString()).equals("0"); - (new Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(0).toString()).equals("0"); - (new Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(+1).toString()).equals("0.0"); - (new Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(+5).toString()).equals("0.00000"); - (new Test("mpl010")).ok=((new com.ibm.math.BigDecimal("0")).movePointLeft(+10).toString()).equals("0.0000000000"); - - (new Test("mpl020")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(-10).toString()).equals("10000000000"); - (new Test("mpl021")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(-5).toString()).equals("100000"); - (new Test("mpl022")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(-1).toString()).equals("10"); - (new Test("mpl023")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(0).toString()).equals("1"); - (new Test("mpl024")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(+1).toString()).equals("0.1"); - (new Test("mpl025")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(+5).toString()).equals("0.00001"); - (new Test("mpl026")).ok=((new com.ibm.math.BigDecimal("+1")).movePointLeft(+10).toString()).equals("0.0000000001"); - - (new Test("mpl030")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(-10).toString()).equals("50000000000"); - (new Test("mpl031")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(-5).toString()).equals("500000"); - (new Test("mpl032")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(-1).toString()).equals("50"); - (new Test("mpl033")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(0).toString()).equals("5"); - (new Test("mpl034")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(+1).toString()).equals("0.5"); - (new Test("mpl035")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(+5).toString()).equals("0.00005"); - (new Test("mpl036")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointLeft(+10).toString()).equals("0.0000000005"); - - summary("movePointLeft"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#movePointRight} method. */ - - public void diagmovepointright(){ - (new Test("mpr001")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(+10).toString()).equals("-10000000000"); - (new Test("mpr002")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(+5).toString()).equals("-100000"); - (new Test("mpr003")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(+1).toString()).equals("-10"); - (new Test("mpr004")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(0).toString()).equals("-1"); - (new Test("mpr005")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(-1).toString()).equals("-0.1"); - (new Test("mpr006")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(-5).toString()).equals("-0.00001"); - (new Test("mpr007")).ok=((new com.ibm.math.BigDecimal("-1")).movePointRight(-10).toString()).equals("-0.0000000001"); - - (new Test("mpr010")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(+10).toString()).equals("0"); - (new Test("mpr011")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(+5).toString()).equals("0"); - (new Test("mpr012")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(+1).toString()).equals("0"); - (new Test("mpr013")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(0).toString()).equals("0"); - (new Test("mpr014")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(-1).toString()).equals("0.0"); - (new Test("mpr015")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(-5).toString()).equals("0.00000"); - (new Test("mpr016")).ok=((new com.ibm.math.BigDecimal("0")).movePointRight(-10).toString()).equals("0.0000000000"); - - (new Test("mpr020")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(+10).toString()).equals("10000000000"); - (new Test("mpr021")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(+5).toString()).equals("100000"); - (new Test("mpr022")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(+1).toString()).equals("10"); - (new Test("mpr023")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(0).toString()).equals("1"); - (new Test("mpr024")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(-1).toString()).equals("0.1"); - (new Test("mpr025")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(-5).toString()).equals("0.00001"); - (new Test("mpr026")).ok=((new com.ibm.math.BigDecimal("+1")).movePointRight(-10).toString()).equals("0.0000000001"); - - (new Test("mpr030")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(+10).toString()).equals("50000000000"); - (new Test("mpr031")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(+5).toString()).equals("500000"); - (new Test("mpr032")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(+1).toString()).equals("50"); - (new Test("mpr033")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(0).toString()).equals("5"); - (new Test("mpr034")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(-1).toString()).equals("0.5"); - (new Test("mpr035")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(-5).toString()).equals("0.00005"); - (new Test("mpr036")).ok=((new com.ibm.math.BigDecimal("0.5E+1")).movePointRight(-10).toString()).equals("0.0000000005"); - - summary("movePointRight"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#scale} method. */ - - public void diagscale(){ - (new Test("sca001")).ok=((new com.ibm.math.BigDecimal("-1")).scale())==0; - (new Test("sca002")).ok=((new com.ibm.math.BigDecimal("-10")).scale())==0; - (new Test("sca003")).ok=((new com.ibm.math.BigDecimal("+1")).scale())==0; - (new Test("sca004")).ok=((new com.ibm.math.BigDecimal("+10")).scale())==0; - (new Test("sca005")).ok=((new com.ibm.math.BigDecimal("1E+10")).scale())==0; - (new Test("sca006")).ok=((new com.ibm.math.BigDecimal("1E-10")).scale())==10; - (new Test("sca007")).ok=((new com.ibm.math.BigDecimal("0E-10")).scale())==0; - (new Test("sca008")).ok=((new com.ibm.math.BigDecimal("0.000")).scale())==3; - (new Test("sca009")).ok=((new com.ibm.math.BigDecimal("0.00")).scale())==2; - (new Test("sca010")).ok=((new com.ibm.math.BigDecimal("0.0")).scale())==1; - (new Test("sca011")).ok=((new com.ibm.math.BigDecimal("0.1")).scale())==1; - (new Test("sca012")).ok=((new com.ibm.math.BigDecimal("0.12")).scale())==2; - (new Test("sca013")).ok=((new com.ibm.math.BigDecimal("0.123")).scale())==3; - (new Test("sca014")).ok=((new com.ibm.math.BigDecimal("-0.0")).scale())==1; - (new Test("sca015")).ok=((new com.ibm.math.BigDecimal("-0.1")).scale())==1; - (new Test("sca016")).ok=((new com.ibm.math.BigDecimal("-0.12")).scale())==2; - (new Test("sca017")).ok=((new com.ibm.math.BigDecimal("-0.123")).scale())==3; - summary("scale"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#setScale} method. */ - - public void diagsetscale(){ - boolean flag=false; - java.lang.RuntimeException e=null; - - (new Test("ssc001")).ok=((new com.ibm.math.BigDecimal("-1")).setScale(0).toString()).equals("-1"); - (new Test("ssc002")).ok=((new com.ibm.math.BigDecimal("-1")).setScale(1).toString()).equals("-1.0"); - (new Test("ssc003")).ok=((new com.ibm.math.BigDecimal("-1")).setScale(2).toString()).equals("-1.00"); - (new Test("ssc004")).ok=((new com.ibm.math.BigDecimal("0")).setScale(0).toString()).equals("0"); - (new Test("ssc005")).ok=((new com.ibm.math.BigDecimal("0")).setScale(1).toString()).equals("0.0"); - (new Test("ssc006")).ok=((new com.ibm.math.BigDecimal("0")).setScale(2).toString()).equals("0.00"); - (new Test("ssc007")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(0).toString()).equals("1"); - (new Test("ssc008")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(1).toString()).equals("1.0"); - (new Test("ssc009")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(2).toString()).equals("1.00"); - (new Test("ssc010")).ok=((new com.ibm.math.BigDecimal("-1")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("-1"); - (new Test("ssc011")).ok=((new com.ibm.math.BigDecimal("-1")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("-1.0"); - (new Test("ssc012")).ok=((new com.ibm.math.BigDecimal("-1")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("-1.00"); - (new Test("ssc013")).ok=((new com.ibm.math.BigDecimal("0")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0"); - (new Test("ssc014")).ok=((new com.ibm.math.BigDecimal("0")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.0"); - (new Test("ssc015")).ok=((new com.ibm.math.BigDecimal("0")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.00"); - (new Test("ssc016")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1"); - (new Test("ssc017")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.0"); - (new Test("ssc018")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.00"); - - (new Test("ssc020")).ok=((new com.ibm.math.BigDecimal("1.04")).setScale(3,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.040"); - (new Test("ssc021")).ok=((new com.ibm.math.BigDecimal("1.04")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.04"); - (new Test("ssc022")).ok=((new com.ibm.math.BigDecimal("1.04")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.0"); - (new Test("ssc023")).ok=((new com.ibm.math.BigDecimal("1.04")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1"); - (new Test("ssc024")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(3,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.050"); - (new Test("ssc025")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.05"); - (new Test("ssc026")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.1"); - (new Test("ssc027")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1"); - (new Test("ssc028")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(3,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("1.050"); - (new Test("ssc029")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("1.05"); - (new Test("ssc030")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("1.0"); - (new Test("ssc031")).ok=((new com.ibm.math.BigDecimal("1.05")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("1"); - (new Test("ssc032")).ok=((new com.ibm.math.BigDecimal("1.06")).setScale(3,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.060"); - (new Test("ssc033")).ok=((new com.ibm.math.BigDecimal("1.06")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.06"); - (new Test("ssc034")).ok=((new com.ibm.math.BigDecimal("1.06")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.1"); - (new Test("ssc035")).ok=((new com.ibm.math.BigDecimal("1.06")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1"); - - (new Test("ssc040")).ok=((new com.ibm.math.BigDecimal("-10")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("-10.00"); - (new Test("ssc041")).ok=((new com.ibm.math.BigDecimal("+1")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("1.00"); - (new Test("ssc042")).ok=((new com.ibm.math.BigDecimal("+10")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("10.00"); - (new Test("ssc043")).ok=((new com.ibm.math.BigDecimal("1E+10")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("10000000000.00"); - (new Test("ssc044")).ok=((new com.ibm.math.BigDecimal("1E-10")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.00"); - (new Test("ssc045")).ok=((new com.ibm.math.BigDecimal("1E-2")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.01"); - (new Test("ssc046")).ok=((new com.ibm.math.BigDecimal("0E-10")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.00"); - - // check rounding - (new Test("ssc050")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_CEILING).toString()).equals("0.01"); - (new Test("ssc051")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_CEILING).toString()).equals("0.1"); - (new Test("ssc052")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_CEILING).toString()).equals("1"); - (new Test("ssc053")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_DOWN).toString()).equals("0.00"); - (new Test("ssc054")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_DOWN).toString()).equals("0.0"); - (new Test("ssc055")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_DOWN).toString()).equals("0"); - (new Test("ssc056")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_FLOOR).toString()).equals("0.00"); - (new Test("ssc057")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_FLOOR).toString()).equals("0.0"); - (new Test("ssc058")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_FLOOR).toString()).equals("0"); - (new Test("ssc059")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.00"); - (new Test("ssc060")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0.0"); - (new Test("ssc061")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_DOWN).toString()).equals("0"); - (new Test("ssc062")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.00"); - (new Test("ssc063")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.0"); - (new Test("ssc064")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0"); - (new Test("ssc065")).ok=((new com.ibm.math.BigDecimal("0.015")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.02"); - (new Test("ssc066")).ok=((new com.ibm.math.BigDecimal("0.015")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0.0"); - (new Test("ssc067")).ok=((new com.ibm.math.BigDecimal("0.015")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_EVEN).toString()).equals("0"); - (new Test("ssc068")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.01"); - (new Test("ssc069")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.0"); - (new Test("ssc070")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0"); - (new Test("ssc071")).ok=((new com.ibm.math.BigDecimal("0.095")).setScale(2,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.10"); - (new Test("ssc072")).ok=((new com.ibm.math.BigDecimal("0.095")).setScale(1,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0.1"); - (new Test("ssc073")).ok=((new com.ibm.math.BigDecimal("0.095")).setScale(0,com.ibm.math.MathContext.ROUND_HALF_UP).toString()).equals("0"); - (new Test("ssc074")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(2,com.ibm.math.MathContext.ROUND_UP).toString()).equals("0.01"); - (new Test("ssc075")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(1,com.ibm.math.MathContext.ROUND_UP).toString()).equals("0.1"); - (new Test("ssc076")).ok=((new com.ibm.math.BigDecimal("0.005")).setScale(0,com.ibm.math.MathContext.ROUND_UP).toString()).equals("1"); - - try{checkscale:do{ - (new com.ibm.math.BigDecimal(1)).setScale(-8); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $117){e=$117; - flag=(e.getMessage()).equals("Negative scale: -8"); - }/*checkscale*/ - (new Test("ssc100")).ok=flag; - try{checkrunn:do{ - (new com.ibm.math.BigDecimal(1.0001D)).setScale(3); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $118){e=$118; - flag=(e.getMessage()).equals("Rounding necessary"); - }/*checkrunn*/ - (new Test("ssc101")).ok=flag; - try{checkrunn:do{ - (new com.ibm.math.BigDecimal(1E-8D)).setScale(3); - flag=false; - }while(false);} - catch (java.lang.RuntimeException $119){e=$119; - flag=(e.getMessage()).equals("Rounding necessary"); - }/*checkrunn*/ - (new Test("ssc102")).ok=flag; - summary("setScale"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the BigDecimal.shortValue() method. */ - - public void diagshortvalue(){ - boolean flag=false; - java.lang.String v=null; - java.lang.ArithmeticException ae=null; - java.lang.String badstrings[]; - int i=0; - java.lang.String norm=null; - - (new Test("shv002")).ok=(((short)0))==((new com.ibm.math.BigDecimal("0")).shortValue()); - (new Test("shv003")).ok=(((short)1))==((new com.ibm.math.BigDecimal("1")).shortValue()); - (new Test("shv004")).ok=(((short)99))==((new com.ibm.math.BigDecimal("99")).shortValue()); - (new Test("shv006")).ok=((smax))==((new com.ibm.math.BigDecimal(smax)).shortValue()); - (new Test("shv007")).ok=((smin))==((new com.ibm.math.BigDecimal(smin)).shortValue()); - (new Test("shv008")).ok=((sneg))==((new com.ibm.math.BigDecimal(sneg)).shortValue()); - (new Test("shv009")).ok=((szer))==((new com.ibm.math.BigDecimal(szer)).shortValue()); - (new Test("shv010")).ok=((spos))==((new com.ibm.math.BigDecimal(spos)).shortValue()); - (new Test("shv011")).ok=((smin))==((new com.ibm.math.BigDecimal(smax+1)).shortValue()); - (new Test("shv012")).ok=((smax))==((new com.ibm.math.BigDecimal(smin-1)).shortValue()); - - (new Test("shv022")).ok=(((short)0))==((new com.ibm.math.BigDecimal("0")).shortValueExact()); - (new Test("shv023")).ok=(((short)1))==((new com.ibm.math.BigDecimal("1")).shortValueExact()); - (new Test("shv024")).ok=(((short)99))==((new com.ibm.math.BigDecimal("99")).shortValueExact()); - (new Test("shv026")).ok=((smax))==((new com.ibm.math.BigDecimal(smax)).shortValueExact()); - (new Test("shv027")).ok=((smin))==((new com.ibm.math.BigDecimal(smin)).shortValueExact()); - (new Test("shv028")).ok=((sneg))==((new com.ibm.math.BigDecimal(sneg)).shortValueExact()); - (new Test("shv029")).ok=((szer))==((new com.ibm.math.BigDecimal(szer)).shortValueExact()); - (new Test("shv030")).ok=((spos))==((new com.ibm.math.BigDecimal(spos)).shortValueExact()); - try{ - v="-88888888888"; - (new com.ibm.math.BigDecimal(v)).shortValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $120){ae=$120; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - } - (new Test("shv100")).ok=flag; - try{ - v="88888888888"; - (new com.ibm.math.BigDecimal(v)).shortValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $121){ae=$121; - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+v); - } - (new Test("shv101")).ok=flag; - try{ - v="1.5"; - (new com.ibm.math.BigDecimal(v)).shortValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $122){ae=$122; - flag=(ae.getMessage()).equals("Decimal part non-zero:"+" "+v); - } - (new Test("shv102")).ok=flag; - - badstrings=new java.lang.String[]{"123456",(new com.ibm.math.BigDecimal(smax)).add(one).toString(),(new com.ibm.math.BigDecimal(smin)).subtract(one).toString(),"71111","81111","91111","-71111","-81111","-91111",(new com.ibm.math.BigDecimal(smin)).multiply(two).toString(),(new com.ibm.math.BigDecimal(smax)).multiply(two).toString(),(new com.ibm.math.BigDecimal(smin)).multiply(ten).toString(),(new com.ibm.math.BigDecimal(smax)).multiply(ten).toString(),"-123456"}; // 220 - // 221 - // 222 - // 223 - // 224 - // 225 - // 226 - // 227 - // 228 - // 229 - // 230 - // 231 - // 232 - // 233 - {int $123=badstrings.length;i=0;i:for(;$123>0;$123--,i++){ - try{ - v=badstrings[i]; - (new com.ibm.math.BigDecimal(v)).shortValueExact(); - flag=false; - } - catch (java.lang.ArithmeticException $124){ae=$124; - norm=(new com.ibm.math.BigDecimal(v)).toString(); - flag=(ae.getMessage()).equals("Conversion overflow:"+" "+norm); - } - (new Test("shv"+(220+i))).ok=flag; - } - }/*i*/ - - - summary("shortValue+"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#signum} method. */ - - public void diagsignum(){ - // necessarily checks some obscure constructions, too - (new Test("sig001")).ok=(-1)==((new com.ibm.math.BigDecimal("-1")).signum()); - (new Test("sig002")).ok=(-1)==((new com.ibm.math.BigDecimal("-0.0010")).signum()); - (new Test("sig003")).ok=(-1)==((new com.ibm.math.BigDecimal("-0.001")).signum()); - (new Test("sig004")).ok=0==((new com.ibm.math.BigDecimal("-0.00")).signum()); - (new Test("sig005")).ok=0==((new com.ibm.math.BigDecimal("-0")).signum()); - (new Test("sig006")).ok=0==((new com.ibm.math.BigDecimal("0")).signum()); - (new Test("sig007")).ok=0==((new com.ibm.math.BigDecimal("00")).signum()); - (new Test("sig008")).ok=0==((new com.ibm.math.BigDecimal("00.0")).signum()); - (new Test("sig009")).ok=1==((new com.ibm.math.BigDecimal("00.01")).signum()); - (new Test("sig010")).ok=1==((new com.ibm.math.BigDecimal("00.01")).signum()); - (new Test("sig011")).ok=1==((new com.ibm.math.BigDecimal("00.010")).signum()); - (new Test("sig012")).ok=1==((new com.ibm.math.BigDecimal("01.01")).signum()); - (new Test("sig013")).ok=1==((new com.ibm.math.BigDecimal("+0.01")).signum()); - (new Test("sig014")).ok=1==((new com.ibm.math.BigDecimal("+0.001")).signum()); - (new Test("sig015")).ok=1==((new com.ibm.math.BigDecimal("1")).signum()); - (new Test("sig016")).ok=1==((new com.ibm.math.BigDecimal("1e+12")).signum()); - (new Test("sig017")).ok=0==((new com.ibm.math.BigDecimal("00e+12")).signum()); - summary("signum"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#toBigDecimal} method. */ - - public void diagtobigdecimal(){ - (new Test("tbd001")).ok=((new com.ibm.math.BigDecimal("0")).toBigDecimal().toString()).equals("0"); - (new Test("tbd002")).ok=((new com.ibm.math.BigDecimal("-1")).toBigDecimal().toString()).equals("-1"); - (new Test("tbd003")).ok=((new com.ibm.math.BigDecimal("+1")).toBigDecimal().toString()).equals("1"); - (new Test("tbd004")).ok=((new com.ibm.math.BigDecimal("1")).toBigDecimal().toString()).equals("1"); - (new Test("tbd005")).ok=((new com.ibm.math.BigDecimal("1E+2")).toBigDecimal().toString()).equals("100"); - (new Test("tbd006")).ok=((new com.ibm.math.BigDecimal("1E-2")).toBigDecimal().toString()).equals("0.01"); - (new Test("tbd007")).ok=((new com.ibm.math.BigDecimal("1E-8")).toBigDecimal().toString()).equals("0.00000001"); - (new Test("tbd008")).ok=((new com.ibm.math.BigDecimal("1E-9")).toBigDecimal().toString()).equals("0.000000001"); - (new Test("tbd009")).ok=((new com.ibm.math.BigDecimal("1E10")).toBigDecimal().toString()).equals("10000000000"); - (new Test("tbd010")).ok=((new com.ibm.math.BigDecimal("1E12")).toBigDecimal().toString()).equals("1000000000000"); - summary("toBigDecimal"); - return;} -/* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#toBigInteger} method. */ - - public void diagtobiginteger(){ - boolean flag=false; - java.lang.String badstrings[]; - int i=0; - (new Test("tbi001")).ok=((new com.ibm.math.BigDecimal("-1")).toBigInteger().toString()).equals("-1"); - (new Test("tbi002")).ok=((new com.ibm.math.BigDecimal("0")).toBigInteger().toString()).equals("0"); - (new Test("tbi003")).ok=((new com.ibm.math.BigDecimal("+1")).toBigInteger().toString()).equals("1"); - (new Test("tbi004")).ok=((new com.ibm.math.BigDecimal("10")).toBigInteger().toString()).equals("10"); - (new Test("tbi005")).ok=((new com.ibm.math.BigDecimal("1000")).toBigInteger().toString()).equals("1000"); - (new Test("tbi006")).ok=((new com.ibm.math.BigDecimal("-1E+0")).toBigInteger().toString()).equals("-1"); - (new Test("tbi007")).ok=((new com.ibm.math.BigDecimal("0E+0")).toBigInteger().toString()).equals("0"); - (new Test("tbi008")).ok=((new com.ibm.math.BigDecimal("+1E+0")).toBigInteger().toString()).equals("1"); - (new Test("tbi009")).ok=((new com.ibm.math.BigDecimal("10E+0")).toBigInteger().toString()).equals("10"); - (new Test("tbi010")).ok=((new com.ibm.math.BigDecimal("1E+3")).toBigInteger().toString()).equals("1000"); - (new Test("tbi011")).ok=((new com.ibm.math.BigDecimal("0.00")).toBigInteger().toString()).equals("0"); - (new Test("tbi012")).ok=((new com.ibm.math.BigDecimal("0.01")).toBigInteger().toString()).equals("0"); - (new Test("tbi013")).ok=((new com.ibm.math.BigDecimal("0.0")).toBigInteger().toString()).equals("0"); - (new Test("tbi014")).ok=((new com.ibm.math.BigDecimal("0.1")).toBigInteger().toString()).equals("0"); - (new Test("tbi015")).ok=((new com.ibm.math.BigDecimal("-0.00")).toBigInteger().toString()).equals("0"); - (new Test("tbi016")).ok=((new com.ibm.math.BigDecimal("-0.01")).toBigInteger().toString()).equals("0"); - (new Test("tbi017")).ok=((new com.ibm.math.BigDecimal("-0.0")).toBigInteger().toString()).equals("0"); - (new Test("tbi018")).ok=((new com.ibm.math.BigDecimal("-0.1")).toBigInteger().toString()).equals("0"); - (new Test("tbi019")).ok=((new com.ibm.math.BigDecimal("1.00")).toBigInteger().toString()).equals("1"); - (new Test("tbi020")).ok=((new com.ibm.math.BigDecimal("1.01")).toBigInteger().toString()).equals("1"); - (new Test("tbi021")).ok=((new com.ibm.math.BigDecimal("1.0")).toBigInteger().toString()).equals("1"); - (new Test("tbi022")).ok=((new com.ibm.math.BigDecimal("1.1")).toBigInteger().toString()).equals("1"); - (new Test("tbi023")).ok=((new com.ibm.math.BigDecimal("-1.00")).toBigInteger().toString()).equals("-1"); - (new Test("tbi024")).ok=((new com.ibm.math.BigDecimal("-1.01")).toBigInteger().toString()).equals("-1"); - (new Test("tbi025")).ok=((new com.ibm.math.BigDecimal("-1.0")).toBigInteger().toString()).equals("-1"); - (new Test("tbi026")).ok=((new com.ibm.math.BigDecimal("-1.1")).toBigInteger().toString()).equals("-1"); - (new Test("tbi027")).ok=((new com.ibm.math.BigDecimal("-111.111")).toBigInteger().toString()).equals("-111"); - (new Test("tbi028")).ok=((new com.ibm.math.BigDecimal("+111.111")).toBigInteger().toString()).equals("111"); - (new Test("tbi029")).ok=((new com.ibm.math.BigDecimal("0.09")).toBigInteger().toString()).equals("0"); - (new Test("tbi030")).ok=((new com.ibm.math.BigDecimal("0.9")).toBigInteger().toString()).equals("0"); - (new Test("tbi031")).ok=((new com.ibm.math.BigDecimal("1.09")).toBigInteger().toString()).equals("1"); - (new Test("tbi032")).ok=((new com.ibm.math.BigDecimal("1.05")).toBigInteger().toString()).equals("1"); - (new Test("tbi033")).ok=((new com.ibm.math.BigDecimal("1.04")).toBigInteger().toString()).equals("1"); - (new Test("tbi034")).ok=((new com.ibm.math.BigDecimal("1.99")).toBigInteger().toString()).equals("1"); - (new Test("tbi034")).ok=((new com.ibm.math.BigDecimal("1.9")).toBigInteger().toString()).equals("1"); - (new Test("tbi035")).ok=((new com.ibm.math.BigDecimal("1.5")).toBigInteger().toString()).equals("1"); - (new Test("tbi036")).ok=((new com.ibm.math.BigDecimal("1.4")).toBigInteger().toString()).equals("1"); - (new Test("tbi037")).ok=((new com.ibm.math.BigDecimal("-1.09")).toBigInteger().toString()).equals("-1"); - (new Test("tbi038")).ok=((new com.ibm.math.BigDecimal("-1.05")).toBigInteger().toString()).equals("-1"); - (new Test("tbi039")).ok=((new com.ibm.math.BigDecimal("-1.04")).toBigInteger().toString()).equals("-1"); - (new Test("tbi040")).ok=((new com.ibm.math.BigDecimal("-1.99")).toBigInteger().toString()).equals("-1"); - (new Test("tbi041")).ok=((new com.ibm.math.BigDecimal("-1.9")).toBigInteger().toString()).equals("-1"); - (new Test("tbi042")).ok=((new com.ibm.math.BigDecimal("-1.5")).toBigInteger().toString()).equals("-1"); - (new Test("tbi043")).ok=((new com.ibm.math.BigDecimal("-1.4")).toBigInteger().toString()).equals("-1"); - (new Test("tbi044")).ok=((new com.ibm.math.BigDecimal("1E-1000")).toBigInteger().toString()).equals("0"); - (new Test("tbi045")).ok=((new com.ibm.math.BigDecimal("-1E-1000")).toBigInteger().toString()).equals("0"); - - // Exact variety -- - (new Test("tbi101")).ok=((new com.ibm.math.BigDecimal("-1")).toBigIntegerExact().toString()).equals("-1"); - (new Test("tbi102")).ok=((new com.ibm.math.BigDecimal("0")).toBigIntegerExact().toString()).equals("0"); - (new Test("tbi103")).ok=((new com.ibm.math.BigDecimal("+1")).toBigIntegerExact().toString()).equals("1"); - (new Test("tbi104")).ok=((new com.ibm.math.BigDecimal("10")).toBigIntegerExact().toString()).equals("10"); - (new Test("tbi105")).ok=((new com.ibm.math.BigDecimal("1000")).toBigIntegerExact().toString()).equals("1000"); - (new Test("tbi106")).ok=((new com.ibm.math.BigDecimal("-1E+0")).toBigIntegerExact().toString()).equals("-1"); - (new Test("tbi107")).ok=((new com.ibm.math.BigDecimal("0E+0")).toBigIntegerExact().toString()).equals("0"); - (new Test("tbi108")).ok=((new com.ibm.math.BigDecimal("+1E+0")).toBigIntegerExact().toString()).equals("1"); - (new Test("tbi109")).ok=((new com.ibm.math.BigDecimal("10E+0")).toBigIntegerExact().toString()).equals("10"); - (new Test("tbi110")).ok=((new com.ibm.math.BigDecimal("1E+3")).toBigIntegerExact().toString()).equals("1000"); - (new Test("tbi111")).ok=((new com.ibm.math.BigDecimal("0.00")).toBigIntegerExact().toString()).equals("0"); - (new Test("tbi112")).ok=((new com.ibm.math.BigDecimal("0.0")).toBigIntegerExact().toString()).equals("0"); - (new Test("tbi113")).ok=((new com.ibm.math.BigDecimal("-0.00")).toBigIntegerExact().toString()).equals("0"); - (new Test("tbi114")).ok=((new com.ibm.math.BigDecimal("-0.0")).toBigIntegerExact().toString()).equals("0"); - (new Test("tbi115")).ok=((new com.ibm.math.BigDecimal("1.00")).toBigIntegerExact().toString()).equals("1"); - (new Test("tbi116")).ok=((new com.ibm.math.BigDecimal("1.0")).toBigIntegerExact().toString()).equals("1"); - (new Test("tbi117")).ok=((new com.ibm.math.BigDecimal("-1.00")).toBigIntegerExact().toString()).equals("-1"); - (new Test("tbi118")).ok=((new com.ibm.math.BigDecimal("-1.0")).toBigIntegerExact().toString()).equals("-1"); - (new Test("tbi119")).ok=((new com.ibm.math.BigDecimal("1.00000000000000000000000000000")).toBigIntegerExact().toString()).equals("1"); - - // the following should all raise exceptions - - badstrings=new java.lang.String[]{"0.09","0.9","0.01","0.1","-0.01","-0.1","1.01","-1.01","-1.1","-111.111","+111.111","1.09","1.05","1.04","1.99","1.9","1.5","1.4","-1.09","-1.05","-1.04","-1.99","-1.9","-1.5","-1.4","1E-1000","-1E-1000","11E-1","1.1","127623156123656561356123512315631231551312356.000001","0.000000000000000000000000000000000000000000000001"}; // 300-303 - // 304-307 - // 308-311 - // 312-316 - // 317-320 - // 321-324 - // 325-328 - // 329 - // 330 - - {int $125=badstrings.length;i=0;i:for(;$125>0;$125--,i++){ - try{ - (new com.ibm.math.BigDecimal(badstrings[i])).toBigIntegerExact(); - flag=false; - } - catch (java.lang.ArithmeticException $126){ - flag=true; - } - (new Test("tbi"+(300+i))).ok=flag; - } - }/*i*/ - - summary("toBigInteger+"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#toCharArray} method. */ - - public void diagtochararray(){ - java.lang.String str; - char car[]; - com.ibm.math.BigDecimal d; - char ca[]; - // the function of this has been tested above, this is simply an - // existence proof and type-check - str="-123.45"; - car=(str).toCharArray(); - d=new com.ibm.math.BigDecimal(str); - ca=d.toCharArray(); - (new Test("tca001")).ok=ca.length==car.length; - (new Test("tca002")).ok=(new java.lang.String(ca)).equals((java.lang.Object)(new java.lang.String(car))); - (new Test("tca003")).ok=(d.toCharArray() instanceof char[]); - (new Test("tca004")).ok=(ca instanceof char[]); - summary("toCharArray"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#toString} method. */ - - public void diagtostring(){ - java.lang.String str; - char car[]; - com.ibm.math.BigDecimal d; - char ca[]; - java.lang.String cs; - // the function of this has been tested above, this is simply an - // existence proof and type-check - str="123.45"; - car=(str).toCharArray(); - d=new com.ibm.math.BigDecimal(car,0,car.length); - ca=d.toCharArray(); - cs=d.toString(); - (new Test("tos001")).ok=(str.toCharArray().length)==ca.length; - (new Test("tos002")).ok=(str.length())==(cs.length()); - (new Test("tos003")).ok=str.equals((java.lang.Object)(new java.lang.String(ca))); - (new Test("tos004")).ok=str.equals((java.lang.Object)cs); - (new Test("tos005")).ok=(cs instanceof java.lang.String); - (new Test("tos006")).ok=(d.toString() instanceof java.lang.String); - summary("toString"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#unscaledValue} method. */ - - public void diagunscaledvalue(){ - // just like toBigInteger, but scaly bits are preserved [without dots] - (new Test("uns001")).ok=((new com.ibm.math.BigDecimal("-1")).unscaledValue().toString()).equals("-1"); - (new Test("uns002")).ok=((new com.ibm.math.BigDecimal("0")).unscaledValue().toString()).equals("0"); - (new Test("uns003")).ok=((new com.ibm.math.BigDecimal("+1")).unscaledValue().toString()).equals("1"); - (new Test("uns004")).ok=((new com.ibm.math.BigDecimal("10")).unscaledValue().toString()).equals("10"); - (new Test("uns005")).ok=((new com.ibm.math.BigDecimal("1000")).unscaledValue().toString()).equals("1000"); - (new Test("uns006")).ok=((new com.ibm.math.BigDecimal("-1E+0")).unscaledValue().toString()).equals("-1"); - (new Test("uns007")).ok=((new com.ibm.math.BigDecimal("0E+0")).unscaledValue().toString()).equals("0"); - (new Test("uns008")).ok=((new com.ibm.math.BigDecimal("+1E+0")).unscaledValue().toString()).equals("1"); - (new Test("uns009")).ok=((new com.ibm.math.BigDecimal("10E+0")).unscaledValue().toString()).equals("10"); - (new Test("uns010")).ok=((new com.ibm.math.BigDecimal("1E+3")).unscaledValue().toString()).equals("1000"); - (new Test("uns011")).ok=((new com.ibm.math.BigDecimal("0.00")).unscaledValue().toString()).equals("0"); - (new Test("uns012")).ok=((new com.ibm.math.BigDecimal("0.01")).unscaledValue().toString()).equals("1"); - (new Test("uns013")).ok=((new com.ibm.math.BigDecimal("0.0")).unscaledValue().toString()).equals("0"); - (new Test("uns014")).ok=((new com.ibm.math.BigDecimal("0.1")).unscaledValue().toString()).equals("1"); - (new Test("uns015")).ok=((new com.ibm.math.BigDecimal("-0.00")).unscaledValue().toString()).equals("0"); - (new Test("uns016")).ok=((new com.ibm.math.BigDecimal("-0.01")).unscaledValue().toString()).equals("-1"); - (new Test("uns017")).ok=((new com.ibm.math.BigDecimal("-0.0")).unscaledValue().toString()).equals("0"); - (new Test("uns018")).ok=((new com.ibm.math.BigDecimal("-0.1")).unscaledValue().toString()).equals("-1"); - (new Test("uns019")).ok=((new com.ibm.math.BigDecimal("1.00")).unscaledValue().toString()).equals("100"); - (new Test("uns020")).ok=((new com.ibm.math.BigDecimal("1.01")).unscaledValue().toString()).equals("101"); - (new Test("uns021")).ok=((new com.ibm.math.BigDecimal("1.0")).unscaledValue().toString()).equals("10"); - (new Test("uns022")).ok=((new com.ibm.math.BigDecimal("1.1")).unscaledValue().toString()).equals("11"); - (new Test("uns023")).ok=((new com.ibm.math.BigDecimal("-1.00")).unscaledValue().toString()).equals("-100"); - (new Test("uns024")).ok=((new com.ibm.math.BigDecimal("-1.01")).unscaledValue().toString()).equals("-101"); - (new Test("uns025")).ok=((new com.ibm.math.BigDecimal("-1.0")).unscaledValue().toString()).equals("-10"); - (new Test("uns026")).ok=((new com.ibm.math.BigDecimal("-1.1")).unscaledValue().toString()).equals("-11"); - (new Test("uns027")).ok=((new com.ibm.math.BigDecimal("-111.111")).unscaledValue().toString()).equals("-111111"); - (new Test("uns028")).ok=((new com.ibm.math.BigDecimal("+111.111")).unscaledValue().toString()).equals("111111"); - summary("unscaledValue"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link BigDecimal#valueOf} method [long and double]. */ - - public void diagvalueof(){ - boolean flag=false; - java.lang.NumberFormatException e=null; - double dzer; - double dpos; - double dneg; - double dpos5; - double dneg5; - double dmin; - double dmax; - double d; - - // valueOf(long [,scale]) -- - - (new Test("val001")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)-2)).toString()).equals("-2"); - (new Test("val002")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)-1)).toString()).equals("-1"); - (new Test("val003")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)-0)).toString()).equals("0"); - (new Test("val004")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)+1)).toString()).equals("1"); - (new Test("val005")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)+2)).toString()).equals("2"); - (new Test("val006")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)10)).toString()).equals("10"); - (new Test("val007")).ok=(com.ibm.math.BigDecimal.valueOf((long)((byte)11)).toString()).equals("11"); - (new Test("val008")).ok=(com.ibm.math.BigDecimal.valueOf(lmin).toString()).equals("-9223372036854775808"); - (new Test("val009")).ok=(com.ibm.math.BigDecimal.valueOf(lmax).toString()).equals("9223372036854775807"); - (new Test("val010")).ok=(com.ibm.math.BigDecimal.valueOf(lneg).toString()).equals("-1"); - (new Test("val011")).ok=(com.ibm.math.BigDecimal.valueOf(lzer).toString()).equals("0"); - (new Test("val012")).ok=(com.ibm.math.BigDecimal.valueOf(lpos).toString()).equals("1"); - (new Test("val013")).ok=(com.ibm.math.BigDecimal.valueOf(lmin,0).toString()).equals("-9223372036854775808"); - (new Test("val014")).ok=(com.ibm.math.BigDecimal.valueOf(lmax,0).toString()).equals("9223372036854775807"); - (new Test("val015")).ok=(com.ibm.math.BigDecimal.valueOf(lneg,0).toString()).equals("-1"); - (new Test("val016")).ok=(com.ibm.math.BigDecimal.valueOf(lpos,0).toString()).equals("1"); - - (new Test("val017")).ok=(com.ibm.math.BigDecimal.valueOf(lzer,0).toString()).equals("0"); - (new Test("val018")).ok=(com.ibm.math.BigDecimal.valueOf(lzer,1).toString()).equals("0.0"); - (new Test("val019")).ok=(com.ibm.math.BigDecimal.valueOf(lzer,2).toString()).equals("0.00"); - (new Test("val020")).ok=(com.ibm.math.BigDecimal.valueOf(lzer,3).toString()).equals("0.000"); - (new Test("val021")).ok=(com.ibm.math.BigDecimal.valueOf(lzer,10).toString()).equals("0.0000000000"); - - (new Test("val022")).ok=(com.ibm.math.BigDecimal.valueOf(lmin,7).toString()).equals("-922337203685.4775808"); - (new Test("val023")).ok=(com.ibm.math.BigDecimal.valueOf(lmax,11).toString()).equals("92233720.36854775807"); - - - try{checkscale:do{ - com.ibm.math.BigDecimal.valueOf((long)23,-8); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $127){e=$127; - flag=(e.getMessage()).equals("Negative scale: -8"); - }/*checkscale*/ - (new Test("val100")).ok=flag; - - // valueOf(double) -- - - dzer=(double)0; - dpos=(double)1; - dpos=dpos/((double)10); - dneg=(double)-dpos; - (new Test("val201")).ok=(com.ibm.math.BigDecimal.valueOf(dneg).toString()).equals("-0.1"); - (new Test("val202")).ok=(com.ibm.math.BigDecimal.valueOf(dzer).toString()).equals("0.0"); // cf. constructor - (new Test("val203")).ok=(com.ibm.math.BigDecimal.valueOf(dpos).toString()).equals("0.1"); - dpos5=(double)0.5D; - dneg5=(double)-dpos5; - (new Test("val204")).ok=(com.ibm.math.BigDecimal.valueOf(dneg5).toString()).equals("-0.5"); - (new Test("val205")).ok=(com.ibm.math.BigDecimal.valueOf(dpos5).toString()).equals("0.5"); - dmin=java.lang.Double.MIN_VALUE; - dmax=java.lang.Double.MAX_VALUE; - (new Test("val206")).ok=(com.ibm.math.BigDecimal.valueOf(dmin).toString()).equals("4.9E-324"); - (new Test("val207")).ok=(com.ibm.math.BigDecimal.valueOf(dmax).toString()).equals("1.7976931348623157E+308"); - - // nasties - d=(double)9; - d=d/((double)10); - (new Test("val210")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("0.9"); - d=d/((double)10); - (new Test("val211")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("0.09"); - d=d/((double)10); - (new Test("val212")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("0.0090"); - d=d/((double)10); - (new Test("val213")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("9.0E-4"); - d=d/((double)10); - (new Test("val214")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("8.999999999999999E-5"); - d=d/((double)10); - (new Test("val215")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("8.999999999999999E-6"); - d=d/((double)10); - (new Test("val216")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("8.999999999999999E-7"); - d=d/((double)10); - (new Test("val217")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("8.999999999999999E-8"); - d=d/((double)10); - (new Test("val218")).ok=(com.ibm.math.BigDecimal.valueOf(d).toString()).equals("8.999999999999998E-9"); - - try{checkpin:do{ - com.ibm.math.BigDecimal.valueOf(java.lang.Double.POSITIVE_INFINITY); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $128){ - flag=true; - }/*checkpin*/ - (new Test("val301")).ok=flag; - try{checknin:do{ - com.ibm.math.BigDecimal.valueOf(java.lang.Double.NEGATIVE_INFINITY); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $129){ - flag=true; - }/*checknin*/ - (new Test("val302")).ok=flag; - try{checknan:do{ - com.ibm.math.BigDecimal.valueOf(java.lang.Double.NaN); - flag=false; - }while(false);} - catch (java.lang.NumberFormatException $130){ - flag=true; - }/*checknan*/ - (new Test("val303")).ok=flag; - - summary("valueOf"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test the {@link MathContext} class. */ - - public void diagmathcontext(){ - com.ibm.math.MathContext mccon1; - com.ibm.math.MathContext mccon2; - com.ibm.math.MathContext mccon3; - com.ibm.math.MathContext mccon4; - com.ibm.math.MathContext mcrmc; - com.ibm.math.MathContext mcrmd; - com.ibm.math.MathContext mcrmf; - com.ibm.math.MathContext mcrmhd; - com.ibm.math.MathContext mcrmhe; - com.ibm.math.MathContext mcrmhu; - com.ibm.math.MathContext mcrmun; - com.ibm.math.MathContext mcrmu; - boolean flag=false; - java.lang.IllegalArgumentException e=null; - // these tests are mostly existence checks - (new Test("mcn001")).ok=(com.ibm.math.MathContext.DEFAULT.getDigits())==9; - (new Test("mcn002")).ok=(com.ibm.math.MathContext.DEFAULT.getForm())==com.ibm.math.MathContext.SCIENTIFIC; - (new Test("mcn003")).ok=(com.ibm.math.MathContext.DEFAULT.getForm())!=com.ibm.math.MathContext.ENGINEERING; - (new Test("mcn004")).ok=(com.ibm.math.MathContext.DEFAULT.getForm())!=com.ibm.math.MathContext.PLAIN; - (new Test("mcn005")).ok=(com.ibm.math.MathContext.DEFAULT.getLostDigits()?1:0)==0; - (new Test("mcn006")).ok=(com.ibm.math.MathContext.DEFAULT.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - - (new Test("mcn010")).ok=com.ibm.math.MathContext.ROUND_CEILING>=0; - (new Test("mcn011")).ok=com.ibm.math.MathContext.ROUND_DOWN>=0; - (new Test("mcn012")).ok=com.ibm.math.MathContext.ROUND_FLOOR>=0; - (new Test("mcn013")).ok=com.ibm.math.MathContext.ROUND_HALF_DOWN>=0; - (new Test("mcn014")).ok=com.ibm.math.MathContext.ROUND_HALF_EVEN>=0; - (new Test("mcn015")).ok=com.ibm.math.MathContext.ROUND_HALF_UP>=0; - (new Test("mcn016")).ok=com.ibm.math.MathContext.ROUND_UNNECESSARY>=0; - (new Test("mcn017")).ok=com.ibm.math.MathContext.ROUND_UP>=0; - - mccon1=new com.ibm.math.MathContext(111); - (new Test("mcn021")).ok=(mccon1.getDigits())==111; - (new Test("mcn022")).ok=(mccon1.getForm())==com.ibm.math.MathContext.SCIENTIFIC; - (new Test("mcn023")).ok=(mccon1.getLostDigits()?1:0)==0; - (new Test("mcn024")).ok=(mccon1.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - - mccon2=new com.ibm.math.MathContext(78,com.ibm.math.MathContext.ENGINEERING); - (new Test("mcn031")).ok=(mccon2.getDigits())==78; - (new Test("mcn032")).ok=(mccon2.getForm())==com.ibm.math.MathContext.ENGINEERING; - (new Test("mcn033")).ok=(mccon2.getLostDigits()?1:0)==0; - (new Test("mcn034")).ok=(mccon2.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - - mccon3=new com.ibm.math.MathContext(5,com.ibm.math.MathContext.PLAIN,true); - (new Test("mcn041")).ok=(mccon3.getDigits())==5; - (new Test("mcn042")).ok=(mccon3.getForm())==com.ibm.math.MathContext.PLAIN; - (new Test("mcn043")).ok=(mccon3.getLostDigits()?1:0)==1; - (new Test("mcn044")).ok=(mccon3.getRoundingMode())==com.ibm.math.MathContext.ROUND_HALF_UP; - - mccon4=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.SCIENTIFIC,false,com.ibm.math.MathContext.ROUND_FLOOR); - (new Test("mcn051")).ok=(mccon4.getDigits())==0; - (new Test("mcn052")).ok=(mccon4.getForm())==com.ibm.math.MathContext.SCIENTIFIC; - (new Test("mcn053")).ok=(mccon4.getLostDigits()?1:0)==0; - (new Test("mcn054")).ok=(mccon4.getRoundingMode())==com.ibm.math.MathContext.ROUND_FLOOR; - - (new Test("mcn061")).ok=(mccon1.toString()).equals("digits=111 form=SCIENTIFIC lostDigits=0 roundingMode=ROUND_HALF_UP"); - - (new Test("mcn062")).ok=(mccon2.toString()).equals("digits=78 form=ENGINEERING lostDigits=0 roundingMode=ROUND_HALF_UP"); - - (new Test("mcn063")).ok=(mccon3.toString()).equals("digits=5 form=PLAIN lostDigits=1 roundingMode=ROUND_HALF_UP"); - - (new Test("mcn064")).ok=(mccon4.toString()).equals("digits=0 form=SCIENTIFIC lostDigits=0 roundingMode=ROUND_FLOOR"); - - - // complete testing rounding modes round trips - mcrmc=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_CEILING); - mcrmd=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_DOWN); - mcrmf=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_FLOOR); - mcrmhd=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_HALF_DOWN); - mcrmhe=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_HALF_EVEN); - mcrmhu=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_HALF_UP); - mcrmun=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_UNNECESSARY); - mcrmu=new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,com.ibm.math.MathContext.ROUND_UP); - - (new Test("mcn071")).ok=(mcrmc.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_CEILING"); - - (new Test("mcn072")).ok=(mcrmd.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_DOWN"); - - (new Test("mcn073")).ok=(mcrmf.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_FLOOR"); - - (new Test("mcn074")).ok=(mcrmhd.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_HALF_DOWN"); - - (new Test("mcn075")).ok=(mcrmhe.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_HALF_EVEN"); - - (new Test("mcn076")).ok=(mcrmhu.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_HALF_UP"); - - (new Test("mcn077")).ok=(mcrmun.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_UNNECESSARY"); - - (new Test("mcn078")).ok=(mcrmu.toString()).equals("digits=0 form=PLAIN lostDigits=0 roundingMode=ROUND_UP"); - - - // [get methods tested already] - - // errors... - - try{checkdig:do{ - new com.ibm.math.MathContext(-1); - flag=false; - }while(false);} - catch (java.lang.IllegalArgumentException $131){e=$131; - flag=(e.getMessage()).equals("Digits too small: -1"); - }/*checkdig*/ - (new Test("mcn101")).ok=flag; - try{checkdigbig:do{ - new com.ibm.math.MathContext(1000000000); - flag=false; - }while(false);} - catch (java.lang.IllegalArgumentException $132){e=$132; - flag=(e.getMessage()).equals("Digits too large: 1000000000"); - }/*checkdigbig*/ - (new Test("mcn102")).ok=flag; - - try{checkform:do{ - new com.ibm.math.MathContext(0,5); - flag=false; - }while(false);} - catch (java.lang.IllegalArgumentException $133){e=$133; - flag=(e.getMessage()).equals("Bad form value: 5"); - }/*checkform*/ - (new Test("mcn111")).ok=flag; - try{checkformneg:do{ - new com.ibm.math.MathContext(0,-1); - flag=false; - }while(false);} - catch (java.lang.IllegalArgumentException $134){e=$134; - flag=(e.getMessage()).equals("Bad form value: -1"); - }/*checkformneg*/ - (new Test("mcn112")).ok=flag; - - // [lostDigits cannot be invalid] - - try{checkround:do{ - new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,12); - flag=false; - }while(false);} - catch (java.lang.IllegalArgumentException $135){e=$135; - flag=(e.getMessage()).equals("Bad roundingMode value: 12"); - }/*checkround*/ - (new Test("mcn121")).ok=flag; - try{checkroundneg:do{ - new com.ibm.math.MathContext(0,com.ibm.math.MathContext.PLAIN,false,-1); - flag=false; - }while(false);} - catch (java.lang.IllegalArgumentException $136){e=$136; - flag=(e.getMessage()).equals("Bad roundingMode value: -1"); - }/*checkroundneg*/ - (new Test("mcn122")).ok=flag; - - summary("MathContext"); - return;} - - /* ----------------------------------------------------------------- */ - - /** Test general arithmetic (base operators). - *

    Unlike the specific method tests, these tests were randomly - * generated by an IBM Object Rexx procedure, then manually corrected - * for known differences from ANSI X3-274. These differences are: - *

      - *
    1. the trigger point in exponential notation is fixed in ANSI - * X3-274 but varies with DIGITS in Classic and Object Rexx - *
    2. some trailing zeros were missing (e.g., 1.3 + 1E-60 should show - * seven trailing zeros) - *
    3. the power operator is less accurate in Object Rexx - *
    4. ANSI X3-274 [errata 1999] rounds input numbers to DIGITS (rather - * than truncating to DIGITS+1). - *
    - */ - - public void diagmath(){ - com.ibm.math.MathContext def; - def=com.ibm.math.MathContext.DEFAULT; - mathtest(1,def,"-9375284.42","5516.99832E+27276984","5.51699832E+27276987","-5.51699832E+27276987","-5.17234284E+27276994","-1.69934516E-27276981","0","-9375284.42","6.79057752E+41"); - mathtest(2,def,"-410.832710","99.3588243E-502740862","-410.832710","-410.832710","-4.08198550E-502740858","-4.13483868E+502740862","","","1.36977786E+26"); - mathtest(3,def,"80025.2340","-8.03097581","80017.2030","80033.2650","-642680.718","-9964.57167","-9964","4.59102916","5.94544517E-40"); - mathtest(4,def,"81052020.2","-464525495","-383473475","545577515","-3.76507298E+16","-0.17448347","0","81052020.2",""); - mathtest(5,def,"715.069294E-26923151","85.4404128E+796388557","8.54404128E+796388558","-8.54404128E+796388558","6.10958157E+769465410","8.36921628E-823311708","0","7.15069294E-26923149","4.88802213E-242308334"); - mathtest(6,def,"-21971575.0E+31454441","-70944960.3E+111238221","-7.09449603E+111238228","7.09449603E+111238228","1.55877252E+142692677","3.09698884E-79783781","0","-2.19715750E+31454448","-4.04549502E-220181139"); - mathtest(7,def,"682.25316","54470185.6","54470867.9","-54469503.4","3.71624563E+10","0.0000125252586","0","682.25316","3.48578699E+154365541"); - mathtest(8,def,"-257586757.","2082888.71","-255503868","-259669646","-5.36524548E+14","-123.668036","-123","-1391445.67","-1.26879515E+17519020"); - mathtest(9,def,"319577540.E+242599761","60.7124561","3.19577540E+242599769","3.19577540E+242599769","1.94023374E+242599771","5.26378869E+242599767","","",""); - mathtest(10,def,"-13769977.0","24371.3381","-13745605.7","-13794348.3","-3.35592765E+11","-565.007015","-565","-170.9735","-8.73734001E+173982"); - mathtest(11,def,"-475.434972E-725464311","-3.22214066E-865476836","-4.75434972E-725464309","-4.75434972E-725464309","","1.47552519E+140012527","","",""); - mathtest(12,def,"842.01250","197199893","197200735","-197199051","1.66044775E+11","0.00000426984258","0","842.01250","7.00674164E+576872502"); - mathtest(13,def,"572.173103E+280128428","-7140.19428","5.72173103E+280128430","5.72173103E+280128430","-4.08542712E+280128434","-8.01341085E+280128426","","",""); - mathtest(14,def,"674235.954E+476135291","9684.82245","6.74235954E+476135296","6.74235954E+476135296","6.52985550E+476135300","6.96177919E+476135292","","",""); - mathtest(15,def,"-360557.921E+437116514","930428850","-3.60557921E+437116519","-3.60557921E+437116519","-3.35473492E+437116528","-3.87517993E+437116510","","",""); - mathtest(16,def,"957165918E-394595705","1676.59073E-829618944","9.57165918E-394595697","9.57165918E-394595697","","5.70900161E+435023244","","","9.16166595E-789191393"); - mathtest(17,def,"-2610864.40","31245912.7","28635048.3","-33856777.1","-8.15788411E+13","-0.0835585897","0","-2610864.40","-3.12008905E+200498284"); - mathtest(18,def,"959.548461","98.994577E+776775426","9.89945770E+776775427","-9.89945770E+776775427","9.49900940E+776775430","9.69293965E-776775426","0","959.548461","6.61712185E+29"); - mathtest(19,def,"-41085.0268","3115477.61","3074392.58","-3156562.64","-1.27999481E+11","-0.0131873927","0","-41085.0268","4.73844173E+14373829"); - mathtest(20,def,"-723420285.","2681660.35","-720738625","-726101945","-1.93996749E+15","-269.765813","-269","-2053650.85","4.14324113E+23757873"); - mathtest(21,def,"63542018.0E-817732230","-8836243.22","-8836243.22","8836243.22","-5.61472726E-817732216","-7.19106711E-817732230","0","6.35420180E-817732223",""); - mathtest(22,def,"-96051.7108","-291201.955","-387253.666","195150.244","2.79704460E+10","0.329845694","0","-96051.7108","3.53617153E-1450916"); - mathtest(23,def,"108490.853","91685996.5","91794487.4","-91577505.7","9.94709197E+12","0.00118328706","0","108490.853","6.98124265E+461675038"); - mathtest(24,def,"-27489.1735","-9835835.4E-506411649","-27489.1735","-27489.1735","2.70378986E-506411638","2.79479804E+506411646","","","4.05866472E-45"); - mathtest(25,def,"-89220406.6","993391.008E-611041175","-89220406.6","-89220406.6","-8.86307496E-611041162","-8.98139865E+611041176","","","3.19625913E+79"); - mathtest(26,def,"4.75502020","-17089144.9","-17089140.2","17089149.7","-81259229.2","-2.78247989E-7","0","4.75502020","1.0630191E-11571955"); - mathtest(27,def,"68027916.2","-796883.839","67231032.4","68824800.0","-5.42103470E+13","-85.3674185","-85","292789.885","8.29415374E-6241744"); - mathtest(28,def,"-8.01969439E+788605478","92154156.0","-8.01969439E+788605478","-8.01969439E+788605478","-7.39048168E+788605486","-8.70247717E+788605470","","",""); - mathtest(29,def,"-8012.98341","96188.8651","88175.8817","-104201.849","-770759780","-0.0833046881","0","-8012.98341","-1.16010156E+375502"); - mathtest(30,def,"21761476E+592330677","-9.70744506","2.17614760E+592330684","2.17614760E+592330684","-2.11248333E+592330685","-2.24173053E+592330683","","",""); - mathtest(31,def,"-9840778.51","-17907.219","-9858685.73","-9822871.29","1.76220976E+11","549.542534","549","-9715.279","-6.62997437E-125225"); - mathtest(32,def,"-4.1097614","-819.225776E-145214751","-4.10976140","-4.10976140","3.36682247E-145214748","5.01664074E+145214748","","","0.0000122876018"); - mathtest(33,def,"-448.880985","-394.087374E-442511435","-448.880985","-448.880985","1.76898329E-442511430","1.13903925E+442511435","","","2.46306099E-11"); - mathtest(34,def,"779.445304E+882688544","-797868519","7.79445304E+882688546","7.79445304E+882688546","-6.21894870E+882688555","-9.7690946E+882688537","","",""); - mathtest(35,def,"799995477","-6.23675208E+156309440","-6.23675208E+156309440","6.23675208E+156309440","-4.98937346E+156309449","-1.28271169E-156309432","0","799995477","3.81482667E-54"); - mathtest(36,def,"-51932.8170","591840275E-278480289","-51932.8170","-51932.8170","-3.07359327E-278480276","-8.7748028E+278480284","","","1.96178443E+28"); - mathtest(37,def,"70.3552392","-4228656.73","-4228586.38","4228727.09","-297508156","-0.0000166377277","0","70.3552392","9.14742382E-7811584"); - mathtest(38,def,"1588359.34","-12232799.2","-10644439.9","13821158.5","-1.94300809E+13","-0.129844307","0","1588359.34","1.56910086E-75854960"); - mathtest(39,def,"2842.16206","-3.23234345","2838.92972","2845.39440","-9186.84392","-879.288388","-879","0.93216745","4.35565514E-11"); - mathtest(40,def,"29960.2305","45.2735747E-95205475","29960.2305","29960.2305","1.35640673E-95205469","6.61759773E+95205477","","","2.413936E+22"); - mathtest(41,def,"2916565.77","1151935.43E-787118724","2916565.77","2916565.77","3.35969544E-787118712","2.53188303E+787118724","","","2916565.77"); - mathtest(42,def,"-52723012.9E-967143787","79.4088237","79.4088237","-79.4088237","-4.18667244E-967143778","-6.63944011E-967143782","0","-5.27230129E-967143780",""); - mathtest(43,def,"-167473465","793646.597","-166679819","-168267112","-1.32914746E+14","-211.017682","-211","-14033.033","-1.19053789E+6526910"); - mathtest(44,def,"-31769071.0","133.4360","-31768937.6","-31769204.4","-4.23913776E+9","-238084.707","-238084","-94.3760","-5.84252432E+997"); - mathtest(45,def,"45960.6383","-93352.7468","-47392.1085","139313.385","-4.29055183E+9","-0.492333004","0","45960.6383","1.88335323E-435248"); - mathtest(46,def,"606.175648","5.28528458E-981983620","606.175648","606.175648","3.20381081E-981983617","1.14691203E+981983622","","","8.18450516E+13"); - mathtest(47,def,"171578.617E+643006110","-407774.293","1.71578617E+643006115","1.71578617E+643006115","-6.99653492E+643006120","-4.20768597E+643006109","","",""); - mathtest(48,def,"-682286332.","-464.871699","-682286797","-682285867","3.17175606E+11","1467687.39","1467687","-182.709787","-1.6050843E-4108"); - mathtest(49,def,"492088.428","653.72170","492742.150","491434.706","321688884","752.74911","752","489.70960","3.94658596E+3722"); - mathtest(50,def,"74303782.5","1141.68058","74304924.2","74302640.8","8.48311855E+10","65082.812","65082","926.99244","4.94849869E+8988"); - mathtest(51,def,"74.7794084E+119375329","-34799355.6","7.47794084E+119375330","7.47794084E+119375330","-2.60227522E+119375338","-2.14887337E+119375323","","",""); - mathtest(52,def,"-9432.08369","33735.5058","24303.4221","-43167.5895","-318196114","-0.279589218","0","-9432.08369","2.309567E+134087"); - mathtest(53,def,"4249198.78E-112433155","418673051.","418673051","-418673051","1.77902502E-112433140","1.01492054E-112433157","0","4.24919878E-112433149",""); - mathtest(54,def,"-2960933.02","-207933.38","-3168866.40","-2752999.64","6.15676811E+11","14.2398158","14","-49865.70","-2.75680397E-1345624"); - mathtest(55,def,"29317.7519E+945600035","1.43555750","2.93177519E+945600039","2.93177519E+945600039","4.20873186E+945600039","2.04225549E+945600039","","","2.93177519E+945600039"); - mathtest(56,def,"-51.1693770","-638055.414","-638106.583","638004.245","32648898.0","0.0000801958198","0","-51.1693770","-3.48266075E-1090443"); - mathtest(57,def,"-756343055.","-68.9248344E+217100975","-6.89248344E+217100976","6.89248344E+217100976","5.21308198E+217100985","1.09734475E-217100968","0","-756343055","-7.06265897E-63"); - mathtest(58,def,"2538.80406E+694185197","-3386499.65","2.53880406E+694185200","2.53880406E+694185200","-8.59765906E+694185206","-7.49683839E+694185193","","",""); - mathtest(59,def,"-54344.0672","-8086.45235","-62430.5196","-46257.6149","439450710","6.72038427","6","-5825.35310","3.62916861E-38289"); - mathtest(60,def,"3.31600054","217481648","217481651","-217481645","721169262","1.5247266E-8","0","3.31600054","3.73134969E+113224119"); - mathtest(61,def,"681832.671","320341.161E+629467560","3.20341161E+629467565","-3.20341161E+629467565","2.18419069E+629467571","2.12845789E-629467560","0","681832.671","3.16981139E+17"); - mathtest(62,def,"832689481","348040024E-882122501","832689481","832689481","2.89809267E-882122484","2.3925107E+882122501","","","5.77363381E+26"); - mathtest(63,def,"14.5512326E+257500811","60.9979577E-647314724","1.45512326E+257500812","1.45512326E+257500812","8.87595471E-389813911","2.38552784E+904815534","","",""); - mathtest(64,def,"-901.278844","449461667.","449460766","-449462568","-4.05090292E+11","-0.00000200524074","0","-901.278844",""); - mathtest(65,def,"-5.32627675","-738860216E-238273224","-5.32627675","-5.32627675","3.93537399E-238273215","7.20877459E+238273215","","","-0.00000822306838"); - mathtest(66,def,"-505383463.","3.18756328","-505383460","-505383466","-1.61094177E+9","-158548527","-158548527","-0.23671144","-1.29081226E+26"); - mathtest(67,def,"769241.44E-720927320","-145382631.","-145382631","145382631","-1.11834344E-720927306","-5.29115091E-720927323","0","7.6924144E-720927315",""); - mathtest(68,def,"-6.45038910","56736.4411E+440937167","5.67364411E+440937171","-5.67364411E+440937171","-3.65972121E+440937172","-1.13690407E-440937171","0","-6.45038910","72030.3421"); - mathtest(69,def,"58.4721075","-712186829","-712186771","712186887","-4.16430648E+10","-8.21022028E-8","0","58.4721075",""); - mathtest(70,def,"8244.08357","245.302828E+652007959","2.45302828E+652007961","-2.45302828E+652007961","2.02229701E+652007965","3.36077804E-652007958","0","8244.08357","67964913.9"); - mathtest(71,def,"45.5361397","-76579063.9","-76579018.4","76579109.4","-3.48711495E+9","-5.94629098E-7","0","45.5361397","3.98335374E-126995367"); - mathtest(72,def,"594420.54E+685263039","-952420.179","5.94420540E+685263044","5.94420540E+685263044","-5.66138117E+685263050","-6.24115861E+685263038","","",""); - mathtest(73,def,"-841310701.","9398110.4","-831912591","-850708811","-7.90673085E+15","-89.5191337","-89","-4878875.4","1.30001466E+83877722"); - mathtest(74,def,"904392146E-140100276","168116093.","168116093","-168116093","1.52042874E-140100259","5.37956914E-140100276","0","9.04392146E-140100268",""); - mathtest(75,def,"-907324792E+685539670","-15.6902171","-9.07324792E+685539678","-9.07324792E+685539678","1.42361230E+685539680","5.78274211E+685539677","","",""); - mathtest(76,def,"987013606.","-26818.3572E+560907442","-2.68183572E+560907446","2.68183572E+560907446","-2.64700834E+560907455","-3.68036565E-560907438","0","987013606","1.0399934E-27"); - mathtest(77,def,"-741317564","630.241530E-212782946","-741317564","-741317564","-4.67209116E-212782935","-1.1762436E+212782952","","","1.65968527E+53"); - mathtest(78,def,"61867907.2","-139204670","-77336763","201072577","-8.61230161E+15","-0.444438446","0","61867907.2",""); - mathtest(79,def,"-273.622743E+531282717","-4543.68684","-2.73622743E+531282719","-2.73622743E+531282719","1.24325606E+531282723","6.02204229E+531282715","","",""); - mathtest(80,def,"-383588949.","-428640583.","-812229532","45051634","1.64421791E+17","0.89489648","0","-383588949",""); - mathtest(81,def,"-56182.2686","32.7741649","-56149.4944","-56215.0428","-1841326.94","-1714.22426","-1714","-7.3499614","-5.45476402E+156"); - mathtest(82,def,"-6366384.30","332014.980","-6034369.32","-6698399.28","-2.11373496E+12","-19.1749911","-19","-58099.680","-3.05392399E+2258994"); - mathtest(83,def,"-1.27897702","-8213776.03E-686519123","-1.27897702","-1.27897702","1.05052308E-686519116","1.55711212E+686519116","","","0.139668371"); - mathtest(84,def,"65.4059036","401162145E+884155506","4.01162145E+884155514","-4.01162145E+884155514","2.62383726E+884155516","1.63041066E-884155513","0","65.4059036","18300704.1"); - mathtest(85,def,"-20630916.8","158987411.E-480500612","-20630916.8","-20630916.8","-3.28005605E-480500597","-1.29764468E+480500611","","","4.25634728E+14"); - mathtest(86,def,"-4.72705853","-97626742.4","-97626747.1","97626737.7","461487325","4.84197097E-8","0","-4.72705853","2.92654449E-65858120"); - mathtest(87,def,"8.43528169","-4573.45752","-4565.02224","4581.89280","-38578.4025","-0.00184439927","0","8.43528169","8.84248688E-4236"); - mathtest(88,def,"1.91075189","-704247089.","-704247087","704247091","-1.34564146E+9","-2.71318394E-9","0","1.91075189","6.84547494E-198037309"); - mathtest(89,def,"31997198E-551746308","326.892584","326.892584","-326.892584","1.04596467E-551746298","9.78829119E-551746304","0","3.1997198E-551746301",""); - mathtest(90,def,"127589.213","84184304.","84311893.2","-84056714.8","1.07410091E+13","0.00151559385","0","127589.213","2.87917042E+429829394"); - mathtest(91,def,"714494248","-7025063.59","707469185","721519312","-5.01936753E+15","-101.706446","-101","4962825.41","1.65018516E-62199908"); - mathtest(92,def,"-52987680.2E+279533503","-42014114.8","-5.29876802E+279533510","-5.29876802E+279533510","2.22623048E+279533518","1.26118759E+279533503","","",""); - mathtest(93,def,"-8795.0513","-225294.394E-884414238","-8795.05130","-8795.05130","1.98147575E-884414229","3.90380388E+884414236","","","1.2927759E-8"); - mathtest(94,def,"83280.1394","161566354.","161649634","-161483074","1.34552685E+13","0.000515454718","0","83280.1394","5.30774809E+794993940"); - mathtest(95,def,"112.877897","-9.96481666","102.913080","122.842714","-1124.80755","-11.3276441","-11","3.26491374","2.97790545E-21"); - mathtest(96,def,"-572542.121E+847487397","433.843420","-5.72542121E+847487402","-5.72542121E+847487402","-2.48393632E+847487405","-1.3196976E+847487400","","",""); - mathtest(97,def,"4709649.89","20949266.4","25658916.3","-16239616.5","9.86637102E+13","0.224812163","0","4709649.89","4.85293644E+139794213"); - mathtest(98,def,"-9475.19322","-30885.2475E+584487341","-3.08852475E+584487345","3.08852475E+584487345","2.92643688E+584487349","3.06787026E-584487342","0","-9475.19322","-1.17553557E-12"); - mathtest(99,def,"-213230447.","864.815822E+127783046","8.64815822E+127783048","-8.64815822E+127783048","-1.84405064E+127783057","-2.46561686E-127783041","0","-213230447","-9.11261361E+74"); - mathtest(100,def,"-89.1168786E+403375873","6464.05744","-8.91168786E+403375874","-8.91168786E+403375874","-5.76056622E+403375878","-1.37865233E+403375871","","",""); - mathtest(101,def,"61774.4958","-14000.7706","47773.7252","75775.2664","-864890545","-4.41222112","-4","5771.4134","7.59030407E-67077"); - mathtest(102,def,"1.60731414","7.04330293E-427033419","1.60731414","1.60731414","1.13208004E-427033418","2.28204602E+427033418","","","27.7143921"); - mathtest(103,def,"7955012.51","-230117662.","-222162650","238072675","-1.83058888E+15","-0.0345693261","0","7955012.51",""); - mathtest(104,def,"4086661.08","1.77621994","4086662.86","4086659.30","7258808.90","2300762.98","2300762","1.73840572","1.67007988E+13"); - mathtest(105,def,"-610.076931","-207.658306","-817.735237","-402.418625","126687.542","2.93788841","2","-194.760319","4.36518377E-580"); - mathtest(106,def,"-98.6353697","-99253.3899E-716309653","-98.6353697","-98.6353697","9.78989481E-716309647","9.93773309E+716309649","","","1.14729007E-20"); - mathtest(107,def,"-959923730","409.125542E-900295528","-959923730","-959923730","-3.92729316E-900295517","-2.3462816E+900295534","","","8.49076677E+35"); - mathtest(108,def,"379965133","-8.15869657","379965125","379965141","-3.10002023E+9","-46571793.6","-46571793","5.19214999","2.30170697E-69"); - mathtest(109,def,"833.646797","1389499.46E-443407251","833.646797","833.646797","1.15835177E-443407242","5.99961944E+443407247","","","833.646797"); - mathtest(110,def,"2314933.4E-646489194","-7401538.17","-7401538.17","7401538.17","-1.71340679E-646489181","-3.12763826E-646489195","0","2.3149334E-646489188",""); - mathtest(111,def,"808525347","-5959.74667E+58232168","-5.95974667E+58232171","5.95974667E+58232171","-4.81860624E+58232180","-1.35664382E-58232163","0","808525347","3.5796302E-54"); - mathtest(112,def,"-17220490.6E+726428704","19.9855688","-1.72204906E+726428711","-1.72204906E+726428711","-3.44161300E+726428712","-8.61646259E+726428709","","",""); - mathtest(113,def,"59015.9705","-72070405.4E+322957279","-7.20704054E+322957286","7.20704054E+322957286","-4.25330492E+322957291","-8.18865527E-322957283","0","59015.9705","4.01063488E-34"); - mathtest(114,def,"16411470E+578192008","497470.005E-377473621","1.64114700E+578192015","1.64114700E+578192015","8.16421406E+200718399","3.29898684E+955665630","","",""); - mathtest(115,def,"-107.353544E+609689808","-659.50136E-456711743","-1.07353544E+609689810","-1.07353544E+609689810","7.07998083E+152978069","","","",""); - mathtest(116,def,"786.134163","-53.0292275E-664419768","786.134163","786.134163","-4.16880874E-664419764","-1.48245449E+664419769","","","3.33055532E-15"); - mathtest(117,def,"23.5414714","5000786.91","5000810.45","-5000763.37","117725882","0.0000047075534","0","23.5414714","4.4895618E+6860247"); - mathtest(118,def,"-69775.6113","561292120.","561222344","-561361896","-3.91645008E+13","-0.000124312473","0","-69775.6113",""); - mathtest(119,def,"919043.871","-71606613.7","-70687569.8","72525657.6","-6.58096194E+13","-0.0128346227","0","919043.871","3.05862429E-427014317"); - mathtest(120,def,"-27667.1915","-293455.107E-789181924","-27667.1915","-27667.1915","8.11907864E-789181915","9.42808315E+789181922","","","-4.72176938E-14"); - mathtest(121,def,"-908603625.","-982.409273E+449441134","-9.82409273E+449441136","9.82409273E+449441136","8.92620627E+449441145","9.2487281E-449441129","0","-908603625","2.60768632E-90"); - mathtest(122,def,"847.113351","5.71511268","852.828464","841.398238","4841.34825","148.223386","148","1.27667436","3.69529538E+17"); - mathtest(123,def,"-992140475","3.82918218","-992140471","-992140479","-3.79908663E+9","-259099836","-259099836","-0.14787752","9.68930595E+35"); - mathtest(124,def,"-12606437.5","268123145E+362798858","2.68123145E+362798866","-2.68123145E+362798866","-3.38007767E+362798873","-4.70173416E-362798860","0","-12606437.5","-2.00344362E+21"); - mathtest(125,def,"3799470.64","-264.703992","3799205.94","3799735.34","-1.00573505E+9","-14353.6583","-14353","174.242824","2.3625466E-1744"); - mathtest(126,def,"-8.11070247","-931284056.E-654288974","-8.11070247","-8.11070247","7.55336789E-654288965","8.70916067E+654288965","","","-6.58375662E-9"); - mathtest(127,def,"-242660177.","-6.09832715E-943742415","-242660177","-242660177","1.47982115E-943742406","3.97912692E+943742422","","","4.89788901E-51"); - mathtest(128,def,"76.1463803","-45.6758006E-636907996","76.1463803","76.1463803","-3.47804688E-636907993","-1.66710554E+636907996","","","3.90619287E-10"); - mathtest(129,def,"761185.862","-70878470.9E+221214712","-7.08784709E+221214719","7.08784709E+221214719","-5.39516900E+221214725","-1.07393099E-221214714","0","761185.862","6.75406144E-42"); - mathtest(130,def,"6203606.54","-195.92748E-833512061","6203606.54","6203606.54","-1.21545700E-833512052","-3.1662769E+833512065","","","2.59843292E-14"); - mathtest(131,def,"-163274837.","95.0448550E+887876533","9.50448550E+887876534","-9.50448550E+887876534","-1.55184332E+887876543","-1.71787139E-887876527","0","-163274837","1.34645731E+82"); - mathtest(132,def,"2.38638190","-807986179.","-807986177","807986181","-1.92816359E+9","-2.95349347E-9","0","2.38638190","1.19029305E-305208656"); - mathtest(133,def,"-109022296E-811981158","7.19685680","7.19685680","-7.19685680","-7.84617852E-811981150","-1.51485988E-811981151","0","-1.09022296E-811981150",""); - mathtest(134,def,"-559250.780E-273710421","-393780811.","-393780811","393780811","2.20222226E-273710407","1.42020831E-273710424","0","-5.59250780E-273710416",""); - mathtest(135,def,"-88021.9966E+555334642","7599686.64E+818884053","7.59968664E+818884059","-7.59968664E+818884059","","-1.15823192E-263549413","0","-8.80219966E+555334646",""); - mathtest(136,def,"194.317648E-197450009","-930.979064","-930.979064","930.979064","-1.80905662E-197450004","-2.08723972E-197450010","0","1.94317648E-197450007",""); - mathtest(137,def,"9495479.65","7405697.96","16901177.6","2089781.69","7.03206543E+13","1.28218565","1","2089781.69","1.0135446E+51673383"); - mathtest(138,def,"-1656.28925","-163050511E-682882380","-1656.28925","-1656.28925","2.70058809E-682882369","1.01581359E+682882375","","","3.64525265E-7"); - mathtest(139,def,"95581.3784E+64262149","-99.2879365","9.55813784E+64262153","9.55813784E+64262153","-9.49007783E+64262155","-9.62668596E+64262151","","",""); - mathtest(140,def,"643761.452","3.73446939","643765.186","643757.718","2404107.44","172383.647","172383","2.41514363","1.71751236E+23"); - mathtest(141,def,"7960.49866E-129827423","3220.22850","3220.22850","-3220.22850","2.56346247E-129827416","2.47202913E-129827423","0","7.96049866E-129827420",""); - mathtest(142,def,"-6356.64112E-707203818","1805054.98","1805054.98","-1805054.98","-1.14740867E-707203808","-3.52157756E-707203821","0","-6.35664112E-707203815",""); - mathtest(143,def,"2.3904042","8476.52006","8478.91046","-8474.12966","20262.3092","0.000282003013","0","2.3904042","2.00251752E+3208"); - mathtest(144,def,"-713298.658","-957.782729","-714256.441","-712340.875","683185135","744.739528","744","-708.307624","3.68122321E-5608"); - mathtest(145,def,"607779233.E-820497365","-20.1188742E-857318323","6.07779233E-820497357","6.07779233E-820497357","","-3.02094057E+36820965","","",""); - mathtest(146,def,"-205888251","-908.792922E+250680613","-9.08792922E+250680615","9.08792922E+250680615","1.87109785E+250680624","2.26551336E-250680608","0","-205888251","-1.5042358E-75"); - mathtest(147,def,"51542399.1","-23212.2414","51519186.9","51565611.3","-1.19641461E+12","-2220.4835","-2220","11223.1920","1.71641348E-179015"); - mathtest(148,def,"4.44287230","158923023","158923027","-158923019","706074697","2.79561275E-8","0","4.44287230","7.12573416E+102928693"); - mathtest(149,def,"-79123682.6","-3.8571770","-79123686.5","-79123678.8","305194049","20513365.8","20513365","-2.9293950","2.55137345E-32"); - mathtest(150,def,"-80.3324347E-569715030","883142.351","883142.351","-883142.351","-7.09449752E-569715023","-9.09620455E-569715035","0","-8.03324347E-569715029",""); - mathtest(151,def,"13637.483","-52798.5631","-39161.0801","66436.0461","-720039507","-0.258292692","0","13637.483","1.47163791E-218310"); - mathtest(152,def,"6.42934843E-276476458","84057440.0E-388039782","6.42934843E-276476458","6.42934843E-276476458","5.40434570E-664516232","7.64875593E+111563316","","",""); - mathtest(153,def,"-5.64133087","-17401297.","-17401302.6","17401291.4","98166473.9","3.24190253E-7","0","-5.64133087","-1.25908916E-13075014"); - mathtest(154,def,"95469.7057E+865733824","198.829749","9.54697057E+865733828","9.54697057E+865733828","1.89822176E+865733831","4.80158056E+865733826","","",""); - mathtest(155,def,"-416466.209","-930153427","-930569893","929736961","3.87377472E+14","0.000447739262","0","-416466.209",""); - mathtest(156,def,"-1541733.85","-1.99208708","-1541735.84","-1541731.86","3071268.08","773928.944","773928","-1.88034976","4.20708401E-13"); - mathtest(157,def,"-39152691.8","-645131748.","-684284440","605979056","2.52586445E+16","0.0606894513","0","-39152691.8",""); - mathtest(158,def,"113.939979","-58282550.4","-58282436.5","58282664.3","-6.64071257E+9","-0.0000019549587","0","113.939979","2.106557E-119868330"); - mathtest(159,def,"-324971.736","-9517.15154","-334488.888","-315454.585","3.09280526E+9","34.1459033","34","-1388.58364","-5.82795263E-52457"); - mathtest(160,def,"-76.9436744","-9548122.75E-273599728","-76.9436744","-76.9436744","7.34667648E-273599720","8.05851332E+273599722","","","1.37489895E-19"); - mathtest(161,def,"-430393.282","-70.2551505","-430463.537","-430323.027","30237344.8","6126.14561","6126","-10.2300370","4.26006409E-395"); - mathtest(162,def,"-3308051.90","-349433799.E+397813188","-3.49433799E+397813196","3.49433799E+397813196","1.15594514E+397813203","9.46689161E-397813191","0","-3308051.90","-2.76237768E-20"); - mathtest(163,def,"23.1543212E-655822712","5848.20853","5848.20853","-5848.20853","1.35411299E-655822707","3.95921607E-655822715","0","2.31543212E-655822711",""); - mathtest(164,def,"-174.261308E-82902077","-200096204.","-200096204","200096204","3.48690262E-82902067","8.70887626E-82902084","0","-1.74261308E-82902075",""); - mathtest(165,def,"-50669105.2","9105789.01E+609889700","9.10578901E+609889706","-9.10578901E+609889706","-4.61382181E+609889714","-5.56449366E-609889700","0","-50669105.2","-2.20135008E+69"); - mathtest(166,def,"424768856.","-971.71757","424767884","424769828","-4.12755361E+11","-437132.012","-437132","11.19076","2.72651473E-8387"); - mathtest(167,def,"7181.2767","999117.918","1006299.19","-991936.641","7.17494223E+9","0.00718761677","0","7181.2767","3.09655124E+3852800"); - mathtest(168,def,"8096417.07E-433694528","-68.4863363","-68.4863363","68.4863363","-5.54493942E-433694520","-1.18219451E-433694523","0","8.09641707E-433694522",""); - mathtest(169,def,"1236287.5","-7119.97299E-176200498","1236287.50","1236287.50","-8.80233361E-176200489","-1.73636544E+176200500","","","2.26549784E-43"); - mathtest(170,def,"-752995833E-654401067","-15.2736930E+803939983","-1.52736930E+803939984","1.52736930E+803939984","1.15010272E+149538926","","0","-7.52995833E-654401059",""); - mathtest(171,def,"702992.459","-312.689474","702679.770","703305.148","-219818342","-2248.21274","-2248","66.521448","8.02493322E-1831"); - mathtest(172,def,"-4414.38805","-17680.4630E-584364536","-4414.38805","-4414.38805","7.80484246E-584364529","2.49676044E+584364535","","","5.13167312E-8"); - mathtest(173,def,"9.46350807","7826.65424","7836.11775","-7817.19073","74067.6056","0.00120913839","0","9.46350807","3.63271495E+7639"); - mathtest(174,def,"2078153.7","-16934607.3E+233594439","-1.69346073E+233594446","1.69346073E+233594446","-3.51927168E+233594452","-1.2271638E-233594440","0","2078153.7","2.31549939E-13"); - mathtest(175,def,"-9359.74629","7.07761788E+252457696","7.07761788E+252457696","-7.07761788E+252457696","-6.62447077E+252457700","-1.32244301E-252457693","0","-9359.74629","-6.29286677E+27"); - mathtest(176,def,"66.2319284E+730468479","25.9391685E+221147044","6.62319284E+730468480","6.62319284E+730468480","1.71800115E+951615526","2.55335588E+509321435","","",""); - mathtest(177,def,"317997088.E-90968742","-977426.461","-977426.461","977426.461","-3.10818768E-90968728","-3.2534119E-90968740","0","3.17997088E-90968734",""); - mathtest(178,def,"227473386","-6759.61390","227466626","227480146","-1.53763226E+12","-33651.8312","-33651","5618.65110","1.40992627E-56493"); - mathtest(179,def,"-392019.462","-245456.503","-637475.965","-146562.959","9.62237263E+10","1.59710359","1","-146562.959","-3.08656533E-1372917"); - mathtest(180,def,"-3619556.28E+587673583","-3.45236972","-3.61955628E+587673589","-3.61955628E+587673589","1.24960465E+587673590","1.04842661E+587673589","","",""); - mathtest(181,def,"-249.400704E-923930848","831102.919","831102.919","-831102.919","-2.07277653E-923930840","-3.00084019E-923930852","0","-2.49400704E-923930846",""); - mathtest(182,def,"65234.2739E+154949914","-694581895","6.52342739E+154949918","6.52342739E+154949918","-4.53105456E+154949927","-9.39187652E+154949909","","",""); - mathtest(183,def,"45.2316213","-88775083.4","-88775038.2","88775128.6","-4.01544095E+9","-5.09508069E-7","0","45.2316213","1.92314254E-146962015"); - mathtest(184,def,"331100375.","442.343378","331100817","331099933","1.46460058E+11","748514.37","748514","163.759708","6.64011043E+3765"); - mathtest(185,def,"81.8162765","5.61239515E+467372163","5.61239515E+467372163","-5.61239515E+467372163","4.59185273E+467372165","1.45777826E-467372162","0","81.8162765","2.99942677E+11"); - mathtest(186,def,"-5738.13069E+789464078","33969715.0","-5.73813069E+789464081","-5.73813069E+789464081","-1.94922664E+789464089","-1.68919012E+789464074","","",""); - mathtest(187,def,"-7413.03911","2.70630320E-254858264","-7413.03911","-7413.03911","-2.00619315E-254858260","-2.73917539E+254858267","","","-4.07369842E+11"); - mathtest(188,def,"-417696.182","27400.6002","-390295.582","-445096.782","-1.14451261E+10","-15.2440523","-15","-6687.1790","-1.58020334E+154017"); - mathtest(189,def,"68.8538735E+655647287","3198.17933E-132454826","6.88538735E+655647288","6.88538735E+655647288","2.20207035E+523192466","2.15290846E+788102111","","",""); - mathtest(190,def,"-6817.04246","434420.439","427603.397","-441237.481","-2.96146258E+9","-0.0156922692","0","-6817.04246","5.94143518E+1665390"); - mathtest(191,def,"8578.27511","647042.341E-490924334","8578.27511","8578.27511","5.55050721E-490924325","1.3257672E+490924332","","","3.98473846E+23"); - mathtest(192,def,"4124.11615E+733109424","597385828E+375928745","4.12411615E+733109427","4.12411615E+733109427","","6.9036056E+357180673","","",""); - mathtest(193,def,"102.714400","-919017.468","-918914.754","919120.182","-94396327.8","-0.000111765449","0","102.714400","4.04295689E-1848724"); - mathtest(194,def,"-4614.33015E+996778733","-433.560812E+22860599","-4.61433015E+996778736","-4.61433015E+996778736","","1.06428672E+973918135","","",""); - mathtest(195,def,"457455170.","3709230.48E+677010879","3.70923048E+677010885","-3.70923048E+677010885","1.69680666E+677010894","1.23328861E-677010877","0","457455170","4.37919376E+34"); - mathtest(196,def,"-2522468.15","-48482043.5","-51004511.7","45959575.4","1.22294411E+14","0.0520289156","0","-2522468.15","1.42348178E-310373595"); - mathtest(197,def,"-659811384","62777.6118","-659748606","-659874162","-4.14213829E+13","-10510.2976","-10510","-18683.9820","3.4393524E+553665"); - mathtest(198,def,"4424.94176","-825848.20","-821423.258","830273.142","-3.65433019E+9","-0.00535805704","0","4424.94176","3.42152775E-3010966"); - mathtest(199,def,"43.6441884","-6509.89663E-614169377","43.6441884","43.6441884","-2.84119155E-614169372","-6.70428286E+614169374","","","3.31524056E-12"); - mathtest(200,def,"897.388381E-843864876","84195.1369","84195.1369","-84195.1369","7.55557376E-843864869","1.06584348E-843864878","0","8.97388381E-843864874",""); - mathtest(201,def,"796199825","496.76834","796200322","796199328","3.95526865E+11","1602758.79","1602758","393.91828","6.42647264E+4423"); - mathtest(202,def,"573583582","1598.69521","573585181","573581983","9.16985325E+11","358782.323","358782","517.16578","9.91156302E+14004"); - mathtest(203,def,"-783144270.","6347.71496","-783137922","-783150618","-4.97117660E+12","-123374.202","-123374","-1284.52496","1.28110803E+56458"); - mathtest(204,def,"26909234.7","52411.5081","26961646.2","26856823.2","1.41035357E+12","513.422255","513","22131.0447","9.75836528E+389415"); - mathtest(205,def,"8.21915282","24859.7841E-843282959","8.21915282","8.21915282","2.04326365E-843282954","3.30620443E+843282955","","","67.5544731"); - mathtest(206,def,"-688.387710","82783.5207E-831870858","-688.387710","-688.387710","-5.69871582E-831870851","-8.31551623E+831870855","","","5.04272012E+22"); - mathtest(207,def,"-9792232.","-1749.01166","-9793981.01","-9790482.99","1.71267279E+10","5598.72311","5598","-1264.72732","-8.86985674E-12228"); - mathtest(208,def,"-130.765600","8.67437427","-122.091226","-139.439974","-1134.30976","-15.0749317","-15","-0.64998595","-1.11799947E+19"); - mathtest(209,def,"917.259102","-368640.426","-367723.167","369557.685","-338138786","-0.00248822169","0","917.259102","8.67104255E-1092094"); - mathtest(210,def,"-4.9725631","-294563717.","-294563722","294563712","1.46473667E+9","1.6881112E-8","0","-4.9725631","-6.27962584E-205187284"); - mathtest(211,def,"-60962887.2E-514249661","-243021.407","-243021.407","243021.407","1.48152866E-514249648","2.5085398E-514249659","0","-6.09628872E-514249654",""); - mathtest(212,def,"-55389219.8","-3772200E+981866393","-3.77220000E+981866399","3.77220000E+981866399","2.08939215E+981866407","1.46835321E-981866392","0","-55389219.8","1.06242678E-31"); - mathtest(213,def,"681.666010","626886700","626887382","-626886018","4.27327356E+11","0.00000108738311","0","681.666010",""); - mathtest(214,def,"6.42652138","53465894.5","53465900.9","-53465888.1","343599714","1.2019852E-7","0","6.42652138","4.61155532E+43199157"); - mathtest(215,def,"561546656","651408.476","562198064","560895248","3.65796251E+14","862.049968","862","32549.688","8.6052377E+5699419"); - mathtest(216,def,"7845778.36E-79951139","9.45859047","9.45859047","-9.45859047","7.42100044E-79951132","8.29487056E-79951134","0","7.84577836E-79951133","1.12648216E-719560189"); - mathtest(217,def,"54486.2112","10.7565078","54496.9677","54475.4547","586081.356","5065.41828","5065","4.4991930","1.25647168E+52"); - mathtest(218,def,"16576482.5","-2217720.83","14358761.7","18794203.3","-3.67620105E+13","-7.47455779","-7","1052436.69","1.38259374E-16010820"); - mathtest(219,def,"61.2793787E-392070111","6.22575651","6.22575651","-6.22575651","3.81510491E-392070109","9.84288072E-392070111","0","6.12793787E-392070110",""); - mathtest(220,def,"5115136.39","-653674372.","-648559236","658789508","-3.34363357E+15","-0.00782520565","0","5115136.39",""); - mathtest(221,def,"-7.84238366E-416477339","-37432758.9E+97369393","-3.74327589E+97369400","3.74327589E+97369400","2.93562057E-319107938","2.09505895E-513846739","0","-7.84238366E-416477339",""); - mathtest(222,def,"-387781.3E+284108380","-218085.592","-3.87781300E+284108385","-3.87781300E+284108385","8.45695144E+284108390","1.77811517E+284108380","","",""); - mathtest(223,def,"-5353.17736","3.39332346E+546685359","3.39332346E+546685359","-3.39332346E+546685359","-1.81650623E+546685363","-1.57756177E-546685356","0","-5353.17736","-1.53403369E+11"); - mathtest(224,def,"-20837.2900E-168652772","-8236.78305E-712819173","-2.08372900E-168652768","-2.08372900E-168652768","1.71632237E-881471937","2.52978497E+544166401","","",""); - mathtest(225,def,"-98573.8722E+829022366","309011.007","-9.85738722E+829022370","-9.85738722E+829022370","-3.04604115E+829022376","-3.18997932E+829022365","","",""); - mathtest(226,def,"49730750.7","-5315.10636E-299586991","49730750.7","49730750.7","-2.64324229E-299586980","-9.35649211E+299586994","","","3.28756936E-39"); - mathtest(227,def,"1539523.40","-962388.581","577134.82","2501911.98","-1.48161974E+12","-1.59969001","-1","577134.819","3.10144834E-5954673"); - mathtest(228,def,"81596.2121","-37600.9653","43995.2468","119197.177","-3.06809634E+9","-2.17005631","-2","6394.2815","1.97878299E-184684"); - mathtest(229,def,"590146199","-1425404.61","588720794","591571604","-8.41197113E+14","-414.020128","-414","28690.46","2.04650994E-12502170"); - mathtest(230,def,"196.05543","505.936305","701.991735","-309.880875","99191.5598","0.387510104","0","196.05543","8.78437397E+1159"); - mathtest(231,def,"77.8058449","-642.275274","-564.469429","720.081119","-49972.7704","-0.121140963","0","77.8058449","9.33582626E-1215"); - mathtest(232,def,"1468.60684","10068.138","11536.7448","-8599.5312","14786136.3","0.145866777","0","1468.60684","2.54122484E+31884"); - mathtest(233,def,"4.98774767E-387968632","4.41731439E-578812376","4.98774767E-387968632","4.98774767E-387968632","2.20324496E-966781007","1.12913577E+190843744","","",""); - mathtest(234,def,"981.091059","-92238.9930","-91257.9020","93220.0841","-90494851.3","-0.0106364025","0","981.091059","5.29943342E-275953"); - mathtest(235,def,"-3606.24992","8290224.70","8286618.45","-8293830.95","-2.98966222E+10","-0.000435000262","0","-3606.24992","-1.23747107E+29488793"); - mathtest(236,def,"-8978571.35","92243.4796","-8886327.87","-9070814.83","-8.28214663E+11","-97.3355666","-97","-30953.8288","-4.95762813E+641384"); - mathtest(237,def,"-61968.1992E+810060478","474294671.E+179263414","-6.19681992E+810060482","-6.19681992E+810060482","-2.93911867E+989323905","-1.30653374E+630797060","","",""); - mathtest(238,def,"61298431.6E-754429041","-2584862.79","-2584862.79","2584862.79","-1.58448035E-754429027","-2.37143851E-754429040","0","6.12984316E-754429034",""); - mathtest(239,def,"621039.064","-5351539.62","-4730500.56","5972578.68","-3.32351516E+12","-0.116048672","0","621039.064","2.41163312E-31002108"); - mathtest(240,def,"-19.6007605","-57905696.","-57905715.6","57905676.4","1.13499568E+9","3.38494515E-7","0","-19.6007605","1.05663646E-74829963"); - mathtest(241,def,"3626.13109E+687030346","189.896004","3.62613109E+687030349","3.62613109E+687030349","6.88587804E+687030351","1.90953523E+687030347","","",""); - mathtest(242,def,"-249334.026","-7.54735834E-14137188","-249334.026","-249334.026","1.88181324E-14137182","3.30359332E+14137192","","","6.69495408E-44"); - mathtest(243,def,"417613928.","-925213.216","416688715","418539141","-3.86381925E+14","-451.370474","-451","342767.584","8.38430085E-7976054"); - mathtest(244,def,"23.8320309","-50074996.1","-50074972.3","50075019.9","-1.19338885E+9","-4.75926765E-7","0","23.8320309","5.81466387E-68961335"); - mathtest(245,def,"49789677.7","-131827812E+156412534","-1.31827812E+156412542","1.31827812E+156412542","-6.56366427E+156412549","-3.77687204E-156412535","0","49789677.7","2.00844843E-8"); - mathtest(246,def,"-8907163.61E-741867246","773651.288E-472033282","7.73651288E-472033277","-7.73651288E-472033277","","-1.15131504E-269833963","0","-8.90716361E-741867240",""); - mathtest(247,def,"514021711.E+463536646","617441659.","5.14021711E+463536654","5.14021711E+463536654","3.17378418E+463536663","8.32502478E+463536645","","",""); - mathtest(248,def,"998175750","2.39285478","998175752","998175748","2.38848961E+9","417148487","417148486","1.30513692","9.96354828E+17"); - mathtest(249,def,"873575426.","647853.152E+497450781","6.47853152E+497450786","-6.47853152E+497450786","5.65948593E+497450795","1.3484158E-497450778","0","873575426","4.44429064E+53"); - mathtest(250,def,"4352626.8","-130338048.E-744560911","4352626.80","4352626.80","-5.67312881E-744560897","-3.33949055E+744560909","","","2.29746322E-7"); - mathtest(251,def,"437.286960","7.37560835","444.662568","429.911352","3225.25735","59.2882565","59","2.12606735","3.05749452E+18"); - mathtest(252,def,"8498280.45E+220511522","588617612","8.49828045E+220511528","8.49828045E+220511528","5.00223754E+220511537","1.44376931E+220511520","","",""); - mathtest(253,def,"-5320387.77","-7673237.46","-12993625.2","2352849.69","4.08245987E+13","0.693369363","0","-5320387.77","-1.30113745E-51609757"); - mathtest(254,def,"587655375","-4.9748366","587655370","587655380","-2.92348947E+9","-118125563","-118125563","0.7919942","1.42687667E-44"); - mathtest(255,def,"1266098.44","-2661.64904E-642601142","1266098.44","1266098.44","-3.36990970E-642601133","-4.75681963E+642601144","","","4.92717036E-19"); - mathtest(256,def,"3.92737463E+482873483","-685.522747","3.92737463E+482873483","3.92737463E+482873483","-2.69230464E+482873486","-5.72902161E+482873480","","",""); - mathtest(257,def,"22826494.1","986189474.","1.00901597E+9","-963362980","2.25112482E+16","0.0231461547","0","22826494.1",""); - mathtest(258,def,"-647342.380","-498816386","-499463728","498169044","3.22904986E+14","0.00129775685","0","-647342.380",""); - mathtest(259,def,"393092373.","-25.7226822","393092347","393092399","-1.01113902E+10","-15281935.6","-15281935","15.5939430","3.49252839E-224"); - mathtest(260,def,"2.96253492","20.7444888","23.7070237","-17.7819539","61.4562725","0.142810698","0","2.96253492","8.03402246E+9"); - mathtest(261,def,"53553.3750E+386955423","-732470876","5.35533750E+386955427","5.35533750E+386955427","-3.92262875E+386955436","-7.31133165E+386955418","","",""); - mathtest(262,def,"-696451.406E-286535917","-73086090.8","-73086090.8","73086090.8","5.09009107E-286535904","9.52919219E-286535920","0","-6.96451406E-286535912",""); - mathtest(263,def,"1551.29957","-580358622.E+117017265","-5.80358622E+117017273","5.80358622E+117017273","-9.00310081E+117017276","-2.67300168E-117017271","0","1551.29957","7.17506711E-20"); - mathtest(264,def,"-205123006.E-213752799","-78638468.6","-78638468.6","78638468.6","1.61305591E-213752783","2.60843083E-213752799","0","-2.05123006E-213752791",""); - mathtest(265,def,"77632.8073","-3378542.88E+677441319","-3.37854288E+677441325","3.37854288E+677441325","-2.62285768E+677441330","-2.29781921E-677441321","0","77632.8073","2.13729331E-15"); - mathtest(266,def,"3068999.37","2.21006212","3069001.58","3068997.16","6782679.25","1388648.46","1388648","1.02718624","9.41875713E+12"); - mathtest(267,def,"625524274.","55.2468624","625524329","625524219","3.45582535E+10","11322349.3","11322349","16.7522224","6.21482943E+483"); - mathtest(268,def,"61269134.9","-845761303.","-784492168","907030438","-5.18190634E+16","-0.0724425848","0","61269134.9",""); - mathtest(269,def,"-2840.12099","-2856.76731E-82743650","-2840.12099","-2840.12099","8.11356480E-82743644","9.94173022E+82743649","","","-4.36505254E-11"); - mathtest(270,def,"8.9538781","-7.56603391","1.38784419","16.5199120","-67.7453453","-1.18343087","-1","1.38784419","2.42053061E-8"); - mathtest(271,def,"-56233547.2","509752530","453518983","-565986077","-2.86651930E+16","-0.110315386","0","-56233547.2",""); - mathtest(272,def,"-3167.47853E-854859497","-110852115","-110852115","110852115","3.51121694E-854859486","2.85739116E-854859502","0","-3.16747853E-854859494",""); - mathtest(273,def,"-5652.52092","-632243244.","-632248897","632237592","3.57376816E+12","0.00000894042123","0","-5652.52092",""); - mathtest(274,def,"-946.009928","820090.66E-589278015","-946.009928","-946.009928","-7.75813906E-589278007","-1.15354311E+589278012","","","6.41454053E+23"); - mathtest(275,def,"-367.757758","-959.626016","-1327.38377","591.868258","352909.912","0.383230292","0","-367.757758","1.14982199E-2463"); - mathtest(276,def,"809926721.E-744611554","-67.6560549","-67.6560549","67.6560549","-5.47964467E-744611544","-1.19712378E-744611547","0","8.09926721E-744611546",""); - mathtest(277,def,"-1725.08555","75586.3031","73861.2176","-77311.3887","-130392839","-0.0228227269","0","-1725.08555","3.70540587E+244657"); - mathtest(278,def,"2659.84191E+29314492","-74372.4551E+518196680","-7.43724551E+518196684","7.43724551E+518196684","-1.97818973E+547511180","-3.5763804E-488882190","0","2.65984191E+29314495","1.06171811E-205201468"); - mathtest(279,def,"-91.1431113","12147507.0","12147415.9","-12147598.1","-1.10716158E+9","-0.00000750303015","0","-91.1431113","-1.52417006E+23805759"); - mathtest(280,def,"-1136778.91E+697783878","-801552569.","-1.13677891E+697783884","-1.13677891E+697783884","9.11188056E+697783892","1.41822128E+697783875","","",""); - mathtest(281,def,"73123773.0E+433334149","63.3548930","7.31237730E+433334156","7.31237730E+433334156","4.63274881E+433334158","1.15419298E+433334155","","",""); - mathtest(282,def,"-9765484.8","7979.90802E-234029715","-9765484.80","-9765484.80","-7.79276705E-234029705","-1.22375907E+234029718","","","8.27085614E+55"); - mathtest(283,def,"-695010288","-8.26582820","-695010296","-695010280","5.74483564E+9","84082353.4","84082353","-3.45024540","1.83683495E-71"); - mathtest(284,def,"23975643.3E-155955264","-505547.692E+137258948","-5.05547692E+137258953","5.05547692E+137258953","-1.21208311E-18696303","-4.7425087E-293214211","0","2.39756433E-155955257","1.26225952E+779776283"); - mathtest(285,def,"2862.95921","-32601248.6E-605861333","2862.95921","2862.95921","-9.33360449E-605861323","-8.78174712E+605861328","","","4.26142175E-11"); - mathtest(286,def,"-13.133518E+246090516","-8.71269925E-945092108","-1.31335180E+246090517","-1.31335180E+246090517","1.14428392E-699001590","","","",""); - mathtest(287,def,"-34671.2232","817710.762","783039.539","-852381.985","-2.83510323E+10","-0.0424003508","0","-34671.2232","-5.30788828E+3712382"); - mathtest(288,def,"-22464769","62.4366060","-22464706.6","-22464831.4","-1.40262393E+9","-359801.252","-359801","-15.7245940","6.21042536E+455"); - mathtest(289,def,"-9458.60887E-563051963","5676056.01","5676056.01","-5676056.01","-5.36875937E-563051953","-1.66640513E-563051966","0","-9.45860887E-563051960",""); - mathtest(290,def,"-591.924123E-95331874","-134.596188","-134.596188","134.596188","7.96707305E-95331870","4.39777777E-95331874","0","-5.91924123E-95331872",""); - mathtest(291,def,"-182566085.E+68870646","-960345993.","-1.82566085E+68870654","-1.82566085E+68870654","1.75326608E+68870663","1.9010449E+68870645","","",""); - mathtest(292,def,"8232.54893","-99822004E+891979845","-9.98220040E+891979852","9.98220040E+891979852","-8.21789532E+891979856","-8.24722867E-891979850","0","8232.54893","6.99289156E-40"); - mathtest(293,def,"-4336.94317","-819373.601E+563233430","-8.19373601E+563233435","8.19373601E+563233435","3.55357674E+563233439","5.29299841E-563233433","0","-4336.94317","7.98969405E-30"); - mathtest(294,def,"-2.09044362E-876527908","-6515463.33","-6515463.33","6515463.33","1.36202087E-876527901","3.20843433E-876527915","0","-2.09044362E-876527908",""); - mathtest(295,def,"-194343.344","1.95929977","-194341.385","-194345.303","-380776.869","-99190.2041","-99190","-0.39981370","3.77693354E+10"); - mathtest(296,def,"-326002.927","4215.99030","-321786.937","-330218.917","-1.37442518E+9","-77.3253503","-77","-1371.67390","5.51875821E+23243"); - mathtest(297,def,"-12037.8590E+876429044","314.81827","-1.20378590E+876429048","-1.20378590E+876429048","-3.78973794E+876429050","-3.82374854E+876429045","","",""); - mathtest(298,def,"21036045.4E-162804809","-91.7149219","-91.7149219","91.7149219","-1.92931926E-162804800","-2.2936339E-162804804","0","2.10360454E-162804802",""); - mathtest(299,def,"-947019.534","9916.29280","-937103.241","-956935.827","-9.39092299E+9","-95.5013686","-95","-4971.71800","3.76029022E+59261"); - mathtest(300,def,"-5985.84136","-12.4090184E-12364204","-5985.84136","-5985.84136","7.42784156E-12364200","4.82378313E+12364206","","","-0.000167060893"); - mathtest(301,def,"-85344379.4","-6783.08669E+218840215","-6.78308669E+218840218","6.78308669E+218840218","5.78898324E+218840226","1.25819385E-218840211","0","-85344379.4","-3.03232347E-56"); - mathtest(302,def,"-94.1947070E-938257103","15003.240","15003.2400","-15003.2400","-1.41322580E-938257097","-6.27829102E-938257106","0","-9.41947070E-938257102",""); - mathtest(303,def,"-4846233.6","-8289769.76","-13136003.4","3443536.16","4.01741607E+13","0.584604125","0","-4846233.6","4.25077524E-55420465"); - mathtest(304,def,"67.9147198","-108373645.E+291715415","-1.08373645E+291715423","1.08373645E+291715423","-7.36016573E+291715424","-6.26671916E-291715422","0","67.9147198","0.0147243485"); - mathtest(305,def,"1958.77994","5.57285137E+690137826","5.57285137E+690137826","-5.57285137E+690137826","1.09159895E+690137830","3.51486126E-690137824","0","1958.77994","5.64824968E+19"); - mathtest(306,def,"22780314.3","8805279.83","31585594.1","13975034.5","2.00587042E+14","2.58711986","2","5169754.64","2.39132169E+64785373"); - mathtest(307,def,"596745.184","197602423.","198199168","-197005678","1.17918294E+14","0.00301992848","0","596745.184",""); - mathtest(308,def,"171.340497","-480349.924","-480178.584","480521.264","-82303394.7","-0.000356699332","0","171.340497","2.17914102E-1073035"); - mathtest(309,def,"824.65555","-379287.530","-378462.875","380112.186","-312781567","-0.00217422268","0","824.65555","6.35829256E-1106108"); - mathtest(310,def,"19.3164031","-9207644.24E+988115069","-9.20764424E+988115075","9.20764424E+988115075","-1.77858568E+988115077","-2.09786592E-988115075","0","19.3164031","2.67093711E-12"); - mathtest(311,def,"-3123.77646E+177814265","973284435.E+383256112","9.73284435E+383256120","-9.73284435E+383256120","-3.04032301E+561070389","-3.20952062E-205441853","0","-3.12377646E+177814268",""); - mathtest(312,def,"-850.123915E+662955309","6774849.81E-846576865","-8.50123915E+662955311","-8.50123915E+662955311","-5.75946184E-183621547","","","",""); - mathtest(313,def,"-23349.7724","2921.35355","-20428.4189","-26271.1260","-68212940.5","-7.99279238","-7","-2900.29755","-5.6705546E+12759"); - mathtest(314,def,"18886653.3","568707476.","587594129","-549820823","1.07409809E+16","0.0332097855","0","18886653.3",""); - mathtest(315,def,"-90552818.0","-542.03563E-986606878","-90552818.0","-90552818.0","4.90828538E-986606868","1.67060638E+986606883","","","-1.64244241E-40"); - mathtest(316,def,"41501126.1E+791838765","-69.6651675E+204268348","4.15011261E+791838772","4.15011261E+791838772","-2.89118290E+996107122","-5.95722763E+587570422","","",""); - mathtest(317,def,"76783193.3E-271488154","3765.01829E-520346003","7.67831933E-271488147","7.67831933E-271488147","2.89090127E-791834146","2.03938434E+248857853","","",""); - mathtest(318,def,"4192.9928","987822007E-146560989","4192.99280","4192.99280","4.14193056E-146560977","4.24468454E+146560983","","","1.67973653E+36"); - mathtest(319,def,"-891845.629","48277955.","47386109.4","-49169800.6","-4.30564831E+13","-0.0184731443","0","-891845.629","-6.32964147E+287267817"); - mathtest(320,def,"334.901176","-7609296.55E+447340228","-7.60929655E+447340234","7.60929655E+447340234","-2.54836236E+447340237","-4.40121073E-447340233","0","334.901176","6.31926575E-21"); - mathtest(321,def,"4.49868636","-341880896E-447251873","4.49868636","4.49868636","-1.53801492E-447251864","-1.31586363E+447251865","","","0.010983553"); - mathtest(322,def,"807615.58","-314286480","-313478865","315094096","-2.53822658E+14","-0.00256967968","0","807615.58",""); - mathtest(323,def,"-37.7457954","53277.8129E-859225538","-37.7457954","-37.7457954","-2.01101343E-859225532","-7.08471188E+859225534","","","-76620134.1"); - mathtest(324,def,"-28671081.","98.8819623","-28670982.1","-28671179.9","-2.83505275E+9","-289952.589","-289952","-58.2671904","-1.93625566E+738"); - mathtest(325,def,"-89752.2106E-469496896","99.9879961","99.9879961","-99.9879961","-8.97414368E-469496890","-8.97629857E-469496894","0","-8.97522106E-469496892",""); - mathtest(326,def,"-497983567E-13538052","39.4578742","39.4578742","-39.4578742","-1.96493729E-13538042","-1.26206385E-13538045","0","-4.97983567E-13538044","-1.55376543E-527983689"); - mathtest(327,def,"845739221E-654202565","-33313.1551","-33313.1551","33313.1551","-2.81742418E-654202552","-2.53875449E-654202561","0","8.45739221E-654202557",""); - mathtest(328,def,"742.332067E+537827843","-4532.70023E-855387414","7.42332067E+537827845","7.42332067E+537827845","-3.36476873E-317559565","","","",""); - mathtest(329,def,"-893.48654","670389960","670389067","-670390853","-5.98984406E+11","-0.00000133278628","0","-893.48654",""); - mathtest(330,def,"1.37697162","-915.737474E-351578724","1.37697162","1.37697162","-1.26094451E-351578721","-1.50367508E+351578721","","","0.0561920784"); - mathtest(331,def,"-65.2839808E+550288403","-121389.306","-6.52839808E+550288404","-6.52839808E+550288404","7.92477712E+550288409","5.37806689E+550288399","","",""); - mathtest(332,def,"-30346603.E+346067390","792661.544","-3.03466030E+346067397","-3.03466030E+346067397","-2.40545852E+346067403","-3.82844396E+346067391","","",""); - mathtest(333,def,"-61170.7065","-453731131.","-453792302","453669960","2.77550538E+13","0.000134817081","0","-61170.7065",""); - mathtest(334,def,"6569.51133","13.8706351E+399434914","1.38706351E+399434915","-1.38706351E+399434915","9.11232944E+399434918","4.73627291E-399434912","0","6569.51133","6569.51133"); - mathtest(335,def,"300703925.","-3156736.8","297547188","303860662","-9.49243146E+14","-95.2578387","-95","813929.0","4.18609114E-26763256"); - mathtest(336,def,"192138216E+353011592","-473.080633","1.92138216E+353011600","1.92138216E+353011600","-9.08968688E+353011602","-4.06142637E+353011597","","",""); - mathtest(337,def,"8607.64794","-34740.3367","-26132.6888","43347.9846","-299032588","-0.247770999","0","8607.64794","1.29604519E-136698"); - mathtest(338,def,"-67913.8241","-93815.4229","-161729.247","25901.5988","6.37136413E+9","0.723908948","0","-67913.8241","-6.96355203E-453311"); - mathtest(339,def,"34.5559455","-998799398.","-998799364","998799433","-3.45144576E+10","-3.45974833E-8","0","34.5559455",""); - mathtest(340,def,"387995.328","990199543.E-124623607","387995.328","387995.328","3.84192796E-124623593","3.91835495E+124623603","","","7.73152138E+55"); - mathtest(341,def,"-471.09166E-83521919","-441222368","-441222368","441222368","2.07856178E-83521908","1.06769669E-83521925","0","-4.7109166E-83521917",""); - mathtest(342,def,"-97834.3858","70779789.8E+502166065","7.07797898E+502166072","-7.07797898E+502166072","-6.92469726E+502166077","-1.38223617E-502166068","0","-97834.3858","-8.57907886E+34"); - mathtest(343,def,"7732331.06","-952719.482E+115325505","-9.52719482E+115325510","9.52719482E+115325510","-7.36674244E+115325517","-8.11606271E-115325505","0","7732331.06","1.30886724E-69"); - mathtest(344,def,"23.2745547","2.23194245E-221062592","23.2745547","23.2745547","5.19474666E-221062591","1.04279368E+221062593","","","541.704896"); - mathtest(345,def,"671.083363E-218324205","-787150031","-787150031","787150031","-5.28243290E-218324194","-8.52548227E-218324212","0","6.71083363E-218324203",""); - mathtest(346,def,"365167.80","-80263.6516","284904.148","445431.452","-2.93097011E+10","-4.54960362","-4","44113.1936","1.27052227E-446468"); - mathtest(347,def,"-1.43297604E-65129780","56.598733E-135581942","-1.43297604E-65129780","-1.43297604E-65129780","-8.11046283E-200711721","-2.53181646E+70452160","","","8.65831881E-390778680"); - mathtest(348,def,"416998859.","260.220323E-349285593","416998859","416998859","1.08511578E-349285582","1.60248383E+349285599","","","7.25111178E+25"); - mathtest(349,def,"7267.17611E+862630607","4021.56861","7.26717611E+862630610","7.26717611E+862630610","2.92254473E+862630614","1.80705014E+862630607","","",""); - mathtest(350,def,"12.2142434E+593908740","5.27236571E-396050748","1.22142434E+593908741","1.22142434E+593908741","6.43979581E+197857993","2.3166533E+989959488","","",""); - mathtest(351,def,"-28.591932","-1.79153238E-817064576","-28.5919320","-28.5919320","5.12233720E-817064575","1.59594838E+817064577","","","0.00122324372"); - mathtest(352,def,"590.849666","753424.306E+277232744","7.53424306E+277232749","-7.53424306E+277232749","4.45160500E+277232752","7.84219014E-277232748","0","590.849666","1.48530607E+22"); - mathtest(353,def,"1.7270628","-1325026.67","-1325024.94","1325028.40","-2288404.27","-0.00000130341739","0","1.7270628","2.09260036E-314440"); - mathtest(354,def,"33402118.","-5534.83745","33396583.2","33407652.8","-1.84875294E+11","-6034.8869","-6034","4908.82670","8.14473913E-41645"); - mathtest(355,def,"-439842.506","-775110.807","-1214953.31","335268.301","3.40926680E+11","0.567457584","0","-439842.506","-1.84678472E-4374182"); - mathtest(356,def,"-248664.779","-440890.44E+666433944","-4.40890440E+666433949","4.40890440E+666433949","1.09633924E+666433955","5.64005831E-666433945","0","-248664.779","2.61542877E-22"); - mathtest(357,def,"-14161.9142","8306.49493","-5855.4193","-22468.4091","-117635869","-1.70492059","-1","-5855.41927","1.65573372E+34479"); - mathtest(358,def,"-6417227.13","16679.8842","-6400547.25","-6433907.01","-1.07038605E+11","-384.728518","-384","-12151.5972","3.58767978E+113546"); - mathtest(359,def,"514825024.","-25.0446345E-103809457","514825024","514825024","-1.28936046E-103809447","-2.05563002E+103809464","","","7.32860062E-27"); - mathtest(360,def,"525948196","219450390","745398586","306497806","1.15419537E+17","2.39666102","2","87047416",""); - mathtest(361,def,"-638509.181","45580189.0E+269212559","4.55801890E+269212566","-4.55801890E+269212566","-2.91033691E+269212572","-1.40084803E-269212561","0","-638509.181","-1.06129405E+29"); - mathtest(362,def,"330590422","74.359928E+535377965","7.43599280E+535377966","-7.43599280E+535377966","2.45826800E+535377975","4.44581418E-535377959","0","330590422","4.31550742E+59"); - mathtest(363,def,"-3.48593871E-940579904","-20265.9640E-322988987","-2.02659640E-322988983","2.02659640E-322988983","","1.72009519E-617590921","0","-3.48593871E-940579904",""); - mathtest(364,def,"-328103480.","-721.949371E-923938665","-328103480","-328103480","2.36874101E-923938654","4.54468822E+923938670","","","-2.4430038E-60"); - mathtest(365,def,"-1857.01448","19081578.1","19079721.1","-19083435.1","-3.54347668E+10","-0.0000973197537","0","-1857.01448","8.44397087E+62374153"); - mathtest(366,def,"347.28720E+145930771","-62821.9906E-676564106","3.47287200E+145930773","3.47287200E+145930773","-2.18172732E-530633328","-5.52811518E+822494874","","","5.69990135E-875584642"); - mathtest(367,def,"-643.211399E+441807003","-50733419.2","-6.43211399E+441807005","-6.43211399E+441807005","3.26323135E+441807013","1.26782584E+441806998","","",""); - mathtest(368,def,"-53991661.4E-843339554","20718.7346","20718.7346","-20718.7346","-1.11863890E-843339542","-2.60593431E-843339551","0","-5.39916614E-843339547",""); - mathtest(369,def,"-900181424","-105763982.","-1.00594541E+9","-794417442","9.52067719E+16","8.51122856","8","-54069568","1.32627061E-947045602"); - mathtest(370,def,"94218.7462E+563233951","19262.6382E+765263890","1.92626382E+765263894","-1.92626382E+765263894","","4.89126906E-202029939","0","9.42187462E+563233955",""); - mathtest(371,def,"28549.271E+921331828","-2150590.40","2.85492710E+921331832","2.85492710E+921331832","-6.13977881E+921331838","-1.32750853E+921331826","","",""); - mathtest(372,def,"810.7080E+779625763","5957.94044","8.10708000E+779625765","8.10708000E+779625765","4.83014998E+779625769","1.36071854E+779625762","","",""); - mathtest(373,def,"-23.7357549E+77116908","351.100649E+864348022","3.51100649E+864348024","-3.51100649E+864348024","-8.33363895E+941464933","-6.7603848E-787231116","0","-2.37357549E+77116909","3.17403853E+308467637"); - mathtest(374,def,"40216102.2E+292724544","661.025962","4.02161022E+292724551","4.02161022E+292724551","2.65838876E+292724554","6.08389148E+292724548","","",""); - mathtest(375,def,"22785024.3E+783719168","399.505989E+137478666","2.27850243E+783719175","2.27850243E+783719175","9.10275367E+921197843","5.70329981E+646240506","","",""); - mathtest(376,def,"515.591819E+821371364","-692137914.E-149498690","5.15591819E+821371366","5.15591819E+821371366","-3.56860646E+671872685","-7.44926421E+970870047","","",""); - mathtest(377,def,"-536883072E+477911251","624996.301","-5.36883072E+477911259","-5.36883072E+477911259","-3.35549934E+477911265","-8.59017999E+477911253","","",""); - mathtest(378,def,"-399492.914E-334369192","5202119.87E+442442258","5.20211987E+442442264","-5.20211987E+442442264","-2.07821003E+108073078","-7.67942539E-776811452","0","-3.99492914E-334369187",""); - mathtest(379,def,"762.071184","9851631.37","9852393.44","-9850869.30","7.50764438E+9","0.0000773548213","0","762.071184","4.02198436E+28392356"); - mathtest(380,def,"5626.12471","72989818.3","72995444.4","-72984192.2","4.10649820E+11","0.0000770809524","0","5626.12471","1.79814757E+273727098"); - mathtest(381,def,"-47207260.1","-2073.3152","-47209333.4","-47205186.8","9.78755299E+10","22768.9741","22768","-2019.6264","-6.02238319E-15909"); - mathtest(382,def,"207.740860","-51.0390090","156.701851","258.779869","-10602.8876","-4.07023694","-4","3.5848240","6.40297515E-119"); - mathtest(383,def,"-572.812464E-745934021","-182805872.E+604508681","-1.82805872E+604508689","1.82805872E+604508689","1.04713482E-141425329","","0","-5.72812464E-745934019",""); - mathtest(384,def,"-6418504E+3531407","8459416.1","-6.41850400E+3531413","-6.41850400E+3531413","-5.42967961E+3531420","-7.58740784E+3531406","","",""); - mathtest(385,def,"280689.531","-128212543","-127931854","128493233","-3.59879186E+13","-0.00218925173","0","280689.531","1.42173809E-698530938"); - mathtest(386,def,"15.803551E-783422793","239108038E-489186308","2.39108038E-489186300","-2.39108038E-489186300","","6.60937672E-294236493","0","1.5803551E-783422792",""); - mathtest(387,def,"26.515922","-9418242.96E-105481628","26.5159220","26.5159220","-2.49733396E-105481620","-2.81537885E+105481622","","","1.54326108E-13"); - mathtest(388,def,"-88.1094557","-54029934.1","-54030022.2","54029846.0","4.76054809E+9","0.0000016307526","0","-88.1094557","5.05289826E-105089439"); - mathtest(389,def,"6770.68602E-498420397","-6.11248908E-729616908","6.77068602E-498420394","6.77068602E-498420394","","-1.10768067E+231196514","","",""); - mathtest(390,def,"-892973818.E-781904441","555201299.","555201299","-555201299","-4.95780224E-781904424","-1.60837847E-781904441","0","-8.92973818E-781904433",""); - mathtest(391,def,"670175802E+135430680","27355195.4","6.70175802E+135430688","6.70175802E+135430688","1.83327900E+135430696","2.44990318E+135430681","","",""); - mathtest(392,def,"-440950.26","205.477469E-677345561","-440950.260","-440950.260","-9.06053434E-677345554","-2.14597864E+677345564","","","1.94437132E+11"); - mathtest(393,def,"-8.2335779","573665010E+742722075","5.73665010E+742722083","-5.73665010E+742722083","-4.72331555E+742722084","-1.43525886E-742722083","0","-8.2335779","311552.753"); - mathtest(394,def,"452943.863","7022.23629","459966.099","445921.627","3.18067883E+9","64.5013703","64","3520.74044","5.54158976E+39716"); - mathtest(395,def,"62874.1079","-52719654.1","-52656780.0","52782528.2","-3.31470122E+12","-0.0011926123","0","62874.1079","1.18819936E-252973775"); - mathtest(396,def,"-7428.41741E+609772037","-46024819.3","-7.42841741E+609772040","-7.42841741E+609772040","3.41891569E+609772048","1.61400251E+609772033","","",""); - mathtest(397,def,"2.27959297","41937.019","41939.2986","-41934.7394","95599.3337","0.0000543575348","0","2.27959297","2.89712423E+15007"); - mathtest(398,def,"508692408E-671967782","8491989.20","8491989.20","-8491989.20","4.31981043E-671967767","5.99026207E-671967781","0","5.08692408E-671967774",""); - mathtest(399,def,"940.533705E-379310421","-4.01176961E+464620037","-4.01176961E+464620037","4.01176961E+464620037","-3.77320453E+85309619","-2.34443599E-843930456","0","9.40533705E-379310419",""); - mathtest(400,def,"97.0649652","-92.4485649E-151989098","97.0649652","97.0649652","-8.97351673E-151989095","-1.0499348E+151989098","","","1.30748728E-18"); - mathtest(401,def,"297544.536E+360279473","8.80275007","2.97544536E+360279478","2.97544536E+360279478","2.61921019E+360279479","3.38013159E+360279477","","",""); - mathtest(402,def,"-28861028.","82818.820E+138368758","8.28188200E+138368762","-8.28188200E+138368762","-2.39023628E+138368770","-3.48483932E-138368756","0","-28861028","4.81387013E+59"); - mathtest(403,def,"36.2496238E+68828039","49243.00","3.62496238E+68828040","3.62496238E+68828040","1.78504022E+68828045","7.36137599E+68828035","","",""); - mathtest(404,def,"22.447828E-476014683","-56067.5520","-56067.5520","56067.5520","-1.25859476E-476014677","-4.00371109E-476014687","0","2.2447828E-476014682",""); - mathtest(405,def,"282688.791E+75011952","5.99789051","2.82688791E+75011957","2.82688791E+75011957","1.69553642E+75011958","4.7131369E+75011956","","","5.10330507E+450071744"); - mathtest(406,def,"-981.860310E-737387002","-994046289","-994046289","994046289","9.76014597E-737386991","9.87741035E-737387009","0","-9.81860310E-737387000",""); - mathtest(407,def,"-702.91210","-6444903.55","-6445606.46","6444200.64","4.53020069E+9","0.000109064797","0","-702.91210","1.70866703E-18348004"); - mathtest(408,def,"972456720E-17536823","16371.2590","16371.2590","-16371.2590","1.59203408E-17536810","5.94002404E-17536819","0","9.72456720E-17536815",""); - mathtest(409,def,"71471.2045","-74303278.4","-74231807.2","74374749.6","-5.31054481E+12","-0.00096188494","0","71471.2045","2.14535374E-360677853"); - mathtest(410,def,"643.103951E+439708441","788251925.","6.43103951E+439708443","6.43103951E+439708443","5.06927927E+439708452","8.15860933E+439708434","","",""); - mathtest(411,def,"4.30838663","-7.43110827","-3.12272164","11.7394949","-32.0160875","-0.579777131","0","4.30838663","0.0000362908645"); - mathtest(412,def,"823.678025","-513.581840E-324453141","823.678025","823.678025","-4.23026076E-324453136","-1.60379118E+324453141","","","2.63762228E-15"); - mathtest(413,def,"4461.81162","3.22081680","4465.03244","4458.59080","14370.6778","1385.30438","1385","0.98035200","8.8824688E+10"); - mathtest(414,def,"-4458527.10","-99072605","-103531132","94614077.9","4.41717894E+14","0.0450026231","0","-4458527.10","-6.23928099E-658752715"); - mathtest(415,def,"-577964618","487424368.","-90540250","-1.06538899E+9","-2.81714039E+17","-1.18575241","-1","-90540250",""); - mathtest(416,def,"-867.036184","-57.1768608","-924.213045","-809.859323","49574.4072","15.1641096","15","-9.3832720","-3.40312837E-168"); - mathtest(417,def,"771871921E-330504770","5.34285236","5.34285236","-5.34285236","4.12399771E-330504761","1.44468136E-330504762","0","7.71871921E-330504762",""); - mathtest(418,def,"-338683.062E-728777518","166441931","166441931","-166441931","-5.63710628E-728777505","-2.03484218E-728777521","0","-3.38683062E-728777513",""); - mathtest(419,def,"-512568743","-416376887.E-965945295","-512568743","-512568743","2.13421778E-965945278","1.23102112E+965945295","","","1.44874358E-35"); - mathtest(420,def,"7447181.99","5318438.52","12765620.5","2128743.47","3.96073796E+13","1.40025723","1","2128743.47","1.21634782E+36548270"); - mathtest(421,def,"54789.8207","93165435.2","93220225.0","-93110645.4","5.10451749E+12","0.000588091716","0","54789.8207","3.80769825E+441483035"); - mathtest(422,def,"41488.5960","146.797094","41635.3931","41341.7989","6090405.33","282.625459","282","91.815492","6.84738153E+678"); - mathtest(423,def,"785741.663E+56754529","-461.531732","7.85741663E+56754534","7.85741663E+56754534","-3.62644711E+56754537","-1.70246509E+56754532","","",""); - mathtest(424,def,"-4.95436786","-3132.4233","-3137.37767","3127.46893","15519.1773","0.0015816406","0","-4.95436786","1.98062422E-2177"); - mathtest(425,def,"77321.8478E+404626874","82.4797688","7.73218478E+404626878","7.73218478E+404626878","6.37748813E+404626880","9.3746441E+404626876","","",""); - mathtest(426,def,"-7.99307725","-29153.7273","-29161.7204","29145.7342","233027.994","0.000274169994","0","-7.99307725","1.88688028E-26318"); - mathtest(427,def,"-61.6337401E+474999517","5254.87092","-6.16337401E+474999518","-6.16337401E+474999518","-3.23877349E+474999522","-1.1728878E+474999515","","",""); - mathtest(428,def,"-16.4043088","35.0064812","18.6021724","-51.4107900","-574.257128","-0.468607762","0","-16.4043088","-3.33831843E+42"); - mathtest(429,def,"-8.41156520","-56508958.9","-56508967.3","56508950.5","475328792","1.48853657E-7","0","-8.41156520","-8.86365458E-52263827"); - mathtest(430,def,"-360165.79E+503559835","-196688.515","-3.60165790E+503559840","-3.60165790E+503559840","7.08404744E+503559845","1.83114805E+503559835","","",""); - mathtest(431,def,"-653236480.E+565648495","-930.445274","-6.53236480E+565648503","-6.53236480E+565648503","6.07800796E+565648506","7.02068674E+565648500","","",""); - mathtest(432,def,"-3.73342903","855.029289","851.295860","-858.762718","-3192.19117","-0.00436643408","0","-3.73342903","-1.41988961E+489"); - mathtest(433,def,"-5.14890532E+562048011","10847127.8E-390918910","-5.14890532E+562048011","-5.14890532E+562048011","-5.58508340E+171129108","-4.74679142E+952966914","","","-5.14890532E+562048011"); - mathtest(434,def,"653311907","-810.036965E+744537823","-8.10036965E+744537825","8.10036965E+744537825","-5.29206794E+744537834","-8.06521104E-744537818","0","653311907","3.01325171E-71"); - mathtest(435,def,"-1.31557907","98.9139300E-579281802","-1.31557907","-1.31557907","-1.30129096E-579281800","-1.33002406E+579281800","","","15.529932"); - mathtest(436,def,"-875192389","-72071565.6","-947263955","-803120823","6.30764857E+16","12.1433797","12","-10333601.8","1.25564408E-644471405"); - mathtest(437,def,"-72838078.8","-391.398423","-72838470.2","-72837687.4","2.85087092E+10","186097.017","186097","-6.474969","-6.574057E-3075"); - mathtest(438,def,"29186560.9","-79.7419988","29186481.2","29186640.6","-2.32739470E+9","-366012.407","-366012","32.4352144","6.10050869E-598"); - mathtest(439,def,"-329801660E-730249465","-6489.9256","-6489.92560","6489.92560","2.14038824E-730249453","5.08174793E-730249461","0","-3.29801660E-730249457",""); - mathtest(440,def,"91.8429117E+103164883","7131455.16","9.18429117E+103164884","9.18429117E+103164884","6.54973607E+103164891","1.28785654E+103164878","","",""); - mathtest(441,def,"3943866.38E+150855113","-31927007.3","3.94386638E+150855119","3.94386638E+150855119","-1.25915851E+150855127","-1.23527594E+150855112","","",""); - mathtest(442,def,"-7002.0468E-795962156","-5937891.05","-5937891.05","5937891.05","4.15773910E-795962146","1.17921443E-795962159","0","-7.0020468E-795962153",""); - mathtest(443,def,"696504605.","54506.4617","696559111","696450099","3.79640016E+13","12778.386","12778","21037.3974","2.6008532E+481992"); - mathtest(444,def,"-5115.76467","690.960979E+815126701","6.90960979E+815126703","-6.90960979E+815126703","-3.53479376E+815126707","-7.4038402E-815126701","0","-5115.76467","-9.17009655E+25"); - mathtest(445,def,"-261.279392","-613.079357","-874.358749","351.799965","160185.002","0.426175484","0","-261.279392","-2.06318841E-1482"); - mathtest(446,def,"-591407763","-80145822.8","-671553586","-511261940","4.73988618E+16","7.37914644","7","-30387003.4","-2.79334522E-703030105"); - mathtest(447,def,"615630407","-69.4661869","615630338","615630476","-4.27654969E+10","-8862303.15","-8862303","10.4375693","3.44283102E-607"); - mathtest(448,def,"1078757.50","27402569.0E-713742082","1078757.50","1078757.50","2.95607268E-713742069","3.93670207E+713742080","","","1.25536924E+18"); - mathtest(449,def,"-4865.60358E-401116515","66952.5315","66952.5315","-66952.5315","-3.25764477E-401116507","-7.26724363E-401116517","0","-4.86560358E-401116512",""); - mathtest(450,def,"-87805.3921E-934896690","-1875.14745","-1875.14745","1875.14745","1.64648057E-934896682","4.68258601E-934896689","0","-8.78053921E-934896686",""); - mathtest(451,def,"-232540609.E+602702520","68.0834223","-2.32540609E+602702528","-2.32540609E+602702528","-1.58321605E+602702530","-3.41552468E+602702526","","",""); - mathtest(452,def,"-320610803.","-863871235.","-1.18448204E+9","543260432","2.76966450E+17","0.37113263","0","-320610803",""); - mathtest(453,def,"-303956364E+278139979","229537.920E+479603725","2.29537920E+479603730","-2.29537920E+479603730","-6.97695116E+757743717","-1.3242098E-201463743","0","-3.03956364E+278139987","9.23894712E+556279974"); - mathtest(454,def,"-439.747348","74.9494457E-353117582","-439.747348","-439.747348","-3.29588200E-353117578","-5.86725284E+353117582","","","-3.17996693E+18"); - mathtest(455,def,"-89702231.9","1.28993993","-89702230.6","-89702233.2","-115710491","-69539852.1","-69539852","-0.07890964","-89702231.9"); - mathtest(456,def,"-5856939.14","-6743375.34","-12600314.5","886436.20","3.94955390E+13","0.868547107","0","-5856939.14","-3.29213248E-45636942"); - mathtest(457,def,"733317.669E+100381349","-13832.6792E+174055607","-1.38326792E+174055611","1.38326792E+174055611","-1.01437481E+274436966","-5.30134227E-73674257","0","7.33317669E+100381354","1.36366549E-100381355"); - mathtest(458,def,"87.4798787E-80124704","108497.32","108497.320","-108497.320","9.49133239E-80124698","8.06286079E-80124708","0","8.74798787E-80124703",""); - mathtest(459,def,"-694562052","310681.319E+549445264","3.10681319E+549445269","-3.10681319E+549445269","-2.15787454E+549445278","-2.23560932E-549445261","0","-694562052","-3.35068155E+26"); - mathtest(460,def,"-9744135.85","1797016.04","-7947119.81","-11541151.9","-1.75103684E+13","-5.42239782","-5","-759055.65","3.83848006E+12558883"); - mathtest(461,def,"3625.87308","-50.2208536E+658627487","-5.02208536E+658627488","5.02208536E+658627488","-1.82094441E+658627492","-7.21985554E-658627486","0","3625.87308","1.5956477E-18"); - mathtest(462,def,"365347.52","-3655414.47","-3290066.95","4020761.99","-1.33549661E+12","-0.099946948","0","365347.52","1.02663257E-20333994"); - mathtest(463,def,"-19706333.6E-816923050","-383858032.","-383858032","383858032","7.56443443E-816923035","5.1337557E-816923052","0","-1.97063336E-816923043",""); - mathtest(464,def,"-86346.2616","-98.8063785","-86445.0680","-86247.4552","8531561.41","873.893598","873","-88.2931695","-2.05064086E-489"); - mathtest(465,def,"-445588.160E-496592215","328.822976","328.822976","-328.822976","-1.46519625E-496592207","-1.35510044E-496592212","0","-4.45588160E-496592210",""); - mathtest(466,def,"-9709213.71","-34.6690137","-9709248.38","-9709179.04","336608863","280054.512","280054","-17.7472602","-2.80903974E-245"); - mathtest(467,def,"742395536.","-43533.6889","742352002","742439070","-3.23192163E+13","-17053.3569","-17053","15539.1883","5.7622734E-386175"); - mathtest(468,def,"-878849193.","-5842982.47E-972537342","-878849193","-878849193","5.13510043E-972537327","1.50411061E+972537344","","","2.17027042E-54"); - mathtest(469,def,"-78014142.1","-624658.522","-78638800.6","-77389483.6","4.87321987E+13","124.890863","124","-556485.372","-7.86063865E-4929918"); - mathtest(470,def,"857039.371","454.379672","857493.751","856584.991","389421268","1886.17454","1886","79.309608","3.82253101E+2693"); - mathtest(471,def,"166534010.","-173.012236","166533837","166534183","-2.88124214E+10","-962556.255","-962556","44.164784","4.78620664E-1423"); - mathtest(472,def,"-810.879063","43776.610","42965.7309","-44587.4891","-35497536.5","-0.0185231123","0","-810.879063","-2.34758691E+127345"); - mathtest(473,def,"-327.127935","93458944","93458616.9","-93459271.1","-3.05730314E+10","-0.00000350023145","0","-327.127935","2.29323021E+235022854"); - mathtest(474,def,"539295218.","-9587941.10E-309643098","539295218","539295218","-5.17073079E-309643083","-5.62472394E+309643099","","","4.80545269E-88"); - mathtest(475,def,"-3862702.65","879616.733","-2983085.92","-4742319.38","-3.39769789E+12","-4.3913474","-4","-344235.718","-3.50650167E+5793941"); - mathtest(476,def,"-8.25290500","992.091584E+256070257","9.92091584E+256070259","-9.92091584E+256070259","-8.18763759E+256070260","-8.31869268E-256070260","0","-8.25290500","1.46577888E+9"); - mathtest(477,def,"546875205.","447.52857E+557357101","4.47528570E+557357103","-4.47528570E+557357103","2.44742278E+557357112","1.22198948E-557357095","0","546875205","8.94443542E+34"); - mathtest(478,def,"177623437","-7779116.14","169844321","185402553","-1.38175335E+15","-22.83337","-22","6482881.92","2.90085309E-64173820"); - mathtest(479,def,"377204735.","13768.1401","377218503","377190967","5.19340764E+12","27396.9274","27396","12768.8204","2.06065297E+118082"); - mathtest(480,def,"-2435.49239","-11732.0640E-23331504","-2435.49239","-2435.49239","2.85733526E-23331497","2.07592832E+23331503","","","-0.00041059459"); - mathtest(481,def,"-6128465.14E-137123294","-5742264.27","-5742264.27","5742264.27","3.51912664E-137123281","1.06725585E-137123294","0","-6.12846514E-137123288",""); - mathtest(482,def,"-2898065.44","-5.11638105","-2898070.56","-2898060.32","14827607.1","566428.773","566428","-3.95461060","-4.89169151E-33"); - mathtest(483,def,"1851395.31E+594383160","-550301.475","1.85139531E+594383166","1.85139531E+594383166","-1.01882557E+594383172","-3.36432918E+594383160","","",""); - mathtest(484,def,"536412589.E+379583977","899.601161","5.36412589E+379583985","5.36412589E+379583985","4.82557388E+379583988","5.96278231E+379583982","","",""); - mathtest(485,def,"185.85297","867419480.","867419666","-867419294","1.61212487E+11","2.14259622E-7","0","185.85297",""); - mathtest(486,def,"-5.26631053","-3815941.35E+183291763","-3.81594135E+183291769","3.81594135E+183291769","2.00959321E+183291770","1.38008162E-183291769","0","-5.26631053","0.00130009218"); - mathtest(487,def,"-8.11587021E-245942806","4553.06753E+943412048","4.55306753E+943412051","-4.55306753E+943412051","-3.69521051E+697469246","","0","-8.11587021E-245942806",""); - mathtest(488,def,"-405765.352","854963231","854557466","-855368996","-3.46914456E+14","-0.000474599769","0","-405765.352",""); - mathtest(489,def,"-159.609757","-43356.7567","-43516.3665","43197.1470","6920161.40","0.00368131219","0","-159.609757","-8.95397849E-95519"); - mathtest(490,def,"-564240.241E-501316672","-557.781977","-557.781977","557.781977","3.14723037E-501316664","1.01157847E-501316669","0","-5.64240241E-501316667",""); - mathtest(491,def,"318847.270","582107878.E+399633412","5.82107878E+399633420","-5.82107878E+399633420","1.85603508E+399633426","5.47746014E-399633416","0","318847.270","1.0507423E+33"); - mathtest(492,def,"-4426.59663","95.1096765","-4331.48695","-4521.70631","-421012.173","-46.5420217","-46","-51.5515110","-2.38037379E+346"); - mathtest(493,def,"6037.28310","578264.105","584301.388","-572226.822","3.49114411E+9","0.010440356","0","6037.28310","3.57279483E+2186324"); - mathtest(494,def,"-66.9556692","-53.8519404","-120.807610","-13.1037288","3605.69271","1.24332881","1","-13.1037288","2.55554086E-99"); - mathtest(495,def,"-92486.0222","-59935.8544","-152421.877","-32550.1678","5.54322876E+9","1.5430834","1","-32550.1678","1.83152656E-297647"); - mathtest(496,def,"852136219.E+917787351","9246221.91","8.52136219E+917787359","8.52136219E+917787359","7.87904058E+917787366","9.21604767E+917787352","","",""); - mathtest(497,def,"-2120096.16E-269253718","9437.00514","9437.00514","-9437.00514","-2.00073584E-269253708","-2.24657731E-269253716","0","-2.12009616E-269253712",""); - mathtest(498,def,"-524653.169E-865784226","228054.698","228054.698","-228054.698","-1.19649620E-865784215","-2.30055848E-865784226","0","-5.24653169E-865784221",""); - mathtest(499,def,"-288193133","-312268737.","-600461870","24075604","8.99937057E+16","0.922901011","0","-288193133",""); - mathtest(500,def,"-373484759E-113589964","844101958E-852538240","-3.73484759E-113589956","-3.73484759E-113589956","-3.15259216E-966128187","-4.42464036E+738948275","","","3.78602147E-908719644"); - - summary("Arithmetic"); - return;} - - /* mathtest -- general arithmetic test routine - Arg1 is test number - Arg2 is MathContext - Arg3 is left hand side (LHS) - Arg4 is right hand side (RHS) - Arg5 is the expected result for add - Arg6 is the expected result for subtract - Arg7 is the expected result for multiply - Arg8 is the expected result for divide - Arg9 is the expected result for integerDivide - Arg10 is the expected result for remainder - Arg11 is the expected result for power - - For power RHS, 0 is added to the number, any exponent is removed and - the number is then rounded to an integer, using format(rhs+0,,0) - - If an error should result for an operation, the 'expected result' is - an empty string. - */ - - private void mathtest(int test,com.ibm.math.MathContext mc,java.lang.String slhs,java.lang.String srhs,java.lang.String add,java.lang.String sub,java.lang.String mul,java.lang.String div,java.lang.String idv,java.lang.String rem,java.lang.String pow){ - com.ibm.math.BigDecimal lhs; - com.ibm.math.BigDecimal rhs; - java.lang.String res=null; - java.lang.String sn=null; - int e=0; - - - - lhs=new com.ibm.math.BigDecimal(slhs); - rhs=new com.ibm.math.BigDecimal(srhs); - - try{ - res=lhs.add(rhs,mc).toString(); - } - catch (java.lang.ArithmeticException $137){ - res=""; - } - mathtestcheck(test,lhs,rhs,"add",res,add); - - try{ - res=lhs.subtract(rhs,mc).toString(); - } - catch (java.lang.ArithmeticException $138){ - res=""; - } - mathtestcheck(test,lhs,rhs,"sub",res,sub); - - try{ - res=lhs.multiply(rhs,mc).toString(); - } - catch (java.lang.ArithmeticException $139){ - res=""; - } - mathtestcheck(test,lhs,rhs,"mul",res,mul); - - try{ - res=lhs.divide(rhs,mc).toString(); - } - catch (java.lang.ArithmeticException $140){ - res=""; - } - mathtestcheck(test,lhs,rhs,"div",res,div); - - try{ - res=lhs.divideInteger(rhs,mc).toString(); - } - catch (java.lang.ArithmeticException $141){ - res=""; - } - mathtestcheck(test,lhs,rhs,"idv",res,idv); - - try{ - res=lhs.remainder(rhs,mc).toString(); - } - catch (java.lang.ArithmeticException $142){ - res=""; - } - mathtestcheck(test,lhs,rhs,"rem",res,rem); - - try{ - // prepare an integer from the rhs - // in Rexx: - // n=rhs+0 - // e=pos('E', n) - // if e>0 then n=left(n,e-1) - // n=format(n,,0) - - sn=rhs.plus(mc).toString(); - e=sn.indexOf("E",0); - if (e>0) - sn=sn.substring(0,e); - sn=(new com.ibm.math.BigDecimal(sn)).format(-1,0); - - res=lhs.pow(new com.ibm.math.BigDecimal(sn),mc).toString(); - } - catch (java.lang.ArithmeticException $143){ - res=""; - } - mathtestcheck(test,lhs,rhs,"pow",res,pow); - return; - } - - /* mathtestcheck -- check for general mathtest error - Arg1 is test number - Arg2 is left hand side (LHS) - Arg3 is right hand side (RHS) - Arg4 is the operation - Arg5 is the actual result - Arg6 is the expected result - Show error message if a problem, otherwise return quietly - */ - - private void mathtestcheck(int test,com.ibm.math.BigDecimal lhs,com.ibm.math.BigDecimal rhs,java.lang.String op,java.lang.String got,java.lang.String want){ - boolean flag; - java.lang.String testnum; - - flag=want.equals((java.lang.Object)got); - - if ((!flag)) - say(">"+test+">"+" "+lhs.toString()+" "+op+" "+rhs.toString()+" "+"="+" "+want+" "+"[got"+" "+got+"]"); - - testnum="gen"+right((new com.ibm.math.BigDecimal(test+1000)).toString(),3); - - (new Test(testnum)).ok=flag; - return; - } - - - /* ------------------------------------------------------------------ */ - /* Support routines and minor classes follow */ - /* ------------------------------------------------------------------ */ - - /* ----------------------------------------------------------------- */ - /* Method called to summarise pending tests */ - /* ----------------------------------------------------------------- */ - /* Arg1 is section name */ - - private void summary(java.lang.String section){ - int bad; - int count; - int i=0; - Test item=null; - bad=0; - count=Tests.size(); - {int $144=count;i=0;i:for(;$144>0;$144--,i++){ - item=(Test)(Tests.elementAt(i)); - if ((!item.ok)) - { - bad++; - say("Failed:"+" "+item.name); - } - } - }/*i*/ - totalcount=totalcount+count; - Tests=new java.util.Vector(100); // reinitialize - if (bad==0) - say("OK"+" "+left(section,14)+" "+right("["+count+" "+"tests]",12)); - else - throw new DiagException(section+" "+"[failed"+" "+bad+" "+"of"+" "+count+" "+"tests]",bad); - return;} - - - /* ----------------------------------------------------------------- */ - /* right - Utility to do a 'right' on a Java String */ - /* ----------------------------------------------------------------- */ - /* Arg1 is string to right-justify */ - /* Arg2 is desired length */ - - private static java.lang.String right(java.lang.String s,int len){ - int slen; - slen=s.length(); - if (slen==len) - return s; // length just right - if (slen>len) - return s.substring(slen-len); // truncate on left - // too short - return (new java.lang.String(new char[len-slen])).replace('\000',' ').concat(s); - } - - /* ----------------------------------------------------------------- */ - /* left - Utility to do a 'left' on a Java String */ - /* ----------------------------------------------------------------- */ - /* Arg1 is string to left-justify */ - /* Arg2 is desired length */ - - private static java.lang.String left(java.lang.String s,int len){ - int slen; - slen=s.length(); - if (slen==len) - return s; // length just right - if (slen>len) - return s.substring(0,len); // truncate on right - // too short - return s.concat((new java.lang.String(new char[len-slen])).replace('\000',' ')); - } - - /* ----------------------------------------------------------------- */ - /* say - Utility to do a display */ - /* ----------------------------------------------------------------- */ - /* Arg1 is string to display, omitted if none */ - /* [null or omitted gives blank line] */ - // this version doesn't heed continuation final character - - private static void say(){ - say((java.lang.String)null);return; - } - private static void say(java.lang.String s){ - if (s==null) - s=""; - java.lang.System.out.println(s); - return;} - - /* ----------------------------------------------------------------- */ - /* Scaffolding for stand-alone run */ - /* ----------------------------------------------------------------- */ - /** Entry point for stand-alone run. It constructs a - * DiagBigDecimal object and then invokes its - * {@link #diagrun(boolean)} method to run the test - * suite. - * - * @param args The command line argument string array. - * if the first word is 'continue' then try and run - * all tests, otherwise stop after the first failing test group. - */ - - public static void main(java.lang.String args[]){ - boolean $continue; - DiagBigDecimal dbd; - int fails; - $continue=false; - if (args.length>0) - $continue=args[0].equals("continue"); - dbd=new DiagBigDecimal(); // make the runner - fails=dbd.diagrun($continue); // and run the tests - if (fails==0) - {System.exit(0);return;} - {System.exit(1);return;} - } - -/* ------------------------------------------------------------------ */ -/* Test -- represents a test and its status */ -/* ------------------------------------------------------------------ */ -/* Copyright IBM Corporation 1998, 2000. All rights reserved. */ -/* Author: Mike Cowlishaw */ -/* ------------------------------------------------------------------ */ -/* 1998.07.15 Initial version */ -/* 2000.03.27 Change to javadoc comments */ - -/** - * The Test class is used to record a specific test. - * When constructed, it notes the name of the test and adds the test - * to the list of tests held by the parent. - * - * Its ok is assigned directly to record whether the - * test succeeded (1) or failed (0). - * - * @see com.ibm.math.DiagBigDecimal - * @version 1.00 2000.03.27 - * @author Mike Cowlishaw - */ - - public class Test{ - private final transient java.lang.String $0="DiagBigDecimal.nrx"; - /* properties shared transient */ - /** The name of the test. */ - transient java.lang.String name; - /** Success flag; will be set to 1 (true) if the test succeeded, or 0 - * (false) if the test failed. - */ - transient boolean ok; - - - /** - * Constructs a new Test with a specified name. - * - * @param testname The String naming the test. - */ - - public Test(java.lang.String testname){super(); - name=testname; // save the name - DiagBigDecimal.this.Tests.addElement((java.lang.Object)this); // and add to parent's list - return;} - } - - /* ------------------------------------------------------------------ */ - /* DiagException */ - /* ------------------------------------------------------------------ */ - /* Copyright IBM Corporation 1996, 2000. All rights reserved. */ - /* Author: Mike Cowlishaw */ - /* ------------------------------------------------------------------ */ - /* 1996.05.27 Initial version in NetRexx (as DiagX) */ - /* 1998.06.25 Copied from NetRexx test suite */ - /* 1999.07.03 Add fail count */ - /* 2000.03.27 Change to javadoc comments */ - - /** - * The DiagException class is used to signal the failure - * of a test group. It records the number of failures in the group. - * - * @see com.ibm.math.DiagBigDecimal - * @version 1.00 2000.03.27 - * @author Mike Cowlishaw - */ - - public static class DiagException extends java.lang.RuntimeException{ - private final transient java.lang.String $0="DiagBigDecimal.nrx"; - - /* properties shared transient */ - /** the count of failed tests in the group which signalled this - * exception. - */ - transient int failcount=0; - // number of tests which failed - - /** - * Constructs a new DiagException with a message and - * failure count. This is thrown when a group of tests fails. - * - * @param message The String message describing the group. - * @param fails The int number of failed tests in the group. - */ - - public DiagException(java.lang.String message,int fails){ - super(message); - failcount=fails; - return;} - }} diff --git a/icu4j/src/com/ibm/test/bnf/BigNumberFormatTest.java b/icu4j/src/com/ibm/test/bnf/BigNumberFormatTest.java deleted file mode 100755 index dd52ff149e..0000000000 --- a/icu4j/src/com/ibm/test/bnf/BigNumberFormatTest.java +++ /dev/null @@ -1,426 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/bnf/Attic/BigNumberFormatTest.java,v $ - * $Date: 2001/10/19 12:47:42 $ - * $Revision: 1.11 $ - * - ***************************************************************************************** - */ -package com.ibm.test.bnf; - -import com.ibm.test.*; -import com.ibm.text.*; -import java.text.ParseException; -import java.util.*; -import java.math.BigInteger; -import com.ibm.util.Utility; - -/** - * @test - * General test of Big NumberFormat - */ -public class BigNumberFormatTest extends TestFmwk { - - static final int ILLEGAL = -1; - - public static void main(String[] args) throws Exception { - new BigNumberFormatTest().run(args); - } - - public void TestExponent() { - DecimalFormatSymbols US = new DecimalFormatSymbols(Locale.US); - DecimalFormat fmt1 = new DecimalFormat("0.###E0", US); - DecimalFormat fmt2 = new DecimalFormat("0.###E+0", US); - Number n = new Long(1234); - expect(fmt1, n, "1.234E3"); - expect(fmt2, n, "1.234E+3"); - expect(fmt1, "1.234E3", n); - expect(fmt1, "1.234E+3", n); // Either format should parse "E+3" - expect(fmt2, "1.234E+3", n); - } - - /** - * Test the functioning of the secondary grouping value. - */ - public void TestSecondaryGrouping() { - DecimalFormatSymbols US = new DecimalFormatSymbols(Locale.US); - DecimalFormat f = new DecimalFormat("#,##,###", US); - expect(f, new Long(123456789), "12,34,56,789"); - expectPat(f, "#,##,###"); - f.applyPattern("#,###"); - f.setSecondaryGroupingSize(4); - expect(f, new Long(123456789), "12,3456,789"); - expectPat(f, "#,####,###"); - - // On Sun JDK 1.2-1.3, the hi_IN locale uses '0' for a zero digit, - // but on IBM JDK 1.2-1.3, the locale uses U+0966. - f = (DecimalFormat) NumberFormat.getInstance(new Locale("hi", "IN")); - String str = transmute("1,87,65,43,210", - f.getDecimalFormatSymbols().getZeroDigit()); - expect(f, new Long(1876543210), str); - } - - private void expectPad(DecimalFormat fmt, String pat, int pos) { - expectPad(fmt, pat, pos, 0, (char)0); - } - - private void expectPad(DecimalFormat fmt, String pat, - int pos, int width, char pad) { - int apos = 0, awidth = 0; - char apad = 0; - try { - fmt.applyPattern(pat); - apos = fmt.getPadPosition(); - awidth = fmt.getFormatWidth(); - apad = fmt.getPadCharacter(); - } catch (IllegalArgumentException e) { - apos = -1; - awidth = width; - apad = pad; - } - if (apos == pos && awidth == width && apad == pad) { - logln("Ok \"" + pat + "\" pos=" + apos + - ((pos == -1) ? "" : " width=" + awidth + " pad=" + apad)); - } else { - logln("FAIL \"" + pat + "\" pos=" + apos + - " width=" + awidth + " pad=" + apad + - ", expected " + pos + " " + width + " " + pad); - } - } - - /** - */ - public void TestPatterns() { - DecimalFormatSymbols US = new DecimalFormatSymbols(Locale.US); - DecimalFormat fmt = new DecimalFormat("#", US); - - expectPad(fmt, "*^#", DecimalFormat.PAD_BEFORE_PREFIX, 1, '^'); - expectPad(fmt, "$*^#", DecimalFormat.PAD_AFTER_PREFIX, 2, '^'); - expectPad(fmt, "#*^", DecimalFormat.PAD_BEFORE_SUFFIX, 1, '^'); - expectPad(fmt, "#$*^", DecimalFormat.PAD_AFTER_SUFFIX, 2, '^'); - expectPad(fmt, "$*^$#", ILLEGAL); - expectPad(fmt, "#$*^$", ILLEGAL); - expectPad(fmt, "'pre'#,##0*x'post'", DecimalFormat.PAD_BEFORE_SUFFIX, - 12, 'x'); - expectPad(fmt, "''#0*x", DecimalFormat.PAD_BEFORE_SUFFIX, - 3, 'x'); - expectPad(fmt, "'I''ll'*a###.##", DecimalFormat.PAD_AFTER_PREFIX, - 10, 'a'); - - fmt.applyPattern("AA#,##0.00ZZ"); - fmt.setPadCharacter('^'); - - fmt.setFormatWidth(10); - - fmt.setPadPosition(DecimalFormat.PAD_BEFORE_PREFIX); - expectPat(fmt, "*^AA#,##0.00ZZ"); - - fmt.setPadPosition(DecimalFormat.PAD_BEFORE_SUFFIX); - expectPat(fmt, "AA#,##0.00*^ZZ"); - - fmt.setPadPosition(DecimalFormat.PAD_AFTER_SUFFIX); - expectPat(fmt, "AA#,##0.00ZZ*^"); - - // 12 3456789012 - String exp = "AA*^#,##0.00ZZ"; - fmt.setFormatWidth(12); - fmt.setPadPosition(DecimalFormat.PAD_AFTER_PREFIX); - expectPat(fmt, exp); - - fmt.setFormatWidth(13); - // 12 34567890123 - expectPat(fmt, "AA*^##,##0.00ZZ"); - - fmt.setFormatWidth(14); - // 12 345678901234 - expectPat(fmt, "AA*^###,##0.00ZZ"); - - fmt.setFormatWidth(15); - // 12 3456789012345 - expectPat(fmt, "AA*^####,##0.00ZZ"); // This is the interesting case - - fmt.setFormatWidth(16); - // 12 34567890123456 - expectPat(fmt, "AA*^#,###,##0.00ZZ"); - } - - private void expectPat(DecimalFormat fmt, String exp) { - String pat = fmt.toPattern(); - if (pat.equals(exp)) { - logln("Ok \"" + pat + '"'); - } else { - errln("FAIL \"" + pat + "\", expected \"" + exp + '"'); - } - } - - /** - * Test the handling of the AlphaWorks BigDecimal - */ - public void TestAlphaBigDecimal() { - DecimalFormatSymbols US = new DecimalFormatSymbols(Locale.US); - /*For ICU compatibility [Richard/GCL]*/ - expect(NumberFormat.getScientificInstance(Locale.US), - new Number[] { new com.ibm.math.BigDecimal("12345.678901"), - }, - "1.2345678901E4"); - expect(new DecimalFormat("##0.####E0", US), - new Number[] { new com.ibm.math.BigDecimal("12345.4999"), - new com.ibm.math.BigDecimal("12344.5001"), - }, - "12.345E3"); - expect(new DecimalFormat("##0.####E0", US), - new Number[] { new com.ibm.math.BigDecimal("12345.5000"), - new com.ibm.math.BigDecimal("12346.5000"), - }, - "12.346E3"); - } - - /** - */ - public void TestScientific() { - DecimalFormatSymbols US = new DecimalFormatSymbols(Locale.US); - /*For ICU compatibility [Richard/GCL]*/ - expect(NumberFormat.getScientificInstance(Locale.US), - new Number[] { new Double(12345.678901), - new java.math.BigDecimal("12345.678901"), - }, - "1.2345678901E4"); - expect(new DecimalFormat("##0.###E0", US), - new Double(12345), - "12.34E3"); - expect(new DecimalFormat("##0.###E0", US), - new Double(12345.00001), - "12.35E3"); - expect(new DecimalFormat("##0.####E0", US), - new Number[] { new Integer(12345), - new Long(12345), - new java.math.BigDecimal("12345.4999"), - new java.math.BigDecimal("12344.5001"), - }, - "12.345E3"); - expect(new DecimalFormat("##0.####E0", US), - new Number[] { new java.math.BigDecimal("12345.5000"), - new java.math.BigDecimal("12346.5000"), - }, - "12.346E3"); - /*For ICU compatibility [Richard/GCL]*/ - expect(NumberFormat.getScientificInstance(Locale.FRANCE), - new Double(12345.678901), - "1,2345678901E4"); - expect(new DecimalFormat("##0.####E0", US), - new Double(789.12345e-9), - "789.12E-9"); - expect(new DecimalFormat("##0.####E0", US), - new Double(780.e-9), - "780E-9"); - expect(new DecimalFormat(".###E0", US), - new Double(45678), - ".457E5"); - expect(new DecimalFormat(".###E0", US), - new Long(0), - ".0E0"); - expect(new DecimalFormat[] { new DecimalFormat("#E0", US), - new DecimalFormat("##E0", US), - new DecimalFormat("####E0", US), - new DecimalFormat("0E0", US), - new DecimalFormat("00E0", US), - new DecimalFormat("000E0", US), - }, - new Long(45678000), - new String[] { "4.5678E7", - "45.678E6", - "4567.8E4", - "5E7", - "46E6", - "457E5", - } - ); - expect(new DecimalFormat("###E0", US), - new Object[] { new Double(0.0000123), "12.3E-6", - new Double(0.000123), "123E-6", - new java.math.BigDecimal("0.00123"), "1.23E-3", // Cafe VM messes up Double(0.00123) - new Double(0.0123), "12.3E-3", - new Double(0.123), "123E-3", - new Double(1.23), "1.23E0", - new Double(12.3), "12.3E0", - new Double(123), "123E0", - new Double(1230), "1.23E3", - }); - expect(new DecimalFormat("0.#E+00", US), - new Object[] { new Double(0.00012), "1.2E-04", - new Long(12000), "1.2E+04", - }); - } - - /** - */ - public void TestPad() { - DecimalFormatSymbols US = new DecimalFormatSymbols(Locale.US); - expect(new DecimalFormat("*^##.##", US), - new Object[] { new Long(0), "^^^^0", - new Double(-1.3), "^-1.3", - } - ); - expect(new DecimalFormat("##0.0####E0*_ g-m/s^2", US), - new Object[] { new Long(0), "0.0E0______ g-m/s^2", - new Double(1.0/3), "333.333E-3_ g-m/s^2", - } - ); - expect(new DecimalFormat("##0.0####*_ g-m/s^2", US), - new Object[] { new Long(0), "0.0______ g-m/s^2", - new Double(1.0/3), "0.33333__ g-m/s^2", - } - ); - expect(new DecimalFormat("*x#,###,###,##0.00;*x(#,###,###,##0.00)", US), - new Object[] { - new Long(-100), "xxxxxxxx(100.00)", - new Long(-1000), "xxxxxx(1,000.00)", - new Long(-1000000), "xx(1,000,000.00)", - new Long(-1000000000), "(1,000,000,000.00)", - }); - } - - private void expect(NumberFormat fmt, Object[] data) { - for (int i=0; i= '0' && c <= '9') { - c = (char) (c - '0' + zero); - } - buf.append(c); - } - return buf.toString(); - } - - public void Test4161100() { - NumberFormat f = NumberFormat.getInstance(); - f.setMinimumFractionDigits(1); - f.setMaximumFractionDigits(1); - double a = -0.09; - String s = f.format(a); - logln(a + " x " + - ((DecimalFormat) f).toPattern() + " = " + - s); - if (!s.equals("-0.1")) { - errln("FAIL"); - } - } - - public void TestBigDecimalJ28() { - String[] DATA = { - "1", "1E0", - "-1", "-1E0", - "0", "0E0", - "12e34", "1.2E35", - "-12.3e-45", "-1.23E-44", - "0.73e-7", "7.3E-8", - }; - NumberFormat fmt = NumberFormat.getScientificInstance(Locale.US); - logln("Pattern: " + ((DecimalFormat)fmt).toPattern()); - for (int i=0; i - - - - - -BigNumberFormat tests. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/calendar/AstroTest.java b/icu4j/src/com/ibm/test/calendar/AstroTest.java deleted file mode 100755 index 9c0f217d9f..0000000000 --- a/icu4j/src/com/ibm/test/calendar/AstroTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/calendar/Attic/AstroTest.java,v $ - * $Date: 2001/09/08 01:15:15 $ - * $Revision: 1.5 $ - * - ***************************************************************************************** - */ -package com.ibm.test.calendar; - -// AstroTest - -import com.ibm.test.*; -import com.ibm.util.*; - -import com.ibm.util.CalendarAstronomer.*; - -// TODO: try finding next new moon after 07/28/1984 16:00 GMT - -public class AstroTest extends TestFmwk { - public static void main(String[] args) throws Exception { - new AstroTest().run(args); - } - - static final double PI = Math.PI; - - static GregorianCalendar gc = new GregorianCalendar(new SimpleTimeZone(0, "UTC")); - static CalendarAstronomer astro = new CalendarAstronomer(); - - public void TestSolarLongitude() { - final double tests[][] = { - { 1980, 7, 27, 00, 00, 124.114347 }, - { 1988, 7, 27, 00, 00, 124.187732 }, - }; - logln(""); - for (int i = 0; i < tests.length; i++) { - gc.clear(); - gc.set((int)tests[i][0], (int)tests[i][1]-1, (int)tests[i][2], (int)tests[i][3], (int) tests[i][4]); - - astro.setDate(gc.getTime()); - - double longitude = astro.getSunLongitude(); - longitude = 0; - Equatorial result = astro.getSunPosition(); - result = null; - } - } - - public void TestLunarPosition() { - final double tests[][] = { - { 1979, 2, 26, 16, 00, 0, 0 }, - }; - logln(""); - - for (int i = 0; i < tests.length; i++) { - gc.clear(); - gc.set((int)tests[i][0], (int)tests[i][1]-1, (int)tests[i][2], (int)tests[i][3], (int) tests[i][4]); - astro.setDate(gc.getTime()); - - Equatorial result = astro.getMoonPosition(); - result = null; - } - - } - - public void TestCoordinates() { - Equatorial result = astro.eclipticToEquatorial(139.686111 * PI/ 180.0, 4.875278* PI / 180.0); - logln("result is " + result + "; " + result.toHmsString()); - } - -} diff --git a/icu4j/src/com/ibm/test/calendar/CalendarRegression.java b/icu4j/src/com/ibm/test/calendar/CalendarRegression.java deleted file mode 100755 index 1352673d83..0000000000 --- a/icu4j/src/com/ibm/test/calendar/CalendarRegression.java +++ /dev/null @@ -1,1816 +0,0 @@ -package com.ibm.test.calendar; -import com.ibm.util.*; -import java.util.Date; -import java.util.Locale; -import com.ibm.text.*; - -/** - * @test 1.32 99/11/14 - * @bug 4031502 4035301 4040996 4051765 4059654 4061476 4070502 4071197 4071385 - * 4073929 4083167 4086724 4092362 4095407 4096231 4096539 4100311 4103271 - * 4106136 4108764 4114578 4118384 4125881 4125892 4136399 4141665 4142933 - * 4145158 4145983 4147269 4149677 4162587 4165343 4166109 4167060 4173516 - * 4174361 4177484 4197699 4209071 4288792 - */ -public class CalendarRegression extends com.ibm.test.TestFmwk { - - public static void main(String[] args) throws Exception { - new CalendarRegression().run(args); - } - - static final String[] FIELD_NAME = { - "ERA", "YEAR", "MONTH", "WEEK_OF_YEAR", "WEEK_OF_MONTH", - "DAY_OF_MONTH", "DAY_OF_YEAR", "DAY_OF_WEEK", - "DAY_OF_WEEK_IN_MONTH", "AM_PM", "HOUR", "HOUR_OF_DAY", - "MINUTE", "SECOND", "MILLISECOND", "ZONE_OFFSET", - "DST_OFFSET", "YEAR_WOY", "DOW_LOCAL", "EXTENDED_YEAR", - "JULIAN_DAY", "MILLISECONDS_IN_DAY", - }; - - /* - Synopsis: java.sql.Timestamp constructor works wrong on Windows 95 - - ==== Here is the test ==== - public static void main (String args[]) { - java.sql.Timestamp t= new java.sql.Timestamp(0,15,5,5,8,13,123456700); - logln("expected=1901-04-05 05:08:13.1234567"); - logln(" result="+t); - } - - ==== Here is the output of the test on Solaris or NT ==== - expected=1901-04-05 05:08:13.1234567 - result=1901-04-05 05:08:13.1234567 - - ==== Here is the output of the test on Windows95 ==== - expected=1901-04-05 05:08:13.1234567 - result=1901-04-05 06:08:13.1234567 - */ - - public void Test4031502() { - // This bug actually occurs on Windows NT as well, and doesn't - // require the host zone to be set; it can be set in Java. - String[] ids = TimeZone.getAvailableIDs(); - boolean bad = false; - for (int i=0; i - * @param date The date to start from - */ - public static Date getAssociatedDate(Date d) { - GregorianCalendar cal = new GregorianCalendar(); - cal.setTime(d); - //cal.add(field, amount); //<-- PROBLEM SEEN WITH field = DATE,MONTH - // cal.getTime(); // <--- REMOVE THIS TO SEE BUG - while (true) { - int wd = cal.get(Calendar.DAY_OF_WEEK); - if (wd == Calendar.SATURDAY || wd == Calendar.SUNDAY) { - cal.add(Calendar.DATE, 1); - // cal.getTime(); - } - else - break; - } - return cal.getTime(); - } - - public void Test4071197() { - dowTest(false); - dowTest(true); - } - - void dowTest(boolean lenient) { - GregorianCalendar cal = new GregorianCalendar(); - cal.set(1997, Calendar.AUGUST, 12); // Wednesday - // cal.getTime(); // Force update - cal.setLenient(lenient); - cal.set(1996, Calendar.DECEMBER, 1); // Set the date to be December 1, 1996 - int dow = cal.get(Calendar.DAY_OF_WEEK); - int min = cal.getMinimum(Calendar.DAY_OF_WEEK); - int max = cal.getMaximum(Calendar.DAY_OF_WEEK); - logln(cal.getTime().toString()); - if (min != Calendar.SUNDAY || max != Calendar.SATURDAY) - errln("FAIL: Min/max bad"); - if (dow < min || dow > max) - errln("FAIL: Day of week " + dow + " out of range"); - if (dow != Calendar.SUNDAY) - errln("FAIL: Day of week should be SUNDAY Got " + dow); - } - - public void Test4071385() { - Calendar cal = Calendar.getInstance(); - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - tempcal.set(1998, Calendar.JUNE, 24); - cal.setTime(tempcal.getTime()); - cal.set(Calendar.MONTH, Calendar.NOVEMBER); // change a field - logln(cal.getTime().toString()); - tempcal.set(1998, Calendar.NOVEMBER, 24); - if (!cal.getTime().equals(tempcal.getTime())) - errln("Fail"); - } - - public void Test4073929() { - GregorianCalendar foo1 = new GregorianCalendar(1997, 8, 27); - foo1.add(Calendar.DAY_OF_MONTH, +1); - int testyear = foo1.get(Calendar.YEAR); - int testmonth = foo1.get(Calendar.MONTH); - int testday = foo1.get(Calendar.DAY_OF_MONTH); - if (testyear != 1997 || - testmonth != 8 || - testday != 28) - errln("Fail: Calendar not initialized"); - } - - public void Test4083167() { - TimeZone saveZone = TimeZone.getDefault(); - try { - TimeZone.setDefault(TimeZone.getTimeZone("UTC")); - Date firstDate = new Date(); - Calendar cal = new GregorianCalendar(); - cal.setTime(firstDate); - long firstMillisInDay = cal.get(Calendar.HOUR_OF_DAY) * 3600000L + - cal.get(Calendar.MINUTE) * 60000L + - cal.get(Calendar.SECOND) * 1000L + - cal.get(Calendar.MILLISECOND); - - logln("Current time: " + firstDate.toString()); - - for (int validity=0; validity<30; validity++) { - Date lastDate = new Date(firstDate.getTime() + - (long)validity*1000*24*60*60); - cal.setTime(lastDate); - long millisInDay = cal.get(Calendar.HOUR_OF_DAY) * 3600000L + - cal.get(Calendar.MINUTE) * 60000L + - cal.get(Calendar.SECOND) * 1000L + - cal.get(Calendar.MILLISECOND); - if (firstMillisInDay != millisInDay) - errln("Day has shifted " + lastDate); - } - } - finally { - TimeZone.setDefault(saveZone); - } - } - - public void Test4086724() { - SimpleDateFormat date; - TimeZone saveZone = TimeZone.getDefault(); - Locale saveLocale = Locale.getDefault(); - try { - Locale.setDefault(Locale.UK); - TimeZone.setDefault(TimeZone.getTimeZone("GMT")); - date=new SimpleDateFormat("dd MMM yyy (zzzz) 'is in week' ww"); - Calendar cal=Calendar.getInstance(); - cal.set(1997,Calendar.SEPTEMBER,30); - Date now=cal.getTime(); - logln(date.format(now)); - cal.set(1997,Calendar.JANUARY,1); - now=cal.getTime(); - logln(date.format(now)); - cal.set(1997,Calendar.JANUARY,8); - now=cal.getTime(); - logln(date.format(now)); - cal.set(1996,Calendar.DECEMBER,31); - now=cal.getTime(); - logln(date.format(now)); - } - finally { - Locale.setDefault(saveLocale); - TimeZone.setDefault(saveZone); - } - logln("*** THE RESULTS OF THIS TEST MUST BE VERIFIED MANUALLY ***"); - } - - public void Test4092362() { - GregorianCalendar cal1 = new GregorianCalendar(1997, 10, 11, 10, 20, 40); - /*cal1.set( Calendar.YEAR, 1997 ); - cal1.set( Calendar.MONTH, 10 ); - cal1.set( Calendar.DATE, 11 ); - cal1.set( Calendar.HOUR, 10 ); - cal1.set( Calendar.MINUTE, 20 ); - cal1.set( Calendar.SECOND, 40 ); */ - - logln( " Cal1 = " + cal1.getTime().getTime() ); - logln( " Cal1 time in ms = " + cal1.get(Calendar.MILLISECOND) ); - for( int k = 0; k < 100 ; k++ ) { - System.out.print(""); - } - - GregorianCalendar cal2 = new GregorianCalendar(1997, 10, 11, 10, 20, 40); - /*cal2.set( Calendar.YEAR, 1997 ); - cal2.set( Calendar.MONTH, 10 ); - cal2.set( Calendar.DATE, 11 ); - cal2.set( Calendar.HOUR, 10 ); - cal2.set( Calendar.MINUTE, 20 ); - cal2.set( Calendar.SECOND, 40 ); */ - - logln( " Cal2 = " + cal2.getTime().getTime() ); - logln( " Cal2 time in ms = " + cal2.get(Calendar.MILLISECOND) ); - if( !cal1.equals( cal2 ) ) - errln("Fail: Milliseconds randomized"); - } - - public void Test4095407() { - GregorianCalendar a = new GregorianCalendar(1997,Calendar.NOVEMBER, 13); - int dow = a.get(Calendar.DAY_OF_WEEK); - if (dow != Calendar.THURSDAY) - errln("Fail: Want THURSDAY Got " + dow); - } - - public void Test4096231() { - TimeZone GMT = TimeZone.getTimeZone("GMT"); - TimeZone PST = TimeZone.getTimeZone("PST"); - int sec = 0, min = 0, hr = 0, day = 1, month = 10, year = 1997; - - Calendar cal1 = new GregorianCalendar(PST); - cal1.setTime(new Date(880698639000L)); - int p; - logln("PST 1 is: " + (p=cal1.get(cal1.HOUR_OF_DAY))); - cal1.setTimeZone(GMT); - // Issue 1: Changing the timezone doesn't change the - // represented time. - int h1,h2; - logln("GMT 1 is: " + (h1=cal1.get(cal1.HOUR_OF_DAY))); - cal1.setTime(new Date(880698639000L)); - logln("GMT 2 is: " + (h2=cal1.get(cal1.HOUR_OF_DAY))); - // Note: This test had a bug in it. It wanted h1!=h2, when - // what was meant was h1!=p. Fixed this concurrent with fix - // to 4177484. - if (p == h1 || h1 != h2) - errln("Fail: Hour same in different zones"); - - Calendar cal2 = new GregorianCalendar(GMT); - Calendar cal3 = new GregorianCalendar(PST); - cal2.set(Calendar.MILLISECOND, 0); - cal3.set(Calendar.MILLISECOND, 0); - - cal2.set(cal1.get(cal1.YEAR), - cal1.get(cal1.MONTH), - cal1.get(cal1.DAY_OF_MONTH), - cal1.get(cal1.HOUR_OF_DAY), - cal1.get(cal1.MINUTE), - cal1.get(cal1.SECOND)); - - long t1,t2,t3,t4; - logln("RGMT 1 is: " + (t1=cal2.getTime().getTime())); - cal3.set(year, month, day, hr, min, sec); - logln("RPST 1 is: " + (t2=cal3.getTime().getTime())); - cal3.setTimeZone(GMT); - logln("RGMT 2 is: " + (t3=cal3.getTime().getTime())); - cal3.set(cal1.get(cal1.YEAR), - cal1.get(cal1.MONTH), - cal1.get(cal1.DAY_OF_MONTH), - cal1.get(cal1.HOUR_OF_DAY), - cal1.get(cal1.MINUTE), - cal1.get(cal1.SECOND)); - // Issue 2: Calendar continues to use the timezone in its - // constructor for set() conversions, regardless - // of calls to setTimeZone() - logln("RGMT 3 is: " + (t4=cal3.getTime().getTime())); - if (t1 == t2 || - t1 != t4 || - t2 != t3) - errln("Fail: Calendar zone behavior faulty"); - } - - public void Test4096539() { - int[] y = {31,28,31,30,31,30,31,31,30,31,30,31}; - - for (int x=0;x<12;x++) { - GregorianCalendar gc = new - GregorianCalendar(1997,x,y[x]); - int m1,m2; - log((m1=gc.get(Calendar.MONTH)+1)+"/"+ - gc.get(Calendar.DATE)+"/"+gc.get(Calendar.YEAR)+ - " + 1mo = "); - - gc.add(Calendar.MONTH, 1); - logln((m2=gc.get(Calendar.MONTH)+1)+"/"+ - gc.get(Calendar.DATE)+"/"+gc.get(Calendar.YEAR) - ); - int m = (m1 % 12) + 1; - if (m2 != m) - errln("Fail: Want " + m + " Got " + m2); - } - - } - - public void Test4100311() { - GregorianCalendar cal = (GregorianCalendar)Calendar.getInstance(); - cal.set(Calendar.YEAR, 1997); - cal.set(Calendar.DAY_OF_YEAR, 1); - Date d = cal.getTime(); // Should be Jan 1 - logln(d.toString()); - if (cal.get(Calendar.DAY_OF_YEAR) != 1) - errln("Fail: DAY_OF_YEAR not set"); - } - - public void Test4103271() { - SimpleDateFormat sdf = new SimpleDateFormat(); - int numYears=40, startYear=1997, numDays=15; - String output, testDesc; - GregorianCalendar testCal = (GregorianCalendar)Calendar.getInstance(); - testCal.clear(); - sdf.setCalendar(testCal); - sdf.applyPattern("d MMM yyyy"); - boolean fail = false; - for (int firstDay=1; firstDay<=2; firstDay++) { - for (int minDays=1; minDays<=7; minDays++) { - testCal.setMinimalDaysInFirstWeek(minDays); - testCal.setFirstDayOfWeek(firstDay); - testDesc = ("Test" + String.valueOf(firstDay) + String.valueOf(minDays)); - logln(testDesc + " => 1st day of week=" + - String.valueOf(firstDay) + - ", minimum days in first week=" + - String.valueOf(minDays)); - for (int j=startYear; j<=startYear+numYears; j++) { - testCal.set(j,11,25); - for(int i=0; i 53) { - Date d = testCal.getTime(); - calWOY = String.valueOf(actWOY); - output = testDesc + " - " + sdf.format(d) + "\t"; - output = output + "\t" + calWOY; - logln(output); - fail = true; - } - } - } - } - } - - int[] DATA = { - 3, 52, 52, 52, 52, 52, 52, 52, - 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, - 4, 52, 52, 52, 52, 52, 52, 52, - 53, 53, 53, 53, 53, 53, 53, - 1, 1, 1, 1, 1, 1, 1, - }; - testCal.setFirstDayOfWeek(Calendar.SUNDAY); - for (int j=0; j " + - testCal.getTime()); - if (!after.equals(testCal.getTime())) { - logln(" exp:" + after + " FAIL"); - fail = true; - } - else logln(" ok"); - - testCal.setTime(after); - if (ADDROLL[i] == ADD) testCal.add(Calendar.WEEK_OF_YEAR, -amount); - else testCal.roll(Calendar.WEEK_OF_YEAR, -amount); - log((ADDROLL[i]==ADD?"add(WOY,":"roll(WOY,") + - (-amount) + ") " + after + " => " + - testCal.getTime()); - if (!before.equals(testCal.getTime())) { - logln(" exp:" + before + " FAIL"); - fail = true; - } - else logln(" ok"); - } - - if (fail) errln("Fail: Week of year misbehaving"); - } - - public void Test4106136() { - Locale saveLocale = Locale.getDefault(); - try { - Locale[] locales = { Locale.CHINESE, Locale.CHINA }; - for (int i=0; i expect " + - d01 + ", got " + cal.getTime()); - } - - cal.set( Calendar.SECOND, 0 ); - logln(cal.getTime().toString()); - if (!cal.getTime().equals(d00)) - errln("Fail: set(SECOND, 0) broken"); - - cal.setTime(d11); - cal.set( Calendar.SECOND, 0 ); - logln(cal.getTime().toString()); - if (!cal.getTime().equals(d10)) - errln("Fail: set(SECOND, 0) broken #2"); - - cal.clear( Calendar.MINUTE ); - logln(cal.getTime().toString()); - if (!cal.getTime().equals(d00)) - errln("Fail: clear(MINUTE) broken #2"); - - cal.clear(); - logln(cal.getTime().toString()); - if (!cal.getTime().equals(epoch)) - errln("Fail: after clear() expect " + epoch + ", got " + cal.getTime()); - - cal.setTime(d11); - cal.clear( Calendar.MONTH ); - logln(cal.getTime().toString()); - if (!cal.getTime().equals(dM)) { - errln("Fail: " + d11 + " clear(MONTH) => expect " + - dM + ", got " + cal.getTime()); - } - } - - public void Test4114578() { - int ONE_HOUR = 60*60*1000; - Calendar cal = Calendar.getInstance(); - cal.setTimeZone(TimeZone.getTimeZone("PST")); - - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - tempcal.set(1998, Calendar.APRIL, 5, 1, 0); - long onset = tempcal.getTime().getTime() + ONE_HOUR; - tempcal.set(1998, Calendar.OCTOBER, 25, 0, 0); - long cease = tempcal.getTime().getTime() + 2*ONE_HOUR; - - boolean fail = false; - - final int ADD = 1; - final int ROLL = 2; - - long[] DATA = { - // Start Action Amt Expected_change - onset - ONE_HOUR, ADD, 1, ONE_HOUR, - onset, ADD, -1, -ONE_HOUR, - onset - ONE_HOUR, ROLL, 1, ONE_HOUR, - onset, ROLL, -1, -ONE_HOUR, - cease - ONE_HOUR, ADD, 1, ONE_HOUR, - cease, ADD, -1, -ONE_HOUR, - cease - ONE_HOUR, ROLL, 1, ONE_HOUR, - cease, ROLL, -1, -ONE_HOUR, - }; - - for (int i=0; i maxYear) { - errln("Failed for "+DATES[i].getTime()+" ms: year=" + - year + ", maxYear=" + maxYear); - } - } - } - - /** - * This is a bug in the validation code of GregorianCalendar. As reported, - * the bug seems worse than it really is, due to a bug in the way the bug - * report test was written. In reality the bug is restricted to the DAY_OF_YEAR - * field. - liu 6/29/98 - */ - public void Test4147269() { - GregorianCalendar calendar = new GregorianCalendar(); - calendar.setLenient(false); - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - tempcal.set(1996, Calendar.JANUARY, 3); // Arbitrary date - Date date = tempcal.getTime(); - for (int field = 0; field < calendar.getFieldCount(); field++) { - calendar.setTime(date); - // Note: In the bug report, getActualMaximum() was called instead - // of getMaximum() -- this was an error. The validation code doesn't - // use getActualMaximum(), since that's too costly. - int max = calendar.getMaximum(field); - int value = max+1; - calendar.set(field, value); - try { - calendar.getTime(); // Force time computation - // We expect an exception to be thrown. If we fall through - // to the next line, then we have a bug. - errln("Test failed with field " + FIELD_NAME[field] + - ", date before: " + date + - ", date after: " + calendar.getTime() + - ", value: " + value + " (max = " + max +")"); - } catch (IllegalArgumentException e) { - System.out.print(""); - } - } - } - - /** - * Reported bug is that a GregorianCalendar with a cutover of Date(Long.MAX_VALUE) - * doesn't behave as a pure Julian calendar. - * CANNOT REPRODUCE THIS BUG - */ - public void Test4149677() { - TimeZone[] zones = { TimeZone.getTimeZone("GMT"), - TimeZone.getTimeZone("PST"), - TimeZone.getTimeZone("EAT") }; - for (int i=0; i0) logln("---"); - - cal.clear(); - cal.set(1998, Calendar.APRIL, 5, i, 0); - d = cal.getTime(); - String s0 = d.toString(); - logln("0 " + i + ": " + s0); - - cal.clear(); - cal.set(1998, Calendar.APRIL, 4, i+24, 0); - d = cal.getTime(); - String sPlus = d.toString(); - logln("+ " + i + ": " + sPlus); - - cal.clear(); - cal.set(1998, Calendar.APRIL, 6, i-24, 0); - d = cal.getTime(); - String sMinus = d.toString(); - logln("- " + i + ": " + sMinus); - - if (!s0.equals(sPlus) || !s0.equals(sMinus)) { - errln("Fail: All three lines must match"); - } - } - } - - /** - * Adding 12 months behaves differently from adding 1 year - */ - public void Test4165343() { - GregorianCalendar calendar = new GregorianCalendar(1996, Calendar.FEBRUARY, 29); - Date start = calendar.getTime(); - logln("init date: " + start); - calendar.add(Calendar.MONTH, 12); - Date date1 = calendar.getTime(); - logln("after adding 12 months: " + date1); - calendar.setTime(start); - calendar.add(Calendar.YEAR, 1); - Date date2 = calendar.getTime(); - logln("after adding one year : " + date2); - if (date1.equals(date2)) { - logln("Test passed"); - } else { - errln("Test failed"); - } - } - - /** - * GregorianCalendar.getActualMaximum() does not account for first day of week. - */ - public void Test4166109() { - /* Test month: - * - * March 1998 - * Su Mo Tu We Th Fr Sa - * 1 2 3 4 5 6 7 - * 8 9 10 11 12 13 14 - * 15 16 17 18 19 20 21 - * 22 23 24 25 26 27 28 - * 29 30 31 - */ - boolean passed = true; - int field = Calendar.WEEK_OF_MONTH; - - GregorianCalendar calendar = new GregorianCalendar(Locale.US); - calendar.set(1998, Calendar.MARCH, 1); - calendar.setMinimalDaysInFirstWeek(1); - logln("Date: " + calendar.getTime()); - - int firstInMonth = calendar.get(Calendar.DAY_OF_MONTH); - - for (int firstInWeek = Calendar.SUNDAY; firstInWeek <= Calendar.SATURDAY; firstInWeek++) { - calendar.setFirstDayOfWeek(firstInWeek); - int returned = calendar.getActualMaximum(field); - int expected = (31 + ((firstInMonth - firstInWeek + 7)% 7) + 6) / 7; - - logln("First day of week = " + firstInWeek + - " getActualMaximum(WEEK_OF_MONTH) = " + returned + - " expected = " + expected + - ((returned == expected) ? " ok" : " FAIL")); - - if (returned != expected) { - passed = false; - } - } - if (!passed) { - errln("Test failed"); - } - } - - /** - * Calendar.getActualMaximum(YEAR) works wrong. - */ - public void Test4167060() { - int field = Calendar.YEAR; - DateFormat format = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy G", - Locale.US); - - GregorianCalendar calendars[] = { - new GregorianCalendar(100, Calendar.NOVEMBER, 1), - new GregorianCalendar(-99 /*100BC*/, Calendar.JANUARY, 1), - new GregorianCalendar(1996, Calendar.FEBRUARY, 29), - }; - - String[] id = { "Hybrid", "Gregorian", "Julian" }; - - for (int k=0; k<3; ++k) { - logln("--- " + id[k] + " ---"); - - for (int j=0; j " + format.format(dateAfter)); - if (valid && newYear != years[i]) { - errln(" FAIL: " + newYear + " should be valid; date, month and time shouldn't change"); - } else if (!valid && newYear == years[i]) { - // We no longer require strict year maxima. That is, the calendar - // algorithm may work for values > the stated maximum. - //errln(" FAIL: " + newYear + " should be invalid"); - logln(" Note: " + newYear + " > maximum, but still valid"); - } - } - } - } - } - - /** - * Calendar.roll broken - * This bug relies on the TimeZone bug 4173604 to also be fixed. - */ - public void Test4173516() { - int fieldsList[][] = { - { 1997, Calendar.FEBRUARY, 1, 10, 45, 15, 900 }, - { 1999, Calendar.DECEMBER, 22, 23, 59, 59, 999 } - }; - int limit = 40; - GregorianCalendar cal = new GregorianCalendar(); - - cal.setTime(new Date(0)); - cal.roll(Calendar.HOUR, 0x7F000000); - cal.roll(Calendar.HOUR, -0x7F000000); - if (cal.getTime().getTime() != 0) { - errln("Hour rolling broken"); - } - - for (int op=0; op<2; ++op) { - logln("Testing GregorianCalendar " + - (op==0 ? "add" : "roll")); - for (int field=0; field < cal.getFieldCount(); ++field) { - if (field != Calendar.ZONE_OFFSET && - field != Calendar.DST_OFFSET) { - for (int j=0; j " : ", -1) => ") + - cal.get(Calendar.YEAR) + - "/" + (cal.get(Calendar.MONTH) + 1) + - "/" + cal.get(Calendar.DATE) + - " " + cal.get(Calendar.HOUR_OF_DAY) + - ":" + cal.get(Calendar.MINUTE) + - ":" + cal.get(Calendar.SECOND) + - "." + cal.get(Calendar.MILLISECOND) + - " delta=" + delta + " ms"); - } - } - } - } - } - } - } - - public void Test4174361() { - GregorianCalendar calendar = new GregorianCalendar(1996, 1, 29); - - calendar.add(Calendar.MONTH, 10); - Date date1 = calendar.getTime(); - date1 = null; - int d1 = calendar.get(Calendar.DAY_OF_MONTH); - - calendar = new GregorianCalendar(1996, 1, 29); - calendar.add(Calendar.MONTH, 11); - Date date2 = calendar.getTime(); - date2 = null; - int d2 = calendar.get(Calendar.DAY_OF_MONTH); - - if (d1 != d2) { - errln("adding months to Feb 29 broken"); - } - } - - /** - * Calendar does not update field values when setTimeZone is called. - */ - public void Test4177484() { - TimeZone PST = TimeZone.getTimeZone("PST"); - TimeZone EST = TimeZone.getTimeZone("EST"); - - Calendar cal = Calendar.getInstance(PST, Locale.US); - cal.clear(); - cal.set(1999, 3, 21, 15, 5, 0); // Arbitrary - int h1 = cal.get(Calendar.HOUR_OF_DAY); - cal.setTimeZone(EST); - int h2 = cal.get(Calendar.HOUR_OF_DAY); - if (h1 == h2) { - errln("FAIL: Fields not updated after setTimeZone"); - } - - // getTime() must NOT change when time zone is changed. - // getTime() returns zone-independent time in ms. - cal.clear(); - cal.setTimeZone(PST); - cal.set(Calendar.HOUR_OF_DAY, 10); - Date pst10 = cal.getTime(); - cal.setTimeZone(EST); - Date est10 = cal.getTime(); - if (!pst10.equals(est10)) { - errln("FAIL: setTimeZone changed time"); - } - } - - /** - * Week of year is wrong at the start and end of the year. - */ - public void Test4197699() { - GregorianCalendar cal = new GregorianCalendar(); - cal.setFirstDayOfWeek(Calendar.MONDAY); - cal.setMinimalDaysInFirstWeek(4); - DateFormat fmt = new SimpleDateFormat("E dd MMM yyyy 'DOY='D 'WOY='w"); - fmt.setCalendar(cal); - - int[] DATA = { - 2000, Calendar.JANUARY, 1, 52, - 2001, Calendar.DECEMBER, 31, 1, - }; - - for (int i=0; i " + actual + - ", want " + DATA[i+1]); - } - } - } - - /** - * WEEK_OF_YEAR computed incorrectly. A failure of this test can indicate - * a problem in several different places in the - */ - public void Test4288792() throws Exception - { - TimeZone savedTZ = TimeZone.getDefault(); - TimeZone.setDefault(TimeZone.getTimeZone("GMT")); - GregorianCalendar cal = new GregorianCalendar(); - - for (int i = 1900; i < 2100; i++) { - for (int j1 = 1; j1 <= 7; j1++) { - // Loop for MinimalDaysInFirstWeek: 1..7 - for (int j = Calendar.SUNDAY; j <= Calendar.SATURDAY; j++) { - // Loop for FirstDayOfWeek: SUNDAY..SATURDAY - cal.clear(); - cal.setMinimalDaysInFirstWeek(j1); - cal.setFirstDayOfWeek(j); - // Set the calendar to the first day of the last week - // of the year. This may overlap some of the start of - // the next year; that is, the last week of 1999 may - // include some of January 2000. Use the add() method - // to advance through the week. For each day, call - // get(WEEK_OF_YEAR). The result should be the same - // for the whole week. Note that a bug in - // getActualMaximum() will break this test. - cal.set(Calendar.YEAR, i); - int maxWeek = cal.getActualMaximum(Calendar.WEEK_OF_YEAR); - cal.set(Calendar.WEEK_OF_YEAR, maxWeek); - cal.set(Calendar.DAY_OF_WEEK, j); - for (int k = 1; k < 7; k++) { - cal.add(Calendar.DATE, 1); - int WOY = cal.get(Calendar.WEEK_OF_YEAR); - if (WOY != maxWeek) { - errln(cal.getTime() + ",got=" + WOY - + ",expected=" + maxWeek - + ",min=" + j1 + ",first=" + j); - } - } - // Now advance the calendar one more day. This should - // put it at the first day of week 1 of the next year. - cal.add(Calendar.DATE, 1); - int WOY = cal.get(Calendar.WEEK_OF_YEAR); - if (WOY != 1) { - errln(cal.getTime() + ",got=" + WOY - + ",expected=1,min=" + j1 + ",first" + j); - } - } - } - } - TimeZone.setDefault(savedTZ); - } - - /** - * Test fieldDifference(). - */ - public void TestJ438() throws Exception { - int DATA[] = { - 2000, Calendar.JANUARY, 20, 2010, Calendar.JUNE, 15, - 2010, Calendar.JUNE, 15, 2000, Calendar.JANUARY, 20, - 1964, Calendar.SEPTEMBER, 7, 1999, Calendar.JUNE, 4, - 1999, Calendar.JUNE, 4, 1964, Calendar.SEPTEMBER, 7, - }; - Calendar cal = Calendar.getInstance(Locale.US); - for (int i=0; i " + got); - } else { - errln("FAIL: " + desc + " => " + got + ", expected " + exp); - } - } - } finally { - TimeZone.setDefault(zone); - } - } -} - -//eof diff --git a/icu4j/src/com/ibm/test/calendar/CalendarTest.java b/icu4j/src/com/ibm/test/calendar/CalendarTest.java deleted file mode 100755 index 1e2466d08e..0000000000 --- a/icu4j/src/com/ibm/test/calendar/CalendarTest.java +++ /dev/null @@ -1,360 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/calendar/Attic/CalendarTest.java,v $ - * $Date: 2000/11/30 21:54:34 $ - * $Revision: 1.11 $ - * - ***************************************************************************************** - */ - -package com.ibm.test.calendar; - -import com.ibm.test.*; -import com.ibm.text.DateFormat; -import com.ibm.text.SimpleDateFormat; -import java.util.Date; -import java.util.Locale; -import java.util.Hashtable; -import java.util.Enumeration; -import com.ibm.util.*; - -/** - * A base class for classes that test individual Calendar subclasses. - * Defines various useful utility methods and constants - */ -public class CalendarTest extends TestFmwk { - - // Constants for use by subclasses, solely to save typing - public final static int SUN = Calendar.SUNDAY; - public final static int MON = Calendar.MONDAY; - public final static int TUE = Calendar.TUESDAY; - public final static int WED = Calendar.WEDNESDAY; - public final static int THU = Calendar.THURSDAY; - public final static int FRI = Calendar.FRIDAY; - public final static int SAT = Calendar.SATURDAY; - - public final static int ERA = Calendar.ERA; - public final static int YEAR = Calendar.YEAR; - public final static int MONTH = Calendar.MONTH; - public final static int DATE = Calendar.DATE; - public final static int HOUR = Calendar.HOUR; - public final static int MINUTE = Calendar.MINUTE; - public final static int SECOND = Calendar.SECOND; - public final static int DOY = Calendar.DAY_OF_YEAR; - public final static int WOY = Calendar.WEEK_OF_YEAR; - public final static int WOM = Calendar.WEEK_OF_MONTH; - public final static int DOW = Calendar.DAY_OF_WEEK; - public final static int DOWM = Calendar.DAY_OF_WEEK_IN_MONTH; - - public final static SimpleTimeZone UTC = new SimpleTimeZone(0, "GMT"); - - private static final String[] FIELD_NAME = { - "ERA", "YEAR", "MONTH", "WEEK_OF_YEAR", "WEEK_OF_MONTH", - "DAY_OF_MONTH", "DAY_OF_YEAR", "DAY_OF_WEEK", - "DAY_OF_WEEK_IN_MONTH", "AM_PM", "HOUR", "HOUR_OF_DAY", - "MINUTE", "SECOND", "MILLISECOND", "ZONE_OFFSET", - "DST_OFFSET", "YEAR_WOY", "DOW_LOCAL", "EXTENDED_YEAR", - "JULIAN_DAY", "MILLISECONDS_IN_DAY", - "IS_LEAP_MONTH" // (ChineseCalendar only) - }; - - public static final String fieldName(int f) { - return (f>=0 && f"); - } - - /** - * Iterates through a list of calendar TestCase objects and - * makes sure that the time-to-fields and fields-to-time calculations work - * correnctly for the values in each test case. - */ - public void doTestCases(TestCase[] cases, Calendar cal) - { - cal.setTimeZone(UTC); - - // Get a format to use for printing dates in the calendar system we're testing - DateFormat format = DateFormat.getDateTimeInstance(cal, DateFormat.SHORT, -1, Locale.getDefault()); - - final String pattern = (cal instanceof ChineseCalendar) ? - "E MMl/dd/y G HH:mm:ss.S z" : - "E, MM/dd/yyyy G HH:mm:ss.S z"; - - ((SimpleDateFormat)format).applyPattern(pattern); - - // This format is used for printing Gregorian dates. - DateFormat gregFormat = new SimpleDateFormat(pattern); - gregFormat.setTimeZone(UTC); - - GregorianCalendar pureGreg = new GregorianCalendar(UTC); - pureGreg.setGregorianChange(new Date(Long.MIN_VALUE)); - DateFormat pureGregFmt = new SimpleDateFormat("E M/d/yyyy G"); - pureGregFmt.setCalendar(pureGreg); - - // Now iterate through the test cases and see what happens - for (int i = 0; i < cases.length; i++) - { - TestCase test = cases[i]; - - // - // First we want to make sure that the millis -> fields calculation works - // test.applyTime will call setTime() on the calendar object, and - // test.fieldsEqual will retrieve all of the field values and make sure - // that they're the same as the ones in the testcase - // - test.applyTime(cal); - if (!test.fieldsEqual(cal, this)) { - errln("Fail: (millis=>fields) " + - gregFormat.format(test.getTime()) + " => " + - format.format(cal.getTime()) + - ", expected " + test); - } - - // - // If that was OK, check the fields -> millis calculation - // test.applyFields will set all of the calendar's fields to - // match those in the test case. - // - cal.clear(); - test.applyFields(cal); - if (!test.equals(cal)) { - errln("Fail: (fields=>millis) " + test + " => " + - pureGregFmt.format(cal.getTime()) + - ", expected " + pureGregFmt.format(test.getTime())); - } - } - } - - static public final boolean ROLL = true; - static public final boolean ADD = false; - - /** - * Process test cases for add and roll methods. - * Each test case is an array of integers, as follows: - *
      - *
    • 0: input year - *
    • 1: month (zero-based) - *
    • 2: day - *
    • 3: field to roll or add to - *
    • 4: amount to roll or add - *
    • 5: result year - *
    • 6: month (zero-based) - *
    • 7: day - *
    - * For example: - *
    -     *   //       input                add by          output
    -     *   //  year  month     day     field amount    year  month     day
    -     *   {   5759, HESHVAN,   2,     MONTH,   1,     5759, KISLEV,    2 },
    -     * 
    - * - * @param roll true or ROLL to test the roll method; - * false or ADD to test the add0 ? i= mark) { - logln("(" + i + " days)"); - mark += 5000; // 5 sec - } - cal.setTimeInMillis(greg.getTimeInMillis()); - for (int j=0; j minHigh) { - errln("Fail: " + ymdToString(cal) + - " Range for min of " + FIELD_NAME[f] + - "=" + minLow + ".." + minHigh + - ", actual_min=" + minActual); - } - if (maxActual < maxLow || maxActual > maxHigh) { - errln("Fail: " + ymdToString(cal) + - " Range for max of " + FIELD_NAME[f] + - "=" + maxLow + ".." + maxHigh + - ", actual_max=" + maxActual); - } - if (v < minActual || v > maxActual) { - errln("Fail: " + ymdToString(cal) + - " " + FIELD_NAME[f] + "=" + v + - ", actual range=" + minActual + ".." + maxActual + - ", allowed=(" + minLow + ".." + minHigh + ")..(" + - maxLow + ".." + maxHigh + ")"); - } - } - greg.add(Calendar.DAY_OF_YEAR, 1); - } - - // Check actual maxima and minima seen against ranges returned - // by API. - StringBuffer buf = new StringBuffer(); - for (int j=0; j Chinese"); - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - for (int i=0; i 1-based - int L = cal.get(ChineseCalendar.IS_LEAP_MONTH); - int d = cal.get(Calendar.DAY_OF_MONTH); - int yE = DATA[i++]; // Expected y, m, isLeapMonth, d - int mE = DATA[i++]; // 1-based - int LE = DATA[i++]; - int dE = DATA[i++]; - buf.setLength(0); - buf.append(date + " -> "); - buf.append(y + "/" + m + (L==1?"(leap)":"") + "/" + d); - if (y == yE && m == mE && L == LE && d == dE) { - logln("OK: " + buf.toString()); - } else { - errln("Fail: " + buf.toString() + ", expected " + - yE + "/" + mE + (LE==1?"(leap)":"") + "/" + dE); - } - } - - logln("Chinese -> Gregorian"); - for (int i=0; i " + date); - if (date.equals(dexp)) { - logln("OK: " + buf.toString()); - } else { - errln("Fail: " + buf.toString() + ", expected " + dexp); - } - } - } - - /** - * Make sure no Gregorian dates map to Chinese 1-based day of - * month zero. This was a problem with some of the astronomical - * new moon determinations. - */ - public void TestZeroDOM() { - ChineseCalendar cal = new ChineseCalendar(); - GregorianCalendar greg = new GregorianCalendar(1989, Calendar.SEPTEMBER, 1); - logln("Start: " + greg.getTime()); - for (int i=0; i<1000; ++i) { - cal.setTimeInMillis(greg.getTimeInMillis()); - if (cal.get(Calendar.DAY_OF_MONTH) == 0) { - errln("Fail: " + greg.getTime() + " -> " + - cal.get(Calendar.EXTENDED_YEAR) + "/" + - cal.get(Calendar.MONTH) + - (cal.get(ChineseCalendar.IS_LEAP_MONTH)==1?"(leap)":"") + - "/" + cal.get(Calendar.DAY_OF_MONTH)); - } - greg.add(Calendar.DAY_OF_YEAR, 1); - } - logln("End: " + greg.getTime()); - } - - /** - * Test minimum and maximum functions. - */ - public void TestLimits() { - // The number of days and the start date can be adjusted - // arbitrarily to either speed up the test or make it more - // thorough, but try to test at least a full year, preferably a - // full non-leap and a full leap year. - - // Final parameter is either number of days, if > 0, or test - // duration in seconds, if < 0. - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - tempcal.set(1989, Calendar.NOVEMBER, 1); - doLimitsTest(new ChineseCalendar(), null, tempcal.getTime(), -10); - } - - /** - * Run through several standard tests from Dershowitz & Reingold. - */ - public void TestJulianDayMapping() { - - final TestCase[] tests = { - // - // From Dershowitz & Reingold, "Calendrical Calculations". - // - // The months in this table are 1-based rather than 0-based. - // - // * Failing fields->millis - // ** Millis->fields gives 0-based month -1 - // These failures were fixed by changing the start search date - // for the winter solstice from Dec 15 to Dec 1. - // - // Julian Day Era Year Month Leap DOM WkDay - new ChineseTestCase(1507231.5, 35, 11, 6, false, 12, SUN), - new ChineseTestCase(1660037.5, 42, 9, 10, false, 27, WED), - new ChineseTestCase(1746893.5, 46, 7, 8, false, 4, WED), - new ChineseTestCase(1770641.5, 47, 12, 8, false, 9, SUN), - new ChineseTestCase(1892731.5, 52, 46, 11, false, 20, WED), - new ChineseTestCase(1931579.5, 54, 33, 4, false, 5, MON), - new ChineseTestCase(1974851.5, 56, 31, 10, false, 15, SAT), - new ChineseTestCase(2091164.5, 61, 50, 3, false, 7, SUN), - new ChineseTestCase(2121509.5, 63, 13, 4, false, 24, SUN), - new ChineseTestCase(2155779.5, 64, 47, 2, false, 9, FRI), - new ChineseTestCase(2174029.5, 65, 37, 2, false, 9, SAT), - new ChineseTestCase(2191584.5, 66, 25, 2, false, 23, FRI), - new ChineseTestCase(2195261.5, 66, 35, 3, false, 9, SUN), //* - new ChineseTestCase(2229274.5, 68, 8, 5, false, 2, SUN), //* - new ChineseTestCase(2245580.5, 68, 53, 1, false, 8, WED), //** - new ChineseTestCase(2266100.5, 69, 49, 3, false, 4, SAT), - new ChineseTestCase(2288542.5, 70, 50, 8, false, 2, SAT), //* - new ChineseTestCase(2290901.5, 70, 57, 1, false, 29, SAT), //* - new ChineseTestCase(2323140.5, 72, 25, 4, true, 20, WED), //* - new ChineseTestCase(2334848.5, 72, 57, 6, false, 5, SUN), - new ChineseTestCase(2348020.5, 73, 33, 6, false, 6, FRI), - new ChineseTestCase(2366978.5, 74, 25, 5, false, 5, SUN), - new ChineseTestCase(2385648.5, 75, 16, 6, false, 12, MON), - new ChineseTestCase(2392825.5, 75, 36, 2, false, 13, WED), - new ChineseTestCase(2416223.5, 76, 40, 3, false, 22, SUN), - new ChineseTestCase(2425848.5, 77, 6, 7, false, 21, SUN), - new ChineseTestCase(2430266.5, 77, 18, 8, false, 9, MON), - new ChineseTestCase(2430833.5, 77, 20, 3, false, 15, MON), - new ChineseTestCase(2431004.5, 77, 20, 9, false, 9, THU), - new ChineseTestCase(2448698.5, 78, 9, 2, false, 14, TUE), - new ChineseTestCase(2450138.5, 78, 13, 1, false, 7, SUN), - new ChineseTestCase(2465737.5, 78, 55, 10, false, 14, WED), - new ChineseTestCase(2486076.5, 79, 51, 6, false, 7, SUN), - - // Additional tests not from D&R - new ChineseTestCase(2467496.5, 78, 60, 8, false, 2, FRI), // year 60 - }; - - ChineseCalendar cal = new ChineseCalendar(); - cal.setLenient(true); - doTestCases(tests, cal); - } - - /** - * Test formatting. - */ - public void TestFormat() { - ChineseCalendar cal = new ChineseCalendar(); - DateFormat fmt = DateFormat.getDateTimeInstance(cal, - DateFormat.DEFAULT, DateFormat.DEFAULT); - - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - - Date[] DATA = new Date[2]; - tempcal.set(2001, Calendar.MAY, 22); - DATA[0] = tempcal.getTime(); - tempcal.set(2001, Calendar.MAY, 23); - DATA[1] = tempcal.getTime(); - // Wed May 23 2001 = Month 4(leap), Day 1, Year 18, Cycle 78 - - for (int i=0; i " + s + " -> " + e); - } else { - errln("FAIL: " + DATA[i] + " -> " + s + " -> " + e); - } - } catch (java.text.ParseException e) { - errln("Fail: " + s + " -> parse failure at " + e.getErrorOffset()); - errln(e.toString()); - } - } - } - - /** - * Make sure IS_LEAP_MONTH participates in field resolution. - */ - public void TestResolution() { - ChineseCalendar cal = new ChineseCalendar(); - DateFormat fmt = DateFormat.getDateInstance(cal, DateFormat.DEFAULT); - - // May 22 2001 = y4638 m4 d30 doy119 - // May 23 2001 = y4638 m4* d1 doy120 - - final int THE_YEAR = 4638; - final int END = -1; - - int[] DATA = { - // Format: - // (field, value)+, END, exp.month, exp.isLeapMonth, exp.DOM - // Note: exp.month is ONE-BASED - - // If we set DAY_OF_YEAR only, that should be used - Calendar.DAY_OF_YEAR, 1, - END, - 1,0,1, // Expect 1-1 - - // If we set MONTH only, that should be used - ChineseCalendar.IS_LEAP_MONTH, 1, - Calendar.DAY_OF_MONTH, 1, - Calendar.MONTH, 3, - END, - 4,1,1, // Expect 4*-1 - - // If we set the DOY last, that should take precedence - Calendar.MONTH, 1, // Should ignore - ChineseCalendar.IS_LEAP_MONTH, 1, // Should ignore - Calendar.DAY_OF_MONTH, 1, // Should ignore - Calendar.DAY_OF_YEAR, 121, - END, - 4,1,2, // Expect 4*-2 - - // I've disabled this test because it doesn't work this way, - // not even with a GregorianCalendar! MONTH alone isn't enough - // to supersede DAY_OF_YEAR. Some other month-related field is - // also required. - Liu 11/28/00 - //! // If we set MONTH last, that should take precedence - //! ChineseCalendar.IS_LEAP_MONTH, 1, - //! Calendar.DAY_OF_MONTH, 1, - //! Calendar.DAY_OF_YEAR, 5, // Should ignore - //! Calendar.MONTH, 3, - //! END, - //! 4,1,1, // Expect 4*-1 - - // If we set IS_LEAP_MONTH last, that should take precedence - Calendar.MONTH, 3, - Calendar.DAY_OF_MONTH, 1, - Calendar.DAY_OF_YEAR, 5, // Should ignore - ChineseCalendar.IS_LEAP_MONTH, 1, - END, - 4,1,1, // Expect 4*-1 - }; - - StringBuffer buf = new StringBuffer(); - for (int i=0; i " + fmt.format(cal.getTime())); - } else { - String s = fmt.format(cal.getTime()); - cal.clear(); - cal.set(Calendar.EXTENDED_YEAR, THE_YEAR); - cal.set(Calendar.MONTH, expMonth); - cal.set(ChineseCalendar.IS_LEAP_MONTH, expIsLeapMonth); - cal.set(Calendar.DAY_OF_MONTH, expDOM); - errln("Fail: " + buf + " => " + s + - "=" + (month+1) + "," + isLeapMonth + "," + dom + - ", expected " + fmt.format(cal.getTime()) + - "=" + (expMonth+1) + "," + expIsLeapMonth + "," + expDOM); - } - } - } - - /** - * Test the behavior of fields that are out of range. - */ - public void TestOutOfRange() { - int[] DATA = new int[] { - // Input Output - 4638, 13, 1, 4639, 1, 1, - 4638, 18, 1, 4639, 6, 1, - 4639, 0, 1, 4638, 12, 1, - 4639, -6, 1, 4638, 6, 1, - 4638, 1, 32, 4638, 2, 2, // 1-4638 has 30 days - 4638, 2, -1, 4638, 1, 29, - }; - ChineseCalendar cal = new ChineseCalendar(); - for (int i=0; i=0?"+":"") + - i + " days: " + y + "/" + mon + "/" + dom + " dow=" + dow); - if (y != 1582 || mon != MON[j] || dom != DOM[j] || dow != DOW[j]) - errln(" Fail: Above line is wrong"); - } - } - - /** - * Test the mapping between millis and fields. For the purposes - * of this test, we don't care about timezones and week data - * (first day of week, minimal days in first week). - */ - public void TestMapping() { - if (false) { - Date PURE_GREGORIAN = new Date(Long.MIN_VALUE); - Date PURE_JULIAN = new Date(Long.MAX_VALUE); - GregorianCalendar cal = - new GregorianCalendar(TimeZone.getTimeZone("UTC")); - final int EPOCH_JULIAN = 2440588; - final long ONE_DAY = 24*60*60*1000L; - com.ibm.text.SimpleDateFormat fmt = - new com.ibm.text.SimpleDateFormat("EEE MMM dd yyyy G"); - /*HH:mm:ss.SSS z*/ - - for (int type=0; type<2; ++type) { - System.out.println(type==0 ? "Gregorian" : "Julian"); - cal.setGregorianChange(type==0 ? PURE_GREGORIAN : PURE_JULIAN); - fmt.setCalendar(cal); - int[] J = { - 0x7FFFFFFF, - 0x7FFFFFF0, - 0x7F000000, - 0x78000000, - 0x70000000, - 0x60000000, - 0x50000000, - 0x40000000, - 0x30000000, - 0x20000000, - 0x10000000, - }; - for (int i=0; i " + calMillis + - " (" + ((float)delta/ONE_DAY) + " day delta) => " + - year2 + "-" + (month2+1-Calendar.JANUARY) + "-" + dom2; - if (delta != 0 || year != year2 || month != month2 || - dom != dom2) errln(s + " FAIL"); - else logln(s); - - // Test Julian computation - year = DATA[i+4]; - month = DATA[i+5]; - dom = DATA[i+6]; - cal.setGregorianChange(PURE_JULIAN); - cal.clear(); - cal.set(year, month, dom); - calMillis = cal.getTime().getTime(); - delta = calMillis - millis; - cal.setTime(new Date(millis)); - year2 = cal.get(Calendar.YEAR); - month2 = cal.get(Calendar.MONTH); - dom2 = cal.get(Calendar.DAY_OF_MONTH); - s = "J " + year + "-" + (month+1-Calendar.JANUARY) + "-" + dom + - " => " + calMillis + - " (" + ((float)delta/ONE_DAY) + " day delta) => " + - year2 + "-" + (month2+1-Calendar.JANUARY) + "-" + dom2; - if (delta != 0 || year != year2 || month != month2 || - dom != dom2) errln(s + " FAIL"); - else logln(s); - } - - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - tempcal.set(1582, Calendar.OCTOBER, 15); - cal.setGregorianChange(tempcal.getTime()); - auxMapping(cal, 1582, Calendar.OCTOBER, 4); - auxMapping(cal, 1582, Calendar.OCTOBER, 15); - auxMapping(cal, 1582, Calendar.OCTOBER, 16); - for (int y=800; y<3000; y+=1+(int)100*Math.random()) { - for (int m=Calendar.JANUARY; m<=Calendar.DECEMBER; ++m) { - auxMapping(cal, y, m, 15); - } - } - } - finally { - TimeZone.setDefault(saveZone); - } - } - private void auxMapping(Calendar cal, int y, int m, int d) { - cal.clear(); - cal.set(y, m, d); - long millis = cal.getTime().getTime(); - cal.setTime(new Date(millis)); - int year2 = cal.get(Calendar.YEAR); - int month2 = cal.get(Calendar.MONTH); - int dom2 = cal.get(Calendar.DAY_OF_MONTH); - if (y != year2 || m != month2 || dom2 != d) - errln("Round-trip failure: " + y + "-" + (m+1) + "-"+d+" =>ms=> " + - year2 + "-" + (month2+1) + "-" + dom2); - } - - public void TestGenericAPI() { - // not used String str; - - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - tempcal.set(1990, Calendar.APRIL, 15); - Date when = tempcal.getTime(); - - String tzid = "TestZone"; - int tzoffset = 123400; - - SimpleTimeZone zone = new SimpleTimeZone(tzoffset, tzid); - Calendar cal = (Calendar)Calendar.getInstance((SimpleTimeZone)zone.clone()); - - if (!zone.equals(cal.getTimeZone())) errln("FAIL: Calendar.getTimeZone failed"); - - Calendar cal2 = Calendar.getInstance(cal.getTimeZone()); - - cal.setTime(when); - cal2.setTime(when); - - if (!(cal.equals(cal2))) errln("FAIL: Calendar.operator== failed"); - // if ((*cal != *cal2)) errln("FAIL: Calendar.operator!= failed"); - if (!cal.equals(cal2) || - cal.before(cal2) || - cal.after(cal2)) errln("FAIL: equals/before/after failed"); - - cal2.setTime(new Date(when.getTime() + 1000)); - if (cal.equals(cal2) || - cal2.before(cal) || - cal.after(cal2)) errln("FAIL: equals/before/after failed"); - - cal.roll(Calendar.SECOND, true); - if (!cal.equals(cal2) || - cal.before(cal2) || - cal.after(cal2)) errln("FAIL: equals/before/after failed"); - - // Roll back to January - cal.roll(Calendar.MONTH, (int)(1 + Calendar.DECEMBER - cal.get(Calendar.MONTH))); - if (cal.equals(cal2) || - cal2.before(cal) || - cal.after(cal2)) errln("FAIL: equals/before/after failed"); - - // C++ only - /* TimeZone z = cal.orphanTimeZone(); - if (z.getID(str) != tzid || - z.getRawOffset() != tzoffset) - errln("FAIL: orphanTimeZone failed"); - */ - - for (int i=0; i<2; ++i) { - boolean lenient = ( i > 0 ); - cal.setLenient(lenient); - if (lenient != cal.isLenient()) errln("FAIL: setLenient/isLenient failed"); - // Later: Check for lenient behavior - } - - int i; - for (i=Calendar.SUNDAY; i<=Calendar.SATURDAY; ++i) { - cal.setFirstDayOfWeek(i); - if (cal.getFirstDayOfWeek() != i) errln("FAIL: set/getFirstDayOfWeek failed"); - } - - for (i=0; i<=7; ++i) { - cal.setMinimalDaysInFirstWeek(i); - if (cal.getMinimalDaysInFirstWeek() != i) errln("FAIL: set/getFirstDayOfWeek failed"); - } - - for (i=0; i cal.getMaximum(i)) - errln("FAIL: getLeastMaximum larger than getMaximum for field " + i); - if (cal.getMinimum(i) >= cal.getMaximum(i)) - errln("FAIL: getMinimum not less than getMaximum for field " + i); - } - - cal.setTimeZone(TimeZone.getDefault()); - cal.clear(); - cal.set(1984, 5, 24); - tempcal.clear(); - tempcal.set(1984, 5, 24); - if (cal.getTime().getTime() != tempcal.getTime().getTime()) { - errln("FAIL: Calendar.set(3 args) failed"); - logln(" Got: " + cal.getTime() + " Expected: " + tempcal.getTime()); - } - - cal.clear(); - cal.set(1985, 3, 2, 11, 49); - tempcal.clear(); - tempcal.set(1985, 3, 2, 11, 49); - if (cal.getTime().getTime() != tempcal.getTime().getTime()) { - errln("FAIL: Calendar.set(5 args) failed"); - logln(" Got: " + cal.getTime() + " Expected: " + tempcal.getTime()); - } - - cal.clear(); - cal.set(1995, 9, 12, 1, 39, 55); - tempcal.clear(); - tempcal.set(1995, 9, 12, 1, 39, 55); - if (cal.getTime().getTime() != tempcal.getTime().getTime()) { - errln("FAIL: Calendar.set(6 args) failed"); - logln(" Got: " + cal.getTime() + " Expected: " + tempcal.getTime()); - } - - cal.getTime(); - // This test is strange -- why do we expect certain fields to be set, and - // others not to be? Revisit the appropriateness of this. - Alan NEWCAL - for (i=0; i max) errln("FAIL: Day of week " + dow + " out of range"); - if (dow != Calendar.SUNDAY) { - errln("FAIL2: Day of week should be SUNDAY; is " + dow + ": " + cal.getTime()); - } - if (min != Calendar.SUNDAY || max != Calendar.SATURDAY) errln("FAIL: Min/max bad"); - } - - // Verify that the clone method produces distinct objects with no - // unintentionally shared fields. - public void TestClonesUnique908() { - Calendar c = Calendar.getInstance(); - Calendar d = (Calendar)c.clone(); - c.set(Calendar.MILLISECOND, 123); - d.set(Calendar.MILLISECOND, 456); - if (c.get(Calendar.MILLISECOND) != 123 || - d.get(Calendar.MILLISECOND) != 456) { - errln("FAIL: Clones share fields"); - } - } - - // Verify effect of Gregorian cutoff value - public void TestGregorianChange768() { - boolean b; - GregorianCalendar c = new GregorianCalendar(); - logln("With cutoff " + c.getGregorianChange()); - logln(" isLeapYear(1800) = " + (b=c.isLeapYear(1800))); - logln(" (should be FALSE)"); - if (b != false) errln("FAIL"); - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - tempcal.set(1900, 0, 1); - c.setGregorianChange(tempcal.getTime()); // Jan 1 1900 - logln("With cutoff " + c.getGregorianChange()); - logln(" isLeapYear(1800) = " + (b=c.isLeapYear(1800))); - logln(" (should be TRUE)"); - if (b != true) errln("FAIL"); - } - - // Test the correct behavior of the disambiguation algorithm. - public void TestDisambiguation765() throws Exception { - Calendar c = Calendar.getInstance(); - c.setLenient(false); - - c.clear(); - c.set(Calendar.YEAR, 1997); - c.set(Calendar.MONTH, Calendar.JUNE); - c.set(Calendar.DATE, 3); - - verify765("1997 third day of June = ", c, 1997, Calendar.JUNE, 3); - - c.clear(); - c.set(Calendar.YEAR, 1997); - c.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); - c.set(Calendar.MONTH, Calendar.JUNE); - c.set(Calendar.DAY_OF_WEEK_IN_MONTH, 1); - verify765("1997 first Tuesday in June = ", c, 1997, Calendar.JUNE, 3); - - c.clear(); - c.set(Calendar.YEAR, 1997); - c.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); - c.set(Calendar.MONTH, Calendar.JUNE); - c.set(Calendar.DAY_OF_WEEK_IN_MONTH, -1); - verify765("1997 last Tuesday in June = ", c, 1997, Calendar.JUNE, 24); - - IllegalArgumentException e = null; - try { - c.clear(); - c.set(Calendar.YEAR, 1997); - c.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); - c.set(Calendar.MONTH, Calendar.JUNE); - c.set(Calendar.DAY_OF_WEEK_IN_MONTH, 0); - c.getTime(); - } - catch (IllegalArgumentException ex) { - e = ex; - } - verify765("1997 zero-th Tuesday in June = ", e, c); - - c.clear(); - c.set(Calendar.YEAR, 1997); - c.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); - c.set(Calendar.MONTH, Calendar.JUNE); - c.set(Calendar.WEEK_OF_MONTH, 1); - verify765("1997 Tuesday in week 1 of June = ", c, 1997, Calendar.JUNE, 3); - - c.clear(); - c.set(Calendar.YEAR, 1997); - c.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); - c.set(Calendar.MONTH, Calendar.JUNE); - c.set(Calendar.WEEK_OF_MONTH, 5); - verify765("1997 Tuesday in week 5 of June = ", c, 1997, Calendar.JULY, 1); - - try { - c.clear(); - c.set(Calendar.YEAR, 1997); - c.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); - c.set(Calendar.MONTH, Calendar.JUNE); - c.set(Calendar.WEEK_OF_MONTH, 0); - verify765("1997 Tuesday in week 0 of June = ", c, 1997, Calendar.MAY, 27); - } - catch (IllegalArgumentException ex) { - errln("FAIL: Exception seen:"); - // ex.printStackTrace(log); - } - - c.clear(); - c.set(Calendar.YEAR, 1997); - c.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); - c.set(Calendar.WEEK_OF_YEAR, 1); - verify765("1997 Tuesday in week 1 of year = ", c, 1996, Calendar.DECEMBER, 31); - - c.clear(); - c.set(Calendar.YEAR, 1997); - c.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); - c.set(Calendar.WEEK_OF_YEAR, 10); - verify765("1997 Tuesday in week 10 of year = ", c, 1997, Calendar.MARCH, 4); - - try { - c.clear(); - c.set(Calendar.YEAR, 1997); - c.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); - c.set(Calendar.WEEK_OF_YEAR, 0); - verify765("1997 Tuesday in week 0 of year = ", c, 1996, Calendar.DECEMBER, 24); - throw new Exception("Fail: WEEK_OF_YEAR 0 should be illegal"); - } - catch (IllegalArgumentException ex) { - System.out.print(""); - } - } - void verify765(String msg, Calendar c, int year, int month, int day) { - int cy = c.get(Calendar.YEAR); // NEWCAL - int cm = c.get(Calendar.MONTH); - int cd = c.get(Calendar.DATE); - if (cy == year && - cm == month && - cd == day) { - logln("PASS: " + msg + c.getTime()); - } - else { - errln("FAIL: " + msg + cy + "/" + (cm+1) + "/" + cd + - "=" + c.getTime() + - "; expected " + - year + "/" + (month+1) + "/" + day); - } - } - // Called when e expected to be non-null - void verify765(String msg, IllegalArgumentException e, Calendar c) { - if (e == null) errln("FAIL: No IllegalArgumentException for " + msg + - c.getTime()); - else logln("PASS: " + msg + "IllegalArgument as expected"); - } - - // Test the behavior of GMT vs. local time - public void TestGMTvsLocal4064654() { - // Sample output 1: - // % /usr/local/java/jdk1.1.3/solaris/bin/java test 1997 1 1 12 0 0 - // date = Wed Jan 01 04:00:00 PST 1997 - // offset for Wed Jan 01 04:00:00 PST 1997= -8hr - aux4064654(1997, 1, 1, 12, 0, 0); - - // Sample output 2: - // % /usr/local/java/jdk1.1.3/solaris/bin/java test 1997 4 16 18 30 0 - // date = Wed Apr 16 10:30:00 PDT 1997 - // offset for Wed Apr 16 10:30:00 PDT 1997= -7hr - - // Note that in sample output 2 according to the offset, the gmt time - // of the result would be 1997 4 16 17 30 0 which is different from the - // input of 1997 4 16 18 30 0. - aux4064654(1997, 4, 16, 18, 30, 0); - } - void aux4064654(int yr, int mo, int dt, int hr, int mn, int sc) { - Date date; - Calendar gmtcal = Calendar.getInstance(); - gmtcal.setTimeZone(TimeZone.getTimeZone("Africa/Casablanca")); - gmtcal.set(yr, mo-1, dt, hr, mn, sc); - gmtcal.set(Calendar.MILLISECOND, 0); - - date = gmtcal.getTime(); - logln("date = "+date); - - Calendar cal = Calendar.getInstance(); - cal.setTimeZone(TimeZone.getTimeZone("America/Los_Angels")); - cal.setTime(date); - - int offset = cal.getTimeZone().getOffset(cal.get(Calendar.ERA), - cal.get(Calendar.YEAR), - cal.get(Calendar.MONTH), - cal.get(Calendar.DATE), - cal.get(Calendar.DAY_OF_WEEK), - cal.get(Calendar.MILLISECOND)); - - logln("offset for "+date+"= "+(offset/1000/60/60.0) + "hr"); - - int utc = ((cal.get(Calendar.HOUR_OF_DAY) * 60 + - cal.get(Calendar.MINUTE)) * 60 + - cal.get(Calendar.SECOND)) * 1000 + - cal.get(Calendar.MILLISECOND) - offset; - - int expected = ((hr * 60 + mn) * 60 + sc) * 1000; - - if (utc != expected) - errln("FAIL: Discrepancy of " + - (utc - expected) + " millis = " + - ((utc-expected)/1000/60/60.0) + " hr"); - } - - // Verify that add and set work regardless of the order in which - // they are called. - public void TestAddSetOrder621() { - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - tempcal.set(1997, 4, 14, 13, 23, 45); - Date d = tempcal.getTime(); - - Calendar cal = Calendar.getInstance (); - cal.setTime (d); - cal.add (Calendar.DATE, -5); - cal.set (Calendar.HOUR_OF_DAY, 0); - cal.set (Calendar.MINUTE, 0); - cal.set (Calendar.SECOND, 0); - // ma feb 03 00:00:00 GMT+00:00 1997 - String s = cal.getTime ().toString (); - - cal = Calendar.getInstance (); - cal.setTime (d); - cal.set (Calendar.HOUR_OF_DAY, 0); - cal.set (Calendar.MINUTE, 0); - cal.set (Calendar.SECOND, 0); - cal.add (Calendar.DATE, -5); - // ma feb 03 13:11:06 GMT+00:00 1997 - String s2 = cal.getTime ().toString (); - - if (s.equals(s2)) - logln("Pass: " + s + " == " + s2); - else - errln("FAIL: " + s + " != " + s2); - } - - // Verify that add works. - public void TestAdd520() { - int y = 1997, m = Calendar.FEBRUARY, d = 1; - GregorianCalendar temp = new GregorianCalendar( y, m, d ); - check520(temp, y, m, d); - - temp.add( temp.YEAR, 1 ); - y++; - check520(temp, y, m, d); - - temp.add( temp.MONTH, 1 ); - m++; - check520(temp, y, m, d); - - temp.add( temp.DATE, 1 ); - d++; - check520(temp, y, m, d); - - temp.add( temp.DATE, 2 ); - d += 2; - check520(temp, y, m, d); - - temp.add( temp.DATE, 28 ); - d = 1; ++m; - check520(temp, y, m, d); - } - void check520(Calendar c, int y, int m, int d) { - if (c.get(Calendar.YEAR) != y || - c.get(Calendar.MONTH) != m || - c.get(Calendar.DATE) != d) { - errln("FAILURE: Expected YEAR/MONTH/DATE of " + - y + "/" + (m+1) + "/" + d + - "; got " + - c.get(Calendar.YEAR) + "/" + - (c.get(Calendar.MONTH)+1) + "/" + - c.get(Calendar.DATE)); - } - else logln("Confirmed: " + - y + "/" + (m+1) + "/" + d); - } - - // Verify that setting fields works. This test fails when an exception is thrown. - public void TestFieldSet4781() { - try { - GregorianCalendar g = new GregorianCalendar(); - GregorianCalendar g2 = new GregorianCalendar(); - // At this point UTC value is set, various fields are not. - // Now set to noon. - g2.set(Calendar.HOUR, 12); - g2.set(Calendar.MINUTE, 0); - g2.set(Calendar.SECOND, 0); - // At this point the object thinks UTC is NOT set, but fields are set. - // The following line will result in IllegalArgumentException because - // it thinks the YEAR is set and it is NOT. - if (g2.equals(g)) - logln("Same"); - else - logln("Different"); - } - catch (IllegalArgumentException e) { - errln("Unexpected exception seen: " + e); - } - } - - // Test serialization of a Calendar object - public void TestSerialize337() { - Calendar cal = Calendar.getInstance(); - - boolean ok = false; - - try { - FileOutputStream f = new FileOutputStream(FILENAME); - ObjectOutput s = new ObjectOutputStream(f); - s.writeObject(PREFIX); - s.writeObject(cal); - s.writeObject(POSTFIX); - f.close(); - - FileInputStream in = new FileInputStream(FILENAME); - ObjectInputStream t = new ObjectInputStream(in); - String pre = (String)t.readObject(); - Calendar c = (Calendar)t.readObject(); - String post = (String)t.readObject(); - in.close(); - - ok = pre.equals(PREFIX) && - post.equals(POSTFIX) && - cal.equals(c); - - File fl = new File(FILENAME); - fl.delete(); - } - catch (IOException e) { - errln("FAIL: Exception received:"); - // e.printStackTrace(log); - } - catch (ClassNotFoundException e) { - errln("FAIL: Exception received:"); - // e.printStackTrace(log); - } - - if (!ok) errln("Serialization of Calendar object failed."); - } - static final String PREFIX = "abc"; - static final String POSTFIX = "def"; - static final String FILENAME = "tmp337.bin"; - - // Try to zero out the seconds field - public void TestSecondsZero121() { - Calendar cal = new GregorianCalendar(); - // Initialize with current date/time - cal.setTime(new Date()); - // Round down to minute - cal.set(Calendar.SECOND, 0); - Date d = cal.getTime(); - String s = d.toString(); - if (s.indexOf(":00 ") < 0) errln("Expected to see :00 in " + s); - } - - // Try various sequences of add, set, and get method calls. - public void TestAddSetGet0610() { - // - // Error case 1: - // - Upon initialization calendar fields, millis = System.currentTime - // - After set is called fields are initialized, time is not - // - Addition uses millis which are still *now* - // - { - Calendar calendar = new GregorianCalendar( ) ; - calendar.set( 1993, Calendar.JANUARY, 4 ) ; - logln( "1A) " + value( calendar ) ) ; - calendar.add( Calendar.DATE, 1 ) ; - String v = value(calendar); - logln( "1B) " + v ); - logln( "--) 1993/0/5" ) ; - if (!v.equals(EXPECTED_0610)) errln("Expected " + EXPECTED_0610 + - "; saw " + v); - } - - // - // Error case 2: - // - Upon initialization calendar fields set, millis = 0 - // - Addition uses millis which are still 1970, 0, 1 - // - - { - Calendar calendar = new GregorianCalendar( 1993, Calendar.JANUARY, 4 ) ; - logln( "2A) " + value( calendar ) ) ; - calendar.add( Calendar.DATE, 1 ) ; - String v = value(calendar); - logln( "2B) " + v ); - logln( "--) 1993/0/5" ) ; - if (!v.equals(EXPECTED_0610)) errln("Expected " + EXPECTED_0610 + - "; saw " + v); - } - - // - // Error case 3: - // - Upon initialization calendar fields, millis = 0 - // - getTime( ) is called which forces the millis to be set - // - Addition uses millis which are correct - // - - { - Calendar calendar = new GregorianCalendar( 1993, Calendar.JANUARY, 4 ) ; - logln( "3A) " + value( calendar ) ) ; - calendar.getTime( ) ; - calendar.add( Calendar.DATE, 1 ) ; - String v = value(calendar); - logln( "3B) " + v ) ; - logln( "--) 1993/0/5" ) ; - if (!v.equals(EXPECTED_0610)) errln("Expected " + EXPECTED_0610 + - "; saw " + v); - } - } - static String value( Calendar calendar ) { - return( calendar.get( Calendar.YEAR ) + "/" + - calendar.get( Calendar.MONTH ) + "/" + - calendar.get( Calendar.DATE ) ) ; - } - static String EXPECTED_0610 = "1993/0/5"; - - // Test that certain fields on a certain date are as expected. - public void TestFields060() { - int year = 1997; - int month = java.util.Calendar.OCTOBER; //october - int dDate = 22; //DAYOFWEEK should return 3 for Wednesday - GregorianCalendar calendar = null; - - calendar = new GregorianCalendar( year, month, dDate); - for (int i=0; iHebrewCalendar
    class. - */ -public class HebrewTest extends CalendarTest { - public static void main(String args[]) throws Exception { - new HebrewTest().run(args); - } - - // Constants to save typing. - public static final int TISHRI = HebrewCalendar.TISHRI; - public static final int HESHVAN = HebrewCalendar.HESHVAN; - public static final int KISLEV = HebrewCalendar.KISLEV; - public static final int TEVET = HebrewCalendar.TEVET; - public static final int SHEVAT = HebrewCalendar.SHEVAT; - public static final int ADAR_1 = HebrewCalendar.ADAR_1; - public static final int ADAR = HebrewCalendar.ADAR; - public static final int NISAN = HebrewCalendar.NISAN; - public static final int IYAR = HebrewCalendar.IYAR; - public static final int SIVAN = HebrewCalendar.SIVAN; - public static final int TAMUZ = HebrewCalendar.TAMUZ; - public static final int AV = HebrewCalendar.AV; - public static final int ELUL = HebrewCalendar.ELUL; - - /** - * Test the behavior of HebrewCalendar.roll - * The only real nastiness with roll is the MONTH field, since a year can - * have a variable number of months. - */ - public void TestRoll() { - int[][] tests = new int[][] { - // input roll by output - // year month day field amount year month day - - { 5759, HESHVAN, 2, MONTH, 1, 5759, KISLEV, 2 }, // non-leap years - { 5759, SHEVAT, 2, MONTH, 1, 5759, ADAR, 2 }, - { 5759, SHEVAT, 2, MONTH, 2, 5759, NISAN, 2 }, - { 5759, SHEVAT, 2, MONTH, 12, 5759, SHEVAT, 2 }, - { 5759, AV, 1, MONTH, 12, 5759, AV, 1 }, // Alan - - { 5757, HESHVAN, 2, MONTH, 1, 5757, KISLEV, 2 }, // leap years - { 5757, SHEVAT, 2, MONTH, 1, 5757, ADAR_1, 2 }, - { 5757, SHEVAT, 2, MONTH, 2, 5757, ADAR, 2 }, - { 5757, SHEVAT, 2, MONTH, 3, 5757, NISAN, 2 }, - { 5757, SHEVAT, 2, MONTH, 12, 5757, TEVET, 2 }, - { 5757, SHEVAT, 2, MONTH, 13, 5757, SHEVAT, 2 }, - { 5757, AV, 1, MONTH, 12, 5757, TAMUZ, 1 }, // Alan - - { 5757, KISLEV, 1, DATE, 30, 5757, KISLEV, 2 }, // 29-day month - { 5758, KISLEV, 1, DATE, 31, 5758, KISLEV, 2 }, // 30-day month - - // Try some other fields too - { 5757, TISHRI, 1, YEAR, 1, 5758, TISHRI, 1 }, - - - // Try some rolls that require other fields to be adjusted - { 5757, TISHRI, 30, MONTH, 1, 5757, HESHVAN, 29 }, - { 5758, KISLEV, 30, YEAR, -1, 5757, KISLEV, 29 }, - }; - - HebrewCalendar cal = new HebrewCalendar(UTC, Locale.getDefault()); - - doRollAdd(ROLL, cal, tests); - } - - /** - * Test the behavior of HebrewCalendar.roll - * The only real nastiness with roll is the MONTH field, since a year can - * have a variable number of months. - */ - public void TestAdd() { - int[][] tests = new int[][] { - // input add by output - // year month day field amount year month day - { 5759, HESHVAN, 2, MONTH, 1, 5759, KISLEV, 2 }, // non-leap years - { 5759, SHEVAT, 2, MONTH, 1, 5759, ADAR, 2 }, - { 5759, SHEVAT, 2, MONTH, 2, 5759, NISAN, 2 }, - { 5759, SHEVAT, 2, MONTH, 12, 5760, SHEVAT, 2 }, - - { 5757, HESHVAN, 2, MONTH, 1, 5757, KISLEV, 2 }, // leap years - { 5757, SHEVAT, 2, MONTH, 1, 5757, ADAR_1, 2 }, - { 5757, SHEVAT, 2, MONTH, 2, 5757, ADAR, 2 }, - { 5757, SHEVAT, 2, MONTH, 3, 5757, NISAN, 2 }, - { 5757, SHEVAT, 2, MONTH, 12, 5758, TEVET, 2 }, - { 5757, SHEVAT, 2, MONTH, 13, 5758, SHEVAT, 2 }, - - { 5757, KISLEV, 1, DATE, 30, 5757, TEVET, 2 }, // 29-day month - { 5758, KISLEV, 1, DATE, 31, 5758, TEVET, 2 }, // 30-day month - }; - - HebrewCalendar cal = new HebrewCalendar(UTC, Locale.getDefault()); - - doRollAdd(ADD, cal, tests); - } - - /** - * A huge list of test cases to make sure that computeTime and computeFields - * work properly for a wide range of data. - */ - public void TestCases() { - doTestCases(testCases, new HebrewCalendar()); - } - - static final TestCase[] testCases = { - // - // Most of these test cases were taken from the back of - // "Calendrical Calculations", with some extras added to help - // debug a few of the problems that cropped up in development. - // - // The months in this table are 1-based rather than 0-based, - // because it's easier to edit that way. - // - // Julian Day Era Year Month Day WkDay Hour Min Sec - new TestCase(1507231.5, 0, 3174, 12, 10, SUN, 0, 0, 0), - new TestCase(1660037.5, 0, 3593, 3, 25, WED, 0, 0, 0), - new TestCase(1746893.5, 0, 3831, 1, 3, WED, 0, 0, 0), - new TestCase(1770641.5, 0, 3896, 1, 9, SUN, 0, 0, 0), - new TestCase(1892731.5, 0, 4230, 4, 18, WED, 0, 0, 0), - new TestCase(1931579.5, 0, 4336, 10, 4, MON, 0, 0, 0), - new TestCase(1974851.5, 0, 4455, 2, 13, SAT, 0, 0, 0), - new TestCase(2091164.5, 0, 4773, 9, 6, SUN, 0, 0, 0), - new TestCase(2121509.5, 0, 4856, 9, 23, SUN, 0, 0, 0), - new TestCase(2155779.5, 0, 4950, 8, 7, FRI, 0, 0, 0), - new TestCase(2174029.5, 0, 5000, 7, 8, SAT, 0, 0, 0), - new TestCase(2191584.5, 0, 5048, 8, 21, FRI, 0, 0, 0), - new TestCase(2195261.5, 0, 5058, 9, 7, SUN, 0, 0, 0), - new TestCase(2229274.5, 0, 5151, 11, 1, SUN, 0, 0, 0), - new TestCase(2245580.5, 0, 5196, 5, 7, WED, 0, 0, 0), - new TestCase(2266100.5, 0, 5252, 8, 3, SAT, 0, 0, 0), - new TestCase(2288542.5, 0, 5314, 1, 1, SAT, 0, 0, 0), - new TestCase(2290901.5, 0, 5320, 6, 27, SAT, 0, 0, 0), - new TestCase(2323140.5, 0, 5408, 10, 20, WED, 0, 0, 0), - new TestCase(2334551.5, 0, 5440, 1, 1, THU, 0, 0, 0), - new TestCase(2334581.5, 0, 5440, 2, 1, SAT, 0, 0, 0), - new TestCase(2334610.5, 0, 5440, 3, 1, SUN, 0, 0, 0), - new TestCase(2334639.5, 0, 5440, 4, 1, MON, 0, 0, 0), - new TestCase(2334668.5, 0, 5440, 5, 1, TUE, 0, 0, 0), - new TestCase(2334698.5, 0, 5440, 6, 1, THU, 0, 0, 0), - new TestCase(2334728.5, 0, 5440, 7, 1, SAT, 0, 0, 0), - new TestCase(2334757.5, 0, 5440, 8, 1, SUN, 0, 0, 0), - new TestCase(2334787.5, 0, 5440, 9, 1, TUE, 0, 0, 0), - new TestCase(2334816.5, 0, 5440, 10, 1, WED, 0, 0, 0), - new TestCase(2334846.5, 0, 5440, 11, 1, FRI, 0, 0, 0), - new TestCase(2334848.5, 0, 5440, 11, 3, SUN, 0, 0, 0), - new TestCase(2334934.5, 0, 5441, 1, 1, TUE, 0, 0, 0), - new TestCase(2348020.5, 0, 5476, 12, 5, FRI, 0, 0, 0), - new TestCase(2366978.5, 0, 5528, 11, 4, SUN, 0, 0, 0), - new TestCase(2385648.5, 0, 5579, 12, 11, MON, 0, 0, 0), - new TestCase(2392825.5, 0, 5599, 8, 12, WED, 0, 0, 0), - new TestCase(2416223.5, 0, 5663, 8, 22, SUN, 0, 0, 0), - new TestCase(2425848.5, 0, 5689, 12, 19, SUN, 0, 0, 0), - new TestCase(2430266.5, 0, 5702, 1, 8, MON, 0, 0, 0), - new TestCase(2430833.5, 0, 5703, 8, 14, MON, 0, 0, 0), - new TestCase(2431004.5, 0, 5704, 1, 8, THU, 0, 0, 0), - new TestCase(2448698.5, 0, 5752, 7, 12, TUE, 0, 0, 0), - new TestCase(2450138.5, 0, 5756, 7, 5, SUN, 0, 0, 0), - new TestCase(2465737.5, 0, 5799, 2, 12, WED, 0, 0, 0), - new TestCase(2486076.5, 0, 5854, 12, 5, SUN, 0, 0, 0), - - // Additional test cases for bugs found during development - // G.YY/MM/DD Era Year Month Day WkDay Hour Min Sec - new TestCase(1013, 9, 8, 0, 4774, 1, 1, TUE, 0, 0, 0), - new TestCase(1239, 9, 1, 0, 5000, 1, 1, THU, 0, 0, 0), - new TestCase(1240, 9,18, 0, 5001, 1, 1, TUE, 0, 0, 0), - - // Test cases taken from a table of 14 "year types" in the Help file - // of the application "Hebrew Calendar" - new TestCase(2456187.5, 0, 5773, 1, 1, MON, 0, 0, 0), - new TestCase(2459111.5, 0, 5781, 1, 1, SAT, 0, 0, 0), - new TestCase(2453647.5, 0, 5766, 1, 1, TUE, 0, 0, 0), - new TestCase(2462035.5, 0, 5789, 1, 1, THU, 0, 0, 0), - new TestCase(2458756.5, 0, 5780, 1, 1, MON, 0, 0, 0), - new TestCase(2460586.5, 0, 5785, 1, 1, THU, 0, 0, 0), - new TestCase(2463864.5, 0, 5794, 1, 1, SAT, 0, 0, 0), - new TestCase(2463481.5, 0, 5793, 1, 1, MON, 0, 0, 0), - new TestCase(2470421.5, 0, 5812, 1, 1, THU, 0, 0, 0), - new TestCase(2460203.5, 0, 5784, 1, 1, SAT, 0, 0, 0), - new TestCase(2459464.5, 0, 5782, 1, 1, TUE, 0, 0, 0), - new TestCase(2467142.5, 0, 5803, 1, 1, MON, 0, 0, 0), - new TestCase(2455448.5, 0, 5771, 1, 1, THU, 0, 0, 0), - new TestCase(2487223.5, 0, 5858, 1, 1, SAT, 0, 0, 0), - }; - - /** - * Problem reported by Armand Bendanan in which setting of the MONTH - * field in a Hebrew calendar causes the time fields to go negative. - */ - public void TestTimeFields() { - HebrewCalendar calendar = new HebrewCalendar(5761, 0, 11, 12, 28, 15); - calendar.set(Calendar.YEAR, 5717); - calendar.set(Calendar.MONTH, 2); - calendar.set(Calendar.DAY_OF_MONTH, 23); - if (calendar.get(Calendar.HOUR_OF_DAY) != 12) { - errln("Fail: HebrewCalendar HOUR_OF_DAY = " + calendar.get(Calendar.HOUR_OF_DAY)); - } - } - - /** - * Test of the behavior of the month field. This requires special - * handling in the Hebrew calendar because of the pattern of leap - * years. - */ - public void TestMonthMovement() { - HebrewCalendar cal = new HebrewCalendar(); - // Leap years are: - // 3 6 8 11 14 17 19 (and so on - 19-year cycle) - // We can't test complete() on some lines below because of ADAR_1 -- if - // the calendar is set to ADAR_1 on a non-leap year, the result is undefined. - int[] DATA = { - // c - test complete() or not - // m/y - before and after month/year - // delta - amount to add to month field - //c m1 y1 delta m2 y2 - 1, 10, 2, +24, 9, 4, // (year 2, month 10) + 24 months -> (y 4, m 9) - 1, 10, 2, +60, 8, 7, // (y 2, m 10) + 60 months -> (y 7, m 8) - 1, 1, 2, +12, 1, 3, // (y 2, m 1) + 12 months -> (y 3, m 1) - 1, 3, 18, -24, 4, 16, // (y 18, m 3) - 24 months -> (y 16, m 4) - 1, 1, 6, -24, 1, 4, - 1, 4, 3, +2, 6, 3, // Leap year - no skip 4,5,6,7,8 - 1, 8, 3, -2, 6, 3, // Leap year - no skip - 0, 4, 2, +2, 7, 2, // Skip over leap month 4,5,(6),7,8 - 0, 8, 2, -2, 5, 2, // Skip over leap month going backward - }; - for (int i=0; i add(MONTH, " + monthDelta + ") -> " + - mact + "/" + yact + ", expected " + - m2 + "/" + y2); - cal.clear(); - cal.set(Calendar.YEAR, y); - cal.set(Calendar.MONTH, m-1); - logln("Start: " + m + "/" + y); - int delta = monthDelta > 0 ? 1 : -1; - for (int c=0; c!=monthDelta; c+=delta) { - cal.add(Calendar.MONTH, delta); - logln("+ " + delta + " MONTH -> " + - (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.YEAR)); - } - } - - if (testComplete) { - cal.clear(); - cal.set(Calendar.YEAR, y); - cal.set(Calendar.MONTH, m + monthDelta - 1); - yact = cal.get(Calendar.YEAR); mact = cal.get(Calendar.MONTH) + 1; - if (y2 != yact || m2 != mact) { - errln("Fail: " + (m+monthDelta) + "/" + y + - " -> complete() -> " + - mact + "/" + yact + ", expected " + - m2 + "/" + y2); - } - } - } - } - - /** - * Test handling of ADAR_1. - */ - /* - public void TestAdar1() { - HebrewCalendar cal = new HebrewCalendar(); - cal.clear(); - cal.set(Calendar.YEAR, 1903); // leap - cal.set(Calendar.MONTH, HebrewCalendar.ADAR_1); - logln("1903(leap)/ADAR_1 => " + - cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH)+1)); - - cal.clear(); - cal.set(Calendar.YEAR, 1904); // non-leap - cal.set(Calendar.MONTH, HebrewCalendar.ADAR_1); - logln("1904(non-leap)/ADAR_1 => " + - cal.get(Calendar.YEAR) + "/" + (cal.get(Calendar.MONTH)+1)); - } - */ - - /** - * With no fields set, the calendar should use default values. - */ - public void TestDefaultFieldValues() { - HebrewCalendar cal = new HebrewCalendar(); - cal.clear(); - logln("cal.clear() -> " + cal.getTime()); - } -}; diff --git a/icu4j/src/com/ibm/test/calendar/IBMCalendarTest.java b/icu4j/src/com/ibm/test/calendar/IBMCalendarTest.java deleted file mode 100755 index 3f89f7dbd6..0000000000 --- a/icu4j/src/com/ibm/test/calendar/IBMCalendarTest.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2000, International Business Machines Corporation and - * others. All Rights Reserved. - ******************************************************************************* - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/calendar/Attic/IBMCalendarTest.java,v $ - * $Date: 2001/10/30 02:42:49 $ - * $Revision: 1.5 $ - ******************************************************************************* - */ -package com.ibm.test.calendar; -import com.ibm.test.TestFmwk; -import com.ibm.util.*; -import java.text.*; -import java.util.Date; -import java.util.Locale; - -/** - * @test - * @summary Tests of new functionality in IBMCalendar - */ -public class IBMCalendarTest extends CalendarTest { - - public static void main(String[] args) throws Exception { - new IBMCalendarTest().run(args); - } - - /** - * Test weekend support in IBMCalendar. - * - * NOTE: This test will have to be updated when the isWeekend() etc. - * API is finalized later. - * - * In particular, the test will have to be rewritten to instantiate - * a Calendar in the given locale (using getInstance()) and call - * that Calendar's isWeekend() etc. methods. - */ - public void TestWeekend() { - SimpleDateFormat fmt = new SimpleDateFormat("EEE MMM dd yyyy G HH:mm:ss.SSS"); - - // NOTE - // This test tests for specific locale data. This is probably okay - // as far as US data is concerned, but if the Arabic/Bahrain data - // changes, this test will have to be updated. - - // Test specific days - Object[] DATA1 = { - Locale.US, new int[] { // Saturday:Sunday - 2000, Calendar.MARCH, 17, 23, 0, 0, // Fri 23:00 - 2000, Calendar.MARCH, 18, 0, -1, 0, // Fri 23:59:59.999 - 2000, Calendar.MARCH, 18, 0, 0, 1, // Sat 00:00 - 2000, Calendar.MARCH, 18, 15, 0, 1, // Sat 15:00 - 2000, Calendar.MARCH, 19, 23, 0, 1, // Sun 23:00 - 2000, Calendar.MARCH, 20, 0, -1, 1, // Sun 23:59:59.999 - 2000, Calendar.MARCH, 20, 0, 0, 0, // Mon 00:00 - 2000, Calendar.MARCH, 20, 8, 0, 0, // Mon 08:00 - }, - new Locale("ar", "BH"), new int[] { // Thursday:Friday - 2000, Calendar.MARCH, 15, 23, 0, 0, // Wed 23:00 - 2000, Calendar.MARCH, 16, 0, -1, 0, // Wed 23:59:59.999 - 2000, Calendar.MARCH, 16, 0, 0, 1, // Thu 00:00 - 2000, Calendar.MARCH, 16, 15, 0, 1, // Thu 15:00 - 2000, Calendar.MARCH, 17, 23, 0, 1, // Fri 23:00 - 2000, Calendar.MARCH, 18, 0, -1, 1, // Fri 23:59:59.999 - 2000, Calendar.MARCH, 18, 0, 0, 0, // Sat 00:00 - 2000, Calendar.MARCH, 18, 8, 0, 0, // Sat 08:00 - }, - }; - - // Test days of the week - Object[] DATA2 = { - Locale.US, new int[] { - Calendar.MONDAY, Calendar.WEEKDAY, - Calendar.FRIDAY, Calendar.WEEKDAY, - Calendar.SATURDAY, Calendar.WEEKEND, - Calendar.SUNDAY, Calendar.WEEKEND, - }, - new Locale("ar", "BH"), new int[] { // Thursday:Friday - Calendar.WEDNESDAY,Calendar.WEEKDAY, - Calendar.SATURDAY, Calendar.WEEKDAY, - Calendar.THURSDAY, Calendar.WEEKEND, - Calendar.FRIDAY, Calendar.WEEKEND, - }, - }; - - // We only test the getDayOfWeekType() and isWeekend() APIs. - // The getWeekendTransition() API is tested indirectly via the - // isWeekend() API, which calls it. - - for (int i1=0; i1 " + d); - } else { - errln("Fail: " + era + ":" + year + "/" + (month+1) + "/" + dayOfMonth + - " => " + d + ", expected " + D); - } - - cal.clear(); - cal.setTime(D); - int e = cal.get(Calendar.ERA); - int y = cal.get(Calendar.YEAR); - if (y == year && e == era) { - logln("OK: " + D + " => " + cal.get(Calendar.ERA) + ":" + - cal.get(Calendar.YEAR) + "/" + - (cal.get(Calendar.MONTH)+1) + "/" + cal.get(Calendar.DATE)); - } else { - logln("Fail: " + D + " => " + cal.get(Calendar.ERA) + ":" + - cal.get(Calendar.YEAR) + "/" + - (cal.get(Calendar.MONTH)+1) + "/" + cal.get(Calendar.DATE) + - ", expected " + era + ":" + year + "/" + (month+1) + "/" + - dayOfMonth); - } - } - } - - /** - * Verify that BuddhistCalendar shifts years to Buddhist Era but otherwise - * behaves like GregorianCalendar. - */ - public void TestBuddhist() { - quasiGregorianTest(new BuddhistCalendar(), - new int[] { - // BE 2542 == 1999 CE - 0, 2542, 1999, Calendar.JUNE, 4 - }); - } - - /** - * Verify that JapaneseCalendar shifts years to Buddhist Era but otherwise - * behaves like GregorianCalendar. - */ - public void TestJapanese() { - int[] data = { - JapaneseCalendar.MEIJI, 1, 1868, Calendar.SEPTEMBER, 8, - JapaneseCalendar.MEIJI, 1, 1868, Calendar.SEPTEMBER, 9, - JapaneseCalendar.MEIJI, 2, 1869, Calendar.JUNE, 4, - JapaneseCalendar.MEIJI, 45, 1912, Calendar.JULY, 29, - JapaneseCalendar.TAISHO, 1, 1912, Calendar.JULY, 30, - JapaneseCalendar.TAISHO, 1, 1912, Calendar.AUGUST, 1, - }; - quasiGregorianTest(new JapaneseCalendar(), data); - } - - /** - * Test limits of the Gregorian calendar. - */ - public void TestGregorianLimits() { - // Final parameter is either number of days, if > 0, or test - // duration in seconds, if < 0. - Calendar cal = Calendar.getInstance(); - cal.set(2004, Calendar.JANUARY, 1); - doLimitsTest(new GregorianCalendar(), null, cal.getTime(), -10); - } -} diff --git a/icu4j/src/com/ibm/test/calendar/IslamicTest.java b/icu4j/src/com/ibm/test/calendar/IslamicTest.java deleted file mode 100755 index 175cd5aabc..0000000000 --- a/icu4j/src/com/ibm/test/calendar/IslamicTest.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/calendar/Attic/IslamicTest.java,v $ - * $Date: 2000/11/18 00:17:58 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ -package com.ibm.test.calendar; - -import com.ibm.test.*; -import java.util.*; -import java.text.*; -import com.ibm.util.*; - -/** - * Tests for the IslamicCalendar class. - */ -public class IslamicTest extends CalendarTest { - public static void main(String args[]) throws Exception { - new IslamicTest().run(args); - } - - /** Constants to save typing. */ - public static final int MUHARRAM = IslamicCalendar.MUHARRAM; - public static final int SAFAR = IslamicCalendar.SAFAR; - public static final int RABI_1 = IslamicCalendar.RABI_1; - public static final int RABI_2 = IslamicCalendar.RABI_2; - public static final int JUMADA_1 = IslamicCalendar.JUMADA_1; - public static final int JUMADA_2 = IslamicCalendar.JUMADA_2; - public static final int RAJAB = IslamicCalendar.RAJAB; - public static final int SHABAN = IslamicCalendar.SHABAN; - public static final int RAMADAN = IslamicCalendar.RAMADAN; - public static final int SHAWWAL = IslamicCalendar.SHAWWAL; - public static final int QIDAH = IslamicCalendar.DHU_AL_QIDAH; - public static final int HIJJAH = IslamicCalendar.DHU_AL_HIJJAH; - - public void TestRoll() { - int[][] tests = new int[][] { - // input roll by output - // year month day field amount year month day - - { 0001, QIDAH, 2, MONTH, 1, 0001, HIJJAH, 2 }, // non-leap years - { 0001, QIDAH, 2, MONTH, 2, 0001, MUHARRAM, 2 }, - { 0001, QIDAH, 2, MONTH, -1, 0001, SHAWWAL, 2 }, - { 0001, MUHARRAM, 2, MONTH, 12, 0001, MUHARRAM, 2 }, - { 0001, MUHARRAM, 2, MONTH, 13, 0001, SAFAR, 2 }, - - { 0001, HIJJAH, 1, DATE, 30, 0001, HIJJAH, 2 }, // 29-day month - { 0002, HIJJAH, 1, DATE, 31, 0002, HIJJAH, 2 }, // 30-day month - - // Try some rolls that require other fields to be adjusted - { 0001, MUHARRAM, 30, MONTH, 1, 0001, SAFAR, 29 }, - { 0002, HIJJAH, 30, YEAR, -1, 0001, HIJJAH, 29 }, - }; - - IslamicCalendar cal = newCivil(); - - doRollAdd(ROLL, cal, tests); - } - - /** - * A huge list of test cases to make sure that computeTime and computeFields - * work properly for a wide range of data in the civil calendar. - */ - public void TestCivilCases() - { - final TestCase[] tests = { - // - // Most of these test cases were taken from the back of - // "Calendrical Calculations", with some extras added to help - // debug a few of the problems that cropped up in development. - // - // The months in this table are 1-based rather than 0-based, - // because it's easier to edit that way. - // Islamic - // Julian Day Era Year Month Day WkDay Hour Min Sec - new TestCase(1507231.5, 0, -1245, 12, 9, SUN, 0, 0, 0), - new TestCase(1660037.5, 0, -813, 2, 23, WED, 0, 0, 0), - new TestCase(1746893.5, 0, -568, 4, 1, WED, 0, 0, 0), - new TestCase(1770641.5, 0, -501, 4, 6, SUN, 0, 0, 0), - new TestCase(1892731.5, 0, -157, 10, 17, WED, 0, 0, 0), - new TestCase(1931579.5, 0, -47, 6, 3, MON, 0, 0, 0), - new TestCase(1974851.5, 0, 75, 7, 13, SAT, 0, 0, 0), - new TestCase(2091164.5, 0, 403, 10, 5, SUN, 0, 0, 0), - new TestCase(2121509.5, 0, 489, 5, 22, SUN, 0, 0, 0), - new TestCase(2155779.5, 0, 586, 2, 7, FRI, 0, 0, 0), - new TestCase(2174029.5, 0, 637, 8, 7, SAT, 0, 0, 0), - new TestCase(2191584.5, 0, 687, 2, 20, FRI, 0, 0, 0), - new TestCase(2195261.5, 0, 697, 7, 7, SUN, 0, 0, 0), - new TestCase(2229274.5, 0, 793, 7, 1, SUN, 0, 0, 0), - new TestCase(2245580.5, 0, 839, 7, 6, WED, 0, 0, 0), - new TestCase(2266100.5, 0, 897, 6, 1, SAT, 0, 0, 0), - new TestCase(2288542.5, 0, 960, 9, 30, SAT, 0, 0, 0), - new TestCase(2290901.5, 0, 967, 5, 27, SAT, 0, 0, 0), - new TestCase(2323140.5, 0, 1058, 5, 18, WED, 0, 0, 0), - new TestCase(2334848.5, 0, 1091, 6, 2, SUN, 0, 0, 0), - new TestCase(2348020.5, 0, 1128, 8, 4, FRI, 0, 0, 0), - new TestCase(2366978.5, 0, 1182, 2, 3, SUN, 0, 0, 0), - new TestCase(2385648.5, 0, 1234, 10, 10, MON, 0, 0, 0), - new TestCase(2392825.5, 0, 1255, 1, 11, WED, 0, 0, 0), - new TestCase(2416223.5, 0, 1321, 1, 21, SUN, 0, 0, 0), - new TestCase(2425848.5, 0, 1348, 3, 19, SUN, 0, 0, 0), - new TestCase(2430266.5, 0, 1360, 9, 8, MON, 0, 0, 0), - new TestCase(2430833.5, 0, 1362, 4, 13, MON, 0, 0, 0), - new TestCase(2431004.5, 0, 1362, 10, 7, THU, 0, 0, 0), - new TestCase(2448698.5, 0, 1412, 9, 13, TUE, 0, 0, 0), - new TestCase(2450138.5, 0, 1416, 10, 5, SUN, 0, 0, 0), - new TestCase(2465737.5, 0, 1460, 10, 12, WED, 0, 0, 0), - new TestCase(2486076.5, 0, 1518, 3, 5, SUN, 0, 0, 0), - }; - - IslamicCalendar civilCalendar = newCivil(); - civilCalendar.setLenient(true); - doTestCases(tests, civilCalendar); - } - - public void TestBasic() { - IslamicCalendar cal = newCivil(); - cal.clear(); - cal.set(1000, 0, 30); - logln("1000/0/30 -> " + - cal.get(YEAR) + "/" + - cal.get(MONTH) + "/" + - cal.get(DATE)); - cal.clear(); - cal.set(1, 0, 30); - logln("1/0/30 -> " + - cal.get(YEAR) + "/" + - cal.get(MONTH) + "/" + - cal.get(DATE)); - } - - private static IslamicCalendar newCivil() { - IslamicCalendar civilCalendar = new IslamicCalendar(); - civilCalendar.setCivil(true); - return civilCalendar; - } - -}; diff --git a/icu4j/src/com/ibm/test/calendar/TestCase.java b/icu4j/src/com/ibm/test/calendar/TestCase.java deleted file mode 100755 index 516a5ac625..0000000000 --- a/icu4j/src/com/ibm/test/calendar/TestCase.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/calendar/Attic/TestCase.java,v $ - * $Date: 2000/11/18 00:17:58 $ - * $Revision: 1.6 $ - * - ***************************************************************************************** - */ -package com.ibm.test.calendar; - -import com.ibm.test.*; -import com.ibm.util.Calendar; -import com.ibm.util.GregorianCalendar; -import java.util.Date; -import com.ibm.util.SimpleTimeZone; -import java.util.Locale; - -/** - * A pseudo Calendar that is useful for testing - * new calendars. A TestCase object is used to hold the - * field and millisecond values that the calendar should have at one - * particular instant in time. The applyFields and applyTime - * methods are used to apply these settings to the calendar object being - * tested, and the equals and fieldsEqual methods are used to ensure - * that the calendar has ended up in the right state. - */ -public class TestCase { - - //------------------------------------------------------------------ - // Pseudo-Calendar fields and methods - //------------------------------------------------------------------ - - protected int[] fields = new int[32]; - protected boolean[] isSet = new boolean[32]; - protected long time; - - protected void set(int field, int value) { - fields[field] = value; - isSet[field] = true; - } - - protected int get(int field) { - return fields[field]; - } - - protected boolean isSet(int field) { - return isSet[field]; - } - - protected void setTime(Date d) { - time = d.getTime(); - } - - public Date getTime() { - return new Date(time); - } - - /** - * Return a String representation of this test case's time. - */ - public String toString() { - return dowToString(get(Calendar.DAY_OF_WEEK)) + - get(Calendar.YEAR) + "/" + (get(Calendar.MONTH)+1) + "/" + - get(Calendar.DATE); - } - - private static final String[] DOW_NAMES = { - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - }; - - public static String dowToString(int dow) { - --dow; - return (dow < 0 || dow > 6) ? - ("") : DOW_NAMES[dow]; - } - - /** - * Initialize a TestCase object using a julian day number and - * the corresponding fields for the calendar being tested. - * - * @param era The ERA field of tested calendar on the given julian day - * @param year The YEAR field of tested calendar on the given julian day - * @param month The MONTH (1-based) field of tested calendar on the given julian day - * @param day The DAY_OF_MONTH field of tested calendar on the given julian day - * @param dayOfWeek The DAY_OF_WEEK field of tested calendar on the given julian day - * @param hour The HOUR field of tested calendar on the given julian day - * @param min The MINUTE field of tested calendar on the given julian day - * @param sec The SECOND field of tested calendar on the given julian day - */ - public TestCase(double julian, - int era, int year, int month, int day, - int dayOfWeek, - int hour, int min, int sec) - { - setTime(new Date(JULIAN_EPOCH + (long)(ONE_DAY * julian))); - - set(Calendar.ERA, era); - set(Calendar.YEAR, year); - set(Calendar.MONTH, month - 1); - set(Calendar.DATE, day); - set(Calendar.DAY_OF_WEEK, dayOfWeek); - set(Calendar.HOUR, hour); - set(Calendar.MINUTE, min); - set(Calendar.SECOND, sec); - } - - /** - * Initialize a TestCase object using a Gregorian year/month/day and - * the corresponding fields for the calendar being tested. - * - * @param gregYear The Gregorian year of the date to be tested - * @param gregMonth The Gregorian month of the date to be tested - * @param gregDay The Gregorian day of the month of the date to be tested - * - * @param era The ERA field of tested calendar on the given gregorian date - * @param year The YEAR field of tested calendar on the given gregorian date - * @param month The MONTH (0-based) field of tested calendar on the given gregorian date - * @param day The DAY_OF_MONTH field of tested calendar on the given gregorian date - * @param dayOfWeek The DAY_OF_WEEK field of tested calendar on the given gregorian date - * @param hour The HOUR field of tested calendar on the given gregorian date - * @param min The MINUTE field of tested calendar on the given gregorian date - * @param sec The SECOND field of tested calendar on the given gregorian date - */ - public TestCase(int gregYear, int gregMonth, int gregDay, - int era, int year, int month, int day, - int dayOfWeek, - int hour, int min, int sec) - { - GregorianCalendar greg = new GregorianCalendar(UTC, Locale.getDefault()); - greg.clear(); - greg.set(gregYear, gregMonth-1, gregDay); - setTime(greg.getTime()); - - set(Calendar.ERA, era); - set(Calendar.YEAR, year); - set(Calendar.MONTH, month - 1); - set(Calendar.DATE, day); - set(Calendar.DAY_OF_WEEK, dayOfWeek); - set(Calendar.HOUR, hour); - set(Calendar.MINUTE, min); - set(Calendar.SECOND, sec); - } - - /** - * For subclasses. - */ - protected TestCase() {} - - /** - * Apply this test case's field values to another calendar - * by calling its set method for each field. This is useful in combination - * with the equal method. - * - * @see #equal - */ - public void applyFields(Calendar c) { - for (int i=0; i < c.getFieldCount(); i++) { - if (isSet(i)) { - c.set(i, get(i)); - } - } - } - - /** - * Apply this test case's time in milliseconds to another calendar - * by calling its setTime method. This is useful in combination - * with fieldsEqual - * - * @see #fieldsEqual - */ - public void applyTime(Calendar c) { - c.setTime(new Date(time)); - } - - /** - * Determine whether the fields of this calendar - * are the same as that of the other calendar. This method is useful - * for determining whether the other calendar's computeFields method - * works properly. For example: - *
    -     *    Calendar testCalendar = ...
    -     *    TestCase case = ...
    -     *    case.applyTime(testCalendar);
    -     *    if (!case.fieldsEqual(testCalendar)) {
    -     *        // Error!
    -     *    }
    -     * 
    - * - * @see #applyTime - */ - public boolean fieldsEqual(Calendar c, TestLog log) { - for (int i=0; i < c.getFieldCount(); i++) { - if (isSet(i) && get(i) != c.get(i)) { - log.errln("Fail: " + CalendarTest.fieldName(i) + " = " + c.get(i) + - ", expected " + get(i)); - for (int j=0; j - * Calendar testCalendar = ... - * TestCase case = ... - * case.applyFields(testCalendar); - * if (!case.equals(testCalendar)) { - * // Error! - * } - *
- * - * @see #applyFields - */ - public boolean equals(Object obj) { - return time == ((Calendar)obj).getTime().getTime(); - } - - protected static final int ONE_SECOND = 1000; - protected static final int ONE_MINUTE = 60*ONE_SECOND; - protected static final int ONE_HOUR = 60*ONE_MINUTE; - protected static final long ONE_DAY = 24*ONE_HOUR; - protected static final long JULIAN_EPOCH = -210866760000000L; // 1/1/4713 BC 12:00 - - public final static SimpleTimeZone UTC = new SimpleTimeZone(0, "GMT"); -} diff --git a/icu4j/src/com/ibm/test/calendar/package.html b/icu4j/src/com/ibm/test/calendar/package.html deleted file mode 100755 index 14f0d50be4..0000000000 --- a/icu4j/src/com/ibm/test/calendar/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Tests for the calendar classes. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/compression/DecompressionTest.java b/icu4j/src/com/ibm/test/compression/DecompressionTest.java deleted file mode 100755 index 147f21668a..0000000000 --- a/icu4j/src/com/ibm/test/compression/DecompressionTest.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/compression/Attic/DecompressionTest.java,v $ - * $Date: 2000/03/10 03:47:45 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.test.compression; - -import com.ibm.text.UnicodeCompressor; -import com.ibm.text.UnicodeDecompressor; -import com.ibm.test.TestFmwk; - -public class DecompressionTest extends TestFmwk { - public static void main(String[] args) throws Exception { - new DecompressionTest().run(args); - } - - /** Print out a segment of a character array, if in verbose mode */ - private void log(char [] chars, int start, int count) { - log("|"); - for(int i = start; i < start + count; ++i) { - log(String.valueOf(chars[i])); - } - log("|"); - } - - /** Print out a segment of a character array, followed by a newline */ - private void logln(char [] chars, int start, int count) - { - log(chars, start, count); - logln(""); - } - - /** Decompress the two segments */ - private String decompressTest(byte [] segment1, byte [] segment2) { - StringBuffer s = new StringBuffer(); - UnicodeDecompressor myDecompressor = new UnicodeDecompressor(); - - int [] bytesRead = new int[1]; - char [] charBuffer = new char [2*(segment1.length + segment2.length)]; - int count1 = 0, count2 = 0; - - count1 = myDecompressor.decompress(segment1, 0, segment1.length, - bytesRead, - charBuffer, 0, charBuffer.length); - - logln("Segment 1 (" + segment1.length + " bytes) " + - "decompressed into " + count1 + " chars"); - logln("Bytes consumed: " + bytesRead[0]); - - logln("Got chars: "); - logln(charBuffer, 0, count1); - s.append(charBuffer, 0, count1); - - count2 = myDecompressor.decompress(segment2, 0, segment2.length, - bytesRead, - charBuffer, count1, - charBuffer.length); - - logln("Segment 2 (" + segment2.length + " bytes) " + - "decompressed into " + count2 + " chars"); - logln("Bytes consumed: " + bytesRead[0]); - - logln("Got chars: "); - logln(charBuffer, count1, count2); - - s.append(charBuffer, count1, count2); - - logln("Result: "); - logln(charBuffer, 0, count1 + count2); - logln("===================="); - - return s.toString(); - } - - - public void testDecompression() throws Exception { - String result; - - // compressed segment breaking on a define window sequence - /* B o o t h SD1 */ - byte [] segment1 = { 0x42, 0x6f, 0x6f, 0x74, 0x68, 0x19 }; - - // continuation - /* IDX , S . */ - byte [] segment2 = { 0x01, 0x2c, 0x20, 0x53, 0x2e }; - - result = decompressTest(segment1, segment2); - if(! result.equals("Booth, S.")) { - errln("Decompression test failed"); - return; - } - - // compressed segment breaking on a quote unicode sequence - /* B o o t SQU */ - byte [] segment3 = { 0x42, 0x6f, 0x6f, 0x74, 0x0e, 0x00 }; - - // continuation - /* h , S . */ - byte [] segment4 = { 0x68, 0x2c, 0x20, 0x53, 0x2e }; - - result = decompressTest(segment3, segment4); - if(! result.equals("Booth, S.")) { - errln("Decompression test failed"); - return; - } - - - // compressed segment breaking on a quote unicode sequence - /* SCU UQU */ - byte [] segment5 = { 0x0f, (byte)0xf0, 0x00 }; - - // continuation - /* B */ - byte [] segment6 = { 0x42 }; - - result = decompressTest(segment5, segment6); - if(! result.equals("B")) { - errln("Decompression test failed"); - return; - } - } - -}; diff --git a/icu4j/src/com/ibm/test/compression/ExhaustiveTest.java b/icu4j/src/com/ibm/test/compression/ExhaustiveTest.java deleted file mode 100755 index 0b02f458ff..0000000000 --- a/icu4j/src/com/ibm/test/compression/ExhaustiveTest.java +++ /dev/null @@ -1,529 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/compression/Attic/ExhaustiveTest.java,v $ - * $Date: 2001/09/08 01:16:25 $ - * $Revision: 1.4 $ - * - ***************************************************************************************** - */ -package com.ibm.test.compression; - -import com.ibm.text.UnicodeCompressor; -import com.ibm.text.UnicodeDecompressor; -import java.util.Random; -import com.ibm.test.TestFmwk; - -public class ExhaustiveTest extends TestFmwk { - public static void main(String args[]) throws Exception { - new ExhaustiveTest().run(args); - } - - /** Test simple compress/decompress API, returning # of errors */ - public void testSimple() throws Exception { - for(int i = 0; i < fTestCases.length; i++) { - simpleTest(fTestCases[i]); - } - } - private void simpleTest(String s) throws Exception { - byte [] compressed = UnicodeCompressor.compress(s); - String res = UnicodeDecompressor.decompress(compressed); - if (logDiffs(s.toCharArray(), s.length(), - res.toCharArray(), res.length()) == false) { - logln(s.length() + " chars ===> " - + compressed.length + " bytes ===> " - + res.length() + " chars"); - } else { - logln("Compressed:"); - printBytes(compressed, compressed.length); - errln("testSimple did not compress correctly"); - } - } - - /** Test iterative compress/decompress API, returning # of errors */ - public void testIterative() throws Exception { - for(int i = 0; i < fTestCases.length; i++) { - myTest(fTestCases[i].toCharArray(), fTestCases[i].length()); - } - } - private void myTest(char[] chars, int len) { - UnicodeCompressor myCompressor = new UnicodeCompressor(); - UnicodeDecompressor myDecompressor = new UnicodeDecompressor(); - - // variables for my compressor - int myByteCount = 0; - int myCharCount = 0; - int myCompressedSize = Math.max(512, 3*len); - byte[] myCompressed = new byte[myCompressedSize]; - int myDecompressedSize = Math.max(2, 2 * len); - char[] myDecompressed = new char[myDecompressedSize]; - int[] unicharsRead = new int[1]; - int[] bytesRead = new int[1]; - - myByteCount = myCompressor.compress(chars, 0, len, unicharsRead, - myCompressed, 0, myCompressedSize); - - myCharCount = myDecompressor.decompress(myCompressed, 0, myByteCount, - bytesRead, myDecompressed, 0, myDecompressedSize); - - if (logDiffs(chars, len, myDecompressed, myCharCount) == false) { - logln(len + " chars ===> " - + myByteCount + " bytes ===> " - + myCharCount + " chars"); - } else { - logln("Compressed:"); - printBytes(myCompressed, myByteCount); - errln("Iterative test failed"); - } - } - - /** Test iterative compress/decompress API */ - public void testMultipass() throws Exception { - for(int i = 0; i < fTestCases.length; i++) { - myMultipassTest(fTestCases[i].toCharArray(), fTestCases[i].length()); - } - } - private void myMultipassTest(char [] chars, int len) throws Exception { - UnicodeCompressor myCompressor = new UnicodeCompressor(); - UnicodeDecompressor myDecompressor = new UnicodeDecompressor(); - - // variables for my compressor - - // for looping - int byteBufferSize = 4;//Math.max(4, len / 4); - byte[] byteBuffer = new byte [byteBufferSize]; - // real target - int compressedSize = Math.max(512, 3 * len); - byte[] compressed = new byte[compressedSize]; - - // for looping - int unicharBufferSize = 2;//byteBufferSize; - char[] unicharBuffer = new char[unicharBufferSize]; - // real target - int decompressedSize = Math.max(2, 2 * len); - char[] decompressed = new char[decompressedSize]; - - int bytesWritten = 0; - int unicharsWritten = 0; - - int[] unicharsRead = new int[1]; - int[] bytesRead = new int[1]; - - int totalCharsCompressed = 0; - int totalBytesWritten = 0; - - int totalBytesDecompressed = 0; - int totalCharsWritten = 0; - - // not used boolean err = false; - - - // perform the compression in a loop - do { - - // do the compression - bytesWritten = myCompressor.compress(chars, totalCharsCompressed, - len, unicharsRead, byteBuffer, 0, byteBufferSize); - - // copy the current set of bytes into the target buffer - System.arraycopy(byteBuffer, 0, compressed, - totalBytesWritten, bytesWritten); - - // update the no. of characters compressed - totalCharsCompressed += unicharsRead[0]; - - // update the no. of bytes written - totalBytesWritten += bytesWritten; - - /*System.out.logln("Compression pass complete. Compressed " - + unicharsRead[0] + " chars into " - + bytesWritten + " bytes.");*/ - } while(totalCharsCompressed < len); - - if (totalCharsCompressed != len) { - errln("ERROR: Number of characters compressed(" - + totalCharsCompressed + ") != len(" + len + ")"); - } else { - logln("MP: " + len + " chars ===> " + totalBytesWritten + " bytes."); - } - - // perform the decompression in a loop - do { - - // do the decompression - unicharsWritten = myDecompressor.decompress(compressed, - totalBytesDecompressed, totalBytesWritten, - bytesRead, unicharBuffer, 0, unicharBufferSize); - - // copy the current set of chars into the target buffer - System.arraycopy(unicharBuffer, 0, decompressed, - totalCharsWritten, unicharsWritten); - - // update the no. of bytes decompressed - totalBytesDecompressed += bytesRead[0]; - - // update the no. of chars written - totalCharsWritten += unicharsWritten; - - /*System.out.logln("Decompression pass complete. Decompressed " - + bytesRead[0] + " bytes into " - + unicharsWritten + " chars.");*/ - } while (totalBytesDecompressed < totalBytesWritten); - - if (totalBytesDecompressed != totalBytesWritten) { - errln("ERROR: Number of bytes decompressed(" - + totalBytesDecompressed - + ") != totalBytesWritten(" - + totalBytesWritten + ")"); - } else { - logln("MP: " + totalBytesWritten - + " bytes ===> " + totalCharsWritten + " chars."); - } - - if (logDiffs(chars, len, decompressed, totalCharsWritten)) { - errln("ERROR: buffer contents incorrect"); - } - } - - /** Print differences between two character buffers */ - private boolean logDiffs(char[] s1, int s1len, char[] s2, int s2len) { - boolean result = false; - - if(s1len != s2len) { - logln("===================="); - logln("Length doesn't match: expected " + s1len - + ", got " + s2len); - logln("Expected:"); - printChars(s1, s1len); - logln("Got:"); - printChars(s2, s2len); - result = true; - } - - int len = Math.min(s1len, s2len); - for(int i = 0; i < len; ++i) { - if(s1[i] != s2[i]) { - if(result == false) { - logln("===================="); - } - logln("First difference at char " + i); - logln("Exp. char: " + Integer.toHexString(s1[i])); - logln("Got char : " + Integer.toHexString(s2[i])); - logln("Expected:"); - printChars(s1, s1len); - logln("Got:"); - printChars(s2, s2len); - result = true; - break; - } - } - - return result; - } - - // generate a string of characters, with simulated runs of characters - private static char[] randomChars(int len, Random random) { - char[] result = new char [len]; - int runLen = 0; - int used = 0; - - while(used < len) { - runLen = (int) (30 * random.nextDouble()); - if(used + runLen >= len) { - runLen = len - used; - } - randomRun(result, used, runLen, random); - used += runLen; - } - - return result; - } - - // generate a run of characters in a "window" - private static void randomRun(char[] target, int pos, int len, Random random) { - int offset = (int) (0xFFFF * random.nextDouble()); - - // don't overflow 16 bits - if(offset > 0xFF80) { - offset = 0xFF80; - } - - for(int i = pos; i < pos + len; i++) { - target[i] = (char)(offset + (0x7F * random.nextDouble())); - } - } - - private static final String [] fTestCases = { - "Hello \u9292 \u9192 World!", - "Hell\u0429o \u9292 \u9192 W\u0084rld!", - "Hell\u0429o \u9292 \u9292W\u0084rld!", - - "\u0648\u06c8", // catch missing reset - "\u0648\u06c8", - - "\u4444\uE001", // lowest quotable - "\u4444\uf2FF", // highest quotable - "\u4444\uf188\u4444", - "\u4444\uf188\uf288", - "\u4444\uf188abc\0429\uf288", - "\u9292\u2222", - "Hell\u0429\u04230o \u9292 \u9292W\u0084\u0192rld!", - "Hell\u0429o \u9292 \u9292W\u0084rld!", - "Hello World!123456", - "Hello W\u0081\u011f\u0082!", // Latin 1 run - - "abc\u0301\u0302", // uses SQn for u301 u302 - "abc\u4411d", // uses SQU - "abc\u4411\u4412d",// uses SCU - "abc\u0401\u0402\u047f\u00a5\u0405", // uses SQn for ua5 - "\u9191\u9191\u3041\u9191\u3041\u3041\u3000", // SJIS like data - "\u9292\u2222", - "\u9191\u9191\u3041\u9191\u3041\u3041\u3000", - "\u9999\u3051\u300c\u9999\u9999\u3060\u9999\u3065\u3065\u3065\u300c", - "\u3000\u266a\u30ea\u30f3\u30b4\u53ef\u611b\u3044\u3084\u53ef\u611b\u3044\u3084\u30ea\u30f3\u30b4\u3002", - - "", // empty input - "\u0000", // smallest BMP character - "\uFFFF", // largest BMP character - - "\ud800\udc00", // smallest surrogate - "\ud8ff\udcff", // largest surrogate pair - - // regression tests - "\u6441\ub413\ua733\uf8fe\ueedb\u587f\u195f\u4899\uf23d\u49fd\u0aac\u5792\ufc22\ufc3c\ufc46\u00aa", - "\u30f9\u8321\u05e5\u181c\ud72b\u2019\u99c9\u2f2f\uc10c\u82e1\u2c4d\u1ebc\u6013\u66dc\ubbde\u94a5\u4726\u74af\u3083\u55b9\u000c", - "\u0041\u00df\u0401\u015f", - "\u9066\u2123abc", - "\ud266\u43d7\\\ue386\uc9c0\u4a6b\u9222\u901f\u7410\ua63f\u539b\u9596\u482e\u9d47\ucfe4\u7b71\uc280\uf26a\u982f\u862a\u4edd\uf513\ufda6\u869d\u2ee0\ua216\u3ff6\u3c70\u89c0\u9576\ud5ec\ubfda\u6cca\u5bb3\ubcea\u554c\u914e\ufa4a\uede3\u2990\ud2f5\u2729\u5141\u0f26\uccd8\u5413\ud196\ubbe2\u51b9\u9b48\u0dc8\u2195\u21a2\u21e9\u00e4\u9d92\u0bc0\u06c5", - "\uf95b\u2458\u2468\u0e20\uf51b\ue36e\ubfc1\u0080\u02dd\uf1b5\u0cf3\u6059\u7489" - - }; - - //========================== - // Compression modes - //========================== - private final static int SINGLEBYTEMODE = 0; - private final static int UNICODEMODE = 1; - - //========================== - // Single-byte mode tags - //========================== - private final static int SDEFINEX = 0x0B; - private final static int SRESERVED = 0x0C; // this is a reserved value - private final static int SQUOTEU = 0x0E; - private final static int SSWITCHU = 0x0F; - - private final static int SQUOTE0 = 0x01; - private final static int SQUOTE1 = 0x02; - private final static int SQUOTE2 = 0x03; - private final static int SQUOTE3 = 0x04; - private final static int SQUOTE4 = 0x05; - private final static int SQUOTE5 = 0x06; - private final static int SQUOTE6 = 0x07; - private final static int SQUOTE7 = 0x08; - - private final static int SSWITCH0 = 0x10; - private final static int SSWITCH1 = 0x11; - private final static int SSWITCH2 = 0x12; - private final static int SSWITCH3 = 0x13; - private final static int SSWITCH4 = 0x14; - private final static int SSWITCH5 = 0x15; - private final static int SSWITCH6 = 0x16; - private final static int SSWITCH7 = 0x17; - - private final static int SDEFINE0 = 0x18; - private final static int SDEFINE1 = 0x19; - private final static int SDEFINE2 = 0x1A; - private final static int SDEFINE3 = 0x1B; - private final static int SDEFINE4 = 0x1C; - private final static int SDEFINE5 = 0x1D; - private final static int SDEFINE6 = 0x1E; - private final static int SDEFINE7 = 0x1F; - - //========================== - // Unicode mode tags - //========================== - private final static int USWITCH0 = 0xE0; - private final static int USWITCH1 = 0xE1; - private final static int USWITCH2 = 0xE2; - private final static int USWITCH3 = 0xE3; - private final static int USWITCH4 = 0xE4; - private final static int USWITCH5 = 0xE5; - private final static int USWITCH6 = 0xE6; - private final static int USWITCH7 = 0xE7; - - private final static int UDEFINE0 = 0xE8; - private final static int UDEFINE1 = 0xE9; - private final static int UDEFINE2 = 0xEA; - private final static int UDEFINE3 = 0xEB; - private final static int UDEFINE4 = 0xEC; - private final static int UDEFINE5 = 0xED; - private final static int UDEFINE6 = 0xEE; - private final static int UDEFINE7 = 0xEF; - - private final static int UQUOTEU = 0xF0; - private final static int UDEFINEX = 0xF1; - private final static int URESERVED = 0xF2; // this is a reserved value - - /* Print out an array of characters, with non-printables (for me) - displayed as hex values */ - private void printChars(char[] chars, int len) { - for(int i = 0; i < len; i++) { - int c = (int)chars[i]; - if(c < 0x0020 || c >= 0x7f) { - log("[0x"); - log(Integer.toHexString(c)); - log("]"); - } else { - log(String.valueOf((char)c)); - } - } - logln(""); - } - - private void printBytes(byte[] byteBuffer, int len) { - int curByteIndex = 0; - int byteBufferLimit = len; - int mode = SINGLEBYTEMODE; - int aByte = 0x00; - - if(len > byteBuffer.length) { - logln("Warning: printBytes called with length too large. Truncating"); - byteBufferLimit = byteBuffer.length;; - } - - while(curByteIndex < byteBufferLimit) { - switch(mode) { - case SINGLEBYTEMODE: - while(curByteIndex < byteBufferLimit - && mode == SINGLEBYTEMODE) { - aByte = ((int)byteBuffer[curByteIndex++]) & 0xFF; - switch(aByte) { - default: - log(Integer.toHexString(((int) aByte) & 0xFF) + " "); - break; - // quote unicode - case SQUOTEU: - log("SQUOTEU "); - if (curByteIndex < byteBufferLimit) { - log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " "); - } - if (curByteIndex < byteBufferLimit) { - log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " "); - } - break; - - // switch to Unicode mode - case SSWITCHU: - log("SSWITCHU "); - mode = UNICODEMODE; - break; - - // handle all quote tags - case SQUOTE0: case SQUOTE1: case SQUOTE2: case SQUOTE3: - case SQUOTE4: case SQUOTE5: case SQUOTE6: case SQUOTE7: - log("SQUOTE" + (aByte - SQUOTE0) + " "); - if(curByteIndex < byteBufferLimit) { - log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " "); - } - break; - - // handle all switch tags - case SSWITCH0: case SSWITCH1: case SSWITCH2: case SSWITCH3: - case SSWITCH4: case SSWITCH5: case SSWITCH6: case SSWITCH7: - log("SSWITCH" + (aByte - SSWITCH0) + " "); - break; - - // handle all define tags - case SDEFINE0: case SDEFINE1: case SDEFINE2: case SDEFINE3: - case SDEFINE4: case SDEFINE5: case SDEFINE6: case SDEFINE7: - log("SDEFINE" + (aByte - SDEFINE0) + " "); - if (curByteIndex < byteBufferLimit) { - log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " "); - } - break; - - // handle define extended tag - case SDEFINEX: - log("SDEFINEX "); - if (curByteIndex < byteBufferLimit) { - log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " "); - } - if (curByteIndex < byteBufferLimit) { - log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " "); - } - break; - - } // end switch - } // end while - break; - - case UNICODEMODE: - while(curByteIndex < byteBufferLimit && mode == UNICODEMODE) { - aByte = ((int)byteBuffer[curByteIndex++]) & 0xFF; - switch(aByte) { - // handle all define tags - case UDEFINE0: case UDEFINE1: case UDEFINE2: case UDEFINE3: - case UDEFINE4: case UDEFINE5: case UDEFINE6: case UDEFINE7: - log("UDEFINE" + (aByte - UDEFINE0) + " "); - if (curByteIndex < byteBufferLimit) { - log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " "); - } - mode = SINGLEBYTEMODE; - break; - - // handle define extended tag - case UDEFINEX: - log("UDEFINEX "); - if (curByteIndex < byteBufferLimit) { - log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " "); - } - if (curByteIndex < byteBufferLimit) { - log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " "); - } - break; - - // handle all switch tags - case USWITCH0: case USWITCH1: case USWITCH2: case USWITCH3: - case USWITCH4: case USWITCH5: case USWITCH6: case USWITCH7: - log("USWITCH" + (aByte - USWITCH0) + " "); - mode = SINGLEBYTEMODE; - break; - - // quote unicode - case UQUOTEU: - log("UQUOTEU "); - if (curByteIndex < byteBufferLimit) { - log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " "); - } - if (curByteIndex < byteBufferLimit) { - log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " "); - } - break; - - default: - log(Integer.toHexString(((int) aByte) & 0xFF) + " "); - if (curByteIndex < byteBufferLimit) { - log(Integer.toHexString(((int) byteBuffer[curByteIndex++]) & 0xFF) + " "); - } - break; - - } // end switch - } // end while - break; - - } // end switch( mode ) - } // end while - - logln(""); - } -} - - - - - - diff --git a/icu4j/src/com/ibm/test/compression/package.html b/icu4j/src/com/ibm/test/compression/package.html deleted file mode 100755 index 6dfab86a17..0000000000 --- a/icu4j/src/com/ibm/test/compression/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Tests for the compression classes. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/normalizer/BasicTest.java b/icu4j/src/com/ibm/test/normalizer/BasicTest.java deleted file mode 100755 index 124de11da4..0000000000 --- a/icu4j/src/com/ibm/test/normalizer/BasicTest.java +++ /dev/null @@ -1,491 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/normalizer/Attic/BasicTest.java,v $ - * $Date: 2001/04/02 19:21:06 $ - * $Revision: 1.8 $ - * - ***************************************************************************************** - */ -package com.ibm.test.normalizer; - -import com.ibm.test.*; -import com.ibm.text.*; -import com.ibm.util.Utility; -import java.text.CharacterIterator; -import java.text.StringCharacterIterator; - -public class BasicTest extends TestFmwk { - public static void main(String[] args) throws Exception { - new BasicTest().run(args); - } - - String[][] canonTests = { - // Input Decomposed Composed - { "cat", "cat", "cat" }, - { "\u00e0ardvark", "a\u0300ardvark", "\u00e0ardvark", }, - - { "\u1e0a", "D\u0307", "\u1e0a" }, // D-dot_above - { "D\u0307", "D\u0307", "\u1e0a" }, // D dot_above - - { "\u1e0c\u0307", "D\u0323\u0307", "\u1e0c\u0307" }, // D-dot_below dot_above - { "\u1e0a\u0323", "D\u0323\u0307", "\u1e0c\u0307" }, // D-dot_above dot_below - { "D\u0307\u0323", "D\u0323\u0307", "\u1e0c\u0307" }, // D dot_below dot_above - - { "\u1e10\u0307\u0323", "D\u0327\u0323\u0307", "\u1e10\u0323\u0307"}, // D dot_below cedilla dot_above - { "D\u0307\u0328\u0323","D\u0328\u0323\u0307", "\u1e0c\u0328\u0307"}, // D dot_above ogonek dot_below - - { "\u1E14", "E\u0304\u0300", "\u1E14" }, // E-macron-grave - { "\u0112\u0300", "E\u0304\u0300", "\u1E14" }, // E-macron + grave - { "\u00c8\u0304", "E\u0300\u0304", "\u00c8\u0304" }, // E-grave + macron - - { "\u212b", "A\u030a", "\u00c5" }, // angstrom_sign - { "\u00c5", "A\u030a", "\u00c5" }, // A-ring - -// { "\u00fdffin", "A\u0308ffin", "\u00fdffin" }, - { "\u00fdffin", "y\u0301ffin", "\u00fdffin" }, //updated with 3.0 -// { "\u00fd\uFB03n", "A\u0308\uFB03n", "\u00fd\uFB03n" }, - { "\u00fd\uFB03n", "y\u0301\uFB03n", "\u00fd\uFB03n" }, //updated with 3.0 - - { "Henry IV", "Henry IV", "Henry IV" }, - { "Henry \u2163", "Henry \u2163", "Henry \u2163" }, - - { "\u30AC", "\u30AB\u3099", "\u30AC" }, // ga (Katakana) - { "\u30AB\u3099", "\u30AB\u3099", "\u30AC" }, // ka + ten - { "\uFF76\uFF9E", "\uFF76\uFF9E", "\uFF76\uFF9E" }, // hw_ka + hw_ten - { "\u30AB\uFF9E", "\u30AB\uFF9E", "\u30AB\uFF9E" }, // ka + hw_ten - { "\uFF76\u3099", "\uFF76\u3099", "\uFF76\u3099" }, // hw_ka + ten - - { "A\u0300\u0316", "A\u0316\u0300", "\u00C0\u0316" }, - }; - - String[][] compatTests = { - // Input Decomposed Composed - { "\uFB4f", "\u05D0\u05DC", "\u05D0\u05DC", }, // Alef-Lamed vs. Alef, Lamed - -// { "\u00fdffin", "A\u0308ffin", "\u00fdffin" }, -// { "\u00fd\uFB03n", "A\u0308ffin", "\u00fdffin" }, // ffi ligature -> f + f + i - { "\u00fdffin", "y\u0301ffin", "\u00fdffin" }, //updated for 3.0 - { "\u00fd\uFB03n", "y\u0301ffin", "\u00fdffin" }, // ffi ligature -> f + f + i - - { "Henry IV", "Henry IV", "Henry IV" }, - { "Henry \u2163", "Henry IV", "Henry IV" }, - - { "\u30AC", "\u30AB\u3099", "\u30AC" }, // ga (Katakana) - { "\u30AB\u3099", "\u30AB\u3099", "\u30AC" }, // ka + ten - - { "\uFF76\u3099", "\u30AB\u3099", "\u30AC" }, // hw_ka + ten - - /* These two are broken in Unicode 2.1.2 but fixed in 2.1.5 and later - { "\uFF76\uFF9E", "\u30AB\u3099", "\u30AC" }, // hw_ka + hw_ten - { "\u30AB\uFF9E", "\u30AB\u3099", "\u30AC" }, // ka + hw_ten - */ - }; - - // With Canonical decomposition, Hangul syllables should get decomposed - // into Jamo, but Jamo characters should not be decomposed into - // conjoining Jamo - String[][] hangulCanon = { - // Input Decomposed Composed - { "\ud4db", "\u1111\u1171\u11b6", "\ud4db" }, - { "\u1111\u1171\u11b6", "\u1111\u1171\u11b6", "\ud4db" }, - }; - - // With compatibility decomposition turned on, - // it should go all the way down to conjoining Jamo characters. - // THIS IS NO LONGER TRUE IN UNICODE v2.1.8, SO THIS TEST IS OBSOLETE - String[][] hangulCompat = { - // Input Decomposed Composed - // { "\ud4db", "\u1111\u116e\u1175\u11af\u11c2", "\ud478\u1175\u11af\u11c2" }, - }; - - public void TestHangulCompose() { - // Make sure that the static composition methods work - logln("Canonical composition..."); - staticTest(Normalizer.COMPOSE, 0, hangulCanon, 2); - logln("Compatibility composition..."); - staticTest(Normalizer.COMPOSE_COMPAT, 0, hangulCompat, 2); - - // Now try iterative composition.... - logln("Static composition..."); - Normalizer norm = new Normalizer("", Normalizer.COMPOSE, 0); - iterateTest(norm, hangulCanon, 2); - - norm.setMode(Normalizer.COMPOSE_COMPAT); - iterateTest(norm, hangulCompat, 2); - - // And finally, make sure you can do it in reverse too - logln("Reverse iteration..."); - norm.setMode(Normalizer.COMPOSE); - backAndForth(norm, hangulCanon); - } - - public void TestHangulDecomp() { - // Make sure that the static decomposition methods work - logln("Canonical decomposition..."); - staticTest(Normalizer.DECOMP, 0, hangulCanon, 1); - logln("Compatibility decomposition..."); - staticTest(Normalizer.DECOMP_COMPAT, 0, hangulCompat, 1); - - // Now the iterative decomposition methods... - logln("Iterative decomposition..."); - Normalizer norm = new Normalizer("", Normalizer.DECOMP, 0); - iterateTest(norm, hangulCanon, 1); - - norm.setMode(Normalizer.DECOMP_COMPAT); - iterateTest(norm, hangulCompat, 1); - - // And finally, make sure you can do it in reverse too - logln("Reverse iteration..."); - norm.setMode(Normalizer.DECOMP); - backAndForth(norm, hangulCanon); - } - - public void TestPrevious() { - Normalizer norm = new Normalizer("", Normalizer.DECOMP, 0); - - logln("testing decomp..."); - backAndForth(norm, canonTests); - - logln("testing compose..."); - norm.setMode(Normalizer.COMPOSE); - backAndForth(norm, canonTests); - } - - public void TestDecomp() { - Normalizer norm = new Normalizer("", Normalizer.DECOMP, 0); - iterateTest(norm, canonTests, 1); - - staticTest(Normalizer.DECOMP, 0, canonTests, 1); - } - - public void TestCompatDecomp() { - Normalizer norm = new Normalizer("", Normalizer.DECOMP_COMPAT, 0); - iterateTest(norm, compatTests, 1); - - staticTest(Normalizer.DECOMP_COMPAT, 0, compatTests, 1); - } - - public void TestCanonCompose() { - Normalizer norm = new Normalizer("", Normalizer.COMPOSE, 0); - iterateTest(norm, canonTests, 2); - - staticTest(Normalizer.COMPOSE, 0, canonTests, 2); - } - - public void TestCompatCompose() { - Normalizer norm = new Normalizer("", Normalizer.COMPOSE_COMPAT, 0); - iterateTest(norm, compatTests, 2); - - staticTest(Normalizer.COMPOSE_COMPAT, 0, compatTests, 2); - } - - public void TestExplodingBase() { - // \u017f - Latin small letter long s - // \u0307 - combining dot above - // \u1e61 - Latin small letter s with dot above - // \u1e9b - Latin small letter long s with dot above - String[][] canon = { - // Input Decomposed Composed - { "Tschu\u017f", "Tschu\u017f", "Tschu\u017f" }, - { "Tschu\u1e9b", "Tschu\u017f\u0307", "Tschu\u1e9b" }, - }; - String[][] compat = { - // Input Decomposed Composed - { "\u017f", "s", "s" }, - { "\u1e9b", "s\u0307", "\u1e61" }, - }; - - staticTest(Normalizer.DECOMP, 0, canon, 1); - staticTest(Normalizer.COMPOSE, 0, canon, 2); - - staticTest(Normalizer.DECOMP_COMPAT, 0, compat, 1); - staticTest(Normalizer.COMPOSE_COMPAT, 0, compat, 2); - - Normalizer norm = new Normalizer("", Normalizer.DECOMP_COMPAT); - iterateTest(norm, compat, 1); - backAndForth(norm, compat); - - norm.setMode(Normalizer.COMPOSE_COMPAT); - iterateTest(norm, compat, 2); - backAndForth(norm, compat); - } - - /** - * The Tibetan vowel sign AA, 0f71, was messed up prior to Unicode version 2.1.9. - * Once 2.1.9 or 3.0 is released, uncomment this test. - */ - public void TestTibetan() { - String[][] decomp = { - { "\u0f77", "\u0f77", "\u0fb2\u0f71\u0f80" } - }; - String[][] compose = { - { "\u0fb2\u0f71\u0f80", "\u0fb2\u0f71\u0f80", "\u0fb2\u0f71\u0f80" } - }; - - staticTest(Normalizer.DECOMP, 0, decomp, 1); - staticTest(Normalizer.DECOMP_COMPAT, 0, decomp, 2); - staticTest(Normalizer.COMPOSE, 0, compose, 1); - staticTest(Normalizer.COMPOSE_COMPAT, 0, compose, 2); - } - - /** - * Make sure characters in the CompositionExclusion.txt list do not get - * composed to. - */ - public void TestCompositionExclusion() { - // This list is generated from CompositionExclusion.txt. - // Update whenever the normalizer tables are updated. Note - // that we test all characters listed, even those that can be - // derived from the Unicode DB and are therefore commented - // out. - String EXCLUDED = - "\u0340\u0341\u0343\u0344\u0374\u037E\u0387\u0958" + - "\u0959\u095A\u095B\u095C\u095D\u095E\u095F\u09DC" + - "\u09DD\u09DF\u0A33\u0A36\u0A59\u0A5A\u0A5B\u0A5E" + - "\u0B5C\u0B5D\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69" + - "\u0F73\u0F75\u0F76\u0F78\u0F81\u0F93\u0F9D\u0FA2" + - "\u0FA7\u0FAC\u0FB9\u1F71\u1F73\u1F75\u1F77\u1F79" + - "\u1F7B\u1F7D\u1FBB\u1FBE\u1FC9\u1FCB\u1FD3\u1FDB" + - "\u1FE3\u1FEB\u1FEE\u1FEF\u1FF9\u1FFB\u1FFD\u2000" + - "\u2001\u2126\u212A\u212B\u2329\u232A\uF900\uFA10" + - "\uFA12\uFA15\uFA20\uFA22\uFA25\uFA26\uFA2A\uFB1F" + - "\uFB2A\uFB2B\uFB2C\uFB2D\uFB2E\uFB2F\uFB30\uFB31" + - "\uFB32\uFB33\uFB34\uFB35\uFB36\uFB38\uFB39\uFB3A" + - "\uFB3B\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46" + - "\uFB47\uFB48\uFB49\uFB4A\uFB4B\uFB4C\uFB4D\uFB4E"; - for (int i=0; i " + - hex(b) + " x COMPOSE => " + - hex(c)); - } else if (isVerbose()) { - logln("Ok: " + hex(a) + " x DECOMP_COMPAT => " + - hex(b) + " x COMPOSE => " + - hex(c)); - } - } - // The following method works too, but it is somewhat - // incestuous. It uses UInfo, which is the same database that - // NormalizerBuilder uses, so if something is wrong with - // UInfo, the following test won't show it. All it will show - // is that NormalizerBuilder has been run with whatever the - // current UInfo is. - // - // We comment this out in favor of the test above, which - // provides independent verification (but also requires - // independent updating). -// logln("---"); -// UInfo uinfo = new UInfo(); -// for (int i=0; i<=0xFFFF; ++i) { -// if (!uinfo.isExcludedComposition((char)i) || -// (!uinfo.hasCanonicalDecomposition((char)i) && -// !uinfo.hasCompatibilityDecomposition((char)i))) continue; -// String a = String.valueOf((char)i); -// String b = Normalizer.normalize(a, Normalizer.DECOMP_COMPAT, 0); -// String c = Normalizer.normalize(b, Normalizer.COMPOSE, 0); -// if (c.equals(a)) { -// errln("FAIL: " + hex(a) + " x DECOMP_COMPAT => " + -// hex(b) + " x COMPOSE => " + -// hex(c)); -// } else if (isVerbose()) { -// logln("Ok: " + hex(a) + " x DECOMP_COMPAT => " + -// hex(b) + " x COMPOSE => " + -// hex(c)); -// } -// } - } - - /** - * Test for a problem that showed up just before ICU 1.6 release - * having to do with combining characters with an index of zero. - * Such characters do not participate in any canonical - * decompositions. However, having an index of zero means that - * they all share one typeMask[] entry, that is, they all have to - * map to the same canonical class, which is not the case, in - * reality. - */ - public void TestZeroIndex() { - String[] DATA = { - // Expect col1 x COMPOSE_COMPAT => col2 - // Expect col2 x DECOMP => col3 - "A\u0316\u0300", "\u00C0\u0316", "A\u0316\u0300", - "A\u0300\u0316", "\u00C0\u0316", "A\u0316\u0300", - "A\u0327\u0300", "\u00C0\u0327", "A\u0327\u0300", - "c\u0321\u0327", "c\u0321\u0327", "c\u0321\u0327", - "c\u0327\u0321", "\u00E7\u0321", "c\u0327\u0321", - }; - - for (int i=0; i " + hex(b)); - } else { - errln("FAIL: " + hex(a) + " x COMPOSE_COMPAT => " + hex(b) + - ", expect " + hex(exp)); - } - a = Normalizer.normalize(b, Normalizer.DECOMP, 0); - exp = DATA[i+2]; - if (a.equals(exp)) { - logln("Ok: " + hex(b) + " x DECOMP => " + hex(a)); - } else { - errln("FAIL: " + hex(b) + " x DECOMP => " + hex(a) + - ", expect " + hex(exp)); - } - } - } - - /** - * Test for a problem found by Verisign. Problem is that - * characters at the start of a string are not put in canonical - * order correctly by compose() if there is no starter. - */ - public void TestVerisign() { - String[] inputs = { - "\u05b8\u05b9\u05b1\u0591\u05c3\u05b0\u05ac\u059f", - "\u0592\u05b7\u05bc\u05a5\u05b0\u05c0\u05c4\u05ad" - }; - String[] outputs = { - "\u05b1\u05b8\u05b9\u0591\u05c3\u05b0\u05ac\u059f", - "\u05b0\u05b7\u05bc\u05a5\u0592\u05c0\u05ad\u05c4" - }; - - for (int i = 0; i < inputs.length; ++i) { - String input = inputs[i]; - String output = outputs[i]; - String result = Normalizer.decompose(input, false, 0); - if (!result.equals(output)) { - errln("FAIL input: " + Utility.escape(input)); - errln(" decompose: " + Utility.escape(result)); - errln(" expected: " + Utility.escape(output)); - } - result = Normalizer.compose(input, false, 0); - if (!result.equals(output)) { - errln("FAIL input: " + Utility.escape(input)); - errln(" compose: " + Utility.escape(result)); - errln(" expected: " + Utility.escape(output)); - } - } - } - - //------------------------------------------------------------------------ - // Internal utilities - // - - private void backAndForth(Normalizer iter, String input) - { - iter.setText(input); - - // Run through the iterator forwards and stick it into a StringBuffer - StringBuffer forward = new StringBuffer(); - for (char ch = iter.first(); ch != iter.DONE; ch = iter.next()) { - forward.append(ch); - } - - // Now do it backwards - StringBuffer reverse = new StringBuffer(); - for (char ch = iter.last(); ch != iter.DONE; ch = iter.previous()) { - reverse.insert(0, ch); - } - - if (!forward.toString().equals(reverse.toString())) { - errln("FAIL: Forward/reverse mismatch for input " + hex(input) - + ", forward: " + hex(forward) + ", backward: " + hex(reverse)); - } else if (isVerbose()) { - logln("Ok: Forward/reverse for input " + hex(input) - + ", forward: " + hex(forward) + ", backward: " + hex(reverse)); - } - } - - private void backAndForth(Normalizer iter, String[][] tests) - { - for (int i = 0; i < tests.length; i++) - { - iter.setText(tests[i][0]); - - // Run through the iterator forwards and stick it into a StringBuffer - StringBuffer forward = new StringBuffer(); - for (char ch = iter.first(); ch != iter.DONE; ch = iter.next()) { - forward.append(ch); - } - - // Now do it backwards - StringBuffer reverse = new StringBuffer(); - for (char ch = iter.last(); ch != iter.DONE; ch = iter.previous()) { - reverse.insert(0, ch); - } - - if (!forward.toString().equals(reverse.toString())) { - errln("FAIL: Forward/reverse mismatch for input " + hex(tests[i][0]) - + ", forward: " + hex(forward) + ", backward: " + hex(reverse)); - } else if (isVerbose()) { - logln("Ok: Forward/reverse for input " + hex(tests[i][0]) - + ", forward: " + hex(forward) + ", backward: " + hex(reverse)); - } - } - } - - private void staticTest(Normalizer.Mode mode, int options, String[][] tests, int outCol) - { - for (int i = 0; i < tests.length; i++) - { - String input = tests[i][0]; - String expect = tests[i][outCol]; - - logln("Normalizing '" + input + "' (" + hex(input) + ")" ); - - String output = Normalizer.normalize(input, mode, options); - - if (!output.equals(expect)) { - errln("FAIL: case " + i - + " expected '" + expect + "' (" + hex(expect) + ")" - + " but got '" + output + "' (" + hex(output) + ")" ); - } - } - } - - private void iterateTest(Normalizer iter, String[][] tests, int outCol) - { - for (int i = 0; i < tests.length; i++) - { - String input = tests[i][0]; - String expect = tests[i][outCol]; - - logln("Normalizing '" + input + "' (" + hex(input) + ")" ); - - iter.setText(input); - assertEqual(expect, iter, "case " + i + " "); - } - } - - private void assertEqual(String expected, Normalizer iter, String msg) - { - int index = 0; - for (char ch = iter.first(); ch != iter.DONE; ch = iter.next()) - { - if (index >= expected.length()) { - errln("FAIL: " + msg + "Unexpected character '" + ch + "' (" + hex(ch) + ")" - + " at index " + index); - break; - } - char want = expected.charAt(index); - if (ch != want) { - errln("FAIL: " + msg + "got '" + ch + "' (" + hex(ch) + ")" - + " but expected '" + want + "' (" + hex(want) + ")" - + " at index " + index); - } - index++; - } - if (index < expected.length()) { - errln("FAIL: " + msg + "Only got " + index + " chars, expected " + expected.length()); - } - } -} diff --git a/icu4j/src/com/ibm/test/normalizer/ConformanceTest.java b/icu4j/src/com/ibm/test/normalizer/ConformanceTest.java deleted file mode 100755 index 44118c27ce..0000000000 --- a/icu4j/src/com/ibm/test/normalizer/ConformanceTest.java +++ /dev/null @@ -1,250 +0,0 @@ -/* -************************************************************************ -* Copyright (c) 1997-2000, International Business Machines -* Corporation and others. All Rights Reserved. -************************************************************************ -*/ - -package com.ibm.test.normalizer; - -import java.io.*; -import com.ibm.test.*; -import com.ibm.text.*; -import com.ibm.util.Utility; - -public class ConformanceTest extends TestFmwk { - - Normalizer normalizer; - - static final String TEST_SUITE_FILE = - "src/data/unicode/Draft-TestSuite.txt"; - - public static void main(String[] args) throws Exception { - new ConformanceTest().run(args); - } - - public ConformanceTest() { - // Doesn't matter what the string and mode are; we'll change - // them later as needed. - normalizer = new Normalizer("", Normalizer.COMPOSE); - } - - /** - * Test the conformance of Normalizer to - * http://www.unicode.org/unicode/reports/tr15/conformance/Draft-TestSuite.txt. - * This file must be located at the path specified as TEST_SUITE_FILE. - */ - public void TestConformance() { - BufferedReader input = null; - String line = null; - String[] fields = new String[5]; - StringBuffer buf = new StringBuffer(); - int passCount = 0; - int failCount = 0; - - try { - input = new BufferedReader(new FileReader(TEST_SUITE_FILE),64*1024); - for (int count = 0;;++count) { - line = input.readLine(); - if (line == null) break; - if (line.length() == 0) continue; - - // Expect 5 columns of this format: - // 1E0C;1E0C;0044 0323;1E0C;0044 0323; # - - // Skip comments - if (line.charAt(0) == '#') continue; - - // Parse out the fields - hexsplit(line, ';', fields, buf); - if (checkConformance(fields, line)) { - ++passCount; - } else { - ++failCount; - } - if ((count % 1000) == 999) { - logln("Line " + (count+1)); - } - } - } catch (IOException ex) { - try { - input.close(); - } catch (Exception ex2) { - System.out.print(""); - } - ex.printStackTrace(); - throw new IllegalArgumentException("Couldn't read file " - + ex.getClass().getName() + " " + ex.getMessage() - + " line = " + line - ); - } - - if (failCount != 0) { - errln("Total: " + failCount + " lines failed, " + - passCount + " lines passed"); - } else { - logln("Total: " + passCount + " lines passed"); - } - } - - /** - * Verify the conformance of the given line of the Unicode - * normalization (UTR 15) test suite file. For each line, - * there are five columns, corresponding to field[0]..field[4]. - * - * The following invariants must be true for all conformant implementations - * c2 == NFC(c1) == NFC(c2) == NFC(c3) - * c3 == NFD(c1) == NFD(c2) == NFD(c3) - * c4 == NFKC(c1) == NFKC(c2) == NFKC(c3) == NFKC(c4) == NFKC(c5) - * c5 == NFKD(c1) == NFKD(c2) == NFKD(c3) == NFKD(c4) == NFKD(c5) - * - * @param field the 5 columns - * @param line the source line from the test suite file - * @return true if the test passes - */ - private boolean checkConformance(String[] field, String line) { - boolean pass = true; - StringBuffer buf = new StringBuffer(); // scratch - String out; - - for (int i=0; i<5; ++i) { - if (i<3) { - out = Normalizer.normalize(field[i], Normalizer.COMPOSE, 0); - pass &= assertEqual("C", field[i], out, field[1], "c2!=C(c" + (i+1)); - out = iterativeNorm(field[i], Normalizer.COMPOSE, buf, +1); - pass &= assertEqual("C(+1)", field[i], out, field[1], "c2!=C(c" + (i+1)); - out = iterativeNorm(field[i], Normalizer.COMPOSE, buf, -1); - pass &= assertEqual("C(-1)", field[i], out, field[1], "c2!=C(c" + (i+1)); - - out = Normalizer.normalize(field[i], Normalizer.DECOMP, 0); - pass &= assertEqual("D", field[i], out, field[2], "c3!=D(c" + (i+1)); - out = iterativeNorm(field[i], Normalizer.DECOMP, buf, +1); - pass &= assertEqual("D(+1)", field[i], out, field[2], "c3!=D(c" + (i+1)); - out = iterativeNorm(field[i], Normalizer.DECOMP, buf, -1); - pass &= assertEqual("D(-1)", field[i], out, field[2], "c3!=D(c" + (i+1)); - } - out = Normalizer.normalize(field[i], Normalizer.COMPOSE_COMPAT, 0); - pass &= assertEqual("KC", field[i], out, field[3], "c4!=KC(c" + (i+1)); - out = iterativeNorm(field[i], Normalizer.COMPOSE_COMPAT, buf, +1); - pass &= assertEqual("KD(+1)", field[i], out, field[3], "c4!=KC(c" + (i+1)); - out = iterativeNorm(field[i], Normalizer.COMPOSE_COMPAT, buf, -1); - pass &= assertEqual("KD(-1)", field[i], out, field[3], "c4!=KC(c" + (i+1)); - - out = Normalizer.normalize(field[i], Normalizer.DECOMP_COMPAT, 0); - pass &= assertEqual("KD", field[i], out, field[4], "c5!=KD(c" + (i+1)); - out = iterativeNorm(field[i], Normalizer.DECOMP_COMPAT, buf, +1); - pass &= assertEqual("KD(+1)", field[i], out, field[4], "c5!=KD(c" + (i+1)); - out = iterativeNorm(field[i], Normalizer.DECOMP_COMPAT, buf, -1); - pass &= assertEqual("KD(-1)", field[i], out, field[4], "c5!=KD(c" + (i+1)); - } - if (!pass) { - errln("FAIL: " + line); - } - return pass; - } - - /** - * Do a normalization using the iterative API in the given direction. - * @param buf scratch buffer - * @param dir either +1 or -1 - */ - private String iterativeNorm(String str, Normalizer.Mode mode, - StringBuffer buf, int dir) { - normalizer.setText(str); - normalizer.setMode(mode); - buf.setLength(0); - char ch; - if (dir > 0) { - for (ch = normalizer.first(); ch != Normalizer.DONE; - ch = normalizer.next()) { - buf.append(ch); - } - } else { - for (ch = normalizer.last(); ch != Normalizer.DONE; - ch = normalizer.previous()) { - buf.insert(0, ch); - } - } - return buf.toString(); - } - - /** - * @param op name of normalization form, e.g., "KC" - * @param s string being normalized - * @param got value received - * @param exp expected value - * @param msg description of this test - * @param return true if got == exp - */ - private boolean assertEqual(String op, String s, String got, - String exp, String msg) { - if (exp.equals(got)) { - return true; - } - errln(Utility.escape(" " + msg + ") " + op + "(" + s + ")=" + got + - ", exp. " + exp)); - return false; - } - - /** - * Split a string into pieces based on the given delimiter - * character. Then, parse the resultant fields from hex into - * characters. That is, "0040 0400;0C00;0899" -> new String[] { - * "\u0040\u0400", "\u0C00", "\u0899" }. The output is assumed to - * be of the proper length already, and exactly output.length - * fields are parsed. If there are too few an exception is - * thrown. If there are too many the extras are ignored. - * - * @param buf scratch buffer - */ - private static void hexsplit(String s, char delimiter, - String[] output, StringBuffer buf) { - int i; - int pos = 0; - for (i=0; i delim) { - throw new IllegalArgumentException("Premature eol in " + s); - } else { - int hex = Integer.parseInt(s.substring(pos, pos+4), 16); - if (hex < 0 || hex > 0xFFFF) { - throw new IllegalArgumentException("Out of range hex " + - hex + " in " + s); - } - buf.append((char) hex); - pos += 4; - } - } - if (buf.length() < 1) { - throw new IllegalArgumentException("Empty field " + i + " in " + s); - } - output[i] = buf.toString(); - ++pos; // Skip over delim - } - } - - // Specific tests for debugging. These are generally failures - // taken from the conformance file, but culled out to make - // debugging easier. These can be eliminated without affecting - // coverage. - - public void _hideTestCase6() { - _testOneLine("0385;0385;00A8 0301;0020 0308 0301;0020 0308 0301;"); - } - - public void _testOneLine(String line) { - String[] fields = new String[5]; - StringBuffer buf = new StringBuffer(); - // Parse out the fields - hexsplit(line, ';', fields, buf); - checkConformance(fields, line); - } -} diff --git a/icu4j/src/com/ibm/test/normalizer/ExhaustiveTest.java b/icu4j/src/com/ibm/test/normalizer/ExhaustiveTest.java deleted file mode 100755 index 739c237d5e..0000000000 --- a/icu4j/src/com/ibm/test/normalizer/ExhaustiveTest.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/normalizer/Attic/ExhaustiveTest.java,v $ - * $Date: 2001/09/08 01:16:35 $ - * $Revision: 1.8 $ - * - ***************************************************************************************** - */ -package com.ibm.test.normalizer; - -import com.ibm.test.*; -import com.ibm.text.*; -import com.ibm.icu.internal.UInfo; - -public class ExhaustiveTest extends TestFmwk -{ - private UInfo info; - - public static void main(String[] args) throws Exception - { - UInfo tempInfo = null; - String[] tempArgs = new String[args.length]; - int count = 0; - - // Allow the test to be pointed at a specific version of the Unicode database - for (int i = 0; i < args.length; i++) - { - if (args[i].equals("-data")) { - tempInfo = new UInfo(args[++i], args[++i]); - } else { - tempArgs[count++] = args[i]; - } - } - - args = new String[count]; - System.arraycopy(tempArgs, 0, args, 0, count); - - - if (tempInfo == null) { - tempInfo = new UInfo(); - } - new ExhaustiveTest(tempInfo).run(args); - } - - public ExhaustiveTest() { - this.info = new UInfo(); - } - - public ExhaustiveTest(UInfo info) { - this.info = info; - } - - - /** - * Run through all of the characters returned by a composed-char iterator - * and make sure that: - *
    - *
  • a) They do indeed have decompositions. - *
  • b) The decomposition according to the iterator is the same as - * returned by Normalizer.decompose(). - *
  • c) All characters not returned by the iterator do not - * have decompositions. - *
- */ - public void TestComposedCharIter() { - doTestComposedChars(false); - } - - public void doTestComposedChars(boolean compat) { - int options = Normalizer.IGNORE_HANGUL; - ComposedCharIter iter = new ComposedCharIter(compat, options); - - char lastChar = 0; - - while (iter.hasNext()) { - char ch = iter.next(); - - // Test all characters between the last one and this one to make - // sure that they don't have decompositions - assertNoDecomp(lastChar, ch, compat, options); - lastChar = ch; - - // Now make sure that the decompositions for this character - // make sense - String chString = new StringBuffer().append(ch).toString(); - String iterDecomp = iter.decomposition(); - String normDecomp = Normalizer.decompose(chString, compat, 0); - - if (iterDecomp.equals(chString)) { - errln("ERROR: " + hex(ch) + " has identical decomp"); - } - else if (!iterDecomp.equals(normDecomp)) { - errln("ERROR: Normalizer decomp for " + hex(ch) + " (" + hex(normDecomp) + ")" - + " != iter decomp (" + hex(iterDecomp) + ")" ); - } - } - assertNoDecomp(lastChar, '\uFFFF', compat, options); - } - - void assertNoDecomp(char start, char limit, boolean compat, int options) - { - for (char x = ++start; x < limit; x++) { - String xString = new StringBuffer().append(x).toString(); - String decomp = Normalizer.decompose(xString, compat, options); - if (!decomp.equals(xString)) { - errln("ERROR: " + hex(x) + " has decomposition (" + hex(decomp) + ")" - + " but was not returned by iterator"); - } - } - } - - - public void TestRoundTrip() { - int options = Normalizer.IGNORE_HANGUL; - boolean compat = false; - - ComposedCharIter iter = new ComposedCharIter(false, options); - while (iter.hasNext()) { - char ch = iter.next(); - - String chStr = new StringBuffer().append(ch).toString(); - String decomp = Normalizer.decompose(chStr, compat, options); - String comp = Normalizer.compose(decomp, compat, options); - - short cClass = info.getCanonicalClass(decomp.charAt(0)); - cClass = 0; - - if (info.isExcludedComposition(ch)) { - logln("Skipped excluded char " + hex(ch) + " (" + info.getName(ch,true) + ")" ); - continue; - } - - // Avoid disparaged characters - if (info.getDecomposition(ch).length() == 4) continue; - - if (!comp.equals(chStr)) { - errln("ERROR: Round trip invalid: " + hex(chStr) + " --> " + hex(decomp) - + " --> " + hex(comp)); - - errln(" char decomp is '" + info.getDecomposition(ch) + "'"); - } - } - } -} diff --git a/icu4j/src/com/ibm/test/normalizer/TestCanonicalIterator.java b/icu4j/src/com/ibm/test/normalizer/TestCanonicalIterator.java deleted file mode 100755 index 9a6ea1189a..0000000000 --- a/icu4j/src/com/ibm/test/normalizer/TestCanonicalIterator.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/normalizer/Attic/TestCanonicalIterator.java,v $ - * $Date: 2002/02/01 02:05:35 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.test.normalizer; - -import com.ibm.test.*; -import com.ibm.text.*; -import com.ibm.util.Utility; -import java.text.CharacterIterator; -import java.text.StringCharacterIterator; -import java.util.*; - -// TODO: fit into test framework - -public class TestCanonicalIterator { - static final String testArray[] = { - "Åd\u0307\u0327", - "\u010d\u017E", - "x\u0307\u0327", - }; - - public static void main(String[] args) { - // set up for readable display - Transliterator name = Transliterator.getInstance("name"); - Transliterator hex = Transliterator.getInstance("hex"); - - // check build - UnicodeSet ss = CanonicalIterator.getSafeStart(); - System.out.println("Safe Start: " + ss.toPattern(true)); - System.out.println(); - ss = CanonicalIterator.getStarts('a'); - System.out.println("Characters with 'a' at the start of their decomposition: " + ss.toPattern(true)); - - // check permute - System.out.println(collectionToString(CanonicalIterator.permute("ABC"))); - - // try samples - for (int i = 0; i < testArray.length; ++i) { - System.out.println(); - System.out.println("Results for: " + name.transliterate(testArray[i])); - CanonicalIterator it = new CanonicalIterator(testArray[i]); - int counter = 0; - while (true) { - String result = it.next(); - if (result == null) break; - System.out.println(++counter + ": " + hex.transliterate(result)); - System.out.println(" = " + name.transliterate(result)); - } - } - } - - static String collectionToString(Collection col) { - StringBuffer result = new StringBuffer(); - Iterator it = col.iterator(); - while (it.hasNext()) { - if (result.length() != 0) result.append(", "); - result.append(it.next().toString()); - } - return result.toString(); - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/normalizer/package.html b/icu4j/src/com/ibm/test/normalizer/package.html deleted file mode 100755 index 75447607a0..0000000000 --- a/icu4j/src/com/ibm/test/normalizer/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Tests for Normalizer. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/package.html b/icu4j/src/com/ibm/test/package.html deleted file mode 100755 index f00ee5b75c..0000000000 --- a/icu4j/src/com/ibm/test/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Shared utilities for tests. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/rbbi/BreakIteratorRules_en_US_TEST.java b/icu4j/src/com/ibm/test/rbbi/BreakIteratorRules_en_US_TEST.java deleted file mode 100755 index 27f64868fd..0000000000 --- a/icu4j/src/com/ibm/test/rbbi/BreakIteratorRules_en_US_TEST.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/rbbi/Attic/BreakIteratorRules_en_US_TEST.java,v $ - * $Date: 2001/02/06 22:37:58 $ - * $Revision: 1.7 $ - * - ***************************************************************************************** - */ -package com.ibm.test.rbbi; - -import java.util.ListResourceBundle; -import java.net.URL; - -/** - * This resource bundle is included for testing and demonstration purposes only. - * It applies the dictionary-based algorithm to English text that has had all the - * spaces removed. Once we have good test cases for Thai, we will replace this - * with good resource data (and a good dictionary file) for Thai - */ -public class BreakIteratorRules_en_US_TEST extends ListResourceBundle { - private static final URL url = - BreakIteratorRules_en_US_TEST.class.getResource("/com/ibm/data/misc/english.dict"); - - public Object[][] getContents() { - return contents; - } - - static final Object[][] contents = { - // names of classes to instantiate for the different kinds of break - // iterator. Notice we're now using DictionaryBasedBreakIterator - // for word and line breaking. - { "BreakIteratorClasses", - new String[] { "RuleBasedBreakIterator", // character-break iterator class - "DictionaryBasedBreakIterator", // word-break iterator class - "DictionaryBasedBreakIterator", // line-break iterator class - "RuleBasedBreakIterator" } // sentence-break iterator class - }, - - // These are the same word-breaking rules as are specified in the default - // resource, except that the Latin letters, apostrophe, and hyphen are - // specified as dictionary characters - { "WordBreakRules", - // ignore non-spacing marks, enclosing marks, and format characters, - // all of which should not influence the algorithm - "$_ignore_=[[:Mn:][:Me:][:Cf:]];" - - // lower and upper case Roman letters, apostrophy and dash are - // in the English dictionary - + "$_dictionary_=[a-zA-Z\\'\\-];" - - // Hindi phrase separator, kanji, katakana, hiragana, CJK diacriticals, - // other letters, and digits - + "$danda=[\u0964\u0965];" - + "$kanji=[\u3005\u4e00-\u9fa5\uf900-\ufa2d];" - + "$kata=[\u3099-\u309c\u30a1-\u30fe];" - + "$hira=[\u3041-\u309e\u30fc];" - + "$let=[[[:L:][:Mc:]]-[$kanji$kata$hira]];" - + "$dgt=[:N:];" - - // punctuation that can occur in the middle of a word: currently - // dashes, apostrophes, and quotation marks - + "$mid_word=[[:Pd:]\u00ad\u2027\\\"\\\'];" - - // punctuation that can occur in the middle of a number: currently - // apostrophes, qoutation marks, periods, commas, and the Arabic - // decimal point - + "$mid_num=[\\\"\\\'\\,\u066b\\.];" - - // punctuation that can occur at the beginning of a number: currently - // the period, the number sign, and all currency symbols except the cents sign - + "$pre_num=[[[:Sc:]-[\u00a2]]\\#\\.];" - - // punctuation that can occur at the end of a number: currently - // the percent, per-thousand, per-ten-thousand, and Arabic percent - // signs, the cents sign, and the ampersand - + "$post_num=[\\%\\&\u00a2\u066a\u2030\u2031];" - - // line separators: currently LF, FF, PS, and LS - + "$ls=[\n\u000c\u2028\u2029];" - - // whitespace: all space separators and the tab character - + "$ws=[[:Zs:]\t];" - - // a word is a sequence of letters that may contain internal - // punctuation, as long as it begins and ends with a letter and - // never contains two punctuation marks in a row - + "$word=($let+($mid_word$let+)*$danda?);" - - // a number is a sequence of digits that may contain internal - // punctuation, as long as it begins and ends with a digit and - // never contains two punctuation marks in a row. - + "$number=($dgt+($mid_num$dgt+)*);" - - // break after every character, with the following exceptions - // (this will cause punctuation marks that aren't considered - // part of words or numbers to be treated as words unto themselves) - + ".;" - - // keep together any sequence of contiguous words and numbers - // (including just one of either), plus an optional trailing - // number-suffix character - + "$word?($number$word)*($number$post_num?)?;" - - // keep together and sequence of contiguous words and numbers - // that starts with a number-prefix character and a number, - // and may end with a number-suffix character - + "$pre_num($number$word)*($number$post_num?)?;" - - // keep together runs of whitespace (optionally with a single trailing - // line separator or CRLF sequence) - + "$ws*\r?$ls?;" - - // keep together runs of Katakana - + "$kata*;" - - // keep together runs of Hiragana - + "$hira*;" - - // keep together runs of Kanji - + "$kanji*;"}, - - // These are the same line-breaking rules as are specified in the default - // resource, except that the Latin letters, apostrophe, and hyphen are - // specified as dictionary characters - { "LineBreakRules", - // ignore non-spacing marks, enclosing marks, and format characters - "$_ignore_=[[:Mn:][:Me:][:Cf:]];" - - // lower and upper case Roman letters, apostrophy and dash - // are in the English dictionary - + "$_dictionary_=[a-zA-Z\\'\\-];" - - // Hindi phrase separators - + "$danda=[\u0964\u0965];" - - // characters that always cause a break: ETX, tab, LF, FF, LS, and PS - + "$break=[\u0003\t\n\f\u2028\u2029];" - - // characters that always prevent a break: the non-breaking space - // and similar characters - + "$nbsp=[\u00a0\u2007\u2011\ufeff];" - - // whitespace: space separators and control characters, except for - // CR and the other characters mentioned above - + "$space=[[[:Zs:][:Cc:]]-[$nbsp$break\r]];" - - // dashes: dash punctuation and the discretionary hyphen, except for - // non-breaking hyphens - + "$dash=[[[:Pd:]\u00ad]-[$nbsp]];" - - // characters that stick to a word if they precede it: currency symbols - // (except the cents sign) and starting punctuation - + "$pre_word=[[[:Sc:]-[\u00a2]][:Ps:]\\\"\\\'];" - - // characters that stick to a word if they follow it: ending punctuation, - // other punctuation that usually occurs at the end of a sentence, - // small Kana characters, some CJK diacritics, etc. - + "$post_word=[[:Pe:]\\!\\\"\\\'\\%\\.\\,\\:\\;\\?\u00a2\u00b0\u066a\u2030-\u2034" - + "\u2103\u2105\u2109\u3001\u3002\u3005\u3041\u3043\u3045\u3047\u3049\u3063" - + "\u3083\u3085\u3087\u308e\u3099-\u309e\u30a1\u30a3\u30a5\u30a7\u30a9" - + "\u30c3\u30e3\u30e5\u30e7\u30ee\u30f5\u30f6\u30fc-\u30fe\uff01\uff0c" - + "\uff0e\uff1f];" - - // Kanji: actually includes both Kanji and Kana, except for small Kana and - // CJK diacritics - + "$kanji=[[\u4e00-\u9fa5\uf900-\ufa2d\u3041-\u3094\u30a1-\u30fa]-[$post_word$_ignore_]];" - - // digits - + "$digit=[[:Nd:][:No:]];" - - // punctuation that can occur in the middle of a number: periods and commas - + "$mid_num=[\\.\\,];" - - // everything not mentioned above, plus the quote marks (which are both - // , , and ) - + "$char=[^$break$space$dash$kanji$nbsp$_ignore_$pre_word$post_word$mid_num$danda\r\\\"\\\'];" - - // a "number" is a run of prefix characters and dashes, followed by one or - // more digits with isolated number-punctuation characters interspersed - + "$number=([$pre_word$dash]*$digit+($mid_num$digit+)*);" - - // the basic core of a word can be either a "number" as defined above, a single - // "Kanji" character, or a run of any number of not-explicitly-mentioned - // characters (this includes Latin letters) - + "$word_core=([$pre_word$char]*|$kanji|$number);" - - // a word may end with an optional suffix that be either a run of one or - // more dashes or a run of word-suffix characters, followed by an optional - // run of whitespace - + "$word_suffix=(($dash+|$post_word*)$space*);" - - // a word, thus, is an optional run of word-prefix characters, followed by - // a word core and a word suffix (the syntax of and - // actually allows either of them to match the empty string, putting a break - // between things like ")(" or "aaa(aaa" - + "$word=($pre_word*$word_core$word_suffix);" - - // finally, the rule that does the work: Keep together any run of words that - // are joined by runs of one of more non-spacing mark. Also keep a trailing - // line-break character or CRLF combination with the word. (line separators - // "win" over nbsp's) - + "$word($nbsp+$word)*\r?$break?;" }, - - // these two resources specify the pathnames of the dictionary files to - // use for word breaking and line breaking. Both currently refer to - // a file called english.dict placed in com\ibm\text\resources - // somewhere in the class path. It's important to note that - // english.dict was created for testing purposes only, and doesn't - // come anywhere close to being an exhaustive dictionary of English - // words (basically, it contains all the words in the Declaration of - // Independence, and the Revised Standard Version of the book of Genesis, - // plus a few other words thrown in to show more interesting cases). - // { "WordBreakDictionary", "com\\ibm\\text\\resources\\english.dict" }, - // { "LineBreakDictionary", "com\\ibm\\text\\resources\\english.dict" } - { "WordBreakDictionary", url }, - { "LineBreakDictionary", url } - }; -} diff --git a/icu4j/src/com/ibm/test/rbbi/BreakIteratorTest.java b/icu4j/src/com/ibm/test/rbbi/BreakIteratorTest.java deleted file mode 100755 index fe90dfe0ec..0000000000 --- a/icu4j/src/com/ibm/test/rbbi/BreakIteratorTest.java +++ /dev/null @@ -1,1404 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/rbbi/Attic/BreakIteratorTest.java,v $ - * $Date: 2001/11/06 11:20:06 $ - * $Revision: 1.7 $ - * - ***************************************************************************************** - */ -package com.ibm.test.rbbi; - -import com.ibm.test.*; -import com.ibm.text.BreakIterator; -import java.text.CharacterIterator; -import com.ibm.text.StringCharacterIterator; -import java.util.Locale; -import java.util.Vector; -import java.util.Enumeration; -import java.io.*; - -public class BreakIteratorTest extends TestFmwk -{ - private BreakIterator characterBreak; - private BreakIterator wordBreak; - private BreakIterator lineBreak; - private BreakIterator sentenceBreak; - - public static void main(String[] args) throws Exception { - new BreakIteratorTest().run(args); - } - - public BreakIteratorTest() - { - characterBreak = BreakIterator.getCharacterInstance(); - wordBreak = BreakIterator.getWordInstance(); - lineBreak = BreakIterator.getLineInstance(); - //logln("Creating sentence iterator..."); - sentenceBreak = BreakIterator.getSentenceInstance(); - //logln("Finished creating sentence iterator..."); - } - - //========================================================================= - // general test subroutines - //========================================================================= - - private void generalIteratorTest(BreakIterator bi, Vector expectedResult) { - StringBuffer buffer = new StringBuffer(); - String text; - for (int i = 0; i < expectedResult.size(); i++) { - text = (String)expectedResult.elementAt(i); - buffer.append(text); - } - text = buffer.toString(); - - bi.setText(text); - - Vector nextResults = _testFirstAndNext(bi, text); - Vector previousResults = _testLastAndPrevious(bi, text); - - logln("comparing forward and backward..."); - int errs = getErrorCount(); - compareFragmentLists("forward iteration", "backward iteration", nextResults, - previousResults); - if (getErrorCount() == errs) { - logln("comparing expected and actual..."); - compareFragmentLists("expected result", "actual result", expectedResult, - nextResults); - } - - int[] boundaries = new int[expectedResult.size() + 3]; - boundaries[0] = BreakIterator.DONE; - boundaries[1] = 0; - for (int i = 0; i < expectedResult.size(); i++) - boundaries[i + 2] = boundaries[i + 1] + ((String)expectedResult.elementAt(i)). - length(); - boundaries[boundaries.length - 1] = BreakIterator.DONE; - - _testFollowing(bi, text, boundaries); - _testPreceding(bi, text, boundaries); - _testIsBoundary(bi, text, boundaries); - - doMultipleSelectionTest(bi, text); - } - - private Vector _testFirstAndNext(BreakIterator bi, String text) { - int p = bi.first(); - int lastP = p; - Vector result = new Vector(); - - if (p != 0) - errln("first() returned " + p + " instead of 0"); - while (p != BreakIterator.DONE) { - p = bi.next(); - if (p != BreakIterator.DONE) { - if (p <= lastP) - errln("next() failed to move forward: next() on position " - + lastP + " yielded " + p); - - result.addElement(text.substring(lastP, p)); - } - else { - if (lastP != text.length()) - errln("next() returned DONE prematurely: offset was " - + lastP + " instead of " + text.length()); - } - lastP = p; - } - return result; - } - - private Vector _testLastAndPrevious(BreakIterator bi, String text) { - int p = bi.last(); - int lastP = p; - Vector result = new Vector(); - - if (p != text.length()) - errln("last() returned " + p + " instead of " + text.length()); - while (p != BreakIterator.DONE) { - p = bi.previous(); - if (p != BreakIterator.DONE) { - if (p >= lastP) - errln("previous() failed to move backward: previous() on position " - + lastP + " yielded " + p); - - result.insertElementAt(text.substring(p, lastP), 0); - } - else { - if (lastP != 0) - errln("previous() returned DONE prematurely: offset was " - + lastP + " instead of 0"); - } - lastP = p; - } - return result; - } - - private void compareFragmentLists(String f1Name, String f2Name, Vector f1, Vector f2) { - int p1 = 0; - int p2 = 0; - String s1; - String s2; - int t1 = 0; - int t2 = 0; - - while (p1 < f1.size() && p2 < f2.size()) { - s1 = (String)f1.elementAt(p1); - s2 = (String)f2.elementAt(p2); - t1 += s1.length(); - t2 += s2.length(); - - if (s1.equals(s2)) { - debugLogln(" >" + s1 + "<"); - ++p1; - ++p2; - } - else { - int tempT1 = t1; - int tempT2 = t2; - int tempP1 = p1; - int tempP2 = p2; - - while (tempT1 != tempT2 && tempP1 < f1.size() && tempP2 < f2.size()) { - while (tempT1 < tempT2 && tempP1 < f1.size()) { - tempT1 += ((String)f1.elementAt(tempP1)).length(); - ++tempP1; - } - while (tempT2 < tempT1 && tempP2 < f2.size()) { - tempT2 += ((String)f2.elementAt(tempP2)).length(); - ++tempP2; - } - } - logln("*** " + f1Name + " has:"); - while (p1 <= tempP1 && p1 < f1.size()) { - s1 = (String)f1.elementAt(p1); - t1 += s1.length(); - debugLogln(" *** >" + s1 + "<"); - ++p1; - } - logln("***** " + f2Name + " has:"); - while (p2 <= tempP2 && p2 < f2.size()) { - s2 = (String)f2.elementAt(p2); - t2 += s2.length(); - debugLogln(" ***** >" + s2 + "<"); - ++p2; - } - errln("Discrepancy between " + f1Name + " and " + f2Name); - } - } - } - - private void _testFollowing(BreakIterator bi, String text, int[] boundaries) { - logln("testFollowing():"); - int p = 2; - for (int i = 0; i <= text.length(); i++) { - if (i == boundaries[p]) - ++p; - - int b = bi.following(i); - logln("bi.following(" + i + ") -> " + b); - if (b != boundaries[p]) - errln("Wrong result from following() for " + i + ": expected " + boundaries[p] - + ", got " + b); - } - } - - private void _testPreceding(BreakIterator bi, String text, int[] boundaries) { - logln("testPreceding():"); - int p = 0; - for (int i = 0; i <= text.length(); i++) { - int b = bi.preceding(i); - logln("bi.preceding(" + i + ") -> " + b); - if (b != boundaries[p]) - errln("Wrong result from preceding() for " + i + ": expected " + boundaries[p] - + ", got " + b); - - if (i == boundaries[p + 1]) - ++p; - } - } - - private void _testIsBoundary(BreakIterator bi, String text, int[] boundaries) { - logln("testIsBoundary():"); - int p = 1; - boolean isB; - for (int i = 0; i <= text.length(); i++) { - isB = bi.isBoundary(i); - logln("bi.isBoundary(" + i + ") -> " + isB); - - if (i == boundaries[p]) { - if (!isB) - errln("Wrong result from isBoundary() for " + i + ": expected true, got false"); - ++p; - } - else { - if (isB) - errln("Wrong result from isBoundary() for " + i + ": expected false, got true"); - } - } - } - - private void doMultipleSelectionTest(BreakIterator iterator, String testText) - { - logln("Multiple selection test..."); - BreakIterator testIterator = (BreakIterator)iterator.clone(); - int offset = iterator.first(); - int testOffset; - int count = 0; - - do { - testOffset = testIterator.first(); - testOffset = testIterator.next(count); - logln("next(" + count + ") -> " + testOffset); - if (offset != testOffset) - errln("next(n) and next() not returning consistent results: for step " + count + ", next(n) returned " + testOffset + " and next() had " + offset); - - if (offset != BreakIterator.DONE) { - count++; - offset = iterator.next(); - } - } while (offset != BreakIterator.DONE); - - // now do it backwards... - offset = iterator.last(); - count = 0; - - do { - testOffset = testIterator.last(); - testOffset = testIterator.next(count); - logln("next(" + count + ") -> " + testOffset); - if (offset != testOffset) - errln("next(n) and next() not returning consistent results: for step " + count + ", next(n) returned " + testOffset + " and next() had " + offset); - - if (offset != BreakIterator.DONE) { - count--; - offset = iterator.previous(); - } - } while (offset != BreakIterator.DONE); - } - - private void doBreakInvariantTest(BreakIterator tb, String testChars) - { - StringBuffer work = new StringBuffer("aaa"); -// int errorCount = 0; - - // a break should always occur after CR (unless followed by LF), LF, PS, and LS, - // unless they're followed by a non-spacing mark or a format character - String breaks = "\r\n\u2029\u2028"; - - for (int i = 0; i < breaks.length(); i++) { - work.setCharAt(1, breaks.charAt(i)); - for (int j = 0; j < testChars.length(); j++) { - work.setCharAt(0, testChars.charAt(j)); - for (int k = 0; k < testChars.length(); k++) { - char c = testChars.charAt(k); - - // if a cr is followed by lf, ps, ls or etx, don't do the check (that's - // not supposed to work) - if (work.charAt(1) == '\r' && (c == '\n' || c == '\u2029' - || c == '\u2028' || c == '\u0003')) - continue; - - work.setCharAt(2, c); - tb.setText(work.toString()); - boolean seen2 = false; - for (int l = tb.first(); l != BreakIterator.DONE; l = tb.next()) { - if (l == 2) - seen2 = true; - } - if (!seen2) { - errln("No break between U+" + Integer.toHexString((int)(work.charAt(1))) - + " and U+" + Integer.toHexString((int)(work.charAt(2)))); - } - } - } - } - } - - private void doOtherInvariantTest(BreakIterator tb, String testChars) - { - StringBuffer work = new StringBuffer("a\r\na"); - int errorCount = 0; - - // a break should never occur between CR and LF - for (int i = 0; i < testChars.length(); i++) { - work.setCharAt(0, testChars.charAt(i)); - for (int j = 0; j < testChars.length(); j++) { - work.setCharAt(3, testChars.charAt(j)); - tb.setText(work.toString()); - for (int k = tb.first(); k != BreakIterator.DONE; k = tb.next()) - if (k == 2) { - errln("Break between CR and LF in string U+" + Integer.toHexString( - (int)(work.charAt(0))) + ", U+d U+a U+" + Integer.toHexString( - (int)(work.charAt(3)))); - errorCount++; - if (errorCount >= 75) - return; - } - } - } - - // a break should never occur before a non-spacing mark, unless it's preceded - // by a line terminator - work.setLength(0); - work.append("aaaa"); - for (int i = 0; i < testChars.length(); i++) { - char c = testChars.charAt(i); - if (c == '\n' || c == '\r' || c == '\u2029' || c == '\u2028' || c == '\u0003') - continue; - work.setCharAt(1, c); - for (int j = 0; j < testChars.length(); j++) { - c = testChars.charAt(j); - if (Character.getType(c) != Character.NON_SPACING_MARK && Character.getType(c) - != Character.ENCLOSING_MARK) - continue; - work.setCharAt(2, c); - tb.setText(work.toString()); - for (int k = tb.first(); k != BreakIterator.DONE; k = tb.next()) - if (k == 2) { - errln("Break between U+" + Integer.toHexString((int)(work.charAt(1))) - + " and U+" + Integer.toHexString((int)(work.charAt(2)))); - errorCount++; - if (errorCount >= 75) - return; - } - } - } - } - - public void debugLogln(String s) { - final String zeros = "0000"; - String temp; - StringBuffer out = new StringBuffer(); - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - if (c >= ' ' && c < '\u007f') - out.append(c); - else { - out.append("\\u"); - temp = Integer.toHexString((int)c); - out.append(zeros.substring(0, 4 - temp.length())); - out.append(temp); - } - } - logln(out.toString()); - } - - //========================================================================= - // tests - //========================================================================= - - public void TestWordBreak() { - Vector wordSelectionData = new Vector(); - - wordSelectionData.addElement("12,34"); - - wordSelectionData.addElement(" "); - wordSelectionData.addElement("\u00A2"); //cent sign - wordSelectionData.addElement("\u00A3"); //pound sign - wordSelectionData.addElement("\u00A4"); //currency sign - wordSelectionData.addElement("\u00A5"); //yen sign - wordSelectionData.addElement("alpha-beta-gamma"); - wordSelectionData.addElement("."); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("Badges"); - wordSelectionData.addElement("?"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("BADGES"); - wordSelectionData.addElement("!"); - wordSelectionData.addElement("?"); - wordSelectionData.addElement("!"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("We"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("don't"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("need"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("no"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("STINKING"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("BADGES"); - wordSelectionData.addElement("!"); - wordSelectionData.addElement("!"); - wordSelectionData.addElement("!"); - - wordSelectionData.addElement("012.566,5"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("123.3434,900"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("1000,233,456.000"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("1,23.322%"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("123.1222"); - - wordSelectionData.addElement(" "); - wordSelectionData.addElement("\u0024123,000.20"); - - wordSelectionData.addElement(" "); - wordSelectionData.addElement("179.01\u0025"); - - wordSelectionData.addElement("Hello"); - wordSelectionData.addElement(","); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("how"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("are"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("you"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("X"); - wordSelectionData.addElement(" "); - - wordSelectionData.addElement("Now"); - wordSelectionData.addElement("\r"); - wordSelectionData.addElement("is"); - wordSelectionData.addElement("\n"); - wordSelectionData.addElement("the"); - wordSelectionData.addElement("\r\n"); - wordSelectionData.addElement("time"); - wordSelectionData.addElement("\n"); - wordSelectionData.addElement("\r"); - wordSelectionData.addElement("for"); - wordSelectionData.addElement("\r"); - wordSelectionData.addElement("\r"); - wordSelectionData.addElement("all"); - wordSelectionData.addElement(" "); - - generalIteratorTest(wordBreak, wordSelectionData); - } - - /** - * @bug 4097779 - */ - public void TestBug4097779() { - Vector wordSelectionData = new Vector(); - - wordSelectionData.addElement("aa\u0300a"); - wordSelectionData.addElement(" "); - - generalIteratorTest(wordBreak, wordSelectionData); - } - - /** - * @bug 4098467 - */ - public void TestBug4098467Words() { - Vector wordSelectionData = new Vector(); - - // What follows is a string of Korean characters (I found it in the Yellow Pages - // ad for the Korean Presbyterian Church of San Francisco, and I hope I transcribed - // it correctly), first as precomposed syllables, and then as conjoining jamo. - // Both sequences should be semantically identical and break the same way. - // precomposed syllables... - wordSelectionData.addElement("\uc0c1\ud56d"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("\ud55c\uc778"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("\uc5f0\ud569"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("\uc7a5\ub85c\uad50\ud68c"); - wordSelectionData.addElement(" "); - // conjoining jamo... - wordSelectionData.addElement("\u1109\u1161\u11bc\u1112\u1161\u11bc"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("\u1112\u1161\u11ab\u110b\u1175\u11ab"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("\u110b\u1167\u11ab\u1112\u1161\u11b8"); - wordSelectionData.addElement(" "); - wordSelectionData.addElement("\u110c\u1161\u11bc\u1105\u1169\u1100\u116d\u1112\u116c"); - wordSelectionData.addElement(" "); - - generalIteratorTest(wordBreak, wordSelectionData); - } - - /** - * @bug 4117554 - */ - public void TestBug4117554Words() { - Vector wordSelectionData = new Vector(); - - // this is a test for bug #4117554: the ideographic iteration mark (U+3005) should - // count as a Kanji character for the purposes of word breaking - wordSelectionData.addElement("abc"); - wordSelectionData.addElement("\u4e01\u4e02\u3005\u4e03\u4e03"); - wordSelectionData.addElement("abc"); - - generalIteratorTest(wordBreak, wordSelectionData); - } - - public void TestSentenceBreak() { - Vector sentenceSelectionData = new Vector(); - - sentenceSelectionData.addElement("This is a simple sample sentence. "); - sentenceSelectionData.addElement("(This is it.) "); - sentenceSelectionData.addElement("This is a simple sample sentence. "); - sentenceSelectionData.addElement("\"This isn\'t it.\" "); - sentenceSelectionData.addElement("Hi! "); - sentenceSelectionData.addElement("This is a simple sample sentence. "); - sentenceSelectionData.addElement("It does not have to make any sense as you can see. "); - sentenceSelectionData.addElement("Nel mezzo del cammin di nostra vita, mi ritrovai in una selva oscura. "); - sentenceSelectionData.addElement("Che la dritta via aveo smarrita. "); - sentenceSelectionData.addElement("He said, that I said, that you said!! "); - - sentenceSelectionData.addElement("Don't rock the boat.\u2029"); - - sentenceSelectionData.addElement("Because I am the daddy, that is why. "); - sentenceSelectionData.addElement("Not on my time (el timo.)! "); - - sentenceSelectionData.addElement("So what!!\u2029"); - - sentenceSelectionData.addElement("\"But now,\" he said, \"I know!\" "); - sentenceSelectionData.addElement("Harris thumbed down several, including \"Away We Go\" (which became the huge success Oklahoma!). "); - sentenceSelectionData.addElement("One species, B. anthracis, is highly virulent.\n"); - sentenceSelectionData.addElement("Wolf said about Sounder:\"Beautifully thought-out and directed.\" "); - sentenceSelectionData.addElement("Have you ever said, \"This is where \tI shall live\"? "); - sentenceSelectionData.addElement("He answered, \"You may not!\" "); - sentenceSelectionData.addElement("Another popular saying is: \"How do you do?\". "); - sentenceSelectionData.addElement("Yet another popular saying is: \'I\'m fine thanks.\' "); - sentenceSelectionData.addElement("What is the proper use of the abbreviation pp.? "); - sentenceSelectionData.addElement("Yes, I am definatelly 12\" tall!!"); - - generalIteratorTest(sentenceBreak, sentenceSelectionData); - } - - /** - * @bug 4113835 - */ - public void TestBug4113835() { - Vector sentenceSelectionData = new Vector(); - - // test for bug #4113835: \n and \r count as spaces, not as paragraph breaks - sentenceSelectionData.addElement("Now\ris\nthe\r\ntime\n\rfor\r\rall\u2029"); - - generalIteratorTest(sentenceBreak, sentenceSelectionData); - } - - /** - * @bug 4111338 - */ - public void TestBug4111338() { - Vector sentenceSelectionData = new Vector(); - - // test for bug #4111338: Don't break sentences at the boundary between CJK - // and other letters - sentenceSelectionData.addElement("\u5487\u67ff\ue591\u5017\u61b3\u60a1\u9510\u8165:\"JAVA\u821c" - + "\u8165\u7fc8\u51ce\u306d,\u2494\u56d8\u4ec0\u60b1\u8560\u51ba" - + "\u611d\u57b6\u2510\u5d46\".\u2029"); - sentenceSelectionData.addElement("\u5487\u67ff\ue591\u5017\u61b3\u60a1\u9510\u8165\u9de8" - + "\u97e4JAVA\u821c\u8165\u7fc8\u51ce\u306d\ue30b\u2494\u56d8\u4ec0" - + "\u60b1\u8560\u51ba\u611d\u57b6\u2510\u5d46\u97e5\u7751\u2029"); - sentenceSelectionData.addElement("\u5487\u67ff\ue591\u5017\u61b3\u60a1\u9510\u8165\u9de8\u97e4" - + "\u6470\u8790JAVA\u821c\u8165\u7fc8\u51ce\u306d\ue30b\u2494\u56d8" - + "\u4ec0\u60b1\u8560\u51ba\u611d\u57b6\u2510\u5d46\u97e5\u7751\u2029"); - sentenceSelectionData.addElement("He said, \"I can go there.\"\u2029"); - - generalIteratorTest(sentenceBreak, sentenceSelectionData); - } - - /** - * @bug 4117554 - */ - public void TestBug4117554Sentences() { - Vector sentenceSelectionData = new Vector(); - - // Treat fullwidth variants of .!? the same as their - // normal counterparts - sentenceSelectionData.addElement("I know I'm right\uff0e "); - sentenceSelectionData.addElement("Right\uff1f "); - sentenceSelectionData.addElement("Right\uff01 "); - - // Don't break sentences at boundary between CJK and digits - sentenceSelectionData.addElement("\u5487\u67ff\ue591\u5017\u61b3\u60a1\u9510\u8165\u9de8" - + "\u97e48888\u821c\u8165\u7fc8\u51ce\u306d\ue30b\u2494\u56d8\u4ec0" - + "\u60b1\u8560\u51ba\u611d\u57b6\u2510\u5d46\u97e5\u7751\u2029"); - - // Break sentence between a sentence terminator and - // opening punctuation - sentenceSelectionData.addElement("no?"); - sentenceSelectionData.addElement("(yes)"); - - generalIteratorTest(sentenceBreak, sentenceSelectionData); - } - - /** - * @bug 4158381 - */ - public void TestBug4158381() { - Vector sentenceSelectionData = new Vector(); - - // Don't break sentence after period if it isn't followed by a space - sentenceSelectionData.addElement("Test Flags.Flag class. "); - sentenceSelectionData.addElement("Another test.\u2029"); - - // No breaks when there are no terminators around - sentenceSelectionData.addElement("

Provides a set of " - + ""lightweight" (all-javaTM" - + " language) components that, " - + "to the maximum degree possible, work the same on all platforms. "); - sentenceSelectionData.addElement("Another test.\u2029"); - - generalIteratorTest(sentenceBreak, sentenceSelectionData); - } - - /** - * @bug 4143071 - */ - public void TestBug4143071() { - Vector sentenceSelectionData = new Vector(); - - // Make sure sentences that end with digits work right - sentenceSelectionData.addElement("Today is the 27th of May, 1998. "); - sentenceSelectionData.addElement("Tomorrow will be 28 May 1998. "); - sentenceSelectionData.addElement("The day after will be the 30th.\u2029"); - - generalIteratorTest(sentenceBreak, sentenceSelectionData); - } - - /** - * @bug 4152416 - */ - public void TestBug4152416() { - Vector sentenceSelectionData = new Vector(); - - // Make sure sentences ending with a capital letter are treated correctly - sentenceSelectionData.addElement("The type of all primitive " - + "boolean values accessed in the target VM. "); - sentenceSelectionData.addElement("Calls to xxx will return an " - + "implementor of this interface.\u2029"); - - generalIteratorTest(sentenceBreak, sentenceSelectionData); - } - - /** - * @bug 4152117 - */ - public void TestBug4152117() { - Vector sentenceSelectionData = new Vector(); - - // Make sure sentence breaking is handling punctuation correctly - // [COULD NOT REPRODUCE THIS BUG, BUT TEST IS HERE TO MAKE SURE - // IT DOESN'T CROP UP] - sentenceSelectionData.addElement("Constructs a randomly generated " - + "BigInteger, uniformly distributed over the range 0 " - + "to (2numBits - 1), inclusive. "); - sentenceSelectionData.addElement("The uniformity of the distribution " - + "assumes that a fair source of random bits is provided in " - + "rnd. "); - sentenceSelectionData.addElement("Note that this constructor always " - + "constructs a non-negative BigInteger.\u2029"); - - generalIteratorTest(sentenceBreak, sentenceSelectionData); - } - - public void TestLineBreak() { - Vector lineSelectionData = new Vector(); - - lineSelectionData.addElement("Multi-"); - lineSelectionData.addElement("Level "); - lineSelectionData.addElement("example "); - lineSelectionData.addElement("of "); - lineSelectionData.addElement("a "); - lineSelectionData.addElement("semi-"); - lineSelectionData.addElement("idiotic "); - lineSelectionData.addElement("non-"); - lineSelectionData.addElement("sensical "); - lineSelectionData.addElement("(non-"); - lineSelectionData.addElement("important) "); - lineSelectionData.addElement("sentence. "); - - lineSelectionData.addElement("Hi "); - lineSelectionData.addElement("Hello "); - lineSelectionData.addElement("How\n"); - lineSelectionData.addElement("are\r"); - lineSelectionData.addElement("you\u2028"); - lineSelectionData.addElement("fine.\t"); - lineSelectionData.addElement("good. "); - - lineSelectionData.addElement("Now\r"); - lineSelectionData.addElement("is\n"); - lineSelectionData.addElement("the\r\n"); - lineSelectionData.addElement("time\n"); - lineSelectionData.addElement("\r"); - lineSelectionData.addElement("for\r"); - lineSelectionData.addElement("\r"); - lineSelectionData.addElement("all"); - - generalIteratorTest(lineBreak, lineSelectionData); - } - - /** - * @bug 4068133 - */ - public void TestBug4068133() { - Vector lineSelectionData = new Vector(); - - lineSelectionData.addElement("\u96f6"); - lineSelectionData.addElement("\u4e00\u3002"); - lineSelectionData.addElement("\u4e8c\u3001"); - lineSelectionData.addElement("\u4e09\u3002\u3001"); - lineSelectionData.addElement("\u56db\u3001\u3002\u3001"); - lineSelectionData.addElement("\u4e94,"); - lineSelectionData.addElement("\u516d."); - lineSelectionData.addElement("\u4e03.\u3001,\u3002"); - lineSelectionData.addElement("\u516b"); - - generalIteratorTest(lineBreak, lineSelectionData); - } - - /** - * @bug 4086052 - */ - public void TestBug4086052() { - Vector lineSelectionData = new Vector(); - - lineSelectionData.addElement("foo\u00a0bar "); -// lineSelectionData.addElement("foo\ufeffbar"); - - generalIteratorTest(lineBreak, lineSelectionData); - } - - /** - * @bug 4097920 - */ - public void TestBug4097920() { - Vector lineSelectionData = new Vector(); - - lineSelectionData.addElement("dog,"); - lineSelectionData.addElement("cat,"); - lineSelectionData.addElement("mouse "); - lineSelectionData.addElement("(one)"); - lineSelectionData.addElement("(two)\n"); - - generalIteratorTest(lineBreak, lineSelectionData); - } - - /** - * @bug 4035266 - */ - public void TestBug4035266() { - Vector lineSelectionData = new Vector(); - - lineSelectionData.addElement("The "); - lineSelectionData.addElement("balance "); - lineSelectionData.addElement("is "); - lineSelectionData.addElement("$-23,456.78, "); - lineSelectionData.addElement("not "); - lineSelectionData.addElement("-$32,456.78!\n"); - - generalIteratorTest(lineBreak, lineSelectionData); - } - - /** - * @bug 4098467 - */ - public void TestBug4098467Lines() { - Vector lineSelectionData = new Vector(); - - // What follows is a string of Korean characters (I found it in the Yellow Pages - // ad for the Korean Presbyterian Church of San Francisco, and I hope I transcribed - // it correctly), first as precomposed syllables, and then as conjoining jamo. - // Both sequences should be semantically identical and break the same way. - // precomposed syllables... - lineSelectionData.addElement("\uc0c1\ud56d "); - lineSelectionData.addElement("\ud55c\uc778 "); - lineSelectionData.addElement("\uc5f0\ud569 "); - lineSelectionData.addElement("\uc7a5\ub85c\uad50\ud68c "); - // conjoining jamo... - lineSelectionData.addElement("\u1109\u1161\u11bc\u1112\u1161\u11bc "); - lineSelectionData.addElement("\u1112\u1161\u11ab\u110b\u1175\u11ab "); - lineSelectionData.addElement("\u110b\u1167\u11ab\u1112\u1161\u11b8 "); - lineSelectionData.addElement("\u110c\u1161\u11bc\u1105\u1169\u1100\u116d\u1112\u116c"); - - generalIteratorTest(lineBreak, lineSelectionData); - } - - public void TestThaiLineBreak() { - Vector lineSelectionData = new Vector(); - - // \u0e2f-- the Thai paiyannoi character-- isn't a letter. It's a symbol that - // represents elided letters at the end of a long word. It should be bound to - // the end of the word and not treated as an independent punctuation mark. - lineSelectionData.addElement("\u0e2a\u0e16\u0e32\u0e19\u0e35\u0e2f"); - lineSelectionData.addElement("\u0e08\u0e30"); - lineSelectionData.addElement("\u0e23\u0e30\u0e14\u0e21"); - lineSelectionData.addElement("\u0e40\u0e08\u0e49\u0e32"); -// lineSelectionData.addElement("\u0e2b\u0e19\u0e49\u0e32"); -// lineSelectionData.addElement("\u0e17\u0e35\u0e48"); -// I think the above two lines are the preferred reading of this text, but our current -// dictionary yields the following: -lineSelectionData.addElement("\u0e2b\u0e16\u0e49\u0e32\u0e17\u0e35\u0e48"); - lineSelectionData.addElement("\u0e2d\u0e2d\u0e01"); - lineSelectionData.addElement("\u0e21\u0e32"); - lineSelectionData.addElement("\u0e40\u0e23\u0e48\u0e07"); - lineSelectionData.addElement("\u0e23\u0e30\u0e1a\u0e32\u0e22"); - lineSelectionData.addElement("\u0e2d\u0e22\u0e48\u0e32\u0e07"); - lineSelectionData.addElement("\u0e40\u0e15\u0e47\u0e21"); - - // the one time where the paiyannoi occurs somewhere other than at the end - // of a word is in the Thai abbrevation for "etc.", which both begins and - // ends with a paiyannoi - lineSelectionData.addElement("\u0e2f\u0e25\u0e2f"); - lineSelectionData.addElement("\u0e17\u0e35\u0e48"); - lineSelectionData.addElement("\u0e19\u0e31\u0e49\u0e19"); - - generalIteratorTest(BreakIterator.getLineInstance(new Locale("th", "", "")), - lineSelectionData); - } - - public void TestMixedThaiLineBreak() { - Vector lineSelectionData = new Vector(); - - // Arabic numerals should always be separated from surrounding Thai text -/* - lineSelectionData.addElement("\u0e04\u0e48\u0e32"); - lineSelectionData.addElement("\u0e40\u0e07\u0e34\u0e19"); - lineSelectionData.addElement("\u0e1a\u0e32\u0e17"); - lineSelectionData.addElement("\u0e41\u0e15\u0e30"); - lineSelectionData.addElement("\u0e23\u0e30\u0e14\u0e31\u0e1a"); - lineSelectionData.addElement("39"); - lineSelectionData.addElement("\u0e1a\u0e32\u0e17 "); - - // words in non-Thai scripts should always be separated from surrounding Thai text - lineSelectionData.addElement("\u0e17\u0e14"); - lineSelectionData.addElement("\u0e2a\u0e2d\u0e1a"); - lineSelectionData.addElement("Java"); - lineSelectionData.addElement("\u0e1a\u0e19"); - lineSelectionData.addElement("\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07"); - lineSelectionData.addElement("\u0e44\u0e2d\u0e1a\u0e35\u0e40\u0e2d\u0e47\u0e21 "); - - // Thai numerals should always be separated from the text surrounding them - lineSelectionData.addElement("\u0e04\u0e48\u0e32"); - lineSelectionData.addElement("\u0e40\u0e07\u0e34\u0e19"); - lineSelectionData.addElement("\u0e1a\u0e32\u0e17"); - lineSelectionData.addElement("\u0e41\u0e15\u0e30"); - lineSelectionData.addElement("\u0e23\u0e30\u0e14\u0e31\u0e1a"); - lineSelectionData.addElement("\u0e53\u0e59"); - lineSelectionData.addElement("\u0e1a\u0e32\u0e17 "); - - // Thai text should interact correctly with punctuation and symbols - lineSelectionData.addElement("\u0e44\u0e2d\u0e1a\u0e35\u0e40\u0e2d\u0e47\u0e21"); -// lineSelectionData.addElement("(\u0e1b\u0e23\u0e30\u0e40\u0e17\u0e28"); -// lineSelectionData.addElement("\u0e44\u0e17\u0e22)"); -// I think the above lines represent the preferred reading for this text, but our current -// dictionary file yields the following: -lineSelectionData.addElement("(\u0e1b\u0e23\u0e30\u0e40\u0e17\u0e28\u0e44\u0e17\u0e22)"); - lineSelectionData.addElement("\u0e08\u0e33\u0e01\u0e31\u0e14"); - lineSelectionData.addElement("\u0e40\u0e1b\u0e34\u0e14"); - lineSelectionData.addElement("\u0e15\u0e31\u0e27\""); -*/ - lineSelectionData.addElement("\u0e2e\u0e32\u0e23\u0e4c\u0e14\u0e14\u0e34\u0e2a\u0e01\u0e4c\""); - lineSelectionData.addElement("\u0e23\u0e38\u0e48\u0e19"); - lineSelectionData.addElement("\u0e43\u0e2b\u0e21\u0e48"); - lineSelectionData.addElement("\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e21\u0e34."); - lineSelectionData.addElement("\u0e22."); - lineSelectionData.addElement("\u0e19\u0e35\u0e49"); - lineSelectionData.addElement("\u0e23\u0e32\u0e04\u0e32"); - lineSelectionData.addElement("$200"); - lineSelectionData.addElement("\u0e40\u0e17\u0e48\u0e32"); - lineSelectionData.addElement("\u0e19\u0e31\u0e49\u0e19 "); - lineSelectionData.addElement("(\"\u0e2e\u0e32\u0e23\u0e4c\u0e14\u0e14\u0e34\u0e2a\u0e01\u0e4c\")."); - - generalIteratorTest(BreakIterator.getLineInstance(new Locale("th", "", "")), - lineSelectionData); - } - - public void TestMaiyamok() { - Vector lineSelectionData = new Vector(); - - // the Thai maiyamok character is a shorthand symbol that means "repeat the previous - // word". Instead of appearing as a word unto itself, however, it's kept together - // with the word before it - lineSelectionData.addElement("\u0e44\u0e1b\u0e46"); - lineSelectionData.addElement("\u0e21\u0e32\u0e46"); - lineSelectionData.addElement("\u0e23\u0e30\u0e2b\u0e27\u0e48\u0e32\u0e07"); - lineSelectionData.addElement("\u0e01\u0e23\u0e38\u0e07\u0e40\u0e17\u0e1e"); - lineSelectionData.addElement("\u0e41\u0e25\u0e30"); - lineSelectionData.addElement("\u0e40\u0e03\u0e35\u0e22\u0e07"); - lineSelectionData.addElement("\u0e43\u0e2b\u0e21\u0e48"); - - generalIteratorTest(BreakIterator.getLineInstance(new Locale("th", "", "")), - lineSelectionData); - } - - /** - * @bug 4117554 - */ - public void TestBug4117554Lines() { - Vector lineSelectionData = new Vector(); - - // Fullwidth .!? should be treated as postJwrd - lineSelectionData.addElement("\u4e01\uff0e"); - lineSelectionData.addElement("\u4e02\uff01"); - lineSelectionData.addElement("\u4e03\uff1f"); - - generalIteratorTest(lineBreak, lineSelectionData); - } - - public void TestLettersAndDigits() { - // a character sequence such as "X11" or "30F3" or "native2ascii" should - // be kept together as a single word - Vector lineSelectionData = new Vector(); - - lineSelectionData.addElement("X11 "); - lineSelectionData.addElement("30F3 "); - lineSelectionData.addElement("native2ascii"); - - generalIteratorTest(lineBreak, lineSelectionData); - } - - /** - * @bug 4217703 - */ - public void TestBug4217703() { - Vector lineSelectionData = new Vector(); - - // There shouldn't be a line break between sentence-ending punctuation - // and a closing quote - lineSelectionData.addElement("He "); - lineSelectionData.addElement("said "); - lineSelectionData.addElement("\"Go!\" "); - lineSelectionData.addElement("I "); - lineSelectionData.addElement("went. "); - - lineSelectionData.addElement("Hashtable$Enumeration "); - lineSelectionData.addElement("getText()."); - lineSelectionData.addElement("getIndex()"); - - generalIteratorTest(lineBreak, lineSelectionData); - } - - private static final String graveS = "S\u0300"; - private static final String acuteBelowI = "i\u0317"; - private static final String acuteE = "e\u0301"; - private static final String circumflexA = "a\u0302"; - private static final String tildeE = "e\u0303"; - - public void TestCharacterBreak() { - Vector characterSelectionData = new Vector(); - - characterSelectionData.addElement(graveS); - characterSelectionData.addElement(acuteBelowI); - characterSelectionData.addElement("m"); - characterSelectionData.addElement("p"); - characterSelectionData.addElement("l"); - characterSelectionData.addElement(acuteE); - characterSelectionData.addElement(" "); - characterSelectionData.addElement("s"); - characterSelectionData.addElement(circumflexA); - characterSelectionData.addElement("m"); - characterSelectionData.addElement("p"); - characterSelectionData.addElement("l"); - characterSelectionData.addElement(tildeE); - characterSelectionData.addElement("."); - characterSelectionData.addElement("w"); - characterSelectionData.addElement(circumflexA); - characterSelectionData.addElement("w"); - characterSelectionData.addElement("a"); - characterSelectionData.addElement("f"); - characterSelectionData.addElement("q"); - characterSelectionData.addElement("\n"); - characterSelectionData.addElement("\r"); - characterSelectionData.addElement("\r\n"); - characterSelectionData.addElement("\n"); - - generalIteratorTest(characterBreak, characterSelectionData); - } - - /** - * @bug 4098467 - */ - public void TestBug4098467Characters() { - Vector characterSelectionData = new Vector(); - - // What follows is a string of Korean characters (I found it in the Yellow Pages - // ad for the Korean Presbyterian Church of San Francisco, and I hope I transcribed - // it correctly), first as precomposed syllables, and then as conjoining jamo. - // Both sequences should be semantically identical and break the same way. - // precomposed syllables... - characterSelectionData.addElement("\uc0c1"); - characterSelectionData.addElement("\ud56d"); - characterSelectionData.addElement(" "); - characterSelectionData.addElement("\ud55c"); - characterSelectionData.addElement("\uc778"); - characterSelectionData.addElement(" "); - characterSelectionData.addElement("\uc5f0"); - characterSelectionData.addElement("\ud569"); - characterSelectionData.addElement(" "); - characterSelectionData.addElement("\uc7a5"); - characterSelectionData.addElement("\ub85c"); - characterSelectionData.addElement("\uad50"); - characterSelectionData.addElement("\ud68c"); - characterSelectionData.addElement(" "); - // conjoining jamo... - characterSelectionData.addElement("\u1109\u1161\u11bc"); - characterSelectionData.addElement("\u1112\u1161\u11bc"); - characterSelectionData.addElement(" "); - characterSelectionData.addElement("\u1112\u1161\u11ab"); - characterSelectionData.addElement("\u110b\u1175\u11ab"); - characterSelectionData.addElement(" "); - characterSelectionData.addElement("\u110b\u1167\u11ab"); - characterSelectionData.addElement("\u1112\u1161\u11b8"); - characterSelectionData.addElement(" "); - characterSelectionData.addElement("\u110c\u1161\u11bc"); - characterSelectionData.addElement("\u1105\u1169"); - characterSelectionData.addElement("\u1100\u116d"); - characterSelectionData.addElement("\u1112\u116c"); - - generalIteratorTest(characterBreak, characterSelectionData); - } - - /* - * @bug 4153072 - */ - public void TestBug4153072() { - BreakIterator iter = BreakIterator.getWordInstance(); - String str = "...Hello, World!..."; - int begin = 3; - int end = str.length() - 3; - // not used boolean gotException = false; - boolean dummy; - - iter.setText(new StringCharacterIterator(str, begin, end, begin)); - for (int index = -1; index < begin + 1; ++index) { - try { - dummy = iter.isBoundary(index); - if (index < begin) - errln("Didn't get exception with offset = " + index + - " and begin index = " + begin); - } - catch (IllegalArgumentException e) { - if (index >= begin) - errln("Got exception with offset = " + index + - " and begin index = " + begin); - } - } - } - - public void TestBug4146175Sentences() { - Vector sentenceSelectionData = new Vector(); - - // break between periods and opening punctuation even when there's no - // intervening space - sentenceSelectionData.addElement("end."); - sentenceSelectionData.addElement("(This is\u2029"); - - // treat the fullwidth period as an unambiguous sentence terminator - sentenceSelectionData.addElement("\u7d42\u308f\u308a\uff0e"); - sentenceSelectionData.addElement("\u300c\u3053\u308c\u306f"); - - generalIteratorTest(sentenceBreak, sentenceSelectionData); - } - - public void TestBug4146175Lines() { - Vector lineSelectionData = new Vector(); - - // the fullwidth comma should stick to the preceding Japanese character - lineSelectionData.addElement("\u7d42\uff0c"); - lineSelectionData.addElement("\u308f"); - - generalIteratorTest(lineBreak, lineSelectionData); - } - - public void TestBug4214367() { - Vector wordSelectionData = new Vector(); - - // the hiragana and katakana iteration marks and the long vowel mark - // are not being treated correctly by the word-break iterator - wordSelectionData.addElement("\u3042\u3044\u309d\u3042\u309e\u3042\u30fc\u3042"); - wordSelectionData.addElement("\u30a2\u30a4\u30fd\u30a2\u30fe\u30a2\u30fc\u30a2"); - - generalIteratorTest(wordBreak, wordSelectionData); - } - - private static final String cannedTestChars - = "\u0000\u0001\u0002\u0003\u0004 !\"#$%&()+-01234<=>ABCDE[]^_`abcde{}|\u00a0\u00a2" - + "\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00ab\u00ad\u00ae\u00af\u00b0\u00b2\u00b3" - + "\u00b4\u00b9\u00bb\u00bc\u00bd\u02b0\u02b1\u02b2\u02b3\u02b4\u0300\u0301\u0302\u0303" - + "\u0304\u05d0\u05d1\u05d2\u05d3\u05d4\u0903\u093e\u093f\u0940\u0949\u0f3a\u0f3b\u2000" - + "\u2001\u2002\u200c\u200d\u200e\u200f\u2010\u2011\u2012\u2028\u2029\u202a\u203e\u203f" - + "\u2040\u20dd\u20de\u20df\u20e0\u2160\u2161\u2162\u2163\u2164"; - - public void TestSentenceInvariants() - { - BreakIterator e = BreakIterator.getSentenceInstance(); - doOtherInvariantTest(e, cannedTestChars + ".,\u3001\u3002\u3041\u3042\u3043\ufeff"); - } - - public void TestWordInvariants() - { - BreakIterator e = BreakIterator.getWordInstance(); - doBreakInvariantTest(e, cannedTestChars + "\',.\u3041\u3042\u3043\u309b\u309c\u30a1\u30a2" - + "\u30a3\u4e00\u4e01\u4e02"); - doOtherInvariantTest(e, cannedTestChars + "\',.\u3041\u3042\u3043\u309b\u309c\u30a1\u30a2" - + "\u30a3\u4e00\u4e01\u4e02"); - } - - public void TestLineInvariants() - { - BreakIterator e = BreakIterator.getLineInstance(); - String testChars = cannedTestChars + ".,;:\u3001\u3002\u3041\u3042\u3043\u3044\u3045" - + "\u30a3\u4e00\u4e01\u4e02"; - doBreakInvariantTest(e, testChars); - doOtherInvariantTest(e, testChars); - - int errorCount = 0; - - // in addition to the other invariants, a line-break iterator should make sure that: - // it doesn't break around the non-breaking characters - String noBreak = "\u00a0\u2007\u2011\ufeff"; - StringBuffer work = new StringBuffer("aaa"); - for (int i = 0; i < testChars.length(); i++) { - char c = testChars.charAt(i); - if (c == '\r' || c == '\n' || c == '\u2029' || c == '\u2028' || c == '\u0003') - continue; - work.setCharAt(0, c); - for (int j = 0; j < noBreak.length(); j++) { - work.setCharAt(1, noBreak.charAt(j)); - for (int k = 0; k < testChars.length(); k++) { - work.setCharAt(2, testChars.charAt(k)); - e.setText(work.toString()); - for (int l = e.first(); l != BreakIterator.DONE; l = e.next()) - if (l == 1 || l == 2) { - errln("Got break between U+" + Integer.toHexString((int) - (work.charAt(l - 1))) + " and U+" + Integer.toHexString( - (int)(work.charAt(l)))); - errorCount++; - if (errorCount >= 75) - return; - } - } - } - } - - // it does break after dashes (unless they're followed by a digit, a non-spacing mark, - // a currency symbol, a space, a format-control character, a regular control character, - // a line or paragraph separator, or another dash) - String dashes = "-\u00ad\u2010\u2012\u2013\u2014"; - for (int i = 0; i < testChars.length(); i++) { - work.setCharAt(0, testChars.charAt(i)); - for (int j = 0; j < dashes.length(); j++) { - work.setCharAt(1, dashes.charAt(j)); - for (int k = 0; k < testChars.length(); k++) { - char c = testChars.charAt(k); - if (Character.getType(c) == Character.DECIMAL_DIGIT_NUMBER || - Character.getType(c) == Character.OTHER_NUMBER || - Character.getType(c) == Character.NON_SPACING_MARK || - Character.getType(c) == Character.ENCLOSING_MARK || - Character.getType(c) == Character.CURRENCY_SYMBOL || - Character.getType(c) == Character.DASH_PUNCTUATION || - Character.getType(c) == Character.SPACE_SEPARATOR || - Character.getType(c) == Character.FORMAT || - Character.getType(c) == Character.CONTROL || - c == '\n' || c == '\r' || c == '\u2028' || c == '\u2029' || - c == '\u0003' || c == '\u2007' || c == '\u2011' || - c == '\ufeff') - continue; - work.setCharAt(2, c); - e.setText(work.toString()); - boolean saw2 = false; - for (int l = e.first(); l != BreakIterator.DONE; l = e.next()) - if (l == 2) - saw2 = true; - if (!saw2) { - errln("Didn't get break between U+" + Integer.toHexString((int) - (work.charAt(1))) + " and U+" + Integer.toHexString( - (int)(work.charAt(2)))); - errorCount++; - if (errorCount >= 75) - return; - } - } - } - } - } - - public void TestCharacterInvariants() - { - BreakIterator e = BreakIterator.getCharacterInstance(); - doBreakInvariantTest(e, cannedTestChars + "\u1100\u1101\u1102\u1160\u1161\u1162\u11a8" - + "\u11a9\u11aa"); - doOtherInvariantTest(e, cannedTestChars + "\u1100\u1101\u1102\u1160\u1161\u1162\u11a8" - + "\u11a9\u11aa"); - } - - public void TestEmptyString() - { - String text = ""; - Vector x = new Vector(); - x.addElement(text); - - generalIteratorTest(lineBreak, x); - } - - public void TestGetAvailableLocales() - { - Locale[] locList = BreakIterator.getAvailableLocales(); - - if (locList.length == 0) - errln("getAvailableLocales() returned an empty list!"); - // I have no idea how to test this function... - } - - /** - * @bug 4095322 - */ - public void TestJapaneseLineBreak() - { - StringBuffer testString = new StringBuffer("\u4e00x\u4e8c"); - String precedingChars = "([{\u00ab$\u00a5\u00a3\u00a4\u2018\u201a\u201c\u201e\u201b\u201f"; - String followingChars = ")]}\u00bb!%,.\u3001\u3002\u3063\u3083\u3085\u3087\u30c3\u30e3\u30e5\u30e7\u30fc:;\u309b\u309c\u3005\u309d\u309e\u30fd\u30fe\u2019\u201d\u00b0\u2032\u2033\u2034\u2030\u2031\u2103\u2109\u00a2\u0300\u0301\u0302"; - BreakIterator iter = BreakIterator.getLineInstance(Locale.JAPAN); - - for (int i = 0; i < precedingChars.length(); i++) { - testString.setCharAt(1, precedingChars.charAt(i)); - iter.setText(testString.toString()); - int j = iter.first(); - if (j != 0) - errln("ja line break failure: failed to start at 0"); - j = iter.next(); - if (j != 1) - errln("ja line break failure: failed to stop before '" + precedingChars.charAt(i) - + "' (" + ((int)(precedingChars.charAt(i))) + ")"); - j = iter.next(); - if (j != 3) - errln("ja line break failure: failed to skip position after '" + precedingChars.charAt(i) - + "' (" + ((int)(precedingChars.charAt(i))) + ")"); - } - - for (int i = 0; i < followingChars.length(); i++) { - testString.setCharAt(1, followingChars.charAt(i)); - iter.setText(testString.toString()); - int j = iter.first(); - if (j != 0) - errln("ja line break failure: failed to start at 0"); - j = iter.next(); - if (j != 2) - errln("ja line break failure: failed to skip position before '" + followingChars.charAt(i) - + "' (" + ((int)(followingChars.charAt(i))) + ")"); - j = iter.next(); - if (j != 3) - errln("ja line break failure: failed to stop after '" + followingChars.charAt(i) - + "' (" + ((int)(followingChars.charAt(i))) + ")"); - } - } - - /** - * @bug 4068137 - */ - public void TestEndBehavior() - { - String testString = "boo."; - BreakIterator wb = BreakIterator.getWordInstance(); - wb.setText(testString); - - if (wb.first() != 0) - errln("Didn't get break at beginning of string."); - if (wb.next() != 3) - errln("Didn't get break before period in \"boo.\""); - if (wb.current() != 4 && wb.next() != 4) - errln("Didn't get break at end of string."); - } - - // The Following two tests are ported from ICU4C 1.8.1 [Richard/GCL] - /** - * Port From: ICU4C v1.8.1 : textbounds : IntlTestTextBoundary - * Source File: $ICU4CRoot/source/test/intltest/ittxtbd.cpp - **/ - /** - * test methods preceding, following and isBoundary - **/ - public void TestPreceding() { - String words3 = "aaa bbb ccc"; - BreakIterator e = BreakIterator.getWordInstance(Locale.getDefault()); - e.setText( words3 ); - e.first(); - int p1 = e.next(); - int p2 = e.next(); - int p3 = e.next(); - int p4 = e.next(); - - int f = e.following(p2+1); - int p = e.preceding(p2+1); - if (f!=p3) - errln("IntlTestTextBoundary::TestPreceding: f!=p3"); - if (p!=p2) - errln("IntlTestTextBoundary::TestPreceding: p!=p2"); - - if (p1+1!=p2) - errln("IntlTestTextBoundary::TestPreceding: p1+1!=p2"); - - if (p3+1!=p4) - errln("IntlTestTextBoundary::TestPreceding: p3+1!=p4"); - - if (!e.isBoundary(p2) || e.isBoundary(p2+1) || !e.isBoundary(p3)) - { - errln("IntlTestTextBoundary::TestPreceding: isBoundary err"); - } - } - - /** - * Test Thai word break using generalIteratorTest() - **/ - public void TestThaiWordBreak() { - Vector thaiWordSelection = new Vector(); - - thaiWordSelection.addElement("\u0E1A\u0E17"); //2 - thaiWordSelection.addElement("\u0E17\u0E35\u0E48"); //5 - thaiWordSelection.addElement("\u0E51"); //6 - thaiWordSelection.addElement("\u0E1E\u0E32\u0E22\u0E38"); //10 - thaiWordSelection.addElement("\u0E44\u0E0B\u0E42\u0E04\u0E25\u0E19"); //16 - thaiWordSelection.addElement("\r\n"); //18 - - // This is the correct result - //thaiWordSelection.addElement(("\u0E42\u0E14\u0E42\u0E23\u0E18\u0E35")); //24 - //thaiWordSelection.addElement(("\u0E2D\u0E32\u0E28\u0E31\u0E22")); //29 - - // and this is what the dictionary does... - thaiWordSelection.addElement("\u0E42\u0E14"); // 20 - thaiWordSelection.addElement("\u0E42\u0E23\u0E18\u0E35\u0E2D\u0E32\u0E28\u0E31\u0E22"); //29 - - thaiWordSelection.addElement("\u0E2D\u0E22\u0E39\u0E48"); //33 - - // This is the correct result - //thaiWordSelection.addElement("\u0E17\u0E48\u0E32\u0E21"); //37 - //thaiWordSelection.addElement("\u0E01\u0E25\u0E32\u0E07"); //41 - - // and this is what the dictionary does - thaiWordSelection.addElement("\u0E17\u0E48\u0E32\u0E21\u0E01\u0E25\u0E32\u0E07"); //41 - - thaiWordSelection.addElement("\u0E17\u0E38\u0E48\u0E07"); //45 - thaiWordSelection.addElement("\u0E43\u0E2B\u0E0D\u0E48"); //49 - thaiWordSelection.addElement("\u0E43\u0E19"); //51 - - // This is the correct result - //thaiWordSelection.addElement("\u0E41\u0E04\u0E19\u0E0B\u0E31\u0E2A"); //57 - //thaiWordSelection.addElement("\u0E01\u0E31\u0E1A"); //60 - - // and this is what the dictionary does - thaiWordSelection.addElement("\u0E41\u0E04\u0E19"); // 54 - thaiWordSelection.addElement("\u0E0B\u0E31\u0E2A\u0E01\u0E31\u0E1A"); //60 - - thaiWordSelection.addElement("\u0E25\u0E38\u0E07"); //63 - - // This is the correct result - //thaiWordSelection.addElement("\u0E40\u0E2E\u0E19\u0E23\u0E35"); //68 - //thaiWordSelection.addElement("\u0E0A\u0E32\u0E27"); //71 - //thaiWordSelection.addElement("\u0E44\u0E23\u0E48"); //74 - //thaiWordSelection.addElement("\u0E41\u0E25\u0E30"); //77 - - // and this is what the dictionary does - thaiWordSelection.addElement("\u0E40\u0E2E"); // 65 - thaiWordSelection.addElement("\u0E19\u0E23\u0E35\u0E0A\u0E32\u0E27\u0E44\u0E23\u0E48\u0E41\u0E25\u0E30"); //77 - - BreakIterator e = BreakIterator.getWordInstance(new Locale("th","","")); - - generalIteratorTest(e, thaiWordSelection); - } -} - diff --git a/icu4j/src/com/ibm/test/rbbi/RBBIAPITest.java b/icu4j/src/com/ibm/test/rbbi/RBBIAPITest.java deleted file mode 100755 index 56a0936808..0000000000 --- a/icu4j/src/com/ibm/test/rbbi/RBBIAPITest.java +++ /dev/null @@ -1,460 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/rbbi/Attic/RBBIAPITest.java,v $ - * $Date: 2001/11/06 11:42:23 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -/** - * Port From: ICU4C v1.8.1 : rbbi : RBBIAPITest - * Source File: $ICU4CRoot/source/test/intltest/rbbiapts.cpp - **/ - -package com.ibm.test.rbbi; - -import com.ibm.text.RuleBasedBreakIterator; -import java.util.Locale; -import java.util.Vector; -import java.io.*; -import java.text.CharacterIterator; -import java.text.StringCharacterIterator; - -/** - * API Test the RuleBasedBreakIterator class - */ -public class RBBIAPITest extends com.ibm.test.TestFmwk { - - public static void main(String[] args) throws Exception { - new RBBIAPITest().run(args); - } - - /** - * Tests clone() and equals() methods of RuleBasedBreakIterator - **/ - public void TestCloneEquals() { - RuleBasedBreakIterator bi1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getCharacterInstance(Locale.getDefault()); - RuleBasedBreakIterator biequal = (RuleBasedBreakIterator) RuleBasedBreakIterator.getCharacterInstance(Locale.getDefault()); - RuleBasedBreakIterator bi3 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getCharacterInstance(Locale.getDefault()); - RuleBasedBreakIterator bi2 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getWordInstance(Locale.getDefault()); - - String testString = "Testing word break iterators's clone() and equals()"; - bi1.setText(testString); - bi2.setText(testString); - biequal.setText(testString); - - bi3.setText("hello"); - logln("Testing equals()"); - logln("Testing == and !="); - if (!bi1.equals(biequal) || bi1.equals(bi2) || bi1.equals(bi3)) - errln("ERROR:1 RBBI's == and !- operator failed."); - if (bi2.equals(biequal) || bi2.equals(bi1) || biequal.equals(bi3)) - errln("ERROR:2 RBBI's == and != operator failed."); - logln("Testing clone()"); - RuleBasedBreakIterator bi1clone = (RuleBasedBreakIterator) bi1.clone(); - RuleBasedBreakIterator bi2clone = (RuleBasedBreakIterator) bi2.clone(); - if (!bi1clone.equals(bi1) - || !bi1clone.equals(biequal) - || bi1clone.equals(bi3) - || bi1clone.equals(bi2)) - errln("ERROR:1 RBBI's clone() method failed"); - - if (bi2clone.equals(bi1) - || bi2clone.equals(biequal) - || bi2clone.equals(bi3) - || !bi2clone.equals(bi2)) - errln("ERROR:2 RBBI's clone() method failed"); - - if (!bi1.getText().equals(bi1clone.getText()) - || !bi2clone.getText().equals(bi2.getText()) - || bi2clone.equals(bi1clone)) - errln("ERROR: RBBI's clone() method failed"); - } - - /** - * Tests toString() method of RuleBasedBreakIterator - **/ - public void TestToString() { - RuleBasedBreakIterator bi1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getCharacterInstance(Locale.getDefault()); - RuleBasedBreakIterator bi2 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getWordInstance(Locale.getDefault()); - logln("Testing toString()"); - bi1.setText("Hello there"); - RuleBasedBreakIterator bi3 = (RuleBasedBreakIterator) bi1.clone(); - String temp = bi1.toString(); - String temp2 = bi2.toString(); - String temp3 = bi3.toString(); - if (temp2.equals(temp3) || temp.equals(temp2) || !temp.equals(temp3)) - errln("ERROR: error in toString() method"); - } - - /** - * Tests the method hashCode() of RuleBasedBreakIterator - **/ - public void TestHashCode() { - RuleBasedBreakIterator bi1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getCharacterInstance(Locale.getDefault()); - RuleBasedBreakIterator bi3 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getCharacterInstance(Locale.getDefault()); - RuleBasedBreakIterator bi2 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getWordInstance(Locale.getDefault()); - logln("Testing hashCode()"); - bi1.setText("Hash code"); - bi2.setText("Hash code"); - bi3.setText("Hash code"); - RuleBasedBreakIterator bi1clone = (RuleBasedBreakIterator) bi1.clone(); - RuleBasedBreakIterator bi2clone = (RuleBasedBreakIterator) bi2.clone(); - if (bi1.hashCode() != bi1clone.hashCode() - || bi1.hashCode() != bi3.hashCode() - || bi1clone.hashCode() != bi3.hashCode() - || bi2.hashCode() != bi2clone.hashCode()) - errln("ERROR: identical objects have different hashcodes"); - - if (bi1.hashCode() == bi2.hashCode() - || bi2.hashCode() == bi3.hashCode() - || bi1clone.hashCode() == bi2clone.hashCode() - || bi1clone.hashCode() == bi2.hashCode()) - errln("ERROR: different objects have same hashcodes"); - } - - /** - * Tests the methods getText() and setText() of RuleBasedBreakIterator - **/ - public void TestGetSetText() { - logln("Testing getText setText "); - String str1 = "first string."; - String str2 = "Second string."; - //RuleBasedBreakIterator charIter1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getCharacterInstance(Locale.getDefault()); - RuleBasedBreakIterator wordIter1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getWordInstance(Locale.getDefault()); - CharacterIterator text1 = new StringCharacterIterator(str1); - //CharacterIterator text1Clone = (CharacterIterator) text1.clone(); - //CharacterIterator text2 = new StringCharacterIterator(str2); - wordIter1.setText(str1); - if (!wordIter1.getText().equals(text1)) - errln("ERROR:1 error in setText or getText "); - if (wordIter1.current() != 0) - errln("ERROR:1 setText did not set the iteration position to the beginning of the text, it is" - + wordIter1.current() + "\n"); - wordIter1.next(2); - wordIter1.setText(str2); - if (wordIter1.current() != 0) - errln("ERROR:2 setText did not reset the iteration position to the beginning of the text, it is" - + wordIter1.current() + "\n"); - //ICU4J has remove the method adoptText - /* - charIter1.adoptText(text1Clone); - if (wordIter1.getText() == charIter1.getText() - || wordIter1.getText() != text2 - || charIter1.getText() != text1) - errln((UnicodeString) "ERROR:2 error is getText or setText()"); - - RuleBasedBreakIterator rb = (RuleBasedBreakIterator) wordIter1.clone(); - rb.adoptText(text1); - if (rb.getText() != text1) - errln((UnicodeString) "ERROR:1 error in adoptText "); - rb.adoptText(text2); - if (rb.getText() != text2) - errln((UnicodeString) "ERROR:2 error in adoptText "); - */ - } - - /** - * Testing the methods first(), next(), next(int) and following() of RuleBasedBreakIterator - **/ - public void TestFirstNextFollowing() { - int p, q; - String testString = "This is a word break. Isn't it? 2.25"; - logln("Testing first() and next(), following() with custom rules"); - logln("testing word iterator - string :- \"" + testString + "\"\n"); - RuleBasedBreakIterator wordIter1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getWordInstance(Locale.getDefault()); - wordIter1.setText(testString); - p = wordIter1.first(); - if (p != 0) - errln("ERROR: first() returned" + p + "instead of 0"); - q = wordIter1.next(9); - doTest(testString, p, q, 20, "This is a word break"); - p = q; - q = wordIter1.next(); - doTest(testString, p, q, 21, "."); - p = q; - q = wordIter1.next(3); - doTest(testString, p, q, 28, " Isn't "); - p = q; - q = wordIter1.next(2); - doTest(testString, p, q, 31, "it?"); - q = wordIter1.following(2); - doTest(testString, 2, q, 4, "is"); - q = wordIter1.following(22); - doTest(testString, 22, q, 27, "Isn't"); - wordIter1.last(); - p = wordIter1.next(); - q = wordIter1.following(wordIter1.last()); - if (p != RuleBasedBreakIterator.DONE || q != RuleBasedBreakIterator.DONE) - errln("ERROR: next()/following() at last position returned #" - + p + " and " + q + " instead of" + testString.length() + "\n"); - RuleBasedBreakIterator charIter1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getCharacterInstance(Locale.getDefault()); - testString = "Write hindi here. \u092d\u093e\u0930\u0924 \u0938\u0941\u0902\u0926\u0930 \u0939\u094c\u0964"; - logln("testing char iter - string:- \"" + testString + "\""); - charIter1.setText(testString); - p = charIter1.first(); - if (p != 0) - errln("ERROR: first() returned" + p + "instead of 0"); - q = charIter1.next(); - doTest(testString, p, q, 1, "W"); - p = q; - q = charIter1.next(4); - doTest(testString, p, q, 5, "rite"); - p = q; - q = charIter1.next(12); - doTest(testString, p, q, 17, " hindi here."); - p = q; - q = charIter1.next(-6); - doTest(testString, p, q, 11, " here."); - p = q; - q = charIter1.next(6); - doTest(testString, p, q, 17, " here."); - // hindi starts here - p = q; - q = charIter1.next(4); - doTest(testString, p, q, 22, " \u092d\u093e\u0930\u0924"); - p = q; - q = charIter1.next(2); - doTest(testString, p, q, 26, " \u0938\u0941\u0902"); - - q = charIter1.following(24); - doTest(testString, 24, q, 26, "\u0941\u0902"); - q = charIter1.following(20); - doTest(testString, 20, q, 21, "\u0930"); - p = charIter1.following(charIter1.last()); - q = charIter1.next(charIter1.last()); - if (p != RuleBasedBreakIterator.DONE || q != RuleBasedBreakIterator.DONE) - errln("ERROR: following()/next() at last position returned #" - + p + " and " + q + " instead of" + testString.length()); - testString = "Hello! how are you? I'am fine. Thankyou. How are you doing? This\n costs $20,00,000."; - RuleBasedBreakIterator sentIter1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getSentenceInstance(Locale.getDefault()); - logln("testing sentence iter - String:- \"" + testString + "\""); - sentIter1.setText(testString); - p = sentIter1.first(); - if (p != 0) - errln("ERROR: first() returned" + p + "instead of 0"); - q = sentIter1.next(); - doTest(testString, p, q, 7, "Hello! "); - p = q; - q = sentIter1.next(2); - doTest(testString, p, q, 31, "how are you? I'am fine. "); - p = q; - q = sentIter1.next(-2); - doTest(testString, p, q, 7, "how are you? I'am fine. "); - p = q; - q = sentIter1.next(4); - doTest(testString, p, q, 60, "how are you? I'am fine. Thankyou. How are you doing? "); - p = q; - q = sentIter1.next(); - doTest(testString, p, q, 83, "This\n costs $20,00,000."); - q = sentIter1.following(1); - doTest(testString, 1, q, 7, "ello! "); - q = sentIter1.following(10); - doTest(testString, 10, q, 20, " are you? "); - q = sentIter1.following(20); - doTest(testString, 20, q, 31, "I'am fine. "); - p = sentIter1.following(sentIter1.last()); - q = sentIter1.next(sentIter1.last()); - if (p != RuleBasedBreakIterator.DONE || q != RuleBasedBreakIterator.DONE) - errln("ERROR: following()/next() at last position returned #" - + p + " and " + q + " instead of" + testString.length()); - testString = "Hello! how\r\n (are)\r you? I'am fine- Thankyou. foo\u00a0bar How, are, you? This, costs $20,00,000."; - logln("(UnicodeString)testing line iter - String:- \"" + testString + "\""); - RuleBasedBreakIterator lineIter1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getLineInstance(Locale.getDefault()); - lineIter1.setText(testString); - p = lineIter1.first(); - if (p != 0) - errln("ERROR: first() returned" + p + "instead of 0"); - q = lineIter1.next(); - doTest(testString, p, q, 7, "Hello! "); - p = q; - p = q; - q = lineIter1.next(4); - doTest(testString, p, q, 20, "how\r\n (are)\r "); - p = q; - q = lineIter1.next(-4); - doTest(testString, p, q, 7, "how\r\n (are)\r "); - p = q; - q = lineIter1.next(6); - doTest(testString, p, q, 30, "how\r\n (are)\r you? I'am "); - p = q; - q = lineIter1.next(); - doTest(testString, p, q, 36, "fine- "); - p = q; - q = lineIter1.next(2); - doTest(testString, p, q, 54, "Thankyou. foo\u00a0bar "); - q = lineIter1.following(60); - doTest(testString, 60, q, 64, "re, "); - q = lineIter1.following(1); - doTest(testString, 1, q, 7, "ello! "); - q = lineIter1.following(10); - doTest(testString, 10, q, 12, "\r\n"); - q = lineIter1.following(20); - doTest(testString, 20, q, 25, "you? "); - p = lineIter1.following(lineIter1.last()); - q = lineIter1.next(lineIter1.last()); - if (p != RuleBasedBreakIterator.DONE || q != RuleBasedBreakIterator.DONE) - errln("ERROR: following()/next() at last position returned #" - + p + " and " + q + " instead of" + testString.length()); - } - - /** - * Testing the methods lastt(), previous(), and preceding() of RuleBasedBreakIterator - **/ - public void TestLastPreviousPreceding() { - int p, q; - String testString = "This is a word break. Isn't it? 2.25 dollars"; - logln("Testing last(),previous(), preceding() with custom rules"); - logln("testing word iteration for string \"" + testString + "\""); - RuleBasedBreakIterator wordIter1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getWordInstance(Locale.getDefault()); - wordIter1.setText(testString); - p = wordIter1.last(); - if (p != testString.length()) { - errln("ERROR: first() returned" + p + "instead of" + testString.length()); - } - q = wordIter1.previous(); - doTest(testString, p, q, 37, "dollars"); - p = q; - q = wordIter1.previous(); - doTest(testString, p, q, 36, " "); - q = wordIter1.preceding(25); - doTest(testString, 25, q, 22, "Isn"); - p = q; - q = wordIter1.previous(); - doTest(testString, p, q, 21, " "); - q = wordIter1.preceding(20); - doTest(testString, 20, q, 15, "break"); - p = wordIter1.preceding(wordIter1.first()); - if (p != RuleBasedBreakIterator.DONE) - errln("ERROR: preceding() at starting position returned #" + p + " instead of 0"); - testString = "Write hindi here. \u092d\u093e\u0930\u0924 \u0938\u0941\u0902\u0926\u0930 \u0939\u094c\u0964"; - logln("testing character iteration for string \" " + testString + "\" \n"); - RuleBasedBreakIterator charIter1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getCharacterInstance(Locale.getDefault()); - charIter1.setText(testString); - p = charIter1.last(); - if (p != testString.length()) - errln("ERROR: first() returned" + p + "instead of" + testString.length()); - q = charIter1.previous(); - doTest(testString, p, q, 31, "\u0964"); - p = q; - q = charIter1.previous(); - doTest(testString, p, q, 29, "\u0939\u094c"); - q = charIter1.preceding(26); - doTest(testString, 26, q, 23, "\u0938\u0941\u0902"); - q = charIter1.preceding(16); - doTest(testString, 16, q, 15, "e"); - p = q; - q = charIter1.previous(); - doTest(testString, p, q, 14, "r"); - charIter1.first(); - p = charIter1.previous(); - q = charIter1.preceding(charIter1.first()); - if (p != RuleBasedBreakIterator.DONE || q != RuleBasedBreakIterator.DONE) - errln("ERROR: previous()/preceding() at starting position returned #" - + p + " and " + q + " instead of 0\n"); - testString = "Hello! how are you? I'am fine. Thankyou. How are you doing? This\n costs $20,00,000."; - logln("testing sentence iter - String:- \"" + testString + "\""); - RuleBasedBreakIterator sentIter1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getSentenceInstance(Locale.getDefault()); - sentIter1.setText(testString); - p = sentIter1.last(); - if (p != testString.length()) - errln("ERROR: last() returned" + p + "instead of " + testString.length()); - q = sentIter1.previous(); - doTest(testString, p, q, 60, "This\n costs $20,00,000."); - p = q; - q = sentIter1.previous(); - doTest(testString, p, q, 41, "How are you doing? "); - q = sentIter1.preceding(40); - doTest(testString, 40, q, 31, "Thankyou."); - q = sentIter1.preceding(25); - doTest(testString, 25, q, 20, "I'am "); - sentIter1.first(); - p = sentIter1.previous(); - q = sentIter1.preceding(sentIter1.first()); - if (p != RuleBasedBreakIterator.DONE || q != RuleBasedBreakIterator.DONE) - errln("ERROR: previous()/preceding() at starting position returned #" - + p + " and " + q + " instead of 0\n"); - testString = "Hello! how are you? I'am fine. Thankyou. How are you doing? This\n costs $20,00,000."; - logln("testing line iter - String:- \"" + testString + "\""); - RuleBasedBreakIterator lineIter1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getLineInstance(Locale.getDefault()); - lineIter1.setText(testString); - p = lineIter1.last(); - if (p != testString.length()) - errln("ERROR: last() returned" + p + "instead of " + testString.length()); - q = lineIter1.previous(); - doTest(testString, p, q, 72, "$20,00,000."); - p = q; - q = lineIter1.previous(); - doTest(testString, p, q, 66, "costs "); - q = lineIter1.preceding(40); - doTest(testString, 40, q, 31, "Thankyou."); - q = lineIter1.preceding(25); - doTest(testString, 25, q, 20, "I'am "); - lineIter1.first(); - p = lineIter1.previous(); - q = lineIter1.preceding(sentIter1.first()); - if (p != RuleBasedBreakIterator.DONE || q != RuleBasedBreakIterator.DONE) - errln("ERROR: previous()/preceding() at starting position returned #" - + p + " and " + q + " instead of 0\n"); - } - - /** - * Tests the method IsBoundary() of RuleBasedBreakIterator - **/ - public void TestIsBoundary() { - String testString1 = "Write here. \u092d\u093e\u0930\u0924 \u0938\u0941\u0902\u0926\u0930 \u0939\u094c\u0964"; - RuleBasedBreakIterator charIter1 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getCharacterInstance(Locale.getDefault()); - charIter1.setText(testString1); - int bounds1[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 20, 21, 22, 23, 25, 26}; - doBoundaryTest(charIter1, testString1, bounds1); - RuleBasedBreakIterator wordIter2 = (RuleBasedBreakIterator) RuleBasedBreakIterator.getWordInstance(Locale.getDefault()); - wordIter2.setText(testString1); - int bounds2[] = {0, 5, 6, 10, 11, 12, 16, 17, 22, 23, 26}; - doBoundaryTest(wordIter2, testString1, bounds2); - } - - //--------------------------------------------- - //Internal subroutines - //--------------------------------------------- - - /* Internal subroutine used by TestIsBoundary() */ - public void doBoundaryTest(RuleBasedBreakIterator bi, String text, int[] boundaries) { - logln("testIsBoundary():"); - int p = 0; - boolean isB; - for (int i = 0; i < text.length(); i++) { - isB = bi.isBoundary(i); - logln("bi.isBoundary(" + i + ") -> " + isB); - if (i == boundaries[p]) { - if (!isB) - errln("Wrong result from isBoundary() for " + i + ": expected true, got false"); - p++; - } else { - if (isB) - errln("Wrong result from isBoundary() for " + i + ": expected false, got true"); - } - } - } - - /*Internal subroutine used for comparision of expected and acquired results */ - public void doTest(String testString, int start, int gotoffset, int expectedOffset, String expectedString) { - String selected; - String expected = expectedString; - if (gotoffset != expectedOffset) - errln("ERROR:****returned #" + gotoffset + " instead of #" + expectedOffset); - if (start <= gotoffset) { - selected = testString.substring(start, gotoffset); - } else { - selected = testString.substring(gotoffset, start); - } - if (!selected.equals(expected)) - errln("ERROR:****selected \"" + selected + "\" instead of \"" + expected + "\""); - else - logln("****selected \"" + selected + "\""); - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/rbbi/RBBITest.java b/icu4j/src/com/ibm/test/rbbi/RBBITest.java deleted file mode 100755 index c9905deea3..0000000000 --- a/icu4j/src/com/ibm/test/rbbi/RBBITest.java +++ /dev/null @@ -1,952 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/rbbi/Attic/RBBITest.java,v $ - * $Date: 2001/02/06 22:37:58 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.test.rbbi; - -//Regression testing of RuleBasedBreakIterator -import com.ibm.test.*; -import com.ibm.text.RuleBasedBreakIterator; -import java.util.Locale; -import java.util.Vector; -import java.io.*; - -public class RBBITest extends TestFmwk -{ - private RuleBasedBreakIterator characterBreak; - private RuleBasedBreakIterator wordBreak; - private RuleBasedBreakIterator lineBreak; - private RuleBasedBreakIterator sentenceBreak; - - public static void main(String[] args) throws Exception { - new RBBITest().run(args); - } - - public RBBITest() { - } - - private static final String halfNA = "\u0928\u094d\u200d"; /*halfform NA = devanigiri NA + virama(supresses inherent vowel)+ zero width joiner */ - private static final String halfSA = "\u0938\u094d\u200d"; - private static final String halfCHA = "\u091a\u094d\u200d"; - private static final String halfKA = "\u0915\u094d\u200d"; - private static final String deadTA = "\u0924\u094d"; - - private static final String deadRA = "\u0930\u094d"; /*deadform RA = devanagari RA + virama*/ - private static final String deadPHA = "\u092b\u094d"; /*deadform PHA = devanagari PHA + virama*/ - private static final String deadTTHA = "\u0920\u094d"; - private static final String deadPA = "\u092a\u094d"; - private static final String deadSA = "\u0938\u094d"; /*devanagari visarga looks like a english colon*/ - private static final String visarga = "\u0903"; - - - //tests default rules based character iteration - public void TestDefaultRuleBasedCharacterIteration(){ - RuleBasedBreakIterator rbbi=(RuleBasedBreakIterator)RuleBasedBreakIterator.getCharacterInstance(); - logln("Testing the RBBI for character iteration by using default rules"); - //fetch the rules used to create the above RuleBasedBreakIterator - String defaultRules=rbbi.toString(); - - RuleBasedBreakIterator charIterDefault=null; - try{ - charIterDefault = new RuleBasedBreakIterator(defaultRules); - }catch(IllegalArgumentException iae){ - errln("ERROR: failed construction in TestDefaultRuleBasedCharacterIteration()"+ iae.toString()); - } - - Vector chardata = new Vector(); - chardata.addElement("H"); - chardata.addElement("e"); - chardata.addElement("l"); - chardata.addElement("l"); - chardata.addElement("o"); - chardata.addElement("e\u0301"); //acuteE - chardata.addElement("&"); - chardata.addElement("e\u0303"); //tildaE - //devanagiri characters for Hindi support - chardata.addElement("\u0906"); //devanagiri AA - //chardata.addElement("\u093e\u0901"); //devanagiri vowelsign AA+ chandrabindhu - chardata.addElement("\u0916\u0947"); //devanagiri KHA+vowelsign E - chardata.addElement("\u0938\u0941\u0902"); //devanagiri SA+vowelsign U + anusvara(bindu) - chardata.addElement("\u0926"); //devanagiri consonant DA - chardata.addElement("\u0930"); //devanagiri consonant RA - chardata.addElement("\u0939\u094c"); //devanagiri HA+vowel sign AI - chardata.addElement("\u0964"); //devanagiri danda - //end hindi characters - chardata.addElement("A\u0302"); // circumflexA - chardata.addElement("i\u0301"); // acuteBelowI - // conjoining jamo... - chardata.addElement("\u1109\u1161\u11bc"); - chardata.addElement("\u1112\u1161\u11bc"); - chardata.addElement("\n"); - chardata.addElement("\r\n"); // keep CRLF sequences together - chardata.addElement("S\u0300"); //graveS - chardata.addElement("i\u0301"); // acuteBelowI - chardata.addElement("!"); - - // What follows is a string of Korean characters (I found it in the Yellow Pages - // ad for the Korean Presbyterian Church of San Francisco, and I hope I transcribed - // it correctly), first as precomposed syllables, and then as conjoining jamo. - // Both sequences should be semantically identical and break the same way. - // precomposed syllables... - chardata.addElement("\uc0c1"); - chardata.addElement("\ud56d"); - chardata.addElement(" "); - chardata.addElement("\ud55c"); - chardata.addElement("\uc778"); - chardata.addElement(" "); - chardata.addElement("\uc5f0"); - chardata.addElement("\ud569"); - chardata.addElement(" "); - chardata.addElement("\uc7a5"); - chardata.addElement("\ub85c"); - chardata.addElement("\uad50"); - chardata.addElement("\ud68c"); - chardata.addElement(" "); - // conjoining jamo... - chardata.addElement("\u1109\u1161\u11bc"); - chardata.addElement("\u1112\u1161\u11bc"); - chardata.addElement(" "); - chardata.addElement("\u1112\u1161\u11ab"); - chardata.addElement("\u110b\u1175\u11ab"); - chardata.addElement(" "); - chardata.addElement("\u110b\u1167\u11ab"); - chardata.addElement("\u1112\u1161\u11b8"); - chardata.addElement(" "); - chardata.addElement("\u110c\u1161\u11bc"); - chardata.addElement("\u1105\u1169"); - chardata.addElement("\u1100\u116d"); - chardata.addElement("\u1112\u116c"); - - //Testing the BreakIterator for devanagari script - //devanagari characters for Hindi support - chardata.addElement("\u0906"); //devanagari AA - //hindi character break should make sure that it - // doesn't break in-between a vowelsign and a chandrabindu - // chardata.addElement("\u093e\u0901"); //devanagari vowelsign AA+ chandrabindu - chardata.addElement("\u0916\u0947"); //devanagari KHA+vowelsign E - chardata.addElement("\u0938\u0941\u0902"); //devanagari SA+vowelsign U + anusvara(bindu) - chardata.addElement("\u0926"); //devanagari consonant DA - chardata.addElement("\u0930"); //devanagari consonant RA - chardata.addElement("\u0939\u094c"); //devanagari consonant HA+dependent vowel sign AI - chardata.addElement("\u0964"); //devanagari danda - chardata.addElement("\u0950"); //devanagari OM - chardata.addElement("\u0915\u0943"); //devanagari KA+dependent vowel RI->KRI - - //dependent half-forms - chardata.addElement(halfSA+ "\u0924"); //halfSA+base consonant TA->STA - chardata.addElement(halfSA+ "\u0925"); //halfSA+base consonant THA->STHA - chardata.addElement(halfSA+ "\u092e"); //halfSA+base consonant MA->SMA - chardata.addElement(halfCHA+ "\u091b"); //halfCHA+base consonant CHHA->CHHHA - chardata.addElement(halfNA+ "\u0917"); //halfNA+base consonant GA->NGA - chardata.addElement("\u092a\u094d\u200d\u092f"); //halfPA(PA+virama+zerowidthjoiner+base consonant YA->PYA - - - //consonant RA rules ---------- - //if the dead consonant RA precedes either a consonant or an independent vowel, - //then it is replaced by its superscript non-spacing mark - chardata.addElement(deadRA+ "\u0915"); //deadRA+devanagari consonant KA->KA+superRA - chardata.addElement(deadRA+ "\u0923"); //deadRA+devanagari consonant NNA->NNA+superRA - chardata.addElement(deadRA+ "\u0917"); //deadRA+devanagari consonant GA->GA+superRA - // chardata.addElement(deadRA+ "\u0960"); //deadRA+devanagari cosonant RRI->RRI+superRA - - //if any dead consonant(other than dead RA)precedes the consonant RA, then - //it is replaced with its nominal forma nd RA is replaced by the subscript non-spacing mark. - chardata.addElement(deadPHA+ "\u0930"); //deadPHA+devanagari consonant RA->PHA+subRA - chardata.addElement(deadPA+ "\u0930"); //deadPA+devanagari consonant RA->PA+subRA - chardata.addElement(deadTTHA+ "\u0930"); //deadTTHA+devanagari consonant RA->TTHA+subRA - chardata.addElement(deadTA+ "\u0930"); //deadTA+RA->TRA - chardata.addElement("\u0936\u094d\u0930"); //deadSHA(SHA+virama)+RA->SHRA - - //conjuct ligatures - chardata.addElement("\u0915\u094d\u0937"); //deadKA(KA+virama) followed by SSHA wraps up into a single character KSSHA - chardata.addElement(deadTA+ "\u0924"); //deadTA+TA wraps up into glyph TTHA - chardata.addElement("\u0926\u094d\u0935"); //deadDA(DA+virama)+VA wraps up into DVA - chardata.addElement("\u091c\u094d\u091e"); //deadJA(JA+virama)+NYA wraps up into JNYA - - - - generalIteratorTest(charIterDefault, chardata); - - } - - public void TestDefaultRuleBasedWordIteration(){ - logln("Testing the RBBI for word iteration using default rules"); - RuleBasedBreakIterator rbbi=(RuleBasedBreakIterator)RuleBasedBreakIterator.getWordInstance(); - //fetch the rules used to create the above RuleBasedBreakIterator - String defaultRules=rbbi.toString(); - - RuleBasedBreakIterator wordIterDefault=null; - try{ - wordIterDefault = new RuleBasedBreakIterator(defaultRules); - }catch(IllegalArgumentException iae){ - errln("ERROR: failed construction in TestDefaultRuleBasedWordIteration() -- custom rules"+ iae.toString()); - } - - Vector worddata = new Vector(); - worddata.addElement ("Write"); - worddata.addElement (" "); - worddata.addElement ("wordrules"); - worddata.addElement ("."); - worddata.addElement(" "); - worddata.addElement("alpha-beta-gamma"); - worddata.addElement(" "); - worddata.addElement("\u092f\u0939"); - worddata.addElement(" "); - worddata.addElement("\u0939\u093f" + halfNA + "\u0926\u0940"); - worddata.addElement(" "); - worddata.addElement("\u0939\u0948"); - // worddata.addElement("\u0964"); //danda followed by a space - worddata.addElement(" "); - worddata.addElement("\u0905\u093e\u092a"); - worddata.addElement(" "); - worddata.addElement("\u0938\u093f\u0916\u094b\u0917\u0947"); - worddata.addElement("?"); - worddata.addElement(" "); - worddata.addElement("\u0968\u0966.\u0969\u096f"); //hindi numbers - worddata.addElement(" "); - worddata.addElement("\u0967\u0966\u0966.\u0966\u0966%"); //postnumeric - worddata.addElement(" "); - worddata.addElement("\u20a8\u0967,\u0967\u0966\u0966.\u0966\u0966"); //pre-number India currency symbol Rs.\u20aD - worddata.addElement(" "); - worddata.addElement("\u0905\u092e\u091c"); - worddata.addElement("\n"); - worddata.addElement(halfSA+"\u0935\u0924\u0902"+deadTA+"\u0930"); - worddata.addElement("\r"); - worddata.addElement("It's"); - worddata.addElement(" "); - worddata.addElement("$30.10"); - worddata.addElement(" "); - worddata.addElement("\u00A2"); //cent sign - worddata.addElement("\u00A3"); //pound sign - worddata.addElement("\u00A4"); //currency sign - worddata.addElement("\u00A5"); //yen sign - worddata.addElement("alpha-beta-gamma"); - worddata.addElement(" "); - worddata.addElement("Badges"); - worddata.addElement("?"); - worddata.addElement(" "); - worddata.addElement("BADGES"); - worddata.addElement("!"); - worddata.addElement("1000,233,456.000"); - worddata.addElement(" "); - worddata.addElement("1,23.322%"); - worddata.addElement(" "); - worddata.addElement("123.1222"); - worddata.addElement(" "); - worddata.addElement("\u0024123,000.20"); - worddata.addElement(" "); - worddata.addElement("179.01\u0025"); - worddata.addElement("X"); - worddata.addElement(" "); - worddata.addElement("Now"); - worddata.addElement("\r"); - worddata.addElement("is"); - worddata.addElement("\n"); - worddata.addElement("the"); - worddata.addElement("\r\n"); - worddata.addElement("time"); - worddata.addElement(" "); - worddata.addElement("\uc5f0\ud569"); - worddata.addElement(" "); - worddata.addElement("\uc7a5\ub85c\uad50\ud68c"); - worddata.addElement(" "); - // conjoining jamo... - worddata.addElement("\u1109\u1161\u11bc\u1112\u1161\u11bc"); - worddata.addElement(" "); - worddata.addElement("\u1112\u1161\u11ab\u110b\u1175\u11ab"); - worddata.addElement(" "); - worddata.addElement("Hello"); - worddata.addElement(","); - worddata.addElement(" "); - worddata.addElement("how"); - worddata.addElement(" "); - worddata.addElement("are"); - worddata.addElement(" "); - worddata.addElement("you"); - worddata.addElement(" "); - - //Testing the BreakIterator for devanagari script - //hindi - worddata.addElement("\u0917\u092a-\u0936\u092a"); - worddata.addElement("!"); - worddata.addElement("\u092f\u0939"); - worddata.addElement(" "); - worddata.addElement("\u0939\u093f" + halfNA + "\u0926\u0940"); - worddata.addElement(" "); - worddata.addElement("\u0939\u0948"); - //danda is similar to full stop. danda is a hindi phrase seperator - //Make sure it breaks before danda and after danda when it is followed by a space - //worddata.addElement("\u0964"); //fails here doesn't break at danda - worddata.addElement(" "); - worddata.addElement("\u0905\u093e\u092a"); - worddata.addElement(" "); - worddata.addElement("\u0938\u093f\u0916\u094b\u0917\u0947"); - worddata.addElement("?"); - worddata.addElement("\n"); - worddata.addElement(":"); - worddata.addElement(deadPA+"\u0930\u093e\u092f"+visarga); //no break before visarga - worddata.addElement(" "); - - worddata.addElement("\u0935" + deadRA+ "\u0937\u093e"); - worddata.addElement("\r\n"); - worddata.addElement(deadPA+ "\u0930\u0915\u093e\u0936"); //deadPA+RA+KA+vowel AA+SHA -> prakash - worddata.addElement(","); - worddata.addElement("\u0924\u0941\u092e\u093e\u0930\u094b"); - worddata.addElement(" "); - worddata.addElement("\u092e\u093f"+ deadTA+ "\u0930"); //MA+vowel I+ deadTA + RA - worddata.addElement(" "); - worddata.addElement("\u0915\u093e"); - worddata.addElement(" "); - worddata.addElement("\u092a"+ deadTA + "\u0930"); //PA + deadTA + RA - worddata.addElement(" "); - worddata.addElement("\u092a\u095d\u094b"); - // worddata.addElement("\u0964"); //fails here doesn't break at danda - worddata.addElement(" "); - worddata.addElement(deadSA + deadTA + "\u0930\u093f"); //deadSA+deadTA+RA+vowel I->sthri - worddata.addElement("."); - worddata.addElement(" "); - worddata.addElement("\u0968\u0966.\u0969\u096f"); //hindi numbers - worddata.addElement(" "); - worddata.addElement("\u0967\u0966\u0966.\u0966\u0966%"); //postnumeric - worddata.addElement(" "); - worddata.addElement("\u20a8\u0967,\u0967\u0966\u0966.\u0966\u0966"); //pre-number India currency symbol Rs.\u20aD - worddata.addElement(" "); - worddata.addElement("\u0905\u092e\u091c"); - worddata.addElement("\n"); - worddata.addElement(halfSA + "\u0935\u0924\u0902" +deadTA+ "\u0930"); - worddata.addElement("\r"); - - generalIteratorTest(wordIterDefault, worddata); - } - private static final String kParagraphSeparator = "\u2029"; - private static final String kLineSeparator = "\u2028"; - - public void TestDefaultRuleBasedSentenceIteration(){ - logln("Testing the RBBI for sentence iteration using default rules"); - RuleBasedBreakIterator rbbi=(RuleBasedBreakIterator)RuleBasedBreakIterator.getSentenceInstance(); - //fetch the rules used to create the above RuleBasedBreakIterator - String defaultRules=rbbi.toString(); - RuleBasedBreakIterator sentIterDefault=null; - try{ - sentIterDefault = new RuleBasedBreakIterator(defaultRules); - }catch(IllegalArgumentException iae){ - errln("ERROR: failed construction in TestDefaultRuleBasedSentenceIteration()" + iae.toString()); - } - - Vector sentdata = new Vector(); - sentdata.addElement("(This is it.) "); - sentdata.addElement("Testing the sentence iterator. "); - sentdata.addElement("\"This isn\'t it.\" "); - sentdata.addElement("Hi! "); - sentdata.addElement("This is a simple sample sentence. "); - sentdata.addElement("(This is it.) "); - sentdata.addElement("This is a simple sample sentence. "); - sentdata.addElement("\"This isn\'t it.\" "); - sentdata.addElement("Hi! "); - sentdata.addElement("This is a simple sample sentence. "); - sentdata.addElement("It does not have to make any sense as you can see. "); - sentdata.addElement("Nel mezzo del cammin di nostra vita, mi ritrovai in una selva oscura. "); - sentdata.addElement("Che la dritta via aveo smarrita. "); - sentdata.addElement("He said, that I said, that you said!! "); - sentdata.addElement("Don't rock the boat." + kParagraphSeparator); - sentdata.addElement("Because I am the daddy, that is why. "); - sentdata.addElement("Not on my time (el timo.)! "); - sentdata.addElement("So what!!" + kParagraphSeparator); - sentdata.addElement("\"But now,\" he said, \"I know!\" "); - sentdata.addElement("Harris thumbed down several, including \"Away We Go\" (which became the huge success Oklahoma!). "); - sentdata.addElement("One species, B. anthracis, is highly virulent.\n"); - sentdata.addElement("Wolf said about Sounder:\"Beautifully thought-out and directed.\" "); - sentdata.addElement("Have you ever said, \"This is where\tI shall live\"? "); - sentdata.addElement("He answered, \"You may not!\" "); - sentdata.addElement("Another popular saying is: \"How do you do?\". "); - sentdata.addElement("Yet another popular saying is: \'I\'m fine thanks.\' "); - sentdata.addElement("What is the proper use of the abbreviation pp.? "); - sentdata.addElement("Yes, I am definatelly 12\" tall!!"); - sentdata.addElement("Now\ris\nthe\r\ntime\n\rfor\r\rall\u2029"); - // Don't break sentences at the boundary between CJK - // and other letters - sentdata.addElement("\u5487\u67ff\ue591\u5017\u61b3\u60a1\u9510\u8165:\"JAVA\u821c" - + "\u8165\u7fc8\u51ce\u306d,\u2494\u56d8\u4ec0\u60b1\u8560\u51ba" - + "\u611d\u57b6\u2510\u5d46\".\u2029"); - sentdata.addElement("\u5487\u67ff\ue591\u5017\u61b3\u60a1\u9510\u8165\u9de8" - + "\u97e4JAVA\u821c\u8165\u7fc8\u51ce\u306d\ue30b\u2494\u56d8\u4ec0" - + "\u60b1\u8560\u51ba\u611d\u57b6\u2510\u5d46\u97e5\u7751\u2029"); - sentdata.addElement("\u5487\u67ff\ue591\u5017\u61b3\u60a1\u9510\u8165\u9de8\u97e4" - + "\u6470\u8790JAVA\u821c\u8165\u7fc8\u51ce\u306d\ue30b\u2494\u56d8" - + "\u4ec0\u60b1\u8560\u51ba\u611d\u57b6\u2510\u5d46\u97e5\u7751\u2029"); - sentdata.addElement("He said, \"I can go there.\"\u2029"); - // Treat fullwidth variants of .!? the same as their - // normal counterparts - sentdata.addElement("I know I'm right\uff0e "); - sentdata.addElement("Right\uff1f "); - sentdata.addElement("Right\uff01 "); - - // Don't break sentences at boundary between CJK and digits - sentdata.addElement("\u5487\u67ff\ue591\u5017\u61b3\u60a1\u9510\u8165\u9de8" - + "\u97e48888\u821c\u8165\u7fc8\u51ce\u306d\ue30b\u2494\u56d8\u4ec0" - + "\u60b1\u8560\u51ba\u611d\u57b6\u2510\u5d46\u97e5\u7751\u2029"); - - // Break sentence between a sentence terminator and - // opening punctuation - sentdata.addElement("How do you do?"); - sentdata.addElement("(fine)."); - //sentence breaks for hindi - //make sure there is sentence break after ?,danda(hindi phrase separator),fullstop followed by space and no break after \n \r - sentdata.addElement("\u0928\u092e"+halfSA+"\u0924\u0947 " - + "\u0930\u092e\u0947\u0936, " - + "\u0905\u093e\u092a" - + "\u0915\u0948\u0938\u0947 " - + "\u0939\u0948?"); - sentdata.addElement("\u092e\u0948 \u0905" - + halfCHA - + "\u091b\u093e \u0939\u0942\u0901\u0964 "); - sentdata.addElement("\u0905\u093e\u092a\r\n \u0915\u0948\u0938\u0947 \u0939\u0948?"); - sentdata.addElement("\u0935\u0939 " - + halfKA - + "\u092f\u093e\n \u0939\u0948?"); - sentdata.addElement("\u092f\u0939 \u0905\u093e\u092e \u0939\u0948. "); - sentdata.addElement("\u092f\u0939 means \"this\". "); - sentdata.addElement("\"\u092a\u095d\u093e\u0908\" meaning \"education\" or \"studies\". "); - sentdata.addElement("\u0905\u093e\u091c" - + "("+halfSA+"\u0935\u0924\u0902" - + deadTA - + "\u0930 " - + "\u0926\u093f\u0935\u093e\u0938) " - + "\u0939\u0948\u0964 "); - sentdata.addElement("Let's end here. "); - generalIteratorTest(sentIterDefault, sentdata); - } - - public void TestDefaultRuleBasedLineIteration(){ - logln("Testing the RBBI for line iteration using default rules"); - RuleBasedBreakIterator rbbi=(RuleBasedBreakIterator)RuleBasedBreakIterator.getLineInstance(); - //fetch the rules used to create the above RuleBasedBreakIterator - String defaultRules=rbbi.toString(); - RuleBasedBreakIterator lineIterDefault=null; - try{ - lineIterDefault = new RuleBasedBreakIterator(defaultRules); - }catch(IllegalArgumentException iae){ - errln("ERROR: failed construction in TestDefaultRuleBasedLineIteration()" + iae.toString()); - } - - Vector linedata = new Vector(); - linedata.addElement("Multi-"); - linedata.addElement("Level "); - linedata.addElement("example "); - linedata.addElement("of "); - linedata.addElement("a "); - linedata.addElement("semi-"); - linedata.addElement("idiotic "); - linedata.addElement("non-"); - linedata.addElement("sensical "); - linedata.addElement("(non-"); - linedata.addElement("important) "); - linedata.addElement("sentence. "); - - linedata.addElement("Hi "); - linedata.addElement("Hello "); - linedata.addElement("How\n"); - linedata.addElement("are\r"); - linedata.addElement("you" + kLineSeparator); - linedata.addElement("fine.\t"); - linedata.addElement("good. "); - - linedata.addElement("Now\r"); - linedata.addElement("is\n"); - linedata.addElement("the\r\n"); - linedata.addElement("time\n"); - linedata.addElement("\r"); - linedata.addElement("for\r"); - linedata.addElement("\r"); - linedata.addElement("all"); - - // to test for bug #4068133 - linedata.addElement("\u96f6"); - linedata.addElement("\u4e00\u3002"); - linedata.addElement("\u4e8c\u3001"); - linedata.addElement("\u4e09\u3002\u3001"); - linedata.addElement("\u56db\u3001\u3002\u3001"); - linedata.addElement("\u4e94,"); - linedata.addElement("\u516d."); - linedata.addElement("\u4e03.\u3001,\u3002"); - linedata.addElement("\u516b"); - - // to test for bug #4086052 - linedata.addElement("foo\u00a0bar "); - // linedata.addElement("foo\ufeffbar"); - - // to test for bug #4097920 - linedata.addElement("dog,"); - linedata.addElement("cat,"); - linedata.addElement("mouse "); - linedata.addElement("(one)"); - linedata.addElement("(two)\n"); - - // to test for bug #4035266 - linedata.addElement("The "); - linedata.addElement("balance "); - linedata.addElement("is "); - linedata.addElement("$-23,456.78, "); - linedata.addElement("not "); - linedata.addElement("-$32,456.78!\n"); - - // to test for bug #4098467 - // What follows is a string of Korean characters (I found it in the Yellow Pages - // ad for the Korean Presbyterian Church of San Francisco, and I hope I transcribed - // it correctly), first as precomposed syllables, and then as conjoining jamo. - // Both sequences should be semantically identical and break the same way. - // precomposed syllables... - linedata.addElement("\uc0c1\ud56d "); - linedata.addElement("\ud55c\uc778 "); - linedata.addElement("\uc5f0\ud569 "); - linedata.addElement("\uc7a5\ub85c\uad50\ud68c "); - // conjoining jamo... - linedata.addElement("\u1109\u1161\u11bc\u1112\u1161\u11bc "); - linedata.addElement("\u1112\u1161\u11ab\u110b\u1175\u11ab "); - linedata.addElement("\u110b\u1167\u11ab\u1112\u1161\u11b8 "); - linedata.addElement("\u110c\u1161\u11bc\u1105\u1169\u1100\u116d\u1112\u116c"); - - // to test for bug #4117554: Fullwidth .!? should be treated as postJwrd - linedata.addElement("\u4e01\uff0e"); - linedata.addElement("\u4e02\uff01"); - linedata.addElement("\u4e03\uff1f"); - generalIteratorTest(lineIterDefault, linedata); - - - } - public void TestCustomRuleBasedLineIterator(){ - - RuleBasedBreakIterator rbbi=(RuleBasedBreakIterator)RuleBasedBreakIterator.getLineInstance(); - //fetch the rules used to create the above RuleBasedBreakIterator - String rules=//"$_ignore_=[e];" + // [liu] Not sure what the intention was here. - // It's illegal to redefine variables, also, why prepend the ignore definition -- - // even if it's legal to redefine variables, the prepended definition will just - // get overridden. - rbbi.toString(); - RuleBasedBreakIterator lineIter=null; - try{ - lineIter = new RuleBasedBreakIterator(rules); - }catch(IllegalArgumentException iae){ - errln("ERROR: failed construction in TestCustomRuleBasedLineIterator() -- custom rules\n" + iae.toString()); - } - Vector linedata=new Vector(); - linedata.addElement("SLhello! "); - linedata.addElement("How "); - generalIteratorTest(lineIter, linedata); - } - - //tests the behaviour of character iteration of RBBI with custom rules - public void TestCustomRuleBasedCharacterIteration(){ - logln("Testing the RBBI by using custom rules for character iteration"); - - String crules2="$_ignore_=[e];" + //ignore the character "e" - ".;" + - "$devVowelSign=[\u093e-\u094c\u0962\u0963];" + //devanagiri vowel = \u093e tp \u094c and \u0962.\u0963 - "$devConsonant=[\u0915-\u0939];" + //devanagiri consonant = \u0915 to \u0939 - "$devConsonant$devVowelSign;" ; //break at all places except the following - //devanagiri consonants+ devanagiri vowelsign - - RuleBasedBreakIterator charIterRules=null; - try{ - charIterRules = new RuleBasedBreakIterator(crules2); - }catch(IllegalArgumentException iae){ - errln("ERROR: failed construction in TestCustomBasedCharacterIteration()-- custom rules" + iae.toString()); - } - - Vector chardata = new Vector(); - chardata.addElement("He"); //ignores 'e' - chardata.addElement("l"); - chardata.addElement("l"); - chardata.addElement("oe"); //ignores 'e' hence wraps it into 'o' instead of wrapping with - chardata.addElement("\u0301"); //'\u0301' to form 'acuteE ' - chardata.addElement("&e"); //ignores 'e' hence wraps it into '&' instead of wrapping with - chardata.addElement("\u0303"); //'\u0303 to form 'tildaE' - //devanagiri characters - chardata.addElement("\u0906"); //devanagiri AA - chardata.addElement("\u093e"); //devanagiri vowelsign AA:--breaks at \u0901 which is devanagiri - chardata.addElement("\u0901"); //chandra bindhu since it is not mentioned in the rules - chardata.addElement("\u0916\u0947"); //devanagiri KHA+vowelsign E - chardata.addElement("\u0938\u0941"); //devanagiri SA+vowelsign U : - breaks at - chardata.addElement("\u0902"); //\u0902 devanagiri anusvara since it is not mentioned in the rules - chardata.addElement("\u0926"); //devanagiri consonant DA - chardata.addElement("\u0930"); //devanagiri consonant RA - chardata.addElement("\u0939\u094c"); //devanagiri HA+vowel sign AI - chardata.addElement("\u0964"); //devanagiri danda - // devanagiri chracters end - chardata.addElement("A"); //breaks in between since it is not mentioned in the rules - chardata.addElement("\u0302"); /* circumflexA */ - chardata.addElement("i"); //breaks in between since not mentioned in the rules - chardata.addElement("\u0301"); /* acuteBelowI */ - //Rules don't support conjoining jamo.... - chardata.addElement("\u1109"); //break at every character since rules - chardata.addElement("\u1161"); //don't support conjoining jamo - chardata.addElement("\u11bc"); - chardata.addElement("\u1112"); - chardata.addElement("\u1161"); - chardata.addElement("\u11bc"); - chardata.addElement("\n"); - chardata.addElement("\r"); //doesn't keep CRLGF together since rules do not mention it - chardata.addElement("\n"); - chardata.addElement("S"); //graveS - chardata.addElement("\u0300"); //breaks in between since it is not mentioned in the rules - chardata.addElement("i"); //acuteBelowI - chardata.addElement("\u0301"); //breaks in between since it is not mentioned in the rules - - generalIteratorTest(charIterRules, chardata); - - } - //tests custom rules based word iteration - public void TestCustomRuleBasedWordIteration(){ - logln("Testing the RBBI by using custom rules for word iteration"); - String wrules1="$_ignore_=[[:Mn:][:Me:][:Cf:]];" + // ignore non-spacing marks, enclosing marks, and format characters, - "$danda=[\u0964\u0965];" + // Hindi Phrase seperator - "$let=[[:L:][:Mc:]];" + // uppercase(Lu), lowercase(Ll), titlecase(Lt), modifier(Lm) letters, Mc-combining space mark - "$mid_word=[[:Pd:]\\\"\\\'\\.];" + // dashes, quotation, apostraphes, period - "$ls=[\n\u000c\u2028\u2029];" + // line separators: LF, FF, PS, and LS - "$ws=[[:Zs:]\t];" + // all space separators and the tab character - "$word=(($let+($mid_word$let+)*));" + - ".;" + // break after every character, with the following exceptions - "$word;" + - "$ws*\r$ls$danda?;" ; - - RuleBasedBreakIterator wordIterRules=null; - try{ - wordIterRules = new RuleBasedBreakIterator(wrules1); - }catch(IllegalArgumentException iae){ - errln("ERROR: failed construction in TestCustomRuleBasedWordIteration() -- custom rules" + iae.toString()); - } - - Vector worddata = new Vector(); - worddata.addElement("Write"); - worddata.addElement(" "); - worddata.addElement("wordrules"); - worddata.addElement("."); - worddata.addElement(" "); - //play with hindi - worddata.addElement("\u092f\u0939"); - worddata.addElement(" "); - worddata.addElement("\u0939\u093f" + halfNA + "\u0926\u0940"); - worddata.addElement(" "); - worddata.addElement("\u0939\u0948"); - worddata.addElement("\u0964"); //Danda is similar to full stop. Danda followed by a space - worddata.addElement(" "); - worddata.addElement("\u0905\u093e\u092a"); - worddata.addElement(" "); - worddata.addElement("\u0938\u093f\u0916\u094b\u0917\u0947"); - worddata.addElement("?"); - worddata.addElement(" "); - worddata.addElement("It's"); - worddata.addElement(" "); - worddata.addElement("$"); - worddata.addElement("3"); - worddata.addElement("0"); - worddata.addElement("."); - worddata.addElement("1"); - worddata.addElement("0"); - worddata.addElement(" "); - // worddata.addElement(" "); - generalIteratorTest(wordIterRules, worddata); - } - //adds extra rules to deal with abbrevations(limited) and test the word Iteration - public void TestAbbrRuleBasedWordIteration(){ - logln("Testing the RBBI for word iteration by adding rules to support abbreviation"); - RuleBasedBreakIterator rb =(RuleBasedBreakIterator)RuleBasedBreakIterator.getWordInstance(); - - String wrules2="$abbr=((Mr.)|(Mrs.)|(Ms.)|(Dr.)|(U.S.));" + // abbreviations. - rb.toString() + - "($abbr$ws)*$word;"; - RuleBasedBreakIterator wordIter=null; - try{ - wordIter = new RuleBasedBreakIterator(wrules2); - }catch(IllegalArgumentException iae){ - errln("ERROR: failed construction in TestAbbrRuleBasedWordIteration() --custom rules" + iae.toString()); - } - Vector worddata = new Vector(); - worddata.addElement("Mr. George"); - worddata.addElement(" "); - worddata.addElement("is"); - worddata.addElement(" "); - worddata.addElement("from"); - worddata.addElement(" "); - worddata.addElement("U.S. Navy"); - worddata.addElement("."); - worddata.addElement(" "); - worddata.addElement("His"); - worddata.addElement("\n"); - worddata.addElement("friend"); - worddata.addElement("\t"); - worddata.addElement("Dr. Steven"); - worddata.addElement(" "); - worddata.addElement("married"); - worddata.addElement(" "); - worddata.addElement("Ms. Benneth"); - worddata.addElement("!"); - worddata.addElement(" "); - worddata.addElement("Mrs. Johnson"); - worddata.addElement("\r\n"); - worddata.addElement("paid"); - worddata.addElement(" "); - worddata.addElement("$2,400.00"); - generalIteratorTest(wordIter, worddata); - } - //========================================================================= - // general test subroutines - //========================================================================= - - private void generalIteratorTest(RuleBasedBreakIterator rbbi, Vector expectedResult){ - StringBuffer buffer = new StringBuffer(); - String text; - for (int i = 0; i < expectedResult.size(); i++) { - text = (String)expectedResult.elementAt(i); - buffer.append(text); - } - text = buffer.toString(); - - rbbi.setText(text); - - Vector nextResults = _testFirstAndNext(rbbi, text); - Vector previousResults = _testLastAndPrevious(rbbi, text); - - logln("comparing forward and backward..."); - int errs = getErrorCount(); - compareFragmentLists("forward iteration", "backward iteration", nextResults, - previousResults); - if (getErrorCount() == errs) { - logln("comparing expected and actual..."); - compareFragmentLists("expected result", "actual result", expectedResult, - nextResults); - } - - int[] boundaries = new int[expectedResult.size() + 3]; - boundaries[0] = RuleBasedBreakIterator.DONE; - boundaries[1] = 0; - for (int i = 0; i < expectedResult.size(); i++) - boundaries[i + 2] = boundaries[i + 1] + ((String)expectedResult.elementAt(i)).length(); - - boundaries[boundaries.length - 1] = RuleBasedBreakIterator.DONE; - - _testFollowing(rbbi, text, boundaries); - _testPreceding(rbbi, text, boundaries); - _testIsBoundary(rbbi, text, boundaries); - - doMultipleSelectionTest(rbbi, text); - } - - private Vector _testFirstAndNext(RuleBasedBreakIterator rbbi, String text) { - int p = rbbi.first(); - int lastP = p; - Vector result = new Vector(); - - if (p != 0) - errln("first() returned " + p + " instead of 0"); - while (p != RuleBasedBreakIterator.DONE) { - p = rbbi.next(); - if (p != RuleBasedBreakIterator.DONE) { - if (p <= lastP) - errln("next() failed to move forward: next() on position " - + lastP + " yielded " + p); - - result.addElement(text.substring(lastP, p)); - } - else { - if (lastP != text.length()) - errln("next() returned DONE prematurely: offset was " - + lastP + " instead of " + text.length()); - } - lastP = p; - } - return result; - } - - private Vector _testLastAndPrevious(RuleBasedBreakIterator rbbi, String text) { - int p = rbbi.last(); - int lastP = p; - Vector result = new Vector(); - - if (p != text.length()) - errln("last() returned " + p + " instead of " + text.length()); - while (p != RuleBasedBreakIterator.DONE) { - p = rbbi.previous(); - if (p != RuleBasedBreakIterator.DONE) { - if (p >= lastP) - errln("previous() failed to move backward: previous() on position " - + lastP + " yielded " + p); - - result.insertElementAt(text.substring(p, lastP), 0); - } - else { - if (lastP != 0) - errln("previous() returned DONE prematurely: offset was " - + lastP + " instead of 0"); - } - lastP = p; - } - return result; - } - - private void compareFragmentLists(String f1Name, String f2Name, Vector f1, Vector f2) { - int p1 = 0; - int p2 = 0; - String s1; - String s2; - int t1 = 0; - int t2 = 0; - - while (p1 < f1.size() && p2 < f2.size()) { - s1 = (String)f1.elementAt(p1); - s2 = (String)f2.elementAt(p2); - t1 += s1.length(); - t2 += s2.length(); - - if (s1.equals(s2)) { - debugLogln(" >" + s1 + "<"); - ++p1; - ++p2; - } - else { - int tempT1 = t1; - int tempT2 = t2; - int tempP1 = p1; - int tempP2 = p2; - - while (tempT1 != tempT2 && tempP1 < f1.size() && tempP2 < f2.size()) { - while (tempT1 < tempT2 && tempP1 < f1.size()) { - tempT1 += ((String)f1.elementAt(tempP1)).length(); - ++tempP1; - } - while (tempT2 < tempT1 && tempP2 < f2.size()) { - tempT2 += ((String)f2.elementAt(tempP2)).length(); - ++tempP2; - } - } - logln("*** " + f1Name + " has:"); - while (p1 <= tempP1 && p1 < f1.size()) { - s1 = (String)f1.elementAt(p1); - t1 += s1.length(); - debugLogln(" *** >" + s1 + "<"); - ++p1; - } - logln("***** " + f2Name + " has:"); - while (p2 <= tempP2 && p2 < f2.size()) { - s2 = (String)f2.elementAt(p2); - t2 += s2.length(); - debugLogln(" ***** >" + s2 + "<"); - ++p2; - } - errln("Discrepancy between " + f1Name + " and " + f2Name); - } - } - } - - private void _testFollowing(RuleBasedBreakIterator rbbi, String text, int[] boundaries) { - logln("testFollowing():"); - int p = 2; - for(int i = 0; i <= text.length(); i++) { - if (i == boundaries[p]) - ++p; - int b = rbbi.following(i); - logln("rbbi.following(" + i + ") -> " + b); - if (b != boundaries[p]) - errln("Wrong result from following() for " + i + ": expected " + boundaries[p] - + ", got " + b); - } - } - - private void _testPreceding(RuleBasedBreakIterator rbbi, String text, int[] boundaries) { - logln("testPreceding():"); - int p = 0; - for(int i = 0; i <= text.length(); i++) { - int b = rbbi.preceding(i); - logln("rbbi.preceding(" + i + ") -> " + b); - if (b != boundaries[p]) - errln("Wrong result from preceding() for " + i + ": expected " + boundaries[p] - + ", got " + b); - if (i == boundaries[p + 1]) - ++p; - } - } - - private void _testIsBoundary(RuleBasedBreakIterator rbbi, String text, int[] boundaries) { - logln("testIsBoundary():"); - int p = 1; - boolean isB; - for(int i = 0; i <= text.length(); i++) { - isB = rbbi.isBoundary(i); - logln("rbbi.isBoundary(" + i + ") -> " + isB); - if(i == boundaries[p]) { - if (!isB) - errln("Wrong result from isBoundary() for " + i + ": expected true, got false"); - ++p; - } - else { - if(isB) - errln("Wrong result from isBoundary() for " + i + ": expected false, got true"); - } - } - } - private void doMultipleSelectionTest(RuleBasedBreakIterator iterator, String testText) - { - logln("Multiple selection test..."); - RuleBasedBreakIterator testIterator = (RuleBasedBreakIterator)iterator.clone(); - int offset = iterator.first(); - int testOffset; - int count = 0; - - do { - testOffset = testIterator.first(); - testOffset = testIterator.next(count); - logln("next(" + count + ") -> " + testOffset); - if (offset != testOffset) - errln("next(n) and next() not returning consistent results: for step " + count + ", next(n) returned " + testOffset + " and next() had " + offset); - - if (offset != RuleBasedBreakIterator.DONE) { - count++; - offset = iterator.next(); - } - } while (offset != RuleBasedBreakIterator.DONE); - - // now do it backwards... - offset = iterator.last(); - count = 0; - - do { - testOffset = testIterator.last(); - testOffset = testIterator.next(count); - logln("next(" + count + ") -> " + testOffset); - if (offset != testOffset) - errln("next(n) and next() not returning consistent results: for step " + count + ", next(n) returned " + testOffset + " and next() had " + offset); - - if (offset != RuleBasedBreakIterator.DONE) { - count--; - offset = iterator.previous(); - } - } while (offset != RuleBasedBreakIterator.DONE); - } - - private void debugLogln(String s) { - final String zeros = "0000"; - String temp; - StringBuffer out = new StringBuffer(); - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - if (c >= ' ' && c < '\u007f') - out.append(c); - else { - out.append("\\u"); - temp = Integer.toHexString((int)c); - out.append(zeros.substring(0, 4 - temp.length())); - out.append(temp); - } - } - logln(out.toString()); - } - -} diff --git a/icu4j/src/com/ibm/test/rbbi/SimpleBITest.java b/icu4j/src/com/ibm/test/rbbi/SimpleBITest.java deleted file mode 100755 index cc922833fe..0000000000 --- a/icu4j/src/com/ibm/test/rbbi/SimpleBITest.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/rbbi/Attic/SimpleBITest.java,v $ - * $Date: 2000/03/10 03:47:46 $ - * $Revision: 1.5 $ - * - ***************************************************************************************** - */ -package com.ibm.test.rbbi; - -import java.util.Locale; -import com.ibm.text.BreakIterator; -import com.ibm.test.TestFmwk; - -public class SimpleBITest extends TestFmwk{ - public static final String testText = -// "The rain in Spain stays mainly on the plain. The plains in Spain are mainly pained with rain."; -//"one-two now-- Hah! You owe me exactly $1,345.67... Pay up, huh? By the way, why don't I send you my re\u0301sume\u0301? This is a line\r\nbreak."; -//"nowisthetimeforallgoodmen... tocometothehelpoftheircountry"; -"When, in the course of human events, it becomes necessary for one people to dissolve the political bonds which have " -//"When,inthecourseofhumanevents,itbecomesnecessaryforonepeopletodissolvethepoliticalbondswhichhave" -+ "connectedthemwithanother,andtoassumeamongthepowersoftheearth,theseparateandequalstationtowhichthelaws" -+ "ofnatureandofnature'sGodentitlethem,adecentrespecttotheopinionsofmankindrequiresthattheyshoulddeclarethe" -+ "causeswhichimpelthemtotheseparation\n" -+ "Weholdthesetruthstobeself-evident,thatallmenarecreatedequal,thattheyareendowedbytheirCreatorwithcertain" -+ "unalienablerights,thatamongthesearelife,libertyandthepursuitofhappiness.Thattosecuretheserights,governmentsare" -+ "institutedamongmen,derivingtheirjustpowersfromtheconsentofthegoverned.Thatwheneveranyformofgovernment" -+ "becomesdestructivetotheseends,itistherightofthepeopletoalterortoabolishit,andtoinstitutenewgovernment,laying" -+ "itsfoundationonsuchprinciplesandorganizingitspowersinsuchform,astothemshallseemmostlikelytoeffecttheirsafety" -+ "andhappiness.Prudence,indeed,willdictatethatgovernmentslongestablishedshouldnotbechangedforlightandtransient" -+ "causes;andaccordinglyallexperiencehathshownthatmankindaremoredisposedtosuffer,whileevilsaresufferable,than" -+ "torightthemselvesbyabolishingtheformstowhichtheyareaccustomed.Butwhenalongtrainofabusesandusurpations," -+ "pursuinginvariablythesameobjectevincesadesigntoreducethemunderabsolutedespotism,itistheirright,itistheirduty," -+ "tothrowoffsuchgovernment,andtoprovidenewguardsfortheirfuturesecurity.--Suchhasbeenthepatientsufferanceof" -+ "thesecolonies;andsuchisnowthenecessitywhichconstrainsthemtoaltertheirformersystemsofgovernment.Thehistory" -+ "ofthepresentKingofGreatBritainisahistoryofrepeatedinjuriesandusurpations,allhavingindirectobjectthe" -+ "establishmentofanabsolutetyrannyoverthesestates.Toprovethis,letfactsbesubmittedtoacandidworld.\n" -+ "Hehasrefusedhisassenttolaws,themostwholesomeandnecessaryforthepublicgood.\n" -+ "Hehasforbiddenhisgovernorstopasslawsofimmediateandpressingimportance,unlesssuspendedintheiroperationtill" -+ "hisassentshouldbeobtained;andwhensosuspended,hehasutterlyneglectedtoattendtothem.\n" -+ "Hehasrefusedtopassotherlawsfortheaccommodationoflargedistrictsofpeople,unlessthosepeoplewouldrelinquish" -+ "therightofrepresentationinthelegislature,arightinestimabletothemandformidabletotyrantsonly.\n" -+ "Hehascalledtogetherlegislativebodiesatplacesunusual,uncomfortable,anddistantfromthedepositoryoftheirpublic" -+ "records,forthesolepurposeoffatiguingthemintocompliancewithhismeasures.\n" -+ "Hehasdissolvedrepresentativehousesrepeatedly,foropposingwithmanlyfirmnesshisinvasionsontherightsofthepeople.\n" -+ "Hehasrefusedforalongtime,aftersuchdissolutions,tocauseotherstobeelected;wherebythelegislativepowers," -+ "incapableofannihilation,havereturnedtothepeopleatlargefortheirexercise;thestateremaininginthemeantimeexposed" -+ "toallthedangersofinvasionfromwithout,andconvulsionswithin.\n" -+ "Hehasendeavoredtopreventthepopulationofthesestates;forthatpurposeobstructingthelawsfornaturalizationof" -+ "foreigners;refusingtopassotherstoencouragetheirmigrationhither,andraisingtheconditionsofnewappropriationsof" -+ "lands.\n" -+ "Hehasobstructedtheadministrationofjustice,byrefusinghisassenttolawsforestablishingjudiciarypowers.\n" -+ "Hehasmadejudgesdependentonhiswillalone,forthetenureoftheiroffices,andtheamountandpaymentoftheirsalaries.\n" -+ "Hehaserectedamultitudeofnewoffices,andsenthitherswarmsofofficerstoharassourpeople,andeatouttheir" -+ "substance.\n" -+ "Hehaskeptamongus,intimesofpeace,standingarmieswithouttheconsentofourlegislature.\n" -+ "Hehasaffectedtorenderthemilitaryindependentofandsuperiortocivilpower.\n" -+ "Hehascombinedwithotherstosubjectustoajurisdictionforeigntoourconstitution,andunacknowledgedbyourlaws;" -+ "givinghisassenttotheiractsofpretendedlegislation:\n" -+ "Forquarteringlargebodiesofarmedtroopsamongus:\n" -+ "Forprotectingthem,bymocktrial,frompunishmentforanymurderswhichtheyshouldcommitontheinhabitantsofthese" -+ "states:\n" -+ "Forcuttingoffourtradewithallpartsoftheworld:\n" -+ "Forimposingtaxesonuswithoutourconsent:\n" -+ "Fordeprivingusinmanycases,ofthebenefitsoftrialbyjury:\n" -+ "Fortransportingusbeyondseastobetriedforpretendedoffenses:\n" -+ "ForabolishingthefreesystemofEnglishlawsinaneighboringprovince,establishingthereinanarbitrarygovernment,and" -+ "enlargingitsboundariessoastorenderitatonceanexampleandfitinstrumentforintroducingthesameabsoluteruleinthese" -+ "colonies:\n" -+ "Fortakingawayourcharters,abolishingourmostvaluablelaws,andalteringfundamentallytheformsofourgovernments:\n" -+ "Forsuspendingourownlegislatures,anddeclaringthemselvesinvestedwithpowertolegislateforusinallcaseswhatsoever.\n" -+ "Hehasabdicatedgovernmenthere,bydeclaringusoutofhisprotectionandwagingwaragainstus.\n" -+ "Hehasplunderedourseas,ravagedourcoasts,burnedourtowns,anddestroyedthelivesofourpeople.\n" -+ "Heisatthistimetransportinglargearmiesofforeignmercenariestocompletetheworksofdeath,desolationandtyranny," -+ "alreadybegunwithcircumstancesofcrueltyandperfidyscarcelyparalleledinthemostbarbarousages,andtotalyunworth" -+ "theheadofacivilizednation.\n" -+ "Hehasconstrainedourfellowcitizenstakencaptiveonthehighseastobeararmsagainsttheircountry,tobecomethe" -+ "executionersoftheirfriendsandbrethren,ortofallthemselvesbytheirhands.\n" -+ "Hehasexciteddomesticinsurrectionsamongstus,andhasendeavoredtobringontheinhabitantsofourfrontiers,the" -+ "mercilessIndiansavages,whoseknownruleofwarfare,isundistinguisheddestructionofallages,sexesandconditions.\n" -+ "Ineverystageoftheseoppressionswehavepetitionedforredressinthemosthumbleterms:ourrepeatedpetitionshave" -+ "beenansweredonlybyrepeatedinjury.Aprince,whosecharacteristhusmarkedbyeveryactwhichmaydefineatyrant,is" -+ "unfittobetherulerofafreepeople.\n" -+ "NorhavewebeenwantinginattentiontoourBritishbrethren.Wehavewarnedthemfromtimetotimeofattemptsbytheir" -+ "legislaturetoextendanunwarrantablejurisdictionoverus.Wehaveremindedthemofthecircumstancesofouremigration" -+ "andsettlementhere.Wehaveappealedtotheirnativejusticeandmagnanimity,andwehaveconjuredthembythetiesofour" -+ "commonkindredtodisavowtheseusurpations,which,wouldinevitablyinterruptourconnectionsandcorrespondence.We" -+ "must,therefore,acquiesceinthenecessity,whichdenouncesourseparation,andholdthem,asweholdtherestofmankind," -+ "enemiesinwar,inpeacefriends.\n" -+ "We,therefore,therepresentativesoftheUnitedStatesofAmerica,inGeneralCongress,assembled,appealingtothe" -+ "SupremeJudgeoftheworldfortherectitudeofourintentions,do,inthename,andbytheauthorityofthegoodpeopleof" -+ "thesecolonies,solemnlypublishanddeclare,thattheseunitedcoloniesare,andofrightoughttobefreeandindependent" -+ "states;thattheyareabsolvedfromallallegiancetotheBritishCrown,andthatallpoliticalconnectionbetweenthemandthe" -+ "stateofGreatBritain,isandoughttobetotallydissolved;andthatasfreeandindependentstates,theyhavefullpowerto" -+ "leveywar,concludepeace,contractalliances,establishcommerce,andtodoallotheractsandthingswhichindependent" -+ "statesmayofrightdo.Andforthesupportofthisdeclaration,withafirmrelianceontheprotectionofDivineProvidence,we" -+ "mutuallypledgetoeachotherourlives,ourfortunesandoursacredhonor.\n"; - - public static void main(String[] args) throws Exception { - new SimpleBITest().run(args); - } - - public void testWordBreak() throws Exception { - BreakIterator wordBreak = BreakIterator.getWordInstance(new Locale("en", "US", "TEST")); - int breaks = doTest(wordBreak); - logln(String.valueOf(breaks)); - } - - public void testLineBreak() throws Exception { - BreakIterator lineBreak = BreakIterator.getLineInstance(new Locale("en", "US", "TEST")); - int breaks = doTest(lineBreak); - logln(String.valueOf(breaks)); - } - - public void testSentenceBreak() throws Exception { - BreakIterator sentenceBreak = BreakIterator.getSentenceInstance(new Locale("en", "US", "TEST")); - int breaks = doTest(sentenceBreak); - logln(String.valueOf(breaks)); - } - - private int doTest(BreakIterator bi) { - // forward - bi.setText(testText); - int p = bi.first(); - int lastP = p; - String fragment; - int breaks = 0; - logln("Forward..."); - while (p != BreakIterator.DONE) { - p = bi.next(); - if (p != BreakIterator.DONE) { - fragment = testText.substring(lastP, p); - } else { - fragment = testText.substring(lastP); - } - debugPrintln(": >" + fragment + "<"); - ++breaks; - lastP = p; - } - return breaks; - } - - private void debugPrintln(String s) { - final String zeros = "0000"; - String temp; - StringBuffer out = new StringBuffer(); - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - if (c >= ' ' && c < '\u007f') - out.append(c); - else { - out.append("\\u"); - temp = Integer.toHexString((int)c); - out.append(zeros.substring(0, 4 - temp.length())); - out.append(temp); - } - } - logln(out.toString()); - } - - private void debugPrintln2(String s) { - StringBuffer out = new StringBuffer(); - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - if (c >= '\u0100') - out.append("<" + ((int)c - 0x100) + ">"); - else - out.append(c); - } - logln(out.toString()); - } -} - diff --git a/icu4j/src/com/ibm/test/rbbi/package.html b/icu4j/src/com/ibm/test/rbbi/package.html deleted file mode 100755 index 636acfd54e..0000000000 --- a/icu4j/src/com/ibm/test/rbbi/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Tests for the RuleBasedBreakIterator. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/rbnf/RbnfRoundTripTest.java b/icu4j/src/com/ibm/test/rbnf/RbnfRoundTripTest.java deleted file mode 100755 index 250540227a..0000000000 --- a/icu4j/src/com/ibm/test/rbnf/RbnfRoundTripTest.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/rbnf/Attic/RbnfRoundTripTest.java,v $ - * $Date: 2000/03/10 03:47:47 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.test.rbnf; - -import com.ibm.text.RuleBasedNumberFormat; -import com.ibm.test.TestFmwk; - -import java.util.Locale; -import java.text.NumberFormat; - -public class RbnfRoundTripTest extends TestFmwk { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - public static void main(String[] args) { - RbnfRoundTripTest test = new RbnfRoundTripTest(); - - try { - test.run(args); - } - catch (Throwable e) { - System.out.println("Entire test failed because of exception: " - + e.toString()); - e.printStackTrace(); - } - } - - /** - * Perform an exhaustive round-trip test on the English spellout rules - */ - public void TestEnglishSpelloutRT() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(Locale.US, - RuleBasedNumberFormat.SPELLOUT); - - doTest(formatter, -12345678, 12345678); - } - - /** - * Perform an exhaustive round-trip test on the duration-formatting rules - */ - public void TestDurationsRT() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(Locale.US, - RuleBasedNumberFormat.DURATION); - - doTest(formatter, 0, 12345678); - } - - /** - * Perform an exhaustive round-trip test on the Spanish spellout rules - */ - public void TestSpanishSpelloutRT() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(new Locale("es", "es", - ""), RuleBasedNumberFormat.SPELLOUT); - - doTest(formatter, -12345678, 12345678); - } - - /** - * Perform an exhaustive round-trip test on the French spellout rules - */ - public void TestFrenchSpelloutRT() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(Locale.FRANCE, - RuleBasedNumberFormat.SPELLOUT); - - doTest(formatter, -12345678, 12345678); - } - - /** - * Perform an exhaustive round-trip test on the Swiss French spellout rules - */ - public void TestSwissFrenchSpelloutRT() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(new Locale("fr", "CH", - ""), RuleBasedNumberFormat.SPELLOUT); - - doTest(formatter, -12345678, 12345678); - } - - /** - * Perform an exhaustive round-trip test on the Italian spellout rules - */ - public void TestItalianSpelloutRT() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(Locale.ITALIAN, - RuleBasedNumberFormat.SPELLOUT); - - doTest(formatter, -999999, 999999); - } - - /** - * Perform an exhaustive round-trip test on the German spellout rules - */ - public void TestGermanSpelloutRT() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(Locale.GERMANY, - RuleBasedNumberFormat.SPELLOUT); - - doTest(formatter, 0, 12345678); - } - - /** - * Perform an exhaustive round-trip test on the Swedish spellout rules - */ - public void TestSwedishSpelloutRT() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(new Locale("sv", "SE", - ""), RuleBasedNumberFormat.SPELLOUT); - - doTest(formatter, 0, 12345678); - } - - /** - * Perform an exhaustive round-trip test on the Dutch spellout rules - */ - public void TestDutchSpelloutRT() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(new Locale("nl", "NL", - ""), RuleBasedNumberFormat.SPELLOUT); - - doTest(formatter, -12345678, 12345678); - } - - /** - * Perform an exhaustive round-trip test on the Japanese spellout rules - */ - public void TestJapaneseSpelloutRT() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(Locale.JAPAN, - RuleBasedNumberFormat.SPELLOUT); - - doTest(formatter, 0, 12345678); - } - - /** - * Perform an exhaustive round-trip test on the Russian spellout rules - */ - public void TestRussianSpelloutRT() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(new Locale("ru", "RU", - ""), RuleBasedNumberFormat.SPELLOUT); - - doTest(formatter, 0, 12345678); - } - - /** - * Perform an exhaustive round-trip test on the Greek spellout rules - */ - public void TestGreekSpelloutRT() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(new Locale("el", "GR", - ""), RuleBasedNumberFormat.SPELLOUT); - - doTest(formatter, 0, 12345678); - } - - void doTest(RuleBasedNumberFormat formatter, long lowLimit, - long highLimit) { - try { - long count = 0; - long increment = 1; - for (long i = lowLimit; i <= highLimit; i += increment) { - if (count % 1000 == 0) - logln(Long.toString(i)); - - if (Math.abs(i) < 5000) - increment = 1; - else if (Math.abs(i) < 500000) - increment = 2737; - else - increment = 267437; - - String text = formatter.format(i); - long rt = formatter.parse(text).longValue(); - - if (rt != i) { - errln("Round-trip failed: " + i + " -> " + text + - " -> " + rt); - } - - ++count; - } - - if (lowLimit < 0) { - double d = 1.234; - while (d < 1000) { - String text = formatter.format(d); - double rt = formatter.parse(text).doubleValue(); - - if (rt != d) { - errln("Round-trip failed: " + d + " -> " + text + - " -> " + rt); - } - d *= 10; - } - } - } - catch (Throwable e) { - errln("Test failed with exception: " + e.toString()); - e.printStackTrace(); - } - } -} - diff --git a/icu4j/src/com/ibm/test/rbnf/RbnfTest.java b/icu4j/src/com/ibm/test/rbnf/RbnfTest.java deleted file mode 100755 index 473bcbb9ed..0000000000 --- a/icu4j/src/com/ibm/test/rbnf/RbnfTest.java +++ /dev/null @@ -1,530 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/rbnf/Attic/RbnfTest.java,v $ - * $Date: 2001/11/12 20:02:46 $ - * $Revision: 1.7 $ - * - ***************************************************************************************** - */ -package com.ibm.test.rbnf; - -import com.ibm.text.RuleBasedNumberFormat; -import com.ibm.test.TestFmwk; - -import java.util.Locale; -import java.text.NumberFormat; - -public class RbnfTest extends TestFmwk { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1999 IBM Corp. All rights reserved."; - - public static void main(String[] args) { - RbnfTest test = new RbnfTest(); - - try { - test.run(args); - } - catch (Throwable e) { - System.out.println("Entire test failed because of exception: " - + e.toString()); - e.printStackTrace(); - } - } - - public void TestUndefinedSpellout() { - Locale greek = new Locale("el", "", ""); - RuleBasedNumberFormat[] formatters = { - new RuleBasedNumberFormat(greek, RuleBasedNumberFormat.SPELLOUT), - new RuleBasedNumberFormat(greek, RuleBasedNumberFormat.ORDINAL), - new RuleBasedNumberFormat(greek, RuleBasedNumberFormat.DURATION), - }; - - String[] data = { - "0", - "1", - "15", - "20", - "23", - "73", - "88", - "100", - "106", - "127", - "200", - "579", - "1,000", - "2,000", - "3,004", - "4,567", - "15,943", - "105,000", - "2,345,678", - "-36", - "-36.91215", - "234.56789" - }; - - NumberFormat decFormat = NumberFormat.getInstance(Locale.US); - for (int j = 0; j < formatters.length; ++j) { - com.ibm.text.NumberFormat formatter = formatters[j]; - logln("formatter[" + j + "]"); - for (int i = 0; i < data.length; ++i) { - try { - String result = formatter.format(decFormat.parse(data[i])); - logln("[" + i + "] " + data[i] + " ==> " + result); - } - catch (Exception e) { - errln("formatter[" + j + "], data[" + i + "] " + data[i] + " threw exception " + e.getMessage()); - } - } - } - } - - /** - * Perform a simple spot check on the English spellout rules - */ - public void TestEnglishSpellout() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(Locale.US, - RuleBasedNumberFormat.SPELLOUT); - String[][] testData = { - { "1", "one" }, - { "15", "fifteen" }, - { "20", "twenty" }, - { "23", "twenty-three" }, - { "73", "seventy-three" }, - { "88", "eighty-eight" }, - { "100", "one hundred" }, - { "106", "one hundred and six" }, - { "127", "one hundred and twenty-seven" }, - { "200", "two hundred" }, - { "579", "five hundred and seventy-nine" }, - { "1,000", "one thousand" }, - { "2,000", "two thousand" }, - { "3,004", "three thousand and four" }, - { "4,567", "four thousand five hundred and sixty-seven" }, - { "15,943", "fifteen thousand nine hundred and forty-three" }, - { "2,345,678", "two million, three hundred and forty-five " - + "thousand, six hundred and seventy-eight" }, - { "-36", "minus thirty-six" }, - { "234.567", "two hundred and thirty-four point five six seven" } - }; - - doTest(formatter, testData, true); - - formatter.setLenientParseMode(true); - String[][] lpTestData = { - { "FOurhundred thiRTY six", "436" }, - // test spaces before fifty-7 causing lenient parse match of "fifty-" to " fifty" - // leaving "-7" for remaining parse, resulting in 2643 as the parse result. - { "fifty-7", "57" }, - { " fifty-7", "57" }, - { " fifty-7", "57" }, - { "2 thousand six HUNDRED fifty-7", "2,657" }, - { "fifteen hundred and zero", "1,500" } - }; - doLenientParseTest(formatter, lpTestData); - } - - /** - * Perform a simple spot check on the English ordinal-abbreviation rules - */ - public void TestOrdinalAbbreviations() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(Locale.US, - RuleBasedNumberFormat.ORDINAL); - String[][] testData = { - { "1", "1st" }, - { "2", "2nd" }, - { "3", "3rd" }, - { "4", "4th" }, - { "7", "7th" }, - { "10", "10th" }, - { "11", "11th" }, - { "13", "13th" }, - { "20", "20th" }, - { "21", "21st" }, - { "22", "22nd" }, - { "23", "23rd" }, - { "24", "24th" }, - { "33", "33rd" }, - { "102", "102nd" }, - { "312", "312th" }, - { "12,345", "12,345th" } - }; - - doTest(formatter, testData, false); - } - - /** - * Perform a simple spot check on the duration-formatting rules - */ - public void TestDurations() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(Locale.US, - RuleBasedNumberFormat.DURATION); - String[][] testData = { - { "3,600", "1:00:00" }, //move me and I fail - { "0", "0 sec." }, - { "1", "1 sec." }, - { "24", "24 sec." }, - { "60", "1:00" }, - { "73", "1:13" }, - { "145", "2:25" }, - { "666", "11:06" }, -// { "3,600", "1:00:00" }, - { "3,740", "1:02:20" }, - { "10,293", "2:51:33" } - }; - - doTest(formatter, testData, true); - - formatter.setLenientParseMode(true); - String[][] lpTestData = { - { "2-51-33", "10,293" } - }; - doLenientParseTest(formatter, lpTestData); - } - - /** - * Perform a simple spot check on the Spanish spellout rules - */ - public void TestSpanishSpellout() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(new Locale("es", "es", - ""), RuleBasedNumberFormat.SPELLOUT); - String[][] testData = { - { "1", "uno" }, - { "6", "seis" }, - { "16", "diecis\u00e9is" }, - { "20", "veinte" }, - { "24", "veinticuatro" }, - { "26", "veintis\u00e9is" }, - { "73", "setenta y tres" }, - { "88", "ochenta y ocho" }, - { "100", "cien" }, - { "106", "ciento seis" }, - { "127", "ciento veintisiete" }, - { "200", "doscientos" }, - { "579", "quinientos setenta y nueve" }, - { "1,000", "mil" }, - { "2,000", "dos mil" }, - { "3,004", "tres mil cuatro" }, - { "4,567", "cuatro mil quinientos sesenta y siete" }, - { "15,943", "quince mil novecientos cuarenta y tres" }, - { "2,345,678", "dos mill\u00f3n trescientos cuarenta y cinco mil " - + "seiscientos setenta y ocho"}, - { "-36", "menos treinta y seis" }, - { "234.567", "doscientos treinta y cuatro punto cinco seis siete" } - }; - - doTest(formatter, testData, true); - } - - /** - * Perform a simple spot check on the French spellout rules - */ - public void TestFrenchSpellout() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(Locale.FRANCE, - RuleBasedNumberFormat.SPELLOUT); - String[][] testData = { - { "1", "un" }, - { "15", "quinze" }, - { "20", "vingt" }, - { "21", "vingt-et-un" }, - { "23", "vingt-trois" }, - { "62", "soixante-deux" }, - { "70", "soixante-dix" }, - { "71", "soixante et onze" }, - { "73", "soixante-treize" }, - { "80", "quatre-vingts" }, - { "88", "quatre-vingt-huit" }, - { "100", "cent" }, - { "106", "cent six" }, - { "127", "cent vingt-sept" }, - { "200", "deux cents" }, - { "579", "cinq cents soixante-dix-neuf" }, - { "1,000", "mille" }, - { "1,123", "onze cents vingt-trois" }, - { "1,594", "mille cinq cents quatre-vingt-quatorze" }, - { "2,000", "deux mille" }, - { "3,004", "trois mille quatre" }, - { "4,567", "quatre mille cinq cents soixante-sept" }, - { "15,943", "quinze mille neuf cents quarante-trois" }, - { "2,345,678", "deux million trois cents quarante-cinq mille " - + "six cents soixante-dix-huit" }, - { "-36", "moins trente-six" }, - { "234.567", "deux cents trente-quatre virgule cinq six sept" } - }; - - doTest(formatter, testData, true); - - formatter.setLenientParseMode(true); - String[][] lpTestData = { - { "trente-un", "31" }, - { "un cents quatre vingt dix huit", "198" } - }; - doLenientParseTest(formatter, lpTestData); - } - - /** - * Perform a simple spot check on the Swiss French spellout rules - */ - public void TestSwissFrenchSpellout() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(new Locale("fr", "CH", - ""), RuleBasedNumberFormat.SPELLOUT); - String[][] testData = { - { "1", "un" }, - { "15", "quinze" }, - { "20", "vingt" }, - { "21", "vingt-et-un" }, - { "23", "vingt-trois" }, - { "62", "soixante-deux" }, - { "70", "septante" }, - { "71", "septante-et-un" }, - { "73", "septante-trois" }, - { "80", "octante" }, - { "88", "octante-huit" }, - { "100", "cent" }, - { "106", "cent six" }, - { "127", "cent vingt-sept" }, - { "200", "deux cents" }, - { "579", "cinq cents septante-neuf" }, - { "1,000", "mille" }, - { "1,123", "onze cents vingt-trois" }, - { "1,594", "mille cinq cents nonante-quatre" }, - { "2,000", "deux mille" }, - { "3,004", "trois mille quatre" }, - { "4,567", "quatre mille cinq cents soixante-sept" }, - { "15,943", "quinze mille neuf cents quarante-trois" }, - { "2,345,678", "deux million trois cents quarante-cinq mille " - + "six cents septante-huit" }, - { "-36", "moins trente-six" }, - { "234.567", "deux cents trente-quatre virgule cinq six sept" } - }; - - doTest(formatter, testData, true); - } - - /** - * Perform a simple spot check on the Italian spellout rules - */ - public void TestItalianSpellout() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(Locale.ITALIAN, - RuleBasedNumberFormat.SPELLOUT); - String[][] testData = { - { "1", "uno" }, - { "15", "quindici" }, - { "20", "venti" }, - { "23", "ventitre" }, - { "73", "settantatre" }, - { "88", "ottantotto" }, - { "100", "cento" }, - { "106", "centosei" }, - { "108", "centotto" }, - { "127", "centoventisette" }, - { "181", "centottantuno" }, - { "200", "duecento" }, - { "579", "cinquecentosettantanove" }, - { "1,000", "mille" }, - { "2,000", "duemila" }, - { "3,004", "tremilaquattro" }, - { "4,567", "quattromilacinquecentosessantasette" }, - { "15,943", "quindicimilanovecentoquarantatre" }, - { "-36", "meno trentisei" }, - { "234.567", "duecentotrentiquattro virgola cinque sei sette" } - }; - - doTest(formatter, testData, true); - } - - /** - * Perform a simple spot check on the German spellout rules - */ - public void TestGermanSpellout() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(Locale.GERMANY, - RuleBasedNumberFormat.SPELLOUT); - String[][] testData = { - { "1", "eins" }, - { "15", "f\u00fcnfzehn" }, - { "20", "zwanzig" }, - { "23", "dreiundzwanzig" }, - { "73", "dreiundsiebzig" }, - { "88", "achtundachtzig" }, - { "100", "hundert" }, - { "106", "hundertsechs" }, - { "127", "hundertsiebenundzwanzig" }, - { "200", "zweihundert" }, - { "579", "f\u00fcnfhundertneunundsiebzig" }, - { "1,000", "tausend" }, - { "2,000", "zweitausend" }, - { "3,004", "dreitausendvier" }, - { "4,567", "viertausendf\u00fcnfhundertsiebenundsechzig" }, - { "15,943", "f\u00fcnfzehntausendneunhundertdreiundvierzig" }, - { "2,345,678", "zwei Millionen dreihundertf\u00fcnfundvierzigtausend" - + "sechshundertachtundsiebzig" } - }; - - doTest(formatter, testData, true); - - formatter.setLenientParseMode(true); - String[][] lpTestData = { - { "ein Tausend sechs Hundert fuenfunddreissig", "1,635" } - }; - doLenientParseTest(formatter, lpTestData); - } - - /** - * Perform a simple spot check on the German spellout rules - */ - public void TestThaiSpellout() { - RuleBasedNumberFormat formatter - = new RuleBasedNumberFormat(new Locale("th", "TH", ""), - RuleBasedNumberFormat.SPELLOUT); - String[][] testData = { - { "0", "\u0e28\u0e39\u0e19\u0e22\u0e4c" }, - { "1", "\u0e2b\u0e19\u0e36\u0e48\u0e07" }, - { "10", "\u0e2a\u0e34\u0e1a" }, - { "11", "\u0e2a\u0e34\u0e1a\u0e40\u0e2d\u0e47\u0e14" }, - { "21", "\u0e22\u0e35\u0e48\u0e2a\u0e34\u0e1a\u0e40\u0e2d\u0e47\u0e14" }, - { "101", "\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e23\u0e49\u0e2d\u0e22\u0e2b\u0e19\u0e36\u0e48\u0e07" }, - { "1.234", "\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e08\u0e38\u0e14\u0e2a\u0e2d\u0e07\u0e2a\u0e32\u0e21\u0e2a\u0e35\u0e48" }, - }; - - doTest(formatter, testData, true); - - /* - formatter.setLenientParseMode(true); - String[][] lpTestData = { - { "ein Tausend sechs Hundert fuenfunddreissig", "1,635" } - }; - doLenientParseTest(formatter, lpTestData); - */ - } - - public void TestSwedishSpellout() - { - Locale locale = new Locale("sv", "", ""); - RuleBasedNumberFormat formatter = new RuleBasedNumberFormat(locale, RuleBasedNumberFormat.SPELLOUT); - - String[][] testDataDefault = { - { "101", "etthundra\u00aden" }, - { "123", "etthundra\u00adtjugotre" }, - { "1,001", "ettusen en" }, - { "1,100", "ettusen etthundra" }, - { "1,101", "ettusen etthundra\u00aden" }, - { "1,234", "ettusen tv\u00e5hundra\u00adtrettiofyra" }, - { "10,001", "tio\u00adtusen en" }, - { "11,000", "elva\u00adtusen" }, - { "12,000", "tolv\u00adtusen" }, - { "20,000", "tjugo\u00adtusen" }, - { "21,000", "tjugoen\u00adtusen" }, - { "21,001", "tjugoen\u00adtusen en" }, - { "200,000", "tv\u00e5hundra\u00adtusen" }, - { "201,000", "tv\u00e5hundra\u00aden\u00adtusen" }, - { "200,200", "tv\u00e5hundra\u00adtusen tv\u00e5hundra" }, - { "2,002,000", "tv\u00e5 miljoner tv\u00e5\u00adtusen" }, - { "12,345,678", "tolv miljoner trehundra\u00adfyrtiofem\u00adtusen sexhundra\u00adsjuttio\u00e5tta" }, - { "123,456.789", "etthundra\u00adtjugotre\u00adtusen fyrahundra\u00adfemtiosex komma sju \u00e5tta nio" }, - { "-12,345.678", "minus tolv\u00adtusen trehundra\u00adfyrtiofem komma sex sju \u00e5tta" } - }; - - logln("testing default rules"); - doTest(formatter, testDataDefault, true); - - String[][] testDataNeutrum = { - { "101", "etthundra\u00adett" }, - { "1,001", "ettusen ett" }, - { "1,101", "ettusen etthundra\u00adett" }, - { "10,001", "tio\u00adtusen ett" }, - { "21,001", "tjugoen\u00adtusen ett" } - }; - - formatter.setDefaultRuleSet("%neutrum"); - logln("testing neutrum rules"); - doTest(formatter, testDataNeutrum, true); - - String[][] testDataYear = { - { "101", "etthundra\u00adett" }, - { "900", "niohundra" }, - { "1,001", "tiohundra\u00adett" }, - { "1,100", "elvahundra" }, - { "1,101", "elvahundra\u00adett" }, - { "1,234", "tolvhundra\u00adtrettiofyra" }, - { "2,001", "tjugohundra\u00adett" }, - { "10,001", "tio\u00adtusen ett" } - }; - - formatter.setDefaultRuleSet("%year"); - logln("testing year rules"); - doTest(formatter, testDataYear, true); - } - - void doTest(RuleBasedNumberFormat formatter, String[][] testData, - boolean testParsing) { - NumberFormat decFmt = NumberFormat.getInstance(Locale.US); - - try { - for (int i = 0; i < testData.length; i++) { - String number = testData[i][0]; - String expectedWords = testData[i][1]; - String actualWords = formatter.format(decFmt.parse(number)); - - if (!actualWords.equals(expectedWords)) { - errln("Spot check failed: for " + number + ", expected " - + expectedWords + ", but got " + - actualWords); - } - else if (testParsing) { - String actualNumber = decFmt.format(formatter - .parse(actualWords)); - - if (!actualNumber.equals(number)) { - errln("Spot check failed: for " + actualWords + - ", expected " + number + ", but got " + - actualNumber); - } - } - } - } - catch (Throwable e) { - errln("Test failed with exception: " + e.toString()); - e.printStackTrace(); - } - } - - void doLenientParseTest(RuleBasedNumberFormat formatter, - String[][] testData) { - NumberFormat decFmt = NumberFormat.getInstance(Locale.US); - - try { - for (int i = 0; i < testData.length; i++) { - String words = testData[i][0]; - String expectedNumber = testData[i][1]; - String actualNumber = decFmt.format(formatter.parse(words)); - - if (!actualNumber.equals(expectedNumber)) { - errln("Lenient-parse spot check failed: for " - + words + ", expected " + expectedNumber - + ", but got " + actualNumber); - } - } - } - catch (Throwable e) { - errln("Test failed with exception: " + e.toString()); - e.printStackTrace(); - } - } -} - diff --git a/icu4j/src/com/ibm/test/rbnf/package.html b/icu4j/src/com/ibm/test/rbnf/package.html deleted file mode 100755 index d14dbbe137..0000000000 --- a/icu4j/src/com/ibm/test/rbnf/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Tests for the RuleBasedBreakIterator. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/richtext/FmwkTestTextPanel.java b/icu4j/src/com/ibm/test/richtext/FmwkTestTextPanel.java deleted file mode 100755 index 36e844fcb6..0000000000 --- a/icu4j/src/com/ibm/test/richtext/FmwkTestTextPanel.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * @(#)$RCSfile: FmwkTestTextPanel.java,v $ $Revision: 1.2 $ $Date: 2000/04/26 17:39:58 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -package com.ibm.test.richtext; - -import com.ibm.test.TestFmwk; -import com.ibm.richtext.tests.TestTextPanel; - -public final class FmwkTestTextPanel extends TestFmwk { - - public static void main(String[] args) throws Exception { - - new FmwkTestTextPanel().run(args); - } - - private TTP ttp; - - public FmwkTestTextPanel() { - - ttp = new TTP(); - } - - public void test() { - - ttp.test(); - // If TestTextPanel gets more tests, add them here - } - - private final class TTP extends TestTextPanel { - - protected void reportError(String message) { - - errln(message); - } - - protected void logMessage(String message) { - - logln(message); - } - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/richtext/TestAll.java b/icu4j/src/com/ibm/test/richtext/TestAll.java deleted file mode 100755 index c70c76fb16..0000000000 --- a/icu4j/src/com/ibm/test/richtext/TestAll.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * @(#)$RCSfile: TestAll.java,v $ $Revision: 1.2 $ $Date: 2000/04/24 21:11:30 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -package com.ibm.test.richtext; - -import com.ibm.test.TestFmwk; - -public class TestAll extends TestFmwk { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - - public static void main(String[] args) throws Exception { - new TestAll().run(args); - } - - public void TestAttributeSet() throws Exception { - run(new TestAttributeSet()); - } - - public void TestAttributeMap() throws Exception { - run(new TestAttributeMap()); - } - - public void TestFormatter() throws Exception { - run(new TestFormatter()); - } - - public void TestMText() throws Exception { - run(new TestMText()); - } - - public void TestParagraphStyles() throws Exception { - run(new TestParagraphStyles()); - } - - public void TestMTextStreaming() throws Exception { - run(new TestMTextStreaming()); - } - - public void TestTextPanel() throws Exception { - run(new FmwkTestTextPanel()); - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/richtext/TestAttributeMap.java b/icu4j/src/com/ibm/test/richtext/TestAttributeMap.java deleted file mode 100755 index 572661ea37..0000000000 --- a/icu4j/src/com/ibm/test/richtext/TestAttributeMap.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * @(#)$RCSfile: TestAttributeMap.java,v $ $Revision: 1.3 $ $Date: 2001/09/08 01:17:12 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -package com.ibm.test.richtext; - -import com.ibm.test.TestFmwk; - -import com.ibm.textlayout.attributes.AttributeSet; -import com.ibm.textlayout.attributes.TextAttribute; -import com.ibm.textlayout.attributes.Map; -import com.ibm.textlayout.attributes.AttributeMap; -import java.util.Enumeration; - -// Java2 imports -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; -import java.util.Map.Entry; - - -public class TestAttributeMap extends TestFmwk { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - - - // There are JDK 1.1 versions of AttributeMap and AttributeSet. - // Some of the tests in this class require Java 2 API's. I have - // tried to isolate these tests by conditionalizing them on - // this static variable. If you are back-porting to 1.1, remove - // the Java 2 tests ONLY. - private static final boolean gJDK11 = false; - - public static void main(String[] args) throws Exception { - - new TestAttributeMap().run(args); - } - - private AttributeSet maps; // A Set of AttributeMaps - private AttributeSet sets; // A Set of Sets - - private static final class TestAttribute extends TextAttribute { - - TestAttribute(String name) { - super(name); - } - } - - private static final TestAttribute[] attributes = { - new TestAttribute("0"), new TestAttribute("1"), new TestAttribute("2") - }; - - private static final Object[] values = { - "Hello world", new Float(-42), new Object(), new AttributeMap(new TestAttribute("3"), "HH") - }; - - /** - * Returns lhs.equals(rhs) - but also checks for symmetry, and - * consistency with hashCode(). - */ - private boolean equalMaps(AttributeMap lhs, Object rhs) { - - boolean equal = lhs.equals(rhs); - if (equal != (rhs.equals(lhs))) { - errln("AttributeMap.equals is not symetric"); - } - if (equal) { - if (lhs.hashCode() != rhs.hashCode()) { - errln("AttributeMaps are equal but hashCodes differ"); - } - } - return equal; - } - - public TestAttributeMap() { - - maps = AttributeSet.EMPTY_SET; - maps = maps.addElement(AttributeMap.EMPTY_ATTRIBUTE_MAP); - maps.addElement(new AttributeMap(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUB)); - maps.addElement(new AttributeMap(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUPER)); - - for (int i=0; i < attributes.length; i++) { - for (int j=0; j < values.length; j++) { - maps = maps.addElement(new AttributeMap(attributes[i], values[j])); - } - } - - AttributeMap bigMap = new AttributeMap(new TestAttribute("4"), "value"); - for (int i=0; i < Math.min(attributes.length, values.length); i++) { - bigMap = bigMap.addAttribute(attributes[i], values[values.length-i-1]); - } - maps = maps.addElement(bigMap); - - sets = AttributeSet.EMPTY_SET; - - sets = new AttributeSet(AttributeSet.EMPTY_SET); - - for (int i=0; i < attributes.length; i++) { - AttributeSet newSet = new AttributeSet(attributes[i]); - sets = sets.addElement(newSet); - } - - AttributeSet allAttrs = AttributeSet.EMPTY_SET; - for (int i=0; i < attributes.length; i++) { - allAttrs = allAttrs.addElement(attributes[i]); - } - - sets = sets.addElement(allAttrs); - } - - /** - * Run tests on AttributeMap. If a test fails an exception will propogate out - * of this method. - */ - public void test() { - - easyTests(); - - Enumeration mapIter = maps.elements(); - while (mapIter.hasMoreElements()) { - - AttributeMap testMap = (AttributeMap) mapIter.nextElement(); - - _testModifiers(testMap); - _testViews(testMap); - - Enumeration unionIter = maps.elements(); - while (unionIter.hasMoreElements()) { - _testUnionWith(testMap, (AttributeMap) unionIter.nextElement()); - } - - Enumeration setIter = sets.elements(); - while (setIter.hasMoreElements()) { - AttributeSet testSet = (AttributeSet) setIter.nextElement(); - _testIntersectWith(testMap, testSet); - _testRemoveAttributes(testMap, testSet); - } - } - } - - /** - * Invoke modifiers on map. All should throw - * UnsupportedOperationException, and leave map unmodified. - */ - void _testModifiers(AttributeMap map) { - - if (gJDK11) { - return; - } - - AttributeMap originalMap = new AttributeMap(map); - - try { - map.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD); - errln("Put should throw UnsupportedOperationException."); - } - catch(UnsupportedOperationException e) { - System.out.print(""); - } - - try { - Object key = TextAttribute.WEIGHT; - Iterator iter = map.keySet().iterator(); - if (iter.hasNext()) { - key = iter.next(); - } - map.remove(key); - errln("Set should throw UnsupportedOperationException."); - } - catch(UnsupportedOperationException e) { - System.out.print(""); - } - - try { - map.putAll(map); - errln("putAll should throw UnsupportedOperationException."); - } - catch(UnsupportedOperationException e) { - System.out.print(""); - } - - try { - map.clear(); - errln("clear should throw UnsupportedOperationException."); - } - catch(UnsupportedOperationException e) { - System.out.print(""); - } - - if (!originalMap.equals(map)) { - errln("Modifiers changed map."); - } - } - - /** - * Ensure that map.addAttributes(addMap) is equivalent to calling - * map.add on all of addMap's entries. - */ - void _testUnionWith(AttributeMap map, AttributeMap addMap) { - - AttributeMap lhs = map.addAttributes(addMap); - - AttributeMap rhs = map; - - Enumeration iter = addMap.getKeySet().elements(); - while (iter.hasMoreElements()) { - Object attr = iter.nextElement(); - Object value = addMap.get(attr); - rhs = rhs.addAttribute(attr, value); - } - - if (!equalMaps(lhs, rhs)) { - errln("Maps are not equal."); - } - } - - /** - * Ensure that map.removeAttributes(remove) is equivalent to calling - * map.removeAttribute on remove's elements. - */ - void _testRemoveAttributes(AttributeMap map, AttributeSet remove) { - - AttributeMap lhs = map.removeAttributes(remove); - - AttributeMap rhs = map; - - Enumeration iter = remove.elements(); - while (iter.hasMoreElements()) { - Object attr = iter.nextElement(); - rhs = rhs.removeAttribute(attr); - } - - if (!equalMaps(lhs, rhs)) { - errln("Maps are not equal."); - } - } - - /** - * Ensure that map.intersectWith(intersect) is equivalent to - * map.removeAttributes(map.keySet() - intersect); - */ - void _testIntersectWith(AttributeMap map, AttributeSet intersect) { - - AttributeMap lhs = map.intersectWith(intersect); - - AttributeSet keySet = map.getKeySet(); - AttributeSet removeSet = keySet.subtract(intersect); - AttributeMap rhs = map.removeAttributes(removeSet); - - if (!equalMaps(lhs, rhs)) { - map.intersectWith(intersect); - logln("intersect: " + intersect); - logln("keySet: " + keySet); - logln("removeSet: " + removeSet); - logln("map: " + map); - logln("lhs: " + lhs); - logln("rhs: " + rhs); - errln("Maps are not equal."); - } - } - - /** - * Ensure that: - * map, map.keySet(), and map.entrySet() are the same size; - * map.containsKey() is true for every key in keySet(); - * map.containsValue() is true for every value in values; - * every entry key is in keySet, every entry value is in map.values(); - * map.get() is consistent with entry's key, value; - * sum of hashcodes of entries equals map.hashCode(). - */ - void _testViews(AttributeMap map) { - - AttributeSet keySet = map.getKeySet(); - - Enumeration keyIter = keySet.elements(); - while (keyIter.hasMoreElements()) { - if (!map.containsKey(keyIter.nextElement())) { - errln("keySet contains key not in map"); - } - } - - if (gJDK11) { - return; - } - - Collection values = map.values(); - Set entrySet = map.entrySet(); - - if (keySet.size() != map.size() || entrySet.size() != map.size()) { - errln("Set sizes are inconsistent with map size."); - } - - int hashCode = 0; - - Iterator valueIter = values.iterator(); - while (valueIter.hasNext()) { - if (!map.containsValue(valueIter.next())) { - errln("value set contains value not in map"); - } - } - - Iterator entryIter = entrySet.iterator(); - while (entryIter.hasNext()) { - - Entry entry = (Entry) entryIter.next(); - - Object key = entry.getKey(); - if (!keySet.contains(key)) { - errln("Entry key is not in key set."); - } - - Object value = map.get(entry.getKey()); - if (!values.contains(value)) { - errln("Entry value is not in value set."); - } - - if (map.get(key) != value) { - errln("map.get did not return entry value."); - } - - hashCode += entry.hashCode(); - } - - if (hashCode != map.hashCode()) { - errln("map hashcode is not sum of entry hashcodes."); - } - } - - /** - * Look for correct behavior in obvious cases. - */ - void easyTests() { - - AttributeMap map = new AttributeMap(); - if (!map.equals(AttributeMap.EMPTY_ATTRIBUTE_MAP)) { - errln("Default-constructed map is not equal to empty map."); - } - - map = map.addAttribute(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE); - Object otherMap = new AttributeMap(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE); - if (!map.equals(otherMap)) { - errln("Maps are inconsistent after map.add"); - } - - otherMap = map.addAttributes(map); - if (!equalMaps(map,otherMap)) { - errln("Maps are inconsistent after addAttributes"); - } - - map = map.addAttribute(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON); - - if (map.size() != 2) { - errln("Map size is wrong. map="+map); - } - - if (equalMaps(map,otherMap)) { - errln("Maps should not be equal"); - } - - Object posture = new Float(0); - map = map.addAttribute(TextAttribute.POSTURE, posture); - - if (map.size() != 2) { - errln("Map size is wrong"); - } - - if (!map.get(TextAttribute.POSTURE).equals(posture)) { - errln("Map element is wrong"); - } - - map = map.removeAttribute(TextAttribute.UNDERLINE); - - if (map.size() != 1) { - errln("Map size is wrong"); - } - - if (map.get(TextAttribute.UNDERLINE) != null) { - errln("Map should not have element"); - } - - // map has POSTURE_REGULAR. If we addAttributes a map with - // POSTURE_ITALIC the new map should have POSTURE_ITALIC - - map = map.addAttributes(new AttributeMap(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE)); - if (map.get(TextAttribute.POSTURE) != TextAttribute.POSTURE_OBLIQUE) { - errln("Map element is wrong"); - } - - _testModifiers(map); - _testViews(map); - - Enumeration mapIter = maps.elements(); - while (mapIter.hasMoreElements()) { - AttributeMap testMap = (AttributeMap) mapIter.nextElement(); - Object newValue = new Object(); - AttributeMap newMap = testMap.addAttribute(attributes[0], newValue); - if (newMap.get(attributes[0]) != newValue) { - errln("Did not get expected value back. map=" + map); - } - } - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/richtext/TestAttributeSet.java b/icu4j/src/com/ibm/test/richtext/TestAttributeSet.java deleted file mode 100755 index fa9ed91799..0000000000 --- a/icu4j/src/com/ibm/test/richtext/TestAttributeSet.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * @(#)$RCSfile: TestAttributeSet.java,v $ $Revision: 1.2 $ $Date: 2000/04/24 20:52:58 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -package com.ibm.test.richtext; - -import com.ibm.test.TestFmwk; -import com.ibm.textlayout.attributes.AttributeSet; -import java.util.Enumeration; - -public class TestAttributeSet extends TestFmwk { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - - public static void main(String[] args) throws Exception { - - new TestAttributeSet().run(args); - } - - public void test() { - - final Object elem1 = new Object(); - final Object elem2 = new Float(4); - final Object elem3 = "String"; - final Object elem4 = Boolean.FALSE; - - AttributeSet set1 = new AttributeSet(new Object[] {elem1, elem2, elem3}); - if (set1.size() != 3) { - errln("Size is wrong."); - } - - if (set1.contains(elem4)){ - errln("Set contents are wrong."); - } - - if (!set1.contains(elem1)) { - errln("Set contents are wrong."); - } - - AttributeSet set2 = new AttributeSet(elem4); - - if (set2.size() != 1) { - errln("Size is wrong."); - } - - if (!set2.contains(elem4)){ - errln("Set contents are wrong."); - } - - if (set2.contains(elem1)) { - errln("Set contents are wrong."); - } - - Enumeration iter = set2.elements(); - if (!iter.nextElement().equals(elem4)) { - errln("Invalid object in iterator."); - } - - AttributeSet union = set2.unionWith(set1); - if (!set1.unionWith(set2).equals(union)) { - errln("unionWith is not commutative."); - } - - if (!union.contains(elem1) || !union.contains(elem4)) { - errln("Set contents are wrong."); - } - - if (!set1.addElement(elem4).equals(union)) { - errln("addElement is wrong."); - } - - if (!union.intersectWith(set1).equals(set1)) { - errln("intersectWith is wrong."); - } - - if (!union.subtract(set1).equals(set2)) { - errln("subtract is wrong."); - } - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/richtext/TestFormatter.java b/icu4j/src/com/ibm/test/richtext/TestFormatter.java deleted file mode 100755 index 9ba832488a..0000000000 --- a/icu4j/src/com/ibm/test/richtext/TestFormatter.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * @(#)$RCSfile: TestFormatter.java,v $ $Revision: 1.2 $ $Date: 2000/04/24 20:52:58 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -package com.ibm.test.richtext; - -import com.ibm.test.TestFmwk; - -import com.ibm.textlayout.attributes.AttributeMap; -import com.ibm.textlayout.attributes.TextAttribute; -import com.ibm.richtext.styledtext.MText; -import com.ibm.richtext.styledtext.MConstText; -import com.ibm.richtext.styledtext.StandardTabRuler; -import com.ibm.richtext.styledtext.StyledText; - -import com.ibm.richtext.textformat.TextOffset; -import com.ibm.richtext.textformat.MFormatter; - -import java.awt.Color; -import java.awt.Frame; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.Toolkit; -import java.awt.image.BufferedImage; - -import java.util.Hashtable; - -public final class TestFormatter extends TestFmwk { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - public static void main(String[] args) throws Exception { - - new TestFormatter().run(args); - } - - private static final Point ORIGIN = new Point(0, 0); - - private static final AttributeMap DEFAULTS; - static { - final Float floatZero = new Float(0.0f); - - Hashtable defaults = new Hashtable(); - defaults.put(TextAttribute.FAMILY, "Serif"); - defaults.put(TextAttribute.WEIGHT, new Float(1.0f)); - defaults.put(TextAttribute.POSTURE, floatZero); - defaults.put(TextAttribute.SIZE, new Float(18.0f)); - defaults.put(TextAttribute.SUPERSCRIPT, new Integer(0)); - defaults.put(TextAttribute.FOREGROUND, Color.black); - defaults.put(TextAttribute.UNDERLINE, new Integer(-1)); - defaults.put(TextAttribute.STRIKETHROUGH, Boolean.FALSE); - - defaults.put(TextAttribute.EXTRA_LINE_SPACING, floatZero); - defaults.put(TextAttribute.FIRST_LINE_INDENT, floatZero); - defaults.put(TextAttribute.MIN_LINE_SPACING, floatZero); - defaults.put(TextAttribute.LINE_FLUSH, TextAttribute.FLUSH_LEADING); - defaults.put(TextAttribute.LEADING_MARGIN, floatZero); - defaults.put(TextAttribute.TRAILING_MARGIN, floatZero); - defaults.put(TextAttribute.TAB_RULER, new StandardTabRuler()); - - DEFAULTS = new AttributeMap(defaults); - } - - // arg to testLineExceptions - private static final int UNKNOWN = -1; - - private Graphics fGraphics; - - public TestFormatter() { - - fGraphics = new BufferedImage(100, 100, BufferedImage.TYPE_3BYTE_BGR).getGraphics(); - - //JDK 1.1: - //Frame f = new Frame(); - //f.show(); - //fGraphics = f.getGraphics(); - } - - private String fiveLines = "a\nb\nc\nd\ne"; - private String twelveLines = fiveLines + "\n" + fiveLines + "\nf\n"; - AttributeMap PLAIN = AttributeMap.EMPTY_ATTRIBUTE_MAP; - - public void test() { - - MConstText text = new StyledText(fiveLines, PLAIN); - _testLineExceptions(makeFormatter(text, 100, true), 5); - _testLineAccess(makeFormatter(text, 100, true), 5); - - text = new StyledText(twelveLines, PLAIN); - _testLineExceptions(makeFormatter(text, 3, false), 12); - _testLineAccess(makeFormatter(text, 100, true), 12); - - _testWithModification(); - } - - private void _testWithModification() { - - MText text = new StyledText(fiveLines, PLAIN); - MFormatter formatter = makeFormatter(text, 100, true); - Rectangle viewRect = new Rectangle(0, 0, 100, Integer.MAX_VALUE); - - formatter.stopBackgroundFormatting(); - text.append(new StyledText("\n", PLAIN)); - formatter.updateFormat(text.length()-1, 1, viewRect, ORIGIN); - - _testLineAccess(formatter, 6); - - formatter.stopBackgroundFormatting(); - text.append(new StyledText("ad", PLAIN)); - formatter.updateFormat(text.length()-2, 2, viewRect, ORIGIN); - _testLineAccess(formatter, 6); - _testLineExceptions(formatter, 6); - - formatter.stopBackgroundFormatting(); - text.remove(0, 1); - formatter.updateFormat(0, 0, viewRect, ORIGIN); - _testLineAccess(formatter, 6); - _testLineExceptions(formatter, 6); - } - - - private MFormatter makeFormatter(MConstText text, - int lineBound, - boolean wrap) { - - return MFormatter.createFormatter(text, - DEFAULTS, - lineBound, - wrap, - fGraphics); - } - - private void _testLineExceptions(MFormatter formatter, - int numLines) { - - if (numLines == UNKNOWN) { - numLines = formatter.getLineCount(); - } - - boolean caught = false; - - try { - formatter.lineRangeLow(numLines); - } - catch(IllegalArgumentException e) { - caught = true; - } - - if (!caught) { - errln("Didn't get exception"); - } - caught = false; - - try { - formatter.lineRangeLimit(numLines); - } - catch(IllegalArgumentException e) { - caught = true; - } - - if (!caught) { - errln("Didn't get exception"); - } - caught = false; - - try { - formatter.lineGraphicStart(numLines+1); - } - catch(IllegalArgumentException e) { - caught = true; - } - - if (!caught) { - errln("Didn't get exception"); - } - caught = false; - } - - private void _testLineAccess(MFormatter formatter, - int numLines) { - - if (numLines == UNKNOWN) { - numLines = formatter.getLineCount(); - } - - if (formatter.lineGraphicStart(0) != 0) { - errln("Line 0 doesn't start at height 0"); - } - if (formatter.lineRangeLow(0) != 0) { - errln("Line 0 doesn't start at character 0"); - } - - int lastLimit = formatter.lineRangeLimit(0); - final int lineBound = formatter.lineBound(); - int[] hitX = new int[] { -1, 1, lineBound + 2 }; - - TextOffset offset = new TextOffset(); - - for (int i=1; i < numLines; i++) { - - int height = formatter.lineGraphicStart(i); - if (lastLimit != formatter.lineRangeLow(i)) { - errln("lastLine limit is not current line start"); - } - int limit = formatter.lineRangeLimit(i); - - if (limit < lastLimit || (limit == lastLimit && i != numLines-1)) { - errln("line has negative or 0 length"); - } - - int nextHeight = formatter.lineGraphicStart(i+1); - if (nextHeight <= height) { - errln("0-height line"); - } - int incAmount = Math.max((nextHeight-height)/4, 1); - for (int hitY = height; hitY < nextHeight; hitY += incAmount) { - - if (formatter.lineAtHeight(hitY) != i) { - errln("lineAtHeight is wrong"); - } - - for (int j=0; j < hitX.length; j++) { - offset = formatter.pointToTextOffset(offset, - hitX[j], hitY, ORIGIN, null, false); - if (offset.fOffset < lastLimit || offset.fOffset > limit) { - errln("Inconsistent offset from pointToTextOffset"); - } - //if (formatter.lineContaining(offset) != i) { - // int debug = formatter.lineContaining(offset); - // errln("lineContaining is incorrect"); - //} - } - } - - lastLimit = limit; - } - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/richtext/TestMText.java b/icu4j/src/com/ibm/test/richtext/TestMText.java deleted file mode 100755 index 83f5364472..0000000000 --- a/icu4j/src/com/ibm/test/richtext/TestMText.java +++ /dev/null @@ -1,721 +0,0 @@ -/* - * @(#)$RCSfile: TestMText.java,v $ $Revision: 1.3 $ $Date: 2000/04/26 17:39:58 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -package com.ibm.test.richtext; - -import com.ibm.test.TestFmwk; - -import com.ibm.textlayout.attributes.AttributeMap; -import com.ibm.textlayout.attributes.TextAttribute; - -import com.ibm.richtext.styledtext.MConstText; -import com.ibm.richtext.styledtext.MText; -import com.ibm.richtext.styledtext.StyledText; -import com.ibm.richtext.styledtext.StyleModifier; - -import java.text.CharacterIterator; -import java.util.Random; - -import java.io.*; - -public class TestMText extends TestFmwk { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - public static void main(String[] args) throws Exception { - - new TestMText().run(args); - } - - private static final int TEST_ITERATIONS = 5000; - private static final int STYLE_TEST_ITERATIONS = 5000; - private static final long RAND_SEED = 598436; - - private static final int NOT_IN_MONKEY_TEST = -5000; - private int testIteration = NOT_IN_MONKEY_TEST; - private int theCase = NOT_IN_MONKEY_TEST; - - private static StyleModifier createMinusModifier(final Object attr) { - return new StyleModifier() { - public AttributeMap modifyStyle(AttributeMap style) { - return style.removeAttribute(attr); - } - }; - } - - public void test() { - - simpleTest(); - styleTest(); - monkeyTest(true); - } - - public void simpleTest() { - - AttributeMap boldStyle = new AttributeMap(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD); - AttributeMap italicStyle = new AttributeMap(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE); - - MConstText allBold = new StyledText("bbbbb", boldStyle); - MConstText allItalic = new StyledText("iii", italicStyle); - MConstText plain = new StyledText("pppppp", AttributeMap.EMPTY_ATTRIBUTE_MAP); - - { - MText buf = new StyledText(); - int ts = buf.getTimeStamp(); - buf.append(allBold); - buf.append(allItalic); - - if (ts == buf.getTimeStamp()) { - errln("Time stamp not incremented"); - } - - // should be bbbbbiii now - - if (buf.length() != allBold.length() + allItalic.length()) { - errln("Length is wrong."); - } - - for (int i=0; i < buf.length(); i++) { - - char rightChar; - AttributeMap rightStyle; - - if (i < allBold.length()) { - rightChar = allBold.at(0); - rightStyle = boldStyle; - } - else { - rightChar = allItalic.at(0); - rightStyle = italicStyle; - } - - if (buf.at(i) != rightChar) { - errln("Character is wrong."); - } - if (!buf.characterStyleAt(i).equals(rightStyle)) { - errln("Style is wrong."); - } - } - - int pos = 0; - - if (!buf.characterStyleAt(pos).equals(boldStyle)) { - errln("First style is wrong."); - } - if (buf.characterStyleLimit(pos) != allBold.length()) { - errln("Run length is wrong."); - } - - pos = allBold.length(); - - if (!buf.characterStyleAt(pos).equals(italicStyle)) { - errln("Second style is wrong."); - } - if (buf.characterStyleLimit(pos) != buf.length()) { - errln("Run length is wrong."); - } - - { - buf.resetDamagedRange(); - int oldLength = buf.length(); - buf.replace(buf.length(), buf.length(), allBold, 0, allBold.length()); - // bbbbbiiibbbbb - - if (buf.damagedRangeStart() != oldLength) { - errln("Damaged range start is incorrect"); - } - if (buf.damagedRangeLimit() != buf.length()) { - errln("Damaged range limit is incorrect"); - } - } - - int start = allBold.length(); - int limit = start + allItalic.length(); - buf.remove(start, limit); - // bbbbbbbbbb - - if (buf.length() != 2 * allBold.length()) { - errln("Text should be twice the length of bold text."); - } - - pos = buf.length() / 2; - if (buf.characterStyleStart(pos) != 0 || - buf.characterStyleLimit(pos) != buf.length()) { - errln("Run range is wrong."); - } - if (!buf.characterStyleAt(pos).equals(boldStyle)) { - errln("Run style is wrong."); - } - - ts = buf.getTimeStamp(); - CharacterIterator cIter = buf.createCharacterIterator(); - for (char ch = cIter.first(); ch != cIter.DONE; ch = cIter.next()) { - if (ch != allBold.at(0)) { - errln("Character is wrong."); - } - } - - if (ts != buf.getTimeStamp()) { - errln("Time stamp should not have changed"); - } - - buf.replace(0, 1, plain, 0, plain.length()); - - if (ts == buf.getTimeStamp()) { - errln("Time stamp not incremented"); - } - - // ppppppbbbbbbbbb - buf.replace(plain.length(), buf.length(), allItalic, 0, allItalic.length()); - // ppppppiii - - if (buf.length() != allItalic.length()+plain.length()) { - errln("Length is wrong."); - } - - pos = 0; - if (buf.characterStyleLimit(pos) != plain.length()) { - errln("Run limit is wrong."); - } - - pos = plain.length(); - if (buf.characterStyleLimit(pos) != buf.length()) { - errln("Run limit is wrong."); - } - - buf.replace(plain.length(), plain.length(), allBold, 0, allBold.length()); - // ppppppbbbbbiii - - AttributeMap st = buf.characterStyleAt(1); - if (!st.equals(AttributeMap.EMPTY_ATTRIBUTE_MAP)) { - errln("Style is wrong."); - } - if (buf.characterStyleStart(1) != 0 || buf.characterStyleLimit(1) != plain.length()) { - errln("Style start is wrong."); - } - - st = buf.characterStyleAt(buf.length() - 1); - if (!st.equals(italicStyle)) { - errln("Style is wrong."); - } - if (buf.characterStyleStart(buf.length() - 1) != plain.length()+allBold.length()) { - errln("Style start is wrong."); - } - - if (buf.characterStyleLimit(buf.length() - 1) != buf.length()) { - errln("Style limit is wrong."); - } - } - } - - private static int randInt(Random rand, int limit) { - - return randInt(rand, 0, limit); - } - - private static int randInt(Random rand, int start, int limit) { - - if (start > limit) { - throw new IllegalArgumentException("Range length is negative."); - } - else if (start == limit) { - return start; - } - - return start + (Math.abs(rand.nextInt())%(limit-start)) ; - } - - public void styleTest() { - - MText text = new StyledText("0123456789", AttributeMap.EMPTY_ATTRIBUTE_MAP); - - AttributeMap[] styles = new AttributeMap[text.length()]; - for (int i=0; i < styles.length; i++) { - styles[i] = AttributeMap.EMPTY_ATTRIBUTE_MAP; - } - AttributeMap[] oldStyles = new AttributeMap[styles.length]; - System.arraycopy(styles, 0, oldStyles, 0, styles.length); - - AttributeMap bigStyle = new AttributeMap(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON). - addAttribute(TextAttribute.SIZE, new Float(23.0f)); - - StyleModifier[] modifiers = { - StyleModifier.createReplaceModifier(new AttributeMap(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD)), - StyleModifier.createAddModifier(new AttributeMap(TextAttribute.WEIGHT, new Float(1.0f))), - createMinusModifier(TextAttribute.WEIGHT), - - StyleModifier.createAddModifier(new AttributeMap(TextAttribute.POSTURE, new Float(0.0f))), - StyleModifier.createReplaceModifier(new AttributeMap(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE)), - createMinusModifier(TextAttribute.POSTURE), - - StyleModifier.createAddModifier(bigStyle), - StyleModifier.createReplaceModifier(bigStyle), - createMinusModifier(bigStyle.getKeySet()) - }; - - Random rand = new Random(RAND_SEED); - final int stopAt = 4; - - for (int testIteration=0; testIteration < STYLE_TEST_ITERATIONS + 1; testIteration++) { - - System.arraycopy(styles, 0, oldStyles, 0, styles.length); - - int startingAt = Integer.MAX_VALUE; - int endingAt = Integer.MIN_VALUE; - int oldTs = text.getTimeStamp(); - - // hack way to do an invariant check before starting... - if (testIteration != 0) { - // modify styles - text.resetDamagedRange(); - startingAt = randInt(rand, styles.length+1); - endingAt = randInt(rand, startingAt, styles.length+1); - StyleModifier modifier = modifiers[randInt(rand, modifiers.length)]; - - if (testIteration == stopAt) { - testIteration = stopAt; - } - text.modifyCharacterStyles(startingAt, endingAt, modifier); - - for (int j=startingAt; j < endingAt; j++) { - styles[j] = modifier.modifyStyle(styles[j]); - } - } - - // check invariants - AttributeMap oldStyle = null; - int textLength = text.length(); - for (int runStart = 0; runStart < textLength;) { - - AttributeMap currentStyle = text.characterStyleAt(runStart); - int runLimit = text.characterStyleLimit(runStart); - if (runStart >= runLimit) { - errln("Run length is not positive"); - } - if (currentStyle.equals(oldStyle)) { - errln("Styles didn't merge"); - } - - for (int pos=runStart; pos < runLimit; pos++) { - AttributeMap charStyleAtPos = text.characterStyleAt(pos); - if (currentStyle != charStyleAtPos) { - errln("Iterator style is not equal to text style at " + pos + "."); - } - AttributeMap expected = styles[pos]; - if (!currentStyle.equals(expected)) { - errln("Iterator style doesn't match expected style at " + pos + "."); - } - if (!(text.characterStyleStart(pos) == runStart) || - !(text.characterStyleLimit(pos) == runLimit)) { - errln("style run start / limit is not consistent"); - } - } - runStart = runLimit; - } - if (textLength > 0) { - if (text.characterStyleAt(textLength) != - text.characterStyleAt(textLength-1)) { - errln("Character styles at end aren't the same"); - } - } - - // check damaged range: - int damageStart = Integer.MAX_VALUE; - int damageLimit = Integer.MIN_VALUE; - for (int i=0; i < textLength; i++) { - if (!styles[i].equals(oldStyles[i])) { - damageStart = Math.min(i, damageStart); - damageLimit = Math.max(i+1, damageLimit); - } - } - if (damageStart != text.damagedRangeStart() || - damageLimit != text.damagedRangeLimit()) { - logln("Test iteration: " + testIteration); - logln("startingAt: " + startingAt + "; endingAt: " + endingAt); - logln("damageStart: " + damageStart + "; damageLimit: " + damageLimit); - logln("text.rangeStart: " + text.damagedRangeStart() + - "text.rangeLimit: " + text.damagedRangeLimit()); - errln("Damage range start or limit is not expected value"); - } - - if ((damageLimit == Integer.MIN_VALUE) != (oldTs == text.getTimeStamp())) { - - errln("timeStamp is incorrect"); - } - } - } - - public void err(String message) { - - if (testIteration != NOT_IN_MONKEY_TEST) { - message = "testIteration="+testIteration+"; testCase="+theCase+message; - } - super.err(message); - } - - /** - * Perform a random series of operations on an MText and - * check the result of each operation against a set of invariants. - */ - public void monkeyTest(boolean streaming) { - - /* - You can add any operation to the switch statement provided it - preserves the following invariants: - - The String plainText contains the same text as the StyledStringBuffer. - Obviously, for the test to be meaningful plainText must be computed - independently of the buffer (ie don't write: plainText = buf.getStyledString().toString()). - - Every 'b' is bold, every 'i' is italic, every 'p' is plain, and - no other characters appear in the text. - */ - - AttributeMap boldAttrs = new AttributeMap(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD); - AttributeMap italicAttrs = new AttributeMap(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE); - AttributeMap emptyAttrs = AttributeMap.EMPTY_ATTRIBUTE_MAP; - - final String bold1Str_getString = "b"; - MConstText bold1Str = new StyledText(bold1Str_getString, boldAttrs); - - final String italic1Str_getString = "i"; - MConstText italic1Str = new StyledText(italic1Str_getString, italicAttrs); - - final String plain1Str_getString = "p"; - MConstText plain1Str = new StyledText(plain1Str_getString, emptyAttrs); - - StyledText temp = new StyledText(); - temp.append(bold1Str); - temp.append(italic1Str); - final String boldItalicStr_getString = bold1Str_getString.concat(italic1Str_getString); - MConstText boldItalicStr = temp; - - temp = new StyledText(); - temp.append(bold1Str); - temp.append(bold1Str); - temp.append(bold1Str); - final String bold3Str_getString = "bbb"; - MConstText bold3Str = temp; - - MText buf = new StyledText(); - String plainText = new String(); - //int testIteration=0; - now instance variables so errln can report it - //int theCase=0; - - final int NUM_CASES = 14; - boolean[] casesExecuted = new boolean[NUM_CASES]; - final int stopAt = -1; - Random rand = new Random(RAND_SEED); - - final String ALWAYS_DIFFERENT = "\uFEFF"; - - for (testIteration=0; testIteration < TEST_ITERATIONS; testIteration++) { - - theCase = randInt(rand, NUM_CASES); - - casesExecuted[theCase] = true; - - if (testIteration == stopAt) { - testIteration = stopAt; // Convenient place to put breakpoint - } - - int timeStamp = buf.getTimeStamp(); - String oldPlainText = plainText; - if (oldPlainText == null) { - errln("oldPlainText is null!"); - } - - switch (theCase) { - - case 0: - // create new string; replace chars at start with different style - buf = new StyledText(); - buf.append(bold3Str); - buf.replace(0, 1, italic1Str, 0, italic1Str.length()); - buf.replace(0, 0, italic1Str, 0, italic1Str.length()); - - plainText = bold3Str_getString.substring(1, bold3Str.length()); - plainText = italic1Str_getString.concat(plainText); - plainText = italic1Str_getString.concat(plainText); - oldPlainText = null; - break; - - case 1: - // delete the last character from the string - if (buf.length() == 0) { - buf.replace(0, 0, italic1Str, 0, italic1Str.length()); - plainText = italic1Str_getString; - oldPlainText = ALWAYS_DIFFERENT; - } - buf.remove(buf.length()-1, buf.length()); - plainText = plainText.substring(0, plainText.length()-1); - break; - - case 2: - // replace some of the buffer with boldItalicStr - int rStart = randInt(rand, buf.length()+1); - int rStop = randInt(rand, rStart, buf.length()+1); - buf.replace(rStart, rStop, boldItalicStr); - { - String newString = (rStart>0)? plainText.substring(0, rStart) : new String(); - newString = newString.concat(boldItalicStr_getString); - if (rStop < plainText.length()) - newString = newString.concat(plainText.substring(rStop, plainText.length())); - oldPlainText = ALWAYS_DIFFERENT; - plainText = newString; - } - break; - - case 3: - // repeatedly insert strings into the center of the buffer - { - int insPos = buf.length() / 2; - String prefix = plainText.substring(0, insPos); - String suffix = plainText.substring(insPos, plainText.length()); - String middle = new String(); - for (int ii=0; ii<4; ii++) { - MConstText which = (ii%2==0)? boldItalicStr : bold3Str; - String whichString = (ii%2==0)? boldItalicStr_getString : bold3Str_getString; - int tempPos = insPos+middle.length(); - buf.insert(tempPos, which); - middle = middle.concat(whichString); - } - plainText = prefix.concat(middle).concat(suffix); - oldPlainText = ALWAYS_DIFFERENT; - } - break; - - case 4: - // insert bold1Str at end - buf.append(bold1Str); - plainText = plainText.concat(bold1Str_getString); - break; - - case 5: - // delete a character from the string - if (buf.length() > 0) { - int delPos = randInt(rand, buf.length()-1); - buf.remove(delPos, delPos+1); - plainText = plainText.substring(0, delPos).concat(plainText.substring(delPos+1)); - } - else { - buf.replace(0, 0, plain1Str, 0, plain1Str.length()); - plainText = plain1Str_getString; - } - break; - - case 6: - // replace the contents of the buffer (except the first character) with itself - { - int start = buf.length() > 1? 1 : 0; - buf.replace(start, buf.length(), buf); - plainText = plainText.substring(0, start).concat(plainText); - if (buf.length() > 0) { - oldPlainText = ALWAYS_DIFFERENT; - } - } - break; - - case 7: - // append the contents of the buffer to itself - { - MConstText content = buf; - buf.insert(buf.length(), content); - plainText = plainText.concat(plainText); - } - break; - - case 8: - // replace the buffer with boldItalicStr+bold3Str - { - MText replacement = new StyledText(); - replacement.append(boldItalicStr); - replacement.append(bold3Str); - buf.replace(0, buf.length(), replacement, 0, replacement.length()); - plainText = boldItalicStr_getString.concat(bold3Str_getString); - oldPlainText = ALWAYS_DIFFERENT; - } - break; - - case 9: - // insert bold1Str at end - same as 4 but uses different API - buf.replace(buf.length(), - buf.length(), - bold1Str_getString.toCharArray(), - 0, - bold1Str_getString.length(), - boldAttrs); - plainText = plainText.concat(bold1Str_getString); - break; - - case 10: - // remove all - buf.remove(); - plainText = ""; - oldPlainText = ALWAYS_DIFFERENT; - break; - - case 11: - // remove all - different way - buf.remove(0, buf.length()); - plainText = ""; - break; - - case 12: - // insert 'i' at 3rd character (or last, if fewer than 3 chars) - { - int insPos = Math.min(buf.length(), 3); - buf.replace(insPos, insPos, 'i', italicAttrs); - plainText = (plainText.substring(0, insPos)). - concat(italic1Str_getString). - concat(plainText.substring(insPos)); - } - break; - - case 13: - if (streaming) { - Throwable error = null; - try { - ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); - ObjectOutputStream objOut = new ObjectOutputStream(bytesOut); - objOut.writeObject(buf); - - ByteArrayInputStream bytesIn = - new ByteArrayInputStream(bytesOut.toByteArray()); - ObjectInputStream objIn = new ObjectInputStream(bytesIn); - buf = (MText) objIn.readObject(); - oldPlainText = null; - } - catch(IOException e) { - error = e; - } - catch(ClassNotFoundException e) { - error = e; - } - if (error != null) { - error.printStackTrace(); - errln("Streaming problem: " + error); - } - } - break; - - default: - errln("Invalid case."); - } - - // Check time stamp if oldPlainText != null. - // Time stamp should be different iff - // oldPlainText == plainText - if (oldPlainText != null) { - if ((timeStamp==buf.getTimeStamp()) != - oldPlainText.equals(plainText)) { - logln("plainText hashCode: " + plainText.hashCode()); - logln("oldPlainText hashCode: " + oldPlainText.hashCode()); - errln("Time stamp is incorrect"); - } - } - - // now check invariants: - if (plainText.length() != buf.length()) { - errln("Lengths don't match"); - } - - for (int j=0; j < buf.length(); j++) { - if (buf.at(j) != plainText.charAt(j)) { - errln("Characters don't match."); - } - } - - int start; - for (start = 0; start < buf.length();) { - - if (start != buf.characterStyleStart(start)) { - errln("style start is wrong"); - } - int limit = buf.characterStyleLimit(start); - if (start >= limit) { - errln("start >= limit"); - } - char current = plainText.charAt(start); - - AttributeMap comp = null; - if (current == 'p') { - comp = emptyAttrs; - } - else if (current == 'b') { - comp = boldAttrs; - } - else if (current == 'i') { - comp = italicAttrs; - } - else { - errln("An invalid character snuck in!"); - } - - AttributeMap startStyle = buf.characterStyleAt(start); - if (!comp.equals(startStyle)) { - errln("Style is not expected style."); - } - - for (int j = start; j < limit; j++) { - if (plainText.charAt(j) != current) { - errln("Character doesn't match style."); - } - if (buf.characterStyleAt(j) != startStyle) { - errln("Incorrect style in run"); - } - } - - if (limit < buf.length()) { - if (plainText.charAt(limit) == current) { - errln("Style run ends too soon."); - } - } - start = limit; - } - if (start != buf.length()) { - errln("Last limit is not buffer length."); - } - - // won't try to compute and check damaged range; however, - // if nonempty it should always be within text - int damageStart = buf.damagedRangeStart(); - int damageLimit = buf.damagedRangeLimit(); - if (damageStart == Integer.MAX_VALUE) { - if (damageLimit != Integer.MIN_VALUE) { - errln("Invalid empty interval"); - } - } - else { - if (damageStart > damageLimit) { - errln("Damage range inverted"); - } - if (damageStart < 0 || damageLimit > buf.length()) { - errln("Damage range endpoint out of bounds"); - } - } - } - - testIteration = NOT_IN_MONKEY_TEST; - - boolean allCasesExecuted = true; - for (int index=0; index < NUM_CASES; index++) { - allCasesExecuted &= casesExecuted[index]; - if (casesExecuted[index] == false) { - logln("Case " + index + " not executed."); - } - } - //if (allCasesExecuted) { - // logln("All cases executed."); - //} - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/richtext/TestMTextStreaming.java b/icu4j/src/com/ibm/test/richtext/TestMTextStreaming.java deleted file mode 100755 index 52083462da..0000000000 --- a/icu4j/src/com/ibm/test/richtext/TestMTextStreaming.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * @(#)$RCSfile: TestMTextStreaming.java,v $ $Revision: 1.2 $ $Date: 2000/04/24 20:52:58 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -package com.ibm.test.richtext; - -import com.ibm.test.TestFmwk; - -import java.io.*; -import java.awt.Color; - -import com.ibm.richtext.styledtext.MText; -import com.ibm.richtext.styledtext.StandardTabRuler; -import com.ibm.richtext.styledtext.StyledText; -import com.ibm.richtext.styledtext.StyleModifier; - -import com.ibm.textlayout.attributes.AttributeMap; -import com.ibm.textlayout.attributes.TextAttribute; - -public class TestMTextStreaming extends TestFmwk { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - - public static void main(String[] args) throws Exception { - - new TestMTextStreaming().run(args); - } - - public TestMTextStreaming() { - } - - public void test() { - - simpleTest(); - allAttributesTest(); - } - - private void simpleTest() { - - AttributeMap style = AttributeMap.EMPTY_ATTRIBUTE_MAP; - MText text = new StyledText("Hello world!", style); - - streamAndCompare(text); - } - - private static class TestModifier extends StyleModifier { - - private Object fKey; - private Object fValue; - - public AttributeMap modifyStyle(AttributeMap style) { - - return style.addAttribute(fKey, fValue); - } - - TestModifier(Object key, Object value) { - - fKey = key; - fValue = value; - } - } - - private void allAttributesTest() { - - AttributeMap style = AttributeMap.EMPTY_ATTRIBUTE_MAP; - MText text = new StyledText("Hello world!", style); - - int length = text.length(); - - final boolean CHARACTER = true; - final boolean PARAGRAPH = false; - - addStyle(text, 0, length/2, TextAttribute.FAMILY, "Times", CHARACTER); - addStyle(text, length/2, length, TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD, CHARACTER); - addStyle(text, 0, length/2, TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE, CHARACTER); - addStyle(text, 0, length/2, TextAttribute.SIZE, new Float(13.7f), CHARACTER); - addStyle(text, length/2, length, TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUB, CHARACTER); - addStyle(text, 0, length/2, TextAttribute.FOREGROUND, Color.blue, CHARACTER); - addStyle(text, 0, length/2, TextAttribute.BACKGROUND, Color.red, CHARACTER); - addStyle(text, 0, length-1, TextAttribute.STRIKETHROUGH, Boolean.TRUE, CHARACTER); - - addStyle(text, 0, length, TextAttribute.EXTRA_LINE_SPACING, new Float(4), PARAGRAPH); - addStyle(text, 0, length, TextAttribute.FIRST_LINE_INDENT, new Float(6), PARAGRAPH); - addStyle(text, 0, length, TextAttribute.MIN_LINE_SPACING, new Float(7), PARAGRAPH); - addStyle(text, 0, length, TextAttribute.LINE_FLUSH, TextAttribute.FLUSH_TRAILING, PARAGRAPH); - addStyle(text, 0, length, TextAttribute.LEADING_MARGIN, new Float(9), PARAGRAPH); - addStyle(text, 0, length, TextAttribute.TRAILING_MARGIN, new Float(9), PARAGRAPH); - addStyle(text, 0, length, TextAttribute.TAB_RULER, new StandardTabRuler(), PARAGRAPH); - - streamAndCompare(text); - } - - private static void addStyle(MText text, - int start, - int limit, - Object key, - Object value, - boolean character) { - - StyleModifier modifier = new TestModifier(key, value); - - if (character) { - text.modifyCharacterStyles(start, limit, modifier); - } - else { - text.modifyParagraphStyles(start, limit, modifier); - } - } - - public void streamAndCompare(MText text) { - - Throwable error = null; - - try { - ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); - ObjectOutputStream objOut = new ObjectOutputStream(bytesOut); - objOut.writeObject(text); - - ByteArrayInputStream bytesIn = - new ByteArrayInputStream(bytesOut.toByteArray()); - ObjectInputStream objIn = new ObjectInputStream(bytesIn); - MText streamedText = (MText) objIn.readObject(); - if (!isEqual(text, streamedText)) { - isEqual(text, streamedText); - errln("Streamed text is not equal"); - } - } -/* catch(OptionalDataException e) { - error = e; - } - catch(StreamCorruptedException e) { - error = e; - }*/ - catch(IOException e) { - error = e; - } - catch(ClassNotFoundException e) { - error = e; - } - - if (error != null) { - error.printStackTrace(); - errln("Serialization failed."); - } - } - - public static boolean isEqual(MText lhs, MText rhs) { - - return lhs.equals(rhs); - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/richtext/TestParagraphStyles.java b/icu4j/src/com/ibm/test/richtext/TestParagraphStyles.java deleted file mode 100755 index 3f12b05be6..0000000000 --- a/icu4j/src/com/ibm/test/richtext/TestParagraphStyles.java +++ /dev/null @@ -1,339 +0,0 @@ -/* - * @(#)$RCSfile: TestParagraphStyles.java,v $ $Revision: 1.2 $ $Date: 2000/04/24 20:52:58 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -package com.ibm.test.richtext; - -import com.ibm.test.TestFmwk; - -import com.ibm.richtext.styledtext.StyledText; -import com.ibm.richtext.styledtext.MConstText; -import com.ibm.richtext.styledtext.MText; -import com.ibm.textlayout.attributes.AttributeMap; -import com.ibm.richtext.styledtext.StyleModifier; -import java.util.Random; - -public final class TestParagraphStyles extends TestFmwk { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - - public static void main(String[] args) throws Exception { - - new TestParagraphStyles().run(args); - } - - private static final int RAND_SEED = 1234; - private static final int NUM_TESTS = 2500; - - private static final boolean isParagraphBreak(char c) { - - return c =='\u2029' || c == '\n'; - } - - private static final Object KEY = "KEY"; - private static final AttributeMap PLAIN = AttributeMap.EMPTY_ATTRIBUTE_MAP; - private static final AttributeMap A_STYLE = new AttributeMap(KEY, new Character('a')); - private static final StyleModifier A_MOD = - StyleModifier.createReplaceModifier(A_STYLE); - private static final AttributeMap B_STYLE = new AttributeMap(KEY, new Character('b')); - private static final StyleModifier B_MOD = - StyleModifier.createReplaceModifier(B_STYLE); - private static final AttributeMap C_STYLE = new AttributeMap(KEY, new Character('c')); - private static final StyleModifier C_MOD = - StyleModifier.createReplaceModifier(C_STYLE); - private static final AttributeMap D_STYLE = new AttributeMap(KEY, new Character('d')); - private static final StyleModifier D_MOD = - StyleModifier.createReplaceModifier(D_STYLE); - private static final AttributeMap E_STYLE = new AttributeMap(KEY, new Character('e')); - private static final StyleModifier E_MOD = - StyleModifier.createReplaceModifier(E_STYLE); - - public void test() { - - easyTests(); - randomTest(); - } - - private void easyTests() { - - MText text = new StyledText("a\nb\nc\nd\n", PLAIN); - text.modifyParagraphStyles(0, text.length(), A_MOD); - verifyParagraphCount(text); - - MText src = new StyledText("XXX\nYYY", PLAIN); - src.modifyParagraphStyles(0, src.length(), B_MOD); - verifyParagraphCount(src); - - MText temp = text.extractWritable(0, text.length()); - temp.append(src); - verifyParagraphCount(temp); - for (int i=0; i < text.length(); i++) { - if (!temp.paragraphStyleAt(i).equals(text.paragraphStyleAt(i))) { - errln("Paragraph styles are wrong"); - } - } - for (int i=0; i < src.length(); i++) { - if (!temp.paragraphStyleAt(i+text.length()).equals(src.paragraphStyleAt(i))) { - errln("Paragraph styles are wrong"); - } - } - - temp = text.extractWritable(0, text.length()); - temp.replace(0, 1, src, 0, src.length()); - verifyParagraphCount(temp); - if (temp.paragraphLimit(0) != 4) { - errln("Paragraph limit is wrong"); - } - if (!temp.paragraphStyleAt(0).equals(B_STYLE)) { - errln("First style is wrong"); - } - if (!temp.paragraphStyleAt(4).equals(A_STYLE)) { - errln("Style after insert is wrong"); - } - - // test append - MConstText newSrc = src.extract(4, 7); - MText initC = new StyledText("cccccc", PLAIN); - initC.modifyParagraphStyles(0, initC.length(), C_MOD); - initC.append(newSrc); - // now initC should be one paragraph with style B - if (initC.paragraphLimit(0) != initC.length()) { - errln("Should only be one paragraph"); - } - if (initC.paragraphStyleAt(0) != initC.paragraphStyleAt(initC.length())) { - errln("Two different paragraph styles"); - } - if (!initC.paragraphStyleAt(initC.length()/2).equals(B_STYLE)) { - errln("Incorrect paragraph style"); - } - - text = new StyledText("aaa\n", PLAIN); - text.modifyParagraphStyles(0, text.length(), A_MOD); - text.modifyParagraphStyles(text.length(), text.length(), B_MOD); - if (text.paragraphStyleAt(text.length()) != B_STYLE) { - errln("0-length paragraph at end has incorrect style"); - } - } - - private static int randInt(Random rand, int limit) { - - return randInt(rand, 0, limit); - } - - private static int randInt(Random rand, int start, int limit) { - - if (start > limit) { - throw new IllegalArgumentException("Range is 0-length."); - } - else if (start == limit) { - return start; - } - - return start + (Math.abs(rand.nextInt())%(limit-start)) ; - } - - private void randomTest() { - - MText noParagraph = new StyledText("zzzz", PLAIN); - noParagraph.modifyParagraphStyles(0, noParagraph.length(), A_MOD); - MText twoParagraphs = new StyledText("aaa\nbbb", PLAIN); - twoParagraphs.modifyParagraphStyles(0, twoParagraphs.paragraphLimit(0), B_MOD); - MText threeParagraphs = new StyledText("cc\ndd\nee", PLAIN); - threeParagraphs.modifyParagraphStyles(0, 3, C_MOD); - threeParagraphs.modifyParagraphStyles(3, 6, D_MOD); - threeParagraphs.modifyParagraphStyles(6, 8, E_MOD); - MText trailingP1 = new StyledText("hhhh\n", PLAIN); - trailingP1.modifyParagraphStyles(0, trailingP1.paragraphLimit(0), C_MOD); - MText trailingP2 = new StyledText("iii\n", PLAIN); - trailingP2.modifyParagraphStyles(0, 0, D_MOD); - trailingP2.modifyParagraphStyles(trailingP2.length(), trailingP2.length(), B_MOD); - - if (!trailingP2.paragraphStyleAt(trailingP2.length()-1).equals(D_STYLE)) { - errln("Style incorrect in trailingP2"); - } - if (!trailingP2.paragraphStyleAt(trailingP2.length()).equals(B_STYLE)) { - errln("Ending style incorrect in trailingP2"); - } - - MConstText[] tests = { noParagraph, twoParagraphs, - threeParagraphs, trailingP1, trailingP2 }; - - Random random = new Random(RAND_SEED); - - int stopAt = 465; - int i = 0; - try { - for (i=0; i < NUM_TESTS; i++) { - - int srcIndex = randInt(random, tests.length); - int targetIndex = randInt(random, tests.length); - MText target = new StyledText(tests[targetIndex]); - MConstText src = tests[srcIndex]; - - int srcStart = randInt(random, src.length()); - int srcLimit = randInt(random, srcStart, src.length()); - int start = randInt(random, target.length()); - int limit = randInt(random, start, target.length()); - - if (i == stopAt) { - stopAt = i; - } - - insertAndCheck(src, srcStart, srcLimit, target, start, limit); - } - } - finally { - if (i < NUM_TESTS) { - logln("iteration=" + i); - } - } - } - - private void insertAndCheck(MConstText src, int srcStart, int srcLimit, - MText target, int start, int limit) { - - // p-style after insertion - AttributeMap after; - if (limit == target.length() && srcLimit > srcStart) { - after = src.paragraphStyleAt(srcLimit); - } - else { - after = target.paragraphStyleAt(limit); - } - - AttributeMap before; - boolean srcHasPBreak = false; - for (int i=srcStart; i < srcLimit; i++) { - if (isParagraphBreak(src.at(i))) { - srcHasPBreak = true; - break; - } - } - - if (start > 0 && isParagraphBreak(target.at(start-1))) { - before = target.paragraphStyleAt(start-1); - } - else { - before = srcHasPBreak? src.paragraphStyleAt(srcStart) : after; - } - boolean stylePropogated = !before.equals(target.paragraphStyleAt(Math.max(0, start-1))); - - - target.resetDamagedRange(); - target.replace(start, limit, src, srcStart, srcLimit); - final int damageLimit = (start==limit && srcStart==srcLimit)? - Integer.MIN_VALUE : start + (srcLimit-srcStart); - - if (target.damagedRangeLimit() != damageLimit) { - logln("limit: " + damageLimit + "; target.limit: " + - target.damagedRangeLimit()); - errln("Damaged range limit is incorrect"); - } - - final int damageStart = (damageLimit==Integer.MIN_VALUE)? Integer.MAX_VALUE : - (stylePropogated? target.paragraphStart(Math.max(0, start-1)) : start); - if (target.damagedRangeStart() > damageStart) { - logln("start: " + damageStart + "; target.start: " + - target.damagedRangeStart()); - errln("Damaged range start is incorrect"); - } - - verifyParagraphCount(target); - - // check endpoints - if (!before.equals(target.paragraphStyleAt(Math.max(start-1, 0)))) { - errln("Incorrect paragraph style before modified range"); - } - - int lengthDelta = (srcLimit-srcStart) - (limit-start); - int indexAfterInsert = Math.min(target.length(), limit + lengthDelta); - if (!after.equals(target.paragraphStyleAt(indexAfterInsert))) { - errln("Incorrect paragraph style after modified range"); - } - - if (srcHasPBreak) { - int startP = target.paragraphLimit(start); - int limitOfTest = target.paragraphStart(indexAfterInsert); - - int offset = start - srcStart; - - while (startP < limitOfTest) { - int limitP = target.paragraphLimit(startP); - if (src.paragraphLimit(startP-offset) + offset != limitP) { - errln("paragraph limits are not consistent"); - } - if (!src.paragraphStyleAt(startP-offset) - .equals(target.paragraphStyleAt(startP))) { - errln("paragraph styles are not consistent"); - } - startP = limitP; - } - } - else { - for (int i=start; i < start+(srcLimit-srcStart); i++) { - if (!after.equals(target.paragraphStyleAt(i))) { - errln("paragraph style changed unexpectedly"); - } - } - } - } - - private void verifyParagraphCount(MConstText text) { - - int pCount = 0; - int textLength = text.length(); - - if (textLength == 0) { - pCount = 1; - } - else { - for (int s=0; s < textLength; s = text.paragraphLimit(s)) { - pCount++; - } - if (isParagraphBreak(text.at(textLength-1))) { - pCount++; - } - } - - int sepCount = 0; - for (int i=0; i < textLength; i++) { - if (isParagraphBreak(text.at(i))) { - sepCount++; - } - } - - if (sepCount + 1 != pCount) { - logln("sepCount=" + sepCount + "; pCount=" + pCount); - errln("Paragraph count is not consistent with characters"); - } - } - - private void checkEndpoint(MConstText text) { - - boolean emptyFinalParagraph; - int length = text.length(); - - if (length != 0) { - char ch = text.at(length-1); - emptyFinalParagraph = isParagraphBreak(ch); - } - else { - emptyFinalParagraph = true; - } - - if ((text.paragraphStart(length) == length) != emptyFinalParagraph) { - errln("Final paragraph length is incorrect"); - } - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/search/SearchTest.java b/icu4j/src/com/ibm/test/search/SearchTest.java deleted file mode 100755 index c988c13437..0000000000 --- a/icu4j/src/com/ibm/test/search/SearchTest.java +++ /dev/null @@ -1,592 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/search/Attic/SearchTest.java,v $ - * $Date: 2001/12/03 21:48:03 $ - * $Revision: 1.11 $ - * - ***************************************************************************************** - */ -package com.ibm.test.search; - -import java.text.*; -import java.util.*; - -//import com.ibm.text.*; -import com.ibm.text.SearchIterator; -import com.ibm.text.StringSearch; - -/** - * Unit and regression tests for the StringSearch and SearchIterator classes. - * This uses IntlTest as a framework for running the tests - * and displaying the output. Basically, any method here that starts with - * Test is run as a test. - */ -public class SearchTest extends com.ibm.test.TestFmwk { - public static void main(String[] args) throws Exception { - new SearchTest().run(args); - } - - //----------------------------------------------------------- - // Static data: collators and break iterators to use for testing - // - static RuleBasedCollator enColl; // Generic English collator - static RuleBasedCollator frColl; // French accent rules - static RuleBasedCollator esColl; // Has Spanish contracting "ch" - static RuleBasedCollator deColl; // Has expansions, e.g. a-umlaut -> ae - - static { - try { - enColl = (RuleBasedCollator)Collator.getInstance(Locale.US); - frColl = (RuleBasedCollator)Collator.getInstance(Locale.FRANCE); - - esColl = new RuleBasedCollator(enColl.getRules() + " & C < ch ; cH ; Ch ; CH"); - - deColl = new RuleBasedCollator(enColl.getRules() + " & ae ; \u00e4 & AE ; \u00c4" - + " & oe ; \u00f6 & OE ; \u00d6" - + " & ue ; \u00fc & UE ; \u00dc"); - } - catch (ParseException e) { - System.out.print(""); - } - } - - static BreakIterator enWord = BreakIterator.getWordInstance(Locale.US); - - static String testString = - "blackbirds Pat p\u00E9ch\u00E9 " + - "p\u00EAche p\u00E9cher p\u00EAcher " + - "Tod T\u00F6ne black Tofu blackbirds " + - "Ton PAT toehold " + - "blackbird " + - "black-bird pat " + - "toe big Toe"; - - //------------------------------------------------------------------------- - // The primary test consists of running through all of the strings in this - // table and making sure we find the proper matches - // - static class TestCase { - TestCase(RuleBasedCollator c, int strength, BreakIterator breaker, - String pattern, String target, int[] matches) { - this.collator = c; - this.strength = strength; - this.breaker = breaker; - this.pattern = pattern; - this.target = target; - this.matches = matches; - } - RuleBasedCollator collator; - int strength; - BreakIterator breaker; - String pattern; - String target; - int[] matches; - }; - static TestCase[] testCases = { - new TestCase(enColl, Collator.PRIMARY, null, "fox", - // 012345678901234567890123456789012345678901234567890123456789 - "The quick brown fox jumps over the lazy foxes", - new int[] { 16, 40 } - ), - - new TestCase(enColl, Collator.PRIMARY, enWord, "fox", - // 012345678901234567890123456789012345678901234567890123456789 - "The quick brown fox jumps over the lazy foxes", - new int[] { 16 } - ), - - new TestCase(frColl, Collator.PRIMARY, null, "peche", - testString, - new int[] { 15, 21, 27, 34 } - ), - new TestCase(frColl, Collator.PRIMARY, enWord, "blackbird", - testString, - new int[] { 88, 98 } - ), - - // NOTE: this case depends on a bug fix in JDK 1.2.2 ("Cricket") - new TestCase(deColl, Collator.PRIMARY, null, "toe", - // 012345678901234567890123456789012345678901234567890123456789 - "This is a toe T\u00F6ne", - new int[] { 10, 14 } - ), - - /* Due to a bug in the JDK 1.2 FCS version of CollationElementIterator, - * searching through text containing contracting character sequences - * isn't working properly right now. This will probably be fixed in - * JDK 1.3 ("Kestrel"). When it is, uncomment these test cases. - * - new TestCase(esColl, Collator.PRIMARY, enWord, "channel", - // 0123456789012345678901234567890123456789012345678901234567890123456789 - "A channel, another CHANNEL, more Channels, and one last channel...", - new int[] { } - ), - - new TestCase(esColl, Collator.TERTIARY, enWord, "Channel", - // 0123456789012345678901234567890123456789012345678901234567890123456789 - "Channel, another channel, more channels, and one last Channel", - new int[] { } - ), - */ - - }; - - /** - * Test using the test cases defined above - */ - public void TestCases() { - for (int t = 0; t < testCases.length; t++) - { - logln("case " + t); - TestCase c = testCases[t]; - StringSearch iter = new StringSearch(c.pattern, - new StringCharacterIterator(c.target), - c.collator, c.breaker); - iter.setStrength(c.strength); - doTestCase(iter, c.matches); - } - } - - /** - * Test for SearchIterator.setOverlapping() - */ - public void TestOverlapping() { - // Create a search iterator. - StringSearch iter = new StringSearch("abab", - new StringCharacterIterator("abababab"), - enColl, null); - - int[] overlap = new int[] { 0, 2, 4 }; // expected results - int[] novrlap = new int[] { 0, 4 }; - - - doTestCase(iter, overlap); // Overlapping is allowed by default - if (iter.isOverlapping() != true) { - errln("ERROR: isOverlapping returned " + iter.isOverlapping()); - } - - iter.setOverlapping(false); // Turn 'em back off - doTestCase(iter, novrlap); - if (iter.isOverlapping() != false) { - errln("ERROR: isOverlapping returned " + iter.isOverlapping()); - } - - iter.setOverlapping(true); - doTestCase(iter, overlap); - if (iter.isOverlapping() != true) { - errln("ERROR: isOverlapping returned " + iter.isOverlapping()); - } - } - - /** - * Test for SearchIterator.setBreakIterator - */ - public void TestBreakIterator() { - StringSearch iter = new StringSearch("fox", - new StringCharacterIterator("foxy fox"), - enColl, null); - - BreakIterator charBreaker = BreakIterator.getCharacterInstance(Locale.US); - BreakIterator wordBreaker = BreakIterator.getWordInstance(Locale.US); - - int[] chars = new int[] { 0, 5 }; // expected results - int[] words = new int[] { 5 }; - - logln("default break iterator..."); - doTestCase(iter, chars); // character breaker by default - - logln("word break iterator..."); - iter.setBreakIterator(wordBreaker); // word break detection - doTestCase(iter, words); - if (iter.getBreakIterator() != wordBreaker) { - errln("ERROR: getBreakIterator returned wrong object"); - } - - logln("char break iterator..."); - iter.setBreakIterator(charBreaker); // char break detection - doTestCase(iter, chars); - if (iter.getBreakIterator() != charBreaker) { - errln("ERROR: getBreakIterator returned wrong object"); - } - - logln("null break iterator..."); - iter.setBreakIterator(null); - doTestCase(iter, chars); - if (iter.getBreakIterator() != null) { - errln("ERROR: getBreakIterator returned wrong object"); - } - } - - /** - * Test for SearchIterator.setTarget - */ - public void TestSetTarget() { - String pat = "fox"; - String targ1 = "the foxy brown fox"; - String targ2 = "the quick brown fox"; - - int[] match1 = new int[] { 4, 15 }; // expected results - int[] match2 = new int[] { 16 }; - - StringSearch iter = new StringSearch(pat, new StringCharacterIterator(targ1), - enColl, null); - - logln("initial text..."); - doTestCase(iter, match1); - assertEqual(iter.getTarget(), targ1); - - logln("target #2..."); - iter.setTarget(new StringCharacterIterator(targ2)); - doTestCase(iter, match2); - assertEqual(iter.getTarget(), targ2); - - logln("back to target #1..."); - iter.setTarget(new StringCharacterIterator(targ1)); - doTestCase(iter, match1); - assertEqual(iter.getTarget(), targ1); - } - - /** - * Test for StringSearch.setStrength - */ - public void TestSetStrength() { - String pat = "fox"; - String targ = "the foxy brown Fox"; - - // not used int[] match1 = new int[] { 4, 15 }; // expected results - int[] match3 = new int[] { 4 }; - - StringSearch iter = new StringSearch(pat, new StringCharacterIterator(targ), - enColl, null); - - /* logln("Trying primary strength..."); - iter.setStrength(Collator.PRIMARY); - doTestCase(iter, match1); - if (iter.getStrength() != Collator.PRIMARY) { - errln("ERROR: getStrength: expected PRIMARY, got " + iter.getStrength()); - } */ - - logln("Trying tertiary strength..."); - iter.setStrength(Collator.TERTIARY); - doTestCase(iter, match3); - if (iter.getStrength() != Collator.TERTIARY) { - errln("ERROR: getStrength: expected PRIMARY, got " + iter.getStrength()); - } - - } - - /** - * Test for StringSearch.setCollator - */ - public void TestSetCollator() throws ParseException { - // Create a test collator that thinks "o" and "p" are the same thing - RuleBasedCollator testColl = new RuleBasedCollator(enColl.getRules() - + "& o,O ; p,P" ); - - String pat = "fox"; - String targ = "fox fpx "; - - int[] match1 = new int[] { 0 }; // English results - int[] match2 = new int[] { 0, 4 }; // Test collator results - - StringSearch iter = new StringSearch(pat, new StringCharacterIterator(targ), - enColl, null); - - logln("Trying English collator..."); - - iter.setStrength(Collator.PRIMARY); - doTestCase(iter, match1); - if (iter.getCollator() != enColl) { - errln("ERROR: getCollator returned wrong collator"); - } - - logln("Trying test collator..."); - - iter.setCollator(testColl); - iter.setStrength(Collator.PRIMARY); - doTestCase(iter, match2); - if (iter.getCollator() != testColl) { - errln("ERROR: getCollator returned wrong collator"); - } - - logln("Trying English collator again..."); - - iter.setCollator(enColl); - iter.setStrength(Collator.PRIMARY); - doTestCase(iter, match1); - if (iter.getCollator() != enColl) { - errln("ERROR: getCollator returned wrong collator"); - } - - } - - /** - * Test for StringSearch.setPattern - */ - public void TestSetPattern() { - // 01234567890123456789012345678901234567890123456789 - String target = "The quick brown fox jumps over the lazy foxes"; - String pat1 = "the"; - String pat2 = "fox"; - - int[] match1 = new int[] { 0, 31 }; - int[] match2 = new int[] { 16, 40 }; - - StringSearch iter = new StringSearch(pat1, new StringCharacterIterator(target), - enColl, null); - iter.setStrength(Collator.PRIMARY); - - doTestCase(iter, match1); - if (!iter.getPattern().equals(pat1)) { - errln("getPattern returned '" + iter.getPattern() + "', expected '" - + pat1 + "'"); - } - - iter.setPattern(pat2); - doTestCase(iter, match2); - if (!iter.getPattern().equals(pat2)) { - errln("getPattern returned '" + iter.getPattern() + "', expected '" - + pat1 + "'"); - } - - iter.setPattern(pat1); - doTestCase(iter, match1); - if (!iter.getPattern().equals(pat1)) { - errln("getPattern returned '" + iter.getPattern() + "', expected '" - + pat1 + "'"); - } - } - - /** - * Test for an infinite loop that happened when the target text started - * with an ignorable character. - * Reported by Muly Oved, - */ - public void TestIgnorableLoop() { - String pattern = "go"; - String target = " on"; - - StringSearch search; - - try { - search=new StringSearch(pattern, new StringCharacterIterator(target), enColl); - - logln("searching... "+pattern); - search.first(); - logln("Will never go here if searching for 'go'"); - } catch (Exception e) { - errln("Caught exception: " + e.toString()); - } - - logln("end"); - } - - /** - * Tests jitterbug #11 - */ - public void TestJitterBug11() - { - String pattern = "c"; - String text = "Scott Ganyo"; - StringSearch ss = new StringSearch(pattern, text); - ss.setStrength(Collator.PRIMARY); - if (ss.next() != 1) { - errln("Error finding character c at index 1 in \"Scott Ganyo\""); - } - - /* empty pattern not handled yet - pattern = " "; - ss.setPattern(pattern); - ss.setStrength(Collator.PRIMARY); - if (ss.next() != 5) { - errln("Error finding character ' ' at index 1 in \"Scott Ganyo\""); - } - */ - } - - /** - * Tests jitterbug #35 - */ - public void TestJitterBug35() - { - String pattern = "dss"; - String strings[] = {"", "", - "", "", - "", "", - "", "", - "", " ", - "A A=\".dss\"", "<A A=\".dss\">"}; - int result[] = {12, SearchIterator.DONE, 7, 7, 8, 6, 7, 9, 8, 8, 6, - 10}; - - StringSearch ss = new StringSearch( pattern, "empty" ); - for ( int i = 0; i < strings.length; i++ ) - { - StringCharacterIterator source = - new StringCharacterIterator(strings[i]); - ss.setTarget(source); - int offset = ss.first(); - if ( offset != result[i] ) { - errln("Error finding pattern \"" + pattern + - "\" match in text \"" + strings[i] + "\""); - } - } - } - - public void TestJitterBug1513() - { - String contents ="\n\nExternal Ano\n" + - "\n\nHello world.\n\n\n" + - "\n" - + "\n" - + "\n" - + "\n" + - "\n\n
CarsColorsInteriors
2\nDoorRedLeather
4\nDoorBlueCloth
ConvertibleBlackVinyl
\n\nRemove This text.\n" + - "\n\n\n\n" + - "\n" + - "\n" + - "\n" + - "
WarrantyLengthRestrictions
Silver2\nYearsYes
Gold5\nYearsNo
\n\n\n\n\n\n\n\n\n\n\n/B>\n" + - "\n" + - "\n" - + "\n" - + "\n" - + "" + - "\n
CarsColorsInteriors
2\nDoorRedLeather
4\nDoorBlueCloth
ConvertibleBlackVinyl
\n\nRemove This text.\n\n\n" - + "\n\n" + - "" + - "\n\n"; - String pattern = "HE"; - int offset[] = {8, 44}; - - logln("Searching for all occurrences of pattern " + - pattern + " following contents:\n" + contents); - - StringSearch searcher = new StringSearch(pattern, contents); - int textoffset = searcher.next(); - int count = 0; - - while (textoffset != SearchIterator.DONE && count < offset.length) { - if (textoffset != offset[count]) { - errln( "Found match not found at offset " + offset[count]); - } - count ++; - textoffset = searcher.next(); - } - if (textoffset != SearchIterator.DONE || count != offset.length) { - errln("End of pattern " + pattern + " search encountering problems"); - } - } - - //------------------------------------------------------------------------- - // Various internal utility methods.... - //------------------------------------------------------------------------- - - void assertEqual(CharacterIterator i1, String s2) { - CharacterIterator i2 = new StringCharacterIterator(s2); - char c1 = i1.first(); - char c2 = i2.first(); - int i = 0; - - while (c1 == c2 && c1 != CharacterIterator.DONE) { - c1 = i1.next(); - c2 = i2.next(); - } - if (c1 != CharacterIterator.DONE || c2 != CharacterIterator.DONE) { - errln("CharacterIterator mismatch at index " + i); - } - } - - void doTestCase(StringSearch iter, int[] expected) { - // - // The basic logic here is as follows... We construct a search - // iterator and use it to find all of the matches in the target - // text. Then we compare it to the expected matches - // - Vector matches = new Vector(); - - for (int i = iter.first(); i != SearchIterator.DONE; i = iter.next()) { - matches.addElement(new Integer(i)); - } - compareMatches(expected, matches); - - // Now do the same exact thing as above, but in reverse - logln("Now searching in reverse..."); - matches.removeAllElements(); - for (int i = iter.last(); i != SearchIterator.DONE; i = iter.previous()) { - matches.insertElementAt(new Integer(i), 0); - } - compareMatches(expected, matches); - } - - /** - * Utility function used by TestCases to compare the matches that - * were found against the ones that were expected - */ - void compareMatches(int[] expected, Vector found) { - // Step through the two arrays in parallel and make sure that they're - // the same - - int e=0, f=0; - - while (e < expected.length && f < found.size()) { - int eVal = expected[e]; - int fVal = ((Integer)found.elementAt(f)).intValue(); - - if (eVal < fVal) { - errln("Missed expected match at " + eVal); - e++; - } else if (eVal > fVal) { - errln("Found unexpected match at " + fVal); - f++; - } else { - e++; - f++; - } - } - while (e < expected.length) { - errln("Missed expected match at " + expected[e]); - e++; - } - while (f < found.size()) { - int fVal = ((Integer)found.elementAt(f)).intValue(); - errln("Found unexpected match at " + fVal); - f++; - } - } - - /** - * ICU4J Jitterbug 11 - */ - /* - Bug to be solved in later release. - Commented away for successful testing. - TODO. - public void TestJ11() { - AuxJ11("c", "Scott Ganyo", 1); - AuxJ11(" ", "Scott Ganyo", 5); - } - */ - - private void AuxJ11(String pattern, String text, int expectedLoc) { - try { - StringSearch ss = new StringSearch(pattern, text); - ss.setStrength(Collator.PRIMARY); - int loc = ss.next(); - if (loc == expectedLoc) { - logln("Ok: StringSearch(\"" + pattern + "\", \"" + text + "\") = " + loc); - } else { - errln("FAIL: StringSearch(\"" + pattern + "\", \"" + text + "\") = " + loc + - ", expected " + expectedLoc); - } - } catch (Exception e) { - errln("FAIL: StringSearch(\"" + pattern + "\", \"" + text + "\") threw "); - e.printStackTrace(); - } - } -} diff --git a/icu4j/src/com/ibm/test/search/package.html b/icu4j/src/com/ibm/test/search/package.html deleted file mode 100755 index 180e57942a..0000000000 --- a/icu4j/src/com/ibm/test/search/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Tests for the international search classes. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/timezone/TimeZoneBoundaryTest.java b/icu4j/src/com/ibm/test/timezone/TimeZoneBoundaryTest.java deleted file mode 100755 index cc378d9d88..0000000000 --- a/icu4j/src/com/ibm/test/timezone/TimeZoneBoundaryTest.java +++ /dev/null @@ -1,707 +0,0 @@ -/* - @test 1.9 99/06/15 - @summary test Time Zone Boundary -*/ - -package com.ibm.test.timezone; -import com.ibm.text.*; -import com.ibm.util.*; -import com.ibm.test.*; -import java.util.Date; - -/** - * A test which discovers the boundaries of DST programmatically and verifies - * that they are correct. - */ -public class TimeZoneBoundaryTest extends TestFmwk -{ - static final int ONE_SECOND = 1000; - static final int ONE_MINUTE = 60*ONE_SECOND; - static final int ONE_HOUR = 60*ONE_MINUTE; - static final long ONE_DAY = 24*ONE_HOUR; - static final long ONE_YEAR = (long)(365.25 * ONE_DAY); - static final long SIX_MONTHS = ONE_YEAR / 2; - - static final int MONTH_LENGTH[] = {31,29,31,30,31,30,31,31,30,31,30,31}; - - // These values are empirically determined to be correct - static final long PST_1997_BEG = 860320800000L; - static final long PST_1997_END = 877856400000L; - - // Minimum interval for binary searches in ms; should be no larger - // than 1000. - static final long INTERVAL = 10; // Milliseconds - - // [3Jan01 Liu] Updated for 2000f data - static final String AUSTRALIA = "Australia/Adelaide"; - static final long AUSTRALIA_1997_BEG = 877797000000L; - static final long AUSTRALIA_1997_END = 859653000000L; - - public static void main(String[] args) throws Exception { - new TimeZoneBoundaryTest().run(args); - } - - /** - * Date.toString().substring() Boundary Test - * Look for a DST changeover to occur within 6 months of the given Date. - * The initial Date.toString() should yield a string containing the - * startMode as a SUBSTRING. The boundary will be tested to be - * at the expectedBoundary value. - */ - void findDaylightBoundaryUsingDate(Date d, String startMode, long expectedBoundary) - { - // Given a date with a year start, find the Daylight onset - // and end. The given date should be 1/1/xx in some year. - - if (d.toString().indexOf(startMode) == -1) - { - logln("Error: " + startMode + " not present in " + d); - } - - // Use a binary search, assuming that we have a Standard - // time at the midpoint. - long min = d.getTime(); - long max = min + SIX_MONTHS; - - while ((max - min) > INTERVAL) - { - long mid = (min + max) >> 1; - String s = new Date(mid).toString(); - // logln(s); - if (s.indexOf(startMode) != -1) - { - min = mid; - } - else - { - max = mid; - } - } - - logln("Date Before: " + showDate(min)); - logln("Date After: " + showDate(max)); - long mindelta = expectedBoundary - min; - // not used long maxdelta = max - expectedBoundary; - if (mindelta >= 0 && mindelta <= INTERVAL && - mindelta >= 0 && mindelta <= INTERVAL) - logln("PASS: Expected boundary at " + expectedBoundary); - else - errln("FAIL: Expected boundary at " + expectedBoundary); - } - - // This test cannot be compiled until the inDaylightTime() method of GregorianCalendar - // becomes public. - // static void findDaylightBoundaryUsingCalendar(Date d, boolean startsInDST) - // { - // // Given a date with a year start, find the Daylight onset - // // and end. The given date should be 1/1/xx in some year. - // - // GregorianCalendar cal = new GregorianCalendar(); - // cal.setTime(d); - // if (cal.inDaylightTime() != startsInDST) - // { - // logln("Error: inDaylightTime(" + d + ") != " + startsInDST); - // } - // - // // Use a binary search, assuming that we have a Standard - // // time at the midpoint. - // long min = d.getTime(); - // long max = min + (long)(365.25 / 2 * 24*60*60*1000); - // - // while ((max - min) > INTERVAL) - // { - // long mid = (min + max) >> 1; - // cal.setTime(new Date(mid)); - // if (cal.inDaylightTime() == startsInDST) - // { - // min = mid; - // } - // else - // { - // max = mid; - // } - // } - // - // logln("Calendar Before: " + showDate(min)); - // logln("Calendar After: " + showDate(max)); - // } - - void findDaylightBoundaryUsingTimeZone(Date d, boolean startsInDST, long expectedBoundary) - { - findDaylightBoundaryUsingTimeZone(d, startsInDST, expectedBoundary, - TimeZone.getDefault()); - } - - void findDaylightBoundaryUsingTimeZone(Date d, boolean startsInDST, - long expectedBoundary, TimeZone tz) - { - // Given a date with a year start, find the Daylight onset - // and end. The given date should be 1/1/xx in some year. - - // Use a binary search, assuming that we have a Standard - // time at the midpoint. - long min = d.getTime(); - long max = min + SIX_MONTHS; - - if (tz.inDaylightTime(d) != startsInDST) - { - errln("FAIL: " + tz.getID() + " inDaylightTime(" + - d + ") != " + startsInDST); - startsInDST = !startsInDST; // Flip over; find the apparent value - } - - if (tz.inDaylightTime(new Date(max)) == startsInDST) - { - errln("FAIL: " + tz.getID() + " inDaylightTime(" + - (new Date(max)) + ") != " + (!startsInDST)); - return; - } - - while ((max - min) > INTERVAL) - { - long mid = (min + max) >> 1; - boolean isIn = tz.inDaylightTime(new Date(mid)); - if (isIn == startsInDST) - { - min = mid; - } - else - { - max = mid; - } - } - - logln(tz.getID() + " Before: " + showDate(min, tz)); - logln(tz.getID() + " After: " + showDate(max, tz)); - - long mindelta = expectedBoundary - min; - // not used long maxdelta = max - expectedBoundary; - DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); - fmt.setTimeZone(tz); - if (mindelta >= 0 && mindelta <= INTERVAL && - mindelta >= 0 && mindelta <= INTERVAL) - logln("PASS: Expected boundary at " + expectedBoundary + " = " + fmt.format(new Date(expectedBoundary))); - else - errln("FAIL: Expected boundary at " + expectedBoundary + " = " + fmt.format(new Date(expectedBoundary))); - } - - private static String showDate(long l) - { - return showDate(new Date(l)); - } - - private static String showDate(Date d) - { - java.util.Calendar cal = java.util.Calendar.getInstance(); - cal.setTime(d); - return "" + (cal.get(Calendar.YEAR) - 1900) + "/" + - showNN(cal.get(Calendar.MONTH) + 1) + "/" + - showNN(cal.get(Calendar.DAY_OF_MONTH)) + " " + - showNN(cal.get(Calendar.HOUR_OF_DAY)) + ":" - + showNN(cal.get(Calendar.MINUTE)) + " \"" + d + "\" = " + - d.getTime(); - } - - private static String showDate(long l, TimeZone z) - { - return showDate(new Date(l), z); - } - - private static String showDate(Date d, TimeZone zone) - { - DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); - fmt.setTimeZone(zone); - java.util.Calendar cal = java.util.Calendar.getInstance(); - cal.setTime(d); - return "" + (cal.get(Calendar.YEAR) - 1900) + "/" + - showNN(cal.get(Calendar.MONTH) + 1) + "/" + - showNN(cal.get(Calendar.DAY_OF_MONTH)) + " " + - showNN(cal.get(Calendar.HOUR_OF_DAY)) + ":" + - showNN(cal.get(Calendar.MINUTE)) + " \"" + d + "\" = " + - fmt.format(d) + " = " + d.getTime(); - } - - private static String showNN(int n) - { - return ((n < 10) ? "0" : "") + n; - } - - /** - * Given a date, a TimeZone, and expected values for inDaylightTime, - * useDaylightTime, zone and DST offset, verify that this is the case. - */ - void verifyDST(Date d, TimeZone time_zone, - boolean expUseDaylightTime, boolean expInDaylightTime, - int expZoneOffset, int expDSTOffset) - { - logln("-- Verifying time " + d + - " in zone " + time_zone.getID()); - - if (time_zone.inDaylightTime(d) == expInDaylightTime) - logln("PASS: inDaylightTime = " + time_zone.inDaylightTime(d)); - else - errln("FAIL: inDaylightTime = " + time_zone.inDaylightTime(d)); - - if (time_zone.useDaylightTime() == expUseDaylightTime) - logln("PASS: useDaylightTime = " + time_zone.useDaylightTime()); - else - errln("FAIL: useDaylightTime = " + time_zone.useDaylightTime()); - - if (time_zone.getRawOffset() == expZoneOffset) - logln("PASS: getRawOffset() = " + expZoneOffset/(double)ONE_HOUR); - else - errln("FAIL: getRawOffset() = " + time_zone.getRawOffset()/(double)ONE_HOUR + - "; expected " + expZoneOffset/(double)ONE_HOUR); - - GregorianCalendar gc = new GregorianCalendar(time_zone); - gc.setTime(d); - int offset = time_zone.getOffset(gc.get(gc.ERA), gc.get(gc.YEAR), gc.get(gc.MONTH), - gc.get(gc.DAY_OF_MONTH), gc.get(gc.DAY_OF_WEEK), - ((gc.get(gc.HOUR_OF_DAY) * 60 + - gc.get(gc.MINUTE)) * 60 + - gc.get(gc.SECOND)) * 1000 + - gc.get(gc.MILLISECOND)); - if (offset == expDSTOffset) - logln("PASS: getOffset() = " + offset/(double)ONE_HOUR); - else - errln("FAIL: getOffset() = " + offset/(double)ONE_HOUR + - "; expected " + expDSTOffset/(double)ONE_HOUR); - } - - public void TestBoundaries() - { - TimeZone pst = TimeZone.getTimeZone("PST"); - TimeZone save = TimeZone.getDefault(); - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - try { - TimeZone.setDefault(pst); - - // DST changeover for PST is 4/6/1997 at 2 hours past midnight - tempcal.set(1997, Calendar.APRIL, 6); - Date d = tempcal.getTime(); - - // i is minutes past midnight standard time - for (int i=60; i<=180; i+=15) - { - boolean inDST = (i >= 120); - Date e = tempcal.getTime(); - e.setTime(d.getTime() + i*60*1000); - verifyDST(e, pst, true, inDST, -8*ONE_HOUR, - inDST ? -7*ONE_HOUR : -8*ONE_HOUR); - } - } finally { - TimeZone.setDefault(save); - } - - if (true) - { - // This only works in PST/PDT - TimeZone.setDefault(TimeZone.getTimeZone("PST")); - logln("========================================"); - tempcal.set(1997, 0, 1); - findDaylightBoundaryUsingDate(tempcal.getTime(), "PST", PST_1997_BEG); - logln("========================================"); - tempcal.set(1997, 6, 1); - findDaylightBoundaryUsingDate(tempcal.getTime(), "PDT", PST_1997_END); - } - - // if (true) - // { - // logln("========================================"); - // findDaylightBoundaryUsingCalendar(new Date(97,0,1), false); - // logln("========================================"); - // findDaylightBoundaryUsingCalendar(new Date(97,6,1), true); - // } - - if (true) - { - // Southern hemisphere test - logln("========================================"); - TimeZone z = TimeZone.getTimeZone(AUSTRALIA); - tempcal.set(1997, 0, 1); - findDaylightBoundaryUsingTimeZone(tempcal.getTime(), true, AUSTRALIA_1997_END, z); - logln("========================================"); - tempcal.set(1997, 6, 1); - findDaylightBoundaryUsingTimeZone(tempcal.getTime(), false, AUSTRALIA_1997_BEG, z); - } - - if (true) - { - logln("========================================"); - tempcal.set(1997, 0, 1); - findDaylightBoundaryUsingTimeZone(tempcal.getTime(), false, PST_1997_BEG); - logln("========================================"); - tempcal.set(1997, 6, 1); - findDaylightBoundaryUsingTimeZone(tempcal.getTime(), true, PST_1997_END); - } - - // This just shows the offset for April 4-7 in 1997. This is redundant - // with a test above, so we disable it. - if (false) - { - TimeZone z = TimeZone.getDefault(); - tempcal.set(1997, 3, 4); - logln(z.getOffset(1, 97, 3, 4, 6, 0) + " " + tempcal.getTime()); - tempcal.set(1997, 3, 5); - logln(z.getOffset(1, 97, 3, 5, 7, 0) + " " + tempcal.getTime()); - tempcal.set(1997, 3, 6); - logln(z.getOffset(1, 97, 3, 6, 1, 0) + " " + tempcal.getTime()); - tempcal.set(1997, 3, 7); - logln(z.getOffset(1, 97, 3, 7, 2, 0) + " " + tempcal.getTime()); - } - } - - - //---------------------------------------------------------------------- - // Can't do any of these without a public inDaylightTime in GC - //---------------------------------------------------------------------- - - - // static GregorianCalendar cal = new GregorianCalendar(); - // - // static void _testUsingBinarySearch(Date d, boolean startsInDST) - // { - // // Given a date with a year start, find the Daylight onset - // // and end. The given date should be 1/1/xx in some year. - // - // // Use a binary search, assuming that we have a Standard - // // time at the midpoint. - // long min = d.getTime(); - // long max = min + (long)(365.25 / 2 * ONE_DAY); - // - // // First check the max - // cal.setTime(new Date(max)); - // if (cal.inDaylightTime() == startsInDST) - // { - // logln("Error: inDaylightTime(" + (new Date(max)) + ") != " + (!startsInDST)); - // } - // - // cal.setTime(d); - // if (cal.inDaylightTime() != startsInDST) - // { - // logln("Error: inDaylightTime(" + d + ") != " + startsInDST); - // } - // - // while ((max - min) > INTERVAL) - // { - // long mid = (min + max) >> 1; - // cal.setTime(new Date(mid)); - // if (cal.inDaylightTime() == startsInDST) - // { - // min = mid; - // } - // else - // { - // max = mid; - // } - // } - // - // logln("Binary Search Before: " + showDate(min)); - // logln("Binary Search After: " + showDate(max)); - // } - // - // static void _testUsingMillis(Date d, boolean startsInDST) - // { - // long millis = d.getTime(); - // long max = millis + (long)(370 * ONE_DAY); // A year plus extra - // - // boolean lastDST = startsInDST; - // while (millis < max) - // { - // cal.setTime(new Date(millis)); - // boolean inDaylight = cal.inDaylightTime(); - // - // if (inDaylight != lastDST) - // { - // logln("Switch " + (inDaylight ? "into" : "out of") - // + " DST at " + (new Date(millis))); - // lastDST = inDaylight; - // } - // - // millis += 15*ONE_MINUTE; - // } - // } - // - // static void _testUsingFields(int y, boolean startsInDST) - // { - // boolean lastDST = startsInDST; - // for (int m = 0; m < 12; ++m) - // { - // for (int d = 1; d <= MONTH_LENGTH[m]; ++d) - // { - // for (int h = 0; h < 24; ++h) - // { - // for (int min = 0; min < 60; min += 15) - // { - // cal.clear(); - // cal.set(y, m, d, h, min); - // boolean inDaylight = cal.inDaylightTime(); - // if (inDaylight != lastDST) - // { - // lastDST = inDaylight; - // log("Switch " + (lastDST ? "into" : "out of") - // + " DST at " + y + "/" + (m+1) + "/" + d - // + " " + showNN(h) + ":" + showNN(min)); - // logln(" " + cal.getTime()); - // - // cal.set(y, m, d, h-1, 45); - // log("Before = " - //+ y + "/" + (m+1) + "/" + d - //+ " " + showNN(h-1) + ":" + showNN(45)); - // logln(" " + cal.getTime()); - // } - // } - // } - // } - // } - // } - // - // public void Test1() - // { - // logln(Locale.getDefault().getDisplayName()); - // logln(TimeZone.getDefault().getID()); - // logln(new Date(0)); - // - // if (true) - // { - // logln("========================================"); - // _testUsingBinarySearch(new Date(97,0,1), false); - // logln("========================================"); - // _testUsingBinarySearch(new Date(97,6,1), true); - // } - // - // if (true) - // { - // logln("========================================"); - // logln("Stepping using millis"); - // _testUsingMillis(new Date(97,0,1), false); - // } - // - // if (true) - // { - // logln("========================================"); - // logln("Stepping using fields"); - // _testUsingFields(1997, false); - // } - // - // if (false) - // { - // cal.clear(); - // cal.set(1997, 3, 5, 10, 0); - // // cal.inDaylightTime(); - // logln("Date = " + cal.getTime()); - // logln("Millis = " + cal.getTime().getTime()/3600000); - // } - // } - - //---------------------------------------------------------------------- - //---------------------------------------------------------------------- - //---------------------------------------------------------------------- - - void _testUsingBinarySearch(SimpleTimeZone tz, Date d, long expectedBoundary) - { - // Given a date with a year start, find the Daylight onset - // and end. The given date should be 1/1/xx in some year. - - // Use a binary search, assuming that we have a Standard - // time at the midpoint. - long min = d.getTime(); - long max = min + (long)(365.25 / 2 * ONE_DAY); - - // First check the boundaries - boolean startsInDST = tz.inDaylightTime(d); - - if (tz.inDaylightTime(new Date(max)) == startsInDST) - { - logln("Error: inDaylightTime(" + (new Date(max)) + ") != " + (!startsInDST)); - } - - while ((max - min) > INTERVAL) - { - long mid = (min + max) >> 1; - if (tz.inDaylightTime(new Date(mid)) == startsInDST) - { - min = mid; - } - else - { - max = mid; - } - } - - logln("Binary Search Before: " + showDate(min)); - logln("Binary Search After: " + showDate(max)); - - long mindelta = expectedBoundary - min; - // not used long maxdelta = max - expectedBoundary; - if (mindelta >= 0 && mindelta <= INTERVAL && - mindelta >= 0 && mindelta <= INTERVAL) - logln("PASS: Expected boundary at " + expectedBoundary); - else - errln("FAIL: Expected boundary at " + expectedBoundary); - } - - /* - static void _testUsingMillis(Date d, boolean startsInDST) - { - long millis = d.getTime(); - long max = millis + (long)(370 * ONE_DAY); // A year plus extra - - boolean lastDST = startsInDST; - while (millis < max) - { - cal.setTime(new Date(millis)); - boolean inDaylight = cal.inDaylightTime(); - - if (inDaylight != lastDST) - { - logln("Switch " + (inDaylight ? "into" : "out of") - + " DST at " + (new Date(millis))); - lastDST = inDaylight; - } - - millis += 15*ONE_MINUTE; - } - } - */ - - /** - * Test new rule formats. - */ - public void TestNewRules() - { - //logln(Locale.getDefault().getDisplayName()); - //logln(TimeZone.getDefault().getID()); - //logln(new Date(0)); - - if (true) - { - // Doesn't matter what the default TimeZone is here, since we - // are creating our own TimeZone objects. - - SimpleTimeZone tz; - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - - logln("-----------------------------------------------------------------"); - logln("Aug 2ndTues .. Mar 15"); - tz = new SimpleTimeZone(-8*ONE_HOUR, "Test_1", - Calendar.AUGUST, 2, Calendar.TUESDAY, 2*ONE_HOUR, - Calendar.MARCH, 15, 0, 2*ONE_HOUR); - //logln(tz.toString()); - logln("========================================"); - tempcal.set(1997, 0, 1); - _testUsingBinarySearch(tz, tempcal.getTime(), 858416400000L); - logln("========================================"); - tempcal.set(1997, 6, 1); - _testUsingBinarySearch(tz, tempcal.getTime(), 871380000000L); - - logln("-----------------------------------------------------------------"); - logln("Apr Wed>=14 .. Sep Sun<=20"); - tz = new SimpleTimeZone(-8*ONE_HOUR, "Test_2", - Calendar.APRIL, 14, -Calendar.WEDNESDAY, 2*ONE_HOUR, - Calendar.SEPTEMBER, -20, -Calendar.SUNDAY, 2*ONE_HOUR); - //logln(tz.toString()); - logln("========================================"); - tempcal.set(1997, 0, 1); - _testUsingBinarySearch(tz, tempcal.getTime(), 861184800000L); - logln("========================================"); - tempcal.set(1997, 6, 1); - _testUsingBinarySearch(tz, tempcal.getTime(), 874227600000L); - } - - /* - if (true) - { - logln("========================================"); - logln("Stepping using millis"); - _testUsingMillis(new Date(97,0,1), false); - } - - if (true) - { - logln("========================================"); - logln("Stepping using fields"); - _testUsingFields(1997, false); - } - - if (false) - { - cal.clear(); - cal.set(1997, 3, 5, 10, 0); - // cal.inDaylightTime(); - logln("Date = " + cal.getTime()); - logln("Millis = " + cal.getTime().getTime()/3600000); - } - */ - } - - //---------------------------------------------------------------------- - //---------------------------------------------------------------------- - //---------------------------------------------------------------------- - // Long Bug - //---------------------------------------------------------------------- - //---------------------------------------------------------------------- - //---------------------------------------------------------------------- - - //public void Test3() - //{ - // findDaylightBoundaryUsingTimeZone(new Date(97,6,1), true); - //} - - /** - * Find boundaries by stepping. - */ - void findBoundariesStepwise(int year, long interval, TimeZone z, int expectedChanges) - { - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - tempcal.set(year, Calendar.JANUARY, 1); - Date d = tempcal.getTime(); - long time = d.getTime(); // ms - long limit = time + ONE_YEAR + ONE_DAY; - boolean lastState = z.inDaylightTime(d); - int changes = 0; - logln("-- Zone " + z.getID() + " starts in " + year + " with DST = " + lastState); - logln("useDaylightTime = " + z.useDaylightTime()); - while (time < limit) - { - d.setTime(time); - boolean state = z.inDaylightTime(d); - if (state != lastState) - { - logln((state ? "Entry " : "Exit ") + - "at " + d); - lastState = state; - ++changes; - } - time += interval; - } - if (changes == 0) - { - if (!lastState && !z.useDaylightTime()) logln("No DST"); - else errln("FAIL: DST all year, or no DST with true useDaylightTime"); - } - else if (changes != 2) - { - errln("FAIL: " + changes + " changes seen; should see 0 or 2"); - } - else if (!z.useDaylightTime()) - { - errln("FAIL: useDaylightTime false but 2 changes seen"); - } - if (changes != expectedChanges) - { - errln("FAIL: " + changes + " changes seen; expected " + expectedChanges); - } - } - - public void TestStepwise() - { - findBoundariesStepwise(1997, ONE_DAY, TimeZone.getTimeZone("EST"), 2); - findBoundariesStepwise(1997, ONE_DAY, TimeZone.getTimeZone("ACT"), 2); // Updated 3Jan01 - findBoundariesStepwise(1997, ONE_DAY, TimeZone.getTimeZone("America/Phoenix"), 0); // Added 3Jan01 - findBoundariesStepwise(1997, ONE_DAY, TimeZone.getTimeZone(AUSTRALIA), 2); - } -} diff --git a/icu4j/src/com/ibm/test/timezone/TimeZoneRegression.java b/icu4j/src/com/ibm/test/timezone/TimeZoneRegression.java deleted file mode 100755 index 8b0c057b79..0000000000 --- a/icu4j/src/com/ibm/test/timezone/TimeZoneRegression.java +++ /dev/null @@ -1,951 +0,0 @@ -/** - * @test 1.18 99/09/21 - * @bug 4052967 4073209 4073215 4084933 4096952 4109314 4126678 4151406 4151429 - * @bug 4154525 4154537 4154542 4154650 4159922 4162593 4173604 4176686 4184229 4208960 - */ - -package com.ibm.test.timezone; -import com.ibm.util.*; -import java.io.*; -import com.ibm.text.*; -import com.ibm.test.*; -import java.util.Date; -import java.util.Locale; - -public class TimeZoneRegression extends TestFmwk { - - public static void main(String[] args) throws Exception { - new TimeZoneRegression().run(args); - } - - public void Test4052967() { - logln("*** CHECK TIMEZONE AGAINST HOST OS SETTING ***"); - String id = TimeZone.getDefault().getID(); - logln("user.timezone: " + System.getProperty("user.timezone", "")); - logln("TimeZone.getDefault().getID(): " + id); - logln(new Date().toString()); - logln("*** THE RESULTS OF THIS TEST MUST BE VERIFIED MANUALLY ***"); - } - - public void Test4073209() { - TimeZone z1 = TimeZone.getTimeZone("PST"); - TimeZone z2 = TimeZone.getTimeZone("PST"); - if (z1 == z2) errln("Fail: TimeZone should return clones"); - } - - public void Test4073215() { - SimpleTimeZone z = (SimpleTimeZone) TimeZone.getTimeZone("GMT"); - if (z.useDaylightTime()) - errln("Fail: Fix test to start with non-DST zone"); - z.setStartRule(Calendar.FEBRUARY, 1, Calendar.SUNDAY, 0); - z.setEndRule(Calendar.MARCH, -1, Calendar.SUNDAY, 0); - if (!z.useDaylightTime()) - errln("Fail: DST not active"); - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - tempcal.set(1997, Calendar.JANUARY, 31); - Date d1 = tempcal.getTime(); - tempcal.set(1997, Calendar.MARCH, 1); - Date d2 = tempcal.getTime(); - tempcal.set(1997, Calendar.MARCH, 31); - Date d3 = tempcal.getTime(); - if (z.inDaylightTime(d1) || !z.inDaylightTime(d2) || - z.inDaylightTime(d3)) { - errln("Fail: DST not working as expected"); - } - } - - /** - * The expected behavior of TimeZone around the boundaries is: - * (Assume transition time of 2:00 AM) - * day of onset 1:59 AM STD = display name 1:59 AM ST - * 2:00 AM STD = display name 3:00 AM DT - * day of end 0:59 AM STD = display name 1:59 AM DT - * 1:00 AM STD = display name 1:00 AM ST - */ - public void Test4084933() { - TimeZone tz = TimeZone.getTimeZone("PST"); - - long offset1 = tz.getOffset(1, - 1997, Calendar.OCTOBER, 26, Calendar.SUNDAY, (2*60*60*1000)); - long offset2 = tz.getOffset(1, - 1997, Calendar.OCTOBER, 26, Calendar.SUNDAY, (2*60*60*1000)-1); - - long offset3 = tz.getOffset(1, - 1997, Calendar.OCTOBER, 26, Calendar.SUNDAY, (1*60*60*1000)); - long offset4 = tz.getOffset(1, - 1997, Calendar.OCTOBER, 26, Calendar.SUNDAY, (1*60*60*1000)-1); - - /* - * The following was added just for consistency. It shows that going *to* Daylight - * Savings Time (PDT) does work at 2am. - */ - - long offset5 = tz.getOffset(1, - 1997, Calendar.APRIL, 6, Calendar.SUNDAY, (2*60*60*1000)); - long offset6 = tz.getOffset(1, - 1997, Calendar.APRIL, 6, Calendar.SUNDAY, (2*60*60*1000)-1); - - long offset7 = tz.getOffset(1, - 1997, Calendar.APRIL, 6, Calendar.SUNDAY, (1*60*60*1000)); - long offset8 = tz.getOffset(1, - 1997, Calendar.APRIL, 6, Calendar.SUNDAY, (1*60*60*1000)-1); - - long SToffset = -8 * 60*60*1000L; - long DToffset = -7 * 60*60*1000L; - if (offset1 != SToffset || offset2 != SToffset || - offset3 != SToffset || offset4 != DToffset || - offset5 != DToffset || offset6 != SToffset || - offset7 != SToffset || offset8 != SToffset) - errln("Fail: TimeZone misbehaving"); - } - - public void Test4096952() { - String[] ZONES = { "GMT", "MET", "IST" }; - boolean pass = true; - try { - for (int i=0; i= ONE_DAY) { - millis -= ONE_DAY; - ++date; - dow = Calendar.SUNDAY + ((dow - Calendar.SUNDAY + 1) % 7); - } - - tzOffset = testTZ.getOffset(testCal.get(Calendar.ERA), - testCal.get(Calendar.YEAR), - testCal.get(Calendar.MONTH), - date, - dow, - millis); - tzRawOffset = testTZ.getRawOffset(); - tzOffsetFloat = new Float((float)tzOffset/(float)3600000); - tzRawOffsetFloat = new Float((float)tzRawOffset/(float)3600000); - - Date testDate = testCal.getTime(); - - boolean inDaylightTime = testTZ.inDaylightTime(testDate); - SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm"); - sdf.setCalendar(testCal); - String inDaylightTimeString; - - boolean passed; - - if (inDaylightTime) - { - inDaylightTimeString = " DST "; - passed = (tzOffset == (tzRawOffset + 3600000)); - } - else - { - inDaylightTimeString = " "; - passed = (tzOffset == tzRawOffset); - } - - String output = testTZ.getID() + " " + sdf.format(testDate) + - " Offset(" + tzOffsetFloat + ")" + - " RawOffset(" + tzRawOffsetFloat + ")" + - " " + millis/(float)3600000 + " " + - inDaylightTimeString; - - if (passed) - output += " "; - else - output += "ERROR"; - - if (passed) logln(output); else errln(output); - return passed; - } - - /** - * CANNOT REPRODUDE - * - * Yet another _alleged_ bug in TimeZone.getOffset(), a method that never - * should have been made public. It's simply too hard to use correctly. - * - * The original test code failed to do the following: - * (1) Call Calendar.setTime() before getting the fields! - * (2) Use the right millis (as usual) for getOffset(); they were passing - * in the MILLIS field, instead of the STANDARD MILLIS IN DAY. - * When you fix these two problems, the test passes, as expected. - */ - public void Test4126678() { - // Note: this test depends on the PST time zone. - TimeZone initialZone = TimeZone.getDefault(); - Calendar cal = Calendar.getInstance(); - TimeZone tz = TimeZone.getTimeZone("PST"); - TimeZone.setDefault(tz); - cal.setTimeZone(tz); - - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - tempcal.set(1998, Calendar.APRIL, 5, 10, 0); - Date dt = tempcal.getTime(); - // the dt value is local time in PST. - if (!tz.inDaylightTime(dt)) - errln("We're not in Daylight Savings Time and we should be.\n"); - - cal.setTime(dt); - int era = cal.get(Calendar.ERA); - int year = cal.get(Calendar.YEAR); - int month = cal.get(Calendar.MONTH); - int day = cal.get(Calendar.DATE); - int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); - int millis = cal.get(Calendar.MILLISECOND) + - (cal.get(Calendar.SECOND) + - (cal.get(Calendar.MINUTE) + - (cal.get(Calendar.HOUR) * 60) * 60) * 1000) - - cal.get(Calendar.DST_OFFSET); - - long offset = tz.getOffset(era, year, month, day, dayOfWeek, millis); - long raw_offset = tz.getRawOffset(); - if (offset == raw_offset) - errln("Offsets should not match when in DST"); - - // restore the initial time zone so that this test case - // doesn't affect the others. - TimeZone.setDefault(initialZone); - } - - /** - * TimeZone.getAvailableIDs(int) throws exception for certain values, - * due to a faulty constant in TimeZone.java. - */ - public void Test4151406() { - int max = 0; - for (int h=-28; h<=30; ++h) { - // h is in half-hours from GMT; rawoffset is in millis - int rawoffset = h * 1800000; - int hh = (h<0) ? -h : h; - String hname = ((h<0) ? "GMT-" : "GMT+") + - ((hh/2 < 10) ? "0" : "") + - (hh/2) + ':' + - ((hh%2==0) ? "00" : "30"); - try { - String[] ids = TimeZone.getAvailableIDs(rawoffset); - if (ids.length > max) max = ids.length; - logln(hname + ' ' + ids.length + - ((ids.length > 0) ? (" e.g. " + ids[0]) : "")); - } catch (Exception e) { - errln(hname + ' ' + "Fail: " + e); - } - } - logln("Maximum zones per offset = " + max); - } - - public void Test4151429() { - try { - TimeZone tz = TimeZone.getTimeZone("GMT"); - String name = tz.getDisplayName(true, Integer.MAX_VALUE, - Locale.getDefault()); - name = null; - errln("IllegalArgumentException not thrown by TimeZone.getDisplayName()"); - } catch(IllegalArgumentException e) { - System.out.print(""); - } - } - - /** - * SimpleTimeZone accepts illegal DST savings values. These values - * must be non-zero. There is no upper limit at this time. - */ - public void Test4154525() { - final int GOOD = 1, BAD = 0; - int[] DATA = { - 1, GOOD, - 0, BAD, - -1, BAD, - 60*60*1000, GOOD, - Integer.MIN_VALUE, BAD, - // Integer.MAX_VALUE, ?, // no upper limit on DST savings at this time - }; - for (int i=0; i) should work but throws " + ex) - : ", ) should fail but doesn't")); - } - - ex = null; - try { - SimpleTimeZone temp = new SimpleTimeZone(0, "Z", - GOOD_MONTH, GOOD_DAY, GOOD_DAY_OF_WEEK, GOOD_TIME, - month, day, dayOfWeek, time); - temp = null; - } catch (IllegalArgumentException e) { - ex = e; - } - if ((ex == null) != shouldBeGood) { - errln("SimpleTimeZone(, month=" + month + ", day=" + day + - ", dayOfWeek=" + dayOfWeek + ", time=" + time + - (shouldBeGood ? (") should work but throws " + ex) - : ") should fail but doesn't")); - } - } - } - - /** - * SimpleTimeZone.getOffset accepts illegal arguments. - */ - public void Test4154650() { - final int GOOD=1, BAD=0; - final int GOOD_ERA=GregorianCalendar.AD, GOOD_YEAR=1998, GOOD_MONTH=Calendar.AUGUST; - final int GOOD_DAY=2, GOOD_DOW=Calendar.SUNDAY, GOOD_TIME=16*3600000; - int[] DATA = { - GOOD, GOOD_ERA, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, GOOD_DOW, GOOD_TIME, - - GOOD, GregorianCalendar.BC, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, GOOD_DOW, GOOD_TIME, - GOOD, GregorianCalendar.AD, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, GOOD_DOW, GOOD_TIME, - BAD, GregorianCalendar.BC-1, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, GOOD_DOW, GOOD_TIME, - BAD, GregorianCalendar.AD+1, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, GOOD_DOW, GOOD_TIME, - - GOOD, GOOD_ERA, GOOD_YEAR, Calendar.JANUARY, GOOD_DAY, GOOD_DOW, GOOD_TIME, - GOOD, GOOD_ERA, GOOD_YEAR, Calendar.DECEMBER, GOOD_DAY, GOOD_DOW, GOOD_TIME, - BAD, GOOD_ERA, GOOD_YEAR, Calendar.JANUARY-1, GOOD_DAY, GOOD_DOW, GOOD_TIME, - BAD, GOOD_ERA, GOOD_YEAR, Calendar.DECEMBER+1, GOOD_DAY, GOOD_DOW, GOOD_TIME, - - GOOD, GOOD_ERA, GOOD_YEAR, Calendar.JANUARY, 1, GOOD_DOW, GOOD_TIME, - GOOD, GOOD_ERA, GOOD_YEAR, Calendar.JANUARY, 31, GOOD_DOW, GOOD_TIME, - BAD, GOOD_ERA, GOOD_YEAR, Calendar.JANUARY, 0, GOOD_DOW, GOOD_TIME, - BAD, GOOD_ERA, GOOD_YEAR, Calendar.JANUARY, 32, GOOD_DOW, GOOD_TIME, - - GOOD, GOOD_ERA, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, Calendar.SUNDAY, GOOD_TIME, - GOOD, GOOD_ERA, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, Calendar.SATURDAY, GOOD_TIME, - BAD, GOOD_ERA, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, Calendar.SUNDAY-1, GOOD_TIME, - BAD, GOOD_ERA, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, Calendar.SATURDAY+1, GOOD_TIME, - - GOOD, GOOD_ERA, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, GOOD_DOW, 0, - GOOD, GOOD_ERA, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, GOOD_DOW, 24*3600000-1, - BAD, GOOD_ERA, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, GOOD_DOW, -1, - BAD, GOOD_ERA, GOOD_YEAR, GOOD_MONTH, GOOD_DAY, GOOD_DOW, 24*3600000, - }; - - TimeZone tz = TimeZone.getDefault(); - for (int i=0; i " + zone[i]); - d = new Date(d.getTime() + ONE_HOUR); - } - if (zone[0].equals(zone[1]) && - (zone[1].equals(zone[2]) != transitionExpected) && - zone[2].equals(zone[3])) { - logln("Ok: transition " + transitionExpected); - } else { - errln("Fail: boundary transition incorrect"); - } - } - - // restore the initial time zone so that this test case - // doesn't affect the others. - TimeZone.setDefault(initialZone); - } - - /** - * TimeZone broken in last hour of year - */ - public void Test4173604() { - SimpleTimeZone pst = (SimpleTimeZone)TimeZone.getTimeZone("PST"); - int o22 = pst.getOffset(1, 1998, 11, 31, Calendar.THURSDAY, 22*60*60*1000); - int o23 = pst.getOffset(1, 1998, 11, 31, Calendar.THURSDAY, 23*60*60*1000); - int o00 = pst.getOffset(1, 1999, 0, 1, Calendar.FRIDAY, 0); - if (o22 != o23 || o22 != o00) { - errln("Offsets should be the same (for PST), but got: " + - "12/31 22:00 " + o22 + - ", 12/31 23:00 " + o23 + - ", 01/01 00:00 " + o00); - } - - GregorianCalendar cal = new GregorianCalendar(); - cal.setTimeZone(pst); - cal.clear(); - cal.set(1998, Calendar.JANUARY, 1); - int lastDST = cal.get(Calendar.DST_OFFSET); - int transitions = 0; - int delta = 5; - while (cal.get(Calendar.YEAR) < 2000) { - cal.add(Calendar.MINUTE, delta); - if (cal.get(Calendar.DST_OFFSET) != lastDST) { - ++transitions; - Calendar t = (Calendar)cal.clone(); - t.add(Calendar.MINUTE, -delta); - logln(t.getTime() + " " + t.get(Calendar.DST_OFFSET)); - logln(cal.getTime() + " " + (lastDST=cal.get(Calendar.DST_OFFSET))); - } - } - if (transitions != 4) { - errln("Saw " + transitions + " transitions; should have seen 4"); - } - } - - /** - * getDisplayName doesn't work with unusual savings/offsets. - */ - public void Test4176686() { - // Construct a zone that does not observe DST but - // that does have a DST savings (which should be ignored). - int offset = 90 * 60000; // 1:30 - SimpleTimeZone z1 = new SimpleTimeZone(offset, "_std_zone_"); - z1.setDSTSavings(45 * 60000); // 0:45 - - // Construct a zone that observes DST for the first 6 months. - SimpleTimeZone z2 = new SimpleTimeZone(offset, "_dst_zone_"); - z2.setDSTSavings(45 * 60000); // 0:45 - z2.setStartRule(Calendar.JANUARY, 1, 0); - z2.setEndRule(Calendar.JULY, 1, 0); - - // Also check DateFormat - DateFormat fmt1 = new SimpleDateFormat("z"); - fmt1.setTimeZone(z1); // Format uses standard zone - DateFormat fmt2 = new SimpleDateFormat("z"); - fmt2.setTimeZone(z2); // Format uses DST zone - java.util.Calendar tempcal = java.util.Calendar.getInstance(); - tempcal.clear(); - tempcal.set(1970, Calendar.FEBRUARY, 1); - Date dst = tempcal.getTime(); // Time in DST - tempcal.set(1970, Calendar.AUGUST, 1); - Date std = tempcal.getTime(); // Time in standard - - // Description, Result, Expected Result - String[] DATA = { - "getDisplayName(false, SHORT)/std zone", - z1.getDisplayName(false, TimeZone.SHORT), "GMT+01:30", - "getDisplayName(false, LONG)/std zone", - z1.getDisplayName(false, TimeZone.LONG ), "GMT+01:30", - "getDisplayName(true, SHORT)/std zone", - z1.getDisplayName(true, TimeZone.SHORT), "GMT+01:30", - "getDisplayName(true, LONG)/std zone", - z1.getDisplayName(true, TimeZone.LONG ), "GMT+01:30", - "getDisplayName(false, SHORT)/dst zone", - z2.getDisplayName(false, TimeZone.SHORT), "GMT+01:30", - "getDisplayName(false, LONG)/dst zone", - z2.getDisplayName(false, TimeZone.LONG ), "GMT+01:30", - "getDisplayName(true, SHORT)/dst zone", - z2.getDisplayName(true, TimeZone.SHORT), "GMT+02:15", - "getDisplayName(true, LONG)/dst zone", - z2.getDisplayName(true, TimeZone.LONG ), "GMT+02:15", - "DateFormat.format(std)/std zone", fmt1.format(std), "GMT+01:30", - "DateFormat.format(dst)/std zone", fmt1.format(dst), "GMT+01:30", - "DateFormat.format(std)/dst zone", fmt2.format(std), "GMT+01:30", - "DateFormat.format(dst)/dst zone", fmt2.format(dst), "GMT+02:15", - }; - - for (int i=0; i " + DATA[i+1] + ", exp " + DATA[i+2]); - } - } - } - - /** - * SimpleTimeZone allows invalid DOM values. - */ - public void Test4184229() { - SimpleTimeZone zone = null; - try { - zone = new SimpleTimeZone(0, "A", 0, -1, 0, 0, 0, 0, 0, 0); - errln("Failed. No exception has been thrown for DOM -1 startDay"); - } catch(IllegalArgumentException e) { - logln("(a) " + e.getMessage()); - } - try { - zone = new SimpleTimeZone(0, "A", 0, 0, 0, 0, 0, -1, 0, 0); - errln("Failed. No exception has been thrown for DOM -1 endDay"); - } catch(IllegalArgumentException e) { - logln("(b) " + e.getMessage()); - } - try { - zone = new SimpleTimeZone(0, "A", 0, -1, 0, 0, 0, 0, 0, 0, 1000); - errln("Failed. No exception has been thrown for DOM -1 startDay +savings"); - } catch(IllegalArgumentException e) { - logln("(c) " + e.getMessage()); - } - try { - zone = new SimpleTimeZone(0, "A", 0, 0, 0, 0, 0, -1, 0, 0, 1000); - errln("Failed. No exception has been thrown for DOM -1 endDay +savings"); - } catch(IllegalArgumentException e) { - logln("(d) " + e.getMessage()); - } - // Make a valid constructor call for subsequent tests. - zone = new SimpleTimeZone(0, "A", 0, 1, 0, 0, 0, 1, 0, 0); - try { - zone.setStartRule(0, -1, 0, 0); - errln("Failed. No exception has been thrown for DOM -1 setStartRule +savings"); - } catch(IllegalArgumentException e) { - logln("(e) " + e.getMessage()); - } - try { - zone.setStartRule(0, -1, 0); - errln("Failed. No exception has been thrown for DOM -1 setStartRule"); - } catch(IllegalArgumentException e) { - logln("(f) " + e.getMessage()); - } - try { - zone.setEndRule(0, -1, 0, 0); - errln("Failed. No exception has been thrown for DOM -1 setEndRule +savings"); - } catch(IllegalArgumentException e) { - logln("(g) " + e.getMessage()); - } - try { - zone.setEndRule(0, -1, 0); - errln("Failed. No exception has been thrown for DOM -1 setEndRule"); - } catch(IllegalArgumentException e) { - logln("(h) " + e.getMessage()); - } - } - - /** - * SimpleTimeZone.getOffset() throws IllegalArgumentException when to get - * of 2/29/1996 (leap day). - */ - public void Test4208960 () { - SimpleTimeZone tz = (SimpleTimeZone)TimeZone.getTimeZone("PST"); - try { - int offset = tz.getOffset(GregorianCalendar.AD, 1996, Calendar.FEBRUARY, 29, - Calendar.THURSDAY, 0); - offset = 0; - } catch (IllegalArgumentException e) { - errln("FAILED: to get TimeZone.getOffset(2/29/96)"); - } - try { - int offset = tz.getOffset(GregorianCalendar.AD, 1997, Calendar.FEBRUARY, 29, - Calendar.THURSDAY, 0); - offset = 0; - errln("FAILED: TimeZone.getOffset(2/29/97) expected to throw Exception."); - } catch (IllegalArgumentException e) { - logln("got IllegalArgumentException"); - } - } - - /** - * Test to see if DateFormat understands zone equivalency groups. It - * might seem that this should be a DateFormat test, but it's really a - * TimeZone test -- the changes to DateFormat are minor. - * - * We use two known, stable zones that shouldn't change much over time - * -- America/Vancouver and America/Los_Angeles. However, they MAY - * change at some point -- if that happens, replace them with any two - * zones in an equivalency group where one zone has localized name - * data, and the other doesn't, in some locale. - */ - public void TestJ449() { - // not used String str; - - // Modify the following three as necessary. The two IDs must - // specify two zones in the same equivalency group. One must have - // locale data in 'loc'; the other must not. - String idWithLocaleData = "America/Los_Angeles"; - String idWithoutLocaleData = "America/Vancouver"; - Locale loc = new Locale("en", "", ""); - - TimeZone zoneWith = TimeZone.getTimeZone(idWithLocaleData); - TimeZone zoneWithout = TimeZone.getTimeZone(idWithoutLocaleData); - // Make sure we got valid zones - if (!(zoneWith.getID().equals(idWithLocaleData) && - zoneWithout.getID().equals(idWithoutLocaleData))) { - errln("Fail: Unable to create zones"); - } else { - GregorianCalendar calWith = new GregorianCalendar(zoneWith); - GregorianCalendar calWithout = new GregorianCalendar(zoneWithout); - SimpleDateFormat fmt = - new SimpleDateFormat("MMM d yyyy hh:mm a zzz", loc); - Date date = new Date(0L); - fmt.setCalendar(calWith); - String strWith = fmt.format(date); - fmt.setCalendar(calWithout); - String strWithout = fmt.format(date); - if (strWith.equals(strWithout)) { - logln("Ok: " + idWithLocaleData + " -> " + - strWith + "; " + idWithoutLocaleData + " -> " + - strWithout); - } else { - errln("FAIL: " + idWithLocaleData + " -> " + - strWith + "; " + idWithoutLocaleData + " -> " + - strWithout); - } - } - } -} - -//eof diff --git a/icu4j/src/com/ibm/test/timezone/TimeZoneTest.java b/icu4j/src/com/ibm/test/timezone/TimeZoneTest.java deleted file mode 100755 index a7fa413077..0000000000 --- a/icu4j/src/com/ibm/test/timezone/TimeZoneTest.java +++ /dev/null @@ -1,775 +0,0 @@ -/** - * @test 1.22 99/09/21 - * @bug 4028006 4044013 4096694 4107276 4107570 4112869 4130885 - * @summary test TimeZone - * @build TimeZoneTest - */ - -package com.ibm.test.timezone; -import com.ibm.text.*; -import com.ibm.util.*; -import com.ibm.test.*; -import java.util.Date; -import java.util.Locale; -import java.util.Hashtable; -import java.util.ResourceBundle; - -public class TimeZoneTest extends TestFmwk -{ - static final int millisPerHour = 3600000; - - public static void main(String[] args) throws Exception { - new TimeZoneTest().run(args); - } - - /** - * Bug 4130885 - * Certain short zone IDs, used since 1.1.x, are incorrect. - * - * The worst of these is: - * - * "CAT" (Central African Time) should be GMT+2:00, but instead returns a - * zone at GMT-1:00. The zone at GMT-1:00 should be called EGT, CVT, EGST, - * or AZOST, depending on which zone is meant, but in no case is it CAT. - * - * Other wrong zone IDs: - * - * ECT (European Central Time) GMT+1:00: ECT is Ecuador Time, - * GMT-5:00. European Central time is abbreviated CEST. - * - * SST (Solomon Island Time) GMT+11:00. SST is actually Samoa Standard Time, - * GMT-11:00. Solomon Island time is SBT. - * - * NST (New Zealand Time) GMT+12:00. NST is the abbreviation for - * Newfoundland Standard Time, GMT-3:30. New Zealanders use NZST. - * - * AST (Alaska Standard Time) GMT-9:00. [This has already been noted in - * another bug.] It should be "AKST". AST is Atlantic Standard Time, - * GMT-4:00. - * - * PNT (Phoenix Time) GMT-7:00. PNT usually means Pitcairn Time, - * GMT-8:30. There is no standard abbreviation for Phoenix time, as distinct - * from MST with daylight savings. - * - * In addition to these problems, a number of zones are FAKE. That is, they - * don't match what people use in the real world. - * - * FAKE zones: - * - * EET (should be EEST) - * ART (should be EEST) - * MET (should be IRST) - * NET (should be AMST) - * PLT (should be PKT) - * BST (should be BDT) - * VST (should be ICT) - * CTT (should be CST) + - * ACT (should be CST) + - * AET (should be EST) + - * MIT (should be WST) + - * IET (should be EST) + - * PRT (should be AST) + - * CNT (should be NST) - * AGT (should be ARST) - * BET (should be EST) + - * - * + A zone with the correct name already exists and means something - * else. E.g., EST usually indicates the US Eastern zone, so it cannot be - * used for Brazil (BET). - */ - public void TestShortZoneIDs() throws Exception { - - ZoneDescriptor[] JDK_116_REFERENCE_LIST = { - new ZoneDescriptor("MIT", -660, false), - new ZoneDescriptor("HST", -600, false), - new ZoneDescriptor("AST", -540, true), - new ZoneDescriptor("PST", -480, true), - new ZoneDescriptor("PNT", -420, false), - new ZoneDescriptor("MST", -420, true), - new ZoneDescriptor("CST", -360, true), - new ZoneDescriptor("IET", -300, false), - new ZoneDescriptor("EST", -300, true), - new ZoneDescriptor("PRT", -240, false), - new ZoneDescriptor("CNT", -210, true), - new ZoneDescriptor("AGT", -180, false), - new ZoneDescriptor("BET", -180, true), - // new ZoneDescriptor("CAT", -60, false), // Wrong: - // As of bug 4130885, fix CAT (Central Africa) - new ZoneDescriptor("CAT", 120, false), // Africa/Harare - new ZoneDescriptor("GMT", 0, false), - new ZoneDescriptor("UTC", 0, false), - new ZoneDescriptor("ECT", 60, true), - new ZoneDescriptor("ART", 120, true), - new ZoneDescriptor("EET", 120, true), - new ZoneDescriptor("EAT", 180, false), - // new ZoneDescriptor("MET", 210, true), - // This is a standard Unix zone, so don't remap it - Liu 3Jan01 - // new ZoneDescriptor("NET", 240, false); - // As of bug 4191164, fix NET - new ZoneDescriptor("NET", 240, true), - new ZoneDescriptor("PLT", 300, false), - new ZoneDescriptor("IST", 330, false), - new ZoneDescriptor("BST", 360, false), - new ZoneDescriptor("VST", 420, false), - new ZoneDescriptor("CTT", 480, true), // Revised Liu 3Jan01, std->dst - new ZoneDescriptor("JST", 540, false), - new ZoneDescriptor("ACT", 570, true), // Revised Liu 3Jan01, std->dst - new ZoneDescriptor("AET", 600, true), - new ZoneDescriptor("SST", 660, false), - // new ZoneDescriptor("NST", 720, false), - // As of bug 4130885, fix NST (New Zealand) - new ZoneDescriptor("NST", 720, true), // Pacific/Auckland - - // [3Jan01 Liu] Three of these zones have been updated. - // The CTT and ACT zones just remap to Asia/Shanghai - // and Australia/Darwin. Since those zones have changed, - // I have updated the table. The MET zone used to be mapped - // to Asia/Tehran but since MET is a standard Unix zone named - // in the source data we no longer do this in icu or icu4j. - }; - - Hashtable hash = new Hashtable(); - - String[] ids = TimeZone.getAvailableIDs(); - for (int i=0; i i2.offset) return 1; - if (i1.offset < i2.offset) return -1; - if (i1.daylight && !i2.daylight) return 1; - if (!i1.daylight && i2.daylight) return -1; - return i1.id.compareTo(i2.id); - } - } - - static final String EXPECTED_CUSTOM_ID = "Custom"; - static final String formatMinutes(int min) { - char sign = '+'; - if (min < 0) { sign = '-'; min = -min; } - int h = min/60; - min = min%60; - return "" + sign + h + ":" + ((min<10) ? "0" : "") + min; - } - /** - * As part of the VM fix (see CCC approved RFE 4028006, bug - * 4044013), TimeZone.getTimeZone() has been modified to recognize - * generic IDs of the form GMT[+-]hh:mm, GMT[+-]hhmm, and - * GMT[+-]hh. Test this behavior here. - * - * Bug 4044013 - */ - public void TestCustomParse() throws Exception { - Object[] DATA = { - // ID Expected offset in minutes - "GMT", null, - "GMT0", null, - "GMT+0", new Integer(0), - "GMT+1", new Integer(60), - "GMT-0030", new Integer(-30), - "GMT+15:99", new Integer(15*60+99), - "GMT+", null, - "GMT-", null, - "GMT+0:", null, - "GMT-:", null, - "GMT+0010", new Integer(10), // Interpret this as 00:10 - "GMT-10", new Integer(-10*60), - "GMT+30", new Integer(30), - "GMT-3:30", new Integer(-(3*60+30)), - "GMT-230", new Integer(-(2*60+30)), - }; - for (int i=0; i generic GMT"); - // When TimeZone.getTimeZone() can't parse the id, it - // returns GMT -- a dubious practice, but required for - // backward compatibility. - if (exp != null) { - throw new Exception("Expected offset of " + formatMinutes(exp.intValue()) + - " for " + id + ", got parse failure"); - } - } - else { - int ioffset = zone.getRawOffset()/60000; - String offset = formatMinutes(ioffset); - logln(id + " -> " + zone.getID() + " GMT" + offset); - if (exp == null) { - throw new Exception("Expected parse failure for " + id + - ", got offset of " + offset + - ", id " + zone.getID()); - } - else if (ioffset != exp.intValue() || - !zone.getID().equals(EXPECTED_CUSTOM_ID)) { - throw new Exception("Expected offset of " + formatMinutes(exp.intValue()) + - ", id Custom, for " + id + - ", got offset of " + offset + - ", id " + zone.getID()); - } - } - } - } - - /** - * Test the basic functionality of the getDisplayName() API. - * - * Bug 4112869 - * Bug 4028006 - * - * See also API change request A41. - * - * 4/21/98 - make smarter, so the test works if the ext resources - * are present or not. - */ - public void TestDisplayName() { - TimeZone zone = TimeZone.getTimeZone("PST"); - String name = zone.getDisplayName(Locale.ENGLISH); - logln("PST->" + name); - if (!name.equals("Pacific Standard Time")) - errln("Fail: Expected \"Pacific Standard Time\", got " + name + - " for " + zone); - - //***************************************************************** - // THE FOLLOWING LINES MUST BE UPDATED IF THE LOCALE DATA CHANGES - // THE FOLLOWING LINES MUST BE UPDATED IF THE LOCALE DATA CHANGES - // THE FOLLOWING LINES MUST BE UPDATED IF THE LOCALE DATA CHANGES - //***************************************************************** - Object[] DATA = { - new Boolean(false), new Integer(TimeZone.SHORT), "PST", - new Boolean(true), new Integer(TimeZone.SHORT), "PDT", - new Boolean(false), new Integer(TimeZone.LONG), "Pacific Standard Time", - new Boolean(true), new Integer(TimeZone.LONG), "Pacific Daylight Time", - }; - - for (int i=0; i" + zone2.inDaylightTime(new Date())); - name = zone2.getDisplayName(Locale.ENGLISH); - logln("Modified PST->" + name); - if (!name.equals("Pacific Standard Time")) - errln("Fail: Expected \"Pacific Standard Time\""); - - // Make sure we get the default display format for Locales - // with no display name data. - Locale zh_CN = Locale.SIMPLIFIED_CHINESE; - name = zone.getDisplayName(zh_CN); - //***************************************************************** - // THE FOLLOWING LINE MUST BE UPDATED IF THE LOCALE DATA CHANGES - // THE FOLLOWING LINE MUST BE UPDATED IF THE LOCALE DATA CHANGES - // THE FOLLOWING LINE MUST BE UPDATED IF THE LOCALE DATA CHANGES - //***************************************************************** - logln("PST(zh_CN)->" + name); - - // Now be smart -- check to see if zh resource is even present. - // If not, we expect the en fallback behavior. - ResourceBundle enRB = ResourceBundle.getBundle("java.text.resources.DateFormatZoneData", - Locale.ENGLISH); - ResourceBundle zhRB = ResourceBundle.getBundle("java.text.resources.DateFormatZoneData", - zh_CN); - boolean noZH = enRB == zhRB; - - if (noZH) { - logln("Warning: Not testing the zh_CN behavior because resource is absent"); - if (!name.equals("Pacific Standard Time")) - errln("Fail: Expected Pacific Standard Time"); - } - else if (!name.equals("Pacific Standard Time") && - !name.equals("GMT-08:00") && - !name.equals("GMT-8:00") && - !name.equals("GMT-0800") && - !name.equals("GMT-800")) { - errln("Fail: Expected GMT-08:00 or something similar"); - errln("************************************************************"); - errln("THE ABOVE FAILURE MAY JUST MEAN THE LOCALE DATA HAS CHANGED"); - errln("************************************************************"); - } - - // Now try a non-existent zone - zone2 = new SimpleTimeZone(90*60*1000, "xyzzy"); - name = zone2.getDisplayName(Locale.ENGLISH); - logln("GMT+90min->" + name); - if (!name.equals("GMT+01:30") && - !name.equals("GMT+1:30") && - !name.equals("GMT+0130") && - !name.equals("GMT+130")) - errln("Fail: Expected GMT+01:30 or something similar"); - } - - public void TestGenericAPI() { - String id = "NewGMT"; - int offset = 12345; - - SimpleTimeZone zone = new SimpleTimeZone(offset, id); - if (zone.useDaylightTime()) errln("FAIL: useDaylightTime should return false"); - - TimeZone zoneclone = (TimeZone)zone.clone(); - if (!zoneclone.equals(zone)) errln("FAIL: clone or operator== failed"); - zoneclone.setID("abc"); - if (zoneclone.equals(zone)) errln("FAIL: clone or operator!= failed"); - // delete zoneclone; - - zoneclone = (TimeZone)zone.clone(); - if (!zoneclone.equals(zone)) errln("FAIL: clone or operator== failed"); - zoneclone.setRawOffset(45678); - if (zoneclone.equals(zone)) errln("FAIL: clone or operator!= failed"); - - // C++ only - /* - SimpleTimeZone copy(*zone); - if (!(copy == *zone)) errln("FAIL: copy constructor or operator== failed"); - copy = *(SimpleTimeZone*)zoneclone; - if (!(copy == *zoneclone)) errln("FAIL: assignment operator or operator== failed"); - */ - - TimeZone saveDefault = TimeZone.getDefault(); - TimeZone.setDefault(zone); - TimeZone defaultzone = TimeZone.getDefault(); - if (defaultzone == zone) errln("FAIL: Default object is identical, not clone"); - if (!defaultzone.equals(zone)) errln("FAIL: Default object is not equal"); - TimeZone.setDefault(saveDefault); - // delete defaultzone; - // delete zoneclone; - } - - public void TestRuleAPI() - { - // ErrorCode status = ZERO_ERROR; - - int offset = (int)(60*60*1000*1.75); // Pick a weird offset - SimpleTimeZone zone = new SimpleTimeZone(offset, "TestZone"); - if (zone.useDaylightTime()) errln("FAIL: useDaylightTime should return false"); - - // Establish our expected transition times. Do this with a non-DST - // calendar with the (above) declared local offset. - GregorianCalendar gc = new GregorianCalendar(zone); - gc.clear(); - gc.set(1990, Calendar.MARCH, 1); - long marchOneStd = gc.getTime().getTime(); // Local Std time midnight - gc.clear(); - gc.set(1990, Calendar.JULY, 1); - long julyOneStd = gc.getTime().getTime(); // Local Std time midnight - - // Starting and ending hours, WALL TIME - int startHour = (int)(2.25 * 3600000); - int endHour = (int)(3.5 * 3600000); - - zone.setStartRule(Calendar.MARCH, 1, 0, startHour); - zone.setEndRule (Calendar.JULY, 1, 0, endHour); - - gc = new GregorianCalendar(zone); - // if (failure(status, "new GregorianCalendar")) return; - - long marchOne = marchOneStd + startHour; - long julyOne = julyOneStd + endHour - 3600000; // Adjust from wall to Std time - - long expMarchOne = 636251400000L; - if (marchOne != expMarchOne) - { - errln("FAIL: Expected start computed as " + marchOne + - " = " + new Date(marchOne)); - logln(" Should be " + expMarchOne + - " = " + new Date(expMarchOne)); - } - - long expJulyOne = 646793100000L; - if (julyOne != expJulyOne) - { - errln("FAIL: Expected start computed as " + julyOne + - " = " + new Date(julyOne)); - logln(" Should be " + expJulyOne + - " = " + new Date(expJulyOne)); - } - - Calendar cal1 = Calendar.getInstance(); - cal1.set(1990, Calendar.JANUARY, 1); - Calendar cal2 = Calendar.getInstance(); - cal2.set(1990, Calendar.JUNE, 1); - _testUsingBinarySearch(zone, cal1.getTimeInMillis(), - cal2.getTimeInMillis(), marchOne); - cal1.set(1990, Calendar.JUNE, 1); - cal2.set(1990, Calendar.DECEMBER, 31); - _testUsingBinarySearch(zone, cal1.getTimeInMillis(), - cal2.getTimeInMillis(), julyOne); - - if (zone.inDaylightTime(new Date(marchOne - 1000)) || - !zone.inDaylightTime(new Date(marchOne))) - errln("FAIL: Start rule broken"); - if (!zone.inDaylightTime(new Date(julyOne - 1000)) || - zone.inDaylightTime(new Date(julyOne))) - errln("FAIL: End rule broken"); - - zone.setStartYear(1991); - if (zone.inDaylightTime(new Date(marchOne)) || - zone.inDaylightTime(new Date(julyOne - 1000))) - errln("FAIL: Start year broken"); - - // failure(status, "TestRuleAPI"); - // delete gc; - // delete zone; - } - - void _testUsingBinarySearch(SimpleTimeZone tz, long min, long max, long expectedBoundary) - { - // ErrorCode status = ZERO_ERROR; - boolean startsInDST = tz.inDaylightTime(new Date(min)); - // if (failure(status, "SimpleTimeZone::inDaylightTime")) return; - if (tz.inDaylightTime(new Date(max)) == startsInDST) { - logln("Error: inDaylightTime(" + new Date(max) + ") != " + (!startsInDST)); - return; - } - // if (failure(status, "SimpleTimeZone::inDaylightTime")) return; - while ((max - min) > INTERVAL) { - long mid = (min + max) / 2; - if (tz.inDaylightTime(new Date(mid)) == startsInDST) { - min = mid; - } - else { - max = mid; - } - // if (failure(status, "SimpleTimeZone::inDaylightTime")) return; - } - logln("Binary Search Before: " + min + " = " + new Date(min)); - logln("Binary Search After: " + max + " = " + new Date(max)); - long mindelta = expectedBoundary - min; - // not used long maxdelta = max - expectedBoundary; - if (mindelta >= 0 && - mindelta <= INTERVAL && - mindelta >= 0 && - mindelta <= INTERVAL) - logln("PASS: Expected bdry: " + expectedBoundary + " = " + new Date(expectedBoundary)); - else - errln("FAIL: Expected bdry: " + expectedBoundary + " = " + new Date(expectedBoundary)); - } - - static final int INTERVAL = 100; - - // Bug 006; verify the offset for a specific zone. - public void TestPRTOffset() - { - TimeZone tz = TimeZone.getTimeZone( "PRT" ); - if( tz == null ) { - errln( "FAIL: TimeZone(PRT) is null" ); - } - else{ - if (tz.getRawOffset() != (-4*millisPerHour)) - errln("FAIL: Offset for PRT should be -4, got " + - tz.getRawOffset() / (double)millisPerHour); - } - - } - - // Test various calls - public void TestVariousAPI518() - { - TimeZone time_zone = TimeZone.getTimeZone("PST"); - Calendar cal = Calendar.getInstance(); - cal.set(1997, Calendar.APRIL, 30); - Date d = cal.getTime(); - - logln("The timezone is " + time_zone.getID()); - - if (time_zone.inDaylightTime(d) != true) - errln("FAIL: inDaylightTime returned false"); - - if (time_zone.useDaylightTime() != true) - errln("FAIL: useDaylightTime returned false"); - - if (time_zone.getRawOffset() != -8*millisPerHour) - errln( "FAIL: getRawOffset returned wrong value"); - - GregorianCalendar gc = new GregorianCalendar(); - gc.setTime(d); - if (time_zone.getOffset(gc.AD, gc.get(gc.YEAR), gc.get(gc.MONTH), - gc.get(gc.DAY_OF_MONTH), - gc.get(gc.DAY_OF_WEEK), 0) - != -7*millisPerHour) - errln("FAIL: getOffset returned wrong value"); - } - - // Test getAvailableID API - public void TestGetAvailableIDs913() - { - StringBuffer buf = new StringBuffer("TimeZone.getAvailableIDs() = { "); - String[] s = TimeZone.getAvailableIDs(); - for (int i=0; i 0) buf.append(", "); - buf.append(s[i]); - } - buf.append(" };"); - logln(buf.toString()); - - buf.setLength(0); - buf.append("TimeZone.getAvailableIDs(GMT+02:00) = { "); - s = TimeZone.getAvailableIDs(+2 * 60 * 60 * 1000); - for (int i=0; i 0) buf.append(", "); - buf.append(s[i]); - } - buf.append(" };"); - logln(buf.toString()); - - TimeZone tz = TimeZone.getTimeZone("PST"); - if (tz != null) - logln("getTimeZone(PST) = " + tz.getID()); - else - errln("FAIL: getTimeZone(PST) = null"); - - tz = TimeZone.getTimeZone("America/Los_Angeles"); - if (tz != null) - logln("getTimeZone(America/Los_Angeles) = " + tz.getID()); - else - errln("FAIL: getTimeZone(PST) = null"); - - // Bug 4096694 - tz = TimeZone.getTimeZone("NON_EXISTENT"); - if (tz == null) - errln("FAIL: getTimeZone(NON_EXISTENT) = null"); - else if (!tz.getID().equals("GMT")) - errln("FAIL: getTimeZone(NON_EXISTENT) = " + tz.getID()); - } - - /** - * Bug 4107276 - */ - public void TestDSTSavings() { - // It might be better to find a way to integrate this test into the main TimeZone - // tests above, but I don't have time to figure out how to do this (or if it's - // even really a good idea). Let's consider that a future. --rtg 1/27/98 - SimpleTimeZone tz = new SimpleTimeZone(-5 * millisPerHour, "dstSavingsTest", - Calendar.MARCH, 1, 0, 0, Calendar.SEPTEMBER, 1, 0, 0, - (int)(0.5 * millisPerHour)); - - if (tz.getRawOffset() != -5 * millisPerHour) - errln("Got back a raw offset of " + (tz.getRawOffset() / millisPerHour) + - " hours instead of -5 hours."); - if (!tz.useDaylightTime()) - errln("Test time zone should use DST but claims it doesn't."); - if (tz.getDSTSavings() != 0.5 * millisPerHour) - errln("Set DST offset to 0.5 hour, but got back " + (tz.getDSTSavings() / - millisPerHour) + " hours instead."); - - int offset = tz.getOffset(GregorianCalendar.AD, 1998, Calendar.JANUARY, 1, - Calendar.THURSDAY, 10 * millisPerHour); - if (offset != -5 * millisPerHour) - errln("The offset for 10 AM, 1/1/98 should have been -5 hours, but we got " - + (offset / millisPerHour) + " hours."); - - offset = tz.getOffset(GregorianCalendar.AD, 1998, Calendar.JUNE, 1, Calendar.MONDAY, - 10 * millisPerHour); - if (offset != -4.5 * millisPerHour) - errln("The offset for 10 AM, 6/1/98 should have been -4.5 hours, but we got " - + (offset / millisPerHour) + " hours."); - - tz.setDSTSavings(millisPerHour); - offset = tz.getOffset(GregorianCalendar.AD, 1998, Calendar.JANUARY, 1, - Calendar.THURSDAY, 10 * millisPerHour); - if (offset != -5 * millisPerHour) - errln("The offset for 10 AM, 1/1/98 should have been -5 hours, but we got " - + (offset / millisPerHour) + " hours."); - - offset = tz.getOffset(GregorianCalendar.AD, 1998, Calendar.JUNE, 1, Calendar.MONDAY, - 10 * millisPerHour); - if (offset != -4 * millisPerHour) - errln("The offset for 10 AM, 6/1/98 (with a 1-hour DST offset) should have been -4 hours, but we got " - + (offset / millisPerHour) + " hours."); - } - - /** - * Bug 4107570 - */ - public void TestAlternateRules() { - // Like TestDSTSavings, this test should probably be integrated somehow with the main - // test at the top of this class, but I didn't have time to figure out how to do that. - // --rtg 1/28/98 - - SimpleTimeZone tz = new SimpleTimeZone(-5 * millisPerHour, "alternateRuleTest"); - - // test the day-of-month API - tz.setStartRule(Calendar.MARCH, 10, 12 * millisPerHour); - tz.setEndRule(Calendar.OCTOBER, 20, 12 * millisPerHour); - - int offset = tz.getOffset(GregorianCalendar.AD, 1998, Calendar.MARCH, 5, - Calendar.THURSDAY, 10 * millisPerHour); - if (offset != -5 * millisPerHour) - errln("The offset for 10AM, 3/5/98 should have been -5 hours, but we got " - + (offset / millisPerHour) + " hours."); - - offset = tz.getOffset(GregorianCalendar.AD, 1998, Calendar.MARCH, 15, - Calendar.SUNDAY, 10 * millisPerHour); - if (offset != -4 * millisPerHour) - errln("The offset for 10AM, 3/15/98 should have been -4 hours, but we got " - + (offset / millisPerHour) + " hours."); - - offset = tz.getOffset(GregorianCalendar.AD, 1998, Calendar.OCTOBER, 15, - Calendar.THURSDAY, 10 * millisPerHour); - if (offset != -4 * millisPerHour) - errln("The offset for 10AM, 10/15/98 should have been -4 hours, but we got " - + (offset / millisPerHour) + " hours."); - - offset = tz.getOffset(GregorianCalendar.AD, 1998, Calendar.OCTOBER, 25, - Calendar.SUNDAY, 10 * millisPerHour); - if (offset != -5 * millisPerHour) - errln("The offset for 10AM, 10/25/98 should have been -5 hours, but we got " - + (offset / millisPerHour) + " hours."); - - // test the day-of-week-after-day-in-month API - tz.setStartRule(Calendar.MARCH, 10, Calendar.FRIDAY, 12 * millisPerHour, true); - tz.setEndRule(Calendar.OCTOBER, 20, Calendar.FRIDAY, 12 * millisPerHour, false); - - offset = tz.getOffset(GregorianCalendar.AD, 1998, Calendar.MARCH, 11, - Calendar.WEDNESDAY, 10 * millisPerHour); - if (offset != -5 * millisPerHour) - errln("The offset for 10AM, 3/11/98 should have been -5 hours, but we got " - + (offset / millisPerHour) + " hours."); - - offset = tz.getOffset(GregorianCalendar.AD, 1998, Calendar.MARCH, 14, - Calendar.SATURDAY, 10 * millisPerHour); - if (offset != -4 * millisPerHour) - errln("The offset for 10AM, 3/14/98 should have been -4 hours, but we got " - + (offset / millisPerHour) + " hours."); - - offset = tz.getOffset(GregorianCalendar.AD, 1998, Calendar.OCTOBER, 15, - Calendar.THURSDAY, 10 * millisPerHour); - if (offset != -4 * millisPerHour) - errln("The offset for 10AM, 10/15/98 should have been -4 hours, but we got " - + (offset / millisPerHour) + " hours."); - - offset = tz.getOffset(GregorianCalendar.AD, 1998, Calendar.OCTOBER, 17, - Calendar.SATURDAY, 10 * millisPerHour); - if (offset != -5 * millisPerHour) - errln("The offset for 10AM, 10/17/98 should have been -5 hours, but we got " - + (offset / millisPerHour) + " hours."); - } - - public void TestEquivalencyGroups() { - String id = "America/Los_Angeles"; - int n = TimeZone.countEquivalentIDs(id); - if (n < 2) { - errln("FAIL: countEquivalentIDs(" + id + ") returned " + n + - ", expected >= 2"); - } - for (int i=0; i" + array[i] + " Got->" + child); - }else { - logln("OK: getTransliterator() passed: Expected->" + array[i] + " Got->" + child); - } - } - - - } - - - public void TestTransliterate(){ - logln("Testing the handleTransliterate() API of CompoundTransliterator"); - CompoundTransliterator ct1=null; - try{ - ct1=new CompoundTransliterator("Any-Hex;Hex-Any"); - }catch(IllegalArgumentException iae){ - errln("FAIL: construction using CompoundTransliterator(String ID) failed for " + "Any-Hex;Hex-Any"); - throw iae; - } - - String s="abcabc"; - expect(ct1, s, s); - Transliterator.Position index = new Transliterator.Position(); - ReplaceableString rsource2=new ReplaceableString(s); - String expectedResult=s; - ct1.transliterate(rsource2, index); - ct1.finishTransliteration(rsource2, index); - String result=rsource2.toString(); - expectAux(ct1.getID() + ":ReplaceableString, index(0,0,0,0)", s + "->" + rsource2, result.equals(expectedResult), expectedResult); - - Transliterator.Position index2 = new Transliterator.Position(1,3,2,3); - ReplaceableString rsource3=new ReplaceableString(s); - ct1.transliterate(rsource3, index2); - ct1.finishTransliteration(rsource3, index2); - result=rsource3.toString(); - expectAux(ct1.getID() + ":String, index2(1,2,2,3)", s + "->" + rsource3, result.equals(expectedResult), expectedResult); - - - String Data[]={ - //ID, input string, transliterated string - "Any-Hex;Hex-Any;Any-Hex", "hello", "\\u0068\\u0065\\u006C\\u006C\\u006F", - "Any-Hex;Hex-Any", "hello! How are you?", "hello! How are you?", - "Devanagari-Latin;Latin-Devanagari", "\u092D\u0948'\u0930'\u0935", "\u092D\u0948\u0930\u0935", // quotes lost - "Latin-Cyrillic;Cyrillic-Latin", "a'b'k'd'e'f'g'h'i'j'Shch'shch'zh'h", "a'b'k'd'e'f'g'h'i'j'Shch'shch'zh'h", - "Latin-Greek;Greek-Latin", "ABGabgAKLMN", "ABGabgAKLMN", - //"Latin-Arabic;Arabic-Latin", "Ad'r'a'b'i'k'dh'dd'gh", "Adrabikdhddgh", - "Hiragana-Katakana", "\u3041\u308f\u3099\u306e\u304b\u3092\u3099", - "\u30A1\u30f7\u30ce\u30ab\u30fa", - "Hiragana-Katakana;Katakana-Hiragana", "\u3041\u308f\u3099\u306e\u304b\u3051", - "\u3041\u308f\u3099\u306e\u304b\u3051", - "Katakana-Hiragana;Hiragana-Katakana", "\u30A1\u30f7\u30ce\u30f5\u30f6", - "\u30A1\u30f7\u30ce\u30ab\u30b1", - "Latin-Katakana;Katakana-Latin", "vavivuvevohuzizuzoninunasesuzezu", - "vavivuvevohuzizuzoninunasesuzezu", - }; - CompoundTransliterator ct2=null; - for(int i=0; i "); - t.transliterate(rsource, index, - String.valueOf(source.charAt(i))); - // Append the string buffer with a vertical bar '|' where - // the committed index is. - String s = rsource.toString(); - log.append(s.substring(0, index.start)). - append('|'). - append(s.substring(index.start)); - } - - // As a final step in keyboard transliteration, we must call - // transliterate to finish off any pending partial matches that - // were waiting for more input. - t.finishTransliteration(rsource, index); - result = rsource.toString(); - log.append(" => ").append(rsource.toString()); - expectAux(t.getID() + ":Keyboard", log.toString(), - result.equals(expectedResult), - expectedResult); - - } - private void expectAux(String tag, String source, - String result, String expectedResult) { - expectAux(tag, source + " -> " + result, - result.equals(expectedResult), - expectedResult); - } - - private void expectAux(String tag, String summary, boolean pass, String expectedResult) { - if (pass) { - logln("(" + tag + ") " + Utility.escape(summary)); - } else { - errln("FAIL: (" + tag+ ") " - + Utility.escape(summary) - + ", expected " + Utility.escape(expectedResult)); - } - } -} - diff --git a/icu4j/src/com/ibm/test/translit/ErrorTest.java b/icu4j/src/com/ibm/test/translit/ErrorTest.java deleted file mode 100755 index f6eed22133..0000000000 --- a/icu4j/src/com/ibm/test/translit/ErrorTest.java +++ /dev/null @@ -1,214 +0,0 @@ -package com.ibm.test.translit; -import com.ibm.test.*; -import com.ibm.text.*; -import com.ibm.util.Utility; -import java.io.*; -import java.text.ParseException; - -/** - * @test - * @summary Error condition test of Transliterator - */ -public class ErrorTest extends TestFmwk { - - public static void main(String[] args) throws Exception { - new ErrorTest().run(args); - } - - public void TestTransliteratorErrors() { - String trans="Latin-Greek"; - String bogusID="LATINGREEK-GREEKLATIN"; - String newID="Bogus-Latin"; - String newIDRules="zzz > Z; f <> ph"; - String bogusRules="a } [b-g m-p "; - ReplaceableString testString= new ReplaceableString("A quick fox jumped over the lazy dog."); - String insertString="cats and dogs"; - int stoppedAt = 0, len; - Transliterator.Position pos = new Transliterator.Position(); - - Transliterator t= Transliterator.getInstance(trans, Transliterator.FORWARD); - if(t==null){ - errln("FAIL: construction of Latin-Greek"); - return; - } - len = testString.length(); - stoppedAt = t.transliterate(testString, 0, 100); - if (stoppedAt != -1) { - errln("FAIL: Out of bounds check failed (1)."); - } else if (testString.length() != len) { - testString= new ReplaceableString("A quick fox jumped over the lazy dog."); - errln("FAIL: Transliterate fails and the target string was modified."); - } - stoppedAt = t.transliterate(testString, 100, testString.length()-1); - if (stoppedAt != -1) { - errln("FAIL: Out of bounds check failed (2)."); - } else if (testString.length() != len) { - testString=new ReplaceableString("A quick fox jumped over the lazy dog."); - errln("FAIL: Transliterate fails and the target string was modified."); - } - pos.start = 100; - pos.limit = testString.length(); - try { - t.transliterate(testString, pos); - errln("FAIL: Start offset is out of bounds, error not reported."); - } catch(IllegalArgumentException e) { - logln("Start offset is out of bounds and detected."); - } - pos.limit = 100; - pos.start = 0; - - try { - t.transliterate(testString, pos ); - errln("FAIL: Limit offset is out of bounds, error not reported.\n"); - } catch(IllegalArgumentException e) { - logln("Start offset is out of bounds and detected."); - } - len = pos.contextLimit = testString.length(); - pos.contextStart = 0; - pos.limit = len - 1; - pos.start = 5; - try { - t.transliterate(testString, pos, insertString); - if (len == pos.limit) { - errln("FAIL: Test insertion with string: the transliteration position limit didn't change as expected."); - } - } catch (IllegalArgumentException e) { - errln("Insertion test with string failed for some reason."); - } - pos.contextStart = 0; - pos.contextLimit = testString.length(); - pos.limit = testString.length() -1; - pos.start = 5; - try { - t.transliterate(testString, pos, 0x0061); - if (len == pos.limit) { - errln("FAIL: Test insertion with character: the transliteration position limit didn't change as expected."); - } - } catch (IllegalArgumentException e) { - errln("FAIL: Insertion test with UTF-16 code point failed for some reason."); - } - len = pos.limit = testString.length(); - pos.contextStart = 0; - pos.contextLimit = testString.length() - 1; - pos.start = 5; - try { - t.transliterate(testString, pos, insertString); - errln("FAIL: Out of bounds check failed (3)."); - if (testString.length() != len) { - errln("FAIL: The input string was modified though the offsets were out of bounds."); - } - } catch (IllegalArgumentException e) { - logln("Insertion test with out of bounds indexes."); - } - Transliterator t1 = null; - try { - t1= Transliterator.getInstance(bogusID, Transliterator.FORWARD); - if(t1!=null) { - errln("FAIL: construction of bogus ID \"LATINGREEK-GREEKLATIN\""); - } - } catch (IllegalArgumentException e) { } - - //try { // unneeded - Exception cannot be thrown - Transliterator t2 = new RuleBasedTransliterator(newID, newIDRules); - try { - Transliterator t3 = t2.getInverse(); - errln("FAIL: The newID transliterator was not registered so createInverse should fail."); - } catch (Exception e) { } - //} catch (Exception e) { } - try { - Transliterator t4 = Transliterator.createFromRules(newID, bogusRules, Transliterator.FORWARD); - if (t4 != null ) { - errln("FAIL: The rules is malformed but error was not reported."); - } - } catch (Exception e) { } - } - - public void TestUnicodeSetErrors() { - String badPattern="[[:L:]-[0x0300-0x0400]"; - UnicodeSet set = new UnicodeSet(); - String result; - - if (!set.isEmpty()) { - errln("FAIL: The default ctor of UnicodeSet created a non-empty object."); - } - try { - set.applyPattern(badPattern); - errln("FAIL: Applied a bad pattern to the UnicodeSet object okay."); - } catch (IllegalArgumentException e) { - logln("Test applying with the bad pattern."); - } - try { - UnicodeSet set1 = new UnicodeSet(badPattern); - errln("FAIL: Created a UnicodeSet based on bad patterns."); - } catch (IllegalArgumentException e) { - logln("Test constructing with the bad pattern."); - } - } - - public void TestUniToHexErrors() { - Transliterator t = null; - try { - t = new UnicodeToHexTransliterator("", true, null); - if (t != null) { - errln("FAIL: Created a UnicodeToHexTransliterator with an empty pattern."); - } - } catch (IllegalArgumentException e) { } - try { - t = new UnicodeToHexTransliterator("\\x", true, null); - if (t != null) { - errln("FAIL: Created a UnicodeToHexTransliterator with a bad pattern."); - } - } catch (IllegalArgumentException e) { } - t = new UnicodeToHexTransliterator(); - try { - ((UnicodeToHexTransliterator)t).applyPattern("\\x"); - errln("FAIL: UnicodeToHexTransliterator::applyPattern succeeded with a bad pattern."); - } catch (Exception e) { } - } - - public void TestRBTErrors() { - - String rules="ab>y"; - String id="MyRandom-YReverse"; - String goodPattern="[[:L:]&[\\u0000-\\uFFFF]]"; /* all BMP letters */ - UnicodeSet set = null; - try { - set = new UnicodeSet(goodPattern); - try { - RuleBasedTransliterator t = new RuleBasedTransliterator(id, rules, Transliterator.REVERSE, set); - Transliterator.registerClass(id, t.getClass(), null); - Transliterator.unregister(id); - try { - Transliterator t1= Transliterator.getInstance(id, Transliterator.REVERSE); - errln("FAIL: construction of unregistered ID should have failed."); - } catch (IllegalArgumentException e) { } - } catch (IllegalArgumentException e) { - errln("FAIL: Was not able to create a good RBT to test registration."); - } - } catch (IllegalArgumentException e) { - errln("FAIL: Was not able to create a good UnicodeSet based on valid patterns."); - return; - } - } - - public void TestHexToUniErrors() { - Transliterator t = null; - //try { // unneeded - exception cannot be thrown - t = new HexToUnicodeTransliterator("", null); - //} catch (Exception e) { - // errln("FAIL: Could not create a HexToUnicodeTransliterator with an empty pattern."); - //} - try { - t = new HexToUnicodeTransliterator("\\x", null); - errln("FAIL: Created a HexToUnicodeTransliterator with a bad pattern."); - } catch (IllegalArgumentException e) { } - - t = new HexToUnicodeTransliterator(); - try { - ((HexToUnicodeTransliterator)t).applyPattern("\\x"); - errln("FAIL: HexToUnicodeTransliterator::applyPattern succeeded with a bad pattern."); - } catch (IllegalArgumentException e) { } - } -} - - diff --git a/icu4j/src/com/ibm/test/translit/HexToUnicodeTransliteratorTest.java b/icu4j/src/com/ibm/test/translit/HexToUnicodeTransliteratorTest.java deleted file mode 100755 index 9af204dd92..0000000000 --- a/icu4j/src/com/ibm/test/translit/HexToUnicodeTransliteratorTest.java +++ /dev/null @@ -1,261 +0,0 @@ - -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/translit/Attic/HexToUnicodeTransliteratorTest.java,v $ - * $Date: 2001/09/24 19:56:41 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ -package com.ibm.test.translit; -import com.ibm.text.*; -import com.ibm.test.*; -import com.ibm.util.Utility; -import java.text.*; -import java.util.*; - - -/** - * @test - * @summary General test of HexToUnicodeTransliterator - */ -public class HexToUnicodeTransliteratorTest extends TestFmwk { - - public static void main(String[] args) throws Exception { - new HexToUnicodeTransliteratorTest().run(args); - } - - /** - * Used by TestConstruction() and TestTransliterate. - */ - UnicodeFilter HexFilter=new UnicodeFilter() { - public boolean contains(int c) { - if(c == 0x0061 || c == 0x0063 ) - return false; - else - return true; - } - }; - - public void TestConstruction(){ - logln("Testing the construction HexToUnicodeTransliterator()"); - HexToUnicodeTransliterator trans1=new HexToUnicodeTransliterator(); - - - logln("Testing the cosntruction HexToUnicodeTransliterator(pattern)"); - String pattern="\\\\U+0000abc"; - try{ - trans1=new HexToUnicodeTransliterator(pattern); - }catch(IllegalArgumentException ex2) { - errln("FAIL: HexToUnicodeTransliterator construction failed with pattern=" + pattern + " Exception= " + ex2.toString()); - } - - logln("Testing the cosntruction HexToUnicodeTransliterator(pattern) with illegal pattern"); - String pattern2="\\X+"; - try{ - trans1=new HexToUnicodeTransliterator(pattern2); - }catch(IllegalArgumentException ex3) { - logln("OK: construction with Illegal pattern handled correctly"); - } - - logln("Testing the construction HexToUnicodeTransliterator(pattern, adoptedFilter=null)"); - try{ - trans1=new HexToUnicodeTransliterator(pattern, null); - }catch(IllegalArgumentException ex4) { - errln("FAIL: HexToUnicodeTransliterator(pattern, adoptedFilter=null) construction failed. Exception= " + ex4.toString()); - } - - logln("Testing the construction HexToUnicodeTransliterator(pattern, adoptedFilter)"); - try{ - trans1=new HexToUnicodeTransliterator(pattern, HexFilter); - }catch(IllegalArgumentException ex4) { - errln("FAIL: HexToUnicodeTransliterator(pattern, adoptedFilter) construction failed. Exception= " + ex4.toString()); - } - - } - public void TestPattern(){ - logln("Testing the applyPattern() and toPattern() API of HexToUnicodeTransliterator"); - /*default transliterator has pattern \\u0000*/ - HexToUnicodeTransliterator transdefault=new HexToUnicodeTransliterator(); - - String defaultpattern=transdefault.toPattern(); - String pattern1="\\\\U+0000"; - - HexToUnicodeTransliterator trans1=null; - try{ - trans1=new HexToUnicodeTransliterator(pattern1, null); - }catch(IllegalArgumentException ex1) { - errln("FAIL: HexToUnicodeTransliterator construction failed with pattern =" + pattern1 + - "Exception:" + ex1.toString()); - } - - /*test toPattern() */ - if(transdefault.toPattern().equals(trans1.toPattern()) == true || - transdefault.toPattern().equals("\\\\u0000;\\\\U0000;u+0000;U+0000") != true || - trans1.toPattern().equals(pattern1) != true ){ - errln("Error: toPattern() failed"); - } - - /*apply patterns for transdefault*/ - String str="abKf"; - expectPattern(transdefault, pattern1, "\\U+0061\\U+0062\\U+004B\\U+0066", str); - expectPattern(transdefault, "\\U##00,", "U61,U62,U4B,U66,", str); - expectPattern(transdefault, defaultpattern, "\\u0061\\u0062\\u004B\\u0066", str); - expectPattern(trans1, "\\uni0000", "uni0061uni0062uni004Buni0066", str); - expectPattern(trans1, "\\\\S-0000-E", "\\S-0061-E\\S-0062-E\\S-004B-E\\S-0066-E", str); - - expectPattern(trans1, "\\\\S-0000-E", "\\S-0061-E\\S-0062-E\\S-004B-E\\S-0066-E", str); - expectPattern(trans1, "\\u##0000", "\\u##0061\\u##0062", "FAIL"); - expectPattern(trans1, "\\*0000", "*0061*0062*004B*0066", str); - expectPattern(trans1, "\\u####", "\\u##0061\\u##0062", "FAIL"); - - - } - - public void TestSimpleTransliterate(){ - String pattern1="\\\\U+0000"; - HexToUnicodeTransliterator trans1=null; - try{ - trans1=new HexToUnicodeTransliterator(pattern1, null); - }catch(IllegalArgumentException iae){ - errln("HexToUnicodeTransliterator(pattern1, null) construction failed with pattern =" - + pattern1 + "Exception:" + iae.toString()); - } - String source="He\\U+006C\\U+006C\\U+006F"; - String expected="Hello"; - - expectTranslit(trans1, ":Replaceable ", source, 1, source.length(), 2, expected); - expect(trans1, "", "\\U+0048\\U+0065\\U+006C\\U+006C\\U+006F", expected); - - HexToUnicodeTransliterator transdefault=new HexToUnicodeTransliterator(); - - HexToUnicodeTransliterator trans2=null; - try{ - trans2=new HexToUnicodeTransliterator(transdefault.toPattern(), HexFilter); - }catch(IllegalArgumentException ex2){ - errln("HexToUnicodeTransliterator(pattern1, HexFilter) construction failed with pattern =" - + pattern1 + "Exception:" + ex2.toString()); - } - expect(trans2, "with Filter(0x0061, 0x0063) ", "\u0061\u0062\u0063", "\u0061b\u0063"); - } - - public void TestTransliterate(){ - String Data[]={ - //pattern, source, index.contextStart, index.contextLimit, index.start, expectedResult, - // "U+##00", "abU+63", "1", "7", "2", "abc", - "\\\\u0000", "a\\u0062c", "1", "7", "1", "abc", - "Uni0000", "abUni0063", "1", "9", "2", "abc", - "U[0000]", "heU[006C]U[006C]o", "0", "16", "2", "hello", - // "prefix-0000-suffix", "aprefix-0062-suffixprefix-0063-suffix", "1", "39", "1", "abc", - "*##00*", "hell*6F**74**68**65*re", "1", "20", "4", "hellothere", - - }; - HexToUnicodeTransliterator trans1=null; - for(int i=0; i" + result, result.equals(expectedResult), expectedResult); - } - private void expectPattern(HexToUnicodeTransliterator t, - String pattern, String source, String expectedResult){ - - try{ - t.applyPattern(pattern); - }catch(IllegalArgumentException iae){ - if(expectedResult.equals("FAIL")){ - logln("OK: calling applyPattern() with illegal pattern failed as expected." + iae.toString()); - } else{ - errln("FAIL: applyPattern() failed with pattern =" + pattern + "--->" + iae.toString()); - } - } - if(!expectedResult.equals("FAIL")){ - if(!t.toPattern().equals(pattern)) { - errln("FAIL: applyPattern or toPatten failed. Expected: " + pattern + "Got: " + t.toPattern()); - }else{ - logln("OK: applyPattern passed. Testing transliteration"); - expect(t, " with pattern "+pattern, source, expectedResult); - } - } - } - private void expect(HexToUnicodeTransliterator t, String message, String source, String expectedResult) { - - String result=t.transliterate(source); - expectAux(t.getID() + ":String " + message, source + "->" + result, result.equals(expectedResult), expectedResult); - - ReplaceableString rsource = new ReplaceableString(source); - t.transliterate(rsource); - result = rsource.toString(); - expectAux(t.getID() + ":Replaceable" + message, source + "->" + result, result.equals(expectedResult), expectedResult); - - // Test keyboard (incremental) transliteration -- this result - // must be the same after we finalize (see below). - rsource.replace(0, rsource.length(), ""); - Transliterator.Position index = new Transliterator.Position(); - StringBuffer log = new StringBuffer(); - - for (int i=0; i "); - t.transliterate(rsource, index, - String.valueOf(source.charAt(i))); - // Append the string buffer with a vertical bar '|' where - // the committed index is. - String s = rsource.toString(); - log.append(s.substring(0, index.start)). - append('|'). - append(s.substring(index.start)); - } - - // As a final step in keyboard transliteration, we must call - // transliterate to finish off any pending partial matches that - // were waiting for more input. - t.finishTransliteration(rsource, index); - result = rsource.toString(); - log.append(" => ").append(rsource.toString()); - expectAux(t.getID() + ":Keyboard", log.toString() + "\n" + source + " -> " + result, result.equals(expectedResult), expectedResult); - - } - private void expectAux(String tag, String summary, boolean pass, String expectedResult) { - if (pass) { - logln("(" + tag + ") " + Utility.escape(summary)); - } else { - errln("FAIL: (" + tag+ ") " - + Utility.escape(summary) - + ", expected " + Utility.escape(expectedResult)); - } - } -} - - - diff --git a/icu4j/src/com/ibm/test/translit/JamoTest.java b/icu4j/src/com/ibm/test/translit/JamoTest.java deleted file mode 100755 index ee50e081e5..0000000000 --- a/icu4j/src/com/ibm/test/translit/JamoTest.java +++ /dev/null @@ -1,481 +0,0 @@ -package com.ibm.test.translit; -import com.ibm.text.*; -import com.ibm.test.*; -import com.ibm.util.Utility; -import java.text.*; -import java.util.*; - -/** - * @test - * @summary Test the Latin-Jamo transliterator - */ -public class JamoTest extends TransliteratorTest { - - private static final char SEP = '\''; - - public static void main(String[] args) throws Exception { - new JamoTest().run(args); - } - - public void TestJamo() { - Transliterator latinJamo = Transliterator.getInstance("Latin-Jamo"); - Transliterator jamoLatin = latinJamo.getInverse(); - - String[] CASE = { - // Column 1 is the latin text L1 to be fed to Latin-Jamo - // to yield output J. - - // Column 2 is expected value of J. J is fed to - // Jamo-Latin to yield output L2. - - // Column 3 is expected value of L2. If the expected - // value of L2 is L1, then L2 is null. - "bab", "(Bi)(A)(Bf)", null, - "babb", "(Bi)(A)(Bf)(Bi)(EU)", "bab"+SEP+"beu", - "babbba", "(Bi)(A)(Bf)(BB)(A)", null, - "bagg", "(Bi)(A)(GGf)", null, - "baggga", "(Bi)(A)(GGf)(Gi)(A)", null, - "bag"+SEP+"gga", "(Bi)(A)(Gf)(GGi)(A)", null, - "kabsa", "(Ki)(A)(Bf)(Si)(A)", null, - "kabska", "(Ki)(A)(BS)(Ki)(A)", null, - "gabsbka", "(Gi)(A)(BS)(Bi)(EU)(Ki)(A)", "gabsbeuka", // not (Kf) - "gga", "(GGi)(A)", null, - "bsa", "(Bi)(EU)(Si)(A)", "beusa", - "agg", "(IEUNG)(A)(GGf)", null, - "agga", "(IEUNG)(A)(GGi)(A)", null, - "la", "(R)(A)", "ra", - "bs", "(Bi)(EU)(Sf)", "beus", - "kalgga", "(Ki)(A)(L)(GGi)(A)", null, - - // 'r' in a final position is treated like 'l' - "karka", "(Ki)(A)(L)(Ki)(A)", "kalka", - }; - - for (int i=0; i " + - jamoToName(jamo) + " => " + - latin + " => " + jamoToName(jamo2) - + " => " + hangul2 - ); - if (!hangul.equals(hangul2)) { - errln("FAIL: " + Utility.escape(buf.toString())); - } else { - logln(Utility.escape(buf.toString())); - } - } - } - - /** - * Test various step-at-a-time transformation of hangul to jamo to - * latin and back. - */ - public void TestPiecemeal() { - String hangul = "\uBC0F"; - String jamo = nameToJamo("(Mi)(I)(Cf)"); - String latin = "mic"; - - Transliterator t = null; - - t = Transliterator.getInstance("NFD"); // was Hangul-Jamo - expect(t, hangul, jamo); - - t = Transliterator.getInstance("NFC"); // was Jamo-Hangul - expect(t, jamo, hangul); - - t = Transliterator.getInstance("Latin-Jamo"); - expect(t, latin, jamo); - - t = Transliterator.getInstance("Jamo-Latin"); - expect(t, jamo, latin); - - t = Transliterator.getInstance("Hangul-Latin"); - expect(t, hangul, latin); - - t = Transliterator.getInstance("Latin-Hangul"); - expect(t, latin, hangul); - - t = Transliterator.getInstance("Hangul-Latin; Latin-Jamo"); - expect(t, hangul, jamo); - - t = Transliterator.getInstance("Jamo-Latin; Latin-Hangul"); - expect(t, jamo, hangul); - - t = Transliterator.getInstance("Hangul-Latin; Latin-Hangul"); - expect(t, hangul, hangul); - } - - public void TestRealText() { - Transliterator latinJamo = Transliterator.getInstance("Latin-Jamo"); - Transliterator jamoLatin = latinJamo.getInverse(); - Transliterator jamoHangul = Transliterator.getInstance("NFC"); - Transliterator hangulJamo = Transliterator.getInstance("NFD"); - Transliterator rt = new CompoundTransliterator(new Transliterator[] { - hangulJamo, jamoLatin, latinJamo, jamoHangul }); - - int pos = 0; - StringBuffer buf = new StringBuffer(); - int total = 0; - int errors = 0; - while (pos < WHAT_IS_UNICODE.length()) { - int space = WHAT_IS_UNICODE.indexOf(' ', pos+1); - if (space < 0) { - space = WHAT_IS_UNICODE.length(); - } - if (pos < space) { - ++total; - String hangul = WHAT_IS_UNICODE.substring(pos, space); - String hangulX = rt.transliterate(hangul); - if (!hangul.equals(hangulX)) { - ++errors; - String jamo = hangulJamo.transliterate(hangul); - String latin = jamoLatin.transliterate(jamo); - String jamo2 = latinJamo.transliterate(latin); - String hangul2 = jamoHangul.transliterate(jamo2); - if (hangul.equals(hangul2)) { - buf.setLength(0); - buf.append("FAIL (Compound transliterator problem): "); - buf.append(hangul + " => " + - jamoToName(jamo) + " => " + - latin + " => " + jamoToName(jamo2) - + " => " + hangul2 + - "; but " + hangul + " =cpd=> " + jamoToName(hangulX) - ); - errln(Utility.escape(buf.toString())); - } else if (jamo.equals(jamo2)) { - buf.setLength(0); - buf.append("FAIL (Jamo<>Hangul problem): "); - if (!hangul2.equals(hangulX)) { - buf.append("(Weird: " + hangulX + " != " + hangul2 + ")"); - } - buf.append(hangul + " => " + - jamoToName(jamo) + " => " + - latin + " => " + jamoToName(jamo2) - + " => " + hangul2 - ); - errln(Utility.escape(buf.toString())); - } else { - buf.setLength(0); - buf.append("FAIL: "); - if (!hangul2.equals(hangulX)) { - buf.append("(Weird: " + hangulX + " != " + hangul2 + ")"); - } - // The Hangul-Jamo conversion is not usually the - // bug here, so we hide it from display. - // Uncomment lines to see the Hangul. - buf.append(//hangul + " => " + - jamoToName(jamo) + " => " + - latin + " => " + jamoToName(jamo2) - //+ " => " + hangul2 - ); - errln(Utility.escape(buf.toString())); - } - } - } - pos = space+1; - } - if (errors != 0) { - errln("Test word failures: " + errors + " out of " + total); - } else { - logln("All " + total + " test words passed"); - } - } - - // Test text taken from the Unicode web site - static final String WHAT_IS_UNICODE = - - "\uc720\ub2c8\ucf54\ub4dc\uc5d0 \ub300\ud574 ? " + - - "\uc5b4\ub5a4 \ud50c\ub7ab\ud3fc, \uc5b4\ub5a4 " + - "\ud504\ub85c\uadf8\ub7a8, \uc5b4\ub5a4 \uc5b8\uc5b4\uc5d0\ub3c4 " + - "\uc0c1\uad00\uc5c6\uc774 \uc720\ub2c8\ucf54\ub4dc\ub294 \ubaa8\ub4e0 " + - "\ubb38\uc790\uc5d0 \ub300\ud574 \uace0\uc720 \ubc88\ud638\ub97c " + - "\uc81c\uacf5\ud569\ub2c8\ub2e4. " + - - "\uae30\ubcf8\uc801\uc73c\ub85c \ucef4\ud4e8\ud130\ub294 " + - "\uc22b\uc790\ub9cc \ucc98\ub9ac\ud569\ub2c8\ub2e4. \uae00\uc790\ub098 " + - "\ub2e4\ub978 \ubb38\uc790\uc5d0\ub3c4 \uc22b\uc790\ub97c " + - "\uc9c0\uc815\ud558\uc5ec " + - "\uc800\uc7a5\ud569\ub2c8\ub2e4. \uc720\ub2c8\ucf54\ub4dc\uac00 " + - "\uac1c\ubc1c\ub418\uae30 \uc804\uc5d0\ub294 \uc774\ub7ec\ud55c " + - "\uc22b\uc790\ub97c \uc9c0\uc815\ud558\uae30 \uc704\ud574 \uc218\ubc31 " + - "\uac00\uc9c0\uc758 \ub2e4\ub978 \uae30\ud638\ud654 " + - "\uc2dc\uc2a4\ud15c\uc744 " + - "\uc0ac\uc6a9\ud588\uc2b5\ub2c8\ub2e4. \ub2e8\uc77c \uae30\ud638\ud654 " + - "\ubc29\ubc95\uc73c\ub85c\ub294 \ubaa8\ub4e0 \ubb38\uc790\ub97c " + - "\ud3ec\ud568\ud560 \uc218 \uc5c6\uc5c8\uc2b5\ub2c8\ub2e4. \uc608\ub97c " + - "\ub4e4\uc5b4 \uc720\ub7fd \uc5f0\ud569\uc5d0\uc11c\ub9cc " + - "\ubcf4\ub354\ub77c\ub3c4 \ubaa8\ub4e0 \uac01 \ub098\ub77c\ubcc4 " + - "\uc5b8\uc5b4\ub97c \ucc98\ub9ac\ud558\ub824\uba74 \uc5ec\ub7ec " + - "\uac1c\uc758 \ub2e4\ub978 \uae30\ud638\ud654 \ubc29\ubc95\uc774 " + - "\ud544\uc694\ud569\ub2c8\ub2e4. \uc601\uc5b4\uc640 \uac19\uc740 " + - "\ub2e8\uc77c \uc5b8\uc5b4\uc758 \uacbd\uc6b0\ub3c4 " + - "\uacf5\ud1b5\uc801\uc73c\ub85c \uc0ac\uc6a9\ub418\ub294 \ubaa8\ub4e0 " + - "\uae00\uc790, \ubb38\uc7a5 \ubd80\ud638 \ubc0f " + - "\ud14c\ud06c\ub2c8\uceec \uae30\ud638\uc5d0 \ub9de\ub294 \ub2e8\uc77c " + - "\uae30\ud638\ud654 \ubc29\ubc95\uc744 \uac16\uace0 \uc788\uc9c0 " + - "\ubabb\ud558\uc600\uc2b5\ub2c8\ub2e4. " + - - "\uc774\ub7ec\ud55c \uae30\ud638\ud654 \uc2dc\uc2a4\ud15c\uc740 " + - "\ub610\ud55c \ub2e4\ub978 \uae30\ud638\ud654 \uc2dc\uc2a4\ud15c\uacfc " + - "\ucda9\ub3cc\ud569\ub2c8\ub2e4. \uc989 \ub450 \uac00\uc9c0 " + - "\uae30\ud638\ud654 \ubc29\ubc95\uc774 \ub450 \uac1c\uc758 \ub2e4\ub978 " + - "\ubb38\uc790\uc5d0 \ub300\ud574 \uac19\uc740 \ubc88\ud638\ub97c " + - "\uc0ac\uc6a9\ud558\uac70\ub098 \uac19\uc740 \ubb38\uc790\uc5d0 " + - "\ub300\ud574 \ub2e4\ub978 \ubc88\ud638\ub97c \uc0ac\uc6a9\ud560 \uc218 " + - "\uc788\uc2b5\ub2c8\ub2e4. \uc8fc\uc5b4\uc9c4 \ubaa8\ub4e0 " + - "\ucef4\ud4e8\ud130(\ud2b9\ud788 \uc11c\ubc84)\ub294 \uc11c\ub85c " + - "\ub2e4\ub978 \uc5ec\ub7ec \uac00\uc9c0 \uae30\ud638\ud654 " + - "\ubc29\ubc95\uc744 \uc9c0\uc6d0\ud574\uc57c " + - "\ud569\ub2c8\ub2e4. \uadf8\ub7ec\ub098, \ub370\uc774\ud130\ub97c " + - "\uc11c\ub85c \ub2e4\ub978 \uae30\ud638\ud654 \ubc29\ubc95\uc774\ub098 " + - "\ud50c\ub7ab\ud3fc \uac04\uc5d0 \uc804\ub2ec\ud560 \ub54c\ub9c8\ub2e4 " + - "\uadf8 \ub370\uc774\ud130\ub294 \ud56d\uc0c1 \uc190\uc0c1\uc758 " + - "\uc704\ud5d8\uc744 \uacaa\uac8c \ub429\ub2c8\ub2e4. " + - - "\uc720\ub2c8\ucf54\ub4dc\ub85c \ubaa8\ub4e0 \uac83\uc744 " + - "\ud574\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4! " + - "\uc720\ub2c8\ucf54\ub4dc\ub294 \uc0ac\uc6a9 \uc911\uc778 " + - "\ud50c\ub7ab\ud3fc, \ud504\ub85c\uadf8\ub7a8, \uc5b8\uc5b4\uc5d0 " + - "\uad00\uacc4\uc5c6\uc774 \ubb38\uc790\ub9c8\ub2e4 \uace0\uc720\ud55c " + - "\uc22b\uc790\ub97c " + - "\uc81c\uacf5\ud569\ub2c8\ub2e4. \uc720\ub2c8\ucf54\ub4dc " + - "\ud45c\uc900\uc740 " + // "Apple, HP, IBM, JustSystem, Microsoft, Oracle, SAP, " + - // "Sun, Sybase, Unisys " + - "\ubc0f \uae30\ud0c0 \uc5ec\ub7ec " + - "\ud68c\uc0ac\uc640 \uac19\uc740 \uc5c5\uacc4 " + - "\uc120\ub450\uc8fc\uc790\uc5d0 \uc758\ud574 " + - "\ucc44\ud0dd\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \uc720\ub2c8\ucf54\ub4dc\ub294 " + - // "XML, Java, ECMAScript(JavaScript), LDAP, CORBA 3.0, WML " + - "\ub4f1\uacfc " + - "\uac19\uc774 \ud604\uc7ac \ub110\ub9ac \uc0ac\uc6a9\ub418\ub294 " + - "\ud45c\uc900\uc5d0\uc11c \ud544\uc694\ud558\uba70 \uc774\ub294 " + //ISO/IEC " + - "10646\uc744 \uad6c\ud604\ud558\ub294 \uacf5\uc2dd\uc801\uc778 " + - "\ubc29\ubc95\uc785\ub2c8\ub2e4. \uc774\ub294 \ub9ce\uc740 \uc6b4\uc601 " + - "\uccb4\uc81c, \uc694\uc998 \uc0ac\uc6a9\ub418\ub294 \ubaa8\ub4e0 " + - "\ube0c\ub77c\uc6b0\uc800 \ubc0f \uae30\ud0c0 \ub9ce\uc740 " + - "\uc81c\ud488\uc5d0\uc11c " + - "\uc9c0\uc6d0\ub429\ub2c8\ub2e4. \uc720\ub2c8\ucf54\ub4dc " + - "\ud45c\uc900\uc758 \ubd80\uc0c1\uacfc \uc774\ub97c " + - "\uc9c0\uc6d0\ud558\ub294 \ub3c4\uad6c\uc758 \uac00\uc6a9\uc131\uc740 " + - "\ucd5c\uadfc \uc804 \uc138\uacc4\uc5d0 \ubd88\uace0 \uc788\ub294 " + - "\uae30\uc220 \uacbd\ud5a5\uc5d0\uc11c \uac00\uc7a5 \uc911\uc694\ud55c " + - "\ubd80\ubd84\uc744 \ucc28\uc9c0\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. " + - - "\uc720\ub2c8\ucf54\ub4dc\ub97c " + - "\ud074\ub77c\uc774\uc5b8\ud2b8-\uc11c\ubc84 \ub610\ub294 " + - "\ub2e4\uc911-\uc5f0\uacb0 \uc751\uc6a9 \ud504\ub85c\uadf8\ub7a8\uacfc " + - "\uc6f9 \uc0ac\uc774\ud2b8\uc5d0 \ud1b5\ud569\ud558\uba74 " + - "\ub808\uac70\uc2dc \ubb38\uc790 \uc138\ud2b8 \uc0ac\uc6a9\uc5d0 " + - "\uc788\uc5b4\uc11c \uc0c1\ub2f9\ud55c \ube44\uc6a9 \uc808\uac10 " + - "\ud6a8\uacfc\uac00 " + - "\ub098\ud0c0\ub0a9\ub2c8\ub2e4. \uc720\ub2c8\ucf54\ub4dc\ub97c " + - "\ud1b5\ud574 \ub9ac\uc5d4\uc9c0\ub2c8\uc5b4\ub9c1 \uc5c6\uc774 " + - "\ub2e4\uc911 \ud50c\ub7ab\ud3fc, \uc5b8\uc5b4 \ubc0f \uad6d\uac00 " + - "\uac04\uc5d0 \ub2e8\uc77c \uc18c\ud504\ud2b8\uc6e8\uc5b4 " + - "\ud50c\ub7ab\ud3fc \ub610\ub294 \ub2e8\uc77c \uc6f9 " + - "\uc0ac\uc774\ud2b8\ub97c \ubaa9\ud45c\ub85c \uc0bc\uc744 \uc218 " + - "\uc788\uc2b5\ub2c8\ub2e4. \uc774\ub97c \uc0ac\uc6a9\ud558\uba74 " + - "\ub370\uc774\ud130\ub97c \uc190\uc0c1 \uc5c6\uc774 \uc5ec\ub7ec " + - "\uc2dc\uc2a4\ud15c\uc744 \ud1b5\ud574 \uc804\uc1a1\ud560 \uc218 " + - "\uc788\uc2b5\ub2c8\ub2e4. " + - - "\uc720\ub2c8\ucf54\ub4dc \ucf58\uc18c\uc2dc\uc5c4\uc5d0 \ub300\ud574 " + - "\uc720\ub2c8\ucf54\ub4dc \ucf58\uc18c\uc2dc\uc5c4\uc740 " + - "\ube44\uc601\ub9ac \uc870\uc9c1\uc73c\ub85c\uc11c \ud604\ub300 " + - "\uc18c\ud504\ud2b8\uc6e8\uc5b4 \uc81c\ud488\uacfc " + - "\ud45c\uc900\uc5d0\uc11c \ud14d\uc2a4\ud2b8\uc758 \ud45c\ud604\uc744 " + - "\uc9c0\uc815\ud558\ub294 \uc720\ub2c8\ucf54\ub4dc \ud45c\uc900\uc758 " + - "\uc0ac\uc6a9\uc744 \uac1c\ubc1c\ud558\uace0 \ud655\uc7a5\ud558\uba70 " + - "\uc7a5\ub824\ud558\uae30 \uc704\ud574 " + - "\uc138\uc6cc\uc84c\uc2b5\ub2c8\ub2e4. \ucf58\uc18c\uc2dc\uc5c4 " + - "\uba64\ubc84\uc27d\uc740 \ucef4\ud4e8\ud130\uc640 \uc815\ubcf4 " + - "\ucc98\ub9ac \uc0b0\uc5c5\uc5d0 \uc885\uc0ac\ud558\uace0 \uc788\ub294 " + - "\uad11\ubc94\uc704\ud55c \ud68c\uc0ac \ubc0f \uc870\uc9c1\uc758 " + - "\ubc94\uc704\ub97c " + - "\ub098\ud0c0\ub0c5\ub2c8\ub2e4. \ucf58\uc18c\uc2dc\uc5c4\uc758 " + - "\uc7ac\uc815\uc740 \uc804\uc801\uc73c\ub85c \ud68c\ube44\uc5d0 " + - "\uc758\ud574 \ucda9\ub2f9\ub429\ub2c8\ub2e4. \uc720\ub2c8\ucf54\ub4dc " + - "\ucee8\uc18c\uc2dc\uc5c4\uc5d0\uc11c\uc758 \uba64\ubc84\uc27d\uc740 " + - "\uc804 \uc138\uacc4 \uc5b4\ub290 \uacf3\uc5d0\uc11c\ub098 " + - "\uc720\ub2c8\ucf54\ub4dc \ud45c\uc900\uc744 \uc9c0\uc6d0\ud558\uace0 " + - "\uadf8 \ud655\uc7a5\uacfc \uad6c\ud604\uc744 " + - "\uc9c0\uc6d0\ud558\uace0\uc790\ud558\ub294 \uc870\uc9c1\uacfc " + - "\uac1c\uc778\uc5d0\uac8c \uac1c\ubc29\ub418\uc5b4 " + - "\uc788\uc2b5\ub2c8\ub2e4. " + - - "\ub354 \uc790\uc138\ud55c \ub0b4\uc6a9\uc740 \uc6a9\uc5b4\uc9d1, " + - "\uc608\uc81c \uc720\ub2c8\ucf54\ub4dc \uc0ac\uc6a9 \uac00\ub2a5 " + - "\uc81c\ud488, \uae30\uc220 \uc815\ubcf4 \ubc0f \uae30\ud0c0 " + - "\uc720\uc6a9\ud55c \uc815\ubcf4\ub97c " + - "\ucc38\uc870\ud558\uc2ed\uc2dc\uc624."; - - // TransliteratorTest override - boolean expectAux(String tag, String summary, boolean pass, - String expectedResult) { - return super.expectAux(tag, jamoToName(summary), - pass, jamoToName(expectedResult)); - } - - // UTILITIES - - // Note: The following could more easily be done with a transliterator! - static final String[] JAMO_NAMES = { - "(Gi)", "\u1100", - "(GGi)", "\u1101", - "(Ni)", "\u1102", - "(Di)", "\u1103", - "(DD)", "\u1104", - "(R)", "\u1105", - "(Mi)", "\u1106", - "(Bi)", "\u1107", - "(BB)", "\u1108", - "(Si)", "\u1109", - "(SSi)", "\u110A", - "(IEUNG)", "\u110B", - "(Ji)", "\u110C", - "(JJ)", "\u110D", - "(Ci)", "\u110E", - "(Ki)", "\u110F", - "(Ti)", "\u1110", - "(Pi)", "\u1111", - "(Hi)", "\u1112", - - "(A)", "\u1161", - "(AE)", "\u1162", - "(YA)", "\u1163", - "(YAE)", "\u1164", - "(EO)", "\u1165", - "(E)", "\u1166", - "(YEO)", "\u1167", - "(YE)", "\u1168", - "(O)", "\u1169", - "(WA)", "\u116A", - "(WAE)", "\u116B", - "(OE)", "\u116C", - "(YO)", "\u116D", - "(U)", "\u116E", - "(WEO)", "\u116F", - "(WE)", "\u1170", - "(WI)", "\u1171", - "(YU)", "\u1172", - "(EU)", "\u1173", - "(YI)", "\u1174", - "(I)", "\u1175", - - "(Gf)", "\u11A8", - "(GGf)", "\u11A9", - "(GS)", "\u11AA", - "(Nf)", "\u11AB", - "(NJ)", "\u11AC", - "(NH)", "\u11AD", - "(Df)", "\u11AE", - "(L)", "\u11AF", - "(LG)", "\u11B0", - "(LM)", "\u11B1", - "(LB)", "\u11B2", - "(LS)", "\u11B3", - "(LT)", "\u11B4", - "(LP)", "\u11B5", - "(LH)", "\u11B6", - "(Mf)", "\u11B7", - "(Bf)", "\u11B8", - "(BS)", "\u11B9", - "(Sf)", "\u11BA", - "(SSf)", "\u11BB", - "(NG)", "\u11BC", - "(Jf)", "\u11BD", - "(Cf)", "\u11BE", - "(Kf)", "\u11BF", - "(Tf)", "\u11C0", - "(Pf)", "\u11C1", - "(Hf)", "\u11C2", - }; - - static Hashtable JAMO_TO_NAME; - static Hashtable NAME_TO_JAMO; - - static { - JAMO_TO_NAME = new Hashtable(); - NAME_TO_JAMO = new Hashtable(); - for (int i=0; i= 2 && (j-i) <= 6) { // "(A)", "(IEUNG)" - String jamo = (String) NAME_TO_JAMO.get(input.substring(i, j+1)); - if (jamo != null) { - buf.append(jamo); - i = j; - continue; - } - } - } - buf.append(c); - } - return buf.toString(); - } - - /** - * Convert jamo to short names. E.g., "x\u11B0y" returns - * "x(LG)y". See JAMO_NAMES for table of names. - */ - static String jamoToName(String input) { - StringBuffer buf = new StringBuffer(); - for (int i=0; i= 0x1100 && c <= 0x11C2) { - String name = (String) JAMO_TO_NAME.get(input.substring(i, i+1)); - if (name != null) { - buf.append(name); - continue; - } - } - buf.append(c); - } - return buf.toString(); - } -} diff --git a/icu4j/src/com/ibm/test/translit/ReplaceableTest.java b/icu4j/src/com/ibm/test/translit/ReplaceableTest.java deleted file mode 100755 index c1d7dda4f8..0000000000 --- a/icu4j/src/com/ibm/test/translit/ReplaceableTest.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.ibm.test.translit; -import com.ibm.test.*; -import com.ibm.text.*; -import com.ibm.util.Utility; -import java.io.*; -import java.util.BitSet; -import java.text.ParseException; - -/** - * @test - * @summary Round trip test of Transliterator - */ -public class ReplaceableTest extends TestFmwk { - public static void main(String[] args) throws Exception { - new ReplaceableTest().run(args); - } - - public void Test() throws IOException, ParseException { - check("Lower", "ABCD", "1234", ""); - check("Upper", "abcd\u00DF", "123455", ""); // must map 00DF to SS - check("Title", "aBCD", "1234", ""); - check("NFC", "A\u0300E\u0300", "1234", "13"); - check("NFD", "\u00C0\u00C8", "12", "1122"); - } - - void check(String transliteratorName, String test, String styles, String shouldProduceStyles) { - if (shouldProduceStyles.length() == 0) shouldProduceStyles = styles; - TestReplaceable tr = new TestReplaceable(test, styles); - String original = tr.toString(); - - Transliterator t = Transliterator.getInstance(transliteratorName); - t.transliterate(tr); - String newStyles = tr.getStyles(); - if (!newStyles.equals(shouldProduceStyles)) { - errln("FAIL Styles: " + transliteratorName + "(" - + original + " => " + tr.toString() + "; should be {" + shouldProduceStyles + "}!"); - } else { - logln("OK: " + transliteratorName + "(" + original + ") => " + tr.toString()); - } - } - - /** - * This is a test class that simulates styled text. - * It associates a style number (0..65536) with each character, - * and maintains that style in the normal fashion: - * When setting text from raw string or characters,
- * Set the styles to the style of the first character replaced.
- * If no characters are replaced, use the style of the previous character.
- * If at start, use the following character
- * Otherwise use defaultStyle. - */ - static class TestReplaceable implements Replaceable { - ReplaceableString chars; - ReplaceableString styles; - - char defaultStyle = '_'; - - TestReplaceable (String text, String styles) { - chars = new ReplaceableString(text); - StringBuffer s = new StringBuffer(); - for (int i = 0; i < text.length(); ++i) { - if (i < styles.length()) { - s.append(styles.charAt(i)); - } else { - s.append((char) (i + 'A')); - } - } - this.styles = new ReplaceableString(s.toString()); - } - - public String getStyles() { - return styles.toString(); - } - - public String toString() { - return chars.toString() + "{" + styles.toString() + "}"; - } - - public String substring(int start, int limit) { - return chars.substring(start, limit); - } - - public int length() { - return chars.length(); - } - - public char charAt(int offset) { - return chars.charAt(offset); - } - - public int char32At(int offset) { - return chars.char32At(offset); - } - - public void getChars(int srcStart, int srcLimit, char dst[], int dstStart) { - chars.getChars(srcStart, srcLimit, dst, dstStart); - } - - public void replace(int start, int limit, String text) { - if (substring(start,limit).equals(text)) return; // NO ACTION! - chars.replace(start, limit, text); - fixStyles(start, limit, text.length()); - } - - public void replace(int start, int limit, char[] chars, - int charsStart, int charsLen) { - if (substring(start,limit).equals(new String(chars, charsStart, charsLen-charsStart))) return; // NO ACTION! - this.chars.replace(start, limit, chars, charsStart, charsLen); - fixStyles(start, limit, charsLen-charsStart); - } - - void fixStyles(int start, int limit, int newLen) { - char newStyle = defaultStyle; - if (start != limit) { - newStyle = styles.charAt(start); - } else if (start > 0) { - newStyle = styles.charAt(start-1); - } else if (limit < styles.length() - 1) { - newStyle = styles.charAt(limit+1); - } - // dumb implementation for now. - StringBuffer s = new StringBuffer(); - for (int i = 0; i < newLen; ++i) { - s.append(newStyle); - } - styles.replace(start, limit, s.toString()); - } - - public void copy(int start, int limit, int dest) { - chars.copy(start, limit, dest); - styles.copy(start, limit, dest); - } - } -} diff --git a/icu4j/src/com/ibm/test/translit/RoundTripTest.java b/icu4j/src/com/ibm/test/translit/RoundTripTest.java deleted file mode 100755 index 2b561dd66d..0000000000 --- a/icu4j/src/com/ibm/test/translit/RoundTripTest.java +++ /dev/null @@ -1,1244 +0,0 @@ -package com.ibm.test.translit; -import com.ibm.test.*; -import com.ibm.text.*; -import com.ibm.util.Utility; -import java.io.*; -import java.util.BitSet; -import java.text.ParseException; - -/** - * @test - * @summary Round trip test of Transliterator - */ -public class RoundTripTest extends TestFmwk { - - static final boolean EXTRA_TESTS = true; - static final boolean PRINT_RULES = true; - - public static void main(String[] args) throws Exception { - new RoundTripTest().run(args); - } - /* - public void TestSingle() throws IOException, ParseException { - Transliterator t = Transliterator.getInstance("Latin-Greek"); - String s = t.transliterate("\u0101\u0069"); - } - */ - - public void TestKana() throws IOException, ParseException { - new Test("Katakana-Hiragana") - .test("[[:katakana:]\u30A1-\u30FA\u30FC]", "[[:hiragana:]\u3040-\u3094\u30FC]", - "[\u30FC\u309D\u309E\uFF66-\uFF9D]", this, new Legal()); - } - - public void TestHiragana() throws IOException, ParseException { - new Test("Latin-Hiragana") - .test("[a-zA-Z]", "[[:hiragana:]\u3040-\u3094]", "[\u309D\u309E]", this, new Legal()); - } - - public void TestKatakana() throws IOException, ParseException { - new Test("Latin-Katakana") - .test("[a-zA-Z]", "[[:katakana:]\u30A1-\u30FA\u30FC]", "[\u30FD\u30FE\uFF66-\uFF9D]", this, new Legal()); - } - -// Some transliterators removed for 2.0 - -// public void TestArabic() throws IOException, ParseException { -// new Test("Latin-Arabic", -// TestUtility.LATIN_SCRIPT, TestUtility.ARABIC_SCRIPT) -// .test("[a-zA-Z]", "[\u0620-\u065F-[\u0640]]", this); -// } - -// public void TestHebrew() throws IOException, ParseException { -// new Test("Latin-Hebrew", -// TestUtility.LATIN_SCRIPT, TestUtility.HEBREW_SCRIPT) -// .test(null, "[\u05D0-\u05EF]", this); -// } - -// public void TestHangul() throws IOException, ParseException { -// Test t = new TestHangul(); -// t.setPairLimit(30); // Don't run full test -- too long -// t.test(null, null, this); -// } - - public void TestJamo() throws IOException, ParseException { - new Test("Latin-Jamo") - .test("[a-zA-Z]", "[\u1100-\u1112 \u1161-\u1175 \u11A8-\u11C2]", "", this, new LegalJamo()); - } - -/* - SBase = 0xAC00, LBase = 0x1100, VBase = 0x1161, TBase = 0x11A7, - LCount = 19, VCount = 21, TCount = 28, - NCount = VCount * TCount, // 588 - SCount = LCount * NCount, // 11172 - LLimit = LBase + LCount, // 1113 - VLimit = VBase + VCount, // 1176 - TLimit = TBase + TCount, // 11C3 - SLimit = SBase + SCount; // D7A4 -*/ - - public void TestHangul() throws IOException, ParseException { - Test t = new Test("Latin-Hangul"); - t.test("[a-zA-Z]", "[\uAC00-\uD7A4]", "", this, new Legal()); - } - - public void TestGreek() throws IOException, ParseException { - new Test("Latin-Greek") - .test("[a-zA-Z]", "[\u003B\u00B7[:Greek:]-[\u03D7-\u03EF]]", - "[\u00B5\u037A\u03D0-\u03F5]", /* roundtrip exclusions */ - this, new LegalGreek(true)); - } - - public void TestGreekUNGEGN() throws IOException, ParseException { - new Test("Latin-Greek/UNGEGN") - .test("[a-zA-Z]", "[\u003B\u00B7[:Greek:]-[\u03D7-\u03EF]]", - "[\u00B5\u037A\u03D0-\uFFFF]", /* roundtrip exclusions */ - this, new LegalGreek(false)); - } - - public void Testel() throws IOException, ParseException { - new Test("Latin-el") - .test("[a-zA-Z]", "[\u003B\u00B7[:Greek:]-[\u03D7-\u03EF]]", - "[\u00B5\u037A\u03D0-\uFFFF]", /* roundtrip exclusions */ - this, new LegalGreek(false)); - } - - public void TestCyrillic() throws IOException, ParseException { - new Test("Latin-Cyrillic") - .test("[a-zA-Z\u0110\u0111]", "[\u0400-\u045F]", null, this, new Legal()); - } - - //---------------------------------- - // Inter-Indic Tests - //---------------------------------- - public static class LegalIndic extends Legal{ - UnicodeSet vowelSignSet = new UnicodeSet(); - - public LegalIndic(){ - vowelSignSet.addAll(new UnicodeSet("[\u0902\u0903\u093e-\u094c\u0962\u0963]"));/* Devanagari */ - vowelSignSet.addAll(new UnicodeSet("[\u0982\u0983\u09be-\u09cc\u09e2\u09e3\u09D7]"));/* Bengali */ - vowelSignSet.addAll(new UnicodeSet("[\u0a02\u0a03\u0a3e-\u0a4c\u0a62\u0a63\u0a70\u0a71]"));/* Gurmukhi */ - vowelSignSet.addAll(new UnicodeSet("[\u0a82\u0a83\u0abe-\u0acc\u0ae2\u0ae3]"));/* Gujarati */ - vowelSignSet.addAll(new UnicodeSet("[\u0b02\u0b03\u0b3e-\u0b4c\u0b62\u0b63\u0b56\u0b57]"));/* Oriya */ - vowelSignSet.addAll(new UnicodeSet("[\u0b82\u0b83\u0bbe-\u0bcc\u0be2\u0be3\u0bd7]"));/* Tamil */ - vowelSignSet.addAll(new UnicodeSet("[\u0c02\u0c03\u0c3e-\u0c4c\u0c62\u0c63\u0c55\u0c56]"));/* Telugu */ - vowelSignSet.addAll(new UnicodeSet("[\u0c82\u0c83\u0cbe-\u0ccc\u0ce2\u0ce3\u0cd5\u0cd6]"));/* Kannada */ - vowelSignSet.addAll(new UnicodeSet("[\u0d02\u0d03\u0d3e-\u0d4c\u0d62\u0d63\u0d57]"));/* Malayalam */ - } - - String avagraha = "\u093d\u0abd\u0b3d"; - String nukta = "\u093c\u09bc\u0a3c\u0abc\u0b3c"; - String virama = "\u094d\u09cd\u0a4d\u0acd\u0b4d\u0bcd\u0c4d\u0ccd\u0d4d"; - String sanskritStressSigns = "\u0951\u0952\u0953\u0954"; - String chandrabindu = "\u0901\u0981\u0A81\u0b01"; - public boolean is(String sourceString){ - int cp=sourceString.charAt(0); - - // A vowel sign cannot be the first char - if(vowelSignSet.contains(cp)){ - return false; - }else if(avagraha.indexOf(cp)!=-1){ - return false; - }else if(virama.indexOf(cp)!=-1){ - return false; - }else if(nukta.indexOf(cp)!=-1){ - return false; - }else if(sanskritStressSigns.indexOf(cp)!=-1){ - return false; - }else if((chandrabindu.indexOf(cp)!=-1) && - (sourceString.length() >1 && - vowelSignSet.contains(sourceString.charAt(1)))){ - return false; - } - return true; - } - } - static String latinForIndic = "[['.0-9A-Za-z~\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD"+ - "\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F"+ - "\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148"+ - "\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0"+ - "\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u01FB"+ - "\u0200-\u021B\u021E-\u021F\u0226-\u0233\u0303-\u0304\u0306\u0314-\u0315"+ - "\u0325\u040E\u0419\u0439\u045E\u04C1-\u04C2\u04D0-\u04D1\u04D6-\u04D7"+ - "\u04E2-\u04E3\u04EE-\u04EF\u1E00-\u1E99\u1EA0-\u1EF9\u1F01\u1F03\u1F05"+ - "\u1F07\u1F09\u1F0B\u1F0D\u1F0F\u1F11\u1F13\u1F15\u1F19\u1F1B\u1F1D\u1F21"+ - "\u1F23\u1F25\u1F27\u1F29\u1F2B\u1F2D\u1F2F\u1F31\u1F33\u1F35\u1F37\u1F39"+ - "\u1F3B\u1F3D\u1F3F\u1F41\u1F43\u1F45\u1F49\u1F4B\u1F4D\u1F51\u1F53\u1F55"+ - "\u1F57\u1F59\u1F5B\u1F5D\u1F5F\u1F61\u1F63\u1F65\u1F67\u1F69\u1F6B\u1F6D"+ - "\u1F6F\u1F81\u1F83\u1F85\u1F87\u1F89\u1F8B\u1F8D\u1F8F\u1F91\u1F93\u1F95"+ - "\u1F97\u1F99\u1F9B\u1F9D\u1F9F\u1FA1\u1FA3\u1FA5\u1FA7\u1FA9\u1FAB\u1FAD"+ - "\u1FAF-\u1FB1\u1FB8-\u1FB9\u1FD0-\u1FD1\u1FD8-\u1FD9\u1FE0-\u1FE1\u1FE5"+ - "\u1FE8-\u1FE9\u1FEC\u212A-\u212B\uE04D\uE064]"+ - "-[\uE000-\uE080 \u01E2\u01E3]& [[:latin:][:mark:]]]"; - - public void TestDevanagariLatin() throws IOException, ParseException { - new Test("Latin-DEVANAGARI") - .test(latinForIndic, "[[:Devanagari:][\u094d][\u0964\u0965]]", "[\u0965]", this, new LegalIndic()); - } - - private static final String [][] array= new String[][]{ - new String [] { "BENGALI-DEVANAGARI", - "[:BENGALI:]", "[:Devanagari:]", - "[\u0951-\u0954\u0943-\u0949\u094a\u0962\u0963\u090D\u090e\u0911\u0912\u0929\u0933\u0934\u0935\u093d\u0950\u0958\u0959\u095a\u095b\u095e\u09f0\u09f1]", /*roundtrip exclusions*/ - }, - new String [] { "DEVANAGARI-BENGALI", - "[:Devanagari:]", "[:BENGALI:]", - "[\u0951-\u0954\u09D7\u090D\u090e\u0911\u0912\u0929\u0933\u0934\u0935\u093d\u0950\u0958\u0959\u095a\u095b\u095e\u09f0\u09f1]", /*roundtrip exclusions*/ - }, - - new String [] { "GURMUKHI-DEVANAGARI", - "[:GURMUKHI:]", "[:Devanagari:]", - "[\u0936\u0933\u0951-\u0954\u0902\u0903\u0943-\u0949\u094a\u0962\u0963\u090B\u090C\u090D\u090e\u0911\u0912\u0934\u0937\u093D\u0950\u0960\u0961\u0a72\u0a73\u0a74]", /*roundtrip exclusions*/ - }, - new String [] { "DEVANAGARI-GURMUKHI", - "[:Devanagari:]", "[:GURMUKHI:]", - "[\u0946\u0A5C\u0951-\u0954\u0A70\u0A71\u090B\u090C\u090D\u090e\u0911\u0912\u0934\u0937\u093D\u0950\u0960\u0961\u0a72\u0a73\u0a74]", /*roundtrip exclusions*/ - }, - - new String [] { "GUJARATI-DEVANAGARI", - "[:GUJARATI:]", "[:Devanagari:]", - "[\u0946\u094A\u0962\u0963\u0951-\u0954\u0961\u090c\u090e\u0912]", /*roundtrip exclusions*/ - }, - new String [] { "DEVANAGARI-GUJARATI", - "[:Devanagari:]", "[:GUJARATI:]", - "[\u0951-\u0954\u0961\u090c\u090e\u0912]", /*roundtrip exclusions*/ - }, - - new String [] { "ORIYA-DEVANAGARI", - "[:ORIYA:]", "[:Devanagari:]", - "[\u0943-\u094a\u0962\u0963\u0951-\u0954\u0950\u090D\u090e\u0912\u0911\u0931\u0935]", /*roundtrip exclusions*/ - }, - new String [] { "DEVANAGARI-ORIYA", - "[:Devanagari:]", "[:ORIYA:]", - "[\u0b5f\u0b56\u0b57\u0950\u090D\u090e\u0912\u0911\u0931\u0935]", /*roundtrip exclusions*/ - }, - - new String [] { "Tamil-DEVANAGARI", - "[:tamil:]", "[:Devanagari:]", - "[\u093c\u0943-\u094a\u0951-\u0954\u0962\u0963\u090B\u090C\u090D\u0911\u0916\u0917\u0918\u091B\u091D\u0920\u0921\u0922\u0925\u0926\u0927\u092B\u092C\u092D\u0936\u093d\u0950[\u0958-\u0961]]", /*roundtrip exclusions*/ - }, - new String [] { "DEVANAGARI-Tamil", - "[:Devanagari:]", "[:tamil:]", - "[\u0bd7]", /*roundtrip exclusions*/ - }, - - new String [] { "Telugu-DEVANAGARI", - "[:telugu:]", "[:Devanagari:]", - "[\u093c\u0950\u0945\u0949\u0951-\u0954\u0962\u0963\u090D\u0911\u093d\u0929\u0934[\u0958-\u095f]]", /*roundtrip exclusions*/ - }, - new String [] { "DEVANAGARI-TELUGU", - "[:Devanagari:]", "[:TELUGU:]", - "[\u0c55\u0c56\u0950\u090D\u0911\u093d\u0929\u0934[\u0958-\u095f]]", /*roundtrip exclusions*/ - }, - - new String [] { "KANNADA-DEVANAGARI", - "[:KANNADA:]", "[:Devanagari:]", - "[\u0946\u093c\u0950\u0945\u0949\u0951-\u0954\u0962\u0963\u0950\u090D\u0911\u093d\u0929\u0934[\u0958-\u095f]]", /*roundtrip exclusions*/ - }, - new String [] { "DEVANAGARI-KANNADA", - "[:Devanagari:]", "[:KANNADA:]", - "[\u0cde\u0cd5\u0cd6\u0950\u090D\u0911\u093d\u0929\u0934[\u0958-\u095f]]", /*roundtrip exclusions*/ - }, - - new String [] { "MALAYALAM-DEVANAGARI", - "[:MALAYALAM:]", "[:Devanagari:]", - "[\u094a\u094b\u094c\u093c\u0950\u0944\u0945\u0949\u0951-\u0954\u0962\u0963\u090D\u0911\u093d\u0929\u0934[\u0958-\u095f]]", /*roundtrip exclusions*/ - }, - new String [] { "DEVANAGARI-MALAYALAM", - "[:Devanagari:]", "[:MALAYALAM:]", - "[\u0d4c\u0d57\u0950\u090D\u0911\u093d\u0929\u0934[\u0958-\u095f]]", /*roundtrip exclusions*/ - }, - - new String [] { "GURMUKHI-BENGALI", - "[:GURMUKHI:]", "[:BENGALI:]", - "[\u09b6\u09e2\u09e3\u09c3\u09c4\u09d7\u098B\u098C\u09B7\u09E0\u09E1\u09F0\u09F1]", /*roundtrip exclusions*/ - }, - new String [] { "BENGALI-GURMUKHI", - "[:BENGALI:]", "[:GURMUKHI:]", - "[\u0a5c\u0a47\u0a70\u0a71\u0A33\u0A35\u0A59\u0A5A\u0A5B\u0A5E\u0A72\u0A73\u0A74]", /*roundtrip exclusions*/ - }, - - new String [] { "GUJARATI-BENGALI", - "[:GUJARATI:]", "[:BENGALI:]", - "[\u09d7\u09e2\u09e3\u098c\u09e1\u09f0\u09f1]", /*roundtrip exclusions*/ - }, - new String [] { "BENGALI-GUJARATI", - "[:BENGALI:]", "[:GUJARATI:]", - "[\u0A82\u0a83\u0Ac9\u0Ac5\u0ac7\u0A8D\u0A91\u0AB3\u0AB5\u0ABD\u0AD0]", /*roundtrip exclusions*/ - }, - - new String [] { "ORIYA-BENGALI", - "[:ORIYA:]", "[:BENGALI:]", - "[\u09c4\u09e2\u09e3\u09f0\u09f1]", /*roundtrip exclusions*/ - }, - new String [] { "BENGALI-ORIYA", - "[:BENGALI:]", "[:ORIYA:]", - "[\u0b5f\u0b56\u0b33\u0b3d]", /*roundtrip exclusions*/ - }, - - new String [] { "Tamil-BENGALI", - "[:tamil:]", "[:BENGALI:]", - "[\u09bc\u09c3\u09c4\u09e2\u09e3\u09f0\u09f1\u098B\u098C\u0996\u0997\u0998\u099B\u099D\u09A0\u09A1\u09A2\u09A5\u09A6\u09A7\u09AB\u09AC\u09AD\u09B6\u09DC\u09DD\u09DF\u09E0\u09E1]", /*roundtrip exclusions*/ - }, - new String [] { "BENGALI-Tamil", - "[:BENGALI:]", "[:tamil:]", - "[\u0bc6\u0bc7\u0bca\u0B8E\u0B92\u0BA9\u0BB1\u0BB3\u0BB4\u0BB5]", /*roundtrip exclusions*/ - }, - - new String [] { "Telugu-BENGALI", - "[:telugu:]", "[:BENGALI:]", - "[\u09e2\u09e3\u09bc\u09d7\u09f0\u09f1\u09dc\u09dd\u09df]", /*roundtrip exclusions*/ - }, - new String [] { "BENGALI-TELUGU", - "[:BENGALI:]", "[:TELUGU:]", - "[\u0c55\u0c56\u0c47\u0c46\u0c4a\u0C0E\u0C12\u0C31\u0C33\u0C35]", /*roundtrip exclusions*/ - }, - - new String [] { "KANNADA-BENGALI", - "[:KANNADA:]", "[:BENGALI:]", - "[\u09e2\u09e3\u09bc\u09d7\u09f0\u09f1\u09dc\u09dd\u09df]", /*roundtrip exclusions*/ - }, - new String [] { "BENGALI-KANNADA", - "[:BENGALI:]", "[:KANNADA:]", - "[\u0cc6\u0cca\u0cd5\u0cd6\u0cc7\u0C8E\u0C92\u0CB1\u0cb3\u0cb5\u0cde]", /*roundtrip exclusions*/ - }, - - new String [] { "MALAYALAM-BENGALI", - "[:MALAYALAM:]", "[:BENGALI:]", - "[\u09e2\u09e3\u09bc\u09c4\u09f0\u09f1\u09dc\u09dd\u09df]", /*roundtrip exclusions*/ - }, - new String [] { "BENGALI-MALAYALAM", - "[:BENGALI:]", "[:MALAYALAM:]", - "[\u0d46\u0d4a\u0d47\u0d31-\u0d35\u0d0e\u0d12]", /*roundtrip exclusions*/ - }, - - new String [] { "GUJARATI-GURMUKHI", - "[:GUJARATI:]", "[:GURMUKHI:]", - "[\u0ab3\u0ab6\u0A70\u0a71\u0a82\u0a83\u0ac3\u0ac4\u0ac5\u0ac9\u0a5c\u0a72\u0a73\u0a74\u0a8b\u0a8d\u0a91\u0abd]", /*roundtrip exclusions*/ - }, - new String [] { "GURMUKHI-GUJARATI", - "[:GURMUKHI:]", "[:GUJARATI:]", - "[\u0ab3\u0ab6\u0A70\u0a71\u0a82\u0a83\u0ac3\u0ac4\u0ac5\u0ac9\u0a5c\u0a72\u0a73\u0a74\u0a8b\u0a8d\u0a91\u0ab7\u0abd\u0ad0\u0ae0]", /*roundtrip exclusions*/ - }, - - new String [] { "ORIYA-GURMUKHI", - "[:ORIYA:]", "[:GURMUKHI:]", - "[\u0a5c\u0a21\u0a47\u0a71\u0b02\u0b03\u0b33\u0b36\u0b43\u0b56\u0b57\u0B0B\u0B0C\u0B37\u0B3D\u0B5F\u0B60\u0B61\u0a35\u0a72\u0a73\u0a74]", /*roundtrip exclusions*/ - }, - new String [] { "GURMUKHI-ORIYA", - "[:GURMUKHI:]", "[:ORIYA:]", - "[\u0a71\u0b02\u0b03\u0b33\u0b36\u0b43\u0b56\u0b57\u0B0B\u0B0C\u0B37\u0B3D\u0B5F\u0B60\u0B61]", /*roundtrip exclusions*/ - }, - - new String [] { "TAMIL-GURMUKHI", - "[:TAMIL:]", "[:GURMUKHI:]", - "[\u0a33\u0a36\u0a3c\u0a70\u0a71\u0a47\u0A16\u0A17\u0A18\u0A1B\u0A1D\u0A20\u0A21\u0A22\u0A25\u0A26\u0A27\u0A2B\u0A2C\u0A2D\u0A59\u0A5A\u0A5B\u0A5C\u0A5E\u0A72\u0A73\u0A74]", /*roundtrip exclusions*/ - }, - new String [] { "GURMUKHI-TAMIL", - "[:GURMUKHI:]", "[:TAMIL:]", - "[\u0bc6\u0bca\u0bd7\u0bb7\u0bb3\u0b83\u0B8E\u0B92\u0BA9\u0BB1\u0BB4]", /*roundtrip exclusions*/ - }, - - new String [] { "TELUGU-GURMUKHI", - "[:TELUGU:]", "[:GURMUKHI:]", - "[\u0a33\u0a36\u0a3c\u0a70\u0a71\u0A59\u0A5A\u0A5B\u0A5C\u0A5E\u0A72\u0A73\u0A74]", /*roundtrip exclusions*/ - }, - new String [] { "GURMUKHI-TELUGU", - "[:GURMUKHI:]", "[:TELUGU:]", - "[\u0c02\u0c03\u0c33\u0c36\u0c44\u0c43\u0c46\u0c4a\u0c56\u0c55\u0C0B\u0C0C\u0C0E\u0C12\u0C31\u0C37\u0C60\u0C61]", /*roundtrip exclusions*/ - }, - new String [] { "KANNADA-GURMUKHI", - "[:KANNADA:]", "[:GURMUKHI:]", - "[\u0a33\u0a36\u0a3c\u0a70\u0a71\u0A59\u0A5A\u0A5B\u0A5C\u0A5E\u0A72\u0A73\u0A74]", /*roundtrip exclusions*/ - }, - new String [] { "GURMUKHI-KANNADA", - "[:GURMUKHI:]", "[:KANNADA:]", - "[\u0c83\u0cb3\u0cb6\u0cc4\u0cc3\u0cc6\u0cca\u0cd5\u0cd6\u0C8B\u0C8C\u0C8E\u0C92\u0CB1\u0CB7\u0CE0\u0CE1]", /*roundtrip exclusions*/ - }, - - new String [] { "MALAYALAM-GURMUKHI", - "[:MALAYALAM:]", "[:GURMUKHI:]", - "[\u0a4b\u0a4c\u0a33\u0a36\u0a3c\u0a70\u0a71\u0A59\u0A5A\u0A5B\u0A5C\u0A5E\u0A72\u0A73\u0A74]", /*roundtrip exclusions*/ - }, - new String [] { "GURMUKHI-MALAYALAM", - "[:GURMUKHI:]", "[:MALAYALAM:]", - "[\u0d03\u0d33\u0d36\u0d43\u0d46\u0d4a\u0d4c\u0d57\u0D0B\u0D0C\u0D0E\u0D12\u0D31\u0D34\u0D37\u0D60\u0D61]", /*roundtrip exclusions*/ - }, - - new String [] { "GUJARATI-ORIYA", - "[:GUJARATI:]", "[:ORIYA:]", - "[\u0b56\u0b57\u0B0C\u0B5F\u0B61]", /*roundtrip exclusions*/ - }, - new String [] { "ORIYA-GUJARATI", - "[:ORIYA:]", "[:GUJARATI:]", - "[\u0Ac4\u0Ac5\u0Ac9\u0Ac7\u0A8D\u0A91\u0AB5\u0Ad0]", /*roundtrip exclusions*/ - }, - - new String [] { "TAMIL-GUJARATI", - "[:TAMIL:]", "[:GUJARATI:]", - "[\u0abc\u0ac3\u0Ac4\u0Ac5\u0Ac9\u0Ac7\u0A8B\u0A8D\u0A91\u0A96\u0A97\u0A98\u0A9B\u0A9D\u0AA0\u0AA1\u0AA2\u0AA5\u0AA6\u0AA7\u0AAB\u0AAC\u0AAD\u0AB6\u0ABD\u0AD0\u0AE0]", /*roundtrip exclusions*/ - }, - new String [] { "GUJARATI-TAMIL", - "[:GUJARATI:]", "[:TAMIL:]", - "[\u0Bc6\u0Bca\u0Bd7\u0B8E\u0B92\u0BA9\u0BB1\u0BB4]", /*roundtrip exclusions*/ - }, - - new String [] { "TELUGU-GUJARATI", - "[:TELUGU:]", "[:GUJARATI:]", - "[\u0abc\u0Ac5\u0Ac9\u0A8D\u0A91\u0ABD\u0Ad0]", /*roundtrip exclusions*/ - }, - new String [] { "GUJARATI-TELUGU", - "[:GUJARATI:]", "[:TELUGU:]", - "[\u0c46\u0c4a\u0c55\u0c56\u0C0C\u0C0E\u0C12\u0C31\u0C61]", /*roundtrip exclusions*/ - }, - - new String [] { "KANNADA-GUJARATI", - "[:KANNADA:]", "[:GUJARATI:]", - "[\u0abc\u0Ac5\u0Ac9\u0A8D\u0A91\u0ABD\u0Ad0]", /*roundtrip exclusions*/ - }, - new String [] { "GUJARATI-KANNADA", - "[:GUJARATI:]", "[:KANNADA:]", - "[\u0cc6\u0cca\u0cd5\u0cd6\u0C8C\u0C8E\u0C92\u0CB1\u0CDE\u0CE1]", /*roundtrip exclusions*/ - }, - - new String [] { "MALAYALAM-GUJARATI", - "[:MALAYALAM:]", "[:GUJARATI:]", - "[\u0ac4\u0acb\u0acc\u0abc\u0Ac5\u0Ac9\u0A8D\u0A91\u0ABD\u0Ad0]", /*roundtrip exclusions*/ - }, - new String [] { "GUJARATI-MALAYALAM", - "[:GUJARATI:]", "[:MALAYALAM:]", - "[\u0d46\u0d4a\u0d4c\u0d55\u0d57\u0D0C\u0D0E\u0D12\u0D31\u0D34\u0D61]", /*roundtrip exclusions*/ - }, - - new String [] { "TAMIL-ORIYA", - "[:TAMIL:]", "[:ORIYA:]", - "[\u0b3c\u0b43\u0b56\u0B0B\u0B0C\u0B16\u0B17\u0B18\u0B1B\u0B1D\u0B20\u0B21\u0B22\u0B25\u0B26\u0B27\u0B2B\u0B2C\u0B2D\u0B36\u0B3D\u0B5C\u0B5D\u0B5F\u0B60\u0B61]", /*roundtrip exclusions*/ - }, - new String [] { "ORIYA-TAMIL", - "[:ORIYA:]", "[:TAMIL:]", - "[\u0bc6\u0bca\u0bc7\u0B8E\u0B92\u0BA9\u0BB1\u0BB4\u0BB5]", /*roundtrip exclusions*/ - }, - - new String [] { "TELUGU-ORIYA", - "[:TELUGU:]", "[:ORIYA:]", - "[\u0b3c\u0b57\u0b56\u0B3D\u0B5C\u0B5D\u0B5F]", /*roundtrip exclusions*/ - }, - new String [] { "ORIYA-TELUGU", - "[:ORIYA:]", "[:TELUGU:]", - "[\u0c44\u0c46\u0c4a\u0c55\u0c47\u0C0E\u0C12\u0C31\u0C35]", /*roundtrip exclusions*/ - }, - - new String [] { "KANNADA-ORIYA", - "[:KANNADA:]", "[:ORIYA:]", - "[\u0b3c\u0b57\u0B3D\u0B5C\u0B5D\u0B5F]", /*roundtrip exclusions*/ - }, - new String [] { "ORIYA-KANNADA", - "[:ORIYA:]", "[:KANNADA:]", - "[\u0cc4\u0cc6\u0cca\u0cd5\u0cc7\u0C8E\u0C92\u0CB1\u0CB5\u0CDE]", /*roundtrip exclusions*/ - }, - - new String [] { "MALAYALAM-ORIYA", - "[:MALAYALAM:]", "[:ORIYA:]", - "[\u0b3c\u0b56\u0B3D\u0B5C\u0B5D\u0B5F]", /*roundtrip exclusions*/ - }, - new String [] { "ORIYA-MALAYALAM", - "[:ORIYA:]", "[:MALAYALAM:]", - "[\u0D47\u0D46\u0D4a\u0D0E\u0D12\u0D31\u0D34\u0D35]", /*roundtrip exclusions*/ - }, - - new String [] { "TELUGU-TAMIL", - "[:TELUGU:]", "[:TAMIL:]", - "[\u0bd7\u0ba9\u0bb4]", /*roundtrip exclusions*/ - }, - new String [] { "TAMIL-TELUGU", - "[:TAMIL:]", "[:TELUGU:]", - "[\u0c43\u0c44\u0c46\u0c47\u0c55\u0c56\u0c66\u0C0B\u0C0C\u0C16\u0C17\u0C18\u0C1B\u0C1D\u0C20\u0C21\u0C22\u0C25\u0C26\u0C27\u0C2B\u0C2C\u0C2D\u0C36\u0C60\u0C61]", /*roundtrip exclusions*/ - }, - - new String [] { "KANNADA-TAMIL", - "[:KANNADA:]", "[:TAMIL:]", - "[\u0bd7\u0bc6\u0ba9\u0bb4]", /*roundtrip exclusions*/ - }, - new String [] { "TAMIL-KANNADA", - "[:TAMIL:]", "[:KANNADA:]", - "[\u0cc3\u0cc4\u0cc6\u0cc7\u0cd5\u0cd6\u0C8B\u0C8C\u0C96\u0C97\u0C98\u0C9B\u0C9D\u0CA0\u0CA1\u0CA2\u0CA5\u0CA6\u0CA7\u0CAB\u0CAC\u0CAD\u0CB6\u0CDE\u0CE0\u0CE1]", /*roundtrip exclusions*/ - }, - - new String [] { "MALAYALAM-TAMIL", - "[:MALAYALAM:]", "[:TAMIL:]", - "[\u0ba9]", /*roundtrip exclusions*/ - }, - new String [] { "TAMIL-MALAYALAM", - "[:TAMIL:]", "[:MALAYALAM:]", - "[\u0d43\u0d12\u0D0B\u0D0C\u0D16\u0D17\u0D18\u0D1B\u0D1D\u0D20\u0D21\u0D22\u0D25\u0D26\u0D27\u0D2B\u0D2C\u0D2D\u0D36\u0D60\u0D61]", /*roundtrip exclusions*/ - }, - - new String [] { "KANNADA-TELUGU", - "[:KANNADA:]", "[:TELUGU:]", - "[\u0c3f\u0c46\u0c48\u0c4a]", /*roundtrip exclusions*/ - }, - new String [] { "TELUGU-KANNADA", - "[:TELUGU:]", "[:KANNADA:]", - "[\u0cc8\u0cd5\u0cd6\u0CDE]", /*roundtrip exclusions*/ - }, - - new String [] { "MALAYALAM-TELUGU", - "[:MALAYALAM:]", "[:TELUGU:]", - "[\u0c44\u0c4a\u0c4c\u0c4b\u0c55\u0c56]", /*roundtrip exclusions*/ - }, - new String [] { "TELUGU-MALAYALAM", - "[:TELUGU:]", "[:MALAYALAM:]", - "[\u0d4c\u0d57\u0D34]", /*roundtrip exclusions*/ - }, - - new String [] { "MALAYALAM-KANNADA", - "[:MALAYALAM:]", "[:KANNADA:]", - "[\u0cc4\u0cc6\u0cca\u0ccc\u0ccb\u0cd5\u0cd6\u0cDe]", /*roundtrip exclusions*/ - }, - new String [] { "Latin-Bengali", - latinForIndic, "[[:Bengali:][\u0964\u0965]]", - "[\u0965\u09f0\u09f1\u0965]", /*roundtrip exclusions*/ - }, - new String [] { "Latin-Gurmukhi", - latinForIndic, "[[:Gurmukhi:][\u0964\u0965]]", - "[\u0965\u0a72\u0a73\u0a74]", /*roundtrip exclusions*/ - }, - new String [] { "Latin-Gujarati", - latinForIndic, "[[:Gujarati:][\u0964\u0965]]", - "[\u0965]", /*roundtrip exclusions*/ - }, - new String [] { "Latin-Oriya", - latinForIndic, "[[:Oriya:][\u0964\u0965]]", - "[\u0965]", /*roundtrip exclusions*/ - }, - new String [] { "Latin-Tamil", - latinForIndic, "[:Tamil:]", - null, /*roundtrip exclusions*/ - }, - new String [] { "Latin-Telugu", - latinForIndic, "[:Telugu:]", - null, /*roundtrip exclusions*/ - }, - new String [] { "Latin-Kannada", - latinForIndic, "[:Kannada:]", - null, /*roundtrip exclusions*/ - }, - new String [] { "Latin-Malayalam", - latinForIndic, "[:Malayalam:]", - null, /*roundtrip exclusions*/ - }, - }; - - public void TestInterIndic() throws Exception{ - int num = array.length; - if (isQuick()) { - logln("Testing only 5 of "+ array.length+" Skipping rest (use -e for exhaustive)"); - num = 5; - } - for(int i=0; i= 0; - } - - public static boolean isRho(char c) { - return "\u03C1\u03A1".indexOf(c) >= 0; - } - - public boolean is(String sourceString) { - try { - String decomp = Normalizer.normalize(sourceString, Normalizer.DECOMP, 0); - - // modern is simpler: don't care about anything but a grave - if (!full) { - if (sourceString.equals("\u039C\u03C0")) return false; - for (int i = 0; i < decomp.length(); ++i) { - char c = decomp.charAt(i); - // exclude all the accents - if (c == '\u0313' || c == '\u0314' || c == '\u0300' || c == '\u0302' - || c == '\u0342' || c == '\u0345' - ) return false; - } - return true; - } - - // Legal full Greek has breathing marks IFF there is a vowel or RHO at the start - // IF it has them, it has exactly one. - // IF it starts with a RHO, then the breathing mark must come before the second letter. - // Since there are no surrogates in greek, don't worry about them - - boolean firstIsVowel = false; - boolean firstIsRho = false; - boolean noLetterYet = true; - int breathingCount = 0; - int letterCount = 0; - for (int i = 0; i < decomp.length(); ++i) { - char c = decomp.charAt(i); - if (UCharacter.isLetter(c)) { - ++letterCount; - if (noLetterYet) { - noLetterYet = false; - firstIsVowel = isVowel(c); - firstIsRho = isRho(c); - } - if (firstIsRho && letterCount == 2 && breathingCount == 0) return false; - } - if (c == '\u0313' || c == '\u0314') { - ++breathingCount; - } - } - - if (firstIsVowel || firstIsRho) return breathingCount == 1; - return breathingCount == 0; - } catch (Throwable t) { - System.out.println(t.getClass().getName() + " " + t.getMessage()); - return true; - } - } - } - - static class Test { - - PrintWriter out; - - private String transliteratorID; - private int errorLimit = 500; - private int errorCount = 0; - private int pairLimit = 0x10000; - UnicodeSet sourceRange; - UnicodeSet targetRange; - UnicodeSet toSource; - UnicodeSet toTarget; - UnicodeSet roundtripExclusions; - - RoundTripTest log; - Legal legalSource; - UnicodeSet badCharacters; - - /* - * create a test for the given script transliterator. - */ - Test(String transliteratorID) { - this.transliteratorID = transliteratorID; - } - - public void setErrorLimit(int limit) { - errorLimit = limit; - } - - public void setPairLimit(int limit) { - pairLimit = limit; - } - - // Added to do better equality check. - - public static boolean isSame(String a, String b) { - if (a.equals(b)) return true; - if (a.equalsIgnoreCase(b) && isCamel(a)) return true; - a = Normalizer.normalize(a, Normalizer.DECOMP, 0); - b = Normalizer.normalize(b, Normalizer.DECOMP, 0); - if (a.equals(b)) return true; - if (a.equalsIgnoreCase(b) && isCamel(a)) return true; - return false; - } - - /* - public boolean includesSome(UnicodeSet set, String a) { - int cp; - for (int i = 0; i < a.length(); i += UTF16.getCharCount(cp)) { - cp = UTF16.charAt(a, i); - if (set.contains(cp)) return true; - } - return false; - } - */ - - public static boolean isCamel(String a) { - //System.out.println("CamelTest"); - // see if string is of the form aB; e.g. lower, then upper or title - int cp; - boolean haveLower = false; - for (int i = 0; i < a.length(); i += UTF16.getCharCount(cp)) { - cp = UTF16.charAt(a, i); - int t = UCharacter.getType(cp); - //System.out.println("\t" + t + " " + Integer.toString(cp,16) + " " + UCharacter.getName(cp)); - switch (t) { - case Character.UPPERCASE_LETTER: - if (haveLower) return true; - break; - case Character.TITLECASE_LETTER: - if (haveLower) return true; - // drop through, since second letter is lower. - case Character.LOWERCASE_LETTER: - haveLower = true; - break; - } - } - //System.out.println("FALSE"); - return false; - } - - static final UnicodeSet okAnyway = new UnicodeSet("[^[:Letter:]]"); - static final UnicodeSet neverOk = new UnicodeSet("[:Other:]"); - - public void test(String sourceRange, String targetRange, String roundtripExclusions, - RoundTripTest log, Legal legalSource) - throws java.io.IOException, java.text.ParseException { - - this.legalSource = legalSource; - this.sourceRange = new UnicodeSet(sourceRange); - this.sourceRange.removeAll(neverOk); - - this.targetRange = new UnicodeSet(targetRange); - this.targetRange.removeAll(neverOk); - - this.toSource = new UnicodeSet(sourceRange); - this.toSource.addAll(okAnyway); - - this.toTarget = new UnicodeSet(targetRange); - this.toTarget.addAll(okAnyway); - - if (roundtripExclusions != null && roundtripExclusions.length() > 0) { - this.roundtripExclusions = new UnicodeSet(roundtripExclusions); - }else{ - this.roundtripExclusions = new UnicodeSet(); // empty - } - - this.log = log; - - log.logln(Utility.escape("Source: " + this.sourceRange)); - log.logln(Utility.escape("Target: " + this.targetRange)); - log.logln(Utility.escape("Exclude: " + this.roundtripExclusions)); - if (log.isQuick()) log.logln("Abbreviated Test"); - - badCharacters = new UnicodeSet("[:other:]"); - - // make a UTF-8 output file we can read with a browser - - // note: check that every transliterator transliterates the null string correctly! - - String logFileName = "test_" + transliteratorID.replace('/', '_') + ".html"; - - File lf = new File(logFileName); - log.logln("Creating log file " + lf.getAbsoluteFile()); - - out = new PrintWriter(new BufferedWriter(new OutputStreamWriter( - new FileOutputStream(logFileName), "UTF8"), 4*1024)); - //out.write('\uFFEF'); // BOM - out.println(""); - out.println(""); - out.println(""); - out.println(""); - try { - test2(); - } catch (TestTruncated e) { - out.println(e.getMessage()); - } - out.println(""); - out.close(); - - if (errorCount > 0) { - log.errln(transliteratorID + " errors: " - + errorCount + (errorCount > errorLimit ? " (at least!)" : "") - + ", see " + lf.getAbsoluteFile()); - } else { - log.logln(transliteratorID + " ok"); - new File(logFileName).delete(); - } - } - - // ok if at least one is not equal - public boolean checkIrrelevants(Transliterator t, String irrelevants) { - for (int i = 0; i < irrelevants.length(); ++i) { - char c = irrelevants.charAt(i); - String cs = UTF16.valueOf(c); - String targ = t.transliterate(cs); - if (cs.equals(targ)) return true; - } - return false; - } - - public void test2() { - - Transliterator sourceToTarget = Transliterator.getInstance(transliteratorID); - Transliterator targetToSource = sourceToTarget.getInverse(); - UnicodeSetIterator usi = new UnicodeSetIterator(); - UnicodeSetIterator usi2 = new UnicodeSetIterator(); - - log.logln("Checking that at least one irrevant characters is not NFC'ed"); - - String irrelevants = "\u2000\u2001\u2126\u212A\u212B\u2329"; // string is from NFC_NO in the UCD - - if (!checkIrrelevants(sourceToTarget, irrelevants)) { - logFails("Source-Target, irrelevants"); - } - if (!checkIrrelevants(targetToSource, irrelevants)) { - logFails("Target-Source, irrelevants"); - } - - if (EXTRA_TESTS) { - log.logln("Checking that toRules works"); - String rules = ""; - Transliterator sourceToTarget2; - Transliterator targetToSource2; - try { - rules = sourceToTarget.toRules(false); - sourceToTarget2 = Transliterator.createFromRules("s2t2", rules, Transliterator.FORWARD); - if (PRINT_RULES) { - out.println("

Forward Rules:

"); - out.println(TestUtility.replace(rules, "\n", "
\n")); - out.println("

"); - } - rules = targetToSource.toRules(false); - targetToSource2 = Transliterator.createFromRules("t2s2", rules, Transliterator.FORWARD); - if (PRINT_RULES) { - out.println("

Backward Rules:

"); - out.println(TestUtility.replace(rules, "\n", "
\n")); - out.println("

"); - } - } catch (RuntimeException e) { - out.println("

Broken Rules:

"); - out.println(TestUtility.replace(rules, "\n", "
\n")); - out.println("

"); - out.flush(); - throw e; - } - - usi.reset(sourceRange); - while (true) { - int c = usi.next(); - if (c < 0) break; - - String cs = UTF16.valueOf(c); - String targ = sourceToTarget.transliterate(cs); - String targ2 = sourceToTarget2.transliterate(cs); - if (!targ.equals(targ2)) { - logToRulesFails("Source-Target, toRules", cs, targ, targ2); - } - } - - usi.reset(targetRange); - while (true) { - int c = usi.next(); - if (c < 0) break; - - String cs = UTF16.valueOf(c); - String targ = targetToSource.transliterate(cs); - String targ2 = targetToSource2.transliterate(cs); - if (!targ.equals(targ2)) { - logToRulesFails("Target-Source, toRules", cs, targ, targ2); - } - } - } - - - log.logln("Checking that source characters convert to target - Singles"); - - UnicodeSet failSourceTarg = new UnicodeSet(); - - /* - for (char c = 0; c < 0xFFFF; ++c) { - if (!sourceRange.contains(c)) continue; - */ - usi.reset(sourceRange); - while (true) { - int c = usi.next(); - if (c < 0) break; - - String cs = UTF16.valueOf(c); - String targ = sourceToTarget.transliterate(cs); - if (!UnicodeSetIterator.containsAll(toTarget, targ) - || UnicodeSetIterator.containsSome(badCharacters, targ)) { - String targD = Normalizer.normalize(targ, Normalizer.DECOMP, 0); - if (!UnicodeSetIterator.containsAll(toTarget, targD) - || UnicodeSetIterator.containsSome(badCharacters, targD)) { - logWrongScript("Source-Target", cs, targ); - failSourceTarg.add(c); - continue; - } - } - - String cs2 = Normalizer.normalize(cs, Normalizer.DECOMP, 0); - String targ2 = sourceToTarget.transliterate(cs2); - if (!targ.equals(targ2)) { - logNotCanonical("Source-Target", cs, targ, cs2, targ2); - } - } - - log.logln("Checking that source characters convert to target - Doubles"); - - /* - for (char c = 0; c < 0xFFFF; ++c) { - if (TestUtility.isUnassigned(c) || - !sourceRange.contains(c)) continue; - if (failSourceTarg.get(c)) continue; - - */ - - UnicodeSet sourceRangeMinusFailures = new UnicodeSet(sourceRange); - sourceRangeMinusFailures.removeAll(failSourceTarg); - - boolean skipSome = log.getInclusion() < 10; - - usi.reset(sourceRangeMinusFailures, skipSome); - while (true) { - int c = usi.next(); - if (c < 0) break; - - /* - for (char d = 0; d < 0xFFFF; ++d) { - if (TestUtility.isUnassigned(d) || - !sourceRange.contains(d)) continue; - if (failSourceTarg.get(d)) continue; - */ - usi2.reset(sourceRangeMinusFailures, skipSome); - while (true) { - int d = usi2.next(); - if (d < 0) break; - - String cs = UTF16.valueOf(c) + UTF16.valueOf(d); - String targ = sourceToTarget.transliterate(cs); - if (!UnicodeSetIterator.containsAll(toTarget,targ) - || UnicodeSetIterator.containsSome(badCharacters, targ)) { - String targD = Normalizer.normalize(targ, Normalizer.DECOMP, 0); - if (!UnicodeSetIterator.containsAll(toTarget,targD) - || UnicodeSetIterator.containsSome(badCharacters, targD)) { - logWrongScript("Source-Target", cs, targ); - continue; - } - } - String cs2 = Normalizer.normalize(cs, Normalizer.DECOMP, 0); - String targ2 = sourceToTarget.transliterate(cs2); - if (!targ.equals(targ2)) { - logNotCanonical("Source-Target", cs, targ, cs2, targ2); - } - } - } - - log.logln("Checking that target characters convert to source and back - Singles"); - - UnicodeSet failTargSource = new UnicodeSet(); - UnicodeSet failRound = new UnicodeSet(); - - /*for (char c = 0; c < 0xFFFF; ++c) { - if (TestUtility.isUnassigned(c) || - !targetRange.contains(c)) continue; - */ - - usi.reset(targetRange); - while (true) { - int c = usi.next(); - if (c < 0) break; - - String cs = UTF16.valueOf(c); - String targ = targetToSource.transliterate(cs); - String reverse = sourceToTarget.transliterate(targ); - - if (!UnicodeSetIterator.containsAll(toSource, targ) - || UnicodeSetIterator.containsSome(badCharacters, targ)) { - String targD = Normalizer.normalize(targ, Normalizer.DECOMP, 0); - if (!UnicodeSetIterator.containsAll(toSource, targD) - || UnicodeSetIterator.containsSome(badCharacters, targD)) { - logWrongScript("Target-Source", cs, targ); - failTargSource.add(c); - continue; - } - } - if (!isSame(cs, reverse) && !roundtripExclusions.contains(c)) { - logRoundTripFailure(cs,targetToSource.getID(), targ,sourceToTarget.getID(), reverse); - failRound.add(c); - continue; - } - String targ2 = Normalizer.normalize(targ, Normalizer.DECOMP, 0); - String reverse2 = sourceToTarget.transliterate(targ2); - if (!reverse.equals(reverse2)) { - logNotCanonical("Target-Source", targ, reverse, targ2, reverse2); - } - } - - log.logln("Checking that target characters convert to source and back - Doubles"); - int count = 0; - - UnicodeSet targetRangeMinusFailures = new UnicodeSet(targetRange); - targetRangeMinusFailures.removeAll(failTargSource); - targetRangeMinusFailures.removeAll(failRound); - - //char[] buf = new char[4]; // maximum we can have with 2 code points - /* - for (char c = 0; c < 0xFFFF; ++c) { - if (TestUtility.isUnassigned(c) || - !targetRange.contains(c)) continue; - */ - - usi.reset(targetRangeMinusFailures, skipSome); - - while (true) { - int c = usi.next(); - if (c < 0) break; - - if (++count > pairLimit) { - throw new TestTruncated("Test truncated at " + pairLimit + " x 64k pairs"); - } - log.log(TestUtility.hex(c)); - - /* - for (char d = 0; d < 0xFFFF; ++d) { - if (TestUtility.isUnassigned(d) || - !targetRange.contains(d)) continue; - */ - usi2.reset(targetRangeMinusFailures, skipSome); - while (true) { - int d = usi2.next(); - if (d < 0) break; - - String cs = UTF16.valueOf(c) + UTF16.valueOf(d); - String targ = targetToSource.transliterate(cs); - String reverse = sourceToTarget.transliterate(targ); - - if (!UnicodeSetIterator.containsAll(toSource, targ) /*&& !failTargSource.contains(c) && !failTargSource.contains(d)*/ - || UnicodeSetIterator.containsSome(badCharacters, targ)) { - String targD = Normalizer.normalize(targ, Normalizer.DECOMP, 0); - if (!UnicodeSetIterator.containsAll(toSource, targD) /*&& !failTargSource.contains(c) && !failTargSource.contains(d)*/ - || UnicodeSetIterator.containsSome(badCharacters, targD)) { - logWrongScript("Target-Source", cs, targ); - continue; - } - } - if (!isSame(cs, reverse) /*&& !failRound.contains(c) && !failRound.contains(d)*/ - && !roundtripExclusions.contains(c) && !roundtripExclusions.contains(d)) { - logRoundTripFailure(cs,targetToSource.getID(), targ,sourceToTarget.getID(), reverse); - continue; - } - String targ2 = Normalizer.normalize(targ, Normalizer.DECOMP, 0); - String reverse2 = sourceToTarget.transliterate(targ2); - if (!reverse.equals(reverse2)) { - logNotCanonical("Target-Source", targ, reverse, targ2, reverse2); - } - } - } - log.logln(""); - } - - final void logWrongScript(String label, String from, String to) { - if (++errorCount > errorLimit) { - throw new TestTruncated("Test truncated; too many failures"); - } - out.println("
Fail " + label + ": " + - from + " (" + - TestUtility.hex(from) + ") => " + - to + " (" + - TestUtility.hex(to) + ")" - ); - } - - final void logNotCanonical(String label, String from, String to, String fromCan, String toCan) { - if (++errorCount > errorLimit) { - throw new TestTruncated("Test truncated; too many failures"); - } - out.println("
Fail (can.equiv)" + label + ": " + - from + " (" + - TestUtility.hex(from) + ") => " + - to + " (" + - TestUtility.hex(to) + ")" + - " -- " + - fromCan + " (" + - TestUtility.hex(fromCan) + ") => " + - toCan + " (" + - TestUtility.hex(toCan) + ")" - ); - } - - final void logFails(String label) { - if (++errorCount > errorLimit) { - throw new TestTruncated("Test truncated; too many failures"); - } - out.println("
Fail (can.equiv)" + label); - } - - final void logToRulesFails(String label, String from, String to, String toCan) { - if (++errorCount > errorLimit) { - throw new TestTruncated("Test truncated; too many failures"); - } - out.println("
Fail (can.equiv)" + label + ": " + - from + " (" + - TestUtility.hex(from) + ") => " + - to + " (" + - TestUtility.hex(to) + ")" + - toCan + " (" + - TestUtility.hex(toCan) + ")" - ); - } - - final void logRoundTripFailure(String from,String toID, String to,String backID, String back) { - if (!legalSource.is(from)) return; // skip illegals - - if (++errorCount > errorLimit) { - throw new TestTruncated("Test truncated; too many failures"); - } - out.println("
Fail Roundtrip: " + - from + " (" + - TestUtility.hex(from) + ") "+toID+"=> " + - to + " (" + - TestUtility.hex(to) + ") " + backID+"=> " + - back + " (" + - TestUtility.hex(back) + ")" - ); - } - - /* - * Characters to filter for source-target mapping completeness - * Typically is base alphabet, minus extended characters - * Default is ASCII letters for Latin - */ - /* - public boolean isSource(char c) { - if (!sourceRange.contains(c)) return false; - return true; - } - */ - - /* - * Characters to check for target back to source mapping. - * Typically the same as the target script, plus punctuation - */ - /* - public boolean isReceivingSource(char c) { - if (!targetRange.contains(c)) return false; - return true; - } - */ - /* - * Characters to filter for target-source mapping - * Typically is base alphabet, minus extended characters - */ - /* - public boolean isTarget(char c) { - byte script = TestUtility.getScript(c); - if (script != targetScript) return false; - if (!TestUtility.isLetter(c)) return false; - if (targetRange != null && !targetRange.contains(c)) return false; - return true; - } - */ - - /* - * Characters to check for target-source mapping - * Typically the same as the source script, plus punctuation - */ - /* - public boolean isReceivingTarget(char c) { - byte script = TestUtility.getScript(c); - return (script == targetScript || script == TestUtility.COMMON_SCRIPT); - } - - final boolean isSource(String s) { - for (int i = 0; i < s.length(); ++i) { - if (!isSource(s.charAt(i))) return false; - } - return true; - } - - final boolean isTarget(String s) { - for (int i = 0; i < s.length(); ++i) { - if (!isTarget(s.charAt(i))) return false; - } - return true; - } - - final boolean isReceivingSource(String s) { - for (int i = 0; i < s.length(); ++i) { - if (!isReceivingSource(s.charAt(i))) return false; - } - return true; - } - - final boolean isReceivingTarget(String s) { - for (int i = 0; i < s.length(); ++i) { - if (!isReceivingTarget(s.charAt(i))) return false; - } - return true; - } - */ - - static class TestTruncated extends RuntimeException { - TestTruncated(String msg) { - super(msg); - } - } - } - -// static class TestHangul extends Test { -// TestHangul () { -// super("Jamo-Hangul", TestUtility.JAMO_SCRIPT, TestUtility.HANGUL_SCRIPT); -// } -// -// public boolean isSource(char c) { -// if (0x1113 <= c && c <= 0x1160) return false; -// if (0x1176 <= c && c <= 0x11F9) return false; -// if (0x3131 <= c && c <= 0x318E) return false; -// return super.isSource(c); -// } -// } -} diff --git a/icu4j/src/com/ibm/test/translit/TestUtility.java b/icu4j/src/com/ibm/test/translit/TestUtility.java deleted file mode 100755 index 7a73f9d14d..0000000000 --- a/icu4j/src/com/ibm/test/translit/TestUtility.java +++ /dev/null @@ -1,439 +0,0 @@ -package com.ibm.test.translit; -import com.ibm.text.UCharacter; -import com.ibm.text.UCharacterCategory; -import com.ibm.text.*; - -public final class TestUtility { - - public static String hex(char ch) { - String foo = Integer.toString(ch,16).toUpperCase(); - return "0000".substring(0,4-foo.length()) + foo; - } - - public static String hex(int ch) { - String foo = Integer.toString(ch,16).toUpperCase(); - return "00000000".substring(0,4-foo.length()) + foo; - } - - public static String hex(String s) { - return hex(s,","); - } - - public static String hex(String s, String sep) { - if (s.length() == 0) return ""; - String result = hex(s.charAt(0)); - for (int i = 1; i < s.length(); ++i) { - result += sep; - result += hex(s.charAt(i)); - } - return result; - } - - public static String replace(String source, String toBeReplaced, String replacement) { - StringBuffer results = new StringBuffer(); - int len = toBeReplaced.length(); - for (int i = 0; i < source.length(); ++i) { - if (source.regionMatches(false, i, toBeReplaced, 0, len)) { - results.append(replacement); - i += len - 1; // minus one, since we will increment - } else { - results.append(source.charAt(i)); - } - } - return results.toString(); - } - - public static String replaceAll(String source, UnicodeSet set, String replacement) { - StringBuffer results = new StringBuffer(); - int cp; - for (int i = 0; i < source.length(); i += UTF16.getCharCount(cp)) { - cp = UTF16.charAt(source,i); - if (set.contains(cp)) { - results.append(replacement); - } else { - UTF16.append(results, cp); - } - } - return results.toString(); - } - - // COMMENTED OUT ALL THE OLD SCRIPT STUFF - /* - public static byte getScript(char c) { - return getScript(getBlock(c)); - } - - public static byte getScript(byte block) { - return blockToScript[block]; - } - - public static byte getBlock(char c) { - int index = c >> 7; - byte block = charToBlock[index]; - while (block < 0) { // take care of exceptions, blocks split across 128 boundaries - int[] tuple = split[-block-1]; - if (c < tuple[0]) block = (byte)tuple[1]; - else block = (byte)tuple[2]; - } - return block; - } - - // returns next letter of script, or 0xFFFF if done - - public static char getNextLetter(char c, byte script) { - while (c < 0xFFFF) { - ++c; - if (getScript(c) == script && Character.isLetter(c)) { - return c; - } - } - return c; - } - - // Supplements to Character methods; these methods go through - // UCharacter if possible. If not, they fall back to Character. - - public static boolean isUnassigned(char c) { - try { - return UCharacter.getType(c) == UCharacterCategory.UNASSIGNED; - } catch (NullPointerException e) { - System.out.print(""); - } - return Character.getType(c) == Character.UNASSIGNED; - } - - public static boolean isLetter(char c) { - try { - return UCharacter.isLetter(c); - } catch (NullPointerException e) { - System.out.print(""); - } - return Character.isLetter(c); - } - - public static void main(String[] args) { - System.out.println("Blocks: "); - byte lastblock = -128; - for (char cc = 0; cc < 0xFFFF; ++cc) { - byte block = TestUtility.getBlock(cc); - if (block != lastblock) { - System.out.println(TestUtility.hex(cc) + "\t" + block); - lastblock = block; - } - } - System.out.println(); - System.out.println("Scripts: "); - byte lastScript = -128; - for (char cc = 0; cc < 0xFFFF; ++cc) { - byte script = TestUtility.getScript(cc); - if (script != lastScript) { - System.out.println(TestUtility.hex(cc) + "\t" + script); - lastScript = script; - } - } - } - - - - public static final byte // SCRIPT CODE - COMMON_SCRIPT = 0, - LATIN_SCRIPT = 1, - GREEK_SCRIPT = 2, - CYRILLIC_SCRIPT = 3, - ARMENIAN_SCRIPT = 4, - HEBREW_SCRIPT = 5, - ARABIC_SCRIPT = 6, - SYRIAC_SCRIPT = 7, - THAANA_SCRIPT = 8, - DEVANAGARI_SCRIPT = 9, - BENGALI_SCRIPT = 10, - GURMUKHI_SCRIPT = 11, - GUJARATI_SCRIPT = 12, - ORIYA_SCRIPT = 13, - TAMIL_SCRIPT = 14, - TELUGU_SCRIPT = 15, - KANNADA_SCRIPT = 16, - MALAYALAM_SCRIPT = 17, - SINHALA_SCRIPT = 18, - THAI_SCRIPT = 19, - LAO_SCRIPT = 20, - TIBETAN_SCRIPT = 21, - MYANMAR_SCRIPT = 22, - GEORGIAN_SCRIPT = 23, - JAMO_SCRIPT = 24, - HANGUL_SCRIPT = 25, - ETHIOPIC_SCRIPT = 26, - CHEROKEE_SCRIPT = 27, - ABORIGINAL_SCRIPT = 28, - OGHAM_SCRIPT = 29, - RUNIC_SCRIPT = 30, - KHMER_SCRIPT = 31, - MONGOLIAN_SCRIPT = 32, - HIRAGANA_SCRIPT = 33, - KATAKANA_SCRIPT = 34, - BOPOMOFO_SCRIPT = 35, - HAN_SCRIPT = 36, - YI_SCRIPT = 37; - - public static final byte // block code - RESERVED_BLOCK = 0, - BASIC_LATIN = 1, - LATIN_1_SUPPLEMENT = 2, - LATIN_EXTENDED_A = 3, - LATIN_EXTENDED_B = 4, - IPA_EXTENSIONS = 5, - SPACING_MODIFIER_LETTERS = 6, - COMBINING_DIACRITICAL_MARKS = 7, - GREEK = 8, - CYRILLIC = 9, - ARMENIAN = 10, - HEBREW = 11, - ARABIC = 12, - SYRIAC = 13, - THAANA = 14, - DEVANAGARI = 15, - BENGALI = 16, - GURMUKHI = 17, - GUJARATI = 18, - ORIYA = 19, - TAMIL = 20, - TELUGU = 21, - KANNADA = 22, - MALAYALAM = 23, - SINHALA = 24, - THAI = 25, - LAO = 26, - TIBETAN = 27, - MYANMAR = 28, - GEORGIAN = 29, - HANGUL_JAMO = 30, - ETHIOPIC = 31, - CHEROKEE = 32, - UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS = 33, - OGHAM = 34, - RUNIC = 35, - KHMER = 36, - MONGOLIAN = 37, - LATIN_EXTENDED_ADDITIONAL = 38, - GREEK_EXTENDED = 39, - GENERAL_PUNCTUATION = 40, - SUPERSCRIPTS_AND_SUBSCRIPTS = 41, - CURRENCY_SYMBOLS = 42, - COMBINING_MARKS_FOR_SYMBOLS = 43, - LETTERLIKE_SYMBOLS = 44, - NUMBER_FORMS = 45, - ARROWS = 46, - MATHEMATICAL_OPERATORS = 47, - MISCELLANEOUS_TECHNICAL = 48, - CONTROL_PICTURES = 49, - OPTICAL_CHARACTER_RECOGNITION = 50, - ENCLOSED_ALPHANUMERICS = 51, - BOX_DRAWING = 52, - BLOCK_ELEMENTS = 53, - GEOMETRIC_SHAPES = 54, - MISCELLANEOUS_SYMBOLS = 55, - DINGBATS = 56, - BRAILLE_PATTERNS = 57, - CJK_RADICALS_SUPPLEMENT = 58, - KANGXI_RADICALS = 59, - IDEOGRAPHIC_DESCRIPTION_CHARACTERS = 60, - CJK_SYMBOLS_AND_PUNCTUATION = 61, - HIRAGANA = 62, - KATAKANA = 63, - BOPOMOFO = 64, - HANGUL_COMPATIBILITY_JAMO = 65, - KANBUN = 66, - BOPOMOFO_EXTENDED = 67, - ENCLOSED_CJK_LETTERS_AND_MONTHS = 68, - CJK_COMPATIBILITY = 69, - CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A = 70, - CJK_UNIFIED_IDEOGRAPHS = 71, - YI_SYLLABLES = 72, - YI_RADICALS = 73, - HANGUL_SYLLABLES = 74, - HIGH_SURROGATES = 75, - HIGH_PRIVATE_USE_SURROGATES = 76, - LOW_SURROGATES = 77, - PRIVATE_USE = 78, - CJK_COMPATIBILITY_IDEOGRAPHS = 79, - ALPHABETIC_PRESENTATION_FORMS = 80, - ARABIC_PRESENTATION_FORMS_A = 81, - COMBINING_HALF_MARKS = 82, - CJK_COMPATIBILITY_FORMS = 83, - SMALL_FORM_VARIANTS = 84, - ARABIC_PRESENTATION_FORMS_B = 85, - SPECIALS = 86, - HALFWIDTH_AND_FULLWIDTH_FORMS = 87; - - static final byte[] blockToScript = { - COMMON_SCRIPT, // 0, - LATIN_SCRIPT, // 1, BASIC_LATIN - LATIN_SCRIPT, // 2, LATIN_1_SUPPLEMENT - LATIN_SCRIPT, // 3, LATIN_EXTENDED_A - LATIN_SCRIPT, // 4, LATIN_EXTENDED_B - LATIN_SCRIPT, // 5, IPA_EXTENSIONS - COMMON_SCRIPT, // 6, SPACING_MODIFIER_LETTERS - COMMON_SCRIPT, // 7, COMBINING_DIACRITICAL_MARKS - GREEK_SCRIPT, // 8, GREEK - CYRILLIC_SCRIPT, // 9, CYRILLIC - ARMENIAN_SCRIPT, // 10, ARMENIAN - HEBREW_SCRIPT, // 11, HEBREW - ARABIC_SCRIPT, // 12, ARABIC - SYRIAC_SCRIPT, // 13, SYRIAC - THAANA_SCRIPT, // 14, THAANA - DEVANAGARI_SCRIPT, // 15, DEVANAGARI - BENGALI_SCRIPT, // 16, BENGALI - GURMUKHI_SCRIPT, // 17, GURMUKHI - GUJARATI_SCRIPT, // 18, GUJARATI - ORIYA_SCRIPT, // 19, ORIYA - TAMIL_SCRIPT, // 20, TAMIL - TELUGU_SCRIPT, // 21, TELUGU - KANNADA_SCRIPT, // 22, KANNADA - MALAYALAM_SCRIPT, // 23, MALAYALAM - SINHALA_SCRIPT, // 24, SINHALA - THAI_SCRIPT, // 25, THAI - LAO_SCRIPT, // 26, LAO - TIBETAN_SCRIPT, // 27, TIBETAN - MYANMAR_SCRIPT, // 28, MYANMAR - GEORGIAN_SCRIPT, // 29, GEORGIAN - JAMO_SCRIPT, // 30, HANGUL_JAMO - ETHIOPIC_SCRIPT, // 31, ETHIOPIC - CHEROKEE_SCRIPT, // 32, CHEROKEE - ABORIGINAL_SCRIPT, // 33, UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS - OGHAM_SCRIPT, // 34, OGHAM - RUNIC_SCRIPT, // 35, RUNIC - KHMER_SCRIPT, // 36, KHMER - MONGOLIAN_SCRIPT, // 37, MONGOLIAN - LATIN_SCRIPT, // 38, LATIN_EXTENDED_ADDITIONAL - GREEK_SCRIPT, // 39, GREEK_EXTENDED - COMMON_SCRIPT, // 40, GENERAL_PUNCTUATION - COMMON_SCRIPT, // 41, SUPERSCRIPTS_AND_SUBSCRIPTS - COMMON_SCRIPT, // 42, CURRENCY_SYMBOLS - COMMON_SCRIPT, // 43, COMBINING_MARKS_FOR_SYMBOLS - COMMON_SCRIPT, // 44, LETTERLIKE_SYMBOLS - COMMON_SCRIPT, // 45, NUMBER_FORMS - COMMON_SCRIPT, // 46, ARROWS - COMMON_SCRIPT, // 47, MATHEMATICAL_OPERATORS - COMMON_SCRIPT, // 48, MISCELLANEOUS_TECHNICAL - COMMON_SCRIPT, // 49, CONTROL_PICTURES - COMMON_SCRIPT, // 50, OPTICAL_CHARACTER_RECOGNITION - COMMON_SCRIPT, // 51, ENCLOSED_ALPHANUMERICS - COMMON_SCRIPT, // 52, BOX_DRAWING - COMMON_SCRIPT, // 53, BLOCK_ELEMENTS - COMMON_SCRIPT, // 54, GEOMETRIC_SHAPES - COMMON_SCRIPT, // 55, MISCELLANEOUS_SYMBOLS - COMMON_SCRIPT, // 56, DINGBATS - COMMON_SCRIPT, // 57, BRAILLE_PATTERNS - HAN_SCRIPT, // 58, CJK_RADICALS_SUPPLEMENT - HAN_SCRIPT, // 59, KANGXI_RADICALS - HAN_SCRIPT, // 60, IDEOGRAPHIC_DESCRIPTION_CHARACTERS - COMMON_SCRIPT, // 61, CJK_SYMBOLS_AND_PUNCTUATION - HIRAGANA_SCRIPT, // 62, HIRAGANA - KATAKANA_SCRIPT, // 63, KATAKANA - BOPOMOFO_SCRIPT, // 64, BOPOMOFO - JAMO_SCRIPT, // 65, HANGUL_COMPATIBILITY_JAMO - HAN_SCRIPT, // 66, KANBUN - BOPOMOFO_SCRIPT, // 67, BOPOMOFO_EXTENDED - COMMON_SCRIPT, // 68, ENCLOSED_CJK_LETTERS_AND_MONTHS - COMMON_SCRIPT, // 69, CJK_COMPATIBILITY - HAN_SCRIPT, // 70, CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A - HAN_SCRIPT, // 71, CJK_UNIFIED_IDEOGRAPHS - YI_SCRIPT, // 72, YI_SYLLABLES - YI_SCRIPT, // 73, YI_RADICALS - HANGUL_SCRIPT, // 74, HANGUL_SYLLABLES - COMMON_SCRIPT, // 75, HIGH_SURROGATES - COMMON_SCRIPT, // 76, HIGH_PRIVATE_USE_SURROGATES - COMMON_SCRIPT, // 77, LOW_SURROGATES - COMMON_SCRIPT, // 78, PRIVATE_USE - HAN_SCRIPT, // 79, CJK_COMPATIBILITY_IDEOGRAPHS - COMMON_SCRIPT, // 80, ALPHABETIC_PRESENTATION_FORMS - ARABIC_SCRIPT, // 81, ARABIC_PRESENTATION_FORMS_A - COMMON_SCRIPT, // 82, COMBINING_HALF_MARKS - COMMON_SCRIPT, // 83, CJK_COMPATIBILITY_FORMS - COMMON_SCRIPT, // 84, SMALL_FORM_VARIANTS - ARABIC_SCRIPT, // 85, ARABIC_PRESENTATION_FORMS_B - COMMON_SCRIPT, // 86, SPECIALS - COMMON_SCRIPT, // 87, HALFWIDTH_AND_FULLWIDTH_FORMS - COMMON_SCRIPT, // 88, SPECIALS - }; - - // could be further reduced to a byte array, but I didn't bother. - static final int[][] split = { - {0x0250, 4, 5}, // -1 - {0x02B0, 5, 6}, // -2 - {0x0370, 7, 8}, // -3 - {0x0530, 0, 10}, // -4 - {0x0590, 10, 11}, // -5 - {0x0750, 13, 0}, // -6 - {0x07C0, 14, 0}, // -7 - {0x10A0, 28, 29}, // -8 - {0x13A0, 0, 32}, // -9 - {0x16A0, 34, 35}, // -10 - {0x18B0, 37, 0}, // -11 - {0x2070, 40, 41}, // -12 - {0x20A0, 41, -31}, // -13 - {0x2150, 44, 45}, // -14 - {0x2190, 45, 46}, // -15 - {0x2440, 49, -32}, // -16 - {0x25A0, 53, 54}, // -17 - {0x27C0, 56, 0}, // -18 - {0x2FE0, 59, -33}, // -19 - {0x3040, 61, 62}, // -20 - {0x30A0, 62, 63}, // -21 - {0x3130, 64, 65}, // -22 - {0x3190, 65, -34}, // -23 - {0x4DB6, 70, 0}, // -24 - {0xA490, 72, -35}, // -25 - {0xD7A4, 74, 0}, // -26 - {0xFB50, 80, 81}, // -27 - {0xFE20, 0, -36}, // -28 - {0xFEFF, 85, 86}, // -29 - {0xFFF0, 87, -37}, // -30 - {0x20D0, 42, 43}, // -31 - {0x2460, 50, 51}, // -32 - {0x2FF0, 0, 60}, // -33 - {0x31A0, 66, -38}, // -34 - {0xA4D0, 73, 0}, //-35 - {0xFE30, 82, -39}, //-36 - {0xFFFE, 88, 0}, //-37 - {0x31C0, 67, 0}, // -38 - {0xFE50, 83, -40}, //-39 - {0xFE70, 84, 85} // -40 - }; - - static final byte[] charToBlock = { - 1, 2, 3, 4, -1, -2, -3, 8, 9, 9, -4, -5, 12, 12, -6, -7, - 0, 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 27, - 28, -8, 30, 30, 31, 31, 31, -9, 33, 33, 33, 33, 33, -10, 0, 36, - 37, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 38, 39, 39, - -12, -13, -14, -15, 47, 47, 48, 48, -16, 51, 52, -17, 55, 55, 56, -18, - 57, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 59, -19, - -20, -21, -22, -23, 68, 68, 69, 69, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, -24, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 72, 72, 72, 72, 72, 72, 72, 72, 72, -25, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, -26, - 75, 75, 75, 75, 75, 75, 75, 76, 77, 77, 77, 77, 77, 77, 77, 77, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, - 78, 78, 79, 79, 79, 79, -27, 81, 81, 81, 81, 81, -28, -29, 87, -30 - }; - */ -} diff --git a/icu4j/src/com/ibm/test/translit/TransliteratorTest.java b/icu4j/src/com/ibm/test/translit/TransliteratorTest.java deleted file mode 100755 index 8baf109f50..0000000000 --- a/icu4j/src/com/ibm/test/translit/TransliteratorTest.java +++ /dev/null @@ -1,2625 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/translit/Attic/TransliteratorTest.java,v $ - * $Date: 2002/02/07 00:56:13 $ - * $Revision: 1.95 $ - * - ***************************************************************************************** - */ -package com.ibm.test.translit; -import com.ibm.text.*; -import com.ibm.test.*; -import com.ibm.util.Utility; -import java.text.*; -import java.util.*; - -/*********************************************************************** - - HOW TO USE THIS TEST FILE - -or- - How I developed on two platforms - without losing (too much of) my mind - - -1. Add new tests by copying/pasting/changing existing tests. On Java, - any public void method named Test...() taking no parameters becomes - a test. On C++, you need to modify the header and add a line to - the runIndexedTest() dispatch method. - -2. Make liberal use of the expect() method; it is your friend. - -3. The tests in this file exactly match those in a sister file on the - other side. The two files are: - - icu4j: src/com/ibm/test/translit/TransliteratorTest.java - icu4c: source/test/intltest/transtst.cpp - - ==> THIS IS THE IMPORTANT PART <== - - When you add a test in this file, add it in transtst.cpp too. - Give it the same name and put it in the same relative place. This - makes maintenance a lot simpler for any poor soul who ends up - trying to synchronize the tests between icu4j and icu4c. - -4. If you MUST enter a test that is NOT paralleled in the sister file, - then add it in the special non-mirrored section. These are - labeled - - "icu4j ONLY" - - or - - "icu4c ONLY" - - Make sure you document the reason the test is here and not there. - - -Thank you. -The Management -***********************************************************************/ - -/** - * @test - * @summary General test of Transliterator - */ -public class TransliteratorTest extends TestFmwk { - - public static void main(String[] args) throws Exception { - new TransliteratorTest().run(args); - } - - public void TestInstantiation() { - long ms = System.currentTimeMillis(); - String ID; - for (Enumeration e = Transliterator.getAvailableIDs(); e.hasMoreElements(); ) { - ID = (String) e.nextElement(); - Transliterator t = null; - try { - t = Transliterator.getInstance(ID); - // We should get a new instance if we try again - Transliterator t2 = Transliterator.getInstance(ID); - if (t != t2) { - logln("OK: " + Transliterator.getDisplayName(ID) + " (" + ID + "): " + t); - } else { - errln("FAIL: " + ID + " returned identical instances"); - t = null; - } - } catch (IllegalArgumentException ex) { - errln("FAIL: " + ID); - throw ex; - } - - if (t != null) { - // Now test toRules - String rules = null; - try { - rules = t.toRules(true); - - Transliterator u = Transliterator.createFromRules("x", - rules, Transliterator.FORWARD); - } catch (IllegalArgumentException ex2) { - errln("FAIL: " + ID + ".toRules() => bad rules: " + - rules); - throw ex2; - } - } - } - - // Now test the failure path - try { - ID = ""; - Transliterator t = Transliterator.getInstance(ID); - errln("FAIL: " + ID + " returned " + t); - } catch (IllegalArgumentException ex) { - logln("OK: Bogus ID handled properly"); - } - - ms = System.currentTimeMillis() - ms; - logln("Elapsed time: " + ms + " ms"); - } - - public void TestSimpleRules() { - /* Example: rules 1. ab>x|y - * 2. yc>z - * - * []|eabcd start - no match, copy e to tranlated buffer - * [e]|abcd match rule 1 - copy output & adjust cursor - * [ex|y]cd match rule 2 - copy output & adjust cursor - * [exz]|d no match, copy d to transliterated buffer - * [exzd]| done - */ - expect("ab>x|y;" + - "yc>z", - "eabcd", "exzd"); - - /* Another set of rules: - * 1. ab>x|yzacw - * 2. za>q - * 3. qc>r - * 4. cw>n - * - * []|ab Rule 1 - * [x|yzacw] No match - * [xy|zacw] Rule 2 - * [xyq|cw] Rule 4 - * [xyqn]| Done - */ - expect("ab>x|yzacw;" + - "za>q;" + - "qc>r;" + - "cw>n", - "ab", "xyqn"); - - /* Test categories - */ - Transliterator t = new RuleBasedTransliterator("", - "$dummy=\uE100;" + - "$vowel=[aeiouAEIOU];" + - "$lu=[:Lu:];" + - "$vowel } $lu > '!';" + - "$vowel > '&';" + - "'!' { $lu > '^';" + - "$lu > '*';" + - "a>ERROR"); - expect(t, "abcdefgABCDEFGU", "&bcd&fg!^**!^*&"); - } - - /** - * Test inline set syntax and set variable syntax. - */ - public void TestInlineSet() { - expect("{ [:Ll:] } x > y; [:Ll:] > z;", "aAbxq", "zAyzz"); - expect("a[0-9]b > qrs", "1a7b9", "1qrs9"); - - expect("$digit = [0-9];" + - "$alpha = [a-zA-Z];" + - "$alphanumeric = [$digit $alpha];" + // *** - "$special = [^$alphanumeric];" + // *** - "$alphanumeric > '-';" + - "$special > '*';", - - "thx-1138", "---*----"); - } - - /** - * Create some inverses and confirm that they work. We have to be - * careful how we do this, since the inverses will not be true - * inverses -- we can't throw any random string at the composition - * of the transliterators and expect the identity function. F x - * F' != I. However, if we are careful about the input, we will - * get the expected results. - */ - public void TestRuleBasedInverse() { - String RULES = - "abc>zyx;" + - "ab>yz;" + - "bc>zx;" + - "ca>xy;" + - "a>x;" + - "b>y;" + - "c>z;" + - - "abc", RULES); - Transliterator rev = new RuleBasedTransliterator("", RULES, - RuleBasedTransliterator.REVERSE, null); - for (int i=0; i", - "psch>Y;" - +"ps>y;" - +"ch>x;" - +"a>A;"); - String DATA[] = { - // insertion, buffer - "a", "A", - "p", "Ap", - "s", "Aps", - "c", "Apsc", - "a", "AycA", - "psch", "AycAY", - null, "AycAY", // null means finishKeyboardTransliteration - }; - - keyboardAux(t, DATA); - } - - /** - * Basic test of keyboard with cursor. - */ - public void TestKeyboard2() { - Transliterator t = new RuleBasedTransliterator("", - "ych>Y;" - +"ps>|y;" - +"ch>x;" - +"a>A;"); - String DATA[] = { - // insertion, buffer - "a", "A", - "p", "Ap", - "s", "Aps", // modified for rollback - "Ay", - "c", "Apsc", // modified for rollback - "Ayc", - "a", "AycA", - "p", "AycAp", - "s", "AycAps", // modified for rollback - "AycAy", - "c", "AycApsc", // modified for rollback - "AycAyc", - "h", "AycAY", - null, "AycAY", // null means finishKeyboardTransliteration - }; - - keyboardAux(t, DATA); - } - - /** - * Test keyboard transliteration with back-replacement. - */ - public void TestKeyboard3() { - // We want th>z but t>y. Furthermore, during keyboard - // transliteration we want t>y then yh>z if t, then h are - // typed. - String RULES = - "t>|y;" + - "yh>z;" + - ""; - - String[] DATA = { - // Column 1: characters to add to buffer (as if typed) - // Column 2: expected appearance of buffer after - // keyboard xliteration. - "a", "a", - "b", "ab", - "t", "abt", // modified for rollback - "aby", - "c", "abyc", - "t", "abyct", // modified for rollback - "abycy", - "h", "abycz", - null, "abycz", // null means finishKeyboardTransliteration - }; - - Transliterator t = new RuleBasedTransliterator("", RULES); - keyboardAux(t, DATA); - } - - private void keyboardAux(Transliterator t, String[] DATA) { - Transliterator.Position index = new Transliterator.Position(); - ReplaceableString s = new ReplaceableString(); - for (int i=0; i "); - t.transliterate(s, index, DATA[i]); - } else { - log = new StringBuffer(s.toString() + " => "); - t.finishTransliteration(s, index); - } - Utility.formatInput(log, s, index); - if (s.toString().equals(DATA[i+1])) { - logln(log.toString()); - } else { - errln("FAIL: " + log.toString() + ", expected " + DATA[i+1]); - } - } - } - - // Latin-Arabic has been temporarily removed until it can be - // done correctly. - -// public void TestArabic() { -// String DATA[] = { -// "Arabic", -// "\u062a\u062a\u0645\u062a\u0639 "+ -// "\u0627\u0644\u0644\u063a\u0629 "+ -// "\u0627\u0644\u0639\u0631\u0628\u0628\u064a\u0629 "+ -// "\u0628\u0628\u0646\u0638\u0645 "+ -// "\u0643\u062a\u0627\u0628\u0628\u064a\u0629 "+ -// "\u062c\u0645\u064a\u0644\u0629" -// }; - -// Transliterator t = Transliterator.getInstance("Latin-Arabic"); -// for (int i=0; i 01 ;" + - " ab > |8 ;" + - " b > k ;" + - " 8x$ > 45 ;" + - " 8x > 77 ;", - - "ababbabxabx", - "018k7745"); - expect("$s = [z$] ;" + - "$s{ab > 01 ;" + - " ab > |8 ;" + - " b > k ;" + - " 8x}$s > 45 ;" + - " 8x > 77 ;", - - "abzababbabxzabxabx", - "01z018k45z01x45"); - } - - /** - * Test pattern quoting and escape mechanisms. - */ - public void TestPatternQuoting() { - // Array of 3n items - // Each item is , , - String[] DATA = { - "\u4E01>'[male adult]'", "\u4E01", "[male adult]", - }; - - for (int i=0; i", DATA[i]); - expect(t, DATA[i+1], DATA[i+2]); - } - } - - /** - * Regression test for bugs found in Greek transliteration. - */ - public void TestJ277() { - Transliterator gl = Transliterator.getInstance("Greek-Latin; NFD; [:M:]Remove; NFC"); - - char sigma = (char)0x3C3; - char upsilon = (char)0x3C5; - char nu = (char)0x3BD; - // not used char PHI = (char)0x3A6; - char alpha = (char)0x3B1; - // not used char omega = (char)0x3C9; - // not used char omicron = (char)0x3BF; - // not used char epsilon = (char)0x3B5; - - // sigma upsilon nu -> syn - StringBuffer buf = new StringBuffer(); - buf.append(sigma).append(upsilon).append(nu); - String syn = buf.toString(); - expect(gl, syn, "syn"); - - // sigma alpha upsilon nu -> saun - buf.setLength(0); - buf.append(sigma).append(alpha).append(upsilon).append(nu); - String sayn = buf.toString(); - expect(gl, sayn, "saun"); - - // Again, using a smaller rule set - String rules = - "$alpha = \u03B1;" + - "$nu = \u03BD;" + - "$sigma = \u03C3;" + - "$ypsilon = \u03C5;" + - "$vowel = [aeiouAEIOU$alpha$ypsilon];" + - "s <> $sigma;" + - "a <> $alpha;" + - "u <> $vowel { $ypsilon;" + - "y <> $ypsilon;" + - "n <> $nu;"; - RuleBasedTransliterator mini = new RuleBasedTransliterator - ("mini", rules, Transliterator.REVERSE, null); - expect(mini, syn, "syn"); - expect(mini, sayn, "saun"); - -//| // Transliterate the Greek locale data -//| Locale el("el"); -//| DateFormatSymbols syms(el, status); -//| if (U_FAILURE(status)) { errln("FAIL: Transliterator constructor failed"); return; } -//| int32_t i, count; -//| const UnicodeString* data = syms.getMonths(count); -//| for (i=0; itransliterate(out); -//| bool_t ok = TRUE; -//| if (data[i].length() >= 2 && out.length() >= 2 && -//| u_isupper(data[i].charAt(0)) && u_islower(data[i].charAt(1))) { -//| if (!(u_isupper(out.charAt(0)) && u_islower(out.charAt(1)))) { -//| ok = FALSE; -//| } -//| } -//| if (ok) { -//| logln(prettify(data[i] + " -> " + out)); -//| } else { -//| errln(UnicodeString("FAIL: ") + prettify(data[i] + " -> " + out)); -//| } -//| } - } - - /** - * Prefix, suffix support in hex transliterators - */ - public void TestJ243() { - // Test default Hex-Any, which should handle - // \\u, \\U, u+, and U+ - HexToUnicodeTransliterator hex = new HexToUnicodeTransliterator(); - expect(hex, "\\u0041+\\U0042,u+0043uu+0044z", "A+B,CuDz"); - - // Try a custom Hex-Any - // \\uXXXX and &#xXXXX; - HexToUnicodeTransliterator hex2 = new HexToUnicodeTransliterator("\\\\u###0;&\\#x###0\\;"); - expect(hex2, "\\u61\\u062\\u0063\\u00645\\u66x0123", - "abcd5fx0123"); - - // Try custom Any-Hex (default is tested elsewhere) - UnicodeToHexTransliterator hex3 = new UnicodeToHexTransliterator("&\\#x###0;"); - expect(hex3, "012", "012"); - } - - public void TestJ329() { - - Object[] DATA = { - new Boolean(false), "a > b; c > d", - new Boolean(true), "a > b; no operator; c > d", - }; - - for (int i=0; i", - (String) DATA[i+1], - Transliterator.FORWARD, - null); - } catch (IllegalArgumentException e) { - err = e.getMessage(); - } - boolean gotError = (err != null); - String desc = (String) DATA[i+1] + - (gotError ? (" -> error: " + err) : " -> no error"); - if ((err != null) == ((Boolean)DATA[i]).booleanValue()) { - logln("Ok: " + desc); - } else { - errln("FAIL: " + desc); - } - } - } - - /** - * Test segments and segment references. - */ - public void TestSegments() { - // Array of 3n items - // Each item is , , - String[] DATA = { - "([a-z]) '.' ([0-9]) > $2 '-' $1", - "abc.123.xyz.456", - "ab1-c23.xy4-z56", - }; - - for (int i=0; i", DATA[i]); - expect(t, DATA[i+1], DATA[i+2]); - } - } - - /** - * Test cursor positioning outside of the key - */ - public void TestCursorOffset() { - // Array of 3n items - // Each item is , , - String[] DATA = { - "pre {alpha} post > | @ ALPHA ;" + - "eALPHA > beta ;" + - "pre {beta} post > BETA @@ | ;" + - "post > xyz", - - "prealphapost prebetapost", - "prbetaxyz preBETApost", - }; - - for (int i=0; i", DATA[i]); - expect(t, DATA[i+1], DATA[i+2]); - } - } - - /** - * Test zero length and > 1 char length variable values. Test - * use of variable refs in UnicodeSets. - */ - public void TestArbitraryVariableValues() { - // Array of 3n items - // Each item is , , - String[] DATA = { - "$abe = ab;" + - "$pat = x[yY]z;" + - "$ll = 'a-z';" + - "$llZ = [$ll];" + - "$llY = [$ll$pat];" + - "$emp = ;" + - - "$abe > ABE;" + - "$pat > END;" + - "$llZ > 1;" + - "$llY > 2;" + - "7$emp 8 > 9;" + - "", - - "ab xYzxyz stY78", - "ABE ENDEND 1129", - }; - - for (int i=0; i", DATA[i]); - expect(t, DATA[i+1], DATA[i+2]); - } - } - - /** - * Confirm that the contextStart, contextLimit, start, and limit - * behave correctly. - */ - public void TestPositionHandling() { - // Array of 3n items - // Each item is , , - String[] DATA = { - "a{t} > SS ; {t}b > UU ; {t} > TT ;", - "xtat txtb", // pos 0,9,0,9 - "xTTaSS TTxUUb", - - "a{t} > SS ; {t}b > UU ; {t} > TT ;", - "xtat txtb", // pos 2,9,3,8 - "xtaSS TTxUUb", - - "a{t} > SS ; {t}b > UU ; {t} > TT ;", - "xtat txtb", // pos 3,8,3,8 - "xtaTT TTxTTb", - }; - - // Array of 4n positions -- these go with the DATA array - // They are: contextStart, contextLimit, start, limit - int[] POS = { - 0, 9, 0, 9, - 2, 9, 3, 8, - 3, 8, 3, 8, - }; - - int n = DATA.length/3; - for (int i=0; i", DATA[3*i]); - Transliterator.Position pos = new Transliterator.Position( - POS[4*i], POS[4*i+1], POS[4*i+2], POS[4*i+3]); - ReplaceableString rsource = new ReplaceableString(DATA[3*i+1]); - t.transliterate(rsource, pos); - t.finishTransliteration(rsource, pos); - String result = rsource.toString(); - String exp = DATA[3*i+2]; - expectAux(Utility.escape(DATA[3*i]), - DATA[3*i+1], - result, - result.equals(exp), - exp); - } - } - - /** - * Test the Hiragana-Katakana transliterator. - */ - public void TestHiraganaKatakana() { - Transliterator hk = Transliterator.getInstance("Hiragana-Katakana"); - Transliterator kh = Transliterator.getInstance("Katakana-Hiragana"); - - // Array of 3n items - // Each item is "hk"|"kh"|"both", , - String[] DATA = { - "both", - "\u3042\u3090\u3099\u3092\u3050", - "\u30A2\u30F8\u30F2\u30B0", - - "kh", - "\u307C\u3051\u3060\u3042\u3093\u30FC", - "\u30DC\u30F6\u30C0\u30FC\u30F3\u30FC", - }; - - for (int i=0; i " + id); - } - String dev = "\u0901\u090B\u0925"; - String guj = "\u0A81\u0A8B\u0AA5"; - expect(dg, dev, guj); - } - - /** - * Test filter syntax in IDs. (J23) - */ - public void TestFilterIDs() { - String[] DATA = { - "[aeiou]Any-Hex", // ID - "[aeiou]Hex-Any", // expected inverse ID - "quizzical", // src - "q\\u0075\\u0069zz\\u0069c\\u0061l", // expected ID.translit(src) - - "[aeiou]Any-Hex;[^5]Hex-Any", - "[^5]Any-Hex;[aeiou]Hex-Any", - "quizzical", - "q\\u0075izzical", - - "[abc]Null", - "[abc]Null", - "xyz", - "xyz", - }; - - for (int i=0; i " + - t.getID()); - } - - // Check the inverse - String uID = DATA[i+1]; - Transliterator u = t.getInverse(); - if (u == null) { - errln("FAIL: " + ID + ".getInverse() returned NULL"); - } else if (!u.getID().equals(uID)) { - errln("FAIL: " + ID + ".getInverse().getID() => " + - u.getID() + ", expected " + uID); - } - } - } - - /** - * Test the case mapping transliterators. - */ - public void TestCaseMap() { - Transliterator toUpper = - Transliterator.getInstance("Any-Upper[^xyzXYZ]"); - Transliterator toLower = - Transliterator.getInstance("Any-Lower[^xyzXYZ]"); - Transliterator toTitle = - Transliterator.getInstance("Any-Title[^xyzXYZ]"); - - expect(toUpper, "The quick brown fox jumped over the lazy dogs.", - "THE QUICK BROWN FOx JUMPED OVER THE LAzy DOGS."); - expect(toLower, "The quIck brown fOX jUMPED OVER THE LAzY dogs.", - "the quick brown foX jumped over the lazY dogs."); - expect(toTitle, "the quick brown foX caN'T jump over the laZy dogs.", - "The Quick Brown FoX Can't Jump Over The LaZy Dogs."); - } - - /** - * Test the name mapping transliterators. - */ - public void TestNameMap() { - Transliterator uni2name = - Transliterator.getInstance("Any-Name[^abc]"); - Transliterator name2uni = - Transliterator.getInstance("Name-Any"); - - expect(uni2name, "\u00A0abc\u4E01\u00B5\u0A81\uFFFD\uFFFF", - "{NO-BREAK SPACE}abc{CJK UNIFIED IDEOGRAPH-4E01}{MICRO SIGN}{GUJARATI SIGN CANDRABINDU}{REPLACEMENT CHARACTER}\uFFFF"); - expect(name2uni, "{ NO-BREAK SPACE}abc{ CJK UNIFIED IDEOGRAPH-4E01 }{x{MICRO SIGN}{GUJARATI SIGN CANDRABINDU}{REPLACEMENT CHARACTER}{", - "\u00A0abc\u4E01{x\u00B5\u0A81\uFFFD{"); - } - - /** - * Test liberalized ID syntax. 1006c - */ - public void TestLiberalizedID() { - // Some test cases have an expected getID() value of NULL. This - // means I have disabled the test case for now. This stuff is - // still under development, and I haven't decided whether to make - // getID() return canonical case yet. It will all get rewritten - // with the move to Source-Target/Variant IDs anyway. [aliu] - String DATA[] = { - "latin-greek", null /*"Latin-Greek"*/, "case insensitivity", - " Null ", "Null", "whitespace", - " Latin[a-z]-Greek ", "[a-z]Latin-Greek", "inline filter", - " null ; latin-greek ", null /*"Null;Latin-Greek"*/, "compound whitespace", - }; - - for (int i=0; i \"" + - t.getID() + "\""); - } else { - errln("FAIL: " + DATA[i+2] + - " create ID \"" + DATA[i] + "\" => \"" + - t.getID() + "\", exp \"" + DATA[i+1] + "\""); - } - } catch (IllegalArgumentException e) { - errln("FAIL: " + DATA[i+2] + - " create ID \"" + DATA[i] + "\""); - } - } - } - - public void TestCreateInstance() { - Transliterator myTrans = Transliterator.getInstance("Latin-Hangul", Transliterator.REVERSE); - String newID = myTrans.getID(); - if (!newID.equals("Hangul-Latin")) { - errln("FAIL: Test for Jitterbug 912 Transliterator::createInstance(id,UTRANS_REVERSE) failed"); - } - } - - /** - * Test the normalization transliterator. - */ - public void TestNormalizationTransliterator() { - // THE FOLLOWING TWO TABLES ARE COPIED FROM com.ibm.test.normalizer.BasicTest - // PLEASE KEEP THEM IN SYNC WITH BasicTest. - String[][] CANON = { - // Input Decomposed Composed - {"cat", "cat", "cat" }, - {"\u00e0ardvark", "a\u0300ardvark", "\u00e0ardvark" }, - - {"\u1e0a", "D\u0307", "\u1e0a" }, // D-dot_above - {"D\u0307", "D\u0307", "\u1e0a" }, // D dot_above - - {"\u1e0c\u0307", "D\u0323\u0307", "\u1e0c\u0307" }, // D-dot_below dot_above - {"\u1e0a\u0323", "D\u0323\u0307", "\u1e0c\u0307" }, // D-dot_above dot_below - {"D\u0307\u0323", "D\u0323\u0307", "\u1e0c\u0307" }, // D dot_below dot_above - - {"\u1e10\u0307\u0323", "D\u0327\u0323\u0307","\u1e10\u0323\u0307"}, // D dot_below cedilla dot_above - {"D\u0307\u0328\u0323","D\u0328\u0323\u0307","\u1e0c\u0328\u0307"}, // D dot_above ogonek dot_below - - {"\u1E14", "E\u0304\u0300", "\u1E14" }, // E-macron-grave - {"\u0112\u0300", "E\u0304\u0300", "\u1E14" }, // E-macron + grave - {"\u00c8\u0304", "E\u0300\u0304", "\u00c8\u0304" }, // E-grave + macron - - {"\u212b", "A\u030a", "\u00c5" }, // angstrom_sign - {"\u00c5", "A\u030a", "\u00c5" }, // A-ring - - {"\u00fdffin", "y\u0301ffin", "\u00fdffin" }, //updated with 3.0 - {"\u00fd\uFB03n", "y\u0301\uFB03n", "\u00fd\uFB03n" }, //updated with 3.0 - - {"Henry IV", "Henry IV", "Henry IV" }, - {"Henry \u2163", "Henry \u2163", "Henry \u2163" }, - - {"\u30AC", "\u30AB\u3099", "\u30AC" }, // ga (Katakana) - {"\u30AB\u3099", "\u30AB\u3099", "\u30AC" }, // ka + ten - {"\uFF76\uFF9E", "\uFF76\uFF9E", "\uFF76\uFF9E" }, // hw_ka + hw_ten - {"\u30AB\uFF9E", "\u30AB\uFF9E", "\u30AB\uFF9E" }, // ka + hw_ten - {"\uFF76\u3099", "\uFF76\u3099", "\uFF76\u3099" }, // hw_ka + ten - - {"A\u0300\u0316", "A\u0316\u0300", "\u00C0\u0316" }, - }; - - String[][] COMPAT = { - // Input Decomposed Composed - {"\uFB4f", "\u05D0\u05DC", "\u05D0\u05DC" }, // Alef-Lamed vs. Alef, Lamed - - {"\u00fdffin", "y\u0301ffin", "\u00fdffin" }, //updated for 3.0 - {"\u00fd\uFB03n", "y\u0301ffin", "\u00fdffin" }, // ffi ligature -> f + f + i - - {"Henry IV", "Henry IV", "Henry IV" }, - {"Henry \u2163", "Henry IV", "Henry IV" }, - - {"\u30AC", "\u30AB\u3099", "\u30AC" }, // ga (Katakana) - {"\u30AB\u3099", "\u30AB\u3099", "\u30AC" }, // ka + ten - - {"\uFF76\u3099", "\u30AB\u3099", "\u30AC" }, // hw_ka + ten - }; - - Transliterator NFD = Transliterator.getInstance("NFD"); - Transliterator NFC = Transliterator.getInstance("NFC"); - for (int i=0; i '.A.';\n" + - "b > '.B.';\n" + - "::[^t]Any-Upper;"; - Transliterator t = Transliterator.createFromRules("Test", rule, Transliterator.FORWARD); - if (t == null) { - errln("FAIL: createFromRules failed"); - return; - } - expect(t, "\u0043at in the hat, bat on the mat", - "C.A.t IN tHE H.A.t, .B..A.t ON tHE M.A.t"); - String r = t.toRules(true); - if (r.equals(rule)) { - logln("OK: toRules() => " + r); - } else { - errln("FAIL: toRules() => " + r + - ", expected " + rule); - } - - // Now test toRules - t = Transliterator.getInstance("Greek-Latin; Latin-Cyrillic", Transliterator.FORWARD); - if (t == null) { - errln("FAIL: createInstance failed"); - return; - } - String exp = "::Greek-Latin;\n::Latin-Cyrillic;"; - r = t.toRules(true); - if (!r.equals(exp)) { - errln("FAIL: toRules() => " + r + - ", expected " + exp); - } else { - logln("OK: toRules() => " + r); - } - - // Round trip the result of toRules - t = Transliterator.createFromRules("Test", r, Transliterator.FORWARD); - if (t == null) { - errln("FAIL: createFromRules #2 failed"); - return; - } else { - logln("OK: createFromRules(" + r + ") succeeded"); - } - - // Test toRules again - r = t.toRules(true); - if (!r.equals(exp)) { - errln("FAIL: toRules() => " + r + - ", expected " + exp); - } else { - logln("OK: toRules() => " + r); - } - - // Test Foo(Bar) IDs. Careful with spacing in id; make it conform - // to what the regenerated ID will look like. - String id = "Upper(Lower);(NFKC)"; - t = Transliterator.getInstance(id, Transliterator.FORWARD); - if (t == null) { - errln("FAIL: createInstance #2 failed"); - return; - } - if (t.getID().equals(id)) { - logln("OK: created " + id); - } else { - errln("FAIL: createInstance(" + id + - ").getID() => " + t.getID()); - } - - Transliterator u = t.getInverse(); - if (u == null) { - errln("FAIL: createInverse failed"); - return; - } - exp = "NFKC();Lower(Upper)"; - if (u.getID().equals(exp)) { - logln("OK: createInverse(" + id + ") => " + - u.getID()); - } else { - errln("FAIL: createInverse(" + id + ") => " + - u.getID()); - } - } - - /** - * Compound filter semantics were orginially not implemented - * correctly. Originally, each component filter f(i) is replaced by - * f'(i) = f(i) && g, where g is the filter for the compound - * transliterator. - * - * From Mark: - * - * Suppose and I have a transliterator X. Internally X is - * "Greek-Latin; Latin-Cyrillic; Any-Lower". I use a filter [^A]. - * - * The compound should convert all greek characters (through latin) to - * cyrillic, then lowercase the result. The filter should say "don't - * touch 'A' in the original". But because an intermediate result - * happens to go through "A", the Greek Alpha gets hung up. - */ - public void TestCompoundFilter() { - Transliterator t = Transliterator.getInstance - ("Greek-Latin; Latin-Greek; Lower", Transliterator.FORWARD); - t.setFilter(new UnicodeSet("[^A]")); - - // Only the 'A' at index 1 should remain unchanged - expect(t, - CharsToUnicodeString("BA\\u039A\\u0391"), - CharsToUnicodeString("\\u03b2A\\u03ba\\u03b1")); - } - - /** - * Test the "Remove" transliterator. - */ - public void TestRemove() { - Transliterator t = Transliterator.getInstance("Remove[aeiou]"); - expect(t, "The quick brown fox.", - "Th qck brwn fx."); - } - - public void TestToRules() { - String RBT = "rbt"; - String SET = "set"; - String[] DATA = { - RBT, - "$a=\\u4E61; [$a] > A;", - "[\\u4E61] > A;", - - RBT, - "$white=[[:Zs:][:Zl:]]; $white{a} > A;", - "[[:Zs:][:Zl:]]{a} > A;", - - SET, - "[[:Zs:][:Zl:]]", - "[[:Zs:][:Zl:]]", - - SET, - "[:Ps:]", - "[:Ps:]", - - SET, - "[:L:]", - "[:L:]", - - SET, - "[[:L:]-[A]]", - "[[:L:]-[A]]", - - SET, - "[~[:Lu:][:Ll:]]", - "[~[:Lu:][:Ll:]]", - - SET, - "[~[a-z]]", - "[~[a-z]]", - - RBT, - "$white=[:Zs:]; $black=[^$white]; $black{a} > A;", - "[^[:Zs:]]{a} > A;", - - RBT, - "$a=[:Zs:]; $b=[[a-z]-$a]; $b{a} > A;", - "[[a-z]-[:Zs:]]{a} > A;", - - RBT, - "$a=[:Zs:]; $b=[$a&[a-z]]; $b{a} > A;", - "[[:Zs:]&[a-z]]{a} > A;", - - RBT, - "$a=[:Zs:]; $b=[x$a]; $b{a} > A;", - "[x[:Zs:]]{a} > A;", - - RBT, - "$accentMinus = [ [\\u0300-\\u0345] & [:M:] - [\\u0338]] ;"+ - "$macron = \\u0304 ;"+ - "$evowel = [aeiouyAEIOUY] ;"+ - "$iotasub = \\u0345 ;"+ - "($evowel $macron $accentMinus *) i > | $1 $iotasub ;", - "([AEIOUYaeiouy]\\u0304[[\\u0300-\\u0345]&[:M:]-[\\u0338]]*)i > | $1 \\u0345;", - - RBT, - "([AEIOUYaeiouy]\\u0304[[:M:]-[\\u0304\\u0345]]*)i > | $1 \\u0345;", - "([AEIOUYaeiouy]\\u0304[[:M:]-[\\u0304\\u0345]]*)i > | $1 \\u0345;", - }; - - for (int d=0; d < DATA.length; d+=3) { - if (DATA[d] == RBT) { - // Transliterator test - Transliterator t = Transliterator.createFromRules("ID", - DATA[d+1], Transliterator.FORWARD); - if (t == null) { - errln("FAIL: createFromRules failed"); - return; - } - String rules, escapedRules; - rules = t.toRules(false); - escapedRules = t.toRules(true); - String expRules = Utility.unescape(DATA[d+2]); - String expEscapedRules = DATA[d+2]; - if (rules.equals(expRules)) { - logln("Ok: " + DATA[d+1] + - " => " + Utility.escape(rules)); - } else { - errln("FAIL: " + DATA[d+1] + - " => " + Utility.escape(rules + ", exp " + expRules)); - } - if (escapedRules.equals(expEscapedRules)) { - logln("Ok: " + DATA[d+1] + - " => " + escapedRules); - } else { - errln("FAIL: " + DATA[d+1] + - " => " + escapedRules + ", exp " + expEscapedRules); - } - - } else { - // UnicodeSet test - String pat = DATA[d+1]; - String expToPat = DATA[d+2]; - UnicodeSet set = new UnicodeSet(pat); - - // Adjust spacing etc. as necessary. - String toPat; - toPat = set.toPattern(true); - if (expToPat.equals(toPat)) { - logln("Ok: " + pat + - " => " + toPat); - } else { - errln("FAIL: " + pat + - " => " + Utility.escape(toPat) + - ", exp " + Utility.escape(pat)); - } - } - } - } - - public void TestContext() { - Transliterator.Position pos = new Transliterator.Position(0, 2, 0, 1); // cs cl s l - - expect("de > x; {d}e > y;", - "de", - "ye", - pos); - - expect("ab{c} > z;", - "xadabdabcy", - "xadabdabzy"); - } - - static final String CharsToUnicodeString(String s) { - return Utility.unescape(s); - } - - public void TestSupplemental() { - - expect(CharsToUnicodeString("$a=\\U00010300; $s=[\\U00010300-\\U00010323];" + - "a > $a; $s > i;"), - CharsToUnicodeString("ab\\U0001030Fx"), - CharsToUnicodeString("\\U00010300bix")); - - expect(CharsToUnicodeString("$a=[a-z\\U00010300-\\U00010323];" + - "$b=[A-Z\\U00010400-\\U0001044D];" + - "($a)($b) > $2 $1;"), - CharsToUnicodeString("aB\\U00010300\\U00010400c\\U00010401\\U00010301D"), - CharsToUnicodeString("Ba\\U00010400\\U00010300\\U00010401cD\\U00010301")); - - // k|ax\\U00010300xm - - // k|a\\U00010400\\U00010300xm - // ky|\\U00010400\\U00010300xm - // ky\\U00010400|\\U00010300xm - - // ky\\U00010400|\\U00010300\\U00010400m - // ky\\U00010400y|\\U00010400m - expect(CharsToUnicodeString("$a=[a\\U00010300-\\U00010323];" + - "$a {x} > | @ \\U00010400;" + - "{$a} [^\\u0000-\\uFFFF] > y;"), - CharsToUnicodeString("kax\\U00010300xm"), - CharsToUnicodeString("ky\\U00010400y\\U00010400m")); - - expect(Transliterator.getInstance("Any-Name"), - CharsToUnicodeString("\\U00010330\\U000E0061\\u00A0"), - "{GOTHIC LETTER AHSA}{TAG LATIN SMALL LETTER A}{NO-BREAK SPACE}"); - - expect(Transliterator.getInstance("Any-Hex/Unicode"), - CharsToUnicodeString("\\U00010330\\U0010FF00\\U000E0061\\u00A0"), - "U+10330U+10FF00U+E0061U+00A0"); - - expect(Transliterator.getInstance("Any-Hex/C"), - CharsToUnicodeString("\\U00010330\\U0010FF00\\U000E0061\\u00A0"), - "\\U00010330\\U0010FF00\\U000E0061\\u00A0"); - - expect(Transliterator.getInstance("Any-Hex/Perl"), - CharsToUnicodeString("\\U00010330\\U0010FF00\\U000E0061\\u00A0"), - "\\x{10330}\\x{10FF00}\\x{E0061}\\x{A0}"); - - expect(Transliterator.getInstance("Any-Hex/Java"), - CharsToUnicodeString("\\U00010330\\U0010FF00\\U000E0061\\u00A0"), - "\\uD800\\uDF30\\uDBFF\\uDF00\\uDB40\\uDC61\\u00A0"); - - expect(Transliterator.getInstance("Any-Hex/XML"), - CharsToUnicodeString("\\U00010330\\U0010FF00\\U000E0061\\u00A0"), - "𐌰􏼀󠁡 "); - - expect(Transliterator.getInstance("Any-Hex/XML10"), - CharsToUnicodeString("\\U00010330\\U0010FF00\\U000E0061\\u00A0"), - "𐌰􏼀󠁡 "); - - expect(Transliterator.getInstance("[\\U000E0000-\\U000E0FFF] Remove"), - CharsToUnicodeString("\\U00010330\\U0010FF00\\U000E0061\\u00A0"), - CharsToUnicodeString("\\U00010330\\U0010FF00\\u00A0")); - } - - public void TestQuantifier() { - - // Make sure @ in a quantified anteContext works - expect("a+ {b} > | @@ c; A > a; (a+ c) > '(' $1 ')';", - "AAAAAb", - "aaa(aac)"); - - // Make sure @ in a quantified postContext works - expect("{b} a+ > c @@ |; (a+) > '(' $1 ')';", - "baaaaa", - "caa(aaa)"); - - // Make sure @ in a quantified postContext with seg ref works - expect("{(b)} a+ > $1 @@ |; (a+) > '(' $1 ')';", - "baaaaa", - "baa(aaa)"); - - // Make sure @ past ante context doesn't enter ante context - Transliterator.Position pos = new Transliterator.Position(0, 5, 3, 5); - expect("a+ {b} > | @@ c; x > y; (a+ c) > '(' $1 ')';", - "xxxab", - "xxx(ac)", - pos); - - // Make sure @ past post context doesn't pass limit - Transliterator.Position pos2 = new Transliterator.Position(0, 4, 0, 2); - expect("{b} a+ > c @@ |; x > y; a > A;", - "baxx", - "caxx", - pos2); - - // Make sure @ past post context doesn't enter post context - expect("{b} a+ > c @@ |; x > y; a > A;", - "baxx", - "cayy"); - - expect("(ab)? c > d;", - "c abc ababc", - "d d abd"); - - // NOTE: The (ab)+ when referenced just yields a single "ab", - // not the full sequence of them. This accords with perl behavior. - expect("(ab)+ {x} > '(' $1 ')';", - "x abx ababxy", - "x ab(ab) abab(ab)y"); - - expect("b+ > x;", - "ac abc abbc abbbc", - "ac axc axc axc"); - - expect("[abc]+ > x;", - "qac abrc abbcs abtbbc", - "qx xrx xs xtx"); - - expect("q{(ab)+} > x;", - "qa qab qaba qababc qaba", - "qa qx qxa qxc qxa"); - - expect("q(ab)* > x;", - "qa qab qaba qababc", - "xa x xa xc"); - - // NOTE: The (ab)+ when referenced just yields a single "ab", - // not the full sequence of them. This accords with perl behavior. - expect("q(ab)* > '(' $1 ')';", - "qa qab qaba qababc", - "()a (ab) (ab)a (ab)c"); - - // 'foo'+ and 'foo'* -- the quantifier should apply to the entire - // quoted string - expect("'ab'+ > x;", - "bb ab ababb", - "bb x xb"); - - // $foo+ and $foo* -- the quantifier should apply to the entire - // variable reference - expect("$var = ab; $var+ > x;", - "bb ab ababb", - "bb x xb"); - } - - static class TestFact implements Transliterator.Factory { - static class NameableNullTrans extends NullTransliterator { - public NameableNullTrans(String id) { - setID(id); - } - }; - String id; - public TestFact(String theID) { - id = theID; - } - public Transliterator getInstance(String ignoredID) { - return new NameableNullTrans(id); - } - }; - - public void TestSTV() { - Enumeration es = Transliterator.getAvailableSources(); - for (int i=0; es.hasMoreElements(); ++i) { - String source = (String) es.nextElement(); - logln("" + i + ": " + source); - if (source.length() == 0) { - errln("FAIL: empty source"); - continue; - } - Enumeration et = Transliterator.getAvailableTargets(source); - for (int j=0; et.hasMoreElements(); ++j) { - String target = (String) et.nextElement(); - logln(" " + j + ": " + target); - if (target.length() == 0) { - errln("FAIL: empty target"); - continue; - } - Enumeration ev = Transliterator.getAvailableVariants(source, target); - for (int k=0; ev.hasMoreElements(); ++k) { - String variant = (String) ev.nextElement(); - if (variant.length() == 0) { - logln(" " + k + ": "); - } else { - logln(" " + k + ": " + variant); - } - } - } - } - - // Test registration - String[] IDS = { "Fieruwer", "Seoridf-Sweorie", "Oewoir-Oweri/Vsie" }; - for (int i=0; i<3; ++i) { - Transliterator.registerFactory(IDS[i], new TestFact(IDS[i])); - try { - Transliterator t = Transliterator.getInstance(IDS[i]); - if (t.getID().equals(IDS[i])) { - logln("Ok: Registration/creation succeeded for ID " + - IDS[i]); - } else { - errln("FAIL: Registration of ID " + - IDS[i] + " creates ID " + t.getID()); - } - Transliterator.unregister(IDS[i]); - try { - t = Transliterator.getInstance(IDS[i]); - errln("FAIL: Unregistration failed for ID " + - IDS[i] + "; still receiving ID " + t.getID()); - } catch (IllegalArgumentException e2) { - // Good; this is what we expect - logln("Ok; Unregistered " + IDS[i]); - } - } catch (IllegalArgumentException e) { - errln("FAIL: Registration/creation failed for ID " + - IDS[i]); - } - } - } - - /** - * Test inverse of Greek-Latin; Title() - */ - public void TestCompoundInverse() { - Transliterator t = Transliterator.getInstance - ("Greek-Latin; Title()", Transliterator.REVERSE); - if (t == null) { - errln("FAIL: createInstance"); - return; - } - String exp = "(Title);Latin-Greek"; - if (t.getID().equals(exp)) { - logln("Ok: inverse of \"Greek-Latin; Title()\" is \"" + - t.getID()); - } else { - errln("FAIL: inverse of \"Greek-Latin; Title()\" is \"" + - t.getID() + "\", expected \"" + exp + "\""); - } - } - - /** - * Test NFD chaining with RBT - */ - public void TestNFDChainRBT() { - Transliterator t = Transliterator.createFromRules( - "TEST", "::NFD; aa > Q; a > q;", - Transliterator.FORWARD); - logln(t.toRules(true)); - expect(t, "aa", "Q"); - } - - /** - * Inverse of "Null" should be "Null". (J21) - */ - public void TestNullInverse() { - Transliterator t = Transliterator.getInstance("Null"); - Transliterator u = t.getInverse(); - if (!u.getID().equals("Null")) { - errln("FAIL: Inverse of Null should be Null"); - } - } - - /** - * Check ID of inverse of alias. (J22) - */ - public void TestAliasInverseID() { - String ID = "Latin-Hangul"; // This should be any alias ID with an inverse - Transliterator t = Transliterator.getInstance(ID); - Transliterator u = t.getInverse(); - String exp = "Hangul-Latin"; - String got = u.getID(); - if (!got.equals(exp)) { - errln("FAIL: Inverse of " + ID + " is " + got + - ", expected " + exp); - } - } - - /** - * Test IDs of inverses of compound transliterators. (J20) - */ - public void TestCompoundInverseID() { - String ID = "Latin-Jamo;NFC(NFD)"; - Transliterator t = Transliterator.getInstance(ID); - Transliterator u = t.getInverse(); - String exp = "NFD(NFC);Jamo-Latin"; - String got = u.getID(); - if (!got.equals(exp)) { - errln("FAIL: Inverse of " + ID + " is " + got + - ", expected " + exp); - } - } - - /** - * Test undefined variable. - */ - public void TestUndefinedVariable() { - String rule = "$initial } a <> \u1161;"; - try { - Transliterator t = new RuleBasedTransliterator("", rule); - t = null; - } catch (IllegalArgumentException e) { - logln("OK: Got exception for " + rule + ", as expected: " + - e.getMessage()); - return; - } - errln("Fail: bogus rule " + rule + " compiled without error"); - } - - /** - * Test empty context. - */ - public void TestEmptyContext() { - expect(" { a } > b;", "xay a ", "xby b "); - } - - /** - * Test compound filter ID syntax - */ - public void TestCompoundFilterID() { - String[] DATA = { - // Col. 1 = ID or rule set (latter must start with #) - - // = columns > 1 are null if expect col. 1 to be illegal = - - // Col. 2 = direction, "F..." or "R..." - // Col. 3 = source string - // Col. 4 = exp result - - "[abc]; [abc]", null, null, null, // multiple filters - "Latin-Greek; [abc];", null, null, null, // misplaced filter - "[b]; Latin-Greek; Upper; ([xyz])", "F", "abc", "a\u0392c", - "[b]; (Lower); Latin-Greek; Upper(); ([\u0392])", "R", "\u0391\u0392\u0393", "\u0391b\u0393", - "#\n::[b]; ::Latin-Greek; ::Upper; ::([xyz]);", "F", "abc", "a\u0392c", - "#\n::[b]; ::(Lower); ::Latin-Greek; ::Upper(); ::([\u0392]);", "R", "\u0391\u0392\u0393", "\u0391b\u0393", - }; - - for (int i=0; i " + t + - (e != null ? (", " + e.getMessage()) : "")); - if (source != null) { - expect(t, source, exp); - } - } else { - errln("FAIL: " + id + " => " + t + - (e != null ? (", " + e.getMessage()) : "")); - } - } - } - - /** - * Test new property set syntax - */ - public void TestPropertySet() { - expect("a>A; \\p{Lu}>x; \\p{Any}>y;", "abcDEF", "Ayyxxx"); - expect("(.+)>'[' $1 ']';", " a stitch \n in time \r saves 9", - "[ a stitch ]\n[ in time ]\r[ saves 9]"); - } - - /** - * Test various failure points of the new 2.0 engine. - */ - public void TestNewEngine() { - Transliterator t = Transliterator.getInstance("Latin-Hiragana"); - // Katakana should be untouched - expect(t, "a\u3042\u30A2", "\u3042\u3042\u30A2"); - - if (true) { - // This test will only work if Transliterator.ROLLBACK is - // true. Otherwise, this test will fail, revealing a - // limitation of global filters in incremental mode. - - Transliterator a = - Transliterator.createFromRules("a", "a > A;", Transliterator.FORWARD); - Transliterator A = - Transliterator.createFromRules("A", "A > b;", Transliterator.FORWARD); - - Transliterator array[] = new Transliterator[] { - a, - Transliterator.getInstance("NFD"), - A }; - - t = new CompoundTransliterator(array, new UnicodeSet("[:Ll:]")); - - expect(t, "aAaA", "bAbA"); - } - - expect("$smooth = x; $macron = q; [:^L:] { ([aeiouyAEIOUY] $macron?) } [^aeiouyAEIOUY$smooth$macron] > | $1 $smooth ;", - "a", - "ax"); - - String gr = - "$ddot = \u0308 ;" + - "$lcgvowel = [\u03b1\u03b5\u03b7\u03b9\u03bf\u03c5\u03c9] ;" + - "$rough = \u0314 ;" + - "($lcgvowel+ $ddot?) $rough > h | $1 ;" + - "\u03b1 <> a ;" + - "$rough <> h ;"; - - expect(gr, "\u03B1\u0314", "ha"); - } - - /** - * Test quantified segment behavior. We want: - * ([abc])+ > x $1 x; applied to "cba" produces "xax" - */ - public void TestQuantifiedSegment() { - // The normal case - expect("([abc]+) > x $1 x;", "cba", "xcbax"); - - // The tricky case; the quantifier is around the segment - expect("([abc])+ > x $1 x;", "cba", "xax"); - - // Tricky case in reverse direction - expect("([abc])+ { q > x $1 x;", "cbaq", "cbaxax"); - - // Check post-context segment - expect("{q} ([a-d])+ > '(' $1 ')';", "ddqcba", "dd(a)cba"); - - // Test toRule/toPattern for non-quantified segment. - // Careful with spacing here. - String r = "([a-c]){q} > x $1 x;"; - Transliterator t = Transliterator.createFromRules("ID", r, Transliterator.FORWARD); - String rr = t.toRules(true); - if (!r.equals(rr)) { - errln("FAIL: \"" + r + "\" x toRules() => \"" + rr + "\""); - } else { - logln("Ok: \"" + r + "\" x toRules() => \"" + rr + "\""); - } - - // Test toRule/toPattern for quantified segment. - // Careful with spacing here. - r = "([a-c])+{q} > x $1 x;"; - t = Transliterator.createFromRules("ID", r, Transliterator.FORWARD); - rr = t.toRules(true); - if (!r.equals(rr)) { - errln("FAIL: \"" + r + "\" x toRules() => \"" + rr + "\""); - } else { - logln("Ok: \"" + r + "\" x toRules() => \"" + rr + "\""); - } - } - - //====================================================================== - // Ram's tests - //====================================================================== - /* this test performs test of rules in ISO 15915 */ - public void TestDevanagariLatinRT(){ - String[] source = { - "bh\u0101rata", - "kra", - "k\u1E63a", - "khra", - "gra", - "\u1E45ra", - "cra", - "chra", - "j\u00F1a", - "jhra", - "\u00F1ra", - "\u1E6Dya", - "\u1E6Dhra", - "\u1E0Dya", - //"r\u0323ya", // \u095c is not valid in Devanagari - "\u1E0Dhya", - "\u1E5Bhra", - "\u1E47ra", - "tta", - "thra", - "dda", - "dhra", - "nna", - "pra", - "phra", - "bra", - "bhra", - "mra", - "\u1E49ra", - //"l\u0331ra", - "yra", - "\u1E8Fra", - //"l-", - "vra", - "\u015Bra", - "\u1E63ra", - "sra", - "hma", - "\u1E6D\u1E6Da", - "\u1E6D\u1E6Dha", - "\u1E6Dh\u1E6Dha", - "\u1E0D\u1E0Da", - "\u1E0D\u1E0Dha", - "\u1E6Dya", - "\u1E6Dhya", - "\u1E0Dya", - "\u1E0Dhya", - // Not roundtrippable -- - // \u0939\u094d\u094d\u092E - hma - // \u0939\u094d\u092E - hma - // CharsToUnicodeString("hma"), - "hya", - "\u015Br\u0325", - "\u015Bca", - "\u0115", - "san\u0304j\u012Bb s\u0113nagupta", - "\u0101nand vaddir\u0101ju", - }; - String[] expected = { - "\u092D\u093E\u0930\u0924", /* bha\u0304rata */ - "\u0915\u094D\u0930", /* kra */ - "\u0915\u094D\u0937", /* ks\u0323a */ - "\u0916\u094D\u0930", /* khra */ - "\u0917\u094D\u0930", /* gra */ - "\u0919\u094D\u0930", /* n\u0307ra */ - "\u091A\u094D\u0930", /* cra */ - "\u091B\u094D\u0930", /* chra */ - "\u091C\u094D\u091E", /* jn\u0303a */ - "\u091D\u094D\u0930", /* jhra */ - "\u091E\u094D\u0930", /* n\u0303ra */ - "\u091F\u094D\u092F", /* t\u0323ya */ - "\u0920\u094D\u0930", /* t\u0323hra */ - "\u0921\u094D\u092F", /* d\u0323ya */ - //"\u095C\u094D\u092F", /* r\u0323ya */ // \u095c is not valid in Devanagari - "\u0922\u094D\u092F", /* d\u0323hya */ - "\u0922\u093C\u094D\u0930", /* r\u0323hra */ - "\u0923\u094D\u0930", /* n\u0323ra */ - "\u0924\u094D\u0924", /* tta */ - "\u0925\u094D\u0930", /* thra */ - "\u0926\u094D\u0926", /* dda */ - "\u0927\u094D\u0930", /* dhra */ - "\u0928\u094D\u0928", /* nna */ - "\u092A\u094D\u0930", /* pra */ - "\u092B\u094D\u0930", /* phra */ - "\u092C\u094D\u0930", /* bra */ - "\u092D\u094D\u0930", /* bhra */ - "\u092E\u094D\u0930", /* mra */ - "\u0929\u094D\u0930", /* n\u0331ra */ - //"\u0934\u094D\u0930", /* l\u0331ra */ - "\u092F\u094D\u0930", /* yra */ - "\u092F\u093C\u094D\u0930", /* y\u0307ra */ - //"l-", - "\u0935\u094D\u0930", /* vra */ - "\u0936\u094D\u0930", /* s\u0301ra */ - "\u0937\u094D\u0930", /* s\u0323ra */ - "\u0938\u094D\u0930", /* sra */ - "\u0939\u094d\u092E", /* hma */ - "\u091F\u094D\u091F", /* t\u0323t\u0323a */ - "\u091F\u094D\u0920", /* t\u0323t\u0323ha */ - "\u0920\u094D\u0920", /* t\u0323ht\u0323ha*/ - "\u0921\u094D\u0921", /* d\u0323d\u0323a */ - "\u0921\u094D\u0922", /* d\u0323d\u0323ha */ - "\u091F\u094D\u092F", /* t\u0323ya */ - "\u0920\u094D\u092F", /* t\u0323hya */ - "\u0921\u094D\u092F", /* d\u0323ya */ - "\u0922\u094D\u092F", /* d\u0323hya */ - // "hma", /* hma */ - "\u0939\u094D\u092F", /* hya */ - "\u0936\u0943", /* s\u0301r\u0325a */ - "\u0936\u094D\u091A", /* s\u0301ca */ - "\u090d", /* e\u0306 */ - "\u0938\u0902\u091C\u0940\u092C\u094D \u0938\u0947\u0928\u0917\u0941\u092A\u094D\u0924", - "\u0906\u0928\u0902\u0926\u094D \u0935\u0926\u094D\u0926\u093F\u0930\u093E\u091C\u0941", - }; - - Transliterator latinToDev=Transliterator.getInstance("Latin-Devanagari", Transliterator.FORWARD ); - Transliterator devToLatin=Transliterator.getInstance("Devanagari-Latin", Transliterator.FORWARD); - - String gotResult; - for(int i= 0; i b;\n" + - "# more stuff\n" + - "d << b;"; - try { - Transliterator t = Transliterator.createFromRules("ID", rule, Transliterator.FORWARD); - } catch (IllegalArgumentException e) { - String err = e.getMessage(); - if (err.indexOf("d << b") >= 0) { - logln("Ok: " + err); - } else { - errln("FAIL: " + err); - } - return; - } - errln("FAIL: no syntax error"); - } - - /** - * Make sure sets on output are disallowed. - */ - public void TestOutputSet() { - String rule = "$set = [a-cm-n]; b > $set;"; - Transliterator t = null; - try { - t = Transliterator.createFromRules("ID", rule, Transliterator.FORWARD); - } catch (IllegalArgumentException e) { - logln("Ok: " + e.getMessage()); - return; - } - errln("FAIL: No syntax error"); - } - - /** - * Test the use variable range pragma, making sure that use of - * variable range characters is detected and flagged as an error. - */ - public void TestVariableRange() { - String rule = "use variable range 0x70 0x72; a > A; b > B; q > Q;"; - try { - Transliterator t = - Transliterator.createFromRules("ID", rule, Transliterator.FORWARD); - } catch (IllegalArgumentException e) { - logln("Ok: " + e.getMessage()); - return; - } - errln("FAIL: No syntax error"); - } - - /** - * Test invalid post context error handling - */ - public void TestInvalidPostContext() { - try { - Transliterator t = - Transliterator.createFromRules("ID", "a}b{c>d;", Transliterator.FORWARD); - } catch (IllegalArgumentException e) { - String msg = e.getMessage(); - if (msg.indexOf("a}b{c") >= 0) { - logln("Ok: " + msg); - } else { - errln("FAIL: " + msg); - } - return; - } - errln("FAIL: No syntax error"); - } - - /** - * Test ID form variants - */ - public void TestIDForms() { - String DATA[] = { - "NFC", null, "NFD", - "nfd", null, "NFC", // make sure case is ignored - "Any-NFKD", null, "Any-NFKC", - "Null", null, "Null", - "-nfkc", "nfkc", "NFKD", - "-nfkc/", "nfkc", "NFKD", - "Latin-Greek/UNGEGN", null, "Greek-Latin/UNGEGN", - "Greek/UNGEGN-Latin", "Greek-Latin/UNGEGN", "Latin-Greek/UNGEGN", - "Bengali-Devanagari/", "Bengali-Devanagari", "Devanagari-Bengali", - "Source-", null, null, - "Source/Variant-", null, null, - "Source-/Variant", null, null, - "/Variant", null, null, - "/Variant-", null, null, - "-/Variant", null, null, - "-/", null, null, - "-", null, null, - "/", null, null, - }; - - for (int i=0; i " + expInvID); - } else { - errln("FAIL: getInstance(" + ID + ") => " + - t.getID() + " x getInverse() => " + u.getID() + - ", expected " + expInvID); - } - } catch (IllegalArgumentException e) { - if (!expValid) { - logln("Ok: getInstance(" + ID + ") => " + e.getMessage()); - } else { - errln("FAIL: getInstance(" + ID + ") => " + e.getMessage()); - } - } - } - } - - void checkRules(String label, Transliterator t2, String testRulesForward) { - String rules2 = t2.toRules(true); - //rules2 = TestUtility.replaceAll(rules2, new UnicodeSet("[' '\n\r]"), ""); - rules2 = TestUtility.replace(rules2, " ", ""); - rules2 = TestUtility.replace(rules2, "\n", ""); - rules2 = TestUtility.replace(rules2, "\r", ""); - testRulesForward = TestUtility.replace(testRulesForward, " ", ""); - - if (!rules2.equals(testRulesForward)) { - errln(label); - logln("GENERATED RULES: " + rules2); - logln("SHOULD BE: " + testRulesForward); - } - } - - /** - * Mark's toRules test. - */ - public void TestToRulesMark() { - - String testRules = - "::[[:Latin:][:Mark:]];" - + "::NFKD (NFC);" - + "::Lower (Lower);" - + "a <> \\u03B1;" // alpha - + "::NFKC (NFD);" - + "::Upper (Lower);" - + "::Lower ();" - + "::([[:Greek:][:Mark:]]);" - ; - String testRulesForward = - "::[[:Latin:][:Mark:]];" - + "::NFKD(NFC);" - + "::Lower(Lower);" - + "a > \\u03B1;" - + "::NFKC(NFD);" - + "::Upper (Lower);" - + "::Lower ();" - ; - String testRulesBackward = - "::[[:Greek:][:Mark:]];" - + "::Lower (Upper);" - + "::NFD(NFKC);" - + "\\u03B1 > a;" - + "::Lower(Lower);" - + "::NFC(NFKD);" - ; - String source = "\u00E1"; // a-acute - String target = "\u03AC"; // alpha-acute - - Transliterator t2 = Transliterator.createFromRules("source-target", testRules, Transliterator.FORWARD); - Transliterator t3 = Transliterator.createFromRules("target-source", testRules, Transliterator.REVERSE); - - expect(t2, source, target); - expect(t3, target, source); - - checkRules("Failed toRules FORWARD", t2, testRulesForward); - checkRules("Failed toRules BACKWARD", t3, testRulesBackward); - } - - /** - * Test Escape and Unescape transliterators. - */ - public void TestEscape() { - expect(Transliterator.getInstance("Hex-Any"), - "\\x{40}\\U000000312Q", - "@12Q"); - expect(Transliterator.getInstance("Any-Hex/C"), - CharsToUnicodeString("A\\U0010BEEF\\uFEED"), - "\\u0041\\U0010BEEF\\uFEED"); - expect(Transliterator.getInstance("Any-Hex/Java"), - CharsToUnicodeString("A\\U0010BEEF\\uFEED"), - "\\u0041\\uDBEF\\uDEEF\\uFEED"); - expect(Transliterator.getInstance("Any-Hex/Perl"), - CharsToUnicodeString("A\\U0010BEEF\\uFEED"), - "\\x{41}\\x{10BEEF}\\x{FEED}"); - } - - /** - * Make sure display names of variants look reasonable. - */ - public void TestDisplayName() { - String DATA[] = { - // ID, forward name, reverse name - // Update the text as necessary -- the important thing is - // not the text itself, but how various cases are handled. - - // Basic test - "Any-Hex", "Any to Hex Escape", "Hex Escape to Any", - - // Variants - "Any-Hex/Perl", "Any to Hex Escape/Perl", "Hex Escape to Any/Perl", - - // Target-only IDs - "NFC", "Any to NFC", "Any to NFD", - }; - - Locale US = Locale.US; - - for (int i=0; i " + - name + ", expected " + DATA[i+1]); - } else { - logln("Ok: " + DATA[i] + ".getDisplayName() => " + name); - } - Transliterator t = Transliterator.getInstance(DATA[i], Transliterator.REVERSE); - name = Transliterator.getDisplayName(t.getID(), US); - if (!name.equals(DATA[i+2])) { - errln("FAIL: " + t.getID() + ".getDisplayName() => " + - name + ", expected " + DATA[i+2]); - } else { - logln("Ok: " + t.getID() + ".getDisplayName() => " + name); - } - } - } - - /** - * Test anchor masking - */ - public void TestAnchorMasking() { - String rule = "^a > Q; a > q;"; - try { - Transliterator t = Transliterator.createFromRules("ID", rule, Transliterator.FORWARD); - } catch (IllegalArgumentException e) { - errln("FAIL: " + rule + " => " + e); - } - } - - static final String[][] registerRules = { - {"Any-Dev1", "x > X; y > Y;"}, - {"Any-Dev2", "XY > Z"}, - {"Greek-Latin/FAKE", - "[^[:L:][:M:]] { \u03bc\u03c0 > b ; "+ - "\u03bc\u03c0 } [^[:L:][:M:]] > b ; "+ - "[^[:L:][:M:]] { [\u039c\u03bc][\u03a0\u03c0] > B ; "+ - "[\u039c\u03bc][\u03a0\u03c0] } [^[:L:][:M:]] > B ;" - }, - }; - - static final String DESERET_DEE = UTF16.valueOf(0x10414); - static final String DESERET_dee = UTF16.valueOf(0x1043C); - - static final String[][] testCases = { - - // NORMALIZATION - // should add more test cases - {"NFD" , "a\u0300 \u00E0 \u1100\u1161 \uFF76\uFF9E\u03D3"}, - {"NFC" , "a\u0300 \u00E0 \u1100\u1161 \uFF76\uFF9E\u03D3"}, - {"NFKD", "a\u0300 \u00E0 \u1100\u1161 \uFF76\uFF9E\u03D3"}, - {"NFKC", "a\u0300 \u00E0 \u1100\u1161 \uFF76\uFF9E\u03D3"}, - - // mp -> b BUG - {"Greek-Latin/UNGEGN", "(\u03BC\u03C0)", "(b)"}, - {"Greek-Latin/FAKE", "(\u03BC\u03C0)", "(b)"}, - - // check for devanagari bug - {"nfd;Dev1;Dev2;nfc", "xy", "Z"}, - - // ff, i, dotless-i, I, dotted-I, LJLjlj deseret deeDEE - {"Title", "ab'cD ffi\u0131I\u0130 \u01C7\u01C8\u01C9 " + DESERET_dee + DESERET_DEE, - "Ab'cd Ffi\u0131ii \u01C8\u01C9\u01C9 " + DESERET_DEE + DESERET_dee}, - //TODO: enable this test once Titlecase works right - //{"Title", "\uFB00i\u0131I\u0130 \u01C7\u01C8\u01C9 " + DESERET_dee + DESERET_DEE, - // "Ffi\u0131ii \u01C8\u01C9\u01C9 " + DESERET_DEE + DESERET_dee}, - - {"Upper", "ab'cD \uFB00i\u0131I\u0130 \u01C7\u01C8\u01C9 " + DESERET_dee + DESERET_DEE, - "AB'CD FFIII\u0130 \u01C7\u01C7\u01C7 " + DESERET_DEE + DESERET_DEE}, - {"Lower", "ab'cD \uFB00i\u0131I\u0130 \u01C7\u01C8\u01C9 " + DESERET_dee + DESERET_DEE, - "ab'cd \uFB00i\u0131ii \u01C9\u01C9\u01C9 " + DESERET_dee + DESERET_dee}, - - {"Upper", "ab'cD \uFB00i\u0131I\u0130 \u01C7\u01C8\u01C9 " + DESERET_dee + DESERET_DEE}, - {"Lower", "ab'cD \uFB00i\u0131I\u0130 \u01C7\u01C8\u01C9 " + DESERET_dee + DESERET_DEE}, - - // FORMS OF S - {"Greek-Latin/UNGEGN", "\u03C3 \u03C3\u03C2 \u03C2\u03C3", "s ss s\u0331s\u0331"}, - {"Latin-Greek/UNGEGN", "s ss s\u0331s\u0331", "\u03C3 \u03C3\u03C2 \u03C2\u03C3"}, - {"Greek-Latin", "\u03C3 \u03C3\u03C2 \u03C2\u03C3", "s ss s\u0331s\u0331"}, - {"Latin-Greek", "s ss s\u0331s\u0331", "\u03C3 \u03C3\u03C2 \u03C2\u03C3"}, - - // Tatiana bug - // Upper: TAT\u02B9\u00C2NA - // Lower: tat\u02B9\u00E2na - // Title: Tat\u02B9\u00E2na - {"Upper", "tat\u02B9\u00E2na", "TAT\u02B9\u00C2NA"}, - {"Lower", "TAT\u02B9\u00C2NA", "tat\u02B9\u00E2na"}, - {"Title", "tat\u02B9\u00E2na", "Tat\u02B9\u00E2na"}, - }; - - public void TestSpecialCases() { - - for (int i = 0; i < registerRules.length; ++i) { - Transliterator t = Transliterator.createFromRules(registerRules[i][0], - registerRules[i][1], Transliterator.FORWARD); - DummyFactory.add(registerRules[i][0], t); - } - for (int i = 0; i < testCases.length; ++i) { - String name = testCases[i][0]; - Transliterator t = Transliterator.getInstance(name); - String id = t.getID(); - String source = testCases[i][1]; - String target = null; - - // Automatic generation of targets, to make it simpler to add test cases (and more fail-safe) - - if (testCases[i].length > 2) target = testCases[i][2]; - else if (id.equalsIgnoreCase("NFD")) target = com.ibm.text.Normalizer.normalize(source, com.ibm.text.Normalizer.DECOMP,0); - else if (id.equalsIgnoreCase("NFC")) target = com.ibm.text.Normalizer.normalize(source, com.ibm.text.Normalizer.COMPOSE,0); - else if (id.equalsIgnoreCase("NFKD")) target = com.ibm.text.Normalizer.normalize(source, com.ibm.text.Normalizer.DECOMP_COMPAT,0); - else if (id.equalsIgnoreCase("NFKC")) target = com.ibm.text.Normalizer.normalize(source, com.ibm.text.Normalizer.COMPOSE_COMPAT,0); - else if (id.equalsIgnoreCase("Lower")) target = UCharacter.toLowerCase(Locale.US, source); - else if (id.equalsIgnoreCase("Upper")) target = UCharacter.toUpperCase(Locale.US, source); - - expect(t, source, target); - } - } - - // seems like there should be an easier way to just register an instance of a transliterator - - static class DummyFactory implements Transliterator.Factory { - static DummyFactory singleton = new DummyFactory(); - static HashMap m = new HashMap(); - - // Since Transliterators are immutable, we don't have to clone on set & get - static void add(String ID, Transliterator t) { - m.put(ID, t); - //System.out.println("Registering: " + ID + ", " + t.toRules(true)); - Transliterator.registerFactory(ID, singleton); - } - public Transliterator getInstance(String ID) { - return (Transliterator) m.get(ID); - } - } - - public void TestSurrogateCasing () { - // check that casing handles surrogates - // titlecase is currently defective - int dee = UTF16.charAt(DESERET_dee,0); - int DEE = UCharacter.toTitleCase(dee); - if (!UTF16.valueOf(DEE).equals(DESERET_DEE)) { - errln("Fails titlecase of surrogates" + Integer.toString(dee,16) + ", " + Integer.toString(DEE,16)); - } - - if (!UCharacter.toUpperCase(DESERET_dee + DESERET_DEE).equals(DESERET_DEE + DESERET_DEE)) { - errln("Fails uppercase of surrogates"); - } - - if (!UCharacter.toLowerCase(DESERET_dee + DESERET_DEE).equals(DESERET_dee + DESERET_dee)) { - errln("Fails lowercase of surrogates"); - } - } - - // Check to see that incremental gets at least part way through a reasonable string. - - public void TestIncrementalProgress() { - String latinTest = "The Quick Brown Fox."; - String devaTest = Transliterator.getInstance("Latin-Devanagari").transliterate(latinTest); - String kataTest = Transliterator.getInstance("Latin-Katakana").transliterate(latinTest); - String[][] tests = { - {"Any", latinTest}, - {"Latin", latinTest}, - {"Halfwidth", latinTest}, - {"Devanagari", devaTest}, - {"Katakana", kataTest}, - }; - - Enumeration sources = Transliterator.getAvailableSources(); - while(sources.hasMoreElements()) { - String source = (String) sources.nextElement(); - String test = findMatch(source, tests); - if (test == null) { - logln("Skipping " + source + "-X"); - continue; - } - Enumeration targets = Transliterator.getAvailableTargets(source); - while(targets.hasMoreElements()) { - String target = (String) targets.nextElement(); - Enumeration variants = Transliterator.getAvailableVariants(source, target); - while(variants.hasMoreElements()) { - String variant = (String) variants.nextElement(); - String id = source + "-" + target + "/" + variant; - - String filter = getFilter(); - if (filter != null && id.indexOf(filter) < 0) continue; - - Transliterator t = Transliterator.getInstance(id); - CheckIncrementalAux(t, test); - - String rev = t.transliterate(test); - Transliterator inv = t.getInverse(); - CheckIncrementalAux(inv, rev); - } - } - } - } - - public String findMatch (String source, String[][] pairs) { - for (int i = 0; i < pairs.length; ++i) { - if (source.equalsIgnoreCase(pairs[i][0])) return pairs[i][1]; - } - return null; - } - - public void CheckIncrementalAux(Transliterator t, String input) { - - Replaceable test = new ReplaceableString(input); - Transliterator.Position pos = new Transliterator.Position(0, test.length(), 0, test.length()); - t.transliterate(test, pos); - boolean gotError = false; - - // we have a few special cases. Any-Remove (pos.start = 0, but also = limit) and U+XXXXX?X? - - if (pos.start == 0 && pos.limit != 0 && !t.getID().equals("Hex-Any/Unicode")) { - errln("No Progress, " + t.getID() + ": " + Utility.formatInput(test, pos)); - gotError = true; - } else { - logln("PASS Progress, " + t.getID() + ": " + Utility.formatInput(test, pos)); - } - t.finishTransliteration(test, pos); - if (pos.start != pos.limit) { - errln("Incomplete, " + t.getID() + ": " + Utility.formatInput(test, pos)); - gotError = true; - } - } - - public void TestFunction() { - // Careful with spacing and ';' here: Phrase this exactly - // as toRules() is going to return it. If toRules() changes - // with regard to spacing or ';', then adjust this string. - String rule = - "([:Lu:]) > $1 '(' &Lower( $1 ) '=' &Hex( &Any-Lower( $1 ) ) ')';"; - - Transliterator t = Transliterator.createFromRules("Test", rule, Transliterator.FORWARD); - if (t == null) { - errln("FAIL: createFromRules failed"); - return; - } - - String r = t.toRules(true); - if (r.equals(rule)) { - logln("OK: toRules() => " + r); - } else { - errln("FAIL: toRules() => " + r + - ", expected " + rule); - } - - expect(t, "The Quick Brown Fox", - "T(t=\\u0074)he Q(q=\\u0071)uick B(b=\\u0062)rown F(f=\\u0066)ox"); - rule = - "([^\\ -\\u007F]) > &Hex/Unicode( $1 ) ' ' &Name( $1 ) ;"; - - t = Transliterator.createFromRules("Test", rule, Transliterator.FORWARD); - if (t == null) { - errln("FAIL: createFromRules failed"); - return; - } - - r = t.toRules(true); - if (r.equals(rule)) { - logln("OK: toRules() => " + r); - } else { - errln("FAIL: toRules() => " + r + - ", expected " + rule); - } - - expect(t, "\u0301", - "U+0301 {COMBINING ACUTE ACCENT}"); - } - - //====================================================================== - // These tests are not mirrored (yet) in icu4c at - // source/test/intltest/transtst.cpp - //====================================================================== - - //====================================================================== - // Support methods - //====================================================================== - void expect(String rules, - String source, - String expectedResult, - Transliterator.Position pos) { - Transliterator t = Transliterator.createFromRules("", rules, Transliterator.FORWARD); - expect(t, source, expectedResult, pos); - } - - void expect(String rules, String source, String expectedResult) { - expect(rules, source, expectedResult, null); - } - - void expect(Transliterator t, String source, String expectedResult, - Transliterator reverseTransliterator) { - expect(t, source, expectedResult); - if (reverseTransliterator != null) { - expect(reverseTransliterator, expectedResult, source); - } - } - - void expect(Transliterator t, String source, String expectedResult) { - expect(t, source, expectedResult, (Transliterator.Position) null); - } - - void expect(Transliterator t, String source, String expectedResult, - Transliterator.Position pos) { - if (pos == null) { - String result = t.transliterate(source); - if (!expectAux(t.getID() + ":String", source, result, expectedResult)) return; - } - - Transliterator.Position index = null; - if (pos == null) { - index = new Transliterator.Position(0, source.length(), 0, source.length()); - } else { - index = new Transliterator.Position(pos.contextStart, pos.contextLimit, - pos.start, pos.limit); - } - - ReplaceableString rsource = new ReplaceableString(source); - - t.finishTransliteration(rsource, index); - // Do it all at once -- below we do it incrementally - - if (index.start != index.limit) { - expectAux(t.getID() + ":UNFINISHED", source, - "start: " + index.start + ", limit: " + index.limit, false, expectedResult); - return; - } - String result = rsource.toString(); - if (!expectAux(t.getID() + ":Replaceable", source, result, expectedResult)) return; - - - if (pos == null) { - index = new Transliterator.Position(); - } else { - index = new Transliterator.Position(pos.contextStart, pos.contextLimit, - pos.start, pos.limit); - } - - // Test incremental transliteration -- this result - // must be the same after we finalize (see below). - Vector v = new Vector(); - v.add(source); - rsource.replace(0, rsource.length(), ""); - if (pos != null) { - rsource.replace(0, 0, source); - v.add(Utility.formatInput(rsource, index)); - t.transliterate(rsource, index); - v.add(Utility.formatInput(rsource, index)); - } else { - for (int i=0; i ")); - t.transliterate(rsource, index, source.charAt(i)); - //v.add(Utility.formatInput(rsource, index) + source.substring(i+1)); - v.add(Utility.formatInput(rsource, index) + - ((i"):" =>")); - } - } - - // As a final step in keyboard transliteration, we must call - // transliterate to finish off any pending partial matches that - // were waiting for more input. - t.finishTransliteration(rsource, index); - result = rsource.toString(); - //log.append(" => ").append(rsource.toString()); - v.add(result); - - String[] results = new String[v.size()]; - v.copyInto(results); - expectAux(t.getID() + ":Incremental", results, - result.equals(expectedResult), - expectedResult); - } - - boolean expectAux(String tag, String source, - String result, String expectedResult) { - return expectAux(tag, new String[] {source, result}, - result.equals(expectedResult), - expectedResult); - } - - boolean expectAux(String tag, String source, - String result, boolean pass, - String expectedResult) { - return expectAux(tag, new String[] {source, result}, - pass, - expectedResult); - } - - boolean expectAux(String tag, String source, - boolean pass, - String expectedResult) { - return expectAux(tag, new String[] {source}, - pass, - expectedResult); - } - - boolean expectAux(String tag, String[] results, boolean pass, - String expectedResult) { - logln((pass?"(":"FAIL: (")+tag+")", pass); - - for (int i = 0; i < results.length; ++i) { - String label; - if (i == 0) { - label = "source: "; - } else if (i == results.length - 1) { - label = "result: "; - } else { - if (!isVerbose() && pass) continue; - label = "interm" + i + ": "; - } - logln(" " + label + results[i], pass, false); - } - - if (!pass) { - logln( " expected: " + expectedResult, pass, false); - } - - return pass; - } -} - - diff --git a/icu4j/src/com/ibm/test/translit/UnicodeFilterLogicTest.java b/icu4j/src/com/ibm/test/translit/UnicodeFilterLogicTest.java deleted file mode 100755 index e58053a574..0000000000 --- a/icu4j/src/com/ibm/test/translit/UnicodeFilterLogicTest.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/translit/Attic/UnicodeFilterLogicTest.java,v $ - * $Date: 2001/09/24 19:56:41 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ -package com.ibm.test.translit; -import com.ibm.text.*; -import com.ibm.test.*; -import com.ibm.util.Utility; -import java.text.*; -import java.util.*; - -/** - * @test - * @summary UnicodeFilterLogic test - */ -public class UnicodeFilterLogicTest extends TestFmwk { - - public static void main(String[] args) throws Exception { - new UnicodeFilterLogicTest().run(args); - } - - - UnicodeFilter Filter1=new UnicodeFilter() { - public boolean contains(int c) { - if(c == 0x0061 || c == 0x0041 || c == 0x0063 || c == 0x0043) - return false; - else - return true; - } - }; - UnicodeFilter Filter2=new UnicodeFilter() { - public boolean contains(int c) { - if(c == 0x0079 || c == 0x0059 || c == 0x007a || c == 0x005a || c == 0x0061 || c == 0x0063) - return false; - else - return true; - } - }; - - public void TestAllFilters() { - - Transliterator t1 = Transliterator.getInstance("Any-Hex"); - String source="abcdABCDyzYZ"; - - //sanity testing wihtout any filter - expect(t1, "without any Filter", source, "\u0061\u0062\u0063\u0064\u0041\u0042\u0043\u0044\u0079\u007A\u0059\u005A"); - //sanity testing using the Filter1(acAC) and Filter2(acyzYZ) - t1.setFilter(Filter1); - expect(t1, "with Filter(acAC)", source, "a\u0062c\u0064A\u0042C\u0044\u0079\u007A\u0059\u005A"); - t1.setFilter(Filter2); - expect(t1, "with Filter2(acyzYZ)", source, "a\u0062c\u0064\u0041\u0042\u0043\u0044yzYZ"); - - UnicodeFilter filterNOT=UnicodeFilterLogic.not(Filter1); - UnicodeFilter filterAND=UnicodeFilterLogic.and(Filter1, Filter2); - UnicodeFilter filterOR=UnicodeFilterLogic.or(Filter1, Filter2); - - checkNOT(t1, Filter1, "Filter(acAC)", source, "\u0061b\u0063d\u0041B\u0043DyzYZ"); - checkNOT(t1, Filter2, "Filter(acyzYZ)", source, "\u0061b\u0063dABCD\u0079\u007A\u0059\u005A"); - // checkNOT(t1, null, "NULL", source, "abcdABCDyzYZ"); - checkNOT(t1, filterNOT, "FilterNOT(Fitler1(acAC))", source, - "a\u0062c\u0064A\u0042C\u0044\u0079\u007A\u0059\u005A"); - checkNOT(t1, filterAND, "FilterAND(Fitler1(acAC), Filter2(acyzYZ))", source, - "\u0061b\u0063d\u0041B\u0043D\u0079\u007A\u0059\u005A"); - checkNOT(t1, filterOR, "FilterOR(Fitler1(acAC), Filter2(acyzYZ))", source, - "\u0061b\u0063dABCDyzYZ"); - - checkAND(t1, Filter1, Filter2, "Filter1(a,c,A,C), Filter2(acyzYZ)", source, - "a\u0062c\u0064A\u0042C\u0044yzYZ"); - checkAND(t1, Filter2, Filter1, "Filter2(acyzYZ), Filter1(a,c,A,C), ", source, - "a\u0062c\u0064A\u0042C\u0044yzYZ"); - checkAND(t1, Filter1, null, "Filter1(a,c,A,C), NULL", source, - "a\u0062c\u0064A\u0042C\u0044\u0079\u007A\u0059\u005A"); - checkAND(t1, null, Filter2, "NULL, Filter2(acyzYZ)", source, - "a\u0062c\u0064\u0041\u0042\u0043\u0044yzYZ"); - checkAND(t1, null, null, "NULL, NULL", source, - "\u0061\u0062\u0063\u0064\u0041\u0042\u0043\u0044\u0079\u007A\u0059\u005A"); - checkAND(t1, filterAND, null, "FilterAND(Fitler1(acAC), Filter2(acyzYZ)), NULL", source, - "a\u0062c\u0064A\u0042C\u0044yzYZ"); - checkAND(t1, filterAND, Filter1, "FilterAND(Fitler1(acAC), Filter2(acyzYZ)), Filter1(acAC)", source, - "a\u0062c\u0064A\u0042C\u0044yzYZ"); - checkAND(t1, filterAND, Filter2, "FilterAND(Fitler1(acAC), Filter2(acyzYZ)), Filter2(acyzYZ)", source, - "a\u0062c\u0064A\u0042C\u0044yzYZ"); - checkAND(t1, Filter1, filterAND, "Filter1(acAC), FilterAND(Filter1(acAC), Fitler1(acAC))", source, - "a\u0062c\u0064A\u0042C\u0044yzYZ"); - checkAND(t1, Filter2, filterAND, "Filter2(acyzYZ), FilterAND(Filter1(acAC), Fitler1(acAC))", source, - "a\u0062c\u0064A\u0042C\u0044yzYZ"); - checkAND(t1, filterOR, null, "FilterOR(Fitler1(acAC), Filter2(acyzYZ)), NULL", source, - "a\u0062c\u0064\u0041\u0042\u0043\u0044\u0079\u007A\u0059\u005A"); - checkAND(t1, filterOR, Filter1, "FilterOR(Fitler1(acAC), Filter2(acyzYZ)), Fitler1(acAC)", source, - "a\u0062c\u0064A\u0042C\u0044\u0079\u007A\u0059\u005A"); - checkAND(t1, filterOR, Filter2, "FilterOR(Fitler1(acAC), Filter2(acyzYZ)), Fitler2(acyzYZ)", source, - "a\u0062c\u0064\u0041\u0042\u0043\u0044yzYZ"); - checkAND(t1, filterNOT, Filter1, "FilterNOT(Fitler1(acAC)), Fitler1(acAC)", source, - "abcdABCDyzYZ"); - checkAND(t1, Filter1, filterNOT, "Fitler1(acAC), FilterNOT(Fitler1(acAC))", source, - "abcdABCDyzYZ"); - checkAND(t1, filterNOT, Filter2, "FilterNOT(Fitler1(acAC)), Fitler2(acyzYZ)", source, - "abcd\u0041B\u0043DyzYZ"); - checkAND(t1, Filter2, filterNOT, "Fitler2(acyzYZ), FilterNOT(Fitler1(acAC))", source, - "abcd\u0041B\u0043DyzYZ"); - - checkOR(t1, Filter1, Filter2, "Filter1(a,c,A,C), Filter2(acyzYZ)", source, - "a\u0062c\u0064\u0041\u0042\u0043\u0044\u0079\u007A\u0059\u005A"); - checkOR(t1, Filter2, Filter1, "Filter2(acyzYZ), Filter1(a,c,A,C)", source, - "a\u0062c\u0064\u0041\u0042\u0043\u0044\u0079\u007A\u0059\u005A"); - checkOR(t1, Filter1, null, "Filter1(a,c,A,C), NULL", source, - "a\u0062c\u0064A\u0042C\u0044\u0079\u007A\u0059\u005A"); - checkOR(t1, null, Filter2, "NULL, Filter2(acyzYZ)", source, - "a\u0062c\u0064\u0041\u0042\u0043\u0044yzYZ"); - checkOR(t1, null, null, "NULL, NULL", source, - "\u0061\u0062\u0063\u0064\u0041\u0042\u0043\u0044\u0079\u007A\u0059\u005A"); - checkOR(t1, filterAND, null, "FilterAND(Fitler1(acAC), Filter2(acyzYZ)), NULL", source, - "a\u0062c\u0064A\u0042C\u0044yzYZ"); - checkOR(t1, filterAND, Filter1, "FilterAND(Fitler1(acAC), Filter2(acyzYZ)), Filter1(acAC)", source, - "a\u0062c\u0064A\u0042C\u0044\u0079\u007A\u0059\u005A"); - checkOR(t1, filterAND, Filter2, "FilterAND(Fitler1(acAC), Filter2(acyzYZ)), Filter2(acyzYZ)", source, - "a\u0062c\u0064\u0041\u0042\u0043\u0044yzYZ"); - checkOR(t1, Filter1, filterAND, "Filter1(acAC), FilterAND(Filter1(acAC), Fitler1(acAC))", source, - "a\u0062c\u0064A\u0042C\u0044\u0079\u007A\u0059\u005A"); - checkOR(t1, Filter2, filterAND, "Filter2(acyzYZ), FilterAND(Filter1(acAC), Fitler1(acAC))", source, - "a\u0062c\u0064\u0041\u0042\u0043\u0044yzYZ"); - checkOR(t1, filterNOT, Filter1, "FilterNOT(Fitler1(acAC)), Fitler1(acAC)", source, - "\u0061\u0062\u0063\u0064\u0041\u0042\u0043\u0044\u0079\u007A\u0059\u005A"); - checkOR(t1, Filter1, filterNOT, "Fitler1(acAC), FilterNOT(Fitler1(acAC))", source, - "\u0061\u0062\u0063\u0064\u0041\u0042\u0043\u0044\u0079\u007A\u0059\u005A"); - checkOR(t1, filterNOT, Filter2, "FilterNOT(Fitler1(acAC)), Fitler1(acyzYZ)", source, - "\u0061\u0062\u0063\u0064\u0041\u0042\u0043\u0044yzYZ"); - checkOR(t1, Filter2, filterNOT, "Fitler2(acyzYZ), FilterNOT(Fitler1(acAC))", source, - "\u0061\u0062\u0063\u0064\u0041\u0042\u0043\u0044yzYZ"); - - -} - //====================================================================== - // Support methods - //====================================================================== - - void checkOR(Transliterator t, - UnicodeFilter f1, - UnicodeFilter f2, - String message, - String source, - String expected){ - UnicodeFilter filter=UnicodeFilterLogic.or(f1, f2); - t.setFilter(filter); - expect(t, "with FilterOR(" + message + ")", source, expected); - - } - void checkAND(Transliterator t, - UnicodeFilter f1, - UnicodeFilter f2, - String message, - String source, - String expected){ - UnicodeFilter filter=UnicodeFilterLogic.and(f1, f2); - t.setFilter(filter); - expect(t, "with FilterAND(" + message + ")", source, expected); - - } - void checkNOT(Transliterator t, - UnicodeFilter f1, - String message, - String source, - String expected){ - UnicodeFilter filter=UnicodeFilterLogic.not(f1); - t.setFilter(filter); - expect(t, "with FilterNOT(" + message + ")", source, expected); - - } - void expect(Transliterator t, String message, String source, String expectedResult) { - String rsource = source; - t.transliterate(rsource); - expectAux(t.getID() + ":Replaceable " + message, source + "->" + rsource, expectedResult.equals(rsource), expectedResult); - - } - void expectAux(String tag, String summary, boolean pass, String expectedResult) { - if (pass) { - logln("(" + tag+ ") " + Utility.escape(summary)); - } else { - errln("FAIL: ("+ tag+ ") " - + Utility.escape(summary) - + ", expected " + Utility.escape(expectedResult)); - } - } - -} - - - diff --git a/icu4j/src/com/ibm/test/translit/UnicodeSetIterator.java b/icu4j/src/com/ibm/test/translit/UnicodeSetIterator.java deleted file mode 100755 index 7d0ad8b30f..0000000000 --- a/icu4j/src/com/ibm/test/translit/UnicodeSetIterator.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.ibm.test.translit; -import com.ibm.text.*; -import com.ibm.test.*; -import com.ibm.util.Utility; -//import java.text.*; -import java.util.*; -import java.io.*; - -public final class UnicodeSetIterator { - public UnicodeSet set; - int endRange = 0; - int range = 0; - int startElement = 0; - int endElement; - int element; - boolean abbreviated = false; - - public UnicodeSetIterator(UnicodeSet set, boolean abb) { - reset(set, abb); - } - - public UnicodeSetIterator(UnicodeSet set) { - reset(set, false); - } - - public UnicodeSetIterator() { - reset(new UnicodeSet(), false); - } - - public void setAbbreviated(boolean value) { - abbreviated = value; - } - - public boolean getAbbreviated() { - return abbreviated; - } - - /* returns -1 when done */ - - public int next() { - if (abbreviated) { - if (element >= startElement + 50 && element <= endElement - 50) { - element = endElement - 50; - } - } - if (element < endElement) { - return ++element; - } - if (range >= endRange) return -1; - ++range; - endElement = set.getRangeEnd(range); - startElement = set.getRangeStart(range); - element = set.getRangeStart(range); - return element; - } - - public void reset(UnicodeSet set, boolean abb) { - abbreviated = abb; - this.set = set; - endRange = set.getRangeCount() - 1; - resetInternal(); - } - - public void reset(UnicodeSet set) { - reset(set, false); - } - - public void reset() { - reset(new UnicodeSet(), false); - } - - void resetInternal() { - range = 0; - endElement = 0; - element = 0; - if (endRange >= 0) { - element = set.getRangeStart(range); - endElement = set.getRangeEnd(range); - startElement = set.getRangeStart(range); - } - } - - // tests whether a string is in a set. - // should be in UnicodeSet - public static boolean containsSome(UnicodeSet set, String s) { - int cp; - for (int i = 0; i < s.length(); i += UTF16.getCharCount(i)) { - cp = UTF16.charAt(s, i); - if (set.contains(cp)) return true; - } - return false; - } - - // tests whether a string is in a set. - // should be in UnicodeSet - public static boolean containsAll(UnicodeSet set, String s) { - int cp; - for (int i = 0; i < s.length(); i += UTF16.getCharCount(i)) { - cp = UTF16.charAt(s, i); - if (!set.contains(cp)) return false; - } - return true; - } -} diff --git a/icu4j/src/com/ibm/test/translit/UnicodeSetTest.java b/icu4j/src/com/ibm/test/translit/UnicodeSetTest.java deleted file mode 100755 index 8b88a5c751..0000000000 --- a/icu4j/src/com/ibm/test/translit/UnicodeSetTest.java +++ /dev/null @@ -1,735 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/translit/Attic/UnicodeSetTest.java,v $ - * $Date: 2001/12/03 18:32:24 $ - * $Revision: 1.20 $ - * - ***************************************************************************************** - */ -package com.ibm.test.translit; -import com.ibm.text.*; -import com.ibm.test.*; -import com.ibm.util.Utility; -import java.text.*; -import java.util.*; - -/** - * @test - * @summary General test of UnicodeSet - */ -public class UnicodeSetTest extends TestFmwk { - - public static void main(String[] args) throws Exception { - new UnicodeSetTest().run(args); - } - - /** - * Test that toPattern() round trips with syntax characters and - * whitespace. - */ - public void TestToPattern() throws Exception { - for (int i = 0; i < OTHER_TOPATTERN_TESTS.length; ++i) { - checkPat(OTHER_TOPATTERN_TESTS[i], new UnicodeSet(OTHER_TOPATTERN_TESTS[i])); - } - for (int i = 0; i <= 0x10FFFF; ++i) { - if ((i <= 0xFF && !UCharacter.isLetter(i)) || UCharacter.isWhitespace(i)) { - // check various combinations to make sure they all work. - if (i != 0 && !toPatternAux(i, i)) continue; - if (!toPatternAux(0, i)) continue; - if (!toPatternAux(i, 0xFFFF)) continue; - } - } - } - - static String[] OTHER_TOPATTERN_TESTS = { - "[[:latin:]&[:greek:]]", - "[[:latin:]-[:greek:]]", - "[:nonspacing mark:]" - }; - - - public boolean toPatternAux(int start, int end) { - // use Integer.toString because Utility.hex doesn't handle ints - String source = "0x" + Integer.toString(start,16).toUpperCase(); - if (start != end) source += "..0x" + Integer.toString(end,16).toUpperCase(); - UnicodeSet testSet = new UnicodeSet(); - testSet.add(start, end); - return checkPat(source, testSet); - } - - boolean checkPat (String source, UnicodeSet testSet) { - String pat = ""; - try { - // What we want to make sure of is that a pattern generated - // by toPattern(), with or without escaped unprintables, can - // be passed back into the UnicodeSet constructor. - String pat0 = testSet.toPattern(true); - if (!checkPat(source + " (escaped)", testSet, pat0)) return false; - - //String pat1 = unescapeLeniently(pat0); - //if (!checkPat(source + " (in code)", testSet, pat1)) return false; - - String pat2 = testSet.toPattern(false); - if (!checkPat(source, testSet, pat2)) return false; - - //String pat3 = unescapeLeniently(pat2); - //if (!checkPat(source + " (in code)", testSet, pat3)) return false; - - //logln(source + " => " + pat0 + ", " + pat1 + ", " + pat2 + ", " + pat3); - logln(source + " => " + pat0 + ", " + pat2); - } catch (Exception e) { - errln("EXCEPTION in toPattern: " + source + " => " + pat); - return false; - } - return true; - } - - boolean checkPat (String source, UnicodeSet testSet, String pat) { - UnicodeSet testSet2 = new UnicodeSet(pat); - if (!testSet2.equals(testSet)) { - errln("Fail toPattern: " + source + " => " + pat); - return false; - } - return true; - } - - - // NOTE: copied the following from Utility. There ought to be a version in there with a flag - // that does the Java stuff - - public static int unescapeAt(String s, int[] offset16) { - int c; - int result = 0; - int n = 0; - int minDig = 0; - int maxDig = 0; - int bitsPerDigit = 4; - int dig; - int i; - - /* Check that offset is in range */ - int offset = offset16[0]; - int length = s.length(); - if (offset < 0 || offset >= length) { - return -1; - } - - /* Fetch first UChar after '\\' */ - c = UTF16.charAt(s, offset); - offset += UTF16.getCharCount(c); - - /* Convert hexadecimal and octal escapes */ - switch (c) { - case 'u': - minDig = maxDig = 4; - break; - /* - case 'U': - minDig = maxDig = 8; - break; - case 'x': - minDig = 1; - maxDig = 2; - break; - */ - default: - dig = UCharacter.digit(c, 8); - if (dig >= 0) { - minDig = 1; - maxDig = 3; - n = 1; /* Already have first octal digit */ - bitsPerDigit = 3; - result = dig; - } - break; - } - if (minDig != 0) { - while (offset < length && n < maxDig) { - // TEMPORARY - // TODO: Restore the char32-based code when UCharacter.digit - // is working (Bug 66). - - //c = UTF16.charAt(s, offset); - //dig = UCharacter.digit(c, (bitsPerDigit == 3) ? 8 : 16); - c = s.charAt(offset); - dig = Character.digit((char)c, (bitsPerDigit == 3) ? 8 : 16); - if (dig < 0) { - break; - } - result = (result << bitsPerDigit) | dig; - //offset += UTF16.getCharCount(c); - ++offset; - ++n; - } - if (n < minDig) { - return -1; - } - offset16[0] = offset; - return result; - } - - /* Convert C-style escapes in table */ - for (i=0; i indexOf() => " + set.indexOf(c)); - } - } - int c = set.charAt(set.size()); - if (c != -1) { - errln("FAIL: charAt() = " + - Utility.escape(String.valueOf(c))); - } - int j = set.indexOf('q'); - if (j != -1) { - errln("FAIL: indexOf('q') = " + j); - } - } - - public void TestExhaustive() { - // exhaustive tests. Simulate UnicodeSets with integers. - // That gives us very solid tests (except for large memory tests). - - char limit = (char)128; - - for (char i = 0; i < limit; ++i) { - logln("Testing " + i + ", " + bitsToSet(i)); - _testComplement(i); - for (char j = 0; j < limit; ++j) { - _testAdd(i,j); - _testXor(i,j); - _testRetain(i,j); - _testRemove(i,j); - } - } - } - - void _testComplement(int a) { - UnicodeSet x = bitsToSet(a); - UnicodeSet z = bitsToSet(a); - z.complement(); - int c = setToBits(z); - if (c != (~a)) { - errln("FAILED: add: ~" + x + " != " + z); - errln("FAILED: add: ~" + a + " != " + c); - } - checkCanonicalRep(z, "complement " + a); - } - - void _testAdd(int a, int b) { - UnicodeSet x = bitsToSet(a); - UnicodeSet y = bitsToSet(b); - UnicodeSet z = bitsToSet(a); - z.addAll(y); - int c = setToBits(z); - if (c != (a | b)) { - errln(Utility.escape("FAILED: add: " + x + " | " + y + " != " + z)); - errln("FAILED: add: " + a + " | " + b + " != " + c); - } - checkCanonicalRep(z, "add " + a + "," + b); - } - - void _testRetain(int a, int b) { - UnicodeSet x = bitsToSet(a); - UnicodeSet y = bitsToSet(b); - UnicodeSet z = bitsToSet(a); - z.retainAll(y); - int c = setToBits(z); - if (c != (a & b)) { - errln("FAILED: retain: " + x + " & " + y + " != " + z); - errln("FAILED: retain: " + a + " & " + b + " != " + c); - } - checkCanonicalRep(z, "retain " + a + "," + b); - } - - void _testRemove(int a, int b) { - UnicodeSet x = bitsToSet(a); - UnicodeSet y = bitsToSet(b); - UnicodeSet z = bitsToSet(a); - z.removeAll(y); - int c = setToBits(z); - if (c != (a &~ b)) { - errln("FAILED: remove: " + x + " &~ " + y + " != " + z); - errln("FAILED: remove: " + a + " &~ " + b + " != " + c); - } - checkCanonicalRep(z, "remove " + a + "," + b); - } - - void _testXor(int a, int b) { - UnicodeSet x = bitsToSet(a); - UnicodeSet y = bitsToSet(b); - UnicodeSet z = bitsToSet(a); - z.complementAll(y); - int c = setToBits(z); - if (c != (a ^ b)) { - errln("FAILED: complement: " + x + " ^ " + y + " != " + z); - errln("FAILED: complement: " + a + " ^ " + b + " != " + c); - } - checkCanonicalRep(z, "complement " + a + "," + b); - } - - /** - * Check that ranges are monotonically increasing and non- - * overlapping. - */ - void checkCanonicalRep(UnicodeSet set, String msg) { - int n = set.getRangeCount(); - if (n < 0) { - errln("FAIL result of " + msg + - ": range count should be >= 0 but is " + - n + " for " + Utility.escape(set.toString())); - return; - } - int last = 0; - for (int i=0; i end) { - errln("FAIL result of " + msg + - ": range " + (i+1) + - " start > end: " + start + ", " + end + - " for " + Utility.escape(set.toString())); - } - if (i > 0 && start <= last) { - errln("FAIL result of " + msg + - ": range " + (i+1) + - " overlaps previous range: " + start + ", " + end + - " for " + Utility.escape(set.toString())); - } - last = end; - } - } - - /** - * Convert a bitmask to a UnicodeSet. - */ - static UnicodeSet bitsToSet(int a) { - UnicodeSet result = new UnicodeSet(); - for (int i = 0; i < 32; ++i) { - if ((a & (1< 0xFFFF) { - end = 0xFFFF; - i = set.getRangeCount(); // Should be unnecessary - } - pairs.append((char)start).append((char)end); - } - return pairs.toString(); - } - - /** - * Expect the given set to contain the characters in charsIn and - * to not contain those in charsOut. - */ - void expectContainment(UnicodeSet set, String charsIn, String charsOut) { - StringBuffer bad = new StringBuffer(); - if (charsIn != null) { - for (int i=0; i0xffff) i++; - if (!set.contains(c)) { - UTF16.append(bad,c); - } - } - if (bad.length() > 0) { - errln(Utility.escape("FAIL: set " + set + " does not contain " + bad + - ", expected containment of " + charsIn)); - } else { - logln(Utility.escape("Ok: set " + set + " contains " + charsIn)); - } - } - if (charsOut != null) { - bad.setLength(0); - for (int i=0; i 0) { - errln(Utility.escape("FAIL: set " + set + " contains " + bad + - ", expected non-containment of " + charsOut)); - } else { - logln(Utility.escape("Ok: set " + set + " does not contain " + charsOut)); - } - } - } - - void expectPattern(UnicodeSet set, - String pattern, - String expectedPairs) { - set.applyPattern(pattern); - if (!getPairs(set).equals(expectedPairs)) { - errln("FAIL: applyPattern(\"" + pattern + - "\") => pairs \"" + - Utility.escape(getPairs(set)) + "\", expected \"" + - Utility.escape(expectedPairs) + "\""); - } else { - logln("Ok: applyPattern(\"" + pattern + - "\") => pairs \"" + - Utility.escape(getPairs(set)) + "\""); - } - } - - void expectPairs(UnicodeSet set, String expectedPairs) { - if (!getPairs(set).equals(expectedPairs)) { - errln("FAIL: Expected pair list \"" + - Utility.escape(expectedPairs) + "\", got \"" + - Utility.escape(getPairs(set)) + "\""); - } - } - static final String CharsToUnicodeString(String s) { - return Utility.unescape(s); - } -} diff --git a/icu4j/src/com/ibm/test/translit/UnicodeToHexTransliteratorTest.java b/icu4j/src/com/ibm/test/translit/UnicodeToHexTransliteratorTest.java deleted file mode 100755 index 6b9991dbae..0000000000 --- a/icu4j/src/com/ibm/test/translit/UnicodeToHexTransliteratorTest.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/translit/Attic/UnicodeToHexTransliteratorTest.java,v $ - * $Date: 2001/09/24 19:56:41 $ - * $Revision: 1.4 $ - * - ***************************************************************************************** - */ -package com.ibm.test.translit; -import com.ibm.text.*; -import com.ibm.test.*; -import com.ibm.util.Utility; -import java.text.*; -import java.util.*; - - -/** - * @test - * @summary General test of UnicodeToHexTransliterator - */ -public class UnicodeToHexTransliteratorTest extends TestFmwk { - - public static void main(String[] args) throws Exception { - new UnicodeToHexTransliteratorTest().run(args); - } - - /** - * Used by TestConstruction() and TestTransliterate. - */ - UnicodeFilter UniFilter=new UnicodeFilter() { - public boolean contains(int c) { - if(c==0x0063 || c==0x0061 || c==0x0043 || c==0x0041) - return false; - else - return true; - } - }; - - public void TestConstruction(){ - logln("Testing the construction UnicodeToHexTransliterator()"); - UnicodeToHexTransliterator trans1=new UnicodeToHexTransliterator(); - - - logln("Testing the cosntruction UnicodeToHexTransliterator(pattern)"); - String pattern="\\\\U+0000abc"; - try{ - trans1=new UnicodeToHexTransliterator(pattern); - }catch(IllegalArgumentException ex2) { - errln("FAIL: UnicodeToHexTransliterator construction failed with pattern=" + pattern + " Exception= " + ex2.toString()); - } - - logln("Testing the cosntruction UnicodeToHexTransliterator(pattern) with illegal pattern"); - String pattern2="\\X+"; - try{ - trans1=new UnicodeToHexTransliterator(pattern2); - }catch(IllegalArgumentException ex3) { - logln("OK: construction with Illegal pattern handled correctly"); - } - - logln("Testing the construction UnicodeToHexTransliterator(pattern, isUppercase=false, adoptedFilter=null)"); - try{ - trans1=new UnicodeToHexTransliterator(pattern, false, null); - }catch(IllegalArgumentException ex4) { - errln("FAIL: UnicodeToHexTransliterator(pattern, isUppercase=false, adoptedFilter=null) construction failed. Exception= " + ex4.toString()); - } - - logln("Testing the construction UnicodeToHexTransliterator(pattern, isUppercase=true, adoptedFilter)"); - try{ - trans1=new UnicodeToHexTransliterator(pattern, true, UniFilter); - }catch(IllegalArgumentException ex4) { - errln("FAIL: UnicodeToHexTransliterator(pattern, isUppercase=true, adoptedFilter) construction failed. Exception= " + ex4.toString()); - } - - } - - public void TestUpperCase(){ - logln("Testing the isUppercase() and setUppercase() API of UnicodeToHexTransliterator"); - String str="abk"; - /*default transliterator has upper case TRUE*/ - UnicodeToHexTransliterator transdefault=new UnicodeToHexTransliterator(); - expect(transdefault, "where uppercase=default", str, "\\u0061\\u0062\\u006B"); - - String pattern="\\\\u0000"; - /*transliterator with Uppercase FALSE*/ - UnicodeToHexTransliterator trans1=null; - try{ - trans1=new UnicodeToHexTransliterator(pattern, false, null); - }catch(IllegalArgumentException ex1) { - errln("FAIL: UnicodeToHexTransliterator(pattern, false,null) construction failed with patter" - + pattern+ " Exception: " + ex1.toString()); - } - expect(trans1, "where uppercase=FALSE", str, "\\u0061\\u0062\\u006b"); /*doesn't display uppercase*/ - - if(transdefault.isUppercase() != true || - trans1.isUppercase() != false ){ - errln("isUpperCase() failed"); - } - - /*changing the outputhexdigits to lower case for the default transliterator*/ - transdefault.setUppercase(trans1.isUppercase()); - if(transdefault.isUppercase() != trans1.isUppercase() || - transdefault.isUppercase() != false){ - errln("setUppercase() failed"); - } - /*doesn't ouput uppercase hex, since transdefault's uppercase is set to FALSE using setUppercase*/ - expect(transdefault, "where uppercase=FALSE", str, "\\u0061\\u0062\\u006b"); - - /*trying round trip*/ - transdefault.setUppercase(true); - if(transdefault.isUppercase() != true || - transdefault.isUppercase() == trans1.isUppercase() ){ - errln("setUppercase() failed"); - } - /*displays upper case since it is set to TRUE*/ - expect(transdefault, "where uppercase=TRUE", str, "\\u0061\\u0062\\u006B"); - - } - public void TestPattern(){ - logln("Testing the applyPattern() and toPattern() API of UnicodeToHexTransliterator"); - /*default transliterator has pattern \\u0000*/ - UnicodeToHexTransliterator transdefault=new UnicodeToHexTransliterator(); - - String defaultpattern=transdefault.toPattern(); - String pattern1="\\\\U+0000"; - - UnicodeToHexTransliterator trans1=null; - try{ - trans1=new UnicodeToHexTransliterator(pattern1, true, null); - }catch(IllegalArgumentException ex1) { - errln("FAIL: UnicodeToHexTransliterator construction failed with pattern =" + pattern1 + - "Exception:" + ex1.toString()); - } - - /*test toPattern() */ - if(transdefault.toPattern().equals(trans1.toPattern()) == true || - transdefault.toPattern().equals("\\\\u0000") != true || - trans1.toPattern().equals(pattern1) != true ){ - errln("Error: toPattern() failed"); - } - - /*apply patterns for transdefault*/ - String str="abKf"; - expectPattern(transdefault, pattern1, str, "\\U+0061\\U+0062\\U+004B\\U+0066"); - expectPattern(transdefault, "\\U##00,", str, "U61,U62,U4B,U66,"); - expectPattern(transdefault, defaultpattern, str, "\\u0061\\u0062\\u004B\\u0066"); - expectPattern(trans1, "\\uni0000", str, "uni0061uni0062uni004Buni0066"); - expectPattern(trans1, "\\\\S-0000-E", str, "\\S-0061-E\\S-0062-E\\S-004B-E\\S-0066-E"); - expectPattern(trans1, "\\u##0000", str, "FAIL"); - expectPattern(trans1, "\\*0000", str, "*0061*0062*004B*0066"); - expectPattern(trans1, "\\u####", str, "FAIL"); - - } - - public void TestSimpleTransliterate(){ - String pattern1="\\\\U+0000"; - UnicodeToHexTransliterator trans1=null; - try{ - trans1=new UnicodeToHexTransliterator(pattern1, true, null); - }catch(IllegalArgumentException iae){ - errln("UnicodeToHexTransliterator(pattern1, true, null) construction failed with pattern =" - + pattern1 + "Exception:" + iae.toString()); - } - String source="Hello"; - String expected="He\\U+006C\\U+006C\\U+006F"; - - expectTranslit(trans1, ":Replaceable ", source, 1, 5, 2, expected); - } - - public void TestTransliterate(){ - String Data[]={ - //pattern, source, index.contextStart, index.contextLimit, index.start, expectedResult, expectedResult using filter(a, b) - "U+##00", "abc", "1", "3", "2", "abU+63", "abc", - "\\\\u0000", "abc", "1", "2", "1", "a\\u0062c", "a\\u0062c", - "Uni0000", "abc", "1", "3", "2", "abUni0063", "abc", - "U[0000]", "hello", "0", "4", "2", "heU[006C]U[006C]o", "heU[006C]U[006C]o", - "prefix-0000-suffix", "abc", "1", "3", "1", "aprefix-0062-suffixprefix-0063-suffix", "aprefix-0062-suffixc", - "*##00*", "hellothere", "1", "8", "4", "hell*6F**74**68**65*re", "hell*6F**74**68**65*re", - - }; - UnicodeToHexTransliterator trans1=null; - UnicodeToHexTransliterator trans2=null; - for(int i=0;i" + result, result.equals(expectedResult), expectedResult); - } - private void expectPattern(UnicodeToHexTransliterator t, - String pattern, String source, String expectedResult){ - - try{ - t.applyPattern(pattern); - }catch(IllegalArgumentException iae){ - if(expectedResult.equals("FAIL")){ - logln("OK: calling applyPattern() with illegal pattern failed as expected." + iae.toString()); - } else{ - errln("FAIL: applyPattern() failed with pattern =" + pattern + "--->" + iae.toString()); - } - } - if(!expectedResult.equals("FAIL")){ - if(!t.toPattern().equals(pattern)) { - errln("FAIL: applyPattern or toPatten failed. Expected: " + pattern + "Got: " + t.toPattern()); - }else{ - logln("OK: applyPattern passed. Testing transliteration"); - expect(t, " with pattern "+pattern, source, expectedResult); - } - } - } - private void expect(UnicodeToHexTransliterator t, String message, String source, String expectedResult) { - - String result=t.transliterate(source); - expectAux(t.getID() + ":String " + message, source + "->" + result, result.equals(expectedResult), expectedResult); - - ReplaceableString rsource = new ReplaceableString(source); - t.transliterate(rsource); - result = rsource.toString(); - expectAux(t.getID() + ":Replaceable" + message, source + "->" + result, result.equals(expectedResult), expectedResult); - - // Test keyboard (incremental) transliteration -- this result - // must be the same after we finalize (see below). - rsource.replace(0, rsource.length(), ""); - Transliterator.Position index = new Transliterator.Position(); - StringBuffer log = new StringBuffer(); - - for (int i=0; i "); - t.transliterate(rsource, index, - String.valueOf(source.charAt(i))); - // Append the string buffer with a vertical bar '|' where - // the committed index is. - String s = rsource.toString(); - log.append(s.substring(0, index.start)). - append('|'). - append(s.substring(index.start)); - } - - // As a final step in keyboard transliteration, we must call - // transliterate to finish off any pending partial matches that - // were waiting for more input. - t.finishTransliteration(rsource, index); - result = rsource.toString(); - log.append(" => ").append(rsource.toString()); - expectAux(t.getID() + ":Keyboard", log.toString() + "\n" + source + " -> " + result, result.equals(expectedResult), expectedResult); - - } - private void expectAux(String tag, String summary, boolean pass, String expectedResult) { - if (pass) { - logln("(" + tag + ") " + Utility.escape(summary)); - } else { - errln("FAIL: (" + tag+ ") " - + Utility.escape(summary) - + ", expected " + Utility.escape(expectedResult)); - } - } -} - - - diff --git a/icu4j/src/com/ibm/test/translit/WriteCharts.java b/icu4j/src/com/ibm/test/translit/WriteCharts.java deleted file mode 100755 index 42b2bfad45..0000000000 --- a/icu4j/src/com/ibm/test/translit/WriteCharts.java +++ /dev/null @@ -1,387 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/test/translit/Attic/WriteCharts.java,v $ - * $Date: 2001/11/20 01:14:43 $ - * $Revision: 1.11 $ - * - ***************************************************************************************** - */ - -package com.ibm.test.translit; -import com.ibm.text.*; -import com.ibm.test.*; -import com.ibm.util.Utility; -//import java.text.*; -import java.util.*; -import java.io.*; - -public class WriteCharts { - public static void main(String[] args) throws IOException { - if (false) { - printSet("[[\u0000-\u007E \u30A1-\u30FC \uFF61-\uFF9F\u3001\u3002][:Katakana:][:Mark:]]"); - } - String testSet = ""; - if (args.length == 0) args = getAllScripts(); - for (int i = 0; i < args.length; ++i) { - // Enumeration enum = Transliterator.getAvailableIDs(); - if (args[i].startsWith("[")) { - testSet = args[i]; - } else { - print(testSet, args[i]); - testSet = ""; - } - } - } - - public static void printSet(String source) { - UnicodeSet s = new UnicodeSet(source); - System.out.println("Printout for '" + source + "'"); - int count = s.getRangeCount(); - for (int i = 0; i < count; ++i) { - int start = s.getRangeStart(i); - int end = s.getRangeEnd(i); - System.out.println(Integer.toString(start,16) + ".." + Integer.toString(end,16)); - } - } - - public static String[] getAllScripts() { - Set set = new TreeSet(); - int scripts[]; - Enumeration sources = Transliterator.getAvailableSources(); - while(sources.hasMoreElements()) { - String source = (String) sources.nextElement(); - scripts = UScript.getCode(source); - if (scripts == null) { - System.out.println("[Skipping " + source + "]"); - continue; - } - int sourceScript = scripts[0]; - System.out.println("Source: " + source + ";\tScripts: " + showScripts(scripts)); - Enumeration targets = Transliterator.getAvailableTargets(source); - while(targets.hasMoreElements()) { - String target = (String) targets.nextElement(); - scripts = UScript.getCode(target); - if (scripts == null - || priority(scripts[0]) < priority(sourceScript)) { - // skip doing both directions - System.out.println("[Skipping '" + source + "-" + target + "']"); - continue; - } - System.out.println("\tTarget: " + target + ";\tScripts: " + showScripts(scripts)); - Enumeration variants = Transliterator.getAvailableVariants(source, target); - while(variants.hasMoreElements()) { - String variant = (String) variants.nextElement(); - String id = source + "-" + target; - if (variant.length() != 0) { - id += "/" + variant; - if (false) { - System.out.println("SKIPPING VARIANT, SINCE IT CURRENTLY BREAKS!\t" + id); - continue; - } - } - System.out.println("\t\t\t\tAdding: '" + id + "'"); - set.add(id); - } - } - } - String[] results = new String[set.size()]; - set.toArray(results); - return results; - }; - - static public int priority(int script) { - if (script == UScript.LATIN) return -2; - return script; - } - - public static String showScripts(int[] scripts) { - StringBuffer results = new StringBuffer(); - for (int i = 0; i < scripts.length; ++i) { - if (i != 0) results.append(", "); - results.append(UScript.getName(scripts[i])); - } - return results.toString(); - } - - public static void print(String testSet, String rawId) throws IOException { - System.out.println("Processing " + rawId); - Transliterator t = Transliterator.getInstance(rawId); - String id = t.getID(); - - // clean up IDs. Ought to be API for getting source, target, variant - int minusPos = id.indexOf('-'); - String source = id.substring(0,minusPos); - String target = id.substring(minusPos+1); - int slashPos = target.indexOf('/'); - if (slashPos >= 0) target = target.substring(0,slashPos); - - // check that the source is a script - if (testSet.equals("")) { - int[] scripts = UScript.getCode(source); - if (scripts == null) { - System.out.println("FAILED: " - + Transliterator.getDisplayName(id) - + " does not have a script as the source"); - return; - } else { - testSet = "[:" + source + ":]"; - if (source.equalsIgnoreCase("katakana")) { - testSet = "[" + testSet + "\u30FC]"; - printSet(testSet); - } - } - } - UnicodeSet sourceSet = new UnicodeSet(testSet); - - // check that the target is a script - int[] scripts = UScript.getCode(target); - if (scripts == null) { - target = "[:Latin:]"; - } else { - target = "[:" + target + ":]"; - } - UnicodeSet targetSet = new UnicodeSet(target); - - Transliterator inverse = t.getInverse(); - - //Transliterator hex = Transliterator.getInstance("Any-Hex"); - - - // iterate through script - System.out.println("Transliterating " + sourceSet.toPattern(true) - + " with " + Transliterator.getDisplayName(id)); - - UnicodeSet leftOverSet = new UnicodeSet(targetSet); - UnicodeSet privateUse = new UnicodeSet("[:private use:]"); - - Map map = new TreeMap(); - - UnicodeSet targetSetPlusAnyways = new UnicodeSet(targetSet); - targetSetPlusAnyways.addAll(okAnyway); - - UnicodeSet sourceSetPlusAnyways = new UnicodeSet(sourceSet); - sourceSetPlusAnyways.addAll(okAnyway); - - UnicodeSetIterator usi = new UnicodeSetIterator(sourceSet); - while (true) { - int j = usi.next(); - if (j < 0) break; - /* - int count = sourceSet.getRangeCount(); - for (int i = 0; i < count; ++i) { - int end = sourceSet.getRangeEnd(i); - for (int j = sourceSet.getRangeStart(i); j <= end; ++j) { - */ - String flag = ""; - String ss = UTF16.valueOf(j); - String ts = t.transliterate(ss); - char group = 0; - if (!UnicodeSetIterator.containsAll(targetSetPlusAnyways, ts)) { - group |= 1; - } - if (UTF16.countCodePoint(ts) == 1) { - leftOverSet.remove(UTF16.charAt(ts,0)); - } - String rt = inverse.transliterate(ts); - if (!UnicodeSetIterator.containsAll(sourceSetPlusAnyways, rt)) { - group |= 2; - } else if (!ss.equals(rt)) { - group |= 4; - } - - if (UnicodeSetIterator.containsSome(privateUse, ts) || UnicodeSetIterator.containsSome(privateUse, rt)) { - group |= 16; - } - - map.put(group + UCharacter.toLowerCase(Normalizer.normalize(ss, Normalizer.DECOMP_COMPAT, 0)) - + "\u0000" + ss, - "
" ); - - // Check Duals - /* - int maxDual = 200; - dual: - for (int i2 = 0; i2 < count; ++i2) { - int end2 = sourceSet.getRangeEnd(i2); - for (int j2 = sourceSet.getRangeStart(i2); j2 <= end; ++j2) { - String ss2 = UTF16.valueOf(j2); - String ts2 = t.transliterate(ss2); - String rt2 = inverse.transliterate(ts2); - - String ss12 = ss + ss2; - String ts12 = t.transliterate(ss + ss12); - String rt12 = inverse.transliterate(ts12); - if (ts12.equals(ts + ts2) && rt12.equals(rt + rt2)) continue; - if (--maxDual < 0) break dual; - - // transliteration of whole differs from that of parts - group = 0x100; - map.put(group + UCharacter.toLowerCase(Normalizer.normalize(ss12, Normalizer.DECOMP_COMPAT, 0)) - + "\u0000" + ss12, - "" ); - } - } - */ - //} - } - - - leftOverSet.remove(0x0100,0x02FF); // remove extended & IPA - - /*int count = leftOverSet.getRangeCount(); - for (int i = 0; i < count; ++i) { - int end = leftOverSet.getRangeEnd(i); - for (int j = leftOverSet.getRangeStart(i); j <= end; ++j) { - */ - - usi.reset(leftOverSet); - while (true) { - int j = usi.next(); - if (j < 0) break; - - String ts = UTF16.valueOf(j); - // String decomp = Normalizer.normalize(ts, Normalizer.DECOMP_COMPAT, 0); - // if (!decomp.equals(ts)) continue; - - String rt = inverse.transliterate(ts); - String flag = ""; - char group = 0x80; - - if (!UnicodeSetIterator.containsAll(sourceSetPlusAnyways, rt)) { - group |= 8; - } - if (UnicodeSetIterator.containsSome(privateUse, rt)) { - group |= 16; - } - - map.put(group + UCharacter.toLowerCase(Normalizer.normalize(ts, Normalizer.DECOMP_COMPAT, 0)) + ts, - ""); - //} - } - - // make file name and open - File f = new File("transliteration/chart_" + id.replace('/', '_') + ".html"); - String filename = f.getCanonicalFile().toString(); - PrintWriter out = new PrintWriter( - new OutputStreamWriter( - new FileOutputStream(filename), "UTF-8")); - //out.print('\uFEFF'); // BOM - - System.out.println("Writing " + filename); - - try { - out.println(""); - out.println(""); - out.println(""); - out.println(""); - - out.println(""); - out.println("

Transliteration Samples for '" + Transliterator.getDisplayName(id) + "'

"); - out.println("

This file illustrates the transliterations of " + Transliterator.getDisplayName(id) + "."); - out.println("The samples are mechanically generated, and only include single characters"); - out.println("from the source set. Thus it will not contain examples where the transliteration"); - out.println("depends on the context around the character. For a more detailed -- and interactive -- example, see the"); - out.println("Transliteration Demo


"); - - // set up the headers - int columnCount = 3; - String headerBase = ""; - String headers = headerBase; - for (int i = columnCount - 1; i > 0; --i) { - if (i != columnCount - 1) headers += ""; - headers += headerBase; - } - - String tableHeader = "

WarrantyLengthRestrictions
Silver2\n" + - "YearsYes
Gold" + ss + "
" + hex(ss) - + "
" + ts + "
" + hex(ts) - + "
" + rt + "
" + hex(rt) + "
" + ss12 + "
" + hex(ss12) - + "
" + ts12 + "
" + hex(ts12) - + "
" + rt12 + "
" + hex(rt12) + "
-" + ts + "
" + hex(ts) - + "
" - + rt + "
" + hex(rt) + "
SourceTargetReturn 
" + headers + ""; - String tableFooter = "

"; - out.println("

Round Trip

"); - out.println(tableHeader); - - Iterator it = map.keySet().iterator(); - char lastGroup = 0; - int count = 0; - int column = 0; - while (it.hasNext()) { - String key = (String) it.next(); - char group = key.charAt(0); - if (group != lastGroup || count++ > 50) { - lastGroup = group; - count = 0; - if (column != 0) { - out.println(""); - column = 0; - } - out.println(tableFooter); - - String title = ""; - if ((group & 0x100) != 0) out.println("

Duals

"); - else if ((group & 0x80) != 0) out.println("

Completeness

"); - else out.println("

Round Trip

"); - if ((group & 16) != 0) out.println("

Errors: Contains Private Use Characters

"); - if ((group & 8) != 0) out.println("

Possible Errors: Return not in Source Set

"); - if ((group & 4) != 0) out.println("

One-Way Mapping: Return not equal to Source

"); - if ((group & 2) != 0) out.println("

Errors: Return not in Source Set

"); - if ((group & 1) != 0) out.println("

Errors: Target not in Target Set

"); - - out.println(tableHeader); - column = 0; - } - String value = (String) map.get(key); - if (column++ == 0) out.print(""); - else out.print(" "); - out.println(value); - if (column == 3) { - out.println(""); - column = 0; - } - } - if (column != 0) { - out.println(""); - column = 0; - } - out.println(tableFooter + ""); - - } finally { - out.close(); - } - } - - public static String hex(String s) { - int cp; - StringBuffer results = new StringBuffer(); - for (int i = 0; i < s.length(); i += UTF16.getCharCount(cp)) { - cp = UTF16.charAt(s, i); - if (i != 0) results.append(' '); - results.append(Integer.toHexString(cp)); - } - return results.toString().toUpperCase(); - } - - static final UnicodeSet okAnyway = new UnicodeSet("[^[:Letter:]]"); - - /* - // tests whether a string is in a set. Also checks for Common and Inherited - public static boolean isIn(String s, UnicodeSet set) { - int cp; - for (int i = 0; i < s.length(); i += UTF16.getCharCount(i)) { - cp = UTF16.charAt(s, i); - if (set.contains(cp)) continue; - if (okAnyway.contains(cp)) continue; - return false; - } - return true; - } - */ - -} - \ No newline at end of file diff --git a/icu4j/src/com/ibm/test/translit/package.html b/icu4j/src/com/ibm/test/translit/package.html deleted file mode 100755 index 344c4b853e..0000000000 --- a/icu4j/src/com/ibm/test/translit/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Transliterator tests. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/text/ArabicShaping.java b/icu4j/src/com/ibm/text/ArabicShaping.java deleted file mode 100755 index 83caaf73e5..0000000000 --- a/icu4j/src/com/ibm/text/ArabicShaping.java +++ /dev/null @@ -1,1179 +0,0 @@ -/* -******************************************************************************* -* Copyright (C) 2001, International Business Machines -* Corporation and others. All Rights Reserved. -******************************************************************************* -*/ - -package com.ibm.text; - -/** - * Shape Arabic text on a character basis. - * - *

ArabicShaping performs basic operations for "shaping" Arabic text. It is most - * useful for use with legacy data formats and legacy display technology - * (simple terminals). All operations are performed on Unicode characters.

- * - *

Text-based shaping means that some character code points in the text are - * replaced by others depending on the context. It transforms one kind of text - * into another. In comparison, modern displays for Arabic text select - * appropriate, context-dependent font glyphs for each text element, which means - * that they transform text into a glyph vector.

- * - *

Text transformations are necessary when modern display technology is not - * available or when text needs to be transformed to or from legacy formats that - * use "shaped" characters. Since the Arabic script is cursive, connecting - * adjacent letters to each other, computers select images for each letter based - * on the surrounding letters. This usually results in four images per Arabic - * letter: initial, middle, final, and isolated forms. In Unicode, on the other - * hand, letters are normally stored abstract, and a display system is expected - * to select the necessary glyphs. (This makes searching and other text - * processing easier because the same letter has only one code.) It is possible - * to mimic this with text transformations because there are characters in - * Unicode that are rendered as letters with a specific shape - * (or cursive connectivity). They were included for interoperability with - * legacy systems and codepages, and for unsophisticated display systems.

- * - *

A second kind of text transformations is supported for Arabic digits: - * For compatibility with legacy codepages that only include European digits, - * it is possible to replace one set of digits by another, changing the - * character code points. These operations can be performed for either - * Arabic-Indic Digits (U+0660...U+0669) or Eastern (Extended) Arabic-Indic - * digits (U+06f0...U+06f9).

- * - *

Some replacements may result in more or fewer characters (code points). - * By default, this means that the destination buffer may receive text with a - * length different from the source length. Some legacy systems rely on the - * length of the text to be constant. They expect extra spaces to be added - * or consumed either next to the affected character or at the end of the - * text.

- */ -public final class ArabicShaping { - private final int options; - private boolean isLogical; // convenience - - /** - * Convert a range of text in the source array, putting the result - * into a range of text in the destination array, and return the number - * of characters written. - * - * @param source An array containing the input text - * @param sourceStart The start of the range of text to convert - * @param sourceLength The length of the range of text to convert - * @param dest The destination array that will receive the result. - * It may be NULL only if destSize is 0. - * @param destStart The start of the range of the destination buffer to use. - * @param destSize The size (capacity) of the destination buffer. - * If destSize is 0, then no output is produced, - * but the necessary buffer size is returned ("preflighting"). This - * does not validate the text against the options, for example, - * if letters are being unshaped, and spaces are being consumed - * following lamalef, this will not detect a lamalef without a - * corresponding space. An error will be thrown when the actual - * conversion is attempted. - * @return The number of chars written to the destination buffer. - * If an error occurs, then no output was written, or it may be - * incomplete. - * @throws ArabicShapingException if the text cannot be converted according to the options. - */ - public int shape(char[] source, int sourceStart, int sourceLength, - char[] dest, int destStart, int destSize) throws ArabicShapingException { - if (source == null) { - throw new IllegalArgumentException("source can not be null"); - } - if (sourceStart < 0 || sourceLength < 0 || sourceStart + sourceLength > source.length) { - throw new IllegalArgumentException("bad source start (" + sourceStart + - ") or length (" + sourceLength + - ") for buffer of length " + source.length); - } - if (dest == null && destSize != 0) { - throw new IllegalArgumentException("null dest requires destSize == 0"); - } - if ((destSize != 0) && - (destStart < 0 || destSize < 0 || destStart + destSize > dest.length)) { - throw new IllegalArgumentException("bad dest start (" + destStart + - ") or size (" + destSize + - ") for buffer of length " + dest.length); - } - - return internalShape(source, sourceStart, sourceLength, dest, destStart, destSize); - } - - /** - * Convert a range of text in place. This may only be used if the Length option - * does not grow or shrink the text. - * - * @param source An array containing the input text - * @param start The start of the range of text to convert - * @param length The length of the range of text to convert - * @throws ArabicShapingException if the text cannot be converted according to the options. - */ - public void shape(char[] source, int start, int length) throws ArabicShapingException { - if ((options & LENGTH_MASK) == LENGTH_GROW_SHRINK) { - throw new ArabicShapingException("Cannot shape in place with length option grow/shrink."); - } - shape(source, start, length, source, start, length); - } - - /** - * Convert a string, returning the new string. - * - * @param source The string to convert. - * @return The converted string. - * @throws ArabicShapingException if the string cannot be converted according to the options. - */ - public String shape(String text) throws ArabicShapingException { - char[] src = text.toCharArray(); - char[] dest = src; - if (((options & LENGTH_MASK) == LENGTH_GROW_SHRINK) && - ((options & LETTERS_MASK) == LETTERS_UNSHAPE)) { - - dest = new char[src.length * 2]; // max - } - int len = shape(src, 0, src.length, dest, 0, dest.length); - - return new String(dest, 0, len); - } - - /** - * Construct ArabicShaping using the options flags. - * The flags are as follows:
- * 'LENGTH' flags control whether the text can change size, and if not, - * how to maintain the size of the text when LamAlef ligatures are - * formed or broken.
- * 'TEXT_DIRECTION' flags control whether the text is read and written - * in visual order or in logical order.
- * 'LETTERS_SHAPE' flags control whether conversion is to or from - * presentation forms.
- * 'DIGITS' flags control whether digits are shaped, and whether from - * European to Arabic-Indic or vice-versa.
- * 'DIGIT_TYPE' flags control whether standard or extended Arabic-Indic - * digits are used when performing digit conversion. - */ - public ArabicShaping(int options) { - this.options = options; - if ((options & DIGITS_MASK) > 0x80) { - throw new IllegalArgumentException("bad DIGITS options"); - } - isLogical = (options & TEXT_DIRECTION_MASK) == TEXT_DIRECTION_LOGICAL; - } - - /** - * Memory option: allow the result to have a different length than the source. - */ - public static final int LENGTH_GROW_SHRINK = 0; - - /** - * Memory option: the result must have the same length as the source. - * If more room is necessary, then try to consume spaces next to modified characters. - */ - public static final int LENGTH_FIXED_SPACES_NEAR = 1; - - /** - * Memory option: the result must have the same length as the source. - * If more room is necessary, then try to consume spaces at the end of the text. - */ - public static final int LENGTH_FIXED_SPACES_AT_END = 2; - - /** - * Memory option: the result must have the same length as the source. - * If more room is necessary, then try to consume spaces at the beginning of the text. - */ - public static final int LENGTH_FIXED_SPACES_AT_BEGINNING = 3; - - /** - * Bit mask for memory options. - */ - public static final int LENGTH_MASK = 3; - - - /** - * Direction indicator: the source is in logical (keyboard) order. - */ - public static final int TEXT_DIRECTION_LOGICAL = 0; - - /** - * Direction indicator: the source is in visual (display) order, that is, - * the leftmost displayed character is stored first. - */ - public static final int TEXT_DIRECTION_VISUAL_LTR = 4; - - /** - * Bit mask for direction indicators. - */ - public static final int TEXT_DIRECTION_MASK = 4; - - - /** - * Letter shaping option: do not perform letter shaping. - */ - public static final int LETTERS_NOOP = 0; - - /** - * Letter shaping option: replace normative letter characters in the U+0600 (Arabic) block, - * by shaped ones in the U+FE70 (Presentation Forms B) block. Performs Lam-Alef ligature - * substitution. - */ - public static final int LETTERS_SHAPE = 8; - - /** - * Letter shaping option: replace shaped letter characters in the U+FE70 (Presentation Forms B) block - * by normative ones in the U+0600 (Arabic) block. Converts Lam-Alef ligatures to pairs of Lam and - * Alef characters, consuming spaces if required. - */ - public static final int LETTERS_UNSHAPE = 0x10; - - /** - * Letter shaping option: replace normative letter characters in the U+0600 (Arabic) block, - * except for the TASHKEEL characters at U+064B...U+0652, by shaped ones in the U+Fe70 - * (Presentation Forms B) block. The TASHKEEL characters will always be converted to - * the isolated forms rather than to their correct shape. - */ - public static final int LETTERS_SHAPE_TASHKEEL_ISOLATED = 0x18; - - /** - * Bit mask for letter shaping options. - */ - public static final int LETTERS_MASK = 0x18; - - - /** - * Digit shaping option: do not perform digit shaping. - */ - public static final int DIGITS_NOOP = 0; - - /** - * Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits. - */ - public static final int DIGITS_EN2AN = 0x20; - - /** - * Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039). - */ - public static final int DIGITS_AN2EN = 0x40; - - /** - * Digit shaping option: - * Replace European digits (U+0030...U+0039) by Arabic-Indic digits - * if the most recent strongly directional character - * is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC). - * The initial state at the start of the text is assumed to be not an Arabic, - * letter, so European digits at the start of the text will not change. - * Compare to DIGITS_ALEN2AN_INIT_AL. - */ - public static final int DIGITS_EN2AN_INIT_LR = 0x60; - - /** - * Digit shaping option: - * Replace European digits (U+0030...U+0039) by Arabic-Indic digits - * if the most recent strongly directional character - * is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC). - * The initial state at the start of the text is assumed to be an Arabic, - * letter, so European digits at the start of the text will change. - * Compare to DIGITS_ALEN2AN_INT_LR. - */ - public static final int DIGITS_EN2AN_INIT_AL = 0x80; - - /** Not a valid option value. */ - private static final int DIGITS_RESERVED = 0xa0; - - /** - * Bit mask for digit shaping options. - */ - public static final int DIGITS_MASK = 0xe0; - - /** - * Digit type option: Use Arabic-Indic digits (U+0660...U+0669). - */ - public static final int DIGIT_TYPE_AN = 0; - - /** - * Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9). - */ - public static final int DIGIT_TYPE_AN_EXTENDED = 0x100; - - /** - * Bit mask for digit type options. - */ - public static final int DIGIT_TYPE_MASK = 0x0100; // 0x3f00? - - public boolean equals(Object rhs) { - return rhs != null && - rhs.getClass() == ArabicShaping.class && - options == ((ArabicShaping)rhs).options; - } - - public int hashCode() { - return options; - } - - public String toString() { - StringBuffer buf = new StringBuffer(super.toString()); - buf.append('['); - switch (options & LENGTH_MASK) { - case LENGTH_GROW_SHRINK: buf.append("grow/shrink"); break; - case LENGTH_FIXED_SPACES_NEAR: buf.append("spaces near"); break; - case LENGTH_FIXED_SPACES_AT_END: buf.append("spaces at end"); break; - case LENGTH_FIXED_SPACES_AT_BEGINNING: buf.append("spaces at beginning"); break; - } - switch (options & TEXT_DIRECTION_MASK) { - case TEXT_DIRECTION_LOGICAL: buf.append(", logical"); break; - case TEXT_DIRECTION_VISUAL_LTR: buf.append(", visual"); break; - } - switch (options & LETTERS_MASK) { - case LETTERS_NOOP: buf.append(", no letter shaping"); break; - case LETTERS_SHAPE: buf.append(", shape letters"); break; - case LETTERS_SHAPE_TASHKEEL_ISOLATED: buf.append(", shape letters tashkeel isolated"); break; - case LETTERS_UNSHAPE: buf.append(", unshape letters"); break; - } - switch (options & DIGITS_MASK) { - case DIGITS_NOOP: buf.append(", no digit shaping"); break; - case DIGITS_EN2AN: buf.append(", shape digits to AN"); break; - case DIGITS_AN2EN: buf.append(", shape digits to EN"); break; - case DIGITS_EN2AN_INIT_LR: buf.append(", shape digits to AN contextually: default EN"); break; - case DIGITS_EN2AN_INIT_AL: buf.append(", shape digits to AN contextually: default AL"); break; - } - switch (options & DIGIT_TYPE_MASK) { - case DIGIT_TYPE_AN: buf.append(", standard Arabic-Indic digits"); break; - case DIGIT_TYPE_AN_EXTENDED: buf.append(", extended Arabic-Indic digits"); break; - } - buf.append("]"); - - return buf.toString(); - } - - // - // ported api - // - - private static final int IRRELEVANT = 4; - private static final int LAMTYPE = 16; - private static final int ALEFTYPE = 32; - - private static final int LINKR = 1; - private static final int LINKL = 2; - private static final int LINK_MASK = 3; - - private static final int irrelevantPos[] = { - 0x0, 0x2, 0x4, 0x6, 0x8, 0xA, 0xC, 0xE - }; - - private static final char convertLamAlef[] = { - '\u0622', // FEF5 - '\u0622', // FEF6 - '\u0623', // FEF7 - '\u0623', // FEF8 - '\u0625', // FEF9 - '\u0625', // FEFA - '\u0627', // FEFB - '\u0627' // FEFC - }; - - private static final char convertNormalizedLamAlef[] = { - '\u0622', // 065C - '\u0623', // 065D - '\u0625', // 065E - '\u0627', // 065F - }; - - private static final int[] araLink = { - 1 + 32 + 256 * 0x11, /*0x0622*/ - 1 + 32 + 256 * 0x13, /*0x0623*/ - 1 + 256 * 0x15, /*0x0624*/ - 1 + 32 + 256 * 0x17, /*0x0625*/ - 1 + 2 + 256 * 0x19, /*0x0626*/ - 1 + 32 + 256 * 0x1D, /*0x0627*/ - 1 + 2 + 256 * 0x1F, /*0x0628*/ - 1 + 256 * 0x23, /*0x0629*/ - 1 + 2 + 256 * 0x25, /*0x062A*/ - 1 + 2 + 256 * 0x29, /*0x062B*/ - 1 + 2 + 256 * 0x2D, /*0x062C*/ - 1 + 2 + 256 * 0x31, /*0x062D*/ - 1 + 2 + 256 * 0x35, /*0x062E*/ - 1 + 256 * 0x39, /*0x062F*/ - 1 + 256 * 0x3B, /*0x0630*/ - 1 + 256 * 0x3D, /*0x0631*/ - 1 + 256 * 0x3F, /*0x0632*/ - 1 + 2 + 256 * 0x41, /*0x0633*/ - 1 + 2 + 256 * 0x45, /*0x0634*/ - 1 + 2 + 256 * 0x49, /*0x0635*/ - 1 + 2 + 256 * 0x4D, /*0x0636*/ - 1 + 2 + 256 * 0x51, /*0x0637*/ - 1 + 2 + 256 * 0x55, /*0x0638*/ - 1 + 2 + 256 * 0x59, /*0x0639*/ - 1 + 2 + 256 * 0x5D, /*0x063A*/ - 0, 0, 0, 0, 0, /*0x063B-0x063F*/ - 1 + 2, /*0x0640*/ - 1 + 2 + 256 * 0x61, /*0x0641*/ - 1 + 2 + 256 * 0x65, /*0x0642*/ - 1 + 2 + 256 * 0x69, /*0x0643*/ - 1 + 2 + 16 + 256 * 0x6D, /*0x0644*/ - 1 + 2 + 256 * 0x71, /*0x0645*/ - 1 + 2 + 256 * 0x75, /*0x0646*/ - 1 + 2 + 256 * 0x79, /*0x0647*/ - 1 + 256 * 0x7D, /*0x0648*/ - 1 + 256 * 0x7F, /*0x0649*/ - 1 + 2 + 256 * 0x81, /*0x064A*/ - 4, 4, 4, 4, /*0x064B-0x064E*/ - 4, 4, 4, 4, /*0x064F-0x0652*/ - 4, 4, 4, 0, 0, /*0x0653-0x0657*/ - 0, 0, 0, 0, /*0x0658-0x065B*/ - 1 + 256 * 0x85, /*0x065C*/ - 1 + 256 * 0x87, /*0x065D*/ - 1 + 256 * 0x89, /*0x065E*/ - 1 + 256 * 0x8B, /*0x065F*/ - 0, 0, 0, 0, 0, /*0x0660-0x0664*/ - 0, 0, 0, 0, 0, /*0x0665-0x0669*/ - 0, 0, 0, 0, 0, 0, /*0x066A-0x066F*/ - 4, /*0x0670*/ - 0, /*0x0671*/ - 1 + 32, /*0x0672*/ - 1 + 32, /*0x0673*/ - 0, /*0x0674*/ - 1 + 32, /*0x0675*/ - 1, 1, /*0x0676-0x0677*/ - 1+2, 1+2, 1+2, 1+2, 1+2, 1+2, /*0x0678-0x067D*/ - 1+2, 1+2, 1+2, 1+2, 1+2, 1+2, /*0x067E-0x0683*/ - 1+2, 1+2, 1+2, 1+2, /*0x0684-0x0687*/ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*0x0688-0x0691*/ - 1, 1, 1, 1, 1, 1, 1, 1, /*0x0692-0x0699*/ - 1+2, 1+2, 1+2, 1+2, 1+2, 1+2, /*0x069A-0x06A3*/ - 1+2, 1+2, 1+2, 1+2, /*0x069A-0x06A3*/ - 1+2, 1+2, 1+2, 1+2, 1+2, 1+2, /*0x06A4-0x06AD*/ - 1+2, 1+2, 1+2, 1+2, /*0x06A4-0x06AD*/ - 1+2, 1+2, 1+2, 1+2, 1+2, 1+2, /*0x06AE-0x06B7*/ - 1+2, 1+2, 1+2, 1+2, /*0x06AE-0x06B7*/ - 1+2, 1+2, 1+2, 1+2, 1+2, 1+2, /*0x06B8-0x06BF*/ - 1+2, 1+2, /*0x06B8-0x06BF*/ - 1, /*0x06C0*/ - 1+2, /*0x06C1*/ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*0x06C2-0x06CB*/ - 1+2, /*0x06CC*/ - 1, /*0x06CD*/ - 1+2, 1+2, 1+2, 1+2, /*0x06CE-0x06D1*/ - 1, 1 /*0x06D2-0x06D3*/ - }; - - private static final int[] presLink = { - 1 + 2, /*0xFE70*/ - 1 + 2, /*0xFE71*/ - 1 + 2, 0, 1+ 2, 0, 1+ 2, /*0xFE72-0xFE76*/ - 1 + 2, /*0xFE77*/ - 1+ 2, 1 + 2, 1+2, 1 + 2, /*0xFE78-0xFE81*/ - 1+ 2, 1 + 2, 1+2, 1 + 2, /*0xFE82-0xFE85*/ - 0, 0 + 32, 1 + 32, 0 + 32, /*0xFE86-0xFE89*/ - 1 + 32, 0, 1, 0 + 32, /*0xFE8A-0xFE8D*/ - 1 + 32, 0, 2, 1 + 2, /*0xFE8E-0xFE91*/ - 1, 0 + 32, 1 + 32, 0, /*0xFE92-0xFE95*/ - 2, 1 + 2, 1, 0, /*0xFE96-0xFE99*/ - 1, 0, 2, 1 + 2, /*0xFE9A-0xFE9D*/ - 1, 0, 2, 1 + 2, /*0xFE9E-0xFEA1*/ - 1, 0, 2, 1 + 2, /*0xFEA2-0xFEA5*/ - 1, 0, 2, 1 + 2, /*0xFEA6-0xFEA9*/ - 1, 0, 2, 1 + 2, /*0xFEAA-0xFEAD*/ - 1, 0, 1, 0, /*0xFEAE-0xFEB1*/ - 1, 0, 1, 0, /*0xFEB2-0xFEB5*/ - 1, 0, 2, 1+2, /*0xFEB6-0xFEB9*/ - 1, 0, 2, 1+2, /*0xFEBA-0xFEBD*/ - 1, 0, 2, 1+2, /*0xFEBE-0xFEC1*/ - 1, 0, 2, 1+2, /*0xFEC2-0xFEC5*/ - 1, 0, 2, 1+2, /*0xFEC6-0xFEC9*/ - 1, 0, 2, 1+2, /*0xFECA-0xFECD*/ - 1, 0, 2, 1+2, /*0xFECE-0xFED1*/ - 1, 0, 2, 1+2, /*0xFED2-0xFED5*/ - 1, 0, 2, 1+2, /*0xFED6-0xFED9*/ - 1, 0, 2, 1+2, /*0xFEDA-0xFEDD*/ - 1, 0, 2, 1+2, /*0xFEDE-0xFEE1*/ - 1, 0 + 16, 2 + 16, 1 + 2 +16, /*0xFEE2-0xFEE5*/ - 1 + 16, 0, 2, 1+2, /*0xFEE6-0xFEE9*/ - 1, 0, 2, 1+2, /*0xFEEA-0xFEED*/ - 1, 0, 2, 1+2, /*0xFEEE-0xFEF1*/ - 1, 0, 1, 0, /*0xFEF2-0xFEF5*/ - 1, 0, 2, 1+2, /*0xFEF6-0xFEF9*/ - 1, 0, 1, 0, /*0xFEFA-0xFEFD*/ - 1, 0, 1, 0, - 1 - }; - - private static int[] convertFEto06 = { - /***********0******1******2******3******4******5******6******7******8******9******A******B******C******D******E******F***/ - /*FE7*/ 0x64B, 0x64B, 0x64C, 0x64C, 0x64D, 0x64D, 0x64E, 0x64E, 0x64F, 0x64F, 0x650, 0x650, 0x651, 0x651, 0x652, 0x652, - /*FE8*/ 0x621, 0x622, 0x622, 0x623, 0x623, 0x624, 0x624, 0x625, 0x625, 0x626, 0x626, 0x626, 0x626, 0x627, 0x627, 0x628, - /*FE9*/ 0x628, 0x628, 0x628, 0x629, 0x629, 0x62A, 0x62A, 0x62A, 0x62A, 0x62B, 0x62B, 0x62B, 0x62B, 0x62C, 0x62C, 0x62C, - /*FEA*/ 0x62C, 0x62D, 0x62D, 0x62D, 0x62D, 0x62E, 0x62E, 0x62E, 0x62E, 0x62F, 0x62F, 0x630, 0x630, 0x631, 0x631, 0x632, - /*FEB*/ 0x632, 0x633, 0x633, 0x633, 0x633, 0x634, 0x634, 0x634, 0x634, 0x635, 0x635, 0x635, 0x635, 0x636, 0x636, 0x636, - /*FEC*/ 0x636, 0x637, 0x637, 0x637, 0x637, 0x638, 0x638, 0x638, 0x638, 0x639, 0x639, 0x639, 0x639, 0x63A, 0x63A, 0x63A, - /*FED*/ 0x63A, 0x641, 0x641, 0x641, 0x641, 0x642, 0x642, 0x642, 0x642, 0x643, 0x643, 0x643, 0x643, 0x644, 0x644, 0x644, - /*FEE*/ 0x644, 0x645, 0x645, 0x645, 0x645, 0x646, 0x646, 0x646, 0x646, 0x647, 0x647, 0x647, 0x647, 0x648, 0x648, 0x649, - /*FEF*/ 0x649, 0x64A, 0x64A, 0x64A, 0x64A, 0x65C, 0x65C, 0x65D, 0x65D, 0x65E, 0x65E, 0x65F, 0x65F - }; - - private static final int shapeTable[][][] = { - { {0,0,0,0}, {0,0,0,0}, {0,1,0,3}, {0,1,0,1} }, - { {0,0,2,2}, {0,0,1,2}, {0,1,1,2}, {0,1,1,3} }, - { {0,0,0,0}, {0,0,0,0}, {0,1,0,3}, {0,1,0,3} }, - { {0,0,1,2}, {0,0,1,2}, {0,1,1,2}, {0,1,1,3} } - }; - - /* - * This function shapes European digits to Arabic-Indic digits - * in-place, writing over the input characters. Data is in visual - * order. - */ - private void shapeToArabicDigitsWithContext(char[] dest, - int start, - int length, - char digitBase, - boolean lastStrongWasAL) { - - digitBase -= '0'; // move common adjustment out of loop - - for(int i = start + length; --i >= start;) { - char ch = dest[i]; - switch (UCharacter.getDirection(ch)) { - case UCharacterDirection.LEFT_TO_RIGHT: - case UCharacterDirection.RIGHT_TO_LEFT: - lastStrongWasAL = false; - break; - case UCharacterDirection.RIGHT_TO_LEFT_ARABIC: - lastStrongWasAL = true; - break; - case UCharacterDirection.EUROPEAN_NUMBER: - if (lastStrongWasAL && ch <= '\u0039') { - dest[i] = (char)(ch + digitBase); - } - break; - default: - break; - } - } - } - - /* - * Name : invertBuffer - * Function: This function inverts the buffer, it's used - * in case the user specifies the buffer to be - * TEXT_DIRECTION_LOGICAL - */ - private static void invertBuffer(char[] buffer, - int start, - int length) { - - for(int i = start, j = start + length - 1; i < j; i++, --j) { - char temp = buffer[i]; - buffer[i] = buffer[j]; - buffer[j] = temp; - } - } - - /* - * Name : changeLamAlef - * Function: Converts the Alef characters into an equivalent - * LamAlef location in the 0x06xx Range, this is an - * intermediate stage in the operation of the program - * later it'll be converted into the 0xFExx LamAlefs - * in the shaping function. - */ - private static char changeLamAlef(char ch) { - switch(ch) { - case '\u0622': return '\u065C'; - case '\u0623': return '\u065D'; - case '\u0625': return '\u065E'; - case '\u0627': return '\u065F'; - default: return '\u0000'; // not a lamalef - } - } - - /* - * Name : specialChar - * Function: Special Arabic characters need special handling in the shapeUnicode - * function, this function returns 1 or 2 for these special characters - */ - private static int specialChar(char ch) { - if ((ch > '\u0621' && ch < '\u0626') || - (ch == '\u0627') || - (ch > '\u062E' && ch < '\u0633') || - (ch > '\u0647' && ch < '\u064A') || - (ch == '\u0629')) { - return 1; - } else if (ch >= '\u064B' && ch<= '\u0652') { - return 2; - } else if (ch >= 0x0653 && ch <= 0x0655 || - ch == 0x0670 || - ch >= 0xFE70 && ch <= 0xFE7F) { - return 3; - } else { - return 0; - } - } - - /* - * Name : getLink - * Function: Resolves the link between the characters as - * Arabic characters have four forms : - * Isolated, Initial, Middle and Final Form - */ - private static int getLink(char ch) { - if (ch >= '\u0622' && ch <= '\u06D3') { - return araLink[ch - '\u0622']; - } else if (ch == '\u200D') { - return 3; - } else if (ch >= '\u206D' && ch <= '\u206F') { - return 4; - } else if (ch >= '\uFE70' && ch <= '\uFEFC') { - return presLink[ch - '\uFE70']; - } else { - return 0; - } - } - - /* - * Name : countSpaces - * Function: Counts the number of spaces - * at each end of the logical buffer - */ - private static int countSpacesLeft(char[] dest, - int start, - int count) { - for (int i = start, e = start + count; i < e; ++i) { - if (dest[i] != '\u0020') { - return i - start; - } - } - return count; - } - - private static int countSpacesRight(char[] dest, - int start, - int count) { - - for (int i = start + count; --i >= start;) { - if (dest[i] != '\u0020') { - return start + count - 1 - i; - } - } - return count; - } - - /* - * Name : isTashkeelChar - * Function: Returns 1 for Tashkeel characters else return 0 - */ - private static boolean isTashkeelChar(char ch) { - return ch >='\u064B' && ch <= '\u0652'; - } - - /* - * Name : isAlefChar - * Function: Returns 1 for Alef characters else return 0 - */ - private static boolean isAlefChar(char ch) { - return ch == '\u0622' || ch == '\u0623' || ch == '\u0625' || ch == '\u0627'; - } - - /* - * Name : isLamAlefChar - * Function: Returns 1 for LamAlef characters else return 0 - */ - private static boolean isLamAlefChar(char ch) { - return ch >= '\uFEF5' && ch <= '\uFEFC'; - } - - private static boolean isNormalizedLamAlefChar(char ch) { - return ch >= '\u065C' && ch <= '\u065F'; - } - - /* - * Name : calculateSize - * Function: This function calculates the destSize to be used in preflighting - * when the destSize is equal to 0 - */ - private int calculateSize(char[] source, - int sourceStart, - int sourceLength) { - - int destSize = sourceLength; - - switch (options & LETTERS_MASK) { - case LETTERS_SHAPE: - case LETTERS_SHAPE_TASHKEEL_ISOLATED: - if (isLogical) { - for (int i = sourceStart, e = sourceStart + sourceLength - 1; i < e; ++i) { - if (source[i] == '\u0644' && isAlefChar(source[i+1])) { - --destSize; - } - } - } else { // visual - for(int i = sourceStart + 1, e = sourceStart + sourceLength; i < e; ++i) { - if (source[i] == '\u0644' && isAlefChar(source[i-1])) { - --destSize; - } - } - } - break; - - case LETTERS_UNSHAPE: - for(int i = sourceStart, e = sourceStart + sourceLength; i < e; ++i) { - if (isLamAlefChar(source[i])) { - destSize++; - } - } - break; - - default: - break; - } - - return destSize; - } - - /* - * Name : removeLamAlefSpaces - * Function: The shapeUnicode function converts Lam + Alef into LamAlef + space, - * this function removes the spaces behind the LamAlefs according to - * the options the user specifies, the spaces are removed to the end - * of the buffer, or shrink the buffer and remove spaces for good - * or leave the buffer as it is LamAlef + space. - */ - private int removeLamAlefSpaces(char[] dest, - int start, - int length) { - - int lenOptions = options & LENGTH_MASK; - if (!isLogical) { - switch (lenOptions) { - case LENGTH_FIXED_SPACES_AT_BEGINNING: lenOptions = LENGTH_FIXED_SPACES_AT_END; break; - case LENGTH_FIXED_SPACES_AT_END: lenOptions = LENGTH_FIXED_SPACES_AT_BEGINNING; break; - default: break; - } - } - - if (lenOptions == LENGTH_FIXED_SPACES_NEAR) { - for (int i = start, e = i + length; i < e; ++i) { - if (dest[i] == '\uffff') { - dest[i] = '\u0020'; - } - } - } else { - final int e = start + length; - int w = e; - int r = e; - while (--r >= start) { - char ch = dest[r]; - if (ch != '\uffff') { - --w; - if (w != r) { - dest[w] = ch; - } - } - } - - if (lenOptions == LENGTH_FIXED_SPACES_AT_END) { - while (w > start) { - dest[--w] = '\u0020'; - } - } else { - if (w > start) { - // shift, assume small buffer size so don't use arraycopy - r = w; - w = start; - while (r < e) { - dest[w++] = dest[r++]; - } - } else { - w = e; - } - if (lenOptions == LENGTH_GROW_SHRINK) { - length = w - start; - } else { // spaces at beginning - while (w < e) { - dest[w++] = '\u0020'; - } - } - } - } - return length; - } - - /* - * Name : expandLamAlef - * Function: LamAlef needs special handling as the LamAlef is - * one character while expanding it will give two - * characters Lam + Alef, so we need to expand the LamAlef - * in near or far spaces according to the options the user - * specifies or increase the buffer size. - * Dest has enough room for the expansion if we are growing. - * lamalef are normalized to the 'special characters' - */ - private int expandLamAlef(char[] dest, - int start, - int length, - int lacount) throws ArabicShapingException { - - int lenOptions = options & LENGTH_MASK; - if (!isLogical) { - switch (lenOptions) { - case LENGTH_FIXED_SPACES_AT_BEGINNING: lenOptions = LENGTH_FIXED_SPACES_AT_END; break; - case LENGTH_FIXED_SPACES_AT_END: lenOptions = LENGTH_FIXED_SPACES_AT_BEGINNING; break; - default: break; - } - } - - switch (lenOptions) { - case LENGTH_GROW_SHRINK: - { - for (int r = start + length, w = r + lacount; --r >= start;) { - char ch = dest[r]; - if (isNormalizedLamAlefChar(ch)) { - dest[--w] = '\u0644'; - dest[--w] = convertNormalizedLamAlef[ch - '\u065C']; - } else { - dest[--w] = ch; - } - } - } - length += lacount; - break; - - case LENGTH_FIXED_SPACES_NEAR: - { - if (isNormalizedLamAlefChar(dest[start])) { - throw new ArabicShapingException("no space for lamalef"); - } - for (int i = start + length; --i > start;) { // don't check start, already checked - char ch = dest[i]; - if (isNormalizedLamAlefChar(ch)) { - if (dest[i-1] == '\u0020') { - dest[i] = '\u0644'; - dest[--i] = convertNormalizedLamAlef[ch - '\u065C']; - } else { - throw new ArabicShapingException("no space for lamalef"); - } - } - } - } - break; - - case LENGTH_FIXED_SPACES_AT_END: - { - if (lacount > countSpacesLeft(dest, start, length)) { - throw new ArabicShapingException("no space for lamalef"); - } - for (int r = start + lacount, w = start, e = start + length; r < e; ++r) { - char ch = dest[r]; - if (isNormalizedLamAlefChar(ch)) { - dest[w++] = convertNormalizedLamAlef[ch - '\u065C']; - dest[w++] = '\u0644'; - } else { - dest[w++] = ch; - } - } - } - break; - - case LENGTH_FIXED_SPACES_AT_BEGINNING: - { - if (lacount > countSpacesRight(dest, start, length)) { - throw new ArabicShapingException("no space for lamalef"); - } - for (int r = start + length - lacount, w = start + length; --r >= start;) { - char ch = dest[r]; - if (isNormalizedLamAlefChar(ch)) { - dest[--w] = '\u0644'; - dest[--w] = convertNormalizedLamAlef[ch - '\u065C']; - } else { - dest[--w] = ch; - } - } - } - break; - } - - return length; - } - - /* Convert the input buffer from FExx Range into 06xx Range - * to put all characters into the 06xx range - * even the lamalef is converted to the special region in - * the 06xx range. Return the number of lamalef chars found. - */ - private int normalize(char[] dest, int start, int length) { - int lacount = 0; - for (int i = start, e = i + length; i < e; ++i) { - char ch = dest[i]; - if (ch >= '\uFE70' && ch <= '\uFEFC') { - if (isLamAlefChar(ch)) { - ++lacount; - } - dest[i] = (char)convertFEto06[ch - '\uFE70']; - } - } - return lacount; - } - - /* - * Name : shapeUnicode - * Function: Converts an Arabic Unicode buffer in 06xx Range into a shaped - * arabic Unicode buffer in FExx Range - */ - private int shapeUnicode(char[] dest, - int start, - int length, - int destSize, - int tashkeelFlag) { - - - normalize(dest, start, length); - - // resolve the link between the characters. - // Arabic characters have four forms: Isolated, Initial, Medial and Final. - // Tashkeel characters have two, isolated or medial, and sometimes only isolated. - // tashkeelFlag == 0: shape normally, 1: shape isolated, 2: don't shape - - boolean lamalef_found = false; - int i = start + length - 1; - int currLink = getLink(dest[i]); - int nextLink = 0; - int prevLink = 0; - int lastLink = 0; - int prevPos = i; - int lastPos = i; - int nx = -2; - int nw = 0; - - while (i >= 0) { - // If high byte of currLink > 0 then there might be more than one shape - if ((currLink & '\uFF00') > 0 || isTashkeelChar(dest[i])) { - nw = i - 1; - nx = -2; - while (nx < 0) { // we need to know about next char - if (nw == -1) { - nextLink = 0; - nx = Integer.MAX_VALUE; - } else { - nextLink = getLink(dest[nw]); - if ((nextLink & IRRELEVANT) == 0) { - nx = nw; - } else { - --nw; - } - } - } - - if (((currLink & ALEFTYPE) > 0) && ((lastLink & LAMTYPE) > 0)) { - lamalef_found = true; - char wLamalef = changeLamAlef(dest[i]); // get from 0x065C-0x065f - if (wLamalef != '\u0000') { - // replace alef by marker, it will be removed later - dest[i] = '\uffff'; - dest[lastPos] = wLamalef; - i = lastPos; - } - - lastLink = prevLink; - currLink = getLink(wLamalef); // requires '\u0000', unfortunately - } - - // get the proper shape according to link ability of neighbors - // and of character; depends on the order of the shapes - // (isolated, initial, middle, final) in the compatibility area - - int flag = specialChar(dest[i]); - - int shape = shapeTable[nextLink & LINK_MASK] - [lastLink & LINK_MASK] - [currLink & LINK_MASK]; - - if (flag == 1) { - shape &= 0x1; - } else if (flag == 2) { - if (tashkeelFlag == 0 && - ((lastLink & LINKL) != 0) && - ((nextLink & LINKR) != 0) && - dest[i] != '\u064C' && - dest[i] != '\u064D' && - !((nextLink & ALEFTYPE) == ALEFTYPE && - (lastLink & LAMTYPE) == LAMTYPE)) { - - shape = 1; - } else { - shape = 0; - } - } - - if (flag == 2) { - if (tashkeelFlag < 2) { - dest[i] = (char)('\uFE70' + irrelevantPos[dest[i] - '\u064B'] + shape); - } // else leave tashkeel alone - } else { - dest[i] = (char)('\uFE70' + (currLink >> 8) + shape); - } - } - - // move one notch forward - if ((currLink & IRRELEVANT) == 0) { - prevLink = lastLink; - lastLink = currLink; - prevPos = lastPos; - lastPos = i; - } - - --i; - if (i == nx) { - currLink = nextLink; - nx = -2; - } else if (i != -1) { - currLink = getLink(dest[i]); - } - } - - // If we found a lam/alef pair in the buffer - // call removeLamAlefSpaces to remove the spaces that were added - - if (lamalef_found) { - destSize = removeLamAlefSpaces(dest, start, length); - } else { - destSize = length; - } - - return destSize; - } - - /* - * Name : deShapeUnicode - * Function: Converts an Arabic Unicode buffer in FExx Range into unshaped - * arabic Unicode buffer in 06xx Range - */ - private int deShapeUnicode(char[] dest, - int start, - int length, - int destSize) throws ArabicShapingException { - - int lamalef_count = normalize(dest, start, length); - - // If there was a lamalef in the buffer call expandLamAlef - if (lamalef_count != 0) { - // need to adjust dest to fit expanded buffer... !!! - destSize = expandLamAlef(dest, start, length, lamalef_count); - } else { - destSize = length; - } - - return destSize; - } - - private int internalShape(char[] source, - int sourceStart, - int sourceLength, - char[] dest, - int destStart, - int destSize) throws ArabicShapingException { - - if (sourceLength == 0) { - return 0; - } - - if (destSize == 0) { - if (((options & LETTERS_MASK) != LETTERS_NOOP) && - ((options & LENGTH_MASK) == LENGTH_GROW_SHRINK)) { - - return calculateSize(source, sourceStart, sourceLength); - } else { - return sourceLength; // by definition - } - } - - // always use temp buffer - char[] temp = new char[sourceLength * 2]; // all lamalefs requiring expansion - System.arraycopy(source, sourceStart, temp, 0, sourceLength); - - if (isLogical) { - invertBuffer(temp, 0, sourceLength); - } - - int outputSize = sourceLength; - - switch (options & LETTERS_MASK) { - case LETTERS_SHAPE_TASHKEEL_ISOLATED: - outputSize = shapeUnicode(temp, 0, sourceLength, destSize, 1); - break; - - case LETTERS_SHAPE: - outputSize = shapeUnicode(temp, 0, sourceLength, destSize, 0); - break; - - case LETTERS_UNSHAPE: - outputSize = deShapeUnicode(temp, 0, sourceLength, destSize); - break; - - default: - break; - } - - if (outputSize > destSize) { - throw new ArabicShapingException("not enough room for result data"); - } - - if ((options & DIGITS_MASK) != DIGITS_NOOP) { - char digitBase = '\u0030'; // European digits - switch (options & DIGIT_TYPE_MASK) { - case DIGIT_TYPE_AN: - digitBase = '\u0660'; // Arabic-Indic digits - break; - - case DIGIT_TYPE_AN_EXTENDED: - digitBase = '\u06f0'; // Eastern Arabic-Indic digits (Persian and Urdu) - break; - - default: - break; - } - - switch (options & DIGITS_MASK) { - case DIGITS_EN2AN: - { - int digitDelta = digitBase - '\u0030'; - for (int i = 0; i < outputSize; ++i) { - char ch = temp[i]; - if (ch <= '\u0039' && ch >= '\u0030') { - temp[i] += digitDelta; - } - } - } - break; - - case DIGITS_AN2EN: - { - char digitTop = (char)(digitBase + 9); - int digitDelta = '\u0030' - digitBase; - for (int i = 0; i < outputSize; ++i) { - char ch = temp[i]; - if (ch <= digitTop && ch >= digitBase) { - temp[i] += digitDelta; - } - } - } - break; - - case DIGITS_EN2AN_INIT_LR: - shapeToArabicDigitsWithContext(temp, 0, outputSize, digitBase, false); - break; - - case DIGITS_EN2AN_INIT_AL: - shapeToArabicDigitsWithContext(temp, 0, outputSize, digitBase, true); - break; - - default: - break; - } - } - - if (isLogical) { - invertBuffer(temp, 0, outputSize); - } - - System.arraycopy(temp, 0, dest, destStart, outputSize); - - return outputSize; - } -} diff --git a/icu4j/src/com/ibm/text/ArabicShapingException.java b/icu4j/src/com/ibm/text/ArabicShapingException.java deleted file mode 100755 index 236ca1cc27..0000000000 --- a/icu4j/src/com/ibm/text/ArabicShapingException.java +++ /dev/null @@ -1,17 +0,0 @@ -/* -******************************************************************************* -* Copyright (C) 2001, International Business Machines -* Corporation and others. All Rights Reserved. -******************************************************************************* -*/ - -package com.ibm.text; - -/** - * Thrown by ArabicShaping when there is a shaping error. - */ -public final class ArabicShapingException extends Exception { - ArabicShapingException(String message) { - super(message); - } -} diff --git a/icu4j/src/com/ibm/text/BreakDictionary.java b/icu4j/src/com/ibm/text/BreakDictionary.java deleted file mode 100755 index ef4f3f4184..0000000000 --- a/icu4j/src/com/ibm/text/BreakDictionary.java +++ /dev/null @@ -1,307 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/BreakDictionary.java,v $ - * $Date: 2000/09/25 21:33:43 $ - * $Revision: 1.6 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.io.InputStream; -import java.io.DataInputStream; -import java.io.FileNotFoundException; -import java.io.UnsupportedEncodingException; -import java.io.IOException; -import java.io.FileInputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.io.FileOutputStream; - -import com.ibm.util.CompactByteArray; - -/** - * This is the class that represents the list of known words used by - * DictionaryBasedBreakIterator. The conceptual data structure used - * here is a trie: there is a node hanging off the root node for every - * letter that can start a word. Each of these nodes has a node hanging - * off of it for every letter that can be the second letter of a word - * if this node is the first letter, and so on. The trie is represented - * as a two-dimensional array that can be treated as a table of state - * transitions. Indexes are used to compress this array, taking - * advantage of the fact that this array will always be very sparse. - */ -public class BreakDictionary { - //================================================================================= - // testing and debugging - //================================================================================= - public static void main(String args[]) - throws FileNotFoundException, UnsupportedEncodingException, IOException { - String filename = args[0]; - - BreakDictionary dictionary = new BreakDictionary(new FileInputStream(filename)); - - PrintWriter out = null; - - if(args.length >= 2) { - out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(args[1]), "UnicodeLittle")); - } - - dictionary.printWordList("", 0, out); - - if (out != null) { - out.close(); - } - } - - public void printWordList(String partialWord, int state, PrintWriter out) - throws IOException { - if (state == 0xFFFF) { - System.out.println(partialWord); - if (out != null) { - out.println(partialWord); - } - } - else { - for (int i = 0; i < numCols; i++) { - int newState = (at(state, i)) & 0xFFFF; - - if (newState != 0) { - char newChar = reverseColumnMap[i]; - String newPartialWord = partialWord; - - if (newChar != 0) { - newPartialWord += newChar; - } - - printWordList(newPartialWord, newState, out); - } - } - } - } - - /** - * A map used to go from column numbers to characters. Used only - * for debugging right now. - */ - private char[] reverseColumnMap = null; - - //================================================================================= - // data members - //================================================================================= - - /** - * Maps from characters to column numbers. The main use of this is to - * avoid making room in the array for empty columns. - */ - private CompactByteArray columnMap = null; - - /** - * The number of actual columns in the table - */ - private int numCols; - - /** - * Columns are organized into groups of 32. This says how many - * column groups. (We could calculate this, but we store the - * value to avoid having to repeatedly calculate it.) - */ - private int numColGroups; - - /** - * The actual compressed state table. Each conceptual row represents - * a state, and the cells in it contain the row numbers of the states - * to transition to for each possible letter. 0 is used to indicate - * an illegal combination of letters (i.e., the error state). The - * table is compressed by eliminating all the unpopulated (i.e., zero) - * cells. Multiple conceptual rows can then be doubled up in a single - * physical row by sliding them up and possibly shifting them to one - * side or the other so the populated cells don't collide. Indexes - * are used to identify unpopulated cells and to locate populated cells. - */ - private short[] table = null; - - /** - * This index maps logical row numbers to physical row numbers - */ - private short[] rowIndex = null; - - /** - * A bitmap is used to tell which cells in the comceptual table are - * populated. This array contains all the unique bit combinations - * in that bitmap. If the table is more than 32 columns wide, - * successive entries in this array are used for a single row. - */ - private int[] rowIndexFlags = null; - - /** - * This index maps from a logical row number into the bitmap table above. - * (This keeps us from storing duplicate bitmap combinations.) Since there - * are a lot of rows with only one populated cell, instead of wasting space - * in the bitmap table, we just store a negative number in this index for - * rows with one populated cell. The absolute value of that number is - * the column number of the populated cell. - */ - private short[] rowIndexFlagsIndex = null; - - /** - * For each logical row, this index contains a constant that is added to - * the logical column number to get the physical column number - */ - private byte[] rowIndexShifts = null; - - //================================================================================= - // deserialization - //================================================================================= - - public BreakDictionary(InputStream dictionaryStream) throws IOException { - readDictionaryFile(new DataInputStream(dictionaryStream)); - } - - public void readDictionaryFile(DataInputStream in) throws IOException { - int l; - - // read in the version number (right now we just ignore it) - in.readInt(); - - // read in the column map (this is serialized in its internal form: - // an index array followed by a data array) - l = in.readInt(); - char[] temp = new char[l]; - for (int i = 0; i < temp.length; i++) - temp[i] = (char)in.readShort(); - l = in.readInt(); - byte[] temp2 = new byte[l]; - for (int i = 0; i < temp2.length; i++) - temp2[i] = in.readByte(); - columnMap = new CompactByteArray(temp, temp2); - - // read in numCols and numColGroups - numCols = in.readInt(); - numColGroups = in.readInt(); - - // read in the row-number index - l = in.readInt(); - rowIndex = new short[l]; - for (int i = 0; i < rowIndex.length; i++) - rowIndex[i] = in.readShort(); - - // load in the populated-cells bitmap: index first, then bitmap list - l = in.readInt(); - rowIndexFlagsIndex = new short[l]; - for (int i = 0; i < rowIndexFlagsIndex.length; i++) - rowIndexFlagsIndex[i] = in.readShort(); - l = in.readInt(); - rowIndexFlags = new int[l]; - for (int i = 0; i < rowIndexFlags.length; i++) - rowIndexFlags[i] = in.readInt(); - - // load in the row-shift index - l = in.readInt(); - rowIndexShifts = new byte[l]; - for (int i = 0; i < rowIndexShifts.length; i++) - rowIndexShifts[i] = in.readByte(); - - // finally, load in the actual state table - l = in.readInt(); - table = new short[l]; - for (int i = 0; i < table.length; i++) - table[i] = in.readShort(); - - // this data structure is only necessary for testing and debugging purposes - reverseColumnMap = new char[numCols]; - for (char c = 0; c < 0xffff; c++) { - int col = columnMap.elementAt(c); - if (col != 0) { - reverseColumnMap[col] = c; - } - } - - // close the stream - in.close(); - } - - //================================================================================= - // access to the words - //================================================================================= - - /** - * Uses the column map to map the character to a column number, then - * passes the row and column number to the other version of at() - * @param row The current state - * @param ch The character whose column we're interested in - * @return The new state to transition to - */ - public final short at(int row, char ch) { - int col = columnMap.elementAt(ch); - return at(row, col); - } - - /** - * Returns the value in the cell with the specified (logical) row and - * column numbers. In DictionaryBasedBreakIterator, the row number is - * a state number, the column number is an input, and the return value - * is the row number of the new state to transition to. (0 is the - * "error" state, and -1 is the "end of word" state in a dictionary) - * @param row The row number of the current state - * @param col The column number of the input character (0 means "not a - * dictionary character") - * @return The row number of the new state to transition to - */ - public final short at(int row, int col) { - if (cellIsPopulated(row, col)) { - // we map from logical to physical row number by looking up the - // mapping in rowIndex; we map from logical column number to - // physical column number by looking up a shift value for this - // logical row and offsetting the logical column number by - // the shift amount. Then we can use internalAt() to actually - // get the value out of the table. - return internalAt(rowIndex[row], col + rowIndexShifts[row]); - } - else { - return 0; - } - } - - /** - * Given (logical) row and column numbers, returns true if the - * cell in that position is populated - */ - private final boolean cellIsPopulated(int row, int col) { - // look up the entry in the bitmap index for the specified row. - // If it's a negative number, it's the column number of the only - // populated cell in the row - if (rowIndexFlagsIndex[row] < 0) { - return col == -rowIndexFlagsIndex[row]; - } - - // if it's a positive number, it's the offset of an entry in the bitmap - // list. If the table is more than 32 columns wide, the bitmap is stored - // successive entries in the bitmap list, so we have to divide the column - // number by 32 and offset the number we got out of the index by the result. - // Once we have the appropriate piece of the bitmap, test the appropriate - // bit and return the result. - else { - int flags = rowIndexFlags[rowIndexFlagsIndex[row] + (col >> 5)]; - return (flags & (1 << (col & 0x1f))) != 0; - } - } - - /** - * Implementation of at() when we know the specified cell is populated. - * @param row The PHYSICAL row number of the cell - * @param col The PHYSICAL column number of the cell - * @return The value stored in the cell - */ - private final short internalAt(int row, int col) { - // the table is a one-dimensional array, so this just does the math necessary - // to treat it as a two-dimensional array (we don't just use a two-dimensional - // array because two-dimensional arrays are inefficient in Java) - return table[row * numCols + col]; - } -} - diff --git a/icu4j/src/com/ibm/text/BreakIterator.java b/icu4j/src/com/ibm/text/BreakIterator.java deleted file mode 100755 index 4699af7a89..0000000000 --- a/icu4j/src/com/ibm/text/BreakIterator.java +++ /dev/null @@ -1,599 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/BreakIterator.java,v $ - * $Date: 2000/03/10 04:07:18 $ - * $Revision: 1.4 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.util.Vector; -import java.util.Locale; -import java.util.ResourceBundle; //ibm.597 -import java.util.MissingResourceException; //ibm.597 -import java.text.resources.LocaleData; //ibm.597 -import java.text.CharacterIterator; //ibm.597 -import java.text.StringCharacterIterator; //ibm.597 - -import java.net.URL; //ibm.597 -import java.io.InputStream; //ibm.597 -import java.io.IOException; //ibm.597 - -import java.lang.ref.SoftReference; //ibm.597 - -/** - * A class that locates boundaries in text. This class defines a protocol for - * objects that break up a piece of natural-language text according to a set - * of criteria. Instances or subclasses of BreakIterator can be provided, for - * example, to break a piece of text into words, sentences, or logical characters - * according to the conventions of some language or group of languages. - * - * We provide four built-in types of BreakIterator: - *
  • getSentenceInstance() returns a BreakIterator that locates boundaries - * between sentences. This is useful for triple-click selection, for example. - *
  • getWordInstance() returns a BreakIterator that locates boundaries between - * words. This is useful for double-click selection or "find whole words" searches. - * This type of BreakIterator makes sure there is a boundary position at the - * beginning and end of each legal word. (Numbers count as words, too.) Whitespace - * and punctuation are kept separate from real words. - *
  • getLineInstance() returns a BreakIterator that locates positions where it is - * legal for a text editor to wrap lines. This is similar to word breaking, but - * not the same: punctuation and whitespace are generally kept with words (you don't - * want a line to start with whitespace, for example), and some special characters - * can force a position to be considered a line-break position or prevent a position - * from being a line-break position. - *
  • getCharacterInstance() returns a BreakIterator that locates boundaries between - * logical characters. Because of the structure of the Unicode encoding, a logical - * character may be stored internally as more than one Unicode code point. (A with an - * umlaut may be stored as an a followed by a separate combining umlaut character, - * for example, but the user still thinks of it as one character.) This iterator allows - * various processes (especially text editors) to treat as characters the units of text - * that a user would think of as characters, rather than the units of text that the - * computer sees as "characters".
- * - * BreakIterator's interface follows an "iterator" model (hence the name), meaning it - * has a concept of a "current position" and methods like first(), last(), next(), - * and previous() that update the current position. All BreakIterators uphold the - * following invariants: - *
  • The beginning and end of the text are always treated as boundary positions. - *
  • The current position of the iterator is always a boundary position (random- - * access methods move the iterator to the nearest boundary position before or - * after the specified position, not _to_ the specified position). - *
  • DONE is used as a flag to indicate when iteration has stopped. DONE is only - * returned when the current position is the end of the text and the user calls next(), - * or when the current position is the beginning of the text and the user calls - * previous(). - *
  • Break positions are numbered by the positions of the characters that follow - * them. Thus, under normal circumstances, the position before the first character - * is 0, the position after the first character is 1, and the position after the - * last character is 1 plus the length of the string. - *
  • The client can change the position of an iterator, or the text it analyzes, - * at will, but cannot change the behavior. If the user wants different behavior, he - * must instantiate a new iterator.
- * - * BreakIterator accesses the text it analyzes through a CharacterIterator, which makes - * it possible to use BreakIterator to analyze text in any text-storage vehicle that - * provides a CharacterIterator interface. - * - * NOTE: Some types of BreakIterator can take a long time to create, and - * instances of BreakIterator are not currently cached by the system. For - * optimal performance, keep instances of BreakIterator around as long as makes - * sense. For example, when word-wrapping a document, don't create and destroy a - * new BreakIterator for each line. Create one break iterator for the whole document - * (or whatever stretch of text you're wrapping) and use it to do the whole job of - * wrapping the text. - * - *

- * Examples:

- * Creating and using text boundaries - *

- *
- * public static void main(String args[]) {
- *      if (args.length == 1) {
- *          String stringToExamine = args[0];
- *          //print each word in order
- *          BreakIterator boundary = BreakIterator.getWordInstance();
- *          boundary.setText(stringToExamine);
- *          printEachForward(boundary, stringToExamine);
- *          //print each sentence in reverse order
- *          boundary = BreakIterator.getSentenceInstance(Locale.US);
- *          boundary.setText(stringToExamine);
- *          printEachBackward(boundary, stringToExamine);
- *          printFirst(boundary, stringToExamine);
- *          printLast(boundary, stringToExamine);
- *      }
- * }
- * 
- *
- * - * Print each element in order - *
- *
- * public static void printEachForward(BreakIterator boundary, String source) {
- *     int start = boundary.first();
- *     for (int end = boundary.next();
- *          end != BreakIterator.DONE;
- *          start = end, end = boundary.next()) {
- *          System.out.println(source.substring(start,end));
- *     }
- * }
- * 
- *
- * - * Print each element in reverse order - *
- *
- * public static void printEachBackward(BreakIterator boundary, String source) {
- *     int end = boundary.last();
- *     for (int start = boundary.previous();
- *          start != BreakIterator.DONE;
- *          end = start, start = boundary.previous()) {
- *         System.out.println(source.substring(start,end));
- *     }
- * }
- * 
- *
- * - * Print first element - *
- *
- * public static void printFirst(BreakIterator boundary, String source) {
- *     int start = boundary.first();
- *     int end = boundary.next();
- *     System.out.println(source.substring(start,end));
- * }
- * 
- *
- * - * Print last element - *
- *
- * public static void printLast(BreakIterator boundary, String source) {
- *     int end = boundary.last();
- *     int start = boundary.previous();
- *     System.out.println(source.substring(start,end));
- * }
- * 
- *
- * - * Print the element at a specified position - *
- *
- * public static void printAt(BreakIterator boundary, int pos, String source) {
- *     int end = boundary.following(pos);
- *     int start = boundary.previous();
- *     System.out.println(source.substring(start,end));
- * }
- * 
- *
- * - * Find the next word - *
- *
- * public static int nextWordStartAfter(int pos, String text) {
- *     BreakIterator wb = BreakIterator.getWordInstance();
- *     wb.setText(text);
- *     int last = wb.following(pos);
- *     int current = wb.next();
- *     while (current != BreakIterator.DONE) {
- *         for (int p = last; p < current; p++) {
- *             if (Character.isLetter(text.charAt(p))
- *                 return last;
- *         }
- *         last = current;
- *         current = wb.next();
- *     }
- *     return BreakIterator.DONE;
- * }
- * 
- * (The iterator returned by BreakIterator.getWordInstance() is unique in that - * the break positions it returns don't represent both the start and end of the - * thing being iterated over. That is, a sentence-break iterator returns breaks - * that each represent the end of one sentence and the beginning of the next. - * With the word-break iterator, the characters between two boundaries might be a - * word, or they might be the punctuation or whitespace between two words. The - * above code uses a simple heuristic to determine which boundary is the beginning - * of a word: If the characters between this boundary and the next boundary - * include at least one letter (this can be an alphabetical letter, a CJK ideograph, - * a Hangul syllable, a Kana character, etc.), then the text between this boundary - * and the next is a word; otherwise, it's the material between words.) - *
- * - * @see CharacterIterator - * - */ - -public abstract class BreakIterator implements Cloneable -{ - /** - * Default constructor. There is no state that is carried by this abstract - * base class. - */ - protected BreakIterator() - { - } - - /** - * Clone method. Creates another BreakIterator with the same behavior and - * current state as this one. - * @return The clone. - */ - public Object clone() - { - try { - return super.clone(); - } - catch (CloneNotSupportedException e) { - throw new InternalError(); - } - } - - /** - * DONE is returned by previous() and next() after all valid - * boundaries have been returned. - */ - public static final int DONE = -1; - - /** - * Return the first boundary position. This is always the beginning - * index of the text this iterator iterates over. For example, if - * the iterator iterates over a whole string, this function will - * always return 0. This function also updates the iteration position - * to point to the beginning of the text. - * @return The character offset of the beginning of the stretch of text - * being broken. - */ - public abstract int first(); - - /** - * Return the last boundary position. This is always the "past-the-end" - * index of the text this iterator iterates over. For example, if the - * iterator iterates over a whole string (call it "text"), this function - * will always return text.length(). This function also updated the - * iteration position to point to the end of the text. - * @return The character offset of the end of the stretch of text - * being broken. - */ - public abstract int last(); - - /** - * Advances the specified number of steps forward in the text (a negative - * number, therefore, advances backwards). If this causes the iterator - * to advance off either end of the text, this function returns DONE; - * otherwise, this function returns the position of the appropriate - * boundary. Calling this function is equivalent to calling next() or - * previous() n times. - * @param n The number of boundaries to advance over (if positive, moves - * forward; if negative, moves backwards). - * @return The position of the boundary n boundaries from the current - * iteration position, or DONE if moving n boundaries causes the iterator - * to advance off either end of the text. - */ - public abstract int next(int n); - - /** - * Advances the iterator forward one boundary. The current iteration - * position is updated to point to the next boundary position after the - * current position, and this is also the value that is returned. If - * the current position is equal to the value returned by last(), or to - * DONE, this function returns DONE and sets the current position to - * DONE. - * @return The position of the first boundary position following the - * iteration position. - */ - public abstract int next(); - - /** - * Advances the iterator backward one boundary. The current iteration - * position is updated to point to the last boundary position before - * the current position, and this is also the value that is returned. If - * the current position is equal to the value returned by first(), or to - * DONE, this function returns DONE and sets the current position to - * DONE. - * @return The position of the last boundary position preceding the - * iteration position. - */ - public abstract int previous(); - - /** - * Sets the iterator's current iteration position to be the first - * boundary position following the specified position. (Whether the - * specified position is itself a boundary position or not doesn't - * matter-- this function always moves the iteration position to the - * first boundary after the specified position.) If the specified - * position is the past-the-end position, returns DONE. - * @param offset The character position to start searching from. - * @return The position of the first boundary position following - * "offset" (whether or not "offset" itself is a boundary position), - * or DONE if "offset" is the past-the-end offset. - */ - public abstract int following(int offset); - - /** - * Sets the iterator's current iteration position to be the last - * boundary position preceding the specified position. (Whether the - * specified position is itself a boundary position or not doesn't - * matter-- this function always moves the iteration position to the - * last boundary before the specified position.) If the specified - * position is the starting position, returns DONE. - * @param offset The character position to start searching from. - * @return The position of the last boundary position preceding - * "offset" (whether of not "offset" itself is a boundary position), - * or DONE if "offset" is the starting offset of the iterator. - */ - public int preceding(int offset) { - // NOTE: This implementation is here solely because we can't add new - // abstract methods to an existing class. There is almost ALWAYS a - // better, faster way to do this. - int pos = following(offset); - while (pos >= offset && pos != DONE) - pos = previous(); - return pos; - } - - /** - * Return true if the specfied position is a boundary position. If the - * function returns true, the current iteration position is set to the - * specified position; if the function returns false, the current - * iteration position is set as though following() had been called. - * @param offset the offset to check. - * @return True if "offset" is a boundary position. - */ - public boolean isBoundary(int offset) { - // Again, this is the default implementation, which is provided solely because - // we couldn't add a new abstract method to an existing class. The real - // implementations will usually need to do a little more work. - if (offset == 0) { - return true; - } - else - return following(offset - 1) == offset; - } - - /** - * Return the iterator's current position. - * @return The iterator's current position. - */ - public abstract int current(); - - /** - * Returns a CharacterIterator over the text being analyzed. - * For at least some subclasses of BreakIterator, this is a reference - * to the actual iterator being used by the BreakIterator, - * and therefore, this function's return value should be treated as - * const. No guarantees are made about the current position - * of this iterator when it is returned. If you need to move that - * position to examine the text, clone this function's return value first. - * @return A CharacterIterator over the text being analyzed. - */ - public abstract CharacterIterator getText(); - - /** - * Sets the iterator to analyze a new piece of text. The new - * piece of text is passed in as a String, and the current - * iteration position is reset to the beginning of the string. - * (The old text is dropped.) - * @param newText A String containing the text to analyze with - * this BreakIterator. - */ - public void setText(String newText) - { - setText(new StringCharacterIterator(newText)); - } - - /** - * Sets the iterator to analyze a new piece of text. The - * BreakIterator is passed a CharacterIterator through which - * it will access the text itself. The current iteration - * position is reset to the CharacterIterator's start index. - * (The old iterator is dropped.) - * @param newText A CharacterIterator referring to the text - * to analyze with this BreakIterator (the iterator's current - * position is ignored, but its other state is significant). - */ - public abstract void setText(CharacterIterator newText); - - private static final int CHARACTER_INDEX = 0; //ibm.597 - private static final int WORD_INDEX = 1; //ibm.597 - private static final int LINE_INDEX = 2; //ibm.597 - private static final int SENTENCE_INDEX = 3; //ibm.597 - private static final SoftReference[] iterCache = new SoftReference[4]; //ibm.597 - - /** - * Returns a new instance of BreakIterator that locates word boundaries. - * This function assumes that the text being analyzed is in the default - * locale's language. - * @return An instance of BreakIterator that locates word boundaries. - */ - public static BreakIterator getWordInstance() - { - return getWordInstance(Locale.getDefault()); - } - - /** - * Returns a new instance of BreakIterator that locates word boundaries. - * @param where A locale specifying the language of the text to be - * analyzed. - * @return An instance of BreakIterator that locates word boundaries. - */ - public static BreakIterator getWordInstance(Locale where) - { - return getBreakInstance(where, //ibm.597 - WORD_INDEX, //ibm.597 - "WordBreakRules", //ibm.597 - "WordBreakDictionary"); //ibm.597 - } - - /** - * Returns a new instance of BreakIterator that locates legal line- - * wrapping positions. This function assumes the text being broken - * is in the default locale's language. - * @returns A new instance of BreakIterator that locates legal - * line-wrapping positions. - */ - public static BreakIterator getLineInstance() - { - return getLineInstance(Locale.getDefault()); - } - - /** - * Returns a new instance of BreakIterator that locates legal line- - * wrapping positions. - * @param where A Locale specifying the language of the text being broken. - * @return A new instance of BreakIterator that locates legal - * line-wrapping positions. - */ - public static BreakIterator getLineInstance(Locale where) - { - return getBreakInstance(where, //ibm.597 - LINE_INDEX, //ibm.597 - "LineBreakRules", //ibm.597 - "LineBreakDictionary"); //ibm.597 - } - - /** - * Returns a new instance of BreakIterator that locates logical-character - * boundaries. This function assumes that the text being analyzed is - * in the default locale's language. - * @return A new instance of BreakIterator that locates logical-character - * boundaries. - */ - public static BreakIterator getCharacterInstance() - { - return getCharacterInstance(Locale.getDefault()); - } - - /** - * Returns a new instance of BreakIterator that locates logical-character - * boundaries. - * @param where A Locale specifying the language of the text being analyzed. - * @return A new instance of BreakIterator that locates logical-character - * boundaries. - */ - public static BreakIterator getCharacterInstance(Locale where) - { - return getBreakInstance(where, //ibm.597 - CHARACTER_INDEX, //ibm.597 - "CharacterBreakRules", //ibm.597 - "CharacterBreakDictionary"); //ibm.597 - } - - /** - * Returns a new instance of BreakIterator that locates sentence boundaries. - * This function assumes the text being analyzed is in the default locale's - * language. - * @return A new instance of BreakIterator that locates sentence boundaries. - */ - public static BreakIterator getSentenceInstance() - { - return getSentenceInstance(Locale.getDefault()); - } - - /** - * Returns a new instance of BreakIterator that locates sentence boundaries. - * @param where A Locale specifying the language of the text being analyzed. - * @return A new instance of BreakIterator that locates sentence boundaries. - */ - public static BreakIterator getSentenceInstance(Locale where) - { - return getBreakInstance(where, //ibm.597 - SENTENCE_INDEX, //ibm.597 - "SentenceBreakRules", //ibm.597 - "SentenceBreakDictionary"); //ibm.597 - } //ibm.597 - - private static BreakIterator getBreakInstance(Locale where, //ibm.597 - int type, //ibm.597 - String rulesName, //ibm.597 - String dictionaryName) { //ibm.597 - - if (iterCache[type] != null) { //ibm.597 - BreakIteratorCache cache = (BreakIteratorCache) iterCache[type].get(); //ibm.597 - if (cache != null) { //ibm.597 - if (cache.getLocale().equals(where)) { //ibm.597 - return cache.createBreakInstance(); //ibm.597 - } //ibm.597 - } //ibm.597 - } //ibm.597 - - BreakIterator result = createBreakInstance(where, //ibm.597 - type, //ibm.597 - rulesName, //ibm.597 - dictionaryName); //ibm.597 - BreakIteratorCache cache = new BreakIteratorCache(where, result); //ibm.597 - iterCache[type] = new SoftReference(cache); //ibm.597 - return result; //ibm.597 - } //ibm.597 - - private static BreakIterator createBreakInstance(Locale where, //ibm.597 - int type, //ibm.597 - String rulesName, //ibm.597 - String dictionaryName) { //ibm.597 - -// System.out.println("rulesName: "+rulesName); -// System.out.println("dictionaryName: "+dictionaryName); - ResourceBundle bundle = ResourceBundle.getBundle( //ibm.597 - "com.ibm.text.resources.BreakIteratorRules", where); //ibm.597 - String[] classNames = bundle.getStringArray("BreakIteratorClasses"); //ibm.597 - - String rules = bundle.getString(rulesName); //ibm.597 - - if (classNames[type].equals("RuleBasedBreakIterator")) { //ibm.597 - return new RuleBasedBreakIterator(rules); //ibm.597 - } //ibm.597 - else if (classNames[type].equals("DictionaryBasedBreakIterator")) { //ibm.597 - try { //ibm.597 - // System.out.println(dictionaryName); - Object t = bundle.getObject(dictionaryName); //ibm.597 - // System.out.println(t); - URL url = (URL)t; //ibm.597 - InputStream dictionary = url.openStream(); //ibm.597 - return new DictionaryBasedBreakIterator(rules, dictionary); //ibm.597 - } //ibm.597 - catch(IOException e) { //ibm.597 - } //ibm.597 - catch(MissingResourceException e) { //ibm.597 - } //ibm.597 - return new RuleBasedBreakIterator(rules); //ibm.597 - } //ibm.597 - else //ibm.597 - throw new IllegalArgumentException("Invalid break iterator class \"" + //ibm.597 - classNames[type] + "\""); //ibm.597 - } - - /** - * Returns a list of locales for which BreakIterators can be used. - * @return An array of Locales. All of the locales in the array can - * be used when creating a BreakIterator. - */ - public static synchronized Locale[] getAvailableLocales() - { - //FIX ME - this is a known bug. It should return - //all locales. - return LocaleData.getAvailableLocales("NumberPatterns"); - } - - private static final class BreakIteratorCache { //ibm.597 - - private BreakIterator iter; //ibm.597 - private Locale where; //ibm.597 - - BreakIteratorCache(Locale where, BreakIterator iter) { //ibm.597 - this.where = where; //ibm.597 - this.iter = (BreakIterator) iter.clone(); //ibm.597 - } //ibm.597 - - Locale getLocale() { //ibm.597 - return where; //ibm.597 - } //ibm.597 - - BreakIterator createBreakInstance() { //ibm.597 - return (BreakIterator) iter.clone(); //ibm.597 - } //ibm.597 - } //ibm.597 -} diff --git a/icu4j/src/com/ibm/text/CanonicalIterator.java b/icu4j/src/com/ibm/text/CanonicalIterator.java deleted file mode 100755 index ee6f97f0f7..0000000000 --- a/icu4j/src/com/ibm/text/CanonicalIterator.java +++ /dev/null @@ -1,439 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/CanonicalIterator.java,v $ - * $Date: 2002/02/01 02:05:35 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.text; -import com.ibm.util.Utility; -import java.util.Enumeration; -import java.util.Vector; - -import java.util.*; - -/** - * This class allows one to iterate through all the strings that are canonically equivalent to a given - * string. For example, here are some sample results: -Results for: {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA} -1: \u0041\u030A\u0064\u0307\u0327 - = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA} -2: \u0041\u030A\u0064\u0327\u0307 - = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D}{COMBINING CEDILLA}{COMBINING DOT ABOVE} -3: \u0041\u030A\u1E0B\u0327 - = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D WITH DOT ABOVE}{COMBINING CEDILLA} -4: \u0041\u030A\u1E11\u0307 - = {LATIN CAPITAL LETTER A}{COMBINING RING ABOVE}{LATIN SMALL LETTER D WITH CEDILLA}{COMBINING DOT ABOVE} -5: \u00C5\u0064\u0307\u0327 - = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA} -6: \u00C5\u0064\u0327\u0307 - = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D}{COMBINING CEDILLA}{COMBINING DOT ABOVE} -7: \u00C5\u1E0B\u0327 - = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D WITH DOT ABOVE}{COMBINING CEDILLA} -8: \u00C5\u1E11\u0307 - = {LATIN CAPITAL LETTER A WITH RING ABOVE}{LATIN SMALL LETTER D WITH CEDILLA}{COMBINING DOT ABOVE} -9: \u212B\u0064\u0307\u0327 - = {ANGSTROM SIGN}{LATIN SMALL LETTER D}{COMBINING DOT ABOVE}{COMBINING CEDILLA} -10: \u212B\u0064\u0327\u0307 - = {ANGSTROM SIGN}{LATIN SMALL LETTER D}{COMBINING CEDILLA}{COMBINING DOT ABOVE} -11: \u212B\u1E0B\u0327 - = {ANGSTROM SIGN}{LATIN SMALL LETTER D WITH DOT ABOVE}{COMBINING CEDILLA} -12: \u212B\u1E11\u0307 - = {ANGSTROM SIGN}{LATIN SMALL LETTER D WITH CEDILLA}{COMBINING DOT ABOVE} - *
Note: the code is intended for use with small strings, and is not suitable for larger ones, - * since it has not been optimized for that situation. - *@author M. Davis - *@draft - */ - -public class CanonicalIterator { - /** - *@param source string to get results for - */ - public CanonicalIterator(String source) { - setSource(source); - } - - /** - *@return gets the source: NOTE: it is the NFD form of source - */ - public String getSource() { - return source; - } - - /** - * Resets the iterator so that one can start again from the beginning. - */ - public void reset() { - done = false; - for (int i = 0; i < current.length; ++i) { - current[i] = 0; - } - } - - /** - *@return the next string that is canonically equivalent. The value null is returned when - * the iteration is done. - */ - public String next() { - if (done) return null; - - // construct return value - - buffer.setLength(0); // delete old contents - for (int i = 0; i < pieces.length; ++i) { - buffer.append(pieces[i][current[i]]); - } - String result = buffer.toString(); - - // find next value for next time - - for (int i = current.length - 1; ; --i) { - if (i < 0) { - done = true; - break; - } - current[i]++; - if (current[i] < pieces[i].length) break; // got sequence - current[i] = 0; - } - return result; - } - - /** - *@param set the source string to iterate against. This allows the same iterator to be used - * while changing the source string, saving object creation. - */ - public void setSource(String newSource) { - source = Normalizer.normalize(newSource, Normalizer.DECOMP, 0); - done = false; - - // find the segments - List list = new ArrayList(); - int cp; - int start = 0; - int i = 1; - for (; i < source.length(); i += UTF16.getCharCount(i)) { - cp = UTF16.charAt(source, i); - if (SAFE_START.contains(cp)) { - list.add(source.substring(start, i)); // add up to i - start = i; - } - } - list.add(source.substring(start, i)); // add last one - - // allocate the arrays, and find the strings that are CE to each segment - pieces = new String[list.size()][]; - current = new int[list.size()]; - for (i = 0; i < pieces.length; ++i) { - if (PROGRESS) System.out.println("SEGMENT"); - pieces[i] = getEquivalents((String) list.get(i)); - } - } - - /** - * Dumb recursive implementation of permutation. - * TODO: optimize - * @param source the string to find permutations for - * @return the results in a set. - */ - public static Set permute(String source) { - //if (PROGRESS) System.out.println("Permute: " + source); - Set result = new TreeSet(); - - // optimization: - // if zero or one character, just return a set with it - // we check for length < 2 to keep from counting code points all the time - if (source.length() <= 2 && UTF16.countCodePoint(source) <= 1) { - result.add(source); - return result; - } - - // otherwise iterate through the string, and recursively permute all the other characters - int cp; - for (int i = 0; i < source.length(); i += UTF16.getCharCount(cp)) { - cp = UTF16.charAt(source, i); - String chStr = UTF16.valueOf(source, i); - - // see what the permutations of the characters before and after this one are - Set subpermute = permute(source.substring(0,i) + source.substring(i + UTF16.getCharCount(cp))); - - // prefix this character to all of them - Iterator it = subpermute.iterator(); - while (it.hasNext()) { - String piece = chStr + (String) it.next(); - //if (PROGRESS) System.out.println(" Piece: " + piece); - result.add(piece); - } - } - return result; - } - - // FOR TESTING - - /** - *@return the set of "safe starts", characters that are class zero AND are never non-initial in a decomposition. - */ - public static UnicodeSet getSafeStart() { - return (UnicodeSet) SAFE_START.clone(); - } - - /** - *@return the set of characters whose decompositions start with the given character - */ - public static UnicodeSet getStarts(int cp) { - UnicodeSet result = AT_START.get(cp); - if (result == null) result = EMPTY; - return (UnicodeSet) result.clone(); - } - - - // ===================== PRIVATES ============================== - - // debug - private static boolean PROGRESS = false; // debug progress - private static Transliterator NAME = PROGRESS ? Transliterator.getInstance("name") : null; - - // fields - private String source; - private boolean done; - private String[][] pieces; - private int[] current; - // Note: C will need two more fields, since arrays there don't have lengths - // int pieces_length; - // int[] pieces_lengths; - - // transient fields - private transient StringBuffer buffer = new StringBuffer(); - - - // we have a segment, in NFD. Find all the strings that are canonically equivalent to it. - private String[] getEquivalents(String segment) { - Set result = new TreeSet(); - Set basic = getEquivalents2(segment); - - // now get all the permutations - // add only the ones that are canonically equivalent - // TODO: optimize by not permuting any class zero. - Iterator it = basic.iterator(); - while (it.hasNext()) { - String item = (String) it.next(); - Set permutations = permute(item); - Iterator it2 = permutations.iterator(); - while (it2.hasNext()) { - String possible = (String) it2.next(); - String attempt = Normalizer.normalize(possible, Normalizer.DECOMP, 0); - if (attempt.equals(segment)) { - if (PROGRESS) System.out.println("Adding Permutation: " + NAME.transliterate(possible)); - result.add(possible); - } else { - if (PROGRESS) System.out.println("-Skipping Permutation: " + NAME.transliterate(possible)); - } - } - } - - // convert into a String[] to clean up storage - String[] finalResult = new String[result.size()]; - result.toArray(finalResult); - return finalResult; - } - - private Set getEquivalents2(String segment) { - Set result = new TreeSet(); - if (PROGRESS) System.out.println("Adding: " + NAME.transliterate(segment)); - result.add(segment); - StringBuffer workingBuffer = new StringBuffer(); - - // cycle through all the characters - int cp; - for (int i = 0; i < segment.length(); i += UTF16.getCharCount(cp)) { - // see if any character is at the start of some decomposition - cp = UTF16.charAt(segment, i); - UnicodeSet starts = AT_START.get(cp); - if (starts == null) continue; - UnicodeSetIterator usi = new UnicodeSetIterator(starts); - // if so, see which decompositions match - while (true) { - int cp2 = usi.next(); - if (cp2 < 0) break; // done - Set remainder = extract(cp2, segment, i, workingBuffer); - if (remainder == null) continue; - - // there were some matches, so add all the possibilities to the set. - String prefix = segment.substring(0, i) + UTF16.valueOf(cp2); - Iterator it = remainder.iterator(); - while (it.hasNext()) { - String item = (String) it.next(); - if (PROGRESS) System.out.println("Adding: " + NAME.transliterate(prefix + item)); - result.add(prefix + item); - } - } - } - return result; - } - - /** - * See if the decomposition of cp2 is at segment starting at segmentPos - * (with canonical rearrangment!) - * If so, take the remainder, and return the equivalents - */ - private Set extract(int comp, String segment, int segmentPos, StringBuffer buffer) { - if (PROGRESS) System.out.println(" extract: " + NAME.transliterate(UTF16.valueOf(comp)) - + ", " + NAME.transliterate(segment.substring(segmentPos))); - String decomp = Normalizer.normalize(UTF16.valueOf(comp), Normalizer.DECOMP, 0); - - // See if it matches the start of segment (at segmentPos) - boolean ok = false; - int cp; - int decompPos = 0; - int decompCp = UTF16.charAt(decomp,0); - decompPos += UTF16.getCharCount(decompCp); // adjust position to skip first char - //int decompClass = getClass(decompCp); - buffer.setLength(0); // initialize working buffer, shared among callees - - for (int i = segmentPos; i < segment.length(); i += UTF16.getCharCount(cp)) { - cp = UTF16.charAt(segment, i); - if (cp == decompCp) { // if equal, eat another cp from decomp - if (PROGRESS) System.out.println(" matches: " + NAME.transliterate(UTF16.valueOf(cp))); - if (decompPos == decomp.length()) { // done, have all decomp characters! - buffer.append(segment.substring(i + UTF16.getCharCount(cp))); // add remaining segment chars - ok = true; - break; - } - decompCp = UTF16.charAt(decomp, decompPos); - decompPos += UTF16.getCharCount(decompCp); - //decompClass = getClass(decompCp); - } else { - if (PROGRESS) System.out.println(" buffer: " + NAME.transliterate(UTF16.valueOf(cp))); - // brute force approach - UTF16.append(buffer, cp); - /* TODO: optimize - // since we know that the classes are monotonically increasing, after zero - // e.g. 0 5 7 9 0 3 - // we can do an optimization - // there are only a few cases that work: zero, less, same, greater - // if both classes are the same, we fail - // if the decomp class < the segment class, we fail - - segClass = getClass(cp); - if (decompClass <= segClass) return null; - */ - } - } - if (!ok) return null; // we failed, characters left over - if (PROGRESS) System.out.println("Matches"); - if (buffer.length() == 0) return SET_WITH_NULL_STRING; // succeed, but no remainder - String remainder = buffer.toString(); - - // brute force approach - // check to make sure result is canonically equivalent - String trial = Normalizer.normalize(UTF16.valueOf(comp) + remainder, Normalizer.DECOMP, 0); - if (!segment.regionMatches(segmentPos, trial, 0, segment.length() - segmentPos)) return null; - - // get the remaining combinations - return getEquivalents2(remainder); - } - - // TODO: fix once we have a codepoint interface to get the canonical combining class - // TODO: Need public access to canonical combining class in UCharacter! - private static int getClass(int cp) { - return Normalizer.getClass((char)cp); - } - - // ================= BUILDER ========================= - // TODO: Flatten this data so it doesn't have to be reconstructed each time! - - private static final UnicodeSet EMPTY = new UnicodeSet(); // constant, don't change - private static final Set SET_WITH_NULL_STRING = new TreeSet(); // constant, don't change - static { - SET_WITH_NULL_STRING.add(""); - } - - private static UnicodeSet SAFE_START = new UnicodeSet(); - private static CharMap AT_START = new CharMap(); - - // WARNING, NORMALIZER doesn't have supplementaries yet; - // Change FFFF to 10FFFF in C, and in Java when normalizer is upgraded. - private static int LAST_UNICODE = 0xFFFF; - static { - buildData(); - } - - // TODO: public just for testing - private static void buildData() { - - if (PROGRESS) System.out.println("Getting Safe Start"); - for (int cp = 0; cp <= LAST_UNICODE; ++cp) { - if (PROGRESS & (cp & 0x7FF) == 0) System.out.print('.'); - int cc = getClass(cp); - if (cc == 0) SAFE_START.add(cp); - // will fix to be really safe below - } - if (PROGRESS) System.out.println(); - - if (PROGRESS) System.out.println("Getting Containment"); - for (int cp = 0; cp <= LAST_UNICODE; ++cp) { - if (PROGRESS & (cp & 0x7FF) == 0) System.out.print('.'); - // TODO: For efficiency, need extra function plus overloads - // Normalizer.normalizationDiffers(String source,...) - // Normalizer.normalizationDiffers(int char32,...) - // Normalizer.normalize(char32,...); - String istr = UTF16.valueOf(cp); - String decomp = Normalizer.normalize(istr, Normalizer.DECOMP, 0); - if (decomp.equals(istr)) continue; - - // add each character in the decomposition to canBeIn - - int component; - for (int i = 0; i < decomp.length(); i += UTF16.getCharCount(component)) { - component = UTF16.charAt(decomp, i); - if (i == 0) { - AT_START.add(component, cp); - } else if (getClass(component) == 0) { - SAFE_START.remove(component); - } - } - } - if (PROGRESS) System.out.println(); - } - - // the following is just for a map from characters to a set of characters - - private static class CharMap { - Map storage = new HashMap(); - MutableInt probe = new MutableInt(); - boolean converted = false; - - public void add(int cp, int whatItIsIn) { - UnicodeSet result = (UnicodeSet) storage.get(probe.set(cp)); - if (result == null) { - result = new UnicodeSet(); - storage.put(probe, result); - } - result.add(whatItIsIn); - } - - public UnicodeSet get(int cp) { - return (UnicodeSet) storage.get(probe.set(cp)); - } - } - - private static class MutableInt { - public int contents; - public int hashCode() { return contents; } - public boolean equals(Object other) { - return ((MutableInt)other).contents == contents; - } - // allows chaining - public MutableInt set(int contents) { - this.contents = contents; - return this; - } - } -} - \ No newline at end of file diff --git a/icu4j/src/com/ibm/text/ChineseDateFormat.java b/icu4j/src/com/ibm/text/ChineseDateFormat.java deleted file mode 100755 index d3398c9956..0000000000 --- a/icu4j/src/com/ibm/text/ChineseDateFormat.java +++ /dev/null @@ -1,126 +0,0 @@ -/********************************************************************* - * Copyright (C) 2000, International Business Machines Corporation and - * others. All Rights Reserved. - ********************************************************************* - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/ChineseDateFormat.java,v $ - * $Date: 2000/11/21 20:19:08 $ - * $Revision: 1.3 $ - */ -package com.ibm.text; -import com.ibm.util.*; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Locale; - -/** - * A concrete {@link DateFormat} for {@link com.ibm.util.ChineseCalendar}. - * This class handles a ChineseCalendar-specific field, - * ChineseCalendar.IS_LEAP_MONTH. It also redefines the - * handling of two fields, ERA and YEAR. The - * former is displayed numerically, instead of symbolically, since it is - * the numeric cycle number in ChineseCalendar. The latter is - * numeric, as before, but has no special 2-digit Y2K behavior. - * - *

With regard to ChineseCalendar.IS_LEAP_MONTH, this - * class handles parsing specially. If no string symbol is found at all, - * this is taken as equivalent to an IS_LEAP_MONTH value of - * zero. This allows formats to display a special string (e.g., "*") for - * leap months, but no string for normal months. - * - *

Summary of field changes vs. {@link SimpleDateFormat}:

- * Symbol   Meaning                 Presentation        Example
- * ------   -------                 ------------        -------
- * G        cycle                   (Number)            78
- * y        year of cycle (1..60)   (Number)            17
- * l        is leap month           (Text)              4637
- * 
- * - * @see com.ibm.util.ChineseCalendar - * @see ChineseDateFormatSymbols - * @author Alan Liu - */ -public class ChineseDateFormat extends SimpleDateFormat { - - // TODO Finish the constructors - - public ChineseDateFormat(String pattern, Locale locale) { - super(pattern, new ChineseDateFormatSymbols(locale)); - } - - protected String subFormat(char ch, int count, int beginOffset, - FieldPosition pos, DateFormatSymbols formatData) { - switch (ch) { - case 'G': // 'G' - ERA - return zeroPaddingNumber(calendar.get(Calendar.ERA), 1, 9); - case 'l': // 'l' - IS_LEAP_MONTH - { - ChineseDateFormatSymbols symbols = - (ChineseDateFormatSymbols) formatData; - return symbols.getLeapMonth(calendar.get( - ChineseCalendar.IS_LEAP_MONTH)); - } - default: - return super.subFormat(ch, count, beginOffset, pos, formatData); - } - } - - protected int subParse(String text, int start, char ch, int count, - boolean obeyCount, boolean[] ambiguousYear) { - if (ch != 'G' && ch != 'l' && ch != 'y') { - return super.subParse(text, start, ch, count, obeyCount, ambiguousYear); - } - - ParsePosition pos = new ParsePosition(start); - - // If there are any spaces here, skip over them. If we hit the end - // of the string, then fail. - for (;;) { - if (pos.getIndex() >= text.length()) { - return -start; - } - char c = text.charAt(pos.getIndex()); - if (c != ' ' && c != '\t') { // TODO Shouldn't this be isWhitespace? - break; - } - pos.setIndex(pos.getIndex()+1); - } - - switch (ch) { - case 'G': // 'G' - ERA - case 'y': // 'y' - YEAR, but without the 2-digit Y2K adjustment - { - Number number = null; - if (obeyCount) { - if ((start+count) > text.length()) { - return -start; - } - number = numberFormat.parse(text.substring(0, start+count), pos); - } else { - number = numberFormat.parse(text, pos); - } - if (number == null) { - return -start; - } - int value = number.intValue(); - calendar.set(ch == 'G' ? Calendar.ERA : Calendar.YEAR, value); - return pos.getIndex(); - } - case 'l': // 'l' - IS_LEAP_MONTH - { - ChineseDateFormatSymbols symbols = - (ChineseDateFormatSymbols) getSymbols(); - int result = matchString(text, start, ChineseCalendar.IS_LEAP_MONTH, - symbols.isLeapMonth); - // Treat the absence of any matching string as setting - // IS_LEAP_MONTH to false. - if (result<0) { - calendar.set(ChineseCalendar.IS_LEAP_MONTH, 0); - result = start; - } - return result; - } - default: - return 0; // This can never happen - } - } -} diff --git a/icu4j/src/com/ibm/text/ChineseDateFormatSymbols.java b/icu4j/src/com/ibm/text/ChineseDateFormatSymbols.java deleted file mode 100755 index dde56f49e0..0000000000 --- a/icu4j/src/com/ibm/text/ChineseDateFormatSymbols.java +++ /dev/null @@ -1,60 +0,0 @@ -/********************************************************************* - * Copyright (C) 2000, International Business Machines Corporation and - * others. All Rights Reserved. - ********************************************************************* - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/ChineseDateFormatSymbols.java,v $ - * $Date: 2000/11/21 20:19:08 $ - * $Revision: 1.1 $ - */ -package com.ibm.text; -import com.ibm.util.*; -import java.util.Locale; -import java.util.ResourceBundle; -import java.util.MissingResourceException; - -/** - * A subclass of {@link DateFormatSymbols} for {@link ChineseDateFormat}. - * This class contains additional symbols corresponding to the - * ChineseCalendar.IS_LEAP_MONTH field. - * - * @see ChineseDateFormat - * @see com.ibm.util.ChineseCalendar - * @author Alan Liu - */ -public class ChineseDateFormatSymbols extends DateFormatSymbols { - - /** - * Package-private array that ChineseDateFormat needs to be able to - * read. - */ - String isLeapMonth[]; // Do NOT add =null initializer - - public ChineseDateFormatSymbols() { - this(Locale.getDefault()); - } - - public ChineseDateFormatSymbols(Locale locale) { - super(ChineseCalendar.class, locale); - } - - public ChineseDateFormatSymbols(Calendar cal, Locale locale) { - super(cal==null?null:cal.getClass(), locale); - } - - // New API - public String getLeapMonth(int isLeapMonth) { - return this.isLeapMonth[isLeapMonth]; - } - - /** - * Override DateFormatSymbols. - */ - protected void constructCalendarSpecific(ResourceBundle bundle) { - super.constructCalendarSpecific(bundle); - if (bundle != null) { - try { - isLeapMonth = bundle.getStringArray("IsLeapMonth"); - } catch (MissingResourceException e) {} - } - } -} diff --git a/icu4j/src/com/ibm/text/ComposeData.java b/icu4j/src/com/ibm/text/ComposeData.java deleted file mode 100755 index 6ebb06277d..0000000000 --- a/icu4j/src/com/ibm/text/ComposeData.java +++ /dev/null @@ -1,1459 +0,0 @@ -/* -************************************************************************ -* Copyright (c) 1997-2000, International Business Machines -* Corporation and others. All Rights Reserved. -************************************************************************ -* > THIS FILE WAS MACHINE GENERATED < -* > DO NOT EDIT BY HAND < -* > RUN TOOL TO REGENERATE < -* Tool: com.ibm.text.Normalizer -* Creation date: Fri Jul 21 13:41:45 PDT 2000 -*/ - -package com.ibm.text; -import com.ibm.util.*; - -class ComposeData { - static final short BASE_COUNT = 748; - static final short COMBINING_COUNT = 55; - static final int MAX_COMPAT = 4341; - static final int MAX_CANONICAL = 5199; - static final char MAX_COMPOSED = 0xfb1d; - static final int MAX_INDEX = 8982; - static final int INITIAL_JAMO_INDEX = 8983; - static final int MEDIAL_JAMO_INDEX = 8984; - static final int MAX_BASES = 1024; - static final int MAX_COMBINE = 64; - static final int TYPE_MASK = 0x7; - static final int INDEX_SHIFT = 3; - static final int IGNORE = 0; - static final int BASE = 1; - static final int NON_COMPOSING_COMBINING = 2; - static final int COMBINING = 3; - static final int INITIAL_JAMO = 4; - static final int MEDIAL_JAMO = 5; - static final int FINAL_JAMO = 6; - static final int HANGUL = 7; - - static final CompactCharArray lookup = new CompactCharArray( - "\000\u0800\000 @`\000\u0080\u00A0\u00C0\u00E0\u0100\u0120\u0140\000\u0160"+ - "\u0180\u01A0\u01C0\u01E0\000\000\u0200\u0220\u0240\u0260\u0280\u02A0\u02C0"+ - "\u02E0\u0300\u0320\u0340\u0360\u0380\u03A0\u03C0\u03E0\u0400\000\u0420"+ - "\u0440\uA5A5\004\000\u0460\u0480\u04A0\000\000\u04C0\u04E0\u0500\000\000"+ - "\u0520\u0540\u0560\u0580\u05A0\uA5A5\016\000\u05C0\u05E0\000\000\u0600"+ - "\u0620\000\000\u0640\u0660\000\000\u0680\u06A0\000\000\u06C0\u06E0\000"+ - "\u0700\u0720\u0740\000\000\000\u0760\000\000\u0780\u07A0\000\000\u07C0"+ - "\u07E0\000\000\000\u0800\000\000\u0820\u0840\000\000\u0860\u0880\000\u08A0"+ - "\u08C0\u08E0\u0900\u0920\u0940\u0960\000\000\u0980\uA5A5\006\000\u09A0"+ - "\u09A0\u09A0\u09C0\u09E0\u0A00\u0A20\u0A40\uA5A5.\000\u0A60\uA5A5\006"+ - "\000\u0A80\uA5A5*\000\u0AA0\u0AC0\u0AE0\u0B00\u0B20\u0B40\u0B60\u0B80"+ - "\u0BA0\u0BC0\u0BE0\u0C00\u0C20\u0C40\u0C60\u0C80\u0CA0\u0CC0\u0CE0\u0D00"+ - "\u0D20\u0D40\u0D60\u0D80\u0DA0\u0DC0\u0DE0\u0E00\u0E20\000\u0E40\000\u0E60"+ - "\u0E80\u0EA0\u0EC0\u0EE0\u0F00\000\000\000\u0F20\uA5A5\011\000\u0F40\u0F60"+ - "\u0F80\u0FA0\u0FC0\uA5A5L\000\u0FE0\000\000\u1000\u1020\u1040\u1060\u1080"+ - "\u10A0\u10C0\u10E0\000\u1100\u1120\u1140\u1160\u1180\u11A0\u11C0\u11E0"+ - "\000\u1200\u1220\u1240\u1260\000\000\000\u1280\u12A0\u12C0\u12E0\u1300"+ - "\u1320\u1340\u1360\u1380\u13A0\u13C0\u13E0\u1400\u1420\u1440\u1460\uA5A5"+ - "\u03C0\000\uA5A5\u015D\u1480\u14A0\uA5A5\u010A\000\u14C0\u14E0\u1500\u1520"+ - "\u1540\u1560\u1580\u15A0\u15C0\u15E0\uA5A5\006\000\u1600\u1620\u1640\u1660"+ - "\u1680\u16A0\u16C0\u16E0\u1700\u1720\u1740\u1760\u1780\u17A0\u17C0\u17E0"+ - "\u1800\u1820\u1840\u1860\u1880\u18A0\u18C0\u18E0\000\u1900\u1920\u1940"+ - "\u1960\u1980\u19A0\u19C0\u19E0\u1A00\u1A20\u1A40\u1A60\u1A80\u1AA0\u1AC0" - , - "\000\u1AE0\uA5A5<\000\021\031)\000\0009IQaiqy\u0081\u0089\u0091\u0099"+ - "\u00A1\u00A9\u00B1\u00B9\u00C1\000\u00C9\u00D1\u00D9\u00E1\u00E9\u00F1"+ - "\u00F9\u0101\u0109\uA5A5\006\000\u0111\u0119\u0121\u0129\u0131\u0139\u0141"+ - "\u0149\u0151\u0159\u0161\u0169\u0171\u0179\u0181\u0189\000\u0191\u0199"+ - "\u01A1\u01A9\u01B1\u01B9\u01C1\u01C9\u01D1\uA5A5\005\000p\uA5A5\007\000"+ - "\012\000\u0080\uA5A5\004\000\u0090\000\000\u00A8\u00B8\u00C8\u00E0\000"+ - "\000\u00F0\u0108\u0118\000\u0128\u0148\u0168\000\u01D9\u01E1\u01E9\u01F1"+ - "\u01F9\u0201\u0209\u0211\u0219\u0221\u0229\u0231\u0239\u0241\u0249\u0251"+ - "\000\u0259\u0261\u0269\u0271\u0279\u0281\000\u0289\u0291\u0299\u02A1\u02A9"+ - "\u02B1\000\000\u02B9\u02C1\u02C9\u02D1\u02D9\u02E1\u02E9\u02F1\u02F9\u0301"+ - "\u0309\u0311\u0319\u0321\u0329\u0331\000\u0339\u0341\u0349\u0351\u0359"+ - "\u0361\000\u0369\u0371\u0379\u0381\u0389\u0391\000\u0399\u03A1\u03A9\u03B1"+ - "\u03B9\000\000\u03C1\u03C9\u03D1\u03D9\u03E1\u03E9\u03F1\u03F9\u0401\u0409"+ - "\000\000\u0411\u0419\u0421\u0429\u0431\u0439\000\000\u0441\u0449\u0451"+ - "\u0459\u0461\u0469\u0471\u0479\000\000\u0481\u0489\000\000\u0491\u0499"+ - "\u04A1\u04A9\u04B1\u04B9\000\000\u04C1\000\u0188\u01A0\uA5A5\005\000\u04C9"+ - "\u04D1\000\000\u04D9\u04E1\u01B8\u01D0\000\000\u04E9\u04F1\000\000\u04F9"+ - "\u0501\u01E8\000\000\u0509\u0511\u0519\u0521\u0529\u0531\000\000\u0539"+ - "\u0541\000\000\u0549\u0551\u0559\u0561\u0569\u0571\000\000\u0579\u0581"+ - "\000\000\u0589\u0591\000\000\u0599\u05A1\u05A9\u05B1\u05B9\u05C1\u05C9"+ - "\u05D1\u05D9\u05E1\000\000\u05E9\u05F1\u05F9\u0601\u0609\u0611\u0619\u0621"+ - "\u0629\u0631\u0639\042\u0641\u0649\uA5A5\015\000\u0651\u0659\uA5A5\006"+ - "\000\u0661\uA5A5\014\000\u0200\u0220\u0240\u0260\u0278\u0290\u02A8\u02C0"+ - "\u02D8\u0669\u0671\u0679\u0681\u0689\u0691\u0699\u06A1\u06A9\u06B1\u06B9"+ - "\u06C1\u06C9\u06D1\u06D9\u06E1\000\u06E9\u06F1\u06F9\u0701\uA5A5\004\000"+ - "\u0709\u0711\u0719\u0721\u0729\u0731\uA5A5\005\000\u02F0\u0308\u0320\u0739"+ - "\u0741\000\000\u0749\u0751\u0759\u0761\uA5A5\004\000\u0769\u0771\u0779"+ - "\u0781\u0789\u0791\u0799\u07A1\u07A9\u07B1\u07B9\u07C1\u07C9\u07D1\u07D9"+ - "\u07E1\u07E9\u07F1\u07F9\u0801\u0809\u0811\u0819\u0821\u0829\u0831\u0839"+ - "\u0841\000\000\u0849\u0851\uA5A5\006\000\u0859\u0861\u0869\u0871\u0879"+ - "\u0881\u0889\u0891\u0899\u08A1\u08A9\u08B1\u08B9\u08C1\uA5A5\036\000\u08C9"+ - "\uA5A5\035\000\u0338\u0348\u01A8\u0358\u0368\u0378\u0388\u0398\u03A8\uA5A5"+ - "\037\000\u03B8\u03D0\u03E8\u0400\u0418\u0430\000\000\u0448\u0458 \u0468"+ - "\u0478\uA5A5\033\000\013\023\033#+\u01BB3;CKS[c\u01BB\u01BBk\u01BBs\u01BB"+ - "{\u0083\u01C3\uA5A5\004\u01CB\u01C3\u008B\uA5A5\005\u01CB\u01D3\u01D3"+ - "\u0093\u009B\u00A3\u00AB\u00B3\u00BB\uA5A5\004\u01CB\u00C3\u00CB\u01CB"+ - "\u00D3\u00DB\u01CB\u01CB\uA5A5\004\u01DB\u00E3\uA5A5\004\u01CB\u01BB\u01BB"+ - "\u01BB\u87B8\u87C8\u00EB\u87D8\u87E8\u00F3\u01BB\u01CB\u01CB\u01CB\u01BB"+ - "\u01BB\u01BB\u01CB\u01CB\uA5A5\021\000\u01E3\u01E3\u01EB\uA5A5\021\000"+ - "\u8800\uA5A5\005\000\u0488\000\000\000\u8810\uA5A5\005\000\u00C8\u04A0"+ - "\000\u8820\uA5A5\011\000\u08D1\000\000\000\u08D9\000\u08E1\000\u08E9\uA5A5"+ - "\005\000\u08F1\000\u08F9\000\000\000\u0901\000\000\000\u0909\000\000\u0911"+ - "\000\u0919\000\000\u0921\000\000\000\u0929\000\u0931\000\u0939\uA5A5\005"+ - "\000\u0941\000\u0949\000\000\000\u0951\000\000\000\u0959\u0961\u0969\000"+ - "\000\u0971\000\u04C0\u04D02\u04E0\u04F8\u0510\u0520\uA5A5\031\000\u0530"+ - "\u0540\u0550\uA5A5\023\000\u0979\uA5A5\011\000\u0981\000\000\u0989\000"+ - "\u0991\u0999\u09A1\u09A9\000\u09B1\000\000\000\u09B9\uA5A5\004\000\u09C1"+ - "\000\000\000\u09C9\000\000\000\u09D1\000\u09D9\000\000\u09E1\000\000\u09E9"+ - "\000\u09F1\u09F9\u0A01\u0A09\000\u0A11\000\000\000\u0A19\uA5A5\004\000"+ - "\u0A21\000\000\000\u0A29\000\000\000\u0A31\000\u0A39\uA5A5\010\000\u0A41"+ - "\uA5A5\035\000\u0A49\u0A51\uA5A5\015\000\uA5A5\004\u01BB\uA5A51\000\u0A59"+ - "\u0A61\uA5A5\016\000\u0A69\u0A71\uA5A5\035\000\u0560\uA5A5\011\000\u01CB"+ - "\uA5A5\004\u01BB\u01CB\u01BB\u01BB\u01BB\u01F3\u01CB\uA5A5\006\u01BB\000"+ - "\uA5A5\005\u01CB\u01BB\u01BB\u01CB\u01BB\u01BB\u01F3\u01FB\u01BB\u0203"+ - "\u020B\u0213\u021B\u00FB\u0223\u022B\u0233\u023B\u0243\000\u024B\u0253"+ - "\u025B\000\u0263\000\u026B\u0273\000\u01BB\uA5A5\024\000\u0A79\uA5A5\010"+ - "\000\u0A81\u0A89\000\000\000\u0A91\uA5A5 \000\u0A99\000\u0AA1\u027B\u0283"+ - "\u028B\u0293\u029B\u02A3\u02AB\u02B3\u0103\u010B\u0113\uA5A5\032\000\u02BB"+ - "\uA5A5\004\000\u0578\u0590\u05A8\u05C0\uA5A5\010\000\u0AA9\uA5A5\020\000"+ - "\u0AB1\000\000\u0AB9\uA5A5\007\u01BB\000\000\uA5A5\004\u01BB\u01CB\u01BB"+ - "\000\000\u01BB\u01BB\000\u01CB\u01BB\u01BB\u01CB\uA5A5#\000\u02C3\uA5A5"+ - "\036\000\u01BB\u01CB\u01BB\u01BB\u01CB\u01BB\u01BB\u01CB\u01CB\u01CB\u01BB"+ - "\u01CB\u01CB\u01BB\u01CB\u01BB\u01BB\u01BB\u01CB\u01BB\u01CB\u01BB\u01CB"+ - "\u01BB\u01CB\u01BB\u01BB\uA5A5\035\000\u0AC1\uA5A5\007\000\u0AC9\000\000"+ - "\u0AD1\uA5A5\010\000\u011B\uA5A5\020\000\u02CB\000\000\000\u01BB\u01CB"+ - "\u01BB\u01BB\000\000\000\u8830\u8848\u8860\u8878\u8890\u88A8\u88C0\u88D8"+ - "\uA5A5\034\000\u02D3\000\u0123\uA5A5\010\000\u0AD9\uA5A5\005\000\u02CB"+ - "\uA5A5\011\000\u012B\uA5A5\004\000\u88F0\u8908\000\u8920\uA5A5\023\000"+ - "\u8938\000\000\u8950\uA5A5\005\000\u02D3\uA5A5\020\000\u02CB\uA5A5\013"+ - "\000\u8968\u8980\u8998\000\000\u89B0\uA5A5\035\000\u02D3\uA5A5\020\000"+ - "\u02CB\uA5A5.\000\u02D3\000\u0133\uA5A5\010\000\u0AE1\uA5A5\005\000\u02CB"+ - "\uA5A5\010\000\u013B\u0143\uA5A5\004\000\u89C8\u89E0\uA5A5\024\000\u0AE9"+ - "\uA5A5+\000\u014B\uA5A5\007\000\u0AF1\u0AF9\uA5A5\005\000\u02CB\uA5A5"+ - "\011\000\u0153\uA5A5\016\000\u0B01\uA5A5\006\000\u02CB\uA5A5\007\000\u02DB"+ - "\u015B\uA5A5(\000\u0B09\000\000\u0163\000\000\000\u0B11\000\000\000\u0B19"+ - "\000\000\u02CB\uA5A5\007\000\u016B\u0173\uA5A5'\000\u017B\uA5A5\007\000"+ - "\u0B21\u0B29\uA5A5\005\000\u02CB\uA5A5\011\000\u0183\uA5A5\022\000\u018B"+ - "\uA5A5\004\000\u0193\uA5A5\011\000\u0B31\u0B39\000\u0B41\000\000\u019B"+ - "\uA5A5\023\000\u05D8\uA5A5\004\000\u02E3\u02E3\u02CB\uA5A5\015\000\uA5A5"+ - "\004\u02EB\uA5A5'\000\u05F0\uA5A5\004\000\u02F3\u02F3\uA5A5\016\000\uA5A5"+ - "\004\u02FB\uA5A5\020\000\u0608\u0620\uA5A5\016\000\u0638\uA5A5\013\000"+ - "\u01CB\u01CB\uA5A5\033\000\u01CB\000\u01CB\000\u0303\uA5A5\011\000\u89F8"+ - "\uA5A5\011\000\u8A10\uA5A5\004\000\u8A28\uA5A5\004\000\u8A40\uA5A5\004"+ - "\000\u8A58\uA5A5\014\000\u8A70\uA5A5\007\000\u030B\u0313\u8A88\u031B\u8AA0"+ - "\u8AB8\u0648\u8AD0\u0668\uA5A5\004\u0313\000\000\u0313\u8AE8\u01BB\u01BB"+ - "\u02CB\000\u01BB\u01BB\uA5A5\013\000\u8B00\uA5A5\011\000\u8B18\uA5A5\004"+ - "\000\u8B30\uA5A5\004\000\u8B48\uA5A5\004\000\u8B60\uA5A5\014\000\u8B78"+ - "\uA5A5\014\000\u01CB\uA5A5\036\000\u0B49\uA5A5\010\000\u01A3\uA5A5\010"+ - "\000\u02D3\000\u02CB\uA5A5\006\000\uA5A5 \004\000\uA5A5E\005\000\uA5A5"+ - "S\006\uA5A5\030\000\u02CB\uA5A5\026\000\u01FB\uA5A5\026\000\u0B51\u0B59"+ - "\u0B61\u0B69\uA5A5\006\000\u0B71\u0B79\u0B81\u0B89\u0B91\u0B99\000\000"+ - "\u0BA1\u0BA9\u0BB1\u0BB9\u0BC1\u0BC9\u0BD1\u0BD9\u0BE1\u0BE9\uA5A5\004"+ - "\000\u0BF1\u0BF9\u0C01\u0C09\u0C11\u0C19\u0C21\u0C29\000\000\u0C31\u0C39"+ - "\u0C41\u0C49\u0C51\u0C59\u0C61\u0C69\u0C71\u0C79\u0C81\u0C89\u0C91\u0C99"+ - "\u0CA1\u0CA9\u0CB1\u0CB9\u0CC1\u0CC9\u0CD1\u0CD9\u0CE1\u0CE9\000\000\u0CF1"+ - "\u0CF9\u0D01\u0D09\u0D11\u0D19\u0D21\u0D29\u0D31\u0D39\u0D41\u0D49\u0D51"+ - "\u0D59\u0D61\u0D69\uA5A5\004\000\u0D71\u0D79\u0D81\u0D89\u0D91\u0D99\u0DA1"+ - "\u0DA9\u0DB1\u0DB9\u0DC1\u0DC9\u0DD1\u0DD9\u0DE1\u0DE9\u0DF1\u0DF9\u0E01"+ - "\u0E09\u0E11\u0E19\u0E21\u0E29\u0E31\u0E39\u0E41\u0E49\u0E51\u0E59\u0E61"+ - "\u0E69\u0E71\u0E79\u0E81\u0E89\u0E91\u0E99\000\000\u0EA1\u0EA9\u0EB1\u0EB9"+ - "\u0EC1\u0EC9\u0ED1\u0ED9\uA5A5\006\000\u0EE1\u0EE9\u0EF1\u0EF9\uA5A5\004"+ - "\000\u0F01\u0F09\u0F11\u0F19\u0688\u06A0\uA5A5\004\000\u0F21\u0F29\u0F31"+ - "\u0F39\u0F41\u0F49\u0F51\u0F59\u0F61\u0F69\u0F71\u0F79\u0F81\u0F89\u0F91"+ - "\u0F99\u0FA1\u0FA9\u0FB1\u0FB9\u0FC1\u0FC9\u0FD1\u0FD9\u0FE1\u0FE9\u0FF1"+ - "\u0FF9\u1001\u1009\u1011\u1019\u1021\u1029\u1031\u1039\u1041\u1049\u1051"+ - "\u1059\u1061\u1069\u1071\u1079\u1081\u1089\u1091\u1099\u10A1\u10A9\u10B1"+ - "\u10B9\u10C1\u10C9\u10D1\u10D9\u10E1\u10E9\u10F1\u10F9\u1101\u1109\u1111"+ - "\u1119\u1121\u1129\u1131\u1139\u1141\u1149\u1151\u1159\u1161\u1169\u1171"+ - "\u1179\u1181\u1189\u1191\u1199\u11A1\u11A9\u11B1\u11B9\000\000\u11C1\u11C9"+ - "\u11D1\u11D9\uA5A5\006\000\u11E1\u11E9\u11F1\u11F9\u1201\u1209\u1211\u1219"+ - "\u1221\u1229\u1231\u1239\u1241\u1249\u1251\u1259\u1261\u1269\uA5A5\006"+ - "\000\u1271\u1279\uA5A5\006\000\u1281\u1289\u1291\u1299\u12A1\u12A9\u12B1"+ - "\u12B9\u12C1\u12C9\u12D1\u12D9\u12E1\u12E9\u12F1\u12F9\u1301\u1309\uA5A5"+ - "\006\000\u1311\u1319\uA5A5\006\000\u1321\u1329\uA5A5\006\000\u1331\u1339"+ - "\uA5A5\006\000\u1341\u1349\uA5A5\007\000\u1351\uA5A5\006\000\u1359\u1361"+ - "\u1369\u1371\u1379\u1381\u1389\u1391\u1399\u13A1\u13A9\u13B1\u13B9\u13C1"+ - "\u13C9\u13D1\u13D9\u8B90\000\u8BA8\u13E1\u8BC0\000\u8BD8\000\u8BF0\000"+ - "\u8C08\u13E9\u8C20\000\000\u13F1\u13F9\uA5A5\006\000\u1401\u1409\uA5A5"+ - "\006\000\u1411\u1419\uA5A5\006\000\u1421\u1429\uA5A5\006\000\u1431\u1439"+ - "\uA5A5\006\000\u1441\u1449\uA5A5\011\000\u1451\000\000\u1459\uA5A5\004"+ - "\000\u8C38\u1461@\u8C50B\u06B8\u06D0\000\u1469\000\000\u1471\000\000\u8C60"+ - "\000\u8C78\u1479\u06F0\u0710\u0730\000\000\000\u8C90\uA5A5\007\000\u8CB0"+ - "\000\u0750\u0770\u0790\000\000\000\u8CC8\uA5A5\007\000\u8CE8\000\u07B0"+ - "\uA292\u8D00\000\000\000\u1481\000\000\u1489\000\000\u8D10\000\u8D28\u1491"+ - "\uA2A2Z\000\uA2B2\uA2C2\uA5A5\011p\uA5A5\006\000\u07D0\uA5A5\005\000\u07E0"+ - "\uA5A5\014\000\u07F8\u0808\u0820\uA5A5\010\000p\000\000\000\u0840\u0858"+ - "\000\u0878\u0890\uA5A5\004\000\u08B0\000\u08C8\uA5A5\011\000\u08E0\u08F8"+ - "\uA5A5&\000\u0910\000\000\000\u0138\u0920\u0930\u0940\u0950\u0960\u0970"+ - "\u0980\u0990\u09A0\u09B0\u01F0\u0910\u0108\u00A8\u00B8\u0138\u0920\u0930"+ - "\u0940\u0950\u0960\u0970\u0980\u0990\u09A0\u09B0\uA5A5\031\000\u09C0\uA5A5"+ - "'\000\u01BB\u01BB\u01DB\u01DB\uA5A5\004\u01BB\u01DB\u01DB\u01DB\u01BB"+ - "\u01BB\uA5A5\004\000\u01BB\uA5A5\036\000\u09D8\u09F8\u0A18\u0A28\000\u0A40"+ - "\u0A60\u0A80\000\u0A90\u0AA8\u0AB8\u0AB8\u0AB8\u0338\u0AC8\u0AD8\u0AD8"+ - "\u0AE8\u0458\000\u0AF8\u0B08\000\000\u0B20\u0B30\u0B40\u0B40\u0B40\000"+ - "\000\u0B50\u0B68\u0B88\000\u02F8\000\u8D40\000\u02F8\000\u8D50\u8D60\u0BA0"+ - "\u0A18\000\u0BB0\u0BC0\u0A98\000\u0B58\u0118\u0BD0\u0BE0\u0BF0\u0C00\u0C10"+ - "\uA5A5\031\000\u0C20\u0C40\u0C60\u0C80\u0CA0\u0CC0\u0CE0\u0D00\u0D20\u0D40"+ - "\u0D60\u0D80\u0DA0\u0AD8\u0DB8\u0DD0\u0DF0\u0DF8\u0E08\u0E20\u0E40\u0E68"+ - "\u0E70\u0E80\u0E98\u0AE8\u0A18\u0EB8\u0B58\u0C10\u0EC8\u0EE0\u0F00\u0F08"+ - "\u0F18\u0F30\u0F50\u0F78\u0468\u0F90\u0FA8\u0458\u09E8\u0FC8\u0FD8\uA5A5"+ - "\020\000\u1499\000\u14A1\000\u14A9\uA5A5\033\000\u14B1\000\u14B9\000\u14C1"+ - "\uA5A5\016\000\u14C9\uA5A5\004\000\u14D1\000\000\u14D9\uA5A5\027\000\u14E1"+ - "\000\u14E9\uA5A5\006\000\u0FE8\u1000\000\u1020\u1038\uA5A5\013\000\u14F1"+ - "\uA5A5\006\000\u14F9\000\u1501\000\000\u1509\uA5A5\004\000\u1511\uA5A5"+ - "\023\000\u1519\000\000\u1521\u1529\uA5A5\014\000\u1531\u1539\000\000\u1541"+ - "\u1549\000\000\u1551\u1559\u1561\u1569\uA5A5\004\000\u1571\u1579\000\000"+ - "\u1581\u1589\uA5A5\011\000\u1591\u1599\uA5A5\017\000\u15A1\uA5A5\005\000"+ - "\u15A9\u15B1\000\u15B9\uA5A5\006\000\u15C1\u15C9\u15D1\u15D9\uA5A5\023"+ - "\000\u8D78\u8D88\uA5A5\025\000\u0108\u00A8\u00B8\u0138\u0920\u0930\u0940"+ - "\u0950\u0960\u1058\u1070\u1088\u10A0\u10B8\u10D0\u10E8\u1100\u1118\u1130"+ - "\u1148\u1160\u1180\u11A0\u11C0\u11E0\u1200\u1220\u1240\u1260\u1280\u12A8"+ - "\u12D0\u12F8\u1320\u1348\u1370\u1398\u13C0\u13E8\u1410\u1438\u1450\u1468"+ - "\u1480\u1498\u14B0\u14C8\u14E0\u14F8\u1510\u1530\u1550\u1570\u1590\u15B0"+ - "\u15D0\u15F0\u1610\u1630\u1650\u1670\u1690\u16B0\u16D0\u16F0\u1710\u1730"+ - "\u1750\u1770\u1790\u17B0\u17D0\u17F0\u1810\u1830\u1850\u1870\u1890\u18B0"+ - "\u18D0\u18F0\u1910\u1930\u1950\u1970\u1990\u19B0\u0BA0\u0A18\u0EB8\u0BC0"+ - "\u0A98\u19C0\u0AB8\u0AD8\u0190\u19D0\u0AE8\u0B58\u0AF8\u19E0\u0B20\u0B30"+ - "\u0B40\u19F0\u1A00\u1A10\u0DF8\u1A20\u0E70\u1A30\u02F8\u0080\u1A40\u09E8"+ - "\u0FC8\u0BB0\u1A50\u0AA8\u0338\u0C10\u01A8\u1A60\u0458\u0FD8\u01F0\u0118"+ - "\u1A70\u1A80\u0358 \u1A90\u0A70\u0F08\u0398\u0468\u03A8\u0310\u0910\uA5A5"+ - "4\000\u1AA0\uA5A5\023\000\u1AB0\uA5A5\014\000\u1AC0\u1AD0\u1AE0\u1AF0"+ - "\u1B00\u1B10\u1B20\u1B30\u1B40\u1B50\u1B60\u1B70\u1B80\u1B90\u1BA0\u1BB0"+ - "\u1BC0\u1BD0\u1BE0\u1BF0\u1C00\u1C10\u1C20\u1C30\u1C40\u1C50\u1C60\u1C70"+ - "\u1C80\u1C90\u1CA0\u1CB0\u1CC0\u1CD0\u1CE0\u1CF0\u1D00\u1D10\u1D20\u1D30"+ - "\u1D40\u1D50\u1D60\u1D70\u1D80\u1D90\u1DA0\u1DB0\u1DC0\u1DD0\u1DE0\u1DF0"+ - "\u1E00\u1E10\u1E20\u1E30\u1E40\u1E50\u1E60\u1E70\u1E80\u1E90\u1EA0\u1EB0"+ - "\u1EC0\u1ED0\u1EE0\u1EF0\u1F00\u1F10\u1F20\u1F30\u1F40\u1F50\u1F60\u1F70"+ - "\u1F80\u1F90\u1FA0\u1FB0\u1FC0\u1FD0\u1FE0\u1FF0\u2000\u2010\u2020\u2030"+ - "\u2040\u2050\u2060\u2070\u2080\u2090\u20A0\u20B0\u20C0\u20D0\u20E0\u20F0"+ - "\u2100\u2110\u2120\u2130\u2140\u2150\u2160\u2170\u2180\u2190\u21A0\u21B0"+ - "\u21C0\u21D0\u21E0\u21F0\u2200\u2210\u2220\u2230\u2240\u2250\u2260\u2270"+ - "\u2280\u2290\u22A0\u22B0\u22C0\u22D0\u22E0\u22F0\u2300\u2310\u2320\u2330"+ - "\u2340\u2350\u2360\u2370\u2380\u2390\u23A0\u23B0\u23C0\u23D0\u23E0\u23F0"+ - "\u2400\u2410\u2420\u2430\u2440\u2450\u2460\u2470\u2480\u2490\u24A0\u24B0"+ - "\u24C0\u24D0\u24E0\u24F0\u2500\u2510\u2520\u2530\u2540\u2550\u2560\u2570"+ - "\u2580\u2590\u25A0\u25B0\u25C0\u25D0\u25E0\u25F0\u2600\u2610\u2620\u2630"+ - "\u2640\u2650\u2660\u2670\u2680\u2690\u26A0\u26B0\u26C0\u26D0\u26E0\u26F0"+ - "\u2700\u2710\u2720\u2730\u2740\u2750\u2760\u2770\u2780\u2790\u27A0\u27B0"+ - "\u27C0\u27D0\u27E0\u27F0\u2800\u2810\uA5A5\012\000p\uA5A5)\000\u0323\u01FB"+ - "\u01C3\u01F3\u032B\u032B\uA5A5\006\000\u2820\000\u1C30\u2830\u2840\uA5A5"+ - "\013\000\u15E1\uA5A5\004\000\u15E9\000\u15F1\000\u15F9\000\u1601\000\u1609"+ - "\000\u1611\000\u1619\000\u1621\000\u1629\000\u1631\000\u1639\000\u1641"+ - "\000\000\u1649\000\u1651\000\u1659\uA5A5\006\000\u1661\000\000\u1669\000"+ - "\000\u1671\000\000\u1679\000\000\u1681\uA5A5\035\000\u01AB\u01B3\u2850"+ - "\u2868\u1689\uA5A5\010\000\u1691\uA5A5\004\000\u1699\000\u16A1\000\u16A9"+ - "\000\u16B1\000\u16B9\000\u16C1\000\u16C9\000\u16D1\000\u16D9\000\u16E1"+ - "\000\u16E9\000\u16F1\000\000\u16F9\000\u1701\000\u1709\uA5A5\006\000\u1711"+ - "\000\000\u1719\000\000\u1721\000\000\u1729\000\000\u1731\uA5A5\023\000"+ - "\u1739\u1741\u1749\u1751\uA5A5\012\000\u1759\uA5A5\023\000\u2880\u2890"+ - "\u28A0\u28B0\u28C0\u28D0\u28E0\u28F0\u2900\u2910\u2920\u2930\u2940\u2950"+ - "\u2960\u2970\u2980\u2990\u29A0\u29B0\u29C0\u29D0\u29E0\u29F0\u2A00\u2A10"+ - "\u2A20\u2A30\u2A40\u2A50\u2A60\u2A70\u2A80\u2A90\u2AA0\u2AB0\u2AC0\u2AD0"+ - "\u2AE0\u2AF0\u2B00\u2B10\u2B20\u2B30\u2B40\u2B50\u2B60\u2B70\u2B80\u2B90"+ - "\u2BA0\u2BB0\u2BC0\u2BD0\u2BE0\u2BF0\u2C00\u2C10\u2C20\u2C30\u2C40\u2C50"+ - "\u2C60\u2C70\u2C80\u2C90\u2CA0\u2CB0\u2CC0\u2CD0\u2CE0\u2CF0\u2D00\u2D10"+ - "\u2D20\u2D30\u2D40\u2D50\u2D60\u2D70\u2D80\u2D90\u2DA0\u2DB0\u2DC0\u2DD0"+ - "\u2DE0\u2DF0\u2E00\u2E10\u2E20\u2E30\u2E40\u2E50\000\000\000\u1AC0\u1B20"+ - "\u2E60\u2E70\u2E80\u2E90\u2EA0\u2EB0\u1B00\u2EC0\u2ED0\u2EE0\u2EF0\u1B40"+ - "\u2F00\u2F20\u2F40\u2F60\u2F80\u2FA0\u2FC0\u2FE0\u3000\u3020\u3040\u3060"+ - "\u3080\u30A0\u30C0\u30E8\u3110\u3138\u3160\u3188\u31B0\u31D8\u3200\u3228"+ - "\u3250\u3278\u32A0\u32C8\u32F0\000\000\000\u3318\u3338\u3358\u3378\u3398"+ - "\u33B8\u33D8\u33F8\u3418\u3438\u3458\u3478\u3498\u34B8\u34D8\u34F8\u3518"+ - "\u3538\u3558\u3578\u3598\u35B8\u35D8\u35F8\u3618\u3638\u3658\u3678\u3698"+ - "\u36B8\u36D8\u36F8\u3718\u3738\u3758\u3778\uA5A5\034\000\u2880\u28B0\u28E0"+ - "\u2900\u2980\u2990\u29C0\u29E0\u29F0\u2A10\u2A20\u2A30\u2A40\u2A50\u3798"+ - "\u37B0\u37C8\u37E0\u37F8\u3810\u3828\u3840\u3858\u3870\u3888\u38A0\u38B8"+ - "\u38D0\uA5A5\004\000\u1AC0\u1B20\u2E60\u2E70\u38E8\u38F8\u3908\u1B70\u3918"+ - "\u1C30\u1F50\u2010\u2000\u1F60\u2520\u1CB0\u1F30\u3928\u3938\u3948\u3958"+ - "\u3968\u3978\u3988\u3998\u39A8\u39B8\u1D10\u39C8\u39D8\u39E8\u39F8\u3A08"+ - "\u3A18\u3A28\u3A38\u2E80\u2E90\u2EA0\u3A48\u3A58\u3A68\u3A78\u3A88\u3A98"+ - "\u3AA8\u3AB8\u3AC8\u3AD8\uA5A5\017\000\u3AE8\u3B00\u3B18\u3B30\u3B48\u3B60"+ - "\u3B78\u3B90\u3BA8\u3BC0\u3BE0\u3C00\uA5A5\004\000\u3C20\u3C30\u3C40\u3C50"+ - "\u3C60\u3C70\u3C80\u3C90\u3CA0\u3CB0\u3CC0\u3CD0\u3CE0\u3CF0\u3D00\u3D10"+ - "\u3D20\u3D30\u3D40\u3D50\u3D60\u3D70\u3D80\u3D90\u3DA0\u3DB0\u3DC0\u3DD0"+ - "\u3DE0\u3DF0\u3E00\u3E10\u3E20\u3E30\u3E40\u3E50\u3E60\u3E70\u3E80\u3E90"+ - "\u3EA0\u3EB0\u3EC0\u3ED0\u3EE0\u3EF0\u3F00\000\u3F10\u3F40\u3F68\u3F98"+ - "\u3FB8\u3FE8\u4008\u4028\u4060\u4088\u40A8\u40C8\u40E8\u4110\u4138\u4160"+ - "\u4188\u41B0\u41D8\u4200\u4238\u4250\u4288\u42C0\u4260\u42F0\u4328\u4360"+ - "\u4388\u43A8\u43C8\u43F0\u4418\u4448\u4478\u4498\u44B8\u44E0\u4500\u4310"+ - "\u4520\u4538\u4558\u4578\u45B0\u45D8\u4608\u4640\u4668\u4688\u46A8\u46E0"+ - "\u4708\u4740\u4760\u4790\u47B0\u47D8\u47F8\u4820\u4850\u4878\u48A8\u48D0"+ - "\u48E8\u4918\u4938\u4958\u4980\u49A0\u49C0\u49E0\u4A10\u4A38\u4A50\u4A88"+ - "\u4AA8\u4298\u4AD8\u4B00\u4B20\u4B40\u4B68\u4B80\u4BA8\u4BD8\u4BF0\u42D0"+ - "\u4C28\u4C40\u4C58\u4C70\u4C88\u4CA0\u4CB8\u4CD0\u4CE8\u4D00\u4D18\u4D38"+ - "\u4D58\u4D78\u4D98\u4DB8\u4DD8\u4DF8\u4E18\u4E38\u4E58\u4E78\u4E98\u4EB8"+ - "\u4ED8\u4EF8\u4F18\u4F30\u4F48\u4F68\u4F80\uA5A5\004\000\u4F98\u4FB0\u4FC8"+ - "\u4FE0\u4FF8\u5020\u5038\u5050\u5068\u5080\u5098\u50B0\u50C8\u50E0\u5100"+ - "\u5128\u5140\u5158\u5170\u5188\u51A0\u51B8\u51D0\u51F0\u5210\u5230\u5250"+ - "\u5268\u5280\u5298\u52B0\u52C8\u52E0\u52F8\u5310\u5328\u5340\u5360\u5348"+ - "\u5380\u53A0\u53C0\u53A8\u53E0\u5400\u5420\u4F00\u5448\u5468\u5488\u54A8"+ - "\u54C8\u54F8\u5530\u5548\u5560\u5578\u5590\u55A8\u55C0\u55D8\u55F0\u5608"+ - "\u5620\u5638\u5650\u5668\u5680\u5698\u56B0\u56C8\u56E0\u5708\u5720\u5738"+ - "\u5750\u5778\u5798\u57B0\u57C8\u57E0\u57F8\u5810\u5828\u5840\u5858\u5870"+ - "\u5888\u58A8\u58C0\u58D8\u58F8\u5918\u5930\u5958\u5978\u5990\u59A8\u59C0"+ - "\000\000\u59D8\u59F0\u5A08\u5A20\u5A38\u5A50\u5A68\u5A80\u5A98\u5AB0\u5AD0"+ - "\u5AF0\u5B10\u5B30\u5B50\u5B70\u5B90\u5BB0\u5BD0\u5BF0\u5C10\u5C30\u5C50"+ - "\u5C70\u5C90\u5CB0\u5CD0\u5CF0\u5D10\u5D30\u5D50\000\uA5A5%\007\uA5A5"+ - "\033\000\u8D98\u8DA8\u8DB8\u8DC8\u8DD8\u8DE8\u8DF8\u8E08\u8E18\u8E28\u8E38"+ - "\u8E48\u8E58\u8E68\u8E78\u8E88\u8E98\u8EA8\u8EB8\u8EC8\u8ED8\u8EE8\u8EF8"+ - "\u8F08\u8F18\u8F28\u8F38\u8F48\u8F58\u8F68\u8F78\u8F88\u8F98\u8FA8\u8FB8"+ - "\u8FC8\u8FD8\u8FE8\u8FF8\u9008\u9018\u9028\u9038\u9048\u9058\u9068\u9078"+ - "\u9088\u9098\u90A8\u90B8\u90C8\u90D8\u90E8\u90F8\u9108\u9118\u9128\u9138"+ - "\u9148\u9158\u9168\u9178\u9188\u9198\u91A8\u91B8\u91C8\u91D8\u91E8\u91F8"+ - "\u9208\u9218\u9228\u9238\u9248\u9258\u9268\u9278\u9288\u9298\u92A8\u92B8"+ - "\u92C8\u92D8\u92E8\u92F8\u9308\u9318\u9328\u9338\u9348\u8ED8\u9358\u9368"+ - "\u9378\u9388\u9398\u93A8\u93B8\u93C8\u93D8\u93E8\u93F8\u9408\u9418\u9428"+ - "\u9438\u9448\u9458\u9468\u9478\u9488\u9498\u94A8\u94B8\u94C8\u94D8\u94E8"+ - "\u94F8\u9508\u9518\u9528\u9538\u9548\u9558\u9568\u9578\u9588\u9598\u95A8"+ - "\u95B8\u95C8\u95D8\u95E8\u95F8\u9608\u9618\u9628\u9638\u9648\u9658\u9668"+ - "\u9678\u9688\u9698\u96A8\u96B8\u96C8\u96D8\u96E8\u96F8\u9708\u9718\u9728"+ - "\u9738\u9748\u9758\u9768\u9778\u9788\u9478\u9798\u97A8\u97B8\u97C8\u97D8"+ - "\u97E8\u97F8\u9808\u9378\u9818\u9828\u9838\u9848\u9858\u9868\u9878\u9888"+ - "\u9898\u98A8\u98B8\u98C8\u98D8\u98E8\u98F8\u9908\u9918\u9928\u9938\u9948"+ - "\u8ED8\u9958\u9968\u9978\u9988\u9998\u99A8\u99B8\u99C8\u99D8\u99E8\u99F8"+ - "\u9A08\u9A18\u9A28\u9A38\u9A48\u9A58\u9A68\u9A78\u9A88\u9A98\u9AA8\u9AB8"+ - "\u9AC8\u9AD8\u9AE8\u9AF8\u9398\u9B08\u9B18\u9B28\u9B38\u9B48\u9B58\u9B68"+ - "\u9B78\u9B88\u9B98\u9BA8\u9BB8\u9BC8\u9BD8\u9BE8\u9BF8\u9C08\u9C18\u9C28"+ - "\u9C38\u9C48\u9C58\u9C68\u9C78\u9C88\u9C98\u9CA8\u9CB8\u9CC8\u9CD8\u9CE8"+ - "\u9CF8\u9D08\u9D18\u9D28\u9D38\u9D48\u9D58\u9D68\u9D78\u9D88\u9D98\u9DA8"+ - "\u9DB8\u9DC8\u9DD8\u9DE8\u9DF8\u9E08\u9E18\000\000\u9E28\000\u9E38\000"+ - "\000\u9E48\u9E58\u9E68\u9E78\u9E88\u9E98\u9EA8\u9EB8\u9EC8\u9ED8\000\u9EE8"+ - "\000\u9EF8\000\000\u9F08\u9F18\000\000\000\u9F28\u9F38\u9F48\u9F58\uA5A5"+ - "\022\000\u5D70\u5D88\u5DA0\u5DB8\u5DD8\u5DF8\u5DF8\uA5A5\014\000\u5E10"+ - "\u5E28\u5E40\u5E58\u5E70\uA5A5\006\000\u0333\u9F68\u5E88\u0BD0\u0C00\u5E98"+ - "\u5EA8\u5EB8\u5EC8\u5ED8\u5EE8\u0970\u9F80\u9F98\u9FB0\u9FD0\u9FF0\uA008"+ - "\uA020\uA038\uA050\uA068\uA080\uA098\uA0B0\000\uA0C8\uA0E0\uA0F8\uA110"+ - "\uA128\000\uA140\000\uA158\uA170\000\uA188\uA1A0\000\uA1B8\uA1D0\uA1E8"+ - "\uA200\uA218\uA230\uA248\uA260\uA278\u5EF8\u5F10\u5F10\uA5A5\004\u5F20"+ - "\uA5A5\004\u5F30\uA5A5\004\u5F40\uA5A5\004\u5F50\uA5A5\004\u5F60\uA5A5"+ - "\004\u5F70\uA5A5\004\u5F80\uA5A5\004\u5F90\uA5A5\004\u5FA0\uA5A5\004\u5FB0"+ - "\uA5A5\004\u5FC0\uA5A5\004\u5FD0\u5FE0\u5FE0\u5FF0\u5FF0\u6000\u6000\u6010"+ - "\u6010\u6020\u6020\u6030\u6030\uA5A5\004\u6040\uA5A5\004\u6050\uA5A5\004"+ - "\u6060\uA5A5\004\u6070\u6080\u6080\uA5A5\004\u6090\u60A0\u60A0\uA5A5\004"+ - "\u60B8\uA5A5\004\u60C8\u60D8\u60D8\u60E8\u60E8\uA5A5!\000\uA5A5\004\u6100"+ - "\u6110\u6110\u6120\u6120\u6130\u6130\u05A8\u6140\u6140\u6150\u6150\u6160"+ - "\u6160\uA5A5\004\u6170\u6180\u6180\u6190\u6190\u61B0\u61B0\u61D0\u61D0"+ - "\u61F0\u61F0\u6210\u6210\u6230\u6230\u6250\u6250\u6250\u6270\u6270\u6270"+ - "\uA5A5\004\u6290\u62A0\u62C0\u62E0\u6270\u6300\u6320\u6338\u6350\u6368"+ - "\u6380\u6398\u63B0\u63C8\u63E0\u63F8\u6410\u6428\u6440\u6458\u6470\u6488"+ - "\u64A0\u64B8\u64D0\u64E8\u6500\u6518\u6530\u6548\u6560\u6578\u6590\u65A8"+ - "\u65C0\u65D8\u65F0\u6608\u6620\u6638\u6650\u6668\u6680\u6698\u66B0\u66C8"+ - "\u66E0\u66F8\u6710\u6728\u6740\u6758\u6770\u6788\u67A0\u67B8\u67D0\u67E8"+ - "\u6800\u6818\u6830\u6848\u6860\u6878\u6890\u68A8\u68C0\u68D8\u68F0\u6908"+ - "\u6920\u6938\u6950\u6968\u6980\u6998\u69B0\u69C8\u69E0\u69F8\u6A10\u6A28"+ - "\u6A40\u6A58\u6A70\u6A88\u6AA0\u6AB8\u6AD0\u6AE8\u6B00\u6B18\u6B30\u6B48"+ - "\u6B60\u6B78\u6B98\u6BB8\u6BD8\u6BF8\u6C18\u6C38\u6C58\u62E0\u6C78\u6270"+ - "\u6300\u6C98\u6CB0\u6368\u6CC8\u6380\u6398\u6CE0\u6CF8\u63F8\u6D10\u6410"+ - "\u6428\u6D28\u6D40\u6458\u6D58\u6470\u6488\u6740\u6758\u67A0\u67B8\u67D0"+ - "\u6830\u6848\u6860\u6878\u68D8\u68F0\u6908\u6D70\u6968\u6D88\u6DA0\u69F8"+ - "\u6DB8\u6A10\u6A28\u6B60\u6DD0\u6DE8\u6AE8\u6E00\u6B00\u6B18\u62A0\u62C0"+ - "\u6E18\u62E0\u6E38\u6320\u6338\u6350\u6368\u6E58\u63B0\u63C8\u63E0\u63F8"+ - "\u6E70\u6458\u64A0\u64B8\u64D0\u64E8\u6500\u6530\u6548\u6560\u6578\u6590"+ - "\u65A8\u6E88\u65C0\u65D8\u65F0\u6608\u6620\u6638\u6668\u6680\u6698\u66B0"+ - "\u66C8\u66E0\u66F8\u6710\u6728\u6770\u6788\u67E8\u6800\u6818\u6830\u6848"+ - "\u6890\u68A8\u68C0\u68D8\u6EA0\u6920\u6938\u6950\u6968\u69B0\u69C8\u69E0"+ - "\u69F8\u6EB8\u6A40\u6A58\u6ED0\u6AA0\u6AB8\u6AD0\u6AE8\u6EE8\u62E0\u6E38"+ - "\u6368\u6E58\u63F8\u6E70\u6458\u6F00\u6590\u6F18\u6F30\u6F48\u6830\u6848"+ - "\u68D8\u69F8\u6EB8\u6AE8\u6EE8\u6F60\u6F80\u6FA0\u6FC0\u6FD8\u6FF0\u7008"+ - "\u7020\u7038\u7050\u7068\u7080\u7098\u70B0\u70C8\u70E0\u70F8\u7110\u7128"+ - "\u7140\u7158\u7170\u7188\u71A0\u71B8\u71D0\u6F30\u71E8\u7200\u7218\u7230"+ - "\u6FC0\u6FD8\u6FF0\u7008\u7020\u7038\u7050\u7068\u7080\u7098\u70B0\u70C8"+ - "\u70E0\u70F8\u7110\u7128\u7140\u7158\u7170\u7188\u71A0\u71B8\u71D0\u6F30"+ - "\u71E8\u7200\u7218\u7230\u71A0\u71B8\u71D0\u6F30\u6F18\u6F48\u6650\u6548"+ - "\u6560\u6578\u71A0\u71B8\u71D0\u6650\u6668\u7248\u7248\uA5A5\022\000\u7260"+ - "\u7280\u7280\u72A0\u72C0\u72E0\u7300\u7320\u7340\u7340\u7360\u7380\u73A0"+ - "\u73C0\u73E0\u7400\u7400\u7420\u7440\u7440\u7460\u7460\u7480\u74A0\u74A0"+ - "\u74C0\u74E0\u74E0\u7500\u7500\u7520\u7540\u7540\u7560\u7560\u7580\u75A0"+ - "\u75C0\u75E0\u75E0\u7600\u7620\u7640\u7660\u7680\u7680\u76A0\u76C0\u76E0"+ - "\u7700\u7720\u7740\u7740\u7760\u7760\u7780\u7780\u77A0\u77C0\u77E0\u7800"+ - "\u7820\u7840\u7860\000\000\u7880\u78A0\u78C0\u78E0\u7900\u7920\u7920\u7940"+ - "\u7960\u7980\u79A0\u79A0\u79C0\u79E0\u7A00\u7A20\u7A40\u7A60\u7A80\u7AA0"+ - "\u7AC0\u7AE0\u7B00\u7B20\u7B40\u7B60\u7B80\u7BA0\u7BC0\u7BE0\u7C00\u7C20"+ - "\u7C40\u7C60\u76A0\u76E0\u7C80\u7CA0\u7CC0\u7CE0\u7D00\u7D20\u7D00\u7CC0"+ - "\u7D40\u7D60\u7D80\u7DA0\u7DC0\u7D20\u75C0\u7480\u7DE0\u7E00\uA5A5(\000"+ - "\u7E20\u7E40\u7E60\u7E88\u7EB0\u7ED8\u7F00\u7F28\u7F50\u7F78\u7F98\u8030"+ - "\uA5A5\004\000\uA5A5\004\u01BB\uA5A5\014\000\u0808\u8078\u8088\u8098\u8098"+ - "\u09A0\u09B0\u80A8\u80B8\u80C8\u80D8\u80E8\u80F8\u8108\u8118\u8128\u8138"+ - "\u8148\u8158\u8168\u8178\uA5A5\004\000\uA5A5\004\u08C8\u8098\u8098\u8098"+ - "\u8188\u8198\u07F8\000\u81A8\u81B8\u0900\u08B8\u8078\u09A0\u09B0\u80A8"+ - "\u80B8\u80C8\u80D8\u81C8\u81D8\u81E8\u0970\u81F8\u8208\u8218\u0990\000"+ - "\u8228\u8238\u8248\u8258\uA5A5\004\000\u8268\u8280\u8298\000\u82B0\000"+ - "\u82C8\u82E0\u82F8\u8310\u8328\u8340\u8358\u8370\u8388\u83A0\u83B8\u83C8"+ - "\u83C8\u83E0\u83E0\u83F8\u83F8\u8410\u8410\uA5A5\004\u8428\u61A0\u61A0"+ - "\uA5A5\004\u8440\u8450\u8450\uA5A5\004\u8460\uA5A5\004\u8470\uA5A5\004"+ - "\u62B0\uA5A5\004\u62D0\uA5A5\004\u6358\u7EC8\u7EC8\u8480\u8480\u6C48\u6C48"+ - "\u6C68\u6C68\uA5A5\004\u8490\uA5A5\004\u84A0\uA5A5\004\u84B0\uA5A5\004"+ - "\u84C0\uA5A5\004\u84D0\uA5A5\004\u84E0\uA5A5\004\u84F0\uA5A5\004\u8500"+ - "\uA5A5\004\u8510\uA5A5\004\u8520\uA5A5\004\u8530\uA5A5\004\u6838\uA5A5"+ - "\004\u62F0\uA5A5\004\u6C88\uA5A5\004\u6E48\u61E0\u61E0\u6180\u6180\uA5A5"+ - "\004\u6310\u8540\u8540\u8560\u8560\u8580\u8580\u85A0\u85A0\uA5A5\004\000"+ - "\u08B8\u85B8\u81C8\u8238\u8248\u81D8\u85C8\u09A0\u09B0\u81E8\u0970\u8188"+ - "\u81F8\u07F8\u85D8\u0910\u0108\u00A8\u00B8\u0138\u0920\u0930\u0940\u0950"+ - "\u0960\u81B8\u81A8\u8208\u0990\u8218\u0900\u8258\u19B0\u0BA0\u0A18\u0EB8"+ - "\u0BC0\u0A98\u19C0\u0AB8\u0AD8\u0190\u19D0\u0AE8\u0B58\u0AF8\u19E0\u0B20"+ - "\u0B30\u0B40\u19F0\u1A00\u1A10\u0DF8\u1A20\u0E70\u1A30\u02F8\u85E8\u8228"+ - "\u85F8\u8608\u8098\u8618\u0080\u1A40\u09E8\u0FC8\u0BB0\u1A50\u0AA8\u0338"+ - "\u0C10\u01A8\u1A60\u0458\u0FD8\u01F0\u0118\u1A70\u1A80\u0358 \u1A90\u0A70"+ - "\u0F08\u0398\u0468\u03A8\u0310\u80A8\u8628\u80B8\u8638\000\000\u8648\u8148"+ - "\u8158\u8198\u8658\u3F00\u3F58\u8668\u8678\u8688\u8698\u86A8\u86B8\u86C8"+ - "\u86D8\u4078\u3C20\u3C30\u3C40\u3C50\u3C60\u3C70\u3C80\u3C90\u3CA0\u3CB0"+ - "\u3CC0\u3CD0\u3CE0\u3CF0\u3D00\u3D10\u3D20\u3D30\u3D40\u3D50\u3D60\u3D70"+ - "\u3D80\u3D90\u3DA0\u3DB0\u3DC0\u3DD0\u3DE0\u3DF0\u3E00\u3E10\u3E20\u3E30"+ - "\u3E40\u3E50\u3E60\u3E70\u3E80\u3E90\u3EA0\u3EB0\u3EC0\u3ED0\u4018\u2858"+ - "\u2870\u2BB0\u2880\u2890\u28A0\u28B0\u28C0\u28D0\u28E0\u28F0\u2900\u2910"+ - "\u2920\u2930\u2940\u2950\u2960\u2970\u2980\u2990\u29A0\u29B0\u29C0\u29D0"+ - "\u29E0\u29F0\u2A00\u2A10\u2A20\u2A30\u2A40\u2A50\000\000\000\u2A60\u2A70"+ - "\u2A80\u2A90\u2AA0\u2AB0\000\000\u2AC0\u2AD0\u2AE0\u2AF0\u2B00\u2B10\000"+ - "\000\u2B20\u2B30\u2B40\u2B50\u2B60\u2B70\000\000\u2B80\u2B90\u2BA0\000"+ - "\000\000\u86E8\u86F8\u8708\u0090\u8718\u8728\u8738\000\u8748\u8758\u8768"+ - "\u8778\u8788\u8798\u87A8\uA5A5\021\000" - ); - - static final CompactCharArray actions = new CompactCharArray( - "\000\u0800\uA5A5 \000 @`\u0080\u00A0\u00C0\u00E0\000\u0100\u0120\u0140"+ - "\uA5A5\006\000\u0160\u0180\u01A0\u01C0\uA5A5\013\000\u01E0\u0200\u0220"+ - "\u0240\u0260\u0280\u02A0\000\u02C0\u02E0\u0300\uA5A5\006\000\u0320\u0340"+ - "\u0360\u0380\uA5A5\013\000\u03A0\u03C0\uA5A5\015\000\u03E0\u0400\uA5A5"+ - "\017\000\u0420\u0440\u0460\u0480\000\000\u04A0\uA5A5\031\000\u04C0\u04E0"+ - "\u0500\u0520\000\000\000\u0540\u0560\u0580\u05A0\000\u05C0\u05E0\uA5A5"+ - "\006\000\u0600\uA5A5\013\000\u0620\u0640\uA5A5\006\000\u0660\u0680\u06A0"+ - "\uA5A5\004\000\u06C0\uA5A5\004\000\u06E0\uA5A5\013\000\u0700\u0720\000"+ - "\000\000\u0740\uA5A5\007\000\u0760\uA5A5\022\000\u0780\u07A0\u07C0\u07E0"+ - "\000\u0800\000\000\u0820\u0840\u0860\uA5A5\025\000\u0880\u08A0\u08C0\u08E0"+ - "\000\000\u0900\uA5A5\031\000\u0920\u0940\uA5A5\036\000\u0960\u0980\uA5A5"+ - "\007\000\u09A0\u09C0\uA5A5\025\000\u09E0\u0A00\u0A20\u0A40\000\000\u0A60"+ - "\000\u0A80\uA5A5\027\000\u0AA0\u0AC0\uA5A5\010\000\u0AE0\uA5A5\025\000"+ - "\u0B00\u0B20\uA5A5&\000\u0B40\u0B60\uA5A5\012\000\u0B80\uA5A5\023\000"+ - "\u0BA0\u0BC0\uA5A5\012\000\u0BE0\uA5A5\013\000\u0C00\u0C20\u0C40\u0C60"+ - "\000\u0C80\u0CA0\u0CC0\u0CE0\uA5A5\004\000\u0D00\u0D20\000\u0D40\u0D60"+ - "\uA5A5\016\000\u0D80\u0DA0\u0DC0\u0DE0\u0E00\u0E20\u0E40\u0E60\u0E80\000"+ - "\000\u0EA0\u0EC0\u0EE0\u0F00\u0F20\u0F40\u0F60\uA5A5\016\000\u0F80\u0FA0"+ - "\u0FC0\u0FE0\000\u1000\u1020\000\u1040\uA5A5\005\000\u1060\000\000\u1080"+ - "\uA5A5\016\000\u10A0\u10C0\u10E0\u1100\000\000\u1120\u1140\u1160\uA5A5"+ - "\006\000\u1180\uA5A5\020\000\u11A0\u11C0\000\000\000\u11E0\uA5A5\007\000"+ - "\u1200\u1220\u1240\uA5A5\020\000\u1260\u1280\u12A0\u12C0\u12E0\u1300\000"+ - "\u1320\u1340\000\000\u1360\u1380\u13A0\u13C0\u13E0\u1400\uA5A5\017\000"+ - "\u1420\u1440\u1460\u1480\u14A0\u14C0\u14E0\u1500\u1520\000\000\u1540\u1560"+ - "\u1580\u15A0\u15C0\u15E0\u1600\uA5A5\016\000\u1620\u1640\u1660\u1680\u16A0"+ - "\u16C0\u16E0\u1700\u1720\000\000\u1740\u1760\000\u1780\u17A0\u17C0\u17E0"+ - "\uA5A5\016\000\u1800\u1820\000\000\u1840\000\000\000\u1860\000\000\000"+ - "\u1880\uA5A5\023\000\u18A0\u18C0\u18E0\u1900\u1920\u1940\u1960\u1980\u19A0"+ - "\000\000\u19C0\u19E0\000\u1A00\u1A20\u1A40\u1A60\uA5A5\016\000\u1A80\u1AA0"+ - "\u1AC0\u1AE0\u1B00\u1B20\u1B40\u1B60\u1B80\000\000\u1BA0\u1BC0\u1BE0\u1C00"+ - "\u1C20\uA5A5\020\000\u1C40\uA5A5\023\000\u1C60\u1C80\uA5A5\012\000\u1CA0"+ - "\uA5A5\010\000\u1CC0\uA5A5\007\000\u1CE0\u1D00\u1D20\u1D40\uA5A5\023\000"+ - "\u1D60\u1D80\uA5A5\007\000\u1DA0\u1DC0\u1DE0\u1E00\uA5A5\025\000\u1E20"+ - "\uA5A5\037\000\u1E40\uA5A5\037\000\u1E60\uA5A5\037\000\u1E80\uA5A5\037"+ - "\000\u1EA0\uA5A5\037\000\u1EC0\uA5A5\037\000\u1EE0\uA5A5\037\000\u1F00"+ - "\uA5A5\037\000\u1F20\uA5A5\037\000\u1F40\uA5A5\037\000\u1F60\uA5A5\037"+ - "\000\u1F80\uA5A5 \000\u1FA0\uA5A5\037\000\u1FC0\uA5A5\037\000\u1FE0\uA5A5"+ - "\037\000\u2000\uA5A5\037\000\u2020\uA5A5\037\000\u2040\uA5A5\037\000\u2060"+ - "\uA5A5\037\000\u2080\uA5A5\037\000\u20A0\uA5A5\037\000\u20C0\uA5A5)\000"+ - "\u20E0\u2100\u2120\uA5A5\036\000\u2140\u2160\uA5A5\u0128\000" - , - "\000\u2180\uA5A5!\000\u1FED\uA5A5\005\000\u00C0\u1FCD\000\000\u1FDD\000"+ - "\u00C8\000\000\000\u00CC\uA5A5\004\000\u01F8\u00D2\uA5A5\004\000\u00D9"+ - "\000\u1E80\000\u1EF2\000\u00E0\000\000\000\u00E8\000\000\000\u00EC\uA5A5"+ - "\004\000\u01F9\u00F2\uA5A5\004\000\u00F9\000\u1E81\000\u1EF3\000\000\000"+ - "\u1EA6\uA5A5\007\000\u1EC0\uA5A5\010\000\u1ED2\uA5A5\006\000\u01DB\000"+ - "\000\000\u1EA7\uA5A5\007\000\u1EC1\uA5A5\010\000\u1ED3\uA5A5\006\000\u01DC"+ - "\uA5A5\004\000\u1EB0\u1EB1\uA5A5\012\000\u1E14\u1E15\uA5A5\035\000\u1E50"+ - "\u1E51\uA5A5%\000\u1EDC\u1EDD\u1EEA\u1EEB\uA5A5.\000\u1FBA\u1FC8\u1FCA"+ - "\u1FDA\u1FF8\000\u1FEA\u1FFA\000\000\u1F70\u1F72\u1F74\u1F76\u1F78\000"+ - "\u1F7A\u1F7C\u1FD2\u1FE2\uA5A5\004\000\u0400\000\000\u040D\uA5A5\010\000"+ - "\u0450\000\000\u045D\uA5A5:\000\u1F02\u1F03\uA5A5\006\000\u1F0A\u1F0B"+ - "\uA5A5\006\000\u1F12\u1F13\u1F1A\u1F1B\u1F22\u1F23\uA5A5\006\000\u1F2A"+ - "\u1F2B\uA5A5\006\000\u1F32\u1F33\u1F3A\u1F3B\u1F42\u1F43\u1F4A\u1F4B\u1F52"+ - "\u1F53\u1F5B\u1F62\u1F63\uA5A5\006\000\u1F6A\u1F6B\uA5A5\011\000\u1F82"+ - "\u1F83\u1F8A\u1F8B\u1F92\u1F93\u1F9A\u1F9B\u1FA2\u1FA3\u1FAA\u1FAB\u1FB2"+ - "\000\uFE8E\u1FC2\000\uFE17\u1FF2\000\uFBC6\uA5A5\016\000\u0385\uA5A5\004"+ - "\000\u03D3\u00C1\u1FCE\000\u0106\u1FDE\000\u00C9\000\u01F4\000\u00CD\000"+ - "\u1E30\u0139\u1E3E\u0143\u00D3\u1E54\u0154\u015A\000\u00DA\000\u1E82\000"+ - "\u00DD\u0179\u00E1\000\u0107\000\u00E9\000\u01F5\000\u00ED\000\u1E31\u013A"+ - "\u1E3F\u0144\u00F3\u1E55\u0155\u015B\000\u00FA\000\u1E83\000\u00FD\u017A"+ - "\000\000\u1EA4\000\000\u01FA\u01FC\u1E08\000\000\u1EBE\uA5A5\004\000\u1E2E"+ - "\000\000\000\u1ED0\u1E4C\000\u01FE\000\000\000\u01D7\000\000\000\u1EA5"+ - "\000\000\u01FB\u01FD\u1E09\000\000\u1EBF\uA5A5\004\000\u1E2F\000\000\000"+ - "\u1ED1\u1E4D\000\u01FF\000\000\000\u01D8\uA5A5\004\000\u1EAE\u1EAF\uA5A5"+ - "\012\000\u1E16\u1E17\uA5A5\035\000\u1E52\u1E53\uA5A5\020\000\u1E78\u1E79"+ - "\uA5A5\023\000\u1EDA\u1EDB\u1EE8\u1EE9\uA5A5.\000\u0386\u0388\u0389\u038A"+ - "\u038C\000\u038E\u038F\000\000\u03AC\u03AD\u03AE\u03AF\u03CC\000\u03CD"+ - "\u03CE\u0390\u03B0\000\000\000\u0403\uA5A5\004\000\u040C\uA5A5\006\000"+ - "\u0453\uA5A5\004\000\u045C\uA5A59\000\u1F04\u1F05\uA5A5\006\000\u1F0C"+ - "\u1F0D\uA5A5\006\000\u1F14\u1F15\u1F1C\u1F1D\u1F24\u1F25\uA5A5\006\000"+ - "\u1F2C\u1F2D\uA5A5\006\000\u1F34\u1F35\u1F3C\u1F3D\u1F44\u1F45\u1F4C\u1F4D"+ - "\u1F54\u1F55\u1F5D\u1F64\u1F65\uA5A5\006\000\u1F6C\u1F6D\uA5A5\011\000"+ - "\u1F84\u1F85\u1F8C\u1F8D\u1F94\u1F95\u1F9C\u1F9D\u1FA4\u1FA5\u1FAC\u1FAD"+ - "\u1FB4\000\uFE8D\u1FC4\000\uFE16\u1FF4\000\uFBC5\uA5A5\024\000\u00C2\000"+ - "\000\u0108\000\000\u00CA\000\u011C\u0124\u00CE\u0134\uA5A5\004\000\u00D4"+ - "\000\000\u015C\000\u00DB\000\u0174\000\u0176\u1E90\u00E2\000\u0109\000"+ - "\u00EA\000\u011D\u0125\u00EE\u0135\uA5A5\004\000\u00F4\000\000\u015D\000"+ - "\u00FB\000\u0175\000\u0177\u1E91\uA5A5\011\000\u1EAC\u1EAD\uA5A5\026\000"+ - "\u1EC6\u1EC7\uA5A5\022\000\u1ED8\u1ED9\uA5A5\025\000\u00C3\uA5A5\005\000"+ - "\u1EBC\000\000\000\u0128\uA5A5\004\000\u00D1\u00D5\uA5A5\004\000\u0168"+ - "\u1E7C\000\000\u1EF8\000\u00E3\000\000\000\u1EBD\000\000\000\u0129\uA5A5"+ - "\004\000\u00F1\u00F5\uA5A5\004\000\u0169\u1E7D\000\000\u1EF9\000\000\000"+ - "\u1EAA\uA5A5\007\000\u1EC4\uA5A5\010\000\u1ED6\uA5A5\012\000\u1EAB\uA5A5"+ - "\007\000\u1EC5\uA5A5\010\000\u1ED7\uA5A5\013\000\u1EB4\u1EB5\uA5A5\020"+ - "\000\u1EE0\u1EE1\u1EEE\u1EEF\uA5A5\033\000\u0100\uA5A5\005\000\u0112\000"+ - "\u1E20\000\u012A\uA5A5\005\000\u014C\uA5A5\004\000\u016A\000\000\000\u0232"+ - "\000\u0101\000\000\000\u0113\000\u1E21\000\u012B\uA5A5\005\000\u014D\uA5A5"+ - "\004\000\u016B\000\000\000\u0233\uA5A5\005\000\u01DE\000\u01E2\uA5A5\015"+ - "\000\u022C\u022A\uA5A5\004\000\u01D5\uA5A5\005\000\u01DF\000\u01E3\uA5A5"+ - "\015\000\u022D\u022B\uA5A5\004\000\u01D6\uA5A5\023\000\u01EC\u01ED\uA5A5"+ - "$\000\u01E0\u01E1\uA5A5\006\000\u0230\u0231\uA5A5\005\000\u1FB9\000\000"+ - "\u1FD9\000\000\u1FE9\000\000\000\u1FB1\000\000\u1FD1\000\000\u1FE1\uA5A5"+ - "\012\000\u04E2\000\000\u04EE\uA5A5\010\000\u04E3\000\000\u04EF\uA5A5-"+ - "\000\u1E38\u1E39\uA5A5\034\000\u1E5C\u1E5D\uA5A5\030\000\uFED5\000\uFE8C"+ - "\uA5A5\032\000\u0102\uA5A5\005\000\u0114\000\u011E\000\u012C\uA5A5\005"+ - "\000\u014E\uA5A5\004\000\u016C\uA5A5\005\000\u0103\000\000\000\u0115\000"+ - "\u011F\000\u012D\uA5A5\005\000\u014F\uA5A5\004\000\u016D\uA5A5\027\000"+ - "\u1E1C\u1E1D\uA5A5\013\000\u1FB8\000\000\u1FD8\000\000\u1FE8\000\000\000"+ - "\u1FB0\000\000\u1FD0\000\000\u1FE0\uA5A5\005\000\u04D0\000\u04D6\u04C1"+ - "\000\u0419\000\000\u040E\000\000\000\u04D1\000\u04D7\u04C2\000\u0439\000"+ - "\000\u045E\uA5A5\037\000\u1EB6\u1EB7\uA5A5$\000\uFED4\000\uFE8B\uA5A5"+ - "\027\000\u1E9B\000\000\u0226\000\u1E02\u010A\000\u1E0A\u0116\u1E1E\u0120"+ - "\u1E22\u0130\000\000\000\u1E40\u1E44\u022E\u1E56\u1E58\u1E60\u1E6A\000"+ - "\000\u1E86\u1E8A\u1E8E\u017B\u0227\u1E03\u010B\u1E0B\u0117\u1E1F\u0121"+ - "\u1E23\uA5A5\004\000\u1E41\u1E45\u022F\u1E57\u1E59\u1E61\u1E6B\000\000"+ - "\u1E87\u1E8B\u1E8F\u017C\uA5A5\020\000\u1E64\u1E65\000\000\u1E66\u1E67"+ - "\uA5A5'\000\u1E68\u1E69\uA5A5\014\000\u03D4\u00C4\uA5A5\005\000\u00CB"+ - "\000\000\u1E26\u00CF\uA5A5\005\000\u00D6\uA5A5\004\000\u00DC\000\u1E84"+ - "\u1E8C\u0178\000\u00E4\000\000\000\u00EB\000\000\u1E27\u00EF\uA5A5\005"+ - "\000\u00F6\000\000\000\u1E97\u00FC\000\u1E85\u1E8D\u00FF\uA5A5\025\000"+ - "\u1E4E\uA5A5\033\000\u1E4F\uA5A5)\000\u1E7A\u1E7B\uA5A5&\000\u03AA\000"+ - "\000\u03AB\uA5A5\006\000\u03CA\000\000\u03CB\uA5A5\004\000\u0407\u04D2"+ - "\000\u0401\u04DC\u04DE\u04E4\000\u04E6\u04F0\u04F4\u04F8\u04EC\u04D3\000"+ - "\u0451\u04DD\u04DF\u04E5\000\u04E7\u04F1\u04F5\u04F9\u04ED\u0457\000\000"+ - "\u04DA\u04DB\u04EA\u04EB\uA5A5\030\000\u1EA2\uA5A5\005\000\u1EBA\000\000"+ - "\000\u1EC8\uA5A5\005\000\u1ECE\uA5A5\004\000\u1EE6\000\000\000\u1EF6\000"+ - "\u1EA3\000\000\000\u1EBB\000\000\000\u1EC9\uA5A5\005\000\u1ECF\uA5A5\004"+ - "\000\u1EE7\000\000\000\u1EF7\000\000\000\u1EA8\uA5A5\007\000\u1EC2\uA5A5"+ - "\010\000\u1ED4\uA5A5\012\000\u1EA9\uA5A5\007\000\u1EC3\uA5A5\010\000\u1ED5"+ - "\uA5A5\013\000\u1EB2\u1EB3\uA5A5\020\000\u1EDE\u1EDF\u1EEC\u1EED\uA5A5"+ - "\033\000\u00C5\uA5A5\024\000\u016E\uA5A5\005\000\u00E5\uA5A5\022\000\u016F"+ - "\000\u1E98\000\u1E99\uA5A5\035\000\u0150\uA5A5\004\000\u0170\uA5A5\023"+ - "\000\u0151\uA5A5\004\000\u0171\uA5A5\042\000\u04F2\uA5A5\013\000\u04F3"+ - "\uA5A5\042\000\u01CD\000\000\u010C\000\u010E\u011A\000\u01E6\u021E\u01CF"+ - "\000\u01E8\u013D\000\u0147\u01D1\000\u0158\u0160\u0164\u01D3\uA5A5\004"+ - "\000\u017D\u01CE\000\u010D\u010F\u011B\000\u01E7\u021F\u01D0\u01F0\u01E9"+ - "\u013E\000\u0148\u01D2\000\u0159\u0161\u0165\u01D4\uA5A5\004\000\u017E"+ - "\uA5A5\032\000\u01D9\uA5A5\033\000\u01DA\uA5A5\032\000\u01EE\uA5A5,\000"+ - "\u01EF\uA5A5\015\000\u0200\uA5A5\005\000\u0204\000\000\000\u0208\uA5A5"+ - "\005\000\u020C\000\u0210\000\000\u0214\uA5A5\005\000\u0201\000\000\000"+ - "\u0205\000\000\000\u0209\uA5A5\005\000\u020D\000\u0211\000\000\u0215\uA5A5"+ - "\023\000\u0476\u0477\uA5A5\034\000\u0202\uA5A5\005\000\u0206\000\000\000"+ - "\u020A\uA5A5\005\000\u020E\000\u0212\000\000\u0216\uA5A5\005\000\u0203"+ - "\000\000\000\u0207\000\000\000\u020B\uA5A5\005\000\u020F\000\u0213\000"+ - "\000\u0217\uA5A5$\000\u1F08\u1F18\u1F28\u1F38\u1F48\000\000\u1F68\000"+ - "\000\u1F00\u1F10\u1F20\u1F30\u1F40\u1FE4\u1F50\u1F60\uA5A5\036\000\u1F80"+ - "\000\u1F88\u1F90\000\u1F98\u1FA0\000\u1FA8\uA5A5'\000\u1F09\u1F19\u1F29"+ - "\u1F39\u1F49\u1FEC\u1F59\u1F69\000\000\u1F01\u1F11\u1F21\u1F31\u1F41\u1FE5"+ - "\u1F51\u1F61\uA5A5\036\000\u1F81\000\u1F89\u1F91\000\u1F99\u1FA1\000\u1FA9"+ - "\uA5A5$\000\u01A0\uA5A5\004\000\u01AF\uA5A5\023\000\u01A1\uA5A5\004\000"+ - "\u01B0\uA5A5\026\000\u1EDC\u1EDA\uFE1F\u1EE0\uFE15\000\u1EEA\u1EE8\uFDDD"+ - "\uFDC6\uA5A5\022\000\u1EDD\u1EDB\uFC9B\u1EE1\uFC85\000\u1EEB\u1EE9\uFC47"+ - "\uFC3B\uA5A5\017\000\uFD2D\uFD1C\uFD0D\uFCFE\uFCF0\uFCE2\uA5A5\014\000"+ - "\u1EEE\u1EEF\uFBB7\uFBA6\uFB95\uFB84\uFB72\uFB63\uFB54\uFB42\uA5A5\024"+ - "\000\uFB73\uFB64\uFB55\uFB43\uFB2A\uFFA1\uFF8E\uFF7A\uFF64\uFF53\uFF43"+ - "\uFF34\uA5A5\034\000\uFD79\uFD6D\uFD5D\uFD4D\uA5A5\004\000\uFD0E\uFCFF"+ - "\uFCF1\uFCE3\uA5A5\012\000\uFC0C\uFBFC\uFBEB\uFBE2\uFBD8\uFBC8\uFBB8\uFBA7"+ - "\uA5A5\017\000\uFD77\uFD6B\uFD5B\uFD4B\uFD43\uFD3A\uFD2B\uFD1A\uA5A5\032"+ - "\000\uFB92\uFB81\uFB70\uFB61\uFB52\uFB41\uFB29\uFFA0\uFF8D\uFF79\uA5A5"+ - "\036\000\u1EE2\u1EE3\u1EDE\u1EDF\uFBE1\uFBD6\uFBC4\uFBB6\uFBA5\uFB94\uFB83"+ - "\uFB71\uFB62\uFB53\uA5A5\012\000\u1EF0\u1EF1\u1EEC\u1EED\uA5A5\033\000"+ - "\u1EA0\000\u1E04\000\000\u1E0C\u1EB8\000\000\u1E24\u1ECA\000\u1E32\u1E36"+ - "\u1E42\u1E46\u1ECC\000\u1E5A\u1E62\u1E6C\u1EE4\u1E7E\u1E88\000\u1EF4\u1E92"+ - "\u1EA1\u1E05\000\u1E0D\u1EB9\000\000\u1E25\u1ECB\000\u1E33\u1E37\u1E43"+ - "\u1E47\u1ECD\000\u1E5B\u1E63\u1E6D\u1EE5\u1E7F\u1E89\000\u1EF5\u1E93\uFEBC"+ - "\uFEB6\u1EAC\uFEA5\uFE9F\uFE98\000\000\uFE7B\uFE6F\u1EC6\uFE5C\uFE50\uFE4A"+ - "\uFE43\uFE3D\uFE2F\uFE26\uFE22\u1ED8\uFE1B\uFE13\000\uFDF5\uFDE9\uFDD8"+ - "\uFDC2\uFDB1\uFD97\uFD8B\u1EAD\uFD75\uFD68\uFD58\000\000\uFD38\uFD28\u1EC7"+ - "\uFD08\uFCF9\uFCEB\uFCDD\uFCD1\uFCBB\uFCAD\uFCA3\u1ED9\uFC90\uFC81\000"+ - "\uFC60\uFC52\uFC46\uFC3A\uFC29\uFC14\uFC11\uFC08\u1EB6\u1EB7\uA5A5\010"+ - "\000\uFB3C\uFB26\uFF75\uFF60\uFF4F\uFF3F\uFF30\uFF25\uFF0C\uFEFB\uA5A5"+ - "\006\000\uFEB7\uFEAF\uFE99\uFE8A\uFE84\uFE7D\uFE71\uFE67\uFE4B\uFE14\uFE08"+ - "\uFDEB\uFDDA\uFD99\uFD8D\uFD6A\uFD5A\uFD29\uFD18\uFD0A\uFCFB\uFCED\uFCDF"+ - "\uFCBC\uFCAE\uFC91\uFC82\uFC75\uFC6B\uFC61\uFC53\uFC2B\uFC1C\uFC0A\uFBF9"+ - "\uFBD4\uFBC2\uFBB2\uFBA1\uFB90\uFB7F\uFB6E\uFB5F\uFB4F\uFB3E\uFF8A\uFF76"+ - "\uFF61\uFF50\uFF40\uFF31\uFF26\uFF1B\uFF14\uFF0D\uFEFC\u1EE2\u1EE3\u1EF0"+ - "\u1EF1\000\uFBB4\uFBA3\uFB91\uFB80\uFB6F\uFB60\uFB51\uFB40\uFB28\uFF9F"+ - "\uFF8C\uFF78\uFF63\uFF52\uFF42\uFF33\uFF1D\uFF16\uFF0F\uFEFE\000\000\uFEC4"+ - "\uFEBF\uA5A5\004\000\uFE3F\uFE37\uFE32\uFE29\uFE0A\uFDFF\uFDF8\uFDED\uFDDC"+ - "\uFDC5\uFDB4\uFDAA\uFDA1\uFD9A\uFD8E\uFD82\uFD78\uFD6C\uFD5C\uFD4C\uFD44"+ - "\uFD3B\uFD2C\uFD1B\uFD0C\uFCFD\uFCEF\uFCE1\uA5A5\004\000\uFC93\uFC84\uFC2D"+ - "\uFC1E\000\000\uFC0B\uFBFA\uFBE9\uFBE0\uFBD5\uFBC3\uFBB5\uFBA4\uFB93\uFB82"+ - "\uA5A5\023\000\uFC36\uFC24\uFBDD\uFBCF\uA5A5\006\000\uFB37\uFB20\uFF99"+ - "\uFF85\uA5A5\006\000\uFEEA\uFEE3\000\000\uFED0\uFEC9\uA5A5\004\000\uFE95"+ - "\uFE89\uFE82\uFE7A\uA5A5\014\000\uFE1A\uFE0F\uFE03\uFDFA\uFDD2\uFDBE\uA5A5"+ - "\006\000\uFD71\uFD63\uFD53\uFD47\uFD3F\uFD35\uFD24\uFD16\uFCCF\uFCC4\uA5A5"+ - "\006\000\u1E68\u1E69\000\000\uFC44\uFC37\uFC25\uFC18\000\000\uFC04\uFBF3"+ - "\uA5A5\014\000\uFB23\uFF9B\uFF87\uFF72\uFF5D\uFF4C\uFF24\uFF19\uFF12\uFF08"+ - "\uFEF7\uFEEC\uFEE5\uFEDD\uFEAE\uFEA4\uFE9E\uFE97\000\uFE5B\uFE4F\uFE49"+ - "\000\000\uFE12\uFE06\uFDFC\uFDF4\uFDE8\uFDD7\uFDC0\uFDB0\uFDA7\uFD9F\000"+ - "\000\uFD80\uFD74\uFD67\uFD57\uFD49\uFD41\uFD37\uFD27\uA5A5\004\000\uFCDC"+ - "\uFCD0\uFCC5\uFCBA\uFCAC\uFCA2\uFC9A\uFC8F\uFC80\uFC74\uFC6A\uFC5F\000"+ - "\000\uFC39\uFC28\uA5A5\004\000\uFBF7\uFBE7\uFBDE\uFBD1\uFBBF\uFBAF\uFB9E"+ - "\uFB8E\uFB7D\uFB6C\000\000\uFB3A\uFB24\uFF9D\uFF89\uFF74\uFF5F\uFF4E\uFF3E"+ - "\uA5A5\004\000\uFF0B\uFEFA\uFEED\uFEE6\uFEDE\uFED9\uFED2\uFECB\uFEC2\uFEBD"+ - "\000\000\uFEA6\uFEA0\uFE83\uFE7C\uFE70\uFE66\uA5A5 \000\u1E72\uA5A5\030"+ - "\000\u1E73\uA5A5\034\000\uFDF3\uFDE6\uFDD5\uFDC1\uA5A5\030\000\uFC5D\uFC50"+ - "\uFC45\uFC38\uA5A5!\000\uFBD2\uFBC0\uFBB0\uFB9F\uFB8F\uFB7E\uFB6D\uFB5E"+ - "\uFB4E\uFB3D\uA5A5\026\000\uFB50\uFB3F\uFB27\uFF9E\uFF8B\uFF77\uFF62\uFF51"+ - "\uFF41\uFF32\uA5A5\004\000\uFD0B\uFCFC\uFCEE\uFCE0\uA5A5)\000\uFB21\uFF9A"+ - "\uFF86\uFF71\uA5A5\030\000\uFF09\uFEF8\uA5A5\033\000\u1E00\uA5A5\032\000"+ - "\u1E01\uA5A5\030\000\uFEBB\uFEB4\uFEAC\uFEA3\uFE9D\uFE96\uA5A5\026\000"+ - "\uFD95\uFD89\uFD7F\uFD73\uFD65\uFD55\uA5A5\027\000\uFC10\uFC05\uFBF4\uFBE6"+ - "\uA5A5\025\000\uFBB3\uFBA2\uA5A5\016\000\uFF1C\uFF15\uFF0E\uFEFD\uA5A5"+ - "\012\000\uFE31\uFE28\uFE09\uFDFE\uFDF7\uFDEC\uA5A5\032\000\uFC2C\uFC1D"+ - "\uA5A5\031\000\uFE10\uFE04\uFDFB\uFDF2\uFDE4\uFDD3\uFDBF\uFDAF\uFDA6\uFD9E"+ - "\000\000\uFD7E\uFD72\uFD64\uFD54\uFD48\uFD40\uFD36\uFD25\uA5A5 \000\u0218"+ - "\u021A\uA5A5\027\000\u0219\u021B\uA5A5\026\000\uFC73\uFC69\uFC5E\uFC51"+ - "\uFC27\uFC1A\uFC07\uFBF6\uA5A5#\000\uFC6F\uFC65\000\000\uFC40\uFC33\uFC22"+ - "\uFC16\000\000\uFC01\uFBF0\uA5A5\037\000\uFE5A\uA5A5(\000\u00C7\000\u1E10"+ - "\u0228\000\u0122\u1E28\000\000\u0136\u013B\000\u0145\000\000\u0156\u015E"+ - "\u0162\uA5A5\010\000\u00E7\u1E11\u0229\000\u0123\u1E29\000\000\u0137\u013C"+ - "\000\u0146\000\000\u0157\u015F\u0163\uA5A5\016\000\uFE78\uFE6D\uFE64\uFE59"+ - "\uA5A5\004\000\uFE2E\uA5A5\023\000\uFD34\uFD23\uFD15\uFD05\uA5A5\004\000"+ - "\uFCB8\uA5A5\020\000\u1E08\u1E09\uFB9B\uFB8B\uFB7A\uFB69\uFB5B\uFB4B\uFB38"+ - "\uFB22\uFF70\uFF5C\u1E1C\u1E1D\uFF2E\uFF23\uFF07\uFEF6\uFEEB\uFEE4\uFEDC"+ - "\uFED8\uFED1\uFECA\uFEB5\uFEAD\uA5A5\007\000\uFE11\uFE05\uFDE5\uFDD4\uFD96"+ - "\uFD8A\uFD66\uFD56\uA5A5\006\000\uFCB9\uFCAB\uFC8E\uFC7F\uFC72\uFC68\uFC5C"+ - "\uFC4F\uFC26\uFC19\uFC06\uFBF5\uA5A5\016\000\uFED3\uFECC\uFEC3\uFEBE\000"+ - "\000\uFE5D\uFE51\uFE3E\uFE36\uA5A5\006\000\uFDDB\uFDC4\uFDB3\uFDA9\uA5A5"+ - "\010\000\uFD42\uFD39\uFD2A\uFD19\uA5A5\004\000\uFCD2\uFCC6\uFCBD\uFCAF"+ - "\uFC92\uFC83\uA5A5#\000\uFBDA\uFBCB\uFBBA\uFBA9\uFB97\uFB87\uFB57\uFB45"+ - "\uFB31\uFFAA\uFF95\uFF81\uFF6B\uFF58\uFF48\uFF39\uFF04\uFEF3\uFEE8\uFEE1"+ - "\uFEDA\uFED6\uFECE\uFEC7\uFEB1\uFEA9\uA5A5\004\000\uFE80\uFE76\uFE6B\uFE61"+ - "\uFE56\uFE4D\uFE46\uFE41\uFE3A\uFE34\uFE2D\uFE24\uFE20\uFE1C\uA5A5\004"+ - "\000\uFDCD\uFDB9\uFDAB\uFDA3\uFD9C\uFD92\uFD86\uFD7B\uA5A5\010\000\uFCCB"+ - "\uFCC1\uFCB5\uFCA7\uFC9E\uFC96\uFC89\uFC7A\uFC6E\uFC64\uFC58\uFC4B\uFC3F"+ - "\uFC32\uFC21\uFC15\uFC12\uFC0D\uFC00\uFBEF\uFBE3\uFBDB\uFBCD\uFBBC\uFBAB"+ - "\uFB99\uA5A5\030\000\uFE63\uFE58\uA5A5\032\000\uFCF6\uFCE8\uFCD9\uFCCE"+ - "\uFCC3\uFCB7\uFCAA\uFCA1\uFC99\uFC8D\uFC7E\uFC71\uFC67\uFC5B\uFC4E\uFC43"+ - "\uA5A5\033\000\u0104\uA5A5\005\000\u0118\000\000\000\u012E\uA5A5\005\000"+ - "\u01EA\uA5A5\004\000\u0172\uA5A5\005\000\u0105\000\000\000\u0119\000\000"+ - "\000\u012F\uA5A5\005\000\u01EB\uA5A5\004\000\u0173\uA5A5\005\000\uFEB9"+ - "\uFEB2\uFEAA\uFEA2\uFE9C\uFE93\000\000\uFE77\uFE6C\uFE62\uFE57\uFE4E\uFE47"+ - "\uFE42\uFE3B\000\uFE25\uFE21\uFE1E\uFE19\uFE0E\000\uFDF1\uFDE3\uFDD0\uFDBC"+ - "\000\uFD94\uFD88\uFD7D\uFD70\uFD62\uFD52\000\000\uFD33\uFD22\uFD14\uFD04"+ - "\uFCF5\uFCE7\uFCD8\uFCCD\000\uFCA9\uFCA0\uFC98\uFC8B\uFC7C\000\uFC5A\uFC4D"+ - "\uFC42\uFC35\000\000\uFC0F\uFC03\uFBF2\uFBE5\uA5A5\012\000\uFF6F\uFF5B"+ - "\uFF4B\uFF3C\uFF2D\uFF22\uFF06\uFEF5\uA5A5\010\000\uFE94\uFE88\uFE81\uFE79"+ - "\uFE6E\uFE65\uFE48\uA5A5\010\000\u01EC\u01ED\uFD07\uFCF8\uFCEA\uFCDB\uA5A5"+ - "\014\000\uFBD0\uFBBE\uFBAD\uFB9C\uFB8C\uFB7B\uFB6A\uFB5C\uFB4C\uFB39\uA5A5"+ - "\013\000\uFDE7\uFDD6\uFD26\uFD17\000\uFBAE\uFB9D\uFB8D\uFB7C\uFB6B\uFB5D"+ - "\uFB4D\uFB3B\uFB25\uFF9C\uFF88\uFF73\uFF5E\uFF4D\uFF3D\uFF2F\uFF1A\uFF13"+ - "\uFF0A\uFEF9\uA5A5\012\000\uFE30\uFE27\uFE07\uFDFD\uFDF6\uFDEA\uFDD9\uFDC3"+ - "\uFDB2\uFDA8\uFDA0\uFD98\uFD8C\uFD81\uFD76\uFD69\uFD59\uFD4A\uA5A5\004"+ - "\000\uFD09\uFCFA\uFCEC\uFCDE\uA5A5\006\000\uFC2A\uFC1B\000\000\uFC09\uFBF8"+ - "\uFBE8\uFBDF\uFBD3\uFBC1\uFBB1\uFBA0\uA5A5\023\000\uFC4A\uFC3E\uA5A5\012"+ - "\000\uFB2F\uFFA8\uFF93\uFF7F\uFF69\uFF56\uFF46\uFF37\uA5A5\012\000\uFEA1"+ - "\uFE9B\uFE92\uFE87\uA5A5\032\000\uFD6E\uFD60\uFD50\uFD45\uFD3D\uFD31\uFD20"+ - "\uFD12\uA5A5\032\000\uFB89\uFB78\uFB67\uFB59\uFB47\uFB33\uFB1D\uFF96\uFF82"+ - "\uFF6C\uA5A5\022\000\uFE1D\uFE18\uFE0D\uFE02\uFDF9\uFDF0\uFDE2\uFDCF\uFDBB"+ - "\uFDAD\uFDA4\uFD9D\uFD93\uFD87\uFD7C\uFD6F\uFD61\uFD51\uFD46\uFD3E\uFD32"+ - "\uFD21\uFD13\uFD03\uFCF4\uFCE6\uFCD7\uFCCC\uFCC2\uFCB6\uFCA8\uFC9F\uFC97"+ - "\uFC8A\uFC7B\uFC70\uFC66\uFC59\uFC4C\uFC41\uFC34\uFC23\uFC17\uFC13\uFC0E"+ - "\uFC02\uFBF1\uFBE4\uFBDC\uFBCE\uFBBD\uFBAC\uFB9A\uFB8A\uFB79\uFB68\uFB5A"+ - "\uFB49\uFB35\uFB1F\uFF98\uFF84\uFF6E\uFF5A\uFF4A\uFF3B\uFF2C\uFF21\uFF18"+ - "\uFF11\uFF05\uFEF4\uFEE9\uFEE2\uFEDB\uFED7\uFECF\uFEC8\uFEC1\uFEBA\uFEB3"+ - "\uFEAB\uA5A5\026\000\u1E12\u1E18\uA5A5\006\000\u1E3C\000\u1E4A\uA5A5\004"+ - "\000\u1E70\u1E76\uA5A5\010\000\u1E13\u1E19\uA5A5\006\000\u1E3D\000\u1E4B"+ - "\uA5A5\004\000\u1E71\u1E77\uA5A5\015\000\uFE75\uFE6A\uFE60\uFE55\uA5A5"+ - "\004\000\uFE2C\uA5A5\006\000\uFDEF\uFDE0\uFDCB\uFDB8\uA5A5\011\000\uFD2F"+ - "\uFD1E\uFD10\uFD01\uA5A5\004\000\uFCB4\uA5A5\006\000\uFC57\uFC49\uFC3D"+ - "\uFC31\uA5A5\016\000\uFB30\uFFA7\uFF68\uFF55\uFF45\uFF36\uFF29\uFF20\uFF03"+ - "\uFEF2\uA5A5\017\000\uFE0C\uFE01\uFDE1\uFDCC\uFD90\uFD84\uFD5F\uFD4F\uA5A5"+ - "\020\000\uFBFF\uFBEE\uFBCC\uFBBB\uFBAA\uFB98\uFB88\uFB77\uFB66\uFB58\uFB48"+ - "\uFB34\uA5A5\026\000\uFB4A\uFB36\uFB1E\uFF97\uFF83\uFF6D\uFF59\uFF49\uFF3A"+ - "\uFF2B\uA5A5\014\000\uFE3C\uFE35\uA5A5\006\000\uFDD1\uFDBD\uFDAE\uFDA5"+ - "\uA5A5\014\000\uFD06\uFCF7\uFCE9\uFCDA\uA5A5)\000\uFBD9\uFBC9\uA5A5\006"+ - "\000\uFB2C\uFFA4\uFF91\uFF7D\uA5A5$\000\uFDC8\uFDB6\uFBFD\uFBEC\uA5A5"+ - "\014\000\uFFA6\uFF92\uFF7E\uFF67\uA5A5\017\000\uFE54\uA5A5\034\000\uFCD5"+ - "\uFCCA\uFCC0\uFCB3\uFCA6\uFC9D\uFC95\uFC88\uFC78\uFC6D\uFC63\uFC56\uA5A5"+ - " \000\uFF02\uFEF1\uA5A5$\000\u1E2A\uA5A5\030\000\u1E2B\uA5A5&\000\uFEB0"+ - "\uFEA8\uA5A5\027\000\uFC8C\uFC7D\uA5A5\025\000\uFEE7\uFEE0\000\000\uFECD"+ - "\uFEC6\uA5A5'\000\u1E1A\000\000\000\u1E2C\uA5A5\012\000\u1E74\uA5A5\011"+ - "\000\u1E1B\000\000\000\u1E2D\uA5A5\012\000\u1E75\uA5A5\015\000\uFE73\uFE68"+ - "\uFE5E\uFE53\uFE4C\uFE44\uFE40\uFE38\uA5A5\007\000\uFDEE\uFDDE\uFDC9\uFDB7"+ - "\uA5A5\011\000\uFD2E\uFD1D\uFD0F\uFD00\uFCF2\uFCE4\uFCD4\uFCC9\uA5A5\007"+ - "\000\uFC55\uFC48\uFC3C\uFC30\uA5A5\020\000\uFF66\uFF54\uFF44\uFF35\uFF27"+ - "\uFF1E\uFF00\uFEEF\uA5A5\010\000\uFE91\uFE86\uFE7F\uFE74\uFE69\uFE5F\uFE45"+ - "\uA5A5\032\000\uFBCA\uFBB9\uFBA8\uFB96\uFB85\uFB75\uFB65\uFB56\uFB44\uFB2E"+ - "\uA5A5\022\000\uFB86\uFB76\000\000\uFB46\uFB32\uFFA9\uFF94\uFF80\uFF6A"+ - "\uFF57\uFF47\uFF38\uFF2A\uA5A5\024\000\uFDCE\uFDBA\uFDAC\uFDA2\uFD9B\uFD91"+ - "\uFD85\uFD7A\uA5A5\010\000\uFD02\uFCF3\uFCE5\uFCD6\uA5A51\000\uFB2B\uFFA2"+ - "\uFF8F\uFF7B\uA5A5\020\000\uFE8F\uFE85\uA5A5\042\000\uFFA3\uFF90\uFF7C"+ - "\uFF65\uA5A5,\000\uFCD3\uFCC8\uFCBF\uFCB1\uFCA4\uFC9C\uFC94\uFC86\uFC76"+ - "\uFC6C\uFC62\uFC54\000\000\uFC2F\uFC20\uA5A5\034\000\uFEFF\uFEEE\uA5A5"+ - "\035\000\u1E06\000\000\u1E0E\uA5A5\006\000\u1E34\u1E3A\000\u1E48\000\000"+ - "\u1E5E\000\u1E6E\uA5A5\005\000\u1E94\000\u1E07\000\u1E0F\000\000\000\u1E96"+ - "\000\000\u1E35\u1E3B\000\u1E49\000\000\u1E5F\000\u1E6F\uA5A5\005\000\u1E95"+ - "\uA5A5\020\000\uFE2B\uA5A5\033\000\uFCB0\uA5A5\030\000\uFB2D\uFFA5\uA5A5"+ - "\017\000\uFEA7\uA5A5\007\000\uFE0B\uFE00\uFDDF\uFDCA\uFD8F\uFD83\uFD5E"+ - "\uFD4E\uA5A5\006\000\uFCB2\uFCA5\uFC87\uFC77\uA5A5\006\000\uFBFE\uFBED"+ - "\uA5A5\017\000\uFF28\uFF1F\uFF17\uFF10\uFF01\uFEF0\uA5A5\033\000\uFEC0"+ - "\uFEB8\uA5A5\004\000\uFE39\uFE33\uA5A5\022\000\uFD3C\uFD30\uFD1F\uFD11"+ - "\uA5A5\011\000\uFC79\uA5A5!\000\uFC2E\uFC1F\uFBD7\uFBC7\uA5A5\021\000"+ - "\uFEDF\000\000\000\uFEC5\uA5A5\006\000\uFE7E\uFE72\uA5A5\020\000\uFDC7"+ - "\uFDB5\uA5A5\016\000\uFCC7\uFCBE\uA5A5\020\000\uFBFB\uFBEA\uA5A5\034\000"+ - "\uFE9A\uFE90\000\uFE52\uA5A5 \000\u226E\u2260\000\u226F\uA5A5-\000\u219A"+ - "\u219B\u21AE\u21CD\u21CF\u21CE\u2204\u2209\u220C\u2224\u2226\u2241\u2244"+ - "\u2247\u2249\u226D\u2262\u2270\u2271\u2274\u2275\u2278\u2279\u2280\u2281"+ - "\u22E0\u22E1\u2284\u2285\u2288\u2289\u22E2\u22E3\u22AC\u22AD\u22AE\u22AF"+ - "\u22EA\u22EB\u22EC\u22ED\uA5A5\005\000\u1FC1\uA5A5\006\000\u1FCF\000\000"+ - "\u1FDF\uA5A5\030\000\u1FB6\000\u1FC6\u1FD6\000\000\u1FE6\u1FF6\u1FD7\u1FE7"+ - "\uA5A5.\000\u1F06\u1F07\uA5A5\006\000\u1F0E\u1F0F\uA5A5\012\000\u1F26"+ - "\u1F27\uA5A5\006\000\u1F2E\u1F2F\uA5A5\006\000\u1F36\u1F37\u1F3E\u1F3F"+ - "\uA5A5\004\000\u1F56\u1F57\u1F5F\u1F66\u1F67\uA5A5\006\000\u1F6E\u1F6F"+ - "\uA5A5\011\000\u1F86\u1F87\u1F8E\u1F8F\u1F96\u1F97\u1F9E\u1F9F\u1FA6\u1FA7"+ - "\u1FAE\u1FAF\u1FB7\000\000\u1FC7\000\000\u1FF7\uA5A5)\000\u1FBC\000\u1FCC"+ - "\uA5A5\004\000\u1FFC\u1FB4\u1FC4\u1FB3\000\u1FC3\uA5A5\004\000\u1FF3\000"+ - "\000\u1FF4\uA5A5-\000\u1F80\u1F81\u1F82\u1F83\u1F84\u1F85\u1F86\u1F87"+ - "\u1F88\u1F89\u1F8A\u1F8B\u1F8C\u1F8D\u1F8E\u1F8F\uA5A5\004\000\u1F90\u1F91"+ - "\u1F92\u1F93\u1F94\u1F95\u1F96\u1F97\u1F98\u1F99\u1F9A\u1F9B\u1F9C\u1F9D"+ - "\u1F9E\u1F9F\uA5A5\013\000\u1FA0\u1FA1\u1FA2\u1FA3\u1FA4\u1FA5\u1FA6\u1FA7"+ - "\u1FA8\u1FA9\u1FAA\u1FAB\u1FAC\u1FAD\u1FAE\u1FAF\u1FB2\u1FC2\u1FF2\uA5A5"+ - "\015\000\u1FB7\000\000\u1FC7\000\000\u1FF7\uA5A5\035\000\uFB1D\uA5A5\042"+ - "\000\u0622\uA5A5\037\000\u0623\u0624\u0626\u06C2\u06D3\u06C0\uA5A5\030"+ - "\000\uFE2A\uFE23\u0625\uA5A5%\000\u0929\u0931\u0934\uA5A5 \000\u09CB\uA5A5"+ - "\037\000\u09CC\uA5A5 \000\u0B4B\uA5A5\037\000\u0B48\uA5A5\037\000\u0B4C"+ - "\uA5A5!\000\u0BCA\u0BCB\uA5A5\035\000\u0B94\u0BCC\000\u0C48\uA5A5!\000"+ - "\u0CCA\uA5A5\036\000\u0CC0\u0CC7\u0CCB\uA5A5\036\000\u0CC8\uA5A5!\000"+ - "\u0D4A\u0D4B\uA5A5\036\000\u0D4C\uA5A5!\000\u0DDA\000\u0DDD\uA5A5\035"+ - "\000\u0DDC\uA5A5\037\000\u0DDE\uFB74\uA5A5!\000\u1026\uA5A52\000\u3094"+ - "\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062"+ - "\u3065\u3067\u3069\u3070\u3073\u3076\u3079\u307C\u309E\u30F4\u30AC\u30AE"+ - "\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7"+ - "\u30C9\u30D0\u30D3\u30D6\u30D9\u30DC\u30F7\u30F8\u30F9\u30FA\u30FE\uA5A5"+ - " \000\u3071\u3074\u3077\u307A\u307D\uA5A5\021\000\u30D1\u30D4\u30D7\u30DA"+ - "\u30DD\uA5A5\031\000" - ); - - static final char[] actionIndex = Utility.RLEStringToCharArray( - "\000\u048E\u145A\u145E\u1462\u1466\u146A\u146E\u1471\u1475\u1478\u147C"+ - "\u147F\u1483\u1487\u148A\u148E\u1492\u1496\u1499\u149C\u14A0\u14A3\u14A7"+ - "\u14AA\u14AD\u14B0\u14B4\u14B7\u14BB\u14BE\u14C1\u14C4\u14C7\u14CA\u14CD"+ - "\u14D0\u14D3\u14D6\u14D9\u14DC\u14DF\u14E2\u14E5\u14E8\u14EB\u14EE\u14F2"+ - "\u14F5\u14F8\u14FB\u14FE\u1501\u1504\u1507\u150A\u150D\u1510\u1513\u1516"+ - "\u1519\u151C\u151F\u1522\u1526\u1529\u152C\u152F\u1532\u1535\u1538\u153B"+ - "\u153E\u1541\u1544\u1547\u154A\u154D\u1551\u1554\u1557\u155A\u155D\u1560"+ - "\u1563\u1566\u1569\u156D\u1570\u1573\u1576\u1579\u157C\u157F\u1582\u1586"+ - "\u1589\u158C\u158F\u1592\u1595\u1598\u159B\u159E\u15A1\u15A5\u15A8\u15AB"+ - "\u15AE\u15B1\u15B4\u15B7\u15BB\u15BE\u15C1\u15C4\u15C7\u15CA\u15CD\u15D0"+ - "\u15D3\u15D6\u15DA\u15DD\u15E0\u15E3\u15E6\u15E9\u15ED\u15F0\u15F3\u15F6"+ - "\u15F9\u15FC\u1600\u1603\u1606\u1609\u160D\u1611\u1614\u1618\u161B\u161E"+ - "\u1621\u1624\u1628\u162B\u162E\u1631\u1634\u1638\u163B\u163E\u1641\u1645"+ - "\u1649\u164C\u1650\u1653\u1656\u1659\u165C\u1660\u1663\u1666\u1669\u166C"+ - "\u166F\u1672\u1676\u1679\u167C\u167F\u1682\u1685\u1688\u168B\u168E\u1691"+ - "\u1695\u1698\u169B\u169E\u16A1\u16A4\u16A7\u16AA\u16AE\u16B1\u16B4\u16B7"+ - "\u16BA\u16BD\u16C1\u16C4\u16C7\u16CB\u16CF\u16D3\u16D6\u16D9\u16DC\u16DF"+ - "\u16E2\u16E5\u16E9\u16ED\u16F0\u16F3\u16F6\u16F9\u16FC\u16FF\u1702\u1705"+ - "\u1708\u170B\u170E\u1711\u1714\u1717\u171B\u171E\u1722\u1725\u1729\u172C"+ - "\u172F\u1732\u1735\u1738\u173B\u173E\u1741\u1744\u1747\u174A\u174D\u1751"+ - "\u1754\u1758\u175C\u1760\u1763\u1766\u1769\u176C\u1770\u1773\u1776\u177A"+ - "\u177E\u1781\u1785\u1788\u178B\u178E\u1791\u1794\u1797\u179A\u179D\u17A1"+ - "\u17A5\u17A8\u17AB\u17AF\u17B2\u17B5\u17B8\u17BB\u17BE\u17C1\u17C4\u17C7"+ - "\u17CA\u17CD\u17D0\u17D3\u17D7\u17DB\u17DE\u17E1\u17E4\u17E8\u17EB\u17EE"+ - "\u17F1\u17F4\u17F7\u17FA\u17FD\u1801\u1805\u1809\u180C\u1810\u1814\u1817"+ - "\u181A\u181D\u1820\u1823\u1826\u1829\u182D\u1830\u1834\u1837\u183A\u183D"+ - "\u1840\u1843\u1847\u184A\u184E\u1851\u1854\u1858\u185B\u185F\u1862\u1865"+ - "\u1868\u186B\u186E\u1871\u1875\u1879\u187C\u187F\u1883\u1887\u188A\u188D"+ - "\u1890\u1893\u1897\u189B\u189E\u18A1\u18A5\u18A9\u18AC\u18AF\u18B2\u18B5"+ - "\u18B9\u18BC\u18C0\u18C3\u18C6\u18CA\u18CD\u18D0\u18D4\u18D7\u18DA\u18DD"+ - "\u18E0\u18E3\u18E6\u18E9\u18ED\u18F0\u18F4\u18F7\u18FB\u18FE\u1901\u1905"+ - "\u1908\u190B\u190E\u1911\u1914\u1917\u191B\u191F\u1923\u1927\u192A\u192E"+ - "\u1931\u1934\u1938\u193C\u1940\u1944\u1947\u194B\u194E\u1951\u1955\u1958"+ - "\u195C\u195F\u1963\u1966\u196A\u196D\u1970\u1973\u1976\u1979\u197C\u197F"+ - "\u1982\u1985\u1988\u198B\u198E\u1991\u1994\u1997\u199A\u199D\u19A0\u19A3"+ - "\u19A6\u19A9\u19AC\u19AF\u19B2\u19B5\u19B8\u19BB\u19BE\u19C1\u19C4\u19C7"+ - "\u19CA\u19CD\u19D0\u19D3\u19D6\u19D9\u19DC\u19DF\u19E2\u19E5\u19E8\u19EB"+ - "\u19EE\u19F1\u19F4\u19F7\u19FA\u19FD\u1A00\u1A03\u1A06\u1A09\u1A0C\u1A0F"+ - "\u1A12\u1A15\u1A18\u1A1B\u1A1E\u1A21\u1A24\u1A27\u1A2A\u1A2D\u1A30\u1A33"+ - "\u1A36\u1A39\u1A3C\u1A3F\u1A42\u1A45\u1A48\u1A4B\u1A4E\u1A51\u1A54\u1A57"+ - "\u1A5A\u1A5D\u1A60\u1A63\u1A66\u1A69\u1A6C\u1A6F\u1A72\u1A76\u1A79\u1A7C"+ - "\u1A7F\u1A82\u1A85\u1A88\u1A8B\u1A8E\u1A91\u1A94\u1A97\u1A9A\u1A9D\u1AA0"+ - "\u1AA3\u1AA7\u1AAA\u1AAD\u1AB1\u1AB4\u1AB7\u1ABA\u1ABE\u1AC1\u1AC4\u1AC7"+ - "\u1ACA\u1ACD\u1AD0\u1AD4\u1AD7\u1ADA\u1ADE\u1AE2\u1AE5\u1AE8\u1AEB\u1AEE"+ - "\u1AF1\u1AF5\u1AF8\u1AFB\u1AFE\u1B01\u1B04\u1B07\u1B0B\u1B0E\u1B11\u1B15"+ - "\u1B19\u1B1C\u1B1F\u1B22\u1B26\u1B29\u1B2C\u1B2F\u1B33\u1B37\u1B3B\u1B3E"+ - "\u1B41\u1B45\u1B48\u1B4C\u1B50\u1B54\u1B58\u1B5B\u1B5E\u1B61\u1B64\u1B67"+ - "\u1B6A\u1B6D\u1B71\u1B75\u1B78\u1B7C\u1B80\u1B83\u1B86\u1B89\u1B8C\u1B8F"+ - "\u1B92\u1B95\u1B98\u1B9B\u1B9E\u1BA1\u1BA5\u1BA9\u1BAC\u1BB0\u1BB4\u1BB7"+ - "\u1BBA\u1BBD\u1BC0\u1BC3\u1BC6\u1BC9\u1BCC\u1BCF\u1BD3\u1BD7\u1BDA\u1BDE"+ - "\u1BE2\u1BE5\u1BE8\u1BEB\u1BEE\u1BF1\u1BF4\u1BF7\u1BFA\u1BFD\u1C01\u1C04"+ - "\u1C08\u1C0B\u1C0E\u1C11\u1C14\u1C17\u1C1A\u1C1D\u1C20\u1C24\u1C27\u1C2A"+ - "\u1C2D\u1C30\u1C33\u1C36\u1C39\u1C3C\u1C3F\u1C42\u1C45\u1C49\u1C4C\u1C4F"+ - "\u1C52\u1C55\u1C58\u1C5B\u1C5E\u1C61\u1C64\u1C68\u1C6C\u1C6F\u1C72\u1C75"+ - "\u1C78\u1C7B\u1C7F\u1C82\u1C86\u1C89\u1C8C\u1C8F\u1C92\u1C95\u1C98\u1C9C"+ - "\u1C9F\u1CA3\u1CA6\u1CA9\u1CAC\u1CAF\u1CB2\u1CB5\u1CB8\u1CBB\u1CBE\u1CC1"+ - "\u1CC4\u1CC8\u1CCB\u1CCE\u1CD1\u1CD5\u1CD8\u1CDB\u1CDE\u1CE1\u1CE4\u1CE7"+ - "\u1CEA\u1CED\u1CF0\u1CF3\u1CF6\u1CF9\u1CFC\u1CFF\u1D02\u1D06\u1D09\u1D0C"+ - "\u1D0F\u1D13\u1D16\u1D19\u1D1C\u1D1F\u1D22\u1D25\u1D28\u1D2B\u1D2E\u1D31"+ - "\u1D34\u1D37\u1D3A\u1D3D\u1D41\u1D44\u1D48\u1D4B\u1D4E\u1D51\u1D54\u1D57"+ - "\u1D5A\u1D5D\u1D60\u1D63\u1D66\u1D69\u1D6D\u1D70\u1D74\u1D77\u1D7A\u1D7D"+ - "\u1D80\u1D83\u1D86\u1D8A\u1D8D\u1D91\u1D94\u1D97\u1D9A\u1D9D\u1DA0\u1DA3"+ - "\u1DA6\u1DA9\u1DAC\u1DAF\u1DB2\u1DB5\u1DB8\u1DBB\u1DBE\u1DC1\u1DC4\u1DC7"+ - "\u1DCA\u1DCD\u1DD0\u1DD3\u1DD6\u1DD9\u1DDC\u1DDF\u1DE2\u1DE5\u1DE8\u1DEB"+ - "\u1DEE\u1DF1\u1DF4\u1DF7\u1DFA\u1DFD\u1E00\u1E03\u1E06\u1E09\u1E0C\u1E0F"+ - "\u1E12\u1E16\u1E1A\u1E1E\u1E21\u1E24\u1E27\u1E2A\u1E2D\u1E30\u1E34\u1E38"+ - "\u1E3C\u1E3F\u1E43\u1E46\u1E49\u1E4C\u1E4F\u1E52\u1E56\u1E59\u1E5C\u1E5F"+ - "\u1E62\u1E65\u1E68\u1E6B\u1E6E\u1E71\u1E74\u1E77\u1E7A\u1E7D\u1E80\u1E83"+ - "\u1E86\u1E89\u1E8C\u1E8F\u1E92\u1E95\u1E98\u1E9B\u1E9E\u1EA1\u1EA4\u1EA7"+ - "\u1EAA\u1EAD\u1EB0\u1EB3\u1EB6\u1EB9\u1EBC\u1EBF\u1EC2\u1EC5\u1EC8\u1ECB"+ - "\u1ECE\u1ED1\u1ED4\u1ED7\u1EDA\u1EDD\u1EE0\u1EE3\u1EE6\u1EE9\u1EEC\u1EEF"+ - "\u1EF2\u1EF5\u1EF8\u1EFB\u1EFE\u1F01\u1F04\u1F07\u1F0A\u1F0D\u1F10\u1F13"+ - "\u1F16\u1F19\u1F1C\u1F1F\u1F22\u1F25\u1F28\u1F2B\u1F2E\u1F31\u1F34\u1F38"+ - "\u1F3B\u1F3F\u1F42\u1F46\u1F49\u1F4C\u1F4F\u1F52\u1F55\u1F59\u1F5C\u1F5F"+ - "\u1F63\u1F66\u1F69\u1F6D\u1F70\u1F73\u1F76\u1F79\u1F7C\u1F7F\u1F82\u1F85"+ - "\u1F88\u1F8B\u1F8E\u1F91\u1F94\u1F97\u1F9A\u1F9D\u1FA0\u1FA3\u1FA6\u1FA9"+ - "\u1FAC\u1FB0\u1FB3\u1FB6\u1FB9\u1FBC\u1FBF\u1FC2\u1FC5\u1FC9\u1FCC\u1FCF"+ - "\u1FD2\u1FD5\u1FD8\u1FDB\u1FDF\u1FE2\u1FE5\u1FE8\u1FEB\u1FEE\u1FF1\u1FF5"+ - "\u1FF8\u1FFB\u1FFE\u2001\u2004\u2007\u200B\u200E\u2011\u2014\u2017\u201A"+ - "\u201D\u2021\u2024\u2027\u202A\u202D\u2030\u2033\u2036\u203A\u203D\u2040"+ - "\u2043\u2047\u204A\u204D\u2050\u2053\u2056\u2059\u205D\u2060\u2063\u2066"+ - "\u2069\u206C\u206F\u2073\u2076\u2079\u207C\u207F\u2082\u2085\u2088\u208B"+ - "\u208E\u2091\u2094\u2097\u209A\u209D\u20A0\u20A4\u20A7\u20AA\u20AD\u20B1"+ - "\u20B5\u20B8\u20BB\u20BE\u20C1\u20C4\u20C7\u20CA\u20CD\u20D0\u20D3\u20D6"+ - "\u20DA\u20DD\u20E0\u20E3\u20E7\u20EB\u20EE\u20F1\u20F4\u20F8\u20FB\u20FF"+ - "\u2103\u2106\u2109\u210C\u2110\u2113\u2117\u211B\u211E\u2121\u2124\u2128"+ - "\u212B\u212E\u2131\u2134\u2137\u213A\u213D\u2140\u2144\u2148\u214C\u214F"+ - "\u2152\u2156\u2159\u215C\u2160\u2164\u2168\u216B\u216E\u2171\u2175\u2178"+ - "\u217C\u2180\u2183\u2187\u218A\u218D\u2190\u2194\u2198\u219C\u219F\u21A2"+ - "\u21A5\u21A9\u21AC\u21B0\u21B4\u21B7\u21BA\u21BE\u21C1\u21C4\u21C7\u21CB"+ - "\u21CF\u21D3\u21D6\u21D9\u21DC\u21E0\u21E3\u21E7\u21EB\u21EE\u21F1\u21F4"+ - "\u21F8\u21FB\u21FE\u2201\u2205\u2209\u220D\u2211\u2214\u2218\u221B\u221E"+ - "\u2222\u2225\u2229\u222D\u2231\u2234\u2237\u223B\u223F\u2243\u2246\u2249"+ - "\u224C\u2250\u2254\u2258\u225C\u2260\u2264\u2268\u226C\u2270\u2274\u2278"+ - "\u227C\u2280\u2284\u2288\u228C\u2290\u2294\u2297\u229A\u229E\u22A2\u22A6"+ - "\u22AA\u22AE\u22B2\u22B6\u22BA\u22BE\u22C2\u22C6\u22CA\u22CE\u22D2\u22D6"+ - "\u22DA\u22DE\u22E2\u22E5\u22E9\u22ED\u22F0\u22F4\u22F8\u22FC\u2300\u2303"+ - "\u2307\u230A\u230E\u2312" - ); - - static final String replace = - " \u0308\000s\000\u03A5\000 \u0313\000 \u0314\000 \000a\000 \u0304\000"+ - "2\0003\000 \u0301\000\u03BC\000 \u0327\0001\000o\0001\u20444\0001\u2044"+ - "2\0003\u20444\000IJ\000ij\000L\u00B7\000l\u00B7\000\u02BCn\000DZ\u030C"+ - "\000Dz\u030C\000dz\u030C\000LJ\000Lj\000lj\000NJ\000Nj\000nj\000DZ\000"+ - "Dz\000dz\000h\000\u0266\000r\000\u0279\000\u027B\000\u0281\000w\000y\000"+ - " \u0306\000 \u0307\000 \u030A\000 \u0328\000 \u0303\000 \u030B\000\u0263"+ - "\000l\000x\000\u0295\000 \u0345\000 \u0308\u0301\000\u03B2\000\u03B8\000"+ - "\u03A5\u0301\000\u03A5\u0308\000\u03C6\000\u03C0\000\u03BA\000\u03C1\000"+ - "\u03C2\000\u0565\u0582\000\u0627\u0674\000\u0648\u0674\000\u06C7\u0674"+ - "\000\u064A\u0674\000\u0E4D\u0E32\000\u0ECD\u0EB2\000\u0EAB\u0E99\000\u0EAB"+ - "\u0EA1\000\u0F0B\000\u0FB2\u0F71\u0F80\000\u0FB3\u0F71\u0F80\000a\u02BE"+ - "\000s\u0307\000 \u0342\000 \u0308\u0342\000 \u0313\u0300\000 \u0313\u0301"+ - "\000 \u0313\u0342\000 \u0314\u0300\000 \u0314\u0301\000 \u0314\u0342\000"+ - " \u0308\u0300\000\u2010\000 \u0333\000.\000..\000...\000\u2032\u2032\000"+ - "\u2032\u2032\u2032\000\u2035\u2035\000\u2035\u2035\u2035\000!!\000 \u0305"+ - "\000?!\000!?\0000\0005\0006\0007\0008\0009\000+\000\u2212\000=\000(\000"+ - ")\000Rs\000a/c\000a/s\000C\000\u00B0C\000c/o\000c/u\000\u0190\000\u00B0"+ - "F\000g\000H\000\u0127\000I\000L\000N\000No\000P\000Q\000R\000SM\000TE"+ - "L\000TM\000B\000e\000E\000\u05D0\000\u05D1\000\u05D2\000\u05D3\000i\000"+ - "1\u20443\0002\u20443\0001\u20445\0002\u20445\0003\u20445\0004\u20445\000"+ - "1\u20446\0005\u20446\0001\u20448\0003\u20448\0005\u20448\0007\u20448\000"+ - "1\u2044\000II\000III\000IV\000VI\000VII\000VIII\000IX\000XI\000XII\000"+ - "D\000ii\000iii\000iv\000vi\000vii\000viii\000ix\000xi\000xii\000d\000"+ - "m\000\u222B\u222B\000\u222B\u222B\u222B\000\u222E\u222E\000\u222E\u222E"+ - "\u222E\00010\00011\00012\00013\00014\00015\00016\00017\00018\00019\000"+ - "20\000(1)\000(2)\000(3)\000(4)\000(5)\000(6)\000(7)\000(8)\000(9)\000"+ - "(10)\000(11)\000(12)\000(13)\000(14)\000(15)\000(16)\000(17)\000(18)\000"+ - "(19)\000(20)\0001.\0002.\0003.\0004.\0005.\0006.\0007.\0008.\0009.\000"+ - "10.\00011.\00012.\00013.\00014.\00015.\00016.\00017.\00018.\00019.\000"+ - "20.\000(a)\000(b)\000(c)\000(d)\000(e)\000(f)\000(g)\000(h)\000(i)\000"+ - "(j)\000(k)\000(l)\000(m)\000(n)\000(o)\000(p)\000(q)\000(r)\000(s)\000"+ - "(t)\000(u)\000(v)\000(w)\000(x)\000(y)\000(z)\000A\000G\000K\000O\000"+ - "S\000T\000U\000W\000Y\000b\000f\000k\000p\000q\000t\000\u6BCD\000\u9F9F"+ - "\000\u4E00\000\u4E28\000\u4E36\000\u4E3F\000\u4E59\000\u4E85\000\u4E8C"+ - "\000\u4EA0\000\u4EBA\000\u513F\000\u5165\000\u516B\000\u5182\000\u5196"+ - "\000\u51AB\000\u51E0\000\u51F5\000\u5200\000\u529B\000\u52F9\000\u5315"+ - "\000\u531A\000\u5338\000\u5341\000\u535C\000\u5369\000\u5382\000\u53B6"+ - "\000\u53C8\000\u53E3\000\u56D7\000\u571F\000\u58EB\000\u5902\000\u590A"+ - "\000\u5915\000\u5927\000\u5973\000\u5B50\000\u5B80\000\u5BF8\000\u5C0F"+ - "\000\u5C22\000\u5C38\000\u5C6E\000\u5C71\000\u5DDB\000\u5DE5\000\u5DF1"+ - "\000\u5DFE\000\u5E72\000\u5E7A\000\u5E7F\000\u5EF4\000\u5EFE\000\u5F0B"+ - "\000\u5F13\000\u5F50\000\u5F61\000\u5F73\000\u5FC3\000\u6208\000\u6236"+ - "\000\u624B\000\u652F\000\u6534\000\u6587\000\u6597\000\u65A4\000\u65B9"+ - "\000\u65E0\000\u65E5\000\u66F0\000\u6708\000\u6728\000\u6B20\000\u6B62"+ - "\000\u6B79\000\u6BB3\000\u6BCB\000\u6BD4\000\u6BDB\000\u6C0F\000\u6C14"+ - "\000\u6C34\000\u706B\000\u722A\000\u7236\000\u723B\000\u723F\000\u7247"+ - "\000\u7259\000\u725B\000\u72AC\000\u7384\000\u7389\000\u74DC\000\u74E6"+ - "\000\u7518\000\u751F\000\u7528\000\u7530\000\u758B\000\u7592\000\u7676"+ - "\000\u767D\000\u76AE\000\u76BF\000\u76EE\000\u77DB\000\u77E2\000\u77F3"+ - "\000\u793A\000\u79B8\000\u79BE\000\u7A74\000\u7ACB\000\u7AF9\000\u7C73"+ - "\000\u7CF8\000\u7F36\000\u7F51\000\u7F8A\000\u7FBD\000\u8001\000\u800C"+ - "\000\u8012\000\u8033\000\u807F\000\u8089\000\u81E3\000\u81EA\000\u81F3"+ - "\000\u81FC\000\u820C\000\u821B\000\u821F\000\u826E\000\u8272\000\u8278"+ - "\000\u864D\000\u866B\000\u8840\000\u884C\000\u8863\000\u897E\000\u898B"+ - "\000\u89D2\000\u8A00\000\u8C37\000\u8C46\000\u8C55\000\u8C78\000\u8C9D"+ - "\000\u8D64\000\u8D70\000\u8DB3\000\u8EAB\000\u8ECA\000\u8F9B\000\u8FB0"+ - "\000\u8FB5\000\u9091\000\u9149\000\u91C6\000\u91CC\000\u91D1\000\u9577"+ - "\000\u9580\000\u961C\000\u96B6\000\u96B9\000\u96E8\000\u9751\000\u975E"+ - "\000\u9762\000\u9769\000\u97CB\000\u97ED\000\u97F3\000\u9801\000\u98A8"+ - "\000\u98DB\000\u98DF\000\u9996\000\u9999\000\u99AC\000\u9AA8\000\u9AD8"+ - "\000\u9ADF\000\u9B25\000\u9B2F\000\u9B32\000\u9B3C\000\u9B5A\000\u9CE5"+ - "\000\u9E75\000\u9E7F\000\u9EA5\000\u9EBB\000\u9EC3\000\u9ECD\000\u9ED1"+ - "\000\u9EF9\000\u9EFD\000\u9F0E\000\u9F13\000\u9F20\000\u9F3B\000\u9F4A"+ - "\000\u9F52\000\u9F8D\000\u9F9C\000\u9FA0\000\u3012\000\u5344\000\u5345"+ - "\000 \u3099\000 \u309A\000\u1100\000\u1101\000\u11AA\000\u1102\000\u11AC"+ - "\000\u11AD\000\u1103\000\u1104\000\u1105\000\u11B0\000\u11B1\000\u11B2"+ - "\000\u11B3\000\u11B4\000\u11B5\000\u111A\000\u1106\000\u1107\000\u1108"+ - "\000\u1121\000\u1109\000\u110A\000\u110B\000\u110C\000\u110D\000\u110E"+ - "\000\u110F\000\u1110\000\u1111\000\u1112\000\u1161\000\u1162\000\u1163"+ - "\000\u1164\000\u1165\000\u1166\000\u1167\000\u1168\000\u1169\000\u116A"+ - "\000\u116B\000\u116C\000\u116D\000\u116E\000\u116F\000\u1170\000\u1171"+ - "\000\u1172\000\u1173\000\u1174\000\u1175\000\u1160\000\u1114\000\u1115"+ - "\000\u11C7\000\u11C8\000\u11CC\000\u11CE\000\u11D3\000\u11D7\000\u11D9"+ - "\000\u111C\000\u11DD\000\u11DF\000\u111D\000\u111E\000\u1120\000\u1122"+ - "\000\u1123\000\u1127\000\u1129\000\u112B\000\u112C\000\u112D\000\u112E"+ - "\000\u112F\000\u1132\000\u1136\000\u1140\000\u1147\000\u114C\000\u11F1"+ - "\000\u11F2\000\u1157\000\u1158\000\u1159\000\u1184\000\u1185\000\u1188"+ - "\000\u1191\000\u1192\000\u1194\000\u119E\000\u11A1\000\u4E09\000\u56DB"+ - "\000\u4E0A\000\u4E2D\000\u4E0B\000\u7532\000\u4E19\000\u4E01\000\u5929"+ - "\000\u5730\000(\u1100)\000(\u1102)\000(\u1103)\000(\u1105)\000(\u1106"+ - ")\000(\u1107)\000(\u1109)\000(\u110B)\000(\u110C)\000(\u110E)\000(\u110F"+ - ")\000(\u1110)\000(\u1111)\000(\u1112)\000(\u1100\u1161)\000(\u1102\u1161"+ - ")\000(\u1103\u1161)\000(\u1105\u1161)\000(\u1106\u1161)\000(\u1107\u1161"+ - ")\000(\u1109\u1161)\000(\u110B\u1161)\000(\u110C\u1161)\000(\u110E\u1161"+ - ")\000(\u110F\u1161)\000(\u1110\u1161)\000(\u1111\u1161)\000(\u1112\u1161"+ - ")\000(\u110C\u116E)\000(\u4E00)\000(\u4E8C)\000(\u4E09)\000(\u56DB)\000"+ - "(\u4E94)\000(\u516D)\000(\u4E03)\000(\u516B)\000(\u4E5D)\000(\u5341)\000"+ - "(\u6708)\000(\u706B)\000(\u6C34)\000(\u6728)\000(\u91D1)\000(\u571F)\000"+ - "(\u65E5)\000(\u682A)\000(\u6709)\000(\u793E)\000(\u540D)\000(\u7279)\000"+ - "(\u8CA1)\000(\u795D)\000(\u52B4)\000(\u4EE3)\000(\u547C)\000(\u5B66)\000"+ - "(\u76E3)\000(\u4F01)\000(\u8CC7)\000(\u5354)\000(\u796D)\000(\u4F11)\000"+ - "(\u81EA)\000(\u81F3)\000\u1100\u1161\000\u1102\u1161\000\u1103\u1161\000"+ - "\u1105\u1161\000\u1106\u1161\000\u1107\u1161\000\u1109\u1161\000\u110B"+ - "\u1161\000\u110C\u1161\000\u110E\u1161\000\u110F\u1161\000\u1110\u1161"+ - "\000\u1111\u1161\000\u1112\u1161\000\u4E94\000\u516D\000\u4E03\000\u4E5D"+ - "\000\u682A\000\u6709\000\u793E\000\u540D\000\u7279\000\u8CA1\000\u795D"+ - "\000\u52B4\000\u79D8\000\u7537\000\u9069\000\u512A\000\u5370\000\u6CE8"+ - "\000\u9805\000\u4F11\000\u5199\000\u6B63\000\u5DE6\000\u53F3\000\u533B"+ - "\000\u5B97\000\u5B66\000\u76E3\000\u4F01\000\u8CC7\000\u5354\000\u591C"+ - "\0001\u6708\0002\u6708\0003\u6708\0004\u6708\0005\u6708\0006\u6708\000"+ - "7\u6708\0008\u6708\0009\u6708\00010\u6708\00011\u6708\00012\u6708\000"+ - "\u30A2\000\u30A4\000\u30A6\000\u30A8\000\u30AA\000\u30AB\000\u30AD\000"+ - "\u30AF\000\u30B1\000\u30B3\000\u30B5\000\u30B7\000\u30B9\000\u30BB\000"+ - "\u30BD\000\u30BF\000\u30C1\000\u30C4\000\u30C6\000\u30C8\000\u30CA\000"+ - "\u30CB\000\u30CC\000\u30CD\000\u30CE\000\u30CF\000\u30D2\000\u30D5\000"+ - "\u30D8\000\u30DB\000\u30DE\000\u30DF\000\u30E0\000\u30E1\000\u30E2\000"+ - "\u30E4\000\u30E6\000\u30E8\000\u30E9\000\u30EA\000\u30EB\000\u30EC\000"+ - "\u30ED\000\u30EF\000\u30F0\000\u30F1\000\u30F2\000\u30A2\u30CF\u309A\u30FC"+ - "\u30C8\000\u30A2\u30EB\u30D5\u30A1\000\u30A2\u30F3\u30D8\u309A\u30A2\000"+ - "\u30A2\u30FC\u30EB\000\u30A4\u30CB\u30F3\u30AF\u3099\000\u30A4\u30F3\u30C1"+ - "\000\u30A6\u30A9\u30F3\000\u30A8\u30B9\u30AF\u30FC\u30C8\u3099\000\u30A8"+ - "\u30FC\u30AB\u30FC\000\u30AA\u30F3\u30B9\000\u30AA\u30FC\u30E0\000\u30AB"+ - "\u30A4\u30EA\000\u30AB\u30E9\u30C3\u30C8\000\u30AB\u30ED\u30EA\u30FC\000"+ - "\u30AB\u3099\u30ED\u30F3\000\u30AB\u3099\u30F3\u30DE\000\u30AD\u3099\u30AB"+ - "\u3099\000\u30AD\u3099\u30CB\u30FC\000\u30AD\u30E5\u30EA\u30FC\000\u30AD"+ - "\u3099\u30EB\u30BF\u3099\u30FC\000\u30AD\u30ED\000\u30AD\u30ED\u30AF\u3099"+ - "\u30E9\u30E0\000\u30AD\u30ED\u30E1\u30FC\u30C8\u30EB\000\u30AD\u30ED\u30EF"+ - "\u30C3\u30C8\000\u30AF\u3099\u30E9\u30E0\u30C8\u30F3\000\u30AF\u30EB\u30BB"+ - "\u3099\u30A4\u30ED\000\u30AF\u30ED\u30FC\u30CD\000\u30B1\u30FC\u30B9\000"+ - "\u30B3\u30EB\u30CA\000\u30B3\u30FC\u30DB\u309A\000\u30B5\u30A4\u30AF\u30EB"+ - "\000\u30B5\u30F3\u30C1\u30FC\u30E0\000\u30B7\u30EA\u30F3\u30AF\u3099\000"+ - "\u30BB\u30F3\u30C1\000\u30BB\u30F3\u30C8\000\u30BF\u3099\u30FC\u30B9\000"+ - "\u30C6\u3099\u30B7\000\u30C8\u3099\u30EB\000\u30CA\u30CE\000\u30CE\u30C3"+ - "\u30C8\000\u30CF\u30A4\u30C4\000\u30CF\u309A\u30FC\u30BB\u30F3\u30C8\000"+ - "\u30CF\u309A\u30FC\u30C4\000\u30CF\u3099\u30FC\u30EC\u30EB\000\u30D2\u309A"+ - "\u30A2\u30B9\u30C8\u30EB\000\u30D2\u309A\u30AF\u30EB\000\u30D2\u309A\u30B3"+ - "\000\u30D2\u3099\u30EB\000\u30D5\u30A1\u30E9\u30C3\u30C8\u3099\000\u30D5"+ - "\u30A3\u30FC\u30C8\000\u30D5\u3099\u30C3\u30B7\u30A7\u30EB\000\u30D5\u30E9"+ - "\u30F3\000\u30D8\u30AF\u30BF\u30FC\u30EB\000\u30D8\u309A\u30BD\000\u30D8"+ - "\u309A\u30CB\u30D2\000\u30D8\u30EB\u30C4\000\u30D8\u309A\u30F3\u30B9\000"+ - "\u30D8\u309A\u30FC\u30B7\u3099\000\u30D8\u3099\u30FC\u30BF\000\u30DB\u309A"+ - "\u30A4\u30F3\u30C8\000\u30DB\u3099\u30EB\u30C8\000\u30DB\u30F3\000\u30DB"+ - "\u309A\u30F3\u30C8\u3099\000\u30DB\u30FC\u30EB\000\u30DB\u30FC\u30F3\000"+ - "\u30DE\u30A4\u30AF\u30ED\000\u30DE\u30A4\u30EB\000\u30DE\u30C3\u30CF\000"+ - "\u30DE\u30EB\u30AF\000\u30DE\u30F3\u30B7\u30E7\u30F3\000\u30DF\u30AF\u30ED"+ - "\u30F3\000\u30DF\u30EA\000\u30DF\u30EA\u30CF\u3099\u30FC\u30EB\000\u30E1"+ - "\u30AB\u3099\000\u30E1\u30AB\u3099\u30C8\u30F3\000\u30E4\u30FC\u30C8\u3099"+ - "\000\u30E4\u30FC\u30EB\000\u30E6\u30A2\u30F3\000\u30EA\u30C3\u30C8\u30EB"+ - "\000\u30EA\u30E9\000\u30EB\u30D2\u309A\u30FC\000\u30EB\u30FC\u30D5\u3099"+ - "\u30EB\000\u30EC\u30E0\000\u30EC\u30F3\u30C8\u30B1\u3099\u30F3\0000\u70B9"+ - "\0001\u70B9\0002\u70B9\0003\u70B9\0004\u70B9\0005\u70B9\0006\u70B9\000"+ - "7\u70B9\0008\u70B9\0009\u70B9\00010\u70B9\00011\u70B9\00012\u70B9\000"+ - "13\u70B9\00014\u70B9\00015\u70B9\00016\u70B9\00017\u70B9\00018\u70B9\000"+ - "19\u70B9\00020\u70B9\00021\u70B9\00022\u70B9\00023\u70B9\00024\u70B9\000"+ - "hPa\000da\000AU\000bar\000oV\000pc\000\u5E73\u6210\000\u662D\u548C\000"+ - "\u5927\u6B63\000\u660E\u6CBB\000\u682A\u5F0F\u4F1A\u793E\000pA\000nA\000"+ - "\u03BCA\000mA\000kA\000KB\000MB\000GB\000cal\000kcal\000pF\000nF\000\u03BC"+ - "F\000\u03BCg\000mg\000kg\000Hz\000kHz\000MHz\000GHz\000THz\000\u03BCl"+ - "\000ml\000dl\000kl\000fm\000nm\000\u03BCm\000mm\000cm\000km\000mm2\000"+ - "cm2\000km2\000mm3\000cm3\000km3\000m\u2215s\000m\u2215s2\000kPa\000MP"+ - "a\000GPa\000rad\000rad\u2215s\000rad\u2215s2\000ps\000ns\000\u03BCs\000"+ - "ms\000pV\000nV\000\u03BCV\000mV\000kV\000MV\000pW\000nW\000\u03BCW\000"+ - "mW\000kW\000MW\000k\u03A9\000M\u03A9\000a.m.\000Bq\000cc\000cd\000C\u2215"+ - "kg\000Co.\000dB\000Gy\000ha\000HP\000in\000KK\000KM\000kt\000lm\000ln"+ - "\000log\000lx\000mb\000mil\000mol\000PH\000p.m.\000PPM\000PR\000sr\000"+ - "Sv\000Wb\0001\u65E5\0002\u65E5\0003\u65E5\0004\u65E5\0005\u65E5\0006\u65E5"+ - "\0007\u65E5\0008\u65E5\0009\u65E5\00010\u65E5\00011\u65E5\00012\u65E5"+ - "\00013\u65E5\00014\u65E5\00015\u65E5\00016\u65E5\00017\u65E5\00018\u65E5"+ - "\00019\u65E5\00020\u65E5\00021\u65E5\00022\u65E5\00023\u65E5\00024\u65E5"+ - "\00025\u65E5\00026\u65E5\00027\u65E5\00028\u65E5\00029\u65E5\00030\u65E5"+ - "\00031\u65E5\000ff\000fi\000fl\000ffi\000ffl\000st\000\u0574\u0576\000"+ - "\u0574\u0565\000\u0574\u056B\000\u057E\u0576\000\u0574\u056D\000\u05E2"+ - "\000\u05D4\000\u05DB\000\u05DC\000\u05DD\000\u05E8\000\u05EA\000\u05D0"+ - "\u05DC\000\u0671\000\u067B\000\u067E\000\u0680\000\u067A\000\u067F\000"+ - "\u0679\000\u06A4\000\u06A6\000\u0684\000\u0683\000\u0686\000\u0687\000"+ - "\u068D\000\u068C\000\u068E\000\u0688\000\u0698\000\u0691\000\u06A9\000"+ - "\u06AF\000\u06B3\000\u06B1\000\u06BA\000\u06BB\000\u06D5\u0654\000\u06C1"+ - "\000\u06BE\000\u06D2\000\u06D2\u0654\000\u06AD\000\u06C7\000\u06C6\000"+ - "\u06C8\000\u06CB\000\u06C5\000\u06C9\000\u06D0\000\u0649\000\u064A\u0654"+ - "\u0627\000\u064A\u0654\u06D5\000\u064A\u0654\u0648\000\u064A\u0654\u06C7"+ - "\000\u064A\u0654\u06C6\000\u064A\u0654\u06C8\000\u064A\u0654\u06D0\000"+ - "\u064A\u0654\u0649\000\u06CC\000\u064A\u0654\u062C\000\u064A\u0654\u062D"+ - "\000\u064A\u0654\u0645\000\u064A\u0654\u064A\000\u0628\u062C\000\u0628"+ - "\u062D\000\u0628\u062E\000\u0628\u0645\000\u0628\u0649\000\u0628\u064A"+ - "\000\u062A\u062C\000\u062A\u062D\000\u062A\u062E\000\u062A\u0645\000\u062A"+ - "\u0649\000\u062A\u064A\000\u062B\u062C\000\u062B\u0645\000\u062B\u0649"+ - "\000\u062B\u064A\000\u062C\u062D\000\u062C\u0645\000\u062D\u062C\000\u062D"+ - "\u0645\000\u062E\u062C\000\u062E\u062D\000\u062E\u0645\000\u0633\u062C"+ - "\000\u0633\u062D\000\u0633\u062E\000\u0633\u0645\000\u0635\u062D\000\u0635"+ - "\u0645\000\u0636\u062C\000\u0636\u062D\000\u0636\u062E\000\u0636\u0645"+ - "\000\u0637\u062D\000\u0637\u0645\000\u0638\u0645\000\u0639\u062C\000\u0639"+ - "\u0645\000\u063A\u062C\000\u063A\u0645\000\u0641\u062C\000\u0641\u062D"+ - "\000\u0641\u062E\000\u0641\u0645\000\u0641\u0649\000\u0641\u064A\000\u0642"+ - "\u062D\000\u0642\u0645\000\u0642\u0649\000\u0642\u064A\000\u0643\u0627"+ - "\000\u0643\u062C\000\u0643\u062D\000\u0643\u062E\000\u0643\u0644\000\u0643"+ - "\u0645\000\u0643\u0649\000\u0643\u064A\000\u0644\u062C\000\u0644\u062D"+ - "\000\u0644\u062E\000\u0644\u0645\000\u0644\u0649\000\u0644\u064A\000\u0645"+ - "\u062C\000\u0645\u062D\000\u0645\u062E\000\u0645\u0645\000\u0645\u0649"+ - "\000\u0645\u064A\000\u0646\u062C\000\u0646\u062D\000\u0646\u062E\000\u0646"+ - "\u0645\000\u0646\u0649\000\u0646\u064A\000\u0647\u062C\000\u0647\u0645"+ - "\000\u0647\u0649\000\u0647\u064A\000\u064A\u062C\000\u064A\u062D\000\u064A"+ - "\u062E\000\u064A\u0645\000\u064A\u0649\000\u064A\u064A\000\u0630\u0670"+ - "\000\u0631\u0670\000\u0649\u0670\000 \u064C\u0651\000 \u064D\u0651\000"+ - " \u064E\u0651\000 \u064F\u0651\000 \u0650\u0651\000 \u0651\u0670\000\u064A"+ - "\u0654\u0631\000\u064A\u0654\u0632\000\u064A\u0654\u0646\000\u0628\u0631"+ - "\000\u0628\u0632\000\u0628\u0646\000\u062A\u0631\000\u062A\u0632\000\u062A"+ - "\u0646\000\u062B\u0631\000\u062B\u0632\000\u062B\u0646\000\u0645\u0627"+ - "\000\u0646\u0631\000\u0646\u0632\000\u0646\u0646\000\u064A\u0631\000\u064A"+ - "\u0632\000\u064A\u0646\000\u064A\u0654\u062E\000\u064A\u0654\u0647\000"+ - "\u0628\u0647\000\u062A\u0647\000\u0635\u062E\000\u0644\u0647\000\u0646"+ - "\u0647\000\u0647\u0670\000\u064A\u0647\000\u062B\u0647\000\u0633\u0647"+ - "\000\u0634\u0645\000\u0634\u0647\000\u0640\u064E\u0651\000\u0640\u064F"+ - "\u0651\000\u0640\u0650\u0651\000\u0637\u0649\000\u0637\u064A\000\u0639"+ - "\u0649\000\u0639\u064A\000\u063A\u0649\000\u063A\u064A\000\u0633\u0649"+ - "\000\u0633\u064A\000\u0634\u0649\000\u0634\u064A\000\u062D\u0649\000\u062D"+ - "\u064A\000\u062C\u0649\000\u062C\u064A\000\u062E\u0649\000\u062E\u064A"+ - "\000\u0635\u0649\000\u0635\u064A\000\u0636\u0649\000\u0636\u064A\000\u0634"+ - "\u062C\000\u0634\u062D\000\u0634\u062E\000\u0634\u0631\000\u0633\u0631"+ - "\000\u0635\u0631\000\u0636\u0631\000\u0627\u064B\000\u062A\u062C\u0645"+ - "\000\u062A\u062D\u062C\000\u062A\u062D\u0645\000\u062A\u062E\u0645\000"+ - "\u062A\u0645\u062C\000\u062A\u0645\u062D\000\u062A\u0645\u062E\000\u062C"+ - "\u0645\u062D\000\u062D\u0645\u064A\000\u062D\u0645\u0649\000\u0633\u062D"+ - "\u062C\000\u0633\u062C\u062D\000\u0633\u062C\u0649\000\u0633\u0645\u062D"+ - "\000\u0633\u0645\u062C\000\u0633\u0645\u0645\000\u0635\u062D\u062D\000"+ - "\u0635\u0645\u0645\000\u0634\u062D\u0645\000\u0634\u062C\u064A\000\u0634"+ - "\u0645\u062E\000\u0634\u0645\u0645\000\u0636\u062D\u0649\000\u0636\u062E"+ - "\u0645\000\u0637\u0645\u062D\000\u0637\u0645\u0645\000\u0637\u0645\u064A"+ - "\000\u0639\u062C\u0645\000\u0639\u0645\u0645\000\u0639\u0645\u0649\000"+ - "\u063A\u0645\u0645\000\u063A\u0645\u064A\000\u063A\u0645\u0649\000\u0641"+ - "\u062E\u0645\000\u0642\u0645\u062D\000\u0642\u0645\u0645\000\u0644\u062D"+ - "\u0645\000\u0644\u062D\u064A\000\u0644\u062D\u0649\000\u0644\u062C\u062C"+ - "\000\u0644\u062E\u0645\000\u0644\u0645\u062D\000\u0645\u062D\u062C\000"+ - "\u0645\u062D\u0645\000\u0645\u062D\u064A\000\u0645\u062C\u062D\000\u0645"+ - "\u062C\u0645\000\u0645\u062E\u062C\000\u0645\u062E\u0645\000\u0645\u062C"+ - "\u062E\000\u0647\u0645\u062C\000\u0647\u0645\u0645\000\u0646\u062D\u0645"+ - "\000\u0646\u062D\u0649\000\u0646\u062C\u0645\000\u0646\u062C\u0649\000"+ - "\u0646\u0645\u064A\000\u0646\u0645\u0649\000\u064A\u0645\u0645\000\u0628"+ - "\u062E\u064A\000\u062A\u062C\u064A\000\u062A\u062C\u0649\000\u062A\u062E"+ - "\u064A\000\u062A\u062E\u0649\000\u062A\u0645\u064A\000\u062A\u0645\u0649"+ - "\000\u062C\u0645\u064A\000\u062C\u062D\u0649\000\u062C\u0645\u0649\000"+ - "\u0633\u062E\u0649\000\u0635\u062D\u064A\000\u0634\u062D\u064A\000\u0636"+ - "\u062D\u064A\000\u0644\u062C\u064A\000\u0644\u0645\u064A\000\u064A\u062D"+ - "\u064A\000\u064A\u062C\u064A\000\u064A\u0645\u064A\000\u0645\u0645\u064A"+ - "\000\u0642\u0645\u064A\000\u0646\u062D\u064A\000\u0639\u0645\u064A\000"+ - "\u0643\u0645\u064A\000\u0646\u062C\u062D\000\u0645\u062E\u064A\000\u0644"+ - "\u062C\u0645\000\u0643\u0645\u0645\000\u062C\u062D\u064A\000\u062D\u062C"+ - "\u064A\000\u0645\u062C\u064A\000\u0641\u0645\u064A\000\u0628\u062D\u064A"+ - "\000\u0633\u062E\u064A\000\u0646\u062C\u064A\000\u0635\u0644\u06D2\000"+ - "\u0642\u0644\u06D2\000\u0627\u0644\u0644\u0647\000\u0627\u0643\u0628\u0631"+ - "\000\u0645\u062D\u0645\u062F\000\u0635\u0644\u0639\u0645\000\u0631\u0633"+ - "\u0648\u0644\000\u0639\u0644\u064A\u0647\000\u0648\u0633\u0644\u0645\000"+ - "\u0635\u0644\u0649\000\u0635\u0644\u0649 \u0627\u0644\u0644\u0647 \u0639"+ - "\u0644\u064A\u0647 \u0648\u0633\u0644\u0645\000\u062C\u0644 \u062C\u0644"+ - "\u0627\u0644\u0647\000\u2014\000\u2013\000_\000{\000}\000\u3014\000\u3015"+ - "\000\u3010\000\u3011\000\u300A\000\u300B\000\u3008\000\u3009\000\u300C"+ - "\000\u300D\000\u300E\000\u300F\000,\000\u3001\000;\000:\000#\000&\000"+ - "*\000-\000<\000>\000\134\000$\000%\000@\000 \u064B\000\u0640\u064B\000"+ - " \u064C\000 \u064D\000 \u064E\000\u0640\u064E\000 \u064F\000\u0640\u064F"+ - "\000 \u0650\000\u0640\u0650\000 \u0651\000\u0640\u0651\000 \u0652\000"+ - "\u0640\u0652\000\u0621\000\u0627\u0653\000\u0627\u0654\000\u0648\u0654"+ - "\000\u0627\u0655\000\u064A\u0654\000\u0628\000\u0629\000\u062A\000\u062B"+ - "\000\u0630\000\u0633\000\u0634\000\u0635\000\u0636\000\u0637\000\u0638"+ - "\000\u0639\000\u063A\000\u0641\000\u0642\000\u0643\000\u0644\u0627\u0653"+ - "\000\u0644\u0627\u0654\000\u0644\u0627\u0655\000\u0644\u0627\000\042\000"+ - "'\000/\000[\000]\000^\000`\000|\000~\000\u3002\000\u30FB\000\u30A3\000"+ - "\u30A5\000\u30A7\000\u30A9\000\u30E3\000\u30E5\000\u30E7\000\u30C3\000"+ - "\u00A2\000\u00A3\000\u00AC\000\u00A6\000\u00A5\000\u20A9\000\u2502\000"+ - "\u2190\000\u2191\000\u2192\000\u2193\000\u25A0\000\u25CB\000\u0300\000"+ - "\u0301\000\u0313\000\u0308\u0301\000\u02B9\000;\000\u00B7\000\u0915\u093C"+ - "\000\u0916\u093C\000\u0917\u093C\000\u091C\u093C\000\u0921\u093C\000\u0922"+ - "\u093C\000\u092B\u093C\000\u092F\u093C\000\u09A1\u09BC\000\u09A2\u09BC"+ - "\000\u09AF\u09BC\000\u0A32\u0A3C\000\u0A38\u0A3C\000\u0A16\u0A3C\000\u0A17"+ - "\u0A3C\000\u0A1C\u0A3C\000\u0A2B\u0A3C\000\u0B21\u0B3C\000\u0B22\u0B3C"+ - "\000\u0F42\u0FB7\000\u0F4C\u0FB7\000\u0F51\u0FB7\000\u0F56\u0FB7\000\u0F5B"+ - "\u0FB7\000\u0F40\u0FB5\000\u0F71\u0F72\000\u0F71\u0F74\000\u0FB2\u0F80"+ - "\000\u0FB3\u0F80\000\u0F71\u0F80\000\u0F92\u0FB7\000\u0F9C\u0FB7\000\u0FA1"+ - "\u0FB7\000\u0FA6\u0FB7\000\u0FAB\u0FB7\000\u0F90\u0FB5\000\u03B1\u0301"+ - "\000\u03B5\u0301\000\u03B7\u0301\000\u03B9\u0301\000\u03BF\u0301\000\u03C5"+ - "\u0301\000\u03C9\u0301\000\u0391\u0301\000\u03B9\000\u0395\u0301\000\u0397"+ - "\u0301\000\u03B9\u0308\u0301\000\u0399\u0301\000\u03C5\u0308\u0301\000"+ - "\u03A5\u0301\000`\000\u039F\u0301\000\u03A9\u0301\000\u03A9\000K\000A"+ - "\u030A\000\u3008\000\u3009\000\u8C48\000\u66F4\000\u8ECA\000\u8CC8\000"+ - "\u6ED1\000\u4E32\000\u53E5\000\u9F9C\000\u9F9C\000\u5951\000\u91D1\000"+ - "\u5587\000\u5948\000\u61F6\000\u7669\000\u7F85\000\u863F\000\u87BA\000"+ - "\u88F8\000\u908F\000\u6A02\000\u6D1B\000\u70D9\000\u73DE\000\u843D\000"+ - "\u916A\000\u99F1\000\u4E82\000\u5375\000\u6B04\000\u721B\000\u862D\000"+ - "\u9E1E\000\u5D50\000\u6FEB\000\u85CD\000\u8964\000\u62C9\000\u81D8\000"+ - "\u881F\000\u5ECA\000\u6717\000\u6D6A\000\u72FC\000\u90CE\000\u4F86\000"+ - "\u51B7\000\u52DE\000\u64C4\000\u6AD3\000\u7210\000\u76E7\000\u8001\000"+ - "\u8606\000\u865C\000\u8DEF\000\u9732\000\u9B6F\000\u9DFA\000\u788C\000"+ - "\u797F\000\u7DA0\000\u83C9\000\u9304\000\u9E7F\000\u8AD6\000\u58DF\000"+ - "\u5F04\000\u7C60\000\u807E\000\u7262\000\u78CA\000\u8CC2\000\u96F7\000"+ - "\u58D8\000\u5C62\000\u6A13\000\u6DDA\000\u6F0F\000\u7D2F\000\u7E37\000"+ - "\u96FB\000\u52D2\000\u808B\000\u51DC\000\u51CC\000\u7A1C\000\u7DBE\000"+ - "\u83F1\000\u9675\000\u8B80\000\u62CF\000\u8AFE\000\u4E39\000\u5BE7\000"+ - "\u6012\000\u7387\000\u7570\000\u5317\000\u78FB\000\u4FBF\000\u5FA9\000"+ - "\u4E0D\000\u6CCC\000\u6578\000\u7D22\000\u53C3\000\u585E\000\u7701\000"+ - "\u8449\000\u8AAA\000\u6BBA\000\u8FB0\000\u6C88\000\u62FE\000\u82E5\000"+ - "\u63A0\000\u7565\000\u4EAE\000\u5169\000\u51C9\000\u6881\000\u7CE7\000"+ - "\u826F\000\u8AD2\000\u91CF\000\u52F5\000\u5442\000\u5973\000\u5EEC\000"+ - "\u65C5\000\u6FFE\000\u792A\000\u95AD\000\u9A6A\000\u9E97\000\u9ECE\000"+ - "\u529B\000\u66C6\000\u6B77\000\u8F62\000\u5E74\000\u6190\000\u6200\000"+ - "\u649A\000\u6F23\000\u7149\000\u7489\000\u79CA\000\u7DF4\000\u806F\000"+ - "\u8F26\000\u84EE\000\u9023\000\u934A\000\u5217\000\u52A3\000\u54BD\000"+ - "\u70C8\000\u88C2\000\u5EC9\000\u5FF5\000\u637B\000\u6BAE\000\u7C3E\000"+ - "\u7375\000\u4EE4\000\u56F9\000\u5DBA\000\u601C\000\u73B2\000\u7469\000"+ - "\u7F9A\000\u8046\000\u9234\000\u96F6\000\u9748\000\u9818\000\u4F8B\000"+ - "\u79AE\000\u91B4\000\u96B8\000\u60E1\000\u4E86\000\u50DA\000\u5BEE\000"+ - "\u5C3F\000\u6599\000\u71CE\000\u7642\000\u84FC\000\u907C\000\u9F8D\000"+ - "\u6688\000\u962E\000\u5289\000\u677B\000\u67F3\000\u6D41\000\u6E9C\000"+ - "\u7409\000\u7559\000\u786B\000\u7D10\000\u985E\000\u516D\000\u622E\000"+ - "\u9678\000\u502B\000\u5D19\000\u6DEA\000\u8F2A\000\u5F8B\000\u6144\000"+ - "\u6817\000\u9686\000\u5229\000\u540F\000\u5C65\000\u6613\000\u674E\000"+ - "\u68A8\000\u6CE5\000\u7406\000\u75E2\000\u7F79\000\u88CF\000\u88E1\000"+ - "\u91CC\000\u96E2\000\u533F\000\u6EBA\000\u541D\000\u71D0\000\u7498\000"+ - "\u85FA\000\u96A3\000\u9C57\000\u9E9F\000\u6797\000\u6DCB\000\u81E8\000"+ - "\u7ACB\000\u7B20\000\u7C92\000\u72C0\000\u7099\000\u8B58\000\u4EC0\000"+ - "\u8336\000\u523A\000\u5207\000\u5EA6\000\u62D3\000\u7CD6\000\u5B85\000"+ - "\u6D1E\000\u66B4\000\u8F3B\000\u884C\000\u964D\000\u898B\000\u5ED3\000"+ - "\u5140\000\u55C0\000\u585A\000\u6674\000\u51DE\000\u732A\000\u76CA\000"+ - "\u793C\000\u795E\000\u7965\000\u798F\000\u9756\000\u7CBE\000\u7FBD\000"+ - "\u8612\000\u8AF8\000\u9038\000\u90FD\000\u98EF\000\u98FC\000\u9928\000"+ - "\u9DB4\000\u05F2\u05B7\000\u05E9\u05C1\000\u05E9\u05C2\000\u05E9\u05BC"+ - "\u05C1\000\u05E9\u05BC\u05C2\000\u05D0\u05B7\000\u05D0\u05B8\000\u05D0"+ - "\u05BC\000\u05D1\u05BC\000\u05D2\u05BC\000\u05D3\u05BC\000\u05D4\u05BC"+ - "\000\u05D5\u05BC\000\u05D6\u05BC\000\u05D8\u05BC\000\u05D9\u05BC\000\u05DA"+ - "\u05BC\000\u05DB\u05BC\000\u05DC\u05BC\000\u05DE\u05BC\000\u05E0\u05BC"+ - "\000\u05E1\u05BC\000\u05E3\u05BC\000\u05E4\u05BC\000\u05E6\u05BC\000\u05E7"+ - "\u05BC\000\u05E8\u05BC\000\u05E9\u05BC\000\u05EA\u05BC\000\u05D5\u05B9"+ - "\000\u05D1\u05BF\000\u05DB\u05BF\000\u05E4\u05BF\000\u0385\000\u00B4\000"+ - "\u2002\000\u2003\000\u0172\u0303\u0301\000\u1E76\u0308\u0304\000\u01EB"+ - "\u031B\u0301\000\u1EB9\u0304\u0300\000\u1E72\u0303\u0301\000\u1E11\u030C"+ - "\000\u1EE4\u0303\u0301\000\u1EE3\u0301\000\u0172\u0308\u0304\000\u1E0D"+ - "\u030C\000\u1E72\u0308\u0304\000\u1EE4\u0308\u0304\000\u1EEE\u0301\000"+ - "\u01AF\u0308\u0304\000\u1E1A\u0304\u0300\000\u1E18\u0304\u0300\000\u1E0E"+ - "\u030C\000\u1E75\u030B\000\u0118\u0304\u0300\000\u1E12\u030C\000\u0228"+ - "\u0304\u0300\000\u1E75\u030C\000\u0173\u032D\000\u1E77\u030B\000\u01EA"+ - "\u031B\u0301\000\u1E77\u030C\000\u1EB8\u0304\u0300\000\u1E10\u030C\000"+ - "\u0173\u030B\000\u1EE2\u0301\000\u0173\u030C\000\u1E0C\u030C\000\u1E73"+ - "\u030B\000\u1EE5\u030B\000\u1E73\u030C\000\u1EE5\u030C\000\u01B0\u032D"+ - "\000\u01B0\u030B\000\u01B0\u030C\000\u1E74\u030B\000\u1E11\u032D\000\u1E74"+ - "\u030C\000\u0172\u032D\000\u1E76\u030B\000\u01EB\u0323\u0302\000\u1E76"+ - "\u030C\000\u00E7\u030C\000\u0172\u030B\000\u0172\u030C\000\u1E72\u030B"+ - "\000\u1EE4\u030B\000\u1E72\u030C\000\u1EE4\u030C\000\u01AF\u032D\000\u1EE3"+ - "\u0302\000\u01AF\u030B\000\u01AF\u030C\000\u1E75\u030A\000\u1E10\u032D"+ - "\000\u1E77\u030A\000\u0173\u0330\000\u01EA\u0323\u0302\000\u00C7\u030C"+ - "\000\u0173\u030A\000\u01EB\u030C\000\u1E73\u030A\000\u1EE5\u030A\000\u1ECD"+ - "\u030C\000\u01B0\u0330\000\u1EE2\u0302\000\u01B0\u030A\000\u01A1\u030C"+ - "\000\u1E74\u030A\000\u1E76\u030A\000\u0172\u0330\000\u01EB\u0302\u0303"+ - "\000\u00E7\u0307\000\u0172\u030A\000\u01EA\u030C\000\u1ED9\u0303\000\u1E72"+ - "\u030A\000\u1EE4\u030A\000\u1ECC\u030C\000\u01AF\u0330\000\u01A1\u0302"+ - "\u0303\000\u01AF\u030A\000\u01A0\u030C\000\u0DDE\u0DCA\000\u1E75\u0306"+ - "\000\u1E2D\u030C\000\u1E77\u0306\000\u0173\u0324\000\u01EA\u0302\u0303"+ - "\000\u00C7\u0307\000\u0173\u0306\000\u012F\u030C\000\u1ED8\u0303\000\u1E73"+ - "\u0306\000\u1EE5\u0306\000\u1ECB\u030C\000\u01B0\u0324\000\u1EF5\u0304"+ - "\000\u01A0\u0302\u0303\000\u01B0\u0306\000\u1E74\u0306\000\u1E2C\u030C"+ - "\000\u1E11\u0331\000\u1E76\u0306\000\u0172\u0324\000\u01EB\u0302\u0309"+ - "\000\u00E7\u0302\000\u0172\u0306\000\u012E\u030C\000\u1ED9\u0309\000\u1E72"+ - "\u0306\000\u1EE4\u0306\000\u1ECA\u030C\000\u01AF\u0324\000\u1EF4\u0304"+ - "\000\u01A1\u0302\u0309\000\u01AF\u0306\000\u1E75\u0304\000\u1E10\u0331"+ - "\000\u1E77\u0304\000\u0163\u032D\000\u01EA\u0302\u0309\000\u00C7\u0302"+ - "\000\u0173\u0304\000\u0105\u030C\000\u1ED8\u0309\000\u1E73\u0304\000\u01EB"+ - "\u0307\u0304\000\u1EE5\u0304\000\u1E01\u030C\000\u1EA1\u030C\000\u1ECD"+ - "\u0307\u0304\000\u01A0\u0302\u0309\000\u01B0\u0304\000\u01A1\u0307\u0304"+ - "\000\u1E74\u0304\000\u1E11\u0323\000\u1E76\u0304\000\u0162\u032D\000\u01EB"+ - "\u0302\u0300\000\u0172\u0304\000\u0104\u030C\000\u1ED9\u0300\000\u1E72"+ - "\u0304\000\u01EA\u0307\u0304\000\u1EE4\u0304\000\u1E00\u030C\000\u1EA0"+ - "\u030C\000\u1ECC\u0307\u0304\000\u01A1\u0302\u0300\000\u01AF\u0304\000"+ - "\u01A0\u0307\u0304\000\u1E75\u0303\000\u1E10\u0323\000\u1E77\u0303\000"+ - "\u0163\u0331\000\u01EA\u0302\u0300\000\u0173\u0303\000\u1ED8\u0300\000"+ - "\u1E73\u0303\000\u01EB\u0307\000\u1EE5\u0303\000\u1ECD\u0307\000\u01A0"+ - "\u0302\u0300\000\u038F\u0345\000\u1FFA\u0345\000\u1E0F\u0307\000\u01A1"+ - "\u0307\000\u1E13\u0307\000\u1E74\u0303\000\u1E11\u0307\000\u1E76\u0303"+ - "\000\u0162\u0331\000\u01EB\u0302\u0301\000\u1E0D\u0307\000\u0172\u0303"+ - "\000\u1ED9\u0301\000\u1E72\u0303\000\u01EA\u0307\000\u1EE4\u0303\000\u1ECC"+ - "\u0307\000\u01A1\u0302\u0301\000\u1E0E\u0307\000\u01A0\u0307\000\u1E12"+ - "\u0307\000\u1E10\u0307\000\u0163\u0323\000\u01EA\u0302\u0301\000\u1E0C"+ - "\u0307\000\u1ED8\u0301\000\u01EB\u0303\u0304\000\u1ECD\u0303\u0304\000"+ - "\u01A0\u0302\u0301\000\u1EE1\u0304\000\u0162\u0323\000\u01EB\u0309\000"+ - "\u0105\u0306\000\u1E01\u0306\000\u1ECD\u0309\000\u01EA\u0303\u0304\000"+ - "\u1ECC\u0303\u0304\000\u1E6F\u0307\000\u1EE0\u0304\000\u1E71\u0307\000"+ - "\u1E6F\u030C\000\u1E71\u030C\000\u0163\u0307\000\u021B\u0307\000\u01EA"+ - "\u0309\000\u0104\u0306\000\u1E6D\u0307\000\u1E00\u0306\000\u0163\u030C"+ - "\000\u021B\u030C\000\u1ECC\u0309\000\u01EB\u0308\u0304\000\u1E6D\u030C"+ - "\000\u1ECD\u0308\u0304\000\u1E6E\u0307\000\u01A1\u0308\u0304\000\u1E70"+ - "\u0307\000\u1E6E\u030C\000\u1E70\u030C\000\u0162\u0307\000\u021A\u0307"+ - "\000\u01EB\u0323\000\u0105\u0304\000\u1E6C\u0307\000\u1E01\u0304\000\u0162"+ - "\u030C\000\u021A\u030C\000\u1EA1\u0304\000\u01EA\u0308\u0304\000\u1E6C"+ - "\u030C\000\u1ECC\u0308\u0304\000\u01A0\u0308\u0304\000\u015F\u0323\u0307"+ - "\000\u01EA\u0323\000\u0104\u0304\000\u1E00\u0304\000\u1EA0\u0304\000\u015E"+ - "\u0323\u0307\000\u012F\u0323\000\u1EF5\u0308\000\u015F\u030C\u0307\000"+ - "\u0219\u030C\u0307\000\u012E\u0323\000\u1E63\u030C\u0307\000\u015F\u030C"+ - "\000\u0219\u030C\000\u0105\u0307\000\u1E63\u030C\000\u1E01\u0307\000\u1EA1"+ - "\u0307\000\u1E07\u0307\000\u1E2D\u0309\000\u015E\u030C\u0307\000\u0218"+ - "\u030C\u0307\000\u012F\u0309\000\u1E05\u0307\000\u1E62\u030C\u0307\000"+ - "\u015E\u030C\000\u0218\u030C\000\u1ECB\u0309\000\u1EF5\u0301\000\u0104"+ - "\u0307\000\u1E62\u030C\000\u1E00\u0307\000\u1EA0\u0307\000\u1E06\u0307"+ - "\000\u1E2C\u0309\000\u1E75\u0308\000\u1E77\u0308\000\u015F\u0301\u0307"+ - "\000\u0219\u0301\u0307\000\u012E\u0309\000\u0173\u0308\000\u1E04\u0307"+ - "\000\u1E63\u0301\u0307\000\u1E73\u0308\000\u1ECA\u0309\000\u1EE5\u0308"+ - "\000\u01B0\u0308\000\u1E75\u0302\000\u1E77\u0302\000\u0105\u0325\000\u015E"+ - "\u0301\u0307\000\u0218\u0301\u0307\000\u0119\u0323\u0302\000\u0173\u0302"+ - "\000\u0229\u0323\u0302\000\u1E62\u0301\u0307\000\u1E73\u0302\000\u1EE5"+ - "\u0302\000\u01B0\u0302\000\u1E75\u0301\000\u1E77\u0301\000\u0104\u0325"+ - "\000\u015F\u0323\000\u0118\u0323\u0302\000\u0173\u0301\000\u0228\u0323"+ - "\u0302\000\u015F\u0302\000\u1E73\u0301\000\u0219\u0302\000\u1EE5\u0301"+ - "\000\u1E63\u0302\000\u1E1B\u0302\u0303\000\u1E75\u0300\000\u1E19\u0302"+ - "\u0303\000\u1E77\u0300\000\u015E\u0323\000\u0119\u0302\u0303\000\u0173"+ - "\u0300\000\u0229\u0302\u0303\000\u015E\u0302\000\u1E73\u0300\000\u0218"+ - "\u0302\000\u1EC7\u0303\000\u1EE5\u0300\000\u1E62\u0302\000\u1E1A\u0302"+ - "\u0303\000\u1E18\u0302\u0303\000\u015F\u0307\000\u0219\u0307\000\u0118"+ - "\u0302\u0303\000\u0228\u0302\u0303\000\u015F\u0301\000\u0219\u0301\000"+ - "\u1EC6\u0303\000\u1E63\u0301\000\u1E1B\u0302\u0309\000\u1E19\u0302\u0309"+ - "\000\u015E\u0307\000\u0218\u0307\000\u0119\u0302\u0309\000\u0229\u0302"+ - "\u0309\000\u015E\u0301\000\u0218\u0301\000\u1EC7\u0309\000\u1E62\u0301"+ - "\000\u1E1A\u0302\u0309\000\u1E5F\u030C\000\u1E18\u0302\u0309\000\u1E96"+ - "\u030C\000\u0157\u0331\000\u0118\u0302\u0309\000\u01EB\u0308\000\u1E2B"+ - "\u030C\000\u0228\u0302\u0309\000\u0157\u030C\000\u1EC6\u0309\000\u1ECD"+ - "\u0308\000\u1E5B\u030C\000\u1E29\u030C\000\u1E25\u030C\000\u01A1\u0308"+ - "\000\u1E1B\u0302\u0300\000\u1E5E\u030C\000\u1E19\u0302\u0300\000\u0156"+ - "\u0331\000\u0119\u0302\u0300\000\u01EB\u0303\000\u1E2A\u030C\000\u0229"+ - "\u0302\u0300\000\u0156\u030C\000\u1EC7\u0300\000\u1ECD\u0303\000\u1E5A"+ - "\u030C\000\u1E28\u030C\000\u1E24\u030C\000\u1E1A\u0302\u0300\000\u1E18"+ - "\u0302\u0300\000\u0157\u0323\u0304\000\u0118\u0302\u0300\000\u01EB\u0302"+ - "\000\u0228\u0302\u0300\000\u1EC6\u0300\000\u01A1\u0302\000\u1E1B\u0302"+ - "\u0301\000\u1E19\u0302\u0301\000\u0156\u0323\u0304\000\u0119\u0302\u0301"+ - "\000\u01EB\u0301\000\u0229\u0302\u0301\000\u1EC7\u0301\000\u1ECD\u0301"+ - "\000\u1E1A\u0302\u0301\000\u1E5F\u0301\000\u1E18\u0302\u0301\000\u0157"+ - "\u0323\000\u0118\u0302\u0301\000\u01EB\u0300\000\u0228\u0302\u0301\000"+ - "\u0157\u0301\000\u1EC6\u0301\000\u1ECD\u0300\000\u1E5B\u0301\000\u0163"+ - "\u0326\000\u1E49\u0303\000\u1E1B\u0303\000\u1E5E\u0301\000\u1E19\u0303"+ - "\000\u1E4B\u0303\000\u0156\u0323\000\u0119\u0303\000\u0229\u0303\000\u0146"+ - "\u0303\000\u0156\u0301\000\u1EB9\u0303\000\u1E47\u0303\000\u1E5A\u0301"+ - "\000\u0162\u0326\000\u1E5F\u0307\000\u1E1A\u0303\000\u1E18\u0303\000\u0157"+ - "\u0307\000\u0118\u0303\000\u0228\u0303\000\u1E5B\u0307\000\u1EB8\u0303"+ - "\000\u015F\u0326\000\u1E5E\u0307\000\u1E1B\u0309\000\u1E2D\u0308\000\u1E19"+ - "\u0309\000\u0156\u0307\000\u0119\u0309\000\u012F\u0308\000\u0229\u0309"+ - "\000\u1E5A\u0307\000\u1EB9\u0309\000\u1ECB\u0308\000\u015E\u0326\000\u1E1A"+ - "\u0309\000\u1E2D\u0302\000\u1E18\u0309\000\u1E75\u0311\000\u0118\u0309"+ - "\000\u012F\u0302\000\u0228\u0309\000\u1E77\u0311\000\u01EB\u030B\000\u1EB8"+ - "\u0309\000\u1ECB\u0302\000\u0173\u0311\000\u1ECD\u030B\000\u1E73\u0311"+ - "\000\u1EE5\u0311\000\u01A1\u030B\000\u01B0\u0311\000\u1E2D\u0301\000\u1E74"+ - "\u0311\000\u0119\u0323\000\u012F\u0301\000\u0229\u0323\000\u1E76\u0311"+ - "\000\u01EA\u030B\000\u1ECB\u0301\000\u0172\u0311\000\u1ECC\u030B\000\u1E72"+ - "\u0311\000\u1EE4\u0311\000\u01A0\u030B\000\u01AF\u0311\000\u1E2D\u0300"+ - "\000\u1E75\u030F\000\u0118\u0323\000\u012F\u0300\000\u0228\u0323\000\u1E77"+ - "\u030F\000\u01EB\u0306\000\u1ECB\u0300\000\u0173\u030F\000\u1ECD\u0306"+ - "\000\u1E73\u030F\000\u1EE5\u030F\000\u01A1\u0306\000\u01B0\u030F\000\u1E1B"+ - "\u0308\000\u1E19\u0308\000\u1E74\u030F\000\u0105\u0323\u0306\000\u0119"+ - "\u0308\000\u0229\u0308\000\u1E76\u030F\000\u01EA\u0306\000\u1EB9\u0308"+ - "\000\u0172\u030F\000\u1ECC\u0306\000\u1E72\u030F\000\u1EE4\u030F\000\u01A0"+ - "\u0306\000\u01AF\u030F\000\u1E1B\u0302\000\u1E19\u0302\000\u1E5F\u0311"+ - "\000\u01ED\u0301\000\u0104\u0323\u0306\000\u0119\u0302\000\u0229\u0302"+ - "\000\u1ECD\u0304\u0301\000\u0173\u031B\000\u1ECD\u0304\000\u0157\u0311"+ - "\000\u01A1\u0304\u0301\000\u1E5B\u0311\000\u01A1\u0304\000\u1E1B\u0301"+ - "\000\u1E19\u0301\000\u1E5E\u0311\000\u01EC\u0301\000\u0105\u0306\u0303"+ - "\000\u0119\u0301\000\u0229\u0301\000\u1ECC\u0304\u0301\000\u1E01\u0306"+ - "\u0303\000\u0172\u031B\000\u1EB7\u0303\000\u1EB9\u0301\000\u1ECC\u0304"+ - "\000\u0156\u0311\000\u01A0\u0304\u0301\000\u1E5A\u0311\000\u01A0\u0304"+ - "\000\u1E1B\u0300\000\u1E19\u0300\000\u1E5F\u030F\000\u01ED\u0300\000\u0104"+ - "\u0306\u0303\000\u0119\u0300\000\u0229\u0300\000\u1ECD\u0304\u0300\000"+ - "\u1E00\u0306\u0303\000\u1EB6\u0303\000\u1EB9\u0300\000\u0157\u030F\000"+ - "\u01A1\u0304\u0300\000\u1E5B\u030F\000\u1E5E\u030F\000\u01EC\u0300\000"+ - "\u0105\u0306\u0309\000\u1ECC\u0304\u0300\000\u1E01\u0306\u0309\000\u1EB7"+ - "\u0309\000\u0156\u030F\000\u01A0\u0304\u0300\000\u1E5A\u030F\000\u01EB"+ - "\u0303\u0308\000\u0104\u0306\u0309\000\u1ECD\u0303\u0308\000\u1E00\u0306"+ - "\u0309\000\u1EB6\u0309\000\u01EB\u0311\000\u1EE1\u0308\000\u1ECD\u0311"+ - "\000\u01A1\u0311\000\u1E49\u030C\000\u1E4B\u030C\000\u01EA\u0303\u0308"+ - "\000\u0105\u0306\u0300\000\u0105\u030A\000\u1ECC\u0303\u0308\000\u1E01"+ - "\u0306\u0300\000\u1E01\u030A\000\u0146\u030C\000\u1EB7\u0300\000\u1EA1"+ - "\u030A\000\u01EA\u0311\000\u1E47\u030C\000\u1EE0\u0308\000\u1ECC\u0311"+ - "\000\u01A0\u0311\000\u1E48\u030C\000\u1E4A\u030C\000\u01EB\u0303\u0301"+ - "\000\u0104\u0306\u0300\000\u0105\u0308\000\u1ECD\u0303\u0301\000\u1E00"+ - "\u0306\u0300\000\u1E01\u0308\000\u0145\u030C\000\u1EB6\u0300\000\u1EA1"+ - "\u0308\000\u01EB\u030F\000\u1E46\u030C\000\u1EE1\u0301\000\u1ECD\u030F"+ - "\000\u01A1\u030F\000\u01EA\u0303\u0301\000\u0105\u0306\u0301\000\u0105"+ - "\u0303\000\u1ECC\u0303\u0301\000\u1E01\u0306\u0301\000\u1E01\u0303\000"+ - "\u1EB7\u0301\000\u1EA1\u0303\000\u01EA\u030F\000\u1EE0\u0301\000\u1ECC"+ - "\u030F\000\u01A0\u030F\000\u1E2D\u0311\000\u0146\u032D\000\u0104\u0306"+ - "\u0301\000\u0105\u0302\000\u1E00\u0306\u0301\000\u1E01\u0302\000\u1EB6"+ - "\u0301\000\u012F\u0311\000\u1ECB\u0311\000\u1E49\u0301\000\u1E4B\u0301"+ - "\000\u1E2C\u0311\000\u0145\u032D\000\u0105\u0323\u0302\000\u0105\u0301"+ - "\000\u1E01\u0301\000\u0146\u0301\000\u1EA1\u0301\000\u012E\u0311\000\u1E47"+ - "\u0301\000\u1ECA\u0311\000\u1E48\u0301\000\u1E4A\u0301\000\u1E2D\u030F"+ - "\000\u0146\u0331\000\u0104\u0323\u0302\000\u0105\u0300\000\u1E01\u0300"+ - "\000\u0145\u0301\000\u1EA1\u0300\000\u012F\u030F\000\u1E46\u0301\000\u1ECB"+ - "\u030F\000\u1E2C\u030F\000\u0145\u0331\000\u0105\u0302\u0303\000\u1E01"+ - "\u0302\u0303\000\u1EAD\u0303\000\u012E\u030F\000\u1ECA\u030F\000\u1E1B"+ - "\u0311\000\u0146\u0323\000\u0104\u0302\u0303\000\u1E19\u0311\000\u1E00"+ - "\u0302\u0303\000\u1EAC\u0303\000\u0119\u0311\000\u0229\u0311\000\u1EB9"+ - "\u0311\000\u0145\u0323\000\u1E1A\u0311\000\u0105\u0302\u0309\000\u1E18"+ - "\u0311\000\u1E01\u0302\u0309\000\u1EAD\u0309\000\u1EF4\u0301\000\u0118"+ - "\u0311\000\u0228\u0311\000\u1EB8\u0311\000\u1E49\u0307\000\u1E4B\u0307"+ - "\000\u1E74\u0308\000\u1E76\u0308\000\u0146\u0307\000\u1E1B\u030F\000\u0104"+ - "\u0302\u0309\000\u0172\u0308\000\u1E19\u030F\000\u1E47\u0307\000\u1E00"+ - "\u0302\u0309\000\u1EAC\u0309\000\u1E72\u0308\000\u1EE4\u0308\000\u0119"+ - "\u030F\000\u0229\u030F\000\u1EB9\u030F\000\u01AF\u0308\000\u1E48\u0307"+ - "\000\u1E4A\u0307\000\u1E74\u0302\000\u1E3B\u030C\000\u1E76\u0302\000\u1E3D"+ - "\u030C\000\u0145\u0307\000\u1E1A\u030F\000\u0105\u0302\u0300\000\u0172"+ - "\u0302\000\u1E18\u030F\000\u1E46\u0307\000\u1E01\u0302\u0300\000\u013C"+ - "\u030C\000\u1E72\u0302\000\u01EB\u031B\000\u1EAD\u0300\000\u1EE4\u0302"+ - "\000\u0118\u030F\000\u1E37\u030C\000\u0228\u030F\000\u1EB8\u030F\000\u01AF"+ - "\u0302\000\u1E74\u0301\000\u1E3A\u030C\000\u1E76\u0301\000\u1E3C\u030C"+ - "\000\u0104\u0302\u0300\000\u0172\u0301\000\u1E00\u0302\u0300\000\u013B"+ - "\u030C\000\u1E72\u0301\000\u01EA\u031B\000\u1EAC\u0300\000\u1EE4\u0301"+ - "\000\u0105\u0311\000\u1E36\u030C\000\u1E01\u0311\000\u1EA1\u0311\000\u1E74"+ - "\u0300\000\u1E76\u0300\000\u0105\u0302\u0301\000\u0172\u0300\000\u1E01"+ - "\u0302\u0301\000\u1E72\u0300\000\u1EAD\u0301\000\u1EE4\u0300\000\u0104"+ - "\u0311\000\u1E00\u0311\000\u1EA0\u0311\000\u0104\u0302\u0301\000\u1E43"+ - "\u0307\000\u1E00\u0302\u0301\000\u1EAC\u0301\000\u0105\u030F\000\u1E01"+ - "\u030F\000\u1EA1\u030F\000\u1E3B\u0301\000\u1E3D\u0301\000\u0105\u0309"+ - "\000\u1E42\u0307\000\u1E01\u0309\000\u013C\u0301\000\u1EA1\u0309\000\u0104"+ - "\u030F\000\u1E37\u0301\000\u1E00\u030F\000\u1EA0\u030F\000\u1E3A\u0301"+ - "\000\u1E3C\u0301\000\u0104\u0309\000\u01EA\u0308\000\u1E43\u0301\000\u1E00"+ - "\u0309\000\u013B\u0301\000\u1EA0\u0309\000\u1ECC\u0308\000\u1E36\u0301"+ - "\000\u01A0\u0308\000\u0389\u0345\000\u1FCA\u0345\000\u0105\u0323\000\u01EA"+ - "\u0303\000\u1E42\u0301\000\u1ECC\u0303\000\u013C\u032D\000\u0104\u0323"+ - "\000\u01EA\u0302\000\u01A0\u0302\000\u013B\u032D\000\u01EA\u0301\000\u1ECC"+ - "\u0301\000\u0625\u0654\000\u013C\u0331\000\u01EA\u0300\000\u1ECC\u0300"+ - "\000\u0105\u030A\u0301\000\u1E01\u030A\u0301\000\u1EA1\u030A\u0301\000"+ - "\u0625\u0653\000\u1E48\u0303\000\u1E4A\u0303\000\u013B\u0331\000\u0145"+ - "\u0303\000\u1E46\u0303\000\u0104\u030A\u0301\000\u1E00\u030A\u0301\000"+ - "\u1EA0\u030A\u0301\000\u1E49\u0300\000\u013C\u0323\u0304\000\u1E4B\u0300"+ - "\000\u0146\u0300\000\u1E47\u0300\000\u1E2C\u0308\000\u1E48\u0300\000\u013B"+ - "\u0323\u0304\000\u012E\u0308\000\u1E4A\u0300\000\u1ECA\u0308\000\u0145"+ - "\u0300\000\u1E46\u0300\000\u1E2C\u0302\000\u013C\u0323\000\u012E\u0302"+ - "\000\u1ECA\u0302\000\u1E2C\u0301\000\u1E2C\u0307\000\u013B\u0323\000\u012E"+ - "\u0301\000\u012E\u0307\000\u1EF5\u030A\000\u1ECA\u0301\000\u1ECA\u0307"+ - "\000\u1E2C\u0300\000\u0137\u0331\000\u012E\u0300\000\u1E89\u030A\000\u1ECA"+ - "\u0300\000\u0123\u0301\000\u1E6F\u0308\000\u1E1A\u0308\000\u1E71\u0308"+ - "\000\u1E18\u0308\000\u0136\u0331\000\u0118\u0308\000\u0163\u0308\000\u0228"+ - "\u0308\000\u021B\u0308\000\u1E6D\u0308\000\u1EB8\u0308\000\u0122\u0301"+ - "\000\u1E1A\u0302\000\u1E2D\u0306\000\u1E18\u0302\000\u0137\u0323\000\u0118"+ - "\u0302\000\u1E29\u0331\000\u0228\u0302\000\u012F\u0306\000\u1EF5\u0303"+ - "\000\u1ECB\u0306\000\u1E1A\u0301\000\u1E2C\u0306\000\u1E18\u0301\000\u0136"+ - "\u0323\000\u0118\u0301\000\u0228\u0301\000\u012E\u0306\000\u1EB8\u0301"+ - "\000\u1EF4\u0303\000\u1ECA\u0306\000\u1E35\u0301\000\u1E1A\u0300\000\u1E2D"+ - "\u0304\000\u1E18\u0300\000\u0137\u0301\000\u0118\u0300\000\u0228\u0300"+ - "\000\u012F\u0304\000\u1E33\u0301\000\u1EB8\u0300\000\u1EF5\u0309\000\u1ECB"+ - "\u0304\000\u1E34\u0301\000\u1E2C\u0304\000\u0136\u0301\000\u012E\u0304"+ - "\000\u1E32\u0301\000\u1EF4\u0309\000\u1ECA\u0304\000\u1E2D\u0308\u0301"+ - "\000\u1E2D\u0303\000\u012F\u0308\u0301\000\u012F\u0303\000\u1ECB\u0308"+ - "\u0301\000\u1ECB\u0303\000\u1FB8\u0345\000\u1FB9\u0345\000\u0386\u0345"+ - "\000\u1FBA\u0345\000\u1E2C\u0308\u0301\000\u1E95\u0302\000\u1E2C\u0303"+ - "\000\u012E\u0308\u0301\000\u0104\u030A\000\u012E\u0303\000\u1ECA\u0308"+ - "\u0301\000\u1E00\u030A\000\u1E93\u0302\000\u1EA0\u030A\000\u1ECA\u0303"+ - "\000\u1E94\u0302\000\u012F\u0330\000\u0104\u0308\000\u1E00\u0308\000\u1E92"+ - "\u0302\000\u1EA0\u0308\000\u1EF5\u0300\000\u012E\u0330\000\u0104\u0303"+ - "\000\u1E00\u0303\000\u1EF5\u0307\000\u1EA0\u0303\000\u1EF4\u0300\000\u1E96"+ - "\u0302\000\u1E2B\u0302\000\u1E29\u032E\000\u0104\u0302\000\u0173\u031B"+ - "\u0323\000\u1E00\u0302\000\u1E29\u0302\000\u1EF4\u0307\000\u1E25\u0302"+ - "\000\u1E2A\u0302\000\u1E28\u032E\000\u0104\u0301\000\u0172\u031B\u0323"+ - "\000\u1E00\u0301\000\u1E28\u0302\000\u1EA0\u0301\000\u1E24\u0302\000\u1E35"+ - "\u030C\000\u0104\u0300\000\u0173\u031B\u0303\000\u1E00\u0300\000\u1EA0"+ - "\u0300\000\u1EF1\u0303\000\u0137\u030C\000\u1E33\u030C\000\u1E34\u030C"+ - "\000\u0172\u031B\u0303\000\u1EF0\u0303\000\u0136\u030C\000\u1E32\u030C"+ - "\000\u1E96\u0308\000\u1E2B\u0308\000\u1E29\u0308\000\u0173\u031B\u0309"+ - "\000\u1E25\u0308\000\u0123\u0307\000\u1EF1\u0309\000\u0123\u030C\000\u1E2A"+ - "\u0308\000\u1E28\u0308\000\u0172\u031B\u0309\000\u1E24\u0308\000\u0122"+ - "\u0307\000\u1EF0\u0309\000\u0122\u030C\000\u1FB0\u0345\000\u1FB1\u0345"+ - "\000\u1E29\u0323\000\u0173\u031B\u0300\000\u0123\u0306\000\u1EF1\u0300"+ - "\000\u1E28\u0323\000\u0172\u031B\u0300\000\u0122\u0306\000\u1E89\u0307"+ - "\000\u1EF0\u0300\000\u1E96\u0307\000\u1E2B\u0307\000\u1E29\u0307\000\u0173"+ - "\u031B\u0301\000\u1E25\u0307\000\u0123\u0302\000\u1E88\u0307\000\u1EF1"+ - "\u0301\000\u1E2A\u0307\000\u1E28\u0307\000\u0172\u031B\u0301\000\u1E24"+ - "\u0307\000\u0122\u0302\000\u1E89\u0308\000\u1EF0\u0301\000\u1E75\u0309"+ - "\000\u1E1B\u030C\000\u1E95\u030C\000\u1E77\u0309\000\u1E19\u030C\000\u0123"+ - "\u0304\000\u0173\u0309\000\u0119\u030C\000\u0229\u030C\000\u1E88\u0308"+ - "\000\u1E73\u0309\000\u0105\u0307\u0304\000\u1EE5\u0309\000\u1EB9\u030C"+ - "\000\u1E93\u030C\000\u1E01\u0307\u0304\000\u1EA1\u0307\u0304\000\u1E74"+ - "\u0309\000\u1E1A\u030C\000\u1E94\u030C\000\u1E76\u0309\000\u1E18\u030C"+ - "\000\u0122\u0304\000\u0172\u0309\000\u0118\u030C\000\u0228\u030C\000\u1E89"+ - "\u0301\000\u1E72\u0309\000\u0104\u0307\u0304\000\u1EE4\u0309\000\u1EB8"+ - "\u030C\000\u1E92\u030C\000\u1E00\u0307\u0304\000\u1EA0\u0307\u0304\000"+ - "\u1E95\u0307\000\u0173\u0323\000\u1E88\u0301\000\u0105\u0308\u0304\000"+ - "\u1E93\u0307\000\u1E01\u0308\u0304\000\u1EA1\u0308\u0304\000\u1E94\u0307"+ - "\000\u0172\u0323\000\u1E89\u0300\000\u0104\u0308\u0304\000\u1E92\u0307"+ - "\000\u1E00\u0308\u0304\000\u1EA0\u0308\u0304\000\u1E1B\u0307\000\u1E95"+ - "\u0301\000\u1E19\u0307\000\u01EB\u031B\u0323\000\u0119\u0307\000\u0229"+ - "\u0307\000\u1E88\u0300\000\u1EB9\u0307\000\u1E93\u0301\000\u1E1A\u0307"+ - "\000\u1E94\u0301\000\u1E18\u0307\000\u1E75\u0308\u0300\000\u1E77\u0308"+ - "\u0300\000\u01EA\u031B\u0323\000\u0118\u0307\000\u0228\u0307\000\u0173"+ - "\u0308\u0300\000\u1EB8\u0307\000\u1E92\u0301\000\u1E73\u0308\u0300\000"+ - "\u1EE5\u0308\u0300\000\u01B0\u0308\u0300\000\u1E1B\u0306\000\u1E19\u0306"+ - "\000\u0119\u0330\000\u1E74\u0308\u0300\000\u0229\u0330\000\u1E76\u0308"+ - "\u0300\000\u01EB\u031B\u0303\000\u0119\u0306\000\u0172\u0308\u0300\000"+ - "\u1EE3\u0303\000\u1EB9\u0306\000\u1EF4\u0308\000\u1E72\u0308\u0300\000"+ - "\u1EE4\u0308\u0300\000\u01AF\u0308\u0300\000\u1E1A\u0306\000\u1E18\u0306"+ - "\000\u0118\u0330\000\u1E75\u0308\u030C\000\u0228\u0330\000\u1E77\u0308"+ - "\u030C\000\u01EA\u031B\u0303\000\u0118\u0306\000\u1E7F\u0303\000\u0173"+ - "\u0308\u030C\000\u1EE2\u0303\000\u1EB8\u0306\000\u1EF5\u0302\000\u1E73"+ - "\u0308\u030C\000\u1EE5\u0308\u030C\000\u01B0\u0308\u030C\000\u1E1B\u0304"+ - "\000\u1E19\u0304\000\u0119\u032D\000\u1E74\u0308\u030C\000\u0229\u032D"+ - "\000\u1E76\u0308\u030C\000\u01EB\u031B\u0309\000\u0119\u0304\000\u0229"+ - "\u0304\000\u1E7E\u0303\000\u0172\u0308\u030C\000\u1EE3\u0309\000\u1EB9"+ - "\u0304\000\u1EF4\u0302\000\u1E72\u0308\u030C\000\u1EE4\u0308\u030C\000"+ - "\u01AF\u0308\u030C\000\u1E75\u0304\u0308\000\u1E1A\u0304\000\u1E77\u0304"+ - "\u0308\000\u1E18\u0304\000\u0118\u032D\000\u1E75\u0308\u0301\000\u0228"+ - "\u032D\000\u0173\u0304\u0308\000\u1E77\u0308\u0301\000\u01EA\u031B\u0309"+ - "\000\u0118\u0304\000\u0228\u0304\000\u1E73\u0304\u0308\000\u1EE5\u0304"+ - "\u0308\000\u0173\u0308\u0301\000\u1EE2\u0309\000\u1EB8\u0304\000\u1E89"+ - "\u0302\000\u1E73\u0308\u0301\000\u1EE5\u0308\u0301\000\u01B0\u0304\u0308"+ - "\000\u01B0\u0308\u0301\000\u1E1B\u0304\u0301\000\u1E74\u0304\u0308\000"+ - "\u1E19\u0304\u0301\000\u1E76\u0304\u0308\000\u0119\u0304\u0301\000\u1E74"+ - "\u0308\u0301\000\u0229\u0304\u0301\000\u0172\u0304\u0308\000\u1E76\u0308"+ - "\u0301\000\u01EB\u031B\u0300\000\u1EB9\u0304\u0301\000\u1E72\u0304\u0308"+ - "\000\u1EE4\u0304\u0308\000\u0172\u0308\u0301\000\u1EE3\u0300\000\u1E88"+ - "\u0302\000\u1E72\u0308\u0301\000\u1EE4\u0308\u0301\000\u01AF\u0304\u0308"+ - "\000\u01AF\u0308\u0301\000\u1E1A\u0304\u0301\000\u1E75\u0303\u0301\000"+ - "\u1E18\u0304\u0301\000\u1E77\u0303\u0301\000\u0118\u0304\u0301\000\u1E75"+ - "\u0308\u0304\000\u0228\u0304\u0301\000\u0173\u0303\u0301\000\u1E77\u0308"+ - "\u0304\000\u01EA\u031B\u0300\000\u1EB8\u0304\u0301\000\u1E73\u0303\u0301"+ - "\000\u1EE5\u0303\u0301\000\u0173\u0308\u0304\000\u1EE2\u0300\000\u1E73"+ - "\u0308\u0304\000\u1EE5\u0308\u0304\000\u1EEF\u0301\000\u01B0\u0308\u0304"+ - "\000\u1E1B\u0304\u0300\000\u1E74\u0303\u0301\000\u1E19\u0304\u0300\000"+ - "\u1E0F\u030C\000\u1E76\u0303\u0301\000\u1E13\u030C\000\u0119\u0304\u0300"+ - "\000\u1E74\u0308\u0304\000\u0229\u0304\u0300\000" - ; - - static final int[] typeBit = Utility.RLEStringToIntArray( - "\000g\000\000\000\uA5A5\000\020\0001\000+\000\uA5A5\000\004\000-\000*"+ - "\000*\000\uA5A5\000\004\000-\000\002\0001\0005\000\012\0001\0001\000-"+ - "\000\003\000\uA5A5\000\007\000\001\000\042\000\uA5A5\000\005\000\001\000"+ - "\005\000\001\000\001\000\001\000\004\000\004\0001\0002\000-\000*\000\002"+ - "\0004\0003\000.\0000\000\006\000\007\000\010\000\011\000\013\000\014\000"+ - "\015\000\016\000\017\000\020\000\021\000\022\000\023\000\024\000\025\000"+ - "\027\000\030\000\031\000\032\000\033\000\034\000\035\000\036\000\037\000"+ - " \000\005\000\003\000!\000#\000$\000%\000&\000+\000'\000(\000)\000,\000"+ - "/\000\026" - ); -} diff --git a/icu4j/src/com/ibm/text/ComposedCharIter.java b/icu4j/src/com/ibm/text/ComposedCharIter.java deleted file mode 100755 index 9370fde200..0000000000 --- a/icu4j/src/com/ibm/text/ComposedCharIter.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/ComposedCharIter.java,v $ - * $Date: 2000/03/10 04:07:19 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -/** - * ComposedCharIter is an iterator class that returns all - * of the precomposed characters defined in the Unicode standard, along - * with their decomposed forms. This is often useful when building - * data tables (e.g. collation tables) which need to treat composed - * and decomposed characters equivalently. - *

- * For example, imagine that you have built a collation table with ordering - * rules for the {@link Normalizer#DECOMP canonically decomposed} forms of all - * characters used in a particular language. When you process input text using - * this table, the text must first be decomposed so that it matches the form - * used in the table. This can impose a performance penalty that may be - * unacceptable in some situations. - *

- * You can avoid this problem by ensuring that the collation table contains - * rules for both the decomposed and composed versions of each character. - * To do so, use a ComposedCharIter to iterate through all of the - * composed characters in Unicode. If the decomposition for that character - * consists solely of characters that are listed in your ruleset, you can - * add a new rule for the composed character that makes it equivalent to - * its decomposition sequence. - *

- * Note that ComposedCharIter iterates over a static table - * of the composed characters in Unicode. If you want to iterate over the - * composed characters in a particular string, use {@link Normalizer} instead. - *

- * When constructing a ComposedCharIter there is one - * optional feature that you can enable or disable: - *

    - *
  • {@link Normalizer#IGNORE_HANGUL} - Do not iterate over the Hangul - * characters and their corresponding Jamo decompositions. - * This option is off by default (i.e. Hangul processing is enabled) - * since the Unicode standard specifies that Hangul to Jamo - * is a canonical decomposition. - *
- *

- * ComposedCharIter is currently based on version 2.1.8 of the - * Unicode Standard. - * It will be updated as later versions of Unicode are released. - */ -public final class ComposedCharIter { - - /** - * Constant that indicates the iteration has completed. - * {@link #next} returns this value when there are no more composed characters - * over which to iterate. - */ - public static final char DONE = Normalizer.DONE; - - /** - * Construct a new ComposedCharIter. The iterator will return - * all Unicode characters with canonical decompositions, including Korean - * Hangul characters. - */ - public ComposedCharIter() { - minDecomp = DecompData.MAX_COMPAT; - hangul = false; - } - - - /** - * Constructs a non-default ComposedCharIter with optional behavior. - *

- * @param compat false for canonical decompositions only; - * true for both canonical and compatibility - * decompositions. - * - * @param options Optional decomposition features. Currently, the only - * supported option is {@link Normalizer#IGNORE_HANGUL}, which - * causes this ComposedCharIter not to iterate - * over the Hangul characters and their corresponding - * Jamo decompositions. - */ - public ComposedCharIter(boolean compat, int options) { - // Compatibility explosions have lower indices; skip them if necessary - minDecomp = compat ? 0 : DecompData.MAX_COMPAT; - - hangul = (options & Normalizer.IGNORE_HANGUL) == 0; - } - - /** - * Determines whether there any precomposed Unicode characters not yet returned - * by {@link #next}. - */ - public boolean hasNext() { - if (nextChar == DONE) { - findNextChar(); - } - return nextChar != DONE; - } - - /** - * Returns the next precomposed Unicode character. - * Repeated calls to next return all of the precomposed characters defined - * by Unicode, in ascending order. After all precomposed characters have - * been returned, {@link #hasNext} will return false and further calls - * to next will return {@link #DONE}. - */ - public char next() { - if (nextChar == DONE) { - findNextChar(); - } - curChar = nextChar; - nextChar = DONE; - return curChar; - } - - /** - * Returns the Unicode decomposition of the current character. - * This method returns the decomposition of the precomposed character most - * recently returned by {@link #next}. The resulting decomposition is - * affected by the settings of the options passed to the constructor. - */ - public String decomposition() { - StringBuffer result = new StringBuffer(); - - int pos = (char)(DecompData.offsets.elementAt(curChar) & DecompData.DECOMP_MASK); - - if (pos > minDecomp) { - Normalizer.doAppend(DecompData.contents, pos, result); - - - } else if (hangul && curChar >= HANGUL_BASE && curChar < HANGUL_LIMIT) { - Normalizer.hangulToJamo(curChar, result, minDecomp); - } else { - result.append(curChar); - } - return result.toString(); - } - - private void findNextChar() { - if (curChar != DONE) { - char ch = curChar; - while (++ch < 0xFFFF) { - int offset = DecompData.offsets.elementAt(ch) & DecompData.DECOMP_MASK; - if (offset > minDecomp - || (hangul && ch >= HANGUL_BASE && ch < HANGUL_LIMIT) ) { - nextChar = ch; - break; - } - } - } - } - - private final int minDecomp; - private final boolean hangul; - - private char curChar = 0; - private char nextChar = Normalizer.DONE; - - private static final char HANGUL_BASE = Normalizer.HANGUL_BASE; - private static final char HANGUL_LIMIT = Normalizer.HANGUL_LIMIT; -}; diff --git a/icu4j/src/com/ibm/text/CompoundTransliterator.java b/icu4j/src/com/ibm/text/CompoundTransliterator.java deleted file mode 100755 index 2cd843d48e..0000000000 --- a/icu4j/src/com/ibm/text/CompoundTransliterator.java +++ /dev/null @@ -1,504 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/CompoundTransliterator.java,v $ - * $Date: 2002/02/07 00:53:54 $ - * $Revision: 1.27 $ - * - ***************************************************************************************** - */ -package com.ibm.text; -import com.ibm.util.Utility; -import java.util.Enumeration; -import java.util.Vector; - -/** - * A transliterator that is composed of two or more other - * transliterator objects linked together. For example, if one - * transliterator transliterates from script A to script B, and - * another transliterates from script B to script C, the two may be - * combined to form a new transliterator from A to C. - * - *

Composed transliterators may not behave as expected. For - * example, inverses may not combine to form the identity - * transliterator. See the class documentation for {@link - * Transliterator} for details. - * - *

Copyright © IBM Corporation 1999. All rights reserved. - * - * @author Alan Liu - * @version $RCSfile: CompoundTransliterator.java,v $ $Revision: 1.27 $ $Date: 2002/02/07 00:53:54 $ - */ -public class CompoundTransliterator extends Transliterator { - - private Transliterator[] trans; - - /** - * For compound RBTs (those with an ::id block before and/or after - * the main rule block) we record the index of the RBT here. - * Otherwise, this should have a value of -1. We need this - * information to implement toRules(). - */ - private int compoundRBTIndex; - - private static final String COPYRIGHT = - "\u00A9 IBM Corporation 1999-2001. All rights reserved."; - - /** - * Constructs a new compound transliterator given an array of - * transliterators. The array of transliterators may be of any - * length, including zero or one, however, useful compound - * transliterators have at least two components. - * @param transliterators array of Transliterator - * objects - * @param filter the filter. Any character for which - * filter.contains() returns false will not be - * altered by this transliterator. If filter is - * null then no filtering is applied. - */ - public CompoundTransliterator(Transliterator[] transliterators, - UnicodeFilter filter) { - super(joinIDs(transliterators), filter); - trans = new Transliterator[transliterators.length]; - System.arraycopy(transliterators, 0, trans, 0, trans.length); - computeMaximumContextLength(); - } - - /** - * Constructs a new compound transliterator given an array of - * transliterators. The array of transliterators may be of any - * length, including zero or one, however, useful compound - * transliterators have at least two components. - * @param transliterators array of Transliterator - * objects - */ - public CompoundTransliterator(Transliterator[] transliterators) { - this(transliterators, null); - } - - /** - * Constructs a new compound transliterator. - * @param ID compound ID - * @param direction either Transliterator.FORWARD or Transliterator.REVERSE - * @param filter a global filter for this compound transliterator - * or null - */ - public CompoundTransliterator(String ID, int direction, - UnicodeFilter filter) { - super(ID, filter); - init(ID, direction, -1, null, true); - } - - /** - * Constructs a new compound transliterator with no filter. - * @param ID compound ID - * @param direction either Transliterator.FORWARD or Transliterator.REVERSE - */ - public CompoundTransliterator(String ID, int direction) { - this(ID, direction, null); - } - - /** - * Constructs a new forward compound transliterator with no filter. - * @param ID compound ID - */ - public CompoundTransliterator(String ID) { - this(ID, FORWARD, null); - } - - /** - * Package private constructor for compound RBTs. Construct a - * compound transliterator using the given idBlock, with the - * splitTrans inserted at the idSplitPoint. - */ - CompoundTransliterator(String ID, - String idBlock, - int idSplitPoint, - Transliterator splitTrans) { - super(ID, null); - init(idBlock, FORWARD, idSplitPoint, splitTrans, false); - } - - /** - * Package private constructor for Transliterator from a vector of - * transliterators. The caller is responsible for fixing up the - * ID. - */ - CompoundTransliterator(Vector list) { - super("", null); - trans = null; - compoundRBTIndex = -1; - init(list, FORWARD, false); - // assume caller will fixup ID - } - - /** - * Finish constructing a transliterator: only to be called by - * constructors. Before calling init(), set trans and filter to NULL. - * @param id the id containing ';'-separated entries - * @param direction either FORWARD or REVERSE - * @param idSplitPoint the index into id at which the - * splitTrans should be inserted, if there is one, or - * -1 if there is none. - * @param splitTrans a transliterator to be inserted - * before the entry at offset idSplitPoint in the id string. May be - * NULL to insert no entry. - * @param fixReverseID if TRUE, then reconstruct the ID of reverse - * entries by calling getID() of component entries. Some constructors - * do not require this because they apply a facade ID anyway. - */ - private void init(String id, - int direction, - int idSplitPoint, - Transliterator splitTrans, - boolean fixReverseID) { - // assert(trans == 0); - - Vector list = new Vector(); - UnicodeSet[] compoundFilter = new UnicodeSet[1]; - StringBuffer regenID = new StringBuffer(); - if (!TransliteratorIDParser.parseCompoundID(id, direction, - regenID, list, compoundFilter)) { - throw new IllegalArgumentException("Invalid ID " + id); - } - - compoundRBTIndex = TransliteratorIDParser.instantiateList(list, splitTrans, idSplitPoint); - - init(list, direction, fixReverseID); - - if (compoundFilter[0] != null) { - setFilter(compoundFilter[0]); - } - } - - /** - * Finish constructing a transliterator: only to be called by - * constructors. Before calling init(), set trans and filter to NULL. - * @param list a vector of transliterator objects to be adopted. It - * should NOT be empty. The list should be in declared order. That - * is, it should be in the FORWARD order; if direction is REVERSE then - * the list order will be reversed. - * @param direction either FORWARD or REVERSE - * @param fixReverseID if TRUE, then reconstruct the ID of reverse - * entries by calling getID() of component entries. Some constructors - * do not require this because they apply a facade ID anyway. - */ - private void init(Vector list, - int direction, - boolean fixReverseID) { - // assert(trans == 0); - - // Allocate array - int count = list.size(); - trans = new Transliterator[count]; - - // Move the transliterators from the vector into an array. - // Reverse the order if necessary. - int i; - for (i=0; i= 0 && direction == REVERSE) { - compoundRBTIndex = count - 1 - compoundRBTIndex; - } - - // If the direction is UTRANS_REVERSE then we may need to fix the - // ID. - if (direction == REVERSE && fixReverseID) { - StringBuffer newID = new StringBuffer(); - for (i=0; i 0) { - newID.append(ID_DELIM); - } - newID.append(trans[i].getID()); - } - setID(newID.toString()); - } - - computeMaximumContextLength(); - } - - /** - * Return the IDs of the given list of transliterators, concatenated - * with ';' delimiting them. Equivalent to the perlish expression - * join(';', map($_.getID(), transliterators). - */ - private static String joinIDs(Transliterator[] transliterators) { - StringBuffer id = new StringBuffer(); - for (int i=0; i 0) { - id.append(';'); - } - id.append(transliterators[i].getID()); - } - return id.toString(); - } - - /** - * Returns the number of transliterators in this chain. - * @return number of transliterators in this chain. - */ - public int getCount() { - return trans.length; - } - - /** - * Returns the transliterator at the given index in this chain. - * @param index index into chain, from 0 to getCount() - 1 - * @return transliterator at the given index - */ - public Transliterator getTransliterator(int index) { - return trans[index]; - } - - /** - * Append c to buf, unless buf is empty or buf already ends in c. - */ - private static void _smartAppend(StringBuffer buf, char c) { - if (buf.length() != 0 && - buf.charAt(buf.length() - 1) != c) { - buf.append(c); - } - } - - /** - * Override Transliterator: - * Create a rule string that can be passed to createFromRules() - * to recreate this transliterator. - * @param escapeUnprintable if TRUE then convert unprintable - * character to their hex escape representations, \\uxxxx or - * \\Uxxxxxxxx. Unprintable characters are those other than - * U+000A, U+0020..U+007E. - * @return the rule string - * @deprecated To be removed after 2002-sep-30. - */ - public String toRules(boolean escapeUnprintable) { - // We do NOT call toRules() on our component transliterators, in - // general. If we have several rule-based transliterators, this - // yields a concatenation of the rules -- not what we want. We do - // handle compound RBT transliterators specially -- those for which - // compoundRBTIndex >= 0. For the transliterator at compoundRBTIndex, - // we do call toRules() recursively. - StringBuffer rulesSource = new StringBuffer(); - if (compoundRBTIndex >= 0 && getFilter() != null) { - // If we are a compound RBT and if we have a global - // filter, then emit it at the top. - rulesSource.append("::").append(getFilter().toPattern(escapeUnprintable)).append(ID_DELIM); - } - for (int i=0; i abca/u - * C S L C S L gl=f->a - * - * 2. upup, changes "x" to "XX" - * - * 4 7 a 4 7 a - * abca/u => abcAA/u - * C SL C S - * L gl=a->b - * 3. u-h, changes Unicode to hex - * - * 4 7 a 4 7 a d 0 3 - * abcAA/u => abc/u0041/u0041/u - * C S L C S - * L gl=b->15 - * 4. return - * - * 4 7 a d 0 3 - * abc/u0041/u0041/u - * C S L - */ - - if (trans.length < 1) { - index.start = index.limit; - return; // Short circuit for empty compound transliterators - } - - // compoundLimit is the limit value for the entire compound - // operation. We overwrite index.limit with the previous - // index.start. After each transliteration, we update - // compoundLimit for insertions or deletions that have happened. - int compoundLimit = index.limit; - - // compoundStart is the start for the entire compound - // operation. - int compoundStart = index.start; - - int delta = 0; // delta in length - - StringBuffer log = null; - if (DEBUG) { - log = new StringBuffer("CompoundTransliterator{" + getID() + - (incremental ? "}i: IN=" : "}: IN=")); - Utility.formatInput(log, text, index); - System.out.println(Utility.escape(log.toString())); - } - - // Give each transliterator a crack at the run of characters. - // See comments at the top of the method for more detail. - for (int i=0; i "); - Utility.formatInput(log, text, index); - System.out.println(Utility.escape(log.toString())); - } - - // Cumulative delta for insertions/deletions - delta += index.limit - limit; - - if (incremental) { - // In the incremental case, only allow subsequent - // transliterators to modify what has already been - // completely processed by prior transliterators. In the - // non-incrmental case, allow each transliterator to - // process the entire text. - index.limit = index.start; - } - } - - compoundLimit += delta; - - // Start is good where it is -- where the last transliterator left - // it. Limit needs to be put back where it was, modulo - // adjustments for deletions/insertions. - index.limit = compoundLimit; - - if (DEBUG) { - log.setLength(0); - log.append("CompoundTransliterator{" + getID() + - (incremental ? "}i: OUT=" : "}: OUT=")); - Utility.formatInput(log, text, index); - System.out.println(Utility.escape(log.toString())); - } - } - - /** - * Compute and set the length of the longest context required by this transliterator. - * This is preceding context. - */ - private void computeMaximumContextLength() { - int max = 0; - for (int i=0; i max) { - max = len; - } - } - setMaximumContextLength(max); - } -} diff --git a/icu4j/src/com/ibm/text/DateFormat.java b/icu4j/src/com/ibm/text/DateFormat.java deleted file mode 100755 index 4280ab27b8..0000000000 --- a/icu4j/src/com/ibm/text/DateFormat.java +++ /dev/null @@ -1,778 +0,0 @@ -/* - * @(#)DateFormat.java 1.37 99/11/02 - * - * (C) Copyright Taligent, Inc. 1996 - All Rights Reserved - * (C) Copyright IBM Corp. 1996 - All Rights Reserved - * - * Portions copyright (c) 1996-1998 Sun Microsystems, Inc. All Rights Reserved. - * - * The original version of this source code and documentation is copyrighted - * and owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These - * materials are provided under terms of a License Agreement between Taligent - * and Sun. This technology is protected by multiple US and International - * patents. This notice and attribution to Taligent may not be removed. - * Taligent is a registered trademark of Taligent, Inc. - * - * Permission to use, copy, modify, and distribute this software - * and its documentation for NON-COMMERCIAL purposes and without - * fee is hereby granted provided that this copyright notice - * appears in all copies. Please refer to the file "copyright.html" - * for further important copyright and licensing information. - * - * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF - * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED - * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR - * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR - * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. - * - */ - -package com.ibm.text; -import java.text.Format; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.text.ParseException; -import java.util.Locale; -import java.util.ResourceBundle; -import java.util.MissingResourceException; -import com.ibm.util.TimeZone; -import com.ibm.util.Calendar; -import com.ibm.util.GregorianCalendar; -import java.util.Date; -import java.text.resources.*; - -/** - * DateFormat is an abstract class for date/time formatting subclasses which - * formats and parses dates or time in a language-independent manner. - * The date/time formatting subclass, such as SimpleDateFormat, allows for - * formatting (i.e., date -> text), parsing (text -> date), and - * normalization. The date is represented as a Date object or - * as the milliseconds since January 1, 1970, 00:00:00 GMT. - * - *

DateFormat provides many class methods for obtaining default date/time - * formatters based on the default or a given loacle and a number of formatting - * styles. The formatting styles include FULL, LONG, MEDIUM, and SHORT. More - * detail and examples of using these styles are provided in the method - * descriptions. - * - *

DateFormat helps you to format and parse dates for any locale. - * Your code can be completely independent of the locale conventions for - * months, days of the week, or even the calendar format: lunar vs. solar. - * - *

To format a date for the current Locale, use one of the - * static factory methods: - *

- *  myString = DateFormat.getDateInstance().format(myDate);
- * 
- *

If you are formatting multiple numbers, it is - * more efficient to get the format and use it multiple times so that - * the system doesn't have to fetch the information about the local - * language and country conventions multiple times. - *

- *  DateFormat df = DateFormat.getDateInstance();
- *  for (int i = 0; i < a.length; ++i) {
- *    output.println(df.format(myDate[i]) + "; ");
- *  }
- * 
- *

To format a number for a different Locale, specify it in the - * call to getDateInstance(). - *

- *  DateFormat df = DateFormat.getDateInstance(DateFormat.LONG, Locale.FRANCE);
- * 
- *

You can use a DateFormat to parse also. - *

- *  myDate = df.parse(myString);
- * 
- *

Use getDateInstance to get the normal date format for that country. - * There are other static factory methods available. - * Use getTimeInstance to get the time format for that country. - * Use getDateTimeInstance to get a date and time format. You can pass in - * different options to these factory methods to control the length of the - * result; from SHORT to MEDIUM to LONG to FULL. The exact result depends - * on the locale, but generally: - *

  • SHORT is completely numeric, such as 12.13.52 or 3:30pm - *
  • MEDIUM is longer, such as Jan 12, 1952 - *
  • LONG is longer, such as January 12, 1952 or 3:30:32pm - *
  • FULL is pretty completely specified, such as - * Tuesday, April 12, 1952 AD or 3:30:42pm PST. - *
- * - *

You can also set the time zone on the format if you wish. - * If you want even more control over the format or parsing, - * (or want to give your users more control), - * you can try casting the DateFormat you get from the factory methods - * to a SimpleDateFormat. This will work for the majority - * of countries; just remember to put it in a try block in case you - * encounter an unusual one. - * - *

You can also use forms of the parse and format methods with - * ParsePosition and FieldPosition to - * allow you to - *

  • progressively parse through pieces of a string. - *
  • align any particular field, or find out where it is for selection - * on the screen. - *
- * - *

Synchronization

- * - * Date formats are not synchronized. It is recommended to create separate - * format instances for each thread. If multiple threads access a format - * concurrently, it must be synchronized externally. - * - * @see Format - * @see NumberFormat - * @see SimpleDateFormat - * @see com.ibm.util.Calendar - * @see com.ibm.util.GregorianCalendar - * @see com.ibm.util.TimeZone - * @version 1.37 11/02/99 - * @author Mark Davis, Chen-Lieh Huang, Alan Liu - */ -public abstract class DateFormat extends Format { - - /** - * The calendar that DateFormat uses to produce the time field - * values needed to implement date and time formatting. Subclasses should - * initialize this to a calendar appropriate for the locale associated with - * this DateFormat. - * @serial - */ - protected Calendar calendar; - - /** - * The number formatter that DateFormat uses to format numbers - * in dates and times. Subclasses should initialize this to a number format - * appropriate for the locale associated with this DateFormat. - * @serial - */ - protected NumberFormat numberFormat; - - /** - * Useful constant for ERA field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int ERA_FIELD = 0; - /** - * Useful constant for YEAR field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int YEAR_FIELD = 1; - /** - * Useful constant for MONTH field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int MONTH_FIELD = 2; - /** - * Useful constant for DATE field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int DATE_FIELD = 3; - /** - * Useful constant for one-based HOUR_OF_DAY field alignment. - * Used in FieldPosition of date/time formatting. - * HOUR_OF_DAY1_FIELD is used for the one-based 24-hour clock. - * For example, 23:59 + 01:00 results in 24:59. - */ - public final static int HOUR_OF_DAY1_FIELD = 4; - /** - * Useful constant for zero-based HOUR_OF_DAY field alignment. - * Used in FieldPosition of date/time formatting. - * HOUR_OF_DAY0_FIELD is used for the zero-based 24-hour clock. - * For example, 23:59 + 01:00 results in 00:59. - */ - public final static int HOUR_OF_DAY0_FIELD = 5; - /** - * Useful constant for MINUTE field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int MINUTE_FIELD = 6; - /** - * Useful constant for SECOND field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int SECOND_FIELD = 7; - /** - * Useful constant for MILLISECOND field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int MILLISECOND_FIELD = 8; - /** - * Useful constant for DAY_OF_WEEK field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int DAY_OF_WEEK_FIELD = 9; - /** - * Useful constant for DAY_OF_YEAR field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int DAY_OF_YEAR_FIELD = 10; - /** - * Useful constant for DAY_OF_WEEK_IN_MONTH field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int DAY_OF_WEEK_IN_MONTH_FIELD = 11; - /** - * Useful constant for WEEK_OF_YEAR field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int WEEK_OF_YEAR_FIELD = 12; - /** - * Useful constant for WEEK_OF_MONTH field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int WEEK_OF_MONTH_FIELD = 13; - /** - * Useful constant for AM_PM field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int AM_PM_FIELD = 14; - /** - * Useful constant for one-based HOUR field alignment. - * Used in FieldPosition of date/time formatting. - * HOUR1_FIELD is used for the one-based 12-hour clock. - * For example, 11:30 PM + 1 hour results in 12:30 AM. - */ - public final static int HOUR1_FIELD = 15; - /** - * Useful constant for zero-based HOUR field alignment. - * Used in FieldPosition of date/time formatting. - * HOUR0_FIELD is used for the zero-based 12-hour clock. - * For example, 11:30 PM + 1 hour results in 00:30 AM. - */ - public final static int HOUR0_FIELD = 16; - /** - * Useful constant for TIMEZONE field alignment. - * Used in FieldPosition of date/time formatting. - */ - public final static int TIMEZONE_FIELD = 17; - - // Proclaim serial compatibility with 1.1 FCS - private static final long serialVersionUID = 7218322306649953788L; - - /** - * Overrides Format. - * Formats a time object into a time string. Examples of time objects - * are a time value expressed in milliseconds and a Date object. - * @param obj must be a Number or a Date. - * @param toAppendTo the string buffer for the returning time string. - * @return the formatted time string. - * @param fieldPosition keeps track of the position of the field - * within the returned string. - * On input: an alignment field, - * if desired. On output: the offsets of the alignment field. For - * example, given a time text "1996.07.10 AD at 15:08:56 PDT", - * if the given fieldPosition is DateFormat.YEAR_FIELD, the - * begin index and end index of fieldPosition will be set to - * 0 and 4, respectively. - * Notice that if the same time field appears - * more than once in a pattern, the fieldPosition will be set for the first - * occurence of that time field. For instance, formatting a Date to - * the time string "1 PM PDT (Pacific Daylight Time)" using the pattern - * "h a z (zzzz)" and the alignment field DateFormat.TIMEZONE_FIELD, - * the begin index and end index of fieldPosition will be set to - * 5 and 8, respectively, for the first occurence of the timezone - * pattern character 'z'. - * @see java.text.Format - */ - public final StringBuffer format(Object obj, StringBuffer toAppendTo, - FieldPosition fieldPosition) - { - if (obj instanceof Date) - return format( (Date)obj, toAppendTo, fieldPosition ); - else if (obj instanceof Number) - return format( new Date(((Number)obj).longValue()), - toAppendTo, fieldPosition ); - else - throw new IllegalArgumentException("Cannot format given Object as a Date"); - } - - /** - * Formats a Date into a date/time string. - * @param date a Date to be formatted into a date/time string. - * @param toAppendTo the string buffer for the returning date/time string. - * @param fieldPosition keeps track of the position of the field - * within the returned string. - * On input: an alignment field, - * if desired. On output: the offsets of the alignment field. For - * example, given a time text "1996.07.10 AD at 15:08:56 PDT", - * if the given fieldPosition is DateFormat.YEAR_FIELD, the - * begin index and end index of fieldPosition will be set to - * 0 and 4, respectively. - * Notice that if the same time field appears - * more than once in a pattern, the fieldPosition will be set for the first - * occurence of that time field. For instance, formatting a Date to - * the time string "1 PM PDT (Pacific Daylight Time)" using the pattern - * "h a z (zzzz)" and the alignment field DateFormat.TIMEZONE_FIELD, - * the begin index and end index of fieldPosition will be set to - * 5 and 8, respectively, for the first occurence of the timezone - * pattern character 'z'. - * @return the formatted date/time string. - */ - public abstract StringBuffer format(Date date, StringBuffer toAppendTo, - FieldPosition fieldPosition); - - /** - * Formats a Date into a date/time string. - * @param date the time value to be formatted into a time string. - * @return the formatted time string. - */ - public final String format(Date date) - { - return format(date, new StringBuffer(),new FieldPosition(0)).toString(); - } - - /** - * Parse a date/time string. - * - * @param text The date/time string to be parsed - * - * @return A Date, or null if the input could not be parsed - * - * @exception ParseException If the given string cannot be parsed as a date. - * - * @see #parse(String, ParsePosition) - */ - public Date parse(String text) throws ParseException - { - ParsePosition pos = new ParsePosition(0); - Date result = parse(text, pos); - if (pos.getIndex() == 0) // ICU4J - throw new ParseException("Unparseable date: \"" + text + "\"" , - pos.getErrorIndex()); // ICU4J - return result; - } - - /** - * Parse a date/time string according to the given parse position. For - * example, a time text "07/10/96 4:5 PM, PDT" will be parsed into a Date - * that is equivalent to Date(837039928046). - * - *

By default, parsing is lenient: If the input is not in the form used - * by this object's format method but can still be parsed as a date, then - * the parse succeeds. Clients may insist on strict adherence to the - * format by calling setLenient(false). - * - * @see #setLenient(boolean) - * - * @param text The date/time string to be parsed - * - * @param pos On input, the position at which to start parsing; on - * output, the position at which parsing terminated, or the - * start position if the parse failed. - * - * @return A Date, or null if the input could not be parsed - */ - public abstract Date parse(String text, ParsePosition pos); - - /** - * Parse a date/time string into an Object. This convenience method simply - * calls parse(String, ParsePosition). - * - * @see #parse(String, ParsePosition) - */ - public Object parseObject (String source, ParsePosition pos) - { - return parse(source, pos); - } - - /** - * Constant for full style pattern. - */ - public static final int FULL = 0; - /** - * Constant for long style pattern. - */ - public static final int LONG = 1; - /** - * Constant for medium style pattern. - */ - public static final int MEDIUM = 2; - /** - * Constant for short style pattern. - */ - public static final int SHORT = 3; - /** - * Constant for default style pattern. Its value is MEDIUM. - */ - public static final int DEFAULT = MEDIUM; - - /** - * Gets the time formatter with the default formatting style - * for the default locale. - * @return a time formatter. - */ - public final static DateFormat getTimeInstance() - { - return get(-1, DEFAULT, Locale.getDefault()); - } - - /** - * Gets the time formatter with the given formatting style - * for the default locale. - * @param style the given formatting style. For example, - * SHORT for "h:mm a" in the US locale. - * @return a time formatter. - */ - public final static DateFormat getTimeInstance(int style) - { - return get(-1, style, Locale.getDefault()); - } - - /** - * Gets the time formatter with the given formatting style - * for the given locale. - * @param style the given formatting style. For example, - * SHORT for "h:mm a" in the US locale. - * @param aLocale the given locale. - * @return a time formatter. - */ - public final static DateFormat getTimeInstance(int style, - Locale aLocale) - { - return get(-1, style, aLocale); - } - - /** - * Gets the date formatter with the default formatting style - * for the default locale. - * @return a date formatter. - */ - public final static DateFormat getDateInstance() - { - return get(DEFAULT, -1, Locale.getDefault()); - } - - /** - * Gets the date formatter with the given formatting style - * for the default locale. - * @param style the given formatting style. For example, - * SHORT for "M/d/yy" in the US locale. - * @return a date formatter. - */ - public final static DateFormat getDateInstance(int style) - { - return get(style, -1, Locale.getDefault()); - } - - /** - * Gets the date formatter with the given formatting style - * for the given locale. - * @param style the given formatting style. For example, - * SHORT for "M/d/yy" in the US locale. - * @param aLocale the given locale. - * @return a date formatter. - */ - public final static DateFormat getDateInstance(int style, - Locale aLocale) - { - return get(style, -1, aLocale); - } - - /** - * Gets the date/time formatter with the default formatting style - * for the default locale. - * @return a date/time formatter. - */ - public final static DateFormat getDateTimeInstance() - { - return get(DEFAULT, DEFAULT, Locale.getDefault()); - } - - /** - * Gets the date/time formatter with the given date and time - * formatting styles for the default locale. - * @param dateStyle the given date formatting style. For example, - * SHORT for "M/d/yy" in the US locale. - * @param timeStyle the given time formatting style. For example, - * SHORT for "h:mm a" in the US locale. - * @return a date/time formatter. - */ - public final static DateFormat getDateTimeInstance(int dateStyle, - int timeStyle) - { - return get(dateStyle, timeStyle, Locale.getDefault()); - } - - /** - * Gets the date/time formatter with the given formatting styles - * for the given locale. - * @param dateStyle the given date formatting style. - * @param timeStyle the given time formatting style. - * @param aLocale the given locale. - * @return a date/time formatter. - */ - public final static DateFormat - getDateTimeInstance(int dateStyle, int timeStyle, Locale aLocale) - { - return get(dateStyle, timeStyle, aLocale); - } - - /** - * Get a default date/time formatter that uses the SHORT style for both the - * date and the time. - */ - public final static DateFormat getInstance() { - return getDateTimeInstance(SHORT, SHORT); - } - - /** - * Gets the set of locales for which DateFormats are installed. - * @return the set of locales for which DateFormats are installed. - */ - public static Locale[] getAvailableLocales() - { - return LocaleData.getAvailableLocales("DateTimePatterns"); - } - - /** - * Set the calendar to be used by this date format. Initially, the default - * calendar for the specified or default locale is used. - * @param newCalendar the new Calendar to be used by the date format - */ - public void setCalendar(Calendar newCalendar) - { - this.calendar = newCalendar; - } - - /** - * Gets the calendar associated with this date/time formatter. - * @return the calendar associated with this date/time formatter. - */ - public Calendar getCalendar() - { - return calendar; - } - - /** - * Allows you to set the number formatter. - * @param newNumberFormat the given new NumberFormat. - */ - public void setNumberFormat(NumberFormat newNumberFormat) - { - this.numberFormat = newNumberFormat; - /*In order to parse String like "11.10.2001" to DateTime correctly - in Locale("fr","CH") [Richard/GCL] - */ - this.numberFormat.setParseIntegerOnly(true); - } - - /** - * Gets the number formatter which this date/time formatter uses to - * format and parse a time. - * @return the number formatter which this date/time formatter uses. - */ - public NumberFormat getNumberFormat() - { - return numberFormat; - } - - /** - * Sets the time zone for the calendar of this DateFormat object. - * @param zone the given new time zone. - */ - public void setTimeZone(TimeZone zone) - { - calendar.setTimeZone(zone); - } - - /** - * Gets the time zone. - * @return the time zone associated with the calendar of DateFormat. - */ - public TimeZone getTimeZone() - { - return calendar.getTimeZone(); - } - - /** - * Specify whether or not date/time parsing is to be lenient. With - * lenient parsing, the parser may use heuristics to interpret inputs that - * do not precisely match this object's format. With strict parsing, - * inputs must match this object's format. - * @param lenient when true, parsing is lenient - * @see com.ibm.util.Calendar#setLenient - */ - public void setLenient(boolean lenient) - { - calendar.setLenient(lenient); - } - - /** - * Tell whether date/time parsing is to be lenient. - */ - public boolean isLenient() - { - return calendar.isLenient(); - } - - /** - * Overrides hashCode - */ - public int hashCode() { - return numberFormat.hashCode(); - // just enough fields for a reasonable distribution - } - - /** - * Overrides equals - */ - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null || getClass() != obj.getClass()) return false; - DateFormat other = (DateFormat) obj; - return (// calendar.equivalentTo(other.calendar) // THIS API DOESN'T EXIST YET! - calendar.getFirstDayOfWeek() == other.calendar.getFirstDayOfWeek() && - calendar.getMinimalDaysInFirstWeek() == other.calendar.getMinimalDaysInFirstWeek() && - calendar.isLenient() == other.calendar.isLenient() && - calendar.getTimeZone().equals(other.calendar.getTimeZone()) && - numberFormat.equals(other.numberFormat)); - } - - /** - * Overrides Cloneable - */ - public Object clone() - { - DateFormat other = (DateFormat) super.clone(); - other.calendar = (Calendar) calendar.clone(); - other.numberFormat = (NumberFormat) numberFormat.clone(); - return other; - } - - /** - * Creates a DateFormat with the given time and/or date style in the given - * locale. - * @param dateStyle a value from 0 to 3 indicating the time format, - * or -1 to indicate no date - * @param timeStyle a value from 0 to 3 indicating the time format, - * or -1 to indicate no time - * @param loc the locale for the format - */ - private static DateFormat get(int dateStyle, int timeStyle, Locale loc) { - if (timeStyle < -1 || timeStyle > 3) { - throw new IllegalArgumentException("Illegal time style " + timeStyle); - } - if (dateStyle < -1 || dateStyle > 3) { - throw new IllegalArgumentException("Illegal date style " + dateStyle); - } - try { - return new SimpleDateFormat(timeStyle, dateStyle, loc); - } catch (MissingResourceException e) { - return new SimpleDateFormat("M/d/yy h:mm a"); - } - } - - /** - * Create a new date format. - */ - protected DateFormat() {} - - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - //------------------------------------------------------------------------- - // Public static interface for creating custon DateFormats for different - // types of Calendars. - //------------------------------------------------------------------------- - - /** - * Create a {@link DateFormat} object that can be used to format dates in - * the calendar system specified by cal. - *

- * @param cal The calendar system for which a date format is desired. - * - * @param dateStyle The type of date format desired. This can be - * {@link DateFormat#SHORT}, {@link DateFormat#MEDIUM}, - * etc. - * - * @param locale The locale for which the date format is desired. - */ - static final public DateFormat getDateInstance(Calendar cal, int dateStyle, Locale locale) - { - return getDateTimeInstance(cal, dateStyle, -1, locale); - } - - /** - * Create a {@link DateFormat} object that can be used to format times in - * the calendar system specified by cal. - *

- * Note: When this functionality is moved into the core JDK, this method - * will probably be replaced by a new overload of {@link DateFormat#getInstance}. - *

- * @param cal The calendar system for which a time format is desired. - * - * @param timeStyle The type of time format desired. This can be - * {@link DateFormat#SHORT}, {@link DateFormat#MEDIUM}, - * etc. - * - * @param locale The locale for which the time format is desired. - * - * @see DateFormat#getTimeInstance - */ - static final public DateFormat getTimeInstance(Calendar cal, int timeStyle, Locale locale) - { - return getDateTimeInstance(cal, -1, timeStyle, locale); - } - - /** - * Create a {@link DateFormat} object that can be used to format dates and times in - * the calendar system specified by cal. - *

- * Note: When this functionality is moved into the core JDK, this method - * will probably be replaced by a new overload of {@link DateFormat#getInstance}. - *

- * @param cal The calendar system for which a date/time format is desired. - * - * @param dateStyle The type of date format desired. This can be - * {@link DateFormat#SHORT}, {@link DateFormat#MEDIUM}, - * etc. - * - * @param timeStyle The type of time format desired. This can be - * {@link DateFormat#SHORT}, {@link DateFormat#MEDIUM}, - * etc. - * - * @param locale The locale for which the date/time format is desired. - * - * @see DateFormat#getDateTimeInstance - */ - static final public DateFormat getDateTimeInstance(Calendar cal, int dateStyle, - int timeStyle, Locale locale) - { - return cal.getDateTimeFormat(dateStyle, timeStyle, locale); - } - - /** - * Convenience overload - */ - static final public DateFormat getInstance(Calendar cal, Locale locale) { - return getDateTimeInstance(cal, SHORT, SHORT, locale); - } - - /** - * Convenience overload - */ - static final public DateFormat getInstance(Calendar cal) { - return getInstance(cal, Locale.getDefault()); - } - - /** - * Convenience overload - */ - static final public DateFormat getDateInstance(Calendar cal, int dateStyle) { - return getDateInstance(cal, dateStyle, Locale.getDefault()); - } - - /** - * Convenience overload - */ - static final public DateFormat getTimeInstance(Calendar cal, int timeStyle) { - return getTimeInstance(cal, timeStyle, Locale.getDefault()); - } - - /** - * Convenience overload - */ - static final public DateFormat getDateTimeInstance(Calendar cal, int dateStyle, int timeStyle) { - return getDateTimeInstance(cal, dateStyle, timeStyle, Locale.getDefault()); - } -} diff --git a/icu4j/src/com/ibm/text/DateFormatSymbols.java b/icu4j/src/com/ibm/text/DateFormatSymbols.java deleted file mode 100755 index 735a2e1f5c..0000000000 --- a/icu4j/src/com/ibm/text/DateFormatSymbols.java +++ /dev/null @@ -1,831 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/DateFormatSymbols.java,v $ - * $Date: 2001/01/09 22:48:51 $ - * $Revision: 1.8 $ - * - ***************************************************************************************** - */ - -package com.ibm.text; -import java.util.Locale; -import java.util.ResourceBundle; -import java.io.Serializable; -import java.lang.ref.SoftReference; -import java.util.Hashtable; -import java.util.Vector; -import java.util.Enumeration; -import java.text.resources.DateFormatZoneData; -import com.ibm.util.Utility; -import com.ibm.util.Calendar; -import com.ibm.util.GregorianCalendar; -import com.ibm.util.TimeZone; -import java.util.MissingResourceException; - -/** - * DateFormatSymbols is a public class for encapsulating - * localizable date-time formatting data, such as the names of the - * months, the names of the days of the week, and the time zone data. - * DateFormat and SimpleDateFormat both use - * DateFormatSymbols to encapsulate this information. - * - *

- * Typically you shouldn't use DateFormatSymbols directly. - * Rather, you are encouraged to create a date-time formatter with the - * DateFormat class's factory methods: getTimeInstance, - * getDateInstance, or getDateTimeInstance. - * These methods automatically create a DateFormatSymbols for - * the formatter so that you don't have to. After the - * formatter is created, you may modify its format pattern using the - * setPattern method. For more information about - * creating formatters using DateFormat's factory methods, - * see {@link DateFormat}. - * - *

- * If you decide to create a date-time formatter with a specific - * format pattern for a specific locale, you can do so with: - *

- *
- * new SimpleDateFormat(aPattern, new DateFormatSymbols(aLocale)).
- * 
- *
- * - *

- * DateFormatSymbols objects are clonable. When you obtain - * a DateFormatSymbols object, feel free to modify the - * date-time formatting data. For instance, you can replace the localized - * date-time format pattern characters with the ones that you feel easy - * to remember. Or you can change the representative cities - * to your favorite ones. - * - *

- * New DateFormatSymbols subclasses may be added to support - * SimpleDateFormat for date-time formatting for additional locales. - - * @see DateFormat - * @see SimpleDateFormat - * @see com.ibm.util.SimpleTimeZone - * @version 1.31 09/21/99 - * @author Chen-Lieh Huang - */ -public class DateFormatSymbols implements Serializable, Cloneable { - - /** - * Construct a DateFormatSymbols object by loading format data from - * resources for the default locale. - * - * @exception java.util.MissingResourceException - * if the resources for the default locale cannot be - * found or cannot be loaded. - */ - public DateFormatSymbols() - { - initializeData(Locale.getDefault()); - } - - /** - * Construct a DateFormatSymbols object by loading format data from - * resources for the given locale. - * - * @exception java.util.MissingResourceException - * if the resources for the specified locale cannot be - * found or cannot be loaded. - */ - public DateFormatSymbols(Locale locale) - { - initializeData(locale); - } - - /** - * Era strings. For example: "AD" and "BC". An array of 2 strings, - * indexed by Calendar.BC and Calendar.AD. - * @serial - */ - String eras[] = null; - - /** - * Month strings. For example: "January", "February", etc. An array - * of 13 strings (some calendars have 13 months), indexed by - * Calendar.JANUARY, Calendar.FEBRUARY, etc. - * @serial - */ - String months[] = null; - - /** - * Short month strings. For example: "Jan", "Feb", etc. An array of - * 13 strings (some calendars have 13 months), indexed by - * Calendar.JANUARY, Calendar.FEBRUARY, etc. - - * @serial - */ - String shortMonths[] = null; - - /** - * Weekday strings. For example: "Sunday", "Monday", etc. An array - * of 8 strings, indexed by Calendar.SUNDAY, - * Calendar.MONDAY, etc. - * The element weekdays[0] is ignored. - * @serial - */ - String weekdays[] = null; - - /** - * Short weekday strings. For example: "Sun", "Mon", etc. An array - * of 8 strings, indexed by Calendar.SUNDAY, - * Calendar.MONDAY, etc. - * The element shortWeekdays[0] is ignored. - * @serial - */ - String shortWeekdays[] = null; - - /** - * AM and PM strings. For example: "AM" and "PM". An array of - * 2 strings, indexed by Calendar.AM and - * Calendar.PM. - * @serial - */ - String ampms[] = null; - - /** - * Localized names of time zones in this locale. This is a - * two-dimensional array of strings of size n by m, - * where m is at least 5. Each of the n rows is an - * entry containing the localized names for a single TimeZone. - * Each such row contains (with i ranging from - * 0..n-1): - *

    - *
  • zoneStrings[i][0] - time zone ID
  • - *
  • zoneStrings[i][1] - long name of zone in standard - * time
  • - *
  • zoneStrings[i][2] - short name of zone in - * standard time
  • - *
  • zoneStrings[i][3] - long name of zone in daylight - * savings time
  • - *
  • zoneStrings[i][4] - short name of zone in daylight - * savings time
  • - *
- * The zone ID is not localized; it corresponds to the ID - * value associated with a system time zone object. All other entries - * are localized names. If a zone does not implement daylight savings - * time, the daylight savings time names are ignored. - * @see java.text.resources.DateFormatZoneData - * @see com.ibm.util.TimeZone - * @serial - */ - String zoneStrings[][] = null; - - /** - * Unlocalized date-time pattern characters. For example: 'y', 'd', etc. - * All locales use the same these unlocalized pattern characters. - */ - static final String patternChars = "GyMdkHmsSEDFwWahKz"; - - /** - * Localized date-time pattern characters. For example, a locale may - * wish to use 'u' rather than 'y' to represent years in its date format - * pattern strings. - * This string must be exactly 18 characters long, with the index of - * the characters described by DateFormat.ERA_FIELD, - * DateFormat.YEAR_FIELD, etc. Thus, if the string were - * "Xz...", then localized patterns would use 'X' for era and 'z' for year. - * @serial - */ - String localPatternChars = null; - - /* use serialVersionUID from JDK 1.1.4 for interoperability */ - static final long serialVersionUID = -5987973545549424702L; - - /** - * Gets era strings. For example: "AD" and "BC". - * @return the era strings. - */ - public String[] getEras() { - return duplicate(eras); - } - - /** - * Sets era strings. For example: "AD" and "BC". - * @param newEras the new era strings. - */ - public void setEras(String[] newEras) { - eras = duplicate(newEras); - } - - /** - * Gets month strings. For example: "January", "February", etc. - * @return the month strings. - */ - public String[] getMonths() { - return duplicate(months); - } - - /** - * Sets month strings. For example: "January", "February", etc. - * @param newMonths the new month strings. - */ - public void setMonths(String[] newMonths) { - months = duplicate(newMonths); - } - - /** - * Gets short month strings. For example: "Jan", "Feb", etc. - * @return the short month strings. - */ - public String[] getShortMonths() { - return duplicate(shortMonths); - } - - /** - * Sets short month strings. For example: "Jan", "Feb", etc. - * @param newShortMonths the new short month strings. - */ - public void setShortMonths(String[] newShortMonths) { - shortMonths = duplicate(newShortMonths); - } - - /** - * Gets weekday strings. For example: "Sunday", "Monday", etc. - * @return the weekday strings. Use Calendar.SUNDAY, - * Calendar.MONDAY, etc. to index the result array. - */ - public String[] getWeekdays() { - return duplicate(weekdays); - } - - /** - * Sets weekday strings. For example: "Sunday", "Monday", etc. - * @param newWeekdays the new weekday strings. The array should - * be indexed by Calendar.SUNDAY, - * Calendar.MONDAY, etc. - */ - public void setWeekdays(String[] newWeekdays) { - weekdays = duplicate(newWeekdays); - } - - /** - * Gets short weekday strings. For example: "Sun", "Mon", etc. - * @return the short weekday strings. Use Calendar.SUNDAY, - * Calendar.MONDAY, etc. to index the result array. - */ - public String[] getShortWeekdays() { - return duplicate(shortWeekdays); - } - - /** - * Sets short weekday strings. For example: "Sun", "Mon", etc. - * @param newShortWeekdays the new short weekday strings. The array should - * be indexed by Calendar.SUNDAY, - * Calendar.MONDAY, etc. - */ - public void setShortWeekdays(String[] newShortWeekdays) { - shortWeekdays = duplicate(newShortWeekdays); - } - - /** - * Gets ampm strings. For example: "AM" and "PM". - * @return the weekday strings. - */ - public String[] getAmPmStrings() { - return duplicate(ampms); - } - - /** - * Sets ampm strings. For example: "AM" and "PM". - * @param newAmpms the new ampm strings. - */ - public void setAmPmStrings(String[] newAmpms) { - ampms = duplicate(newAmpms); - } - - /** - * Gets timezone strings. - * @return the timezone strings. - */ - public String[][] getZoneStrings() { - String[][] aCopy = new String[zoneStrings.length][]; - for (int i = 0; i < zoneStrings.length; ++i) - aCopy[i] = duplicate(zoneStrings[i]); - return aCopy; - } - - /** - * Sets timezone strings. - * @param newZoneStrings the new timezone strings. - */ - public void setZoneStrings(String[][] newZoneStrings) { - String[][] aCopy = new String[newZoneStrings.length][]; - for (int i = 0; i < newZoneStrings.length; ++i) - aCopy[i] = duplicate(newZoneStrings[i]); - zoneStrings = aCopy; - } - - /** - * Gets localized date-time pattern characters. For example: 'u', 't', etc. - * @return the localized date-time pattern characters. - */ - public String getLocalPatternChars() { - return new String(localPatternChars); - } - - /** - * Sets localized date-time pattern characters. For example: 'u', 't', etc. - * @param newLocalPatternChars the new localized date-time - * pattern characters. - */ - public void setLocalPatternChars(String newLocalPatternChars) { - localPatternChars = new String(newLocalPatternChars); - } - - /** - * Overrides Cloneable - */ - public Object clone() - { - try - { - DateFormatSymbols other = (DateFormatSymbols)super.clone(); - copyMembers(this, other); - return other; - } catch (CloneNotSupportedException e) { - throw new InternalError(); - } - } - - /** - * Override hashCode. - * Generates a hash code for the DateFormatSymbols object. - */ - public int hashCode() { - int hashcode = 0; - for (int index = 0; index < this.zoneStrings[0].length; ++index) - hashcode ^= this.zoneStrings[0][index].hashCode(); - return hashcode; - } - - /** - * Override equals - */ - public boolean equals(Object obj) - { - if (this == obj) return true; - if (obj == null || getClass() != obj.getClass()) return false; - DateFormatSymbols that = (DateFormatSymbols) obj; - return (Utility.arrayEquals(eras, that.eras) - && Utility.arrayEquals(months, that.months) - && Utility.arrayEquals(shortMonths, that.shortMonths) - && Utility.arrayEquals(weekdays, that.weekdays) - && Utility.arrayEquals(shortWeekdays, that.shortWeekdays) - && Utility.arrayEquals(ampms, that.ampms) - && Utility.arrayEquals(zoneStrings, that.zoneStrings) - && Utility.arrayEquals(localPatternChars, - that.localPatternChars)); - } - - // =======================privates=============================== - - /** - * Useful constant for defining timezone offsets. - */ - static final int millisPerHour = 60*60*1000; - - /** - * Cache to hold the LocaleElements and DateFormatZoneData ResourceBundles - * of a Locale. - */ - private static Hashtable cachedLocaleData = new Hashtable(3); - - /** - * cache to hold time zone localized strings. Keyed by Locale - */ - private static Hashtable cachedZoneData = new Hashtable(); - - /* Utility methods for fetching resource bundles */ - private ResourceBundle getLocaleElements(Locale desiredLocale) { - return ResourceBundle.getBundle("java.text.resources.LocaleElements", - desiredLocale); - } - - private ResourceBundle getZoneData(Locale desiredLocale) { - return ResourceBundle.getBundle("java.text.resources.DateFormatZoneData", - desiredLocale); - } - - /** - * Look up resource data for the desiredLocale in the cache; update the - * cache if necessary. - */ - private ResourceBundle[] cacheLookup(Locale desiredLocale) { - ResourceBundle[] rbs = new ResourceBundle[2]; - SoftReference[] data - = (SoftReference[])cachedLocaleData.get(desiredLocale); - if (data == null) { - rbs[0] = getLocaleElements(desiredLocale); - rbs[1] = getZoneData(desiredLocale); - data = new SoftReference[] { new SoftReference(rbs[0]), - new SoftReference(rbs[1]) }; - cachedLocaleData.put(desiredLocale, data); - } else { - ResourceBundle r; - if ((r = (ResourceBundle)data[0].get()) == null) { - r = getLocaleElements(desiredLocale); - data[0] = new SoftReference(r); - } - rbs[0] = r; - if ((r = (ResourceBundle)data[1].get()) == null) { - r = getZoneData(desiredLocale); - data[1] = new SoftReference(r); - } - rbs[1] = r; - } - return rbs; - } - - /** - * Load time zone localized strings. Enumerate all keys (except - * "localPatternChars" and "zoneStrings"). - */ - private String[][] loadZoneStrings(Locale desiredLocale, - ResourceBundle rsrc) - { - /* We have to handle two different formats of DateFormatZoneData. - * The first is used in JDK 1.2.2: - * - * | public Object[][] getContents() { - * | return new Object[][] { - * | {"zoneStrings", - * | new String[][] { - * | {"America/Los_Angeles", "Pacific Standard Time", "PST", - * | "Pacific Daylight Time", "PDT" }, - * | //... - * | } - * | }, - * | {"localPatternChars", "GyMdkHmsSEDFwWahKz"}, - * | }; - * | } - * - * The second is used in JDK 1.3: - * - * | public Object[][] getContents() { - * | return new Object[][] { - * | {"America/Los_Angeles", new String[] {"America/Los_Angeles", "Pacific Standard Time", "PST", - * | "Pacific Daylight Time", "PDT"}}, - * | {"localPatternChars", "GyMdkHmsSEDFwWahKz"}, - * | }; - * | } - * - * Let's pray they don't alter it further. - */ - String[][] zones = null; - SoftReference data = (SoftReference)cachedZoneData.get(desiredLocale); - if (data == null || ((zones = (String[][])data.get()) == null)) { - // For JDK 1.3, we have to enumerate over the keys. For 1.2.2, a - // single getObject() call works. As a heuristic, we assume that if - // the zoneStrings key is present, then we are have a 1.2.2 format. - // Otherwise we parse the 1.3 format. - liu - try { - zones = (String[][])rsrc.getObject("zoneStrings"); - } catch (java.util.MissingResourceException e) {} - if (zones == null || zones.length == 0) { - Vector vec = new Vector(); - Enumeration keys = rsrc.getKeys(); - while(keys.hasMoreElements()) { - String key = (String)keys.nextElement(); - if (!key.equals("localPatternChars") && - !key.equals("zoneStrings")) { - vec.add(rsrc.getObject(key)); - } - } - zones = new String[vec.size()][]; - vec.toArray(zones); - } - data = new SoftReference(zones); - cachedZoneData.put(desiredLocale, data); - } - return zones; - } - - private void initializeData(Locale desiredLocale) - { - int i; - ResourceBundle[] rbs = cacheLookup(desiredLocale); - ResourceBundle resource = rbs[0]; - ResourceBundle zoneResource = rbs[1]; - - // FIXME: cache only ResourceBundle. Hence every time, will do - // getObject(). This won't be necessary if the Resource itself - // is cached. - eras = (String[])resource.getObject("Eras"); - months = resource.getStringArray("MonthNames"); - shortMonths = resource.getStringArray("MonthAbbreviations"); - String[] lWeekdays = resource.getStringArray("DayNames"); - weekdays = new String[8]; - weekdays[0] = ""; // 1-based - for (i=0; i= 0) { - return result; - } - - // Do a search through the equivalency group for the given ID - int n = TimeZone.countEquivalentIDs(ID); - if (n > 1) { - for (int i=0; i= 0) { - return equivResult; - } - } - } - } - - return -1; - } - - /** - * Lookup the given ID. Do NOT do an equivalency search. - */ - private int _getZoneIndex(String ID) - { - for (int index=0; index - * Subclassing:
- * When creating a new Calendar subclass, you must create the - * {@link ResourceBundle ResourceBundle} - * containing its {@link DateFormatSymbols DateFormatSymbols} in a specific place. - * The resource bundle name is based on the calendar's fully-specified - * class name, with ".resources" inserted at the end of the package name - * (just before the class name) and "Symbols" appended to the end. - * For example, the bundle corresponding to "com.ibm.util.HebrewCalendar" - * is "com.ibm.util.resources.HebrewCalendarSymbols". - *

- * Within the ResourceBundle, this method searches for five keys: - *

    - *
  • DayNames - - * An array of strings corresponding to each possible - * value of the DAY_OF_WEEK field. Even though - * DAY_OF_WEEK starts with SUNDAY = 1, - * This array is 0-based; the name for Sunday goes in the - * first position, at index 0. If this key is not found - * in the bundle, the day names are inherited from the - * default DateFormatSymbols for the requested locale. - * - *
  • DayAbbreviations - - * An array of abbreviated day names corresponding - * to the values in the "DayNames" array. If this key - * is not found in the resource bundle, the "DayNames" - * values are used instead. If neither key is found, - * the day abbreviations are inherited from the default - * DateFormatSymbols for the locale. - * - *
  • MonthNames - - * An array of strings corresponding to each possible - * value of the MONTH field. If this key is not found - * in the bundle, the month names are inherited from the - * default DateFormatSymbols for the requested locale. - * - *
  • MonthAbbreviations - - * An array of abbreviated day names corresponding - * to the values in the "MonthNames" array. If this key - * is not found in the resource bundle, the "MonthNames" - * values are used instead. If neither key is found, - * the day abbreviations are inherited from the default - * DateFormatSymbols for the locale. - * - *
  • Eras - - * An array of strings corresponding to each possible - * value of the ERA field. If this key is not found - * in the bundle, the era names are inherited from the - * default DateFormatSymbols for the requested locale. - *
- *

- * @param cal The calendar system whose date format symbols are desired. - * @param locale The locale whose symbols are desired. - * - * @see DateFormatSymbols#DateFormatSymbols(java.util.Locale) - */ - public DateFormatSymbols(Calendar cal, Locale locale) { - this(cal==null?null:cal.getClass(), locale); - } - - public DateFormatSymbols(Class calendarClass, Locale locale) { - this(locale); // old-style construction - if (calendarClass != null) { - ResourceBundle bundle = null; - try { - bundle = getDateFormatBundle(calendarClass, locale); - } catch (MissingResourceException e) { - //if (!(cal instanceof GregorianCalendar)) { - if (!(GregorianCalendar.class.isAssignableFrom(calendarClass))) { - // Ok for symbols to be missing for a Gregorian calendar, but - // not for any other type. - throw e; - } - } - constructCalendarSpecific(bundle); - } - } - - /** - * Fetch a custom calendar's DateFormatSymbols out of the given resource - * bundle. Symbols that are not overridden are inherited from the - * default DateFormatSymbols for the locale. - * @see DateFormatSymbols#DateFormatSymbols - */ - public DateFormatSymbols(ResourceBundle bundle, Locale locale) { - // Get the default symbols for the locale, since most - // calendars will only need to override month names and will - // want everything else the same - this(locale); // old-style construction - constructCalendarSpecific(bundle); - } - - /** - * Given a resource bundle specific to the given Calendar class, - * initialize this object. Member variables will have already been - * initialized using the default mechanism, so only those that differ - * from or supplement the standard resource data need be handled here. - * If subclasses override this method, they should call - * super.constructCalendarSpecific(bundle) as needed to - * handle the "DayNames", "DayAbbreviations", "MonthNames", - * "MonthAbbreviations", and "Eras" resource data. - */ - protected void constructCalendarSpecific(ResourceBundle bundle) { - - // Fetch the day names from the resource bundle. If they're not found, - // it's ok; we'll just use the default ones. - // Allow a null ResourceBundle just for the sake of completeness; - // this is useful for calendars that don't have any overridden symbols - - if (bundle != null) { - try { - String[] temp = bundle.getStringArray("DayNames"); - setWeekdays(temp); - setShortWeekdays(temp); - - temp = bundle.getStringArray("DayAbbreviations"); - setShortWeekdays( temp ); - } catch (MissingResourceException e) {} - - try { - String[] temp = bundle.getStringArray("MonthNames"); - setMonths( temp ); - setShortMonths( temp ); - - temp = bundle.getStringArray("MonthAbbreviations"); - setShortMonths( temp ); - } catch (MissingResourceException e) {} - - try { - String[] temp = bundle.getStringArray("Eras"); - setEras( temp ); - } catch (MissingResourceException e) {} - } - } - -//~ private static final java.text.DateFormatSymbols oldStyleSymbols(DateFormatSymbols syms, Locale loc) { -//~ java.text.DateFormatSymbols result = new java.text.DateFormatSymbols(loc); -//~ result.setAmPmStrings(syms.getAmPmStrings()); -//~ result.setEras(syms.getEras()); -//~ result.setLocalPatternChars(syms.getLocalPatternChars()); -//~ result.setMonths(syms.getMonths()); -//~ result.setShortMonths(syms.getShortMonths()); -//~ result.setShortWeekdays(syms.getShortWeekdays()); -//~ result.setWeekdays(syms.getWeekdays()); -//~ result.setZoneStrings(syms.getZoneStrings()); -//~ return result; -//~ } - - /** - * Find the ResourceBundle containing the date format information for - * a specified calendar subclass in a given locale. - *

- * The resource bundle name is based on the calendar's fully-specified - * class name, with ".resources" inserted at the end of the package name - * (just before the class name) and "Symbols" appended to the end. - * For example, the bundle corresponding to "com.ibm.util.HebrewCalendar" - * is "com.ibm.util.resources.HebrewCalendarSymbols". - */ - static public ResourceBundle getDateFormatBundle(Class calendarClass, Locale locale) - throws MissingResourceException { - - // Find the calendar's class name, which we're going to use to construct the - // resource bundle name. - String fullName = calendarClass.getName(); - int lastDot = fullName.lastIndexOf('.'); - String className = fullName.substring(lastDot+1); - - // The name of the ResourceBundle itself is the calendar's fully-qualified - // name, with ".resources" inserted in the package and "Symbols" appended. - // E.g., "my.pkg.MyCalendar" -> "my.pkg.resources.MyCalendarSymbols" - String bundleName = fullName.substring(0, lastDot+1) + "resources." - + className + "Symbols"; - - ResourceBundle result = null; - try { - result = ResourceBundle.getBundle(bundleName, locale); - } - catch (MissingResourceException e) { - //if (!(cal instanceof GregorianCalendar)) { - if (!(GregorianCalendar.class.isAssignableFrom(calendarClass))) { - // Ok for symbols to be missing for a Gregorian calendar, but - // not for any other type. - throw e; - } - } - return result; - } - - static public ResourceBundle getDateFormatBundle(Calendar cal, Locale locale) - throws MissingResourceException { - return getDateFormatBundle(cal==null?null:cal.getClass(), locale); - } -} diff --git a/icu4j/src/com/ibm/text/DecimalFormat.java b/icu4j/src/com/ibm/text/DecimalFormat.java deleted file mode 100755 index 4387dd4490..0000000000 --- a/icu4j/src/com/ibm/text/DecimalFormat.java +++ /dev/null @@ -1,3203 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/DecimalFormat.java,v $ - * $Date: 2001/10/30 02:43:54 $ - * $Revision: 1.13 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.text.Format; -import java.text.ParsePosition; -import java.text.FieldPosition; -import java.math.BigInteger; -import java.util.ResourceBundle; -import java.util.Locale; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.util.Hashtable; -import java.io.InvalidObjectException; //Bug 4185761 [Richard/GCL] - -/** - * DecimalFormat is a concrete subclass of - * NumberFormat that formats decimal numbers. It has a variety of - * features designed to make it possible to parse and format numbers in any - * locale, including support for Western, Arabic, or Indic digits. It also - * supports different flavors of numbers, including integers (123), fixed-point - * numbers (123.4), scientific notation (1.23E4), percentages (12%), and - * currency amounts ($123). All of these flavors can be easily localized. - * - *

This is an enhanced version of DecimalFormat that - * is based on the standard version in the JDK. New or changed functionality - * is labeled - * NEW or - * CHANGED. - * - *

To obtain a NumberFormat for a specific locale (including the - * default locale) call one of NumberFormat's factory methods such - * as getInstance(). Do not call the DecimalFormat - * constructors directly, unless you know what you are doing, since the - * NumberFormat factory methods may return subclasses other than - * DecimalFormat. If you need to customize the format object, do - * something like this: - * - *

- * NumberFormat f = NumberFormat.getInstance(loc);
- * if (f instanceof DecimalFormat) {
- *     ((DecimalFormat) f).setDecimalSeparatorAlwaysShown(true);
- * }
- * 
- * - *

A DecimalFormat comprises a pattern and a set of - * symbols. The pattern may be set directly using - * applyPattern(), or indirectly using the API methods. The - * symbols are stored in a DecimalFormatSymbols object. When using - * the NumberFormat factory methods, the pattern and symbols are - * read from localized ResourceBundles in the package - * java.text.resource. - * - *

Synchronization

- *

- * Decimal formats are generally not synchronized. It is recommended to create - * separate format instances for each thread. If multiple threads access a format - * concurrently, it must be synchronized externally. - *

- * - *

Example - * - *

- * // Print out a number using the localized number, currency,
- * // and percent format for each locale
- * Locale[] locales = NumberFormat.getAvailableLocales();
- * double myNumber = -1234.56;
- * NumberFormat form;
- * for (int j=0; j<3; ++j) {
- *     System.out.println("FORMAT");
- *     for (int i = 0; i < locales.length; ++i) {
- *         if (locales[i].getCountry().length() == 0) {
- *            // Skip language-only locales
- *            continue;
- *         }
- *         System.out.print(locales[i].getDisplayName());
- *         switch (j) {
- *         case 0:
- *             form = NumberFormat.getInstance(locales[i]); break;
- *         case 1:
- *             form = NumberFormat.getCurrencyInstance(locales[i]); break;
- *         default:
- *             form = NumberFormat.getPercentInstance(locales[i]); break;
- *         }
- *         try {
- *             // Assume form is a DecimalFormat
- *             System.out.print(": " + ((DecimalFormat) form).toPattern()
- *                              + " -> " + form.format(myNumber));
- *         } catch (IllegalArgumentException e) {}
- *         try {
- *             System.out.println(" -> " + form.parse(form.format(myNumber)));
- *         } catch (ParseException e) {}
- *     }
- * }
- * 
- * - *

Notes - * - *

A DecimalFormat pattern contains a postive and negative - * subpattern, for example, "#,##0.00;(#,##0.00)". Each subpattern has a - * prefix, numeric part, and suffix. If there is no explicit negative - * subpattern, the localized minus sign, typically '-', is prefixed to the - * positive form. That is, "0.00" alone is equivalent to "0.00;-0.00". If there - * is an explicit negative subpattern, it serves only to specify the negative - * prefix and suffix; the number of digits, minimal digits, and other - * characteristics are all the same as the positive pattern. That means that - * "#,##0.0#;(#)" has precisely the same result as "#,##0.0#;(#,##0.0#)". - * - *

The prefixes, suffixes, and various symbols used for infinity, digits, - * thousands separators, decimal separators, etc. may be set to arbitrary - * values, and they will appear properly during formatting. However, care must - * be taken that the symbols and strings do not conflict, or parsing will be - * unreliable. For example, either the positive and negative prefixes or the - * suffixes must be distinct for DecimalFormat.parse() to be able - * to distinguish positive from negative values. Another example is that the - * decimal separator and thousands separator should be distinct characters, or - * parsing will be impossible. - * - *

The grouping separator is commonly used for thousands, but in some - * countries it separates ten-thousands. The grouping size is a constant number - * of digits between the grouping characters, such as 3 for 100,000,000 or 4 for - * 1,0000,0000. - * If you supply a pattern with multiple grouping characters, the interval - * between the last one and the end of the integer determines the primary - * grouping size, and the interval between the last two determines - * the secondary grouping size (see below); all others are ignored. - * So "#,##,###,####" == "###,###,####" == "##,#,###,####". - * - *

Some locales have two different grouping intervals: One used for the - * least significant integer digits (the primary grouping size), and - * one used for all others (the secondary grouping size). For example, - * if the primary grouping interval is 3, and the secondary is 2, then - * this corresponds to the pattern "#,##,##0", and the number 123456789 - * is formatted as "12,34,56,789". - * - *

DecimalFormat parses all Unicode characters that represent - * decimal digits, as defined by Character.digit(). In addition, - * DecimalFormat also recognizes as digits the ten consecutive - * characters starting with the localized zero digit defined in the - * DecimalFormatSymbols object. During formatting, the - * DecimalFormatSymbols-based digits are output. - * - *

Illegal patterns, such as "#.#.#" or "#.###,###", will cause - * DecimalFormat to throw an IllegalArgumentException - * with a message that describes the problem. - * - *

If DecimalFormat.parse(String, ParsePosition) fails to parse - * a string, it returns null and leaves the parse position - * unchanged. The convenience method DecimalFormat.parse(String) - * indicates parse failure by throwing a ParseException. - * - *

Special Cases - * - *

NaN is formatted as a single character, typically - * \uFFFD. This character is determined by the - * DecimalFormatSymbols object. This is the only value for which - * the prefixes and suffixes are not used. - * - *

Infinity is formatted as a single character, typically - * \u221E, with the positive or negative prefixes and suffixes - * applied. The infinity character is determined by the - * DecimalFormatSymbols object. - * - *

- * NEW - * Scientific Notation - * - *

Numbers in scientific notation are expressed as the product of a mantissa - * and a power of ten, for example, 1234 can be expressed as 1.234 x 10^3. The - * mantissa is often in the range 1.0 <= x < 10.0, but it need not be. - * DecimalFormat can be instructed to format and parse scientific - * notation through the API or via a pattern. In a pattern, the exponent - * character immediately followed by one or more digit characters indicates - * scientific notation. Example: "0.###E0" formats the number 1234 as - * "1.234E3". - * - *

    - *
  • The number of digit characters after the exponent character gives the - * minimum exponent digit count. There is no maximum. Negative exponents are - * formatted using the localized minus sign, not the prefix and suffix - * from the pattern. This allows patterns such as "0.###E0 m/s". To prefix - * positive exponents with a localized plus sign, specify '+' between the - * exponent and the digits: "0.###E+0" will produce formats "1E+1", "1E+0", - * "1E-1", etc. (In localized patterns, use the localized plus sign rather than - * '+'.) - * - *
  • The minimum number of integer digits is achieved by adjusting the - * exponent. Example: 0.00123 formatted with "00.###E0" yields "12.3E-4". This - * only happens if there is no maximum number of integer digits. If there is a - * maximum, then the minimum number of integer digits is fixed at one. - * - *
  • The maximum number of integer digits, if present, specifies the exponent - * grouping. The most common use of this is to generate engineering - * notation, in which the exponent is a multiple of three, e.g., - * "##0.###E0". The number 12345 is formatted using "##0.####E0" as "12.345E3". - * - *
  • The number of significant digits is the sum of the minimum - * integer and maximum fraction digits, and is unaffected by the - * maximum integer digits. If this sum is zero, then all significant digits are - * shown. The number of significant digits limits the total number of integer - * and fraction digits that will be shown in the mantissa; it does not affect - * parsing. For example, 12345 formatted with "##0.##E0" is "12.3E3". - * - *
  • Exponential patterns may not contain grouping separators. - *
- * - *

- * NEW - * Padding - * - *

DecimalFormat supports padding the result of - * format() to a specific width. Padding may be specified either - * through the API or through the pattern syntax. In a pattern the pad escape - * character, followed by a single pad character, causes padding to be parsed - * and formatted. The pad escape character is '*' in unlocalized patterns, and - * can be localized using DecimalFormatSymbols.setPadEscape(). For - * example, "$*x#,##0.00" formats 123 to "$xx123.00", - * and 1234 to "$1,234.00". - * - *

    - *
  • When padding is in effect, the width of the positive subpattern, - * including prefix and suffix, determines the format width. For example, in - * the pattern "* #0 o''clock", the format width is 10. - * - *
  • Some parameters which usually do not matter have meaning when padding is - * used, because the pattern width is significant with padding. In the pattern - * "^ ##,##,#,##0.##", the format width is 14. The initial characters "##,##," - * do not affect the grouping size or maximum integer digits, but they do affect - * the format width. - * - *
  • Padding may be inserted at one of four locations: before the prefix, - * after the prefix, before the suffix, or after the suffix. If padding is - * specified in any other location, DecimalFormat.applyPattern() - * throws an IllegalArgumentException. If there is no prefix, - * before the prefix and after the prefix are equivalent, likewise for the - * suffix. - * - *
  • The pad character may not be a quote. - *
- * - *

- * NEW - * Rounding - * - *

DecimalFormat supports rounding to a specific increment. For - * example, 1230 rounded to the nearest 50 is 1250. 1.234 rounded to the - * nearest 0.65 is 1.3. The rounding increment may be specified through the API - * or in a pattern. To specify a rounding increment in a pattern, include the - * increment in the pattern itself. "#,#50" specifies a rounding increment of - * 50. "#,##0.05" specifies a rounding increment of 0.05. - * - *

    - *
  • Rounding only affects the string produced by formatting. It does - * not affect parsing or change any numerical values. - * - *
  • A rounding mode determines how values are rounded; see the - * java.math.BigDecimal documentation for a description of the - * modes. Rounding increments specified in patterns use the default mode, - * ROUND_HALF_EVEN. - * - *
  • Some locales use rounding in their currency formats to reflect the - * smallest currency denomination. - * - *
  • In a pattern, digits '1' through '9' specify rounding, but otherwise - * behave identically to digit '0'. - *
- * - *

Pattern Syntax - *

- * pattern    := subpattern{';' subpattern}
- * subpattern := {prefix}number{suffix}
- * number     := integer{'.' fraction}{exponent}
- * prefix     := '\u0000'..'\uFFFD' - specialCharacters
- * suffix     := '\u0000'..'\uFFFD' - specialCharacters
- * integer    := '#'* '0'* '0'
- * fraction   := '0'* '#'*
- * exponent   := 'E' {'+'} '0'* '0'
- * padSpec    := '*' padChar
- * padChar    := '\u0000'..'\uFFFD' - quote
- *  
- * Notation:
- *   X*       0 or more instances of X
- *   { X }    0 or 1 instances of X
- *   X..Y     any character from X up to Y, inclusive
- *   S - T    characters in S, except those in T
- * 
- * The first subpattern is for positive numbers. The second (optional) - * subpattern is for negative numbers. - * - *

Not indicated in the BNF syntax above: - *

  • The grouping separator ',' can occur inside the integer portion between the - * most significant digit and the least significant digit. - * - *
  • NEW - * Two grouping intervals are recognized: That between the - * decimal point and the first grouping symbol, and that - * between the first and second grouping symbols. These - * intervals are identical in most locales, but in some - * locales they differ. For example, the pattern - * "#,##,###" formats the number 123456789 as - * "12,34,56,789".
  • - * - *
  • - * NEW - * The pad specifier padSpec may appear before the prefix, - * after the prefix, before the suffix, after the suffix, or not at all. - * - *
  • - * NEW - * In place of '0', the digits '1' through '9' may be used to - * indicate a rounding increment. - *
- * - *

Special Pattern Characters - * - *

Here are the special characters used in the pattern, with notes on their - * usage. Special characters must be quoted, unless noted otherwise, if they - * are to appear in the prefix or suffix. This does not apply to those listed - * with location "prefix or suffix." Such characters should only be quoted in - * order to remove their special meaning. - * - *

- * - * - * - * - * - * - * - * - * - * - * - * - * - *
SymbolLocationMeaning
0-9NumberDigit. - * NEW - * '1' through '9' indicate rounding
#NumberDigit, zero shows as absent
.NumberDecimal separator or monetary decimal separator
,NumberGrouping separator
ENumber - * Separates mantissa and exponent in scientific notation. - * Need not be quoted in prefix or suffix.
NEW - * +Exponent - * Prefix positive exponents with localized plus sign. - * Need not be quoted in prefix or suffix.
;Subpattern boundary - * Separates positive and negative subpatterns
%Prefix or suffixMultiply by 100 and show as percentage
\u2030Prefix or suffix - * Multiply by 1000 and show as per mille
\u00A4Prefix or suffix - * Currency sign, replaced by currency symbol. If - * doubled, replaced by international currency symbol. - * If present in a pattern, the monetary decimal separator - * is used instead of the decimal separator.
'Prefix or suffix - * Used to quote special characters in a prefix or suffix, - * for example, "'#'#" formats 123 to - * "#123". To create a single quote - * itself, use two in a row: "# o''clock".
NEW - * *Prefix or suffix boundary - * Pad escape, precedes pad character
- *

- * - * - * @see java.text.Format - * @see NumberFormat - * @version 1.48 09/21/98 - * @author Mark Davis - * @author Alan Liu - * */ -public class DecimalFormat extends NumberFormat { - - /** - * Create a DecimalFormat using the default pattern and symbols - * for the default locale. This is a convenient way to obtain a - * DecimalFormat when internationalization is not the main concern. - *

- * To obtain standard formats for a given locale, use the factory methods - * on NumberFormat such as getNumberInstance. These factories will - * return the most appropriate sub-class of NumberFormat for a given - * locale. - * @see NumberFormat#getInstance - * @see NumberFormat#getNumberInstance - * @see NumberFormat#getCurrencyInstance - * @see NumberFormat#getPercentInstance - */ - public DecimalFormat() { - // [NEW] - Locale def = Locale.getDefault(); - String pattern = getPattern(def, 0); - // Always applyPattern after the symbols are set - this.symbols = new DecimalFormatSymbols(def); - applyPattern(pattern, false); - } - - - /** - * Create a DecimalFormat from the given pattern and the symbols - * for the default locale. This is a convenient way to obtain a - * DecimalFormat when internationalization is not the main concern. - *

- * To obtain standard formats for a given locale, use the factory methods - * on NumberFormat such as getNumberInstance. These factories will - * return the most appropriate sub-class of NumberFormat for a given - * locale. - * @param pattern A non-localized pattern string. - * @exception IllegalArgumentException if the given pattern is invalid. - * @see NumberFormat#getInstance - * @see NumberFormat#getNumberInstance - * @see NumberFormat#getCurrencyInstance - * @see NumberFormat#getPercentInstance - */ - public DecimalFormat(String pattern) { - // Always applyPattern after the symbols are set - this.symbols = new DecimalFormatSymbols( Locale.getDefault() ); - applyPattern( pattern, false ); - } - - - /** - * Create a DecimalFormat from the given pattern and symbols. - * Use this constructor when you need to completely customize the - * behavior of the format. - *

- * To obtain standard formats for a given - * locale, use the factory methods on NumberFormat such as - * getInstance or getCurrencyInstance. If you need only minor adjustments - * to a standard format, you can modify the format returned by - * a NumberFormat factory method. - * @param pattern a non-localized pattern string - * @param symbols the set of symbols to be used - * @exception IllegalArgumentException if the given pattern is invalid - * @see NumberFormat#getInstance - * @see NumberFormat#getNumberInstance - * @see NumberFormat#getCurrencyInstance - * @see NumberFormat#getPercentInstance - * @see DecimalFormatSymbols - */ - public DecimalFormat (String pattern, DecimalFormatSymbols symbols) { - // Always applyPattern after the symbols are set - this.symbols = (DecimalFormatSymbols)symbols.clone(); - applyPattern( pattern, false ); - } - - - // Overrides - public StringBuffer format(double number, StringBuffer result, - FieldPosition fieldPosition) - { - //FP:fieldPosition.setBeginIndex(0); - //FP:fieldPosition.setEndIndex(0); - - if (Double.isNaN(number)) - { - //FP:if (fieldPosition.getField() == NumberFormat.INTEGER_FIELD) - //FP:fieldPosition.setBeginIndex(result.length()); - - result.append(symbols.getNaN()); - - //FP:if (fieldPosition.getField() == NumberFormat.INTEGER_FIELD) - //FP:fieldPosition.setEndIndex(result.length()); - - addPadding(result, false, false /*ignored*/); - return result; - } - - /* Detecting whether a double is negative is easy with the exception of - * the value -0.0. This is a double which has a zero mantissa (and - * exponent), but a negative sign bit. It is semantically distinct from - * a zero with a positive sign bit, and this distinction is important - * to certain kinds of computations. However, it's a little tricky to - * detect, since (-0.0 == 0.0) and !(-0.0 < 0.0). How then, you may - * ask, does it behave distinctly from +0.0? Well, 1/(-0.0) == - * -Infinity. Proper detection of -0.0 is needed to deal with the - * issues raised by bugs 4106658, 4106667, and 4147706. Liu 7/6/98. - */ - boolean isNegative = (number < 0.0) || (number == 0.0 && 1/number < 0.0); - if (isNegative) number = -number; - - // Do this BEFORE checking to see if value is infinite! - if (multiplier != 1) number *= multiplier; - - // Apply rounding after multiplier - if (roundingDouble > 0.0) { - number = roundingDouble - * round(number / roundingDouble, roundingMode, isNegative); - } - - if (Double.isInfinite(number)) - { - result.append(isNegative ? negativePrefix : positivePrefix); - - //FP:if (fieldPosition.getField() == NumberFormat.INTEGER_FIELD) - //FP:fieldPosition.setBeginIndex(result.length()); - - result.append(symbols.getInfinity()); - - //FP:if (fieldPosition.getField() == NumberFormat.INTEGER_FIELD) - //FP:eydfieldPosition.setEndIndex(result.length()); - - result.append(isNegative ? negativeSuffix : positiveSuffix); - - addPadding(result, true, isNegative); - return result; - } - - // At this point we are guaranteed a nonnegative finite - // number. - synchronized(digitList) { - digitList.set(number, useExponentialNotation ? - getMinimumIntegerDigits() + getMaximumFractionDigits() : - getMaximumFractionDigits(), - !useExponentialNotation); - - return subformat(result, fieldPosition, isNegative, false); - } - } - - /** - * NEW - * Round a double value to the nearest integer according to the - * given mode. - * @param a the absolute value of the number to be rounded - * @param mode a BigDecimal rounding mode - * @param isNegative true if the number to be rounded is negative - * @return the absolute value of the rounded result - */ - private static double round(double a, int mode, boolean isNegative) { - switch (mode) { - case java.math.BigDecimal.ROUND_CEILING: - return isNegative ? Math.floor(a) : Math.ceil(a); - case java.math.BigDecimal.ROUND_FLOOR: - return isNegative ? Math.ceil(a) : Math.floor(a); - case java.math.BigDecimal.ROUND_DOWN: - return Math.floor(a); - case java.math.BigDecimal.ROUND_UP: - return Math.ceil(a); - case java.math.BigDecimal.ROUND_HALF_EVEN: - // We should be able to just return Math.rint(a), but this - // doesn't work in some VMs. - { - double f = Math.floor(a); - if ((a - f) != 0.5) { - return Math.rint(a); - } - f /= 2.0; - return f == Math.floor(f) ? Math.floor(a) : (Math.floor(a) + 1.0); - } - case java.math.BigDecimal.ROUND_HALF_DOWN: - return ((a - Math.floor(a)) <= 0.5) ? Math.floor(a) : Math.ceil(a); - case java.math.BigDecimal.ROUND_HALF_UP: - return ((a - Math.floor(a)) < 0.5) ? Math.floor(a) : Math.ceil(a); - case java.math.BigDecimal.ROUND_UNNECESSARY: - if (a != Math.floor(a)) { - throw new ArithmeticException("Rounding necessary"); - } - return a; - default: - throw new IllegalArgumentException("Invalid rounding mode: " + mode); - } - } - - public StringBuffer format(long number, StringBuffer result, - FieldPosition fieldPosition) - { - //FP:fieldPosition.setBeginIndex(0); - //FP:fieldPosition.setEndIndex(0); - - // If we are to do rounding, we need to move into the BigDecimal - // domain in order to do divide/multiply correctly. - // [NEW] - if (roundingIncrement != null) { - return format(java.math.BigDecimal.valueOf(number), result, fieldPosition); - } - - boolean isNegative = (number < 0); - if (isNegative) number = -number; - - // In general, long values always represent real finite numbers, so - // we don't have to check for +/- Infinity or NaN. However, there - // is one case we have to be careful of: The multiplier can push - // a number near MIN_VALUE or MAX_VALUE outside the legal range. We - // check for this before multiplying, and if it happens we use BigInteger - // instead. - // [NEW] - if (multiplier != 1) { - boolean tooBig = false; - if (number < 0) { // This can only happen if number == Long.MIN_VALUE - long cutoff = Long.MIN_VALUE / multiplier; - tooBig = (number < cutoff); - } else { - long cutoff = Long.MAX_VALUE / multiplier; - tooBig = (number > cutoff); - } - if (tooBig) { - return format(BigInteger.valueOf(isNegative ? -number : number), - result, fieldPosition); - } - } - - number *= multiplier; - synchronized(digitList) { - digitList.set(number, useExponentialNotation ? - getMinimumIntegerDigits() + getMaximumFractionDigits() : 0); - - return subformat(result, fieldPosition, isNegative, true); - } - } - - /** - * NEW - * Format a BigInteger number. - */ - public StringBuffer format(BigInteger number, StringBuffer result, - FieldPosition fieldPosition) { - // If we are to do rounding, we need to move into the BigDecimal - // domain in order to do divide/multiply correctly. - if (roundingIncrement != null) { - return format(new java.math.BigDecimal(number), result, fieldPosition); - } - - if (multiplier != 1) { - number = number.multiply(BigInteger.valueOf(multiplier)); - } - - // At this point we are guaranteed a nonnegative finite - // number. - synchronized(digitList) { - digitList.set(number, useExponentialNotation ? - getMinimumIntegerDigits() + getMaximumFractionDigits() : 0); - - return subformat(result, fieldPosition, number.signum() < 0, false); - } - } - - /** - * NEW - * Format a BigDecimal number. - */ - public StringBuffer format(java.math.BigDecimal number, StringBuffer result, - FieldPosition fieldPosition) { - if (multiplier != 1) { - number = number.multiply(java.math.BigDecimal.valueOf(multiplier)); - } - - if (roundingIncrement != null) { - number = number.divide(roundingIncrement, 0, roundingMode) - .multiply(roundingIncrement); - } - - // At this point we are guaranteed a nonnegative finite - // number. - synchronized(digitList) { - digitList.set(number, useExponentialNotation ? - getMinimumIntegerDigits() + getMaximumFractionDigits() : - getMaximumFractionDigits(), - !useExponentialNotation); - return subformat(result, fieldPosition, number.signum() < 0, false); - } - } - - //This has been removed pending addition of com.ibm.math package to ICU4J - /* - * NEW - * Format a BigDecimal number. - */ - public StringBuffer format(com.ibm.math.BigDecimal number, StringBuffer result, - FieldPosition fieldPosition) { - /* This method is just a copy of the corresponding java.math.BigDecimal - * method for now. It isn't very efficient since it must create a - * conversion object to do math on the rounding increment. In the - * future we may try to clean this up, or even better, limit our support - * to just one flavor of BigDecimal. - */ - if (multiplier != 1) { - number = number.multiply(com.ibm.math.BigDecimal.valueOf(multiplier)); - } - - if (roundingIncrement != null) { - com.ibm.math.BigDecimal ri = new com.ibm.math.BigDecimal(roundingIncrement); - number = number.divide(ri, 0, roundingMode) - .multiply(ri); - } - - // At this point we are guaranteed a nonnegative finite - // number. - synchronized(digitList) { - digitList.set(number, useExponentialNotation ? - getMinimumIntegerDigits() + getMaximumFractionDigits() : - getMaximumFractionDigits(), - !useExponentialNotation); - return subformat(result, fieldPosition, number.signum() < 0, false); - } - } - - /** - * Return true if a grouping separator belongs at the given - * position, based on whether grouping is in use and the values of - * the primary and secondary grouping interval. - * @param pos the number of integer digits to the right of - * the current position. Zero indicates the position after the - * rightmost integer digit. - * @return true if a grouping character belongs at the current - * position. - */ - private boolean isGroupingPosition(int pos) { - boolean result = false; - if (isGroupingUsed() && (pos > 0) && (groupingSize > 0)) { - if ((groupingSize2 > 0) && (pos > groupingSize)) { - result = ((pos - groupingSize) % groupingSize2) == 0; - } else { - result = pos % groupingSize == 0; - } - } - return result; - } - - /** - * Complete the formatting of a finite number. On entry, the digitList must - * be filled in with the correct digits. - */ - private StringBuffer subformat(StringBuffer result, FieldPosition fieldPosition, - boolean isNegative, boolean isInteger) - { - // NOTE: This isn't required anymore because DigitList takes care of this. - // - // // The negative of the exponent represents the number of leading - // // zeros between the decimal and the first non-zero digit, for - // // a value < 0.1 (e.g., for 0.00123, -fExponent == 2). If this - // // is more than the maximum fraction digits, then we have an underflow - // // for the printed representation. We recognize this here and set - // // the DigitList representation to zero in this situation. - // - // if (-digitList.decimalAt >= getMaximumFractionDigits()) - // { - // digitList.count = 0; - // } - - int i; - char zero = symbols.getZeroDigit(); - int zeroDelta = zero - '0'; // '0' is the DigitList representation of zero - char grouping = symbols.getGroupingSeparator(); - char decimal = isCurrencyFormat ? - symbols.getMonetaryDecimalSeparator() : - symbols.getDecimalSeparator(); - int maxIntDig = getMaximumIntegerDigits(); - int minIntDig = getMinimumIntegerDigits(); - - /* Per bug 4147706, DecimalFormat must respect the sign of numbers which - * format as zero. This allows sensible computations and preserves - * relations such as signum(1/x) = signum(x), where x is +Infinity or - * -Infinity. Prior to this fix, we always formatted zero values as if - * they were positive. Liu 7/6/98. - */ - if (digitList.isZero()) - { - digitList.decimalAt = 0; // Normalize - } - - result.append(isNegative ? negativePrefix : positivePrefix); - - if (useExponentialNotation) - { - // Record field information for caller. - //FP:if (fieldPosition.getField() == NumberFormat.INTEGER_FIELD) - //FP:{ - //FP:fieldPosition.setBeginIndex(result.length()); - //FP:fieldPosition.setEndIndex(-1); - //FP:} - //FP:else if (fieldPosition.getField() == NumberFormat.FRACTION_FIELD) - //FP:{ - //FP:fieldPosition.setBeginIndex(-1); - //FP:} - - // Minimum integer digits are handled in exponential format by - // adjusting the exponent. For example, 0.01234 with 3 minimum - // integer digits is "123.4E-4". - - // Maximum integer digits are interpreted as indicating the - // repeating range. This is useful for engineering notation, in - // which the exponent is restricted to a multiple of 3. For - // example, 0.01234 with 3 maximum integer digits is "12.34e-3". - // If maximum integer digits are defined and are larger than - // minimum integer digits, then minimum integer digits are - // ignored. - - int exponent = digitList.decimalAt; - if (maxIntDig > 1 && maxIntDig != minIntDig) { - // A exponent increment is defined; adjust to it. - exponent = (exponent > 0) ? (exponent - 1) / maxIntDig - : (exponent / maxIntDig) - 1; - exponent *= maxIntDig; - } else { - // No exponent increment is defined; use minimum integer digits. - // If none is specified, as in "#E0", generate 1 integer digit. - exponent -= (minIntDig > 0 || getMinimumFractionDigits() > 0) - ? minIntDig : 1; - } - - // We now output a minimum number of digits, and more if there - // are more digits, up to the maximum number of digits. We - // place the decimal point after the "integer" digits, which - // are the first (decimalAt - exponent) digits. - int minimumDigits = minIntDig - + getMinimumFractionDigits(); - // The number of integer digits is handled specially if the number - // is zero, since then there may be no digits. - int integerDigits = digitList.isZero() ? minIntDig : - digitList.decimalAt - exponent; - int totalDigits = digitList.count; - if (minimumDigits > totalDigits) totalDigits = minimumDigits; - if (integerDigits > totalDigits) totalDigits = integerDigits; - - for (i=0; i 0 && count < digitList.decimalAt) - count = digitList.decimalAt; - - // Handle the case where getMaximumIntegerDigits() is smaller - // than the real number of integer digits. If this is so, we - // output the least significant max integer digits. For example, - // the value 1997 printed with 2 max integer digits is just "97". - - if (count > maxIntDig) - { - count = maxIntDig; - digitIndex = digitList.decimalAt - count; - } - - int sizeBeforeIntegerPart = result.length(); - for (i=count-1; i>=0; --i) - { - if (i < digitList.decimalAt && digitIndex < digitList.count) - { - // Output a real digit - result.append((char)(digitList.digits[digitIndex++] + zeroDelta)); - } - else - { - // Output a leading zero - result.append(zero); - } - - // Output grouping separator if necessary. - if (isGroupingPosition(i)) { - result.append(grouping); - } - } - - // Record field information for caller. - //FP:if (fieldPosition.getField() == NumberFormat.INTEGER_FIELD) - //FP:fieldPosition.setEndIndex(result.length()); - - // Determine whether or not there are any printable fractional - // digits. If we've used up the digits we know there aren't. - boolean fractionPresent = (getMinimumFractionDigits() > 0) || - (!isInteger && digitIndex < digitList.count); - - // If there is no fraction present, and we haven't printed any - // integer digits, then print a zero. Otherwise we won't print - // _any_ digits, and we won't be able to parse this string. - if (!fractionPresent && result.length() == sizeBeforeIntegerPart) - result.append(zero); - - // Output the decimal separator if we always do so. - if (decimalSeparatorAlwaysShown || fractionPresent) - result.append(decimal); - - // Record field information for caller. - //FP:if (fieldPosition.getField() == NumberFormat.FRACTION_FIELD) - //FP:fieldPosition.setBeginIndex(result.length()); - - for (i=0; i < getMaximumFractionDigits(); ++i) - { - // Here is where we escape from the loop. We escape if we've output - // the maximum fraction digits (specified in the for expression above). - // We also stop when we've output the minimum digits and either: - // we have an integer, so there is no fractional stuff to display, - // or we're out of significant digits. - if (i >= getMinimumFractionDigits() && - (isInteger || digitIndex >= digitList.count)) - break; - - // Output leading fractional zeros. These are zeros that come after - // the decimal but before any significant digits. These are only - // output if abs(number being formatted) < 1.0. - if (-1-i > (digitList.decimalAt-1)) - { - result.append(zero); - continue; - } - - // Output a digit, if we have any precision left, or a - // zero if we don't. We don't want to output noise digits. - if (!isInteger && digitIndex < digitList.count) - { - result.append((char)(digitList.digits[digitIndex++] + zeroDelta)); - } - else - { - result.append(zero); - } - } - - // Record field information for caller. - //FP:if (fieldPosition.getField() == NumberFormat.FRACTION_FIELD) - //FP:fieldPosition.setEndIndex(result.length()); - } - - result.append(isNegative ? negativeSuffix : positiveSuffix); - - // [NEW] - addPadding(result, true, isNegative); - return result; - } - - // [NEW] - private final void addPadding(StringBuffer result, boolean hasAffixes, - boolean isNegative) { - if (formatWidth > 0) { - int len = formatWidth - result.length(); - if (len > 0) { - char[] padding = new char[len]; - for (int i=0; iCHANGED - * Parse the given string, returning a Number object to - * represent the parsed value. Double objects are returned to - * represent non-integral values which cannot be stored in a - * BigDecimal. These are NaN, infinity, - * -infinity, and -0.0. All other values are returned as Long, - * BigInteger, or BigDecimal values, in that order - * of preference. If the parse fails, null is returned. - * @param text the string to be parsed - * @param parsePosition defines the position where parsing is to begin, - * and upon return, the position where parsing left off. If the position - * has not changed upon return, then parsing failed. - * @return a Number object with the parsed value or - * null if the parse failed - */ - public Number parse(String text, ParsePosition parsePosition) - { - // Skip padding characters, if any - int backup; - int i = backup = parsePosition.getIndex(); - if (formatWidth > 0) { - while (i < text.length() && text.charAt(i) == pad) { - ++i; - } - parsePosition.setIndex(i); - } - - // Handle NaN as a special case - if (text.regionMatches(parsePosition.getIndex(), symbols.getNaN(), - 0, symbols.getNaN().length())) { - parsePosition.setIndex(parsePosition.getIndex() - + symbols.getNaN().length()); - return new Double(Double.NaN); - } - - boolean[] status = new boolean[STATUS_LENGTH]; - if (!subparse(text, parsePosition, digitList, false, status)) { - parsePosition.setIndex(backup); - return null; - } else if (formatWidth < 0) { - i = parsePosition.getIndex(); - while (i < text.length() && text.charAt(i) == pad) { - ++i; - } - parsePosition.setIndex(i); - } - - // Handle infinity - if (status[STATUS_INFINITE]) { - return new Double(status[STATUS_POSITIVE] - ? Double.POSITIVE_INFINITY - : Double.NEGATIVE_INFINITY); - } - - // Handle -0.0 - if (!status[STATUS_POSITIVE] && digitList.isZero()) { - return new Double(-0.0); - } - - // Do as much of the multiplier conversion as possible without - // losing accuracy. - int mult = multiplier; // Don't modify this.multiplier - while (mult % 10 == 0) { - --digitList.decimalAt; - mult /= 10; - } - - // Handle integral values - if (mult == 1 && digitList.isIntegral()) { - BigInteger n = digitList.getBigInteger(status[STATUS_POSITIVE]); - return (n.bitLength() < 64) - ? (Number) new Long(n.longValue()) - : (Number) n; - } - - // Handle non-integral values - java.math.BigDecimal n = digitList.getBigDecimal(status[STATUS_POSITIVE]); - if (mult != 1) { - n = n.divide(java.math.BigDecimal.valueOf(mult), - java.math.BigDecimal.ROUND_HALF_EVEN); - } - return n; - } - - private static final int STATUS_INFINITE = 0; - private static final int STATUS_POSITIVE = 1; - private static final int STATUS_LENGTH = 2; - - /** - * CHANGED - * Parse the given text into a number. The text is parsed beginning at - * parsePosition, until an unparseable character is seen. - * @param text The string to parse. - * @param parsePosition The position at which to being parsing. Upon - * return, the first unparseable character. - * @param digits The DigitList to set to the parsed value. - * @param isExponent If true, parse an exponent. This means no - * infinite values and integer only. - * @param status Upon return contains boolean status flags indicating - * whether the value was infinite and whether it was positive. - */ - private final boolean subparse(String text, ParsePosition parsePosition, - DigitList digits, boolean isExponent, - boolean status[]) - { - int position = parsePosition.getIndex(); - int oldStart = parsePosition.getIndex(); - int backup; - - // check for positivePrefix; take longest - boolean gotPositive = text.regionMatches(position,positivePrefix,0, - positivePrefix.length()); - boolean gotNegative = text.regionMatches(position,negativePrefix,0, - negativePrefix.length()); - if (gotPositive && gotNegative) { - if (positivePrefix.length() > negativePrefix.length()) - gotNegative = false; - else if (positivePrefix.length() < negativePrefix.length()) - gotPositive = false; - } - if (gotPositive) { - position += positivePrefix.length(); - } else if (gotNegative) { - position += negativePrefix.length(); - } else { - //PP:parsePosition.errorIndex = position; - return false; - } - // process digits or Inf, find decimal position - status[STATUS_INFINITE] = false; - if (!isExponent && text.regionMatches(position,symbols.getInfinity(),0, - symbols.getInfinity().length())) - { - position += symbols.getInfinity().length(); - status[STATUS_INFINITE] = true; - } else { - // We now have a string of digits, possibly with grouping symbols, - // and decimal points. We want to process these into a DigitList. - // We don't want to put a bunch of leading zeros into the DigitList - // though, so we keep track of the location of the decimal point, - // put only significant digits into the DigitList, and adjust the - // exponent as needed. - - digits.decimalAt = digits.count = 0; - char zero = symbols.getZeroDigit(); - char decimal = isCurrencyFormat ? - symbols.getMonetaryDecimalSeparator() : symbols.getDecimalSeparator(); - char grouping = symbols.getGroupingSeparator(); - String exponentSep = symbols.getExponentSeparator(); - boolean sawDecimal = false; - boolean sawExponent = false; - boolean sawDigit = false; - int exponent = 0; // Set to the exponent value, if any - int digit = 0; - - // We have to track digitCount ourselves, because digits.count will - // pin when the maximum allowable digits is reached. - int digitCount = 0; - - backup = -1; - for (; position < text.length(); ++position) - { - char ch = text.charAt(position); - - /* We recognize all digit ranges, not only the Latin digit range - * '0'..'9'. We do so by using the Character.digit() method, - * which converts a valid Unicode digit to the range 0..9. - * - * The character 'ch' may be a digit. If so, place its value - * from 0 to 9 in 'digit'. First try using the locale digit, - * which may or MAY NOT be a standard Unicode digit range. If - * this fails, try using the standard Unicode digit ranges by - * calling Character.digit(). If this also fails, digit will - * have a value outside the range 0..9. - */ - digit = ch - zero; - if (digit < 0 || digit > 9) digit = Character.digit(ch, 10); - - if (digit == 0) - { - // Cancel out backup setting (see grouping handler below) - backup = -1; // Do this BEFORE continue statement below!!! - sawDigit = true; - - // Handle leading zeros - if (digits.count == 0) - { - // Ignore leading zeros in integer part of number. - if (!sawDecimal) continue; - - // If we have seen the decimal, but no significant digits yet, - // then we account for leading zeros by decrementing the - // digits.decimalAt into negative values. - --digits.decimalAt; - } - else - { - ++digitCount; - digits.append((char)(digit + '0')); - } - } - else if (digit > 0 && digit <= 9) // [sic] digit==0 handled above - { - sawDigit = true; - ++digitCount; - digits.append((char)(digit + '0')); - - // Cancel out backup setting (see grouping handler below) - backup = -1; - } - else if (!isExponent && ch == decimal) - { - // If we're only parsing integers, or if we ALREADY saw the - // decimal, then don't parse this one. - if (isParseIntegerOnly() || sawDecimal) break; - digits.decimalAt = digitCount; // Not digits.count! - sawDecimal = true; - } - else if (!isExponent && ch == grouping && isGroupingUsed()) - { - if (sawDecimal) { - break; - } - // Ignore grouping characters, if we are using them, but require - // that they be followed by a digit. Otherwise we backup and - // reprocess them. - backup = position; - } - else if (!isExponent && !sawExponent && - text.regionMatches(position, exponentSep, - 0, exponentSep.length())) - { - // Parse sign, if present - boolean negExp = false; - int pos = position + exponentSep.length(); - if (pos < text.length()) { - ch = text.charAt(pos); - if (ch == symbols.getPlusSign()) { - ++pos; - } else if (ch == symbols.getMinusSign()) { - ++pos; - negExp = true; - } - } - - DigitList exponentDigits = new DigitList(); - exponentDigits.count = 0; - while (pos < text.length()) { - digit = text.charAt(pos) - zero; - if (digit < 0 || digit > 9) { - /* - Can't parse "[1E0]" when pattern is "0.###E0;[0.###E0]" - Should update reassign the value of 'ch' in the - code: digit = Character.digit(ch, 10); - [Richard/GCL] - */ - digit = Character.digit(text.charAt(pos), 10); - } - if (digit >= 0 && digit <= 9) { - exponentDigits.append((char)(digit + '0')); - ++pos; - } else { - break; - } - } - - if (exponentDigits.count > 0) { - exponentDigits.decimalAt = exponentDigits.count; - exponent = (int) exponentDigits.getLong(); - if (negExp) { - exponent = -exponent; - } - position = pos; // Advance past the exponent - sawExponent = true; - } - - break; // Whether we fail or succeed, we exit this loop - } - else break; - } - - if (backup != -1) position = backup; - - // If there was no decimal point we have an integer - if (!sawDecimal) digits.decimalAt = digitCount; // Not digits.count! - - // Adjust for exponent, if any - digits.decimalAt += exponent; - - // If none of the text string was recognized. For example, parse - // "x" with pattern "#0.00" (return index and error index both 0) - // parse "$" with pattern "$#0.00". (return index 0 and error index - // 1). - if (!sawDigit && digitCount == 0) { - parsePosition.setIndex(oldStart); - //PP:parsePosition.errorIndex = oldStart; - return false; - } - } - - // check for positiveSuffix - if (gotPositive) - gotPositive = text.regionMatches(position,positiveSuffix,0, - positiveSuffix.length()); - if (gotNegative) - gotNegative = text.regionMatches(position,negativeSuffix,0, - negativeSuffix.length()); - - // if both match, take longest - if (gotPositive && gotNegative) { - if (positiveSuffix.length() > negativeSuffix.length()) - gotNegative = false; - else if (positiveSuffix.length() < negativeSuffix.length()) - gotPositive = false; - } - - // fail if neither or both - if (gotPositive == gotNegative) { - //PP:parsePosition.errorIndex = position; - return false; - } - - parsePosition.setIndex(position + - (gotPositive ? positiveSuffix.length() : negativeSuffix.length())); // mark success! - - status[STATUS_POSITIVE] = gotPositive; - if (parsePosition.getIndex() == oldStart) { - //PP:parsePosition.errorIndex = position; - return false; - } - return true; - } - - /** - * Returns the decimal format symbols, which is generally not changed - * by the programmer or user. - * @return desired DecimalFormatSymbols - * @see DecimalFormatSymbols - */ - public DecimalFormatSymbols getDecimalFormatSymbols() { - try { - // don't allow multiple references - return (DecimalFormatSymbols) symbols.clone(); - } catch (Exception foo) { - return null; // should never happen - } - } - - - /** - * Sets the decimal format symbols, which is generally not changed - * by the programmer or user. - * @param newSymbols desired DecimalFormatSymbols - * @see DecimalFormatSymbols - */ - public void setDecimalFormatSymbols(DecimalFormatSymbols newSymbols) { - try { - // don't allow multiple references - symbols = (DecimalFormatSymbols) newSymbols.clone(); - /*Bug 4212072 - Update the affix strings accroding to symbols in order to keep - the affix strings up to date. - [Richard/GCL] - */ - expandAffixes(); - } catch (Exception foo) { - // should never happen - } - } - - /** - * Get the positive prefix. - *

Examples: +123, $123, sFr123 - */ - public String getPositivePrefix () { - return positivePrefix; - } - - /** - * Set the positive prefix. - *

Examples: +123, $123, sFr123 - */ - public void setPositivePrefix (String newValue) { - positivePrefix = newValue; - } - - /** - * Get the negative prefix. - *

Examples: -123, ($123) (with negative suffix), sFr-123 - */ - public String getNegativePrefix () { - return negativePrefix; - } - - /** - * Set the negative prefix. - *

Examples: -123, ($123) (with negative suffix), sFr-123 - */ - public void setNegativePrefix (String newValue) { - negativePrefix = newValue; - } - - /** - * Get the positive suffix. - *

Example: 123% - */ - public String getPositiveSuffix () { - return positiveSuffix; - } - - /** - * Set the positive suffix. - *

Example: 123% - */ - public void setPositiveSuffix (String newValue) { - positiveSuffix = newValue; - } - - /** - * Get the negative suffix. - *

Examples: -123%, ($123) (with positive suffixes) - */ - public String getNegativeSuffix () { - return negativeSuffix; - } - - /** - * Set the positive suffix. - *

Examples: 123% - */ - public void setNegativeSuffix (String newValue) { - negativeSuffix = newValue; - } - - /** - * Get the multiplier for use in percent, permill, etc. - * For a percentage, set the suffixes to have "%" and the multiplier to be 100. - * (For Arabic, use arabic percent symbol). - * For a permill, set the suffixes to have "\u2031" and the multiplier to be 1000. - *

Examples: with 100, 1.23 -> "123", and "123" -> 1.23 - */ - public int getMultiplier () { - return multiplier; - } - - /** - * Set the multiplier for use in percent, permill, etc. - * For a percentage, set the suffixes to have "%" and the multiplier to be 100. - * (For Arabic, use arabic percent symbol). - * For a permill, set the suffixes to have "\u2031" and the multiplier to be 1000. - *

Examples: with 100, 1.23 -> "123", and "123" -> 1.23 - */ - public void setMultiplier (int newValue) { - if (newValue <= 0) { - throw new IllegalArgumentException("Bad multiplier: " + newValue); - } - multiplier = newValue; - } - - /** - * NEW - * Get the rounding increment. - * @return A positive rounding increment, or null if rounding - * is not in effect. - * @see #setRoundingIncrement - * @see #getRoundingMode - * @see #setRoundingMode - */ - public java.math.BigDecimal getRoundingIncrement() { - return roundingIncrement; - } - - /** - * NEW - * Set the rounding increment. This method also controls whether - * rounding is enabled. - * @param newValue A positive rounding increment, or null or - * BigDecimal(0.0) to disable rounding. - * @exception IllegalArgumentException if newValue is < 0.0 - * @see #getRoundingIncrement - * @see #getRoundingMode - * @see #setRoundingMode - */ - public void setRoundingIncrement(java.math.BigDecimal newValue) { - int i = newValue == null - ? 0 : newValue.compareTo(java.math.BigDecimal.valueOf(0)); - if (i < 0) { - throw new IllegalArgumentException("Illegal rounding increment"); - } - if (i == 0) { - roundingIncrement = null; - roundingDouble = 0.0; - } else { - roundingIncrement = newValue; - roundingDouble = newValue.doubleValue(); - } - } - - /** - * NEW - * Set the rounding increment. This method also controls whether - * rounding is enabled. - * @param newValue A positive rounding increment, or 0.0 to disable - * rounding. - * @exception IllegalArgumentException if newValue is < 0.0 - * @see #getRoundingIncrement - * @see #getRoundingMode - * @see #setRoundingMode - */ - public void setRoundingIncrement(double newValue) { - if (newValue < 0.0) { - throw new IllegalArgumentException("Illegal rounding increment"); - } - roundingDouble = newValue; - roundingIncrement = (newValue > 0.0) - ? new java.math.BigDecimal(String.valueOf(newValue)) : null; - } - - /** - * NEW - * Get the rounding mode. - * @return A rounding mode, between BigDecimal.ROUND_UP - * and BigDecimal.ROUND_UNNECESSARY. - * @see #setRoundingIncrement - * @see #getRoundingIncrement - * @see #setRoundingMode - * @see java.math.BigDecimal - */ - public int getRoundingMode() { - return roundingMode; - } - - /** - * NEW - * Set the rounding mode. This has no effect unless the rounding - * increment is greater than zero. - * @param roundingMode A rounding mode, between - * BigDecimal.ROUND_UP and - * BigDecimal.ROUND_UNNECESSARY. - * @exception IllegalArgumentException if roundingMode - * is unrecognized. - * @see #setRoundingIncrement - * @see #getRoundingIncrement - * @see #getRoundingMode - * @see java.math.BigDecimal - */ - public void setRoundingMode(int roundingMode) { - if (roundingMode < java.math.BigDecimal.ROUND_UP - || roundingMode > java.math.BigDecimal.ROUND_UNNECESSARY) { - throw new IllegalArgumentException("Invalid rounding mode: " - + roundingMode); - } - this.roundingMode = roundingMode; - } - - /** - * NEW - * Get the width to which the output of format() is padded. - * @return the format width, or zero if no padding is in effect - * @see #setFormatWidth - * @see #getPadCharacter - * @see #setPadCharacter - * @see #getPadPosition - * @see #setPadPosition - */ - public int getFormatWidth() { - return formatWidth; - } - - /** - * NEW - * Set the width to which the output of format() is padded. - * This method also controls whether padding is enabled. - * @param width the width to which to pad the result of - * format(), or zero to disable padding - * @exception IllegalArgumentException if width is < 0 - * @see #getFormatWidth - * @see #getPadCharacter - * @see #setPadCharacter - * @see #getPadPosition - * @see #setPadPosition - */ - public void setFormatWidth(int width) { - if (width < 0) { - throw new IllegalArgumentException("Illegal format width"); - } - formatWidth = width; - } - - /** - * NEW - * Get the character used to pad to the format width. The default is ' '. - * @return the pad character - * @see #setFormatWidth - * @see #getFormatWidth - * @see #setPadCharacter - * @see #getPadPosition - * @see #setPadPosition - */ - public char getPadCharacter() { - return pad; - } - - /** - * NEW - * Set the character used to pad to the format width. This has no effect - * unless padding is enabled. - * @param padChar the pad character - * @see #setFormatWidth - * @see #getFormatWidth - * @see #getPadCharacter - * @see #getPadPosition - * @see #setPadPosition - */ - public void setPadCharacter(char padChar) { - pad = padChar; - } - - /** - * NEW - * Get the position at which padding will take place. This is the location - * at which padding will be inserted if the result of format() - * is shorter than the format width. - * @return the pad position, one of PAD_BEFORE_PREFIX, - * PAD_AFTER_PREFIX, PAD_BEFORE_SUFFIX, or - * PAD_AFTER_SUFFIX. - * @see #setFormatWidth - * @see #getFormatWidth - * @see #setPadCharacter - * @see #getPadCharacter - * @see #setPadPosition - * @see #PAD_BEFORE_PREFIX - * @see #PAD_AFTER_PREFIX - * @see #PAD_BEFORE_SUFFIX - * @see #PAD_AFTER_SUFFIX - */ - public int getPadPosition() { - return padPosition; - } - - /** - * NEW - * Set the position at which padding will take place. This is the location - * at which padding will be inserted if the result of format() - * is shorter than the format width. This has no effect unless padding is - * enabled. - * @param padPos the pad position, one of PAD_BEFORE_PREFIX, - * PAD_AFTER_PREFIX, PAD_BEFORE_SUFFIX, or - * PAD_AFTER_SUFFIX. - * @exception IllegalArgumentException if the pad position in - * unrecognized - * @see #setFormatWidth - * @see #getFormatWidth - * @see #setPadCharacter - * @see #getPadCharacter - * @see #getPadPosition - * @see #PAD_BEFORE_PREFIX - * @see #PAD_AFTER_PREFIX - * @see #PAD_BEFORE_SUFFIX - * @see #PAD_AFTER_SUFFIX - */ - public void setPadPosition(int padPos) { - if (padPos < PAD_BEFORE_PREFIX || padPos > PAD_AFTER_SUFFIX) { - throw new IllegalArgumentException("Illegal pad position"); - } - padPosition = padPos; - } - - /** - * NEW - * Return whether or not scientific notation is used. - * @return true if this object formats and parses scientific notation - * @see #setScientificNotation - * @see #getMinimumExponentDigits - * @see #setMinimumExponentDigits - * @see #isExponentSignAlwaysShown - * @see #setExponentSignAlwaysShown - */ - public boolean isScientificNotation() { - return useExponentialNotation; - } - - /** - * NEW - * Set whether or not scientific notation is used. - * @param useScientific true if this object formats and parses scientific - * notation - * @see #isScientificNotation - * @see #getMinimumExponentDigits - * @see #setMinimumExponentDigits - * @see #isExponentSignAlwaysShown - * @see #setExponentSignAlwaysShown - */ - public void setScientificNotation(boolean useScientific) { - useExponentialNotation = useScientific; - if (useExponentialNotation && minExponentDigits < 1) { - minExponentDigits = 1; - } - } - - /** - * NEW - * Return the minimum exponent digits that will be shown. - * @return the minimum exponent digits that will be shown - * @see #setScientificNotation - * @see #isScientificNotation - * @see #setMinimumExponentDigits - * @see #isExponentSignAlwaysShown - * @see #setExponentSignAlwaysShown - */ - public byte getMinimumExponentDigits() { - return minExponentDigits; - } - - /** - * NEW - * Set the minimum exponent digits that will be shown. This has no - * effect unless scientific notation is in use. - * @param minExpDig a value >= 1 indicating the fewest exponent digits - * that will be shown - * @exception IllegalArgumentException if minExpDig < 1 - * @see #setScientificNotation - * @see #isScientificNotation - * @see #getMinimumExponentDigits - * @see #isExponentSignAlwaysShown - * @see #setExponentSignAlwaysShown - */ - public void setMinimumExponentDigits(byte minExpDig) { - if (minExpDig < 1) { - throw new IllegalArgumentException("Exponent digits must be >= 1"); - } - minExponentDigits = minExpDig; - } - - /** - * NEW - * Return whether the exponent sign is always shown. - * @return true if the exponent is always prefixed with either the - * localized minus sign or the localized plus sign, false if only negative - * exponents are prefixed with the localized minus sign. - * @see #setScientificNotation - * @see #isScientificNotation - * @see #setMinimumExponentDigits - * @see #getMinimumExponentDigits - * @see #setExponentSignAlwaysShown - */ - public boolean isExponentSignAlwaysShown() { - return exponentSignAlwaysShown; - } - - /** - * NEW - * Set whether the exponent sign is always shown. This has no effect - * unless scientific notation is in use. - * @param expSignAlways true if the exponent is always prefixed with either - * the localized minus sign or the localized plus sign, false if only - * negative exponents are prefixed with the localized minus sign. - * @see #setScientificNotation - * @see #isScientificNotation - * @see #setMinimumExponentDigits - * @see #getMinimumExponentDigits - * @see #isExponentSignAlwaysShown - */ - public void setExponentSignAlwaysShown(boolean expSignAlways) { - exponentSignAlwaysShown = expSignAlways; - } - - /** - * Return the grouping size. Grouping size is the number of digits between - * grouping separators in the integer portion of a number. For example, - * in the number "123,456.78", the grouping size is 3. - * @see #setGroupingSize - * @see NumberFormat#isGroupingUsed - * @see DecimalFormatSymbols#getGroupingSeparator - */ - public int getGroupingSize () { - return groupingSize; - } - - /** - * Set the grouping size. Grouping size is the number of digits between - * grouping separators in the integer portion of a number. For example, - * in the number "123,456.78", the grouping size is 3. - * @see #getGroupingSize - * @see NumberFormat#setGroupingUsed - * @see DecimalFormatSymbols#setGroupingSeparator - */ - public void setGroupingSize (int newValue) { - groupingSize = (byte)newValue; - } - - /** - * Return the secondary grouping size. In some locales one - * grouping interval is used for the least significant integer - * digits (the primary grouping size), and another is used for all - * others (the secondary grouping size). A formatter supporting a - * secondary grouping size will return a positive integer unequal - * to the primary grouping size returned by - * getGroupingSize(). For example, if the primary - * grouping size is 4, and the secondary grouping size is 2, then - * the number 123456789 formats as "1,23,45,6789", and the pattern - * appears as "#,##,###0". - * [NEW] - * @return the secondary grouping size, or a value less than - * one if there is none - * @see #setSecondaryGroupingSize - * @see NumberFormat#isGroupingUsed - * @see DecimalFormatSymbols#getGroupingSeparator - */ - public int getSecondaryGroupingSize () { - return groupingSize2; - } - - /** - * Set the secondary grouping size. If set to a value less than 1, - * then secondary grouping is turned off, and the primary grouping - * size is used for all intervals, not just the least significant. - * [NEW] - * @see #getSecondaryGroupingSize - * @see NumberFormat#setGroupingUsed - * @see DecimalFormatSymbols#setGroupingSeparator - */ - public void setSecondaryGroupingSize (int newValue) { - groupingSize2 = (byte)newValue; - } - - /** - * Allows you to get the behavior of the decimal separator with integers. - * (The decimal separator will always appear with decimals.) - *

Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345 - */ - public boolean isDecimalSeparatorAlwaysShown() { - return decimalSeparatorAlwaysShown; - } - - /** - * Allows you to set the behavior of the decimal separator with integers. - * (The decimal separator will always appear with decimals.) - *

Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345 - */ - public void setDecimalSeparatorAlwaysShown(boolean newValue) { - decimalSeparatorAlwaysShown = newValue; - } - - /** - * Standard override; no change in semantics. - */ - public Object clone() { - try { - DecimalFormat other = (DecimalFormat) super.clone(); - other.symbols = (DecimalFormatSymbols) symbols.clone(); - return other; - } catch (Exception e) { - throw new InternalError(); - } - } - - /** - * Overrides equals - */ - public boolean equals(Object obj) - { - if (obj == null) return false; - if (!super.equals(obj)) return false; // super does class check - DecimalFormat other = (DecimalFormat) obj; - /* Add the comparison of the four new added fields ,they are - * posPrefixPattern, posSuffixPattern, negPrefixPattern, negSuffixPattern. - * [Richard/GCL] - */ - return (((posPrefixPattern == other.posPrefixPattern && - positivePrefix.equals(other.positivePrefix)) - || (posPrefixPattern != null && - posPrefixPattern.equals(other.posPrefixPattern))) - && ((posSuffixPattern == other.posSuffixPattern && - positiveSuffix.equals(other.positiveSuffix)) - || (posSuffixPattern != null && - posSuffixPattern.equals(other.posSuffixPattern))) - && ((negPrefixPattern == other.negPrefixPattern && - negativePrefix.equals(other.negativePrefix)) - || (negPrefixPattern != null && - negPrefixPattern.equals(other.negPrefixPattern))) - && ((negSuffixPattern == other.negSuffixPattern && - negativeSuffix.equals(other.negativeSuffix)) - || (negSuffixPattern != null && - negSuffixPattern.equals(other.negSuffixPattern))) - && multiplier == other.multiplier - && groupingSize == other.groupingSize - && groupingSize2 == other.groupingSize2 - && decimalSeparatorAlwaysShown == other.decimalSeparatorAlwaysShown - && useExponentialNotation == other.useExponentialNotation - && (!useExponentialNotation || - minExponentDigits == other.minExponentDigits) - && symbols.equals(other.symbols)); - } - - /** - * Overrides hashCode - */ - public int hashCode() { - return super.hashCode() * 37 + positivePrefix.hashCode(); - // just enough fields for a reasonable distribution - } - - /** - * Synthesizes a pattern string that represents the current state - * of this Format object. - * @see #applyPattern - */ - public String toPattern() { - return toPattern( false ); - } - - /** - * Synthesizes a localized pattern string that represents the current - * state of this Format object. - * @see #applyPattern - */ - public String toLocalizedPattern() { - return toPattern( true ); - } - - /** - * Expand the affix pattern strings into the expanded affix strings. If any - * affix pattern string is null, do not expand it. This method should be - * called any time the symbols or the affix patterns change in order to keep - * the expanded affix strings up to date. - */ - //Bug 4212072 [Richard/GCL] - private void expandAffixes() { - // Reuse one StringBuffer for better performance - StringBuffer buffer = new StringBuffer(); - if (posPrefixPattern != null) { - positivePrefix = expandAffix(posPrefixPattern, buffer); - } - if (posSuffixPattern != null) { - positiveSuffix = expandAffix(posSuffixPattern, buffer); - } - if (negPrefixPattern != null) { - negativePrefix = expandAffix(negPrefixPattern, buffer); - } - if (negSuffixPattern != null) { - negativeSuffix = expandAffix(negSuffixPattern, buffer); - } - } - - /** - * Expand an affix pattern into an affix string. All characters in the - * pattern are literal unless prefixed by QUOTE. The following characters - * after QUOTE are recognized: PATTERN_PERCENT, PATTERN_PER_MILLE, - * PATTERN_MINUS, and CURRENCY_SIGN. If CURRENCY_SIGN is doubled (QUOTE + - * CURRENCY_SIGN + CURRENCY_SIGN), it is interpreted as an international - * currency sign. Any other character after a QUOTE represents itself. - * QUOTE must be followed by another character; QUOTE may not occur by - * itself at the end of the pattern. - * - * @param pattern the non-null, possibly empty pattern - * @param buffer a scratch StringBuffer; its contents will be lost - * @return the expanded equivalent of pattern - */ - //Bug 4212072 [Richard/GCL] - private String expandAffix(String pattern, StringBuffer buffer) { - buffer.setLength(0); - for (int i=0; i= 0 - || affix.indexOf(symbols.getGroupingSeparator()) >= 0 - || affix.indexOf(symbols.getDecimalSeparator()) >= 0 - || affix.indexOf(symbols.getPercent()) >= 0 - || affix.indexOf(symbols.getPerMill()) >= 0 - || affix.indexOf(symbols.getDigit()) >= 0 - || affix.indexOf(symbols.getPatternSeparator()) >= 0 - || affix.indexOf(symbols.getExponentSeparator()) >= 0; - } - else { - needQuote = affix.indexOf(PATTERN_ZERO_DIGIT) >= 0 - || affix.indexOf(PATTERN_GROUPING_SEPARATOR) >= 0 - || affix.indexOf(PATTERN_DECIMAL_SEPARATOR) >= 0 - || affix.indexOf(PATTERN_PERCENT) >= 0 - || affix.indexOf(PATTERN_PER_MILLE) >= 0 - || affix.indexOf(PATTERN_DIGIT) >= 0 - || affix.indexOf(PATTERN_SEPARATOR) >= 0 - || affix.indexOf(PATTERN_EXPONENT) >= 0; - } - if (needQuote) buffer.append('\''); - if (affix.indexOf('\'') < 0) buffer.append(affix); - else { - for (int j=0; jCHANGED - * Does the real work of generating a pattern. - */ - private String toPattern(boolean localized) { - StringBuffer result = new StringBuffer(); - char zero = localized ? symbols.getZeroDigit() : PATTERN_ZERO_DIGIT; - char digit = localized ? symbols.getDigit() : PATTERN_DIGIT; - char group = localized ? symbols.getGroupingSeparator() - : PATTERN_GROUPING_SEPARATOR; - int i; - int roundingDecimalPos = 0; // Pos of decimal in roundingDigits - String roundingDigits = null; - int padPos = (formatWidth > 0) ? padPosition : -1; - String padSpec = (formatWidth > 0) - ? new StringBuffer(2). - append(localized ? symbols.getPadEscape() : PATTERN_PAD_ESCAPE). - append(pad).toString() - : null; - if (roundingIncrement != null) { - i = roundingIncrement.scale(); - roundingDigits = roundingIncrement.movePointRight(i).toString(); - roundingDecimalPos = roundingDigits.length() - i; - } - for (int part=0; part<2; ++part) { - // variable not used int partStart = result.length(); - if (padPos == PAD_BEFORE_PREFIX) { - result.append(padSpec); - } - /* Use original symbols read from java.text.resources in pattern - * eg. use "\u00A4" instead of "$" in Locale.US [Richard/GCL] - */ - appendAffix(result, - (part==0 ? posPrefixPattern : negPrefixPattern), - localized); - if (padPos == PAD_AFTER_PREFIX) { - result.append(padSpec); - } - int sub0Start = result.length(); - int g = isGroupingUsed() ? Math.max(0, groupingSize) : 0; - if (g > 0 && groupingSize2 > 0 && groupingSize2 != groupingSize) { - g += groupingSize2; - } - int maxIntDig = useExponentialNotation ? getMaximumIntegerDigits() : - (Math.max(Math.max(g, getMinimumIntegerDigits()), - roundingDecimalPos) + 1); - for (i = maxIntDig; i > 0; --i) { - if (!useExponentialNotation && i= 0 && pos < roundingDigits.length()) { - result.append((char) (roundingDigits.charAt(pos) - '0' + zero)); - continue; - } - } - result.append(i<=getMinimumIntegerDigits() ? zero : digit); - } - if (getMaximumFractionDigits() > 0 || decimalSeparatorAlwaysShown) { - result.append(localized ? symbols.getDecimalSeparator() : - PATTERN_DECIMAL_SEPARATOR); - } - int pos = roundingDecimalPos; - for (i = 0; i < getMaximumFractionDigits(); ++i) { - if (roundingDigits != null && - pos < roundingDigits.length()) { - result.append(pos < 0 ? zero : - (char) (roundingDigits.charAt(pos) - '0' + zero)); - ++pos; - continue; - } - result.append(i 0) { - result.insert(sub0Start, digit); - ++maxIntDig; - --add; - // Only add a grouping separator if we have at least - // 2 additional characters to be added, so we don't - // end up with ",###". - if (add>1 && isGroupingPosition(maxIntDig)) { - result.insert(sub0Start, group); - --add; - } - } - } - if (padPos == PAD_BEFORE_SUFFIX) { - result.append(padSpec); - } - if (part == 0) { - /* Use original symbols read from java.text.resources in pattern - * eg. use "\u00A4" instead of "$" in Locale.US [Richard/GCL] - */ - appendAffix(result, posSuffixPattern, localized); - if (padPos == PAD_AFTER_SUFFIX) { - result.append(padSpec); - } - if (negativeSuffix.equals(positiveSuffix) && - negativePrefix.equals(symbols.getMinusSign() + positivePrefix)) { - part = 2; - } else { - result.append(localized ? symbols.getPatternSeparator() : - PATTERN_SEPARATOR); - } - } else { - appendAffix(result, negSuffixPattern, localized); - if (padPos == PAD_AFTER_SUFFIX) { - result.append(padSpec); - } - } - } - return result.toString(); - } - - /** - * Apply the given pattern to this Format object. A pattern is a - * short-hand specification for the various formatting properties. - * These properties can also be changed individually through the - * various setter methods. - *

- * There is no limit to integer digits are set - * by this routine, since that is the typical end-user desire; - * use setMaximumInteger if you want to set a real value. - * For negative numbers, use a second pattern, separated by a semicolon - *

Example "#,#00.0#" -> 1,234.56 - *

This means a minimum of 2 integer digits, 1 fraction digit, and - * a maximum of 2 fraction digits. - *

Example: "#,#00.0#;(#,#00.0#)" for negatives in parentheses. - *

In negative patterns, the minimum and maximum counts are ignored; - * these are presumed to be set in the positive pattern. - */ - public void applyPattern( String pattern ) { - applyPattern( pattern, false ); - } - - /** - * Apply the given pattern to this Format object. The pattern - * is assumed to be in a localized notation. A pattern is a - * short-hand specification for the various formatting properties. - * These properties can also be changed individually through the - * various setter methods. - *

- * There is no limit to integer digits are set - * by this routine, since that is the typical end-user desire; - * use setMaximumInteger if you want to set a real value. - * For negative numbers, use a second pattern, separated by a semicolon - *

Example "#,#00.0#" -> 1,234.56 - *

This means a minimum of 2 integer digits, 1 fraction digit, and - * a maximum of 2 fraction digits. - *

Example: "#,#00.0#;(#,#00.0#)" for negatives in parantheses. - *

In negative patterns, the minimum and maximum counts are ignored; - * these are presumed to be set in the positive pattern. - */ - public void applyLocalizedPattern( String pattern ) { - applyPattern( pattern, true ); - } - - /** - * CHANGED - * Does the real work of applying a pattern. - */ - private void applyPattern(String pattern, boolean localized) { - char zeroDigit = PATTERN_ZERO_DIGIT; - char groupingSeparator = PATTERN_GROUPING_SEPARATOR; - char decimalSeparator = PATTERN_DECIMAL_SEPARATOR; - char percent = PATTERN_PERCENT; - char perMill = PATTERN_PER_MILLE; - char digit = PATTERN_DIGIT; - char separator = PATTERN_SEPARATOR; - String exponent = PATTERN_EXPONENT; - char plus = PATTERN_PLUS_SIGN; - char padEscape = PATTERN_PAD_ESCAPE; - char minus = PATTERN_MINUS; //Bug 4212072 [Richard/GCL] - if (localized) { - zeroDigit = symbols.getZeroDigit(); - groupingSeparator = symbols.getGroupingSeparator(); - decimalSeparator = symbols.getDecimalSeparator(); - percent = symbols.getPercent(); - perMill = symbols.getPerMill(); - digit = symbols.getDigit(); - separator = symbols.getPatternSeparator(); - exponent = symbols.getExponentSeparator(); - plus = symbols.getPlusSign(); - padEscape = symbols.getPadEscape(); - minus = symbols.getMinusSign(); //Bug 4212072 [Richard/GCL] - } - char nineDigit = (char) (zeroDigit + 9); - - boolean gotNegative = false; - - int pos = 0; - // Part 0 is the positive pattern. Part 1, if present, is the negative - // pattern. - for (int part=0; part<2 && pos 0) { - ++digitRightCount; - } else { - ++digitLeftCount; - } - if (groupingCount >= 0 && decimalPos < 0) { - ++groupingCount; - } - } else if (ch >= zeroDigit && ch <= nineDigit) { - if (digitRightCount > 0) { - throw new IllegalArgumentException( - "Unexpected '0' in pattern \"" + - pattern + '"'); - } - ++zeroDigitCount; - if (groupingCount >= 0 && decimalPos < 0) { - ++groupingCount; - } - if (ch != zeroDigit) { - int p = digitLeftCount + zeroDigitCount - + digitRightCount; - if (incrementPos >= 0) { - while (incrementPos < p) { - incrementVal *= 10; - ++incrementPos; - } - } else { - incrementPos = p; - } - incrementVal += ch - zeroDigit; - } - } else if (ch == groupingSeparator) { - /*Bug 4212072 - process the Localized pattern like "'Fr. '#'##0.05;'Fr.-'#'##0.05" - (Locale="CH", groupingSeparator == QUOTE) - [Richard/GCL] - */ - if ((pos + 1) < pattern.length() - && !((pattern.charAt(pos +1) == digit) - || ((pattern.charAt(pos +1) >= zeroDigit) - && (pattern.charAt(pos + 1) <= nineDigit)) - )) { - if (ch == QUOTE) { - // A quote outside quotes indicates either the opening - // quote or two quotes, which is a quote literal. That is, - // we have the first quote in 'do' or o''clock. - if ((pos+1) < pattern.length() && - pattern.charAt(pos+1) == QUOTE) { - ++pos; - // Fall through to append(ch) - } else { - if (groupingCount < 0) { - subpart += 3; // open quote - } else { - // Transition to suffix subpart - subpart = 2; // suffix subpart - affix = suffix; - sub0Limit = pos--; - } - continue; - } - } - } - - if (decimalPos >= 0) { - throw new IllegalArgumentException( - "Grouping separator after decimal in pattern \"" + - pattern + '"'); - } - groupingCount2 = groupingCount; - groupingCount = 0; - } else if (ch == decimalSeparator) { - if (decimalPos >= 0) { - throw new IllegalArgumentException( - "Multiple decimal separators in pattern \"" + - pattern + '"'); - } - // Intentionally incorporate the digitRightCount, - // even though it is illegal for this to be > 0 - // at this point. We check pattern syntax below. - decimalPos = digitLeftCount + zeroDigitCount + digitRightCount; - } else { - if (pattern.regionMatches(pos, exponent, 0, exponent.length())) { - if (expDigits >= 0) { - throw new IllegalArgumentException( - "Multiple exponential " + - "symbols in pattern \"" + - pattern + '"'); - } - if (groupingCount >= 0) { - throw new IllegalArgumentException( - "Grouping separator in exponential " + - "pattern \"" + - pattern + '"'); - } - // Check for positive prefix - if ((pos+1) < pattern.length() - && pattern.charAt(pos+1) == plus) { - expSignAlways = true; - ++pos; - } - // Use lookahead to parse out the exponential part of the - // pattern, then jump into suffix subpart. - expDigits = 0; - while (++pos < pattern.length() && - pattern.charAt(pos) == zeroDigit) { - ++expDigits; - } - - if ((digitLeftCount + zeroDigitCount) < 1 || - expDigits < 1) { - throw new IllegalArgumentException( - "Malformed exponential " + - "pattern \"" + pattern + '"'); - } - } - // Transition to suffix subpart - subpart = 2; // suffix subpart - affix = suffix; - sub0Limit = pos--; - continue; - } - break; - case 1: // Prefix subpart - case 2: // Suffix subpart - // Process the prefix / suffix characters - // Process unquoted characters seen in prefix or suffix - // subpart. - if (ch == digit || - ch == groupingSeparator || - ch == decimalSeparator || - (ch >= zeroDigit && ch <= nineDigit)) { - // Any of these characters implicitly begins the - // next subpart if we are in the prefix - if (subpart == 1) { // prefix subpart - subpart = 0; // pattern proper subpart - sub0Start = pos--; // Reprocess this character - continue; - } else if (ch == QUOTE) { - /*Bug 4212072 - process the Localized pattern like "'Fr. '#'##0.05;'Fr.-'#'##0.05" - (Locale="CH", groupingSeparator == QUOTE) - [Richard/GCL] - */ - // A quote outside quotes indicates either the opening - // quote or two quotes, which is a quote literal. That is, - // we have the first quote in 'do' or o''clock. - if ((pos+1) < pattern.length() && - pattern.charAt(pos+1) == QUOTE) { - ++pos; - // Fall through to append(ch) - } else { - subpart += 2; // open quote - continue; - } - } - // Fall through to append(ch) - } else if (ch == CURRENCY_SIGN) { - // Use lookahead to determine if the currency sign is - // doubled or not. - boolean doubled = (pos + 1) < pattern.length() && - pattern.charAt(pos + 1) == CURRENCY_SIGN; - /*Bug 4212072 - To meet the need of expandAffix(String, StirngBuffer) - [Richard/GCL] - */ - affix.append(doubled ? "\u00A4\u00A4" : "\u00A4"); - if (doubled) ++pos; // Skip over the doubled character - isCurrency = true; - continue; - } else if (ch == QUOTE) { - // A quote outside quotes indicates either the opening - // quote or two quotes, which is a quote literal. That is, - // we have the first quote in 'do' or o''clock. - if ((pos+1) < pattern.length() && - pattern.charAt(pos+1) == QUOTE) { - ++pos; - // Fall through to append(ch) - } else { - subpart += 2; // open quote - continue; - } - } else if (ch == separator) { - // Don't allow separators in the prefix, and don't allow - // separators in the second pattern (part == 1). - if (subpart == 1 || part == 1) { - throw new IllegalArgumentException( - "Unquoted special character '" + - ch + "' in pattern \"" + - pattern + '"'); - } - sub2Limit = pos++; - break PARTLOOP; // Go to next part - } else if (ch == percent || ch == perMill) { - // Next handle characters which are appended directly. - if (multiplier != 1) { - throw new IllegalArgumentException( - "Too many percent/permille characters " - + "in pattern \"" + pattern + '"'); - } - if (ch == percent) { - multiplier = 100; - ch = symbols.getPercent(); - } else { - multiplier = 1000; - ch = symbols.getPerMill(); - } - // Fall through to append(ch) - } else if (ch == padEscape) { - if (padPos >= 0) { - throw new IllegalArgumentException( - "Multiple pad specifiers"); - } - if ((pos+1) == pattern.length()) { - throw new IllegalArgumentException( - "Invalid pad specifier"); - } - padPos = pos++; // Advance past pad char - padChar = pattern.charAt(pos); - continue; - } - // Unquoted, non-special characters fall through to here, as - // well as other code which needs to append something to the - // affix. - affix.append(ch); - break; - case 3: // Prefix subpart, in quote - case 4: // Suffix subpart, in quote - // A quote within quotes indicates either the closing - // quote or two quotes, which is a quote literal. That is, - // we have the second quote in 'do' or 'don''t'. - if (ch == QUOTE) { - if ((pos+1) < pattern.length() && - pattern.charAt(pos+1) == QUOTE) { - ++pos; - // Fall through to append(ch) - } else { - subpart -= 2; // close quote - continue; - } - } - /*Bug 4212072 - To process the localized pattern "#,##0'%'" of which percent - symbol is quoted - [Richard/GCL] - */ - if (ch == percent || ch == perMill) { - // Next handle characters which are appended directly. - if (multiplier != 1) { - throw new IllegalArgumentException( - "Too many percent/permille characters " - + "in pattern \"" + pattern + '"'); - } - if (ch == percent) { - multiplier = 100; - ch = symbols.getPercent(); - } else { - multiplier = 1000; - ch = symbols.getPerMill(); - } - } - affix.append(ch); - break; - } - } - - if (sub0Limit == 0) { - sub0Limit = pattern.length(); - } - - if (sub2Limit == 0) { - sub2Limit = pattern.length(); - } - - /* Handle patterns with no '0' pattern character. These patterns - * are legal, but must be recodified to make sense. "##.###" -> - * "#0.###". ".###" -> ".0##". - * - * We allow patterns of the form "####" to produce a zeroDigitCount - * of zero (got that?); although this seems like it might make it - * possible for format() to produce empty strings, format() checks - * for this condition and outputs a zero digit in this situation. - * Having a zeroDigitCount of zero yields a minimum integer digits - * of zero, which allows proper round-trip patterns. We don't want - * "#" to become "#0" when toPattern() is called (even though that's - * what it really is, semantically). - */ - if (zeroDigitCount == 0 && digitLeftCount > 0 && decimalPos >= 0) { - // Handle "###.###" and "###." and ".###" - int n = decimalPos; - if (n == 0) ++n; // Handle ".###" - digitRightCount = digitLeftCount - n; - digitLeftCount = n - 1; - zeroDigitCount = 1; - } - - // Do syntax checking on the digits, decimal points, and quotes. - if ((decimalPos < 0 && digitRightCount > 0) || - (decimalPos >= 0 && - (decimalPos < digitLeftCount || - decimalPos > (digitLeftCount + zeroDigitCount))) || - groupingCount == 0 || groupingCount2 == 0 || - subpart > 2) { // subpart > 2 == unmatched quote - throw new IllegalArgumentException("Malformed pattern \"" + - pattern + '"'); - } - - // Make sure pad is at legal position before or after affix. - if (padPos >= 0) { - if (padPos == start) { - padPos = PAD_BEFORE_PREFIX; - } else if (padPos+2 == sub0Start) { - padPos = PAD_AFTER_PREFIX; - } else if (padPos == sub0Limit) { - padPos = PAD_BEFORE_SUFFIX; - } else if (padPos+2 == sub2Limit) { - padPos = PAD_AFTER_SUFFIX; - } else { - throw new IllegalArgumentException("Illegal pad position"); - } - } - - if (part == 0) { - // Set negative affixes temporarily to match the positive - // affixes. Fix this up later after processing both parts. - /*Bug 4212072 - To meet the need of expandAffix(String, StirngBuffer) - [Richard/GCL] - */ - this.posPrefixPattern = this.negPrefixPattern = prefix.toString(); - this.posSuffixPattern = this.negSuffixPattern = suffix.toString(); - - useExponentialNotation = (expDigits >= 0); - if (useExponentialNotation) { - minExponentDigits = expDigits; - exponentSignAlwaysShown = expSignAlways; - } - isCurrencyFormat = isCurrency; - int digitTotalCount = digitLeftCount + zeroDigitCount + digitRightCount; - // The effectiveDecimalPos is the position the decimal is at or - // would be at if there is no decimal. Note that if - // decimalPos<0, then digitTotalCount == digitLeftCount + - // zeroDigitCount. - int effectiveDecimalPos = decimalPos >= 0 ? decimalPos : digitTotalCount; - setMinimumIntegerDigits(effectiveDecimalPos - digitLeftCount); - /*Upper limit on integer and fraction digits for a Java double - [Richard/GCL] - */ - setMaximumIntegerDigits(useExponentialNotation - ? digitLeftCount + getMinimumIntegerDigits() : DOUBLE_INTEGER_DIGITS); - setMaximumFractionDigits(decimalPos >= 0 - ? (digitTotalCount - decimalPos) : 0); - setMinimumFractionDigits(decimalPos >= 0 - ? (digitLeftCount + zeroDigitCount - decimalPos) : 0); - setGroupingUsed(groupingCount > 0); - this.groupingSize = (groupingCount > 0) ? groupingCount : 0; - this.groupingSize2 = (groupingCount2 > 0 && groupingCount2 != groupingCount) - ? groupingCount2 : 0; - this.multiplier = multiplier; - setDecimalSeparatorAlwaysShown(decimalPos == 0 - || decimalPos == digitTotalCount); - if (padPos >= 0) { - padPosition = padPos; - formatWidth = prefix.length() + suffix.length() + - sub0Limit - sub0Start; - pad = padChar; - } else { - formatWidth = 0; - } - if (incrementVal != 0) { - // BigDecimal scale cannot be negative (even though - // this makes perfect sense), so we need to handle this. - int scale = incrementPos - effectiveDecimalPos; - roundingIncrement = - java.math.BigDecimal.valueOf(incrementVal, scale > 0 ? scale : 0); - if (scale < 0) { - roundingIncrement = - roundingIncrement.movePointRight(-scale); - } - roundingDouble = roundingIncrement.doubleValue(); - roundingMode = java.math.BigDecimal.ROUND_HALF_EVEN; - } else { - setRoundingIncrement(null); - } - } else { - /*Bug 4212072 - To meet the need of expandAffix(String, StirngBuffer) - [Richard/GCL] - */ - this.negPrefixPattern = prefix.toString(); - this.negSuffixPattern = suffix.toString(); - gotNegative = true; - } - } - - /*Bug 4140009 - Process the empty pattern - [Richard/GCL] - */ - if (pattern.length() == 0) { - posPrefixPattern = posSuffixPattern = ""; - setMinimumIntegerDigits(0); - setMaximumIntegerDigits(DOUBLE_INTEGER_DIGITS); - setMinimumFractionDigits(0); - setMaximumFractionDigits(DOUBLE_FRACTION_DIGITS); - } - - // If there was no negative pattern, or if the negative pattern is - // identical to the positive pattern, then prepend the minus sign to the - // positive pattern to form the negative pattern. - /*Bug 4212072 - To meet the need of expandAffix(String, StirngBuffer) - [Richard/GCL] - */ - if (!gotNegative || - (negPrefixPattern.equals(posPrefixPattern) - && negSuffixPattern.equals(posSuffixPattern))) { - negSuffixPattern = posSuffixPattern; - negPrefixPattern = symbols.getMinusSign() + posPrefixPattern; - } - /*Bug 4212072 - Update the affix strings accroding to symbols in order to keep - the affix strings up to date. - [Richard/GCL] - */ - expandAffixes(); - } - - /*Rewrite the following 4 "set" methods - Upper limit on integer and fraction digits for a Java double - [Richard/GCL] - */ - /** - * Sets the maximum number of digits allowed in the integer portion of a - * number. This override limits the integer digit count to 309. - * @see NumberFormat#setMaximumIntegerDigits - */ - public void setMaximumIntegerDigits(int newValue) { - super.setMaximumIntegerDigits(Math.min(newValue, DOUBLE_INTEGER_DIGITS)); - } - - /** - * Sets the minimum number of digits allowed in the integer portion of a - * number. This override limits the integer digit count to 309. - * @see NumberFormat#setMinimumIntegerDigits - */ - public void setMinimumIntegerDigits(int newValue) { - super.setMinimumIntegerDigits(Math.min(newValue, DOUBLE_INTEGER_DIGITS)); - } - - /** - * Sets the maximum number of digits allowed in the fraction portion of a - * number. This override limits the fraction digit count to 340. - * @see NumberFormat#setMaximumFractionDigits - */ - public void setMaximumFractionDigits(int newValue) { - super.setMaximumFractionDigits(Math.min(newValue, DOUBLE_FRACTION_DIGITS)); - } - - /** - * Sets the minimum number of digits allowed in the fraction portion of a - * number. This override limits the fraction digit count to 340. - * @see NumberFormat#setMinimumFractionDigits - */ - public void setMinimumFractionDigits(int newValue) { - super.setMinimumFractionDigits(Math.min(newValue, DOUBLE_FRACTION_DIGITS)); - } - - /** - * First, read the default serializable fields from the stream. Then - * if serialVersionOnStream is less than 1, indicating that - * the stream was written by JDK 1.1, initialize useExponentialNotation - * to false, since it was not present in JDK 1.1. - * Finally, set serialVersionOnStream back to the maximum allowed value so that - * default serialization will work properly if this object is streamed out again. - */ - private void readObject(ObjectInputStream stream) - throws IOException, ClassNotFoundException - { - stream.defaultReadObject(); - /*Bug 4185761 validate fields - [Richard/GCL] - */ - // We only need to check the maximum counts because NumberFormat - // .readObject has already ensured that the maximum is greater than the - // minimum count. - /*Commented for compatibility with previous version, and reserved for further use - if (getMaximumIntegerDigits() > DOUBLE_INTEGER_DIGITS || - getMaximumFractionDigits() > DOUBLE_FRACTION_DIGITS) { - throw new InvalidObjectException("Digit count out of range"); - }*/ - /* Truncte the maximumIntegerDigits to DOUBLE_INTEGER_DIGITS and maximumFractionDigits - * to DOUBLE_FRACTION_DIGITS - */ - if (getMaximumIntegerDigits() > DOUBLE_INTEGER_DIGITS) { - setMaximumIntegerDigits(DOUBLE_INTEGER_DIGITS); - } - if (getMaximumFractionDigits() > DOUBLE_FRACTION_DIGITS) { - setMaximumFractionDigits(DOUBLE_FRACTION_DIGITS); - } - if (serialVersionOnStream < 2) { - exponentSignAlwaysShown = false; - roundingDouble = 0.0; - roundingIncrement = null; - roundingMode = java.math.BigDecimal.ROUND_HALF_EVEN; - formatWidth = 0; - pad = ' '; - padPosition = PAD_BEFORE_PREFIX; - if (serialVersionOnStream < 1) { - // Didn't have exponential fields - useExponentialNotation = false; - } - } - serialVersionOnStream = currentSerialVersion; - digitList = new DigitList(); - } - - //---------------------------------------------------------------------- - // INSTANCE VARIABLES - //---------------------------------------------------------------------- - - private transient DigitList digitList = new DigitList(); - - /** - * The symbol used as a prefix when formatting positive numbers, e.g. "+". - * - * @serial - * @see #getPositivePrefix - */ - private String positivePrefix = ""; - - /** - * The symbol used as a suffix when formatting positive numbers. - * This is often an empty string. - * - * @serial - * @see #getPositiveSuffix - */ - private String positiveSuffix = ""; - - /** - * The symbol used as a prefix when formatting negative numbers, e.g. "-". - * - * @serial - * @see #getNegativePrefix - */ - private String negativePrefix = "-"; - - /** - * The symbol used as a suffix when formatting negative numbers. - * This is often an empty string. - * - * @serial - * @see #getNegativeSuffix - */ - private String negativeSuffix = ""; - - /** - * The prefix pattern for non-negative numbers. This variable corresponds - * to positivePrefix. - * - *

This pattern is expanded by the method expandAffix() to - * positivePrefix to update the latter to reflect changes in - * symbols. If this variable is null then - * positivePrefix is taken as a literal value that does not - * change when symbols changes. This variable is always - * null for DecimalFormat objects older than - * stream version 2 restored from stream. - * - * @serial - */ - //[Richard/GCL] - private String posPrefixPattern; - - /** - * The suffix pattern for non-negative numbers. This variable corresponds - * to positiveSuffix. This variable is analogous to - * posPrefixPattern; see that variable for further - * documentation. - * - * @serial - */ - //[Richard/GCL] - private String posSuffixPattern; - - /** - * The prefix pattern for negative numbers. This variable corresponds - * to negativePrefix. This variable is analogous to - * posPrefixPattern; see that variable for further - * documentation. - * - * @serial - */ - //[Richard/GCL] - private String negPrefixPattern; - - /** - * The suffix pattern for negative numbers. This variable corresponds - * to negativeSuffix. This variable is analogous to - * posPrefixPattern; see that variable for further - * documentation. - * - * @serial - */ - //[Richard/GCL] - private String negSuffixPattern; - - /** - * The multiplier for use in percent, permill, etc. - * - * @serial - * @see #getMultiplier - */ - private int multiplier = 1; - - /** - * The number of digits between grouping separators in the integer - * portion of a number. Must be greater than 0 if - * NumberFormat.groupingUsed is true. - * - * @serial - * @see #getGroupingSize - * @see NumberFormat#isGroupingUsed - */ - private byte groupingSize = 3; // invariant, > 0 if useThousands - - /** - * The secondary grouping size. This is only used for Hindi - * numerals, which use a primary grouping of 3 and a secondary - * grouping of 2, e.g., "12,34,567". If this value is less than - * 1, then secondary grouping is equal to the primary grouping. - * [NEW] - */ - private byte groupingSize2 = 0; - - /** - * If true, forces the decimal separator to always appear in a formatted - * number, even if the fractional part of the number is zero. - * - * @serial - * @see #isDecimalSeparatorAlwaysShown - */ - private boolean decimalSeparatorAlwaysShown = false; - - /** - * True if this object represents a currency format. This determines - * whether the monetary decimal separator is used instead of the normal one. - */ - private transient boolean isCurrencyFormat = false; - - /** - * The DecimalFormatSymbols object used by this format. - * It contains the symbols used to format numbers, e.g. the grouping separator, - * decimal separator, and so on. - * - * @serial - * @see #setDecimalFormatSymbols - * @see DecimalFormatSymbols - */ - private DecimalFormatSymbols symbols = null; // LIU new DecimalFormatSymbols(); - - /** - * True to force the use of exponential (i.e. scientific) notation when formatting - * numbers. - *

- * Note that the JDK 1.2 public API provides no way to set this field, - * even though it is supported by the implementation and the stream format. - * The intent is that this will be added to the API in the future. - * - * @serial - */ - private boolean useExponentialNotation; // Newly persistent in JDK 1.2 - - /** - * The minimum number of digits used to display the exponent when a number is - * formatted in exponential notation. This field is ignored if - * useExponentialNotation is not true. - *

- * Note that the JDK 1.2 public API provides no way to set this field, - * even though it is supported by the implementation and the stream format. - * The intent is that this will be added to the API in the future. - * - * @serial - */ - private byte minExponentDigits; // Newly persistent in JDK 1.2 - - /** - * NEW - * If true, the exponent is always prefixed with either the plus - * sign or the minus sign. Otherwise, only negative exponents are - * prefixed with the minus sign. This has no effect unless - * useExponentialNotation is true. - * @serial - * @since AlphaWorks NumberFormat - */ - private boolean exponentSignAlwaysShown = false; - - /** - * NEW - * The value to which numbers are rounded during formatting. For example, - * if the rounding increment is 0.05, then 13.371 would be formatted as - * 13.350, assuming 3 fraction digits. Has the value null if - * rounding is not in effect, or a positive value if rounding is in effect. - * Default value null. - * @serial - * @since AlphaWorks NumberFormat - */ - private java.math.BigDecimal roundingIncrement = null; - - /** - * NEW - * The rounding increment as a double. If this value is <= 0, then no - * rounding is done. This value is - * roundingIncrement.doubleValue(). Default value 0.0. - */ - private transient double roundingDouble = 0.0; - - /** - * NEW - * The rounding mode. This value controls any rounding operations which - * occur when applying a rounding increment or when reducing the number of - * fraction digits to satisfy a maximum fraction digits limit. The value - * may assume any of the BigDecimal rounding mode values. - * Default value BigDecimal.ROUND_HALF_EVEN. - * @serial - * @since AlphaWorks NumberFormat - */ - private int roundingMode = java.math.BigDecimal.ROUND_HALF_EVEN; - - /** - * NEW - * The padded format width, or zero if there is no padding. Must - * be >= 0. Default value zero. - * @serial - * @since AlphaWorks NumberFormat - */ - private int formatWidth = 0; - - /** - * NEW - * The character used to pad the result of format to - * formatWidth, if padding is in effect. Default value ' '. - * @serial - * @since AlphaWorks NumberFormat - */ - private char pad = ' '; - - /** - * NEW - * The position in the string at which the pad character - * will be inserted, if padding is in effect. Must have a value from - * PAD_BEFORE_PREFIX to PAD_AFTER_SUFFIX. - * Default value PAD_BEFORE_PREFIX. - * @serial - * @since AlphaWorks NumberFormat - */ - private int padPosition = PAD_BEFORE_PREFIX; - - //---------------------------------------------------------------------- - - static final int currentSerialVersion = 2; - - /** - * The internal serial version which says which version was written - * Possible values are: - *

    - *
  • 0 (default): versions before JDK 1.2 - *
  • 1: version from JDK 1.2 and later, which includes the two new fields - * useExponentialNotation and minExponentDigits. - *
  • 2: version on AlphaWorks, which adds roundingMode, formatWidth, - * pad, padPosition, exponentSignAlwaysShown, roundingIncrement. - *
- * @serial */ - private int serialVersionOnStream = currentSerialVersion; - - //---------------------------------------------------------------------- - // CONSTANTS - //---------------------------------------------------------------------- - - /** - * NEW - * Constant for getPadPosition() and - * setPadPosition() specifying pad characters inserted before - * the prefix. - * @see #setPadPosition - * @see #getPadPosition - * @see #PAD_AFTER_PREFIX - * @see #PAD_BEFORE_SUFFIX - * @see #PAD_AFTER_SUFFIX - */ - public static final int PAD_BEFORE_PREFIX = 0; - - /** - * NEW - * Constant for getPadPosition() and - * setPadPosition() specifying pad characters inserted after - * the prefix. - * @see #setPadPosition - * @see #getPadPosition - * @see #PAD_BEFORE_PREFIX - * @see #PAD_BEFORE_SUFFIX - * @see #PAD_AFTER_SUFFIX - */ - public static final int PAD_AFTER_PREFIX = 1; - - /** - * NEW - * Constant for getPadPosition() and - * setPadPosition() specifying pad characters inserted before - * the suffix. - * @see #setPadPosition - * @see #getPadPosition - * @see #PAD_BEFORE_PREFIX - * @see #PAD_AFTER_PREFIX - * @see #PAD_AFTER_SUFFIX - */ - public static final int PAD_BEFORE_SUFFIX = 2; - - /** - * NEW - * Constant for getPadPosition() and - * setPadPosition() specifying pad characters inserted after - * the suffix. - * @see #setPadPosition - * @see #getPadPosition - * @see #PAD_BEFORE_PREFIX - * @see #PAD_AFTER_PREFIX - * @see #PAD_BEFORE_SUFFIX - */ - public static final int PAD_AFTER_SUFFIX = 3; - - // Constants for characters used in programmatic (unlocalized) patterns. - private static final char PATTERN_ZERO_DIGIT = '0'; - private static final char PATTERN_GROUPING_SEPARATOR = ','; - private static final char PATTERN_DECIMAL_SEPARATOR = '.'; - private static final char PATTERN_PER_MILLE = '\u2030'; - private static final char PATTERN_PERCENT = '%'; - private static final char PATTERN_DIGIT = '#'; - private static final char PATTERN_SEPARATOR = ';'; - static final String PATTERN_EXPONENT = "E"; // [NEW] - static final char PATTERN_PAD_ESCAPE = '*'; // [NEW] - static final char PATTERN_PLUS_SIGN = '+'; // [NEW] - /*Bug 4212072 - To meet the need of expandAffix(String, StirngBuffer) - [Richard/GCL] - */ - private static final char PATTERN_MINUS = '-'; //[Richard/GCL] - - // Pad escape is package private to allow access by DecimalFormatSymbols. - // Also plus sign. Also exponent. - - /** - * The CURRENCY_SIGN is the standard Unicode symbol for currency. It - * is used in patterns and substitued with either the currency symbol, - * or if it is doubled, with the international currency symbol. If the - * CURRENCY_SIGN is seen in a pattern, then the decimal separator is - * replaced with the monetary decimal separator. - * - * The CURRENCY_SIGN is not localized. - */ - private static final char CURRENCY_SIGN = '\u00A4'; - - private static final char QUOTE = '\''; - - /* Upper limit on integer and fraction digits for a Java double - [Richard/GCL] - */ - static final int DOUBLE_INTEGER_DIGITS = 309; - static final int DOUBLE_FRACTION_DIGITS = 340; - - // Proclaim JDK 1.1 serial compatibility. - static final long serialVersionUID = 864413376551465018L; - - /** - * Cache to hold the NumberPattern of a Locale. - * [NEW] No longer needed -- share the NumberFormat cache - */ - // private static Hashtable cachedLocaleData = new Hashtable(3); -} - -//eof diff --git a/icu4j/src/com/ibm/text/DecimalFormatSymbols.java b/icu4j/src/com/ibm/text/DecimalFormatSymbols.java deleted file mode 100755 index f4e34a71c2..0000000000 --- a/icu4j/src/com/ibm/text/DecimalFormatSymbols.java +++ /dev/null @@ -1,617 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/DecimalFormatSymbols.java,v $ - * $Date: 2001/10/19 12:31:15 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.Serializable; -import java.util.ResourceBundle; -import java.util.Locale; -import java.util.Hashtable; - -/** - * This class represents the set of symbols (such as the decimal separator, the - * grouping separator, and so on) needed by DecimalFormat to format - * numbers. DecimalFormat creates for itself an instance of - * DecimalFormatSymbols from its locale data. If you need to - * change any of these symbols, you can get the - * DecimalFormatSymbols object from your DecimalFormat - * and modify it. - * - *

This is an enhanced version of DecimalFormatSymbols that - * is based on the standard version in the JDK. New or changed functionality - * is labeled - * NEW. - * - * @see java.util.Locale - * @see DecimalFormat - * @version 1.12 29 Jan 1997 - * @author Mark Davis - * @author Alan Liu - */ - -final public class DecimalFormatSymbols implements Cloneable, Serializable { - - /** - * Create a DecimalFormatSymbols object for the default locale. - */ - public DecimalFormatSymbols() { - initialize( Locale.getDefault() ); - } - - /** - * Create a DecimalFormatSymbols object for the given locale. - */ - public DecimalFormatSymbols( Locale locale ) { - initialize( locale ); - } - - /** - * character used for zero. Different for Arabic, etc. - */ - public char getZeroDigit() { - return zeroDigit; - } - - public void setZeroDigit(char zeroDigit) { - this.zeroDigit = zeroDigit; - } - - /** - * character used for thousands separator. Different for French, etc. - */ - public char getGroupingSeparator() { - return groupingSeparator; - } - - public void setGroupingSeparator(char groupingSeparator) { - this.groupingSeparator = groupingSeparator; - } - - /** - * character used for decimal sign. Different for French, etc. - */ - public char getDecimalSeparator() { - return decimalSeparator; - } - - public void setDecimalSeparator(char decimalSeparator) { - this.decimalSeparator = decimalSeparator; - } - - /** - * character used for mille percent sign. Different for Arabic, etc. - */ - public char getPerMill() { - return perMill; - } - - public void setPerMill(char perMill) { - this.perMill = perMill; - } - - /** - * character used for percent sign. Different for Arabic, etc. - */ - public char getPercent() { - return percent; - } - - public void setPercent(char percent) { - this.percent = percent; - } - - /** - * character used for a digit in a pattern. - */ - public char getDigit() { - return digit; - } - - public void setDigit(char digit) { - this.digit = digit; - } - - /** - * character used to separate positive and negative subpatterns - * in a pattern. - */ - public char getPatternSeparator() { - return patternSeparator; - } - - public void setPatternSeparator(char patternSeparator) { - this.patternSeparator = patternSeparator; - } - - /** - * String used to represent infinity. Almost always left - * unchanged. - */ - //Bug 4194173 [Richard/GCL] - - public String getInfinity() { - return infinity; - } - - public void setInfinity(String infinity) { - this.infinity = infinity; - } - - /** - * String used to represent NaN. Almost always left - * unchanged. - */ - //Bug 4194173 [Richard/GCL] - public String getNaN() { - return NaN; - } - - public void setNaN(String NaN) { - this.NaN = NaN; - } - - /** - * character used to represent minus sign. If no explicit - * negative format is specified, one is formed by prefixing - * minusSign to the positive format. - */ - public char getMinusSign() { - return minusSign; - } - - public void setMinusSign(char minusSign) { - this.minusSign = minusSign; - } - - /** - * Return the string denoting the local currency. - */ - public String getCurrencySymbol() - { - return currencySymbol; - } - - /** - * Set the string denoting the local currency. - */ - public void setCurrencySymbol(String currency) - { - currencySymbol = currency; - } - - /** - * Return the international string denoting the local currency. - */ - public String getInternationalCurrencySymbol() - { - return intlCurrencySymbol; - } - - /** - * Set the international string denoting the local currency. - */ - public void setInternationalCurrencySymbol(String currency) - { - intlCurrencySymbol = currency; - } - - /** - * Return the monetary decimal separator. - */ - public char getMonetaryDecimalSeparator() - { - return monetarySeparator; - } - - /** - * Set the monetary decimal separator. - */ - public void setMonetaryDecimalSeparator(char sep) - { - monetarySeparator = sep; - } - - /** - * NEW - * Return the string used to separate the mantissa from the exponent. - * Examples: "x10^" for 1.23x10^4, "E" for 1.23E4. - * @return the localized exponent symbol, used in localized patterns - * and formatted strings - * @see #setExponentSeparator - */ - public String getExponentSeparator() - { - return exponentSeparator; - } - - /** - * NEW - * Set the string used to separate the mantissa from the exponent. - * Examples: "x10^" for 1.23x10^4, "E" for 1.23E4. - * @param exp the localized exponent symbol, used in localized patterns - * and formatted strings - * @see #getExponentSeparator - */ - public void setExponentSeparator(String exp) - { - exponentSeparator = exp; - } - - /** - * NEW - * Return the localized plus sign. - * @return the plus sign, used in localized patterns and formatted - * strings - * @see #setPlusSign - * @see #setMinusSign - * @see #getMinusSign - */ - public char getPlusSign() { - return plusSign; - } - - /** - * NEW - * Set the localized plus sign. - * @param plus the plus sign, used in localized patterns and formatted - * strings - * @see #getPlusSign - * @see #setMinusSign - * @see #getMinusSign - */ - public void setPlusSign(char plus) { - plusSign = plus; - } - - /** - * NEW - * Return the character used to pad numbers out to a specified width. This - * is not the pad character itself; rather, it is the special pattern - * character preceding the pad character. In the pattern - * "*_#,##0", '*' is the pad escape, and '_' is the pad character. - * @return the character - * @see #setPadEscape - * @see DecimalFormat#getFormatWidth - * @see DecimalFormat#getPadPosition - * @see DecimalFormat#getPadCharacter - */ - public char getPadEscape() { - return padEscape; - } - - /** - * NEW - * Set the character used to pad numbers out to a specified width. This is - * not the pad character itself; rather, it is the special pattern character - * preceding the pad character. In the pattern "*_#,##0", '*' is - * the pad escape, and '_' is the pad character. - * @see #getPadEscape - * @see DecimalFormat#setFormatWidth - * @see DecimalFormat#setPadPosition - * @see DecimalFormat#setPadCharacter - */ - public void setPadEscape(char c) { - padEscape = c; - } - - /** - * Standard override. - */ - public Object clone() { - try { - return (DecimalFormatSymbols)super.clone(); - // other fields are bit-copied - } catch (CloneNotSupportedException e) { - throw new InternalError(); - } - } - - /** - * Override equals - */ - public boolean equals(Object obj) { - if (obj == null) return false; - if (this == obj) return true; - if (getClass() != obj.getClass()) return false; - DecimalFormatSymbols other = (DecimalFormatSymbols) obj; - return (zeroDigit == other.zeroDigit && - groupingSeparator == other.groupingSeparator && - decimalSeparator == other.decimalSeparator && - percent == other.percent && - perMill == other.perMill && - digit == other.digit && - minusSign == other.minusSign && - patternSeparator == other.patternSeparator && - infinity.equals(other.infinity) && - NaN.equals(other.NaN) && - currencySymbol.equals(other.currencySymbol) && - intlCurrencySymbol.equals(other.intlCurrencySymbol) && - padEscape == other.padEscape && // [NEW] - plusSign == other.plusSign && // [NEW] - exponentSeparator.equals(other.exponentSeparator) && // [NEW] - monetarySeparator == other.monetarySeparator); - } - - /** - * Override hashCode - */ - public int hashCode() { - int result = zeroDigit; - result = result * 37 + groupingSeparator; - result = result * 37 + decimalSeparator; - return result; - } - - /** - * Initializes the symbols from the LocaleElements resource bundle. - * Note: The organization of LocaleElements badly needs to be - * cleaned up. - */ - private void initialize( Locale locale ) { - /* try the cache first */ - String[][] data = (String[][]) cachedLocaleData.get(locale); - String[] numberElements; - String[] currencyElements; - if (data == null) { /* cache miss */ - data = new String[2][]; - ResourceBundle rb = ResourceBundle.getBundle - (NumberFormat.RESOURCE_BASE, locale); // [NEW] Temporary - data[0] = rb.getStringArray("NumberElements"); - data[1] = rb.getStringArray("CurrencyElements"); - /* update cache */ - cachedLocaleData.put(locale, data); - } - numberElements = data[0]; - currencyElements = data[1]; - - decimalSeparator = numberElements[0].charAt(0); - groupingSeparator = numberElements[1].charAt(0); - // [NEW] Temporary hack to support old JDK 1.1 resources - patternSeparator = numberElements[2].length() > 0 ? - numberElements[2].charAt(0) : ';'; - // patternSeparator = numberElements[2].charAt(0); - percent = numberElements[3].charAt(0); - zeroDigit = numberElements[4].charAt(0); //different for Arabic,etc. - digit = numberElements[5].charAt(0); - minusSign = numberElements[6].charAt(0); - - // [NEW] Temporary hack to support JDK versions before 1.1.6 (?) - exponentSeparator = numberElements.length >= 9 ? - numberElements[7] : DecimalFormat.PATTERN_EXPONENT; - perMill = numberElements.length >= 9 ? - numberElements[8].charAt(0) : '\u2030'; - infinity = numberElements.length >= 10 ? - numberElements[9] : "\u221e"; - NaN = numberElements.length >= 11 ? - numberElements[10] : "\ufffd"; - - // [NEW] Temporarily hard code; retrieve from resource later - plusSign = DecimalFormat.PATTERN_PLUS_SIGN; - padEscape = DecimalFormat.PATTERN_PAD_ESCAPE; - - currencySymbol = currencyElements[0]; - intlCurrencySymbol = currencyElements[1]; - - // if the resource data specified the empty string as the monetary decimal - // separator, that means we should just use the regular separator as the - // monetary separator - if (currencyElements[2].length() == 0) - monetarySeparator = decimalSeparator; - else - monetarySeparator = currencyElements[2].charAt(0); - } - - /** - * Read the default serializable fields, then if serialVersionOnStream - * is less than 1, initialize monetarySeparator to be - * the same as decimalSeparator and exponential - * to be 'E'. - * Finally, set serialVersionOnStream back to the maximum allowed value so that - * default serialization will work properly if this object is streamed out again. - * - */ - private void readObject(ObjectInputStream stream) - throws IOException, ClassNotFoundException { - stream.defaultReadObject(); - if (serialVersionOnStream < 1) { - // Didn't have monetarySeparator or exponential field; - // use defaults. - monetarySeparator = decimalSeparator; - exponential = 'E'; - } - if (serialVersionOnStream < 2) { // [NEW] - padEscape = DecimalFormat.PATTERN_PAD_ESCAPE; - plusSign = DecimalFormat.PATTERN_PLUS_SIGN; - exponentSeparator = String.valueOf(exponential); - // Although we read the exponential field on stream to create the - // exponentSeparator, we don't do the reverse, since scientific - // notation isn't supported by the old classes, even though the - // symbol is there. - } - serialVersionOnStream = currentSerialVersion; - } - - /** - * Character used for zero. - * - * @serial - * @see #getZeroDigit - */ - private char zeroDigit; - - /** - * Character used for thousands separator. - * - * @serial - * @see #getGroupingSeparator - */ - private char groupingSeparator; - - /** - * Character used for decimal sign. - * - * @serial - * @see #getDecimalSeparator - */ - private char decimalSeparator; - - /** - * Character used for mille percent sign. - * - * @serial - * @see #getPerMill - */ - private char perMill; - - /** - * Character used for percent sign. - * @serial - * @see #getPercent - */ - private char percent; - - /** - * Character used for a digit in a pattern. - * - * @serial - * @see #getDigit - */ - private char digit; - - /** - * Character used to separate positive and negative subpatterns - * in a pattern. - * - * @serial - * @see #getPatternSeparator - */ - private char patternSeparator; - - /** - * Character used to represent infinity. - * @serial - * @see #getInfinity - */ - private String infinity; - - /** - * Character used to represent NaN. - * @serial - * @see #getNaN - */ - private String NaN; - - /** - * Character used to represent minus sign. - * @serial - * @see #getMinusSign - */ - private char minusSign; - - /** - * String denoting the local currency, e.g. "$". - * @serial - * @see #getCurrencySymbol - */ - private String currencySymbol; - - /** - * International string denoting the local currency, e.g. "USD". - * @serial - * @see #getInternationalCurrencySymbol - */ - private String intlCurrencySymbol; - - /** - * The decimal separator used when formatting currency values. - * @serial - * @see #getMonetaryDecimalSeparator - */ - private char monetarySeparator; // Field new in JDK 1.1.6 - - /** - * The character used to distinguish the exponent in a number formatted - * in exponential notation, e.g. 'E' for a number such as "1.23E45". - *

- * Note that this field has been superseded by exponentSeparator. - * It is retained for backward compatibility. - * - * @serial - */ - private char exponential; // Field new in JDK 1.1.6 - - /** - * The string used to separate the mantissa from the exponent. - * Examples: "x10^" for 1.23x10^4, "E" for 1.23E4. - *

- * Note that this supersedes the exponential field. - * - * @serial - * @since AlphaWorks - */ - private String exponentSeparator; - - /** - * NEW - * The character used to indicate a padding character in a format, - * e.g., '*' in a pattern such as "$*_#,##0.00". - * @serial - * @since AlphaWorks - */ - private char padEscape; - - /** - * NEW - * The character used to indicate a plus sign. - * @serial - * @since AlphaWorks - */ - private char plusSign; - - // Proclaim JDK 1.1 FCS compatibility - static final long serialVersionUID = 5772796243397350300L; - - // The internal serial version which says which version was written - // - 0 (default) for version up to JDK 1.1.5 - // - 1 for version from JDK 1.1.6, which includes two new fields: - // monetarySeparator and exponential. - // - 2 for version from AlphaWorks, which includes 3 new fields: - // padEscape, exponentSeparator, and plusSign. - private static final int currentSerialVersion = 2; - - /** - * Describes the version of DecimalFormatSymbols present on the stream. - * Possible values are: - *

    - *
  • 0 (or uninitialized): versions prior to JDK 1.1.6. - * - *
  • 1: Versions written by JDK 1.1.6 or later, which includes - * two new fields: monetarySeparator and exponential. - *
  • 2: Version for AlphaWorks. Adds padEscape, exponentSeparator, - * and plusSign. - *
- * When streaming out a DecimalFormatSymbols, the most recent format - * (corresponding to the highest allowable serialVersionOnStream) - * is always written. - * - * @serial - */ - private int serialVersionOnStream = currentSerialVersion; - - /** - * cache to hold the NumberElements and the CurrencyElements - * of a Locale. - */ - private static final Hashtable cachedLocaleData = new Hashtable(3); -} diff --git a/icu4j/src/com/ibm/text/DecompData.java b/icu4j/src/com/ibm/text/DecompData.java deleted file mode 100755 index 1f09e4f1a3..0000000000 --- a/icu4j/src/com/ibm/text/DecompData.java +++ /dev/null @@ -1,745 +0,0 @@ -/* -************************************************************************ -* Copyright (c) 1997-2000, International Business Machines -* Corporation and others. All Rights Reserved. -************************************************************************ -* > THIS FILE WAS MACHINE GENERATED < -* > DO NOT EDIT BY HAND < -* > RUN TOOL TO REGENERATE < -* Tool: com.ibm.text.Normalizer -* Creation date: Tue Jul 18 11:05:28 PDT 2000 -*/ - -package com.ibm.text; -import com.ibm.util.*; - -class DecompData { - static final int MAX_CANONICAL = 21754; - static final int MAX_COMPAT = 11177; - static final int DECOMP_MASK = 32767; - static final int DECOMP_RECURSE = 32768; - static final short BASE = 0; - - static final CompactCharArray offsets = new CompactCharArray( - "\000\u0800\uA5A5\005\000 @`\u0080\u00A0\u00C0\u00E0\000\u0100\u0120\u0140"+ - "\u0160\u0180\000\000\000\u01A0\u01C0\u01E0\000\000\u0200\u0220\u0240\u0260"+ - "\u0280\u02A0\u02C0\u02E0\u0300\u0320\000\000\u0340\u0360\uA5A5\004\000"+ - "\u0380\uA5A5\004\000\u03A0\000\u03C0\000\000\u03E0\uA5A5\022\000\u0400"+ - "\u0420\000\000\000\u0440\000\000\u0460\u0480\uA5A5\007\000\u04A0\000\u04C0"+ - "\000\u04E0\000\000\000\u0500\000\000\000\u0520\000\000\000\u0540\000\000"+ - "\000\u0560\000\000\u0580\000\000\000\u05A0\u05C0\000\u05E0\000\u0600\u0620"+ - "\u0640\u0660\000\000\000\u0680\uA5A5n\000\u06A0\u06C0\u06E0\u0700\u0720"+ - "\u0740\u0760\u0780\u07A0\u07C0\u07E0\u0800\u0820\u0840\u0860\u0880\u08A0"+ - "\u08C0\u08E0\u0900\u0920\u0940\000\000\u0960\u0980\u09A0\u09C0\u09E0\u0A00"+ - "\u0A20\000\u0A40\u0A60\u0A80\u0AA0\u0AC0\u0AE0\000\u0B00\000\u0B20\uA5A5"+ - "\011\000\u0B40\u0B60\u0B80\u0BA0\u0BC0\uA5A5L\000\u0BE0\000\000\u0C00"+ - "\u0C20\u0C40\u0C60\u0C80\u0CA0\u0CC0\u0CE0\000\u0D00\u0D20\u0D40\u0D60"+ - "\u0D80\u0DA0\u0DC0\u0DE0\000\u0E00\u0E20\u0E40\u0E60\000\000\000\u0E80"+ - "\u0EA0\u0EC0\u0EE0\u0F00\u0F20\u0F40\u0F60\u0F80\u0FA0\u0FC0\u0FE0\u1000"+ - "\u1020\u1040\u1060\uA5A5\u0628\000\u1080\u10A0\u10C0\u10E0\u1100\u1120"+ - "\u1140\u1160\u1180\u11A0\uA5A5\006\000\u11C0\u11E0\u1200\u1220\u1240\u1260"+ - "\u1280\u12A0\u12C0\u12E0\u1300\u1320\u1340\u1360\u1380\u13A0\u13C0\u13E0"+ - "\u1400\u1420\u1440\u1460\u1480\u14A0\000\u14C0\u14E0\u1500\u1520\u1540"+ - "\u1560\u1580\u15A0\u15C0\u15E0\u1600\u1620\u1640\u1660\u1680" - , - "\000\u16A0\uA5A5 \000\005\uA5A5\007\000\012\000\021\uA5A5\004\000\026"+ - "\000\000\035!&-\000\00029=\000CO[\000\u2BAE\u2BB6\u2BBE\u2BC6\u2BCE\u2BD6"+ - "\000\u2BDE\u2BE6\u2BEE\u2BF6\u2BFE\u2C06\u2C0E\u2C16\u2C1E\000\u2C26\u2C2E"+ - "\u2C36\u2C3E\u2C46\u2C4E\000\000\u2C56\u2C5E\u2C66\u2C6E\u2C76\000\000"+ - "\u2C7E\u2C86\u2C8E\u2C96\u2C9E\u2CA6\000\u2CAE\u2CB6\u2CBE\u2CC6\u2CCE"+ - "\u2CD6\u2CDE\u2CE6\u2CEE\000\u2CF6\u2CFE\u2D06\u2D0E\u2D16\u2D1E\000\000"+ - "\u2D26\u2D2E\u2D36\u2D3E\u2D46\000\u2D4E\u2D56\u2D5E\u2D66\u2D6E\u2D76"+ - "\u2D7E\u2D86\u2D8E\u2D96\u2D9E\u2DA6\u2DAE\u2DB6\u2DBE\u2DC6\u2DCE\000"+ - "\000\u2DD6\u2DDE\u2DE6\u2DEE\u2DF6\u2DFE\u2E06\u2E0E\u2E16\u2E1E\u2E26"+ - "\u2E2E\u2E36\u2E3E\u2E46\u2E4E\u2E56\u2E5E\u2E66\u2E6E\000\000\u2E76\u2E7E"+ - "\u2E86\u2E8E\u2E96\u2E9E\u2EA6\u2EAE\u2EB6\000fn\u2EBE\u2EC6\u2ECE\u2ED6"+ - "\000\u2EDE\u2EE6\u2EEE\u2EF6\u2EFE\u2F06v~\000\000\u2F0E\u2F16\u2F1E\u2F26"+ - "\u2F2E\u2F36\u0086\000\000\u2F3E\u2F46\u2F4E\u2F56\u2F5E\u2F66\000\000"+ - "\u2F6E\u2F76\u2F7E\u2F86\u2F8E\u2F96\u2F9E\u2FA6\u2FAE\u2FB6\u2FBE\u2FC6"+ - "\u2FCE\u2FD6\u2FDE\u2FE6\u2FEE\u2FF6\000\000\u2FFE\u3006\u300E\u3016\u301E"+ - "\u3026\u302E\u3036\u303E\u3046\u304E\u3056\u305E\u3066\u306E\u3076\u307E"+ - "\u3086\u308E\u3096\u309E\u30A6\u30AE\u008D\u30B6\u30BE\uA5A5\015\000\u30C6"+ - "\u30CE\uA5A5\023\000\u0093\u009F\u00AB\u00B6\u00BE\u00C6\u00CE\u00D6\u00DE"+ - "\u30D6\u30DE\u30E6\u30EE\u30F6\u30FE\u3106\u310E\u3117\u3123\u312F\u313B"+ - "\u3147\u3153\u315F\u316B\000\u3177\u3183\u318F\u319B\u31A6\u31AE\000\000"+ - "\u31B6\u31BE\u31C6\u31CE\u31D6\u31DE\u31E7\u31F3\u31FE\u3206\u320E\u0092"+ - "\u009E\u00AA\u3216\u321E\000\000\u3226\u322E\u3237\u3243\u324E\u3256\u325E"+ - "\u3266\u326E\u3276\u327E\u3286\u328E\u3296\u329E\u32A6\u32AE\u32B6\u32BE"+ - "\u32C6\u32CE\u32D6\u32DE\u32E6\u32EE\u32F6\u32FE\u3306\u330E\u3316\u331E"+ - "\u3326\u332E\u3336\u333E\u3346\000\000\u334E\u3356\uA5A5\006\000\u335E"+ - "\u3366\u336E\u3376\u337F\u338B\u3397\u33A3\u33AE\u33B6\u33BF\u33CB\u33D6"+ - "\u33DE\uA5A5\034\000\u00E5\u00E9q\u00ED\u00F1\u00F5\u00F9\u00FD\u0101"+ - "\uA5A5\037\000\u0106\u010E\u0116\u011E\u0126\u012E\000\000\u0135}\u008D"+ - "\u0139\u013D\uA5A5\033\000\u33E5\u33E9\000\u33ED\u33F2\uA5A5/\000\u33F9"+ - "\uA5A5\005\000\u0142\000\000\000\u33FD\uA5A5\005\000&\uB402\u340A\u3411"+ - "\u3416\u341E\u3426\000\u342E\000\u3436\u343E\u3447\uA5A5\031\000\u3452"+ - "\u345A\u3462\u346A\u3472\u347A\u3483\uA5A5\031\000\u348E\u3496\u349E\u34A6"+ - "\u34AE\000\u0149\u014D\u0151\uB4B6\uB4BE\u0155\u0159\uA5A5\031\000\u015D"+ - "\u0161\u0165\uA5A5\015\000\u34C6\u34CE\000\u34D6\000\000\000\u34DE\uA5A5"+ - "\004\000\u34E6\u34EE\u34F6\uA5A5\012\000\u34FE\uA5A5\037\000\u3506\uA5A5"+ - "\026\000\u350E\u3516\000\u351E\000\000\000\u3526\uA5A5\004\000\u352E\u3536"+ - "\u353E\uA5A5\027\000\u3546\u354E\uA5A5\011\000\u3556\u355E\uA5A5\015\000"+ - "\u3566\u356E\u3576\u357E\000\000\u3586\u358E\000\000\u3596\u359E\u35A6"+ - "\u35AE\u35B6\u35BE\000\000\u35C6\u35CE\u35D6\u35DE\u35E6\u35EE\000\000"+ - "\u35F6\u35FE\u3606\u360E\u3616\u361E\u3626\u362E\u3636\u363E\u3646\u364E"+ - "\000\000\u3656\u365E\uA5A5\015\000\u016A\uA5A5\032\000\u3666\u366E\u3676"+ - "\u367E\u3686\uA5A5.\000\u0172\u017A\u0182\u018A\uA5A5\007\000\u368E\000"+ - "\u3696\uA5A5\020\000\u369E\uA5A5\025\000\u36A6\uA5A5\007\000\u36AE\000"+ - "\000\u36B6\uA5A5#\000\u36BE\u36C6\u36CE\u36D6\u36DE\u36E6\u36EE\u36F6"+ - "\uA5A5\013\000\u36FE\u3706\uA5A5\017\000\u370E\u3716\000\u371E\uA5A5\023"+ - "\000\u3726\000\000\u372E\uA5A5\042\000\u3736\u373E\u3746\000\000\u374E"+ - "\uA5A5\011\000\u3756\000\000\u375E\u3766\uA5A5\017\000\u376E\u3776\uA5A5"+ - "\026\000\u377E\uA5A5\025\000\u3786\u378E\u3796\uA5A5\033\000\u379E\uA5A5"+ - "\027\000\u37A6\uA5A5\006\000\u37AE\u37B6\000\u37BE\u37C7\uA5A5\036\000"+ - "\u37D2\u37DA\u37E2\uA5A5-\000\u37EA\000\u37F2\u37FB\u3806\uA5A5\024\000"+ - "\u0192\uA5A5\037\000\u019A\uA5A5(\000\u01A2\u01AA\uA5A5\016\000\u01B1"+ - "\uA5A5\026\000\u380E\uA5A5\011\000\u3816\uA5A5\004\000\u381E\uA5A5\004"+ - "\000\u3826\uA5A5\004\000\u382E\uA5A5\014\000\u3836\uA5A5\011\000\u383E"+ - "\000\u3846\u384E\u01B7\u3856\u01C3\uA5A5\007\000\u385E\uA5A5\021\000\u3866"+ - "\uA5A5\011\000\u386E\uA5A5\004\000\u3876\uA5A5\004\000\u387E\uA5A5\004"+ - "\000\u3886\uA5A5\014\000\u388E\uA5A5\014\000\u3896\uA5A5\031\000\u389E"+ - "\u38A6\u38AE\u38B6\u38BE\u38C6\u38CE\u38D6\u38DF\u38EB\u38F6\u38FE\u3906"+ - "\u390E\u3916\u391E\u3926\u392E\u3936\u393E\u3947\u3953\u395F\u396B\u3976"+ - "\u397E\u3986\u398E\u3997\u39A3\u39AE\u39B6\u39BE\u39C6\u39CE\u39D6\u39DE"+ - "\u39E6\u39EE\u39F6\u39FE\u3A06\u3A0E\u3A16\u3A1E\u3A26\u3A2F\u3A3B\u3A46"+ - "\u3A4E\u3A56\u3A5E\u3A66\u3A6E\u3A76\u3A7E\u3A87\u3A93\u3A9E\u3AA6\u3AAE"+ - "\u3AB6\u3ABE\u3AC6\u3ACE\u3AD6\u3ADE\u3AE6\u3AEE\u3AF6\u3AFE\u3B06\u3B0E"+ - "\u3B16\u3B1E\u3B26\u3B2F\u3B3B\u3B47\u3B53\u3B5F\u3B6B\u3B77\u3B83\u3B8E"+ - "\u3B96\u3B9E\u3BA6\u3BAE\u3BB6\u3BBE\u3BC6\u3BCF\u3BDB\u3BE6\u3BEE\u3BF6"+ - "\u3BFE\u3C06\u3C0E\u3C17\u3C23\u3C2F\u3C3B\u3C47\u3C53\u3C5E\u3C66\u3C6E"+ - "\u3C76\u3C7E\u3C86\u3C8E\u3C96\u3C9E\u3CA6\u3CAE\u3CB6\u3CBE\u3CC6\u3CCF"+ - "\u3CDB\u3CE7\u3CF3\u3CFE\u3D06\u3D0E\u3D16\u3D1E\u3D26\u3D2E\u3D36\u3D3E"+ - "\u3D46\u3D4E\u3D56\u3D5E\u3D66\u3D6E\u3D76\u3D7E\u3D86\u3D8E\u3D96\u3D9E"+ - "\u3DA6\u3DAE\u3DB6\u3DBE\u3DC6\u3DCE\u3DD6\u3DDE\u3DE6\u01CE\uBDEE\uA5A5"+ - "\004\000\u3DF6\u3DFE\u3E06\u3E0E\u3E17\u3E23\u3E2F\u3E3B\u3E47\u3E53\u3E5F"+ - "\u3E6B\u3E77\u3E83\u3E8F\u3E9B\u3EA7\u3EB3\u3EBF\u3ECB\u3ED7\u3EE3\u3EEF"+ - "\u3EFB\u3F06\u3F0E\u3F16\u3F1E\u3F26\u3F2E\u3F37\u3F43\u3F4F\u3F5B\u3F67"+ - "\u3F73\u3F7F\u3F8B\u3F97\u3FA3\u3FAE\u3FB6\u3FBE\u3FC6\u3FCE\u3FD6\u3FDE"+ - "\u3FE6\u3FEF\u3FFB\u4007\u4013\u401F\u402B\u4037\u4043\u404F\u405B\u4067"+ - "\u4073\u407F\u408B\u4097\u40A3\u40AF\u40BB\u40C7\u40D3\u40DE\u40E6\u40EE"+ - "\u40F6\u40FF\u410B\u4117\u4123\u412F\u413B\u4147\u4153\u415F\u416B\u4176"+ - "\u417E\u4186\u418E\u4196\u419E\u41A6\u41AE\uA5A5\006\000\u41B6\u41BE\u41C7"+ - "\u41D3\u41DF\u41EB\u41F7\u4203\u420E\u4216\u421F\u422B\u4237\u4243\u424F"+ - "\u425B\u4266\u426E\u4277\u4283\u428F\u429B\000\000\u42A6\u42AE\u42B7\u42C3"+ - "\u42CF\u42DB\000\000\u42E6\u42EE\u42F7\u4303\u430F\u431B\u4327\u4333\u433E"+ - "\u4346\u434F\u435B\u4367\u4373\u437F\u438B\u4396\u439E\u43A7\u43B3\u43BF"+ - "\u43CB\u43D7\u43E3\u43EE\u43F6\u43FF\u440B\u4417\u4423\u442F\u443B\u4446"+ - "\u444E\u4457\u4463\u446F\u447B\000\000\u4486\u448E\u4497\u44A3\u44AF\u44BB"+ - "\000\000\u44C6\u44CE\u44D7\u44E3\u44EF\u44FB\u4507\u4513\000\u451E\000"+ - "\u4527\000\u4533\000\u453F\u454A\u4552\u455B\u4567\u4573\u457F\u458B\u4597"+ - "\u45A2\u45AA\u45B3\u45BF\u45CB\u45D7\u45E3\u45EF\u45FA\u4602\u460A\u4612"+ - "\u461A\u4622\u462A\u4632\u463A\u4642\u464A\u4652\u465A\u4662\000\000\u466B"+ - "\u4677\u4680\u4694\u46A8\u46BC\u46D0\u46E4\u46FB\u4707\u4710\u4724\u4738"+ - "\u474C\u4760\u4774\u478B\u4797\u47A0\u47B4\u47C8\u47DC\u47F0\u4804\u481B"+ - "\u4827\u4830\u4844\u4858\u486C\u4880\u4894\u48AB\u48B7\u48C0\u48D4\u48E8"+ - "\u48FC\u4910\u4924\u493B\u4947\u4950\u4964\u4978\u498C\u49A0\u49B4\u49CA"+ - "\u49D2\u49DB\u49E6\u49EF\000\u49FA\u4A03\u4A0E\u4A16\u4A1E\u4A26\u4A2E"+ - "\u01D6\u4A35\u01D6\u01DE\uCA3A\u4A43\u4A4E\u4A57\000\u4A62\u4A6B\u4A76"+ - "\u4A7E\u4A86\u4A8E\u4A96\uCA9E\uCAA6\uCAAE\u4AB6\u4ABE\u4AC7\u4AD3\000"+ - "\000\u4ADE\u4AE7\u4AF2\u4AFA\u4B02\u4B0A\000\uCB12\uCB1A\uCB22\u4B2A\u4B32"+ - "\u4B3B\u4B47\u4B52\u4B5A\u4B62\u4B6B\u4B76\u4B7E\u4B86\u4B8E\u4B96\uCB9E"+ - "\uCBA6\u4BAD\000\000\u4BB3\u4BBE\u4BC7\000\u4BD2\u4BDB\u4BE6\u4BEE\u4BF6"+ - "\u4BFE\u4C06\uCC0D\u01E6\000\uCC11\uCC15\uA5A5\011\005\uA5A5\006\000\u01ED"+ - "\uA5A5\005\000\u01F2\uA5A5\014\000\u01F9\u01FE\u01FB\uA5A5\010\000\005"+ - "\000\000\000\u0206\u020F\000\u021A\u0223\uA5A5\004\000\u022E\000\u0236"+ - "\uA5A5\011\000\u023E\u0246\uA5A5&\000\u024D\000\000\000I\u0251\u0255\u0259"+ - "\u025D\u0261\u0265\u0269\u026D\u0271\u0275\u0089\u024D9\035!I\u0251\u0255"+ - "\u0259\u025D\u0261\u0265\u0269\u026D\u0271\u0275\uA5A5\031\000\u027A\uA5A5"+ - "\027\000\u0283\u028F\u0299\u029E\000\u02A7\u02B3\u02BD\000\u02C2\u02C9"+ - "\u02CD\u02CD\u02CD\u00E5\u02D1eeu}\000\u00CD\u02D6\000\000\u02DD\u02E1"+ - "\u0279\u0279\u0279\000\000\u02E6\u02EF\u02FA\000\u0095\000\u4C19\000\u0095"+ - "\000\u4C1D\u4C22\u0301\u0299\000\u0305\u02F1\u02C5\000\u02E9=\u0309\u030D"+ - "\u0311\u0315m\uA5A5\031\000\u031B\u0327\u0333\u033F\u034B\u0357\u0363"+ - "\u036F\u037B\u0387\u0393\u039FBe\u03AA\u03B3\u03BE\u03C1\u03C6\u03CF\u03D8"+ - "\u03EE\u03F1\u03F6\u03FFu\u0299\u0091\u02E9m\u040A\u0413\u041E\u0421\u0426"+ - "\u042F\u0438\u044E\u0139\u0456\u045F}\u0289\u00A9\u0469\uA5A5\032\000"+ - "\u4C2A\u4C32\uA5A5\022\000\u4C3A\uA5A5\036\000\u4C42\u4C4A\u4C52\uA5A5"+ - "\024\000\u4C5A\uA5A5\004\000\u4C62\000\000\u4C6A\uA5A5\027\000\u4C72\000"+ - "\u4C7A\uA5A5\005\000\u046E\u0477\000\u0482\u048B\uA5A5\020\000\u4C82\000"+ - "\000\u4C8A\000\000\u4C92\000\u4C9A\uA5A5\026\000\u4CA2\000\u4CAA\uA5A5"+ - "\012\000\u4CB2\u4CBA\u4CC2\u4CCA\u4CD2\000\000\u4CDA\u4CE2\000\000\u4CEA"+ - "\u4CF2\uA5A5\006\000\u4CFA\u4D02\000\000\u4D0A\u4D12\000\000\u4D1A\u4D22"+ - "\uA5A5\042\000\u4D2A\u4D32\u4D3A\u4D42\uA5A5\020\000\u4D4A\u4D52\u4D5A"+ - "\u4D62\uA5A5\006\000\u4D6A\u4D72\u4D7A\u4D82\uA5A5\033\000\u4D89\u4D8D"+ - "\uA5A5\025\0009\035!I\u0251\u0255\u0259\u025D\u0261\u0496\u049E\u04A6"+ - "\u04AE\u04B6\u04BE\u04C6\u04CE\u04D6\u04DE\u04E6\u04EF\u04FB\u0507\u0513"+ - "\u051F\u052B\u0537\u0543\u054F\u0558\u056C\u0580\u0594\u05A8\u05BC\u05D0"+ - "\u05E4\u05F8\u060C\u0620\u0636\u063E\u0646\u064E\u0656\u065E\u0666\u066E"+ - "\u0676\u067F\u068B\u0697\u06A3\u06AF\u06BB\u06C7\u06D3\u06DF\u06EB\u06F7"+ - "\u0703\u070F\u071B\u0727\u0733\u073F\u074B\u0757\u0763\u076F\u077B\u0787"+ - "\u0793\u079F\u07AB\u07B7\u07C3\u07CF\u07DB\u07E7\u07F3\u07FF\u080B\u0817"+ - "\u0823\u082F\u0839\u0301\u0299\u0091\u02F1\u02C5\u083D\u02CDei\u0841u"+ - "\u02E9\u00CD\u0845\u02DD\u02E1\u0279\u02E5\u02ED\u0849\u03C1\u084D\u03F1"+ - "\u0851\u0095\021\u0711\u0289\u00A9\u0305\u0741\u02C9\u00E5mq\u077D}\u0469"+ - "\u0089=\u07B9\u07C5\u00ED\u008D\u07E9\u02B9\u0421\u00FD\u0139\u0101\u00A1"+ - "\u024D\uA5A54\000\u0855\uA5A5\023\000\u0859\uA5A5\014\000\u085D\u0861"+ - "\u0865\u0869\u086D\u0871\u0875\u0879\u087D\u0881\u0885\u0889\u088D\u0891"+ - "\u0895\u0899\u089D\u08A1\u08A5\u08A9\u08AD\u08B1\u08B5\u08B9\u08BD\u08C1"+ - "\u08C5\u08C9\u08CD\u08D1\u08D5\u08D9\u08DD\u08E1\u08E5\u08E9\u08ED\u08F1"+ - "\u08F5\u08F9\u08FD\u0901\u0905\u0909\u090D\u0911\u0915\u0919\u091D\u0921"+ - "\u0925\u0929\u092D\u0931\u0935\u0939\u093D\u0941\u0945\u0949\u094D\u0951"+ - "\u0955\u0959\u095D\u0961\u0965\u0969\u096D\u0971\u0975\u0979\u097D\u0981"+ - "\u0985\u0989\u098D\u0991\u0995\u0999\u099D\u09A1\u09A5\u09A9\u09AD\u09B1"+ - "\u09B5\u09B9\u09BD\u09C1\u09C5\u09C9\u09CD\u09D1\u09D5\u09D9\u09DD\u09E1"+ - "\u09E5\u09E9\u09ED\u09F1\u09F5\u09F9\u09FD\u0A01\u0A05\u0A09\u0A0D\u0A11"+ - "\u0A15\u0A19\u0A1D\u0A21\u0A25\u0A29\u0A2D\u0A31\u0A35\u0A39\u0A3D\u0A41"+ - "\u0A45\u0A49\u0A4D\u0A51\u0A55\u0A59\u0A5D\u0A61\u0A65\u0A69\u0A6D\u0A71"+ - "\u0A75\u0A79\u0A7D\u0A81\u0A85\u0A89\u0A8D\u0A91\u0A95\u0A99\u0A9D\u0AA1"+ - "\u0AA5\u0AA9\u0AAD\u0AB1\u0AB5\u0AB9\u0ABD\u0AC1\u0AC5\u0AC9\u0ACD\u0AD1"+ - "\u0AD5\u0AD9\u0ADD\u0AE1\u0AE5\u0AE9\u0AED\u0AF1\u0AF5\u0AF9\u0AFD\u0B01"+ - "\u0B05\u0B09\u0B0D\u0B11\u0B15\u0B19\u0B1D\u0B21\u0B25\u0B29\u0B2D\u0B31"+ - "\u0B35\u0B39\u0B3D\u0B41\u0B45\u0B49\u0B4D\u0B51\u0B55\u0B59\u0B5D\u0B61"+ - "\u0B65\u0B69\u0B6D\u0B71\u0B75\u0B79\u0B7D\u0B81\u0B85\u0B89\u0B8D\u0B91"+ - "\u0B95\u0B99\u0B9D\u0BA1\u0BA5\u0BA9\u0BAD\u0BB1\uA5A5\012\000\005\uA5A5"+ - "5\000\u0BB5\000\u08B9\u0BB9\u0BBD\uA5A5\021\000\u4D92\000\u4D9A\000\u4DA2"+ - "\000\u4DAA\000\u4DB2\000\u4DBA\000\u4DC2\000\u4DCA\000\u4DD2\000\u4DDA"+ - "\000\u4DE2\000\u4DEA\000\000\u4DF2\000\u4DFA\000\u4E02\uA5A5\006\000\u4E0A"+ - "\u4E12\000\u4E1A\u4E22\000\u4E2A\u4E32\000\u4E3A\u4E42\000\u4E4A\u4E52"+ - "\uA5A5\026\000\u4E5A\uA5A5\006\000\u0BC2\u0BCA\000\u4E62\uA5A5\015\000"+ - "\u4E6A\000\u4E72\000\u4E7A\000\u4E82\000\u4E8A\000\u4E92\000\u4E9A\000"+ - "\u4EA2\000\u4EAA\000\u4EB2\000\u4EBA\000\u4EC2\000\000\u4ECA\000\u4ED2"+ - "\000\u4EDA\uA5A5\006\000\u4EE2\u4EEA\000\u4EF2\u4EFA\000\u4F02\u4F0A\000"+ - "\u4F12\u4F1A\000\u4F22\u4F2A\uA5A5\026\000\u4F32\000\000\u4F3A\u4F42\u4F4A"+ - "\u4F52\000\000\000\u4F5A\uA5A5\022\000\u0BD1\u0BD5\u0BD9\u0BDD\u0BE1\u0BE5"+ - "\u0BE9\u0BED\u0BF1\u0BF5\u0BF9\u0BFD\u0C01\u0C05\u0C09\u0C0D\u0C11\u0C15"+ - "\u0C19\u0C1D\u0C21\u0C25\u0C29\u0C2D\u0C31\u0C35\u0C39\u0C3D\u0C41\u0C45"+ - "\u0C49\u0C4D\u0C51\u0C55\u0C59\u0C5D\u0C61\u0C65\u0C69\u0C6D\u0C71\u0C75"+ - "\u0C79\u0C7D\u0C81\u0C85\u0C89\u0C8D\u0C91\u0C95\u0C99\u0C9D\u0CA1\u0CA5"+ - "\u0CA9\u0CAD\u0CB1\u0CB5\u0CB9\u0CBD\u0CC1\u0CC5\u0CC9\u0CCD\u0CD1\u0CD5"+ - "\u0CD9\u0CDD\u0CE1\u0CE5\u0CE9\u0CED\u0CF1\u0CF5\u0CF9\u0CFD\u0D01\u0D05"+ - "\u0D09\u0D0D\u0D11\u0D15\u0D19\u0D1D\u0D21\u0D25\u0D29\u0D2D\u0D31\u0D35"+ - "\u0D39\u0D3D\u0D41\u0D45\000\000\000\u085D\u0875\u0D49\u0D4D\u0D51\u0D55"+ - "\u0D59\u0D5D\u086D\u0D61\u0D65\u0D69\u0D6D\u087D\u0D73\u0D7F\u0D8B\u0D97"+ - "\u0DA3\u0DAF\u0DBB\u0DC7\u0DD3\u0DDF\u0DEB\u0DF7\u0E03\u0E0F\u0E18\u0E2C"+ - "\u0E40\u0E54\u0E68\u0E7C\u0E90\u0EA4\u0EB8\u0ECC\u0EE0\u0EF4\u0F08\u0F1C"+ - "\u0F30\000\000\000\u0F47\u0F53\u0F5F\u0F6B\u0F77\u0F83\u0F8F\u0F9B\u0FA7"+ - "\u0FB3\u0FBF\u0FCB\u0FD7\u0FE3\u0FEF\u0FFB\u1007\u1013\u101F\u102B\u1037"+ - "\u1043\u104F\u105B\u1067\u1073\u107F\u108B\u1097\u10A3\u10AF\u10BB\u10C7"+ - "\u10D3\u10DF\u10EB\uA5A5\034\000\u0BD1\u0BDD\u0BE9\u0BF1\u0C11\u0C15\u0C21"+ - "\u0C29\u0C2D\u0C35\u0C39\u0C3D\u0C41\u0C45\u0E1E\u0E32\u0E46\u0E5A\u0E6E"+ - "\u0E82\u0E96\u0EAA\u0EBE\u0ED2\u0EE6\u0EFA\u0F0E\u0C46\uA5A5\004\000\u085D"+ - "\u0875\u0D49\u0D4D\u0F79\u0F85\u0F91\u0889\u0FA9\u08B9\u0981\u09B1\u09AD"+ - "\u0985\u0AF5\u08D9\u0979\u1015\u1021\u102D\u1039\u1045\u1051\u105D\u1069"+ - "\u10F5\u10F9\u08F1\u10FD\u1101\u1105\u1109\u110D\u10D5\u1111\u1115\u0D51"+ - "\u0D55\u0D59\u1119\u111D\u1121\u1125\u108D\u1099\u10A5\u10B1\u10BD\u1129"+ - "\uA5A5\017\000\u112E\u1136\u113E\u1146\u114E\u1156\u115E\u1166\u116E\u1177"+ - "\u1183\u118F\uA5A5\004\000\u1199\u119D\u11A1\u11A5\u11A9\u11AD\u11B1\u11B5"+ - "\u11B9\u11BD\u11C1\u11C5\u11C9\u11CD\u11D1\u11D5\u11D9\u11DD\u11E1\u11E5"+ - "\u11E9\u11ED\u11F1\u11F5\u11F9\u11FD\u1201\u1205\u1209\u120D\u1211\u1215"+ - "\u1219\u121D\u1221\u1225\u1229\u122D\u1231\u1235\u1239\u123D\u1241\u1245"+ - "\u1249\u124D\u1251\000\u1254\u126C\u1280\u129B\u12A4\u12BF\u12CB\u12D4"+ - "\u12F0\u1307\u1313\u131F\u1328\u133C\u1350\u1364\u1378\u138C\u13A0\u13B4"+ - "\u13D2\u13D8\u13F4\u1410\u13E0\u1428\u1444\u1460\u1477\u1483\u148C\u14A0"+ - "\u14B4\u14CC\u14E7\u14F3\u14FC\u1513\u151F\u143A\u152A\u1533\u153F\u1548"+ - "\u1564\u1578\u1590\u15AC\u15C3\u15CF\u15D8\u15F4\u1608\u1627\u1630\u164B"+ - "\u1654\u166B\u1674\u1688\u16A0\u16B4\u16CC\u16E2\u16E8\u1703\u170F\u1718"+ - "\u172F\u173B\u1747\u1750\u1768\u177E\u1784\u17A3\u17AC\u13FC\u17C4\u17DB"+ - "\u17E7\u17F0\u1806\u180C\u1820\u183A\u1840\u141B\u185E\u1866\u186E\u1876"+ - "\u187E\u1886\u188E\u1896\u189E\u18A6\u18AF\u18BB\u18C7\u18D3\u18DF\u18EB"+ - "\u18F7\u1903\u190F\u191B\u1927\u1933\u193F\u194B\u1957\u1963\u196E\u1976"+ - "\u197F\u198A\u1992\uA5A5\004\000\u199A\u19A2\u19AA\u19B2\u19B8\u19CE\u19D6"+ - "\u19DE\u19E6\u19EE\u19F6\u02FE\u19FE\u1A07\u1A10\u1A26\u1A2E\u1A36\u1A3E"+ - "\u1A46\u1A4E\u1A56\u1A5F\u1A6B\u1A77\u1A83\u1A8E\u1A96\u1A9E\u1AA6\u1AAE"+ - "\u1AB6\u1ABE\u1AC6\u1ACE\u1AD6\u1ADF\u1AEB\u1AE2\u1AF7\u1B03\u1B0F\u1B06"+ - "\u1B1B\u1B27\u1B30\u1966\u1B47\u1B53\u1B5F\u1B6B\u1B74\u1B8C\u1BAA\u008A"+ - "\u1BB2\u1BBA\u1BC2\u1BCA\u1BD2\u1BDA\u1BE2\u1BEA\u1BF2\u1BFA\u1C02\u1C0A"+ - "\u1C12\u1C1A\u1C22\u1C2A\u1C30\u1C46\u1C4E\u1C56\u1C5C\u1C73\u1C7E\u1C86"+ - "\u1C8E\u1C96\u1C9E\u1CA6\u1CAE\u1CB6\u1A92\u1CBE\u1CC7\u1CD2\u1CDA\u1CE3"+ - "\u1CEF\u1CFA\u1D00\u1D17\u1D22\u1D2A\u1D32\u1D3A\000\000\u1D42\u1D4A\u1D52"+ - "\u1D5A\u1D62\u1D6A\u1D72\u1D7A\u1D82\u1D8B\u1D97\u1DA3\u1DAF\u1DBB\u1DC7"+ - "\u1DD3\u1DDF\u1DEB\u1DF7\u1E03\u1E0F\u1E1B\u1E27\u1E33\u1E3F\u1E4B\u1E57"+ - "\u1E63\u1E6F\u1E7B\u1E87\000\u4F61\u4F65\u4F69\u4F6D\u4F71\u4F75\u4F79"+ - "\u4F7D\u4F81\u4F85\u4F89\u4F8D\u4F91\u4F95\u4F99\u4F9D\u4FA1\u4FA5\u4FA9"+ - "\u4FAD\u4FB1\u4FB5\u4FB9\u4FBD\u4FC1\u4FC5\u4FC9\u4FCD\u4FD1\u4FD5\u4FD9"+ - "\u4FDD\u4FE1\u4FE5\u4FE9\u4FED\u4FF1\u4FF5\u4FF9\u4FFD\u5001\u5005\u5009"+ - "\u500D\u5011\u5015\u5019\u501D\u5021\u5025\u5029\u502D\u5031\u5035\u5039"+ - "\u503D\u5041\u5045\u5049\u504D\u5051\u5055\u5059\u505D\u5061\u5065\u5069"+ - "\u506D\u5071\u5075\u5079\u507D\u5081\u5085\u5089\u508D\u5091\u5095\u5099"+ - "\u509D\u50A1\u50A5\u50A9\u50AD\u50B1\u50B5\u50B9\u50BD\u50C1\u50C5\u50C9"+ - "\u50CD\u50D1\u50D5\u50D9\u50DD\u50E1\u50E5\u50E9\u50ED\u50F1\u50F5\u50F9"+ - "\u50FD\u5101\u5105\u5109\u510D\u5111\u5115\u5119\u511D\u5121\u5125\u5129"+ - "\u512D\u5131\u5135\u5139\u513D\u5141\u5145\u5149\u514D\u5151\u5155\u5159"+ - "\u515D\u5161\u5165\u5169\u516D\u5171\u5175\u5179\u517D\u5181\u5185\u5189"+ - "\u518D\u5191\u5195\u5199\u519D\u51A1\u51A5\u51A9\u51AD\u51B1\u51B5\u51B9"+ - "\u51BD\u51C1\u51C5\u51C9\u51CD\u51D1\u51D5\u51D9\u51DD\u51E1\u51E5\u51E9"+ - "\u51ED\u51F1\u51F5\u51F9\u51FD\u5201\u5205\u5209\u520D\u5211\u5215\u5219"+ - "\u521D\u5221\u5225\u5229\u522D\u5231\u5235\u5239\u523D\u5241\u5245\u5249"+ - "\u524D\u5251\u5255\u5259\u525D\u5261\u5265\u5269\u526D\u5271\u5275\u5279"+ - "\u527D\u5281\u5285\u5289\u528D\u5291\u5295\u5299\u529D\u52A1\u52A5\u52A9"+ - "\u52AD\u52B1\u52B5\u52B9\u52BD\u52C1\u52C5\u52C9\u52CD\u52D1\u52D5\u52D9"+ - "\u52DD\u52E1\u52E5\u52E9\u52ED\u52F1\u52F5\u52F9\u52FD\u5301\u5305\u5309"+ - "\u530D\u5311\u5315\u5319\u531D\u5321\u5325\u5329\u532D\u5331\u5335\u5339"+ - "\u533D\u5341\u5345\u5349\u534D\u5351\u5355\u5359\u535D\u5361\u5365\u5369"+ - "\u536D\u5371\u5375\u5379\u537D\u5381\u5385\u5389\u538D\u5391\u5395\000"+ - "\000\u5399\000\u539D\000\000\u53A1\u53A5\u53A9\u53AD\u53B1\u53B5\u53B9"+ - "\u53BD\u53C1\u53C5\000\u53C9\000\u53CD\000\000\u53D1\u53D5\000\000\000"+ - "\u53D9\u53DD\u53E1\u53E5\uA5A5\022\000\u1E92\u1E9A\u1EA2\u1E97\u1EAB\u1EB6"+ - "\u1EB6\uA5A5\014\000\u1EBE\u1EC6\u1ECE\u1ED6\u1EDE\uA5A5\005\000\u53EA"+ - "\000\u53F2\u1EE5\u0309\u0315\u1EE9\u1EED\u1EF1\u1EF5\u1EF9\u1EFD\u0265"+ - "\u53FA\u5402\u540B\u5417\u5422\u542A\u5432\u543A\u5442\u544A\u5452\u545A"+ - "\u5462\000\u546A\u5472\u547A\u5482\u548A\000\u5492\000\u549A\u54A2\000"+ - "\u54AA\u54B2\000\u54BA\u54C2\u54CA\u54D2\u54DA\u54E2\u54EA\u54F2\u54FA"+ - "\u1F02\u1F09\u1F09\uA5A5\004\u1F0D\uA5A5\004\u1F11\uA5A5\004\u1F15\uA5A5"+ - "\004\u1F19\uA5A5\004\u1F1D\uA5A5\004\u1F21\uA5A5\004\u1F25\uA5A5\004\u1F29"+ - "\uA5A5\004\u1F2D\uA5A5\004\u1F31\uA5A5\004\u1F35\uA5A5\004\u1F39\u1F3D"+ - "\u1F3D\u1F41\u1F41\u1F45\u1F45\u1F49\u1F49\u1F4D\u1F4D\u1F51\u1F51\uA5A5"+ - "\004\u1F55\uA5A5\004\u1F59\uA5A5\004\u1F5D\uA5A5\004\u1F61\u1F65\u1F65"+ - "\uA5A5\004\u1F69\u1F6E\u1F6E\uA5A5\004\u1F75\uA5A5\004\u1F79\u1F7D\u1F7D"+ - "\u1F82\u1F82\uA5A5!\000\uA5A5\004\u1F89\u0181\u0181\u1F8D\u1F8D\u1F91"+ - "\u1F91\u0182\u1F95\u1F95\u1F99\u1F99\u1F9D\u1F9D\uA5A5\004\u1FA1\u1FA5"+ - "\u1FA5\u1FAB\u1FAB\u1FB7\u1FB7\u1FC3\u1FC3\u1FCF\u1FCF\u1FDB\u1FDB\u1FE7"+ - "\u1FE7\u1FF3\u1FF3\u1FF3\u1FFF\u1FFF\u1FFF\uA5A5\004\u2009\u200F\u201B"+ - "\u2027\u1FFF\u2033\u203E\u2046\u204E\u2056\u205E\u2066\u206E\u2076\u207E"+ - "\u2086\u208E\u2096\u209E\u20A6\u20AE\u20B6\u20BE\u20C6\u20C2\u20CE\u20D6"+ - "\u20DE\u20E6\u20EE\u20F6\u20FE\u2106\u210E\u2116\u211E\u2126\u212E\u2136"+ - "\u213E\u2146\u214E\u2156\u215E\u2166\u216E\u2176\u217E\u2186\u218E\u2196"+ - "\u219E\u21A6\u21AE\u21B6\u21BE\u21C6\u21CE\u21D6\u21DE\u21E6\u21EE\u21F6"+ - "\u21FE\u2206\u220E\u2216\u221E\u2226\u222E\u2236\u20CA\u20D2\u223E\u2246"+ - "\u202E\u224E\u2256\u225E\u2266\u226E\u2276\u227E\u2286\u228E\u2296\u20BA"+ - "\u229E\u22A6\u2232\u22AE\u229A\u22B6\u22BE\u22C6\u22CF\u22DB\u22E7\u22F3"+ - "\u22FF\u230B\u2317\u2323\u2027\u232F\u1FFF\u2033\u233A\u2342\u2056\u234A"+ - "\u205E\u2066\u2352\u235A\u2086\u2362\u208E\u2096\u236A\u2372\u20A6\u237A"+ - "\u20AE\u20B6\u2196\u219E\u21B6\u21BE\u21C6\u21E6\u21EE\u21F6\u21FE\u221E"+ - "\u2226\u222E\u2382\u223E\u238A\u2392\u2266\u239A\u226E\u2276\u22C6\u23A2"+ - "\u23AA\u2232\u23B2\u22AE\u229A\u200F\u201B\u23BB\u2027\u23C7\u203E\u2046"+ - "\u204E\u2056\u23D2\u206E\u2076\u207E\u2086\u23DA\u20A6\u20BE\u20C6\u20C2"+ - "\u20CE\u20D6\u20E6\u20EE\u20F6\u20FE\u2106\u210E\u23E2\u2116\u211E\u2126"+ - "\u212E\u2136\u213E\u214E\u2156\u215E\u2166\u216E\u2176\u217E\u2186\u218E"+ - "\u21A6\u21AE\u21CE\u21D6\u21DE\u21E6\u21EE\u2206\u220E\u2216\u221E\u23EA"+ - "\u2236\u20CA\u20D2\u223E\u224E\u2256\u225E\u2266\u23F2\u227E\u2286\u23FA"+ - "\u20BA\u229E\u22A6\u2232\u227A\u2027\u23C7\u2056\u23D2\u2086\u23DA\u20A6"+ - "\u2402\u2106\u240A\u2412\u241A\u21E6\u21EE\u221E\u2266\u23F2\u2232\u227A"+ - "\u2423\u242F\u243B\u2446\u244E\u2456\u245E\u2466\u246E\u2476\u247E\u2486"+ - "\u248E\u2496\u2022\u249E\u2016\u24A6\u22AA\u24AE\u24B6\u24BE\u24C6\u24CE"+ - "\u24D6\u24DE\u2412\u24E6\u24EE\u24F6\u24FE\u2446\u244E\u2456\u245E\u2466"+ - "\u246E\u2476\u247E\u2486\u248E\u2496\u2022\u249E\u2016\u24A6\u22AA\u24AE"+ - "\u24B6\u24BE\u24C6\u24CE\u24D6\u24DE\u2412\u24E6\u24EE\u24F6\u24FE\u24CE"+ - "\u24D6\u24DE\u2412\u240A\u241A\u2146\u20EE\u20F6\u20FE\u24CE\u24D6\u24DE"+ - "\u2146\u214E\u2506\u2506\uA5A5\022\000\u250F\u251B\u251B\u2527\u2533\u253F"+ - "\u254B\u2557\u20C7\u20C7\u2563\u256F\u257B\u2587\u2593\u259F\u259F\u25AB"+ - "\u25B7\u25B7\u25C3\u25C3\u25CF\u25DB\u25DB\u25E7\u25F3\u25F3\u25FF\u25FF"+ - "\u260B\u2617\u2617\u2623\u2623\u262F\u263B\u2647\u2653\u2653\u265F\u266B"+ - "\u2677\u2683\u268F\u268F\u269B\u26A7\u26B3\u26BF\u26CB\u26D7\u26D7\u26E3"+ - "\u26E3\u26EF\u26EF\u26FB\u20CB\u2707\u2713\u2237\u20D3\u271F\000\000\u272B"+ - "\u2737\u2743\u274F\u275B\u2767\u2767\u2773\u277F\u278B\u2797\u2797\u27A3"+ - "\u27AF\u27BB\u27C7\u27D3\u27DF\u27EB\u27F7\u2803\u280F\u281B\u2827\u2833"+ - "\u283F\u284B\u2857\u229F\u2863\u286F\u287B\u2887\u2893\u269B\u26B3\u289F"+ - "\u28AB\u28B7\u28C3\u28CF\u28DB\u28CF\u28B7\u28E7\u28F3\u28FF\u290B\u2917"+ - "\u28DB\u2647\u25CF\u2923\u292F\uA5A5(\000\u293B\u2947\u2950\u2964\u2978"+ - "\u298C\u29A0\u29B4\u29C8\u29DF\u29E8\u2A34\uA5A5\024\000\u01FA\u2A59\u2A5D"+ - "\u2A61\u2A61\u0271\u0275\u2A65\u2A69\u2A6D\u2A71\u2A75\u2A79\u2A7D\u2A81"+ - "\u2A85\u2A89\u2A8D\u2A91\u2A95\u2A99\uA5A5\004\000\uA5A5\004\u0236\u2A61"+ - "\u2A61\u2A61\u2A9D\u2AA1\u01F9\000\u2AA5\u2AA9\u023D\u022D\u2A59\u0271"+ - "\u0275\u2A65\u2A69\u2A6D\u2A71\u2AAD\u2AB1\u2AB5\u0265\u2AB9\u2ABD\u2AC1"+ - "\u026D\000\u2AC5\u2AC9\u2ACD\u2AD1\uA5A5\004\000\u2AD6\u2ADE\u22CE\000"+ - "\u22DA\000\u22E6\u2422\u22F2\u242E\u22FE\u243A\u230A\u2AE6\u2AEE\u2AF6"+ - "\u2AFD\u2B02\u2B02\u2B0A\u2B0A\u2B12\u2B12\u2B1A\u2B1A\uA5A5\004\u1FAA"+ - "\u0171\u0171\uA5A5\004\u203D\u2B21\u2B21\uA5A5\004\u206D\uA5A5\004\u209D"+ - "\uA5A5\004\u2015\uA5A5\004\u2021\uA5A5\004\u2051\u2985\u2985\u22B5\u22B5"+ - "\u22BD\u22BD\u2329\u2329\uA5A5\004\u20ED\uA5A5\004\u2411\uA5A5\004\u210D"+ - "\uA5A5\004\u211D\uA5A5\004\u213D\uA5A5\004\u214D\uA5A5\004\u2155\uA5A5"+ - "\004\u2165\uA5A5\004\u2175\uA5A5\004\u21A5\uA5A5\004\u21C5\uA5A5\004\u21E9"+ - "\uA5A5\004\u202D\uA5A5\004\u224D\uA5A5\004\u227D\u0179\u0179\u1FA5\u1FA5"+ - "\uA5A5\004\u0189\u2B27\u2B27\u2B33\u2B33\u2B3F\u2B3F\u2A46\u2A46\uA5A5"+ - "\004\000\u022D\u2B49\u2AAD\u2AC9\u2ACD\u2AB1\u2B4D\u0271\u0275\u2AB5\u0265"+ - "\u2A9D\u2AB9\u01F9\u0285\u024D9\035!I\u0251\u0255\u0259\u025D\u0261\u2AA9"+ - "\u2AA5\u2ABD\u026D\u2AC1\u023D\u2AD1\u0839\u0301\u0299\u0091\u02F1\u02C5"+ - "\u083D\u02CDei\u0841u\u02E9\u00CD\u0845\u02DD\u02E1\u0279\u02E5\u02ED"+ - "\u0849\u03C1\u084D\u03F1\u0851\u0095\u2B51\u2AC5\u2B55\u2B59\u2A61\u2B5D"+ - "\021\u0711\u0289\u00A9\u0305\u0741\u02C9\u00E5mq\u077D}\u0469\u0089=\u07B9"+ - "\u07C5\u00ED\u008D\u07E9\u02B9\u0421\u00FD\u0139\u0101\u00A1\u2A65\u2B61"+ - "\u2A69\u2B65\000\000\u2B69\u2A8D\u2A91\u2AA1\u2B6D\u1251\u1279\u15F9\u2B71"+ - "\u1619\u12CD\u2B75\u13A5\u175D\u1331\u1261\u1199\u119D\u11A1\u11A5\u11A9"+ - "\u11AD\u11B1\u11B5\u11B9\u11BD\u11C1\u11C5\u11C9\u11CD\u11D1\u11D5\u11D9"+ - "\u11DD\u11E1\u11E5\u11E9\u11ED\u11F1\u11F5\u11F9\u11FD\u1201\u1205\u1209"+ - "\u120D\u1211\u1215\u1219\u121D\u1221\u1225\u1229\u122D\u1231\u1235\u1239"+ - "\u123D\u1241\u1245\u1285\u0BC5\u0BCD\u0C9D\u0BD1\u0BD5\u0BD9\u0BDD\u0BE1"+ - "\u0BE5\u0BE9\u0BED\u0BF1\u0BF5\u0BF9\u0BFD\u0C01\u0C05\u0C09\u0C0D\u0C11"+ - "\u0C15\u0C19\u0C1D\u0C21\u0C25\u0C29\u0C2D\u0C31\u0C35\u0C39\u0C3D\u0C41"+ - "\u0C45\000\000\000\u0C49\u0C4D\u0C51\u0C55\u0C59\u0C5D\000\000\u0C61\u0C65"+ - "\u0C69\u0C6D\u0C71\u0C75\000\000\u0C79\u0C7D\u0C81\u0C85\u0C89\u0C8D\000"+ - "\000\u0C91\u0C95\u0C99\000\000\000\u2B79\u2B7D\u2B81\026\u2B85\u2B89\u2B8D"+ - "\000\u2B91\u2B95\u2B99\u2B9D\u2BA1\u2BA5\u2BA9\uA5A5\021\000" - ); - - static final String contents = - "\uFFFF \u0308a \u030423 \u0301\u03BC \u03271o1\u204441\u204423\u2044"+ - "4IJijL\u00B7l\u00B7\u02BCnsDZ\u030CDz\u030Cdz\u030CLJLjljNJNjnjh\u0266"+ - "r\u0279\u027B\u0281wy \u0306 \u0307 \u030A \u0328 \u0303 \u030B\u0263"+ - "x\u0295 \u0345\u03B2\u03B8\u03A5\u03C6\u03C0\u03BA\u03C1\u03C2\u0565\u0582"+ - "\u0627\u0674\u0648\u0674\u06C7\u0674\u064A\u0674\u0E4D\u0E32\u0ECD\u0EB2"+ - "\u0EAB\u0E99\u0EAB\u0EA1\u0F0B\u0FB2\u0F71\u0F80\u0FB3\u0F71\u0F80a\u02BE"+ - " \u0313 \u0342 \u0314\u2010 \u0333...\u2032\u2032\u2032\u2032\u2032\u2035"+ - "\u2035\u2035\u2035\u2035!! \u0305?!!?056789+\u2212=()Rsa/ca/sC\u00B0C"+ - "c/oc/u\u0190\u00B0FgH\u0127NoPQSMTELTMBe\u05D0\u05D1\u05D2\u05D31\u2044"+ - "32\u204431\u204452\u204453\u204454\u204451\u204465\u204461\u204483\u2044"+ - "85\u204487\u20448IIIIIIVVIVIIVIII\000IXXIXIIiiiiiivviviiviii\000ixxix"+ - "iim\u222B\u222B\u222B\u222B\u222B\u222E\u222E\u222E\u222E\u222E101112"+ - "1314151617181920(1)(2)(3)(4)(5)(6)(7)(8)(9)(10)\000(11)\000(12)\000(1"+ - "3)\000(14)\000(15)\000(16)\000(17)\000(18)\000(19)\000(20)\0001.2.3.4"+ - ".5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.(a)(b)(c)(d)(e)(f)(g)(h)("+ - "i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)(y)(z)AGKOUWY\u6BCD\u9F9F"+ - "\u4E00\u4E28\u4E36\u4E3F\u4E59\u4E85\u4E8C\u4EA0\u4EBA\u513F\u5165\u516B"+ - "\u5182\u5196\u51AB\u51E0\u51F5\u5200\u529B\u52F9\u5315\u531A\u5338\u5341"+ - "\u535C\u5369\u5382\u53B6\u53C8\u53E3\u56D7\u571F\u58EB\u5902\u590A\u5915"+ - "\u5927\u5973\u5B50\u5B80\u5BF8\u5C0F\u5C22\u5C38\u5C6E\u5C71\u5DDB\u5DE5"+ - "\u5DF1\u5DFE\u5E72\u5E7A\u5E7F\u5EF4\u5EFE\u5F0B\u5F13\u5F50\u5F61\u5F73"+ - "\u5FC3\u6208\u6236\u624B\u652F\u6534\u6587\u6597\u65A4\u65B9\u65E0\u65E5"+ - "\u66F0\u6708\u6728\u6B20\u6B62\u6B79\u6BB3\u6BCB\u6BD4\u6BDB\u6C0F\u6C14"+ - "\u6C34\u706B\u722A\u7236\u723B\u723F\u7247\u7259\u725B\u72AC\u7384\u7389"+ - "\u74DC\u74E6\u7518\u751F\u7528\u7530\u758B\u7592\u7676\u767D\u76AE\u76BF"+ - "\u76EE\u77DB\u77E2\u77F3\u793A\u79B8\u79BE\u7A74\u7ACB\u7AF9\u7C73\u7CF8"+ - "\u7F36\u7F51\u7F8A\u7FBD\u8001\u800C\u8012\u8033\u807F\u8089\u81E3\u81EA"+ - "\u81F3\u81FC\u820C\u821B\u821F\u826E\u8272\u8278\u864D\u866B\u8840\u884C"+ - "\u8863\u897E\u898B\u89D2\u8A00\u8C37\u8C46\u8C55\u8C78\u8C9D\u8D64\u8D70"+ - "\u8DB3\u8EAB\u8ECA\u8F9B\u8FB0\u8FB5\u9091\u9149\u91C6\u91CC\u91D1\u9577"+ - "\u9580\u961C\u96B6\u96B9\u96E8\u9751\u975E\u9762\u9769\u97CB\u97ED\u97F3"+ - "\u9801\u98A8\u98DB\u98DF\u9996\u9999\u99AC\u9AA8\u9AD8\u9ADF\u9B25\u9B2F"+ - "\u9B32\u9B3C\u9B5A\u9CE5\u9E75\u9E7F\u9EA5\u9EBB\u9EC3\u9ECD\u9ED1\u9EF9"+ - "\u9EFD\u9F0E\u9F13\u9F20\u9F3B\u9F4A\u9F52\u9F8D\u9F9C\u9FA0\u3012\u5344"+ - "\u5345 \u3099 \u309A\u1100\u1101\u11AA\u1102\u11AC\u11AD\u1103\u1104\u1105"+ - "\u11B0\u11B1\u11B2\u11B3\u11B4\u11B5\u111A\u1106\u1107\u1108\u1121\u1109"+ - "\u110A\u110B\u110C\u110D\u110E\u110F\u1110\u1111\u1112\u1161\u1162\u1163"+ - "\u1164\u1165\u1166\u1167\u1168\u1169\u116A\u116B\u116C\u116D\u116E\u116F"+ - "\u1170\u1171\u1172\u1173\u1174\u1175\u1160\u1114\u1115\u11C7\u11C8\u11CC"+ - "\u11CE\u11D3\u11D7\u11D9\u111C\u11DD\u11DF\u111D\u111E\u1120\u1122\u1123"+ - "\u1127\u1129\u112B\u112C\u112D\u112E\u112F\u1132\u1136\u1140\u1147\u114C"+ - "\u11F1\u11F2\u1157\u1158\u1159\u1184\u1185\u1188\u1191\u1192\u1194\u119E"+ - "\u11A1\u4E09\u56DB\u4E0A\u4E2D\u4E0B\u7532\u4E19\u4E01\u5929\u5730(\u1100"+ - ")(\u1102)(\u1103)(\u1105)(\u1106)(\u1107)(\u1109)(\u110B)(\u110C)(\u110E"+ - ")(\u110F)(\u1110)(\u1111)(\u1112)(\u1100\u1161)\000(\u1102\u1161)\000"+ - "(\u1103\u1161)\000(\u1105\u1161)\000(\u1106\u1161)\000(\u1107\u1161)\000"+ - "(\u1109\u1161)\000(\u110B\u1161)\000(\u110C\u1161)\000(\u110E\u1161)\000"+ - "(\u110F\u1161)\000(\u1110\u1161)\000(\u1111\u1161)\000(\u1112\u1161)\000"+ - "(\u110C\u116E)\000(\u4E00)(\u4E8C)(\u4E09)(\u56DB)(\u4E94)(\u516D)(\u4E03"+ - ")(\u516B)(\u4E5D)(\u5341)(\u6708)(\u706B)(\u6C34)(\u6728)(\u91D1)(\u571F"+ - ")(\u65E5)(\u682A)(\u6709)(\u793E)(\u540D)(\u7279)(\u8CA1)(\u795D)(\u52B4"+ - ")(\u4EE3)(\u547C)(\u5B66)(\u76E3)(\u4F01)(\u8CC7)(\u5354)(\u796D)(\u4F11"+ - ")(\u81EA)(\u81F3)\u79D8\u7537\u9069\u512A\u5370\u6CE8\u9805\u5199\u6B63"+ - "\u5DE6\u53F3\u533B\u5B97\u591C1\u67082\u67083\u67084\u67085\u67086\u6708"+ - "7\u67088\u67089\u670810\u670811\u670812\u6708\u30A2\u30A4\u30A6\u30A8"+ - "\u30AA\u30AB\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB\u30BD\u30BF"+ - "\u30C1\u30C4\u30C6\u30C8\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D2\u30D5"+ - "\u30D8\u30DB\u30DE\u30DF\u30E0\u30E1\u30E2\u30E4\u30E6\u30E8\u30E9\u30EA"+ - "\u30EB\u30EC\u30ED\u30EF\u30F0\u30F1\u30F2\u30A2\u30CF\u309A\u30FC\u30C8"+ - "\000\u30A2\u30EB\u30D5\u30A1\000\u30A2\u30F3\u30D8\u309A\u30A2\000\u30A2"+ - "\u30FC\u30EB\u30A4\u30CB\u30F3\u30AF\u3099\000\u30A4\u30F3\u30C1\u30A6"+ - "\u30A9\u30F3\u30A8\u30B9\u30AF\u30FC\u30C8\u3099\000\u30A8\u30FC\u30AB"+ - "\u30FC\000\u30AA\u30F3\u30B9\u30AA\u30FC\u30E0\u30AB\u30A4\u30EA\u30AB"+ - "\u30E9\u30C3\u30C8\000\u30AB\u30ED\u30EA\u30FC\000\u30AB\u3099\u30ED\u30F3"+ - "\000\u30AB\u3099\u30F3\u30DE\000\u30AD\u3099\u30AB\u3099\000\u30AD\u3099"+ - "\u30CB\u30FC\000\u30AD\u30E5\u30EA\u30FC\000\u30AD\u3099\u30EB\u30BF\u3099"+ - "\u30FC\000\u30AD\u30ED\u30AD\u30ED\u30AF\u3099\u30E9\u30E0\000\u30AD\u30ED"+ - "\u30E1\u30FC\u30C8\u30EB\000\u30AD\u30ED\u30EF\u30C3\u30C8\000\u30AF\u3099"+ - "\u30E9\u30E0\u30C8\u30F3\000\u30AF\u30EB\u30BB\u3099\u30A4\u30ED\000\u30AF"+ - "\u30ED\u30FC\u30CD\000\u30B1\u30FC\u30B9\u30B3\u30EB\u30CA\u30B3\u30FC"+ - "\u30DB\u309A\000\u30B5\u30A4\u30AF\u30EB\000\u30B5\u30F3\u30C1\u30FC\u30E0"+ - "\000\u30B7\u30EA\u30F3\u30AF\u3099\000\u30BB\u30F3\u30C1\u30BB\u30F3\u30C8"+ - "\u30BF\u3099\u30FC\u30B9\000\u30C6\u3099\u30B7\u30C8\u3099\u30EB\u30CA"+ - "\u30CE\u30CE\u30C3\u30C8\u30CF\u30A4\u30C4\u30CF\u309A\u30FC\u30BB\u30F3"+ - "\u30C8\000\u30CF\u309A\u30FC\u30C4\000\u30CF\u3099\u30FC\u30EC\u30EB\000"+ - "\u30D2\u309A\u30A2\u30B9\u30C8\u30EB\000\u30D2\u309A\u30AF\u30EB\000\u30D2"+ - "\u309A\u30B3\u30D2\u3099\u30EB\u30D5\u30A1\u30E9\u30C3\u30C8\u3099\000"+ - "\u30D5\u30A3\u30FC\u30C8\000\u30D5\u3099\u30C3\u30B7\u30A7\u30EB\000\u30D5"+ - "\u30E9\u30F3\u30D8\u30AF\u30BF\u30FC\u30EB\000\u30D8\u309A\u30BD\u30D8"+ - "\u309A\u30CB\u30D2\000\u30D8\u30EB\u30C4\u30D8\u309A\u30F3\u30B9\000\u30D8"+ - "\u309A\u30FC\u30B7\u3099\000\u30D8\u3099\u30FC\u30BF\000\u30DB\u309A\u30A4"+ - "\u30F3\u30C8\000\u30DB\u3099\u30EB\u30C8\000\u30DB\u30F3\u30DB\u309A\u30F3"+ - "\u30C8\u3099\000\u30DB\u30FC\u30EB\u30DB\u30FC\u30F3\u30DE\u30A4\u30AF"+ - "\u30ED\000\u30DE\u30A4\u30EB\u30DE\u30C3\u30CF\u30DE\u30EB\u30AF\u30DE"+ - "\u30F3\u30B7\u30E7\u30F3\000\u30DF\u30AF\u30ED\u30F3\000\u30DF\u30EA\u30DF"+ - "\u30EA\u30CF\u3099\u30FC\u30EB\000\u30E1\u30AB\u3099\u30E1\u30AB\u3099"+ - "\u30C8\u30F3\000\u30E4\u30FC\u30C8\u3099\000\u30E4\u30FC\u30EB\u30E6\u30A2"+ - "\u30F3\u30EA\u30C3\u30C8\u30EB\000\u30EA\u30E9\u30EB\u30D2\u309A\u30FC"+ - "\000\u30EB\u30FC\u30D5\u3099\u30EB\000\u30EC\u30E0\u30EC\u30F3\u30C8\u30B1"+ - "\u3099\u30F3\0000\u70B91\u70B92\u70B93\u70B94\u70B95\u70B96\u70B97\u70B9"+ - "8\u70B99\u70B910\u70B911\u70B912\u70B913\u70B914\u70B915\u70B916\u70B9"+ - "17\u70B918\u70B919\u70B920\u70B921\u70B922\u70B923\u70B924\u70B9hPada"+ - "AUbaroVpc\u5E73\u6210\u662D\u548C\u5927\u6B63\u660E\u6CBB\u682A\u5F0F"+ - "\u4F1A\u793E\000pAnA\u03BCAmAkAKBGBcalkcal\000pFnF\u03BCF\u03BCgmgkgH"+ - "zkHzMHzGHzTHz\u03BClmldlklfmnm\u03BCmmmcmkmmm2cm2km2mm3cm3km3m\u2215s"+ - "m\u2215s2\000kPaMPaGParadrad\u2215s\000rad\u2215s2\000ps\u03BCsmspVnV"+ - "\u03BCVmVkVMVpWnW\u03BCWmWkWMWk\u03A9M\u03A9a.m.\000BqcccdC\u2215kg\000"+ - "Co.dBGyhaHPinKKKMktlnloglxmbmilmolPHp.m.\000PPMPRsrSvWb1\u65E52\u65E5"+ - "3\u65E54\u65E55\u65E56\u65E57\u65E58\u65E59\u65E510\u65E511\u65E512\u65E5"+ - "13\u65E514\u65E515\u65E516\u65E517\u65E518\u65E519\u65E520\u65E521\u65E5"+ - "22\u65E523\u65E524\u65E525\u65E526\u65E527\u65E528\u65E529\u65E530\u65E5"+ - "31\u65E5fffiflfflst\u0574\u0576\u0574\u0565\u0574\u056B\u057E\u0576\u0574"+ - "\u056D\u05E2\u05D4\u05DB\u05DC\u05DD\u05E8\u05EA\u05D0\u05DC\u0671\u067B"+ - "\u067E\u0680\u067A\u067F\u0679\u06A4\u06A6\u0684\u0683\u0686\u0687\u068D"+ - "\u068C\u068E\u0688\u0698\u0691\u06A9\u06AF\u06B3\u06B1\u06BA\u06BB\u06D5"+ - "\u0654\u06C1\u06BE\u06D2\u06D2\u0654\u06AD\u06C6\u06C8\u06CB\u06C5\u06C9"+ - "\u06D0\u0649\u064A\u0654\u0627\u064A\u0654\u06D5\u064A\u0654\u0648\u064A"+ - "\u0654\u06C7\u064A\u0654\u06C6\u064A\u0654\u06C8\u064A\u0654\u06D0\u064A"+ - "\u0654\u0649\u06CC\u064A\u0654\u062C\u064A\u0654\u062D\u064A\u0654\u0645"+ - "\u064A\u0654\u064A\u0628\u062C\u0628\u062D\u0628\u062E\u0628\u0645\u0628"+ - "\u0649\u0628\u064A\u062A\u062C\u062A\u062D\u062A\u062E\u062A\u0645\u062A"+ - "\u0649\u062A\u064A\u062B\u062C\u062B\u0645\u062B\u0649\u062B\u064A\u062C"+ - "\u062D\u062C\u0645\u062D\u0645\u062E\u062C\u062E\u062D\u062E\u0645\u0633"+ - "\u062C\u0633\u062D\u0633\u062E\u0633\u0645\u0635\u062D\u0635\u0645\u0636"+ - "\u062C\u0636\u062D\u0636\u062E\u0636\u0645\u0637\u062D\u0637\u0645\u0638"+ - "\u0645\u0639\u062C\u0639\u0645\u063A\u062C\u063A\u0645\u0641\u062C\u0641"+ - "\u062D\u0641\u062E\u0641\u0645\u0641\u0649\u0641\u064A\u0642\u062D\u0642"+ - "\u0645\u0642\u0649\u0642\u064A\u0643\u0627\u0643\u062C\u0643\u062D\u0643"+ - "\u062E\u0643\u0644\u0643\u0645\u0643\u0649\u0643\u064A\u0644\u062C\u0644"+ - "\u062D\u0644\u062E\u0644\u0645\u0644\u0649\u0644\u064A\u0645\u062C\u0645"+ - "\u0645\u0645\u0649\u0646\u062C\u0646\u062D\u0646\u062E\u0646\u0645\u0646"+ - "\u0649\u0646\u064A\u0647\u062C\u0647\u0645\u0647\u0649\u0647\u064A\u064A"+ - "\u062D\u064A\u062E\u064A\u0649\u0630\u0670\u0631\u0670\u0649\u0670 \u064C"+ - "\u0651 \u064D\u0651 \u064E\u0651 \u064F\u0651 \u0650\u0651 \u0651\u0670"+ - "\u064A\u0654\u0631\u064A\u0654\u0632\u064A\u0654\u0646\u0628\u0631\u0628"+ - "\u0632\u0628\u0646\u062A\u0631\u062A\u0632\u062A\u0646\u062B\u0631\u062B"+ - "\u0632\u062B\u0646\u0645\u0627\u0646\u0631\u0646\u0632\u0646\u0646\u064A"+ - "\u0631\u064A\u0632\u064A\u0646\u064A\u0654\u062E\u064A\u0654\u0647\u0628"+ - "\u0647\u062A\u0647\u0635\u062E\u0644\u0647\u0646\u0647\u0647\u0670\u062B"+ - "\u0647\u0633\u0647\u0634\u0645\u0634\u0647\u0640\u064E\u0651\u0640\u064F"+ - "\u0651\u0640\u0650\u0651\u0637\u0649\u0637\u064A\u0639\u0649\u0639\u064A"+ - "\u063A\u0649\u063A\u064A\u0633\u0649\u0633\u064A\u0634\u0649\u0634\u064A"+ - "\u062D\u0649\u062C\u0649\u062E\u0649\u0635\u0649\u0635\u064A\u0636\u0649"+ - "\u0636\u064A\u0634\u062C\u0634\u062D\u0634\u062E\u0634\u0631\u0633\u0631"+ - "\u0635\u0631\u0636\u0631\u0627\u064B\u062A\u062C\u0645\u062A\u062D\u062C"+ - "\u062A\u062D\u0645\u062A\u062E\u0645\u062A\u0645\u062C\u062A\u0645\u062D"+ - "\u062A\u0645\u062E\u062D\u0645\u064A\u062D\u0645\u0649\u0633\u062D\u062C"+ - "\u0633\u062C\u062D\u0633\u062C\u0649\u0633\u0645\u062D\u0633\u0645\u062C"+ - "\u0633\u0645\u0645\u0635\u062D\u062D\u0635\u0645\u0645\u0634\u062D\u0645"+ - "\u0634\u062C\u064A\u0634\u0645\u062E\u0634\u0645\u0645\u0636\u062D\u0649"+ - "\u0636\u062E\u0645\u0637\u0645\u062D\u0637\u0645\u0645\u0637\u0645\u064A"+ - "\u0639\u062C\u0645\u0639\u0645\u0645\u0639\u0645\u0649\u063A\u0645\u0645"+ - "\u063A\u0645\u064A\u063A\u0645\u0649\u0641\u062E\u0645\u0642\u0645\u062D"+ - "\u0642\u0645\u0645\u0644\u062D\u0645\u0644\u062D\u064A\u0644\u062D\u0649"+ - "\u0644\u062C\u062C\u0644\u062E\u0645\u0644\u0645\u062D\u0645\u062D\u062C"+ - "\u0645\u062D\u064A\u0645\u062C\u062D\u0645\u062E\u0645\u0645\u062C\u062E"+ - "\u0647\u0645\u062C\u0647\u0645\u0645\u0646\u062D\u0645\u0646\u062D\u0649"+ - "\u0646\u062C\u0645\u0646\u062C\u0649\u0646\u0645\u064A\u0646\u0645\u0649"+ - "\u064A\u0645\u0645\u0628\u062E\u064A\u062A\u062C\u064A\u062A\u062C\u0649"+ - "\u062A\u062E\u064A\u062A\u062E\u0649\u062A\u0645\u064A\u062A\u0645\u0649"+ - "\u062C\u0645\u064A\u062C\u062D\u0649\u062C\u0645\u0649\u0633\u062E\u0649"+ - "\u0635\u062D\u064A\u0634\u062D\u064A\u0636\u062D\u064A\u0644\u062C\u064A"+ - "\u0644\u0645\u064A\u064A\u062C\u064A\u064A\u0645\u064A\u0645\u0645\u064A"+ - "\u0642\u0645\u064A\u0646\u062D\u064A\u0639\u0645\u064A\u0643\u0645\u064A"+ - "\u0646\u062C\u062D\u0645\u062E\u064A\u0644\u062C\u0645\u0643\u0645\u0645"+ - "\u062C\u062D\u064A\u062D\u062C\u064A\u0645\u062C\u064A\u0641\u0645\u064A"+ - "\u0628\u062D\u064A\u0633\u062E\u064A\u0646\u062C\u064A\u0635\u0644\u06D2"+ - "\u0642\u0644\u06D2\u0627\u0644\u0644\u0647\000\u0627\u0643\u0628\u0631"+ - "\000\u0645\u062D\u0645\u062F\000\u0635\u0644\u0639\u0645\000\u0631\u0633"+ - "\u0648\u0644\000\u0639\u0644\u064A\u0647\000\u0648\u0633\u0644\u0645\000"+ - "\u0635\u0644\u0649\u0635\u0644\u0649 \u0627\u0644\u0644\u0647 \u0639\u0644"+ - "\u064A\u0647 \u0648\u0633\u0644\u0645\000\u062C\u0644 \u062C\u0644\u0627"+ - "\u0644\u0647\000\u2014\u2013_{}\u3014\u3015\u3010\u3011\u300A\u300B\u3008"+ - "\u3009\u300C\u300D\u300E\u300F,\u3001;:#&*-<>\134$%@ \u064B\u0640\u064B"+ - "\u0640\u0651 \u0652\u0640\u0652\u0621\u0627\u0653\u0627\u0654\u0648\u0654"+ - "\u0627\u0655\u0629\u0644\u0627\u0653\u0644\u0627\u0654\u0644\u0627\u0655"+ - "\042'[]^`|~\u3002\u30FB\u30A5\u30E3\u00A2\u00A3\u00AC\u00A6\u00A5\u20A9"+ - "\u2502\u2190\u2191\u2192\u2193\u25A0\u25CBA\u0300A\u0301A\u0302A\u0303"+ - "A\u0308A\u030AC\u0327E\u0300E\u0301E\u0302E\u0308I\u0300I\u0301I\u0302"+ - "I\u0308N\u0303O\u0300O\u0301O\u0302O\u0303O\u0308U\u0300U\u0301U\u0302"+ - "U\u0308Y\u0301a\u0300a\u0301a\u0302a\u0303a\u0308a\u030Ac\u0327e\u0300"+ - "e\u0301e\u0302e\u0308i\u0300i\u0301i\u0302i\u0308n\u0303o\u0300o\u0301"+ - "o\u0302o\u0303o\u0308u\u0300u\u0301u\u0302u\u0308y\u0301y\u0308A\u0304"+ - "a\u0304A\u0306a\u0306A\u0328a\u0328C\u0301c\u0301C\u0302c\u0302C\u0307"+ - "c\u0307C\u030Cc\u030CD\u030Cd\u030CE\u0304e\u0304E\u0306e\u0306E\u0307"+ - "e\u0307E\u0328e\u0328E\u030Ce\u030CG\u0302g\u0302G\u0306g\u0306G\u0307"+ - "g\u0307G\u0327g\u0327H\u0302h\u0302I\u0303i\u0303I\u0304i\u0304I\u0306"+ - "i\u0306I\u0328i\u0328I\u0307J\u0302j\u0302K\u0327k\u0327L\u0301l\u0301"+ - "L\u0327l\u0327L\u030Cl\u030CN\u0301n\u0301N\u0327n\u0327N\u030Cn\u030C"+ - "O\u0304o\u0304O\u0306o\u0306O\u030Bo\u030BR\u0301r\u0301R\u0327r\u0327"+ - "R\u030Cr\u030CS\u0301s\u0301S\u0302s\u0302S\u0327s\u0327S\u030Cs\u030C"+ - "T\u0327t\u0327T\u030Ct\u030CU\u0303u\u0303U\u0304u\u0304U\u0306u\u0306"+ - "U\u030Au\u030AU\u030Bu\u030BU\u0328u\u0328W\u0302w\u0302Y\u0302y\u0302"+ - "Y\u0308Z\u0301z\u0301Z\u0307z\u0307Z\u030Cz\u030CO\u031Bo\u031BU\u031B"+ - "u\u031BA\u030Ca\u030CI\u030Ci\u030CO\u030Co\u030CU\u030Cu\u030CU\u0308"+ - "\u0304u\u0308\u0304U\u0308\u0301u\u0308\u0301U\u0308\u030Cu\u0308\u030C"+ - "U\u0308\u0300u\u0308\u0300A\u0308\u0304a\u0308\u0304A\u0307\u0304a\u0307"+ - "\u0304\u00C6\u0304\u00E6\u0304G\u030Cg\u030CK\u030Ck\u030CO\u0328o\u0328"+ - "O\u0328\u0304o\u0328\u0304\u01B7\u030C\u0292\u030Cj\u030CG\u0301g\u0301"+ - "N\u0300n\u0300A\u030A\u0301a\u030A\u0301\u00C6\u0301\u00E6\u0301\u00D8"+ - "\u0301\u00F8\u0301A\u030Fa\u030FA\u0311a\u0311E\u030Fe\u030FE\u0311e\u0311"+ - "I\u030Fi\u030FI\u0311i\u0311O\u030Fo\u030FO\u0311o\u0311R\u030Fr\u030F"+ - "R\u0311r\u0311U\u030Fu\u030FU\u0311u\u0311S\u0326s\u0326T\u0326t\u0326"+ - "H\u030Ch\u030CA\u0307a\u0307E\u0327e\u0327O\u0308\u0304o\u0308\u0304O"+ - "\u0303\u0304o\u0303\u0304O\u0307o\u0307O\u0307\u0304o\u0307\u0304Y\u0304"+ - "y\u0304\u0300\u0301\u0313\u0308\u0301\u02B9;\u00A8\u0301\u0391\u0301\u00B7"+ - "\u0395\u0301\u0397\u0301\u0399\u0301\u039F\u0301\u03A5\u0301\u03A9\u0301"+ - "\u03B9\u0308\u0301\u0399\u0308\u03A5\u0308\u03B1\u0301\u03B5\u0301\u03B7"+ - "\u0301\u03B9\u0301\u03C5\u0308\u0301\u03B9\u0308\u03C5\u0308\u03BF\u0301"+ - "\u03C5\u0301\u03C9\u0301\u03D2\u0301\u03D2\u0308\u0415\u0300\u0415\u0308"+ - "\u0413\u0301\u0406\u0308\u041A\u0301\u0418\u0300\u0423\u0306\u0418\u0306"+ - "\u0438\u0306\u0435\u0300\u0435\u0308\u0433\u0301\u0456\u0308\u043A\u0301"+ - "\u0438\u0300\u0443\u0306\u0474\u030F\u0475\u030F\u0416\u0306\u0436\u0306"+ - "\u0410\u0306\u0430\u0306\u0410\u0308\u0430\u0308\u0415\u0306\u0435\u0306"+ - "\u04D8\u0308\u04D9\u0308\u0416\u0308\u0436\u0308\u0417\u0308\u0437\u0308"+ - "\u0418\u0304\u0438\u0304\u0418\u0308\u0438\u0308\u041E\u0308\u043E\u0308"+ - "\u04E8\u0308\u04E9\u0308\u042D\u0308\u044D\u0308\u0423\u0304\u0443\u0304"+ - "\u0423\u0308\u0443\u0308\u0423\u030B\u0443\u030B\u0427\u0308\u0447\u0308"+ - "\u042B\u0308\u044B\u0308\u0627\u0653\u0627\u0654\u0648\u0654\u0627\u0655"+ - "\u064A\u0654\u06D5\u0654\u06C1\u0654\u06D2\u0654\u0928\u093C\u0930\u093C"+ - "\u0933\u093C\u0915\u093C\u0916\u093C\u0917\u093C\u091C\u093C\u0921\u093C"+ - "\u0922\u093C\u092B\u093C\u092F\u093C\u09C7\u09BE\u09C7\u09D7\u09A1\u09BC"+ - "\u09A2\u09BC\u09AF\u09BC\u0A32\u0A3C\u0A38\u0A3C\u0A16\u0A3C\u0A17\u0A3C"+ - "\u0A1C\u0A3C\u0A2B\u0A3C\u0B47\u0B56\u0B47\u0B3E\u0B47\u0B57\u0B21\u0B3C"+ - "\u0B22\u0B3C\u0B92\u0BD7\u0BC6\u0BBE\u0BC7\u0BBE\u0BC6\u0BD7\u0C46\u0C56"+ - "\u0CBF\u0CD5\u0CC6\u0CD5\u0CC6\u0CD6\u0CC6\u0CC2\u0CC6\u0CC2\u0CD5\u0D46"+ - "\u0D3E\u0D47\u0D3E\u0D46\u0D57\u0DD9\u0DCA\u0DD9\u0DCF\u0DD9\u0DCF\u0DCA"+ - "\u0DD9\u0DDF\u0F42\u0FB7\u0F4C\u0FB7\u0F51\u0FB7\u0F56\u0FB7\u0F5B\u0FB7"+ - "\u0F40\u0FB5\u0F71\u0F72\u0F71\u0F74\u0FB2\u0F80\u0FB3\u0F80\u0F71\u0F80"+ - "\u0F92\u0FB7\u0F9C\u0FB7\u0FA1\u0FB7\u0FA6\u0FB7\u0FAB\u0FB7\u0F90\u0FB5"+ - "\u1025\u102EA\u0325a\u0325B\u0307b\u0307B\u0323b\u0323B\u0331b\u0331C"+ - "\u0327\u0301c\u0327\u0301D\u0307d\u0307D\u0323d\u0323D\u0331d\u0331D\u0327"+ - "d\u0327D\u032Dd\u032DE\u0304\u0300e\u0304\u0300E\u0304\u0301e\u0304\u0301"+ - "E\u032De\u032DE\u0330e\u0330E\u0327\u0306e\u0327\u0306F\u0307f\u0307G"+ - "\u0304g\u0304H\u0307h\u0307H\u0323h\u0323H\u0308h\u0308H\u0327h\u0327"+ - "H\u032Eh\u032EI\u0330i\u0330I\u0308\u0301i\u0308\u0301K\u0301k\u0301K"+ - "\u0323k\u0323K\u0331k\u0331L\u0323l\u0323L\u0323\u0304l\u0323\u0304L\u0331"+ - "l\u0331L\u032Dl\u032DM\u0301m\u0301M\u0307m\u0307M\u0323m\u0323N\u0307"+ - "n\u0307N\u0323n\u0323N\u0331n\u0331N\u032Dn\u032DO\u0303\u0301o\u0303"+ - "\u0301O\u0303\u0308o\u0303\u0308O\u0304\u0300o\u0304\u0300O\u0304\u0301"+ - "o\u0304\u0301P\u0301p\u0301P\u0307p\u0307R\u0307r\u0307R\u0323r\u0323"+ - "R\u0323\u0304r\u0323\u0304R\u0331r\u0331S\u0307s\u0307S\u0323s\u0323S"+ - "\u0301\u0307s\u0301\u0307S\u030C\u0307s\u030C\u0307S\u0323\u0307s\u0323"+ - "\u0307T\u0307t\u0307T\u0323t\u0323T\u0331t\u0331T\u032Dt\u032DU\u0324"+ - "u\u0324U\u0330u\u0330U\u032Du\u032DU\u0303\u0301u\u0303\u0301U\u0304\u0308"+ - "u\u0304\u0308V\u0303v\u0303V\u0323v\u0323W\u0300w\u0300W\u0301w\u0301"+ - "W\u0308w\u0308W\u0307w\u0307W\u0323w\u0323X\u0307x\u0307X\u0308x\u0308"+ - "Y\u0307y\u0307Z\u0302z\u0302Z\u0323z\u0323Z\u0331z\u0331h\u0331t\u0308"+ - "w\u030Ay\u030A\u017F\u0307A\u0323a\u0323A\u0309a\u0309A\u0302\u0301a\u0302"+ - "\u0301A\u0302\u0300a\u0302\u0300A\u0302\u0309a\u0302\u0309A\u0302\u0303"+ - "a\u0302\u0303A\u0323\u0302a\u0323\u0302A\u0306\u0301a\u0306\u0301A\u0306"+ - "\u0300a\u0306\u0300A\u0306\u0309a\u0306\u0309A\u0306\u0303a\u0306\u0303"+ - "A\u0323\u0306a\u0323\u0306E\u0323e\u0323E\u0309e\u0309E\u0303e\u0303E"+ - "\u0302\u0301e\u0302\u0301E\u0302\u0300e\u0302\u0300E\u0302\u0309e\u0302"+ - "\u0309E\u0302\u0303e\u0302\u0303E\u0323\u0302e\u0323\u0302I\u0309i\u0309"+ - "I\u0323i\u0323O\u0323o\u0323O\u0309o\u0309O\u0302\u0301o\u0302\u0301O"+ - "\u0302\u0300o\u0302\u0300O\u0302\u0309o\u0302\u0309O\u0302\u0303o\u0302"+ - "\u0303O\u0323\u0302o\u0323\u0302O\u031B\u0301o\u031B\u0301O\u031B\u0300"+ - "o\u031B\u0300O\u031B\u0309o\u031B\u0309O\u031B\u0303o\u031B\u0303O\u031B"+ - "\u0323o\u031B\u0323U\u0323u\u0323U\u0309u\u0309U\u031B\u0301u\u031B\u0301"+ - "U\u031B\u0300u\u031B\u0300U\u031B\u0309u\u031B\u0309U\u031B\u0303u\u031B"+ - "\u0303U\u031B\u0323u\u031B\u0323Y\u0300y\u0300Y\u0323y\u0323Y\u0309y\u0309"+ - "Y\u0303y\u0303\u03B1\u0313\u03B1\u0314\u03B1\u0313\u0300\u03B1\u0314\u0300"+ - "\u03B1\u0313\u0301\u03B1\u0314\u0301\u03B1\u0313\u0342\u03B1\u0314\u0342"+ - "\u0391\u0313\u0391\u0314\u0391\u0313\u0300\u0391\u0314\u0300\u0391\u0313"+ - "\u0301\u0391\u0314\u0301\u0391\u0313\u0342\u0391\u0314\u0342\u03B5\u0313"+ - "\u03B5\u0314\u03B5\u0313\u0300\u03B5\u0314\u0300\u03B5\u0313\u0301\u03B5"+ - "\u0314\u0301\u0395\u0313\u0395\u0314\u0395\u0313\u0300\u0395\u0314\u0300"+ - "\u0395\u0313\u0301\u0395\u0314\u0301\u03B7\u0313\u03B7\u0314\u03B7\u0313"+ - "\u0300\u03B7\u0314\u0300\u03B7\u0313\u0301\u03B7\u0314\u0301\u03B7\u0313"+ - "\u0342\u03B7\u0314\u0342\u0397\u0313\u0397\u0314\u0397\u0313\u0300\u0397"+ - "\u0314\u0300\u0397\u0313\u0301\u0397\u0314\u0301\u0397\u0313\u0342\u0397"+ - "\u0314\u0342\u03B9\u0313\u03B9\u0314\u03B9\u0313\u0300\u03B9\u0314\u0300"+ - "\u03B9\u0313\u0301\u03B9\u0314\u0301\u03B9\u0313\u0342\u03B9\u0314\u0342"+ - "\u0399\u0313\u0399\u0314\u0399\u0313\u0300\u0399\u0314\u0300\u0399\u0313"+ - "\u0301\u0399\u0314\u0301\u0399\u0313\u0342\u0399\u0314\u0342\u03BF\u0313"+ - "\u03BF\u0314\u03BF\u0313\u0300\u03BF\u0314\u0300\u03BF\u0313\u0301\u03BF"+ - "\u0314\u0301\u039F\u0313\u039F\u0314\u039F\u0313\u0300\u039F\u0314\u0300"+ - "\u039F\u0313\u0301\u039F\u0314\u0301\u03C5\u0313\u03C5\u0314\u03C5\u0313"+ - "\u0300\u03C5\u0314\u0300\u03C5\u0313\u0301\u03C5\u0314\u0301\u03C5\u0313"+ - "\u0342\u03C5\u0314\u0342\u03A5\u0314\u03A5\u0314\u0300\u03A5\u0314\u0301"+ - "\u03A5\u0314\u0342\u03C9\u0313\u03C9\u0314\u03C9\u0313\u0300\u03C9\u0314"+ - "\u0300\u03C9\u0313\u0301\u03C9\u0314\u0301\u03C9\u0313\u0342\u03C9\u0314"+ - "\u0342\u03A9\u0313\u03A9\u0314\u03A9\u0313\u0300\u03A9\u0314\u0300\u03A9"+ - "\u0313\u0301\u03A9\u0314\u0301\u03A9\u0313\u0342\u03A9\u0314\u0342\u03B1"+ - "\u0300\u03B1\u0301\u03B5\u0300\u03B5\u0301\u03B7\u0300\u03B7\u0301\u03B9"+ - "\u0300\u03B9\u0301\u03BF\u0300\u03BF\u0301\u03C5\u0300\u03C5\u0301\u03C9"+ - "\u0300\u03C9\u0301\u03B1\u0313\u0345\u03B1\u0314\u0345\u03B1\u0313\u0300"+ - "\u0345\000\u03B1\u0314\u0300\u0345\000\u03B1\u0313\u0301\u0345\000\u03B1"+ - "\u0314\u0301\u0345\000\u03B1\u0313\u0342\u0345\000\u03B1\u0314\u0342\u0345"+ - "\000\u0391\u0313\u0345\u0391\u0314\u0345\u0391\u0313\u0300\u0345\000\u0391"+ - "\u0314\u0300\u0345\000\u0391\u0313\u0301\u0345\000\u0391\u0314\u0301\u0345"+ - "\000\u0391\u0313\u0342\u0345\000\u0391\u0314\u0342\u0345\000\u03B7\u0313"+ - "\u0345\u03B7\u0314\u0345\u03B7\u0313\u0300\u0345\000\u03B7\u0314\u0300"+ - "\u0345\000\u03B7\u0313\u0301\u0345\000\u03B7\u0314\u0301\u0345\000\u03B7"+ - "\u0313\u0342\u0345\000\u03B7\u0314\u0342\u0345\000\u0397\u0313\u0345\u0397"+ - "\u0314\u0345\u0397\u0313\u0300\u0345\000\u0397\u0314\u0300\u0345\000\u0397"+ - "\u0313\u0301\u0345\000\u0397\u0314\u0301\u0345\000\u0397\u0313\u0342\u0345"+ - "\000\u0397\u0314\u0342\u0345\000\u03C9\u0313\u0345\u03C9\u0314\u0345\u03C9"+ - "\u0313\u0300\u0345\000\u03C9\u0314\u0300\u0345\000\u03C9\u0313\u0301\u0345"+ - "\000\u03C9\u0314\u0301\u0345\000\u03C9\u0313\u0342\u0345\000\u03C9\u0314"+ - "\u0342\u0345\000\u03A9\u0313\u0345\u03A9\u0314\u0345\u03A9\u0313\u0300"+ - "\u0345\000\u03A9\u0314\u0300\u0345\000\u03A9\u0313\u0301\u0345\000\u03A9"+ - "\u0314\u0301\u0345\000\u03A9\u0313\u0342\u0345\000\u03A9\u0314\u0342\u0345"+ - "\000\u03B1\u0306\u03B1\u0304\u03B1\u0300\u0345\u03B1\u0345\u03B1\u0301"+ - "\u0345\u03B1\u0342\u03B1\u0342\u0345\u0391\u0306\u0391\u0304\u0391\u0300"+ - "\u0391\u0301\u0391\u0345\u03B9\u00A8\u0342\u03B7\u0300\u0345\u03B7\u0345"+ - "\u03B7\u0301\u0345\u03B7\u0342\u03B7\u0342\u0345\u0395\u0300\u0395\u0301"+ - "\u0397\u0300\u0397\u0301\u0397\u0345\u1FBF\u0300\u1FBF\u0301\u1FBF\u0342"+ - "\u03B9\u0306\u03B9\u0304\u03B9\u0308\u0300\u03B9\u0308\u0301\u03B9\u0342"+ - "\u03B9\u0308\u0342\u0399\u0306\u0399\u0304\u0399\u0300\u0399\u0301\u1FFE"+ - "\u0300\u1FFE\u0301\u1FFE\u0342\u03C5\u0306\u03C5\u0304\u03C5\u0308\u0300"+ - "\u03C5\u0308\u0301\u03C1\u0313\u03C1\u0314\u03C5\u0342\u03C5\u0308\u0342"+ - "\u03A5\u0306\u03A5\u0304\u03A5\u0300\u03A5\u0301\u03A1\u0314\u00A8\u0300"+ - "\u00A8\u0301`\u03C9\u0300\u0345\u03C9\u0345\u03C9\u0301\u0345\u03C9\u0342"+ - "\u03C9\u0342\u0345\u039F\u0300\u039F\u0301\u03A9\u0300\u03A9\u0301\u03A9"+ - "\u0345\u00B4\u2002\u2003\u03A9KA\u030A\u2190\u0338\u2192\u0338\u2194\u0338"+ - "\u21D0\u0338\u21D4\u0338\u21D2\u0338\u2203\u0338\u2208\u0338\u220B\u0338"+ - "\u2223\u0338\u2225\u0338\u223C\u0338\u2243\u0338\u2245\u0338\u2248\u0338"+ - "=\u0338\u2261\u0338\u224D\u0338<\u0338>\u0338\u2264\u0338\u2265\u0338"+ - "\u2272\u0338\u2273\u0338\u2276\u0338\u2277\u0338\u227A\u0338\u227B\u0338"+ - "\u2282\u0338\u2283\u0338\u2286\u0338\u2287\u0338\u22A2\u0338\u22A8\u0338"+ - "\u22A9\u0338\u22AB\u0338\u227C\u0338\u227D\u0338\u2291\u0338\u2292\u0338"+ - "\u22B2\u0338\u22B3\u0338\u22B4\u0338\u22B5\u0338\u3008\u3009\u304B\u3099"+ - "\u304D\u3099\u304F\u3099\u3051\u3099\u3053\u3099\u3055\u3099\u3057\u3099"+ - "\u3059\u3099\u305B\u3099\u305D\u3099\u305F\u3099\u3061\u3099\u3064\u3099"+ - "\u3066\u3099\u3068\u3099\u306F\u3099\u306F\u309A\u3072\u3099\u3072\u309A"+ - "\u3075\u3099\u3075\u309A\u3078\u3099\u3078\u309A\u307B\u3099\u307B\u309A"+ - "\u3046\u3099\u309D\u3099\u30AB\u3099\u30AD\u3099\u30AF\u3099\u30B1\u3099"+ - "\u30B3\u3099\u30B5\u3099\u30B7\u3099\u30B9\u3099\u30BB\u3099\u30BD\u3099"+ - "\u30BF\u3099\u30C1\u3099\u30C4\u3099\u30C6\u3099\u30C8\u3099\u30CF\u3099"+ - "\u30CF\u309A\u30D2\u3099\u30D2\u309A\u30D5\u3099\u30D5\u309A\u30D8\u3099"+ - "\u30D8\u309A\u30DB\u3099\u30DB\u309A\u30A6\u3099\u30EF\u3099\u30F0\u3099"+ - "\u30F1\u3099\u30F2\u3099\u30FD\u3099\u8C48\u66F4\u8ECA\u8CC8\u6ED1\u4E32"+ - "\u53E5\u9F9C\u9F9C\u5951\u91D1\u5587\u5948\u61F6\u7669\u7F85\u863F\u87BA"+ - "\u88F8\u908F\u6A02\u6D1B\u70D9\u73DE\u843D\u916A\u99F1\u4E82\u5375\u6B04"+ - "\u721B\u862D\u9E1E\u5D50\u6FEB\u85CD\u8964\u62C9\u81D8\u881F\u5ECA\u6717"+ - "\u6D6A\u72FC\u90CE\u4F86\u51B7\u52DE\u64C4\u6AD3\u7210\u76E7\u8001\u8606"+ - "\u865C\u8DEF\u9732\u9B6F\u9DFA\u788C\u797F\u7DA0\u83C9\u9304\u9E7F\u8AD6"+ - "\u58DF\u5F04\u7C60\u807E\u7262\u78CA\u8CC2\u96F7\u58D8\u5C62\u6A13\u6DDA"+ - "\u6F0F\u7D2F\u7E37\u96FB\u52D2\u808B\u51DC\u51CC\u7A1C\u7DBE\u83F1\u9675"+ - "\u8B80\u62CF\u6A02\u8AFE\u4E39\u5BE7\u6012\u7387\u7570\u5317\u78FB\u4FBF"+ - "\u5FA9\u4E0D\u6CCC\u6578\u7D22\u53C3\u585E\u7701\u8449\u8AAA\u6BBA\u8FB0"+ - "\u6C88\u62FE\u82E5\u63A0\u7565\u4EAE\u5169\u51C9\u6881\u7CE7\u826F\u8AD2"+ - "\u91CF\u52F5\u5442\u5973\u5EEC\u65C5\u6FFE\u792A\u95AD\u9A6A\u9E97\u9ECE"+ - "\u529B\u66C6\u6B77\u8F62\u5E74\u6190\u6200\u649A\u6F23\u7149\u7489\u79CA"+ - "\u7DF4\u806F\u8F26\u84EE\u9023\u934A\u5217\u52A3\u54BD\u70C8\u88C2\u8AAA"+ - "\u5EC9\u5FF5\u637B\u6BAE\u7C3E\u7375\u4EE4\u56F9\u5BE7\u5DBA\u601C\u73B2"+ - "\u7469\u7F9A\u8046\u9234\u96F6\u9748\u9818\u4F8B\u79AE\u91B4\u96B8\u60E1"+ - "\u4E86\u50DA\u5BEE\u5C3F\u6599\u6A02\u71CE\u7642\u84FC\u907C\u9F8D\u6688"+ - "\u962E\u5289\u677B\u67F3\u6D41\u6E9C\u7409\u7559\u786B\u7D10\u985E\u516D"+ - "\u622E\u9678\u502B\u5D19\u6DEA\u8F2A\u5F8B\u6144\u6817\u7387\u9686\u5229"+ - "\u540F\u5C65\u6613\u674E\u68A8\u6CE5\u7406\u75E2\u7F79\u88CF\u88E1\u91CC"+ - "\u96E2\u533F\u6EBA\u541D\u71D0\u7498\u85FA\u96A3\u9C57\u9E9F\u6797\u6DCB"+ - "\u81E8\u7ACB\u7B20\u7C92\u72C0\u7099\u8B58\u4EC0\u8336\u523A\u5207\u5EA6"+ - "\u62D3\u7CD6\u5B85\u6D1E\u66B4\u8F3B\u884C\u964D\u898B\u5ED3\u5140\u55C0"+ - "\u585A\u6674\u51DE\u732A\u76CA\u793C\u795E\u7965\u798F\u9756\u7CBE\u7FBD"+ - "\u8612\u8AF8\u9038\u90FD\u98EF\u98FC\u9928\u9DB4\u05D9\u05B4\u05F2\u05B7"+ - "\u05E9\u05C1\u05E9\u05C2\u05E9\u05BC\u05C1\u05E9\u05BC\u05C2\u05D0\u05B7"+ - "\u05D0\u05B8\u05D0\u05BC\u05D1\u05BC\u05D2\u05BC\u05D3\u05BC\u05D4\u05BC"+ - "\u05D5\u05BC\u05D6\u05BC\u05D8\u05BC\u05D9\u05BC\u05DA\u05BC\u05DB\u05BC"+ - "\u05DC\u05BC\u05DE\u05BC\u05E0\u05BC\u05E1\u05BC\u05E3\u05BC\u05E4\u05BC"+ - "\u05E6\u05BC\u05E7\u05BC\u05E8\u05BC\u05E9\u05BC\u05EA\u05BC\u05D5\u05B9"+ - "\u05D1\u05BF\u05DB\u05BF\u05E4\u05BF" - ; - - static final CompactByteArray canonClass = new CompactByteArray( - "\000\u0200\uA5A5\006\000\u0080\000\000\u0100\000\u0180\u0200\u0280\u0300"+ - "\000\000\000\u0380\uA5A5\004\u0400\u0480\u0500\u0480\u0480\u0580\u0600"+ - "\u0680\u0700\u0780\u0800\uA5A5\016\000\u0880\000\u0900\uA5A5\017\000\u0980"+ - "\uA5A5\036\000\u0A00\u0A80\uA5A5\u0194\000\u0B00\uA5A5\005\000\u0B80\000"+ - "\000\000" - , - "\000\u0C00\uA580\u00A5\u15E6\uE8A5\u04DC\uE8D8\uA505\uDCCA\uCAA5\u04DC"+ - "\uCACA\uA50B\uDCA5\u0501\uA504\uDCA5\u08E6\uF0E6\uDCDC\uDCE6\uE6E6\uDCDC"+ - "\uA511\u00EA\uEAE9\uA520\u00A5\u04E6\uA58A\u00DC\uA504\uE6DC\uE6E6\uE6DE"+ - "\uDCA5\u06E6\u00A5\u05DC\uE6E6\uDCE6\uE6DE\uE4E6\u0A0B\u0C0D\u0E0F\u1011"+ - "\u1213\024\u1516\027\030\u1900\uE6A5\u8600\u1B1C\u1D1E\u1F20\u2122\uE6E6"+ - "\uDCA5\u1A00\u23A5\u6500\uA507\uE600\u00A5\u04E6\uDCE6\000\uE6E6\u00DC"+ - "\uE6E6\uDCA5\u2300\u24A5\u1E00\uE6DC\uE6E6\uDCE6\uE6DC\uDCDC\uE6DC\uDCE6"+ - "\uDCE6\uE6E6\uDCE6\uDCE6\uDCE6\uDCE6\uE6A5\u7100\u07A5\u1000\u0900\000"+ - "\uE6DC\uE6E6\uA567\007\uA510\011\uA57F\011\uA57F\011\uA507T\u5BA5\u7300"+ - "\u09A5\u6D00\u6767\u09A5\u0D00\uA504\u6BA5\u6C00\u7676\uA50E\u00A5\u047A"+ - "\uA54C\u00DC\uDCA5\u1B00\uDC00\uDC00\uD8A5\u3700\u8182\u0084\uA505\u00A5"+ - "\u0482\000\u8200\uE6E6\u0900\uE6E6\uA53E\u00DC\uA570\007\011\uA598\011"+ - "\uA556\u00E4\uA5A6\u00E6\uE601\u01A5\u04E6\u0101\u01E6\uE6A5\u0400\uE6A5"+ - "\u4800\uDAE4\uE8DE\uE0E0\uA569\010\u08A5\u8300\u1AA5\u8100\uA504\uE6A5"+ - "\u5C00" - ); -} diff --git a/icu4j/src/com/ibm/text/DictionaryBasedBreakIterator.java b/icu4j/src/com/ibm/text/DictionaryBasedBreakIterator.java deleted file mode 100755 index 7ad07d02c1..0000000000 --- a/icu4j/src/com/ibm/text/DictionaryBasedBreakIterator.java +++ /dev/null @@ -1,574 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/DictionaryBasedBreakIterator.java,v $ - * $Date: 2001/10/30 02:42:49 $ - * $Revision: 1.8 $ - * - ***************************************************************************************** - */ - -package com.ibm.text; - -import java.util.Vector; -import java.util.Stack; -import java.util.Hashtable; -import java.text.CharacterIterator; -import java.io.InputStream; -import java.io.IOException; - -import java.io.*; - -/** - * A subclass of RuleBasedBreakIterator that adds the ability to use a dictionary - * to further subdivide ranges of text beyond what is possible using just the - * state-table-based algorithm. This is necessary, for example, to handle - * word and line breaking in Thai, which doesn't use spaces between words. The - * state-table-based algorithm used by RuleBasedBreakIterator is used to divide - * up text as far as possible, and then contiguous ranges of letters are - * repeatedly compared against a list of known words (i.e., the dictionary) - * to divide them up into words. - * - * DictionaryBasedBreakIterator uses the same rule language as RuleBasedBreakIterator, - * but adds one more special substitution name: _dictionary_. This substitution - * name is used to identify characters in words in the dictionary. The idea is that - * if the iterator passes over a chunk of text that includes two or more characters - * in a row that are included in _dictionary_, it goes back through that range and - * derives additional break positions (if possible) using the dictionary. - * - * DictionaryBasedBreakIterator is also constructed with the filename of a dictionary - * file. It uses Class.getResource() to locate the dictionary file. The - * dictionary file is in a serialized binary format. We have a very primitive (and - * slow) BuildDictionaryFile utility for creating dictionary files, but aren't - * currently making it public. Contact us for help. - */ -public class DictionaryBasedBreakIterator extends RuleBasedBreakIterator { - - /** - * a list of known words that is used to divide up contiguous ranges of letters, - * stored in a compressed, indexed, format that offers fast access - */ - private BreakDictionary dictionary; - - /** - * a list of flags indicating which character categories are contained in - * the dictionary file (this is used to determine which ranges of characters - * to apply the dictionary to) - */ - private boolean[] categoryFlags; - - /** - * a temporary hiding place for the number of dictionary characters in the - * last range passed over by next() - */ - private int dictionaryCharCount; - - /** - * when a range of characters is divided up using the dictionary, the break - * positions that are discovered are stored here, preventing us from having - * to use either the dictionary or the state table again until the iterator - * leaves this range of text - */ - private int[] cachedBreakPositions; - - /** - * if cachedBreakPositions is not null, this indicates which item in the - * cache the current iteration position refers to - */ - private int positionInCache; - - /** - * Special variable name for characters in words in dictionary - */ - private static final String DICTIONARY_VAR = "_dictionary_"; - - /** - * Constructs a DictionaryBasedBreakIterator. - * @param description Same as the description parameter on RuleBasedBreakIterator, - * except for the special meaning of DICTIONARY_VAR. This parameter is just - * passed through to RuleBasedBreakIterator's constructor. - * @param dictionaryFilename The filename of the dictionary file to use - */ - public DictionaryBasedBreakIterator(String description, - InputStream dictionaryStream) throws IOException { - super(description); - dictionary = new BreakDictionary(dictionaryStream); - } - - /** - * Returns a Builder that is customized to build a DictionaryBasedBreakIterator. - * This is the same as RuleBasedBreakIterator.Builder, except for the extra code - * to handle the DICTIONARY_VAR tag. - */ - protected RuleBasedBreakIterator.Builder makeBuilder() { - return new Builder(); - } - -public void writeTablesToFile(FileOutputStream file, boolean littleEndian) throws IOException { -super.writeTablesToFile(file, littleEndian); - -DataOutputStream out = new DataOutputStream(file); - -// --- write index to fields (there's only one entry, but this allows subclassing of this class) -writeSwappedInt((short)8, out, littleEndian); -writeSwappedInt((short)(categoryFlags.length + 3 & 0x0f), out, littleEndian); - -for (int i = 0; i < categoryFlags.length; i++) - out.writeBoolean(categoryFlags[i]); -switch (categoryFlags.length % 4) { - case 1: out.write(0); - case 2: out.write(0); - case 3: out.write(0); - default: break; -} -} - - public void setText(CharacterIterator newText) { - super.setText(newText); - cachedBreakPositions = null; - dictionaryCharCount = 0; - positionInCache = 0; - } - - /** - * Sets the current iteration position to the beginning of the text. - * (i.e., the CharacterIterator's starting offset). - * @return The offset of the beginning of the text. - */ - public int first() { - cachedBreakPositions = null; - dictionaryCharCount = 0; - positionInCache = 0; - return super.first(); - } - - /** - * Sets the current iteration position to the end of the text. - * (i.e., the CharacterIterator's ending offset). - * @return The text's past-the-end offset. - */ - public int last() { - cachedBreakPositions = null; - dictionaryCharCount = 0; - positionInCache = 0; - return super.last(); - } - - /** - * Advances the iterator one step backwards. - * @return The position of the last boundary position before the - * current iteration position - */ - public int previous() { - CharacterIterator text = getText(); - - // if we have cached break positions and we're still in the range - // covered by them, just move one step backward in the cache - if (cachedBreakPositions != null && positionInCache > 0) { - --positionInCache; - text.setIndex(cachedBreakPositions[positionInCache]); - return cachedBreakPositions[positionInCache]; - } - - // otherwise, dump the cache and use the inherited previous() method to move - // backward. This may fill up the cache with new break positions, in which - // case we have to mark our position in the cache - else { - cachedBreakPositions = null; - int result = super.previous(); - if (cachedBreakPositions != null) - positionInCache = cachedBreakPositions.length - 2; - return result; - } - } - - /** - * Sets the current iteration position to the last boundary position - * before the specified position. - * @param offset The position to begin searching from - * @return The position of the last boundary before "offset" - */ - public int preceding(int offset) { - CharacterIterator text = getText(); - checkOffset(offset, text); - - // if we have no cached break positions, or "offset" is outside the - // range covered by the cache, we can just call the inherited routine - // (which will eventually call other routines in this class that may - // refresh the cache) - if (cachedBreakPositions == null || offset <= cachedBreakPositions[0] || - offset > cachedBreakPositions[cachedBreakPositions.length - 1]) { - cachedBreakPositions = null; - return super.preceding(offset); - } - - // on the other hand, if "offset" is within the range covered by the cache, - // then all we have to do is search the cache for the last break position - // before "offset" - else { - positionInCache = 0; - while (positionInCache < cachedBreakPositions.length - && offset > cachedBreakPositions[positionInCache]) - ++positionInCache; - --positionInCache; - text.setIndex(cachedBreakPositions[positionInCache]); - return text.getIndex(); - } - } - - /** - * Sets the current iteration position to the first boundary position after - * the specified position. - * @param offset The position to begin searching forward from - * @return The position of the first boundary after "offset" - */ - public int following(int offset) { - CharacterIterator text = getText(); - checkOffset(offset, text); - - // if we have no cached break positions, or if "offset" is outside the - // range covered by the cache, then dump the cache and call our - // inherited following() method. This will call other methods in this - // class that may refresh the cache. - if (cachedBreakPositions == null || offset < cachedBreakPositions[0] || - offset >= cachedBreakPositions[cachedBreakPositions.length - 1]) { - cachedBreakPositions = null; - return super.following(offset); - } - - // on the other hand, if "offset" is within the range covered by the - // cache, then just search the cache for the first break position - // after "offset" - else { - positionInCache = 0; - while (positionInCache < cachedBreakPositions.length - && offset >= cachedBreakPositions[positionInCache]) - ++positionInCache; - text.setIndex(cachedBreakPositions[positionInCache]); - return text.getIndex(); - } - } - - /** - * This is the implementation function for next(). - */ - protected int handleNext() { - CharacterIterator text = getText(); - - // if there are no cached break positions, or if we've just moved - // off the end of the range covered by the cache, we have to dump - // and possibly regenerate the cache - if (cachedBreakPositions == null || positionInCache == cachedBreakPositions.length - 1) { - - // start by using the inherited handleNext() to find a tentative return - // value. dictionaryCharCount tells us how many dictionary characters - // we passed over on our way to the tentative return value - int startPos = text.getIndex(); - dictionaryCharCount = 0; - int result = super.handleNext(); - - // if we passed over more than one dictionary character, then we use - // divideUpDictionaryRange() to regenerate the cached break positions - // for the new range - if (dictionaryCharCount > 1 && result - startPos > 1) { - divideUpDictionaryRange(startPos, result); - } - - // otherwise, the value we got back from the inherited fuction - // is our return value, and we can dump the cache - else { - cachedBreakPositions = null; - return result; - } - } - - // if the cache of break positions has been regenerated (or existed all - // along), then just advance to the next break position in the cache - // and return it - if (cachedBreakPositions != null) { - ++positionInCache; - text.setIndex(cachedBreakPositions[positionInCache]); - return cachedBreakPositions[positionInCache]; - } - return -9999; // SHOULD NEVER GET HERE! - } - - /** - * Looks up a character category for a character. - */ - protected int lookupCategory(char c) { - // this override of lookupCategory() exists only to keep track of whether we've - // passed over any dictionary characters. It calls the inherited lookupCategory() - // to do the real work, and then checks whether its return value is one of the - // categories represented in the dictionary. If it is, bump the dictionary- - // character count. - int result = super.lookupCategory(c); - if (result != RuleBasedBreakIterator.IGNORE && categoryFlags[result]) { - ++dictionaryCharCount; - } - return result; - } - - /** - * This is the function that actually implements the dictionary-based - * algorithm. Given the endpoints of a range of text, it uses the - * dictionary to determine the positions of any boundaries in this - * range. It stores all the boundary positions it discovers in - * cachedBreakPositions so that we only have to do this work once - * for each time we enter the range. - */ - private void divideUpDictionaryRange(int startPos, int endPos) { - CharacterIterator text = getText(); - - // the range we're dividing may begin or end with non-dictionary characters - // (i.e., for line breaking, we may have leading or trailing punctuation - // that needs to be kept with the word). Seek from the beginning of the - // range to the first dictionary character - text.setIndex(startPos); - char c = text.current(); - int category = lookupCategory(c); - while (category == IGNORE || !categoryFlags[category]) { - c = text.next(); - category = lookupCategory(c); - } -//System.out.println("\nDividing up range from " + (text.getIndex() + 1) + " to " + endPos); - - // initialize. We maintain two stacks: currentBreakPositions contains - // the list of break positions that will be returned if we successfully - // finish traversing the whole range now. possibleBreakPositions lists - // all other possible word ends we've passed along the way. (Whenever - // we reach an error [a sequence of characters that can't begin any word - // in the dictionary], we back up, possibly delete some breaks from - // currentBreakPositions, move a break from possibleBreakPositions - // to currentBreakPositions, and start over from there. This process - // continues in this way until we either successfully make it all the way - // across the range, or exhaust all of our combinations of break - // positions.) - Stack currentBreakPositions = new Stack(); - Stack possibleBreakPositions = new Stack(); - Vector wrongBreakPositions = new Vector(); - - // the dictionary is implemented as a trie, which is treated as a state - // machine. -1 represents the end of a legal word. Every word in the - // dictionary is represented by a path from the root node to -1. A path - // that ends in state 0 is an illegal combination of characters. - int state = 0; - - // these two variables are used for error handling. We keep track of the - // farthest we've gotten through the range being divided, and the combination - // of breaks that got us that far. If we use up all possible break - // combinations, the text contains an error or a word that's not in the - // dictionary. In this case, we "bless" the break positions that got us the - // farthest as real break positions, and then start over from scratch with - // the character where the error occurred. - int farthestEndPoint = text.getIndex(); - Stack bestBreakPositions = null; - - // initialize (we always exit the loop with a break statement) - c = text.current(); - while (true) { -//System.out.print("c = " + Integer.toString(c, 16) + ", pos = " + text.getIndex()); - - // if we can transition to state "-1" from our current state, we're - // on the last character of a legal word. Push that position onto - // the possible-break-positions stack - if (dictionary.at(state, 0) == -1) { - possibleBreakPositions.push(new Integer(text.getIndex())); - } - - // look up the new state to transition to in the dictionary - state = (dictionary.at(state, c)) & 0xFFFF; -//System.out.print(", state = " + state); - - // if the character we're sitting on causes us to transition to - // the "end of word" state, then it was a non-dictionary character - // and we've successfully traversed the whole range. Drop out - // of the loop. - if (state == /*-1*/ 0xFFFF) { - currentBreakPositions.push(new Integer(text.getIndex())); - break; - } - - // if the character we're sitting on causes us to transition to - // the error state, or if we've gone off the end of the range - // without transitioning to the "end of word" state, we've hit - // an error... - else if (state == 0 || text.getIndex() >= endPos) { - - // if this is the farthest we've gotten, take note of it in - // case there's an error in the text - if (text.getIndex() > farthestEndPoint) { - farthestEndPoint = text.getIndex(); - bestBreakPositions = (Stack)(currentBreakPositions.clone()); - } - - // wrongBreakPositions is a list of all break positions we've tried starting - // that didn't allow us to traverse all the way through the text. Every time - // we pop a break position off of currentBreakPositions, we put it into - // wrongBreakPositions to avoid trying it again later. If we make it to this - // spot, we're either going to back up to a break in possibleBreakPositions - // and try starting over from there, or we've exhausted all possible break - // positions and are going to do the fallback procedure. This loop prevents - // us from messing with anything in possibleBreakPositions that didn't work as - // a starting point the last time we tried it (this is to prevent a bunch of - // repetitive checks from slowing down some extreme cases) - // variable not used Integer newStartingSpot = null; - while (!possibleBreakPositions.isEmpty() && wrongBreakPositions.contains( - possibleBreakPositions.peek())) { - possibleBreakPositions.pop(); - } - - // if we've used up all possible break-position combinations, there's - // an error or an unknown word in the text. In this case, we start - // over, treating the farthest character we've reached as the beginning - // of the range, and "blessing" the break positions that got us that - // far as real break positions - if (possibleBreakPositions.isEmpty()) { - if (bestBreakPositions != null) { - currentBreakPositions = bestBreakPositions; - if (farthestEndPoint < endPos) { - text.setIndex(farthestEndPoint + 1); - } - else { - break; - } - } - else { - if ((currentBreakPositions.size() == 0 - || ((Integer)(currentBreakPositions.peek())).intValue() != text.getIndex()) - && text.getIndex() != startPos) { - currentBreakPositions.push(new Integer(text.getIndex())); - } - text.next(); - currentBreakPositions.push(new Integer(text.getIndex())); - } - } - - // if we still have more break positions we can try, then promote the - // last break in possibleBreakPositions into currentBreakPositions, - // and get rid of all entries in currentBreakPositions that come after - // it. Then back up to that position and start over from there (i.e., - // treat that position as the beginning of a new word) - else { - Integer temp = (Integer)possibleBreakPositions.pop(); - Object temp2 = null; - while (!currentBreakPositions.isEmpty() && temp.intValue() < - ((Integer)currentBreakPositions.peek()).intValue()) { - temp2 = currentBreakPositions.pop(); - wrongBreakPositions.addElement(temp2); - } - currentBreakPositions.push(temp); - text.setIndex(((Integer)currentBreakPositions.peek()).intValue()); - } - - // re-sync "c" for the next go-round, and drop out of the loop if - // we've made it off the end of the range - c = text.current(); - state = 0; - if (text.getIndex() >= endPos) { - break; - } - } - - // if we didn't hit any exceptional conditions on this last iteration, - // just advance to the next character and loop - else { - c = text.next(); - } -//System.out.print(", possibleBreakPositions = { "); for (int i = 0; i < possibleBreakPositions.size(); i++) System.out.print(possibleBreakPositions.elementAt(i) + " "); System.out.print("}"); -//System.out.print(", currentBreakPositions = { "); for (int i = 0; i < currentBreakPositions.size(); i++) System.out.print(currentBreakPositions.elementAt(i) + " "); System.out.println("}"); - } - - // dump the last break position in the list, and replace it with the actual - // end of the range (which may be the same character, or may be further on - // because the range actually ended with non-dictionary characters we want to - // keep with the word) - if (!currentBreakPositions.isEmpty()) { - currentBreakPositions.pop(); - } - currentBreakPositions.push(new Integer(endPos)); - - // create a regular array to hold the break positions and copy - // the break positions from the stack to the array (in addition, - // our starting position goes into this array as a break position). - // This array becomes the cache of break positions used by next() - // and previous(), so this is where we actually refresh the cache. - cachedBreakPositions = new int[currentBreakPositions.size() + 1]; - cachedBreakPositions[0] = startPos; - - for (int i = 0; i < currentBreakPositions.size(); i++) { - cachedBreakPositions[i + 1] = ((Integer)currentBreakPositions.elementAt(i)).intValue(); - } - positionInCache = 0; - } - - /** - * The Builder class for DictionaryBasedBreakIterator inherits almost all of - * its functionality from the Builder class for RuleBasedBreakIterator, but - * extends it with extra logic to handle the DICTIIONARY_VAR token - */ - protected class Builder extends RuleBasedBreakIterator.Builder { - - /** - * A UnicodeSet that contains all the characters represented in the dictionary - */ - private UnicodeSet dictionaryChars = new UnicodeSet(); - private String dictionaryExpression = ""; - - /** - * No special initialization - */ - public Builder() { - } - - /** - * We override handleSpecialSubstitution() to add logic to handle - * the $dictionary tag. If we see a substitution named DICTIONARY_VAR, - * parse the substitution expression and store the result in - * dictionaryChars. - */ - protected void handleSpecialSubstitution(String replace, String replaceWith, - int startPos, String description) { - super.handleSpecialSubstitution(replace, replaceWith, startPos, description); - - if (replace.equals(DICTIONARY_VAR)) { - if (replaceWith.charAt(0) == '(') { - error("Dictionary group can't be enclosed in (", startPos, description); - } - dictionaryExpression = replaceWith; - dictionaryChars = new UnicodeSet(replaceWith, false); - } - } - - /** - * The other half of the logic to handle the dictionary characters happens here. - * After the inherited builder has derived the real character categories, we - * set up the categoryFlags array in the iterator. This array contains "true" - * for every character category that includes a dictionary character. - */ - protected void buildCharCategories(Vector tempRuleList) { - super.buildCharCategories(tempRuleList); - - categoryFlags = new boolean[categories.size()]; - for (int i = 0; i < categories.size(); i++) { - UnicodeSet cs = (UnicodeSet)categories.elementAt(i); - - cs.retainAll(dictionaryChars); - if (!cs.isEmpty()) { - categoryFlags[i] = true; - } - } - } - - // This function is actually called by RuleBasedBreakIterator.buildCharCategories(), - // which is called by the function above. This gives us a way to create a separate - // character category for the dictionary characters even when RuleBasedBreakIterator - // isn't making a distinction - protected void mungeExpressionList(Hashtable expressions) { - expressions.put(dictionaryExpression, dictionaryChars); - } - } -} diff --git a/icu4j/src/com/ibm/text/DigitList.java b/icu4j/src/com/ibm/text/DigitList.java deleted file mode 100755 index c41227f0bf..0000000000 --- a/icu4j/src/com/ibm/text/DigitList.java +++ /dev/null @@ -1,741 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/DigitList.java,v $ - * $Date: 2001/10/30 02:42:49 $ - * $Revision: 1.8 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.math.BigInteger; - -/** - * DigitList handles the transcoding between numeric values and - * strings of characters. It only represents non-negative numbers. The - * division of labor between DigitList and - * DecimalFormat is that DigitList handles the radix - * 10 representation issues and numeric conversion, including rounding; - * DecimalFormat handles the locale-specific issues such as - * positive and negative representation, digit grouping, decimal point, - * currency, and so on. - * - *

A DigitList is a representation of a finite numeric value. - * DigitList objects do not represent NaN or infinite - * values. A DigitList value can be converted to a - * BigDecimal without loss of precision. Conversion to other - * numeric formats may involve loss of precision, depending on the specific - * value. - * - *

The DigitList representation consists of a string of - * characters, which are the digits radix 10, from '0' to '9'. It also has a - * base 10 exponent associated with it. The value represented by a - * DigitList object can be computed by mulitplying the fraction - * f, where 0 <= f < 1, derived by placing all the digits of - * the list to the right of the decimal point, by 10^exponent. - * - * @see java.util.Locale - * @see java.text.Format - * @see NumberFormat - * @see DecimalFormat - * @see java.text.ChoiceFormat - * @see java.text.MessageFormat - * @version 1.18 08/12/98 - * @author Mark Davis, Alan Liu - * */ -final class DigitList implements Cloneable { - /** - * The maximum number of significant digits in an IEEE 754 double, that - * is, in a Java double. This must not be increased, or garbage digits - * will be generated, and should not be decreased, or accuracy will be lost. - */ - public static final int MAX_LONG_DIGITS = 19; // == Long.toString(Long.MAX_VALUE).length() - public static final int DBL_DIG = 17; - - /** - * These data members are intentionally public and can be set directly. - * - * The value represented is given by placing the decimal point before - * digits[decimalAt]. If decimalAt is < 0, then leading zeros between - * the decimal point and the first nonzero digit are implied. If decimalAt - * is > count, then trailing zeros between the digits[count-1] and the - * decimal point are implied. - * - * Equivalently, the represented value is given by f * 10^decimalAt. Here - * f is a value 0.1 <= f < 1 arrived at by placing the digits in Digits to - * the right of the decimal. - * - * DigitList is normalized, so if it is non-zero, figits[0] is non-zero. We - * don't allow denormalized numbers because our exponent is effectively of - * unlimited magnitude. The count value contains the number of significant - * digits present in digits[]. - * - * Zero is represented by any DigitList with count == 0 or with each digits[i] - * for all i <= count == '0'. - */ - public int decimalAt = 0; - public int count = 0; - public byte[] digits = new byte[MAX_LONG_DIGITS]; - - private final void ensureCapacity(int digitCapacity, int digitsToCopy) { - if (digitCapacity > digits.length) { - byte[] newDigits = new byte[digitCapacity * 2]; - System.arraycopy(digits, 0, newDigits, 0, digitsToCopy); - digits = newDigits; - } - } - - /** - * Return true if the represented number is zero. - */ - boolean isZero() - { - for (int i=0; iBigInteger representing the value stored in this - * DigitList. This method assumes that this object contains - * an integral value; if not, it will return an incorrect value. - * [bnf] - * @param isPositive determines the sign of the returned result - * @return the value of this object as a BigInteger - */ - public BigInteger getBigInteger(boolean isPositive) { - if (isZero()) return BigInteger.valueOf(0); - StringBuffer stringRep = new StringBuffer(count); - if (!isPositive) { - stringRep.append('-'); - } - for (int i=0; i count) { - stringRep.append('0'); - } - return new BigInteger(stringRep.toString()); - } - - /** - * Return a BigDecimal representing the value stored in this - * DigitList. - * [bnf] - * @param isPositive determines the sign of the returned result - * @return the value of this object as a BigDecimal - */ - public java.math.BigDecimal getBigDecimal(boolean isPositive) { - if (isZero()) return java.math.BigDecimal.valueOf(0); - StringBuffer stringRep = new StringBuffer(count+1); - if (!isPositive) { - stringRep.append('-'); - } - int d = decimalAt; - if (d < 0) { - stringRep.append('.'); - while (d < 0) { - stringRep.append('0'); - ++d; - } - d = -1; - } - for (int i=0; i count) { - stringRep.append('0'); - } - return new java.math.BigDecimal(stringRep.toString()); - } - - /** - * Return whether or not this objects represented value is an integer. - * [bnf] - * @return true if the represented value of this object is an integer - */ - boolean isIntegral() { - // Trim trailing zeros. This does not change the represented value. - while (count > 0 && digits[count - 1] == (byte)'0') --count; - return count == 0 || decimalAt >= count; - } - - /** - * Return true if the number represented by this object can fit into - * a long. - */ - boolean fitsIntoLong(boolean isPositive) - { - // Figure out if the result will fit in a long. We have to - // first look for nonzero digits after the decimal point; - // then check the size. If the digit count is 18 or less, then - // the value can definitely be represented as a long. If it is 19 - // then it may be too large. - - // Trim trailing zeros. This does not change the represented value. - while (count > 0 && digits[count - 1] == (byte)'0') --count; - - if (count == 0) { - // Positive zero fits into a long, but negative zero can only - // be represented as a double. - bug 4162852 - return isPositive; - } - - if (decimalAt < count || decimalAt > MAX_LONG_DIGITS) return false; - - if (decimalAt < MAX_LONG_DIGITS) return true; - - // At this point we have decimalAt == count, and count == MAX_LONG_DIGITS. - // The number will overflow if it is larger than 9223372036854775807 - // or smaller than -9223372036854775808. - for (int i=0; i max) return false; - if (dig < max) return true; - } - - // At this point the first count digits match. If decimalAt is less - // than count, then the remaining digits are zero, and we return true. - if (count < decimalAt) return true; - - // Now we have a representation of Long.MIN_VALUE, without the leading - // negative sign. If this represents a positive value, then it does - // not fit; otherwise it fits. - return !isPositive; - } - - /** - * Set the digit list to a representation of the given double value. - * This method supports fixed-point notation. - * @param source Value to be converted; must not be Inf, -Inf, Nan, - * or a value <= 0. - * @param maximumFractionDigits The most fractional digits which should - * be converted. - */ - public final void set(double source, int maximumFractionDigits) - { - set(source, maximumFractionDigits, true); - } - - /** - * Set the digit list to a representation of the given double value. - * This method supports both fixed-point and exponential notation. - * @param source Value to be converted; must not be Inf, -Inf, Nan, - * or a value <= 0. - * @param maximumDigits The most fractional or total digits which should - * be converted. - * @param fixedPoint If true, then maximumDigits is the maximum - * fractional digits to be converted. If false, total digits. - */ - final void set(double source, int maximumDigits, boolean fixedPoint) - { - if (source == 0) source = 0; - // Generate a representation of the form DDDDD, DDDDD.DDDDD, or - // DDDDDE+/-DDDDD. - String rep = Double.toString(source); - - set(rep, MAX_LONG_DIGITS); - - if (fixedPoint) { - // The negative of the exponent represents the number of leading - // zeros between the decimal and the first non-zero digit, for - // a value < 0.1 (e.g., for 0.00123, -decimalAt == 2). If this - // is more than the maximum fraction digits, then we have an underflow - // for the printed representation. - if (-decimalAt > maximumDigits) { - count = 0; - return; - } else if (-decimalAt == maximumDigits) { - if (shouldRoundUp(0)) { - count = 1; - ++decimalAt; - digits[0] = (byte)'1'; - } else { - count = 0; - } - return; - } - // else fall through - } - - // Eliminate trailing zeros. - while (count > 1 && digits[count - 1] == '0') - --count; - - // Eliminate digits beyond maximum digits to be displayed. - // Round up if appropriate. - round(fixedPoint ? (maximumDigits + decimalAt) : maximumDigits); - } - - /** - * Given a string representation of the form DDDDD, DDDDD.DDDDD, - * or DDDDDE+/-DDDDD, set this object's value to it. Ignore - * any leading '-'. - */ - private void set(String rep, int maxCount) { - decimalAt = -1; - count = 0; - int exponent = 0; - // Number of zeros between decimal point and first non-zero digit after - // decimal point, for numbers < 1. - int leadingZerosAfterDecimal = 0; - boolean nonZeroDigitSeen = false; - // Skip over leading '-' - int i=0; - if (rep.charAt(i) == '-') { - ++i; - } - for (; i < rep.length(); ++i) { - char c = rep.charAt(i); - if (c == '.') { - decimalAt = count; - } else if (c == 'e' || c == 'E') { - ++i; - // Integer.parseInt doesn't handle leading '+' signs - if (rep.charAt(i) == '+') { - ++i; - } - exponent = Integer.valueOf(rep.substring(i)).intValue(); - break; - } else if (count < maxCount) { - if (!nonZeroDigitSeen) { - nonZeroDigitSeen = (c != '0'); - if (!nonZeroDigitSeen && decimalAt != -1) { - ++leadingZerosAfterDecimal; - } - } - - if (nonZeroDigitSeen) { - ensureCapacity(count+1, count); - digits[count++] = (byte)c; - } - } - } - if (decimalAt == -1) { - decimalAt = count; - } - decimalAt += exponent - leadingZerosAfterDecimal; - } - - /** - * Return true if truncating the representation to the given number - * of digits will result in an increment to the last digit. This - * method implements half-even rounding, the default rounding mode. - * [bnf] - * @param maximumDigits the number of digits to keep, from 0 to - * count-1. If 0, then all digits are rounded away, and - * this method returns true if a one should be generated (e.g., formatting - * 0.09 with "#.#"). - * @return true if digit maximumDigits-1 should be - * incremented - */ - private boolean shouldRoundUp(int maximumDigits) { - // variable not used boolean increment = false; - // Implement IEEE half-even rounding - /*Bug 4243108 - format(0.0) gives "0.1" if preceded by parse("99.99") [Richard/GCL] - */ - if (maximumDigits < count) { - if (digits[maximumDigits] > '5') { - return true; - } else if (digits[maximumDigits] == '5' ) { - for (int i=maximumDigits+1; i 0 && (digits[maximumDigits-1] % 2 != 0); - } - } - return false; - } - - /** - * Round the representation to the given number of digits. - * @param maximumDigits The maximum number of digits to be shown. - * Upon return, count will be less than or equal to maximumDigits. - */ - public final void round(int maximumDigits) { - // Eliminate digits beyond maximum digits to be displayed. - // Round up if appropriate. - // [bnf] rewritten to fix 4179818 - if (maximumDigits > 0 && maximumDigits < count) { - if (shouldRoundUp(maximumDigits)) { - // Rounding up involved incrementing digits from LSD to MSD. - // In most cases this is simple, but in a worst case situation - // (9999..99) we have to adjust the decimalAt value. - for (;;) - { - --maximumDigits; - if (maximumDigits < 0) - { - // We have all 9's, so we increment to a single digit - // of one and adjust the exponent. - digits[0] = (byte) '1'; - ++decimalAt; - maximumDigits = 0; // Adjust the count - break; - } - - ++digits[maximumDigits]; - if (digits[maximumDigits] <= '9') break; - // digits[maximumDigits] = '0'; // Unnecessary since we'll truncate this - } - ++maximumDigits; // Increment for use as count - } - count = maximumDigits; - /*Bug 4217661 DecimalFormat formats 1.001 to "1.00" instead of "1" - Eliminate trailing zeros. [Richard/GCL] - */ - while (count > 1 && digits[count-1] == '0') { - --count; - } //[Richard/GCL] - } - } - - /** - * Utility routine to set the value of the digit list from a long - */ - public final void set(long source) - { - set(source, 0); - } - - /** - * Set the digit list to a representation of the given long value. - * @param source Value to be converted; must be >= 0 or == - * Long.MIN_VALUE. - * @param maximumDigits The most digits which should be converted. - * If maximumDigits is lower than the number of significant digits - * in source, the representation will be rounded. Ignored if <= 0. - */ - public final void set(long source, int maximumDigits) - { - // This method does not expect a negative number. However, - // "source" can be a Long.MIN_VALUE (-9223372036854775808), - // if the number being formatted is a Long.MIN_VALUE. In that - // case, it will be formatted as -Long.MIN_VALUE, a number - // which is outside the legal range of a long, but which can - // be represented by DigitList. - // [NEW] Faster implementation - if (source <= 0) { - if (source == Long.MIN_VALUE) { - decimalAt = count = MAX_LONG_DIGITS; - System.arraycopy(LONG_MIN_REP, 0, digits, 0, count); - } else { - count = 0; - decimalAt = 0; - } - } else { - int left = MAX_LONG_DIGITS; - int right; - while (source > 0) { - digits[--left] = (byte) (((long) '0') + (source % 10)); - source /= 10; - } - decimalAt = MAX_LONG_DIGITS-left; - // Don't copy trailing zeros - // we are guaranteed that there is at least one non-zero digit, - // so we don't have to check lower bounds - for (right = MAX_LONG_DIGITS - 1; digits[right] == (byte) '0'; --right) {} - count = right - left + 1; - System.arraycopy(digits, left, digits, 0, count); - } - if (maximumDigits > 0) round(maximumDigits); - } - - /** - * Set the digit list to a representation of the given BigInteger value. - * [bnf] - * @param source Value to be converted - * @param maximumDigits The most digits which should be converted. - * If maximumDigits is lower than the number of significant digits - * in source, the representation will be rounded. Ignored if <= 0. - */ - public final void set(BigInteger source, int maximumDigits) { - String stringDigits = source.toString(); - - count = decimalAt = stringDigits.length(); - - // Don't copy trailing zeros - while (count > 1 && stringDigits.charAt(count - 1) == '0') --count; - - int offset = 0; - if (stringDigits.charAt(0) == '-') { - ++offset; - --count; - --decimalAt; - } - - ensureCapacity(count, 0); - for (int i = 0; i < count; ++i) { - digits[i] = (byte) stringDigits.charAt(i + offset); - } - - if (maximumDigits > 0) round(maximumDigits); - } - - /** - * Internal method that sets this digit list to represent the - * given value. The value is given as a String of the format - * returned by BigDecimal. - * @param stringDigits value to be represented with the following - * syntax, expressed as a regular expression: -?\d*.?\d* - * Must not be an empty string. - * @param maximumDigits The most digits which should be converted. - * If maximumDigits is lower than the number of significant digits - * in source, the representation will be rounded. Ignored if <= 0. - * @param fixedPoint If true, then maximumDigits is the maximum - * fractional digits to be converted. If false, total digits. - */ - private void setBigDecimalDigits(String stringDigits, - int maximumDigits, boolean fixedPoint) { -//| // Find the first non-zero digit, the decimal, and the last non-zero digit. -//| int first=-1, last=stringDigits.length()-1, decimal=-1; -//| for (int i=0; (first<0 || decimal<0) && i<=last; ++i) { -//| char c = stringDigits.charAt(i); -//| if (c == '.') { -//| decimal = i; -//| } else if (first < 0 && (c >= '1' && c <= '9')) { -//| first = i; -//| } -//| } -//| -//| if (first < 0) { -//| clear(); -//| return; -//| } -//| -//| // At this point we know there is at least one non-zero digit, so the -//| // following loop is safe. -//| for (;;) { -//| char c = stringDigits.charAt(last); -//| if (c != '0' && c != '.') { -//| break; -//| } -//| --last; -//| } -//| -//| if (decimal < 0) { -//| decimal = stringDigits.length(); -//| } -//| -//| count = last - first; -//| if (decimal < first || decimal > last) { -//| ++count; -//| } -//| decimalAt = decimal - first; -//| if (decimalAt < 0) { -//| ++decimalAt; -//| } -//| -//| ensureCapacity(count, 0); -//| for (int i = 0; i < count; ++i) { -//| digits[i] = (byte) stringDigits.charAt(first++); -//| if (first == decimal) { -//| ++first; -//| } -//| } - - // The maxDigits here could also be Integer.MAX_VALUE - set(stringDigits, stringDigits.length()); - - // Eliminate digits beyond maximum digits to be displayed. - // Round up if appropriate. - round(fixedPoint ? (maximumDigits + decimalAt) : maximumDigits); - } - - /** - * Set the digit list to a representation of the given BigDecimal value. - * [bnf] - * @param source Value to be converted - * @param maximumDigits The most digits which should be converted. - * If maximumDigits is lower than the number of significant digits - * in source, the representation will be rounded. Ignored if <= 0. - * @param fixedPoint If true, then maximumDigits is the maximum - * fractional digits to be converted. If false, total digits. - */ - public final void set(java.math.BigDecimal source, - int maximumDigits, boolean fixedPoint) { - setBigDecimalDigits(source.toString(), maximumDigits, fixedPoint); - } - - /* - * Set the digit list to a representation of the given BigDecimal value. - * [bnf] - * @param source Value to be converted - * @param maximumDigits The most digits which should be converted. - * If maximumDigits is lower than the number of significant digits - * in source, the representation will be rounded. Ignored if <= 0. - * @param fixedPoint If true, then maximumDigits is the maximum - * fractional digits to be converted. If false, total digits. - */ - public final void set(com.ibm.math.BigDecimal source, - int maximumDigits, boolean fixedPoint) { - setBigDecimalDigits(source.toString(), maximumDigits, fixedPoint); - } - - /** - * equality test between two digit lists. - */ - public boolean equals(Object obj) { - if (this == obj) // quick check - return true; - if (!(obj instanceof DigitList)) // (1) same object? - return false; - DigitList other = (DigitList) obj; - if (count != other.count || - decimalAt != other.decimalAt) - return false; - for (int i = 0; i < count; i++) - if (digits[i] != other.digits[i]) - return false; - return true; - } - - /** - * Generates the hash code for the digit list. - */ - public int hashCode() { - int hashcode = decimalAt; - - for (int i = 0; i < count; i++) - hashcode = hashcode * 37 + digits[i]; - - return hashcode; - } - - /** - * Returns true if this DigitList represents Long.MIN_VALUE; - * false, otherwise. This is required so that getLong() works. - */ - private boolean isLongMIN_VALUE() - { - if (decimalAt != count || count != MAX_LONG_DIGITS) - return false; - - for (int i = 0; i < count; ++i) - { - if (digits[i] != LONG_MIN_REP[i]) return false; - } - - return true; - } - - private static byte[] LONG_MIN_REP; - - static - { - // Store the representation of LONG_MIN without the leading '-' - String s = Long.toString(Long.MIN_VALUE); - LONG_MIN_REP = new byte[MAX_LONG_DIGITS]; - for (int i=0; i < MAX_LONG_DIGITS; ++i) - { - LONG_MIN_REP[i] = (byte)s.charAt(i + 1); - } - } - - /** - * Return the floor of the log base 10 of a given double. - * This method compensates for inaccuracies which arise naturally when - * computing logs, and always give the correct value. The parameter - * must be positive and finite. - */ - private static final int log10(double d) - { - // The reason this routine is needed is that simply taking the - // log and dividing by log10 yields a result which may be off - // by 1 due to rounding errors. For example, the naive log10 - // of 1.0e300 taken this way is 299, rather than 300. - double log10 = Math.log(d) / LOG10; - int ilog10 = (int)Math.floor(log10); - // Positive logs could be too small, e.g. 0.99 instead of 1.0 - if (log10 > 0 && d >= Math.pow(10, ilog10 + 1)) - { - ++ilog10; - } - // Negative logs could be too big, e.g. -0.99 instead of -1.0 - else if (log10 < 0 && d < Math.pow(10, ilog10)) - { - --ilog10; - } - return ilog10; - } - - private static final double LOG10 = Math.log(10.0); - - public String toString() - { - if (isZero()) return "0"; - StringBuffer buf = new StringBuffer("0."); - for (int i=0; iSome escape forms actually have two different patterns, one for - * BMP characters (0..FFFF) and one for supplements (>FFFF). To - * handle this, a second EscapeTransliterator may be defined that - * specifies the pattern to be produced for supplementals. An example - * of a form that requires this is the C form, which uses "\\uFFFF" - * for BMP characters and "\\U0010FFFF" for supplementals. - * - *

This class is package private. It registers several standard - * variants with the system which are then accessed via their IDs. - * - * @author Alan Liu - * @version $RCSfile: EscapeTransliterator.java,v $ $Revision: 1.3 $ $Date: 2002/02/09 01:01:47 $ - */ -class EscapeTransliterator extends Transliterator { - - /** - * The prefix of the escape form; may be empty, but usually isn't. - * May not be null. - */ - private String prefix; - - /** - * The prefix of the escape form; often empty. May not be null. - */ - private String suffix; - - /** - * The radix to display the number in. Typically 16 or 10. Must - * be in the range 2 to 36. - */ - private int radix; - - /** - * The minimum number of digits. Typically 1, 4, or 8. Values - * less than 1 are equivalent to 1. - */ - private int minDigits; - - /** - * If true, supplementals are handled as 32-bit code points. If - * false, they are handled as two 16-bit code units. - */ - private boolean grokSupplementals; - - /** - * The form to be used for supplementals. If this is null then - * the same form is used for BMP characters and supplementals. If - * this is not null and if grokSupplementals is true then the - * prefix, suffix, radix, and minDigits of this object are used - * for supplementals. - */ - private EscapeTransliterator supplementalHandler; - - /** - * Registers standard variants with the system. Called by - * Transliterator during initialization. - */ - static void register() { - // Unicode: "U+10FFFF" hex, min=4, max=6 - Transliterator.registerFactory("Any-Hex/Unicode", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new EscapeTransliterator("Any-Hex/Unicode", - "U+", "", 16, 4, true, null); - } - }); - - // Java: "\\uFFFF" hex, min=4, max=4 - Transliterator.registerFactory("Any-Hex/Java", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new EscapeTransliterator("Any-Hex/Java", - "\\u", "", 16, 4, false, null); - } - }); - - // C: "\\uFFFF" hex, min=4, max=4; \\U0010FFFF hex, min=8, max=8 - Transliterator.registerFactory("Any-Hex/C", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new EscapeTransliterator("Any-Hex/C", - "\\u", "", 16, 4, true, - new EscapeTransliterator("", "\\U", "", 16, 8, true, null)); - } - }); - - // XML: "􏿿" hex, min=1, max=6 - Transliterator.registerFactory("Any-Hex/XML", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new EscapeTransliterator("Any-Hex/XML", - "&#x", ";", 16, 1, true, null); - } - }); - - // XML10: "&1114111;" dec, min=1, max=7 (not really "Any-Hex") - Transliterator.registerFactory("Any-Hex/XML10", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new EscapeTransliterator("Any-Hex/XML10", - "&#", ";", 10, 1, true, null); - } - }); - - // Perl: "\\x{263A}" hex, min=1, max=6 - Transliterator.registerFactory("Any-Hex/Perl", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new EscapeTransliterator("Any-Hex/Perl", - "\\x{", "}", 16, 1, true, null); - } - }); - - // Generic - Transliterator.registerFactory("Any-Hex", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new EscapeTransliterator("Any-Hex", - "\\u", "", 16, 4, false, null); - } - }); - } - - /** - * Constructs an escape transliterator with the given ID and - * parameters. See the class member documentation for details. - */ - EscapeTransliterator(String ID, String prefix, String suffix, - int radix, int minDigits, - boolean grokSupplementals, - EscapeTransliterator supplementalHandler) { - super(ID, null); - this.prefix = prefix; - this.suffix = suffix; - this.radix = radix; - this.minDigits = minDigits; - this.grokSupplementals = grokSupplementals; - this.supplementalHandler = supplementalHandler; - } - - /** - * Implements {@link Transliterator#handleTransliterate}. - */ - protected void handleTransliterate(Replaceable text, - Position pos, boolean incremental) { - int start = pos.start; - int limit = pos.limit; - - StringBuffer buf = new StringBuffer(prefix); - int prefixLen = prefix.length(); - boolean redoPrefix = false; - - while (start < limit) { - int c = grokSupplementals ? text.char32At(start) : text.charAt(start); - int charLen = grokSupplementals ? UTF16.getCharCount(c) : 1; - - if ((c & 0xFFFF0000) != 0 && supplementalHandler != null) { - buf.setLength(0); - buf.append(supplementalHandler.prefix); - Utility.appendNumber(buf, c, supplementalHandler.radix, - supplementalHandler.minDigits); - buf.append(supplementalHandler.suffix); - redoPrefix = true; - } else { - if (redoPrefix) { - buf.setLength(0); - buf.append(prefix); - redoPrefix = false; - } else { - buf.setLength(prefixLen); - } - Utility.appendNumber(buf, c, radix, minDigits); - buf.append(suffix); - } - - text.replace(start, start + charLen, buf.toString()); - start += buf.length(); - limit += buf.length() - charLen; - } - - pos.contextLimit += limit - pos.limit; - pos.limit = limit; - pos.start = start; - } -} diff --git a/icu4j/src/com/ibm/text/FunctionReplacer.java b/icu4j/src/com/ibm/text/FunctionReplacer.java deleted file mode 100755 index fc9ef16a34..0000000000 --- a/icu4j/src/com/ibm/text/FunctionReplacer.java +++ /dev/null @@ -1,76 +0,0 @@ -/* -********************************************************************** -* Copyright (c) 2002, International Business Machines Corporation -* and others. All Rights Reserved. -********************************************************************** -* Date Name Description -* 01/14/2002 aliu Creation. -********************************************************************** -*/ - -package com.ibm.text; -import com.ibm.util.Utility; - -/** - * A replacer that calls a transliterator to generate its output text. - * The input text to the transliterator is the output of another - * UnicodeReplacer object. That is, this replacer wraps another - * replacer with a transliterator. - * @author Alan Liu - */ -class FunctionReplacer implements UnicodeReplacer { - - /** - * The transliterator. Must not be null. - */ - private Transliterator translit; - - /** - * The replacer object. This generates text that is then - * processed by 'translit'. Must not be null. - */ - private UnicodeReplacer replacer; - - /** - * Construct a replacer that takes the output of the given - * replacer, passes it through the given transliterator, and emits - * the result as output. - */ - public FunctionReplacer(Transliterator theTranslit, - UnicodeReplacer theReplacer) { - translit = theTranslit; - replacer = theReplacer; - } - - /** - * UnicodeReplacer API - */ - public int replace(Replaceable text, - int start, - int limit, - int[] cursor) { - - // First delegate to subordinate replacer - int len = replacer.replace(text, start, limit, cursor); - limit = start + len; - - // Now transliterate - limit = translit.transliterate(text, start, limit); - - return limit - start; - } - - /** - * UnicodeReplacer API - */ - public String toReplacerPattern(boolean escapeUnprintable) { - StringBuffer rule = new StringBuffer("&"); - rule.append(translit.getID()); - rule.append("( "); - rule.append(replacer.toReplacerPattern(escapeUnprintable)); - rule.append(" )"); - return rule.toString(); - } -} - -//eof diff --git a/icu4j/src/com/ibm/text/HexToUnicodeTransliterator.java b/icu4j/src/com/ibm/text/HexToUnicodeTransliterator.java deleted file mode 100755 index 152e290d99..0000000000 --- a/icu4j/src/com/ibm/text/HexToUnicodeTransliterator.java +++ /dev/null @@ -1,381 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/HexToUnicodeTransliterator.java,v $ - * $Date: 2001/12/04 20:09:07 $ - * $Revision: 1.11 $ - * - ***************************************************************************************** - */ -package com.ibm.text; -import java.util.*; -import com.ibm.util.Utility; - -/** - * A transliterator that converts from hexadecimal Unicode escape - * sequences to the characters they represent. For example, "U+0040" - * and '\u0040'. A default HexToUnicodeTransliterator recognizes the - * prefixes "U+", "u+", "\U", and "\u". Hex values may be - * upper- or lowercase. By calling the applyPattern() method, one - * or more custom prefix/suffix pairs may be specified. See - * applyPattern() for details. - * - * @author Alan Liu - * @version $RCSfile: HexToUnicodeTransliterator.java,v $ $Revision: 1.11 $ $Date: 2001/12/04 20:09:07 $ - */ -public class HexToUnicodeTransliterator extends Transliterator { - private static final String COPYRIGHT = - "\u00A9 IBM Corporation 1999. All rights reserved."; - - /** - * Package accessible ID for this transliterator. - */ - static final String _ID = "Hex-Any"; - - /** - * This pattern encodes the following specs for the default constructor: - * \\u0000 - * \\U0000 - * u+0000 - * U+0000 - * The multiple backslashes resolve to a single backslash - * in the effective prefix. - */ - private static final String DEFAULT_PATTERN = "\\\\u0000;\\\\U0000;u+0000;U+0000"; - - // Character constants for special pattern characters - private static final char SEMICOLON = ';'; - private static final char ZERO = '0'; - private static final char POUND = '#'; - private static final char BACKSLASH = '\\'; - - /** - * The pattern for this transliterator - */ - private String pattern; - - /** - * The processed pattern specification. See applyPattern() for - * details. - */ - private char[] affixes; - - /** - * The number of different affix sets in affixes. - */ - private int affixCount; - - /** - * Constructs a transliterator. - */ - public HexToUnicodeTransliterator() { - super(_ID, null); - applyPattern(DEFAULT_PATTERN); - } - - /** - * Constructs a transliterator. - */ - public HexToUnicodeTransliterator(String thePattern) { - this(thePattern, null); - } - - /** - * Constructs a transliterator. - */ - public HexToUnicodeTransliterator(String thePattern, - UnicodeFilter theFilter) { - super(_ID, theFilter); - applyPattern(thePattern); - } - - /** - * Set the patterns recognized by this transliterator. One or - * more patterns may be specified, separated by semicolons (';'). - * Each pattern contains zero or more prefix characters, one or - * more digit characters, and zero or more suffix characters. The - * digit characters indicates optional digits ('#') followed by - * required digits ('0'). The total number of digits cannot - * exceed 4, and must be at least 1 required digit. Use a - * backslash ('\\') to escape any of the special characters. An - * empty pattern is allowed; it specifies a transliterator that - * does nothing. - * - *

Example: "U+0000;<###0>" specifies two patterns. The first - * has a prefix of "U+", exactly four digits, and no suffix. The - * second has a prefix of "<", between one and four digits, and a - * suffix of ">". - * - *

-     * pattern := spec | ( pattern ';' spec )
-     * spec := prefix-char* digit-spec suffix-char*
-     * digit-spec := '#'* '0'+
-     * prefix-char := [^special-char] | '\\' special-char
-     * suffix-char := [^special-char] | '\\' special-char
-     * special-char := ';' | '0' | '#' | '\\'
-     * 
- */ - public void applyPattern(String pattern) { - - /* The pattern is processed and stored in affixes. The pattern - * consists of zero or more affixes. Each affix is parsed to - * determine the prefix, suffix, minimum digit count, and maximum - * digit count. These values are then stored as a four character - * header. That is, their numeric values are cast to UChars and - * stored in the string. Following these four characters, the prefix - * characters, then suffix characters are stored. Each spec takes - * n+4 characters, where n is the total length of the prefix and - * suffix. - */ - - StringBuffer affixes = new StringBuffer(); - affixCount = 0; - - /* The mode specifies where we are in each spec. - * mode 0 = in prefix - * mode 1 = in optional digits (#) - * mode 2 = in required digits (0) - * mode 3 = in suffix - */ - int mode = 0; - - int prefixLen = 0, suffixLen = 0, minDigits = 0, maxDigits = 0; - int start = 0; - - /* To make parsing easier, we append a virtual ';' at the end of - * the pattern string, if there isn't one already. When we get to - * the index pattern.length() (that is, one past the end), we - * create a virtual ';' if necessary. - */ - char c = 0; // These are outside the loop so we can - boolean isLiteral = false; // see the previous character... - for (int i=0; i<=pattern.length(); ++i) { - // Create the virtual trailing ';' if necessary - if (i == pattern.length()) { - // If the last character was not a non-literal ';'... - if (i > 0 && !(c == SEMICOLON && !isLiteral)) { - c = SEMICOLON; - isLiteral = false; - } else { - break; - } - } else { - c = pattern.charAt(i); - isLiteral = false; - } - - if (c == BACKSLASH) { - if ((i+1) 4 - // Invalid min/max digit count - || prefixLen > 0xFFFF || suffixLen > 0xFFFF) { - // Suffix or prefix too long - throw new IllegalArgumentException("Suffix or prefix too long"); - } - // If there was no prefix and no suffix, then the - // header will not have been allocated yet. We need - // allocate the header now. - if (start == affixes.length()) { - affixes.append("AAAA"); - } - // Fill in 4-character header - affixes.setCharAt(start++, (char) prefixLen); - affixes.setCharAt(start++, (char) suffixLen); - affixes.setCharAt(start++, (char) minDigits); - affixes.setCharAt(start, (char) maxDigits); - start = affixes.length(); - ++affixCount; - prefixLen = suffixLen = minDigits = maxDigits = mode = 0; - break; - default: - isLiteral = true; - break; - } - } - - if (isLiteral) { - if (start == affixes.length()) { - // Make space for the header. Append any four - // characters as place holders for the header values. - // We fill these in when we parse the ';'. - affixes.append("AAAA"); - } - affixes.append(c); - if (mode == 0) { - ++prefixLen; - } else { - // Any literal outside the prefix moves us into mode 3 - // (suffix) - mode = 3; - ++suffixLen; - } - } - } - - // We only modify the pattern and affixes member variables if - // we get to this point, that is, if the parse succeeds. - this.pattern = pattern; - int len = affixes.length(); - this.affixes = new char[len]; - Utility.getChars(affixes, 0, len, this.affixes, 0); - } - - /** - * Return this transliterator's pattern. - */ - public String toPattern() { - return pattern; - } - - /** - * Implements {@link Transliterator#handleTransliterate}. - */ - protected void handleTransliterate(Replaceable text, - Position offsets, boolean isIncremental) { - int cursor = offsets.start; - int limit = offsets.limit; - int i, j, ipat; - - loop: - while (cursor < limit) { - // Loop over the specs in affixes. If affixCount is zero (an - // empty pattern), then we do nothing. We exit this loop when - // we match one of the specs. We exit this function (by - // jumping to exit: below) if a partial match is detected and - // isIncremental is true. - for (j=0, ipat=0; j= limit) { - if (i > 0) { - // We've already matched a character. This is - // a partial match, so we return if in - // incremental mode. In non-incremental mode, - // go to the next spec. - if (isIncremental) { - break loop; - } - match = false; - break; - } - } - char c = text.charAt(curs++); - if (c != affixes[ipat + i]) { - match = false; - break; - } - } - - if (match) { - char u = 0; - int digitCount = 0; - for (;;) { - if (curs >= limit) { - // Check for partial match in incremental mode. - if (curs > cursor && isIncremental) { - break loop; - } - break; - } - int digit = Character.digit(text.charAt(curs), 16); - if (digit < 0) { - break; - } - ++curs; - u <<= 4; - u |= (char) digit; - if (++digitCount == maxDigits) { - break; - } - } - - match = (digitCount >= minDigits); - - if (match) { - for (i=0; i= limit) { - // Check for partial match in incremental mode. - if (curs > cursor && isIncremental) { - break loop; - } - match = false; - break; - } - char c = text.charAt(curs++); - if (c != affixes[ipat + prefixLen + i]) { - match = false; - break; - } - } - - if (match) { - // At this point, we have a match - text.replace(cursor, curs, String.valueOf(u)); - limit -= curs - cursor - 1; - // The following break statement leaves the - // loop that is traversing the specs in - // affixes. We then parse the next input - // character. - break; - } - } - } - - ipat += prefixLen + suffixLen; - } - - ++cursor; - } - - offsets.contextLimit += limit - offsets.limit; - offsets.limit = limit; - offsets.start = cursor; - } -} diff --git a/icu4j/src/com/ibm/text/LowercaseTransliterator.java b/icu4j/src/com/ibm/text/LowercaseTransliterator.java deleted file mode 100755 index 1c9fafc80f..0000000000 --- a/icu4j/src/com/ibm/text/LowercaseTransliterator.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/LowercaseTransliterator.java,v $ - * $Date: 2001/11/25 23:12:22 $ - * $Revision: 1.6 $ - * - ***************************************************************************************** - */ -package com.ibm.text; -import java.util.*; - -/** - * A transliterator that performs locale-sensitive toLower() - * case mapping. - */ -class LowercaseTransliterator extends Transliterator{ - - /** - * Package accessible ID. - */ - static final String _ID = "Any-Lower"; - - // TODO: Add variants for tr, az, lt, default = default locale - - /** - * System registration hook. - */ - static void register() { - Transliterator.registerFactory(_ID, new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new LowercaseTransliterator(Locale.US); - } - }); - - Transliterator.registerSpecialInverse("Lower", "Upper", true); - } - - private Locale loc; - - /** - * Constructs a transliterator. - */ - - public LowercaseTransliterator(Locale loc) { - super(_ID, null); - this.loc = loc; - } - - /** - * Implements {@link Transliterator#handleTransliterate}. - */ - protected void handleTransliterate(Replaceable text, - Position offsets, boolean isIncremental) { - int textPos = offsets.start; - if (textPos >= offsets.limit) return; - - // get string for context - // TODO: add convenience method to do this, since we do it all over - - char[] strBuffer = new char[offsets.contextLimit - offsets.contextStart]; // get whole context - text.getChars(offsets.contextStart, offsets.contextLimit, strBuffer, 0); - String original = new String(strBuffer); - - // Walk through original string - // If there is a case change, modify corresponding position in replaceable - - int i = textPos - offsets.contextStart; - int limit = offsets.limit - offsets.contextStart; - int cp; - int oldLen; - - for (; i < limit; i += oldLen) { - cp = UTF16.charAt(original, i); - oldLen = UTF16.getCharCount(cp); - int newLen = UCharacter.toLowerCase(loc, original, i, buffer); - if (newLen >= 0) { - text.replace(textPos, textPos + oldLen, buffer, 0, newLen); - if (newLen != oldLen) { - textPos += newLen; - offsets.limit += newLen - oldLen; - offsets.contextLimit += newLen - oldLen; - continue; - } - } - textPos += oldLen; - } - offsets.start = offsets.limit; - } - - private char buffer[] = new char[UCharacter.getMaxCaseExpansion()]; - -} diff --git a/icu4j/src/com/ibm/text/NFRule.java b/icu4j/src/com/ibm/text/NFRule.java deleted file mode 100755 index 4fb1305fca..0000000000 --- a/icu4j/src/com/ibm/text/NFRule.java +++ /dev/null @@ -1,1334 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/NFRule.java,v $ - * $Date: 2001/10/24 20:00:08 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.text.*; - -/** - * A class represnting a single rule in a RuleBasedNumberFormat. A rule - * inserts its text into the result string and then passes control to its - * substitutions, which do the same thing. - * $RCSfile: NFRule.java,v $ $Revision: 1.3 $ $Date: 2001/10/24 20:00:08 $ - */ -final class NFRule { - //----------------------------------------------------------------------- - // constants - //----------------------------------------------------------------------- - - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - /** - * Special base value used to identify a negative-number rule - */ - public static final int NEGATIVE_NUMBER_RULE = -1; - - /** - * Special base value used to identify an improper fraction (x.x) rule - */ - public static final int IMPROPER_FRACTION_RULE = -2; - - /** - * Special base value used to identify a proper fraction (0.x) rule - */ - public static final int PROPER_FRACTION_RULE = -3; - - /** - * Special base value used to identify a master rule - */ - public static final int MASTER_RULE = -4; - - //----------------------------------------------------------------------- - // data members - //----------------------------------------------------------------------- - - /** - * The rule's base value - */ - private long baseValue; - - /** - * The rule's radix (the radix to the power of the exponent equals - * the rule's divisor) - */ - private short radix = 10; - - /** - * The rule's exponent (the radx rased to the power of the exponsnt - * equals the rule's divisor) - */ - private short exponent = 0; - - /** - * The rule's rule text. When formatting a number, the rule's text - * is inserted into the result string, and then the text from any - * substitutions is inserted into the result string - */ - private String ruleText = null; - - /** - * The rule's first substitution (the one with the lower offset - * into the rule text) - */ - private NFSubstitution sub1 = null; - - /** - * The rule's second substitution (the one with the higher offset - * into the rule text) - */ - private NFSubstitution sub2 = null; - - /** - * The RuleBasedNumberFormat that owns this rule - */ - private RuleBasedNumberFormat formatter = null; - - //----------------------------------------------------------------------- - // construction - //----------------------------------------------------------------------- - - /** - * Creates one or more rules based on the description passed in. - * @param description The description of the rule(s). - * @param owner The rule set containing the new rule(s). - * @param predecessor The rule that precedes the new one(s) in "owner"'s - * rule list - * @param ownersOwner The RuleBasedNumberFormat that owns the - * rule set that owns the new rule(s) - * @return An instance of NFRule, or an array of NFRules - */ - public static Object makeRules(String description, - NFRuleSet owner, - NFRule predecessor, - RuleBasedNumberFormat ownersOwner) { - // we know we're making at least one rule, so go ahead and - // new it up and initialize its basevalue and divisor - // (this also strips the rule descriptor, if any, off the - // descripton string) - NFRule rule1 = new NFRule(ownersOwner); - description = rule1.parseRuleDescriptor(description); - - // check the description to see whether there's text enclosed - // in brackets - int brack1 = description.indexOf("["); - int brack2 = description.indexOf("]"); - - // if the description doesn't contain a matched pair of brackets, - // or if it's of a type that doesn't recognize bracketed text, - // then leave the description alone, initialize the rule's - // rule text and substitutions, and return that rule - if (brack1 == -1 || brack2 == -1 || brack1 > brack2 - || rule1.getBaseValue() == PROPER_FRACTION_RULE - || rule1.getBaseValue() == NEGATIVE_NUMBER_RULE) { - rule1.ruleText = description; - rule1.extractSubstitutions(owner, predecessor, ownersOwner); - return rule1; - } else { - // if the description does contain a matched pair of brackets, - // then it's really shorthand for two rules (with one exception) - NFRule rule2 = null; - StringBuffer sbuf = new StringBuffer(); - - // we'll actually only split the rule into two rules if its - // base value is an even multiple of its divisor (or it's one - // of the special rules) - if ((rule1.baseValue > 0 - && rule1.baseValue % (Math.pow(rule1.radix, rule1.exponent)) == 0) - || rule1.baseValue == IMPROPER_FRACTION_RULE - || rule1.baseValue == MASTER_RULE) { - - // if it passes that test, new up the second rule. If the - // rule set both rules will belong to is a fraction rule - // set, they both have the same base value; otherwise, - // increment the original rule's base value ("rule1" actually - // goes SECOND in the rule set's rule list) - rule2 = new NFRule(ownersOwner); - if (rule1.baseValue >= 0) { - rule2.baseValue = rule1.baseValue; - if (!owner.isFractionSet()) { - ++rule1.baseValue; - } - } - - // if the description began with "x.x" and contains bracketed - // text, it describes both the improper fraction rule and - // the proper fraction rule - else if (rule1.baseValue == IMPROPER_FRACTION_RULE) { - rule2.baseValue = PROPER_FRACTION_RULE; - } - - // if the description began with "x.0" and contains bracketed - // text, it describes both the master rule and the - // improper fraction rule - else if (rule1.baseValue == MASTER_RULE) { - rule2.baseValue = rule1.baseValue; - rule1.baseValue = IMPROPER_FRACTION_RULE; - } - - // both rules have the same radix and exponent (i.e., the - // same divisor) - rule2.radix = rule1.radix; - rule2.exponent = rule1.exponent; - - // rule2's rule text omits the stuff in brackets: initalize - // its rule text and substitutions accordingly - sbuf.append(description.substring(0, brack1)); - if (brack2 + 1 < description.length()) { - sbuf.append(description.substring(brack2 + 1)); - } - rule2.ruleText = sbuf.toString(); - rule2.extractSubstitutions(owner, predecessor, ownersOwner); - } - - // rule1's text includes the text in the brackets but omits - // the brackets themselves: initialize _its_ rule text and - // substitutions accordingly - sbuf.setLength(0); - sbuf.append(description.substring(0, brack1)); - sbuf.append(description.substring(brack1 + 1, brack2)); - if (brack2 + 1 < description.length()) { - sbuf.append(description.substring(brack2 + 1)); - } - rule1.ruleText = sbuf.toString(); - rule1.extractSubstitutions(owner, predecessor, ownersOwner); - - // if we only have one rule, return it; if we have two, return - // a two-element array containing them (notice that rule2 goes - // BEFORE rule1 in the list: in all cases, rule2 OMITS the - // material in the brackets and rule1 INCLUDES the material - // in the brackets) - if (rule2 == null) { - return rule1; - } else { - return new NFRule[] { rule2, rule1 }; - } - } - } - - /** - * Nominal constructor for NFRule. Most of the work of constructing - * an NFRule is actually performed by makeRules(). - */ - public NFRule(RuleBasedNumberFormat formatter) { - this.formatter = formatter; - } - - /** - * This function parses the rule's rule descriptor (i.e., the base - * value and/or other tokens that precede the rule's rule text - * in the description) and sets the rule's base value, radix, and - * exponent according to the descriptor. (If the description doesn't - * include a rule descriptor, then this function sets everything to - * default values and the rule set sets the rule's real base value). - * @param description The rule's description - * @return If "description" included a rule descriptor, this is - * "description" with the descriptor and any trailing whitespace - * stripped off. Otherwise; it's "descriptor" unchangd. - */ - private String parseRuleDescriptor(String description) { - String descriptor; - - // the description consists of a rule descriptor and a rule body, - // separated by a colon. The rule descriptor is optional. If - // it's omitted, just set the base value to 0. - int p = description.indexOf(":"); - if (p == -1) { - setBaseValue(0); - } else { - // copy the descriptor out into its own string and strip it, - // along with any trailing whitespace, out of the original - // description - descriptor = description.substring(0, p); - ++p; - while (p < description.length() && Character.isWhitespace(description.charAt(p))) - ++p; - description = description.substring(p); - - // check first to see if the rule descriptor matches the token - // for one of the special rules. If it does, set the base - // value to the correct identfier value - if (descriptor.equals("-x")) { - setBaseValue(NEGATIVE_NUMBER_RULE); - } - else if (descriptor.equals("x.x")) { - setBaseValue(IMPROPER_FRACTION_RULE); - } - else if (descriptor.equals("0.x")) { - setBaseValue(PROPER_FRACTION_RULE); - } - else if (descriptor.equals("x.0")) { - setBaseValue(MASTER_RULE); - } - - // if the rule descriptor begins with a digit, it's a descriptor - // for a normal rule - else if (descriptor.charAt(0) >= '0' && descriptor.charAt(0) <= '9') { - StringBuffer tempValue = new StringBuffer(); - p = 0; - char c = ' '; - - // begin parsing the descriptor: copy digits - // into "tempValue", skip periods, commas, and spaces, - // stop on a slash or > sign (or at the end of the string), - // and throw an exception on any other character - while (p < descriptor.length()) { - c = descriptor.charAt(p); - if (c >= '0' && c <= '9') { - tempValue.append(c); - } - else if (c == '/' || c == '>') { - break; - } - else if (Character.isWhitespace(c) || c == ',' || c == '.') { - } - else { - throw new IllegalArgumentException("Illegal character in rule descriptor"); - } - ++p; - } - - // tempValue now contains a string representation of the - // rule's base value with the punctuation stripped out. - // Set the rule's base value accordingly - setBaseValue(Long.parseLong(tempValue.toString())); - - // if we stopped the previous loop on a slash, we're - // now parsing the rule's radix. Again, accumulate digits - // in tempValue, skip punctuation, stop on a > mark, and - // throw an exception on anything else - if (c == '/') { - tempValue.setLength(0); - ++p; - while (p < descriptor.length()) { - c = descriptor.charAt(p); - if (c >= '0' && c <= '9') { - tempValue.append(c); - } - else if (c == '>') { - break; - } - else if (Character.isWhitespace(c) || c == ',' || c == '.') { - } - else { - throw new IllegalArgumentException("Illegal character is rule descriptor"); - } - ++p; - } - - // tempValue now contain's the rule's radix. Set it - // accordingly, and recalculate the rule's exponent - radix = Short.parseShort(tempValue.toString()); - if (radix == 0) { - throw new IllegalArgumentException("Rule can't have radix of 0"); - } - exponent = expectedExponent(); - } - - // if we stopped the previous loop on a > sign, then continue - // for as long as we still see > signs. For each one, - // decrement the exponent (unless the exponent is already 0). - // If we see another character before reaching the end of - // the descriptor, that's also a syntax error. - if (c == '>') { - while (p < descriptor.length()) { - c = descriptor.charAt(p); - if (c == '>' && exponent > 0) { - --exponent; - } else { - throw new IllegalArgumentException("Illegal character in rule descriptor"); - } - ++p; - } - } - } - } - - // finally, if the rule body begins with an apostrophe, strip it off - // (this is generally used to put whitespace at the beginning of - // a rule's rule text) - if (description.length() > 0 && description.charAt(0) == '\'') { - description = description.substring(1); - } - - // return the description with all the stuff we've just waded through - // stripped off the front. It now contains just the rule body. - return description; - } - - /** - * Searches the rule's rule text for the substitution tokens, - * creates the substitutions, and removes the substitution tokens - * from the rule's rule text. - * @param owner The rule set containing this rule - * @param predecessor The rule preseding this one in "owners" rule list - * @param ownersOwner The RuleBasedFormat that owns this rule - */ - private void extractSubstitutions(NFRuleSet owner, - NFRule predecessor, - RuleBasedNumberFormat ownersOwner) { - sub1 = extractSubstitution(owner, predecessor, ownersOwner); - sub2 = extractSubstitution(owner, predecessor, ownersOwner); - } - - /** - * Searches the rule's rule text for the first substitution token, - * creates a substitution based on it, and removes the token from - * the rule's rule text. - * @param owner The rule set containing this rule - * @param predecessor The rule preceding this one in the rule set's - * rule list - * @param ownersOwner The RuleBasedNumberFormat that owns this rule - * @return The newly-created substitution. This is never null; if - * the rule text doesn't contain any substitution tokens, this will - * be a NullSubstitution. - */ - private NFSubstitution extractSubstitution(NFRuleSet owner, - NFRule predecessor, - RuleBasedNumberFormat ownersOwner) { - NFSubstitution result = null; - int subStart; - int subEnd; - - // search the rule's rule text for the first two characters of - // a substitution token - subStart = indexOfAny(new String[] { "<<", "<%", "<#", "<0", - ">>", ">%", ">#", ">0", - "=%", "=#", "=0" } ); - - // if we didn't find one, create a null substitution positioned - // at the end of the rule text - if (subStart == -1) { - return NFSubstitution.makeSubstitution(ruleText.length(), this, predecessor, - owner, ownersOwner, ""); - } - - // special-case the ">>>" token, since searching for the > at the - // end will actually find the > in the middle - if (ruleText.substring(subStart).startsWith(">>>")) { - subEnd = subStart + 2; - - // otherwise the substitution token ends with the same character - // it began with - } else { - subEnd = ruleText.indexOf(ruleText.charAt(subStart), subStart + 1); - } - - // if we don't find the end of the token (i.e., if we're on a single, - // unmatched token character), create a null substitution positioned - // at the end of the rule - if (subEnd == -1) { - return NFSubstitution.makeSubstitution(ruleText.length(), this, predecessor, - owner, ownersOwner, ""); - } - - // if we get here, we have a real substitution token (or at least - // some text bounded by substitution token characters). Use - // makeSubstitution() to create the right kind of substitution - result = NFSubstitution.makeSubstitution(subStart, this, predecessor, owner, - ownersOwner, ruleText.substring(subStart, subEnd + 1)); - - // remove the substitution from the rule text - ruleText = ruleText.substring(0, subStart) + ruleText.substring(subEnd + 1); - return result; - } - - /** - * Sets the rule's base value, and causes the radix and exponent - * to be recalculated. This is used during construction when we - * don't know the rule's base value until after it's been - * constructed. It should be used at any other time. - * @param The new base value for the rule. - */ - public final void setBaseValue(long newBaseValue) { - // set the base value - baseValue = newBaseValue; - - // if this isn't a special rule, recalculate the radix and exponent - // (the radix always defaults to 10; if it's supposed to be something - // else, it's cleaned up by the caller and the exponent is - // recalculated again-- the only function that does this is - // NFRule.parseRuleDescriptor() ) - if (baseValue >= 1) { - radix = 10; - exponent = expectedExponent(); - - // this function gets called on a fully-constructed rule whose - // description didn't specify a base value. This means it - // has substitutions, and some substitutions hold on to copies - // of the rule's divisor. Fix their copies of the divisor. - if (sub1 != null) { - sub1.setDivisor(radix, exponent); - } - if (sub2 != null) { - sub2.setDivisor(radix, exponent); - } - - // if this is a special rule, its radix and exponent are basically - // ignored. Set them to "safe" default values - } else { - radix = 10; - exponent = 0; - } - } - - /** - * This calculates the rule's exponent based on its radix and base - * value. This will be the highest power the radix can be raised to - * and still produce a result less than or equal to the base value. - */ - private short expectedExponent() { - // since the log of 0, or the log base 0 of something, causes an - // error, declare the exponent in these cases to be 0 (we also - // deal with the special-rule identifiers here) - if (radix == 0 || baseValue < 1) { - return 0; - } - - // we get rounding error in some cases-- for example, log 1000 / log 10 - // gives us 1.9999999996 instead of 2. The extra logic here is to take - // that into account - short tempResult = (short)(Math.log(baseValue) / Math.log(radix)); - if (Math.pow(radix, tempResult + 1) <= baseValue) { - return (short)(tempResult + 1); - } else { - return tempResult; - } - } - - /** - * Searches the rule's rule text for any of the specified strings. - * @param strings An array of strings to search the rule's rule - * text for - * @return The index of the first match in the rule's rule text - * (i.e., the first substring in the rule's rule text that matches - * _any_ of the strings in "strings"). If none of the strings in - * "strings" is found in the rule's rule text, returns -1. - */ - private int indexOfAny(String[] strings) { - int pos; - int result = -1; - for (int i = 0; i < strings.length; i++) { - pos = ruleText.indexOf(strings[i]); - if (pos != -1 && (result == -1 || pos < result)) { - result = pos; - } - } - return result; - } - - //----------------------------------------------------------------------- - // boilerplate - //----------------------------------------------------------------------- - - /** - * Tests two rules for equality. - * @param that The rule to compare this one against - * @return True is the two rules are functionally equivalent - */ - public boolean equals(Object that) { - if (that instanceof NFRule) { - NFRule that2 = (NFRule)that; - - return baseValue == that2.baseValue - && radix == that2.radix - && exponent == that2.exponent - && ruleText.equals(that2.ruleText) - && sub1.equals(that2.sub1) - && sub2.equals(that2.sub2); - } else { - return false; - } - } - - /** - * Returns a textual representation of the rule. This won't - * necessarily be the same as the description that this rule - * was created with, but it will produce the same result. - * @return A textual description of the rule - */ - public String toString() { - StringBuffer result = new StringBuffer(); - - // start with the rule descriptor. Special-case the special rules - if (baseValue == NEGATIVE_NUMBER_RULE) { - result.append("-x: "); - } - else if (baseValue == IMPROPER_FRACTION_RULE) { - result.append("x.x: "); - } - else if (baseValue == PROPER_FRACTION_RULE) { - result.append("0.x: "); - } - else if (baseValue == MASTER_RULE) { - result.append("x.0: "); - } - - // for a normal rule, write out its base value, and if the radix is - // something other than 10, write out the radix (with the preceding - // slash, of course). Then calculate the expected exponent and if - // if isn't the same as the actual exponent, write an appropriate - // number of > signs. Finally, terminate the whole thing with - // a colon. - else { - result.append(String.valueOf(baseValue)); - if (radix != 10) { - result.append('/'); - result.append(String.valueOf(radix)); - } - int numCarets = expectedExponent() - exponent; - for (int i = 0; i < numCarets; i++) - result.append('>'); - result.append(": "); - } - - // if the rule text begins with a space, write an apostrophe - // (whitespace after the rule descriptor is ignored; the - // apostrophe is used to make the whitespace significant) - if (ruleText.startsWith(" ") && (sub1 == null || sub1.getPos() != 0)) { - result.append("\'"); - } - - // now, write the rule's rule text, inserting appropriate - // substitution tokens in the appropriate places - StringBuffer ruleTextCopy = new StringBuffer(ruleText); - ruleTextCopy.insert(sub2.getPos(), sub2.toString()); - ruleTextCopy.insert(sub1.getPos(), sub1.toString()); - result.append(ruleTextCopy); - - // and finally, top the whole thing off with a semicolon and - // return the result - result.append(';'); - return result.toString(); - } - - //----------------------------------------------------------------------- - // simple accessors - //----------------------------------------------------------------------- - - /** - * Returns the rule's base value - * @return The rule's base value - */ - public final long getBaseValue() { - return baseValue; - } - - /** - * Returns the rule's divisor (the value that cotrols the behavior - * of its substitutions) - * @return The rule's divisor - */ - public double getDivisor() { - return Math.pow(radix, exponent); - } - - //----------------------------------------------------------------------- - // formatting - //----------------------------------------------------------------------- - - /** - * Formats the number, and inserts the resulting text into - * toInsertInto. - * @param number The number being formatted - * @param toInsertInto The string where the resultant text should - * be inserted - * @param pos The position in toInsertInto where the resultant text - * should be inserted - */ - public void doFormat(long number, StringBuffer toInsertInto, int pos) { - // first, insert the rule's rule text into toInsertInto at the - // specified position, then insert the results of the substitutions - // into the right places in toInsertInto (notice we do the - // substitutions in reverse order so that the offsets don't get - // messed up) - toInsertInto.insert(pos, ruleText); - sub2.doSubstitution(number, toInsertInto, pos); - sub1.doSubstitution(number, toInsertInto, pos); - } - - /** - * Formats the number, and inserts the resulting text into - * toInsertInto. - * @param number The number being formatted - * @param toInsertInto The string where the resultant text should - * be inserted - * @param pos The position in toInsertInto where the resultant text - * should be inserted - */ - public void doFormat(double number, StringBuffer toInsertInto, int pos) { - // first, insert the rule's rule text into toInsertInto at the - // specified position, then insert the results of the substitutions - // into the right places in toInsertInto - // [again, we have two copies of this routine that do the same thing - // so that we don't sacrifice precision in a long by casting it - // to a double] - toInsertInto.insert(pos, ruleText); - sub2.doSubstitution(number, toInsertInto, pos); - sub1.doSubstitution(number, toInsertInto, pos); - } - - /** - * Used by the owning rule set to determine whether to invoke the - * rollback rule (i.e., whether this rule or the one that precedes - * it in the rule set's list should be used to format the number) - * @param The number being formatted - * @return True if the rule set should use the rule that precedes - * this one in its list; false if it should use this rule - */ - public boolean shouldRollBack(double number) { - // we roll back if the rule contains a modulus substitution, - // the number being formatted is an even multiple of the rule's - // divisor, and the rule's base value is NOT an even multiple - // of its divisor - // In other words, if the original description had - // 100: << hundred[ >>]; - // that expands into - // 100: << hundred; - // 101: << hundred >>; - // internally. But when we're formatting 200, if we use the rule - // at 101, which would normally apply, we get "two hundred zero". - // To prevent this, we roll back and use the rule at 100 instead. - // This is the logic that makes this happen: the rule at 101 has - // a modulus substitution, its base value isn't an even multiple - // of 100, and the value we're trying to format _is_ an even - // multiple of 100. This is called the "rollback rule." - if ((sub1.isModulusSubstitution()) || (sub2.isModulusSubstitution())) { - return (number % Math.pow(radix, exponent)) == 0 - && (baseValue % Math.pow(radix, exponent)) != 0; - } - return false; - } - - //----------------------------------------------------------------------- - // parsing - //----------------------------------------------------------------------- - - /** - * Attempts to parse the string with this rule. - * @param text The string being parsed - * @param parsePosition On entry, the value is ignored and assumed to - * be 0. On exit, this has been updated with the position of the first - * character not consumed by matching the text against this rule - * (if this rule doesn't match the text at all, the parse position - * if left unchanged (presumably at 0) and the function returns - * new Long(0)). - * @param isFractionRule True if this rule is contained within a - * fraction rule set. This is only used if the rule has no - * substitutions. - * @return If this rule matched the text, this is the rule's base value - * combined appropriately with the results of parsing the substitutions. - * If nothing matched, this is new Long(0) and the parse position is - * left unchanged. The result will be an instance of Long if the - * result is an integer and Double otherwise. The result is never null. - */ - public Number doParse(String text, ParsePosition parsePosition, boolean isFractionRule, - double upperBound) { - - // internally we operate on a copy of the string being parsed - // (because we're going to change it) and use our own ParsePosition - ParsePosition pp = new ParsePosition(0); - String workText = new String(text); - - // check to see whether the text before the first substitution - // matches the text at the beginning of the string being - // parsed. If it does, strip that off the front of workText; - // otherwise, dump out with a mismatch - workText = stripPrefix(workText, ruleText.substring(0, sub1.getPos()), pp); - int prefixLength = text.length() - workText.length(); - - if (pp.getIndex() == 0 && sub1.getPos() != 0) { -// commented out because ParsePosition doesn't have error index in 1.1.x -// parsePosition.setErrorIndex(pp.getErrorIndex()); - return new Long(0); - } - - // this is the fun part. The basic guts of the rule-matching - // logic is matchToDelimiter(), which is called twice. The first - // time it searches the input string for the rule text BETWEEN - // the substitutions and tries to match the intervening text - // in the input string with the first substitution. If that - // succeeds, it then calls it again, this time to look for the - // rule text after the second substitution and to match the - // intervening input text against the second substitution. - // - // For example, say we have a rule that looks like this: - // first << middle >> last; - // and input text that looks like this: - // first one middle two last - // First we use stripPrefix() to match "first " in both places and - // strip it off the front, leaving - // one middle two last - // Then we use matchToDelimiter() to match " middle " and try to - // match "one" against a substitution. If it's successful, we now - // have - // two last - // We use matchToDelimiter() a second time to match " last" and - // try to match "two" against a substitution. If "two" matches - // the substitution, we have a successful parse. - // - // Since it's possible in many cases to find multiple instances - // of each of these pieces of rule text in the input string, - // we need to try all the possible combinations of these - // locations. This prevents us from prematurely declaring a mismatch, - // and makes sure we match as much input text as we can. - int highWaterMark = 0; - double result = 0; - int start = 0; - double tempBaseValue = Math.max(0, baseValue); - - do { - // our partial parse result starts out as this rule's base - // value. If it finds a successful match, matchToDelimiter() - // will compose this in some way with what it gets back from - // the substitution, giving us a new partial parse result - pp.setIndex(0); - double partialResult = matchToDelimiter(workText, start, tempBaseValue, - ruleText.substring(sub1.getPos(), sub2.getPos()), pp, sub1, - upperBound).doubleValue(); - - // if we got a successful match (or were trying to match a - // null substitution), pp is now pointing at the first unmatched - // character. Take note of that, and try matchToDelimiter() - // on the input text again - if (pp.getIndex() != 0 || sub1.isNullSubstitution()) { - start = pp.getIndex(); - - String workText2 = workText.substring(pp.getIndex()); - ParsePosition pp2 = new ParsePosition(0); - - // the second matchToDelimiter() will compose our previous - // partial result with whatever it gets back from its - // substitution if there's a successful match, giving us - // a real result - partialResult = matchToDelimiter(workText2, 0, partialResult, - ruleText.substring(sub2.getPos()), pp2, sub2, - upperBound).doubleValue(); - - // if we got a successful match on this second - // matchToDelimiter() call, update the high-water mark - // and result (if necessary) - if (pp2.getIndex() != 0 || sub2.isNullSubstitution()) { - if (prefixLength + pp.getIndex() + pp2.getIndex() > highWaterMark) { - highWaterMark = prefixLength + pp.getIndex() + pp2.getIndex(); - result = partialResult; - } - } -// commented out because ParsePosition doesn't have error index in 1.1.x -// else { -// int temp = pp2.getErrorIndex() + sub1.getPos() + pp.getIndex(); -// if (temp> parsePosition.getErrorIndex()) { -// parsePosition.setErrorIndex(temp); -// } -// } - } -// commented out because ParsePosition doesn't have error index in 1.1.x -// else { -// int temp = sub1.getPos() + pp.getErrorIndex(); -// if (temp > parsePosition.getErrorIndex()) { -// parsePosition.setErrorIndex(temp); -// } -// } - // keep trying to match things until the outer matchToDelimiter() - // call fails to make a match (each time, it picks up where it - // left off the previous time) - } while (sub1.getPos() != sub2.getPos() && pp.getIndex() > 0 && pp.getIndex() - < workText.length() && pp.getIndex() != start); - - // update the caller's ParsePosition with our high-water mark - // (i.e., it now points at the first character this function - // didn't match-- the ParsePosition is therefore unchanged if - // we didn't match anything) - parsePosition.setIndex(highWaterMark); -// commented out because ParsePosition doesn't have error index in 1.1.x -// if (highWaterMark > 0) { -// parsePosition.setErrorIndex(0); -// } - - // this is a hack for one unusual condition: Normally, whether this - // rule belong to a fraction rule set or not is handled by its - // substitutions. But if that rule HAS NO substitutions, then - // we have to account for it here. By definition, if the matching - // rule in a fraction rule set has no substitutions, its numerator - // is 1, and so the result is the reciprocal of its base value. - if (isFractionRule && highWaterMark > 0 && sub1.isNullSubstitution()) { - result = 1 / result; - } - - // return the result as a Long if possible, or as a Double - if (result == (long)result) { - return new Long((long)result); - } else { - return new Double(result); - } - } - - /** - * This function is used by parse() to match the text being parsed - * against a possible prefix string. This function - * matches characters from the beginning of the string being parsed - * to characters from the prospective prefix. If they match, pp is - * updated to the first character not matched, and the result is - * the unparsed part of the string. If they don't match, the whole - * string is returned, and pp is left unchanged. - * @param text The string being parsed - * @param prefix The text to match against - * @param pp On entry, ignored and assumed to be 0. On exit, points - * to the first unmatched character (assuming the whole prefix matched), - * or is unchanged (if the whole prefix didn't match). - * @return If things match, this is the unparsed part of "text"; - * if they didn't match, this is "text". - */ - private String stripPrefix(String text, String prefix, ParsePosition pp) { - // if the prefix text is empty, dump out without doing anything - if (prefix.length() == 0) { - return text; - } else { - // otherwise, use prefixLength() to match the beginning of - // "text" against "prefix". This function returns the - // number of characters from "text" that matched (or 0 if - // we didn't match the whole prefix) - int pfl = prefixLength(text, prefix); - if (pfl != 0) { - // if we got a successful match, update the parse position - // and strip the prefix off of "text" - pp.setIndex(pp.getIndex() + pfl); - return text.substring(pfl); - - // if we didn't get a successful match, leave everything alone - } else { - return text; - } - } - } - - /** - * Used by parse() to match a substitution and any following text. - * "text" is searched for instances of "delimiter". For each instance - * of delimiter, the intervening text is tested to see whether it - * matches the substitution. The longest match wins. - * @param text The string being parsed - * @param startPos The position in "text" where we should start looking - * for "delimiter". - * @param baseValue A partial parse result (often the rule's base value), - * which is combined with the result from matching the substitution - * @param delimiter The string to search "text" for. - * @param pp Ignored and presumed to be 0 on entry. If there's a match, - * on exit this will point to the first unmatched character. - * @param sub If we find "delimiter" in "text", this substitution is used - * to match the text between the beginning of the string and the - * position of "delimiter." (If "delimiter" is the empty string, then - * this function just matches against this substitution and updates - * everything accordingly.) - * @param upperBound When matching the substitution, it will only - * consider rules with base values lower than this value. - * @return If there's a match, this is the result of composing - * baseValue with the result of matching the substitution. Otherwise, - * this is new Long(0). It's never null. If the result is an integer, - * this will be an instance of Long; otherwise, it's an instance of - * Double. - */ - private Number matchToDelimiter(String text, int startPos, double baseValue, - String delimiter, ParsePosition pp, NFSubstitution sub, double upperBound) { - // if "delimiter" contains real (i.e., non-ignorable) text, search - // it for "delimiter" beginning at "start". If that succeeds, then - // use "sub"'s doParse() method to match the text before the - // instance of "delimiter" we just found. - if (!allIgnorable(delimiter)) { - ParsePosition tempPP = new ParsePosition(0); - Number tempResult; - - // use findText() to search for "delimiter". It returns a two- - // element array: element 0 is the position of the match, and - // element 1 is the number of characters that matched - // "delimiter". - int[] temp = findText(text, delimiter, startPos); - int dPos = temp[0]; - int dLen = temp[1]; - - // if findText() succeeded, isolate the text preceding the - // match, and use "sub" to match that text - while (dPos >= 0) { - String subText = text.substring(0, dPos); - if (subText.length() > 0) { - tempResult = sub.doParse(subText, tempPP, baseValue, upperBound, - formatter.lenientParseEnabled()); - - // if the substitution could match all the text up to - // where we found "delimiter", then this function has - // a successful match. Bump the caller's parse position - // to point to the first character after the text - // that matches "delimiter", and return the result - // we got from parsing the substitution. - if (tempPP.getIndex() == dPos) { - pp.setIndex(dPos + dLen); - return tempResult; - } -// commented out because ParsePosition doesn't have error index in 1.1.x -// else { -// if (tempPP.getErrorIndex() > 0) { -// pp.setErrorIndex(tempPP.getErrorIndex()); -// } else { -// pp.setErrorIndex(tempPP.getIndex()); -// } -// } - } - - // if we didn't match the substitution, search for another - // copy of "delimiter" in "text" and repeat the loop if - // we find it - tempPP.setIndex(0); - temp = findText(text, delimiter, dPos + dLen); - dPos = temp[0]; - dLen = temp[1]; - } - // if we make it here, this was an unsuccessful match, and we - // leave pp unchanged and return 0 - pp.setIndex(0); - return new Long(0); - - // if "delimiter" is empty, or consists only of ignorable characters - // (i.e., is semantically empty), thwe we obviously can't search - // for "delimiter". Instead, just use "sub" to parse as much of - // "text" as possible. - } else { - ParsePosition tempPP = new ParsePosition(0); - Number result = new Long(0); - Number tempResult; - - // try to match the whole string against the substitution - tempResult = sub.doParse(text, tempPP, baseValue, upperBound, - formatter.lenientParseEnabled()); - if (tempPP.getIndex() != 0 || sub.isNullSubstitution()) { - // if there's a successful match (or it's a null - // substitution), update pp to point to the first - // character we didn't match, and pass the result from - // sub.doParse() on through to the caller - pp.setIndex(tempPP.getIndex()); - if (tempResult != null) { - result = tempResult; - } - } -// commented out because ParsePosition doesn't have error index in 1.1.x -// else { -// pp.setErrorIndex(tempPP.getErrorIndex()); -// } - - // and if we get to here, then nothing matched, so we return - // 0 and leave pp alone - return result; - } - } - - /** - * Used by stripPrefix() to match characters. If lenient parse mode - * is off, this just calls startsWith(). If lenient parse mode is on, - * this function uses CollationElementIterators to match characters in - * the strings (only primary-order differences are significant in - * determining whether there's a match). - * @param str The string being tested - * @param prefix The text we're hoping to see at the beginning - * of "str" - * @return If "prefix" is found at the beginning of "str", this - * is the number of characters in "str" that were matched (this - * isn't necessarily the same as the length of "prefix" when matching - * text with a collator). If there's no match, this is 0. - */ - private int prefixLength(String str, String prefix) { - // if we're looking for an empty prefix, it obviously matches - // zero characters. Just go ahead and return 0. - if (prefix.length() == 0) { - return 0; - } - - // go through all this grief if we're in lenient-parse mode - if (formatter.lenientParseEnabled()) { - // get the formatter's collator and use it to create two - // collation element iterators, one over the target string - // and another over the prefix (right now, we'll throw an - // exception if the collator we get back from the formatter - // isn't a RuleBasedCollator, because RuleBasedCollator defines - // the CollationElementIteratoer protocol. Hopefully, this - // will change someday.) - // - // Previous code was matching "fifty-" against " fifty" and leaving - // the number " fifty-7" to parse as 43 (50 - 7). - // Also it seems that if we consume the entire prefix, that's ok even - // if we've consumed the entire string, so I switched the logic to - // reflect this. - RuleBasedCollator collator = (RuleBasedCollator)formatter.getCollator(); - CollationElementIterator strIter = collator.getCollationElementIterator(str); - CollationElementIterator prefixIter = collator.getCollationElementIterator(prefix); - - // match collation elements between the strings - int oStr = strIter.next(); - int oPrefix = prefixIter.next(); - - while (oPrefix != CollationElementIterator.NULLORDER) { - // skip over ignorable characters in the target string - while (CollationElementIterator.primaryOrder(oStr) == 0 && oStr != - CollationElementIterator.NULLORDER) { - oStr = strIter.next(); - } - - // skip over ignorable characters in the prefix - while (CollationElementIterator.primaryOrder(oPrefix) == 0 && oPrefix != - CollationElementIterator.NULLORDER) { - oPrefix = prefixIter.next(); - } - - // if skipping over ignorables brought to the end of - // the prefix, we DID match: drop out of the loop - if (oPrefix == CollationElementIterator.NULLORDER) { - break; - } - - // if skipping over ignorables brought us to the end - // of the target string, we didn't match and return 0 - if (oStr == CollationElementIterator.NULLORDER) { - return 0; - } - - // match collation elements from the two strings - // (considering only primary differences). If we - // get a mismatch, dump out and return 0 - if (CollationElementIterator.primaryOrder(oStr) != CollationElementIterator. - primaryOrder(oPrefix)) { - return 0; - } - // otherwise, advance to the next character in each string - // and loop (we drop out of the loop when we exhaust - // collation elements in the prefix) - - oStr = strIter.next(); - oPrefix = prefixIter.next(); - } - - // we are not compatible with jdk 1.1 any longer - int result = strIter.getOffset(); - if (oStr != CollationElementIterator.NULLORDER) { - --result; - } - return result; - - /* - //---------------------------------------------------------------- - // JDK 1.2-specific API call - // return strIter.getOffset(); - //---------------------------------------------------------------- - // JDK 1.1 HACK (take out for 1.2-specific code) - - // if we make it to here, we have a successful match. Now we - // have to find out HOW MANY characters from the target string - // matched the prefix (there isn't necessarily a one-to-one - // mapping between collation elements and characters). - // In JDK 1.2, there's a simple getOffset() call we can use. - // In JDK 1.1, on the other hand, we have to go through some - // ugly contortions. First, use the collator to compare the - // same number of characters from the prefix and target string. - // If they're equal, we're done. - collator.setStrength(Collator.PRIMARY); - if (str.length() >= prefix.length() - && collator.equals(str.substring(0, prefix.length()), prefix)) { - return prefix.length(); - } - - // if they're not equal, then we have to compare successively - // larger and larger substrings of the target string until we - // get to one that matches the prefix. At that point, we know - // how many characters matched the prefix, and we can return. - int p = 1; - while (p <= str.length()) { - if (collator.equals(str.substring(0, p), prefix)) { - return p; - } else { - ++p; - } - } - - // SHOULKD NEVER GET HERE!!! - return 0; - //---------------------------------------------------------------- - */ - - // If lenient parsing is turned off, forget all that crap above. - // Just use String.startsWith() and be done with it. - } else { - if (str.startsWith(prefix)) { - return prefix.length(); - } else { - return 0; - } - } - } - - /** - * Searches a string for another string. If lenient parsing is off, - * this just calls indexOf(). If lenient parsing is on, this function - * uses CollationElementIterator to match characters, and only - * primary-order differences are significant in determining whether - * there's a match. - * @param str The string to search - * @param key The string to search "str" for - * @return A two-element array of ints. Element 0 is the position - * of the match, or -1 if there was no match. Element 1 is the - * number of characters in "str" that matched (which isn't necessarily - * the same as the length of "key") - */ - private int[] findText(String str, String key) { - return findText(str, key, 0); - } - - /** - * Searches a string for another string. If lenient parsing is off, - * this just calls indexOf(). If lenient parsing is on, this function - * uses CollationElementIterator to match characters, and only - * primary-order differences are significant in determining whether - * there's a match. - * @param str The string to search - * @param key The string to search "str" for - * @param startingAt The index into "str" where the search is to - * begin - * @return A two-element array of ints. Element 0 is the position - * of the match, or -1 if there was no match. Element 1 is the - * number of characters in "str" that matched (which isn't necessarily - * the same as the length of "key") - */ - private int[] findText(String str, String key, int startingAt) { - // if lenient parsing is turned off, this is easy: just call - // String.indexOf() and we're done - if (!formatter.lenientParseEnabled()) { - return new int[] { str.indexOf(key, startingAt), key.length() }; - - // but if lenient parsing is turned ON, we've got some work - // ahead of us - } else { - //---------------------------------------------------------------- - // JDK 1.1 HACK (take out of 1.2-specific code) - - // in JDK 1.2, CollationElementIterator provides us with an - // API to map between character offsets and collation elements - // and we can do this by marching through the string comparing - // collation elements. We can't do that in JDK 1.1. Insted, - // we have to go through this horrible slow mess: - int p = startingAt; - int keyLen = 0; - - // basically just isolate smaller and smaller substrings of - // the target string (each running to the end of the string, - // and with the first one running from startingAt to the end) - // and then use prefixLength() to see if the search key is at - // the beginning of each substring. This is excruciatingly - // slow, but it will locate the key and tell use how long the - // matching text was. - while (p < str.length() && keyLen == 0) { - keyLen = prefixLength(str.substring(p), key); - if (keyLen != 0) { - return new int[] { p, keyLen }; - } - ++p; - } - // if we make it to here, we didn't find it. Return -1 for the - // location. The length should be ignored, but set it to 0, - // which should be "safe" - return new int[] { -1, 0 }; - - //---------------------------------------------------------------- - // JDK 1.2 version of this routine - //RuleBasedCollator collator = (RuleBasedCollator)formatter.getCollator(); - // - //CollationElementIterator strIter = collator.getCollationElementIterator(str); - //CollationElementIterator keyIter = collator.getCollationElementIterator(key); - // - //int keyStart = -1; - // - //str.setOffset(startingAt); - // - //int oStr = strIter.next(); - //int oKey = keyIter.next(); - //while (oKey != CollationElementIterator.NULLORDER) { - // while (oStr != CollationElementIterator.NULLORDER && - // CollationElementIterator.primaryOrder(oStr) == 0) - // oStr = strIter.next(); - // - // while (oKey != CollationElementIterator.NULLORDER && - // CollationElementIterator.primaryOrder(oKey) == 0) - // oKey = keyIter.next(); - // - // if (oStr == CollationElementIterator.NULLORDER) { - // return new int[] { -1, 0 }; - // } - // - // if (oKey == CollationElementIterator.NULLORDER) { - // break; - // } - // - // if (CollationElementIterator.primaryOrder(oStr) == - // CollationElementIterator.primaryOrder(oKey)) { - // keyStart = strIter.getOffset(); - // oStr = strIter.next(); - // oKey = keyIter.next(); - // } else { - // if (keyStart != -1) { - // keyStart = -1; - // keyIter.reset(); - // } else { - // oStr = strIter.next(); - // } - // } - //} - // - //if (oKey == CollationElementIterator.NULLORDER) { - // return new int[] { keyStart, strIter.getOffset() - keyStart }; - //} else { - // return new int[] { -1, 0 }; - //} - } - } - - /** - * Checks to see whether a string consists entirely of ignorable - * characters. - * @param str The string to test. - * @return true if the string is empty of consists entirely of - * characters that the number formatter's collator says are - * ignorable at the primary-order level. false otherwise. - */ - private boolean allIgnorable(String str) { - // if the string is empty, we can just return true - if (str.length() == 0) { - return true; - } - - // if lenient parsing is turned on, walk through the string with - // a collation element iterator and make sure each collation - // element is 0 (ignorable) at the primary level - if (formatter.lenientParseEnabled()) { - RuleBasedCollator collator = (RuleBasedCollator)(formatter.getCollator()); - CollationElementIterator iter = collator.getCollationElementIterator(str); - - int o = iter.next(); - while (o != CollationElementIterator.NULLORDER - && CollationElementIterator.primaryOrder(o) == 0) { - o = iter.next(); - } - return o == CollationElementIterator.NULLORDER; - // if lenient parsing is turned off, there is no such thing as - // an ignorable character: return true only if the string is empty - } else { - return false; - } - } -} diff --git a/icu4j/src/com/ibm/text/NFRuleSet.java b/icu4j/src/com/ibm/text/NFRuleSet.java deleted file mode 100755 index e461d5b171..0000000000 --- a/icu4j/src/com/ibm/text/NFRuleSet.java +++ /dev/null @@ -1,746 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/NFRuleSet.java,v $ - * $Date: 2000/03/10 04:07:21 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.text.*; -import java.util.Vector; - -/** - * A collection of rules used by a RuleBasedNumberFormat to format and - * parse numbers. It is the responsibility of a RuleSet to select an - * appropriate rule for formatting a particular number and dispatch - * control to it, and to arbitrate between different rules when parsing - * a number. - * $RCSfile: NFRuleSet.java,v $ $Revision: 1.2 $ $Date: 2000/03/10 04:07:21 $ - */ -final class NFRuleSet { - //----------------------------------------------------------------------- - // constants - //----------------------------------------------------------------------- - - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - //----------------------------------------------------------------------- - // data members - //----------------------------------------------------------------------- - - /** - * The rule set's name - */ - private String name; - - /** - * The rule set's regular rules - */ - private NFRule[] rules; - - /** - * The rule set's negative-number rule - */ - private NFRule negativeNumberRule = null; - - /** - * The rule set's fraction rules: element 0 is the proper fraction - * (0.x) rule, element 1 is the improper fraction (x.x) rule, and - * element 2 is the master (x.0) rule. - */ - private NFRule[] fractionRules = new NFRule[3]; - - /** - * True if the rule set is a fraction rule set. A fraction rule set - * is a rule set that is used to format the fractional part of a - * number. It is called from a >> substitution in another rule set's - * fraction rule, and is only called upon to format values between - * 0 and 1. A fraction rule set has different rule-selection - * behavior than a regular rule set. - */ - private boolean isFractionRuleSet = false; - - //----------------------------------------------------------------------- - // construction - //----------------------------------------------------------------------- - - /* - * Constructs a rule set. - * @param descriptions An array of Strings representing rule set - * descriptions. On exit, this rule set's entry in the array will - * have been stripped of its rule set name and any trailing whitespace. - * @param index The index into "descriptions" of the description - * for the rule to be constructed - */ - public NFRuleSet(String[] descriptions, int index) throws IllegalArgumentException { - String description = descriptions[index]; - - // if the description begins with a rule set name (the rule set - // name can be omitted in formatter descriptions that consist - // of only one rule set), copy it out into our "name" member - // and delete it from the description - if (description.charAt(0) == '%') { - int pos = description.indexOf(':'); - if (pos == -1) { - throw new IllegalArgumentException("Rule set name doesn't end in colon"); - } else { - name = description.substring(0, pos); - while (pos < description.length() && Character.isWhitespace(description. - charAt(++pos))) { - } - description = description.substring(pos); - descriptions[index] = description; - } - - // if the description doesn't begin with a rule set name, its - // name is "%default" - } else { - name = "%default"; - } - - if (description.length() == 0) { - throw new IllegalArgumentException("Empty rule set description"); - } - - // all of the other members of NFRuleSet are initialized - // by parseRules() - } - - /** - * Construct the subordinate data structures used by this object. - * This function is called by the RuleBasedNumberFormat constructor - * after all the rule sets have been created to actually parse - * the description and build rules from it. Since any rule set - * can refer to any other rule set, we have to have created all of - * them before we can create anything else. - * @param description The textual description of this rule set - * @param owner The formatter that owns this rule set - */ - public void parseRules(String description, - RuleBasedNumberFormat owner) { - // start by creating a Vector whose elements are Strings containing - // the descriptions of the rules (one rule per element). The rules - // are separated by semicolons (there's no escape facility: ALL - // semicolons are rule delimiters) - Vector ruleDescriptions = new Vector(); - - int oldP = 0; - int p = description.indexOf(';'); - while (oldP != -1) { - if (p != -1) { - ruleDescriptions.addElement(description.substring(oldP, p)); - oldP = p + 1; - } else { - if (oldP < description.length()) { - ruleDescriptions.addElement(description.substring(oldP)); - } - oldP = p; - } - p = description.indexOf(';', p + 1); - } - - // now go back through and build a vector of the rules themselves - // (the number of elements in the description list isn't necessarily - // the number of rules-- some descriptions may expend into two rules) - Vector tempRules = new Vector(); - - // we keep track of the rule before the one we're currently working - // on solely to support >>> substitutions - NFRule predecessor = null; - for (int i = 0; i < ruleDescriptions.size(); i++) { - // makeRules (a factory method on NFRule) will return either - // a single rule or an array of rules. Either way, add them - // to our rule vector - Object temp = NFRule.makeRules((String)ruleDescriptions.elementAt(i), - this, predecessor, owner); - - if (temp instanceof NFRule) { - tempRules.addElement(temp); - predecessor = (NFRule)temp; - } - else if (temp instanceof NFRule[]) { - NFRule[] rulesToAdd = (NFRule[])temp; - - for (int j = 0; j < rulesToAdd.length; j++) { - tempRules.addElement(rulesToAdd[j]); - predecessor = rulesToAdd[j]; - } - } - } - // now we can bag the description list - ruleDescriptions = null; - - // for rules that didn't specify a base value, their base values - // were initialized to 0. Make another pass through the list and - // set all those rules' base values. We also remove any special - // rules from the list and put them into their own member variables - long defaultBaseValue = 0; - - // (this isn't a for loop because we might be deleting items from - // the vector-- we want to make sure we only increment i when - // we _didn't_ delete aything from the vector) - int i = 0; - while (i < tempRules.size()) { - NFRule rule = (NFRule)tempRules.elementAt(i); - - switch ((int)rule.getBaseValue()) { - // if the rule's base value is 0, fill in a default - // base value (this will be 1 plus the preceding - // rule's base value for regular rule sets, and the - // same as the preceding rule's base value in fraction - // rule sets) - case 0: - rule.setBaseValue(defaultBaseValue); - if (!isFractionRuleSet) { - ++defaultBaseValue; - } - ++i; - break; - - // if it's the negative-number rule, copy it into its own - // data member and delete it from the list - case NFRule.NEGATIVE_NUMBER_RULE: - negativeNumberRule = rule; - tempRules.removeElementAt(i); - break; - - // if it's the improper fraction rule, copy it into the - // correct element of fractionRules - case NFRule.IMPROPER_FRACTION_RULE: - fractionRules[0] = rule; - tempRules.removeElementAt(i); - break; - - // if it's the proper fraction rule, copy it into the - // correct element of fractionRules - case NFRule.PROPER_FRACTION_RULE: - fractionRules[1] = rule; - tempRules.removeElementAt(i); - break; - - // if it's the master rule, copy it into the - // correct element of fractionRules - case NFRule.MASTER_RULE: - fractionRules[2] = rule; - tempRules.removeElementAt(i); - break; - - // if it's a regular rule that already knows its base value, - // check to make sure the rules are in order, and update - // the default base value for the next rule - default: - if (rule.getBaseValue() < defaultBaseValue) { - throw new IllegalArgumentException("Rules are not in order"); - } - defaultBaseValue = rule.getBaseValue(); - if (!isFractionRuleSet) { - ++defaultBaseValue; - } - ++i; - break; - } - } - - // finally, we can copy the rules from the vector into a - // fixed-length array - rules = new NFRule[tempRules.size()]; - tempRules.copyInto((Object[])rules); - } - - /** - * Flags this rule set as a fraction rule set. This function is - * called during the construction process once we know this rule - * set is a fraction rule set. We don't know a rule set is a - * fraction rule set until we see it used somewhere. This function - * is not ad must not be called at any time other than during - * construction of a RuleBasedNumberFormat. - */ - public void makeIntoFractionRuleSet() { - isFractionRuleSet = true; - } - - //----------------------------------------------------------------------- - // boilerplate - //----------------------------------------------------------------------- - - /** - * Compares two rule sets for equality. - * @param that The other rule set - * @return true if the two rule sets are functionally equivalent. - */ - public boolean equals(Object that) { - // if different classes, they're not equal - if (!(that instanceof NFRuleSet)) { - return false; - } else { - // otherwise, compare the members one by one... - NFRuleSet that2 = (NFRuleSet)that; - - if (!name.equals(that2.name) - || !negativeNumberRule.equals(that2.negativeNumberRule) - || !fractionRules[0].equals(that2.fractionRules[0]) - || !fractionRules[1].equals(that2.fractionRules[1]) - || !fractionRules[2].equals(that2.fractionRules[2]) - || rules.length != that2.rules.length - || isFractionRuleSet != that2.isFractionRuleSet) { - return false; - } - - // ...then compare the rule lists... - for (int i = 0; i < rules.length; i++) { - if (!rules[i].equals(that2.rules[i])) { - return false; - } - } - - // ...and if we make it here, tney're equal - return true; - } - } - - /** - * Builds a textual representation of a rule set. - * @return A textual representation of a rule set. This won't - * necessarily be the same description that the rule set was - * constructed with, but it will produce the same results. - */ - public String toString() { - StringBuffer result = new StringBuffer(); - - // the rule set name goes first... - result.append(name + ":\n"); - - // followed by the regular rules... - for (int i = 0; i < rules.length; i++) { - result.append(" " + rules[i].toString() + "\n"); - } - - // followed by the special rules (if they exist) - if (negativeNumberRule != null) { - result.append(" " + negativeNumberRule.toString() + "\n"); - } - if (fractionRules[0] != null) { - result.append(" " + fractionRules[0].toString() + "\n"); - } - if (fractionRules[1] != null) { - result.append(" " + fractionRules[1].toString() + "\n"); - } - if (fractionRules[2] != null) { - result.append(" " + fractionRules[2].toString() + "\n"); - } - - return result.toString(); - } - - //----------------------------------------------------------------------- - // simple accessors - //----------------------------------------------------------------------- - - /** - * Says whether this rule set is a fraction rule set. - * @return true if this rule is a fraction rule set; false if it isn't - */ - public boolean isFractionSet() { - return isFractionRuleSet; - } - - /* - * Returns the rule set's name - * @return The rule set's name - */ - public String getName() { - return name; - } - - //----------------------------------------------------------------------- - // formatting - //----------------------------------------------------------------------- - - /** - * Formats a long. Selects an appropriate rule and dispatches - * control to it. - * @param number The number being formatted - * @param toInsertInto The string where the result is to be placed - * @param pos The position in toInsertInto where the result of - * this operation is to be inserted - */ - public void format(long number, StringBuffer toInsertInto, int pos) { - NFRule applicableRule = findNormalRule(number); - - applicableRule.doFormat(number, toInsertInto, pos); - } - - /** - * Formats a double. Selects an appropriate rule and dispatches - * control to it. - * @param number The number being formatted - * @param toInsertInto The string where the result is to be placed - * @param pos The position in toInsertInto where the result of - * this operation is to be inserted - */ - public void format(double number, StringBuffer toInsertInto, int pos) { - NFRule applicableRule = findRule(number); - - applicableRule.doFormat(number, toInsertInto, pos); - } - - /** - * Selects an apropriate rule for formatting the number. - * @param number The number being formatted. - * @return The rule that should be used to format it - */ - private NFRule findRule(double number) { - // if this is a fraction rule set, use findFractionRuleSetRule() - if (isFractionRuleSet) { - return findFractionRuleSetRule(number); - } - - // if the number is negative, return the negative number rule - // (if there isn't a negative-number rule, we pretend it's a - // positive number) - if (number < 0) { - if (negativeNumberRule != null) { - return negativeNumberRule; - } else { - number = -number; - } - } - - // if the number isn't an integer, we use one f the fraction rules... - if (number != Math.floor(number)) { - // if the number is between 0 and 1, return the proper - // fraction rule - if (number < 1 && fractionRules[1] != null) { - return fractionRules[1]; - } - - // otherwise, return the improper fraction rule - else if (fractionRules[0] != null) { - return fractionRules[0]; - } - } - - // if there's a master rule, use it to format the number - if (fractionRules[2] != null) { - return fractionRules[2]; - - // and if we haven't yet returned a rule, use findNormalRule() - // to find the applicable rule - } else { - return findNormalRule((long)Math.round(number)); - } - } - - /** - * If the value passed to findRule() is a positive integer, findRule() - * uses this function to select the appropriate rule. The result will - * generally be the rule with the highest base value less than or equal - * to the number. There is one exception to this: If that rule has - * two substitutions and a base value that is not an even multiple of - * its divisor, and the number itself IS an even multiple of the rule's - * divisor, then the result will be the rule that preceded the original - * result in the rule list. (This behavior is known as the "rollback - * rule", and is used to handle optional text: a rule with optional - * text is represented internally as two rules, and the rollback rule - * selects appropriate between them. This avoids things like "two - * hundred zero".) - * @param number The number being formatted - * @return The rule to use to format this number - */ - private NFRule findNormalRule(long number) { - // if this is a fraction rule set, use findFractionRuleSetRule() - // to find the rule (we should only go into this clause if the - // value is 0) - if (isFractionRuleSet) { - return findFractionRuleSetRule(number); - } - - // if the number is negative, return the negative-number rule - // (if there isn't one, pretend the number is positive) - if (number < 0) { - if (negativeNumberRule != null) { - return negativeNumberRule; - } else { - number = -number; - } - } - - // we have to repeat the preceding two checks, even though we - // do them in findRule(), because the version of format() that - // takes a long bypasses findRule() and goes straight to this - // function. This function does skip the fraction rules since - // we know the value is an integer (it also skips the master - // rule, since it's considered a fraction rule. Skipping the - // master rule in this function is also how we avoid infinite - // recursion) - - // binary-search the rule list for the applicable rule - // (a rule is used for all values from its base value to - // the next rule's base value) - int lo = 0; - int hi = rules.length; - while (lo < hi) { - int mid = (lo + hi) / 2; - if (rules[mid].getBaseValue() == number) { - return rules[mid]; - } - else if (rules[mid].getBaseValue() > number) { - hi = mid; - } - else { - lo = mid + 1; - } - } - NFRule result = rules[hi - 1]; - - // use shouldRollBack() to see whether we need to invoke the - // rollback rule (see shouldRollBack()'s documentation for - // an explanation of the rollback rule). If we do, roll back - // one rule and return that one instead of the one we'd normally - // return - if (result.shouldRollBack(number)) { - result = rules[hi - 2]; - } - - return result; - } - - /** - * If this rule is a fraction rule set, this function is used by - * findRule() to select the most appropriate rule for formatting - * the number. Basically, the base value of each rule in the rule - * set is treated as the denominator of a fraction. Whichever - * denominator can produce the fraction closest in value to the - * number passed in is the result. If there's a tie, the earlier - * one in the list wins. (If there are two rules in a row with the - * same base value, the first one is used when the numerator of the - * fraction would be 1, and the second rule is used the rest of the - * time. - * @param number The number being formatted (which will always be - * a number between 0 and 1) - * @return The rule to use to format this number - */ - private NFRule findFractionRuleSetRule(double number) { - // the obvious way to do this (multiply the value being formatted - // by each rule's base value until you get an integral result) - // doesn't work because of rounding error. This method is more - // accurate - - // find the least common multiple of the rules' base values - // and multiply this by the number being formatted. This is - // all the precision we need, and we can do all of the rest - // of the math using integer arithmetic - long leastCommonMultiple = rules[0].getBaseValue(); - for (int i = 1; i < rules.length; i++) { - leastCommonMultiple = lcm(leastCommonMultiple, rules[i].getBaseValue()); - } - long numerator = (long)(Math.round(number * leastCommonMultiple)); - - // for each rule, do the following... - long tempDifference; - long difference = Long.MAX_VALUE; - int winner = 0; - for (int i = 0; i < rules.length; i++) { - // "numerator" is the numerator of the fraction is the - // denominator is the LCD. The numerator if the the rule's - // base value is the denomiator is "numerator" times the - // base value divided bythe LCD. Here we check to see if - // that's an integer, and if not, how close it is to being - // an integer. - tempDifference = numerator * rules[i].getBaseValue() % leastCommonMultiple; - - // normalize the result of the above calculation: we want - // the numerator's distance from the CLOSEST multiple - // of the LCD - if (leastCommonMultiple - tempDifference < tempDifference) { - tempDifference = leastCommonMultiple - tempDifference; - } - - // if this is as close as we've come, keep track of how close - // that is, and the line number of the rule that did it. If - // we've scored a direct hit, we don't have to look at any more - // rules - if (tempDifference < difference) { - difference = tempDifference; - winner = i; - if (difference == 0) { - break; - } - } - } - - // if we have two successive rules that both have the winning base - // value, then the first one (the one we found above) is used if - // the numerator of the fraction is 1 and the second one is used if - // the numerator of the fraction is anything else (this lets us - // do things like "one third"/"two thirds" without haveing to define - // a whole bunch of extra rule sets) - if (winner + 1 < rules.length - && rules[winner + 1].getBaseValue() == rules[winner].getBaseValue()) { - if (Math.round(number * rules[winner].getBaseValue()) < 1 - || Math.round(number * rules[winner].getBaseValue()) >= 2) { - ++winner; - } - } - - // finally, return the winning rule - return rules[winner]; - } - - /** - * Calculates the least common multiple of x and y. - */ - private static long lcm(long x, long y) { - // binary gcd algorithm from Knuth, "The Art of Computer Programming," - // vol. 2, 1st ed., pp. 298-299 - long x1 = x; - long y1 = y; - - int p2 = 0; - while ((x1 & 1) == 0 && (y1 & 1) == 0) { - ++p2; - x1 >>= 1; - y1 >>= 1; - } - - long t; - if ((x1 & 1) == 1) { - t = -y1; - } else { - t = x1; - } - - while (t != 0) { - while ((t & 1) == 0) { - t >>= 1; - } - if (t > 0) { - x1 = t; - } else { - y1 = -t; - } - t = x1 - y1; - } - long gcd = x1 << p2; - - // x * y == gcd(x, y) * lcm(x, y) - return x / gcd * y; - } - - //----------------------------------------------------------------------- - // parsing - //----------------------------------------------------------------------- - - /** - * Parses a string. Matches the string to be parsed against each - * of its rules (with a base value less than upperBound) and returns - * the value produced by the rule that matched the most charcters - * in the source string. - * @param text The string to parse - * @param parsePosition The initial position is ignored and assumed - * to be 0. On exit, this object has been updated to point to the - * first character position this rule set didn't consume. - * @param upperBound Limits the rules that can be allowed to match. - * Only rules whose base values are strictly less than upperBound - * are considered. - * @return The numerical result of parsing this string. This will - * be the matching rule's base value, composed appropriately with - * the results of matching any of its substitutions. The object - * will be an instance of Long if it's an integral value; otherwise, - * it will be an instance of Double. This function always returns - * a valid object: If nothing matched the input string at all, - * this function returns new Long(0), and the parse position is - * left unchanged. - */ - public Number parse(String text, ParsePosition parsePosition, double upperBound) { - // try matching each rule in the rule set against the text being - // parsed. Whichever one matches the most characters is the one - // that determines the value we return. - - ParsePosition highWaterMark = new ParsePosition(0); - Number result = new Long(0); - Number tempResult = null; - - // dump out if there's no text to parse - if (text.length() == 0) { - return result; - } - - // start by trying the nehative number rule (if there is one) - if (negativeNumberRule != null) { - tempResult = negativeNumberRule.doParse(text, parsePosition, false, upperBound); - if (parsePosition.getIndex() > highWaterMark.getIndex()) { - result = tempResult; - highWaterMark.setIndex(parsePosition.getIndex()); - } -// commented out because the error-index API on ParsePosition isn't there in 1.1.x -// if (parsePosition.getErrorIndex() > highWaterMark.getErrorIndex()) { -// highWaterMark.setErrorIndex(parsePosition.getErrorIndex()); -// } - parsePosition.setIndex(0); - } - - // then try each of the fraction rules - for (int i = 0; i < 3; i++) { - if (fractionRules[i] != null) { - tempResult = fractionRules[i].doParse(text, parsePosition, false, upperBound); - if (parsePosition.getIndex() > highWaterMark.getIndex()) { - result = tempResult; - highWaterMark.setIndex(parsePosition.getIndex()); - } -// commented out because the error-index API on ParsePosition isn't there in 1.1.x -// if (parsePosition.getErrorIndex() > highWaterMark.getErrorIndex()) { -// highWaterMark.setErrorIndex(parsePosition.getErrorIndex()); -// } - parsePosition.setIndex(0); - } - } - - // finally, go through the regular rules one at a time. We start - // at the end of the list because we want to try matching the most - // sigificant rule first (this helps ensure that we parse - // "five thousand three hundred six" as - // "(five thousand) (three hundred) (six)" rather than - // "((five thousand three) hundred) (six)"). Skip rules whose - // base values are higher than the upper bound (again, this helps - // limit ambiguity by making sure the rules that match a rule's - // are less significant than the rule containing the substitutions)/ - for (int i = rules.length - 1; i >= 0 && highWaterMark.getIndex() < text.length(); i--) { - if (!isFractionRuleSet && rules[i].getBaseValue() >= upperBound) { - continue; - } - - tempResult = rules[i].doParse(text, parsePosition, isFractionRuleSet, upperBound); - if (parsePosition.getIndex() > highWaterMark.getIndex()) { - result = tempResult; - highWaterMark.setIndex(parsePosition.getIndex()); - } -// commented out because the error-index API on ParsePosition isn't there in 1.1.x -// if (parsePosition.getErrorIndex() > highWaterMark.getErrorIndex()) { -// highWaterMark.setErrorIndex(parsePosition.getErrorIndex()); -// } - parsePosition.setIndex(0); - } - - // finally, update the parse postion we were passed to point to the - // first character we didn't use, and return the result that - // cporresponds to that string of characters - parsePosition.setIndex(highWaterMark.getIndex()); -// commented out because the error-index API on ParsePosition isn't there in 1.1.x -// if (parsePosition.getIndex() == 0) { -// parsePosition.setErrorIndex(highWaterMark.getErrorIndex()); -// } - - return result; - } -} diff --git a/icu4j/src/com/ibm/text/NFSubstitution.java b/icu4j/src/com/ibm/text/NFSubstitution.java deleted file mode 100755 index 744a338e4b..0000000000 --- a/icu4j/src/com/ibm/text/NFSubstitution.java +++ /dev/null @@ -1,1747 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/NFSubstitution.java,v $ - * $Date: 2001/10/02 17:42:40 $ - * $Revision: 1.5 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.text.*; - -//=================================================================== -// NFSubstitution (abstract base class) -//=================================================================== - -/** - * An abstract class defining protocol for substitutions. A substitution - * is a section of a rule that inserts text into the rule's rule text - * based on some part of the number being formatted. - * @author Richard Gillam - * @version $RCSfile: NFSubstitution.java,v $ $Revision: 1.5 $ $Date: 2001/10/02 17:42:40 $ - */ -abstract class NFSubstitution { - //----------------------------------------------------------------------- - // constants - //----------------------------------------------------------------------- - - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - //----------------------------------------------------------------------- - // data members - //----------------------------------------------------------------------- - - /** - * The substitution's position in the rule text of the rule that owns it - */ - int pos; - - /** - * The rule set this substitution uses to format its result, or null. - * (Either this or numberFormat has to be non-null.) - */ - NFRuleSet ruleSet = null; - - /** - * The DecimalFormat this substitution uses to format its result, - * or null. (Either this or ruleSet has to be non-null.) - */ - DecimalFormat numberFormat = null; - - //----------------------------------------------------------------------- - // construction - //----------------------------------------------------------------------- - - /** - * Parses the description, creates the right kind of substitution, - * and initializes it based on the description. - * @param pos The substitution's position in the rule text of the - * rule that owns it. - * @param rule The rule containing this substitution - * @param rulePredecessor The rule preceding the one that contains - * this substitution in the rule set's rule list (this is used - * only for >>> substitutions). - * @param ruleSet The rule set containing the rule containing this - * substitution - * @param formatter The RuleBasedNumberFormat that ultimately owns - * this substitution - * @param description The description to parse to build the substitution - * (this is just the substring of the rule's description containing - * the substitution token itself) - * @return A new substitution constructed according to the description - */ - public static NFSubstitution makeSubstitution(int pos, - NFRule rule, - NFRule rulePredecessor, - NFRuleSet ruleSet, - RuleBasedNumberFormat formatter, - String description) { - // if the description is empty, return a NummSubstitution - if (description.length() == 0) { - return new NullSubstitution(pos, ruleSet, formatter, description); - } - - switch (description.charAt(0)) { - // if the description begins with '<'... - case '<': - // throw an exception if the rule is a negative number - // rule - if (rule.getBaseValue() == NFRule.NEGATIVE_NUMBER_RULE) { - throw new IllegalArgumentException("<< not allowed in negative-number rule"); - } - - // if the rule is a fraction rule, return an - // IntegralPartSubstitution - else if (rule.getBaseValue() == NFRule.IMPROPER_FRACTION_RULE - || rule.getBaseValue() == NFRule.PROPER_FRACTION_RULE - || rule.getBaseValue() == NFRule.MASTER_RULE) { - return new IntegralPartSubstitution(pos, ruleSet, formatter, description); - } - - // if the rule set containing the rule is a fraction - // rule set, return a NumeratorSubstitution - else if (ruleSet.isFractionSet()) { - return new NumeratorSubstitution(pos, rule.getBaseValue(), - formatter.getDefaultRuleSet(), formatter, description); - } - - // otherwise, return a MultiplierSubstitution - else { - return new MultiplierSubstitution(pos, rule.getDivisor(), ruleSet, - formatter, description); - } - - // if the description begins with '>'... - case '>': - // if the rule is a negative-number rule, return - // an AbsoluteValueSubstitution - if (rule.getBaseValue() == NFRule.NEGATIVE_NUMBER_RULE) { - return new AbsoluteValueSubstitution(pos, ruleSet, formatter, description); - } - - // if the rule is a fraction rule, return a - // FractionalPartSubstitution - else if (rule.getBaseValue() == NFRule.IMPROPER_FRACTION_RULE - || rule.getBaseValue() == NFRule.PROPER_FRACTION_RULE - || rule.getBaseValue() == NFRule.MASTER_RULE) { - return new FractionalPartSubstitution(pos, ruleSet, formatter, description); - } - - // if the rule set owning the rule is a fraction rule set, - // throw an exception - else if (ruleSet.isFractionSet()) { - throw new IllegalArgumentException(">> not allowed in fraction rule set"); - } - - // otherwise, return a ModulusSubstitution - else { - return new ModulusSubstitution(pos, rule.getDivisor(), rulePredecessor, - ruleSet, formatter, description); - } - - // if the description begins with '=', always return a - // SameValueSubstitution - case '=': - return new SameValueSubstitution(pos, ruleSet, formatter, description); - - // and if it's anything else, throw an exception - default: - throw new IllegalArgumentException("Illegal substitution character"); - } - } - - /** - * Base constructor for substitutions. This constructor sets up the - * fields which are common to all substitutions. - * @param pos The substitution's position in the owning rule's rule - * text - * @param ruleSet The rule set that owns this substitution - * @param formatter The RuleBasedNumberFormat that owns this substitution - * @param description The substitution descriptor (i.e., the text - * inside the token characters) - */ - NFSubstitution(int pos, - NFRuleSet ruleSet, - RuleBasedNumberFormat formatter, - String description) { - // initialize the substitution's position in its parent rule - this.pos = pos; - - // the description should begin and end with the same character. - // If it doesn't that's a syntax error. Otherwise, - // makeSubstitution() was the only thing that needed to know - // about these characters, so strip them off - if (description.length() >= 2 && description.charAt(0) == description.charAt( - description.length() - 1)) { - description = description.substring(1, description.length() - 1); - } - else if (description.length() != 0) { - throw new IllegalArgumentException("Illegal substitution syntax"); - } - - // if the description was just two paired token characters - // (i.e., "<<" or ">>"), it uses the rule set it belongs to to - // format its result - if (description.length() == 0) { - this.ruleSet = ruleSet; - } - - // if the description contains a rule set name, that's the rule - // set we use to format the result: get a reference to the - // names rule set - else if (description.charAt(0) == '%') { - this.ruleSet = formatter.findRuleSet(description); - } - - // if the description begins with 0 or #, treat it as a - // DecimalFormat pattern, and initialize a DecimalFormat with - // that pattern (then set it to use the DecimalFormatSymbols - // belonging to our formatter) - else if (description.charAt(0) == '#' || description.charAt(0) == '0') { - this.numberFormat = new DecimalFormat(description); - this.numberFormat.setDecimalFormatSymbols(formatter.getDecimalFormatSymbols()); - } - - // if the description is ">>>", this substitution bypasses the - // usual rule-search process and always uses the rule that precedes - // it in its own rule set's rule list (this is used for place-value - // notations: formats where you want to see a particular part of - // a number even when it's 0) - else if (description.charAt(0) == '>') { - this.ruleSet = ruleSet; // was null, thai rules added to control space - this.numberFormat = null; - } - - // and of the description is none of these things, it's a syntax error - else { - throw new IllegalArgumentException("Illegal substitution syntax"); - } - } - - /** - * Set's the substitution's divisor. Used by NFRule.setBaseValue(). - * A no-op for all substitutions except multiplier and modulus - * substitutions. - * @param radix The radix of the divisor - * @param exponent The exponent of the divisor - */ - public void setDivisor(int radix, int exponent) { - // a no-op for all substitutions except multiplier and modulus substitutions - } - - //----------------------------------------------------------------------- - // boilerplate - //----------------------------------------------------------------------- - - /** - * Compares two substitutions for equality - * @param The substitution to compare this one to - * @return true if the two substitutions are functionally equivalent - */ - public boolean equals(Object that) { - // compare class and all of the fields all substitutions have - // in common - if (this.getClass() == that.getClass()) { - NFSubstitution that2 = (NFSubstitution)that; - - return pos == that2.pos - && ruleSet == that2.ruleSet - && numberFormat.equals(that2.numberFormat); - } else { - return false; - } - } - - /** - * Returns a textual description of the substitution - * @return A textual description of the substitution. This might - * not be identical to the description it was created from, but - * it'll produce the same result. - */ - public String toString() { - // use tokenChar() to get the character at the beginning and - // end of the substitution token. In between them will go - // either the name of the rule set it uses, or the pattern of - // the DecimalFormat it uses - if (ruleSet != null) { - return tokenChar() + ruleSet.getName() + tokenChar(); - } else { - return tokenChar() + numberFormat.toPattern() + tokenChar(); - } - } - - //----------------------------------------------------------------------- - // formatting - //----------------------------------------------------------------------- - - /** - * Performs a mathematical operation on the number, formats it using - * either ruleSet or decimalFormat, and inserts the result into - * toInsertInto. - * @param number The number being formatted. - * @param toInsertInto The string we insert the result into - * @param pos The position in toInsertInto where the owning rule's - * rule text begins (this value is added to this substitution's - * position to determine exactly where to insert the new text) - */ - public void doSubstitution(long number, StringBuffer toInsertInto, int pos) { - if (ruleSet != null) { - // perform a transformation on the number that is dependent - // on the type of substitution this is, then just call its - // rule set's format() method to format the result - long numberToFormat = transformNumber(number); - - ruleSet.format(numberToFormat, toInsertInto, pos + this.pos); - } else { - // or perform the transformation on the number (preserving - // the result's fractional part if the formatter it set - // to show it), then use that formatter's format() method - // to format the result - double numberToFormat = transformNumber((double)number); - if (numberFormat.getMaximumFractionDigits() == 0) { - numberToFormat = Math.floor(numberToFormat); - } - - toInsertInto.insert(pos + this.pos, numberFormat.format(numberToFormat)); - } - } - - /** - * Performs a mathematical operation on the number, formats it using - * either ruleSet or decimalFormat, and inserts the result into - * toInsertInto. - * @param number The number being formatted. - * @param toInsertInto The string we insert the result into - * @param pos The position in toInsertInto where the owning rule's - * rule text begins (this value is added to this substitution's - * position to determine exactly where to insert the new text) - */ - public void doSubstitution(double number, StringBuffer toInsertInto, int pos) { - // perform a transformation on the number being formatted that - // is dependent on the type of substitution this is - double numberToFormat = transformNumber(number); - - // if the result is an integer, from here on out we work in integer - // space (saving time and memory and preserving accuracy) - if (numberToFormat == Math.floor(numberToFormat) && ruleSet != null) { - ruleSet.format((long)numberToFormat, toInsertInto, pos + this.pos); - - // if the result isn't an integer, then call either our rule set's - // format() method or our DecimalFormat's format() method to - // format the result - } else { - if (ruleSet != null) { - ruleSet.format(numberToFormat, toInsertInto, pos + this.pos); - } else { - toInsertInto.insert(pos + this.pos, numberFormat.format(numberToFormat)); - } - } - } - - /** - * Subclasses override this function to perform some kind of - * mathematical operation on the number. The result of this operation - * is formatted using the rule set or DecimalFormat that this - * substitution refers to, and the result is inserted into the result - * string. - * @param The number being formatted - * @return The result of performing the opreration on the number - */ - public abstract long transformNumber(long number); - - /** - * Subclasses override this function to perform some kind of - * mathematical operation on the number. The result of this operation - * is formatted using the rule set or DecimalFormat that this - * substitution refers to, and the result is inserted into the result - * string. - * @param The number being formatted - * @return The result of performing the opreration on the number - */ - public abstract double transformNumber(double number); - - //----------------------------------------------------------------------- - // parsing - //----------------------------------------------------------------------- - - /** - * Parses a string using the rule set or DecimalFormat belonging - * to this substitution. If there's a match, a mathematical - * operation (the inverse of the one used in formatting) is - * performed on the result of the parse and the value passed in - * and returned as the result. The parse position is updated to - * point to the first unmatched character in the string. - * @param text The string to parse - * @param parsePosition On entry, ignored, but assumed to be 0. - * On exit, this is updated to point to the first unmatched - * character (or 0 if the substitution didn't match) - * @param baseValue A partial parse result that should be - * combined with the result of this parse - * @param upperBound When searching the rule set for a rule - * matching the string passed in, only rules with base values - * lower than this are considered - * @param lenientParse If true and matching against rules fails, - * the substitution will also try matching the text against - * numerals using a default-costructed NumberFormat. If false, - * no extra work is done. (This value is false whenever the - * formatter isn't in lenient-parse mode, but is also false - * under some conditions even when the formatter _is_ in - * lenient-parse mode.) - * @return If there's a match, this is the result of composing - * baseValue with whatever was returned from matching the - * characters. This will be either a Long or a Double. If there's - * no match this is new Long(0) (not null), and parsePosition - * is left unchanged. - */ - public Number doParse(String text, ParsePosition parsePosition, double baseValue, - double upperBound, boolean lenientParse) { - Number tempResult; - - // figure out the highest base value a rule can have and match - // the text being parsed (this varies according to the type of - // substitutions: multiplier, modulus, and numerator substitutions - // restrict the search to rules with base values lower than their - // own; same-value substitutions leave the upper bound wherever - // it was, and the others allow any rule to match - upperBound = calcUpperBound(upperBound); - - // use our rule set to parse the text. If that fails and - // lenient parsing is enabled (this is always false if the - // formatter's lenient-parsing mode is off, but it may also - // be false even when the formatter's lenient-parse mode is - // on), then also try parsing the text using a default- - // constructed NumberFormat - if (ruleSet != null) { - tempResult = ruleSet.parse(text, parsePosition, upperBound); - if (lenientParse && !ruleSet.isFractionSet() && parsePosition.getIndex() == 0) { - tempResult = NumberFormat.getInstance().parse(text, parsePosition); - } - - // ...or use our DecimalFormat to parse the text - } else { - tempResult = numberFormat.parse(text, parsePosition); - } - - // if the parse was successful, we've already advanced the caller's - // parse position (this is the one function that doesn't have one - // of its own). Derive a parse result and return it as a Long, - // if possible, or a Double - if (parsePosition.getIndex() != 0) { - double result = tempResult.doubleValue(); - - // composeRuleValue() produces a full parse result from - // the partial parse result passed to this function from - // the caller (this is either the owning rule's base value - // or the partial result obtained from composing the - // owning rule's base value with its other substitution's - // parse result) and the partial parse result obtained by - // matching the substitution (which will be the same value - // the caller would get by parsing just this part of the - // text with RuleBasedNumberFormat.parse() ). How the two - // values are used to derive the full parse result depends - // on the types of substitutions: For a regular rule, the - // ultimate result is its multiplier substitution's result - // times the rule's divisor (or the rule's base value) plus - // the modulus substitution's result (which will actually - // supersede part of the rule's base value). For a negative- - // number rule, the result is the negative of its substitution's - // result. For a fraction rule, it's the sum of its two - // substitution results. For a rule in a fraction rule set, - // it's the numerator substitution's result divided by - // the rule's base value. Results from same-value substitutions - // propagate back upard, and null substitutions don't affect - // the result. - result = composeRuleValue(result, baseValue); - if (result == (long)result) { - return new Long((long)result); - } else { - return new Double(result); - } - - // if the parse was UNsuccessful, return 0 - } else { - return tempResult; - } - } - - /** - * Derives a new value from the two values passed in. The two values - * are typically either the base values of two rules (the one containing - * the substitution and the one matching the substitution) or partial - * parse results derived in some other way. The operation is generally - * the inverse of the operation performed by transformNumber(). - * @param newRuleValue The value produced by matching this substitution - * @param oldRuleValue The value that was passed to the substitution - * by the rule that owns it - * @return A third value derived from the other two, representing a - * partial parse result - */ - public abstract double composeRuleValue(double newRuleValue, double oldRuleValue); - - /** - * Calculates an upper bound when searching for a rule that matches - * this substitution. Rules with base values greater than or equal - * to upperBound are not considered. - * @param oldUpperBound The current upper-bound setting. The new - * upper bound can't be any higher. - */ - public abstract double calcUpperBound(double oldUpperBound); - - //----------------------------------------------------------------------- - // simple accessors - //----------------------------------------------------------------------- - - /** - * Returns the substitution's position in the rule that owns it. - * @return The substitution's position in the rule that owns it. - */ - public final int getPos() { - return pos; - } - - /** - * Returns the character used in the textual representation of - * substitutions of this type. Used by toString(). - * @return This substitution's token character. - */ - abstract char tokenChar(); - - /** - * Returns true if this is a null substitution. (We didn't do this - * with instanceof partially because it causes source files to - * proliferate and partially because we have to port this to C++.) - * @return true if this object is an instance of NullSubstitution - */ - public boolean isNullSubstitution() { - return false; - } - - /** - * Returns true if this is a modulus substitution. (We didn't do this - * with instanceof partially because it causes source files to - * proliferate and partially because we have to port this to C++.) - * @return true if this object is an instance of ModulusSubstitution - */ - public boolean isModulusSubstitution() { - return false; - } -} - -//=================================================================== -// SameValueSubstitution -//=================================================================== - -/** - * A substitution that passes the value passed to it through unchanged. - * Represented by == in rule descriptions. - */ -class SameValueSubstitution extends NFSubstitution { - //----------------------------------------------------------------------- - // constants - //----------------------------------------------------------------------- - - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - //----------------------------------------------------------------------- - // construction - //----------------------------------------------------------------------- - - /** - * Constructs a SameValueSubstution. This function just uses the - * superclass constructor, but it performs a check that this - * substitution doesn't call the rule set that owns it, since that - * would lead to infinite recursion. - */ - SameValueSubstitution(int pos, - NFRuleSet ruleSet, - RuleBasedNumberFormat formatter, - String description) { - super(pos, ruleSet, formatter, description); - if (description.equals("==")) { - throw new IllegalArgumentException("== is not a legal token"); - } - } - - //----------------------------------------------------------------------- - // formatting - //----------------------------------------------------------------------- - - /** - * Returns "number" unchanged. - * @return "number" - */ - public long transformNumber(long number) { - return number; - } - - /** - * Returns "number" unchanged. - * @return "number" - */ - public double transformNumber(double number) { - return number; - } - - //----------------------------------------------------------------------- - // parsing - //----------------------------------------------------------------------- - - /** - * Returns newRuleValue and ignores oldRuleValue. (The value we got - * matching the substitution supersedes the value of the rule - * that owns the substitution.) - * @param newRuleValue The value resulting from matching the substituion - * @param oldRuleValue The value of the rule containing the - * substitution. - * @return newRuleValue - */ - public double composeRuleValue(double newRuleValue, double oldRuleValue) { - return newRuleValue; - } - - /** - * SameValueSubstitution doesn't change the upper bound. - * @param oldUpperBound The current upper bound. - * @return oldUpperBound - */ - public double calcUpperBound(double oldUpperBound) { - return oldUpperBound; - } - - //----------------------------------------------------------------------- - // simple accessor - //----------------------------------------------------------------------- - - /** - * The token character for a SameValueSubstitution is =. - * @return '=' - */ - char tokenChar() { - return '='; - } -} - -//=================================================================== -// MultiplierSubstitution -//=================================================================== - -/** - * A substitution that divides the number being formatted by the rule's - * divisor and formats the quotient. Represented by << in normal - * rules. - */ -class MultiplierSubstitution extends NFSubstitution { - //----------------------------------------------------------------------- - // constants - //----------------------------------------------------------------------- - - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - //----------------------------------------------------------------------- - // data members - //----------------------------------------------------------------------- - - /** - * The divisor of the rule that owns this substitution. - */ - double divisor; - - //----------------------------------------------------------------------- - // construction - //----------------------------------------------------------------------- - - /** - * Constructs a MultiplierSubstitution. This uses the superclass - * constructor to initialize most members, but this substitution - * also maintains its own copy of its rule's divisor. - * @param pos The substitution's position in its rule's rule text - * @param divisor The owning rule's divisor - * @ruleSet The ruleSet this substitution uses to format its result - * @formatter The formatter that owns this substitution - * @description The description describing this substitution - */ - MultiplierSubstitution(int pos, - double divisor, - NFRuleSet ruleSet, - RuleBasedNumberFormat formatter, - String description) { - super(pos, ruleSet, formatter, description); - - // the owning rule's divisor affects the behavior of this - // substitution. Rather than keeping a back-pointer to the - // rule, we keep a copy of the divisor - this.divisor = divisor; - } - - /** - * Sets the substitution's divisor based on the values passed in. - * @param radix The radix of the divisor. - * @param exponent The exponent of the divisor. - */ - public void setDivisor(int radix, int exponent) { - divisor = Math.pow(radix, exponent); - } - - //----------------------------------------------------------------------- - // boilerplate - //----------------------------------------------------------------------- - - /** - * Augments the superclass's equals() function by comparing divisors. - * @param that The other substitution - * @return true if the two substitutions are functionally equal - */ - public boolean equals(Object that) { - if (super.equals(that)) { - MultiplierSubstitution that2 = (MultiplierSubstitution)that; - - return divisor == that2.divisor; - } else { - return false; - } - } - - //----------------------------------------------------------------------- - // formatting - //----------------------------------------------------------------------- - - /** - * Divides the number by the rule's divisor and returns the quotient. - * @param number The number being formatted. - * @return "number" divided by the rule's divisor - */ - public long transformNumber(long number) { - return (long)Math.floor(number / divisor); - } - - /** - * Divides the number by the rule's divisor and returns the quotient. - * This is an integral quotient if we're filling in the substitution - * using another rule set, but it's the full quotient (integral and - * fractional parts) if we're filling in the substitution using - * a DecimalFormat. (This allows things such as "1.2 million".) - * @param number The number being formatted - * @return "number" divided by the rule's divisor - */ - public double transformNumber(double number) { - if (ruleSet == null) { - return number / divisor; - } else { - return Math.floor(number / divisor); - } - } - - //----------------------------------------------------------------------- - // parsing - //----------------------------------------------------------------------- - - /** - * Returns newRuleValue times the divisor. Ignores oldRuleValue. - * (The result of matching a << substitution supersedes the base - * value of the rule that contains it.) - * @param newRuleValue The result of matching the substitution - * @param oldRuleValue The base value of the rule containing the - * substitution - * @return newRuleValue * divisor - */ - public double composeRuleValue(double newRuleValue, double oldRuleValue) { - return newRuleValue * divisor; - } - - /** - * Sets the upper bound down to the rule's divisor. - * @param oldUpperBound Ignored. - * @return The rule's divisor. - */ - public double calcUpperBound(double oldUpperBound) { - return divisor; - } - - //----------------------------------------------------------------------- - // simple accessor - //----------------------------------------------------------------------- - - /** - * The token character for a multiplier substitution is <. - * @return '<' - */ - char tokenChar() { - return '<'; - } -} - -//=================================================================== -// ModulusSubstitution -//=================================================================== - -/** - * A substitution that divides the number being formatted by the its rule's - * divisor and formats the remainder. Represented by ">>" in a - * regular rule. - */ -class ModulusSubstitution extends NFSubstitution { - //----------------------------------------------------------------------- - // constants - //----------------------------------------------------------------------- - - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - //----------------------------------------------------------------------- - // data members - //----------------------------------------------------------------------- - - /** - * The divisor of the rule owning this substitution - */ - double divisor; - - /** - * If this is a >>> substitution, the rule to use to format - * the substitution value. Otherwise, null. - */ - NFRule ruleToUse; - - //----------------------------------------------------------------------- - // construction - //----------------------------------------------------------------------- - - /** - * Constructs a ModulusSubstution. In addition to the inherited - * members, a ModulusSubstitution keeps track of the divisor of the - * rule that owns it, and may also keep a reference to the rule - * that precedes the rule containing this substitution in the rule - * set's rule list. - * @param pos The substitution's position in its rule's rule text - * @param divisor The divisor of the rule that owns this substitution - * @param rulePredecessor The rule that precedes this substitution's - * rule in its rule set's rule list - * @param formatter The RuleBasedNumberFormat owning this substitution - * @param description The description for this substitution - */ - ModulusSubstitution(int pos, - double divisor, - NFRule rulePredecessor, - NFRuleSet ruleSet, - RuleBasedNumberFormat formatter, - String description) { - super(pos, ruleSet, formatter, description); - - // the owning rule's divisor controls the behavior of this - // substitution: rather than keeping a backpointer to the rule, - // we keep a copy of the divisor - this.divisor = divisor; - - // the >>> token doesn't alter how this substituion calculates the - // values it uses for formatting and parsing, but it changes - // what's done with that value after it's obtained: >>> short- - // circuits the rule-search process and goes straight to the - // specified rule to format the substitution value - if (description.equals(">>>")) { - ruleToUse = rulePredecessor; - } else { - ruleToUse = null; - } - } - - /** - * Makes the substitution's divisor conform to that of the rule - * that owns it. Used when the divisor is determined after creation. - * @param radix The radix of the divsor. - * @param exponent The exponent of the divisor. - */ - public void setDivisor(int radix, int exponent) { - divisor = Math.pow(radix, exponent); - } - - //----------------------------------------------------------------------- - // boilerplate - //----------------------------------------------------------------------- - - /** - * Augments the inherited equals() function by comparing divisors and - * ruleToUse. - * @param that The other substitution - * @return true if the two substitutions are functionally equivalent - */ - public boolean equals(Object that) { - if (super.equals(that)) { - ModulusSubstitution that2 = (ModulusSubstitution)that; - - return divisor == that2.divisor; - } else { - return false; - } - } - - //----------------------------------------------------------------------- - // formatting - //----------------------------------------------------------------------- - - /** - * If this is a >>> substitution, use ruleToUse to fill in - * the substitution. Otherwise, just use the superclass function. - * @param number The number being formatted - * @toInsertInto The string to insert the result of this substitution - * into - * @param pos The position of the rule text in toInsertInto - */ - public void doSubstitution(long number, StringBuffer toInsertInto, int pos) { - // if this isn't a >>> substitution, just use the inherited version - // of this function (which uses either a rule set or a DecimalFormat - // to format its substitution value) - if (ruleToUse == null) { - super.doSubstitution(number, toInsertInto, pos); - - // a >>> substitution goes straight to a particular rule to - // format the substitution value - } else { - long numberToFormat = transformNumber(number); - ruleToUse.doFormat(numberToFormat, toInsertInto, pos + this.pos); - } - } - - /** - * If this is a >>> substitution, use ruleToUse to fill in - * the substitution. Otherwise, just use the superclass function. - * @param number The number being formatted - * @toInsertInto The string to insert the result of this substitution - * into - * @param pos The position of the rule text in toInsertInto - */ - public void doSubstitution(double number, StringBuffer toInsertInto, int pos) { - // if this isn't a >>> substitution, just use the inherited version - // of this function (which uses either a rule set or a DecimalFormat - // to format its substitution value) - if (ruleToUse == null) { - super.doSubstitution(number, toInsertInto, pos); - - // a >>> substitution goes straight to a particular rule to - // format the substitution value - } else { - double numberToFormat = transformNumber(number); - - ruleToUse.doFormat(numberToFormat, toInsertInto, pos + this.pos); - } - } - - /** - * Divides the number being formatted by the rule's divisor and - * returns the remainder. - * @param number The number being formatted - * @return "number" mod divisor - */ - public long transformNumber(long number) { - return (long)Math.floor(number % divisor); - } - - /** - * Divides the number being formatted by the rule's divisor and - * returns the remainder. - * @param number The number being formatted - * @return "number" mod divisor - */ - public double transformNumber(double number) { - return Math.floor(number % divisor); - } - - //----------------------------------------------------------------------- - // parsing - //----------------------------------------------------------------------- - - /** - * If this is a >>> substitution, match only against ruleToUse. - * Otherwise, use the superclass function. - * @param text The string to parse - * @param parsePosition Ignored on entry, updated on exit to point to - * the first unmatched character. - * @param baseValue The partial parse result prior to calling this - * routine. - */ - public Number doParse(String text, ParsePosition parsePosition, double baseValue, - double upperBound, boolean lenientParse) { - // if this isn't a >>> substitution, we can just use the - // inherited parse() routine to do the parsing - if (ruleToUse == null) { - return super.doParse(text, parsePosition, baseValue, upperBound, lenientParse); - - // but if it IS a >>> substitution, we have to do it here: we - // use the specific rule's doParse() method, and then we have to - // do some of the other work of NFRuleSet.parse() - } else { - Number tempResult = ruleToUse.doParse(text, parsePosition, false, upperBound); - - if (parsePosition.getIndex() != 0) { - double result = tempResult.doubleValue(); - - result = composeRuleValue(result, baseValue); - if (result == (long)result) { - return new Long((long)result); - } else { - return new Double(result); - } - } else { - return tempResult; - } - } - } - - /** - * Returns the highest multiple of the rule's divisor that its less - * than or equal to oldRuleValue, plus newRuleValue. (The result - * is the sum of the result of parsing the substitution plus the - * base valueof the rule containing the substitution, but if the - * owning rule's base value isn't an even multiple of its divisor, - * we have to round it down to a multiple of the divisor, or we - * get unwanted digits in the result.) - * @param newRuleValue The result of parsing the substitution - * @param oldRuleValue The base value of the rule containing the - * substitution - * @return (oldRuleValue - (oldRuleValue % divisor)) + newRuleValue - */ - public double composeRuleValue(double newRuleValue, double oldRuleValue) { - return (oldRuleValue - (oldRuleValue % divisor)) + newRuleValue; - } - - /** - * Sets the upper bound down to the owning rule's divisor - * @param oldUpperBound Ignored - * @return The owning rule's dvisor - */ - public double calcUpperBound(double oldUpperBound) { - return divisor; - } - - //----------------------------------------------------------------------- - // simple accessors - //----------------------------------------------------------------------- - - /** - * Returns true. This _is_ a ModulusSubstitution. - * @return true - */ - public boolean isModulusSubstitution() { - return true; - } - - /** - * The token character of a ModulusSubstitution is >. - * @return '>' - */ - char tokenChar() { - return '>'; - } -} - -//=================================================================== -// IntegralPartSubstitution -//=================================================================== - -/** - * A substitution that formats the number's integral part. This is - * represented by << in a fraction rule. - */ -class IntegralPartSubstitution extends NFSubstitution { - //----------------------------------------------------------------------- - // constants - //----------------------------------------------------------------------- - - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - //----------------------------------------------------------------------- - // construction - //----------------------------------------------------------------------- - - /** - * Constructs an IntegralPartSubstitution. This just calls - * the superclass constructor. - */ - IntegralPartSubstitution(int pos, - NFRuleSet ruleSet, - RuleBasedNumberFormat formatter, - String description) { - super(pos, ruleSet, formatter, description); - } - - //----------------------------------------------------------------------- - // formatting - //----------------------------------------------------------------------- - - /** - * Returns the number's integral part. (For a long, that's just the - * number unchanged.) - * @param number The number being formatted - * @return "number" unchanged - */ - public long transformNumber(long number) { - return number; - } - - /** - * Returns the number's integral part. - * @param number The integral part of the number being formatted - * @return floor(number) - */ - public double transformNumber(double number) { - return Math.floor(number); - } - - //----------------------------------------------------------------------- - // parsing - //----------------------------------------------------------------------- - - /** - * Returns the sum of the result of parsing the substitution and the - * owning rule's base value. (The owning rule, at best, has an - * integral-part substitution and a fractional-part substitution, - * so we can safely just add them.) - * @param newRuleValue The result of matching the substitution - * @param oldRuleValue The partial result of the parse prior to - * calling this function - * @return oldRuleValue + newRuleValue - */ - public double composeRuleValue(double newRuleValue, double oldRuleValue) { - return newRuleValue + oldRuleValue; - } - - /** - * An IntegralPartSubstitution sets the upper bound back up so all - * potentially matching rules are considered. - * @param oldUpperBound Ignored - * @return Double.MAX_VALUE - */ - public double calcUpperBound(double oldUpperBound) { - return Double.MAX_VALUE; - } - - //----------------------------------------------------------------------- - // simple accessor - //----------------------------------------------------------------------- - - /** - * An IntegralPartSubstitution's token character is < - * @return '<' - */ - char tokenChar() { - return '<'; - } -} - -//=================================================================== -// FractionalPartSubstitution -//=================================================================== - -/** - * A substitution that formats the fractional part of a number. This is - * represented by >> in a fraction rule. - */ -class FractionalPartSubstitution extends NFSubstitution { - //----------------------------------------------------------------------- - // constants - //----------------------------------------------------------------------- - - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - //----------------------------------------------------------------------- - // data members - //----------------------------------------------------------------------- - - /** - * true if this substitution should have the default "by digits" - * behavior, false otherwise - */ - private boolean byDigits = false; - - /** - * true if we automatically insert spaces to separate names of digits - * set to false by '>>>' in fraction rules, used by Thai. - */ - private boolean useSpaces = true; - - /** - * The largest number of digits after the decimal point that this - * object will show in "by digits" mode - */ - private static final int MAXDECIMALDIGITS = 8; - - //----------------------------------------------------------------------- - // construction - //----------------------------------------------------------------------- - - /** - * Constructs a FractionalPartSubstitution. This object keeps a flag - * telling whether it should format by digits or not. In addition, - * it marks the rule set it calls (if any) as a fraction rule set. - */ - FractionalPartSubstitution(int pos, - NFRuleSet ruleSet, - RuleBasedNumberFormat formatter, - String description) { - super(pos, ruleSet, formatter, description); - if (description.equals(">>") || description.equals(">>>") || ruleSet == this.ruleSet) { - byDigits = true; - if (description.equals(">>>")) { - useSpaces = false; - } - } else { - this.ruleSet.makeIntoFractionRuleSet(); - } - } - - //----------------------------------------------------------------------- - // formatting - //----------------------------------------------------------------------- - - /** - * If in "by digits" mode, fills in the substitution one decimal digit - * at a time using the rule set containing this substitution. - * Otherwise, uses the superclass function. - * @param number The number being formatted - * @param toInsertInto The string to insert the result of formatting - * the substitution into - * @param pos The position of the owning rule's rule text in - * toInsertInto - */ - public void doSubstitution(double number, StringBuffer toInsertInto, int pos) { - // if we're not in "byDigits" mode, just use the inherited - // doSubstitution() routine - if (!byDigits) { - super.doSubstitution(number, toInsertInto, pos); - - // if we're in "byDigits" mode, transform the value into an integer - // by moving the decimal point eight places to the right and - // pulling digits off the right one at a time, formatting each digit - // as an integer using this substitution's owning rule set - // (this is slower, but more accurate, than doing it from the - // other end) - } else { - int numberToFormat = (int)Math.round(transformNumber(number) * Math.pow( - 10, MAXDECIMALDIGITS)); - // this flag keeps us from formatting trailing zeros. It starts - // out false because we're pulling from the right, and switches - // to true the first time we encounter a non-zero digit - boolean doZeros = false; - for (int i = 0; i < MAXDECIMALDIGITS; i++) { - int digit = numberToFormat % 10; - if (digit != 0 || doZeros) { - if (doZeros && useSpaces) { - toInsertInto.insert(pos + this.pos, ' '); - } - doZeros = true; - ruleSet.format(digit, toInsertInto, pos + this.pos); - } - numberToFormat /= 10; - } - } - } - - /** - * Returns the fractional part of the number, which will always be - * zero if it's a long. - * @param number The number being formatted - * @return 0 - */ - public long transformNumber(long number) { - return 0; - } - - /** - * Returns the fractional part of the number. - * @param number The number being formatted. - * @return number - floor(number) - */ - public double transformNumber(double number) { - return number - Math.floor(number); - } - - //----------------------------------------------------------------------- - // parsing - //----------------------------------------------------------------------- - - /** - * If in "by digits" mode, parses the string as if it were a string - * of individual digits; otherwise, uses the superclass function. - * @param text The string to parse - * @param parsePosition Ignored on entry, but updated on exit to point - * to the first unmatched character - * @param baseValue The partial parse result prior to entering this - * function - * @param upperBound Only consider rules with base values lower than - * this when filling in the substitution - * @param lenientParse If true, try matching the text as numerals if - * matching as words doesn't work - * @return If the match was successful, the current partial parse - * result; otherwise new Long(0). The result is either a Long or - * a Double. - */ - public Number doParse(String text, ParsePosition parsePosition, double baseValue, - double upperBound, boolean lenientParse) { - // if we're not in byDigits mode, we can just use the inherited - // doParse() - if (!byDigits) { - return super.doParse(text, parsePosition, baseValue, 0, lenientParse); - - // if we ARE in byDigits mode, parse the text one digit at a time - // using this substitution's owning rule set (we do this by setting - // upperBound to 10 when calling doParse() ) until we reach - // nonmatching text - } else { - String workText = new String(text); - ParsePosition workPos = new ParsePosition(1); - double result = 0; - int digit; - double p10 = 0.1; - - while (workText.length() > 0 && workPos.getIndex() != 0) { - workPos.setIndex(0); - digit = ruleSet.parse(workText, workPos, 10).intValue(); - if (lenientParse && workPos.getIndex() == 0) { - digit = NumberFormat.getInstance().parse(workText, workPos).intValue(); - } - - if (workPos.getIndex() != 0) { - result += digit * p10; - p10 /= 10; - parsePosition.setIndex(parsePosition.getIndex() + workPos.getIndex()); - workText = workText.substring(workPos.getIndex()); - while (workText.length() > 0 && workText.charAt(0) == ' ') { - workText = workText.substring(1); - parsePosition.setIndex(parsePosition.getIndex() + 1); - } - } - } - result = composeRuleValue(result, baseValue); - return new Double(result); - } - } - - /** - * Returns the sum of the two partial parse results. - * @param newRuleValue The result of parsing the substitution - * @param oldRuleValue The partial parse result prior to calling - * this function - * @return newRuleValue + oldRuleValue - */ - public double composeRuleValue(double newRuleValue, double oldRuleValue) { - return newRuleValue + oldRuleValue; - } - - /** - * Not used. - */ - public double calcUpperBound(double oldUpperBound) { - return 0; // this value is ignored - } - - //----------------------------------------------------------------------- - // simple accessor - //----------------------------------------------------------------------- - - /** - * The token character for a FractionalPartSubstitution is >. - * @return '>' - */ - char tokenChar() { - return '>'; - } -} - -//=================================================================== -// AbsoluteValueSubstitution -//=================================================================== - - /** - * A substitution that formats the absolute value of the number. - * This substition is represented by >> in a negative-number rule. - */ -class AbsoluteValueSubstitution extends NFSubstitution { - //----------------------------------------------------------------------- - // constants - //----------------------------------------------------------------------- - - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - //----------------------------------------------------------------------- - // construction - //----------------------------------------------------------------------- - - /** - * Constructs an AbsoluteValueSubstitution. This just uses the - * superclass constructor. - */ - AbsoluteValueSubstitution(int pos, - NFRuleSet ruleSet, - RuleBasedNumberFormat formatter, - String description) { - super(pos, ruleSet, formatter, description); - } - - //----------------------------------------------------------------------- - // formatting - //----------------------------------------------------------------------- - - /** - * Returns the absolute value of the number. - * @param number The number being formatted. - * @return abs(number) - */ - public long transformNumber(long number) { - return Math.abs(number); - } - - /** - * Returns the absolute value of the number. - * @param number The number being formatted. - * @return abs(number) - */ - public double transformNumber(double number) { - return Math.abs(number); - } - - //----------------------------------------------------------------------- - // parsing - //----------------------------------------------------------------------- - - /** - * Returns the addtive inverse of the result of parsing the - * substitution (this supersedes the earlier partial result) - * @param newRuleValue The result of parsing the substitution - * @param oldRuleValue The partial parse result prior to calling - * this function - * @return -newRuleValue - */ - public double composeRuleValue(double newRuleValue, double oldRuleValue) { - return -newRuleValue; - } - - /** - * Sets the upper bound beck up to consider all rules - * @param oldUpperBound Ignored. - * @return Double.MAX_VALUE - */ - public double calcUpperBound(double oldUpperBound) { - return Double.MAX_VALUE; - } - - //----------------------------------------------------------------------- - // simple accessor - //----------------------------------------------------------------------- - - /** - * The token character for an AbsoluteValueSubstitution is > - * @return '>' - */ - char tokenChar() { - return '>'; - } -} - -//=================================================================== -// NumeratorSubstitution -//=================================================================== - -/** - * A substitution that multiplies the number being formatted (which is - * between 0 and 1) by the base value of the rule that owns it and - * formats the result. It is represented by << in the rules - * in a fraction rule set. - */ -class NumeratorSubstitution extends NFSubstitution { - //----------------------------------------------------------------------- - // constants - //----------------------------------------------------------------------- - - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - //----------------------------------------------------------------------- - // data members - //----------------------------------------------------------------------- - - /** - * The denominator of the fraction we're finding the numerator for. - * (The base value of the rule that owns this substitution.) - */ - double denominator; - - //----------------------------------------------------------------------- - // construction - //----------------------------------------------------------------------- - - /** - * Constructs a NumberatorSubstitution. In addition to the inherited - * fields, a NumeratorSubstitution keeps track of a denominator, which - * is merely the base value of the rule that owns it. - */ - NumeratorSubstitution(int pos, - double denominator, - NFRuleSet ruleSet, - RuleBasedNumberFormat formatter, - String description) { - super(pos, ruleSet, formatter, description); - - // this substitution's behavior depends on the rule's base value - // Rather than keeping a backpointer to the rule, we copy its - // base value here - this.denominator = denominator; - } - - //----------------------------------------------------------------------- - // boilerplate - //----------------------------------------------------------------------- - - /** - * Tests two NumeratorSubstitutions for equality - * @param that The other NumeratorSubstitution - * @return true if the two objects are functionally equivalent - */ - public boolean equals(Object that) { - if (super.equals(that)) { - NumeratorSubstitution that2 = (NumeratorSubstitution)that; - - return denominator == that2.denominator; - } else { - return false; - } - } - - //----------------------------------------------------------------------- - // formatting - //----------------------------------------------------------------------- - - /** - * Returns the number being formatted times the denominator. - * @param number The number being formatted - * @return number * denominator - */ - public long transformNumber(long number) { - return Math.round(number * denominator); - } - - /** - * Returns the number being formatted times the denominator. - * @param number The number being formatted - * @return number * denominator - */ - public double transformNumber(double number) { - return Math.round(number * denominator); - } - - //----------------------------------------------------------------------- - // parsing - //----------------------------------------------------------------------- - - /** - * Dispatches to the inherited version of this function, but makes - * sure that lenientParse is off. - */ - public Number doParse(String text, ParsePosition parsePosition, double baseValue, - double upperBound, boolean lenientParse) { - // we don't have to do anything special to do the parsing here, - // but we have to turn lenient parsing off-- if we leave it on, - // it SERIOUSLY messes up the algorithm - return super.doParse(text, parsePosition, baseValue, upperBound, false); - } - - /** - * Divides the result of parsing the substitution by the partial - * parse result. - * @param newRuleValue The result of parsing the substitution - * @param oldRuleValue The owning rule's base value - * @return newRuleValue / oldRuleValue - */ - public double composeRuleValue(double newRuleValue, double oldRuleValue) { - return newRuleValue / oldRuleValue; - } - - /** - * Sets the uper bound down to this rule's base value - * @param oldUpperBound Ignored - * @return The base value of the rule owning this substitution - */ - public double calcUpperBound(double oldUpperBound) { - return denominator; - } - - //----------------------------------------------------------------------- - // simple accessor - //----------------------------------------------------------------------- - - /** - * The token character for a NumeratorSubstitution is < - * @return '<' - */ - char tokenChar() { - return '<'; - } -} - -//=================================================================== -// NullSubstitution -//=================================================================== - -/** - * A substitution which does nothing. This class exists just to simplify - * the logic in some other routines so that they don't have to worry - * about how many substitutions a rule has. - */ -class NullSubstitution extends NFSubstitution { - //----------------------------------------------------------------------- - // constants - //----------------------------------------------------------------------- - - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - //----------------------------------------------------------------------- - // construction - //----------------------------------------------------------------------- - - /** - * Constructs a NullSubstitution. This just delegates to the superclass - * constructor, but the only value we really care about is the position. - */ - NullSubstitution(int pos, - NFRuleSet ruleSet, - RuleBasedNumberFormat formatter, - String description) { - super(pos, ruleSet, formatter, description); - } - - //----------------------------------------------------------------------- - // boilerplate - //----------------------------------------------------------------------- - - /** - * Only checks for class equality - */ - public boolean equals(Object that) { - return super.equals(that); - } - - /** - * NullSubstitutions don't show up in the textual representation - * of a RuleBasedNumberFormat - */ - public String toString() { - return ""; - } - - //----------------------------------------------------------------------- - // formatting - //----------------------------------------------------------------------- - - /** - * Does nothing. - */ - public void doSubstitution(long number, StringBuffer toInsertInto, int pos) { - } - - /** - * Does nothing. - */ - public void doSubstitution(double number, StringBuffer toInsertInto, int pos) { - } - - /** - * Never called. - */ - public long transformNumber(long number) { - return 0; - } - - /** - * Never called. - */ - public double transformNumber(double number) { - return 0; - } - - //----------------------------------------------------------------------- - // parsing - //----------------------------------------------------------------------- - - /** - * Returns the partial parse result unchanged - */ - public Number doParse(String text, ParsePosition parsePosition, double baseValue, - double upperBound, boolean lenientParse) { - if (baseValue == (long)baseValue) { - return new Long((long)baseValue); - } else { - return new Double(baseValue); - } - } - - /** - * Never called. - */ - public double composeRuleValue(double newRuleValue, double oldRuleValue) { - return 0; - } - - /** - * Never called. - */ - public double calcUpperBound(double oldUpperBound) { - return 0; - } - - //----------------------------------------------------------------------- - // simple accessors - //----------------------------------------------------------------------- - - /** - * Returns true (this _is_ a NillSubstitution). - * @return true - */ - public boolean isNullSubstitution() { - return true; - } - - /** - * Never called. - */ - char tokenChar() { - return ' '; - } -} - diff --git a/icu4j/src/com/ibm/text/NameUnicodeTransliterator.java b/icu4j/src/com/ibm/text/NameUnicodeTransliterator.java deleted file mode 100755 index 3b0fc17a9f..0000000000 --- a/icu4j/src/com/ibm/text/NameUnicodeTransliterator.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (C) 1996-2001, International Business Machines Corporation and - * others. All Rights Reserved. - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/NameUnicodeTransliterator.java,v $ - * $Date: 2002/02/09 01:01:47 $ - * $Revision: 1.7 $ - */ -package com.ibm.text; -import java.util.*; - -/** - * A transliterator that performs name to character mapping. - * @author Alan Liu - */ -class NameUnicodeTransliterator extends Transliterator { - - char openDelimiter; - char closeDelimiter; - - static final String _ID = "Name-Any"; - - /** - * System registration hook. - */ - static void register() { - Transliterator.registerFactory(_ID, new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new NameUnicodeTransliterator(null); - } - }); - } - - /** - * Constructs a transliterator. - */ - public NameUnicodeTransliterator(char openDelimiter, char closeDelimiter, - UnicodeFilter filter) { - super(_ID, filter); - this.openDelimiter = openDelimiter; - this.closeDelimiter = closeDelimiter; - } - - /** - * Constructs a transliterator with the default delimiters '{' and - * '}'. - */ - public NameUnicodeTransliterator(UnicodeFilter filter) { - this('{', '}', filter); - } - - /** - * Implements {@link Transliterator#handleTransliterate}. - */ - protected void handleTransliterate(Replaceable text, - Position offsets, boolean isIncremental) { - // Longest name as of 3.0.0 is 83 - final int LONGEST_NAME = 83; - - // Accomodate the longest possible name plus padding - char[] buf = new char[LONGEST_NAME + 8]; - - // The only characters used in names are (as of Unicode 3.0.0): - // -0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ - // (first character is a space). - - int cursor = offsets.start; - int limit = offsets.limit; - - // Modes: - // 0 - looking for open delimiter - // 1 - after open delimiter - int mode = 0; - int ibuf = 0; - int openPos = offsets.start; // position of openDelimiter - - int c; - for (; cursor < limit; cursor+=UTF16.getCharCount(c)) { - c = text.char32At(cursor); - - switch (mode) { - case 0: // looking for open delimiter - if (c == openDelimiter) { - openPos = cursor; - mode = 1; - ibuf = 0; - } - break; - - case 1: // after open delimiter - // Look for [-a-zA-Z0-9]. If \w+ is found, convert it - // to a single space. If closeDelimiter is found, exit - // the loop. If any other character is found, exit the - // loop. If the limit is found, exit the loop. - if (UCharacter.isWhitespace(c)) { - // Ignore leading whitespace - if (ibuf != 0 && buf[ibuf-1] != (char)0x0020) { - buf[ibuf++] = (char)0x0020 /* */; - // If we go a bit past the longest possible name then abort - if (ibuf == (LONGEST_NAME + 4)) { - mode = 0; - } - } - continue; - } - - if (c == closeDelimiter) { - // Delete trailing space, if any - if (ibuf > 0 && buf[ibuf-1] == (char)0x0020) { - --ibuf; - } - int ch = UCharacter.getCharFromName(new String(buf, 0, ibuf)); - if (ch != -1) { - // Lookup succeeded - String str = UTF16.valueOf(ch); - text.replace(openPos, cursor+1, str); - - // Adjust indices for the change in the length of - // the string. Do not assume that str.length() == - // 1, in case of surrogates. - int delta = cursor + 1 - openPos - str.length(); - cursor -= delta; - limit -= delta; - // assert(cursor == openPos + str.length()); - } - // If the lookup failed, we leave things as-is and - // still switch to mode 0 and continue. - mode = 0; - continue; - } - - if (c >= (char)0x0061 && c <= (char)0x007A) { - c -= 0x0020; // [a-z] => [A-Z] - } - - // Check if c =~ [-A-Z0-9] - if (c == (char)0x002D || - (c >= (char)0x0041 && c <= (char)0x005A) || - (c >= (char)0x0030 && c <= (char)0x0039)) { - buf[ibuf++] = (char) c; - // If we go a bit past the longest possible name then abort - if (ibuf == (LONGEST_NAME + 4)) { - mode = 0; - } - } - - // Invalid character - else { - --cursor; // Backup and reprocess this character - mode = 0; - } - - break; - } - } - - offsets.contextLimit += limit - offsets.limit; - offsets.limit = limit; - // In incremental mode, only advance the cursor up to the last - // open delimiter, if we are in mode 1. - offsets.start = (mode == 1 && isIncremental) ? openPos : cursor; - } -} diff --git a/icu4j/src/com/ibm/text/NormalizationTransliterator.java b/icu4j/src/com/ibm/text/NormalizationTransliterator.java deleted file mode 100755 index ced6ae9cfa..0000000000 --- a/icu4j/src/com/ibm/text/NormalizationTransliterator.java +++ /dev/null @@ -1,605 +0,0 @@ -/* -********************************************************************** -* Copyright (C) 2001, International Business Machines -* Corporation and others. All Rights Reserved. -********************************************************************** -* Date Name Description -* 06/08/01 aliu Creation. -********************************************************************** -*/ - -package com.ibm.text; -import java.util.*; - -/** - * @author Alan Liu - * @version $RCSfile: NormalizationTransliterator.java,v $ $Revision: 1.15 $ $Date: 2002/02/09 01:01:47 $ - */ -final class NormalizationTransliterator extends Transliterator { - - static final boolean DEBUG = false; - - /** - * The normalization mode of this transliterator. - */ - private Normalizer.Mode mode; - - /** - * Normalization options for this transliterator. - */ - private int options; - - /** - * The set of "unsafe start" characters. These are characters - * with cc==0 but which may interact with previous characters. We - * effectively consider these to be cc!=0, for our purposes. - * - * From http://www.macchiato.com/utc/NFUnsafeStart-3.1.1dX.txt - * Generated in unicodetools, NFSkippable - * - */ - - static final UnicodeSet[] UNSAFE_STARTS = new UnicodeSet[4]; - static final UnicodeSet[] SKIPPABLES = new UnicodeSet[4]; - - static final int - D = 0, C = 1, KD= 2, KC = 3; - - // Instance data, simply pointer to one of the sets below - final UnicodeSet UNSAFE_START; - final UnicodeSet SKIPPABLE; - - /** - * System registration hook. - */ - static void register() { - Transliterator.registerFactory("Any-NFC", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return NormalizationTransliterator. - getInstance(Normalizer.COMPOSE); - } - }); - Transliterator.registerFactory("Any-NFD", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return NormalizationTransliterator. - getInstance(Normalizer.DECOMP); - } - }); - Transliterator.registerFactory("Any-NFKC", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return NormalizationTransliterator. - getInstance(Normalizer.COMPOSE_COMPAT); - } - }); - Transliterator.registerFactory("Any-NFKD", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return NormalizationTransliterator. - getInstance(Normalizer.DECOMP_COMPAT); - } - }); - Transliterator.registerSpecialInverse("NFC", "NFD", true); - Transliterator.registerSpecialInverse("NFKC", "NFKD", true); - } - - /** - * Factory method. - */ - public static NormalizationTransliterator getInstance(Normalizer.Mode m, - int opt) { - StringBuffer id = new StringBuffer("NF"); - int choice = 0; - if (m.compat()) { - id.append('K'); - choice |= KD; - } - if (m.compose()) { - id.append('C'); - choice |= C; - } else { - id.append('D'); - } - return new NormalizationTransliterator(id.toString(), m, choice, opt); - } - - /** - * Factory method. - */ - public static NormalizationTransliterator getInstance(Normalizer.Mode m) { - return getInstance(m, 0); - } - - /** - * Constructs a transliterator. - */ - private NormalizationTransliterator(String id, Normalizer.Mode m, int startChoice, - int opt) { - super(id, null); - mode = m; - options = opt; - UNSAFE_START = UNSAFE_STARTS[startChoice]; - SKIPPABLE = SKIPPABLES[startChoice]; - } - - /** - * Implements {@link Transliterator#handleTransliterate}. - */ - protected void handleTransliterate(Replaceable text, - Position offsets, boolean isIncremental) { - int start = offsets.start; - int limit = offsets.limit; - if (start >= limit) return; - - int overallDelta = 0; - - // Walk through the string looking for safe characters. - // Whenever you hit one normalize from the start of the last - // safe character up to just before the next safe character - // Also, if you hit the end and we are not in incremental mode, - // do to end. - - // TODO: fix for surrogates - // TODO: add QuickCheck, so we rarely convert OK stuff - - int lastSafe = start; // go back to start in any event - int cp; - for (int i = start+1; i < limit; i += UTF16.getCharCount(cp)) { - cp = text.char32At(i); - if (UCharacter.getCombiningClass(cp) == 0 && !UNSAFE_START.contains(cp)) { - int delta = convert(text, lastSafe, i, null); - i += delta; - limit += delta; - overallDelta += delta; - lastSafe = i; - } - } - if (!isIncremental) { - int delta = convert(text, lastSafe, limit, null); - overallDelta += delta; - lastSafe = limit + delta; - } else { - // We are incremental, so accept the last characters IF they turn into SKIPPABLEs - int delta = convert(text, lastSafe, limit, SKIPPABLE); - if (delta != Integer.MIN_VALUE) { - overallDelta += delta; - lastSafe = limit + delta; - } - } - offsets.contextLimit += overallDelta; - offsets.limit += overallDelta; - offsets.start = lastSafe; - } - - /** - * Converts the range from lastSafe to limit. - * @param verify If non-null, check to see that all replacement characters are in it. If not, - * abort the conversion and return Integer.MIN_VALUE. - * @return return the delta in length (new - old), or Integer.MIN_VALUE if the verify aborted. - */ - int convert(Replaceable text, int lastSafe, int limit, UnicodeSet verify) { - //System.out.println("t: " + com.ibm.util.Utility.hex(text.toString()) + ", s: " + lastSafe + ", l: " + limit); - - int len = limit - lastSafe; - if (buffer.length < len) { - buffer = new char[len]; // rare, and we don't care if we grow too large - } - text.getChars(lastSafe, limit, buffer, 0); - String input = new String(buffer, 0, len); // TODO: fix normalizer to take char[] - String output = Normalizer.normalize(input, mode, options); - - // verify OK, if specified - if (verify != null) { - boolean skip = !SKIPPABLE.containsAll(output); - if (DEBUG) { - System.out.println((skip ? " SKIP: " : "NOSKIP: ") - + com.ibm.util.Utility.escape(input) - + " => " + com.ibm.util.Utility.escape(output)); - } - if (skip) return Integer.MIN_VALUE; - } - - if (output.equals(input)) { - return 0; - } - text.replace(lastSafe, limit, output); - return output.length() - len; - } - - private char buffer[] = new char[30]; - - static { - UNSAFE_STARTS[D] = new UnicodeSet("[\u0F73\u0F75\u0F81]", false); - UNSAFE_STARTS[C] = new UnicodeSet("[\u09BE\u09D7\u0B3E\u0B56-\u0B57\u0BBE\u0BD7\u0CC2\u0CD5-\u0CD6" - + "\u0D3E\u0D57\u0DCF\u0DDF\u0F73\u0F75\u0F81\u102E\u1161-\u1175\u11A8-\u11C2]", false); - UNSAFE_STARTS[KD] = new UnicodeSet("[\u0F73\u0F75\u0F81\uFF9E-\uFF9F]", false); - UNSAFE_STARTS[KC] = new UnicodeSet("[\u09BE\u09D7\u0B3E\u0B56-\u0B57\u0BBE\u0BD7\u0CC2\u0CD5-\u0CD6" - + "\u0D3E\u0D57\u0DCF\u0DDF\u0F73\u0F75\u0F81\u102E\u1161-\u1175\u11A8-\u11C2\u3133\u3135-\u3136" - + "\u313A-\u313F\u314F-\u3163\uFF9E-\uFF9F\uFFA3\uFFA5-\uFFA6\uFFAA-\uFFAF\uFFC2-\uFFC7\uFFCA-\uFFCF" - + "\uFFD2-\uFFD7\uFFDA-\uFFDC]", false); - - SKIPPABLES[D] = new UnicodeSet( - "[^\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-" - + "\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112" - + "-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148" - + "\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-" - + "\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01F0\u01F4-\u01F5\u01F8" - + "-\u021B\u021E-\u021F\u0226-\u0233\u0300-\u034E\u0360-\u0362" - + "\u0374\u037E\u0385-\u038A\u038C\u038E-\u0390\u03AA-\u03B0\u03CA-" - + "\u03CE\u03D3-\u03D4\u0400-\u0401\u0403\u0407\u040C-\u040E\u0419" - + "\u0439\u0450-\u0451\u0453\u0457\u045C-\u045E\u0476-\u0477\u0483-" - + "\u0486\u04C1-\u04C2\u04D0-\u04D3\u04D6-\u04D7\u04DA-\u04DF\u04E2" - + "-\u04E7\u04EA-\u04F5\u04F8-\u04F9\u0591-\u05A1\u05A3-\u05B9" - + "\u05BB-\u05BD\u05BF\u05C1-\u05C2\u05C4\u0622-\u0626\u064B-\u0655" - + "\u0670\u06C0\u06C2\u06D3\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8" - + "\u06EA-\u06ED\u0711\u0730-\u074A\u0929\u0931\u0934\u093C\u094D" - + "\u0951-\u0954\u0958-\u095F\u09BC\u09CB-\u09CD\u09DC-\u09DD\u09DF" - + "\u0A33\u0A36\u0A3C\u0A4D\u0A59-\u0A5B\u0A5E\u0ABC\u0ACD\u0B3C" - + "\u0B48\u0B4B-\u0B4D\u0B5C-\u0B5D\u0B94\u0BCA-\u0BCD\u0C48\u0C4D" - + "\u0C55-\u0C56\u0CC0\u0CC7-\u0CC8\u0CCA-\u0CCB\u0CCD\u0D4A-\u0D4D" - + "\u0DCA\u0DDA\u0DDC-\u0DDE\u0E38-\u0E3A\u0E48-\u0E4B\u0EB8-\u0EB9" - + "\u0EC8-\u0ECB\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F43\u0F4D\u0F52" - + "\u0F57\u0F5C\u0F69\u0F71-\u0F76\u0F78\u0F7A-\u0F7D\u0F80-\u0F84" - + "\u0F86-\u0F87\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u0FC6\u1026" - + "\u1037\u1039\u17D2\u18A9\u1E00-\u1E99\u1E9B\u1EA0-\u1EF9\u1F00-" - + "\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59" - + "\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC1-" - + "\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6" - + "-\u1FFD\u2000-\u2001\u20D0-\u20DC\u20E1\u2126\u212A-\u212B\u219A" - + "-\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u2241" - + "\u2244\u2247\u2249\u2260\u2262\u226D-\u2271\u2274-\u2275\u2278-" - + "\u2279\u2280-\u2281\u2284-\u2285\u2288-\u2289\u22AC-\u22AF\u22E0" - + "-\u22E3\u22EA-\u22ED\u2329-\u232A\u302A-\u302F\u304C\u304E\u3050" - + "\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062\u3065" - + "\u3067\u3069\u3070-\u3071\u3073-\u3074\u3076-\u3077\u3079-\u307A" - + "\u307C-\u307D\u3094\u3099-\u309A\u309E\u30AC\u30AE\u30B0\u30B2" - + "\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7" - + "\u30C9\u30D0-\u30D1\u30D3-\u30D4\u30D6-\u30D7\u30D9-\u30DA\u30DC" - + "-\u30DD\u30F4\u30F7-\u30FA\u30FE\uAC00-\uD7A3\uF900-\uFA0D\uFA10" - + "\uFA12\uFA15-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA2D\uFB1D-" - + "\uFB1F\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44" - + "\uFB46-\uFB4E\uFE20-\uFE23\\U0001D15E-\\U0001D169\\U0001D16D-\\U0001" - + "D172\\U0001D17B-\\U0001D182\\U0001D185-\\U0001D18B\\U0001D1AA-\\U0001D" - + "1AD\\U0001D1BB-\\U0001D1C0\\U0002F800-\\U0002FA1D]", false); - - /*Unicode: - "[^À-ÅÇ-ÏÑ-ÖÙ-Ýà-åç-ïñ-öù-ýÿ-dE-hI-IJ-kL-lN-nO-oR-tU-žO-oU-uA-uA-" - + "?G-j?-??-??-??-?`-??-??;?-???-??-??-??-??-????-????-????-??-??-?" - + "?-??-??-??-??-??-??-??-??-??-???-???-??-??????-??-??-??-???-????" - + "???-??-???-??-???????-???????-??-???-????-???-??-???-????-??-??-" - + "??-??-??-???????????-???-??-??-??????????????-???-??-??-??-??-??" - + "-?????-??-??-???-??-??-??-??-??-?\ -\ ?-???K-Å?-???-????????????" - + "?-??-??-??-??-??-??-??-??-?<->?-?????????????????-??-??-??-??-??" - + "?-??????????????????-??-??-??-??-???-???-??-????-????-??-??-??-?" - + "?-???-??-??-??-???-????-????-????-????-????-????-??]"*/ - - SKIPPABLES[C] = new UnicodeSet( - "[^<->A-PR-Za-pr-z\u00A8\u00C0-\u00CF\u00D1-\u00D6\u00D8-\u00DD" - + "\u00E0-\u00EF\u00F1-\u00F6\u00F8-\u00FD\u00FF-\u0103\u0106-" - + "\u010F\u0112-\u0117\u011A-\u0121\u0124-\u0125\u0128-\u012D\u0130" - + "\u0139-\u013A\u013D-\u013E\u0143-\u0144\u0147-\u0148\u014C-" - + "\u0151\u0154-\u0155\u0158-\u015D\u0160-\u0161\u0164-\u0165\u0168" - + "-\u0171\u0174-\u017F\u01A0-\u01A1\u01AF-\u01B0\u01B7\u01CD-" - + "\u01DC\u01DE-\u01E1\u01E6-\u01EB\u01F4-\u01F5\u01F8-\u01FB\u0200" - + "-\u021B\u021E-\u021F\u0226-\u0233\u0292\u0300-\u034E\u0360-" - + "\u0362\u0374\u037E\u0387\u0391\u0395\u0397\u0399\u039F\u03A1" - + "\u03A5\u03A9\u03AC\u03AE\u03B1\u03B5\u03B7\u03B9\u03BF\u03C1" - + "\u03C5\u03C9-\u03CB\u03CE\u03D2\u0406\u0410\u0413\u0415-\u0418" - + "\u041A\u041E\u0423\u0427\u042B\u042D\u0430\u0433\u0435-\u0438" - + "\u043A\u043E\u0443\u0447\u044B\u044D\u0456\u0474-\u0475\u0483-" - + "\u0486\u04D8-\u04D9\u04E8-\u04E9\u0591-\u05A1\u05A3-\u05B9\u05BB" - + "-\u05BD\u05BF\u05C1-\u05C2\u05C4\u0622-\u0623\u0627\u0648\u064A-" - + "\u0655\u0670\u06C1\u06D2\u06D5-\u06DC\u06DF-\u06E4\u06E7-\u06E8" - + "\u06EA-\u06ED\u0711\u0730-\u074A\u0928\u0930\u0933\u093C\u094D" - + "\u0951-\u0954\u0958-\u095F\u09BC\u09BE\u09C7\u09CD\u09D7\u09DC-" - + "\u09DD\u09DF\u0A33\u0A36\u0A3C\u0A4D\u0A59-\u0A5B\u0A5E\u0ABC" - + "\u0ACD\u0B3C\u0B3E\u0B47\u0B4D\u0B56-\u0B57\u0B5C-\u0B5D\u0B92" - + "\u0BBE\u0BC6-\u0BC7\u0BCD\u0BD7\u0C46\u0C4D\u0C55-\u0C56\u0CBF" - + "\u0CC2\u0CC6\u0CCA\u0CCD\u0CD5-\u0CD6\u0D3E\u0D46-\u0D47\u0D4D" - + "\u0D57\u0DCA\u0DCF\u0DD9\u0DDC\u0DDF\u0E38-\u0E3A\u0E48-\u0E4B" - + "\u0EB8-\u0EB9\u0EC8-\u0ECB\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F43" - + "\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F71-\u0F76\u0F78\u0F7A-\u0F7D" - + "\u0F80-\u0F84\u0F86-\u0F87\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9" - + "\u0FC6\u1025\u102E\u1037\u1039\u1100-\u1112\u1161-\u1175\u11A8-" - + "\u11C2\u17D2\u18A9\u1E00-\u1E03\u1E0A-\u1E0F\u1E12-\u1E1B\u1E20-" - + "\u1E27\u1E2A-\u1E41\u1E44-\u1E53\u1E58-\u1E7D\u1E80-\u1E87\u1E8E" - + "-\u1E91\u1E96-\u1E99\u1EA0-\u1EF3\u1EF6-\u1EF9\u1F00-\u1F11" - + "\u1F18-\u1F19\u1F20-\u1F31\u1F38-\u1F39\u1F40-\u1F41\u1F48-" - + "\u1F49\u1F50-\u1F51\u1F59\u1F60-\u1F71\u1F73-\u1F75\u1F77\u1F79" - + "\u1F7B-\u1F7D\u1F80-\u1F81\u1F88-\u1F89\u1F90-\u1F91\u1F98-" - + "\u1F99\u1FA0-\u1FA1\u1FA8-\u1FA9\u1FB3\u1FB6\u1FBB-\u1FBC\u1FBE-" - + "\u1FBF\u1FC3\u1FC6\u1FC9\u1FCB-\u1FCC\u1FD3\u1FDB\u1FE3\u1FEB" - + "\u1FEE-\u1FEF\u1FF3\u1FF6\u1FF9\u1FFB-\u1FFE\u2000-\u2001\u20D0-" - + "\u20DC\u20E1\u2126\u212A-\u212B\u2190\u2192\u2194\u21D0\u21D2" - + "\u21D4\u2203\u2208\u220B\u2223\u2225\u223C\u2243\u2245\u2248" - + "\u224D\u2261\u2264-\u2265\u2272-\u2273\u2276-\u2277\u227A-\u227D" - + "\u2282-\u2283\u2286-\u2287\u2291-\u2292\u22A2\u22A8-\u22A9\u22AB" - + "\u22B2-\u22B5\u2329-\u232A\u302A-\u302F\u3046\u304B\u304D\u304F" - + "\u3051\u3053\u3055\u3057\u3059\u305B\u305D\u305F\u3061\u3064" - + "\u3066\u3068\u306F\u3072\u3075\u3078\u307B\u3099-\u309A\u309D" - + "\u30A6\u30AB\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB" - + "\u30BD\u30BF\u30C1\u30C4\u30C6\u30C8\u30CF\u30D2\u30D5\u30D8" - + "\u30DB\u30EF-\u30F2\u30FD\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C" - + "\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4" - + "\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC" - + "\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4" - + "\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC" - + "\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204" - + "\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C" - + "\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434" - + "\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C" - + "\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664" - + "\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C" - + "\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894" - + "\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC" - + "\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4" - + "\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC" - + "\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4" - + "\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C" - + "\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24" - + "\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C" - + "\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154" - + "\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C" - + "\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384" - + "\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C" - + "\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4" - + "\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC" - + "\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4" - + "\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC" - + "\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14" - + "\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C" - + "\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44" - + "\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C" - + "\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74" - + "\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C" - + "\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4" - + "\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC" - + "\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4" - + "\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC" - + "\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504" - + "\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C" - + "\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734" - + "\uD750\uD76C\uD788\uF900-\uFA0D\uFA10\uFA12\uFA15-\uFA1E\uFA20" - + "\uFA22\uFA25-\uFA26\uFA2A-\uFA2D\uFB1D-\uFB1F\uFB2A-\uFB36\uFB38" - + "-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFB4E\uFE20-" - + "\uFE23\\U0001D15E-\\U0001D169\\U0001D16D-\\U0001D172\\U0001D17B-" - + "\\U0001D182\\U0001D185-\\U0001D18B\\U0001D1AA-\\U0001D1AD\\U0001D1BB-" - + "\\U0001D1C0\\U0002F800-\\U0002FA1D]", false); - - /*Unicode: - "[^<->A-PR-Za-pr-z¨À-ÏÑ-ÖØ-Ýà-ïñ-öø-ýÿ-aC-dE-eE-gH-hI-iIL-lL-lN-n" - + "N-nO-oR-rR-sŠ-šT-tU-uW-?O-oU-u?A-uA-?G-o?-??-??-??-??-??`-??-??;" - + "????????O??ae??????-???????-??????????-?????????-??-??-??-??-??-" - + "??-???-???-????-?????-??-??-??-???-???????-??-???????-???????-??" - + "???????-??-????-??????-???????-???-?????????-??-??-??-??-???????" - + "????-???-??-??-?????????????-??-??-????-??-??-??-??-??-??-??-??-" - + "??-??-??-??-??-??-??-??-??-??-???-??-????-??-??-??-??-??-??-????" - + "-??-?????-??????-?????-?\ -\ ?-???K-Å?????????|?~??˜?==-=?-??-??" - + "-??-??-??-???-???-?<->?-???????????????????????-????????????????" - + "????????-???????????????????????????????????????????????????????" - + "????????????????????????????????????????????????????????????????" - + "????????????????????????????????????????????????????????????????" - + "????????????????????????????????????????????????????????????????" - + "????????????????????????????????????????????????????????????????" - + "????????????????????????????????????????????????????????????????" - + "???????????????????????????-????-????-??-??-??-??-???-??-??-??-?" - + "??-????-????-????-????-????-????-??]"*/ - - SKIPPABLES[KD] = new UnicodeSet( - "[^\u00A0\u00A8\u00AA\u00AF\u00B2-\u00B5\u00B8-\u00BA\u00BC-" - + "\u00BE\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0" - + "-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F" - + "\u0112-\u0125\u0128-\u0130\u0132-\u0137\u0139-\u0140\u0143-" - + "\u0149\u014C-\u0151\u0154-\u0165\u0168-\u017F\u01A0-\u01A1\u01AF" - + "-\u01B0\u01C4-\u01DC\u01DE-\u01E3\u01E6-\u01F5\u01F8-\u021B" - + "\u021E-\u021F\u0226-\u0233\u02B0-\u02B8\u02D8-\u02DD\u02E0-" - + "\u02E4\u0300-\u034E\u0360-\u0362\u0374\u037A\u037E\u0384-\u038A" - + "\u038C\u038E-\u0390\u03AA-\u03B0\u03CA-\u03CE\u03D0-\u03D6\u03F0" - + "-\u03F2\u03F4-\u03F5\u0400-\u0401\u0403\u0407\u040C-\u040E\u0419" - + "\u0439\u0450-\u0451\u0453\u0457\u045C-\u045E\u0476-\u0477\u0483-" - + "\u0486\u04C1-\u04C2\u04D0-\u04D3\u04D6-\u04D7\u04DA-\u04DF\u04E2" - + "-\u04E7\u04EA-\u04F5\u04F8-\u04F9\u0587\u0591-\u05A1\u05A3-" - + "\u05B9\u05BB-\u05BD\u05BF\u05C1-\u05C2\u05C4\u0622-\u0626\u064B-" - + "\u0655\u0670\u0675-\u0678\u06C0\u06C2\u06D3\u06D6-\u06DC\u06DF-" - + "\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u0929\u0931" - + "\u0934\u093C\u094D\u0951-\u0954\u0958-\u095F\u09BC\u09CB-\u09CD" - + "\u09DC-\u09DD\u09DF\u0A33\u0A36\u0A3C\u0A4D\u0A59-\u0A5B\u0A5E" - + "\u0ABC\u0ACD\u0B3C\u0B48\u0B4B-\u0B4D\u0B5C-\u0B5D\u0B94\u0BCA-" - + "\u0BCD\u0C48\u0C4D\u0C55-\u0C56\u0CC0\u0CC7-\u0CC8\u0CCA-\u0CCB" - + "\u0CCD\u0D4A-\u0D4D\u0DCA\u0DDA\u0DDC-\u0DDE\u0E33\u0E38-\u0E3A" - + "\u0E48-\u0E4B\u0EB3\u0EB8-\u0EB9\u0EC8-\u0ECB\u0EDC-\u0EDD\u0F0C" - + "\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F43\u0F4D\u0F52\u0F57\u0F5C" - + "\u0F69\u0F71-\u0F7D\u0F80-\u0F84\u0F86-\u0F87\u0F93\u0F9D\u0FA2" - + "\u0FA7\u0FAC\u0FB9\u0FC6\u1026\u1037\u1039\u17D2\u18A9\u1E00-" - + "\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48" - + "-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4" - + "\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-" - + "\u1FF4\u1FF6-\u1FFE\u2000-\u200A\u2011\u2017\u2024-\u2026\u202F" - + "\u2033-\u2034\u2036-\u2037\u203C\u203E\u2048-\u2049\u2070\u2074-" - + "\u208E\u20A8\u20D0-\u20DC\u20E1\u2100-\u2103\u2105-\u2107\u2109-" - + "\u2113\u2115-\u2116\u2119-\u211D\u2120-\u2122\u2124\u2126\u2128" - + "\u212A-\u212D\u212F-\u2131\u2133-\u2139\u2153-\u217F\u219A-" - + "\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u222C-" - + "\u222D\u222F-\u2230\u2241\u2244\u2247\u2249\u2260\u2262\u226D-" - + "\u2271\u2274-\u2275\u2278-\u2279\u2280-\u2281\u2284-\u2285\u2288" - + "-\u2289\u22AC-\u22AF\u22E0-\u22E3\u22EA-\u22ED\u2329-\u232A" - + "\u2460-\u24EA\u2E9F\u2EF3\u2F00-\u2FD5\u3000\u302A-\u302F\u3036" - + "\u3038-\u303A\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A" - + "\u305C\u305E\u3060\u3062\u3065\u3067\u3069\u3070-\u3071\u3073-" - + "\u3074\u3076-\u3077\u3079-\u307A\u307C-\u307D\u3094\u3099-\u309C" - + "\u309E\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC" - + "\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0-\u30D1\u30D3-\u30D4" - + "\u30D6-\u30D7\u30D9-\u30DA\u30DC-\u30DD\u30F4\u30F7-\u30FA\u30FE" - + "\u3131-\u318E\u3192-\u319F\u3200-\u321C\u3220-\u3243\u3260-" - + "\u327B\u3280-\u32B0\u32C0-\u32CB\u32D0-\u32FE\u3300-\u3376\u337B" - + "-\u33DD\u33E0-\u33FE\uAC00-\uD7A3\uF900-\uFA0D\uFA10\uFA12\uFA15" - + "-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA2D\uFB00-\uFB06\uFB13" - + "-\uFB17\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-" - + "\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0" - + "-\uFDFB\uFE20-\uFE23\uFE30-\uFE44\uFE49-\uFE52\uFE54-\uFE66" - + "\uFE68-\uFE6B\uFE70-\uFE72\uFE74\uFE76-\uFEFC\uFF01-\uFF5E\uFF61" - + "-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC" - + "\uFFE0-\uFFE6\uFFE8-\uFFEE\\U0001D15E-\\U0001D169\\U0001D16D-\\U0001" - + "D172\\U0001D17B-\\U0001D182\\U0001D185-\\U0001D18B\\U0001D1AA-\\U0001D" - + "1AD\\U0001D1BB-\\U0001D1C0\\U0001D400-\\U0001D454\\U0001D456-\\U0001D4" - + "9C\\U0001D49E-\\U0001D49F\\U0001D4A2\\U0001D4A5-\\U0001D4A6\\U0001D4A9" - + "-\\U0001D4AC\\U0001D4AE-\\U0001D4B9\\U0001D4BB\\U0001D4BD-\\U0001D4C0" - + "\\U0001D4C2-\\U0001D4C3\\U0001D4C5-\\U0001D505\\U0001D507-\\U0001D50A" - + "\\U0001D50D-\\U0001D514\\U0001D516-\\U0001D51C\\U0001D51E-\\U0001D539" - + "\\U0001D53B-\\U0001D53E\\U0001D540-\\U0001D544\\U0001D546\\U0001D54A-" - + "\\U0001D550\\U0001D552-\\U0001D6A3\\U0001D6A8-\\U0001D7C9\\U0001D7CE-" - + "\\U0001D7FF\\U0002F800-\\U0002FA1D]", false); - - /*Unicode: - "[^ ¨ª¯²-µ¸-º¼-¾À-ÅÇ-ÏÑ-ÖÙ-Ýà-åç-ïñ-öù-ýÿ-dE-hI-I?-kL-?N-?O-oR-tU" - + "-?O-oU-u?-uA-?G-??-??-??-??-??-??-?`-??-???;?-???-??-??-??-??-??" - + "-??-????-????-????-??-??-??-??-??-??-??-??-??-???-??-??-???-???-" - + "??-???-?????-??-??-??-???-???????-??-???-??-???????-???????-??-?" - + "??-????-???-??-???-????-???-??-???-??-??-???-???????????-??-??-?" - + "?????????????-??-??-??-??-??-??-?????-??-??-??-??-??-??-??-?\ -" - + "\?-=·-…??-??-????-?°4-???-???-??-E?-lN-?P-R?-™Z?ZK-Ce-FM-??-??-?" - + "??-???????-??-????????-??-??-??-??-??-??-??-??-?<->?-????-?" - + "\ ?-???-?????????????????-??-??-??-??-???-??????????????????-??-" - + "??-??-??-???-???-??-??-??-??-??-??-??-??-??-??-??-??-????-????-?" - + "?-??-??-??-??-???-??-??-??-??-??-??-??-??-??-??-??-??-???-?!-~?-" - + "??-??-??-??-??-??-???-????-????-????-????-????-????-????-????-??" - + "????-????-????-??????-????-????-????-????-????-????-????-????-??" - + "????-????-????-????-????-??]"*/ - - SKIPPABLES[KC] = new UnicodeSet( - "[^<->A-PR-Za-pr-z\u00A0\u00A8\u00AA\u00AF\u00B2-\u00B5\u00B8-" - + "\u00BA\u00BC-\u00BE\u00C0-\u00CF\u00D1-\u00D6\u00D8-\u00DD\u00E0" - + "-\u00EF\u00F1-\u00F6\u00F8-\u00FD\u00FF-\u0103\u0106-\u010F" - + "\u0112-\u0117\u011A-\u0121\u0124-\u0125\u0128-\u012D\u0130\u0132" - + "-\u0133\u0139-\u013A\u013D-\u0140\u0143-\u0144\u0147-\u0149" - + "\u014C-\u0151\u0154-\u0155\u0158-\u015D\u0160-\u0161\u0164-" - + "\u0165\u0168-\u0171\u0174-\u017F\u01A0-\u01A1\u01AF-\u01B0\u01B7" - + "\u01C4-\u01DC\u01DE-\u01E1\u01E6-\u01EB\u01F1-\u01F5\u01F8-" - + "\u01FB\u0200-\u021B\u021E-\u021F\u0226-\u0233\u0292\u02B0-\u02B8" - + "\u02D8-\u02DD\u02E0-\u02E4\u0300-\u034E\u0360-\u0362\u0374\u037A" - + "\u037E\u0384-\u0385\u0387\u0391\u0395\u0397\u0399\u039F\u03A1" - + "\u03A5\u03A9\u03AC\u03AE\u03B1\u03B5\u03B7\u03B9\u03BF\u03C1" - + "\u03C5\u03C9-\u03CB\u03CE\u03D0-\u03D6\u03F0-\u03F2\u03F4-\u03F5" - + "\u0406\u0410\u0413\u0415-\u0418\u041A\u041E\u0423\u0427\u042B" - + "\u042D\u0430\u0433\u0435-\u0438\u043A\u043E\u0443\u0447\u044B" - + "\u044D\u0456\u0474-\u0475\u0483-\u0486\u04D8-\u04D9\u04E8-\u04E9" - + "\u0587\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD\u05BF\u05C1-\u05C2" - + "\u05C4\u0622-\u0623\u0627\u0648\u064A-\u0655\u0670\u0675-\u0678" - + "\u06C1\u06D2\u06D5-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED" - + "\u0711\u0730-\u074A\u0928\u0930\u0933\u093C\u094D\u0951-\u0954" - + "\u0958-\u095F\u09BC\u09BE\u09C7\u09CD\u09D7\u09DC-\u09DD\u09DF" - + "\u0A33\u0A36\u0A3C\u0A4D\u0A59-\u0A5B\u0A5E\u0ABC\u0ACD\u0B3C" - + "\u0B3E\u0B47\u0B4D\u0B56-\u0B57\u0B5C-\u0B5D\u0B92\u0BBE\u0BC6-" - + "\u0BC7\u0BCD\u0BD7\u0C46\u0C4D\u0C55-\u0C56\u0CBF\u0CC2\u0CC6" - + "\u0CCA\u0CCD\u0CD5-\u0CD6\u0D3E\u0D46-\u0D47\u0D4D\u0D57\u0DCA" - + "\u0DCF\u0DD9\u0DDC\u0DDF\u0E33\u0E38-\u0E3A\u0E48-\u0E4B\u0EB3" - + "\u0EB8-\u0EB9\u0EC8-\u0ECB\u0EDC-\u0EDD\u0F0C\u0F18-\u0F19\u0F35" - + "\u0F37\u0F39\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F71-\u0F7D" - + "\u0F80-\u0F84\u0F86-\u0F87\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9" - + "\u0FC6\u1025\u102E\u1037\u1039\u1100-\u1112\u1161-\u1175\u11A8-" - + "\u11C2\u17D2\u18A9\u1E00-\u1E03\u1E0A-\u1E0F\u1E12-\u1E1B\u1E20-" - + "\u1E27\u1E2A-\u1E41\u1E44-\u1E53\u1E58-\u1E7D\u1E80-\u1E87\u1E8E" - + "-\u1E91\u1E96-\u1E9B\u1EA0-\u1EF3\u1EF6-\u1EF9\u1F00-\u1F11" - + "\u1F18-\u1F19\u1F20-\u1F31\u1F38-\u1F39\u1F40-\u1F41\u1F48-" - + "\u1F49\u1F50-\u1F51\u1F59\u1F60-\u1F71\u1F73-\u1F75\u1F77\u1F79" - + "\u1F7B-\u1F7D\u1F80-\u1F81\u1F88-\u1F89\u1F90-\u1F91\u1F98-" - + "\u1F99\u1FA0-\u1FA1\u1FA8-\u1FA9\u1FB3\u1FB6\u1FBB-\u1FC1\u1FC3" - + "\u1FC6\u1FC9\u1FCB-\u1FCF\u1FD3\u1FDB\u1FDD-\u1FDF\u1FE3\u1FEB" - + "\u1FED-\u1FEF\u1FF3\u1FF6\u1FF9\u1FFB-\u1FFE\u2000-\u200A\u2011" - + "\u2017\u2024-\u2026\u202F\u2033-\u2034\u2036-\u2037\u203C\u203E" - + "\u2048-\u2049\u2070\u2074-\u208E\u20A8\u20D0-\u20DC\u20E1\u2100-" - + "\u2103\u2105-\u2107\u2109-\u2113\u2115-\u2116\u2119-\u211D\u2120" - + "-\u2122\u2124\u2126\u2128\u212A-\u212D\u212F-\u2131\u2133-\u2139" - + "\u2153-\u217F\u2190\u2192\u2194\u21D0\u21D2\u21D4\u2203\u2208" - + "\u220B\u2223\u2225\u222C-\u222D\u222F-\u2230\u223C\u2243\u2245" - + "\u2248\u224D\u2261\u2264-\u2265\u2272-\u2273\u2276-\u2277\u227A-" - + "\u227D\u2282-\u2283\u2286-\u2287\u2291-\u2292\u22A2\u22A8-\u22A9" - + "\u22AB\u22B2-\u22B5\u2329-\u232A\u2460-\u24EA\u2E9F\u2EF3\u2F00-" - + "\u2FD5\u3000\u302A-\u302F\u3036\u3038-\u303A\u3046\u304B\u304D" - + "\u304F\u3051\u3053\u3055\u3057\u3059\u305B\u305D\u305F\u3061" - + "\u3064\u3066\u3068\u306F\u3072\u3075\u3078\u307B\u3099-\u309D" - + "\u30A6\u30AB\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB" - + "\u30BD\u30BF\u30C1\u30C4\u30C6\u30C8\u30CF\u30D2\u30D5\u30D8" - + "\u30DB\u30EF-\u30F2\u30FD\u3131-\u318E\u3192-\u319F\u3200-\u321C" - + "\u3220-\u3243\u3260-\u327B\u3280-\u32B0\u32C0-\u32CB\u32D0-" - + "\u32FE\u3300-\u3376\u337B-\u33DD\u33E0-\u33FE\uAC00\uAC1C\uAC38" - + "\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50" - + "\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68" - + "\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80" - + "\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098" - + "\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0" - + "\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8" - + "\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0" - + "\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8" - + "\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610" - + "\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728" - + "\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840" - + "\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958" - + "\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70" - + "\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88" - + "\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0" - + "\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8" - + "\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0" - + "\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8" - + "\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100" - + "\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218" - + "\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330" - + "\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448" - + "\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560" - + "\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678" - + "\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790" - + "\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8" - + "\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0" - + "\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8" - + "\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0" - + "\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08" - + "\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20" - + "\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38" - + "\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050" - + "\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168" - + "\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280" - + "\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398" - + "\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0" - + "\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8" - + "\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0" - + "\uD6FC\uD718\uD734\uD750\uD76C\uD788\uF900-\uFA0D\uFA10\uFA12" - + "\uFA15-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA2D\uFB00-\uFB06" - + "\uFB13-\uFB17\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43" - + "-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7" - + "\uFDF0-\uFDFB\uFE20-\uFE23\uFE30-\uFE44\uFE49-\uFE52\uFE54-" - + "\uFE66\uFE68-\uFE6B\uFE70-\uFE72\uFE74\uFE76-\uFEFC\uFF01-\uFF5E" - + "\uFF61-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-" - + "\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\\U0001D15E-\\U0001D169\\U0001D16D-" - + "\\U0001D172\\U0001D17B-\\U0001D182\\U0001D185-\\U0001D18B\\U0001D1AA-" - + "\\U0001D1AD\\U0001D1BB-\\U0001D1C0\\U0001D400-\\U0001D454\\U0001D456-" - + "\\U0001D49C\\U0001D49E-\\U0001D49F\\U0001D4A2\\U0001D4A5-\\U0001D4A6" - + "\\U0001D4A9-\\U0001D4AC\\U0001D4AE-\\U0001D4B9\\U0001D4BB\\U0001D4BD-" - + "\\U0001D4C0\\U0001D4C2-\\U0001D4C3\\U0001D4C5-\\U0001D505\\U0001D507-" - + "\\U0001D50A\\U0001D50D-\\U0001D514\\U0001D516-\\U0001D51C\\U0001D51E-" - + "\\U0001D539\\U0001D53B-\\U0001D53E\\U0001D540-\\U0001D544\\U0001D546" - + "\\U0001D54A-\\U0001D550\\U0001D552-\\U0001D6A3\\U0001D6A8-\\U0001D7C9" - + "\\U0001D7CE-\\U0001D7FF\\U0002F800-\\U0002FA1D]", false); - - /*Unicode: - "[^<->A-PR-Za-pr-z ¨ª¯²-µ¸-º¼-¾À-ÏÑ-ÖØ-Ýà-ïñ-öø-ýÿ-aC-dE-eE-gH-hI" - + "-iI?-?L-lL-?N-nN-?O-oR-rR-sŠ-šT-tU-uW-?O-oU-u??-uA-?G-o?-??-??-?" - + "?-??-???-??-??-?`-??-???;?-?????????O??ae??????-???-??-??-?????-" - + "??????????-?????????-??-??-??-???-??-??-???-???-????-???-????-??" - + "-??-??-???-???????-??-???????-???????-?????????-??-????-??????-?" - + "??????-???-??????????-??-???-??-??-???-???????????-??-??-???????" - + "??????-??-??-????-??-??-??-??-??-??-??-??-??-??-??-??-??-??-??-?" - + "?-??-??-???-??-????-??-??-??-??-??-??-????-?????-????-????-?????" - + "-?\ -\?-=·-…??-??-????-?°4-???-???-??-E?-lN-?P-R?-™Z?ZK-Ce-FM-??" - + "-??????????|??-??-?~??˜?==-=?-??-??-??-??-??-???-???-?<->?-????-" - + "?\ ?-???-???????????????????????-???????????????????????-???-??-" - + "??-??-??-??-??-??-??-??-??-?????????????????????????????????????" - + "????????????????????????????????????????????????????????????????" - + "????????????????????????????????????????????????????????????????" - + "????????????????????????????????????????????????????????????????" - + "????????????????????????????????????????????????????????????????" - + "????????????????????????????????????????????????????????????????" - + "????????????????????????????????????????????-????-????-??-??-??-" - + "??-??-???-??-??-??-??-??-??-??-??-??-??-??-??-???-?!-~?-??-??-??" - + "-??-??-??-???-????-????-????-????-????-????-????-????-??????-???" - + "?-????-??????-????-????-????-????-????-????-????-????-??????-???" - + "?-????-????-????-??]"*/ - } -} diff --git a/icu4j/src/com/ibm/text/Normalizer.java b/icu4j/src/com/ibm/text/Normalizer.java deleted file mode 100755 index 4cf37d960d..0000000000 --- a/icu4j/src/com/ibm/text/Normalizer.java +++ /dev/null @@ -1,1658 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/Normalizer.java,v $ - * $Date: 2001/11/21 00:56:22 $ - * $Revision: 1.13 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.lang.Character; -import java.text.CharacterIterator; -import java.text.StringCharacterIterator; -import com.ibm.util.CompactByteArray; -import com.ibm.util.Utility; - -/** - * Normalizer transforms Unicode text into an equivalent composed or - * decomposed form, allowing for easier sorting and searching of text. - * Normalizer supports the standard normalization forms described in - * - * Unicode Technical Report #15. - *

- * Characters with accents or other adornments can be encoded in - * several different ways in Unicode. For example, take the character "Â" - * (A-acute). In Unicode, this can be encoded as a single character (the - * "composed" form): - *

- *      00C1    LATIN CAPITAL LETTER A WITH ACUTE
- * or as two separate characters (the "decomposed" form): - *
- *      0041    LATIN CAPITAL LETTER A
- *      0301    COMBINING ACUTE ACCENT
- *

- * To a user of your program, however, both of these sequences should be - * treated as the same "user-level" character "Â". When you are searching or - * comparing text, you must ensure that these two sequences are treated - * equivalently. In addition, you must handle characters with more than one - * accent. Sometimes the order of a character's combining accents is - * significant, while in other cases accent sequences in different orders are - * really equivalent. - *

- * Similarly, the string "ffi" can be encoded as three separate letters: - *

- *      0066    LATIN SMALL LETTER F
- *      0066    LATIN SMALL LETTER F
- *      0069    LATIN SMALL LETTER I
- * or as the single character - *
- *      FB03    LATIN SMALL LIGATURE FFI
- *

- * The ffi ligature is not a distinct semantic character, and strictly speaking - * it shouldn't be in Unicode at all, but it was included for compatibility - * with existing character sets that already provided it. The Unicode standard - * identifies such characters by giving them "compatibility" decompositions - * into the corresponding semantic characters. When sorting and searching, you - * will often want to use these mappings. - *

- * Normalizer helps solve these problems by transforming text into the - * canonical composed and decomposed forms as shown in the first example above. - * In addition, you can have it perform compatibility decompositions so that - * you can treat compatibility characters the same as their equivalents. - * Finally, Normalizer rearranges accents into the proper canonical - * order, so that you do not have to worry about accent rearrangement on your - * own. - *

- * Normalizer adds one optional behavior, {@link #IGNORE_HANGUL}, - * that differs from - * the standard Unicode Normalization Forms. This option can be passed - * to the {@link #Normalizer constructors} and to the static - * {@link #compose compose} and {@link #decompose decompose} methods. This - * option, and any that are added in the future, will be turned off by default. - *

- * There are three common usage models for Normalizer. In the first, - * the static {@link #normalize normalize()} method is used to process an - * entire input string at once. Second, you can create a Normalizer - * object and use it to iterate through the normalized form of a string by - * calling {@link #first} and {@link #next}. Finally, you can use the - * {@link #setIndex setIndex()} and {@link #getIndex} methods to perform - * random-access iteration, which is very useful for searching. - *

- * Note: Normalizer objects behave like iterators and have - * methods such as setIndex, next, previous, etc. - * You should note that while the setIndex and getIndex refer - * to indices in the underlying input text being processed, the - * next and previous methods it iterate through characters - * in the normalized output. This means that there is not - * necessarily a one-to-one correspondence between characters returned - * by next and previous and the indices passed to and - * returned from setIndex and getIndex. It is for this - * reason that Normalizer does not implement the - * {@link CharacterIterator} interface. - *

- * Note: Normalizer is currently based on version 2.1.8 - * of the Unicode Standard. - * It will be updated as later versions of Unicode are released. If you are - * using this class on a JDK that supports an earlier version of Unicode, it - * is possible that Normalizer may generate composed or dedecomposed - * characters for which your JDK's {@link java.lang.Character} class does not - * have any data. - *

- * @author Laura Werner, Mark Davis - */ -public final class Normalizer { - - /** - * Constant indicating that the end of the iteration has been reached. - * This is guaranteed to have the same value as {@link CharacterIterator#DONE}. - */ - public static final char DONE = CharacterIterator.DONE; - - // This tells us what the bits in the "mode" object mean. - private static final int COMPAT_BIT = 1; - private static final int DECOMP_BIT = 2; - private static final int COMPOSE_BIT = 4; - - /** - * This class represents the mode of a {@link Normalizer} - * object, i.e. the Unicode Normalization Form of the - * text that the Normalizer produces. Mode objects - * are used as arguments to the {@link Normalizer#Normalizer constructors} - * and {@link Normalizer#setMode setMode} method of Normalizer. - *

- * Clients cannot create Mode objects directly. - * Instead, use the predefined constants {@link Normalizer#NO_OP}, - * {@link Normalizer#COMPOSE}, {@link Normalizer#COMPOSE_COMPAT}, - * {@link Normalizer#DECOMP}, and {@link Normalizer#DECOMP_COMPAT}. - *

- * @see Normalizer - */ - public static final class Mode { - Mode(int m) { - mode = m; - } - final boolean compat() { - return (mode & COMPAT_BIT) != 0; - } - final boolean compose() { - return (mode & COMPOSE_BIT) != 0; - } - final boolean decomp() { - return (mode & DECOMP_BIT) != 0; - } - final int mode; - }; - - /** - * Null operation for use with the {@link #Normalizer constructors} - * and the static {@link #normalize normalize} method. This value tells - * the Normalizer to do nothing but return unprocessed characters - * from the underlying String or CharacterIterator. If you have code which - * requires raw text at some times and normalized text at others, you can - * use NO_OP for the cases where you want raw text, rather - * than having a separate code path that bypasses Normalizer - * altogether. - *

- * @see #setMode - */ - public static final Mode NO_OP = new Mode(0); - - /** - * Canonical decomposition followed by canonical composition. Used with the - * {@link #Normalizer constructors} and the static {@link #normalize normalize} - * method to determine the operation to be performed. - *

- * If all optional features (e.g. {@link #IGNORE_HANGUL}) are turned - * off, this operation produces output that is in - * Unicode Canonical Form - * C. - *

- * @see #setMode - */ - public static final Mode COMPOSE = new Mode(COMPOSE_BIT); - - /** - * Compatibility decomposition followed by canonical composition. - * Used with the {@link #Normalizer constructors} and the static - * {@link #normalize normalize} method to determine the operation to be performed. - *

- * If all optional features (e.g. {@link #IGNORE_HANGUL}) are turned - * off, this operation produces output that is in - * Unicode Canonical Form - * KC. - *

- * @see #setMode - */ - public static final Mode COMPOSE_COMPAT = new Mode(COMPOSE_BIT | COMPAT_BIT); - - /** - * Canonical decomposition. This value is passed to the - * {@link #Normalizer constructors} and the static {@link #normalize normalize} - * method to determine the operation to be performed. - *

- * If all optional features (e.g. {@link #IGNORE_HANGUL}) are turned - * off, this operation produces output that is in - * Unicode Canonical Form - * D. - *

- * @see #setMode - */ - public static final Mode DECOMP = new Mode(DECOMP_BIT); - - /** - * Compatibility decomposition. This value is passed to the - * {@link #Normalizer constructors} and the static {@link #normalize normalize} - * method to determine the operation to be performed. - *

- * If all optional features (e.g. {@link #IGNORE_HANGUL}) are turned - * off, this operation produces output that is in - * Unicode Canonical Form - * KD. - *

- * @see #setMode - */ - public static final Mode DECOMP_COMPAT = new Mode(DECOMP_BIT | COMPAT_BIT); - - /** - * Option to disable Hangul/Jamo composition and decomposition. - * This option applies to Korean text, - * which can be represented either in the Jamo alphabet or in Hangul - * characters, which are really just two or three Jamo combined - * into one visual glyph. Since Jamo takes up more storage space than - * Hangul, applications that process only Hangul text may wish to turn - * this option on when decomposing text. - *

- * The Unicode standard treates Hangul to Jamo conversion as a - * canonical decomposition, so this option must be turned off if you - * wish to transform strings into one of the standard - * - * Unicode Normalization Forms. - *

- * @see #setOption - */ - public static final int IGNORE_HANGUL = 0x0001; - - //------------------------------------------------------------------------- - // Constructors - //------------------------------------------------------------------------- - - /** - * Creates a new Normalizer object for iterating over the - * normalized form of a given string. - *

- * @param str The string to be normalized. The normalization - * will start at the beginning of the string. - * - * @param mode The normalization mode. - */ - public Normalizer(String str, Mode mode) { - this(new StringCharacterIterator(str), mode, 0); - } - - /** - * Creates a new Normalizer object for iterating over the - * normalized form of a given string. - *

- * The options parameter specifies which optional - * Normalizer features are to be enabled for this object. - *

- * @param str The string to be normalized. The normalization - * will start at the beginning of the string. - * - * @param mode The normalization mode. - * - * @param opt Any optional features to be enabled. - * Currently the only available option is {@link #IGNORE_HANGUL}. - * If you want the default behavior corresponding to one of the - * standard Unicode Normalization Forms, use 0 for this argument. - */ - public Normalizer(String str, Mode mode, int opt) { - this(new StringCharacterIterator(str), mode, opt); - } - - /** - * Creates a new Normalizer object for iterating over the - * normalized form of the given text. - *

- * @param iter The input text to be normalized. The normalization - * will start at the beginning of the string. - * - * @param mode The normalization mode. - * - */ - public Normalizer(CharacterIterator iter, Mode mode) { - this(iter, mode, 0); - } - - /** - * Creates a new Normalizer object for iterating over the - * normalized form of the given text. - *

- * @param iter The input text to be normalized. The normalization - * will start at the beginning of the string. - * - * @param mode The normalization mode. - * - * @param opt Any optional features to be enabled. - * Currently the only available option is {@link #IGNORE_HANGUL}. - * If you want the default behavior corresponding to one of the - * standard Unicode Normalization Forms, use 0 for this argument. - */ - public Normalizer(CharacterIterator iter, Mode mode, int opt) { - text = iter; - this.mode = mode; - options = opt; - - // Compatibility explosions have lower indices; skip them if necessary - minDecomp = mode.compat() ? 0 : DecompData.MAX_COMPAT; - } - - /** - * Clones this Normalizer object. All properties of this - * object are duplicated in the new object, including the cloning of any - * {@link CharacterIterator} that was passed in to the constructor - * or to {@link #setText(CharacterIterator) setText}. - * However, the text storage underlying - * the CharacterIterator is not duplicated unless the - * iterator's clone method does so. - */ - public Object clone() { - try { - Normalizer copy = (Normalizer) super.clone(); - copy.text = (CharacterIterator) text.clone(); - return copy; - } - catch (CloneNotSupportedException e) { - throw new InternalError(e.toString()); - } - } - - //------------------------------------------------------------------------- - // Static utility methods - //------------------------------------------------------------------------- - - /** - * Normalizes a String using the given normalization operation. - *

- * The options parameter specifies which optional - * Normalizer features are to be enabled for this operation. - * Currently the only available option is {@link #IGNORE_HANGUL}. - * If you want the default behavior corresponding to one of the standard - * Unicode Normalization Forms, use 0 for this argument. - *

- * @param str the input string to be normalized. - * - * @param aMode the normalization mode - * - * @param options the optional features to be enabled. - */ - public static String normalize(String str, Mode mode, int options) { - if (mode.compose()) { - // compose() handles decomposition and reordering; - // don't call decompose() first. - return compose(str, mode.compat(), options); - } - if (mode.decomp()) { - return decompose(str, mode.compat(), options); - } - return str; - } - - //------------------------------------------------------------------------- - // Compose methods - //------------------------------------------------------------------------- - - /** - * Compose a String. - *

- * The options parameter specifies which optional - * Normalizer features are to be enabled for this operation. - * Currently the only available option is {@link #IGNORE_HANGUL}. - * If you want the default behavior corresponding - * to Unicode Normalization Form C or KC, - * use 0 for this argument. - *

- * @param source the string to be composed. - * - * @param compat Perform compatibility decomposition before composition. - * If this argument is false, only canonical - * decomposition will be performed. - * - * @param options the optional features to be enabled. - * - * @return the composed string. - */ - public static String compose(String source, boolean compat, int options) - { - StringBuffer result = new StringBuffer(); - StringBuffer explodeBuf = new StringBuffer(); - - int explodePos = EMPTY; // Position in input buffer - int basePos = 0; // Position of last base in output string - int baseIndex = 0; // Index of last base in "actions" array - int classesSeenL = 0; // Combining classes seen since last base - int classesSeenH = 0; // 64-bit mask - int action; - - // Compatibility explosions have lower indices; skip them if necessary - int minExplode = compat ? 0 : ComposeData.MAX_COMPAT; - int minDecomp = compat ? 0 : DecompData.MAX_COMPAT; - - if (DEBUG) System.out.println("minExplode = " + minExplode); - - int i = 0; - while (i < source.length() || explodePos != EMPTY) { - // Get the next char from either the buffer or the source - char ch; - if (explodePos == EMPTY) { - ch = source.charAt(i++); - } else { - ch = explodeBuf.charAt(explodePos++); - if (explodePos >= explodeBuf.length()) { - explodePos = EMPTY; - explodeBuf.setLength(0); - } - } - - // Get the basic info for the character - int charInfo = composeLookup(ch); - int type = charInfo & ComposeData.TYPE_MASK; - int index = charInfo >>> ComposeData.INDEX_SHIFT; - - if (DEBUG) System.out.println("Got char " + Utility.hex(ch) + ", type=" + type + ", index=" + index); - - // Examples of NON_COMPOSING_COMBINING with an index < minExplode: - // 00A8 017F 03D2 1FBF 1FFE - if (type == ComposeData.BASE || (type == ComposeData.NON_COMPOSING_COMBINING && index < minExplode)) { - if (DEBUG) System.out.println("New base " + Utility.hex(ch) + ", type=" + type + ", index=" + index); - classesSeenL = classesSeenH = 0; - baseIndex = index; - basePos = result.length(); - result.append(ch); - } - else if (type == ComposeData.COMBINING) - { - // assert(index > 0); - int cclass = ComposeData.typeBit[index]; - // typeBit is a bit value from 0..63, indicating the class. - // We use a bit mask of 2 32-bit ints. - boolean seen = 0 != ((cclass < 32) ? - (classesSeenL & (1 << cclass)) : - (classesSeenH & (1 << (cclass & 31)))); - - if (DEBUG) System.out.println("Class of " + Utility.hex(ch) + " = " + cclass + - " seen:" + seen + - " baseIndex:" + baseIndex + - " action:" + composeAction(baseIndex, index)); - - // We can only combine a character with the base if we haven't - // already seen a combining character with the same canonical class. - // We only combine characters with an index from - // 1..COMBINING_COUNT-1. Indices >= COMBINING_COUNT are - // also combining characters, but we know that they don't - // compose with anything. - if (index < ComposeData.COMBINING_COUNT && !seen - && (action = composeAction(baseIndex, index)) > 0) - { - if (action > ComposeData.MAX_COMPOSED) { - // Pairwise explosion. Actions above this value are really - // indices into an array that in turn contains indices - // into the exploding string table - // TODO: What if there are unprocessed chars in the explode buffer? - if (DEBUG) System.out.println("Pairwise exploding"); - char newBase = pairExplode(explodeBuf, action); - explodePos = 0; - result.setCharAt(basePos, newBase); - - baseIndex = composeLookup(newBase) >>> ComposeData.INDEX_SHIFT; - if (DEBUG) System.out.println("New base " + Utility.hex(newBase)); - } else { - // Normal pairwise combination. Replace the base char - if (DEBUG) System.out.println("Pairwise combining"); - char newBase = (char) action; - result.setCharAt(basePos, newBase); - - baseIndex = composeLookup(newBase) >>> ComposeData.INDEX_SHIFT; - if (DEBUG) System.out.println("New base " + Utility.hex(newBase)); - } - // - // Since there are Unicode characters that cannot be combined in arbitrary - // order, we have to re-process any combining marks that go with this - // base character. There are only four characters in Unicode that have - // this problem. If they are fixed in Unicode 3.0, this code can go away. - // - int len = result.length(); - if (len - basePos > 1) { - for (int j = basePos+1; j < len; j++) { - explodeBuf.append(result.charAt(j)); - } - result.setLength(basePos+1); - classesSeenL = classesSeenH = 0; - if (explodePos == EMPTY) explodePos = 0; - } - } else { - // No combination with this character - if (DEBUG) System.out.println("No action"); - bubbleAppend(result, ch, cclass); - if (cclass < 32) { - classesSeenL |= 1 << cclass; - } else { - classesSeenH |= 1 << (cclass & 31); - } - } - } - else if (index > minExplode) { - // Single exploding character - explode(explodeBuf, index); - explodePos = 0; - if (DEBUG) System.out.println("explosion: " + Utility.hex(ch) + " --> " + Utility.hex(explodeBuf)); - } - else if (type == ComposeData.HANGUL && minExplode == 0) { - // If we're in compatibility mode we need to decompose Hangul to Jamo, - // because some of the Jamo might have compatibility decompositions. - hangulToJamo(ch, explodeBuf, minDecomp); - if (DEBUG) System.out.println("decomposed hangul " + Utility.hex(ch) + " to jamo " + Utility.hex(explodeBuf)); - explodePos = 0; - } - else if (type == ComposeData.INITIAL_JAMO) { - classesSeenL = classesSeenH = 0; - baseIndex = ComposeData.INITIAL_JAMO_INDEX; - basePos = result.length(); - result.append(ch); - if (DEBUG) System.out.println("got initial jamo " + Utility.hex(ch)); - } - else if (type == ComposeData.MEDIAL_JAMO && classesSeenL == 0 && classesSeenH == 0 - && baseIndex == ComposeData.INITIAL_JAMO_INDEX) { - // If the last character was an initial jamo, we can combine it with this - // one to create a Hangul character. - int l = result.charAt(basePos) - JAMO_LBASE; - int v = ch - JAMO_VBASE; - char newCh = (char)(HANGUL_BASE + (l*JAMO_VCOUNT + v) * JAMO_TCOUNT); - result.setCharAt(basePos, newCh); - - if (DEBUG) System.out.println("got medial jamo " + Utility.hex(ch) + ", replacing with Hangul " + Utility.hex(newCh)); - - baseIndex = ComposeData.MEDIAL_JAMO_INDEX; - } - else if (type == ComposeData.FINAL_JAMO && classesSeenL == 0 && classesSeenH == 0 - && baseIndex == ComposeData.MEDIAL_JAMO_INDEX) { - // If the last character was a medial jamo that we turned into Hangul, - // we can add this character too. - char newCh = (char)(result.charAt(basePos) + (ch - JAMO_TBASE)); - result.setCharAt(basePos, newCh); - - if (DEBUG) System.out.println("got final jamo " + Utility.hex(ch) + ", replacing with Hangul " + Utility.hex(newCh)); - - baseIndex = 0; - basePos = -1; - classesSeenL = classesSeenH = 0; - } else { - if (DEBUG) System.out.println("No base as of " + Utility.hex(ch)); - baseIndex = 0; - basePos = -1; - classesSeenL = classesSeenH = 0; - result.append(ch); - } - } - return result.toString(); - } - - /** - * Compose starting with current input character and continuing - * until just before the next base char. - *

- * Input: - *

    - *
  • underlying char iter points to first character to compose - *
- *

- * Output: - *

    - *
  • returns first char of composition or DONE if at end - *
  • Underlying char iter is pointing at next base char or past end - *
- */ - private char nextCompose() - { - if (DEBUG) System.out.println("--------------- top of nextCompose() ---------------"); - - int explodePos = EMPTY; // Position in input buffer - int basePos = 0; // Position of last base in output string - int baseIndex = 0; // Index of last base in "actions" array - int classesSeenL = 0; // Combining classes seen since last base - int classesSeenH = 0; // 64-bit mask - int action; - char lastBase = 0; - boolean chFromText = true; - - // Compatibility explosions have lower indices; skip them if necessary - int minExplode = mode.compat() ? 0 : ComposeData.MAX_COMPAT; - int minDecomp = mode.compat() ? 0 : DecompData.MAX_COMPAT; - - initBuffer(); - if (explodeBuf == null) { - explodeBuf = new StringBuffer(); - } else { - explodeBuf.setLength(0); - } - - char ch = curForward(); - - while (ch != DONE) { - // Get the basic info for the character - int charInfo = composeLookup(ch); - int type = charInfo & ComposeData.TYPE_MASK; - int index = charInfo >>> ComposeData.INDEX_SHIFT; - - if (type == ComposeData.BASE || (type == ComposeData.NON_COMPOSING_COMBINING && index < minExplode)) { - if (buffer.length() > 0 && chFromText && explodePos == EMPTY) { - // When we hit a base char in the source text, we can return the text - // that's been composed so far. We'll re-process this char next time through. - if (DEBUG) System.out.println("returning early because we hit a new base"); - break; - } - classesSeenL = classesSeenH = 0; - baseIndex = index; - basePos = buffer.length(); - buffer.append(ch); - if (DEBUG) System.out.println("got BASE char " + Utility.hex(ch) + ", type=" + type + ", index=" + index); - lastBase = ch; - } - else if (type == ComposeData.COMBINING) - { - // assert(index > 0); - int cclass = ComposeData.typeBit[index]; - boolean seen = 0 != ((cclass < 32) ? - (classesSeenL & (1 << cclass)) : - (classesSeenH & (1 << (cclass & 31)))); - - if (DEBUG) System.out.println("got COMBINING char " + Utility.hex(ch) + ", type=" + type + ", index=" + index - + ", class=" + cclass); - - // We can only combine a character with the base if we haven't - // already seen a combining character with the same canonical class. - if (index < ComposeData.COMBINING_COUNT && !seen - && (action = composeAction(baseIndex, index)) > 0) - { - if (action > ComposeData.MAX_COMPOSED) { - // Pairwise explosion. Actions above this value are really - // indices into an array that in turn contains indices - // into the exploding string table - // TODO: What if there are unprocessed chars in the explode buffer? - char newBase = pairExplode(explodeBuf, action); - explodePos = 0; - buffer.setCharAt(basePos, newBase); - - baseIndex = composeLookup(newBase) >>> ComposeData.INDEX_SHIFT; - - if (DEBUG) System.out.println("Pairwise explosion: " + Utility.hex(lastBase) + "," + Utility.hex(ch) - + " --> " + Utility.hex(newBase) + "," + Utility.hex(explodeBuf)); - lastBase = newBase; - } else { - // Normal pairwise combination. Replace the base char - char newBase = (char) action; - buffer.setCharAt(basePos, newBase); - - baseIndex = composeLookup(newBase) >>> ComposeData.INDEX_SHIFT; - - if (DEBUG) System.out.println("Pairwise combination: " + Utility.hex(lastBase) + "," + Utility.hex(ch) - + " --> " + Utility.hex(newBase)); - lastBase = newBase; - } - // - // Since there are Unicode characters that cannot be combined in arbitrary - // order, we have to re-process any combining marks that go with this - // base character. There are only four characters in Unicode that have - // this problem. If they are fixed in Unicode 3.0, this code can go away. - // - int len = buffer.length(); - if (len - basePos > 1) { - if (DEBUG) System.out.println("Reprocessing combining marks"); - for (int j = basePos+1; j < len; j++) { - explodeBuf.append(buffer.charAt(j)); - } - buffer.setLength(basePos+1); - classesSeenL = classesSeenH = 0; - if (explodePos == EMPTY) explodePos = 0; - } - } else { - if (DEBUG) System.out.println("char doesn't combine"); - // No combination with this character - bubbleAppend(buffer, ch, cclass); - if (cclass < 32) { - classesSeenL |= 1 << cclass; - } else { - classesSeenH |= 1 << (cclass & 31); - } - } - } - else if (index > minExplode) { - // Single exploding character - explode(explodeBuf, index); - explodePos = 0; - if (DEBUG) System.out.println("explosion: " + Utility.hex(ch) + " --> " + Utility.hex(explodeBuf)); - } - else if (type == ComposeData.HANGUL && minExplode == 0) { - // If we're in compatibility mode we need to decompose Hangul to Jamo, - // because some of the Jamo might have compatibility decompositions. - hangulToJamo(ch, explodeBuf, minDecomp); - if (DEBUG) System.out.println("decomposed hangul " + Utility.hex(ch) + " to jamo " + Utility.hex(explodeBuf)); - explodePos = 0; - } - else if (type == ComposeData.INITIAL_JAMO) { - if (buffer.length() > 0 && chFromText && explodePos == EMPTY) { - // When we hit a base char in the source text, we can return the text - // that's been composed so far. We'll re-process this char next time through. - if (DEBUG) System.out.println("returning early because we hit a new base"); - break; - } - classesSeenL = classesSeenH = 0; - baseIndex = ComposeData.INITIAL_JAMO_INDEX; - basePos = buffer.length(); - buffer.append(ch); - if (DEBUG) System.out.println("got initial jamo " + Utility.hex(ch)); - } - else if (type == ComposeData.MEDIAL_JAMO && classesSeenL == 0 && classesSeenH == 0 - && baseIndex == ComposeData.INITIAL_JAMO_INDEX) { - // If the last character was an initial jamo, we can combine it with this - // one to create a Hangul character. - int l = buffer.charAt(basePos) - JAMO_LBASE; - int v = ch - JAMO_VBASE; - char newCh = (char)(HANGUL_BASE + (l*JAMO_VCOUNT + v) * JAMO_TCOUNT); - buffer.setCharAt(basePos, newCh); - - if (DEBUG) System.out.println("got medial jamo " + Utility.hex(ch) + ", replacing with Hangul " + Utility.hex(newCh)); - - baseIndex = ComposeData.MEDIAL_JAMO_INDEX; - } - else if (type == ComposeData.FINAL_JAMO && classesSeenL == 0 && classesSeenH == 0 - && baseIndex == ComposeData.MEDIAL_JAMO_INDEX) { - // If the last character was a medial jamo that we turned into Hangul, - // we can add this character too. - char newCh = (char)(buffer.charAt(basePos) + (ch - JAMO_TBASE)); - buffer.setCharAt(basePos, newCh); - - if (DEBUG) System.out.println("got final jamo " + Utility.hex(ch) + ", replacing with Hangul " + Utility.hex(newCh)); - - baseIndex = 0; - basePos = -1; - classesSeenL = classesSeenH = 0; - } else { - // TODO: deal with JAMO character types - baseIndex = 0; - basePos = -1; - classesSeenL = classesSeenH = 0; - buffer.append(ch); - if (DEBUG) System.out.println("UNKNOWN char " + Utility.hex(ch)); - } - - if (explodePos == EMPTY) { - ch = text.next(); - chFromText = true; - } else { - ch = explodeBuf.charAt(explodePos++); - if (explodePos >= explodeBuf.length()) { - explodePos = EMPTY; - explodeBuf.setLength(0); - } - chFromText = false; - } - } - if (buffer.length() > 0) { - bufferLimit = buffer.length() - 1; - ch = buffer.charAt(0); - } else { - ch = DONE; - bufferLimit = 0; - } - return ch; - } - - /** - * Compose starting with the input char just before the current position - * and continuing backward until (and including) the previous base char. - *

- * Input: - *

    - *
  • underlying char iter points just after last char to decompose - *
- *

- * Output: - *

    - *
  • returns last char of resulting decomposition sequence - *
  • underlying iter points to lowest-index char we decomposed, i.e. the base char - *
- */ - private char prevCompose() { - if (DEBUG) System.out.println("--------------- top of prevCompose() ---------------"); - - // Compatibility explosions have lower indices; skip them if necessary - int minExplode = mode.compat() ? 0 : ComposeData.MAX_COMPAT; - - initBuffer(); - - // Slurp up characters until we hit a base char or an initial Jamo - char ch; - while ((ch = curBackward()) != DONE) { - buffer.insert(0, ch); - - // Get the basic info for the character - int charInfo = composeLookup(ch); - int type = charInfo & ComposeData.TYPE_MASK; - int index = charInfo >>> ComposeData.INDEX_SHIFT; - - if (DEBUG) System.out.println("prevCompose got char " + Utility.hex(ch) + - ", type=" + type + ", index=" + index + - ", minExplode=" + minExplode); - - if (type == ComposeData.BASE - || (type == ComposeData.NON_COMPOSING_COMBINING && index < minExplode) - || type == ComposeData.HANGUL - || type == ComposeData.INITIAL_JAMO) - { - break; - } - } - // If there's more than one character in the buffer, compose it all at once.... - if (buffer.length() > 0) { - // TODO: The performance of this is awful; add a way to compose - // a StringBuffer in place. - String composed = compose(buffer.toString(), mode.compat(), options); - if (DEBUG) System.out.println("prevCompose called compose(" + Utility.hex(buffer) + - ")->" + Utility.hex(composed)); - buffer.setLength(0); - buffer.append(composed); - - if (buffer.length() > 1) { - bufferLimit = bufferPos = buffer.length() - 1; - ch = buffer.charAt(bufferPos); - } else { - ch = buffer.charAt(0); - } - } - else { - ch = DONE; - } - - if (DEBUG) System.out.println("prevCompose returning " + Utility.hex(ch)); - return ch; - } - - private static void bubbleAppend(StringBuffer target, char ch, int cclass) { - if (DEBUG) System.out.println(" bubbleAppend(" + Utility.hex(target) + ", " + Utility.hex(ch) + ", " + cclass + ")" ); - if (DEBUG) System.out.println(" getComposeClass(" + Utility.hex(ch) + ")=" + getComposeClass(ch) ); - if (DEBUG) System.out.println(" target before bubbling is : " + Utility.hex(target)); - - int i = target.length()-1; - if (cclass != 1) { // 1 means combining class 0!!! - for (; i >= 0; --i ) { - int iClass = getComposeClass(target.charAt(i)); - if (DEBUG) System.out.println(" getComposeClass(" + Utility.hex(target.charAt(i)) + ")=" + getComposeClass(target.charAt(i)) ); - if (DEBUG) System.out.println(" bubbleAppend: target[" + i + "]=" + Utility.hex(target.charAt(i)) + " is iClass=" + iClass + " CC="+ UCharacter.getCombiningClass(target.charAt(i))); - if (DEBUG) System.out.println(" bubbleAppend: for ch="+ Utility.hex(ch) + " class="+cclass + " CC=" + UCharacter.getCombiningClass(ch)); - if (iClass <= cclass) { - // We've hit something we can't bubble this character past, so insert here - break; - } - } - } - // We need to insert just after character "i" - if (DEBUG) System.out.println(" bubbleAppend inserting "+ Utility.hex(ch)+" at index " + (i+1)); - - target.insert(i+1, ch); - - if (DEBUG) System.out.println(" target is : " + Utility.hex(target)); - } - - private static int getComposeClass(char ch) { - int cclass = 0; - int charInfo = composeLookup(ch); - int type = charInfo & ComposeData.TYPE_MASK; - if(DEBUG) System.out.println(Utility.hex(ch) + " charInfo: " +charInfo + " type : " +type); - if (type == ComposeData.COMBINING) { - cclass = ComposeData.typeBit[charInfo >>> ComposeData.INDEX_SHIFT]; - } - return cclass; - } - - static final int composeLookup(char ch) { - return ComposeData.lookup.elementAt(ch); - } - - static final int composeAction(int baseIndex, int comIndex) { - return ComposeData.actions.elementAt((char)(baseIndex - + ComposeData.MAX_BASES*comIndex)); - } - - static final void explode(StringBuffer target, int index) { - char ch; - while ((ch = ComposeData.replace.charAt(index++)) != 0) - target.append(ch); - } - - static final char pairExplode(StringBuffer target, int action) { - int index = ComposeData.actionIndex[action - ComposeData.MAX_COMPOSED]; - explode(target, index + 1); - return ComposeData.replace.charAt(index); // New base char - } - - - //------------------------------------------------------------------------- - // Decompose methods - //------------------------------------------------------------------------- - - /** - * Static method to decompose a String. - *

- * The options parameter specifies which optional - * Normalizer features are to be enabled for this operation. - * Currently the only available option is {@link #IGNORE_HANGUL}. - * The desired options should be OR'ed together to determine the value - * of this argument. If you want the default behavior corresponding - * to Unicode Normalization Form D or KD, - * use 0 for this argument. - *

- * @param str the string to be decomposed. - * - * @param compat Perform compatibility decomposition. - * If this argument is false, only canonical - * decomposition will be performed. - * - * - * @return the decomposed string. - */ - public static String decompose(String source, boolean compat, int options) - { - if (DEBUG) System.out.println("--------------- top of decompose() ---------------"); - - boolean hangul = (options & IGNORE_HANGUL) == 0; - int minDecomp = compat ? 0 : DecompData.MAX_COMPAT; - - StringBuffer result = new StringBuffer(); - StringBuffer buffer = null; - - int i = 0, bufPtr = -1; - - while (i < source.length() || bufPtr >= 0) - { - char ch; - - if (bufPtr >= 0) { - ch = buffer.charAt(bufPtr++); - if (bufPtr == buffer.length()) { - bufPtr = -1; - } - } else { - ch = source.charAt(i++); - } - - int offset = DecompData.offsets.elementAt(ch); - int index = offset & DecompData.DECOMP_MASK; - - if (DEBUG) System.out.println("decompose got " + Utility.hex(ch)); - - if (index > minDecomp) { - if ((offset & DecompData.DECOMP_RECURSE) != 0) { - if (DEBUG) System.out.println(" " + Utility.hex(ch) + " has RECURSIVE decomposition, index=" + index); - if (buffer == null) { - buffer = new StringBuffer(); - } else { - buffer.setLength(0); - } - doAppend(DecompData.contents, index, buffer); - bufPtr = 0; - } else { - if (DEBUG) System.out.println(" " + Utility.hex(ch) + " has decomposition, index=" + index); - doAppend(DecompData.contents, index, result); - } - } else if (ch >= HANGUL_BASE && ch < HANGUL_LIMIT && hangul) { - hangulToJamo(ch, result, minDecomp); - } else { - result.append(ch); - } - } - fixCanonical(result); - return result.toString(); - } - - /** - * Decompose starting with current input character and continuing - * until just before the next base char. - *

- * Input: - *

    - *
  • underlying char iter points to first character to decompose - *
- *

- * Output: - *

    - *
  • returns first char of decomposition or DONE if at end - *
  • Underlying char iter is pointing at next base char or past end - *
- */ - private char nextDecomp() - { - if (DEBUG) System.out.println("--------------- top of nextDecomp() ---------------"); - - boolean hangul = (options & IGNORE_HANGUL) == 0; - char ch = curForward(); - - int offset = DecompData.offsets.elementAt(ch); - int index = offset & DecompData.DECOMP_MASK; - - if (index > minDecomp || DecompData.canonClass.elementAt(ch) != DecompData.BASE) - { - initBuffer(); - - if (index > minDecomp) { - if (DEBUG) System.out.println(" " + Utility.hex(ch) + " has decomposition, index=" + index); - doAppend(DecompData.contents, index, buffer); - - if ((offset & DecompData.DECOMP_RECURSE) != 0) { - // Need to decompose the output of this decomposition recursively. - for (int i = 0; i < buffer.length(); i++) { - ch = buffer.charAt(i); - index = DecompData.offsets.elementAt(ch) & DecompData.DECOMP_MASK; - - if (index > minDecomp) { - i += doReplace(DecompData.contents, index, buffer, i); - } - } - } - } else { - buffer.append(ch); - } - boolean needToReorder = false; - - // Any other combining chacters that immediately follow the decomposed - // character must be included in the buffer too, because they're - // conceptually part of the same logical character. - while ((ch = text.next()) != DONE - && DecompData.canonClass.elementAt(ch) != DecompData.BASE) - { - needToReorder = true; - // Decompose any of these characters that need it - Liu - index = DecompData.offsets.elementAt(ch) & DecompData.DECOMP_MASK; - if (index > minDecomp) { - doAppend(DecompData.contents, index, buffer); - } else { - buffer.append(ch); - } - } - - if (buffer.length() > 1 && needToReorder) { - // If there is more than one combining character in the buffer, - // put them into the canonical order. - // But we don't need to sort if only characters are the ones that - // resulted from decomosing the base character. - fixCanonical(buffer); - } - bufferLimit = buffer.length() - 1; - ch = buffer.charAt(0); - } else { - // Just use this character, but first advance to the next one - text.next(); - - // Do Hangul -> Jamo decomposition if necessary - if (hangul && ch >= HANGUL_BASE && ch < HANGUL_LIMIT) { - initBuffer(); - hangulToJamo(ch, buffer, minDecomp); - bufferLimit = buffer.length() - 1; - ch = buffer.charAt(0); - } - } - if (DEBUG) System.out.println(" nextDecomp returning " + Utility.hex(ch) + ", text index=" + text.getIndex()); - return ch; - } - - /** - * Decompose starting with the input char just before the current position - * and continuing backward until (and including) the previous base char. - *

- * Input: - *

    - *
  • underlying char iter points just after last char to decompose - *
- *

- * Output: - *

    - *
  • returns last char of resulting decomposition sequence - *
  • underlying iter points to lowest-index char we decomposed, i.e. the base char - *
- */ - private char prevDecomp() { - if (DEBUG) System.out.println("--------------- top of prevDecomp() ---------------"); - - boolean hangul = (options & IGNORE_HANGUL) == 0; - - char ch = curBackward(); - - int offset = DecompData.offsets.elementAt(ch); - int index = offset & DecompData.DECOMP_MASK; - - if (DEBUG) System.out.println("prevDecomp got input char " + Utility.hex(ch)); - - if (index > minDecomp || DecompData.canonClass.elementAt(ch) != DecompData.BASE) - { - initBuffer(); - - // This method rewritten to pass conformance tests. - Liu - // Collect all characters up to the previous base char - while (ch != DONE) { - buffer.insert(0, ch); - if (DecompData.canonClass.elementAt(ch) == DecompData.BASE) break; - ch = text.previous(); - } - - if (DEBUG) System.out.println("prevDecomp buffer: " + Utility.hex(buffer)); - - // Decompose the buffer - for (int i = 0; i < buffer.length(); i++) { - ch = buffer.charAt(i); - offset = DecompData.offsets.elementAt(ch); - index = offset & DecompData.DECOMP_MASK; - - if (index > minDecomp) { - int j = doReplace(DecompData.contents, index, buffer, i); - if ((offset & DecompData.DECOMP_RECURSE) != 0) { - // Need to decompose this recursively - for (; i < j; ++i) { - ch = buffer.charAt(i); - index = DecompData.offsets.elementAt(ch) & DecompData.DECOMP_MASK; - if (index > minDecomp) { - i += doReplace(DecompData.contents, index, buffer, i); - } - } - } - i = j; - } - } - - if (DEBUG) System.out.println("prevDecomp buffer after decomp: " + Utility.hex(buffer)); - - if (buffer.length() > 1) { - // If there is more than one combining character in the buffer, - // put them into the canonical order. - fixCanonical(buffer); - } - bufferLimit = bufferPos = buffer.length() - 1; - ch = buffer.charAt(bufferPos); - } - else if (hangul && ch >= HANGUL_BASE && ch < HANGUL_LIMIT) { - initBuffer(); - hangulToJamo(ch, buffer, minDecomp); - bufferLimit = bufferPos = buffer.length() - 1; - ch = buffer.charAt(bufferPos); - } - if (DEBUG) System.out.println(" prevDecomp returning '" + ch + "' " + Utility.hex(ch) + ", text index=" + text.getIndex()); - return ch; - } - - static final int getClass(char ch) { - int value = DecompData.canonClass.elementAt(ch); - return (value >= 0) ? value : value + 256; - } - - - //------------------------------------------------------------------------- - // CharacterIterator overrides - //------------------------------------------------------------------------- - - /** - * Return the current character in the normalized text. - */ - public char current() { - if (currentChar == DONE) { - if (mode.compose()) { - currentChar = nextCompose(); - } - else if (mode.decomp()) { - currentChar = nextDecomp(); - } - else { - currentChar = text.current(); - } - } - return currentChar; - } - - /** - * Return the first character in the normalized text. This resets - * the Normalizer's position to the beginning of the text. - */ - public char first() { - return setIndex(text.getBeginIndex()); - } - - /** - * Return the last character in the normalized text. This resets - * the Normalizer's position to be just before the - * the input text corresponding to that normalized character. - */ - public char last() { - text.setIndex(text.getEndIndex() - 1); // Setting to getEndIndex() fails in 1.1 - atEnd = true; // so work around the bug - - currentChar = DONE; // The current char hasn't been processed - clearBuffer(); // The buffer is empty too - return previous(); - } - - /** - * Return the next character in the normalized text and advance - * the iteration position by one. If the end - * of the text has already been reached, {@link #DONE} is returned. - */ - public char next() { - if (bufferPos < bufferLimit) { - // There are output characters left in the buffer - currentChar = buffer.charAt(++bufferPos); - } - else { - bufferLimit = bufferPos = 0; // Buffer is now out of date - if (mode.compose()) { - currentChar = nextCompose(); - } - else if (mode.decomp()) { - currentChar = nextDecomp(); - } - else { - currentChar = text.next(); - } - } - return currentChar; - } - - /** - * Return the previous character in the normalized text and decrement - * the iteration position by one. If the beginning - * of the text has already been reached, {@link #DONE} is returned. - */ - public char previous() { - if (bufferPos > 0) { - // There are output characters left in the buffer - currentChar = buffer.charAt(--bufferPos); - } - else { - bufferLimit = bufferPos = 0; // Buffer is now out of date - if (mode.compose()) { - currentChar = prevCompose(); - } - else if (mode.decomp()) { - currentChar = prevDecomp(); - } - else { - currentChar = text.previous(); - } - } - return currentChar; - } - - /** - * Set the iteration position in the input text that is being normalized - * and return the first normalized character at that position. - *

- * @param index the desired index in the input text. - * - * @return the first normalized character that is the result of iterating - * forward starting at the given index. - * - * @throws IllegalArgumentException if the given index is less than - * {@link #getBeginIndex} or greater than {@link #getEndIndex}. - */ - public char setIndex(int index) { - text.setIndex(index); // Checks range - currentChar = DONE; // The current char hasn't been processed - clearBuffer(); // The buffer is empty too - - return current(); - } - - /** - * Retrieve the current iteration position in the input text that is - * being normalized. This method is useful in applications such as - * searching, where you need to be able to determine the position in - * the input text that corresponds to a given normalized output character. - */ - public final int getIndex() { - return text.getIndex(); - } - - /** - * Retrieve the index of the start of the input text. This is the begin index - * of the CharacterIterator or the start (i.e. 0) of the String - * over which this Normalizer is iterating - */ - public final int getBeginIndex() { - return text.getBeginIndex(); - } - - /** - * Retrieve the index of the end of the input text. This is the end index - * of the CharacterIterator or the length of the String - * over which this Normalizer is iterating - */ - public final int getEndIndex() { - return text.getEndIndex(); - } - - //------------------------------------------------------------------------- - // Property access methods - //------------------------------------------------------------------------- - - /** - * Set the normalization mode for this object. - *

- * Note:If the normalization mode is changed while iterating - * over a string, calls to {@link #next} and {@link #previous} may - * return previously buffers characters in the old normalization mode - * until the iteration is able to re-sync at the next base character. - * It is safest to call {@link #setText setText()}, {@link #first}, - * {@link #last}, etc. after calling setMode. - *

- * @param newMode the new mode for this Normalizer. - * The supported modes are: - *

    - *
  • {@link #COMPOSE} - Unicode canonical decompositiion - * followed by canonical composition. - *
  • {@link #COMPOSE_COMPAT} - Unicode compatibility decompositiion - * follwed by canonical composition. - *
  • {@link #DECOMP} - Unicode canonical decomposition - *
  • {@link #DECOMP_COMPAT} - Unicode compatibility decomposition. - *
  • {@link #NO_OP} - Do nothing but return characters - * from the underlying input text. - *
- * - * @see #getMode - */ - public void setMode(Mode newMode) { - mode = newMode; - minDecomp = mode.compat() ? 0 : DecompData.MAX_COMPAT; - } - - /** - * Return the basic operation performed by this Normalizer - * - * @see #setMode - */ - public Mode getMode() { - return mode; - } - - /** - * Set options that affect this Normalizer's operation. - * Options do not change the basic composition or decomposition operation - * that is being performed , but they control whether - * certain optional portions of the operation are done. - * Currently the only available option is: - *

- *

    - *
  • {@link #IGNORE_HANGUL} - Do not decompose Hangul syllables into the Jamo alphabet - * and vice-versa. This option is off by default (i.e. Hangul processing - * is enabled) since the Unicode standard specifies that Hangul to Jamo - * is a canonical decomposition. For any of the standard Unicode Normalization - * Forms, you should leave this option off. - *
- *

- * @param option the option whose value is to be set. - * @param value the new setting for the option. Use true to - * turn the option on and false to turn it off. - * - * @see #getOption - */ - public void setOption(int option, boolean value) { - if (option != IGNORE_HANGUL) { - throw new IllegalArgumentException("Illegal option"); - } - if (value) { - options |= option; - } else { - options &= (~option); - } - } - - /** - * Determine whether an option is turned on or off. - *

- * @see #setOption - */ - public boolean getOption(int option) { - return (options & option) != 0; - } - - /** - * Set the input text over which this Normalizer will iterate. - * The iteration position will be reset to the beginning. - *

- * @param newText The new string to be normalized. - */ - public void setText(String newText) { - text = new StringCharacterIterator(newText); - reset(); - } - - /** - * Set the input text over which this Normalizer will iterate. - * The iteration position will be reset to the beginning. - *

- * @param newText The new text to be normalized. - */ - public void setText(CharacterIterator newText) { - text = newText; - reset(); - } - - - //------------------------------------------------------------------------- - // Private utility methods - //------------------------------------------------------------------------- - - private final char curForward() { - char ch = text.current(); - if (DEBUG) System.out.println(" curForward returning " + Utility.hex(ch) + ", text index=" + text.getIndex()); - return ch; - } - - private final char curBackward() { - char ch = atEnd ? text.current() : text.previous(); - atEnd = false; - if (DEBUG) System.out.println(" curBackward returning " + Utility.hex(ch) + ", text index=" + text.getIndex()); - return ch; - } - - static final int doAppend(String source, int offset, StringBuffer dest) { - int index = offset >>> STR_INDEX_SHIFT; - int length = offset & STR_LENGTH_MASK; - - if (length == 0) { - char ch; - while ((ch = DecompData.contents.charAt(index++)) != 0x0000) { - dest.append(ch); - length++; - } - } else { - for (int i = 0; i < length; i++) { - dest.append(DecompData.contents.charAt(index++)); - } - } - return length; - } - - - static final int doInsert(String source, int offset, StringBuffer dest, int pos) - { - int index = offset >>> STR_INDEX_SHIFT; - int length = offset & STR_LENGTH_MASK; - - if (length == 0) { - char ch; - while ((ch = DecompData.contents.charAt(index++)) != 0x0000) { - dest.insert(pos++, ch); - length++; - } - } else { - for (int i = 0; i < length; i++) { - dest.insert(pos++, DecompData.contents.charAt(index++)); - } - } - return length; - } - - static final int doReplace(String source, int offset, StringBuffer dest, int pos) - { - int index = offset >>> STR_INDEX_SHIFT; - int length = offset & STR_LENGTH_MASK; - - dest.setCharAt(pos++, DecompData.contents.charAt(index++)); - if (length == 0) { - char ch; - while ((ch = DecompData.contents.charAt(index++)) != 0x0000) { - dest.insert(pos++, ch); - length++; - } - } else { - for (int i = 1; i < length; i++) { - dest.insert(pos++, DecompData.contents.charAt(index++)); - } - } - return length; - } - - private void reset() { - text.setIndex(text.getBeginIndex()); - atEnd = false; - bufferPos = 0; - bufferLimit = 0; - } - - private final void initBuffer() { - if (buffer == null) { - buffer = new StringBuffer(10); - } else { - buffer.setLength(0); - } - clearBuffer(); - } - - private final void clearBuffer() { - bufferLimit = bufferPos = 0; - } - - - /** - * Fixes the sorting sequence of non-spacing characters according to - * their combining class. The algorithm is listed on p.3-11 in the - * Unicode Standard 2.0. The table of combining classes is on p.4-2 - * in the Unicode Standard 2.0. - * @param result the string to fix. - */ - private static void fixCanonical(StringBuffer result) { - if (result.length() == 0) return; // don't bother with empty strings! - - int i = result.length() - 1; - int currentType = getClass(result.charAt(i)); - int lastType; - - for (--i; i >= 0; --i) { - lastType = currentType; - currentType = getClass(result.charAt(i)); - - // - // a swap is presumed to be rare (and a double-swap very rare), - // so don't worry about efficiency here. - // - if (currentType > lastType && lastType != DecompData.BASE) { - // swap characters - char temp = result.charAt(i); - result.setCharAt(i, result.charAt(i+1)); - result.setCharAt(i+1, temp); - // if not at end, backup (one further, to compensate for for-loop) - if (i < result.length() - 2) { - i += 2; - } - // reset type, since we swapped. - currentType = getClass(result.charAt(i)); - } - } - } - - //------------------------------------------------------------------------- - // Hangul / Jamo conversion utilities for internal use - // See section 3.10 of The Unicode Standard, v 2.0. - // - - // Package-accessible for use by ComposedCharIter - static final char HANGUL_BASE = 0xac00; - static final char HANGUL_LIMIT = 0xd7a4; - - private static final char JAMO_LBASE = 0x1100; - private static final char JAMO_VBASE = 0x1161; - private static final char JAMO_TBASE = 0x11a7; - private static final int JAMO_LCOUNT = 19; - private static final int JAMO_VCOUNT = 21; - private static final int JAMO_TCOUNT = 28; - private static final int JAMO_NCOUNT = JAMO_VCOUNT * JAMO_TCOUNT; - - /** - * Convert a single Hangul syllable into one or more Jamo characters. - * - * @param conjoin If true, decompose Jamo into conjoining Jamo. - */ - static int hangulToJamo(char ch, StringBuffer result, int decompLimit) { - char sIndex = (char)(ch - HANGUL_BASE); - char leading = (char)(JAMO_LBASE + sIndex / JAMO_NCOUNT); - char vowel = (char)(JAMO_VBASE + - (sIndex % JAMO_NCOUNT) / JAMO_TCOUNT); - char trailing= (char)(JAMO_TBASE + (sIndex % JAMO_TCOUNT)); - - int length = 0; - - length += jamoAppend(leading, decompLimit, result); - length += jamoAppend(vowel, decompLimit, result); - if (trailing != JAMO_TBASE) { - length += jamoAppend(trailing, decompLimit, result); - } - return length; - } - static final int jamoAppend(char ch, int limit, StringBuffer dest) { - int offset = DecompData.offsets.elementAt(ch); - if (offset > limit) { - return doAppend(DecompData.contents, offset, dest); - } else { - dest.append(ch); - return 1; - } - } - - static private void jamoToHangul(StringBuffer buffer, int start) { - int out = 0; - int limit = buffer.length() - 1; - - int in, l, v, t; - - for (in = start; in < limit; in++) { - char ch = buffer.charAt(in); - - if ((l = ch - JAMO_LBASE) >= 0 && l < JAMO_LCOUNT - && (v = buffer.charAt(in+1) - JAMO_VBASE) >= 0 && v < JAMO_VCOUNT) { - // - // We've found a pair of Jamo characters to compose. - // Snarf the Jamo vowel and see if there's also a trailing char - // - in++; // Snarf the Jamo vowel too. - - t = (in < limit) ? buffer.charAt(in+1) : 0; - t -= JAMO_TBASE; - - if (t >= 0 && t < JAMO_TCOUNT) { - in++; // Snarf the trailing consonant too - } else { - t = 0; // No trailing consonant - } - buffer.setCharAt(out++, (char)((l*JAMO_VCOUNT + v) * JAMO_TCOUNT - + t + HANGUL_BASE)); - } else { - buffer.setCharAt(out++, ch); - } - } - while (in < buffer.length()) { - buffer.setCharAt(out++, buffer.charAt(in++)); - } - - buffer.setLength(out); - } - - - //------------------------------------------------------------------------- - // Private data - //------------------------------------------------------------------------- - - private static final boolean DEBUG = false; - - private Mode mode = DECOMP; - private int options = 0; - private transient int minDecomp; - - // The input text and our position in it - private CharacterIterator text; - private boolean atEnd = false; - - // A buffer for holding intermediate results - private StringBuffer buffer = null; - private int bufferPos = 0; - private int bufferLimit = 0; - private char currentChar; - - // Another buffer for use during iterative composition - private static final int EMPTY = -1; - private StringBuffer explodeBuf = null; - - // These must agree with the constants used in NormalizerBuilder - static final int STR_INDEX_SHIFT = 2; - static final int STR_LENGTH_MASK = 0x0003; -}; diff --git a/icu4j/src/com/ibm/text/NullTransliterator.java b/icu4j/src/com/ibm/text/NullTransliterator.java deleted file mode 100755 index 8d8b32d70d..0000000000 --- a/icu4j/src/com/ibm/text/NullTransliterator.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/NullTransliterator.java,v $ - * $Date: 2001/09/20 21:20:39 $ - * $Revision: 1.9 $ - * - ***************************************************************************************** - */ -package com.ibm.text; -import java.util.*; - -/** - * A transliterator that leaves text unchanged. - */ -public class NullTransliterator extends Transliterator { - private static final String COPYRIGHT = - "\u00A9 IBM Corporation 2000. All rights reserved."; - - /** - * Package accessible IDs for this transliterator. - */ - static String SHORT_ID = "Null"; - static String _ID = "Any-Null"; - - /** - * Constructs a transliterator. - */ - public NullTransliterator() { - super(_ID, null); - } - - /** - * Implements {@link Transliterator#handleTransliterate}. - */ - protected void handleTransliterate(Replaceable text, - Position offsets, boolean incremental) { - offsets.start = offsets.limit; - } -} diff --git a/icu4j/src/com/ibm/text/NumberFormat.java b/icu4j/src/com/ibm/text/NumberFormat.java deleted file mode 100755 index 7e680e1d8c..0000000000 --- a/icu4j/src/com/ibm/text/NumberFormat.java +++ /dev/null @@ -1,937 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/NumberFormat.java,v $ - * $Date: 2001/10/19 12:35:49 $ - * $Revision: 1.10 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.util.Locale; -import java.util.ResourceBundle; -import java.text.Format; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.text.ParseException; -import java.text.resources.*; -import java.util.Hashtable; -import java.math.BigInteger; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import com.ibm.util.OverlayBundle; -import java.io.InvalidObjectException; //Bug 4185761 [Richard/GCL] - -/** - * NumberFormat is the abstract base class for all number - * formats. This class provides the interface for formatting and parsing - * numbers. NumberFormat also provides methods for determining - * which locales have number formats, and what their names are. - * - *

This is an enhanced version of NumberFormat that - * is based on the standard version in the JDK. New or changed functionality - * is labeled - * NEW or - * CHANGED. - * - *

- * NumberFormat helps you to format and parse numbers for any locale. - * Your code can be completely independent of the locale conventions for - * decimal points, thousands-separators, or even the particular decimal - * digits used, or whether the number format is even decimal. - * - *

- * To format a number for the current Locale, use one of the factory - * class methods: - *

- *
- *  myString = NumberFormat.getInstance().format(myNumber);
- * 
- *
- * If you are formatting multiple numbers, it is - * more efficient to get the format and use it multiple times so that - * the system doesn't have to fetch the information about the local - * language and country conventions multiple times. - *
- *
- * NumberFormat nf = NumberFormat.getInstance();
- * for (int i = 0; i < a.length; ++i) {
- *     output.println(nf.format(myNumber[i]) + "; ");
- * }
- * 
- *
- * To format a number for a different Locale, specify it in the - * call to getInstance. - *
- *
- * NumberFormat nf = NumberFormat.getInstance(Locale.FRENCH);
- * 
- *
- * You can also use a NumberFormat to parse numbers: - *
- *
- * myNumber = nf.parse(myString);
- * 
- *
- * Use getInstance or getNumberInstance to get the - * normal number format. Use getIntegerInstance to get an - * integer number format. Use getCurrencyInstance to get the - * currency number format. And use getPercentInstance to get a - * format for displaying percentages. With this format, a fraction like - * 0.53 is displayed as 53%. - * - *

- * You can also control the display of numbers with such methods as - * setMinimumFractionDigits. - * If you want even more control over the format or parsing, - * or want to give your users more control, - * you can try casting the NumberFormat you get from the factory methods - * to a DecimalFormat. This will work for the vast majority - * of locales; just remember to put it in a try block in case you - * encounter an unusual one. - * - *

- * NumberFormat and DecimalFormat are designed such that some controls - * work for formatting and others work for parsing. The following is - * the detailed description for each these control methods, - *

- * setParseIntegerOnly : only affects parsing, e.g. - * if true, "3456.78" -> 3456 (and leaves the parse position just after index 6) - * if false, "3456.78" -> 3456.78 (and leaves the parse position just after index 8) - * This is independent of formatting. If you want to not show a decimal point - * where there might be no digits after the decimal point, use - * setDecimalSeparatorAlwaysShown. - *

- * setDecimalSeparatorAlwaysShown : only affects formatting, and only where - * there might be no digits after the decimal point, such as with a pattern - * like "#,##0.##", e.g., - * if true, 3456.00 -> "3,456." - * if false, 3456.00 -> "3456" - * This is independent of parsing. If you want parsing to stop at the decimal - * point, use setParseIntegerOnly. - * - *

- * You can also use forms of the parse and format - * methods with ParsePosition and FieldPosition to - * allow you to: - *

    - *
  • progressively parse through pieces of a string - *
  • align the decimal point and other areas - *
- * For example, you can align numbers in two ways: - *
    - *
  1. If you are using a monospaced font with spacing for alignment, - * you can pass the FieldPosition in your format call, with - * field = INTEGER_FIELD. On output, - * getEndIndex will be set to the offset between the - * last character of the integer and the decimal. Add - * (desiredSpaceCount - getEndIndex) spaces at the front of the string. - * - *
  2. If you are using proportional fonts, - * instead of padding with spaces, measure the width - * of the string in pixels from the start to getEndIndex. - * Then move the pen by - * (desiredPixelWidth - widthToAlignmentPoint) before drawing the text. - * It also works where there is no decimal, but possibly additional - * characters at the end, e.g., with parentheses in negative - * numbers: "(12)" for -12. - *
- * - *

Synchronization

- *

- * Number formats are generally not synchronized. It is recommended to create - * separate format instances for each thread. If multiple threads access a format - * concurrently, it must be synchronized externally. - *

- * - * see DecimalFormat - * see java.text.ChoiceFormat - * @version $Revision: 1.10 $ - * @author Mark Davis - * @author Helena Shih - * @author Alan Liu - */ -public abstract class NumberFormat extends Format{ - - /** - * Field constant used to construct a FieldPosition object. Signifies that - * the position of the integer part of a formatted number should be returned. - * @see java.text.FieldPosition - */ - public static final int INTEGER_FIELD = 0; - - /** - * Field constant used to construct a FieldPosition object. Signifies that - * the position of the fraction part of a formatted number should be returned. - * @see java.text.FieldPosition - */ - public static final int FRACTION_FIELD = 1; - - /** - * CHANGED - * Format an object. Change: recognizes BigInteger - * and BigDecimal objects now. - */ - public final StringBuffer format(Object number, - StringBuffer toAppendTo, - FieldPosition pos) - { - if (number instanceof Long) { - return format(((Long)number).longValue(), toAppendTo, pos); - } else if (number instanceof BigInteger) { - return format((BigInteger) number, toAppendTo, pos); - } else if (number instanceof java.math.BigDecimal) { - return format((java.math.BigDecimal) number, toAppendTo, pos); - } else if (number instanceof com.ibm.math.BigDecimal) { - return format((com.ibm.math.BigDecimal) number, toAppendTo, pos); - } else if (number instanceof Number) { - return format(((Number)number).doubleValue(), toAppendTo, pos); - } else { - throw new IllegalArgumentException("Cannot format given Object as a Number"); - } - } - - public final Object parseObject(String source, - ParsePosition parsePosition) - { - return parse(source, parsePosition); - } - - /** - * Specialization of format. - * @see java.text.Format#format - */ - public final String format (double number) { - return format(number,new StringBuffer(), - new FieldPosition(0)).toString(); - } - - /** - * Specialization of format. - * @see java.text.Format#format - */ - public final String format (long number) { - return format(number,new StringBuffer(), - new FieldPosition(0)).toString(); - } - - /** - * NEW - * Convenience method to format a BigInteger. - */ - public final String format(BigInteger number) { - return format(number, new StringBuffer(), - new FieldPosition(0)).toString(); - } - - /** - * NEW - * Convenience method to format a BigDecimal. - */ - public final String format(java.math.BigDecimal number) { - return format(number, new StringBuffer(), - new FieldPosition(0)).toString(); - } - - /* this has been removed pending addition of com.ibm.math packge to ICU4J - * NEW - * Convenience method to format a BigDecimal. - */ - public final String format(com.ibm.math.BigDecimal number) { - return format(number, new StringBuffer(), - new FieldPosition(0)).toString(); - } - - /** - * Specialization of format. - * @see java.text.Format#format - */ - public abstract StringBuffer format(double number, - StringBuffer toAppendTo, - FieldPosition pos); - - /** - * Specialization of format. - * @see java.text.Format#format - */ - public abstract StringBuffer format(long number, - StringBuffer toAppendTo, - FieldPosition pos); - - /** - * NEW - * Format a BigInteger. - */ - public abstract StringBuffer format(BigInteger number, - StringBuffer toAppendTo, - FieldPosition pos); - - /** - * NEW - * Format a BigDecimal. - */ - public abstract StringBuffer format(java.math.BigDecimal number, - StringBuffer toAppendTo, - FieldPosition pos); - - /** - * NEW - * Format a BigDecimal. - */ - public abstract StringBuffer format(com.ibm.math.BigDecimal number, - StringBuffer toAppendTo, - FieldPosition pos); - - /** - * Returns a Long if possible (e.g., within the range [Long.MIN_VALUE, - * Long.MAX_VALUE] and with no decimals), otherwise a Double. - * If IntegerOnly is set, will stop at a decimal - * point (or equivalent; e.g., for rational numbers "1 2/3", will stop - * after the 1). - * Does not throw an exception; if no object can be parsed, index is - * unchanged! - * @see #isParseIntegerOnly - * @see java.text.Format#parseObject - */ - public abstract Number parse(String text, ParsePosition parsePosition); - - /** - * Parses text from the beginning of the given string to produce a number. - * The method may not use the entire text of the given string. - * - * @param text A String whose beginning should be parsed. - * @return A Number parsed from the string. - * @exception ParseException if the beginning of the specified string - * cannot be parsed. - * @see #format - */ - //Bug 4375399 [Richard/GCL] - public Number parse(String text) throws ParseException { - ParsePosition parsePosition = new ParsePosition(0); - Number result = parse(text, parsePosition); - if (parsePosition.getIndex() == 0) { - throw new ParseException("Unparseable number: \"" + text + "\"", - //PP:parsePosition.errorIndex); - 0); - } - return result; - } - - /** - * Returns true if this format will parse numbers as integers only. - * For example in the English locale, with ParseIntegerOnly true, the - * string "1234." would be parsed as the integer value 1234 and parsing - * would stop at the "." character. Of course, the exact format accepted - * by the parse operation is locale dependant and determined by sub-classes - * of NumberFormat. - */ - public boolean isParseIntegerOnly() { - return parseIntegerOnly; - } - - /** - * Sets whether or not numbers should be parsed as integers only. - * @see #isParseIntegerOnly - */ - public void setParseIntegerOnly(boolean value) { - parseIntegerOnly = value; - } - - //============== Locale Stuff ===================== - - /** - * Returns the default number format for the current default locale. - * The default format is one of the styles provided by the other - * factory methods: getNumberInstance, getIntegerInstance, - * getCurrencyInstance or getPercentInstance. - * Exactly which one is locale dependant. - */ - //Bug 4408066 [Richard/GCL] - public final static NumberFormat getInstance() { - return getInstance(Locale.getDefault(), NUMBERSTYLE); - } - - /** - * Returns the default number format for the specified locale. - * The default format is one of the styles provided by the other - * factory methods: getNumberInstance, getCurrencyInstance or getPercentInstance. - * Exactly which one is locale dependant. - */ - public static NumberFormat getInstance(Locale inLocale) { - return getInstance(inLocale, NUMBERSTYLE); - } - - /** - * Returns a general-purpose number format for the current default locale. - */ - public final static NumberFormat getNumberInstance() { - return getInstance(Locale.getDefault(), NUMBERSTYLE); - } - - /** - * Returns a general-purpose number format for the specified locale. - */ - public static NumberFormat getNumberInstance(Locale inLocale) { - return getInstance(inLocale, NUMBERSTYLE); - } - - /** - * Returns an integer number format for the current default locale. The - * returned number format is configured to round floating point numbers - * to the nearest integer using IEEE half-even rounding (see {@link - * com.ibm.math.BigDecimal#ROUND_HALF_EVEN ROUND_HALF_EVEN}) for formatting, - * and to parse only the integer part of an input string (see {@link - * #isParseIntegerOnly isParseIntegerOnly}). - * - * @return a number format for integer values - */ - //Bug 4408066 [Richard/GCL] - public final static NumberFormat getIntegerInstance() { - return getInstance(Locale.getDefault(), INTEGERSTYLE); - } - - /** - * Returns an integer number format for the specified locale. The - * returned number format is configured to round floating point numbers - * to the nearest integer using IEEE half-even rounding (see {@link - * com.ibm.math.BigDecimal#ROUND_HALF_EVEN ROUND_HALF_EVEN}) for formatting, - * and to parse only the integer part of an input string (see {@link - * #isParseIntegerOnly isParseIntegerOnly}). - * - * @param inLocale the locale for which a number format is needed - * @return a number format for integer values - */ - //Bug 4408066 [Richard/GCL] - public static NumberFormat getIntegerInstance(Locale inLocale) { - return getInstance(inLocale, INTEGERSTYLE); - } - - /** - * Returns a currency format for the current default locale. - */ - public final static NumberFormat getCurrencyInstance() { - return getInstance(Locale.getDefault(), CURRENCYSTYLE); - } - - /** - * Returns a currency format for the specified locale. - */ - public static NumberFormat getCurrencyInstance(Locale inLocale) { - return getInstance(inLocale, CURRENCYSTYLE); - } - - /** - * Returns a percentage format for the current default locale. - */ - public final static NumberFormat getPercentInstance() { - return getInstance(Locale.getDefault(), PERCENTSTYLE); - } - - /** - * Returns a percentage format for the specified locale. - */ - public static NumberFormat getPercentInstance(Locale inLocale) { - return getInstance(inLocale, PERCENTSTYLE); - } - - /** - * NEW - * Returns a scientific format for the current default locale. - */ - public final static NumberFormat getScientificInstance() { - return getInstance(Locale.getDefault(), SCIENTIFICSTYLE); - } - - /** - * NEW - * Returns a scientific format for the specified locale. - */ - public static NumberFormat getScientificInstance(Locale inLocale) { - return getInstance(inLocale, SCIENTIFICSTYLE); - } - - - /** - * Get the set of Locales for which NumberFormats are installed - * @return available locales - */ - public static Locale[] getAvailableLocales() { - return LocaleData.getAvailableLocales("NumberPatterns"); - } - - /** - * Overrides hashCode - */ - public int hashCode() { - return maximumIntegerDigits * 37 + maxFractionDigits; - // just enough fields for a reasonable distribution - } - - /** - * Overrides equals - */ - public boolean equals(Object obj) { - if (obj == null) return false; - if (this == obj) - return true; - if (getClass() != obj.getClass()) - return false; - NumberFormat other = (NumberFormat) obj; - return (maximumIntegerDigits == other.maximumIntegerDigits - && minimumIntegerDigits == other.minimumIntegerDigits - && maximumFractionDigits == other.maximumFractionDigits - && minimumFractionDigits == other.minimumFractionDigits - && groupingUsed == other.groupingUsed - && parseIntegerOnly == other.parseIntegerOnly); - } - - /** - * Overrides Cloneable - */ - public Object clone() - { - NumberFormat other = (NumberFormat) super.clone(); - return other; - } - - /** - * Returns true if grouping is used in this format. For example, in the - * English locale, with grouping on, the number 1234567 might be formatted - * as "1,234,567". The grouping separator as well as the size of each group - * is locale dependant and is determined by sub-classes of NumberFormat. - * @see #setGroupingUsed - */ - public boolean isGroupingUsed() { - return groupingUsed; - } - - /** - * Set whether or not grouping will be used in this format. - * @see #isGroupingUsed - */ - public void setGroupingUsed(boolean newValue) { - groupingUsed = newValue; - } - - /** - * Returns the maximum number of digits allowed in the integer portion of a - * number. - * @see #setMaximumIntegerDigits - */ - public int getMaximumIntegerDigits() { - return maximumIntegerDigits; - } - - /** - * Sets the maximum number of digits allowed in the integer portion of a - * number. maximumIntegerDigits must be >= minimumIntegerDigits. If the - * new value for maximumIntegerDigits is less than the current value - * of minimumIntegerDigits, then minimumIntegerDigits will also be set to - * the new value. - * @param newValue the maximum number of integer digits to be shown; if - * less than zero, then zero is used. The concrete subclass may enforce an - * upper limit to this value appropriate to the numeric type being formatted. - * @see #getMaximumIntegerDigits - */ - public void setMaximumIntegerDigits(int newValue) { - maximumIntegerDigits = Math.max(0,newValue); - if (minimumIntegerDigits > maximumIntegerDigits) - minimumIntegerDigits = maximumIntegerDigits; - } - - /** - * Returns the minimum number of digits allowed in the integer portion of a - * number. - * @see #setMinimumIntegerDigits - */ - public int getMinimumIntegerDigits() { - return minimumIntegerDigits; - } - - /** - * Sets the minimum number of digits allowed in the integer portion of a - * number. minimumIntegerDigits must be <= maximumIntegerDigits. If the - * new value for minimumIntegerDigits exceeds the current value - * of maximumIntegerDigits, then maximumIntegerDigits will also be set to - * the new value - * @param newValue the minimum number of integer digits to be shown; if - * less than zero, then zero is used. The concrete subclass may enforce an - * upper limit to this value appropriate to the numeric type being formatted. - * @see #getMinimumIntegerDigits - */ - public void setMinimumIntegerDigits(int newValue) { - minimumIntegerDigits = Math.max(0,newValue); - if (minimumIntegerDigits > maximumIntegerDigits) - maximumIntegerDigits = minimumIntegerDigits; - } - - /** - * Returns the maximum number of digits allowed in the fraction portion of a - * number. - * @see #setMaximumFractionDigits - */ - public int getMaximumFractionDigits() { - return maximumFractionDigits; - } - - /** - * Sets the maximum number of digits allowed in the fraction portion of a - * number. maximumFractionDigits must be >= minimumFractionDigits. If the - * new value for maximumFractionDigits is less than the current value - * of minimumFractionDigits, then minimumFractionDigits will also be set to - * the new value. - * @param newValue the maximum number of fraction digits to be shown; if - * less than zero, then zero is used. The concrete subclass may enforce an - * upper limit to this value appropriate to the numeric type being formatted. - * @see #getMaximumFractionDigits - */ - public void setMaximumFractionDigits(int newValue) { - maximumFractionDigits = Math.max(0,newValue); - if (maximumFractionDigits < minimumFractionDigits) - minimumFractionDigits = maximumFractionDigits; - } - - /** - * Returns the minimum number of digits allowed in the fraction portion of a - * number. - * @see #setMinimumFractionDigits - */ - public int getMinimumFractionDigits() { - return minimumFractionDigits; - } - - /** - * Sets the minimum number of digits allowed in the fraction portion of a - * number. minimumFractionDigits must be <= maximumFractionDigits. If the - * new value for minimumFractionDigits exceeds the current value - * of maximumFractionDigits, then maximumIntegerDigits will also be set to - * the new value - * @param newValue the minimum number of fraction digits to be shown; if - * less than zero, then zero is used. The concrete subclass may enforce an - * upper limit to this value appropriate to the numeric type being formatted. - * @see #getMinimumFractionDigits - */ - public void setMinimumFractionDigits(int newValue) { - minimumFractionDigits = Math.max(0,newValue); - if (maximumFractionDigits < minimumFractionDigits) - maximumFractionDigits = minimumFractionDigits; - } - - // =======================privates=============================== - - // [NEW] - private static NumberFormat getInstance(Locale desiredLocale, - int choice) { - DecimalFormat format = new DecimalFormat(getPattern(desiredLocale, choice), - new DecimalFormatSymbols(desiredLocale)); - /*Bug 4408066 - Add codes for the new method getIntegerInstance() [Richard/GCL] - */ - if (choice == INTEGERSTYLE) { - format.setMaximumFractionDigits(0); - format.setDecimalSeparatorAlwaysShown(false); - format.setParseIntegerOnly(true); - } - return format; - } - - // [NEW] - protected static String getPattern(Locale forLocale, int choice) { - - /* The following code takes care of a few cases where the - * resource data in the underlying JDK lags the new features - * we have added to ICU4J: scientific notation, rounding, and - * secondary grouping. - * - * We detect these cases here and return various hard-coded - * resource data. This is the simplest solution for now, but - * it is not a good long-term mechanism. - * - * We should replace this code with a data-driven mechanism - * that reads the bundle com.ibm.text.resources.LocaleElements - * and parses an exception table that overrides the standard - * data at java.text.resource.LocaleElements*.java. - * Alternatively, we should create our own copy of the - * resource data, and use that exclusively. - */ - - // TEMPORARY, until we get scientific patterns into the main - // resources: Retrieve scientific patterns from our resources. - if (choice == SCIENTIFICSTYLE) { - // Temporarily hard code; retrieve from resource later - /*For ICU compatibility [Richard/GCL]*/ - return "#E0"; - // return NumberFormat.getBaseStringArray("NumberPatterns")[SCIENTIFICSTYLE]; - } - // TEMPORARY: Use rounding for Swiss currency - //if (choice == CURRENCYSTYLE && - // forLocale.getCountry().equals("CH")) { - // return "'Fr. '#,##0.05;'Fr.-'#,##0.05"; - //} - // TEMPORARY: Special case IN number format - //if (choice == NUMBERSTYLE && - // forLocale.getCountry().equals("IN")) { - // return "#,##,##0.###"; - //} - // Try the cache first - String[] numberPatterns = (String[]) cachedLocaleData.get(forLocale); - if (numberPatterns == null) { - OverlayBundle resource = new OverlayBundle(new String[] - { "com.ibm.text.resources.LocaleElements", RESOURCE_BASE }, forLocale); - numberPatterns = resource.getStringArray("NumberPatterns"); - // Update the cache - cachedLocaleData.put(forLocale, numberPatterns); - } - /*Bug 4408066 - Add codes for the new method getIntegerInstance() [Richard/GCL] - */ - int entry = (choice == INTEGERSTYLE) ? NUMBERSTYLE : choice; //[Richard/GCL] - return numberPatterns[entry]; //[Richard/GCL] - } - - public static final String RESOURCE_BASE = "java.text.resources.LocaleElements"; - -//! static ResourceBundle baseBundle = null; -//! -//! public synchronized static final String[] getBaseStringArray(String name) { -//! if (baseBundle == null) { -//! baseBundle = ResourceBundle.getBundle(RESOURCE_BASE); -//! } -//! return baseBundle.getStringArray(name); -//! } - - /** - * First, read in the default serializable data. - * - * Then, if serialVersionOnStream is less than 1, indicating that - * the stream was written by JDK 1.1, - * set the int fields such as maximumIntegerDigits - * to be equal to the byte fields such as maxIntegerDigits, - * since the int fields were not present in JDK 1.1. - * Finally, set serialVersionOnStream back to the maximum allowed value so that - * default serialization will work properly if this object is streamed out again. - * - */ - private void readObject(ObjectInputStream stream) - throws IOException, ClassNotFoundException - { - stream.defaultReadObject(); - if (serialVersionOnStream < 1) { - // Didn't have additional int fields, reassign to use them. - maximumIntegerDigits = maxIntegerDigits; - minimumIntegerDigits = minIntegerDigits; - maximumFractionDigits = maxFractionDigits; - minimumFractionDigits = minFractionDigits; - } - /*Bug 4185761 - Validate the min and max fields [Richard/GCL] - */ - if (minimumIntegerDigits > maximumIntegerDigits || - minimumFractionDigits > maximumFractionDigits || - minimumIntegerDigits < 0 || minimumFractionDigits < 0) { - throw new InvalidObjectException("Digit count range invalid"); - } - serialVersionOnStream = currentSerialVersion; - } - - /** - * Write out the default serializable data, after first setting - * the byte fields such as maxIntegerDigits to be - * equal to the int fields such as maximumIntegerDigits - * (or to Byte.MAX_VALUE, whichever is smaller), for compatibility - * with the JDK 1.1 version of the stream format. - * - */ - private void writeObject(ObjectOutputStream stream) - throws IOException - { - maxIntegerDigits = (maximumIntegerDigits > Byte.MAX_VALUE) ? Byte.MAX_VALUE : - (byte)maximumIntegerDigits; - minIntegerDigits = (minimumIntegerDigits > Byte.MAX_VALUE) ? Byte.MAX_VALUE : - (byte)minimumIntegerDigits; - maxFractionDigits = (maximumFractionDigits > Byte.MAX_VALUE) ? Byte.MAX_VALUE : - (byte)maximumFractionDigits; - minFractionDigits = (minimumFractionDigits > Byte.MAX_VALUE) ? Byte.MAX_VALUE : - (byte)minimumFractionDigits; - stream.defaultWriteObject(); - } - - /** - * Cache to hold the NumberPatterns of a Locale. - */ - private static final Hashtable cachedLocaleData = new Hashtable(3); - - // Constants used by factory methods to specify a style of format. - private static final int NUMBERSTYLE = 0; - private static final int CURRENCYSTYLE = 1; - private static final int PERCENTSTYLE = 2; - private static final int SCIENTIFICSTYLE = 3; - /*Bug 4408066 - Add Field for the new method getIntegerInstance() [Richard/GCL] - */ - private static final int INTEGERSTYLE = 4; - - /** - * True if the the grouping (i.e. thousands) separator is used when - * formatting and parsing numbers. - * - * @serial - * @see #isGroupingUsed - */ - private boolean groupingUsed = true; - - /** - * The maximum number of digits allowed in the integer portion of a - * number. maxIntegerDigits must be greater than or equal to - * minIntegerDigits. - *

- * Note: This field exists only for serialization - * compatibility with JDK 1.1. In JDK 1.2 and higher, the new - * int field maximumIntegerDigits is used instead. - * When writing to a stream, maxIntegerDigits is set to - * maximumIntegerDigits or Byte.MAX_VALUE, - * whichever is smaller. When reading from a stream, this field is used - * only if serialVersionOnStream is less than 1. - * - * @serial - * @see #getMaximumIntegerDigits - */ - private byte maxIntegerDigits = 40; - - /** - * The minimum number of digits allowed in the integer portion of a - * number. minimumIntegerDigits must be less than or equal to - * maximumIntegerDigits. - *

- * Note: This field exists only for serialization - * compatibility with JDK 1.1. In JDK 1.2 and higher, the new - * int field minimumIntegerDigits is used instead. - * When writing to a stream, minIntegerDigits is set to - * minimumIntegerDigits or Byte.MAX_VALUE, - * whichever is smaller. When reading from a stream, this field is used - * only if serialVersionOnStream is less than 1. - * - * @serial - * @see #getMinimumIntegerDigits - */ - private byte minIntegerDigits = 1; - - /** - * The maximum number of digits allowed in the fractional portion of a - * number. maximumFractionDigits must be greater than or equal to - * minimumFractionDigits. - *

- * Note: This field exists only for serialization - * compatibility with JDK 1.1. In JDK 1.2 and higher, the new - * int field maximumFractionDigits is used instead. - * When writing to a stream, maxFractionDigits is set to - * maximumFractionDigits or Byte.MAX_VALUE, - * whichever is smaller. When reading from a stream, this field is used - * only if serialVersionOnStream is less than 1. - * - * @serial - * @see #getMaximumFractionDigits - */ - private byte maxFractionDigits = 3; // invariant, >= minFractionDigits - - /** - * The minimum number of digits allowed in the fractional portion of a - * number. minimumFractionDigits must be less than or equal to - * maximumFractionDigits. - *

- * Note: This field exists only for serialization - * compatibility with JDK 1.1. In JDK 1.2 and higher, the new - * int field minimumFractionDigits is used instead. - * When writing to a stream, minFractionDigits is set to - * minimumFractionDigits or Byte.MAX_VALUE, - * whichever is smaller. When reading from a stream, this field is used - * only if serialVersionOnStream is less than 1. - * - * @serial - * @see #getMinimumFractionDigits - */ - private byte minFractionDigits = 0; - - /** - * True if this format will parse numbers as integers only. - * - * @serial - * @see #isParseIntegerOnly - */ - private boolean parseIntegerOnly = false; - - // new fields for 1.2. byte is too small for integer digits. - - /** - * The maximum number of digits allowed in the integer portion of a - * number. maximumIntegerDigits must be greater than or equal to - * minimumIntegerDigits. - * - * @serial - * @see #getMaximumIntegerDigits - */ - private int maximumIntegerDigits = 40; - - /** - * The minimum number of digits allowed in the integer portion of a - * number. minimumIntegerDigits must be less than or equal to - * maximumIntegerDigits. - * - * @serial - * @see #getMinimumIntegerDigits - */ - private int minimumIntegerDigits = 1; - - /** - * The maximum number of digits allowed in the fractional portion of a - * number. maximumFractionDigits must be greater than or equal to - * minimumFractionDigits. - * - * @serial - * @see #getMaximumFractionDigits - */ - private int maximumFractionDigits = 3; // invariant, >= minFractionDigits - - /** - * The minimum number of digits allowed in the fractional portion of a - * number. minimumFractionDigits must be less than or equal to - * maximumFractionDigits. - * - * @serial - * @see #getMinimumFractionDigits - */ - private int minimumFractionDigits = 0; - - static final int currentSerialVersion = 1; - - /** - * Describes the version of NumberFormat present on the stream. - * Possible values are: - *

    - *
  • 0 (or uninitialized): the JDK 1.1 version of the stream format. - * In this version, the int fields such as - * maximumIntegerDigits were not present, and the byte - * fields such as maxIntegerDigits are used instead. - * - *
  • 1: the JDK 1.2 version of the stream format. The values of the - * byte fields such as maxIntegerDigits are ignored, - * and the int fields such as maximumIntegerDigits - * are used instead. - *
- * When streaming out a NumberFormat, the most recent format - * (corresponding to the highest allowable serialVersionOnStream) - * is always written. - * - * @serial - */ - private int serialVersionOnStream = currentSerialVersion; - - // Removed "implements Cloneable" clause. Needs to update serialization - // ID for backward compatibility. - static final long serialVersionUID = -2308460125733713944L; -} diff --git a/icu4j/src/com/ibm/text/Quantifier.java b/icu4j/src/com/ibm/text/Quantifier.java deleted file mode 100755 index af840c5cf9..0000000000 --- a/icu4j/src/com/ibm/text/Quantifier.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/Quantifier.java,v $ - * $Date: 2001/11/29 22:31:18 $ - * $Revision: 1.5 $ - * - ***************************************************************************************** - */ -package com.ibm.text; -import com.ibm.util.Utility; - -class Quantifier implements UnicodeMatcher { - - private UnicodeMatcher matcher; - - private int minCount; - - private int maxCount; - - /** - * Maximum count a quantifier can have. - */ - public static final int MAX = Integer.MAX_VALUE; - - public Quantifier(UnicodeMatcher theMatcher, - int theMinCount, int theMaxCount) { - if (theMatcher == null || minCount < 0 || maxCount < 0 || minCount > maxCount) { - throw new IllegalArgumentException(); - } - matcher = theMatcher; - minCount = theMinCount; - maxCount = theMaxCount; - } - - /** - * Implement UnicodeMatcher API. - */ - public int matches(Replaceable text, - int[] offset, - int limit, - boolean incremental) { - int start = offset[0]; - int count = 0; - while (count < maxCount) { - int pos = offset[0]; - int m = matcher.matches(text, offset, limit, incremental); - if (m == U_MATCH) { - ++count; - if (pos == offset[0]) { - // If offset has not moved we have a zero-width match. - // Don't keep matching it infinitely. - break; - } - } else if (incremental && m == U_PARTIAL_MATCH) { - return U_PARTIAL_MATCH; - } else { - break; - } - } - if (incremental && offset[0] == limit) { - return U_PARTIAL_MATCH; - } - if (count >= minCount) { - return U_MATCH; - } - offset[0] = start; - return U_MISMATCH; - } - - /** - * Implement UnicodeMatcher API - */ - public String toPattern(boolean escapeUnprintable) { - StringBuffer result = new StringBuffer(); - result.append(matcher.toPattern(escapeUnprintable)); - if (minCount == 0) { - if (maxCount == 1) { - return result.append('?').toString(); - } else if (maxCount == MAX) { - return result.append('*').toString(); - } - // else fall through - } else if (minCount == 1 && maxCount == MAX) { - return result.append('+').toString(); - } - result.append('{'); - Utility.appendNumber(result, minCount); - result.append(','); - if (maxCount != MAX) { - Utility.appendNumber(result, maxCount); - } - result.append('}'); - return result.toString(); - } - - /** - * Implement UnicodeMatcher API - */ - public boolean matchesIndexValue(int v) { - return (minCount == 0) || matcher.matchesIndexValue(v); - } - - /** - * Implementation of UnicodeMatcher API. Union the set of all - * characters that may be matched by this object into the given - * set. - * @param toUnionTo the set into which to union the source characters - * @return a reference to toUnionTo - */ - public UnicodeSet getMatchSet(UnicodeSet toUnionTo) { - if (maxCount > 0) { - matcher.getMatchSet(toUnionTo); - } - return toUnionTo; - } -} - -//eof diff --git a/icu4j/src/com/ibm/text/RemoveTransliterator.java b/icu4j/src/com/ibm/text/RemoveTransliterator.java deleted file mode 100755 index 0b785d673e..0000000000 --- a/icu4j/src/com/ibm/text/RemoveTransliterator.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/RemoveTransliterator.java,v $ - * $Date: 2001/11/29 17:54:31 $ - * $Revision: 1.5 $ - * - ***************************************************************************************** - */ -package com.ibm.text; -import java.util.*; - -/** - * A transliterator that removes characters. This is useful in conjunction - * with a filter. - */ -class RemoveTransliterator extends Transliterator { - - /** - * ID for this transliterator. - */ - private static String _ID = "Any-Remove"; - - /** - * System registration hook. - */ - static void register() { - Transliterator.registerFactory(_ID, new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new RemoveTransliterator(); - } - }); - Transliterator.registerSpecialInverse("Remove", "Null", false); - } - - /** - * Constructs a transliterator. - */ - public RemoveTransliterator() { - super(_ID, null); - } - - /** - * Implements {@link Transliterator#handleTransliterate}. - */ - protected void handleTransliterate(Replaceable text, - Position index, boolean incremental) { - // Our caller (filteredTransliterate) has already narrowed us - // to an unfiltered run. Delete it. - text.replace(index.start, index.limit, ""); - int len = index.limit - index.start; - index.contextLimit -= len; - index.limit -= len; - } -} diff --git a/icu4j/src/com/ibm/text/Replaceable.java b/icu4j/src/com/ibm/text/Replaceable.java deleted file mode 100755 index f0f635f99c..0000000000 --- a/icu4j/src/com/ibm/text/Replaceable.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/Replaceable.java,v $ - * $Date: 2002/02/09 01:01:47 $ - * $Revision: 1.5 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -/** - * Replaceable is an interface that supports the - * operation of replacing a substring with another piece of text. - * Replaceable is needed in order to change a piece of - * text while retaining style attributes. For example, if the string - * "the bold font" has range (4, 8) replaced with "strong", - * then it becomes "the strong font". - * - *

If a subclass supports styles, then typically the behavior is the following: - *

    - *
  • Set the styles to the style of the first character replaced
  • - *
  • If no characters are replaced, use the style of the previous - * character
  • - *
  • If there is no previous character (i.e. start == 0), use the following - * character
  • - *
  • If there is no following character (i.e. the replaceable was empty), a - * default style.
    - *
  • - *
- * If this is not the behavior, the subclass should document any differences. - * - *

Copyright © IBM Corporation 1999. All rights reserved. - * - * @author Alan Liu - * @version $RCSfile: Replaceable.java,v $ $Revision: 1.5 $ $Date: 2002/02/09 01:01:47 $ - */ -public interface Replaceable { - /** - * Return the number of characters in the text. - * @return number of characters in text - */ - int length(); - - /** - * Return the character at the given offset into the text. - * @param offset an integer between 0 and length()-1 - * inclusive - * @return character of text at given offset - */ - char charAt(int offset); - - /** - * Return the 32-bit code point at the given 16-bit offset into - * the text. This assumes the text is stored as 16-bit code units - * with surrogate pairs intermixed. If the offset of a leading or - * trailing code unit of a surrogate pair is given, return the - * code point of the surrogate pair. - * - *

Most subclasses can return - * com.ibm.text.UTF16.charAt(this, offset). - * @param offset an integer between 0 and length()-1 - * inclusive - * @return 32-bit code point of text at given offset - */ - int char32At(int offset); - - /** - * Copies characters from this object into the destination - * character array. The first character to be copied is at index - * srcStart; the last character to be copied is at - * index srcLimit-1 (thus the total number of - * characters to be copied is srcLimit-srcStart). The - * characters are copied into the subarray of dst - * starting at index dstStart and ending at index - * dstStart + (srcLimit-srcStart) - 1. - * - * @param srcStart the beginning index to copy, inclusive; 0 - * <= start <= limit. - * @param srcLimit the ending index to copy, exclusive; - * start <= limit <= length(). - * @param dst the destination array. - * @param dstStart the start offset in the destination array. - */ - void getChars(int srcStart, int srcLimit, char dst[], int dstStart); - - /** - * Replace a substring of this object with the given text. - * - *

Subclasses must ensure that if the text between start and - * limit is equal to the replacement text, that replace has no - * effect. That is, any out-of-band information such as styles - * should be unaffected. In addition, subclasses are encourage to - * check for initial and trailing identical characters, and make a - * smaller replacement if possible. This will preserve as much - * style information as possible. - * @param start the beginning index, inclusive; 0 <= start - * <= limit. - * @param limit the ending index, exclusive; start <= limit - * <= length(). - * @param text the text to replace characters start - * to limit - 1 - */ - void replace(int start, int limit, String text); - - /** - * Replace a substring of this object with the given text. - * - *

Subclasses must ensure that if the text between start and - * limit is equal to the replacement text, that replace has no - * effect. That is, any out-of-band information such as styles - * should be unaffected. In addition, subclasses are encourage to - * check for initial and trailing identical characters, and make a - * smaller replacement if possible. This will preserve as much - * style information as possible. - * @param start the beginning index, inclusive; 0 <= start - * <= limit. - * @param limit the ending index, exclusive; start <= limit - * <= length(). - * @param chars the text to replace characters start - * to limit - 1 - * @param charsStart the beginning index into chars, - * inclusive; 0 <= start <= limit. - * @param charsLen the number of characters of chars. - */ - void replace(int start, int limit, char[] chars, - int charsStart, int charsLen); - // Note: We use length rather than limit to conform to StringBuffer - // and System.arraycopy. - - /** - * Copy a substring of this object, retaining attribute (out-of-band) - * information. This method is used to duplicate or reorder substrings. - * The destination index must not overlap the source range. - * Implementations that do not care about maintaining out-of-band - * information or performance during copying may use the naive - * implementation: - * - *

 char[] text = new char[limit - start];
-     * getChars(start, limit, text, 0);
-     * replace(dest, dest, text, 0, limit - start);
- * - * @param start the beginning index, inclusive; 0 <= start <= - * limit. - * @param limit the ending index, exclusive; start <= limit <= - * length(). - * @param dest the destination index. The characters from - * start..limit-1 will be copied to dest. - * Implementations of this method may assume that dest <= start || - * dest >= limit. - */ - void copy(int start, int limit, int dest); -} diff --git a/icu4j/src/com/ibm/text/ReplaceableString.java b/icu4j/src/com/ibm/text/ReplaceableString.java deleted file mode 100755 index bdedc416e1..0000000000 --- a/icu4j/src/com/ibm/text/ReplaceableString.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/ReplaceableString.java,v $ - * $Date: 2002/02/09 01:01:47 $ - * $Revision: 1.8 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import com.ibm.util.Utility; - -/** - * ReplaceableString is an adapter class that implements the - * Replaceable API around an ordinary StringBuffer. - * - *

Note: This class does not support attributes and is not - * intended for general use. Most clients will need to implement - * {@link Replaceable} in their text representation class. - * - *

Copyright © IBM Corporation 1999. All rights reserved. - * - * @see Replaceable - * @author Alan Liu - * @version $RCSfile: ReplaceableString.java,v $ $Revision: 1.8 $ $Date: 2002/02/09 01:01:47 $ - */ -public class ReplaceableString implements Replaceable { - private StringBuffer buf; - - private static final String COPYRIGHT = - "\u00A9 IBM Corporation 1999. All rights reserved."; - - /** - * Construct a new object with the given initial contents. - * @param str initial contents - */ - public ReplaceableString(String str) { - buf = new StringBuffer(str); - } - - /** - * Construct a new object using buf for internal - * storage. The contents of buf at the time of - * construction are used as the initial contents. Note! - * Modifications to buf will modify this object, and - * vice versa. - * @param buf object to be used as internal storage - */ - public ReplaceableString(StringBuffer buf) { - this.buf = buf; - } - - /** - * Construct a new empty object. - */ - public ReplaceableString() { - buf = new StringBuffer(); - } - - /** - * Return the contents of this object as a String. - * @return string contents of this object - */ - public String toString() { - return buf.toString(); - } - - /** - * Return a substring of the given string. - */ - public String substring(int start, int limit) { - return buf.substring(start, limit); - } - - /** - * Return the number of characters contained in this object. - * Replaceable API. - */ - public int length() { - return buf.length(); - } - - /** - * Return the character at the given position in this object. - * Replaceable API. - * @param offset offset into the contents, from 0 to - * length() - 1 - */ - public char charAt(int offset) { - return buf.charAt(offset); - } - - /** - * Return the 32-bit code point at the given 16-bit offset into - * the text. This assumes the text is stored as 16-bit code units - * with surrogate pairs intermixed. If the offset of a leading or - * trailing code unit of a surrogate pair is given, return the - * code point of the surrogate pair. - * @param offset an integer between 0 and length()-1 - * inclusive - * @return 32-bit code point of text at given offset - */ - public int char32At(int offset) { - return UTF16.charAt(buf, offset); - } - - /** - * Copies characters from this object into the destination - * character array. The first character to be copied is at index - * srcStart; the last character to be copied is at - * index srcLimit-1 (thus the total number of - * characters to be copied is srcLimit-srcStart). The - * characters are copied into the subarray of dst - * starting at index dstStart and ending at index - * dstStart + (srcLimit-srcStart) - 1. - * - * @param srcStart the beginning index to copy, inclusive; 0 - * <= start <= limit. - * @param srcLimit the ending index to copy, exclusive; - * start <= limit <= length(). - * @param dst the destination array. - * @param dstStart the start offset in the destination array. - */ - public void getChars(int srcStart, int srcLimit, char dst[], int dstStart) { - Utility.getChars(buf, srcStart, srcLimit, dst, dstStart); - } - - /** - * Replace zero or more characters with new characters. - * Replaceable API. - * @param start the beginning index, inclusive; 0 <= start - * <= limit. - * @param limit the ending index, exclusive; start <= limit - * <= length(). - * @param text new text to replace characters start to - * limit - 1 - */ - public void replace(int start, int limit, String text) { - buf.replace(start, limit, text); - } - - /** - * Replace a substring of this object with the given text. - * @param start the beginning index, inclusive; 0 <= start - * <= limit. - * @param limit the ending index, exclusive; start <= limit - * <= length(). - * @param chars the text to replace characters start - * to limit - 1 - * @param charsStart the beginning index into chars, - * inclusive; 0 <= start <= limit. - * @param charsLen the number of characters of chars. - */ - public void replace(int start, int limit, char[] chars, - int charsStart, int charsLen) { - buf.delete(start, limit); - buf.insert(start, chars, charsStart, charsLen); - } - - /** - * Copy a substring of this object, retaining attribute (out-of-band) - * information. This method is used to duplicate or reorder substrings. - * The destination index must not overlap the source range. - * - * @param start the beginning index, inclusive; 0 <= start <= - * limit. - * @param limit the ending index, exclusive; start <= limit <= - * length(). - * @param dest the destination index. The characters from - * start..limit-1 will be copied to dest. - * Implementations of this method may assume that dest <= start || - * dest >= limit. - */ - public void copy(int start, int limit, int dest) { - if (start == limit && start >= 0 && start <= buf.length()) { - return; - } - char[] text = new char[limit - start]; - getChars(start, limit, text, 0); - replace(dest, dest, text, 0, limit - start); - } -} diff --git a/icu4j/src/com/ibm/text/RuleBasedBreakIterator.java b/icu4j/src/com/ibm/text/RuleBasedBreakIterator.java deleted file mode 100755 index 32872810c4..0000000000 --- a/icu4j/src/com/ibm/text/RuleBasedBreakIterator.java +++ /dev/null @@ -1,3081 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/RuleBasedBreakIterator.java,v $ - * $Date: 2001/11/14 00:27:40 $ - * $Revision: 1.15 $ - * - ***************************************************************************************** - */ - - -//ibm.597 -/* - * @(#)RuleBasedBreakIterator.java 1.3 99/04/07 - * - * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved - * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved - * - * The original version of this source code and documentation - * is copyrighted and owned by Taligent, Inc., a wholly-owned - * subsidiary of IBM. These materials are provided under terms - * of a License Agreement between Taligent and Sun. This technology - * is protected by multiple US and International patents. - * - * This notice and attribution to Taligent may not be removed. - * Taligent is a registered trademark of Taligent, Inc. - */ - -package com.ibm.text; - -import com.ibm.util.CompactByteArray; -import com.ibm.util.Utility; -import java.util.Vector; -import java.util.Stack; -import java.util.Hashtable; -import java.util.Enumeration; -import java.text.CharacterIterator; -import java.text.StringCharacterIterator; - -import java.io.*; - -/** - *

A subclass of BreakIterator whose behavior is specified using a list of rules.

- * - *

There are two kinds of rules, which are separated by semicolons: substitutions - * and regular expressions.

- * - *

A substitution rule defines a name that can be used in place of an expression. It - * consists of a name, an equals sign, and an expression. (There can be no whitespace on - * either side of the equals sign.) To keep its syntactic meaning intact, the expression - * must be enclosed in parentheses or square brackets. A substitution is visible after its - * definition, and is filled in using simple textual substitution (when a substitution is - * used, its name is enclosed in curly braces. The curly braces are optional in the - * substition's definition). Substitution definitions can contain other substitutions, as - * long as those substitutions have been defined first. Substitutions are generally used to - * make the regular expressions (which can get quite complex) shorter and easier to read. - * They typically define either character categories or commonly-used subexpressions.

- * - *

There is one special substitution.  If the description defines a substitution - * called "_ignore_", the expression must be a [] expression, and the - * expression defines a set of characters (the "ignore characters") that - * will be transparent to the BreakIterator.  A sequence of characters will break the - * same way it would if any ignore characters it contains are taken out.  Break - * positions never occur before ignore characters, except when the character before the - * ignore characters is a line or paragraph terminator.

- * - *

A regular expression uses a syntax similar to the normal Unix regular-expression - * syntax, and defines a sequence of characters to be kept together. With one significant - * exception, the iterator uses a longest-possible-match algorithm when matching text to regular - * expressions. The iterator also treats descriptions containing multiple regular expressions - * as if they were ORed together (i.e., as if they were separated by |).

- * - *

The special characters recognized by the regular-expression parser are as follows:

- * - *
- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
*Specifies that the expression preceding the asterisk may occur any number - * of times (including not at all).
+Specifies that the expression preceding the asterisk may occur one or - * more times, but must occur at least once.
?Specifies that the expression preceding the asterisk may occur once - * or not at all (i.e., it makes the preceding expression optional).
()Encloses a sequence of characters. If followed by * or +, the - * sequence repeats. If followed by ?, the sequence is optional. Otherwise, the - * parentheses are just a grouping device and a way to delimit the ends of expressions - * containing |.
|Separates two alternative sequences of characters.  Either one - * sequence or the other, but not both, matches this expression.  The | character can - * only occur inside ().
.Matches any character.
*?Specifies a non-greedy asterisk.  *? works the same way as *, except - * when there is overlap between the last group of characters in the expression preceding the - * * and the first group of characters following the *.  When there is this kind of - * overlap, * will match the longest sequence of characters that match the expression before - * the *, and *? will match the shortest sequence of characters matching the expression - * before the *?.  For example, if you have "xxyxyyyxyxyxxyxyxyy" in the text, - * "x[xy]*x" will match through to the last x (i.e., "xxyxyyyxyxyxxyxyxyy", - * but "x[xy]*?x" will only match the first two xes ("xxyxyyyxyxyxxyxyxyy").
[]Specifies a group of alternative characters.  A [] expression will - * match any single character that is specified in the [] expression.  For more on the - * syntax of [] expressions, see below.
/Specifies where the break position should go if text matches this - * expression.  (e.g., "[a-z]*/[:Zs:]*[1-0]" will match if the iterator sees a run - * of letters, followed by a run of whitespace, followed by a digit, but the break position - * will actually go before the whitespace).  Expressions that don't contain / put the - * break position at the end of the matching text.
\Escape character.  The \ itself is ignored, but causes the next - * character to be treated as literal character.  This has no effect for many - * characters, but for the characters listed above, this deprives them of their special - * meaning.  (There are no special escape sequences for Unicode characters, or tabs and - * newlines; these are all handled by a higher-level protocol.  In a Java string, - * "\n" will be converted to a literal newline character by the time the - * regular-expression parser sees it.  Of course, this means that \ sequences that are - * visible to the regexp parser must be written as \\ when inside a Java string.)  All - * characters in the ASCII range except for letters, digits, and control characters are - * reserved characters to the parser and must be preceded by \ even if they currently don't - * mean anything.
!If ! appears at the beginning of a regular expression, it tells the regexp - * parser that this expression specifies the backwards-iteration behavior of the iterator, - * and not its normal iteration behavior.  This is generally only used in situations - * where the automatically-generated backwards-iteration behavior doesn't produce - * satisfactory results and must be supplemented with extra client-specified rules.
(all others)All other characters are treated as literal characters, which must match - * the corresponding character(s) in the text exactly.
- *
- * - *

Within a [] expression, a number of other special characters can be used to specify - * groups of characters:

- * - *
- * - * - * - * - * - * - * - * - * - * - * - * - * - *
-Specifies a range of matching characters.  For example - * "[a-p]" matches all lowercase Latin letters from a to p (inclusive).  The - - * sign specifies ranges of continuous Unicode numeric values, not ranges of characters in a - * language's alphabetical order: "[a-z]" doesn't include capital letters, nor does - * it include accented letters such as a-umlaut.
^Inverts the expression. All characters the expression includes are - * excluded, and vice versa. (i.e., it has the effect of saying "all Unicode characters - * except...") This character only has its special meaning when it's the first character - * in the [] expression. (Generally, you only see the ^ character inside a nested [] - * expression used in conjunction with the syntax below.)
(all others)All other characters are treated as literal characters.  (For - * example, "[aeiou]" specifies just the letters a, e, i, o, and u.)
- *
- * - *

[] expressions can nest. There are some other characters that have special meaning only - * when used in conjunction with nester [] expressions:

- * - *
- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *

For a more complete explanation, see http://www.ibm.com/developerworks/unicode/library/boundaries/boundaries.html. - *   For examples, see the resource data (which is annotated).

- * - * @author Richard Gillam - * $RCSfile: RuleBasedBreakIterator.java,v $ $Revision: 1.15 $ $Date: 2001/11/14 00:27:40 $ - */ -public class RuleBasedBreakIterator extends BreakIterator { - - /** - * A token used as a character-category value to identify ignore characters - */ - protected static final byte IGNORE = -1; - - /** - * Special variable used to define ignore characters - */ - private static final String IGNORE_VAR = "_ignore_"; - - /** - * The state number of the starting state - */ - private static final short START_STATE = 1; - - /** - * The state-transition value indicating "stop" - */ - private static final short STOP_STATE = 0; - - /** - * The textual description this iterator was created from - */ - private String description; - - /** - * A table that indexes from character values to character category numbers - */ - private CompactByteArray charCategoryTable = null; - - /** - * The table of state transitions used for forward iteration - */ - private short[] stateTable = null; - - /** - * The table of state transitions used to sync up the iterator with the - * text in backwards and random-access iteration - */ - private short[] backwardsStateTable = null; - - /** - * A list of flags indicating which states in the state table are accepting - * ("end") states - */ - private boolean[] endStates = null; - - /** - * A list of flags indicating which states in the state table are - * lookahead states (states which turn lookahead on and off) - */ - private boolean[] lookaheadStates = null; - - /** - * The number of character categories (and, thus, the number of columns in - * the state tables) - */ - private int numCategories; - - /** - * The character iterator through which this BreakIterator accesses the text - */ - private CharacterIterator text = null; - - //======================================================================= - // constructors - //======================================================================= - - /** - * Constructs a RuleBasedBreakIterator according to the description - * provided. If the description is malformed, throws an - * IllegalArgumentException. Normally, instead of constructing a - * RuleBasedBreakIterator directory, you'll use the factory methods - * on BreakIterator to create one indirectly from a description - * in the framework's resource files. You'd use this when you want - * special behavior not provided by the built-in iterators. - */ - public RuleBasedBreakIterator(String description) { -//System.out.println(">>>RBBI constructor"); - this.description = description; - - // the actual work is done by the Builder class - Builder builder = makeBuilder(); - builder.buildBreakIterator(); -//System.out.println("<<> 8) & 0xff)); - } - else { - out.write((byte)((x >> 8) & 0xff)); - out.write((byte)(x & 0xff)); - } -} - -protected void writeSwappedInt(int x, DataOutputStream out, boolean littleEndian) -throws IOException { - if (littleEndian) { - out.write((byte)(x & 0xff)); - out.write((byte)((x >> 8) & 0xff)); - out.write((byte)((x >> 16) & 0xff)); - out.write((byte)((x >> 24) & 0xff)); - } - else { - out.write((byte)((x >> 24) & 0xff)); - out.write((byte)((x >> 16) & 0xff)); - out.write((byte)((x >> 8) & 0xff)); - out.write((byte)(x & 0xff)); - } -} - - //======================================================================= - // BreakIterator overrides - //======================================================================= - - /** - * Sets the current iteration position to the beginning of the text. - * (i.e., the CharacterIterator's starting offset). - * @return The offset of the beginning of the text. - */ - public int first() { - CharacterIterator t = getText(); - - t.first(); - return t.getIndex(); - } - - /** - * Sets the current iteration position to the end of the text. - * (i.e., the CharacterIterator's ending offset). - * @return The text's past-the-end offset. - */ - public int last() { - CharacterIterator t = getText(); - - // I'm not sure why, but t.last() returns the offset of the last character, - // rather than the past-the-end offset - t.setIndex(t.getEndIndex()); - return t.getIndex(); - } - - /** - * Advances the iterator either forward or backward the specified number of steps. - * Negative values move backward, and positive values move forward. This is - * equivalent to repeatedly calling next() or previous(). - * @param n The number of steps to move. The sign indicates the direction - * (negative is backwards, and positive is forwards). - * @return The character offset of the boundary position n boundaries away from - * the current one. - */ - public int next(int n) { - int result = current(); - while (n > 0) { - result = handleNext(); - --n; - } - while (n < 0) { - result = previous(); - ++n; - } - return result; - } - - /** - * Advances the iterator to the next boundary position. - * @return The position of the first boundary after this one. - */ - public int next() { - return handleNext(); - } - - /** - * Advances the iterator backwards, to the last boundary preceding this one. - * @return The position of the last boundary position preceding this one. - */ - public int previous() { - // if we're already sitting at the beginning of the text, return DONE - CharacterIterator text = getText(); - if (current() == text.getBeginIndex()) { - return BreakIterator.DONE; - } - - // set things up. handlePrevious() will back us up to some valid - // break position before the current position (we back our internal - // iterator up one step to prevent handlePrevious() from returning - // the current position), but not necessarily the last one before - // where we started - int start = current(); - text.previous(); - int lastResult = handlePrevious(); - int result = lastResult; - - // iterate forward from the known break position until we pass our - // starting point. The last break position before the starting - // point is our return value - while (result != BreakIterator.DONE && result < start) { - lastResult = result; - result = handleNext(); - } - - // set the current iteration position to be the last break position - // before where we started, and then return that value - text.setIndex(lastResult); - return lastResult; - } - - /** - * Throw IllegalArgumentException unless begin <= offset < end. - */ - protected static final void checkOffset(int offset, CharacterIterator text) { - if (offset < text.getBeginIndex() || offset > text.getEndIndex()) { - throw new IllegalArgumentException("offset out of bounds"); - } - } - - /** - * Sets the iterator to refer to the first boundary position following - * the specified position. - * @offset The position from which to begin searching for a break position. - * @return The position of the first break after the current position. - */ - public int following(int offset) { - // if the offset passed in is already past the end of the text, - // just return DONE - CharacterIterator text = getText(); - if (offset == text.getEndIndex()) { - return BreakIterator.DONE; - } - checkOffset(offset, text); - - // otherwise, set our internal iteration position (temporarily) - // to the position passed in. If this is the _beginning_ position, - // then we can just use next() to get our return value - text.setIndex(offset); - if (offset == text.getBeginIndex()) { - return handleNext(); - } - - // otherwise, we have to sync up first. Use handlePrevious() to back - // us up to a known break position before the specified position (if - // we can determine that the specified position is a break position, - // we don't back up at all). This may or may not be the last break - // position at or before our starting position. Advance forward - // from here until we've passed the starting position. The position - // we stop on will be the first break position after the specified one. - int result = handlePrevious(); - while (result != BreakIterator.DONE && result <= offset) { - result = handleNext(); - } - return result; - } - - /** - * Sets the iterator to refer to the last boundary position before the - * specified position. - * @offset The position to begin searching for a break from. - * @return The position of the last boundary before the starting position. - */ - public int preceding(int offset) { - // if we start by updating the current iteration position to the - // position specified by the caller, we can just use previous() - // to carry out this operation - CharacterIterator text = getText(); - checkOffset(offset, text); - text.setIndex(offset); - return previous(); - } - - /** - * Returns true if the specfied position is a boundary position. As a side - * effect, leaves the iterator pointing to the first boundary position at - * or after "offset". - * @param offset the offset to check. - * @return True if "offset" is a boundary position. - */ - public boolean isBoundary(int offset) { - CharacterIterator text = getText(); - checkOffset(offset, text); - if (offset == text.getBeginIndex()) { - return true; - } - - // to check whether this is a boundary, we can use following() on the - // position before the specified one and return true if the position we - // get back is the one the user specified - else { - return following(offset - 1) == offset; - } - } - - /** - * Returns the current iteration position. - * @return The current iteration position. - */ - public int current() { - return getText().getIndex(); - } - - /** - * Return a CharacterIterator over the text being analyzed. This version - * of this method returns the actual CharacterIterator we're using internally. - * Changing the state of this iterator can have undefined consequences. If - * you need to change it, clone it first. - * @return An iterator over the text being analyzed. - */ - public CharacterIterator getText() { - // The iterator is initialized pointing to no text at all, so if this - // function is called while we're in that state, we have to fudge an - // an iterator to return. - if (text == null) { - text = new StringCharacterIterator(""); - } - return text; - } - - /** - * Set the iterator to analyze a new piece of text. This function resets - * the current iteration position to the beginning of the text. - * @param newText An iterator over the text to analyze. - */ - public void setText(CharacterIterator newText) { - // Test text to see if we need to wrap it in a SafeCharIterator: - int end = newText.getEndIndex(); - newText.setIndex(end); - if (newText.getIndex() != end) { - // failed - wrap in correct implementation - text = new SafeCharIterator(newText); - } - else { - text = newText; - } - text.first(); - } - - - //======================================================================= - // implementation - //======================================================================= - - /** - * This method is the actual implementation of the next() method. All iteration - * vectors through here. This method initializes the state machine to state 1 - * and advances through the text character by character until we reach the end - * of the text or the state machine transitions to state 0. We update our return - * value every time the state machine passes through a possible end state. - */ - protected int handleNext() { - // if we're already at the end of the text, return DONE. - CharacterIterator text = getText(); - if (text.getIndex() == text.getEndIndex()) { - return BreakIterator.DONE; - } - - // no matter what, we always advance at least one character forward - int result = text.getIndex() + 1; - int lookaheadResult = 0; - - // begin in state 1 - int state = START_STATE; - int category; - char c = text.current(); - char lastC = c; - int lastCPos = 0; - - // if the first character in this segment is an ignore character (which can happen - // when it's either the first character in the file or follows a mandatory break - // character), and the first non-ignore character isn't a glue character, always - // put a break between the ignore characters and the rest of the text - if (lookupCategory(c) == IGNORE) { - while (lookupCategory(c) == IGNORE) - c = text.next(); - - if (Character.getType(c) == Character.NON_SPACING_MARK || Character.getType(c) - == Character.ENCLOSING_MARK) { - return text.getIndex(); - } - } - - // loop until we reach the end of the text or transition to state 0 - while (c != CharacterIterator.DONE && state != STOP_STATE) { - - // look up the current character's character category (which tells us - // which column in the state table to look at) - category = lookupCategory(c); - - // if the character isn't an ignore character, look up a state - // transition in the state table - if (category != IGNORE) { - state = lookupState(state, category); - } - - // if the state we've just transitioned to is a lookahead state, - // (but not also an end state), save its position. If it's - // both a lookahead state and an end state, update the break position - // to the last saved lookup-state position - if (lookaheadStates[state]) { - if (endStates[state]) { - if (lookaheadResult > 0) { - result = lookaheadResult; - } - else { - result = text.getIndex() + 1; - } - } - else { - lookaheadResult = text.getIndex() + 1; - } - } - - // otherwise, if the state we've just transitioned to is an accepting - // state, update the break position to be the current iteration position - else { - if (endStates[state]) { - result = text.getIndex() + 1; - } - } - - // keep track of the last "real" character we saw. If this character isn't an - // ignore character, take note of it and its position in the text - if (category != IGNORE && state != STOP_STATE) { - lastC = c; - lastCPos = text.getIndex(); - } - c = text.next(); - } - - // if we've run off the end of the text, and the very last character took us into - // a lookahead state, advance the break position to the lookahead position - // (the theory here is that if there are no characters at all after the lookahead - // position, that always matches the lookahead criteria) - if (c == CharacterIterator.DONE && lookaheadResult == text.getEndIndex()) { - result = lookaheadResult; - } - - // if the last character we saw before the one that took us into the stop state - // was a mandatory breaking character, then the break position goes right after it - // (this is here so that breaks come before, rather than after, a string of - // ignore characters when they follow a mandatory break character) - else if ("\n\r\f\u2028\u2029".indexOf(lastC) != -1) { - result = lastCPos + 1; - } - - text.setIndex(result); - return result; - } - - /** - * This method backs the iterator back up to a "safe position" in the text. - * This is a position that we know, without any context, must be a break position. - * The various calling methods then iterate forward from this safe position to - * the appropriate position to return. (For more information, see the description - * of buildBackwardsStateTable() in RuleBasedBreakIterator.Builder.) - */ - protected int handlePrevious() { - CharacterIterator text = getText(); - int state = START_STATE; - int category = 0; - int lastCategory = 0; - char c = text.current(); - - // loop until we reach the beginning of the text or transition to state 0 - while (c != CharacterIterator.DONE && state != STOP_STATE) { -//System.out.print(" " + text.getIndex()); - - // save the last character's category and look up the current - // character's category - lastCategory = category; - category = lookupCategory(c); - - // if the current character isn't an ignore character, look up a - // state transition in the backwards state table - if (category != IGNORE) { - state = lookupBackwardState(state, category); - } - - // then advance one character backwards - c = text.previous(); - } - - // if we didn't march off the beginning of the text, we're either one or two - // positions away from the real break position. (One because of the call to - // previous() at the end of the loop above, and another because the character - // that takes us into the stop state will always be the character BEFORE - // the break position.) - if (c != CharacterIterator.DONE) { - if (lastCategory != IGNORE) { - text.setIndex(text.getIndex() + 2); - } - else { - text.next(); - } - } -//System.out.print(","); - return text.getIndex(); - } - -//static int visitedChars = 0; - /** - * Looks up a character's category (i.e., its category for breaking purposes, - * not its Unicode category) - */ - protected int lookupCategory(char c) { -//++visitedChars; - return charCategoryTable.elementAt(c); - } - -/* -static void printVisitedCharCount() { -System.out.println("Total number of characters visited = " + visitedChars); -visitedChars = 0; -} -*/ - - /** - * Given a current state and a character category, looks up the - * next state to transition to in the state table. - */ - protected int lookupState(int state, int category) { - return stateTable[state * numCategories + category]; - } - - /** - * Given a current state and a character category, looks up the - * next state to transition to in the backwards state table. - */ - protected int lookupBackwardState(int state, int category) { - return backwardsStateTable[state * numCategories + category]; - } - - /** - * This is a helper function for computing the intersection of - * two UnicodeSet objects. - * @param a, b the two UnicodeSets to intersect - * @return a new UnicodeSet which is the intersection of a and b - */ - private static UnicodeSet intersection(UnicodeSet a, UnicodeSet b) - { - UnicodeSet result = new UnicodeSet(a); - - result.retainAll(b); - - return result; - } - - //======================================================================= - // RuleBasedBreakIterator.Builder - //======================================================================= - /** - * The Builder class has the job of constructing a RuleBasedBreakIterator from a - * textual description. A Builder is constructed by RuleBasedBreakIterator's - * constructor, which uses it to construct the iterator itself and then throws it - * away. - *

The construction logic is separated out into its own class for two primary - * reasons: - *

  • The construction logic is quite sophisticated and large. Separating it - * out into its own class means the code must only be loaded into memory while a - * RuleBasedBreakIterator is being constructed, and can be purged after that. - *
  • There is a fair amount of state that must be maintained throughout the - * construction process that is not needed by the iterator after construction. - * Separating this state out into another class prevents all of the functions that - * construct the iterator from having to have really long parameter lists, - * (hopefully) contributing to readability and maintainability.
- *

It'd be really nice if this could be an independent class rather than an - * inner class, because that would shorten the source file considerably, but - * making Builder an inner class of RuleBasedBreakIterator allows it direct access - * to RuleBasedBreakIterator's private members, which saves us from having to - * provide some kind of "back door" to the Builder class that could then also be - * used by other classes. - */ - protected class Builder { - /** - * A temporary holding place used for calculating the character categories. - * This object contains UnicodeSet objects. - */ - protected Vector categories = null; - - /** - * A table used to map parts of regexp text to lists of character categories, - * rather than having to figure them out from scratch each time - */ - protected Hashtable expressions = null; - - /** - * A temporary holding place for the list of ignore characters - */ - protected UnicodeSet ignoreChars = null; - - /** - * A temporary holding place where the forward state table is built - */ - protected Vector tempStateTable = null; - - /** - * A list of all the states that have to be filled in with transitions to the - * next state that is created. Used when building the state table from the - * regular expressions. - */ - protected Vector decisionPointList = null; - - /** - * A stack for holding decision point lists. This is used to handle nested - * parentheses and braces in regexps. - */ - protected Stack decisionPointStack = null; - - /** - * A list of states that loop back on themselves. Used to handle .*? - */ - protected Vector loopingStates = null; - - /** - * Looping states actually have to be backfilled later in the process - * than everything else. This is where a the list of states to backfill - * is accumulated. This is also used to handle .*? - */ - protected Vector statesToBackfill = null; - - /** - * A list mapping pairs of state numbers for states that are to be combined - * to the state number of the state representing their combination. Used - * in the process of making the state table deterministic to prevent - * infinite recursion. - */ - protected Vector mergeList = null; - - /** - * A flag that is used to indicate when the list of looping states can - * be reset. - */ - protected boolean clearLoopingStates = false; - - /** - * A bit mask used to indicate a bit in the table's flags column that marks a - * state as an accepting state. - */ - protected static final int END_STATE_FLAG = 0x8000; - - /** - * A bit mask used to indicate a bit in the table's flags column that marks a - * state as one the builder shouldn't loop to any looping states - */ - protected static final int DONT_LOOP_FLAG = 0x4000; - - /** - * A bit mask used to indicate a bit in the table's flags column that marks a - * state as a lookahead state. - */ - protected static final int LOOKAHEAD_STATE_FLAG = 0x2000; - - /** - * A bit mask representing the union of the mask values listed above. - * Used for clearing or masking off the flag bits. - */ - protected static final int ALL_FLAGS = END_STATE_FLAG | LOOKAHEAD_STATE_FLAG - | DONT_LOOP_FLAG; - - /** - * No special construction is required for the Builder. - */ - public Builder() { - } - - /** - * This is the main function for setting up the BreakIterator's tables. It - * just vectors different parts of the job off to other functions. - */ - public void buildBreakIterator() { - Vector tempRuleList = buildRuleList(description); - buildCharCategories(tempRuleList); - buildStateTable(tempRuleList); - buildBackwardsStateTable(tempRuleList); - } - - /** - * Thus function has three main purposes: - *

  • Perform general syntax checking on the description, so the rest of the - * build code can assume that it's parsing a legal description. - *
  • Split the description into separate rules - *
  • Perform variable-name substitutions (so that no one else sees variable names) - *
- */ - private Vector buildRuleList(String description) { - // invariants: - // - parentheses must be balanced: ()[]{}<> - // - nothing can be nested inside {} - // - nothing can be nested inside [] except more []s - // - pairs of ()[]{}<> must not be empty - // - ; can only occur at the outer level - // - | can only appear inside () - // - only one = or / can occur in a single rule - // - = and / cannot both occur in the same rule - // - the right-hand side of a = expression must be enclosed in [] or () - // - * may not occur at the beginning of a rule, nor may it follow - // =, /, (, (, |, }, ;, or * - // - ? may only follow * - // - the rule list must contain at least one / rule - // - no rule may be empty - // - all printing characters in the ASCII range except letters and digits - // are reserved and must be preceded by \ - // - ! may only occur at the beginning of a rule - - // set up a vector to contain the broken-up description (each entry in the - // vector is a separate rule) and a stack for keeping track of opening - // punctuation - Vector tempRuleList = new Vector(); - Stack parenStack = new Stack(); - - int p = 0; - int ruleStart = 0; - char c = '\u0000'; - char lastC = '\u0000'; - char lastOpen = '\u0000'; - boolean haveEquals = false; - boolean havePipe = false; - boolean sawVarName = false; - boolean sawIllegalChar = false; - int illegalCharPos = 0; - final String charsThatCantPrecedeAsterisk = "=/<(|>*+?;\u0000"; - - // if the description doesn't end with a semicolon, tack a semicolon onto the end - if (description.length() != 0 && description.charAt(description.length() - 1) != ';') { - description = description + ";"; - } - - // for each character, do... - while (p < description.length()) { - c = description.charAt(p); - switch (c) { - // if the character is opening punctuation, verify that no nesting - // rules are broken, and push the character onto the stack - case '{': - case '[': - case '(': - if (lastOpen == '{') { - error("Can't nest brackets inside {}", p, description); - } - if (lastOpen == '[' && c != '[') { - error("Can't nest anything in [] but []", p, description); - } - - // if we see { anywhere except on the left-hand side of =, - // we must be seeing a variable name that was never defined - if (c == '{' && (haveEquals || havePipe)) { - error("Unknown variable name", p, description); - } - - lastOpen = c; - parenStack.push(new Character(c)); - if (c == '{') { - sawVarName = true; - } - break; - - // if the character is closing punctuation, verify that it matches the - // last opening punctuation we saw, and that the brackets contain - // something, then pop the stack - case '}': - case ']': - case ')': - char expectedClose = '\u0000'; - switch (lastOpen) { - case '{': - expectedClose = '}'; - break; - case '[': - expectedClose = ']'; - break; - case '(': - expectedClose = ')'; - break; - } - if (c != expectedClose) { - error("Unbalanced parentheses", p, description); - } - if (lastC == lastOpen) { - error("Parens don't contain anything", p, description); - } - parenStack.pop(); - if (!parenStack.empty()) { - lastOpen = ((Character)(parenStack.peek())).charValue(); - } - else { - lastOpen = '\u0000'; - } - - break; - - // if the character is an asterisk, make sure it occurs in a place - // where an asterisk can legally go - case '*': case '+': case '?': - if (charsThatCantPrecedeAsterisk.indexOf(lastC) != -1 - && (c != '?' || lastC != '*')) { - error("Misplaced *, +, or ?", p, description); - } - break; - - // if the character is an equals sign, make sure we haven't seen another - // equals sign or a slash yet - case '=': - if (haveEquals || havePipe) { - error("More than one = or / in rule", p, description); - } - haveEquals = true; - sawIllegalChar = false; - break; - - // if the character is a slash, make sure we haven't seen another slash - // or an equals sign yet - case '/': - if (haveEquals || havePipe) { - error("More than one = or / in rule", p, description); - } - if (sawVarName) { - error("Unknown variable name", p, description); - } - havePipe = true; - break; - - // if the character is an exclamation point, make sure it occurs only - // at the beginning of a rule - case '!': - if (lastC != ';' && lastC != '\u0000') { - error("! can only occur at the beginning of a rule", p, description); - } - break; - - // if the character is a backslash, skip the character that follows it - // (it'll get treated as a literal character) - case '\\': - ++p; - break; - - // we don't have to do anything special on a period - case '.': - break; - - // if the character is a syntax character that can only occur - // inside [], make sure that it does in fact only occur inside [] - // (or in a variable name) - case '^': - case '-': - case ':': - case '&': - if (lastOpen != '[' && lastOpen != '{' && !sawIllegalChar) { - sawIllegalChar = true; - illegalCharPos = p; - } - break; - - // if the character is a semicolon, do the following... - case ';': - // if we saw any illegal characters along the way, throw - // an error - if (sawIllegalChar) { - error("Illegal character", illegalCharPos, description); - } - - // make sure the rule contains something and that there are no - // unbalanced parentheses or brackets - if (lastC == ';' || lastC == '\u0000') { - error("Empty rule", p, description); - } - if (!parenStack.empty()) { - error("Unbalanced parenheses", p, description); - } - - if (parenStack.empty()) { - // if the rule contained an = sign, call processSubstitution() - // to replace the substitution name with the substitution text - // wherever it appears in the description - if (haveEquals) { - description = processSubstitution(description.substring(ruleStart, - p), description, p + 1); - } - else { - // otherwise, check to make sure the rule doesn't reference - // any undefined substitutions - if (sawVarName) { - error("Unknown variable name", p, description); - } - - // then add it to tempRuleList - tempRuleList.addElement(description.substring(ruleStart, p)); - } - - // and reset everything to process the next rule - ruleStart = p + 1; - haveEquals = havePipe = sawVarName = sawIllegalChar = false; - } - break; - - // if the character is a vertical bar, check to make sure that it - // occurs inside a () expression and that the character that precedes - // it isn't also a vertical bar - case '|': - if (lastC == '|') { - error("Empty alternative", p, description); - } - if (parenStack.empty() || lastOpen != '(') { - error("Misplaced |", p, description); - } - break; - - // if the character is anything else (escaped characters are - // skipped and don't make it here), it's an error - default: - if (c >= ' ' && c < '\u007f' && !Character.isLetter(c) - && !Character.isDigit(c) && !sawIllegalChar) { - sawIllegalChar = true; - illegalCharPos = p; - } - break; - } - lastC = c; - ++p; - } - if (tempRuleList.size() == 0) { - error("No valid rules in description", p, description); - } - return tempRuleList; - } - - /** - * This function performs variable-name substitutions. First it does syntax - * checking on the variable-name definition. If it's syntactically valid, it - * then goes through the remainder of the description and does a simple - * find-and-replace of the variable name with its text. (The variable text - * must be enclosed in either [] or () for this to work.) - */ - protected String processSubstitution(String substitutionRule, String description, - int startPos) { - // isolate out the text on either side of the equals sign - String replace; - String replaceWith; - int equalPos = substitutionRule.indexOf('='); - if (substitutionRule.charAt(0) != '$') { - error("Missing '$' on left-hand side of =", startPos, description); - } - replace = substitutionRule.substring(1, equalPos); - replaceWith = substitutionRule.substring(equalPos + 1); - - // check to see whether the substitution name is something we've declared - // to be "special". For RuleBasedBreakIterator itself, this is IGNORE_VAR. - // This function takes care of any extra processing that has to be done - // with "special" substitution names. - handleSpecialSubstitution(replace, replaceWith, startPos, description); - - // perform various other syntax checks on the rule - if (replaceWith.length() == 0) { - error("Nothing on right-hand side of =", startPos, description); - } - if (replace.length() == 0) { - error("Nothing on left-hand side of =", startPos, description); - } - if (!(replaceWith.charAt(0) == '[' && replaceWith.charAt(replaceWith.length() - 1) - == ']') && !(replaceWith.charAt(0) == '(' && replaceWith.charAt( - replaceWith.length() - 1) == ')')) { - error("Illegal right-hand side for =", startPos, description); - } - - // now go through the rest of the description (which hasn't been broken up - // into separate rules yet) and replace every occurrence of the - // substitution name with the substitution body - replace = "$" + replace; - StringBuffer result = new StringBuffer(); - result.append(description.substring(0, startPos)); - int lastPos = startPos; - int pos = description.indexOf(replace, startPos); - while (pos != -1) { - // [liu] Check that the string we've found isn't a redefinition - // of the variable. - if (description.charAt(pos-1) == ';' && - description.charAt(pos + replace.length()) == '=') { - error("Attempt to redefine " + replace, pos, description); - } - result.append(description.substring(lastPos, pos)); - result.append(replaceWith); - lastPos = pos + replace.length(); - pos = description.indexOf(replace, lastPos); - } - result.append(description.substring(lastPos)); - return result.toString(); - } - - /** - * This function defines a protocol for handling substitution names that - * are "special," i.e., that have some property beyond just being - * substitutions. At the RuleBasedBreakIterator level, we have one - * special substitution name, IGNORE_VAR. Subclasses can override this - * function to add more. Any special processing that has to go on beyond - * that which is done by the normal substitution-processing code is done - * here. - */ - protected void handleSpecialSubstitution(String replace, String replaceWith, - int startPos, String description) { - // if we get a definition for a substitution called IGNORE_VAR, it defines - // the ignore characters for the iterator. Check to make sure the expression - // is a [] expression, and if it is, parse it and store the characters off - // to the side. - if (replace.equals(IGNORE_VAR)) { - if (replaceWith.charAt(0) == '(') { - error("Ignore group can't be enclosed in (", startPos, description); - } - ignoreChars = new UnicodeSet(replaceWith, false); - } - } - - /** - * This function builds the character category table. On entry, - * tempRuleList is a vector of break rules that has had variable names substituted. - * On exit, the charCategoryTable data member has been initialized to hold the - * character category table, and tempRuleList's rules have been munged to contain - * character category numbers everywhere a literal character or a [] expression - * originally occurred. - */ - protected void buildCharCategories(Vector tempRuleList) { - int bracketLevel = 0; - int p = 0; - int lineNum = 0; - - // build hash table of every literal character or [] expression in the rule list - // and derive a UnicodeSet object representing the characters each refers to - expressions = new Hashtable(); - while (lineNum < tempRuleList.size()) { - String line = (String)(tempRuleList.elementAt(lineNum)); - p = 0; - while (p < line.length()) { - char c = line.charAt(p); - switch (c) { - // skip over all syntax characters except [ - case '(': case ')': case '*': case '.': case '/': - case '|': case ';': case '?': case '!': case '+': - break; - - // for [, find the matching ] (taking nested [] pairs into account) - // and add the whole expression to the expression list - case '[': - int q = p + 1; - ++bracketLevel; - while (q < line.length() && bracketLevel != 0) { - c = line.charAt(q); - if (c == '[') { - ++bracketLevel; - } - else if (c == ']') { - --bracketLevel; - } - ++q; - } - if (expressions.get(line.substring(p, q)) == null) { - expressions.put(line.substring(p, q), new UnicodeSet(line. - substring(p, q), false)); -//Test.debugPrintln("1. Adding expression: " + line.substring(p, q)); - } - p = q - 1; - break; - - // for \ sequences, just move to the next character and treat - // it as a single character - case '\\': - ++p; - c = line.charAt(p); - // DON'T break; fall through into "default" clause - - // for an isolated single character, add it to the expression list - default: - UnicodeSet s = new UnicodeSet(); - s.add(line.charAt(p)); - expressions.put(line.substring(p, p + 1), s); -//Test.debugPrintln("2. Adding expression: " + line.substring(p, p + 1)); - break; - } - ++p; - } - ++lineNum; - } - - // create the temporary category table (which is a vector of UnicodeSet objects) - categories = new Vector(); - if (ignoreChars != null) { - categories.addElement(ignoreChars); - } - else { - categories.addElement(new UnicodeSet()); - } - ignoreChars = null; - - // this is a hook to allow subclasses to add categories on their own - mungeExpressionList(expressions); - - // Derive the character categories. Go through the existing character categories - // looking for overlap. Any time there's overlap, we create a new character - // category for the characters that overlapped and remove them from their original - // category. At the end, any characters that are left in the expression haven't - // been mentioned in any category, so another new category is created for them. - // For example, if the first expression is [abc], then a, b, and c will be placed - // into a single character category. If the next expression is [bcd], we will first - // remove b and c from their existing category (leaving a behind), create a new - // category for b and c, and then create another new category for d (which hadn't - // been mentioned in the previous expression). - // At no time should a character ever occur in more than one character category. - - // for each expression in the expressions list, do... - Enumeration iter = expressions.elements(); - while (iter.hasMoreElements()) { - // initialize the working char set to the chars in the current expression - UnicodeSet work = new UnicodeSet((UnicodeSet)iter.nextElement()); - - // for each category in the category list, do... - for (int j = categories.size() - 1; !work.isEmpty() && j > 0; j--) { - - // if there's overlap between the current working set of chars - // and the current category... - UnicodeSet cat = (UnicodeSet)(categories.elementAt(j)); - UnicodeSet overlap = intersection(work, cat); - - if (!overlap.isEmpty()) { - // if the current category is not a subset of the current - // working set of characters, then remove the overlapping - // characters from the current category and create a new - // category for them - if (!overlap.equals(cat)) { - cat.removeAll(overlap); - categories.addElement(overlap); - } - - // and always remove the overlapping characters from the current - // working set of characters - work.removeAll(overlap); - } - } - - // if there are still characters left in the working char set, - // add a new category containing them - if (!work.isEmpty()) { - categories.addElement(work); - } - } - - // we have the ignore characters stored in position 0. Make an extra pass through - // the character category list and remove anything from the ignore list that shows - // up in some other category - UnicodeSet allChars = new UnicodeSet(); - for (int i = 1; i < categories.size(); i++) - allChars.addAll((UnicodeSet)(categories.elementAt(i))); - UnicodeSet ignoreChars = (UnicodeSet)(categories.elementAt(0)); - ignoreChars.removeAll(allChars); - - // now that we've derived the character categories, go back through the expression - // list and replace each UnicodeSet object with a String that represents the - // character categories that expression refers to. The String is encoded: each - // character is a character category number (plus 0x100 to avoid confusing them - // with syntax characters in the rule grammar) - iter = expressions.keys(); - while (iter.hasMoreElements()) { - String key = (String)iter.nextElement(); - UnicodeSet cs = (UnicodeSet)expressions.get(key); - StringBuffer cats = new StringBuffer(); - - // for each category... - for (int j = 1; j < categories.size(); j++) { - UnicodeSet cat = new UnicodeSet((UnicodeSet) categories.elementAt(j)); - - // if the current expression contains characters in that category... - if (cs.containsAll(cat)) { - - // then add the encoded category number to the String for this - // expression - cats.append((char)(0x100 + j)); - if (cs.equals(cat)) { - break; - } - } - } - - // once we've finished building the encoded String for this expression, - // replace the UnicodeSet object with it - expressions.put(key, cats.toString()); - } - - // and finally, we turn the temporary category table into a permanent category - // table, which is a CompactByteArray. (we skip category 0, which by definition - // refers to all characters not mentioned specifically in the rules) - charCategoryTable = new CompactByteArray((byte)0); - - // for each category... - for (int i = 0; i < categories.size(); i++) { - UnicodeSet chars = (UnicodeSet)(categories.elementAt(i)); - int n = chars.getRangeCount(); - - // go through the character ranges in the category one by one... - for (int j = 0; j < n; ++j) { - int rangeStart = chars.getRangeStart(j); - - // (ignore anything above the BMP for now...) - if (rangeStart >= 0x10000) { - break; - } - - // and set the corresponding elements in the CompactArray accordingly - if (i != 0) { - charCategoryTable.setElementAt((char)rangeStart, - (char)chars.getRangeEnd(j), (byte)i); - } - - // (category 0 is special-- it's the hiding place for the ignore - // characters, whose real category number in the CompactArray is - // -1 [this is because category 0 contains all characters not - // specifically mentioned anywhere in the rules] ) - else { - charCategoryTable.setElementAt((char)rangeStart, - (char)chars.getRangeEnd(j), IGNORE); - } - } - } - - // once we've populated the CompactArray, compact it - charCategoryTable.compact(); - - // initialize numCategories - numCategories = categories.size(); - } - - protected void mungeExpressionList(Hashtable expressions) { - // empty in the parent class. This function provides a hook for subclasses - // to mess with the character category table. - } - - /** - * This is the function that builds the forward state table. Most of the real - * work is done in parseRule(), which is called once for each rule in the - * description. - */ - private void buildStateTable(Vector tempRuleList) { - // initialize our temporary state table, and fill it with two states: - // state 0 is a dummy state that allows state 1 to be the starting state - // and 0 to represent "stop". State 1 is added here to seed things - // before we start parsing - tempStateTable = new Vector(); - tempStateTable.addElement(new short[numCategories + 1]); - tempStateTable.addElement(new short[numCategories + 1]); - - // call parseRule() for every rule in the rule list (except those which - // start with !, which are actually backwards-iteration rules) - // variable not used int n = tempRuleList.size(); - for (int i = 0; i < tempRuleList.size(); i++) { - String rule = (String)tempRuleList.elementAt(i); - if (rule.charAt(0) != '!') { - parseRule(rule, true); - } - } - - // finally, use finishBuildingStateTable() to minimize the number of - // states in the table and perform some other cleanup work - finishBuildingStateTable(true); -/* -System.out.print("C:\t"); -for (int i = 0; i < numCategories; i++) -System.out.print(Integer.toString(i) + "\t"); -System.out.println(); System.out.print("================================================="); -for (int i = 0; i < stateTable.length; i++) { -if (i % numCategories == 0) { -System.out.println(); -if (endStates[i / numCategories]) -System.out.print("*"); -else -System.out.print(" "); -if (lookaheadStates[i / numCategories]) { -System.out.print("%"); -} -else -System.out.print(" "); -System.out.print(Integer.toString(i / numCategories) + ":\t"); -} -if (stateTable[i] == 0) System.out.print(".\t"); else System.out.print(Integer.toString(stateTable[i]) + "\t"); -} -System.out.println(); -*/ - } - - /** - * This is where most of the work really happens. This routine parses a single - * rule in the rule description, adding and modifying states in the state - * table according to the new expression. The state table is kept deterministic - * throughout the whole operation, although some ugly postprocessing is needed - * to handle the *? token. - */ - private void parseRule(String rule, boolean forward) { - // algorithm notes: - // - The basic idea here is to read successive character-category groups - // from the input string. For each group, you create a state and point - // the appropriate entries in the previous state to it. This produces a - // straight line from the start state to the end state. The ?, +, *, and (|) - // idioms produce branches in this straight line. These branches (states - // that can transition to more than one other state) are called "decision - // points." A list of decision points is kept. This contains a list of - // all states that can transition to the next state to be created. For a - // straight line progression, the only thing in the decision-point list is - // the current state. But if there's a branch, the decision-point list - // will contain all of the beginning points of the branch when the next - // state to be created represents the end point of the branch. A stack is - // used to save decision point lists in the presence of nested parentheses - // and the like. For example, when a { is encountered, the current decision - // point list is saved on the stack and restored when the corresponding } - // is encountered. This way, after the } is read, the decision point list - // will contain both the state right before the } _and_ the state before - // the whole {} expression. Both of these states can transition to the next - // state after the {} expression. - // - one complication arises when we have to stamp a transition value into - // an array cell that already contains one. The updateStateTable() and - // mergeStates() functions handle this case. Their basic approach is to - // create a new state that combines the two states that conflict and point - // at it when necessary. This happens recursively, so if the merged states - // also conflict, they're resolved in the same way, and so on. There are - // a number of tests aimed at preventing infinite recursion. - // - another complication arises with repeating characters. It's somewhat - // ambiguous whether the user wants a greedy or non-greedy match in these cases. - // (e.g., whether "[a-z]*abc" means the SHORTEST sequence of letters ending in - // "abc" or the LONGEST sequence of letters ending in "abc". We've adopted - // the *? to mean "shortest" and * by itself to mean "longest". (You get the - // same result with both if there's no overlap between the repeating character - // group and the group immediately following it.) Handling the *? token is - // rather complicated and involves keeping track of whether a state needs to - // be merged (as described above) or merely overwritten when you update one of - // its cells, and copying the contents of a state that loops with a *? token - // into some of the states that follow it after the rest of the table-building - // process is complete ("backfilling"). - // implementation notes: - // - This function assumes syntax checking has been performed on the input string - // prior to its being passed in here. It assumes that parentheses are - // balanced, all literal characters are enclosed in [] and turned into category - // numbers, that there are no illegal characters or character sequences, and so - // on. Violation of these invariants will lead to undefined behavior. - // - It'd probably be better to use linked lists rather than Vector and Stack - // to maintain the decision point list and stack. I went for simplicity in - // this initial implementation. If performance is critical enough, we can go - // back and fix this later. - // -There are a number of important limitations on the *? token. It does not work - // right when followed by a repeating character sequence (e.g., ".*?(abc)*") - // (although it does work right when followed by a single repeating character). - // It will not always work right when nested in parentheses or braces (although - // sometimes it will). It also will not work right if the group of repeating - // characters and the group of characters that follows overlap partially - // (e.g., "[a-g]*?[e-j]"). None of these capabilites was deemed necessary for - // describing breaking rules we know about, so we left them out for - // expeditiousness. - // - Rules such as "[a-z]*?abc;" will be treated the same as "[a-z]*?aa*bc;"-- - // that is, if the string ends in "aaaabc", the break will go before the first - // "a" rather than the last one. Both of these are limitations in the design - // of RuleBasedBreakIterator and not limitations of the rule parser. - - int p = 0; - int currentState = 1; // don't use state number 0; 0 means "stop" - int lastState = currentState; - String pendingChars = ""; - - decisionPointStack = new Stack(); - decisionPointList = new Vector(); - loopingStates = new Vector(); - statesToBackfill = new Vector(); - - short[] state; - boolean sawEarlyBreak = false; - - // if we're adding rules to the backward state table, mark the initial state - // as a looping state - if (!forward) { - loopingStates.addElement(new Integer(1)); - } - - // put the current state on the decision point list before we start - decisionPointList.addElement(new Integer(currentState)); // we want currentState to - // be 1 here... - currentState = tempStateTable.size() - 1; // but after that, we want it to be - // 1 less than the state number of the next state - while (p < rule.length()) { - char c = rule.charAt(p); - clearLoopingStates = false; - - // this section handles literal characters, escaped characters (which are - // effectively literal characters too), the . token, and [] expressions - if (c == '[' - || c == '\\' - || Character.isLetter(c) - || Character.isDigit(c) - || c < ' ' - || c == '.' - || c >= '\u007f') { - - // if we're not on a period, isolate the expression and look up - // the corresponding category list - if (c != '.') { - int q = p; - - // if we're on a backslash, the expression is the character - // after the backslash - if (c == '\\') { - q = p + 2; - ++p; - } - - // if we're on an opening bracket, scan to the closing bracket - // to isolate the expression - else if (c == '[') { - int bracketLevel = 1; - while (bracketLevel > 0) { - ++q; - c = rule.charAt(q); - if (c == '[') { - ++bracketLevel; - } - else if (c == ']') { - --bracketLevel; - } - else if (c == '\\') { - ++q; - } - } - ++q; - } - - // otherwise, the expression is just the character itself - else { - q = p + 1; - } - - // look up the category list for the expression and store it - // in pendingChars - pendingChars = (String)expressions.get(rule.substring(p, q)); - - // advance the current position past the expression - p = q - 1; - } - - // if the character we're on is a period, we end up down here - else { - int rowNum = ((Integer)decisionPointList.lastElement()).intValue(); - state = (short[])tempStateTable.elementAt(rowNum); - - // if the period is followed by an asterisk, then just set the current - // state to loop back on itself - if (p + 1 < rule.length() && rule.charAt(p + 1) == '*' && state[0] != 0) { - decisionPointList.addElement(new Integer(state[0])); - pendingChars = ""; - ++p; - if (p + 1 < rule.length() && rule.charAt(p + 1) == '?') { -//System.out.println("Saw *?"); - setLoopingStates(decisionPointList, decisionPointList); - ++p; - } -//System.out.println("Saw .*"); - } - - // otherwise, fabricate a category list ("pendingChars") with - // every category in it - else { - StringBuffer temp = new StringBuffer(); - for (int i = 0; i < numCategories; i++) - temp.append((char)(i + 0x100)); - pendingChars = temp.toString(); - } - } - - // we'll end up in here for all expressions except for .*, which is - // special-cased above - if (pendingChars.length() != 0) { - - // if the expression is followed by an asterisk or a question mark, - // then push a copy of the current decision point list onto the stack - if (p + 1 < rule.length() && ( - rule.charAt(p + 1) == '*' || - rule.charAt(p + 1) == '?' - )) { - decisionPointStack.push(decisionPointList.clone()); - } - - // create a new state, add it to the list of states to backfill - // if we have looping states to worry about, set its "don't make - // me an accepting state" flag if we've seen a slash, and add - // it to the end of the state table - int newState = tempStateTable.size(); - if (loopingStates.size() != 0) { - statesToBackfill.addElement(new Integer(newState)); - } - state = new short[numCategories + 1]; - if (sawEarlyBreak) { - state[numCategories] = DONT_LOOP_FLAG; - } - tempStateTable.addElement(state); - - // update everybody in the decision point list to point to - // the new state (this also performs all the reconciliation - // needed to make the table deterministic), then clear the - // decision point list - updateStateTable(decisionPointList, pendingChars, (short)newState); - decisionPointList.removeAllElements(); - - // add all states created since the last literal character we've - // seen to the decision point list - lastState = currentState; - do { - ++currentState; - decisionPointList.addElement(new Integer(currentState)); - } while (currentState + 1 < tempStateTable.size()); - } - } - - // a * or a + denotes a repeating character or group, and a ? denotes an - // optional character group. (*, + and ? after () are handled separately below.) - if (c == '+' || c == '*' || c == '?') { - // when there's a * or a +, update the current state to loop back on itself - // on the character categories that caused us to enter this state - if (c == '*' || c == '+') { - // Note: we process one state at a time because updateStateTable - // may add new states, and we want to process them as well. - for (int i = lastState + 1; i < tempStateTable.size(); i++) { - Vector temp = new Vector(); - temp.addElement(new Integer(i)); - updateStateTable(temp, pendingChars, (short)(lastState + 1)); - } - - // If we just added any new states, add them to the decison point list - // Note: it might be a good idea to avoid adding new states to the - // decision point list in more than one place... - while (currentState + 1 < tempStateTable.size()) { - decisionPointList.addElement(new Integer(++currentState)); - } - } - - // for * and ? pop the top element off the decision point stack and merge - // it with the current decision point list (this causes the divergent - // paths through the state table to come together again on the next - // new state) - if (c == '*' || c == '?') { - Vector temp = (Vector)decisionPointStack.pop(); - for (int i = 0; i < decisionPointList.size(); i++) - temp.addElement(decisionPointList.elementAt(i)); - decisionPointList = temp; - - // a ? after a * modifies the behavior of * in cases where there is overlap - // between the set of characters that repeat and the characters which follow. - // Without the ?, all states following the repeating state, up to a state which - // is reached by a character that doesn't overlap, will loop back into the - // repeating state. With the ?, the mark states following the *? DON'T loop - // back into the repeating state. Thus, "[a-z]*xyz" will match the longest - // sequence of letters that ends in "xyz," while "[a-z]*? will match the - // _shortest_ sequence of letters that ends in "xyz". - // We use extra bookkeeping to achieve this effect, since everything else works - // according to the "longest possible match" principle. The basic principle - // is that transitions out of a looping state are written in over the looping - // value instead of being reconciled, and that we copy the contents of the - // looping state into empty cells of all non-terminal states that follow the - // looping state. -//System.out.println("c = " + c + ", p = " + p + ", rule.length() = " + rule.length()); - if (c == '*' && p + 1 < rule.length() && rule.charAt(p + 1) == '?') { -//System.out.println("Saw *?"); - setLoopingStates(decisionPointList, decisionPointList); - ++p; - } - } - } - - // a ( marks the beginning of a sequence of characters. Parentheses can either - // contain several alternative character sequences (i.e., "(ab|cd|ef)"), or - // they can contain a sequence of characters that can repeat (i.e., "(abc)*"). Thus, - // A () group can have multiple entry and exit points. To keep track of this, - // we reserve TWO spots on the decision-point stack. The top of the stack is - // the list of exit points, which becomes the current decision point list when - // the ) is reached. The next entry down is the decision point list at the - // beginning of the (), which becomes the current decision point list at every - // entry point. - // In addition to keeping track of the exit points and the active decision - // points before the ( (i.e., the places from which the () can be entered), - // we need to keep track of the entry points in case the expression loops - // (i.e., is followed by *). We do that by creating a dummy state in the - // state table and adding it to the decision point list (BEFORE it's duplicated - // on the stack). Nobody points to this state, so it'll get optimized out - // at the end. It exists only to hold the entry points in case the () - // expression loops. - if (c == '(') { - - // add a new state to the state table to hold the entry points into - // the () expression - tempStateTable.addElement(new short[numCategories + 1]); - - // we have to adjust lastState and currentState to account for the - // new dummy state - lastState = currentState; - ++currentState; - - // add the current state to the decision point list (add it at the - // BEGINNING so we can find it later) - decisionPointList.insertElementAt(new Integer(currentState), 0); - - // finally, push a copy of the current decision point list onto the - // stack (this keeps track of the active decision point list before - // the () expression), followed by an empty decision point list - // (this will hold the exit points) - decisionPointStack.push(decisionPointList.clone()); - decisionPointStack.push(new Vector()); - } - - // a | separates alternative character sequences in a () expression. When - // a | is encountered, we add the current decision point list to the exit-point - // list, and restore the decision point list to its state prior to the (. - if (c == '|') { - - // pick out the top two decision point lists on the stack - Vector oneDown = (Vector)decisionPointStack.pop(); - Vector twoDown = (Vector)decisionPointStack.peek(); - decisionPointStack.push(oneDown); - - // append the current decision point list to the list below it - // on the stack (the list of exit points), and restore the - // current decision point list to its state before the () expression - for (int i = 0; i < decisionPointList.size(); i++) - oneDown.addElement(decisionPointList.elementAt(i)); - decisionPointList = (Vector)twoDown.clone(); - } - - // a ) marks the end of a sequence of characters. We do one of two things - // depending on whether the sequence repeats (i.e., whether the ) is followed - // by *): If the sequence doesn't repeat, then the exit-point list is merged - // with the current decision point list and the decision point list from before - // the () is thrown away. If the sequence does repeat, then we fish out the - // state we were in before the ( and copy all of its forward transitions - // (i.e., every transition added by the () expression) into every state in the - // exit-point list and the current decision point list. The current decision - // point list is then merged with both the exit-point list AND the saved version - // of the decision point list from before the (). Then we throw out the *. - if (c == ')') { - - // pull the exit point list off the stack, merge it with the current - // decision point list, and make the merged version the current - // decision point list - Vector exitPoints = (Vector)decisionPointStack.pop(); - for (int i = 0; i < decisionPointList.size(); i++) - exitPoints.addElement(decisionPointList.elementAt(i)); - decisionPointList = exitPoints; - - // if the ) isn't followed by a *, + or ?, then all we have to do is throw - // away the other list on the decision point stack, and we're done - if (p + 1 >= rule.length() || ( - rule.charAt(p + 1) != '*' && - rule.charAt(p + 1) != '+' && - rule.charAt(p + 1) != '?') - ) { - decisionPointStack.pop(); - } - - // but if the sequence is conditional or it repeats, - // we have a lot more work to do... - else { - - // now exitPoints and decisionPointList have to point to equivalent - // vectors, but not the SAME vector - exitPoints = (Vector)decisionPointList.clone(); - - // pop the original decision point list off the stack - Vector temp = (Vector)decisionPointStack.pop(); - - // we squirreled away the row number of our entry point list - // at the beginning of the original decision point list. Fish - // that state number out and retrieve the entry point list - int tempStateNum = ((Integer)temp.firstElement()).intValue(); - short[] tempState = (short[])tempStateTable.elementAt(tempStateNum); - - // merge the original decision point list with the current - // decision point list - if (rule.charAt(p + 1) == '?' || rule.charAt(p + 1) == '*') { - for (int i = 0; i < decisionPointList.size(); i++) - temp.addElement(decisionPointList.elementAt(i)); - decisionPointList = temp; - } - - // finally, for * and + copy every forward reference from the entry point - // list into every state in the new decision point list - if (rule.charAt(p + 1) == '+' || rule.charAt(p + 1) == '*') { - for (int i = 0; i < tempState.length; i++) { - if (tempState[i] > tempStateNum) { - updateStateTable(exitPoints, - new Character((char)(i + 0x100)).toString(), - tempState[i]); - } - } - } - - // update lastState and currentState, and throw away the *, +, or ? - lastState = currentState; - currentState = tempStateTable.size() - 1; - ++p; - } - } - - // a / marks the position where the break is to go if the character sequence - // matches this rule. We update the flag word of every state on the decision - // point list to mark them as ending states, and take note of the fact that - // we've seen the slash - if (c == '/') { - sawEarlyBreak = true; - for (int i = 0; i < decisionPointList.size(); i++) { - state = (short[])tempStateTable.elementAt(((Integer)decisionPointList. - elementAt(i)).intValue()); - state[numCategories] |= LOOKAHEAD_STATE_FLAG; - } - } - - // if we get here without executing any of the above clauses, we have a - // syntax error. However, for now we just ignore the offending character - // and move on -/* -debugPrintln("====Parsed \"" + rule.substring(0, p + 1) + "\"..."); -System.out.println(" currentState = " + currentState); -debugPrintVectorOfVectors(" decisionPointStack:", " ", decisionPointStack); -debugPrintVector(" ", decisionPointList); -debugPrintVector(" loopingStates = ", loopingStates); -debugPrintVector(" statesToBackfill = ", statesToBackfill); -System.out.println(" sawEarlyBreak = " + sawEarlyBreak); -debugPrintTempStateTable(); -*/ - - // clearLoopingStates is a signal back from updateStateTable() that we've - // transitioned to a state that won't loop back to the current looping - // state. (In other words, we've gotten to a point where we can no longer - // go back into a *? we saw earlier.) Clear out the list of looping states - // and backfill any states that need to be backfilled. - if (clearLoopingStates) { - setLoopingStates(null, decisionPointList); - } - - // advance to the next character, now that we've processed the current - // character - ++p; - } - - // this takes care of backfilling any states that still need to be backfilled - setLoopingStates(null, decisionPointList); - - // when we reach the end of the string, we do a postprocessing step to mark the - // end states. The decision point list contains every state that can transition - // to the end state-- that is, every state that is the last state in a sequence - // that matches the rule. All of these states are considered "mark states" - // or "accepting states"-- that is, states that cause the position returned from - // next() to be updated. A mark state represents a possible break position. - // This allows us to look ahead and remember how far the rule matched - // before following the new branch (see next() for more information). - // The temporary state table has an extra "flag column" at the end where this - // information is stored. We mark the end states by setting a flag in their - // flag column. - // Now if we saw the / in the rule, then everything after it is lookahead - // material and the break really goes where the slash is. In this case, - // we mark these states as BOTH accepting states and lookahead states. This - // signals that these states cause the break position to be updated to the - // position of the slash rather than the current break position. - for (int i = 0; i < decisionPointList.size(); i++) { - int rowNum = ((Integer)decisionPointList.elementAt(i)).intValue(); - state = (short[])tempStateTable.elementAt(rowNum); - state[numCategories] |= END_STATE_FLAG; - if (sawEarlyBreak) { - state[numCategories] |= LOOKAHEAD_STATE_FLAG; - } - } -/* -debugPrintln("====Parsed \"" + rule + ";"); -System.out.println(); -System.out.println(" currentState = " + currentState); -debugPrintVectorOfVectors(" decisionPointStack:", " ", decisionPointStack); -debugPrintVector(" ", decisionPointList); -debugPrintVector(" loopingStates = ", loopingStates); -debugPrintVector(" statesToBackfill = ", statesToBackfill); -System.out.println(" sawEarlyBreak = " + sawEarlyBreak); -debugPrintTempStateTable(); -*/ - } - - - /** - * Update entries in the state table, and merge states when necessary to keep - * the table deterministic. - * @param rows The list of rows that need updating (the decision point list) - * @param pendingChars A character category list, encoded in a String. This is the - * list of the columns that need updating. - * @param newValue Update the cells specfied above to contain this value - */ - private void updateStateTable(Vector rows, - String pendingChars, - short newValue) { - // create a dummy state that has the specified row number (newValue) in - // the cells that need to be updated (those specified by pendingChars) - // and 0 in the other cells - short[] newValues = new short[numCategories + 1]; - for (int i = 0; i < pendingChars.length(); i++) - newValues[(int)(pendingChars.charAt(i)) - 0x100] = newValue; - - // go through the list of rows to update, and update them by calling - // mergeStates() to merge them the the dummy state we created - for (int i = 0; i < rows.size(); i++) { - mergeStates(((Integer)rows.elementAt(i)).intValue(), newValues, rows); - } - } - - /** - * The real work of making the state table deterministic happens here. This function - * merges a state in the state table (specified by rowNum) with a state that is - * passed in (newValues). The basic process is to copy the nonzero cells in newStates - * into the state in the state table (we'll call that oldValues). If there's a - * collision (i.e., if the same cell has a nonzero value in both states, and it's - * not the SAME value), then we have to reconcile the collision. We do this by - * creating a new state, adding it to the end of the state table, and using this - * function recursively to merge the original two states into a single, combined - * state. This process may happen recursively (i.e., each successive level may - * involve collisions). To prevent infinite recursion, we keep a log of merge - * operations. Any time we're merging two states we've merged before, we can just - * supply the row number for the result of that merge operation rather than creating - * a new state just like it. - * @param rowNum The row number in the state table of the state to be updated - * @param newValues The state to merge it with. - * @param rowsBeingUpdated A copy of the list of rows passed to updateStateTable() - * (itself a copy of the decision point list from parseRule()). Newly-created - * states get added to the decision point list if their "parents" were on it. - */ - private void mergeStates(int rowNum, - short[] newValues, - Vector rowsBeingUpdated) { - short[] oldValues = (short[])(tempStateTable.elementAt(rowNum)); -/* -System.out.print("***Merging " + rowNum + ":"); -for (int i = 0; i < oldValues.length; i++) System.out.print("\t" + oldValues[i]); -System.out.println(); -System.out.print(" with \t"); -for (int i = 0; i < newValues.length; i++) System.out.print("\t" + newValues[i]); -System.out.println(); -*/ - - boolean isLoopingState = loopingStates.contains(new Integer(rowNum)); - - // for each of the cells in the rows we're reconciling, do... - for (int i = 0; i < oldValues.length; i++) { - - // if they contain the same value, we don't have to do anything - if (oldValues[i] == newValues[i]) { - continue; - } - - // if oldValues is a looping state and the state the current cell points to - // is too, then we can just stomp over the current value of that cell (and - // set the clear-looping-states flag if necessary) - else if (isLoopingState && loopingStates.contains(new Integer(oldValues[i]))) { - if (newValues[i] != 0) { - if (oldValues[i] == 0) { - clearLoopingStates = true; - } - oldValues[i] = newValues[i]; - } - } - - // if the current cell in oldValues is 0, copy in the corresponding value - // from newValues - else if (oldValues[i] == 0) { - oldValues[i] = newValues[i]; - } - - // the last column of each row is the flag column. Take care to merge the - // flag words correctly - else if (i == numCategories) { - oldValues[i] = (short)((newValues[i] & ALL_FLAGS) | oldValues[i]); - } - - // if both newValues and oldValues have a nonzero value in the current - // cell, and it isn't the same value both places... - else if (oldValues[i] != 0 && newValues[i] != 0) { - - // look up this pair of cell values in the merge list. If it's - // found, update the cell in oldValues to point to the merged state - int combinedRowNum = searchMergeList(oldValues[i], newValues[i]); - if (combinedRowNum != 0) { - oldValues[i] = (short)combinedRowNum; - } - - // otherwise, we have to reconcile them... - else { - // copy our row numbers into variables to make things easier - int oldRowNum = oldValues[i]; - int newRowNum = newValues[i]; - combinedRowNum = tempStateTable.size(); - - // add this pair of row numbers to the merge list (create it first - // if we haven't created the merge list yet) - if (mergeList == null) { - mergeList = new Vector(); - } - mergeList.addElement(new int[] { oldRowNum, newRowNum, combinedRowNum }); - -//System.out.println("***At " + rowNum + ", merging " + oldRowNum + " and " + newRowNum + " into " + combinedRowNum); - - // create a new row to represent the merged state, and copy the - // contents of oldRow into it, then add it to the end of the - // state table and update the original row (oldValues) to point - // to the new, merged, state - short[] newRow = new short[numCategories + 1]; - short[] oldRow = (short[])(tempStateTable.elementAt(oldRowNum)); - System.arraycopy(oldRow, 0, newRow, 0, numCategories + 1); - tempStateTable.addElement(newRow); - oldValues[i] = (short)combinedRowNum; - - -//System.out.println("lastOldRowNum = " + lastOldRowNum); -//System.out.println("lastCombinedRowNum = " + lastCombinedRowNum); -//System.out.println("decisionPointList.contains(lastOldRowNum) = " + decisionPointList.contains(new Integer(lastOldRowNum))); -//System.out.println("decisionPointList.contains(lastCombinedRowNum) = " + decisionPointList.contains(new Integer(lastCombinedRowNum))); - - // if the decision point list contains either of the parent rows, - // update it to include the new row as well - if ((decisionPointList.contains(new Integer(oldRowNum)) - || decisionPointList.contains(new Integer(newRowNum))) - && !decisionPointList.contains(new Integer(combinedRowNum)) - ) { - decisionPointList.addElement(new Integer(combinedRowNum)); - } - - // do the same thing with the list of rows being updated - if ((rowsBeingUpdated.contains(new Integer(oldRowNum)) - || rowsBeingUpdated.contains(new Integer(newRowNum))) - && !rowsBeingUpdated.contains(new Integer(combinedRowNum)) - ) { - decisionPointList.addElement(new Integer(combinedRowNum)); - } - // now (groan) do the same thing for all the entries on the - // decision point stack - for (int k = 0; k < decisionPointStack.size(); k++) { - Vector dpl = (Vector)decisionPointStack.elementAt(k); - if ((dpl.contains(new Integer(oldRowNum)) - || dpl.contains(new Integer(newRowNum))) - && !dpl.contains(new Integer(combinedRowNum)) - ) { - dpl.addElement(new Integer(combinedRowNum)); - } - } - - // FINALLY (puff puff puff), call mergeStates() recursively to copy - // the row referred to by newValues into the new row and resolve any - // conflicts that come up at that level - mergeStates(combinedRowNum, (short[])(tempStateTable.elementAt( - newValues[i])), rowsBeingUpdated); - } - } - } - return; - } - - /** - * The merge list is a list of pairs of rows that have been merged somewhere in - * the process of building this state table, along with the row number of the - * row containing the merged state. This function looks up a pair of row numbers - * and returns the row number of the row they combine into. (It returns 0 if - * this pair of rows isn't in the merge list.) - */ - private int searchMergeList(int a, int b) { - // if there is no merge list, there obviously isn't anything in it - if (mergeList == null) { - return 0; - } - - // otherwise, for each element in the merge list... - else { - int[] entry; - for (int i = 0; i < mergeList.size(); i++) { - entry = (int[])(mergeList.elementAt(i)); - - // we have a hit if the two row numbers match the two row numbers - // in the beginning of the entry (the two that combine), in either - // order - if ((entry[0] == a && entry[1] == b) || (entry[0] == b && entry[1] == a)) { - return entry[2]; - } - - // we also have a hit if one of the two row numbers matches the marged - // row number and the other one matches one of the original row numbers - if ((entry[2] == a && (entry[0] == b || entry[1] == b))) { - return entry[2]; - } - if ((entry[2] == b && (entry[0] == a || entry[1] == a))) { - return entry[2]; - } - } - return 0; - } - } - - /** - * This function is used to update the list of current loooping states (i.e., - * states that are controlled by a *? construct). It backfills values from - * the looping states into unpopulated cells of the states that are currently - * marked for backfilling, and then updates the list of looping states to be - * the new list - * @param newLoopingStates The list of new looping states - * @param endStates The list of states to treat as end states (states that - * can exit the loop). - */ - private void setLoopingStates(Vector newLoopingStates, Vector endStates) { - - // if the current list of looping states isn't empty, we have to backfill - // values from the looping states into the states that are waiting to be - // backfilled - if (!loopingStates.isEmpty()) { - int loopingState = ((Integer)loopingStates.lastElement()).intValue(); - int rowNum; - - // don't backfill into an end state OR any state reachable from an end state - // (since the search for reachable states is recursive, it's split out into - // a separate function, eliminateBackfillStates(), below) - for (int i = 0; i < endStates.size(); i++) { - eliminateBackfillStates(((Integer)endStates.elementAt(i)).intValue()); - } - - // we DON'T actually backfill the states that need to be backfilled here. - // Instead, we MARK them for backfilling. The reason for this is that if - // there are multiple rules in the state-table description, the looping - // states may have some of their values changed by a succeeding rule, and - // this wouldn't be reflected in the backfilled states. We mark a state - // for backfilling by putting the row number of the state to copy from - // into the flag cell at the end of the row - for (int i = 0; i < statesToBackfill.size(); i++) { - rowNum = ((Integer)statesToBackfill.elementAt(i)).intValue(); - short[] state = (short[])tempStateTable.elementAt(rowNum); - state[numCategories] = - (short)((state[numCategories] & ALL_FLAGS) | loopingState); - } - statesToBackfill.removeAllElements(); - loopingStates.removeAllElements(); - } - - if (newLoopingStates != null) { - loopingStates = (Vector)newLoopingStates.clone(); - } - } - - /** - * This removes "ending states" and states reachable from them from the - * list of states to backfill. - * @param The row number of the state to remove from the backfill list - */ - private void eliminateBackfillStates(int baseState) { - - // don't do anything unless this state is actually in the backfill list... - if (statesToBackfill.contains(new Integer(baseState))) { - - // if it is, take it out - statesToBackfill.removeElement(new Integer(baseState)); - - // then go through and recursively call this function for every - // state that the base state points to - short[] state = (short[])tempStateTable.elementAt(baseState); - for (int i = 0; i < numCategories; i++) { - if (state[i] != 0) { - eliminateBackfillStates(state[i]); - } - } - } - } - - /** - * This function completes the backfilling process by actually doing the - * backfilling on the states that are marked for it - */ - private void backfillLoopingStates() { - short[] state; - short[] loopingState = null; - int loopingStateRowNum = 0; - int fromState; - - // for each state in the state table... - for (int i = 0; i < tempStateTable.size(); i++) { - state = (short[])tempStateTable.elementAt(i); - - // check the state's flag word to see if it's marked for backfilling - // (it's marked for backfilling if any bits other than the two high-order - // bits are set-- if they are, then the flag word, minus the two high bits, - // is the row number to copy from) - fromState = state[numCategories] & ~ALL_FLAGS; - if (fromState > 0) { - - // load up the state to copy from (if we haven't already) - if (fromState != loopingStateRowNum) { - loopingStateRowNum = fromState; - loopingState = (short[])tempStateTable.elementAt(loopingStateRowNum); - } - - // clear out the backfill part of the flag word - state[numCategories] &= ALL_FLAGS; - - // then fill all zero cells in the current state with values - // from the corresponding cells of the fromState - for (int j = 0; j < state.length; j++) { - if (state[j] == 0) { - state[j] = loopingState[j]; - } - else if (state[j] == DONT_LOOP_FLAG) { - state[j] = 0; - } - } - } - } - } - - /** - * This function completes the state-table-building process by doing several - * postprocessing steps and copying everything into its final resting place - * in the iterator itself - * @param forward True if we're working on the forward state table - */ - private void finishBuildingStateTable(boolean forward) { -//debugPrintTempStateTable(); - // start by backfilling the looping states - backfillLoopingStates(); -//debugPrintTempStateTable(); - - int[] rowNumMap = new int[tempStateTable.size()]; - Stack rowsToFollow = new Stack(); - rowsToFollow.push(new Integer(1)); - rowNumMap[1] = 1; - - // determine which states are no longer reachable from the start state - // (the reachable states will have their row numbers in the row number - // map, and the nonreachable states will have zero in the row number map) - while (rowsToFollow.size() != 0) { - int rowNum = ((Integer)rowsToFollow.pop()).intValue(); - short[] row = (short[])(tempStateTable.elementAt(rowNum)); - - for (int i = 0; i < numCategories; i++) { - if (row[i] != 0) { - if (rowNumMap[row[i]] == 0) { - rowNumMap[row[i]] = row[i]; - rowsToFollow.push(new Integer(row[i])); - } - } - } - } -/* -System.out.println("The following rows are not reachable:"); -for (int i = 1; i < rowNumMap.length; i++) -if (rowNumMap[i] == 0) System.out.print("\t" + i); -System.out.println(); -*/ - - // variable not used boolean madeChange; - int newRowNum; - - // algorithm for minimizing the number of states in the table adapted from - // Aho & Ullman, "Principles of Compiler Design" - // The basic idea here is to organize the states into classes. When we're done, - // all states in the same class can be considered identical and all but one eliminated. - - // initially assign states to classes based on the number of populated cells they - // contain (the class number is the number of populated cells) - int[] stateClasses = new int[tempStateTable.size()]; - int nextClass = numCategories + 1; - short[] state1, state2; - for (int i = 1; i < stateClasses.length; i++) { - if (rowNumMap[i] == 0) { - continue; - } - state1 = (short[])tempStateTable.elementAt(i); - for (int j = 0; j < numCategories; j++) { - if (state1[j] != 0) { - ++stateClasses[i]; - } - } - if (stateClasses[i] == 0) { - stateClasses[i] = nextClass; - } - } - ++nextClass; - - // then, for each class, elect the first member of that class as that class's - // "representative". For each member of the class, compare it to the "representative." - // If there's a column position where the state being tested transitions to a - // state in a DIFFERENT class from the class where the "representative" transitions, - // then move the state into a new class. Repeat this process until no new classes - // are created. - int currentClass; - int lastClass; - boolean split; - - do { -//System.out.println("Making a pass..."); - currentClass = 1; - lastClass = nextClass; - while (currentClass < nextClass) { -//System.out.print("States in class #" + currentClass +":"); - split = false; - state1 = state2 = null; - for (int i = 0; i < stateClasses.length; i++) { - if (stateClasses[i] == currentClass) { -//System.out.print("\t" + i); - if (state1 == null) { - state1 = (short[])tempStateTable.elementAt(i); - } - else { - state2 = (short[])tempStateTable.elementAt(i); - for (int j = 0; j < state2.length; j++) - if ((j == numCategories && state1[j] != state2[j] && forward) - || (j != numCategories && stateClasses[state1[j]] - != stateClasses[state2[j]])) { - stateClasses[i] = nextClass; - split = true; - break; - } - } - } - } - if (split) { - ++nextClass; - } - ++currentClass; -//System.out.println(); - } - } while (lastClass != nextClass); - - // at this point, all of the states in a class except the first one (the - //"representative") can be eliminated, so update the row-number map accordingly - int[] representatives = new int[nextClass]; - for (int i = 1; i < stateClasses.length; i++) - if (representatives[stateClasses[i]] == 0) { - representatives[stateClasses[i]] = i; - } - else { - rowNumMap[i] = representatives[stateClasses[i]]; - } -//System.out.println("Renumbering..."); - - // renumber all remaining rows... - // first drop all that are either unreferenced or not a class representative - for (int i = 1; i < rowNumMap.length; i++) { - if (rowNumMap[i] != i) { - tempStateTable.setElementAt(null, i); - } - } - - // then calculate everybody's new row number and update the row - // number map appropriately (the first pass updates the row numbers - // of all the class representatives [the rows we're keeping], and the - // second pass updates the cross references for all the rows that - // are being deleted) - newRowNum = 1; - for (int i = 1; i < rowNumMap.length; i++) { - if (tempStateTable.elementAt(i) != null) { - rowNumMap[i] = newRowNum++; - } - } - for (int i = 1; i < rowNumMap.length; i++) { - if (tempStateTable.elementAt(i) == null) { - rowNumMap[i] = rowNumMap[rowNumMap[i]]; - } - } -//for (int i = 1; i < rowNumMap.length; i++) rowNumMap[i] = i; int newRowNum = rowNumMap.length; - - // allocate the permanent state table, and copy the remaining rows into it - // (adjusting all the cell values, of course) - - // this section does that for the forward state table - if (forward) { - endStates = new boolean[newRowNum]; - lookaheadStates = new boolean[newRowNum]; - stateTable = new short[newRowNum * numCategories]; - int p = 0; - int p2 = 0; - for (int i = 0; i < tempStateTable.size(); i++) { - short[] row = (short[])(tempStateTable.elementAt(i)); - if (row == null) { - continue; - } - for (int j = 0; j < numCategories; j++) { - stateTable[p] = (short)(rowNumMap[row[j]]); - ++p; - } - endStates[p2] = ((row[numCategories] & END_STATE_FLAG) != 0); - lookaheadStates[p2] = ((row[numCategories] & LOOKAHEAD_STATE_FLAG) != 0); - ++p2; - } - } - - // and this section does it for the backward state table - else { - backwardsStateTable = new short[newRowNum * numCategories]; - int p = 0; - for (int i = 0; i < tempStateTable.size(); i++) { - short[] row = (short[])(tempStateTable.elementAt(i)); - if (row == null) { - continue; - } - for (int j = 0; j < numCategories; j++) { - backwardsStateTable[p] = (short)(rowNumMap[row[j]]); - ++p; - } - } - } - } - - /** - * This function builds the backward state table from the forward state - * table and any additional rules (identified by the ! on the front) - * supplied in the description - */ - private void buildBackwardsStateTable(Vector tempRuleList) { - - // create the temporary state table and seed it with two rows (row 0 - // isn't used for anything, and we have to create row 1 (the initial - // state) before we can do anything else - tempStateTable = new Vector(); - tempStateTable.addElement(new short[numCategories + 1]); - tempStateTable.addElement(new short[numCategories + 1]); - - // although the backwards state table is built automatically from the forward - // state table, there are some situations (the default sentence-break rules, - // for example) where this doesn't yield enough stop states, causing a dramatic - // drop in performance. To help with these cases, the user may supply - // supplemental rules that are added to the backward state table. These have - // the same syntax as the normal break rules, but begin with '!' to distinguish - // them from normal break rules - for (int i = 0; i < tempRuleList.size(); i++) { - String rule = (String)tempRuleList.elementAt(i); - if (rule.charAt(0) == '!') { - parseRule(rule.substring(1), false); - } - } - backfillLoopingStates(); - - // Backwards iteration is qualitatively different from forwards iteration. - // This is because backwards iteration has to be made to operate from no context - // at all-- the user should be able to ask BreakIterator for the break position - // immediately on either side of some arbitrary offset in the text. The - // forward iteration table doesn't let us do that-- it assumes complete - // information on the context, which means starting from the beginning of the - // document. - // The way we do backward and random-access iteration is to back up from the - // current (or user-specified) position until we see something we're sure is - // a break position (it may not be the last break position immediately - // preceding our starting point, however). Then we roll forward from there to - // locate the actual break position we're after. - // This means that the backwards state table doesn't have to identify every - // break position, allowing the building algorithm to be much simpler. Here, - // we use a "pairs" approach, scanning the forward-iteration state table for - // pairs of character categories we ALWAYS break between, and building a state - // table from that information. No context is required-- all this state table - // looks at is a pair of adjacent characters. - - // It's possible that the user has supplied supplementary rules (see above). - // This has to be done first to keep parseRule() and friends from becoming - // EVEN MORE complicated. The automatically-generated states are appended - // onto the end of the state table, and then the two sets of rules are - // stitched together at the end. Take note of the row number of the - // first row of the auromatically-generated part. - int backTableOffset = tempStateTable.size(); - if (backTableOffset > 2) { - ++backTableOffset; - } - - // the automatically-generated part of the table models a two-dimensional - // array where the two dimensions represent the two characters we're currently - // looking at. To model this as a state table, we actually need one additional - // row to represent the initial state. It gets populated with the row numbers - // of the other rows (in order). - for (int i = 0; i < numCategories + 1; i++) - tempStateTable.addElement(new short[numCategories + 1]); - - short[] state = (short[])tempStateTable.elementAt(backTableOffset - 1); - for (int i = 0; i < numCategories; i++) - state[i] = (short)(i + backTableOffset); - - // scavenge the forward state table for pairs of character categories - // that always have a break between them. The algorithm is as follows: - // Look down each column in the state table. For each nonzero cell in - // that column, look up the row it points to. For each nonzero cell in - // that row, populate a cell in the backwards state table: the row number - // of that cell is the number of the column we were scanning (plus the - // offset that locates this sub-table), and the column number of that cell - // is the column number of the nonzero cell we just found. This cell is - // populated with its own column number (adjusted according to the actual - // location of the sub-table). This process will produce a state table - // whose behavior is the same as looking up successive pairs of characters - // in an array of Booleans to determine whether there is a break. - int numRows = stateTable.length / numCategories; - for (int column = 0; column < numCategories; column++) { - for (int row = 0; row < numRows; row++) { - int nextRow = lookupState(row, column); - if (nextRow != 0) { - for (int nextColumn = 0; nextColumn < numCategories; nextColumn++) { - int cellValue = lookupState(nextRow, nextColumn); - if (cellValue != 0) { - state = (short[])tempStateTable.elementAt(nextColumn + - backTableOffset); - state[column] = (short)(column + backTableOffset); - } - } - } - } - } - -//debugPrintTempStateTable(); - // if the user specified some backward-iteration rules with the ! token, - // we have to merge the resulting state table with the auto-generated one - // above. First copy the populated cells from row 1 over the populated - // cells in the auto-generated table. Then copy values from row 1 of the - // auto-generated table into all of the the unpopulated cells of the - // rule-based table. - if (backTableOffset > 1) { - - // for every row in the auto-generated sub-table, if a cell is - // populated that is also populated in row 1 of the rule-based - // sub-table, copy the value from row 1 over the value in the - // auto-generated sub-table - state = (short[])tempStateTable.elementAt(1); - for (int i = backTableOffset - 1; i < tempStateTable.size(); i++) { - short[] state2 = (short[])tempStateTable.elementAt(i); - for (int j = 0; j < numCategories; j++) { - if (state[j] != 0 && state2[j] != 0) { - state2[j] = state[j]; - } - } - } - - // now, for every row in the rule-based sub-table that is not - // an end state, fill in all unpopulated cells with the values - // of the corresponding cells in the first row of the auto- - // generated sub-table. - state = (short[])tempStateTable.elementAt(backTableOffset - 1); - for (int i = 1; i < backTableOffset - 1; i++) { - short[] state2 = (short[])tempStateTable.elementAt(i); - if ((state2[numCategories] & END_STATE_FLAG) == 0) { - for (int j = 0; j < numCategories; j++) { - if (state2[j] == 0) { - state2[j] = state[j]; - } - } - } - } - } - -//debugPrintTempStateTable(); - - // finally, clean everything up and copy it into the actual BreakIterator - // by calling finishBuildingStateTable() - finishBuildingStateTable(false); -/* -System.out.print("C:\t"); -for (int i = 0; i < numCategories; i++) -System.out.print(Integer.toString(i) + "\t"); -System.out.println(); System.out.print("================================================="); -for (int i = 0; i < backwardsStateTable.length; i++) { -if (i % numCategories == 0) { -System.out.println(); -System.out.print(Integer.toString(i / numCategories) + ":\t"); -} -if (backwardsStateTable[i] == 0) System.out.print(".\t"); else System.out.print(Integer.toString(backwardsStateTable[i]) + "\t"); -} -System.out.println(); -*/ - } - - /** - * Throws an IllegalArgumentException representing a syntax error in the rule - * description. The exception's message contains some debugging information. - * @param message A message describing the problem - * @param position The position in the description where the problem was - * discovered - * @param context The string containing the error - */ - protected void error(String message, int position, String context) { - throw new IllegalArgumentException("Parse error: " + message + "\n" + - Utility.escape(context.substring(0, position)) + "\n\n" + - Utility.escape(context.substring(position))); - } - - - protected void debugPrintVector(String label, Vector v) { - System.out.print(label); - for (int i = 0; i < v.size(); i++) - System.out.print(v.elementAt(i).toString() + "\t"); - System.out.println(); - } - - protected void debugPrintVectorOfVectors(String label1, String label2, Vector v) { - System.out.println(label1); - for (int i = 0; i < v.size(); i++) - debugPrintVector(label2, (Vector)v.elementAt(i)); - } - - protected void debugPrintTempStateTable() { - System.out.println(" tempStateTable:"); - System.out.print(" C:\t"); - for (int i = 0; i <= numCategories; i++) - System.out.print(Integer.toString(i) + "\t"); - System.out.println(); - for (int i = 1; i < tempStateTable.size(); i++) { - short[] row = (short[])(tempStateTable.elementAt(i)); - System.out.print(" " + i + ":\t"); - for (int j = 0; j < row.length; j++) { - if (row[j] == 0) { - System.out.print(".\t"); - } - else { - System.out.print(Integer.toString(row[j]) + "\t"); - } - } - System.out.println(); - } - } - - } - - /* - * This class exists to work around a bug in HotJava's implementation - * of CharacterIterator, which incorrectly handles setIndex(endIndex). - * This iterator relies only on base.setIndex(n) where n is less than - * endIndex. - * - * One caveat: if the base iterator's begin and end indices change - * the change will not be reflected by this wrapper. Does that matter? - */ - private static final class SafeCharIterator implements CharacterIterator, - Cloneable { - - private CharacterIterator base; - private int rangeStart; - private int rangeLimit; - private int currentIndex; - - SafeCharIterator(CharacterIterator base) { - this.base = base; - this.rangeStart = base.getBeginIndex(); - this.rangeLimit = base.getEndIndex(); - this.currentIndex = base.getIndex(); - } - - public char first() { - return setIndex(rangeStart); - } - - public char last() { - return setIndex(rangeLimit - 1); - } - - public char current() { - if (currentIndex < rangeStart || currentIndex >= rangeLimit) { - return DONE; - } - else { - return base.setIndex(currentIndex); - } - } - - public char next() { - - currentIndex++; - if (currentIndex >= rangeLimit) { - currentIndex = rangeLimit; - return DONE; - } - else { - return base.setIndex(currentIndex); - } - } - - public char previous() { - - currentIndex--; - if (currentIndex < rangeStart) { - currentIndex = rangeStart; - return DONE; - } - else { - return base.setIndex(currentIndex); - } - } - - public char setIndex(int i) { - - if (i < rangeStart || i > rangeLimit) { - throw new IllegalArgumentException("Invalid position"); - } - currentIndex = i; - return current(); - } - - public int getBeginIndex() { - return rangeStart; - } - - public int getEndIndex() { - return rangeLimit; - } - - public int getIndex() { - return currentIndex; - } - - public Object clone() { - - SafeCharIterator copy = null; - try { - copy = (SafeCharIterator) super.clone(); - } - catch(CloneNotSupportedException e) { - throw new Error("Clone not supported: " + e); - } - - CharacterIterator copyOfBase = (CharacterIterator) base.clone(); - copy.base = copyOfBase; - return copy; - } - } - - - public static void debugPrintln(String s) { - final String zeros = "0000"; - String temp; - StringBuffer out = new StringBuffer(); - for (int i = 0; i < s.length(); i++) { - char c = s.charAt(i); - if (c >= ' ' && c < '\u007f') { - out.append(c); - } - else { - out.append("\\u"); - temp = Integer.toHexString((int)c); - out.append(zeros.substring(0, 4 - temp.length())); - out.append(temp); - } - } - System.out.println(out); - } - -} - diff --git a/icu4j/src/com/ibm/text/RuleBasedNumberFormat.java b/icu4j/src/com/ibm/text/RuleBasedNumberFormat.java deleted file mode 100755 index 5d7a5d545a..0000000000 --- a/icu4j/src/com/ibm/text/RuleBasedNumberFormat.java +++ /dev/null @@ -1,1303 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/RuleBasedNumberFormat.java,v $ - * $Date: 2001/11/12 20:02:00 $ - * $Revision: 1.4 $ - * - ***************************************************************************************** - */ - -package com.ibm.text; - -import java.math.BigInteger; -import java.text.*; -import java.util.Vector; -import java.util.Locale; -import java.util.ResourceBundle; - -/** - *

A class that formats numbers according to a set of rules. This number formatter is - * typically used for spelling out numeric values in words (e.g., 25,3476 as - * "twenty-five thousand three hundred seventy-six" or "vingt-cinq mille trois - * cents soixante-seize" or - * "funfundzwanzigtausenddreihundertsechsundsiebzig"), but can also be used for - * other complicated formatting tasks, such as formatting a number of seconds as hours, - * minutes and seconds (e.g., 3,730 as "1:02:10").

- * - *

The resources contain three predefined formatters for each locale: spellout, which - * spells out a value in words (123 is "one hundred twenty-three"); ordinal, which - * appends an ordinal suffix to the end of a numeral (123 is "123rd"); and - * duration, which shows a duration in seconds as hours, minutes, and seconds (123 is - * "2:03").  The client can also define more specialized RuleBasedNumberFormats - * by supplying programmer-defined rule sets.

- * - *

The behavior of a RuleBasedNumberFormat is specified by a textual description - * that is either passed to the constructor as a String or loaded from a resource - * bundle. In its simplest form, the description consists of a semicolon-delimited list of rules. - * Each rule has a string of output text and a value or range of values it is applicable to. - * In a typical spellout rule set, the first twenty rules are the words for the numbers from - * 0 to 19:

- * - *
zero; one; two; three; four; five; six; seven; eight; nine;
- * ten; eleven; twelve; thirteen; fourteen; fifteen; sixteen; seventeen; eighteen; nineteen;
- * - *

For larger numbers, we can use the preceding set of rules to format the ones place, and - * we only have to supply the words for the multiples of 10:

- * - *
20: twenty[->>];
- * 30: thirty{->>];
- * 40: forty[->>];
- * 50: fifty[->>];
- * 60: sixty[->>];
- * 70: seventy[->>];
- * 80: eighty[->>];
- * 90: ninety[->>];
- * - *

In these rules, the base value is spelled out explicitly and set off from the - * rule's output text with a colon. The rules are in a sorted list, and a rule is applicable - * to all numbers from its own base value to one less than the next rule's base value. The - * ">>" token is called a substitution and tells the fomatter to - * isolate the number's ones digit, format it using this same set of rules, and place the - * result at the position of the ">>" token. Text in brackets is omitted if - * the number being formatted is an even multiple of 10 (the hyphen is a literal hyphen; 24 - * is "twenty-four," not "twenty four").

- * - *

For even larger numbers, we can actually look up several parts of the number in the - * list:

- * - *
100: << hundred[ >>];
- * - *

The "<<" represents a new kind of substitution. The << isolates - * the hundreds digit (and any digits to its left), formats it using this same rule set, and - * places the result where the "<<" was. Notice also that the meaning of - * >> has changed: it now refers to both the tens and the ones digits. The meaning of - * both substitutions depends on the rule's base value. The base value determines the rule's divisor, - * which is the highest power of 10 that is less than or equal to the base value (the user - * can change this). To fill in the substitutions, the formatter divides the number being - * formatted by the divisor. The integral quotient is used to fill in the << - * substitution, and the remainder is used to fill in the >> substitution. The meaning - * of the brackets changes similarly: text in brackets is omitted if the value being - * formatted is an even multiple of the rule's divisor. The rules are applied recursively, so - * if a substitution is filled in with text that includes another substitution, that - * substitution is also filled in.

- * - *

This rule covers values up to 999, at which point we add another rule:

- * - *
1000: << thousand[ >>];
- * - *

Again, the meanings of the brackets and substitution tokens shift because the rule's - * base value is a higher power of 10, changing the rule's divisor. This rule can actually be - * used all the way up to 999,999. This allows us to finish out the rules as follows:

- * - *
1,000,000: << million[ >>];
- * 1,000,000,000: << billion[ >>];
- * 1,000,000,000,000: << trillion[ >>];
- * 1,000,000,000,000,000: OUT OF RANGE!;
- * - *

Commas, periods, and spaces can be used in the base values to improve legibility and - * are ignored by the rule parser. The last rule in the list is customarily treated as an - * "overflow rule," applying to everything from its base value on up, and often (as - * in this example) being used to print out an error message or default representation. - * Notice also that the size of the major groupings in large numbers is controlled by the - * spacing of the rules: because in English we group numbers by thousand, the higher rules - * are separated from each other by a factor of 1,000.

- * - *

To see how these rules actually work in practice, consider the following example: - * Formatting 25,430 with this rule set would work like this:

- * - *
::Within a nested [] expression, a pair of colons containing a one- or - * two-letter code matches all characters in the corresponding Unicode category.  - * The :: expression has to be the only thing inside the [] expression. The two-letter codes - * are the same as the two-letter codes in the Unicode database (for example, - * "[[:Sc:][:Sm:]]" matches all currency symbols and all math symbols).  - * Specifying a one-letter code is the same as specifying all two-letter codes that begin - * with that letter (for example, "[[:L:]]" matches all letters, and is equivalent - * to "[[:Lu:][:Ll:][:Lo:][:Lm:][:Lt:]]").  Anything other than a valid - * two-letter Unicode category code or a single letter that begins a valide Unicode category - * code is illegal within the colons.
|Two nested [] expressions juxtaposed or separated only by a | character - * are merged together into a single [] expression matching all the characters in either - * of the original [] expressions. (e.g., "[[ab][bc]]" is equivalent to "[abc]", and so - * is "[[ab]|[bc]]". NOTE: "[ab][bc]" is NOT the same thing as "[[ab][bc]]". - * The first expression will match two characters: an a or b followed by either another - * b or a c. The second expression will match a single character, which may be a, b, or c. - * The nesting is required for the expressions to merge together.
&Two nested [] expressions with only & between them will match any - * character that appears in both nested [] expressions (this is a set intersection). - * (e.g., "[[ab]&[bc]]" will only match the letter b.)
-Two nested [] expressions with - between them will match any - * character that appears in the first nested [] expression but not the - * second one (this is an asymmetrical set difference). (e.g., "[[:Sc:]-[$]]" - * matches any currency symbol except the dollar sign. "[[ab]-[bc]] will match - * only the letter a. This has exactly the same effect as "[[ab]&[^bc]]".)
- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
<< thousand >>[the rule whose base value is 1,000 is applicable to 25,340]
twenty->> thousand >>[25,340 over 1,000 is 25. The rule for 20 applies.]
twenty-five thousand >>[25 mod 10 is 5. The rule for 5 is "five."
twenty-five thousand << hundred >>[25,340 mod 1,000 is 340. The rule for 100 applies.]
twenty-five thousand three hundred >>[340 over 100 is 3. The rule for 3 is "three."]
twenty-five thousand three hundred forty[340 mod 100 is 40. The rule for 40 applies. Since 40 divides - * evenly by 10, the hyphen and substitution in the brackets are omitted.]
- * - *

The above syntax suffices only to format positive integers. To format negative numbers, - * we add a special rule:

- * - *
-x: minus >>;
- * - *

This is called a negative-number rule, and is identified by "-x" - * where the base value would be. This rule is used to format all negative numbers. the - * >> token here means "find the number's absolute value, format it with these - * rules, and put the result here."

- * - *

We also add a special rule called a fraction rule for numbers with fractional - * parts:

- * - *
x.x: << point >>;
- * - *

This rule is used for all positive non-integers (negative non-integers pass through the - * negative-number rule first and then through this rule). Here, the << token refers to - * the number's integral part, and the >> to the number's fractional part. The - * fractional part is formatted as a series of single-digit numbers (e.g., 123.456 would be - * formatted as "one hundred twenty-three point four five six").

- * - *

To see how this rule syntax is applied to various languages, examine the resource data.

- * - *

There is actually much more flexibility built into the rule language than the - * description above shows. A formatter may own multiple rule sets, which can be selected by - * the caller, and which can use each other to fill in their substitutions. Substitutions can - * also be filled in with digits, using a DecimalFormat object. There is syntax that can be - * used to alter a rule's divisor in various ways. And there is provision for much more - * flexible fraction handling. A complete description of the rule syntax follows:

- * - *
- * - *

The description of a RuleBasedNumberFormat's behavior consists of one or more rule - * sets. Each rule set consists of a name, a colon, and a list of rules. A rule - * set name must begin with a % sign. Rule sets with names that begin with a single % sign - * are public: the caller can specify that they be used to format and parse numbers. - * Rule sets with names that begin with %% are private: they exist only for the use - * of other rule sets. If a formatter only has one rule set, the name may be omitted.

- * - *

The user can also specify a special "rule set" named %%lenient-parse. - * The body of %%lenient-parse isn't a set of number-formatting rules, but a RuleBasedCollator - * description which is used to define equivalences for lenient parsing. For more information - * on the syntax, see RuleBasedCollator. For more information on lenient parsing, - * see setLenientParse().

- * - *

The body of a rule set consists of an ordered, semicolon-delimited list of rules. - * Internally, every rule has a base value, a divisor, rule text, and zero, one, or two substtutions. - * These parameters are controlled by the description syntax, which consists of a rule - * descriptor, a colon, and a rule body.

- * - *

A rule descriptor can take one of the following forms (text in italics is the - * name of a token):

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
bv:bv specifies the rule's base value. bv is a decimal - * number expressed using ASCII digits. bv may contain spaces, period, and commas, - * which are irgnored. The rule's divisor is the highest power of 10 less than or equal to - * the base value.
bv/rad:bv specifies the rule's base value. The rule's divisor is the - * highest power of rad less than or equal to the base value.
bv>:bv specifies the rule's base value. To calculate the divisor, - * let the radix be 10, and the exponent be the highest exponent of the radix that yields a - * result less than or equal to the base value. Every > character after the base value - * decreases the exponent by 1. If the exponent is positive or 0, the divisor is the radix - * raised to the power of the exponent; otherwise, the divisor is 1.
bv/rad>:bv specifies the rule's base value. To calculate the divisor, - * let the radix be rad, and the exponent be the highest exponent of the radix that - * yields a result less than or equal to the base value. Every > character after the radix - * decreases the exponent by 1. If the exponent is positive or 0, the divisor is the radix - * raised to the power of the exponent; otherwise, the divisor is 1.
-x:The rule is a negative-number rule.
x.x:The rule is an improper fraction rule.
0.x:The rule is a proper fraction rule.
x.0:The rule is a master rule.
nothingIf the rule's rule descriptor is left out, the base value is one plus the - * preceding rule's base value (or zero if this is the first rule in the list) in a normal - * rule set.  In a fraction rule set, the base value is the same as the preceding rule's - * base value.
- * - *

A rule set may be either a regular rule set or a fraction rule set, depending - * on whether it is used to format a number's integral part (or the whole number) or a - * number's fractional part. Using a rule set to format a rule's fractional part makes it a - * fraction rule set.

- * - *

Which rule is used to format a number is defined according to one of the following - * algorithms: If the rule set is a regular rule set, do the following: - * - *

    - *
  • If the rule set includes a master rule (and the number was passed in as a double), - * use the master rule.  (If the number being formatted was passed in as a long, - * the master rule is ignored.)
  • - *
  • If the number is negative, use the negative-number rule.
  • - *
  • If the number has a fractional part and is greater than 1, use the improper fraction - * rule.
  • - *
  • If the number has a fractional part and is between 0 and 1, use the proper fraction - * rule.
  • - *
  • Binary-search the rule list for the rule with the highest base value less than or equal - * to the number. If that rule has two substitutions, its base value is not an even multiple - * of its divisor, and the number is an even multiple of the rule's divisor, use the - * rule that precedes it in the rule list. Otherwise, use the rule itself.
  • - *
- * - *

If the rule set is a fraction rule set, do the following: - * - *

    - *
  • Ignore negative-number and fraction rules.
  • - *
  • For each rule in the list, multiply the number being formatted (which will always be - * between 0 and 1) by the rule's base value. Keep track of the distance between the result - * the nearest integer.
  • - *
  • Use the rule that produced the result closest to zero in the above calculation. In the - * event of a tie or a direct hit, use the first matching rule encountered. (The idea here is - * to try each rule's base value as a possible denominator of a fraction. Whichever - * denominator produces the fraction closest in value to the number being formatted wins.) If - * the rule following the matching rule has the same base value, use it if the numerator of - * the fraction is anything other than 1; if the numerator is 1, use the original matching - * rule. (This is to allow singular and plural forms of the rule text without a lot of extra - * hassle.)
  • - *
- * - *

A rule's body consists of a string of characters terminated by a semicolon. The rule - * may include zero, one, or two substitution tokens, and a range of text in - * brackets. The brackets denote optional text (and may also include one or both - * substitutions). The exact meanings of the substitution tokens, and under what conditions - * optional text is omitted, depend on the syntax of the substitution token and the context. - * The rest of the text in a rule body is literal text that is output when the rule matches - * the number being formatted.

- * - *

A substitution token begins and ends with a token character. The token - * character and the context together specify a mathematical operation to be performed on the - * number being formatted. An optional substitution descriptor specifies how the - * value resulting from that operation is used to fill in the substitution. The position of - * the substitution token in the rule body specifies the location of the resultant text in - * the original rule text.

- * - *

The meanings of the substitution token characters are as follows:

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
>>in normal ruleDivide the number by the rule's divisor and format the remainder
in negative-number ruleFind the absolute value of the number and format the result
in fraction or master ruleIsolate the number's fractional part and format it.
in rule in fraction rule setNot allowed.
>>>in normal ruleDivide the number by the rule's divisor and format the remainder, - * but bypass the normal rule-selection process and just use the - * rule that precedes this one in this rule list.
in all other rulesNot allowed.
<<in normal ruleDivide the number by the rule's divisor and format the quotient
in negative-number ruleNot allowed.
in fraction or master ruleIsolate the number's integral part and format it.
in rule in fraction rule setMultiply the number by the rule's base value and format the result.
==in all rule setsFormat the number unchanged
[]in normal ruleOmit the optional text if the number is an even multiple of the rule's divisor
in negative-number ruleNot allowed.
in improper-fraction ruleOmit the optional text if the number is between 0 and 1 (same as specifying both an - * x.x rule and a 0.x rule)
in master ruleOmit the optional text if the number is an integer (same as specifying both an x.x - * rule and an x.0 rule)
in proper-fraction ruleNot allowed.
in rule in fraction rule setOmit the optional text if multiplying the number by the rule's base value yields 1.
- * - *

The substitution descriptor (i.e., the text between the token characters) may take one - * of three forms:

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
a rule set namePerform the mathematical operation on the number, and format the result using the - * named rule set.
a DecimalFormat patternPerform the mathematical operation on the number, and format the result using a - * DecimalFormat with the specified pattern.  The pattern must begin with 0 or #.
nothingPerform the mathematical operation on the number, and format the result using the rule - * set containing the current rule, except:
    - *
  • You can't have an empty substitution descriptor with a == substitution.
  • - *
  • If you omit the substitution descriptor in a >> substitution in a fraction rule, - * format the result one digit at a time using the rule set containing the current rule.
  • - *
  • If you omit the substitution descriptor in a << substitution in a rule in a - * fraction rule set, format the result using the default rule set for this formatter.
  • - *
- *
- * - *

Whitespace is ignored between a rule set name and a rule set body, between a rule - * descriptor and a rule body, or between rules. If a rule body begins with an apostrophe, - * the apostrophe is ignored, but all text after it becomes significant (this is how you can - * have a rule's rule text begin with whitespace). There is no escape function: the semicolon - * is not allowed in rule set names or in rule text, and the colon is not allowed in rule set - * names. The characters beginning a substitution token are always treated as the beginning - * of a substitution token.

- * - *

See the resource data and the demo program for annotated examples of real rule sets - * using these features.

- * - * @author Richard Gillam - * $RCSfile: RuleBasedNumberFormat.java,v $ $Revision: 1.4 $ $Date: 2001/11/12 20:02:00 $ - * @see NumberFormat - * @see DecimalFormat - */ -public final class RuleBasedNumberFormat extends NumberFormat { - - //----------------------------------------------------------------------- - // constants - //----------------------------------------------------------------------- - - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - /** - * Selector code that tells the constructor to create a spellout formatter - */ - public static final int SPELLOUT = 1; - - /** - * Selector code that tells the constructor to create an ordinal formatter - */ - public static final int ORDINAL = 2; - - /** - * Selector code that tells the constructor to create a duration formatter - */ - public static final int DURATION = 3; - - //----------------------------------------------------------------------- - // data members - //----------------------------------------------------------------------- - - /** - * The formatter's rule sets. - */ - private NFRuleSet[] ruleSets = null; - - /** - * A pointer to the formatter's default rule set. This is always included - * in ruleSets. - */ - private NFRuleSet defaultRuleSet = null; - - /** - * The formatter's locale. This is used to create DecimalFormatSymbols and - * Collator objects. - */ - private Locale locale = null; - - /** - * Collator to be used in lenient parsing. This variable is lazy-evaluated: - * the collator is actually created the first time the client does a parse - * with lenient-parse mode turned on. - */ - private Collator collator = null; - - /** - * The DecimalFormatSymbols object that any DecimalFormat objects this - * formatter uses should use. This variable is lazy-evaluated: it isn't - * filled in if the rule set never uses a DecimalFormat pattern. - */ - private DecimalFormatSymbols decimalFormatSymbols = null; - - /** - * Flag specifying whether lenient parse mode is on or off. Off by default. - */ - private boolean lenientParse = false; - - /** - * If the description specifies lenient-parse rules, they're stored here until - * the collator is created. - */ - private String lenientParseRules = null; - - //----------------------------------------------------------------------- - // constructors - //----------------------------------------------------------------------- - - /** - * Creates a RuleBasedNumberFormat that behaves according to the description - * passed in. The formatter uses the default locale. - * @param description A description of the formatter's desired behavior. - * See the class documentation for a complete explanation of the description - * syntax. - */ - public RuleBasedNumberFormat(String description) { - locale = Locale.getDefault(); - init(description); - } - - /** - * Creates a RuleBasedNumberFormat that behaves according to the description - * passed in. The formatter uses the specified locale to determine the - * characters to use when formatting in numerals, and to define equivalences - * for lenient parsing. - * @param description A description of the formatter's desired behavior. - * See the class documentation for a complete explanation of the description - * syntax. - * @param locale A locale, which governs which characters are used for - * formatting values in numerals, and which characters are equivalent in - * lenient parsing. - */ - public RuleBasedNumberFormat(String description, Locale locale) { - this.locale = locale; - init(description); - } - - /** - * Creates a RuleBasedNumberFormat from a predefined description. The selector - * code choosed among three possible predefined formats: spellout, ordinal, - * and duration. - * @param locale The locale for the formatter. - * @param format A selector code specifying which kind of formatter to create for that - * locale. There are three legal values: SPELLOUT, which creates a formatter that - * spells out a value in words in the desired language, ORDINAL, which attaches - * an ordinal suffix from the desired language to the end of a number (e.g. "123rd"), - * and DURATION, which formats a duration in seconds as hours, minutes, and seconds. - */ - public RuleBasedNumberFormat(Locale locale, int format) { - this.locale = locale; - - // load up the resource bundle containing the description - // from the specified locale - ResourceBundle bundle = ResourceBundle.getBundle( - "com.ibm.text.resources.NumberFormatRules", - locale); - String description = ""; - - // pick a description from the resource bundle based on the - // kind of formatter the user asked for - switch (format) { - case SPELLOUT: - description = bundle.getString("SpelloutRules"); - break; - - case ORDINAL: - description = bundle.getString("OrdinalRules"); - break; - - case DURATION: - description = bundle.getString("DurationRules"); - break; - } - - // construct the formatter based on the description - init(description); - } - - /** - * Creates a RuleBasedNumberFormat from a predefined description. Uses the - * default locale. - * @param format A selector code specifying which kind of formatter to create. - * There are three legal values: SPELLOUT, which creates a formatter that spells - * out a value in words in the default locale's langyage, ORDINAL, which attaches - * an ordinal suffix from the default locale's language to a numeral, and - * DURATION, which formats a duration in seconds as hours, minutes, and seconds. - */ - public RuleBasedNumberFormat(int format) { - this(Locale.getDefault(), format); - } - - //----------------------------------------------------------------------- - // boilerplate - //----------------------------------------------------------------------- - - /** - * Duplicates this formatter. - * @return A RuleBasedNumberFormat that is equal to this one. - */ - public Object clone() { - return super.clone(); - } - - /** - * Tests two RuleBasedNumberFormats for equality. - * @param that The formatter to compare against this one. - * @return true if the two formatters have identical behavior. - */ - public boolean equals(Object that) { - // if the other object isn't a RuleBasedNumberFormat, that's - // all we need to know - if (!(that instanceof RuleBasedNumberFormat)) { - return false; - } else { - // cast the other object's pointer to a pointer to a - // RuleBasedNumberFormat - RuleBasedNumberFormat that2 = (RuleBasedNumberFormat)that; - - // compare their locales and lenient-parse modes - if (!locale.equals(that2.locale) || lenientParse != that2.lenientParse) { - return false; - } - - // if that succeeds, then compare their rule set lists - if (ruleSets.length != that2.ruleSets.length) { - return false; - } - for (int i = 0; i < ruleSets.length; i++) { - if (!ruleSets[i].equals(that2.ruleSets[i])) { - return false; - } - } - - return true; - } - } - - /** - * Generates a textual description of this formatter. - * @return a String containing a rule set that will produce a RuleBasedNumberFormat - * with identical behavior to this one. This won't necessarily be identical - * to the rule set description that was originally passed in, but will produce - * the same result. - */ - public String toString() { - - // accumulate the descriptions of all the rule sets in a - // StringBuffer, then cast it to a String and return it - StringBuffer result = new StringBuffer(); - for (int i = 0; i < ruleSets.length; i++) { - result.append(ruleSets[i].toString()); - } - return result.toString(); - } - - /** - * Writes this object to a stream. - * @param out The stream to write to. - */ - private void writeObject(java.io.ObjectOutputStream out) - throws java.io.IOException { - // we just write the textual description to the stream, so we - // have an implementation-independent streaming format - out.writeUTF(this.toString()); - } - - /** - * Reads this object in from a stream. - * @param in The stream to read from. - */ - private void readObject(java.io.ObjectInputStream in) - throws java.io.IOException { - - // read the description in from the stream - String description = in.readUTF(); - - // build a brand-new RuleBasedNumberFormat from the description, - // then steal its substructure. This object's substructure and - // the temporary RuleBasedNumberFormat drop on the floor and - // get swept up by the garbage collector - RuleBasedNumberFormat temp = new RuleBasedNumberFormat(description); - ruleSets = temp.ruleSets; - defaultRuleSet = temp.defaultRuleSet; - } - - - //----------------------------------------------------------------------- - // public API functions - //----------------------------------------------------------------------- - - /** - * Returns a list of the names of all of this formatter's public rule sets. - * @return A list of the names of all of this formatter's public rule sets. - */ - public String[] getRuleSetNames() { - // preflight the iteration, counting the number of public rule sets - // (public rule sets have names that begin with % instead of %%) - int count = 0; - for (int i = 0; i < ruleSets.length; i++) { - if (!ruleSets[i].getName().startsWith("%%")) { - ++count; - } - } - - // then new up an array of the proper size and copy the names into it - String[] result = new String[count]; - count = 0; - for (int i = ruleSets.length - 1; i >= 0; i--) { - if (!ruleSets[i].getName().startsWith("%%")) { - result[count++] = ruleSets[i].getName(); - } - } - - return result; - } - - /** - * Formats the specified number according to the specified rule set. - * @param number The number to format. - * @param ruleSet The name of the rule set to format the number with. - * This must be the name of a valid public rule set for this formatter. - * @return A textual representation of the number. - */ - public String format(double number, String ruleSet) throws IllegalArgumentException { - if (ruleSet.startsWith("%%")) { - throw new IllegalArgumentException("Can't use internal rule set"); - } - return format(number, findRuleSet(ruleSet)); - } - - /** - * Formats the specified number according to the specified rule set. - * (If the specified rule set specifies a master ["x.0"] rule, this function - * ignores it. Convert the number to a double first if you ned it.) This - * function preserves all the precision in the long-- it doesn't convert it - * to a double. - * @param number The number to format. - * @param ruleSet The name of the rule set to format the number with. - * This must be the name of a valid public rule set for this formatter. - * @return A textual representation of the number. - */ - public String format(long number, String ruleSet) throws IllegalArgumentException { - if (ruleSet.startsWith("%%")) { - throw new IllegalArgumentException("Can't use internal rule set"); - } - return format(number, findRuleSet(ruleSet)); - } - - /** - * Formats the specified number using the formatter's default rule set. - * (The default rule set is the last public rule set defined in the description.) - * @param number The number to format. - * @param toAppendTo A StringBuffer that the result should be appended to. - * @param ignore This function doesn't examine or update the field position. - * @return toAppendTo - */ - public StringBuffer format(double number, - StringBuffer toAppendTo, - FieldPosition ignore) { - // this is one of the inherited format() methods. Since it doesn't - // have a way to select the rule set to use, it just uses the - // default one - toAppendTo.append(format(number, defaultRuleSet)); - return toAppendTo; - } - - /** - * Formats the specified number using the formatter's default rule set. - * (The default rule set is the last public rule set defined in the description.) - * (If the specified rule set specifies a master ["x.0"] rule, this function - * ignores it. Convert the number to a double first if you ned it.) This - * function preserves all the precision in the long-- it doesn't convert it - * to a double. - * @param number The number to format. - * @param toAppendTo A StringBuffer that the result should be appended to. - * @param ignore This function doesn't examine or update the field position. - * @return toAppendTo - */ - public StringBuffer format(long number, - StringBuffer toAppendTo, - FieldPosition ignore) { - // this is one of the inherited format() methods. Since it doesn't - // have a way to select the rule set to use, it just uses the - // default one - toAppendTo.append(format(number, defaultRuleSet)); - return toAppendTo; - } - - /** - * NEW - * Implement com.ibm.text.NumberFormat: - * Format a BigInteger. - */ - public StringBuffer format(BigInteger number, - StringBuffer toAppendTo, - FieldPosition pos) { - return format(new com.ibm.math.BigDecimal(number), toAppendTo, pos); - } - - /** - * NEW - * Implement com.ibm.text.NumberFormat: - * Format a BigDecimal. - */ - public StringBuffer format(java.math.BigDecimal number, - StringBuffer toAppendTo, - FieldPosition pos) { - return format(new com.ibm.math.BigDecimal(number), toAppendTo, pos); - } - - /** - * NEW - * Implement com.ibm.text.NumberFormat: - * Format a BigDecimal. - */ - public StringBuffer format(com.ibm.math.BigDecimal number, - StringBuffer toAppendTo, - FieldPosition pos) { - // TEMPORARY: - return format(number.doubleValue(), toAppendTo, pos); - } - - /** - * Parses the specfied string, beginning at the specified position, according - * to this formatter's rules. This will match the string against all of the - * formatter's public rule sets and return the value corresponding to the longest - * parseable substring. This function's behavior is affected by the lenient - * parse mode. - * @param text The string to parse - * @param parsePosition On entry, contains the position of the first character - * in "text" to examine. On exit, has been updated to contain the position - * of the first character in "text" that wasn't consumed by the parse. - * @return The number that corresponds to the parsed text. This will be an - * instance of either Long or Double, depending on whether the result has a - * fractional part. - * @see #setLenientParseMode - */ - public Number parse(String text, ParsePosition parsePosition) { - - // parsePosition tells us where to start parsing. We copy the - // text in the string from here to the end inro a new string, - // and create a new ParsePosition and result variable to use - // for the duration of the parse operation - String workingText = text.substring(parsePosition.getIndex()); - ParsePosition workingPos = new ParsePosition(0); - Number tempResult = null; - - // keep track of the largest number of characters consumed in - // the various trials, and the result that corresponds to it - Number result = new Long(0); - ParsePosition highWaterMark = new ParsePosition(workingPos.getIndex()); - - // iterate over the public rule sets (beginning with the default one) - // and try parsing the text with each of them. Keep track of which - // one consumes the most characters: that's the one that determines - // the result we return - for (int i = ruleSets.length - 1; i >= 0; i--) { - // skip private rule sets - if (ruleSets[i].getName().startsWith("%%")) { - continue; - } - - // try parsing the string with the rule set. If it gets past the - // high-water mark, update the high-water mark and the result - tempResult = ruleSets[i].parse(workingText, workingPos, Double.MAX_VALUE); - if (workingPos.getIndex() > highWaterMark.getIndex()) { - result = tempResult; - highWaterMark.setIndex(workingPos.getIndex()); - } -// commented out because this API on ParsePosition doesn't exist in 1.1.x -// if (workingPos.getErrorIndex() > highWaterMark.getErrorIndex()) { -// highWaterMark.setErrorIndex(workingPos.getErrorIndex()); -// } - - // if we manage to use up all the characters in the string, - // we don't have to try any more rule sets - if (highWaterMark.getIndex() == workingText.length()) { - break; - } - - // otherwise, reset our internal parse position to the - // beginning and try again with the next rule set - workingPos.setIndex(0); - } - - // add the high water mark to our original parse position and - // return the result - parsePosition.setIndex(parsePosition.getIndex() + highWaterMark.getIndex()); -// commented out because this API on ParsePosition doesn't exist in 1.1.x -// if (highWaterMark.getIndex() == 0) { -// parsePosition.setErrorIndex(parsePosition.getIndex() + highWaterMark.getErrorIndex()); -// } - return result; - } - - /** - * Turns lenient parse mode on and off. - * - * When in lenient parse mode, the formatter uses a Collator for parsing the text. - * Only primary differences are treated as significant. This means that case - * differences, accent differences, alternate spellings of the same letter - * (e.g., ae and a-umlaut in German), ignorable characters, etc. are ignored in - * matching the text. In many cases, numerals will be accepted in place of words - * or phrases as well. - * - * For example, all of the following will correctly parse as 255 in English in - * lenient-parse mode: - *
"two hundred fifty-five" - *
"two hundred fifty five" - *
"TWO HUNDRED FIFTY-FIVE" - *
"twohundredfiftyfive" - *
"2 hundred fifty-5" - * - * The Collator used is determined by the locale that was - * passed to this object on construction. The description passed to this object - * on construction may supply additional collation rules that are appended to the - * end of the default collator for the locale, enabling additional equivalences - * (such as adding more ignorable characters or permitting spelled-out version of - * symbols; see the demo program for examples). - * - * It's important to emphasize that even strict parsing is relatively lenient: it - * will accept some text that it won't produce as output. In English, for example, - * it will correctly parse "two hundred zero" and "fifteen hundred". - * - * @param enabled If true, turns lenient-parse mode on; if false, turns it off. - * @see java.text.RuleBasedCollator - */ - public void setLenientParseMode(boolean enabled) { - lenientParse = enabled; - - // if we're leaving lenient-parse mode, throw away the collator - // we've been using - if (!enabled) { - collator = null; - } - } - - /** - * Returns true if lenient-parse mode is turned on. Lenient parsing is off - * by default. - * @return true if lenient-parse mode is turned on. - * @see #setLenientParseMode - */ - public boolean lenientParseEnabled() { - return lenientParse; - } - - /** - * Override the default rule set to use. If ruleSetName is null, reset - * to the initial default rule set. - * @param ruleSetName the name of the rule set, or null to reset the initial default. - * @throws IllegalArgumentException if ruleSetName is not the name of a public ruleset. - */ - public void setDefaultRuleSet(String ruleSetName) { - if (ruleSetName == null) { - initDefaultRuleSet(); - } else if (ruleSetName.startsWith("%%")) { - throw new IllegalArgumentException("cannot use private rule set: " + ruleSetName); - } else { - defaultRuleSet = findRuleSet(ruleSetName); - } - } - - //----------------------------------------------------------------------- - // package-internal API - //----------------------------------------------------------------------- - - /** - * Returns a reference to the formatter's default rule set. The default - * rule set is the last public rule set in the description, or the one - * most recently set by setDefaultRuleSet. - * @return The formatter's default rule set. - */ - NFRuleSet getDefaultRuleSet() { - return defaultRuleSet; - } - - /** - * Returns the collator to use for lenient parsing. The collator is lazily created: - * this function creates it the first time it's called. - * @return The collator to use for lenient parsing, or null if lenient parsing - * is turned off. - */ - Collator getCollator() { - // lazy-evaulate the collator - if (collator == null && lenientParse) { - try { - // create a default collator based on the formatter's locale, - // then pull out that collator's rules, append any additional - // rules specified in the description, and create a _new_ - // collator based on the combinaiton of those rules - RuleBasedCollator temp = (RuleBasedCollator)collator.getInstance(locale); - String rules = temp.getRules() + lenientParseRules; - - collator = new RuleBasedCollator(rules); - collator.setDecomposition(Collator.CANONICAL_DECOMPOSITION); - } - catch (Exception e) { - // If we get here, it means we have a malformed set of - // collation rules, which hopefully won't happen - e.printStackTrace(); - collator = null; - } - } - - // if lenient-parse mode is off, this will be null - // (see setLenientParseMode()) - return collator; - } - - /** - * Returns the DecimalFormatSymbols object that should be used by all DecimalFormat - * instances owned by this formatter. This object is lazily created: this function - * creates it the first time it's called. - * @return The DecimalFormatSymbols object that should be used by all DecimalFormat - * instances owned by this formatter. - */ - DecimalFormatSymbols getDecimalFormatSymbols() { - // lazy-evaluate the DecimalFormatSymbols object. This object - // is shared by all DecimalFormat instances belonging to this - // formatter - if (decimalFormatSymbols == null) { - decimalFormatSymbols = new DecimalFormatSymbols(locale); - } - return decimalFormatSymbols; - } - - //----------------------------------------------------------------------- - // construction implementation - //----------------------------------------------------------------------- - - /** - * This function parses the description and uses it to build all of - * internal data structures that the formatter uses to do formatting - * @param description The description of the formatter's desired behavior. - * This is either passed in by the caller or loaded out of a resource - * by one of the constructors, and is in the description format specified - * in the class docs. - */ - private void init(String description) { - // start by stripping the trailing whitespace from all the rules - // (this is all the whitespace follwing each semicolon in the - // description). This allows us to look for rule-set boundaries - // by searching for ";%" without having to worry about whitespace - // between the ; and the % - description = stripWhitespace(description); - - // check to see if there's a set of lenient-parse rules. If there - // is, pull them out into our temporary holding place for them, - // and delete them from the description before the real desciption- - // parsing code sees them - int lp = description.indexOf("%%lenient-parse:"); - if (lp != -1) { - // we've got to make sure we're not in the middle of a rule - // (where "%%lenient-parse" would actually get treated as - // rule text) - if (lp == 0 || description.charAt(lp - 1) == ';') { - // locate the beginning and end of the actual collation - // rules (there may be whitespace between the name and - // the first token in the description) - int lpEnd = description.indexOf(";%", lp); - - if (lpEnd == -1) { - lpEnd = description.length() - 1; - } - int lpStart = lp + "%%lenient-parse:".length(); - while (Character.isWhitespace(description.charAt(lpStart))) { - ++lpStart; - } - - // copy out the lenient-parse rules and delete them - // from the description - lenientParseRules = description.substring(lpStart, lpEnd); - StringBuffer temp = new StringBuffer(description.substring(0, lp)); - if (lpEnd + 1 < description.length()) { - temp.append(description.substring(lpEnd + 1)); - } - description = temp.toString(); - } - } - - // pre-flight parsing the description and count the number of - // rule sets (";%" marks the end of one rule set and the beginning - // of the next) - int numRuleSets = 0; - for (int p = description.indexOf(";%"); p != -1; p = description.indexOf(";%", p)) { - ++numRuleSets; - ++p; - } - ++numRuleSets; - - // our rule list is an array of the apprpriate size - ruleSets = new NFRuleSet[numRuleSets]; - - // divide up the descriptions into individual rule-set descriptions - // and store them in a temporary array. At each step, we also - // new up a rule set, but all this does is initialize its name - // and remove it from its description. We can't actually parse - // the rest of the descriptions and finish initializing everything - // because we have to know the names and locations of all the rule - // sets before we can actually set everything up - String[] ruleSetDescriptions = new String[numRuleSets]; - - int curRuleSet = 0; - int start = 0; - for (int p = description.indexOf(";%"); p != -1; p = description.indexOf(";%", start)) { - ruleSetDescriptions[curRuleSet] = description.substring(start, p + 1); - ruleSets[curRuleSet] = new NFRuleSet(ruleSetDescriptions, curRuleSet); - ++curRuleSet; - start = p + 1; - } - ruleSetDescriptions[curRuleSet] = description.substring(start); - ruleSets[curRuleSet] = new NFRuleSet(ruleSetDescriptions, curRuleSet); - - // now we can take note of the formatter's default rule set, which - // is the last public rule set in the description (it's the last - // rather than the first so that a user can create a new formatter - // from an existing formatter and change its default bevhaior just - // by appending more rule sets to the end) - initDefaultRuleSet(); - - // finally, we can go back through the temporary descriptions - // list and finish seting up the substructure (and we throw - // away the temporary descriptions as we go) - for (int i = 0; i < ruleSets.length; i++) { - ruleSets[i].parseRules(ruleSetDescriptions[i], this); - ruleSetDescriptions[i] = null; - } - } - - /** - * This function is used by init() to strip whitespace between rules (i.e., - * after semicolons). - * @param description The formatter description - * @return The description with all the whitespace that follows semicolons - * taken out. - */ - private String stripWhitespace(String description) { - // since we don't have a method that deletes characters (why?!!) - // create a nwe StringBuffer to copy the text into - StringBuffer result = new StringBuffer(); - - // iterate through the characters... - int start = 0; - while (start != -1 && start < description.length()) { - // seek to the first non-whitespace character... - while (start < description.length() - && Character.isWhitespace(description.charAt(start))) { - ++start; - } - - // locate the next semicolon in the text and copyt he text from - // our current position up to that semicolon into the result - int p; - p = description.indexOf(';', start); - if (p == -1) { - // or if we don't find a semicolon, just copy the rest of - // the string into the result - result.append(description.substring(start)); - start = -1; - } - else if (p < description.length()) { - result.append(description.substring(start, p + 1)); - start = p + 1; - } - - // when we get here, we've seeked off the end of the sring, and - // we terminate the loop (we continue until *start* is -1 rather - // than until *p* is -1, because otherwise we'd miss the last - // rule in the description) - else { - start = -1; - } - } - return result.toString(); - } - - /** - * This function is called ONLY DURING CONSTRUCTION to fill in the - * defaultRuleSet variable once we've set up all the rule sets. - * The default rule set is the last public rule set in the description. - * (It's the last rather than the first so that a caller can append - * text to the end of an existing formatter description to change its - * behavior.) - */ - private void initDefaultRuleSet() { - // seek backward from the end of the list until we reach a rule set - // whose name DOESN'T begin with %%. That's the default rule set - for (int i = ruleSets.length - 1; i >= 0; --i) { - if (!ruleSets[i].getName().startsWith("%%")) { - defaultRuleSet = ruleSets[i]; - return; - } - } - defaultRuleSet = ruleSets[ruleSets.length - 1]; - } - - //----------------------------------------------------------------------- - // formatting implementation - //----------------------------------------------------------------------- - - /** - * Bottleneck through which all the public format() methods - * that take a double pass. By the time we get here, we know - * which rule set we're using to do the formatting. - * @param number The number to format - * @param ruleSet The rule set to use to format the number - * @return The text that resulted from formatting the number - */ - String format(double number, NFRuleSet ruleSet) { - // all API format() routines that take a double vector through - // here. Create an empty string buffer where the result will - // be built, and pass it to the rule set (along with an insertion - // position of 0 and the number being formatted) to the rule set - // for formatting - StringBuffer result = new StringBuffer(); - ruleSet.format(number, result, 0); - return result.toString(); - } - - /** - * Bottleneck through which all the public format() methods - * that take a long pass. By the time we get here, we know - * which rule set we're using to do the formatting. - * @param number The number to format - * @param ruleSet The rule set to use to format the number - * @return The text that resulted from formatting the number - */ - String format(long number, NFRuleSet ruleSet) { - // all API format() routines that take a double vector through - // here. We have these two identical functions-- one taking a - // double and one taking a long-- the couple digits of precision - // that long has but double doesn't (both types are 8 bytes long, - // but double has to borrow some of the mantissa bits to hold - // the exponent). - // Create an empty string buffer where the result will - // be built, and pass it to the rule set (along with an insertion - // position of 0 and the number being formatted) to the rule set - // for formatting - StringBuffer result = new StringBuffer(); - ruleSet.format(number, result, 0); - return result.toString(); - } - - /** - * Returns the named rule set. Throws an IllegalArgumentException - * if this formatter doesn't have a rule set with that name. - * @param name The name of the desired rule set - * @return The rule set with that name - */ - NFRuleSet findRuleSet(String name) throws IllegalArgumentException { - for (int i = 0; i < ruleSets.length; i++) { - if (ruleSets[i].getName().equals(name)) { - return ruleSets[i]; - } - } - throw new IllegalArgumentException("No rule set named " + name); - } -} - diff --git a/icu4j/src/com/ibm/text/RuleBasedTransliterator.java b/icu4j/src/com/ibm/text/RuleBasedTransliterator.java deleted file mode 100755 index 6e7b0c6b6e..0000000000 --- a/icu4j/src/com/ibm/text/RuleBasedTransliterator.java +++ /dev/null @@ -1,609 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/RuleBasedTransliterator.java,v $ - * $Date: 2002/02/07 00:53:54 $ - * $Revision: 1.52 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.util.Hashtable; -import java.util.Vector; -import java.text.ParsePosition; -import com.ibm.util.Utility; -import com.ibm.text.resources.ResourceReader; - -/** - * RuleBasedTransliterator is a transliterator - * that reads a set of rules in order to determine how to perform - * translations. Rule sets are stored in resource bundles indexed by - * name. Rules within a rule set are separated by semicolons (';'). - * To include a literal semicolon, prefix it with a backslash ('\'). - * Whitespace, as defined by Character.isWhitespace(), - * is ignored. If the first non-blank character on a line is '#', - * the entire line is ignored as a comment.

- * - *

Each set of rules consists of two groups, one forward, and one - * reverse. This is a convention that is not enforced; rules for one - * direction may be omitted, with the result that translations in - * that direction will not modify the source text. In addition, - * bidirectional forward-reverse rules may be specified for - * symmetrical transformations.

- * - *

Rule syntax

- * - *

Rule statements take one of the following forms:

- * - *
- *
$alefmadda=\u0622;
- *
Variable definition. The name on the - * left is assigned the text on the right. In this example, - * after this statement, instances of the left hand name, - * "$alefmadda", will be replaced by - * the Unicode character U+0622. Variable names must begin - * with a letter and consist only of letters, digits, and - * underscores. Case is significant. Duplicate names cause - * an exception to be thrown, that is, variables cannot be - * redefined. The right hand side may contain well-formed - * text of any length, including no text at all ("$empty=;"). - * The right hand side may contain embedded UnicodeSet - * patterns, for example, "$softvowel=[eiyEIY]".
- *
 
- *
ai>$alefmadda;
- *
Forward translation rule. This rule - * states that the string on the left will be changed to the - * string on the right when performing forward - * transliteration.
- *
 
- *
ai<$alefmadda;
- *
Reverse translation rule. This rule - * states that the string on the right will be changed to - * the string on the left when performing reverse - * transliteration.
- *
- * - *
- *
ai<>$alefmadda;
- *
Bidirectional translation rule. This - * rule states that the string on the right will be changed - * to the string on the left when performing forward - * transliteration, and vice versa when performing reverse - * transliteration.
- *
- * - *

Translation rules consist of a match pattern and an output - * string. The match pattern consists of literal characters, - * optionally preceded by context, and optionally followed by - * context. Context characters, like literal pattern characters, - * must be matched in the text being transliterated. However, unlike - * literal pattern characters, they are not replaced by the output - * text. For example, the pattern "abc{def}" - * indicates the characters "def" must be - * preceded by "abc" for a successful match. - * If there is a successful match, "def" will - * be replaced, but not "abc". The final '}' - * is optional, so "abc{def" is equivalent to - * "abc{def}". Another example is "{123}456" - * (or "123}456") in which the literal - * pattern "123" must be followed by "456". - *

- * - *

The output string of a forward or reverse rule consists of - * characters to replace the literal pattern characters. If the - * output string contains the character '|', this is - * taken to indicate the location of the cursor after - * replacement. The cursor is the point in the text at which the - * next replacement, if any, will be applied. The cursor is usually - * placed within the replacement text; however, it can actually be - * placed into the precending or following context by using the - * special character '@'. Examples:

- * - *
- *

a {foo} z > | @ bar; # foo -> bar, move cursor - * before a
- * {foo} xyz > bar @@|; # foo -> bar, cursor between - * y and z

- *
- * - *

UnicodeSet

- * - *

UnicodeSet patterns may appear anywhere that - * makes sense. They may appear in variable definitions. - * Contrariwise, UnicodeSet patterns may themselves - * contain variable references, such as "$a=[a-z];$not_a=[^$a]", - * or "$range=a-z;$ll=[$range]".

- * - *

UnicodeSet patterns may also be embedded directly - * into rule strings. Thus, the following two rules are equivalent:

- * - *
- *

$vowel=[aeiou]; $vowel>'*'; # One way to do this
- * [aeiou]>'*'; - *                # - * Another way

- *
- * - *

See {@link UnicodeSet} for more documentation and examples.

- * - *

Segments

- * - *

Segments of the input string can be matched and copied to the - * output string. This makes certain sets of rules simpler and more - * general, and makes reordering possible. For example:

- * - *
- *

([a-z]) > $1 $1; - *           # - * double lowercase letters
- * ([:Lu:]) ([:Ll:]) > $2 $1; # reverse order of Lu-Ll pairs

- *
- * - *

The segment of the input string to be copied is delimited by - * "(" and ")". Up to - * nine segments may be defined. Segments may not overlap. In the - * output string, "$1" through "$9" - * represent the input string segments, in left-to-right order of - * definition.

- * - *

Anchors

- * - *

Patterns can be anchored to the beginning or the end of the text. This is done with the - * special characters '^' and '$'. For example:

- * - *
- *

^ a   > 'BEG_A';   # match 'a' at start of text
- *   a   > 'A';       # match other instances - * of 'a'
- *   z $ > 'END_Z';   # match 'z' at end of text
- *   z   > 'Z';       # match other instances - * of 'z'

- *
- * - *

It is also possible to match the beginning or the end of the text using a UnicodeSet. - * This is done by including a virtual anchor character '$' at the end of the - * set pattern. Although this is usually the match chafacter for the end anchor, the set will - * match either the beginning or the end of the text, depending on its placement. For - * example:

- * - *
- *

$x = [a-z$];   # match 'a' through 'z' OR anchor
- * $x 1    > 2;   # match '1' after a-z or at the start
- *    3 $x > 4;   # match '3' before a-z or at the end

- *
- * - *

Example

- * - *

The following example rules illustrate many of the features of - * the rule language.

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Rule 1.abc{def}>x|y
Rule 2.xyz>r
Rule 3.yz>q
- * - *

Applying these rules to the string "adefabcdefz" - * yields the following results:

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
|adefabcdefzInitial state, no rules match. Advance - * cursor.
a|defabcdefzStill no match. Rule 1 does not match - * because the preceding context is not present.
ad|efabcdefzStill no match. Keep advancing until - * there is a match...
ade|fabcdefz...
adef|abcdefz...
adefa|bcdefz...
adefab|cdefz...
adefabc|defzRule 1 matches; replace "def" - * with "xy" and back up the cursor - * to before the 'y'.
adefabcx|yzAlthough "xyz" is - * present, rule 2 does not match because the cursor is - * before the 'y', not before the 'x'. - * Rule 3 does match. Replace "yz" - * with "q".
adefabcxq|The cursor is at the end; - * transliteration is complete.
- * - *

The order of rules is significant. If multiple rules may match - * at some point, the first matching rule is applied.

- * - *

Forward and reverse rules may have an empty output string. - * Otherwise, an empty left or right hand side of any statement is a - * syntax error.

- * - *

Single quotes are used to quote any character other than a - * digit or letter. To specify a single quote itself, inside or - * outside of quotes, use two single quotes in a row. For example, - * the rule "'>'>o''clock" changes the - * string ">" to the string "o'clock". - *

- * - *

Notes

- * - *

While a RuleBasedTransliterator is being built, it checks that - * the rules are added in proper order. For example, if the rule - * "a>x" is followed by the rule "ab>y", - * then the second rule will throw an exception. The reason is that - * the second rule can never be triggered, since the first rule - * always matches anything it matches. In other words, the first - * rule masks the second rule.

- * - *

Copyright (c) IBM Corporation 1999-2000. All rights reserved.

- * - * @author Alan Liu - * @version $RCSfile: RuleBasedTransliterator.java,v $ $Revision: 1.52 $ $Date: 2002/02/07 00:53:54 $ - */ -public class RuleBasedTransliterator extends Transliterator { - - private Data data; - - private static final String COPYRIGHT = - "\u00A9 IBM Corporation 1999. All rights reserved."; - - /** - * Constructs a new transliterator from the given rules. - * @param rules rules, separated by ';' - * @param direction either FORWARD or REVERSE. - * @exception IllegalArgumentException if rules are malformed - * or direction is invalid. - */ - public RuleBasedTransliterator(String ID, String rules, int direction, - UnicodeFilter filter) { - super(ID, filter); - if (direction != FORWARD && direction != REVERSE) { - throw new IllegalArgumentException("Invalid direction"); - } - - TransliteratorParser parser = new TransliteratorParser(); - parser.parse(rules, direction); - if (parser.idBlock.length() != 0 || - parser.compoundFilter != null) { - throw new IllegalArgumentException("::ID blocks illegal in RuleBasedTransliterator constructor"); - } - - data = parser.data; - setMaximumContextLength(data.ruleSet.getMaximumContextLength()); - } - - /** - * Constructs a new transliterator from the given rules in the - * FORWARD direction. - * @param rules rules, separated by ';' - * @exception IllegalArgumentException if rules are malformed - * or direction is invalid. - */ - public RuleBasedTransliterator(String ID, String rules) { - this(ID, rules, FORWARD, null); - } - - RuleBasedTransliterator(String ID, Data data, UnicodeFilter filter) { - super(ID, filter); - this.data = data; - setMaximumContextLength(data.ruleSet.getMaximumContextLength()); - } - - /** - * Implements {@link Transliterator#handleTransliterate}. - */ - protected void handleTransliterate(Replaceable text, - Position index, boolean incremental) { - /* We keep start and limit fixed the entire time, - * relative to the text -- limit may move numerically if text is - * inserted or removed. The cursor moves from start to limit, with - * replacements happening under it. - * - * Example: rules 1. ab>x|y - * 2. yc>z - * - * |eabcd start - no match, advance cursor - * e|abcd match rule 1 - change text & adjust cursor - * ex|ycd match rule 2 - change text & adjust cursor - * exz|d no match, advance cursor - * exzd| done - */ - - /* A rule like - * a>b|a - * creates an infinite loop. To prevent that, we put an arbitrary - * limit on the number of iterations that we take, one that is - * high enough that any reasonable rules are ok, but low enough to - * prevent a server from hanging. The limit is 16 times the - * number of characters n, unless n is so large that 16n exceeds a - * uint32_t. - */ - int loopCount = 0; - int loopLimit = (index.limit - index.start) << 4; - if (loopLimit < 0) { - loopLimit = 0x7FFFFFFF; - } - - while (index.start < index.limit && - loopCount <= loopLimit && - data.ruleSet.transliterate(text, index, incremental)) { - ++loopCount; - } - } - - - static class Data { - public Data() { - variableNames = new Hashtable(); - ruleSet = new TransliterationRuleSet(); - } - - /** - * Rule table. May be empty. - */ - public TransliterationRuleSet ruleSet; - - /** - * Map variable name (String) to variable (char[]). A variable name - * corresponds to zero or more characters, stored in a char[] array in - * this hash. One or more of these chars may also correspond to a - * UnicodeSet, in which case the character in the char[] in this hash is - * a stand-in: it is an index for a secondary lookup in - * data.variables. The stand-in also represents the UnicodeSet in - * the stored rules. - */ - Hashtable variableNames; - - /** - * Map category variable (Character) to UnicodeMatcher or UnicodeReplacer. - * Variables that correspond to a set of characters are mapped - * from variable name to a stand-in character in data.variableNames. - * The stand-in then serves as a key in this hash to lookup the - * actual UnicodeSet object. In addition, the stand-in is - * stored in the rule text to represent the set of characters. - * variables[i] represents character (variablesBase + i). - */ - Object[] variables; - - /** - * The character that represents variables[0]. Characters - * variablesBase through variablesBase + - * variables.length - 1 represent UnicodeSet objects. - */ - char variablesBase; - - /** - * Return the UnicodeMatcher represented by the given character, or - * null if none. - */ - public UnicodeMatcher lookupMatcher(int standIn) { - int i = standIn - variablesBase; - return (i >= 0 && i < variables.length) - ? (UnicodeMatcher) variables[i] : null; - } - - /** - * Return the UnicodeReplacer represented by the given character, or - * null if none. - */ - public UnicodeReplacer lookupReplacer(int standIn) { - int i = standIn - variablesBase; - return (i >= 0 && i < variables.length) - ? (UnicodeReplacer) variables[i] : null; - } - } - - - /** - * Return a representation of this transliterator as source rules. - * These rules will produce an equivalent transliterator if used - * to construct a new transliterator. - * @param escapeUnprintable if TRUE then convert unprintable - * character to their hex escape representations, \\uxxxx or - * \\Uxxxxxxxx. Unprintable characters are those other than - * U+000A, U+0020..U+007E. - * @return rules string - */ - public String toRules(boolean escapeUnprintable) { - return data.ruleSet.toRules(escapeUnprintable); - } - - /** - * Return the set of all characters that may be modified by this - * Transliterator, ignoring the effect of filters. - */ - UnicodeSet getSourceSet() { - return data.ruleSet.getSourceSet(); - } -} - -/** - * $Log: RuleBasedTransliterator.java,v $ - * Revision 1.52 2002/02/07 00:53:54 alan - * jitterbug 1234: make output side of RBTs object-oriented; rewrite ID parsers and modularize them; implement &Any-Lower() support - * - * Revision 1.51 2001/11/29 22:31:18 alan - * jitterbug 1560: add source-set methods and TransliteratorUtility class - * - * Revision 1.50 2001/11/27 22:07:33 alan - * jitterbug 1389: incorporate Mark's review comments - comments only - * - * Revision 1.49 2001/10/10 20:26:27 alan - * jitterbug 81: initial implementation of compound filters in IDs and ::ID blocks - * - * Revision 1.48 2001/10/05 18:15:54 alan - * jitterbug 74: finish port of Source-Target/Variant code incl. TransliteratorRegistry and tests - * - * Revision 1.47 2001/10/03 00:14:22 alan - * jitterbug 73: finish quantifier and supplemental char support - * - * Revision 1.46 2001/09/26 18:00:06 alan - * jitterbug 67: sync parser with icu4c, allow unlimited, nested segments - * - * Revision 1.45 2001/09/24 19:57:17 alan - * jitterbug 60: implement toPattern in UnicodeSet; update UnicodeFilter.contains to take an int; update UnicodeSet to support code points to U+10FFFF - * - * Revision 1.44 2001/09/21 21:24:04 alan - * jitterbug 64: allow ::ID blocks in rules - * - * Revision 1.43 2001/09/19 17:43:37 alan - * jitterbug 60: initial implementation of toRules() - * - * Revision 1.42 2001/02/20 17:59:40 alan4j - * Remove backslash-u from log - * - * Revision 1.41 2001/02/16 18:53:55 alan4j - * Handle backslash-u escapes - * - * Revision 1.40 2001/02/03 00:46:21 alan4j - * Load RuleBasedTransliterator files from UTF8 files instead of ResourceBundles - * - * Revision 1.39 2000/08/31 17:11:42 alan4j - * Implement anchors. - * - * Revision 1.38 2000/08/30 20:40:30 alan4j - * Implement anchors. - * - * Revision 1.37 2000/07/12 16:31:36 alan4j - * Simplify loop limit logic - * - * Revision 1.36 2000/06/29 21:59:23 alan4j - * Fix handling of Transliterator.Position fields - * - * Revision 1.35 2000/06/28 20:49:54 alan4j - * Fix handling of Positions fields - * - * Revision 1.34 2000/06/28 20:36:32 alan4j - * Clean up Transliterator::Position - rename temporary names - * - * Revision 1.33 2000/06/28 20:31:43 alan4j - * Clean up Transliterator::Position and rename fields (related to jitterbug 450) - * - * Revision 1.32 2000/05/24 22:21:00 alan4j - * Compact UnicodeSets - * - * Revision 1.31 2000/05/23 16:48:27 alan4j - * Fix doc; remove unused auto - * - * Revision 1.30 2000/05/18 22:49:51 alan - * Update docs - * - * Revision 1.29 2000/04/28 00:25:42 alan - * Improve error reporting - * - * Revision 1.28 2000/04/25 17:38:00 alan - * Minor parser cleanup. - * - * Revision 1.27 2000/04/25 01:42:58 alan - * Allow arbitrary length variable values. Clean up Data API. Update javadocs. - * - * Revision 1.26 2000/04/22 01:25:10 alan - * Add support for cursor positioner '@'; update javadoc - * - * Revision 1.25 2000/04/22 00:08:43 alan - * Narrow range to 21 - 7E for mandatory quoting. - * - * Revision 1.24 2000/04/22 00:03:54 alan - * Disallow unquoted special chars. Report multiple errors at once. - * - * Revision 1.23 2000/04/21 22:23:40 alan - * Clean up parseReference. Previous log should read 'delegate', not 'delete'. - * - * Revision 1.22 2000/04/21 22:16:29 alan - * Delete variable name parsing to SymbolTable interface to consolidate parsing code. - * - * Revision 1.21 2000/04/21 21:16:40 alan - * Modify rule syntax - * - * Revision 1.20 2000/04/19 17:35:23 alan - * Update javadoc; fix compile error - * - * Revision 1.19 2000/04/19 16:34:18 alan - * Add segment support. - * - * Revision 1.18 2000/04/12 20:17:45 alan - * Delegate replace operation to rule object - * - * Revision 1.17 2000/03/10 04:07:23 johnf - * Copyright update - * - * Revision 1.16 2000/02/24 20:46:49 liu - * Add infinite loop check - * - * Revision 1.15 2000/02/10 07:36:25 johnf - * fixed imports for com.ibm.util.Utility - * - * Revision 1.14 2000/02/03 18:18:42 Alan - * Use array rather than hashtable for char-to-set map - * - * Revision 1.13 2000/01/27 18:59:19 Alan - * Use Position rather than int[] and move all subclass overrides to one method (handleTransliterate) - * - * Revision 1.12 2000/01/18 17:51:09 Alan - * Remove "keyboard" from method names. Make maximum context a field of Transliterator, and have subclasses set it. - * - * Revision 1.11 2000/01/18 02:30:49 Alan - * Add Jamo-Hangul, Hangul-Jamo, fix rules, add compound ID support - * - * Revision 1.10 2000/01/13 23:53:23 Alan - * Fix bugs found during ICU port - * - * Revision 1.9 2000/01/11 04:12:06 Alan - * Cleanup, embellish comments - * - * Revision 1.8 2000/01/11 02:25:03 Alan - * Rewrite UnicodeSet and RBT parsers for better performance and new syntax - * - * Revision 1.7 2000/01/06 01:36:36 Alan - * Allow string arrays in rule resource bundles - * - * Revision 1.6 2000/01/04 21:43:57 Alan - * Add rule indexing, and move masking check to TransliterationRuleSet. - * - * Revision 1.5 1999/12/22 01:40:54 Alan - * Consolidate rule pattern anteContext, key, and postContext into one string. - * - * Revision 1.4 1999/12/22 01:05:54 Alan - * Improve masking checking; turn it off by default, for better performance - */ diff --git a/icu4j/src/com/ibm/text/SCSU.java b/icu4j/src/com/ibm/text/SCSU.java deleted file mode 100755 index ca3a77fb38..0000000000 --- a/icu4j/src/com/ibm/text/SCSU.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/SCSU.java,v $ - * $Date: 2000/03/10 04:07:23 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -package com.ibm.text; - -/** - * An interface defining constants for the Standard Compression Scheme - * for Unicode (SCSU) as outlined in Unicode Technical - * Report #6. - * - * @author Stephen F. Booth - * @version 1.1 05 Aug 99 - * @version 1.0 26 Jul 99 - */ -interface SCSU -{ - //========================== - // Generic window shift - //========================== - final static int COMPRESSIONOFFSET = 0x80; - - //========================== - // Number of windows - //========================== - final static int NUMWINDOWS = 8; - final static int NUMSTATICWINDOWS = 8; - - //========================== - // Indicates a window index is invalid - //========================== - final static int INVALIDWINDOW = -1; - - //========================== - // Indicates a character doesn't exist in input (past end of buffer) - //========================== - final static int INVALIDCHAR = -1; - - //========================== - // Compression modes - //========================== - final static int SINGLEBYTEMODE = 0; - final static int UNICODEMODE = 1; - - //========================== - // Maximum value for a window's index - //========================== - final static int MAXINDEX = 0xFF; - - //========================== - // Reserved index value (characters belongs to first block) - //========================== - final static int RESERVEDINDEX = 0x00; - - //========================== - // Indices for scripts which cross a half-block boundary - //========================== - final static int LATININDEX = 0xF9; - final static int IPAEXTENSIONINDEX = 0xFA; - final static int GREEKINDEX = 0xFB; - final static int ARMENIANINDEX = 0xFC; - final static int HIRAGANAINDEX = 0xFD; - final static int KATAKANAINDEX = 0xFE; - final static int HALFWIDTHKATAKANAINDEX = 0xFF; - - //========================== - // Single-byte mode tags - //========================== - final static int SDEFINEX = 0x0B; - final static int SRESERVED = 0x0C; // reserved value - final static int SQUOTEU = 0x0E; - final static int SCHANGEU = 0x0F; - - final static int SQUOTE0 = 0x01; - final static int SQUOTE1 = 0x02; - final static int SQUOTE2 = 0x03; - final static int SQUOTE3 = 0x04; - final static int SQUOTE4 = 0x05; - final static int SQUOTE5 = 0x06; - final static int SQUOTE6 = 0x07; - final static int SQUOTE7 = 0x08; - - final static int SCHANGE0 = 0x10; - final static int SCHANGE1 = 0x11; - final static int SCHANGE2 = 0x12; - final static int SCHANGE3 = 0x13; - final static int SCHANGE4 = 0x14; - final static int SCHANGE5 = 0x15; - final static int SCHANGE6 = 0x16; - final static int SCHANGE7 = 0x17; - - final static int SDEFINE0 = 0x18; - final static int SDEFINE1 = 0x19; - final static int SDEFINE2 = 0x1A; - final static int SDEFINE3 = 0x1B; - final static int SDEFINE4 = 0x1C; - final static int SDEFINE5 = 0x1D; - final static int SDEFINE6 = 0x1E; - final static int SDEFINE7 = 0x1F; - - //========================== - // Unicode mode tags - //========================== - final static int UCHANGE0 = 0xE0; - final static int UCHANGE1 = 0xE1; - final static int UCHANGE2 = 0xE2; - final static int UCHANGE3 = 0xE3; - final static int UCHANGE4 = 0xE4; - final static int UCHANGE5 = 0xE5; - final static int UCHANGE6 = 0xE6; - final static int UCHANGE7 = 0xE7; - - final static int UDEFINE0 = 0xE8; - final static int UDEFINE1 = 0xE9; - final static int UDEFINE2 = 0xEA; - final static int UDEFINE3 = 0xEB; - final static int UDEFINE4 = 0xEC; - final static int UDEFINE5 = 0xED; - final static int UDEFINE6 = 0xEE; - final static int UDEFINE7 = 0xEF; - - final static int UQUOTEU = 0xF0; - final static int UDEFINEX = 0xF1; - final static int URESERVED = 0xF2; // reserved value - - - //========================== - // Class variables - //========================== - - /** For window offset mapping */ - final static int [] sOffsetTable = { - // table generated by CompressionTableGenerator - 0x0, 0x80, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380, 0x400, - 0x480, 0x500, 0x580, 0x600, 0x680, 0x700, 0x780, 0x800, 0x880, - 0x900, 0x980, 0xa00, 0xa80, 0xb00, 0xb80, 0xc00, 0xc80, 0xd00, - 0xd80, 0xe00, 0xe80, 0xf00, 0xf80, 0x1000, 0x1080, 0x1100, - 0x1180, 0x1200, 0x1280, 0x1300, 0x1380, 0x1400, 0x1480, - 0x1500, 0x1580, 0x1600, 0x1680, 0x1700, 0x1780, 0x1800, - 0x1880, 0x1900, 0x1980, 0x1a00, 0x1a80, 0x1b00, 0x1b80, - 0x1c00, 0x1c80, 0x1d00, 0x1d80, 0x1e00, 0x1e80, 0x1f00, - 0x1f80, 0x2000, 0x2080, 0x2100, 0x2180, 0x2200, 0x2280, - 0x2300, 0x2380, 0x2400, 0x2480, 0x2500, 0x2580, 0x2600, - 0x2680, 0x2700, 0x2780, 0x2800, 0x2880, 0x2900, 0x2980, - 0x2a00, 0x2a80, 0x2b00, 0x2b80, 0x2c00, 0x2c80, 0x2d00, - 0x2d80, 0x2e00, 0x2e80, 0x2f00, 0x2f80, 0x3000, 0x3080, - 0x3100, 0x3180, 0x3200, 0x3280, 0x3300, 0x3380, 0xe000, - 0xe080, 0xe100, 0xe180, 0xe200, 0xe280, 0xe300, 0xe380, - 0xe400, 0xe480, 0xe500, 0xe580, 0xe600, 0xe680, 0xe700, - 0xe780, 0xe800, 0xe880, 0xe900, 0xe980, 0xea00, 0xea80, - 0xeb00, 0xeb80, 0xec00, 0xec80, 0xed00, 0xed80, 0xee00, - 0xee80, 0xef00, 0xef80, 0xf000, 0xf080, 0xf100, 0xf180, - 0xf200, 0xf280, 0xf300, 0xf380, 0xf400, 0xf480, 0xf500, - 0xf580, 0xf600, 0xf680, 0xf700, 0xf780, 0xf800, 0xf880, - 0xf900, 0xf980, 0xfa00, 0xfa80, 0xfb00, 0xfb80, 0xfc00, - 0xfc80, 0xfd00, 0xfd80, 0xfe00, 0xfe80, 0xff00, 0xff80, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, - 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0, 0x250, 0x370, - 0x530, 0x3040, 0x30a0, 0xff60 - }; - - /** Static compression window offsets */ - final static int [] sOffsets = { - 0x0000, // for quoting single-byte mode tags - 0x0080, // Latin-1 Supplement - 0x0100, // Latin Extended-A - 0x0300, // Combining Diacritical Marks - 0x2000, // General Punctuation - 0x2080, // Curency Symbols - 0x2100, // Letterlike Symbols and Number Forms - 0x3000 // CJK Symbols and Punctuation - }; - -}; - diff --git a/icu4j/src/com/ibm/text/SearchIterator.java b/icu4j/src/com/ibm/text/SearchIterator.java deleted file mode 100755 index 6b8a344e1b..0000000000 --- a/icu4j/src/com/ibm/text/SearchIterator.java +++ /dev/null @@ -1,438 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/SearchIterator.java,v $ - * $Date: 2000/03/10 04:07:23 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -package com.ibm.text; - -import java.text.CharacterIterator; -import java.text.BreakIterator; - -/** - * SearchIterator is an abstract base class that provides methods - * to search for a pattern within a text string. Instances of - * SearchIterator maintain a current position and scan over - * the target text, returning the indices the pattern is matched - * and the length of each match. - *

- * SearchIterator is an abstract base class that defines a - * protocol for text searching. Subclasses provide concrete implementations of - * various search algorithms. For example, {@link StringSearch} - * implements language-sensitive pattern matching based on the comparison rules - * defined in a {@link java.text.RuleBasedCollator RuleBasedCollator} object. - *

- * Internally, SearchIterator scans text using a - * {@link CharacterIterator}, and is thus able to scan text held - * by any object implementing that protocol. A StringCharacterIterator - * is used to scan String objects passed to setText. - *

- * SearchIterator provides an API that is similar to that of - * other text iteration classes such as BreakIterator. Using this - * class, it is easy to scan through text looking for all occurances of a - * given pattern. The following example uses a StringSearch object to - * find all instances of "fox" in the target string. Any other subclass of - * SearchIterator can be used in an identical manner. - *


- * String target = "The quick brown fox jumped over the lazy fox";
- * String pattern = "fox";
- *
- * SearchIterator iter = new StringSearch(pattern, target);
- *
- * for (int pos = iter.first(); pos != SearchIterator.DONE; pos = iter.next()) {
- *     System.out.println("Found match at " + pos +
- *                        ", length is " + iter.getMatchLength());
- * }
- * 
- * - * @see StringSearch - */ -public abstract class SearchIterator { - /** - * DONE is returned by previous() and next() after all valid - * matches have been returned, and by first() and last() if - * there are no matches at all. - */ - public static final int DONE = -1; - - /** - * Private value indicating that the iterator is pointing - * before the beginning of the target text. - */ - private static final int BEFORE = -2; - - /** - * Return the first index at which the target text matches the search - * pattern. The iterator is adjusted so that its current index - * (as returned by {@link #getIndex}) is the match posisition if one was found - * and DONE if one was not. - * - * @return The character index of the first match, or DONE if there - * are no matches. - */ - final public int first() { - setIndex(BEFORE); - return next(); - } - - /** - * Return the first index greater than pos at which the target - * text matches the search pattern. The iterator is adjusted so that its current index - * (as returned by {@link #getIndex}) is the match posisition if one was found - * and DONE if one was not. - * - * @return The character index of the first match following pos, - * or DONE if there are no matches. - */ - final public int following(int pos) { - setIndex(pos); - return next(); - } - - /** - * Return the last index in the target text at which it matches - * the search pattern and adjusts the iteration to point to that position. - * - * @return The index of the first match, or DONE if there - * are no matches. - */ - final public int last() { - setIndex(DONE); - return previous(); - } - - /** - * Return the first index less than pos at which the target - * text matches the search pattern. The iterator is adjusted so that its current index - * (as returned by {@link #getIndex}) is the match posisition if one was found - * and DONE if one was not. - * - * @return The character index of the first match preceding pos, - * or DONE if there are no matches. - */ - final public int preceding(int pos) { - setIndex(pos); - return previous(); - } - - /** - * Return the index of the next point at which the text matches the - * search pattern, starting from the current position - *

- * @return The index of the next match after the current position, - * or DONE if there are no more matches. - * - * @see #first - */ - public int next() { - if (index == BEFORE){ - // Starting at the beginning of the text - index = target.getBeginIndex(); - } else if (length > 0) { - // Finding the next match after a previous one - index += overlap ? 1 : length; - } - index -= 1; - - do { - length = 0; - index = handleNext(index + 1); - } while (index != DONE && !isBreakUnit(index, index+length)); - - return index; - } - - /** - * Return the index of the previous point at which the text matches - * the search pattern, starting at the current position - * - * @return The index of the previous match before the current position, - * or DONE if there are no more matches. - */ - public int previous() { - if (index == DONE) { - index = target.getEndIndex(); - } else if (length > 0) { - // Finding the previous match before a following one - index = overlap ? index + length - 1 : index; - } - index += 1; - - do { - length = 0; - index = handlePrev(index - 1); - } while (index != DONE && !isBreakUnit(index, index+length)); - - if (index == DONE) { - index = BEFORE; - } - return getIndex(); - } - - - - /** - * Return the current index in the text being searched. - * If the iteration has gone past the end of the text - * (or past the beginning for a backwards search), - * {@link #DONE} is returned. - */ - public int getIndex() { - return index == BEFORE ? DONE : index; - } - - /** - * Determines whether overlapping matches are returned. If this - * property is true, matches that begin within the - * boundry of the previous match are considered valid and will - * be returned. For example, when searching for "abab" in the - * target text "ababab", both offsets 0 and 2 will be returned - * as valid matches if this property is true. - *

- * The default setting of this property is true - */ - public void setOverlapping(boolean allowOverlap) { - overlap = allowOverlap; - } - - /** - * Determines whether overlapping matches are returned. - * - * @see #setOverlapping - */ - public boolean isOverlapping() { - return overlap; - } - - /** - * Returns the length of text in the target which matches the search - * pattern. This call returns a valid result only after a successful - * call to {@link #first}, {@link #next}, {@link #previous}, or {@link #last}. - * Just after construction, or after a searching method returns - * DONE, this method will return 0. - * - * @return The length of the match in the target text, or 0 if there - * is no match currently. - */ - public int getMatchLength() { - return length; - } - - /** - * Set the BreakIterator that will be used to restrict the points - * at which matches are detected. - * - * @param breaker A {@link java.text.BreakIterator BreakIterator} - * that will be used to restrict the points - * at which matches are detected. If a match is found, but the match's start - * or end index is not a boundary as determined by - * the BreakIterator, the match will be rejected and - * another will be searched for. - * - * If this parameter is null, no break - * detection is attempted. - * - * @see #getBreakIterator - */ - public void setBreakIterator(BreakIterator iterator) { - breaker = iterator; - if (breaker != null) { - breaker.setText(target); - } - } - - /** - * Returns the BreakIterator that is used to restrict the points - * at which matches are detected. This will be the same object - * that was passed to the constructor or to setBreakIterator. - * Note that null is a legal value; it means that break - * detection should not be attempted. - * - * @see #setBreakIterator - */ - public BreakIterator getBreakIterator() { - return breaker; - } - - /** - * Set the target text which should be searched and resets the - * iterator's position to point before the start of the target text. - * This method is useful if you want to re-use an iterator to - * search for the same pattern within a different body of text. - * - * @see #getTarget - */ - public void setTarget(CharacterIterator iterator) { - target = iterator; - if (breaker != null) { - breaker.setText(target); - } - setIndex(BEFORE); - } - - /** - * Return the target text which is being searched - * - * @see #setTarget - */ - public CharacterIterator getTarget() { - return target; - } - - /** - * Returns the text that was matched by the most recent call to - * {@link #first}, {@link #next}, {@link #previous}, or {@link #last}. - * If the iterator is not pointing at a valid match (e.g. just after - * construction or after DONE has been returned, returns - * an empty string. - */ - public String getMatchedText() { - StringBuffer buffer = new StringBuffer(); - - if (length > 0) { - int i = 0; - for (char c = target.setIndex(index); i < length; c = target.next(), i++) - { - buffer.append(c); - } - } - return buffer.toString(); - } - - //------------------------------------------------------------------- - // Protected interface for subclasses - //------------------------------------------------------------------- - - /** - * Constructor for use by subclasses - *

- * @param target The target text to be searched. This is for internal - * use by this class. Subclasses need to maintain their - * own reference to or iterator over the target text - * for use by their {@link #handleNext handleNext} and - * {@link #handlePrev handlePrev} methods. - * - * @param breaker A {@link BreakIterator} that is used to restrict the points - * at which matches are detected. If handleNext or - * handlePrev finds a match, but the match's start - * or end index is not a boundary as determined by - * the BreakIterator, the match is rejected and - * handleNext or handlePrev is called again. - * If this parameter is null, no break - * detection is attempted. - * - */ - protected SearchIterator(CharacterIterator target, BreakIterator breaker) - { - this.target = target; - - if (breaker != null) { - this.breaker = (BreakIterator)breaker.clone(); - this.breaker.setText(target); - } - - index = target.getBeginIndex(); - length = 0; - } - - /** - * Abstract method which subclasses override to provide the mechanism - * for finding the next match in the target text. This allows different - * subclasses to provide different search algorithms. - *

- * If a match is found, the implementation should return the index at - * which the match starts and should call {@link #setMatchLength setMatchLength} - * with the number of characters in the target - * text that make up the match. If no match is found, the method - * should return DONE and should not call setMatchLength. - *

- * @param startAt The index in the target text at which the search - * should start. - * - * @see #setMatchLength - */ - protected abstract int handleNext(int startAt); - - /** - * Abstract method which subclasses override to provide the mechanism - * for finding the previous match in the target text. This allows different - * subclasses to provide different search algorithms. - *

- * If a match is found, the implementation should return the index at - * which the match starts and should call {@link #setMatchLength setMatchLength} - * with the number of characters in the target - * text that make up the match. If no match is found, the method - * should return DONE and should not call setMatchLength. - *

- * @param startAt The index in the target text at which the search - * should start. - * - * @see #setMatchLength - */ - protected abstract int handlePrev(int startAt); - - /** - * Sets the length of the currently matched string in the target text. - * Subclasses' handleNext and handlePrev - * methods should call this when they find a match in the target text. - */ - protected void setMatchLength(int length) { - this.length = length; - } - - //------------------------------------------------------------------- - // Privates - // - - /** - * Internal method used by preceding and following. Sets the index - * to point to the given position, and clears any state that's - * affected. - */ - private void setIndex(int pos) { - index = pos; - length = 0; - } - - /** - * Determine whether the target text bounded by start and - * end is one or more whole units of text as determined by - * the current BreakIterator. - */ - private boolean isBreakUnit(int start, int end) - { - if (breaker == null) { - return true; - } - boolean startBound = breaker.isBoundary(start); - boolean endBound = (end == target.getEndIndex()) || breaker.isBoundary(end); - - return startBound && endBound; - } - - //------------------------------------------------------------------------- - // Private data... - //------------------------------------------------------------------------- - private int index; // Current position in the target text - private int length; // Length of matched text, or 0 - private boolean overlap = true; // Return overlapping matches? - private CharacterIterator target; // Target text to be searched - private BreakIterator breaker; // Break iterator to constrain matches - - //------------------------------------------------------------------------- - // Debugging support... - //------------------------------------------------------------------------- - - static private final boolean DEBUG = false; - - static void debug(String str) { - System.err.println(str); - } -}; \ No newline at end of file diff --git a/icu4j/src/com/ibm/text/SimpleDateFormat.java b/icu4j/src/com/ibm/text/SimpleDateFormat.java deleted file mode 100755 index 0504b18f45..0000000000 --- a/icu4j/src/com/ibm/text/SimpleDateFormat.java +++ /dev/null @@ -1,1411 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/SimpleDateFormat.java,v $ - * $Date: 2001/10/31 03:33:17 $ - * $Revision: 1.9 $ - * - ***************************************************************************************** - */ - -package com.ibm.text; - -import com.ibm.text.DateFormat; -import java.text.MessageFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; - -import com.ibm.util.TimeZone; -import com.ibm.util.Calendar; -import java.util.Date; -import java.util.Locale; -import java.util.ResourceBundle; -import com.ibm.util.SimpleTimeZone; -import com.ibm.util.GregorianCalendar; -import java.io.ObjectInputStream; -import java.io.IOException; -import java.lang.ClassNotFoundException; -import java.util.Hashtable; -import java.lang.StringIndexOutOfBoundsException; - -/** - * SimpleDateFormat is a concrete class for formatting and - * parsing dates in a locale-sensitive manner. It allows for formatting - * (date -> text), parsing (text -> date), and normalization. - * - *

- * SimpleDateFormat allows you to start by choosing - * any user-defined patterns for date-time formatting. However, you - * are encouraged to create a date-time formatter with either - * getTimeInstance, getDateInstance, or - * getDateTimeInstance in DateFormat. Each - * of these class methods can return a date/time formatter initialized - * with a default format pattern. You may modify the format pattern - * using the applyPattern methods as desired. - * For more information on using these methods, see - * {@link DateFormat}. - * - *

- * Time Format Syntax: - *

- * To specify the time format use a time pattern string. - * In this pattern, all ASCII letters are reserved as pattern letters, - * which are defined as the following: - *

- *
- * Symbol   Meaning                 Presentation        Example
- * ------   -------                 ------------        -------
- * G        era designator          (Text)              AD
- * y        year                    (Number)            1996
- * u        extended year           (Number)            4601
- * M        month in year           (Text & Number)     July & 07
- * d        day in month            (Number)            10
- * h        hour in am/pm (1~12)    (Number)            12
- * H        hour in day (0~23)      (Number)            0
- * m        minute in hour          (Number)            30
- * s        second in minute        (Number)            55
- * S        millisecond             (Number)            978
- * E        day in week             (Text)              Tuesday
- * D        day in year             (Number)            189
- * F        day of week in month    (Number)            2 (2nd Wed in July)
- * w        week in year            (Number)            27
- * W        week in month           (Number)            2
- * a        am/pm marker            (Text)              PM
- * k        hour in day (1~24)      (Number)            24
- * K        hour in am/pm (0~11)    (Number)            0
- * z        time zone               (Text)              Pacific Standard Time
- * '        escape for text         (Delimiter)
- * ''       single quote            (Literal)           '
- * 
- *
- * The count of pattern letters determine the format. - *

- * (Text): 4 or more pattern letters--use full form, - * < 4--use short or abbreviated form if one exists. - *

- * (Number): the minimum number of digits. Shorter - * numbers are zero-padded to this amount. Year is handled specially; - * that is, if the count of 'y' is 2, the Year will be truncated to 2 digits. - *

- * (Text & Number): 3 or over, use text, otherwise use number. - *

- * Any characters in the pattern that are not in the ranges of ['a'..'z'] - * and ['A'..'Z'] will be treated as quoted text. For instance, characters - * like ':', '.', ' ', '#' and '@' will appear in the resulting time text - * even they are not embraced within single quotes. - *

- * A pattern containing any invalid pattern letter will result in a thrown - * exception during formatting or parsing. - * - *

- * Examples Using the US Locale: - *

- *
- * Format Pattern                         Result
- * --------------                         -------
- * "yyyy.MM.dd G 'at' HH:mm:ss z"    ->>  1996.07.10 AD at 15:08:56 PDT
- * "EEE, MMM d, ''yy"                ->>  Wed, July 10, '96
- * "h:mm a"                          ->>  12:08 PM
- * "hh 'o''clock' a, zzzz"           ->>  12 o'clock PM, Pacific Daylight Time
- * "K:mm a, z"                       ->>  0:00 PM, PST
- * "yyyyy.MMMMM.dd GGG hh:mm aaa"    ->>  01996.July.10 AD 12:08 PM
- * 
- *
- * Code Sample: - *
- *
- * SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, "PST");
- * pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2*60*60*1000);
- * pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2*60*60*1000);
- * 
- * // Format the current time. - * SimpleDateFormat formatter - * = new SimpleDateFormat ("yyyy.MM.dd G 'at' hh:mm:ss a zzz"); - * Date currentTime_1 = new Date(); - * String dateString = formatter.format(currentTime_1); - *
- * // Parse the previous string back into a Date. - * ParsePosition pos = new ParsePosition(0); - * Date currentTime_2 = formatter.parse(dateString, pos); - *
- *
- * In the example, the time value currentTime_2 obtained from - * parsing will be equal to currentTime_1. However, they may not be - * equal if the am/pm marker 'a' is left out from the format pattern while - * the "hour in am/pm" pattern symbol is used. This information loss can - * happen when formatting the time in PM. - * - *

- * When parsing a date string using the abbreviated year pattern ("yy"), - * SimpleDateFormat must interpret the abbreviated year - * relative to some century. It does this by adjusting dates to be - * within 80 years before and 20 years after the time the SimpleDateFormat - * instance is created. For example, using a pattern of "MM/dd/yy" and a - * SimpleDateFormat instance created on Jan 1, 1997, the string - * "01/11/12" would be interpreted as Jan 11, 2012 while the string "05/04/64" - * would be interpreted as May 4, 1964. - * During parsing, only strings consisting of exactly two digits, as defined by - * {@link Character#isDigit(char)}, will be parsed into the default century. - * Any other numeric string, such as a one digit string, a three or more digit - * string, or a two digit string that isn't all digits (for example, "-1"), is - * interpreted literally. So "01/02/3" or "01/02/003" are parsed, using the - * same pattern, as Jan 2, 3 AD. Likewise, "01/02/-3" is parsed as Jan 2, 4 BC. - * - *

- * If the year pattern does not have exactly two 'y' characters, the year is - * interpreted literally, regardless of the number of digits. So using the - * pattern "MM/dd/yyyy", "01/11/12" parses to Jan 11, 12 A.D. - * - *

- * For time zones that have no names, use strings GMT+hours:minutes or - * GMT-hours:minutes. - * - *

- * The calendar defines what is the first day of the week, the first week - * of the year, whether hours are zero based or not (0 vs 12 or 24), and the - * time zone. There is one common decimal format to handle all the numbers; - * the digit count is handled programmatically according to the pattern. - * - *

Synchronization

- * - * Date formats are not synchronized. It is recommended to create separate - * format instances for each thread. If multiple threads access a format - * concurrently, it must be synchronized externally. - * - * @see com.ibm.util.Calendar - * @see com.ibm.util.GregorianCalendar - * @see com.ibm.util.TimeZone - * @see DateFormat - * @see DateFormatSymbols - * @see DecimalFormat - * @version 1.51, 09/24/99 - * @author Mark Davis, Chen-Lieh Huang, Alan Liu - */ -public class SimpleDateFormat extends DateFormat { - - // the official serial version ID which says cryptically - // which version we're compatible with - static final long serialVersionUID = 4774881970558875024L; - - // the internal serial version which says which version was written - // - 0 (default) for version up to JDK 1.1.3 - // - 1 for version from JDK 1.1.4, which includes a new field - static final int currentSerialVersion = 1; - - /** - * The version of the serialized data on the stream. Possible values: - *
    - *
  • 0 or not present on stream: JDK 1.1.3. This version - * has no defaultCenturyStart on stream. - *
  • 1 JDK 1.1.4 or later. This version adds - * defaultCenturyStart. - *
- * When streaming out this class, the most recent format - * and the highest allowable serialVersionOnStream - * is written. - * @serial - * @since JDK1.1.4 - */ - private int serialVersionOnStream = currentSerialVersion; - - /** - * The pattern string of this formatter. This is always a non-localized - * pattern. May not be null. See class documentation for details. - * @serial - */ - private String pattern; - - /** - * The symbols used by this formatter for week names, month names, - * etc. May not be null. - * @serial - * @see DateFormatSymbols - */ - private DateFormatSymbols formatData; - - /** - * We map dates with two-digit years into the century starting at - * defaultCenturyStart, which may be any date. May - * not be null. - * @serial - * @since JDK1.1.4 - */ - private Date defaultCenturyStart; - - transient private int defaultCenturyStartYear; - - private static final int millisPerHour = 60 * 60 * 1000; - private static final int millisPerMinute = 60 * 1000; - - // For time zones that have no names, use strings GMT+minutes and - // GMT-minutes. For instance, in France the time zone is GMT+60. - private static final String GMT_PLUS = "GMT+"; - private static final String GMT_MINUS = "GMT-"; - private static final String GMT = "GMT"; - - /** - * Cache to hold the DateTimePatterns of a Locale. - */ - private static Hashtable cachedLocaleData = new Hashtable(3); - - /** - * Construct a SimpleDateFormat using the default pattern for the default - * locale. Note: Not all locales support SimpleDateFormat; for full - * generality, use the factory methods in the DateFormat class. - * - * @see DateFormat - */ - public SimpleDateFormat() { - this(SHORT, SHORT, Locale.getDefault()); - } - - /** - * Construct a SimpleDateFormat using the given pattern in the default - * locale. Note: Not all locales support SimpleDateFormat; for full - * generality, use the factory methods in the DateFormat class. - */ - public SimpleDateFormat(String pattern) - { - this(pattern, Locale.getDefault()); - } - - /** - * Construct a SimpleDateFormat using the given pattern and locale. - * Note: Not all locales support SimpleDateFormat; for full - * generality, use the factory methods in the DateFormat class. - */ - public SimpleDateFormat(String pattern, Locale loc) - { - this.pattern = pattern; - this.formatData = new DateFormatSymbols(loc); - initialize(loc); - } - - /** - * Construct a SimpleDateFormat using the given pattern and - * locale-specific symbol data. - */ - public SimpleDateFormat(String pattern, DateFormatSymbols formatData) - { - this.pattern = pattern; - this.formatData = (DateFormatSymbols) formatData.clone(); - initialize(Locale.getDefault()); - } - - /* Package-private, called by DateFormat factory methods */ - SimpleDateFormat(int timeStyle, int dateStyle, Locale loc) { - /* try the cache first */ - String[] dateTimePatterns = (String[]) cachedLocaleData.get(loc); - if (dateTimePatterns == null) { /* cache miss */ - ResourceBundle r = ResourceBundle.getBundle - ("java.text.resources.LocaleElements", loc); - dateTimePatterns = r.getStringArray("DateTimePatterns"); - /* update cache */ - cachedLocaleData.put(loc, dateTimePatterns); - } - formatData = new DateFormatSymbols(loc); - if ((timeStyle >= 0) && (dateStyle >= 0)) { - Object[] dateTimeArgs = {dateTimePatterns[timeStyle], - dateTimePatterns[dateStyle + 4]}; - pattern = MessageFormat.format(dateTimePatterns[8], dateTimeArgs); - } - else if (timeStyle >= 0) { - pattern = dateTimePatterns[timeStyle]; - } - else if (dateStyle >= 0) { - pattern = dateTimePatterns[dateStyle + 4]; - } - else { - throw new IllegalArgumentException("No date or time style specified"); - } - - initialize(loc); - } - - /* Initialize calendar and numberFormat fields */ - private void initialize(Locale loc) { - // The format object must be constructed using the symbols for this zone. - // However, the calendar should use the current default TimeZone. - // If this is not contained in the locale zone strings, then the zone - // will be formatted using generic GMT+/-H:MM nomenclature. - calendar = Calendar.getInstance(TimeZone.getDefault(), loc); - numberFormat = NumberFormat.getInstance(loc); - numberFormat.setGroupingUsed(false); - if (numberFormat instanceof DecimalFormat) - ((DecimalFormat)numberFormat).setDecimalSeparatorAlwaysShown(false); - numberFormat.setParseIntegerOnly(true); /* So that dd.MM.yy can be parsed */ - numberFormat.setMinimumFractionDigits(0); // To prevent "Jan 1.00, 1997.00" - - initializeDefaultCentury(); - } - - /* Initialize the fields we use to disambiguate ambiguous years. Separate - * so we can call it from readObject(). - */ - private void initializeDefaultCentury() { - calendar.setTime( new Date() ); - calendar.add( Calendar.YEAR, -80 ); - parseAmbiguousDatesAsAfter(calendar.getTime()); - } - - /* Define one-century window into which to disambiguate dates using - * two-digit years. - */ - private void parseAmbiguousDatesAsAfter(Date startDate) { - defaultCenturyStart = startDate; - calendar.setTime(startDate); - defaultCenturyStartYear = calendar.get(Calendar.YEAR); - } - - /** - * Sets the 100-year period 2-digit years will be interpreted as being in - * to begin on the date the user specifies. - * @param startDate During parsing, two digit years will be placed in the range - * startDate to startDate + 100 years. - */ - public void set2DigitYearStart(Date startDate) { - parseAmbiguousDatesAsAfter(startDate); - } - - /** - * Returns the beginning date of the 100-year period 2-digit years are interpreted - * as being within. - * @return the start of the 100-year period into which two digit years are - * parsed - */ - public Date get2DigitYearStart() { - return defaultCenturyStart; - } - - /** - * Overrides DateFormat - *

Formats a date or time, which is the standard millis - * since January 1, 1970, 00:00:00 GMT. - *

Example: using the US locale: - * "yyyy.MM.dd G 'at' HH:mm:ss zzz" ->> 1996.07.10 AD at 15:08:56 PDT - * @param date the date-time value to be formatted into a date-time string. - * @param toAppendTo where the new date-time text is to be appended. - * @param pos the formatting position. On input: an alignment field, - * if desired. On output: the offsets of the alignment field. - * @return the formatted date-time string. - * @see DateFormat - */ - public StringBuffer format(Date date, StringBuffer toAppendTo, - FieldPosition pos) - { - // Initialize - pos.setBeginIndex(0); - pos.setEndIndex(0); - - // Convert input date to time field list - calendar.setTime(date); - - boolean inQuote = false; // true when between single quotes - char prevCh = 0; // previous pattern character - int count = 0; // number of time prevCh repeated - for (int i=0; i 0) { - toAppendTo.append( - subFormat(prevCh, count, toAppendTo.length(), pos, formatData)); - count = 0; - } - if (ch == '\'') { - // Consecutive single quotes are a single quote literal, - // either outside of quotes or between quotes - if ((i+1)= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z')) { - // ch is a date-time pattern character to be interpreted - // by subFormat(); count the number of times it is repeated - prevCh = ch; - ++count; - } - else { - // Append quoted characters and unquoted non-pattern characters - toAppendTo.append(ch); - } - } - // Format the last item in the pattern, if any - if (count > 0) { - toAppendTo.append( - subFormat(prevCh, count, toAppendTo.length(), pos, formatData)); - } - return toAppendTo; - } - - // Map index into pattern character string to Calendar field number - private static final int[] PATTERN_INDEX_TO_CALENDAR_FIELD = - { - Calendar.ERA, Calendar.YEAR, Calendar.MONTH, Calendar.DATE, - Calendar.HOUR_OF_DAY, Calendar.HOUR_OF_DAY, Calendar.MINUTE, - Calendar.SECOND, Calendar.MILLISECOND, Calendar.DAY_OF_WEEK, - Calendar.DAY_OF_YEAR, Calendar.DAY_OF_WEEK_IN_MONTH, - Calendar.WEEK_OF_YEAR, Calendar.WEEK_OF_MONTH, - Calendar.AM_PM, Calendar.HOUR, Calendar.HOUR, Calendar.ZONE_OFFSET - }; - - // Map index into pattern character string to DateFormat field number - private static final int[] PATTERN_INDEX_TO_DATE_FORMAT_FIELD = { - DateFormat.ERA_FIELD, DateFormat.YEAR_FIELD, DateFormat.MONTH_FIELD, - DateFormat.DATE_FIELD, DateFormat.HOUR_OF_DAY1_FIELD, - DateFormat.HOUR_OF_DAY0_FIELD, DateFormat.MINUTE_FIELD, - DateFormat.SECOND_FIELD, DateFormat.MILLISECOND_FIELD, - DateFormat.DAY_OF_WEEK_FIELD, DateFormat.DAY_OF_YEAR_FIELD, - DateFormat.DAY_OF_WEEK_IN_MONTH_FIELD, DateFormat.WEEK_OF_YEAR_FIELD, - DateFormat.WEEK_OF_MONTH_FIELD, DateFormat.AM_PM_FIELD, - DateFormat.HOUR1_FIELD, DateFormat.HOUR0_FIELD, - DateFormat.TIMEZONE_FIELD, - }; - - /** - * Format a single field, given its pattern character. Subclasses may - * override this method in order to modify or add formatting - * capabilities. - * @param ch the pattern character - * @param count the number of times ch is repeated in the pattern - * @param beginOffset the offset of the output string at the start of - * this field; used to set pos when appropriate - * @param pos receives the position of a field, when appropriate - * @param formatData the symbols for this formatter - */ - protected String subFormat(char ch, int count, int beginOffset, - FieldPosition pos, DateFormatSymbols formatData) - throws IllegalArgumentException - { - int patternCharIndex = -1; - int maxIntCount = Integer.MAX_VALUE; - String current = ""; - - // TEMPORARY HACK TODO fix this - if (ch == 'u') { // 'u' - EXTENDED_YEAR - return zeroPaddingNumber(calendar.get(Calendar.EXTENDED_YEAR), - 1, maxIntCount); - } - - if ((patternCharIndex=formatData.patternChars.indexOf(ch)) == -1) - throw new IllegalArgumentException("Illegal pattern character " + - "'" + ch + "'"); - - int field = PATTERN_INDEX_TO_CALENDAR_FIELD[patternCharIndex]; - int value = calendar.get(field); - - switch (patternCharIndex) { - case 0: // 'G' - ERA - current = formatData.eras[value]; - break; - case 1: // 'y' - YEAR - /* According to the specification, if the number of pattern letters ('y') is 2, - * the year is truncated to 2 digits; otherwise it is interpreted as a number. - * But the original code process 'y', 'yy', 'yyy' in the same way. and process - * patterns with 4 or more than 4 'y' characters in the same way. - * So I change the codes to meet the specification. [Richard/GCl] - */ - if (count == 2) - current = zeroPaddingNumber(value, 2, 2); // clip 1996 to 96 - else //count = 1 or count > 2 - current = zeroPaddingNumber(value, count, maxIntCount); - break; - case 2: // 'M' - MONTH - if (count >= 4) - current = formatData.months[value]; - else if (count == 3) - current = formatData.shortMonths[value]; - else - current = zeroPaddingNumber(value+1, count, maxIntCount); - break; - case 4: // 'k' - HOUR_OF_DAY: 1-based. eg, 23:59 + 1 hour =>> 24:59 - if (value == 0) - current = zeroPaddingNumber( - calendar.getMaximum(Calendar.HOUR_OF_DAY)+1, - count, maxIntCount); - else - current = zeroPaddingNumber(value, count, maxIntCount); - break; - case 9: // 'E' - DAY_OF_WEEK - if (count >= 4) - current = formatData.weekdays[value]; - else // count < 4, use abbreviated form if exists - current = formatData.shortWeekdays[value]; - break; - case 14: // 'a' - AM_PM - current = formatData.ampms[value]; - break; - case 15: // 'h' - HOUR:1-based. eg, 11PM + 1 hour =>> 12 AM - if (value == 0) - current = zeroPaddingNumber( - calendar.getLeastMaximum(Calendar.HOUR)+1, - count, maxIntCount); - else - current = zeroPaddingNumber(value, count, maxIntCount); - break; - case 17: // 'z' - ZONE_OFFSET - int zoneIndex - = formatData.getZoneIndex (calendar.getTimeZone().getID()); - if (zoneIndex == -1) - { - // For time zones that have no names, use strings - // GMT+hours:minutes and GMT-hours:minutes. - // For instance, France time zone uses GMT+01:00. - StringBuffer zoneString = new StringBuffer(); - - value = calendar.get(Calendar.ZONE_OFFSET) + - calendar.get(Calendar.DST_OFFSET); - - if (value < 0) - { - zoneString.append(GMT_MINUS); - value = -value; // suppress the '-' sign for text display. - } - else - zoneString.append(GMT_PLUS); - zoneString.append( - zeroPaddingNumber((int)(value/millisPerHour), 2, 2)); - zoneString.append(':'); - zoneString.append( - zeroPaddingNumber( - (int)((value%millisPerHour)/millisPerMinute), 2, 2)); - current = zoneString.toString(); - } - else if (calendar.get(Calendar.DST_OFFSET) != 0) - { - if (count >= 4) - current = formatData.zoneStrings[zoneIndex][3]; - else - // count < 4, use abbreviated form if exists - current = formatData.zoneStrings[zoneIndex][4]; - } - else - { - if (count >= 4) - current = formatData.zoneStrings[zoneIndex][1]; - else - current = formatData.zoneStrings[zoneIndex][2]; - } - break; - default: - // case 3: // 'd' - DATE - // case 5: // 'H' - HOUR_OF_DAY:0-based. eg, 23:59 + 1 hour =>> 00:59 - // case 6: // 'm' - MINUTE - // case 7: // 's' - SECOND - // case 8: // 'S' - MILLISECOND - // case 10: // 'D' - DAY_OF_YEAR - // case 11: // 'F' - DAY_OF_WEEK_IN_MONTH - // case 12: // 'w' - WEEK_OF_YEAR - // case 13: // 'W' - WEEK_OF_MONTH - // case 16: // 'K' - HOUR: 0-based. eg, 11PM + 1 hour =>> 0 AM - current = zeroPaddingNumber(value, count, maxIntCount); - break; - } // switch (patternCharIndex) - - if (pos.getField() == PATTERN_INDEX_TO_DATE_FORMAT_FIELD[patternCharIndex]) { - // set for the first occurence only. - if (pos.getBeginIndex() == 0 && pos.getEndIndex() == 0) { - pos.setBeginIndex(beginOffset); - pos.setEndIndex(beginOffset + current.length()); - } - } - - return current; - } - - /** - * Formats a number with the specified minimum and maximum number of digits. - */ - protected String zeroPaddingNumber(long value, int minDigits, int maxDigits) - { - numberFormat.setMinimumIntegerDigits(minDigits); - numberFormat.setMaximumIntegerDigits(maxDigits); - return numberFormat.format(value); - } - - - /** - * Overrides DateFormat - * @see DateFormat - */ - public Date parse(String text, ParsePosition pos) - { - int start = pos.getIndex(); - int oldStart = start; - boolean[] ambiguousYear = {false}; - - calendar.clear(); // Clears all the time fields - - boolean inQuote = false; // inQuote set true when hits 1st single quote - char prevCh = 0; - int count = 0; - int interQuoteCount = 1; // Number of chars between quotes - - for (int i=0; i= text.length() || ch != text.charAt(start)) - { - pos.setIndex(oldStart); - pos.setErrorIndex(start); - return null; - } - ++start; - } - count = 0; - interQuoteCount = 0; - } - else - { - // pattern uses text following from 1st single quote. - if (start >= text.length() || ch != text.charAt(start)) { - // Check for cases like: 'at' in pattern vs "xt" - // in time text, where 'a' doesn't match with 'x'. - // If fail to match, return null. - pos.setIndex(oldStart); // left unchanged - pos.setErrorIndex(start); - return null; - } - ++count; - ++start; - } - } - else // !inQuote - { - if (ch == '\'') - { - inQuote = true; - if (count > 0) // handle cases like: e'at' - { - int startOffset = start; - start=subParse(text, start, prevCh, count, - false, ambiguousYear); - if ( start<0 ) { - pos.setErrorIndex(startOffset); - pos.setIndex(oldStart); - return null; - } - count = 0; - } - - if (interQuoteCount == 0) - { - // This indicates two consecutive quotes inside a quote, - // for example, 'o''clock'. We need to parse this as - // representing a single quote within the quote. - int startOffset = start; - if (start >= text.length() || ch != text.charAt(start)) - { - pos.setErrorIndex(startOffset); - pos.setIndex(oldStart); - return null; - } - ++start; - count = 1; // Make it look like we never left - } - } - else if (ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z') - { - // ch is a date-time pattern - if (ch != prevCh && count > 0) // e.g., yyyyMMdd - { - int startOffset = start; - // This is the only case where we pass in 'true' for - // obeyCount. That's because the next field directly - // abuts this one, so we have to use the count to know when - // to stop parsing. [LIU] - start = subParse(text, start, prevCh, count, true, - ambiguousYear); - if (start < 0) { - pos.setErrorIndex(startOffset); - pos.setIndex(oldStart); - return null; - } - prevCh = ch; - count = 1; - } - else - { - if (ch != prevCh) - prevCh = ch; - count++; - } - } - else if (count > 0) - { - // handle cases like: MM-dd-yy, HH:mm:ss, or yyyy MM dd, - // where ch = '-', ':', or ' ', repectively. - int startOffset = start; - start=subParse(text, start, prevCh, count, - false, ambiguousYear); - if ( start < 0 ) { - pos.setErrorIndex(startOffset); - pos.setIndex(oldStart); - return null; - } - if (start >= text.length() || ch != text.charAt(start)) { - // handle cases like: 'MMMM dd' in pattern vs. "janx20" - // in time text, where ' ' doesn't match with 'x'. - pos.setErrorIndex(start); - pos.setIndex(oldStart); - return null; - } - start++; - count = 0; - prevCh = 0; - } - else // any other unquoted characters - { - if (start >= text.length() || ch != text.charAt(start)) { - // handle cases like: 'MMMM dd' in pattern vs. - // "jan,,,20" in time text, where " " doesn't - // match with ",,,". - pos.setErrorIndex(start); - pos.setIndex(oldStart); - return null; - } - start++; - } - - ++interQuoteCount; - } - } - // Parse the last item in the pattern - if (count > 0) - { - int startOffset = start; - start=subParse(text, start, prevCh, count, - false, ambiguousYear); - if ( start < 0 ) { - pos.setIndex(oldStart); - pos.setErrorIndex(startOffset); - return null; - } - } - - // At this point the fields of Calendar have been set. Calendar - // will fill in default values for missing fields when the time - // is computed. - - pos.setIndex(start); - - // This part is a problem: When we call parsedDate.after, we compute the time. - // Take the date April 3 2004 at 2:30 am. When this is first set up, the year - // will be wrong if we're parsing a 2-digit year pattern. It will be 1904. - // April 3 1904 is a Sunday (unlike 2004) so it is the DST onset day. 2:30 am - // is therefore an "impossible" time, since the time goes from 1:59 to 3:00 am - // on that day. It is therefore parsed out to fields as 3:30 am. Then we - // add 100 years, and get April 3 2004 at 3:30 am. Note that April 3 2004 is - // a Saturday, so it can have a 2:30 am -- and it should. [LIU] - /* - Date parsedDate = calendar.getTime(); - if( ambiguousYear[0] && !parsedDate.after(defaultCenturyStart) ) { - calendar.add(Calendar.YEAR, 100); - parsedDate = calendar.getTime(); - } - */ - // Because of the above condition, save off the fields in case we need to readjust. - // The procedure we use here is not particularly efficient, but there is no other - // way to do this given the API restrictions present in Calendar. We minimize - // inefficiency by only performing this computation when it might apply, that is, - // when the two-digit year is equal to the start year, and thus might fall at the - // front or the back of the default century. This only works because we adjust - // the year correctly to start with in other cases -- see subParse(). - Date parsedDate; - try { - if (ambiguousYear[0]) // If this is true then the two-digit year == the default start year - { - // We need a copy of the fields, and we need to avoid triggering a call to - // complete(), which will recalculate the fields. Since we can't access - // the fields[] array in Calendar, we clone the entire object. This will - // stop working if Calendar.clone() is ever rewritten to call complete(). - Calendar savedCalendar = (Calendar)calendar.clone(); - parsedDate = calendar.getTime(); - if (parsedDate.before(defaultCenturyStart)) - { - // We can't use add here because that does a complete() first. - savedCalendar.set(Calendar.YEAR, defaultCenturyStartYear + 100); - parsedDate = savedCalendar.getTime(); - } - } - else parsedDate = calendar.getTime(); - } - // An IllegalArgumentException will be thrown by Calendar.getTime() - // if any fields are out of range, e.g., MONTH == 17. - catch (IllegalArgumentException e) { - pos.setErrorIndex(start); - pos.setIndex(oldStart); - return null; - } - - return parsedDate; - } - - /** - * Attempt to match the text at a given position against an array of - * strings. Since multiple strings in the array may match (for - * example, if the array contains "a", "ab", and "abc", all will match - * the input string "abcd") the longest match is returned. As a side - * effect, the given field of calendar is set to the index - * of the best match, if there is one. - * @param text the time text being parsed. - * @param start where to start parsing. - * @param field the date field being parsed. - * @param data the string array to parsed. - * @return the new start position if matching succeeded; a negative - * number indicating matching failure, otherwise. As a side effect, - * sets the calendar field field to the index - * of the best match, if matching succeeded. - */ - protected int matchString(String text, int start, int field, String[] data) - { - int i = 0; - int count = data.length; - - if (field == Calendar.DAY_OF_WEEK) i = 1; - - // There may be multiple strings in the data[] array which begin with - // the same prefix (e.g., Cerven and Cervenec (June and July) in Czech). - // We keep track of the longest match, and return that. Note that this - // unfortunately requires us to test all array elements. - int bestMatchLength = 0, bestMatch = -1; - for (; i bestMatchLength && - text.regionMatches(true, start, data[i], 0, length)) - { - bestMatch = i; - bestMatchLength = length; - } - } - if (bestMatch >= 0) - { - calendar.set(field, bestMatch); - return start + bestMatchLength; - } - return -start; - } - - private int matchZoneString(String text, int start, int zoneIndex) { - int j; - for (j = 1; j <= 4; ++j) { - // Checking long and short zones [1 & 2], - // and long and short daylight [3 & 4]. - if (text.regionMatches(true, start, - formatData.zoneStrings[zoneIndex][j], 0, - formatData.zoneStrings[zoneIndex][j].length())) { - break; - } - } - return (j > 4) ? -1 : j; - } - - /** - * find time zone 'text' matched zoneStrings and set to internal - * calendar. - */ - private int subParseZoneString(String text, int start) { - // At this point, check for named time zones by looking through - // the locale data from the DateFormatZoneData strings. - // Want to be able to parse both short and long forms. - int zoneIndex = - formatData.getZoneIndex (getTimeZone().getID()); - TimeZone tz = null; - int j = 0, i = 0; - if ((zoneIndex != -1) && ((j = matchZoneString(text, start, zoneIndex)) > 0)) { - tz = TimeZone.getTimeZone(formatData.zoneStrings[zoneIndex][0]); - i = zoneIndex; - } - if (tz == null) { - zoneIndex = - formatData.getZoneIndex (TimeZone.getDefault().getID()); - if ((zoneIndex != -1) && ((j = matchZoneString(text, start, zoneIndex)) > 0)) { - tz = TimeZone.getTimeZone(formatData.zoneStrings[zoneIndex][0]); - i = zoneIndex; - } - } - - if (tz == null) { - for (i = 0; i < formatData.zoneStrings.length; i++) { - if ((j = matchZoneString(text, start, i)) > 0) { - tz = TimeZone.getTimeZone(formatData.zoneStrings[i][0]); - break; - } - } - } - if (tz != null) { // Matched any ? - calendar.set(Calendar.ZONE_OFFSET, tz.getRawOffset()); - // The code below time zone is assumed to be instance of - // SimpleTimeZone. - calendar.set(Calendar.DST_OFFSET, - j >= 3 ? ((SimpleTimeZone)tz).getDSTSavings() : 0); - return (start + formatData.zoneStrings[i][j].length()); - } - return 0; - } - - /** - * Protected method that converts one field of the input string into a - * numeric field value in calendar. Returns -start (for - * ParsePosition) if failed. Subclasses may override this method to - * modify or add parsing capabilities. - * @param text the time text to be parsed. - * @param start where to start parsing. - * @param ch the pattern character for the date field text to be parsed. - * @param count the count of a pattern character. - * @param obeyCount if true, then the next field directly abuts this one, - * and we should use the count to know when to stop parsing. - * @param ambiguousYear return parameter; upon return, if ambiguousYear[0] - * is true, then a two-digit year was parsed and may need to be readjusted. - * @return the new start position if matching succeeded; a negative - * number indicating matching failure, otherwise. As a side effect, - * set the appropriate field of calendar with the parsed - * value. - */ - protected int subParse(String text, int start, char ch, int count, - boolean obeyCount, boolean[] ambiguousYear) - { - Number number = null; - int value = 0; - int i; - ParsePosition pos = new ParsePosition(0); - int patternCharIndex = -1; - - // TEMPORARY HACK TODO fix this - if (ch == 'u') { // 'u' - EXTENDED_YEAR - pos.setIndex(start); - for (;;) { - if (pos.getIndex() >= text.length()) return -start; - char c = text.charAt(pos.getIndex()); - if (c != ' ' && c != '\t') break; - pos.setIndex(pos.getIndex()+1); - } - if (obeyCount) { - if ((start+count) > text.length()) { - return -start; - } - number = numberFormat.parse(text.substring(0, start+count), pos); - } else { - number = numberFormat.parse(text, pos); - } - if (number == null) { - return -start; - } - value = number.intValue(); - calendar.set(Calendar.EXTENDED_YEAR, value); - return pos.getIndex(); - } - - if ((patternCharIndex=formatData.patternChars.indexOf(ch)) == -1) - return -start; - - pos.setIndex(start); - - int field = PATTERN_INDEX_TO_CALENDAR_FIELD[patternCharIndex]; - - // If there are any spaces here, skip over them. If we hit the end - // of the string, then fail. - for (;;) { - if (pos.getIndex() >= text.length()) return -start; - char c = text.charAt(pos.getIndex()); - if (c != ' ' && c != '\t') break; - pos.setIndex(pos.getIndex()+1); - } - - // We handle a few special cases here where we need to parse - // a number value. We handle further, more generic cases below. We need - // to handle some of them here because some fields require extra processing on - // the parsed value. - if (patternCharIndex == 4 /*HOUR_OF_DAY1_FIELD*/ || - patternCharIndex == 15 /*HOUR1_FIELD*/ || - (patternCharIndex == 2 /*MONTH_FIELD*/ && count <= 2) || - patternCharIndex == 1) - { - // It would be good to unify this with the obeyCount logic below, - // but that's going to be difficult. - if (obeyCount) - { - if ((start+count) > text.length()) return -start; - number = numberFormat.parse(text.substring(0, start+count), pos); - } - else number = numberFormat.parse(text, pos); - if (number == null) - return -start; - value = number.intValue(); - } - - switch (patternCharIndex) - { - case 0: // 'G' - ERA - return matchString(text, start, Calendar.ERA, formatData.eras); - case 1: // 'y' - YEAR - // If there are 3 or more YEAR pattern characters, this indicates - // that the year value is to be treated literally, without any - // two-digit year adjustments (e.g., from "01" to 2001). Otherwise - // we made adjustments to place the 2-digit year in the proper - // century, for parsed strings from "00" to "99". Any other string - // is treated literally: "2250", "-1", "1", "002". - /* 'yy' is the only special case, 'y' is interpreted as number. [Richard/GCL]*/ - if (count == 2 && (pos.getIndex() - start) == 2 - && Character.isDigit(text.charAt(start)) - && Character.isDigit(text.charAt(start+1))) - { - // Assume for example that the defaultCenturyStart is 6/18/1903. - // This means that two-digit years will be forced into the range - // 6/18/1903 to 6/17/2003. As a result, years 00, 01, and 02 - // correspond to 2000, 2001, and 2002. Years 04, 05, etc. correspond - // to 1904, 1905, etc. If the year is 03, then it is 2003 if the - // other fields specify a date before 6/18, or 1903 if they specify a - // date afterwards. As a result, 03 is an ambiguous year. All other - // two-digit years are unambiguous. - int ambiguousTwoDigitYear = defaultCenturyStartYear % 100; - ambiguousYear[0] = value == ambiguousTwoDigitYear; - value += (defaultCenturyStartYear/100)*100 + - (value < ambiguousTwoDigitYear ? 100 : 0); - } - calendar.set(Calendar.YEAR, value); - return pos.getIndex(); - case 2: // 'M' - MONTH - if (count <= 2) // i.e., M or MM. - { - // Don't want to parse the month if it is a string - // while pattern uses numeric style: M or MM. - // [We computed 'value' above.] - calendar.set(Calendar.MONTH, value - 1); - return pos.getIndex(); - } - else - { - // count >= 3 // i.e., MMM or MMMM - // Want to be able to parse both short and long forms. - // Try count == 4 first: - int newStart = 0; - if ((newStart=matchString(text, start, Calendar.MONTH, - formatData.months)) > 0) - return newStart; - else // count == 4 failed, now try count == 3 - return matchString(text, start, Calendar.MONTH, - formatData.shortMonths); - } - case 4: // 'k' - HOUR_OF_DAY: 1-based. eg, 23:59 + 1 hour =>> 24:59 - // [We computed 'value' above.] - if (value == calendar.getMaximum(Calendar.HOUR_OF_DAY)+1) value = 0; - calendar.set(Calendar.HOUR_OF_DAY, value); - return pos.getIndex(); - case 9: { // 'E' - DAY_OF_WEEK - // Want to be able to parse both short and long forms. - // Try count == 4 (DDDD) first: - int newStart = 0; - if ((newStart=matchString(text, start, Calendar.DAY_OF_WEEK, - formatData.weekdays)) > 0) - return newStart; - else // DDDD failed, now try DDD - return matchString(text, start, Calendar.DAY_OF_WEEK, - formatData.shortWeekdays); - } - case 14: // 'a' - AM_PM - return matchString(text, start, Calendar.AM_PM, formatData.ampms); - case 15: // 'h' - HOUR:1-based. eg, 11PM + 1 hour =>> 12 AM - // [We computed 'value' above.] - if (value == calendar.getLeastMaximum(Calendar.HOUR)+1) value = 0; - calendar.set(Calendar.HOUR, value); - return pos.getIndex(); - case 17: // 'z' - ZONE_OFFSET - // First try to parse generic forms such as GMT-07:00. Do this first - // in case localized DateFormatZoneData contains the string "GMT" - // for a zone; in that case, we don't want to match the first three - // characters of GMT+/-HH:MM etc. - { - int sign = 0; - int offset; - - // For time zones that have no known names, look for strings - // of the form: - // GMT[+-]hours:minutes or - // GMT[+-]hhmm or - // GMT. - if ((text.length() - start) >= GMT.length() && - text.regionMatches(true, start, GMT, 0, GMT.length())) - { - calendar.set(Calendar.DST_OFFSET, 0); - - pos.setIndex(start + GMT.length()); - - try { // try-catch for "GMT" only time zone string - if( text.charAt(pos.getIndex()) == '+' ) { - sign = 1; - } else if( text.charAt(pos.getIndex()) == '-' ) { - sign = -1; - } - } catch(StringIndexOutOfBoundsException e) { - } - if (sign == 0) { - calendar.set(Calendar.ZONE_OFFSET, 0 ); - return pos.getIndex(); - } - - // Look for hours:minutes or hhmm. - pos.setIndex(pos.getIndex() + 1); - Number tzNumber = numberFormat.parse(text, pos); - if( tzNumber == null) { - return -start; - } - if( text.charAt(pos.getIndex()) == ':' ) { - // This is the hours:minutes case - offset = tzNumber.intValue() * 60; - pos.setIndex(pos.getIndex() + 1); - tzNumber = numberFormat.parse(text, pos); - if( tzNumber == null) { - return -start; - } - offset += tzNumber.intValue(); - } - else { - // This is the hhmm case. - offset = tzNumber.intValue(); - if( offset < 24 ) - offset *= 60; - else - offset = offset % 100 + offset / 100 * 60; - } - - // Fall through for final processing below of 'offset' and 'sign'. - } - else { - // At this point, check for named time zones by looking through - // the locale data from the DateFormatZoneData strings. - // Want to be able to parse both short and long forms. - i = subParseZoneString(text, start); - if (i != 0) - return i; - - // As a last resort, look for numeric timezones of the form - // [+-]hhmm as specified by RFC 822. This code is actually - // a little more permissive than RFC 822. It will try to do - // its best with numbers that aren't strictly 4 digits long. - DecimalFormat fmt = new DecimalFormat("+####;-####"); - fmt.setParseIntegerOnly(true); - Number tzNumber = fmt.parse( text, pos ); - if( tzNumber == null) { - return -start; // Wasn't actually a number. - } - offset = tzNumber.intValue(); - sign = 1; - if( offset < 0 ) { - sign = -1; - offset = -offset; - } - if( offset < 24 ) - offset = offset * 60; - else - offset = offset % 100 + offset / 100 * 60; - - // Fall through for final processing below of 'offset' and 'sign'. - } - - // Do the final processing for both of the above cases. We only - // arrive here if the form GMT+/-... or an RFC 822 form was seen. - if (sign != 0) - { - offset *= millisPerMinute * sign; - - if (calendar.getTimeZone().useDaylightTime()) - { - calendar.set(Calendar.DST_OFFSET, millisPerHour); - offset -= millisPerHour; - } - calendar.set(Calendar.ZONE_OFFSET, offset); - - return pos.getIndex(); - } - } - - // All efforts to parse a zone failed. - return -start; - - default: - // case 3: // 'd' - DATE - // case 5: // 'H' - HOUR_OF_DAY:0-based. eg, 23:59 + 1 hour =>> 00:59 - // case 6: // 'm' - MINUTE - // case 7: // 's' - SECOND - // case 8: // 'S' - MILLISECOND - // case 10: // 'D' - DAY_OF_YEAR - // case 11: // 'F' - DAY_OF_WEEK_IN_MONTH - // case 12: // 'w' - WEEK_OF_YEAR - // case 13: // 'W' - WEEK_OF_MONTH - // case 16: // 'K' - HOUR: 0-based. eg, 11PM + 1 hour =>> 0 AM - - // Handle "generic" fields - if (obeyCount) - { - if ((start+count) > text.length()) return -start; - number = numberFormat.parse(text.substring(0, start+count), pos); - } - else number = numberFormat.parse(text, pos); - if (number != null) { - calendar.set(field, number.intValue()); - return pos.getIndex(); - } - return -start; - } - } - - - /** - * Translate a pattern, mapping each character in the from string to the - * corresponding character in the to string. - */ - private String translatePattern(String pattern, String from, String to) { - StringBuffer result = new StringBuffer(); - boolean inQuote = false; - for (int i = 0; i < pattern.length(); ++i) { - char c = pattern.charAt(i); - if (inQuote) { - if (c == '\'') - inQuote = false; - } - else { - if (c == '\'') - inQuote = true; - else if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) { - int ci = from.indexOf(c); - if (ci == -1) - throw new IllegalArgumentException("Illegal pattern " + - " character '" + - c + "'"); - c = to.charAt(ci); - } - } - result.append(c); - } - if (inQuote) - throw new IllegalArgumentException("Unfinished quote in pattern"); - return result.toString(); - } - - /** - * Return a pattern string describing this date format. - */ - public String toPattern() { - return pattern; - } - - /** - * Return a localized pattern string describing this date format. - */ - public String toLocalizedPattern() { - return translatePattern(pattern, - formatData.patternChars, - formatData.localPatternChars); - } - - /** - * Apply the given unlocalized pattern string to this date format. - */ - public void applyPattern (String pattern) - { - this.pattern = pattern; - } - - /** - * Apply the given localized pattern string to this date format. - */ - public void applyLocalizedPattern(String pattern) { - this.pattern = translatePattern(pattern, - formatData.localPatternChars, - formatData.patternChars); - } - - /** - * Gets the date/time formatting data. - * @return a copy of the date-time formatting data associated - * with this date-time formatter. - */ - public DateFormatSymbols getDateFormatSymbols() - { - return (DateFormatSymbols)formatData.clone(); - } - - /** - * Allows you to set the date/time formatting data. - * @param newFormatData the given date-time formatting data. - */ - public void setDateFormatSymbols(DateFormatSymbols newFormatSymbols) - { - this.formatData = (DateFormatSymbols)newFormatSymbols.clone(); - } - - /** - * Method for subclasses to access the DateFormatSymbols. - */ - protected DateFormatSymbols getSymbols() { - return formatData; - } - - /** - * Overrides Cloneable - */ - public Object clone() { - SimpleDateFormat other = (SimpleDateFormat) super.clone(); - other.formatData = (DateFormatSymbols) formatData.clone(); - return other; - } - - /** - * Override hashCode. - * Generates the hash code for the SimpleDateFormat object - */ - public int hashCode() - { - return pattern.hashCode(); - // just enough fields for a reasonable distribution - } - - /** - * Override equals. - */ - public boolean equals(Object obj) - { - if (!super.equals(obj)) return false; // super does class check - SimpleDateFormat that = (SimpleDateFormat) obj; - return (pattern.equals(that.pattern) - && formatData.equals(that.formatData)); - } - - /** - * Override readObject. - */ - private void readObject(ObjectInputStream stream) - throws IOException, ClassNotFoundException { - stream.defaultReadObject(); - if (serialVersionOnStream < 1) { - // didn't have defaultCenturyStart field - initializeDefaultCentury(); - } - else { - // fill in dependent transient field - parseAmbiguousDatesAsAfter(defaultCenturyStart); - } - serialVersionOnStream = currentSerialVersion; - } -} diff --git a/icu4j/src/com/ibm/text/StringCharacterIterator.java b/icu4j/src/com/ibm/text/StringCharacterIterator.java deleted file mode 100755 index 6b9f5a30f7..0000000000 --- a/icu4j/src/com/ibm/text/StringCharacterIterator.java +++ /dev/null @@ -1,269 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/StringCharacterIterator.java,v $ - * $Date: 2000/03/10 04:07:23 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - - -// NOTE: This class is identical to java.text.StringCharacterIterator -// in JDK 1.2. It's copied here because the JDK 1.1 version of -// StringCharacterIterator has a bug that prevents it from working -// right with RuleBasedBreakIterator. This class is unnecessary -// when using RuleBasedBreakIterator with JDK 1.2. - -package com.ibm.text; -import java.text.CharacterIterator; - -/** - * StringCharacterIterator implements the - * CharacterIterater protocol for a String. - * The StringCharacterIterator class iterates over the - * entire String. - * - * @see CharacterIterator - */ - -public final class StringCharacterIterator implements CharacterIterator -{ - private String text; - private int begin; - private int end; - // invariant: begin <= pos <= end - private int pos; - - /** - * Constructs an iterator with an initial index of 0. - */ - public StringCharacterIterator(String text) - { - this(text, 0); - } - - /** - * Constructs an iterator with the specified initial index. - * - * @param text The String to be iterated over - * @param pos Initial iterator position - */ - public StringCharacterIterator(String text, int pos) - { - this(text, 0, text.length(), pos); - } - - /** - * Constructs an iterator over the given range of the given string, with the - * index set at the specified position. - * - * @param text The String to be iterated over - * @param begin Index of the first character - * @param end Index of the character following the last character - * @param pos Initial iterator position - */ - public StringCharacterIterator(String text, int begin, int end, int pos) { - if (text == null) { - throw new NullPointerException(); - } - this.text = text; - - if (begin < 0 || begin > end || end > text.length()) { - throw new IllegalArgumentException("Invalid substring range"); - } - - if (pos < begin || pos > end) { - throw new IllegalArgumentException("Invalid position"); - } - - this.begin = begin; - this.end = end; - this.pos = pos; - } - - /** - * Reset this iterator to point to a new string. This package-visible - * method is used by other java.text classes that want to avoid allocating - * new StringCharacterIterator objects every time their setText method - * is called. - * - * @param text The String to be iterated over - */ - public void setText(String text) { - if (text == null) { - throw new NullPointerException(); - } - this.text = text; - this.begin = 0; - this.end = text.length(); - this.pos = 0; - } - - /** - * Implements CharacterIterator.first() for String. - * @see CharacterIterator#first - */ - public char first() - { - pos = begin; - return current(); - } - - /** - * Implements CharacterIterator.last() for String. - * @see CharacterIterator#last - */ - public char last() - { - if (end != begin) { - pos = end - 1; - } else { - pos = end; - } - return current(); - } - - /** - * Implements CharacterIterator.setIndex() for String. - * @see CharacterIterator#setIndex - */ - public char setIndex(int p) - { - if (p < begin || p > end) { - throw new IllegalArgumentException("Invalid index"); - } - pos = p; - return current(); - } - - /** - * Implements CharacterIterator.current() for String. - * @see CharacterIterator#current - */ - public char current() - { - if (pos >= begin && pos < end) { - return text.charAt(pos); - } - else { - return DONE; - } - } - - /** - * Implements CharacterIterator.next() for String. - * @see CharacterIterator#next - */ - public char next() - { - if (pos < end - 1) { - pos++; - return text.charAt(pos); - } - else { - pos = end; - return DONE; - } - } - - /** - * Implements CharacterIterator.previous() for String. - * @see CharacterIterator#previous - */ - public char previous() - { - if (pos > begin) { - pos--; - return text.charAt(pos); - } - else { - return DONE; - } - } - - /** - * Implements CharacterIterator.getBeginIndex() for String. - * @see CharacterIterator#getBeginIndex - */ - public int getBeginIndex() - { - return begin; - } - - /** - * Implements CharacterIterator.getEndIndex() for String. - * @see CharacterIterator#getEndIndex - */ - public int getEndIndex() - { - return end; - } - - /** - * Implements CharacterIterator.getIndex() for String. - * @see CharacterIterator#getIndex - */ - public int getIndex() - { - return pos; - } - - /** - * Compares the equality of two StringCharacterIterator objects. - * @param obj the StringCharacterIterator object to be compared with. - * @return true if the given obj is the same as this - * StringCharacterIterator object; false otherwise. - */ - public boolean equals(Object obj) - { - if (this == obj) { - return true; - } - if (!(obj instanceof StringCharacterIterator)) { - return false; - } - - StringCharacterIterator that = (StringCharacterIterator) obj; - - if (hashCode() != that.hashCode()) { - return false; - } - if (!text.equals(that.text)) { - return false; - } - if (pos != that.pos || begin != that.begin || end != that.end) { - return false; - } - return true; - } - - /** - * Computes a hashcode for this iterator. - * @return A hash code - */ - public int hashCode() - { - return text.hashCode() ^ pos ^ begin ^ end; - } - - /** - * Creates a copy of this iterator. - * @return A copy of this - */ - public Object clone() - { - try { - StringCharacterIterator other - = (StringCharacterIterator) super.clone(); - return other; - } - catch (CloneNotSupportedException e) { - throw new InternalError(); - } - } - -} diff --git a/icu4j/src/com/ibm/text/StringMatcher.java b/icu4j/src/com/ibm/text/StringMatcher.java deleted file mode 100755 index bf378fb811..0000000000 --- a/icu4j/src/com/ibm/text/StringMatcher.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/StringMatcher.java,v $ - * $Date: 2002/02/07 00:53:54 $ - * $Revision: 1.7 $ - * - ***************************************************************************************** - */ -package com.ibm.text; -import com.ibm.util.Utility; - -/** - * An object that matches a fixed input string, implementing the - * UnicodeMatcher API. This object also implements the - * UnicodeReplacer API, allowing it to emit the matched text as - * output. Since the match text may contain flexible match elements, - * such as UnicodeSets, the emitted text is not the match pattern, but - * instead a substring of the actual matched text. Following - * convention, the output text is the leftmost match seen up to this - * point. - * - * A StringMatcher may represent a segment, in which case it has a - * positive segment number. This affects how the matcher converts - * itself to a pattern but does not otherwise affect its function. - * - * A StringMatcher that is not a segment should not be used as a - * UnicodeReplacer. - */ -class StringMatcher implements UnicodeMatcher, UnicodeReplacer { - - /** - * The text to be matched. - */ - private String pattern; - - /** - * Start offset, in the match text, of the rightmost - * match. - */ - private int matchStart; - - /** - * Limit offset, in the match text, of the rightmost - * match. - */ - private int matchLimit; - - /** - * The segment number, 1-based, or 0 if not a segment. - */ - private int segmentNumber; - - /** - * Context object that maps stand-ins to matcher and replacer - * objects. - */ - private final RuleBasedTransliterator.Data data; - - /** - * Construct a matcher that matches the given pattern string. - * @param theString the pattern to be matched, possibly containing - * stand-ins that represent nested UnicodeMatcher objects. - * @param segmentNum the segment number from 1..n, or 0 if this is - * not a segment. - * @param theData context object mapping stand-ins to - * UnicodeMatcher objects. - */ - public StringMatcher(String theString, - int segmentNum, - RuleBasedTransliterator.Data theData) { - data = theData; - pattern = theString; - matchStart = matchLimit = -1; - segmentNumber = segmentNum; - } - - /** - * Construct a matcher that matches a substring of the given - * pattern string. - * @param theString the pattern to be matched, possibly containing - * stand-ins that represent nested UnicodeMatcher objects. - * @param start first character of theString to be matched - * @param limit index after the last character of theString to be - * matched. - * @param segmentNum the segment number from 1..n, or 0 if this is - * not a segment. - * @param theData context object mapping stand-ins to - * UnicodeMatcher objects. - */ - public StringMatcher(String theString, - int start, - int limit, - int segmentNum, - RuleBasedTransliterator.Data theData) { - this(theString.substring(start, limit), segmentNum, theData); - } - - /** - * Implement UnicodeMatcher - */ - public int matches(Replaceable text, - int[] offset, - int limit, - boolean incremental) { - // Note (1): We process text in 16-bit code units, rather than - // 32-bit code points. This works because stand-ins are - // always in the BMP and because we are doing a literal match - // operation, which can be done 16-bits at a time. - int i; - int[] cursor = new int[] { offset[0] }; - if (limit < cursor[0]) { - // Match in the reverse direction - for (i=pattern.length()-1; i>=0; --i) { - char keyChar = pattern.charAt(i); // OK; see note (1) above - UnicodeMatcher subm = data.lookupMatcher(keyChar); - if (subm == null) { - if (cursor[0] > limit && - keyChar == text.charAt(cursor[0])) { // OK; see note (1) above - --cursor[0]; - } else { - return U_MISMATCH; - } - } else { - int m = - subm.matches(text, cursor, limit, incremental); - if (m != U_MATCH) { - return m; - } - } - } - // Record the match position, but adjust for a normal - // forward start, limit, and only if a prior match does not - // exist -- we want the rightmost match. - if (matchStart < 0) { - matchStart = cursor[0]+1; - matchLimit = offset[0]+1; - } - } else { - for (i=0; i 0) { // i.e., if this is a segment - result.append('('); - } - for (int i=0; i 0) { // i.e., if this is a segment - result.append(')'); - } - // Flush quoteBuf out to result - Utility.appendToRule(result, -1, - true, escapeUnprintable, quoteBuf); - return result.toString(); - } - - /** - * Implement UnicodeMatcher - */ - public boolean matchesIndexValue(int v) { - if (pattern.length() == 0) { - return true; - } - int c = UTF16.charAt(pattern, 0); - UnicodeMatcher m = data.lookupMatcher(c); - return (m == null) ? ((c & 0xFF) == v) : m.matchesIndexValue(v); - } - - /** - * Implementation of UnicodeMatcher API. Union the set of all - * characters that may be matched by this object into the given - * set. - * @param toUnionTo the set into which to union the source characters - * @return a reference to toUnionTo - */ - public UnicodeSet getMatchSet(UnicodeSet toUnionTo) { - for (int i=0; i= 0) { - if (matchStart != matchLimit) { - text.copy(matchStart, matchLimit, dest); - outLen = matchLimit - matchStart; - } - } - - text.replace(start, limit, ""); // delete original text - - return outLen; - } - - /** - * UnicodeReplacer API - */ - public String toReplacerPattern(boolean escapeUnprintable) { - // assert(segmentNumber > 0); - StringBuffer rule = new StringBuffer("$"); - Utility.appendNumber(rule, segmentNumber, 10, 1); - return rule.toString(); - } - - /** - * Remove any match data. This must be called before performing a - * set of matches with this segment. - */ - public void resetMatch() { - matchStart = matchLimit = -1; - } -} - -//eof diff --git a/icu4j/src/com/ibm/text/StringReplacer.java b/icu4j/src/com/ibm/text/StringReplacer.java deleted file mode 100755 index 68657a6b88..0000000000 --- a/icu4j/src/com/ibm/text/StringReplacer.java +++ /dev/null @@ -1,278 +0,0 @@ -/* -********************************************************************** -* Copyright (c) 2002, International Business Machines Corporation -* and others. All Rights Reserved. -********************************************************************** -* Date Name Description -* 01/14/2002 aliu Creation. -********************************************************************** -*/ - -package com.ibm.text; -import com.ibm.util.Utility; - -/** - * A replacer that produces static text as its output. The text may - * contain transliterator stand-in characters that represent nested - * UnicodeReplacer objects, making it possible to encode a tree of - * replacers in a StringReplacer. A StringReplacer that contains such - * stand-ins is called a complex StringReplacer. A complex - * StringReplacer has a slower processing loop than a non-complex one. - * @author Alan Liu - */ -class StringReplacer implements UnicodeReplacer { - - /** - * Output text, possibly containing stand-in characters that - * represent nested UnicodeReplacers. - */ - private String output; - - /** - * Cursor position. Value is ignored if hasCursor is false. - */ - private int cursorPos; - - /** - * True if this object outputs a cursor position. - */ - private boolean hasCursor; - - /** - * A complex object contains nested replacers and requires more - * complex processing. StringReplacers are initially assumed to - * be complex. If no nested replacers are seen during processing, - * then isComplex is set to false, and future replacements are - * short circuited for better performance. - */ - private boolean isComplex; - - /** - * Object that translates stand-in characters in 'output' to - * UnicodeReplacer objects. - */ - private final RuleBasedTransliterator.Data data; - - /** - * Construct a StringReplacer that sets the emits the given output - * text and sets the cursor to the given position. - * @param theOutput text that will replace input text when the - * replace() method is called. May contain stand-in characters - * that represent nested replacers. - * @param theCursorPos cursor position that will be returned by - * the replace() method - * @param theData transliterator context object that translates - * stand-in characters to UnicodeReplacer objects - */ - public StringReplacer(String theOutput, - int theCursorPos, - RuleBasedTransliterator.Data theData) { - output = theOutput; - cursorPos = theCursorPos; - hasCursor = true; - data = theData; - isComplex = true; - } - - /** - * Construct a StringReplacer that sets the emits the given output - * text and does not modify the cursor. - * @param theOutput text that will replace input text when the - * replace() method is called. May contain stand-in characters - * that represent nested replacers. - * @param theData transliterator context object that translates - * stand-in characters to UnicodeReplacer objects - */ - public StringReplacer(String theOutput, - RuleBasedTransliterator.Data theData) { - output = theOutput; - cursorPos = 0; - hasCursor = false; - data = theData; - isComplex = true; - } - -//= public static UnicodeReplacer valueOf(String output, -//= int cursorPos, -//= RuleBasedTransliterator.Data data) { -//= if (output.length() == 1) { -//= char c = output.charAt(0); -//= UnicodeReplacer r = data.lookupReplacer(c); -//= if (r != null) { -//= return r; -//= } -//= } -//= return new StringReplacer(output, cursorPos, data); -//= } - - /** - * UnicodeReplacer API - */ - public int replace(Replaceable text, - int start, - int limit, - int[] cursor) { - int outLen; - int newStart = 0; - - // NOTE: It should be possible to _always_ run the complex - // processing code; just slower. If not, then there is a bug - // in the complex processing code. - - // Simple (no nested replacers) Processing Code : - if (!isComplex) { - text.replace(start, limit, output); - outLen = output.length(); - - // Setup default cursor position (for cursorPos within output) - newStart = cursorPos; - } - - // Complex (nested replacers) Processing Code : - else { - /* When there are segments to be copied, use the Replaceable.copy() - * API in order to retain out-of-band data. Copy everything to the - * end of the string, then copy them back over the key. This preserves - * the integrity of indices into the key and surrounding context while - * generating the output text. - */ - int destStart = text.length(); // copy new text to here - int destLimit = destStart; - StringBuffer buf = new StringBuffer(); - int oOutput; // offset into 'output' - isComplex = false; - for (oOutput=0; oOutput 0) { - text.replace(destLimit, destLimit, buf.toString()); - destLimit += buf.length(); - buf.setLength(0); - } - - // Delegate output generation to replacer object - int len = r.replace(text, destLimit, destLimit, cursor); - destLimit += len; - } - oOutput += UTF16.getCharCount(c); - } - // Insert any accumulated straight text. - if (buf.length() > 0) { - text.replace(destLimit, destLimit, buf.toString()); - destLimit += buf.length(); - } - if (oOutput == cursorPos) { - // Record the position of the cursor - newStart = destLimit - destStart; // relative to start - } - - outLen = destLimit - destStart; - - // Copy new text to start, and delete it - text.copy(destStart, destLimit, start); - text.replace(destStart + outLen, destLimit + outLen, ""); - - // Delete the old text (the key) - text.replace(start + outLen, limit + outLen, ""); - } - - if (hasCursor) { - // Adjust the cursor for positions outside the key. These - // refer to code points rather than code units. If cursorPos - // is within the output string, then use newStart, which has - // already been set above. - if (cursorPos < 0) { - newStart = start; - int n = cursorPos; - // Outside the output string, cursorPos counts code points - while (n < 0 && newStart > 0) { - newStart -= UTF16.getCharCount(text.char32At(newStart-1)); - ++n; - } - newStart += n; - } else if (cursorPos > output.length()) { - newStart = start + outLen; - int n = cursorPos - output.length(); - // Outside the output string, cursorPos counts code points - while (n > 0 && newStart < text.length()) { - newStart += UTF16.getCharCount(text.char32At(newStart)); - --n; - } - newStart += n; - } else { - // Cursor is within output string. It has been set up above - // to be relative to start. - newStart += start; - } - - cursor[0] = newStart; - } - - return outLen; - } - - /** - * UnicodeReplacer API - */ - public String toReplacerPattern(boolean escapeUnprintable) { - StringBuffer rule = new StringBuffer(); - StringBuffer quoteBuf = new StringBuffer(); - - int cursor = cursorPos; - - // Handle a cursor preceding the output - if (hasCursor && cursor < 0) { - while (cursor++ < 0) { - Utility.appendToRule(rule, '@', true, escapeUnprintable, quoteBuf); - } - // Fall through and append '|' below - } - - for (int i=0; i rather than >= because - // if cursor == output.length() it is at the end of the output, - // which is the default position, so we need not emit it. - if (hasCursor && cursor > output.length()) { - cursor -= output.length(); - while (cursor-- > 0) { - Utility.appendToRule(rule, '@', true, escapeUnprintable, quoteBuf); - } - Utility.appendToRule(rule, '|', true, escapeUnprintable, quoteBuf); - } - // Flush quoteBuf out to result - Utility.appendToRule(rule, -1, - true, escapeUnprintable, quoteBuf); - - return rule.toString(); - } -} - -//eof diff --git a/icu4j/src/com/ibm/text/StringSearch.java b/icu4j/src/com/ibm/text/StringSearch.java deleted file mode 100755 index 80daaf72cb..0000000000 --- a/icu4j/src/com/ibm/text/StringSearch.java +++ /dev/null @@ -1,638 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/StringSearch.java,v $ - * $Date: 2001/09/12 00:22:19 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ - -package com.ibm.text; - -import java.text.BreakIterator; -import java.text.CharacterIterator; -import java.text.CollationElementIterator; -import java.text.Collator; -import java.text.RuleBasedCollator; -import java.text.StringCharacterIterator; -import java.util.Locale; - -/** - * StringSearch is a SearchIterator that provides - * language-sensitive text searching based on the comparison rules defined - * in a {@link RuleBasedCollator} object. - * Instances of StringSearch function as iterators - * maintain a current position and scan over text returning the index of - * characters where the pattern occurs and the length of each match. - *

- * StringSearch uses a version of the fast Boyer-Moore search - * algorithm that has been adapted to work with the large character set of - * Unicode. See "Efficient Text Searching in Java", to be published in - * Java Report in February, 1999, for further information on the algorithm. - *

- * Consult the SearchIterator documentation for information on - * and examples of how to use instances of this class to implement text - * searching. SearchIterator provides all of the necessary - * API; this class only provides constructors and internal implementation - * methods. - * - * @see SearchIterator - * @see java.text.RuleBasedCollator - * - * @author Laura Werner - * @version 1.0 - */ -public final class StringSearch extends SearchIterator -{ - /** - * Construct a StringSearch object using a specific collator and set - * of boundary-detection rules. - *

- * @param pat The text for which this object will search. - * - * @param target The text in which to search for the pattern. - * - * @param coll A RuleBasedCollator object which defines the - * language-sensitive comparison rules used to determine - * whether text in the pattern and target matches. - * - * @param breaker A BreakIterator object used to constrain the matches - * that are found. Matches whose start and end indices - * in the target text are not boundaries as determined - * by the BreakIterator are ignored. If this behavior - * is not desired, null can be passed in instead. - */ - public StringSearch(String pat, CharacterIterator target, - RuleBasedCollator coll, BreakIterator breaker) { - super(target, breaker); - - pattern = pat; - collator = coll; - strength = coll.getStrength(); - iter = collator.getCollationElementIterator(target); - - initialize(); // Initialize the Boyer-Moore tables - } - - /** - * Construct a StringSearch object using a specific collator. - *

- * @param pattern The text for which this object will search. - * - * @param target The text in which to search for the pattern. - * - * @param collator A RuleBasedCollator object which defines the - * language-sensitive comparison rules used to determine - * whether text in the pattern and target matches. - */ - public StringSearch(String pattern, - CharacterIterator target, - RuleBasedCollator collator) { - this(pattern, target, collator, BreakIterator.getCharacterInstance()); - } - - /** - * Construct a StringSearch object using the collator and - * character boundary detection rules for a given locale - *

- * @param pattern The text for which this object will search. - * - * @param target The text in which to search for the pattern. - * - * @param loc The locale whose collation and break-detection rules - * should be used. - * - * @exception ClassCastException thrown if the collator for the specified - * locale is not a RuleBasedCollator. - */ - public StringSearch(String pattern, CharacterIterator target, Locale loc) { - this(pattern, target, - (RuleBasedCollator) Collator.getInstance(loc), - BreakIterator.getCharacterInstance(loc)); - } - - /** - * Construct a StringSearch object using the collator for the default - * locale - *

- * @param pattern The text for which this object will search. - * - * @param target The text in which to search for the pattern. - * - * @param collator A RuleBasedCollator object which defines the - * language-sensitive comparison rules used to determine - * whether text in the pattern and target matches. - */ - public StringSearch(String pattern, String target) { - this(pattern, - new StringCharacterIterator(target), - (RuleBasedCollator)Collator.getInstance(), - BreakIterator.getCharacterInstance()); - } - - //------------------------------------------------------------------- - // Getters and Setters - //------------------------------------------------------------------- - - /** - * Sets this object's strength property. The strength determines the - * minimum level of difference considered significant during a - * search. Generally, {@link Collator#TERTIARY} and - * {@link Collator#IDENTICAL} indicate that all differences are - * considered significant, {@link Collator#SECONDARY} indicates - * that upper/lower case distinctions should be ignored, and - * {@link Collator#PRIMARY} indicates that both case and accents - * should be ignored. However, the exact meanings of these constants - * are determined by individual Collator objects. - *

- * @see java.text.Collator#PRIMARY - * @see java.text.Collator#SECONDARY - * @see java.text.Collator#TERTIARY - * @see java.text.Collator#IDENTICAL - */ - public void setStrength(int newStrength) { - strength = newStrength; - - // Due to a bug (?) in CollationElementIterator, we must set the - // collator's strength as well, since the iterator is going to - // mask out the portions of the collation element that are not - // relevant for the collator's current strength setting - // Note that this makes it impossible to share a Collator among - // multiple StringSearch objects if you adjust Strength settings. - collator.setStrength(strength); - initialize(); - } - - - /** - * Returns this object's strength property, which indicates what level - * of differences are considered significant during a search. - *

- * @see #setStrength - */ - public int getStrength() { - return strength; - } - - /** - * Set the collator to be used for this string search. Also changes - * the search strength to match that of the new collator. - *

- * This method causes internal data such as Boyer-Moore shift tables - * to be recalculated, but the iterator's position is unchanged. - *

- * @see #getCollator - */ - public void setCollator(RuleBasedCollator coll) { - collator = coll; - strength = collator.getStrength(); - - // Also need to recompute the pattern and get a new target iterator - iter = collator.getCollationElementIterator(getTarget()); - initialize(); - } - - /** - * Return the RuleBasedCollator being used for this string search. - */ - public RuleBasedCollator getCollator() { - return collator; - } - - /** - * Set the pattern for which to search. - * This method causes internal data such as Boyer-Moore shift tables - * to be recalculated, but the iterator's position is unchanged. - */ - public void setPattern(String pat) { - pattern = pat; - initialize(); - } - - /** - * Returns the pattern for which this object is searching. - */ - public String getPattern() { - return pattern; - } - - /** - * Set the target text which should be searched and resets the - * iterator's position to point before the start of the new text. - * This method is useful if you want to re-use an iterator to - * search for the same pattern within a different body of text. - */ - public void setTarget(CharacterIterator target) { - super.setTarget(target); - - // Since we're caching a CollationElementIterator, recreate it - iter = collator.getCollationElementIterator(target); - } - - //------------------------------------------------------------------- - // Privates - //------------------------------------------------------------------- - - /** - * Search forward for matching text, starting at a given location. - * Clients should not call this method directly; instead they should call - * {@link SearchIterator#next}. - *

- * If a match is found, this method returns the index at which the match - * starts and calls {@link SearchIterator#setMatchLength} - * with the number of characters in the target - * text that make up the match. If no match is found, the method returns - * DONE and does not call setMatchLength. - *

- * @param start The index in the target text at which the search starts. - * - * @return The index at which the matched text in the target starts, or DONE - * if no match was found. - *

- * @see SearchIterator#next - * @see SearchIterator#DONE - */ - protected int handleNext(int start) - { - CharacterIterator target = getTarget(); - - int mask = getMask(strength); - int done = CollationElementIterator.NULLORDER & mask; - - if (DEBUG) { - debug("-------------------------handleNext-----------------------------------"); - debug(""); - debug("strength=" + strength + ", mask=" + Integer.toString(mask,16) - + ", done=" + Integer.toString(done,16)); - debug("decomp=" + collator.getDecomposition()); - - debug("target.begin=" + getTarget().getBeginIndex()); - debug("target.end=" + getTarget().getEndIndex()); - debug("start = " + start); - } - - int index = start + minLen; - int matchEnd = 0; - - while (index <= target.getEndIndex()) - { - int patIndex = normLen; - int tval = 0, pval = 0; - boolean getP = true; - - iter.setOffset(index); - matchEnd = index; - - if (DEBUG) debug(" outer loop: patIndex=" + patIndex + ", index=" + index); - - while ((patIndex > 0 || getP == false) && iter.getOffset() > start) - { - if (DEBUG) { - debug(" inner loop: patIndex=" + patIndex + " iter=" + iter.getOffset()); - debug(" getP=" + getP); - } - - // Get the previous character in both the pattern and the target - tval = iter.previous() & mask; - - if (getP) pval = valueList[--patIndex]; - getP = true; - - if (DEBUG) debug(" pval=" + Integer.toString(pval,16) + ", tval=" + Integer.toString(tval,16)); - - if (tval == 0) { // skip tval, use same pval - if (DEBUG) debug(" tval is ignorable"); - getP = false; - } - else if (pval != tval) { // Mismatch, skip ahead - if (DEBUG) debug(" mismatch: skippping " + getShift(tval, patIndex)); - - index += getShift(tval, patIndex); - break; - } - else if (patIndex == 0) { - // The values matched, and we're at the beginning of the pattern, - // which means we matched the whole thing. - start = iter.getOffset(); - setMatchLength(matchEnd - start); - if (DEBUG) debug("Found match at index "+ start ); - return start; - } - } - if (DEBUG) debug(" end of inner loop: patIndex=" + patIndex + " iter=" + iter.getOffset()); - if (DEBUG) debug(" getP=" + getP); - - if (index == matchEnd) { - // We hit the beginning of the text being searched, which is - // possible if it contains lots of ignorable characters. - // Advance one character and try again. - if (DEBUG) debug("hit beginning of target; advance by one"); - index++; - } - } - if (DEBUG) debug("Fell off end of outer loop; returning DONE"); - return DONE; - } - - /** - * Search backward for matching text ,starting at a given location. - * Clients should not call this method directly; instead they should call - * SearchIterator.previous(), which this method overrides. - *

- * If a match is found, this method returns the index at which the match - * starts and calls {@link SearchIterator#setMatchLength} - * with the number of characters in the target - * text that make up the match. If no match is found, the method returns - * DONE and does not call setMatchLength. - *

- * @param start The index in the target text at which the search starts. - * - * @return The index at which the matched text in the target starts, or DONE - * if no match was found. - *

- * @see SearchIterator#previous - * @see SearchIterator#DONE - */ - protected int handlePrev(int start) - { - int patLen = normLen; - int index = start - minLen; - - int mask = getMask(strength); - int done = CollationElementIterator.NULLORDER & mask; - - if (DEBUG) { - debug("-------------------------handlePrev-----------------------------------"); - debug(""); - debug("strength=" + strength + ", mask=" + Integer.toString(mask,16) - + ", done=" + Integer.toString(done,16)); - debug("decomp=" + collator.getDecomposition()); - - debug("target.begin=" + getTarget().getBeginIndex()); - debug("target.end=" + getTarget().getEndIndex()); - } - - while (index >= 0) { - int patIndex = 0; - int tval = 0, pval = 0; - boolean getP = true; - - iter.setOffset(index); - - if (DEBUG) debug(" outer loop: patIndex=" + patIndex + ", index=" + index); - - while ((patIndex < patLen || !getP) && iter.getOffset() < start) - { - if (DEBUG) { - debug(" inner loop: patIndex=" + patIndex + " iter=" + iter.getOffset()); - } - tval = iter.next() & mask; - if (getP) pval = valueList[patIndex++]; - getP = true; - - if (DEBUG) debug(" pval=" + Integer.toString(pval,16) + ", tval=" + Integer.toString(tval,16)); - - if (tval == done) { - if (DEBUG) debug(" end of target; no match"); - return DONE; - } - else if (tval == 0) { - if (DEBUG) debug(" tval is ignorable"); - getP = false; - } - else if (pval != tval) { - // We didn't match this pattern. Skip ahead - if (DEBUG) debug(" mismatch: skippping " + getBackShift(tval, patIndex)); - - int shift = getBackShift(tval, patIndex); - index -= shift; - break; - } - else if (patIndex == patLen) { - // The elements matched and we're at the end of the pattern, - // which means we matched the whole thing. - setMatchLength(iter.getOffset() - index); - return index; - } - } - if (iter.getOffset() >= start) { - // We hit the end of the text being searched, which is - // possible if it contains lots of ignorable characters. - // Back up one character and try again. - if (DEBUG) debug("hit end of target; back by one"); - index--; - } - } - return DONE; - } - - /** - * Return a bitmask that will select only the portions of a collation - * element that are significant at the given strength level. - */ - private static final int getMask(int strength) { - switch (strength) { - case Collator.PRIMARY: - return 0xFFFF0000; - case Collator.SECONDARY: - return 0xFFFFFF00; - default: - return 0xFFFFFFFF; - } - } - - - //------------------------------------------------------------------------ - // Private Data - // - private CollationElementIterator iter; - private RuleBasedCollator collator; - private int strength; - - //------------------------------------------------------------------------ - // Everything from here on down is the data used to represent the - // Boyer-Moore shift tables and the code that generates and manipulates - // them. - // - private static final int MAX_TABLE = 256; // Size of the shift tables - - private int valueList[] = null; - private int shiftTable[] = new int[MAX_TABLE]; - private int backShiftTable[] = new int[MAX_TABLE]; - - private String pattern; // The pattern string - private int normLen = 0; // num. of collation elements in pattern. - private int minLen = 0; // Min of composed, decomposed versions - private int maxLen = 0; // Max - - private void initialize() { - if (DEBUG) { - debug("-------------------------initialize-----------------------------------"); - debug("pattern=" + pattern); - } - - CollationElementIterator iter = collator.getCollationElementIterator(pattern); - - int mask = getMask(strength); - - // See how many non-ignorable collation keys are in the text - normLen = 0; - int elem; - while ((elem = iter.next()) != CollationElementIterator.NULLORDER) - { - if ((elem & mask) != 0) { - normLen++; - } - } - - // Save them all - valueList = new int[normLen]; - int expandLen = 0; - iter.reset(); - - for (int i = 0; i < normLen; i++) - { - elem = iter.next(); - - if ((elem & mask) != 0) { - valueList[i] = elem & mask; - - } - // Keep track of whether there are any expanding-character - // sequences that can result in one of the characters that's in - // the pattern. If there are, we have to reduce the shift - // distances calculated below to account for it. - expandLen += iter.getMaxExpansion(elem) - 1; - } - - // - // We need to remember the size of the composed and decomposed - // versions of the string. Standard Boyer-Moore shift calculations - // can be wrong by an amount up to that difference, since a small - // small number of characters in the pattern can map to a larger - // number in the text being searched, or vice-versa. - // - int uniLen = pattern.length(); - maxLen = Math.max(normLen, uniLen); - minLen = Math.min(normLen, uniLen) - expandLen; - - if (DEBUG) debug("normLen=" + normLen + ", expandLen=" + expandLen - + ", maxLen=" + maxLen + ", minLen=" + minLen); - - // Now initialize the shift tables - // - // NOTE: This is the most conservative way to build them. If we had a way - // of knowing that there were no expanding/contracting chars in the rules, - // we could get rid of the "- 1" in the shiftTable calculations. - // But all of the default collators have at least one expansion or - // contraction, so it probably doesn't matter anyway. - // - for (int i = 0; i < MAX_TABLE; i++) { - shiftTable[i] = backShiftTable[i] = minLen; - } - - for (int i = 0; i < normLen-1; i++) { - shiftTable[hash(valueList[i])] = Math.max(minLen - i - 1, 1); - } - shiftTable[hash(valueList[normLen-1])] = 1; - - for (int i = normLen - 1; i > 0; i--) { - backShiftTable[hash(valueList[i])] = i; - } - backShiftTable[hash(valueList[0])] = 1; - - if (DEBUG) dumpTables(); - } - - /** - * Method used by StringSearch to determine how far to the right to - * shift the pattern during a Boyer-Moore search. - * - * @param curValue The current value in the target text - * @param curIndex The index in the pattern at which we failed to match - * curValue in the target text. - */ - private int getShift( int curValue, int curIndex ) { - int shiftAmt = shiftTable[hash(curValue)]; - - // if (minLen != maxLen) { - int adjust = normLen - curIndex; - // if (shiftAmt > adjust + 1) { - if (adjust > 1 && shiftAmt >= adjust) { - if (DEBUG) debug("getShift: adjusting by " + adjust); - // shiftAmt -= adjust; - shiftAmt -= adjust - 1; - } - // } - return shiftAmt; - } - - /** - * Method used by StringSearch to determine how far to the left to - * shift the pattern during a reverse Boyer-Moore search. - * - * @param curValue The current value in the target text - * @param curIndex The index in the pattern at which we failed to match - * curValue in the target text. - */ - private int getBackShift( int curValue, int curIndex ) { - int shiftAmt = backShiftTable[hash(curValue)]; - - // if (minLen != maxLen) { - int adjust = curIndex; - // int adjust = normLen - (minLen - curIndex); - if (adjust > 1 && shiftAmt > adjust) { - shiftAmt -= adjust - 1; - } - /* - if (shiftAmt > adjust + 1) { - if (DEBUG) debug("getBackShift: adjusting by " + adjust); - shiftAmt -= adjust; - } - */ - // } - return shiftAmt; - } - - /** - * Hash a collation element from its full size (32 bits) down into a - * value that can be used as an index into the shift tables. Right - * now we do a modulus by the size of the hash table. - * - * TODO: At some point I should experiment to see whether a slightly - * more complicated hash function gives us a better distribution - * on multilingual text. I doubt it will have much effect on - * performance, though. - */ - private static final int hash(int order) { - return CollationElementIterator.primaryOrder(order) % MAX_TABLE; - } - - - //------------------------------------------------------------------------- - // Debugging support... - //------------------------------------------------------------------------- - - static private final boolean DEBUG = false; - - static void debug(String str) { - System.out.println(str); - } - - void dumpTables() { - for (int i = 0; i < MAX_TABLE; i++) { - if (shiftTable[i] != minLen) { - debug("shift[" + Integer.toString(i,16) + "] = " + shiftTable[i]); - } - } - for (int i = 0; i < MAX_TABLE; i++) { - if (backShiftTable[i] != minLen) { - debug("backShift[" + Integer.toString(i,16) + "] = " + backShiftTable[i]); - } - } - } -}; diff --git a/icu4j/src/com/ibm/text/SymbolTable.java b/icu4j/src/com/ibm/text/SymbolTable.java deleted file mode 100755 index 838d73bb30..0000000000 --- a/icu4j/src/com/ibm/text/SymbolTable.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/SymbolTable.java,v $ - * $Date: 2001/11/09 00:51:53 $ - * $Revision: 1.8 $ - * - ***************************************************************************************** - */ -package com.ibm.text; -import java.text.ParsePosition; - -/** - * An interface that maps strings to objects. This interface defines - * both lookup protocol and parsing. This allows different components - * to share a symbol table and to handle name parsing uniformly. It - * is expected that client parse code look for the SYMBOL_REF - * character and, when seen, attempt to parse the characters after it - * using parseReference(). - * - *

Currently, RuleBasedTransliterator and UnicodeSet use this - * interface to share variable definitions. - */ -public interface SymbolTable { - - /** - * The character preceding a symbol reference name. - */ - static final char SYMBOL_REF = '$'; - - /** - * Lookup the characters associated with this string and return it. - * Return null if no such name exists. The resultant - * array may have length zero. - */ - char[] lookup(String s); - - /** - * Lookup the UnicodeMatcher associated with the given character, and - * return it. Return null if not found. - * @param ch a 32-bit code point from 0 to 0x10FFFF. - */ - UnicodeMatcher lookupMatcher(int ch); - - /** - * Parse a symbol reference name from the given string, starting - * at the given position. If no valid symbol reference name is - * found, return null and leave pos unchanged. - * @param text the text to parse for the name - * @param pos on entry, the index of the first character to parse. - * This is the character following the SYMBOL_REF character. On - * exit, the index after the last parsed character. - * @param limit the index after the last character to be parsed. - * @return the parsed name. - */ - String parseReference(String text, ParsePosition pos, int limit); -} diff --git a/icu4j/src/com/ibm/text/TitlecaseTransliterator.java b/icu4j/src/com/ibm/text/TitlecaseTransliterator.java deleted file mode 100755 index 2ad26e89d5..0000000000 --- a/icu4j/src/com/ibm/text/TitlecaseTransliterator.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (C) 1996-2000, International Business Machines Corporation and - * others. All Rights Reserved. - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/TitlecaseTransliterator.java,v $ - * $Date: 2002/02/09 01:01:47 $ - * $Revision: 1.11 $ - */ -package com.ibm.text; -import java.util.*; - -/** - * A transliterator that converts all letters (as defined by - * UCharacter.isLetter()) to lower case, except for those - * letters preceded by non-letters. The latter are converted to title - * case using UCharacter.toTitleCase(). - * @author Alan Liu - */ -class TitlecaseTransliterator extends Transliterator { - - static final String _ID = "Any-Title"; - private Locale loc; - - /** - * The set of characters we skip. These are neither cased nor - * non-cased, to us; we copy them verbatim. - */ - static final UnicodeSet SKIP = new UnicodeSet("[\u00AD \u2019 \\' [:Mn:] [:Me:] [:Cf:] [:Lm:] [:Sk:]]"); - - /** - * The set of characters that cause the next non-SKIP character - * to be lowercased. - */ - static final UnicodeSet CASED = new UnicodeSet("[[:Lu:] [:Ll:] [:Lt:]]"); - - /** - * System registration hook. - */ - static void register() { - Transliterator.registerFactory(_ID, new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new TitlecaseTransliterator(Locale.US); - } - }); - - registerSpecialInverse("Title", "Lower", false); - } - - /** - * Constructs a transliterator. - */ - public TitlecaseTransliterator(Locale loc) { - super(_ID, null); - this.loc = loc; - // Need to look back 2 characters in the case of "can't" - setMaximumContextLength(2); - } - - /** - * Implements {@link Transliterator#handleTransliterate}. - */ - protected void handleTransliterate(Replaceable text, - Position offsets, boolean incremental) { - - // Our mode; we are either converting letter toTitle or - // toLower. - boolean doTitle = true; - - // Determine if there is a preceding context of CASED SKIP*, - // in which case we want to start in toLower mode. If the - // prior context is anything else (including empty) then start - // in toTitle mode. - int c; - for (int start = offsets.start - 1; start >= offsets.contextStart; start -= UTF16.getCharCount(c)) { - c = text.char32At(start); - if (SKIP.contains(c)) { - continue; - } - doTitle = !CASED.contains(c); - break; - } - - // Convert things after a CASED character toLower; things - // after a non-CASED, non-SKIP character toTitle. SKIP - // characters are copied directly and do not change the mode. - - int textPos = offsets.start; - if (textPos >= offsets.limit) return; - - // get string for context - // TODO: add convenience method to do this, since we do it all over - - char[] strBuffer = new char[offsets.contextLimit - offsets.contextStart]; // get whole context - text.getChars(offsets.contextStart, offsets.contextLimit, strBuffer, 0); - String original = new String(strBuffer); - - // Walk through original string - // If there is a case change, modify corresponding position in replaceable - - int i = textPos - offsets.contextStart; - int limit = offsets.limit - offsets.contextStart; - int cp; - int oldLen; - int newLen; - - for (; i < limit; i += oldLen) { - cp = UTF16.charAt(original, i); - oldLen = UTF16.getCharCount(cp); - - if (!SKIP.contains(cp)) { - if (doTitle) { - newLen = UCharacter.toTitleCase(loc, original, i, buffer); - } else { - newLen = UCharacter.toLowerCase(loc, original, i, buffer); - } - doTitle = !CASED.contains(cp); - if (newLen >= 0) { - text.replace(textPos, textPos + oldLen, buffer, 0, newLen); - if (newLen != oldLen) { - textPos += newLen; - offsets.limit += newLen - oldLen; - offsets.contextLimit += newLen - oldLen; - continue; - } - } - } - textPos += oldLen; - } - offsets.start = offsets.limit; - } - - private char buffer[] = new char[UCharacter.getMaxCaseExpansion()]; -} diff --git a/icu4j/src/com/ibm/text/TransformTransliterator.java b/icu4j/src/com/ibm/text/TransformTransliterator.java deleted file mode 100755 index b938a9e888..0000000000 --- a/icu4j/src/com/ibm/text/TransformTransliterator.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) 1996-2000, International Business Machines Corporation and - * others. All Rights Reserved. - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/TransformTransliterator.java,v $ - * $Date: 2001/12/03 21:33:58 $ - * $Revision: 1.4 $ - */ -package com.ibm.text; -import java.util.*; - -abstract class TransformTransliterator { - // Currently unused -} - -///** -// * An abstract class for transliterators based on a transform -// * operation. To create a transliterator that implements a -// * transformation, create a subclass of this class and implement the -// * abstract transform() and hasTransform() -// * methods. -// * @author Alan Liu -// */ -//abstract class TransformTransliterator extends Transliterator { -// -// /** -// * Constructs a transliterator. For use by subclasses. -// */ -// protected TransformTransliterator(String id, UnicodeFilter f) { -// super(id, f); -// } -// -// /** -// * Implements {@link Transliterator#handleTransliterate}. -// */ -// protected void handleTransliterate(Replaceable text, -// Position offsets, boolean incremental) { -// -// int start; -// for (start = offsets.start; start < offsets.limit; ++start) { -// // Scan for the first character that is != its transform. -// // If there are none, we fall out without doing anything. -// char c = text.charAt(start); -// if (hasTransform(c)) { -// // There is a transforming character at start. Break -// // up the remaining string, from start to -// // offsets.limit, into segments of unfiltered and -// // filtered characters. Only transform the unfiltered -// // characters. As always, minimize the number of -// // calls to Replaceable.replace(). -// -// int len = offsets.limit - start; -// // assert(len >= 1); -// -// char[] buf = new char[len]; -// text.getChars(start, offsets.limit, buf, 0); -// -// int segStart = 0; -// int segLimit; -// UnicodeFilter filt = getFilter(); -// -// // lenDelta is the accumulated length difference for -// // all transformed segments. It is new length - old -// // length. -// int lenDelta = 0; -// -// // Set segStart, segLimit to the unfiltered segment -// // starting with start. If the filter is null, then -// // segStart/Limit will be set to the whole string, -// // that is, 0/len. -// do { -// // Set segLimit to the first filtered char at or -// // after segStart. -// segLimit = len; -// if (filt != null) { -// segLimit = segStart; -// while (segLimit < len && filt.contains(buf[segLimit])) { -// ++segLimit; -// } -// } -// -// // Transform the unfiltered chars between segStart -// // and segLimit. -// int segLen = segLimit - segStart; -// if (segLen != 0) { -// String newStr = transform( -// new String(buf, segStart, segLen)); -// text.replace(start, start + segLen, newStr); -// start += newStr.length(); -// lenDelta += newStr.length() - segLen; -// } -// -// // Set segStart to the first unfiltered char at or -// // after segLimit. -// segStart = segLimit; -// if (filt != null) { -// while (segStart < len && !filt.contains(buf[segStart])) { -// ++segStart; -// } -// } -// start += segStart - segLimit; -// -// } while (segStart < len); -// -// offsets.limit += lenDelta; -// offsets.contextLimit += lenDelta; -// offsets.start = offsets.limit; -// return; -// } -// } -// // assert(start == offsets.limit); -// offsets.start = start; -// } -// -// /** -// * Subclasses must implement this method to determine whether a -// * given character has a transform that is not equal to itself. -// * This is approximately equivalent to c != -// * transform(String.valueOf(c)), where -// * String.valueOf(c) returns a String containing the -// * single character (not integer) c. Subclasses that -// * transform all their input can simply return true. -// */ -// protected abstract boolean hasTransform(int c); -// -// /** -// * Subclasses must implement this method to transform a string. -// */ -// protected abstract String transform(String s); -//} diff --git a/icu4j/src/com/ibm/text/TransliterationRule.java b/icu4j/src/com/ibm/text/TransliterationRule.java deleted file mode 100755 index 15802f6635..0000000000 --- a/icu4j/src/com/ibm/text/TransliterationRule.java +++ /dev/null @@ -1,711 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/TransliterationRule.java,v $ - * $Date: 2002/02/09 01:01:47 $ - * $Revision: 1.43 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import com.ibm.util.Utility; - -/** - * A transliteration rule used by - * RuleBasedTransliterator. - * TransliterationRule is an immutable object. - * - *

A rule consists of an input pattern and an output string. When - * the input pattern is matched, the output string is emitted. The - * input pattern consists of zero or more characters which are matched - * exactly (the key) and optional context. Context must match if it - * is specified. Context may be specified before the key, after the - * key, or both. The key, preceding context, and following context - * may contain variables. Variables represent a set of Unicode - * characters, such as the letters a through z. - * Variables are detected by looking up each character in a supplied - * variable list to see if it has been so defined. - * - *

A rule may contain segments in its input string and segment - * references in its output string. A segment is a substring of the - * input pattern, indicated by an offset and limit. The segment may - * be in the preceding or following context. It may not span a - * context boundary. A segment reference is a special character in - * the output string that causes a segment of the input string (not - * the input pattern) to be copied to the output string. The range of - * special characters that represent segment references is defined by - * RuleBasedTransliterator.Data. - * - *

Example: The rule "([a-z]) . ([0-9]) > $2 . $1" will change the input - * string "abc.123" to "ab1.c23". - * - *

Copyright © IBM Corporation 1999. All rights reserved. - * - * @author Alan Liu - * @version $RCSfile: TransliterationRule.java,v $ $Revision: 1.43 $ $Date: 2002/02/09 01:01:47 $ - */ -class TransliterationRule { - - // TODO Eliminate the pattern and keyLength data members. They - // are used only by masks() and getIndexValue() which are called - // only during build time, not during run-time. Perhaps these - // methods and pattern/keyLength can be isolated into a separate - // object. - - /** - * The match that must occur before the key, or null if there is no - * preceding context. - */ - private StringMatcher anteContext; - - /** - * The matcher object for the key. If null, then the key is empty. - */ - private StringMatcher key; - - /** - * The match that must occur after the key, or null if there is no - * following context. - */ - private StringMatcher postContext; - - /** - * The object that performs the replacement if the key, - * anteContext, and postContext are matched. Never null. - */ - private UnicodeReplacer output; - - /** - * The string that must be matched, consisting of the anteContext, key, - * and postContext, concatenated together, in that order. Some components - * may be empty (zero length). - * @see anteContextLength - * @see keyLength - */ - private String pattern; - - /** - * An array of matcher objects corresponding to the input pattern - * segments. If there are no segments this is null. N.B. This is - * a UnicodeMatcher for generality, but in practice it is always a - * StringMatcher. In the future we may generalize this, but for - * now we sometimes cast down to StringMatcher. - */ - UnicodeMatcher[] segments; - - /** - * The length of the string that must match before the key. If - * zero, then there is no matching requirement before the key. - * Substring [0,anteContextLength) of pattern is the anteContext. - */ - private int anteContextLength; - - /** - * The length of the key. Substring [anteContextLength, - * anteContextLength + keyLength) is the key. - */ - private int keyLength; - - /** - * Miscellaneous attributes. - */ - byte flags; - - /** - * Flag attributes. - */ - static final int ANCHOR_START = 1; - static final int ANCHOR_END = 2; - - /** - * An alias pointer to the data for this rule. The data provides - * lookup services for matchers and segments. - */ - private final RuleBasedTransliterator.Data data; - - /** - * The character at index i, where i < contextStart || i >= contextLimit, - * is ETHER. This allows explicit matching by rules and UnicodeSets - * of text outside the context. In traditional terms, this allows anchoring - * at the start and/or end. - */ - static final char ETHER = '\uFFFF'; - - private static final String COPYRIGHT = - "\u00A9 IBM Corporation 1999-2001. All rights reserved."; - - /** - * Construct a new rule with the given input, output text, and other - * attributes. A cursor position may be specified for the output text. - * @param input input string, including key and optional ante and - * post context - * @param anteContextPos offset into input to end of ante context, or -1 if - * none. Must be <= input.length() if not -1. - * @param postContextPos offset into input to start of post context, or -1 - * if none. Must be <= input.length() if not -1, and must be >= - * anteContextPos. - * @param output output string - * @param cursorPos offset into output at which cursor is located, or -1 if - * none. If less than zero, then the cursor is placed after the - * output; that is, -1 is equivalent to - * output.length(). If greater than - * output.length() then an exception is thrown. - * @param cursorOffset an offset to be added to cursorPos to position the - * cursor either in the ante context, if < 0, or in the post context, if > - * 0. For example, the rule "abc{def} > | @@@ xyz;" changes "def" to - * "xyz" and moves the cursor to before "a". It would have a cursorOffset - * of -3. - * @param segs array of UnicodeMatcher corresponding to input pattern - * segments, or null if there are none - * @param anchorStart true if the the rule is anchored on the left to - * the context start - * @param anchorEnd true if the rule is anchored on the right to the - * context limit - */ - public TransliterationRule(String input, - int anteContextPos, int postContextPos, - String output, - int cursorPos, int cursorOffset, - UnicodeMatcher[] segs, - boolean anchorStart, boolean anchorEnd, - RuleBasedTransliterator.Data theData) { - data = theData; - - // Do range checks only when warranted to save time - if (anteContextPos < 0) { - anteContextLength = 0; - } else { - if (anteContextPos > input.length()) { - throw new IllegalArgumentException("Invalid ante context"); - } - anteContextLength = anteContextPos; - } - if (postContextPos < 0) { - keyLength = input.length() - anteContextLength; - } else { - if (postContextPos < anteContextLength || - postContextPos > input.length()) { - throw new IllegalArgumentException("Invalid post context"); - } - keyLength = postContextPos - anteContextLength; - } - if (cursorPos < 0) { - cursorPos = output.length(); - } else if (cursorPos > output.length()) { - throw new IllegalArgumentException("Invalid cursor position"); - } - - // We don't validate the segments array. The caller must - // guarantee that the segments are well-formed (that is, that - // all $n references in the output refer to indices of this - // array, and that no array elements are null). - this.segments = segs; - - pattern = input; - flags = 0; - if (anchorStart) { - flags |= ANCHOR_START; - } - if (anchorEnd) { - flags |= ANCHOR_END; - } - - anteContext = null; - if (anteContextLength > 0) { - anteContext = new StringMatcher(pattern.substring(0, anteContextLength), - 0, data); - } - - key = null; - if (keyLength > 0) { - key = new StringMatcher(pattern.substring(anteContextLength, anteContextLength + keyLength), - 0, data); - } - - int postContextLength = pattern.length() - keyLength - anteContextLength; - postContext = null; - if (postContextLength > 0) { - postContext = new StringMatcher(pattern.substring(anteContextLength + keyLength), - 0, data); - } - - this.output = new StringReplacer(output, cursorPos + cursorOffset, data); - } - - /** - * Return the preceding context length. This method is needed to - * support the Transliterator method - * getMaximumContextLength(). - */ - public int getAnteContextLength() { - return anteContextLength + (((flags & ANCHOR_START) != 0) ? 1 : 0); - } - - /** - * Internal method. Returns 8-bit index value for this rule. - * This is the low byte of the first character of the key, - * unless the first character of the key is a set. If it's a - * set, or otherwise can match multiple keys, the index value is -1. - */ - final int getIndexValue() { - if (anteContextLength == pattern.length()) { - // A pattern with just ante context {such as foo)>bar} can - // match any key. - return -1; - } - int c = UTF16.charAt(pattern, anteContextLength); - return data.lookupMatcher(c) == null ? (c & 0xFF) : -1; - } - - /** - * Internal method. Returns true if this rule matches the given - * index value. The index value is an 8-bit integer, 0..255, - * representing the low byte of the first character of the key. - * It matches this rule if it matches the first character of the - * key, or if the first character of the key is a set, and the set - * contains any character with a low byte equal to the index - * value. If the rule contains only ante context, as in foo)>bar, - * then it will match any key. - */ - final boolean matchesIndexValue(int v) { - // Delegate to the key, or if there is none, to the postContext. - // If there is neither then we match any key; return true. - UnicodeMatcher m = (key != null) ? key : postContext; - return (m != null) ? m.matchesIndexValue(v) : true; - } - - /** - * Return true if this rule masks another rule. If r1 masks r2 then - * r1 matches any input string that r2 matches. If r1 masks r2 and r2 masks - * r1 then r1 == r2. Examples: "a>x" masks "ab>y". "a>x" masks "a[b]>y". - * "[c]a>x" masks "[dc]a>y". - */ - public boolean masks(TransliterationRule r2) { - /* Rule r1 masks rule r2 if the string formed of the - * antecontext, key, and postcontext overlaps in the following - * way: - * - * r1: aakkkpppp - * r2: aaakkkkkpppp - * ^ - * - * The strings must be aligned at the first character of the - * key. The length of r1 to the left of the alignment point - * must be <= the length of r2 to the left; ditto for the - * right. The characters of r1 must equal (or be a superset - * of) the corresponding characters of r2. The superset - * operation should be performed to check for UnicodeSet - * masking. - * - * Anchors: Two patterns that differ only in anchors only - * mask one another if they are exactly equal, and r2 has - * all the anchors r1 has (optionally, plus some). Here Y - * means the row masks the column, N means it doesn't. - * - * ab ^ab ab$ ^ab$ - * ab Y Y Y Y - * ^ab N Y N Y - * ab$ N N Y Y - * ^ab$ N N N Y - * - * Post context: {a}b masks ab, but not vice versa, since {a}b - * matches everything ab matches, and {a}b matches {|a|}b but ab - * does not. Pre context is different (a{b} does not align with - * ab). - */ - - /* LIMITATION of the current mask algorithm: Some rule - * maskings are currently not detected. For example, - * "{Lu}]a>x" masks "A]a>y". This can be added later. TODO - */ - - int len = pattern.length(); - int left = anteContextLength; - int left2 = r2.anteContextLength; - int right = pattern.length() - left; - int right2 = r2.pattern.length() - left2; - - // TODO Clean this up -- some logic might be combinable with the - // next statement. - - // Test for anchor masking - if (left == left2 && right == right2 && - keyLength <= r2.keyLength && - r2.pattern.regionMatches(0, pattern, 0, len)) { - // The following boolean logic implements the table above - return (flags == r2.flags) || - (!((flags & ANCHOR_START) != 0) && !((flags & ANCHOR_END) != 0)) || - (((r2.flags & ANCHOR_START) != 0) && ((r2.flags & ANCHOR_END) != 0)); - } - - return left <= left2 && - (right < right2 || - (right == right2 && keyLength <= r2.keyLength)) && - r2.pattern.regionMatches(left2 - left, pattern, 0, len); - } - - static final int posBefore(Replaceable str, int pos) { - return (pos > 0) ? - pos - UTF16.getCharCount(str.char32At(pos-1)) : - pos - 1; - } - - static final int posAfter(Replaceable str, int pos) { - return (pos >= 0 && pos < str.length()) ? - pos + UTF16.getCharCount(str.char32At(pos)) : - pos + 1; - } - - /** - * Attempt a match and replacement at the given position. Return - * the degree of match between this rule and the given text. The - * degree of match may be mismatch, a partial match, or a full - * match. A mismatch means at least one character of the text - * does not match the context or key. A partial match means some - * context and key characters match, but the text is not long - * enough to match all of them. A full match means all context - * and key characters match. - * - * If a full match is obtained, perform a replacement, update pos, - * and return U_MATCH. Otherwise both text and pos are unchanged. - * - * @param text the text - * @param pos the position indices - * @param incremental if TRUE, test for partial matches that may - * be completed by additional text inserted at pos.limit. - * @return one of U_MISMATCH, - * U_PARTIAL_MATCH, or U_MATCH. If - * incremental is FALSE then U_PARTIAL_MATCH will not be returned. - */ - public int matchAndReplace(Replaceable text, - Transliterator.Position pos, - boolean incremental) { - // Matching and replacing are done in one method because the - // replacement operation needs information obtained during the - // match. Another way to do this is to have the match method - // create a match result struct with relevant offsets, and to pass - // this into the replace method. - - // ============================ MATCH =========================== - - // Reset segment match data - if (segments != null) { - for (int i=0; i ", true, escapeUnprintable, quoteBuf); - - // Emit the output pattern - - Utility.appendToRule(rule, output.toReplacerPattern(escapeUnprintable), - true, escapeUnprintable, quoteBuf); - - Utility.appendToRule(rule, ';', true, escapeUnprintable, quoteBuf); - - return rule.toString(); - } - - /** - * Return a string representation of this object. - * @return string representation of this object - */ - public String toString() { - return getClass().getName() + '{' + toRule(true) + '}'; - } - - /** - * Union the set of all characters that may be modified by this rule - * into the given set. - */ - UnicodeSet getSourceSet(UnicodeSet toUnionTo) { - int limit = anteContextLength + keyLength; - for (int i=anteContextLength; ix masking a>y - */ diff --git a/icu4j/src/com/ibm/text/TransliterationRuleSet.java b/icu4j/src/com/ibm/text/TransliterationRuleSet.java deleted file mode 100755 index 919dc89f42..0000000000 --- a/icu4j/src/com/ibm/text/TransliterationRuleSet.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/TransliterationRuleSet.java,v $ - * $Date: 2002/02/09 01:01:47 $ - * $Revision: 1.21 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.util.*; -import com.ibm.util.Utility; - -/** - * A set of rules for a RuleBasedTransliterator. This set encodes - * the transliteration in one direction from one set of characters or short - * strings to another. A RuleBasedTransliterator consists of up to - * two such sets, one for the forward direction, and one for the reverse. - * - *

A TransliterationRuleSet has one important operation, that of - * finding a matching rule at a given point in the text. This is accomplished - * by the findMatch() method. - * - *

Copyright © IBM Corporation 1999. All rights reserved. - * - * @author Alan Liu - * @version $RCSfile: TransliterationRuleSet.java,v $ $Revision: 1.21 $ $Date: 2002/02/09 01:01:47 $ - */ -class TransliterationRuleSet { - /** - * Vector of rules, in the order added. - */ - private Vector ruleVector; - - /** - * Length of the longest preceding context - */ - private int maxContextLength; - - /** - * Sorted and indexed table of rules. This is created by freeze() from - * the rules in ruleVector. rules.length >= ruleVector.size(), and the - * references in rules[] are aliases of the references in ruleVector. - * A single rule in ruleVector is listed one or more times in rules[]. - */ - private TransliterationRule[] rules; - - /** - * Index table. For text having a first character c, compute x = c&0xFF. - * Now use rules[index[x]..index[x+1]-1]. This index table is created by - * freeze(). - */ - private int[] index; - - private static final String COPYRIGHT = - "\u00A9 IBM Corporation 1999-2001. All rights reserved."; - - /** - * Construct a new empty rule set. - */ - public TransliterationRuleSet() { - ruleVector = new Vector(); - maxContextLength = 0; - } - - /** - * Return the maximum context length. - * @return the length of the longest preceding context. - */ - public int getMaximumContextLength() { - return maxContextLength; - } - - /** - * Add a rule to this set. Rules are added in order, and order is - * significant. - * @param rule the rule to add - */ - public void addRule(TransliterationRule rule) { - ruleVector.addElement(rule); - int len; - if ((len = rule.getAnteContextLength()) > maxContextLength) { - maxContextLength = len; - } - - rules = null; - } - - /** - * Close this rule set to further additions, check it for masked rules, - * and index it to optimize performance. - * @exception IllegalArgumentException if some rules are masked - */ - public void freeze() { - /* Construct the rule array and index table. We reorder the - * rules by sorting them into 256 bins. Each bin contains all - * rules matching the index value for that bin. A rule - * matches an index value if string whose first key character - * has a low byte equal to the index value can match the rule. - * - * Each bin contains zero or more rules, in the same order - * they were found originally. However, the total rules in - * the bins may exceed the number in the original vector, - * since rules that have a variable as their first key - * character will generally fall into more than one bin. - * - * That is, each bin contains all rules that either have that - * first index value as their first key character, or have - * a set containing the index value as their first character. - */ - int n = ruleVector.size(); - index = new int[257]; // [sic] - Vector v = new Vector(2*n); // heuristic; adjust as needed - - /* Precompute the index values. This saves a LOT of time. - */ - int[] indexValue = new int[n]; - for (int j=0; j= 0) { - if (indexValue[j] == x) { - v.addElement(ruleVector.elementAt(j)); - } - } else { - // If the indexValue is < 0, then the first key character is - // a set, and we must use the more time-consuming - // matchesIndexValue check. In practice this happens - // rarely, so we seldom tread this code path. - TransliterationRule r = (TransliterationRule) ruleVector.elementAt(j); - if (r.matchesIndexValue(x)) { - v.addElement(r); - } - } - } - } - index[256] = v.size(); - - /* Freeze things into an array. - */ - rules = new TransliterationRule[v.size()]; - v.copyInto(rules); - - StringBuffer errors = null; - - /* Check for masking. This is MUCH faster than our old check, - * which was each rule against each following rule, since we - * only have to check for masking within each bin now. It's - * 256*O(n2^2) instead of O(n1^2), where n1 is the total rule - * count, and n2 is the per-bin rule count. But n2< " + - Utility.formatInput(text, pos)); - } - return true; - case UnicodeMatcher.U_PARTIAL_MATCH: - if (Transliterator.DEBUG) { - System.out.println((incremental ? "Rule.i: partial match ":"Rule: partial match ") + - rules[i].toRule(true) + " => " + - Utility.formatInput(text, pos)); - } - return false; - } - } - // No match or partial match from any rule - pos.start += UTF16.getCharCount(text.char32At(pos.start)); - if (Transliterator.DEBUG) { - System.out.println((incremental ? "Rule.i: no match => ":"Rule: no match => ") + - Utility.formatInput(text, pos)); - } - return true; - } - - /** - * Create rule strings that represents this rule set. - */ - String toRules(boolean escapeUnprintable) { - int i; - int count = ruleVector.size(); - StringBuffer ruleSource = new StringBuffer(); - for (i=0; ix masking a>y - */ diff --git a/icu4j/src/com/ibm/text/Transliterator.java b/icu4j/src/com/ibm/text/Transliterator.java deleted file mode 100755 index d63b1a486d..0000000000 --- a/icu4j/src/com/ibm/text/Transliterator.java +++ /dev/null @@ -1,1569 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/Transliterator.java,v $ - * $Date: 2002/02/09 01:01:47 $ - * $Revision: 1.73 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.util.*; -import java.text.MessageFormat; -import java.text.ParsePosition; -import java.io.UnsupportedEncodingException; -import com.ibm.text.resources.ResourceReader; -import com.ibm.util.CaseInsensitiveString; -import com.ibm.util.Utility; - -/** - * Transliterator is an abstract class that - * transliterates text from one format to another. The most common - * kind of transliterator is a script, or alphabet, transliterator. - * For example, a Russian to Latin transliterator changes Russian text - * written in Cyrillic characters to phonetically equivalent Latin - * characters. It does not translate Russian to English! - * Transliteration, unlike translation, operates on characters, without - * reference to the meanings of words and sentences. - * - *

Although script conversion is its most common use, a - * transliterator can actually perform a more general class of tasks. - * In fact, Transliterator defines a very general API - * which specifies only that a segment of the input text is replaced - * by new text. The particulars of this conversion are determined - * entirely by subclasses of Transliterator. - * - *

Transliterators are stateless - * - *

Transliterator objects are stateless; they - * retain no information between calls to - * transliterate(). As a result, threads may share - * transliterators without synchronizing them. This might seem to - * limit the complexity of the transliteration operation. In - * practice, subclasses perform complex transliterations by delaying - * the replacement of text until it is known that no other - * replacements are possible. In other words, although the - * Transliterator objects are stateless, the source text - * itself embodies all the needed information, and delayed operation - * allows arbitrary complexity. - * - *

Batch transliteration - * - *

The simplest way to perform transliteration is all at once, on a - * string of existing text. This is referred to as batch - * transliteration. For example, given a string input - * and a transliterator t, the call - * - *

String result = t.transliterate(input); - *
- * - * will transliterate it and return the result. Other methods allow - * the client to specify a substring to be transliterated and to use - * {@link Replaceable} objects instead of strings, in order to - * preserve out-of-band information (such as text styles). - * - *

Keyboard transliteration - * - *

Somewhat more involved is keyboard, or incremental - * transliteration. This is the transliteration of text that is - * arriving from some source (typically the user's keyboard) one - * character at a time, or in some other piecemeal fashion. - * - *

In keyboard transliteration, a Replaceable buffer - * stores the text. As text is inserted, as much as possible is - * transliterated on the fly. This means a GUI that displays the - * contents of the buffer may show text being modified as each new - * character arrives. - * - *

Consider the simple RuleBasedTransliterator: - * - *

- * th>{theta}
- * t>{tau} - *
- * - * When the user types 't', nothing will happen, since the - * transliterator is waiting to see if the next character is 'h'. To - * remedy this, we introduce the notion of a cursor, marked by a '|' - * in the output string: - * - *
- * t>|{tau}
- * {tau}h>{theta} - *
- * - * Now when the user types 't', tau appears, and if the next character - * is 'h', the tau changes to a theta. This is accomplished by - * maintaining a cursor position (independent of the insertion point, - * and invisible in the GUI) across calls to - * transliterate(). Typically, the cursor will - * be coincident with the insertion point, but in a case like the one - * above, it will precede the insertion point. - * - *

Keyboard transliteration methods maintain a set of three indices - * that are updated with each call to - * transliterate(), including the cursor, start, - * and limit. These indices are changed by the method, and they are - * passed in and out via a Position object. The start index - * marks the beginning of the substring that the transliterator will - * look at. It is advanced as text becomes committed (but it is not - * the committed index; that's the cursor). The - * cursor index, described above, marks the point at - * which the transliterator last stopped, either because it reached - * the end, or because it required more characters to disambiguate - * between possible inputs. The cursor can also be - * explicitly set by rules in a RuleBasedTransliterator. - * Any characters before the cursor index are frozen; - * future keyboard transliteration calls within this input sequence - * will not change them. New text is inserted at the - * limit index, which marks the end of the substring that - * the transliterator looks at. - * - *

Because keyboard transliteration assumes that more characters - * are to arrive, it is conservative in its operation. It only - * transliterates when it can do so unambiguously. Otherwise it waits - * for more characters to arrive. When the client code knows that no - * more characters are forthcoming, perhaps because the user has - * performed some input termination operation, then it should call - * finishTransliteration() to complete any - * pending transliterations. - * - *

Inverses - * - *

Pairs of transliterators may be inverses of one another. For - * example, if transliterator A transliterates characters by - * incrementing their Unicode value (so "abc" -> "def"), and - * transliterator B decrements character values, then A - * is an inverse of B and vice versa. If we compose A - * with B in a compound transliterator, the result is the - * indentity transliterator, that is, a transliterator that does not - * change its input text. - * - * The Transliterator method getInverse() - * returns a transliterator's inverse, if one exists, or - * null otherwise. However, the result of - * getInverse() usually will not be a true - * mathematical inverse. This is because true inverse transliterators - * are difficult to formulate. For example, consider two - * transliterators: AB, which transliterates the character 'A' - * to 'B', and BA, which transliterates 'B' to 'A'. It might - * seem that these are exact inverses, since - * - *

"A" x AB -> "B"
- * "B" x BA -> "A"
- * - * where 'x' represents transliteration. However, - * - *
"ABCD" x AB -> "BBCD"
- * "BBCD" x BA -> "AACD"
- * - * so AB composed with BA is not the - * identity. Nonetheless, BA may be usefully considered to be - * AB's inverse, and it is on this basis that - * AB.getInverse() could legitimately return - * BA. - * - *

IDs and display names - * - *

A transliterator is designated by a short identifier string or - * ID. IDs follow the format source-destination, - * where source describes the entity being replaced, and - * destination describes the entity replacing - * source. The entities may be the names of scripts, - * particular sequences of characters, or whatever else it is that the - * transliterator converts to or from. For example, a transliterator - * from Russian to Latin might be named "Russian-Latin". A - * transliterator from keyboard escape sequences to Latin-1 characters - * might be named "KeyboardEscape-Latin1". By convention, system - * entity names are in English, with the initial letters of words - * capitalized; user entity names may follow any format so long as - * they do not contain dashes. - * - *

In addition to programmatic IDs, transliterator objects have - * display names for presentation in user interfaces, returned by - * {@link #getDisplayName}. - * - *

Factory methods and registration - * - *

In general, client code should use the factory method - * getInstance() to obtain an instance of a - * transliterator given its ID. Valid IDs may be enumerated using - * getAvailableIDs(). Since transliterators are - * stateless, multiple calls to getInstance() with the - * same ID will return the same object. - * - *

In addition to the system transliterators registered at startup, - * user transliterators may be registered by calling - * registerInstance() at run time. To register a - * transliterator subclass without instantiating it (until it is - * needed), users may call registerClass(). - * - *

Composed transliterators - * - *

In addition to built-in system transliterators like - * "Latin-Greek", there are also built-in composed - * transliterators. These are implemented by composing two or more - * component transliterators. For example, if we have scripts "A", - * "B", "C", and "D", and we want to transliterate between all pairs - * of them, then we need to write 12 transliterators: "A-B", "A-C", - * "A-D", "B-A",..., "D-A", "D-B", "D-C". If it is possible to - * convert all scripts to an intermediate script "M", then instead of - * writing 12 rule sets, we only need to write 8: "A~M", "B~M", "C~M", - * "D~M", "M~A", "M~B", "M~C", "M~D". (This might not seem like a big - * win, but it's really 2n vs. n2 - - * n, so as n gets larger the gain becomes - * significant. With 9 scripts, it's 18 vs. 72 rule sets, a big - * difference.) Note the use of "~" rather than "-" for the script - * separator here; this indicates that the given transliterator is - * intended to be composed with others, rather than be used as is. - * - *

Composed transliterators can be instantiated as usual. For - * example, the system transliterator "Devanagari-Gujarati" is a - * composed transliterator built internally as - * "Devanagari~InterIndic;InterIndic~Gujarati". When this - * transliterator is instantiated, it appears externally to be a - * standard transliterator (e.g., getID() returns - * "Devanagari-Gujarati"). - * - *

Subclassing - * - *

Subclasses must implement the abstract method - * handleTransliterate().

Subclasses should override - * the transliterate() method taking a - * Replaceable and the transliterate() - * method taking a String and StringBuffer - * if the performance of these methods can be improved over the - * performance obtained by the default implementations in this class. - * - *

Copyright © IBM Corporation 1999. All rights reserved. - * - * @author Alan Liu - * @version $RCSfile: Transliterator.java,v $ $Revision: 1.73 $ $Date: 2002/02/09 01:01:47 $ - */ -public abstract class Transliterator { - /** - * Direction constant indicating the forward direction in a transliterator, - * e.g., the forward rules of a RuleBasedTransliterator. An "A-B" - * transliterator transliterates A to B when operating in the forward - * direction, and B to A when operating in the reverse direction. - * @see RuleBasedTransliterator - * @see CompoundTransliterator - */ - public static final int FORWARD = 0; - - /** - * Direction constant indicating the reverse direction in a transliterator, - * e.g., the reverse rules of a RuleBasedTransliterator. An "A-B" - * transliterator transliterates A to B when operating in the forward - * direction, and B to A when operating in the reverse direction. - * @see RuleBasedTransliterator - * @see CompoundTransliterator - */ - public static final int REVERSE = 1; - - /** - * Position structure for incremental transliteration. This data - * structure defines two substrings of the text being - * transliterated. The first region, [contextStart, - * contextLimit), defines what characters the transliterator will - * read as context. The second region, [start, limit), defines - * what characters will actually be transliterated. The second - * region should be a subset of the first. - * - *

After a transliteration operation, some of the indices in this - * structure will be modified. See the field descriptions for - * details. - * - *

contextStart <= start <= limit <= contextLimit - * - *

Note: All index values in this structure must be at code point - * boundaries. That is, none of them may occur between two code units - * of a surrogate pair. If any index does split a surrogate pair, - * results are unspecified. - */ - public static class Position { - - /** - * Beginning index, inclusive, of the context to be considered for - * a transliteration operation. The transliterator will ignore - * anything before this index. INPUT/OUTPUT parameter: This parameter - * is updated by a transliteration operation to reflect the maximum - * amount of antecontext needed by a transliterator. - */ - public int contextStart; - - /** - * Ending index, exclusive, of the context to be considered for a - * transliteration operation. The transliterator will ignore - * anything at or after this index. INPUT/OUTPUT parameter: This - * parameter is updated to reflect changes in the length of the - * text, but points to the same logical position in the text. - */ - public int contextLimit; - - /** - * Beginning index, inclusive, of the text to be transliteratd. - * INPUT/OUTPUT parameter: This parameter is advanced past - * characters that have already been transliterated by a - * transliteration operation. - */ - public int start; - - /** - * Ending index, exclusive, of the text to be transliteratd. - * INPUT/OUTPUT parameter: This parameter is updated to reflect - * changes in the length of the text, but points to the same - * logical position in the text. - */ - public int limit; - - public Position() { - this(0, 0, 0, 0); - } - - public Position(int contextStart, int contextLimit, int start) { - this(contextStart, contextLimit, start, contextLimit); - } - - public Position(int contextStart, int contextLimit, - int start, int limit) { - this.contextStart = contextStart; - this.contextLimit = contextLimit; - this.start = start; - this.limit = limit; - } - - /** - * Check all bounds. If they are invalid, throw an exception. - * @param length the length of the string this object applies to - * @exception IllegalArgumentException if any indices are out - * of bounds - */ - public final void validate(int length) { - if (contextStart < 0 || - start < contextStart || - limit < start || - contextLimit < limit || - length < contextLimit) { - throw new IllegalArgumentException("Invalid Position {cs=" + - contextStart + ", s=" + - start + ", l=" + - limit + ", cl=" + - contextLimit + "}, len=" + - length); - } - } - } - - /** - * Programmatic name, e.g., "Latin-Arabic". - */ - private String ID; - - /** - * This transliterator's filter. Any character for which - * filter.contains() returns false will not be - * altered by this transliterator. If filter is - * null then no filtering is applied. - */ - private UnicodeFilter filter; - - private int maximumContextLength = 0; - - /** - * System transliterator registry. - */ - private static TransliteratorRegistry registry; - - private static Hashtable displayNameCache; - - /** - * Prefix for resource bundle key for the display name for a - * transliterator. The ID is appended to this to form the key. - * The resource bundle value should be a String. - */ - private static final String RB_DISPLAY_NAME_PREFIX = "%Translit%%"; - - /** - * Prefix for resource bundle key for the display name for a - * transliterator SCRIPT. The ID is appended to this to form the key. - * The resource bundle value should be a String. - */ - private static final String RB_SCRIPT_DISPLAY_NAME_PREFIX = "%Translit%"; - - /** - * Resource bundle key for display name pattern. - * The resource bundle value should be a String forming a - * MessageFormat pattern, e.g.: - * "{0,choice,0#|1#{1} Transliterator|2#{1} to {2} Transliterator}". - */ - private static final String RB_DISPLAY_NAME_PATTERN = "TransliteratorNamePattern"; - - /** - * Resource bundle containing display name keys and the - * RB_RULE_BASED_IDS array. - * - *

If we ever integrate this with the Sun JDK, the resource bundle - * root will change to java.text.resources.LocaleElements - */ - private static final String RB_LOCALE_ELEMENTS = - "com.ibm.text.resources.LocaleElements"; - - protected static final char ID_DELIM = ';'; - - protected static final char ID_SEP = '-'; - - protected static final char VARIANT_SEP = '/'; - - private static final String ANY = "Any"; - - /** - * To enable debugging output in the Transliterator component, set - * DEBUG to true. - * - * N.B. Make sure to recompile all of the com.ibm.text package - * after changing this. Easiest way to do this is 'ant clean - * core' ('ant' will NOT pick up the dependency automatically). - * - * <> - */ - static final boolean DEBUG = false; - - private static final String COPYRIGHT = - "\u00A9 IBM Corporation 1999. All rights reserved."; - - /** - * Default constructor. - * @param ID the string identifier for this transliterator - * @param filter the filter. Any character for which - * filter.contains() returns false will not be - * altered by this transliterator. If filter is - * null then no filtering is applied. - */ - protected Transliterator(String ID, UnicodeFilter filter) { - if (ID == null) { - throw new NullPointerException(); - } - this.ID = ID; - this.filter = filter; - } - - /** - * Transliterates a segment of a string, with optional filtering. - * - * @param text the string to be transliterated - * @param start the beginning index, inclusive; 0 <= start - * <= limit. - * @param limit the ending index, exclusive; start <= limit - * <= text.length(). - * @return The new limit index. The text previously occupying [start, - * limit) has been transliterated, possibly to a string of a different - * length, at [start, new-limit), where - * new-limit is the return value. If the input offsets are out of bounds, - * the returned value is -1 and the input string remains unchanged. - */ - public final int transliterate(Replaceable text, int start, int limit) { - if (start < 0 || - limit < start || - text.length() < limit) { - return -1; - } - - Position pos = new Position(start, limit, start); - filteredTransliterate(text, pos, false, true); - return pos.limit; - } - - /** - * Transliterates an entire string in place. Convenience method. - * @param text the string to be transliterated - */ - public final void transliterate(Replaceable text) { - transliterate(text, 0, text.length()); - } - - /** - * Transliterate an entire string and returns the result. Convenience method. - * - * @param text the string to be transliterated - * @return The transliterated text - */ - public final String transliterate(String text) { - ReplaceableString result = new ReplaceableString(text); - transliterate(result); - return result.toString(); - } - - /** - * Transliterates the portion of the text buffer that can be - * transliterated unambiguosly after new text has been inserted, - * typically as a result of a keyboard event. The new text in - * insertion will be inserted into text - * at index.contextLimit, advancing - * index.contextLimit by insertion.length(). - * Then the transliterator will try to transliterate characters of - * text between index.start and - * index.contextLimit. Characters before - * index.start will not be changed. - * - *

Upon return, values in index will be updated. - * index.contextStart will be advanced to the first - * character that future calls to this method will read. - * index.start and index.contextLimit will - * be adjusted to delimit the range of text that future calls to - * this method may change. - * - *

Typical usage of this method begins with an initial call - * with index.contextStart and index.contextLimit - * set to indicate the portion of text to be - * transliterated, and index.start == index.contextStart. - * Thereafter, index can be used without - * modification in future calls, provided that all changes to - * text are made via this method. - * - *

This method assumes that future calls may be made that will - * insert new text into the buffer. As a result, it only performs - * unambiguous transliterations. After the last call to this - * method, there may be untransliterated text that is waiting for - * more input to resolve an ambiguity. In order to perform these - * pending transliterations, clients should call {@link - * #finishTransliteration} after the last call to this - * method has been made. - * - * @param text the buffer holding transliterated and untransliterated text - * @param index the start and limit of the text, the position - * of the cursor, and the start and limit of transliteration. - * @param insertion text to be inserted and possibly - * transliterated into the translation buffer at - * index.contextLimit. If null then no text - * is inserted. - * @see #handleTransliterate - * @exception IllegalArgumentException if index - * is invalid - */ - public final void transliterate(Replaceable text, Position index, - String insertion) { - index.validate(text.length()); - -// int originalStart = index.contextStart; - if (insertion != null) { - text.replace(index.limit, index.limit, insertion); - index.limit += insertion.length(); - index.contextLimit += insertion.length(); - } - - if (index.limit > 0 && - UTF16.isLeadSurrogate(text.charAt(index.limit - 1))) { - // Oops, there is a dangling lead surrogate in the buffer. - // This will break most transliterators, since they will - // assume it is part of a pair. Don't transliterate until - // more text comes in. - return; - } - - filteredTransliterate(text, index, true, true); - -// TODO -// This doesn't work once we add quantifier support. Need to rewrite -// this code to support quantifiers and 'use maximum backup ;'. -// -// index.contextStart = Math.max(index.start - getMaximumContextLength(), -// originalStart); - } - - /** - * Transliterates the portion of the text buffer that can be - * transliterated unambiguosly after a new character has been - * inserted, typically as a result of a keyboard event. This is a - * convenience method; see {@link #transliterate(Replaceable, - * Transliterator.Position, String)} for details. - * @param text the buffer holding transliterated and - * untransliterated text - * @param index the start and limit of the text, the position - * of the cursor, and the start and limit of transliteration. - * @param insertion text to be inserted and possibly - * transliterated into the translation buffer at - * index.contextLimit. - * @see #transliterate(Replaceable, Transliterator.Position, String) - */ - public final void transliterate(Replaceable text, Position index, - int insertion) { - transliterate(text, index, UTF16.valueOf(insertion)); - } - - /** - * Transliterates the portion of the text buffer that can be - * transliterated unambiguosly. This is a convenience method; see - * {@link #transliterate(Replaceable, Transliterator.Position, - * String)} for details. - * @param text the buffer holding transliterated and - * untransliterated text - * @param index the start and limit of the text, the position - * of the cursor, and the start and limit of transliteration. - * @see #transliterate(Replaceable, Transliterator.Position, String) - */ - public final void transliterate(Replaceable text, Position index) { - transliterate(text, index, null); - } - - /** - * Finishes any pending transliterations that were waiting for - * more characters. Clients should call this method as the last - * call after a sequence of one or more calls to - * transliterate(). - * @param text the buffer holding transliterated and - * untransliterated text. - * @param index the array of indices previously passed to {@link - * #transliterate} - */ - public final void finishTransliteration(Replaceable text, - Position index) { - index.validate(text.length()); - filteredTransliterate(text, index, false, true); - } - - /** - * Abstract method that concrete subclasses define to implement - * keyboard transliteration. This method should transliterate all - * characters between pos.start and - * pos.contextLimit that can be unambiguously - * transliterated, regardless of future insertions of text at - * pos.contextLimit. pos.start should - * be advanced past committed characters (those that will not - * change in future calls to this method). - * pos.contextLimit should be updated to reflect text - * replacements that shorten or lengthen the text between - * pos.start and pos.contextLimit. Upon - * return, neither pos.start nor - * pos.contextLimit should be less than the initial value - * of pos.start. pos.contextStart - * should not be changed. - * - *

Subclasses may safely assume that all characters in - * [pos.start, pos.limit) are unfiltered. In other words, the - * filter has already been applied by the time this method is - * called. See filteredTransliterate(). - * - *

This method is not for public consumption. Calling - * this method directly will transliterate [pos.start, - * pos.limit) without applying the filter. End user code that - * wants to call this method should be calling transliterate(). - * Subclass code that wants to call this method should probably be - * calling filteredTransliterate(). - * - *

If incremental is true, then upon return pos.start may be - * less than pos.limit, if some characters are unprocessed. If - * incremental is false, then pos.start should be equal to pos.limit. - * - * @param text the buffer holding transliterated and - * untransliterated text - * @param pos the start and limit of the text, the position - * of the cursor, and the start and limit of transliteration. - * @param incremental if true, assume more text may be coming after - * pos.contextLimit. Otherwise, assume the text is complete. - * @see #transliterate - */ - protected abstract void handleTransliterate(Replaceable text, - Position pos, boolean incremental); - - /** - * Top-level transliteration method, handling filtering, incremental and - * non-incremental transliteration, and rollback. All transliteration - * public API methods eventually call this method with a rollback argument - * of TRUE. Other entities may call this method but rollback should be - * FALSE. - * - *

If this transliterator has a filter, break up the input text into runs - * of unfiltered characters. Pass each run to - * .handleTransliterate(). - * - *

In incremental mode, if rollback is TRUE, perform a special - * incremental procedure in which several passes are made over the input - * text, adding one character at a time, and committing successful - * transliterations as they occur. Unsuccessful transliterations are rolled - * back and retried with additional characters to give correct results. - * - * @param text the text to be transliterated - * @param index the position indices - * @param incremental if TRUE, then assume more characters may be inserted - * at index.limit, and postpone processing to accomodate future incoming - * characters - * @param rollback if TRUE and if incremental is TRUE, then perform special - * incremental processing, as described above, and undo partial - * transliterations where necessary. If incremental is FALSE then this - * parameter is ignored. - */ - private void filteredTransliterate(Replaceable text, - Position index, - boolean incremental, - boolean rollback) { - // Short circuit path for transliterators with no filter in - // non-incremental mode. - if (filter == null && !rollback) { - handleTransliterate(text, index, incremental); - return; - } - - //---------------------------------------------------------------------- - // This method processes text in two groupings: - // - // RUNS -- A run is a contiguous group of characters which are contained - // in the filter for this transliterator (filter.contains(ch) == true). - // Text outside of runs may appear as context but it is not modified. - // The start and limit Position values are narrowed to each run. - // - // PASSES (incremental only) -- To make incremental mode work correctly, - // each run is broken up into n passes, where n is the length (in code - // points) of the run. Each pass contains the first n characters. If a - // pass is completely transliterated, it is committed, and further passes - // include characters after the committed text. If a pass is blocked, - // and does not transliterate completely, then this method rolls back - // the changes made during the pass, extends the pass by one code point, - // and tries again. - //---------------------------------------------------------------------- - - // globalLimit is the limit value for the entire operation. We - // set index.limit to the end of each unfiltered run before - // calling handleTransliterate(), so we need to maintain the real - // value of index.limit here. After each transliteration, we - // update globalLimit for insertions or deletions that have - // happened. - int globalLimit = index.limit; - - // If there is a non-null filter, then break the input text up. Say the - // input text has the form: - // xxxabcxxdefxx - // where 'x' represents a filtered character (filter.contains('x') == - // false). Then we break this up into: - // xxxabc xxdef xx - // Each pass through the loop consumes a run of filtered - // characters (which are ignored) and a subsequent run of - // unfiltered characters (which are transliterated). - - StringBuffer log = null; - if (DEBUG) { - log = new StringBuffer(); - } - - for (;;) { - - if (filter != null) { - // Narrow the range to be transliterated to the first run - // of unfiltered characters at or after index.start. - - // Advance past filtered chars - int c; - while (index.start < globalLimit && - !filter.contains(c=text.char32At(index.start))) { - index.start += UTF16.getCharCount(c); - } - - // Find the end of this run of unfiltered chars - index.limit = index.start; - while (index.limit < globalLimit && - filter.contains(c=text.char32At(index.limit))) { - index.limit += UTF16.getCharCount(c); - } - } - - // Check to see if the unfiltered run is empty. This only - // happens at the end of the string when all the remaining - // characters are filtered. - if (index.start == index.limit) { - break; - } - - // Is this run incremental? If there is additional - // filtered text (if limit < globalLimit) then we pass in - // an incremental value of FALSE to force the subclass to - // complete the transliteration for this run. - boolean isIncrementalRun = - (index.limit < globalLimit ? false : incremental); - - int delta; - - // Implement rollback. To understand the need for rollback, - // consider the following transliterator: - // - // "t" is "a > A;" - // "u" is "A > b;" - // "v" is a compound of "t; NFD; u" with a filter [:Ll:] - // - // Now apply "v" to the input text "a". The result is "b". But if - // the transliteration is done incrementally, then the NFD holds - // things up after "t" has already transformed "a" to "A". When - // finishTransliterate() is called, "A" is _not_ processed because - // it gets excluded by the [:Ll:] filter, and the end result is "A" - // -- incorrect. The problem is that the filter is applied to a - // partially-transliterated result, when we only want it to apply to - // input text. Although this example describes a compound - // transliterator containing NFD and a specific filter, it can - // happen with any transliterator which does a partial - // transformation in incremental mode into characters outside its - // filter. - // - // To handle this, when in incremental mode we supply characters to - // handleTransliterate() in several passes. Each pass adds one more - // input character to the input text. That is, for input "ABCD", we - // first try "A", then "AB", then "ABC", and finally "ABCD". If at - // any point we block (upon return, start < limit) then we roll - // back. If at any point we complete the run (upon return start == - // limit) then we commit that run. - - if (rollback && isIncrementalRun) { - - if (DEBUG) { - log.setLength(0); - System.out.println("filteredTransliterate{"+getID()+"}i: IN=" + - Utility.formatInput(text, index)); - } - - int runStart = index.start; - int runLimit = index.limit; - int runLength = runLimit - runStart; - - // Make a rollback copy at the end of the string - int rollbackOrigin = text.length(); - text.copy(runStart, runLimit, rollbackOrigin); - - // Variables reflecting the commitment of completely - // transliterated text. passStart is the runStart, advanced - // past committed text. rollbackStart is the rollbackOrigin, - // advanced past rollback text that corresponds to committed - // text. - int passStart = runStart; - int rollbackStart = rollbackOrigin; - - // The limit for each pass; we advance by one code point with - // each iteration. - int passLimit = index.start; - - // Total length, in 16-bit code units, of uncommitted text. - // This is the length to be rolled back. - int uncommittedLength = 0; - - // Total delta (change in length) for all passes - int totalDelta = 0; - - // PASS MAIN LOOP -- Start with a single character, and extend - // the text by one character at a time. Roll back partial - // transliterations and commit complete transliterations. - for (;;) { - // Length of additional code point, either one or two - int charLength = - UTF16.getCharCount(text.char32At(passLimit)); - passLimit += charLength; - if (passLimit > runLimit) { - break; - } - uncommittedLength += charLength; - - index.limit = passLimit; - - if (DEBUG) { - log.setLength(0); - log.append("filteredTransliterate{"+getID()+"}i: "); - Utility.formatInput(log, text, index); - } - - // Delegate to subclass for actual transliteration. Upon - // return, start will be updated to point after the - // transliterated text, and limit and contextLimit will be - // adjusted for length changes. - handleTransliterate(text, index, true); - - if (DEBUG) { - log.append(" => "); - Utility.formatInput(log, text, index); - } - - delta = index.limit - passLimit; // change in length - - // We failed to completely transliterate this pass. - // Roll back the text. Indices remain unchanged; reset - // them where necessary. - if (index.start != index.limit) { - // Find the rollbackStart, adjusted for length changes - // and the deletion of partially transliterated text. - int rs = rollbackStart + delta - (index.limit - passStart); - - // Delete the partially transliterated text - text.replace(passStart, index.limit, ""); - - // Copy the rollback text back - text.copy(rs, rs + uncommittedLength, passStart); - - // Restore indices to their original values - index.start = passStart; - index.limit = passLimit; - index.contextLimit -= delta; - - if (DEBUG) { - log.append(" (ROLLBACK)"); - } - } - - // We did completely transliterate this pass. Update the - // commit indices to record how far we got. Adjust indices - // for length change. - else { - // Move the pass indices past the committed text. - passStart = passLimit = index.start; - - // Adjust the rollbackStart for length changes and move - // it past the committed text. All characters we've - // processed to this point are committed now, so zero - // out the uncommittedLength. - rollbackStart += delta + uncommittedLength; - uncommittedLength = 0; - - // Adjust indices for length changes. - runLimit += delta; - totalDelta += delta; - } - - if (DEBUG) { - System.out.println(Utility.escape(log.toString())); - } - } - - // Adjust overall limit and rollbackOrigin for insertions and - // deletions. Don't need to worry about contextLimit because - // handleTransliterate() maintains that. - rollbackOrigin += totalDelta; - globalLimit += totalDelta; - - // Delete the rollback copy - text.replace(rollbackOrigin, rollbackOrigin + runLength, ""); - - // Move start past committed text - index.start = passStart; - } - - else { - // Delegate to subclass for actual transliteration. - if (DEBUG) { - log.setLength(0); - log.append("filteredTransliterate{"+getID()+"}: "); - Utility.formatInput(log, text, index); - } - - int limit = index.limit; - handleTransliterate(text, index, isIncrementalRun); - delta = index.limit - limit; // change in length - - if (DEBUG) { - log.append(" => "); - Utility.formatInput(log, text, index); - } - - // In a properly written transliterator, start == limit after - // handleTransliterate() returns when incremental is false. - // Catch cases where the subclass doesn't do this, and throw - // an exception. (Just pinning start to limit is a bad idea, - // because what's probably happening is that the subclass - // isn't transliterating all the way to the end, and it should - // in non-incremental mode.) - if (!isIncrementalRun && index.start != index.limit) { - throw new RuntimeException("ERROR: Incomplete non-incremental transliteration by " + getID()); - } - - // Adjust overall limit for insertions/deletions. Don't need - // to worry about contextLimit because handleTransliterate() - // maintains that. - globalLimit += delta; - - if (DEBUG) { - System.out.println(Utility.escape(log.toString())); - } - } - - if (filter == null || isIncrementalRun) { - break; - } - - // If we did completely transliterate this - // run, then repeat with the next unfiltered run. - } - - // Start is valid where it is. Limit needs to be put back where - // it was, modulo adjustments for deletions/insertions. - index.limit = globalLimit; - - if (DEBUG) { - System.out.println("filteredTransliterate{"+getID()+"}: OUT=" + - Utility.formatInput(text, index)); - } - } - - /** - * Transliterate a substring of text, as specified by index, taking filters - * into account. This method is for subclasses that need to delegate to - * another transliterator, such as CompoundTransliterator. - * @param text the text to be transliterated - * @param index the position indices - * @param incremental if TRUE, then assume more characters may be inserted - * at index.limit, and postpone processing to accomodate future incoming - * characters - */ - protected void filteredTransliterate(Replaceable text, - Position index, - boolean incremental) { - filteredTransliterate(text, index, incremental, false); - } - - /** - * Returns the length of the longest context required by this transliterator. - * This is preceding context. The default value is zero, but - * subclasses can change this by calling setMaximumContextLength(). - * For example, if a transliterator translates "ddd" (where - * d is any digit) to "555" when preceded by "(ddd)", then the preceding - * context length is 5, the length of "(ddd)". - * - * @return The maximum number of preceding context characters this - * transliterator needs to examine - */ - protected final int getMaximumContextLength() { - return maximumContextLength; - } - - /** - * Method for subclasses to use to set the maximum context length. - * @see #getMaximumContextLength - */ - protected void setMaximumContextLength(int a) { - if (a < 0) { - throw new IllegalArgumentException("Invalid context length " + a); - } - maximumContextLength = a; - } - - /** - * Returns a programmatic identifier for this transliterator. - * If this identifier is passed to getInstance(), it - * will return this object, if it has been registered. - * @see #registerClass - * @see #getAvailableIDs - */ - public final String getID() { - return ID; - } - - /** - * Set the programmatic identifier for this transliterator. Only - * for use by subclasses. - */ - protected final void setID(String id) { - ID = id; - } - - /** - * Returns a name for this transliterator that is appropriate for - * display to the user in the default locale. See {@link - * #getDisplayName(String,Locale)} for details. - */ - public final static String getDisplayName(String ID) { - return getDisplayName(ID, Locale.getDefault()); - } - - /** - * Returns a name for this transliterator that is appropriate for - * display to the user in the given locale. This name is taken - * from the locale resource data in the standard manner of the - * java.text package. - * - *

If no localized names exist in the system resource bundles, - * a name is synthesized using a localized - * MessageFormat pattern from the resource data. The - * arguments to this pattern are an integer followed by one or two - * strings. The integer is the number of strings, either 1 or 2. - * The strings are formed by splitting the ID for this - * transliterator at the first '-'. If there is no '-', then the - * entire ID forms the only string. - * @param inLocale the Locale in which the display name should be - * localized. - * @see java.text.MessageFormat - */ - public static String getDisplayName(String id, Locale inLocale) { - ResourceBundle bundle = ResourceBundle.getBundle( - RB_LOCALE_ELEMENTS, inLocale); - - // Normalize the ID - String stv[] = TransliteratorIDParser.IDtoSTV(id); - if (stv == null) { - // No target; malformed id - return ""; - } - String ID = stv[0] + '-' + stv[1]; - if (stv[2] != null && stv[2].length() > 0) { - ID = ID + '/' + stv[2]; - } - - // Use the registered display name, if any - String n = (String) displayNameCache.get(new CaseInsensitiveString(ID)); - if (n != null) { - return n; - } - - // Use display name for the entire transliterator, if it - // exists. - try { - return bundle.getString(RB_DISPLAY_NAME_PREFIX + ID); - } catch (MissingResourceException e) {} - - try { - // Construct the formatter first; if getString() fails - // we'll exit the try block - MessageFormat format = new MessageFormat( - bundle.getString(RB_DISPLAY_NAME_PATTERN)); - // Construct the argument array - Object[] args = new Object[] { new Integer(2), stv[0], stv[1] }; - - // Use display names for the scripts, if they exist - for (int j=1; j<=2; ++j) { - try { - args[j] = bundle.getString(RB_SCRIPT_DISPLAY_NAME_PREFIX + - (String) args[j]); - } catch (MissingResourceException e) {} - } - - // Format it using the pattern in the resource - return (stv[2].length() > 0) ? - (format.format(args) + '/' + stv[2]) : - format.format(args); - } catch (MissingResourceException e2) {} - - // We should not reach this point unless there is something - // wrong with the build or the RB_DISPLAY_NAME_PATTERN has - // been deleted from the root RB_LOCALE_ELEMENTS resource. - throw new RuntimeException(); - } - - /** - * Returns the filter used by this transliterator, or null - * if this transliterator uses no filter. - */ - public final UnicodeFilter getFilter() { - return filter; - } - - /** - * Changes the filter used by this transliterator. If the filter - * is set to null then no filtering will occur. - * - *

Callers must take care if a transliterator is in use by - * multiple threads. The filter should not be changed by one - * thread while another thread may be transliterating. - */ - public void setFilter(UnicodeFilter filter) { - this.filter = filter; - } - - public static final Transliterator getInstance(String ID) { - return getInstance(ID, FORWARD); - } - - /** - * Returns a Transliterator object given its ID. - * The ID must be either a system transliterator ID or a ID registered - * using registerClass(). - * - * @param ID a valid ID, as enumerated by getAvailableIDs() - * @return A Transliterator object with the given ID - * @exception IllegalArgumentException if the given ID is invalid. - * @see #registerClass - * @see #getAvailableIDs - * @see #getID - */ - public static Transliterator getInstance(String ID, - int dir) { - StringBuffer canonID = new StringBuffer(); - Vector list = new Vector(); - UnicodeSet[] globalFilter = new UnicodeSet[1]; - if (!TransliteratorIDParser.parseCompoundID(ID, dir, canonID, list, globalFilter)) { - throw new IllegalArgumentException("Invalid ID " + ID); - } - - TransliteratorIDParser.instantiateList(list, null, -1); - - // assert(list.size() > 0); - Transliterator t = null; - switch (list.size()) { - case 1: - t = (Transliterator) list.elementAt(0); - break; - default: - t = new CompoundTransliterator(list); - break; - } - t.setID(canonID.toString()); - if (globalFilter[0] != null) { - t.setFilter(globalFilter[0]); - } - return t; - } - - /** - * Create a transliterator from a basic ID. This is an ID - * containing only the forward direction source, target, and - * variant. - * @param id a basic ID of the form S-T or S-T/V. - * @param canonID canonical ID to apply to the result, or - * null to leave the ID unchanged - * @return a newly created Transliterator or null if the ID is - * invalid. - */ - static Transliterator getBasicInstance(String id, String canonID) { - StringBuffer s = new StringBuffer(); - Transliterator t = registry.get(id, s); - if (s.length() != 0) { - // assert(t==0); - // Instantiate an alias - t = getInstance(s.toString(), FORWARD); - } - if (t != null && canonID != null) { - t.setID(canonID); - } - return t; - } - - /** - * Returns a Transliterator object constructed from - * the given rule string. This will be a RuleBasedTransliterator, - * if the rule string contains only rules, or a - * CompoundTransliterator, if it contains ID blocks, or a - * NullTransliterator, if it contains ID blocks which parse as - * empty for the given direction. - */ - public static final Transliterator createFromRules(String ID, String rules, int dir) { - Transliterator t = null; - - TransliteratorParser parser = new TransliteratorParser(); - parser.parse(rules, dir); - - // NOTE: The logic here matches that in TransliteratorRegistry. - if (parser.idBlock.length() == 0) { - if (parser.data == null) { - // No idBlock, no data -- this is just an - // alias for Null - t = new NullTransliterator(); - } else { - // No idBlock, data != 0 -- this is an - // ordinary RBT_DATA. - t = new RuleBasedTransliterator(ID, parser.data, null); - } - } else { - if (parser.data == null) { - // idBlock, no data -- this is an alias. The ID has - // been munged from reverse into forward mode, if - // necessary, so instantiate the ID in the forward - // direction. - t = getInstance(parser.idBlock); - if (t != null) { - t.setID(ID); - } - } else { - // idBlock and data -- this is a compound - // RBT - t = new RuleBasedTransliterator("_", parser.data, null); - t = new CompoundTransliterator(ID, parser.idBlock, parser.idSplitPoint, - t); - if (parser.compoundFilter != null) { - t.setFilter(parser.compoundFilter); - } - } - } - - return t; - } - - public String toRules(boolean escapeUnprintable) { - return baseToRules(escapeUnprintable); - } - - protected final String baseToRules(boolean escapeUnprintable) { - // The base class implementation of toRules munges the ID into - // the correct format. That is: foo => ::foo - // KEEP in sync with rbt_pars - if (escapeUnprintable) { - StringBuffer rulesSource = new StringBuffer(); - String id = getID(); - for (int i=0; igetID() - * returns "A-B", then this method will return the result of - * getInstance("B-A"), or null if that - * call fails. - * - *

Subclasses with knowledge of their inverse may wish to - * override this method. - * - * @return a transliterator that is an inverse, not necessarily - * exact, of this transliterator, or null if no such - * transliterator is registered. - * @see #registerClass - */ - public final Transliterator getInverse() { - return getInstance(ID, REVERSE); - } - - /** - * Registers a subclass of Transliterator with the - * system. This subclass must have a public constructor taking no - * arguments. When that constructor is called, the resulting - * object must return the ID passed to this method if - * its getID() method is called. - * - * @param ID the result of getID() for this - * transliterator - * @param transClass a subclass of Transliterator - * @see #unregister - */ - public static void registerClass(String ID, Class transClass, String displayName) { - registry.put(ID, transClass, true); - if (displayName != null) { - displayNameCache.put(new CaseInsensitiveString(ID), displayName); - } - } - - /** - * Register a factory object with the given ID. The factory - * method should return a new instance of the given transliterator. - * @param ID the ID of this transliterator - * @param factory the factory object - */ - public static void registerFactory(String ID, Factory factory) { - registry.put(ID, factory, true); - } - - /** - * Register two targets as being inverses of one another. For - * example, calling registerSpecialInverse("NFC", "NFD", true) causes - * Transliterator to form the following inverse relationships: - * - *

NFC => NFD
-     * Any-NFC => Any-NFD
-     * NFD => NFC
-     * Any-NFD => Any-NFC
- * - * (Without the special inverse registration, the inverse of NFC - * would be NFC-Any.) Note that NFD is shorthand for Any-NFD, but - * that the presence or absence of "Any-" is preserved. - * - *

The relationship is symmetrical; registering (a, b) is - * equivalent to registering (b, a). - * - *

The relevant IDs must still be registered separately as - * factories or classes. - * - *

Only the targets are specified. Special inverses always - * have the form Any-Target1 <=> Any-Target2. The target should - * have canonical casing (the casing desired to be produced when - * an inverse is formed) and should contain no whitespace or other - * extraneous characters. - * - * @param target the target against which to register the inverse - * @param inverseTarget the inverse of target, that is - * Any-target.getInverse() => Any-inverseTarget - * @param bidirectional if true, register the reverse relation - * as well, that is, Any-inverseTarget.getInverse() => Any-target - */ - static void registerSpecialInverse(String target, - String inverseTarget, - boolean bidirectional) { - TransliteratorIDParser.registerSpecialInverse(target, inverseTarget, bidirectional); - } - - /** - * Unregisters a transliterator or class. This may be either - * a system transliterator or a user transliterator or class. - * - * @param ID the ID of the transliterator or class - * @see #registerClass - */ - public static void unregister(String ID) { - displayNameCache.remove(new CaseInsensitiveString(ID)); - registry.remove(ID); - } - - /** - * Returns an enumeration over the programmatic names of registered - * Transliterator objects. This includes both system - * transliterators and user transliterators registered using - * registerClass(). The enumerated names may be - * passed to getInstance(). - * - * @return An Enumeration over String objects - * @see #getInstance - * @see #registerClass - */ - public static final Enumeration getAvailableIDs() { - return registry.getAvailableIDs(); - } - - public static final Enumeration getAvailableSources() { - return registry.getAvailableSources(); - } - - public static final Enumeration getAvailableTargets(String source) { - return registry.getAvailableTargets(source); - } - - public static final Enumeration getAvailableVariants(String source, - String target) { - return registry.getAvailableVariants(source, target); - } - - /** - * Method for subclasses to use to obtain a character in the given - * string, with filtering. If the character at the given offset - * is excluded by this transliterator's filter, then U+FFFE is returned. - * - *

Note: Most subclasses that implement - * handleTransliterator() will not want to use this - * method, since characters they see are already filtered. - * - * @deprecated the new architecture provides filtering at the top - * level. This method will be removed Dec 31 2001. - */ - protected char filteredCharAt(Replaceable text, int i) { - char c; - UnicodeFilter filter = getFilter(); - return (filter == null) ? text.charAt(i) : - (filter.contains(c = text.charAt(i)) ? c : '\uFFFE'); - } - - static { - registry = new TransliteratorRegistry(); - - // The display name cache starts out empty - displayNameCache = new Hashtable(); - - // Read the index file and populate the registry. - // Each line of the index file is either blank, a '#' comment, - // or a colon-delimited line. In the latter case the first - // field is the ID being defined. The second field is one of - // three strings: "file", "internal", or "alias". Remaining - // fields vary according the value fo the second field. See - // the index file itself for further documentation. - ResourceReader r = new ResourceReader("Transliterator_index.txt"); - for (;;) { - String line = null; - try { - line = r.readLine(); - } catch (java.io.IOException e) { - throw new RuntimeException("Can't read Transliterator_index.txt"); - } - if (line == null) { - break; - } - try { - // Skip over whitespace - int pos = 0; - while (pos < line.length() && - Character.isWhitespace(line.charAt(pos))) { - ++pos; - } - // Ignore blank lines and comments - if (pos == line.length() || line.charAt(pos) == '#') { - continue; - } - // Parse colon-delimited line - int colon = line.indexOf(':', pos); - String ID = line.substring(pos, colon); - pos = colon+1; - colon = line.indexOf(':', pos); - String type = line.substring(pos, colon); - pos = colon+1; - - if (type.equals("file") || type.equals("internal")) { - // Rest of line is :: - // pos colon c2 - colon = line.indexOf(':', pos); - int c2 = line.indexOf(':', colon+1); - int dir; - switch (line.charAt(c2+1)) { - case 'F': - dir = FORWARD; - break; - case 'R': - dir = REVERSE; - break; - default: - throw new RuntimeException("Can't parse line: " + line); - } - registry.put(ID, - line.substring(pos, colon), // resource - line.substring(colon+1, c2), // encoding - dir, - !type.equals("internal")); - } else if (type.equals("alias")) { - // Rest of line is the - registry.put(ID, line.substring(pos), true); - } else { - // Unknown type - throw new RuntimeException("Can't parse line: " + line); - } - } catch (StringIndexOutOfBoundsException e) { - throw new RuntimeException("Can't parse line: " + line); - } - } - - registerSpecialInverse(NullTransliterator.SHORT_ID, NullTransliterator.SHORT_ID, false); - - // Register non-rule-based transliterators - registerClass(NullTransliterator._ID, - NullTransliterator.class, null); - RemoveTransliterator.register(); - EscapeTransliterator.register(); - UnescapeTransliterator.register(); - LowercaseTransliterator.register(); - UppercaseTransliterator.register(); - TitlecaseTransliterator.register(); - UnicodeNameTransliterator.register(); - NameUnicodeTransliterator.register(); - NormalizationTransliterator.register(); - } - - /** - * The factory interface for transliterators. Transliterator - * subclasses can register factory objects for IDs using the - * registerFactory() method of Transliterator. When invoked, the - * factory object will be passed the ID being instantiated. This - * makes it possible to register one factory method to more than - * one ID, or for a factory method to parameterize its result - * based on the variant. - */ - public static interface Factory { - Transliterator getInstance(String ID); - } -} diff --git a/icu4j/src/com/ibm/text/TransliteratorIDParser.java b/icu4j/src/com/ibm/text/TransliteratorIDParser.java deleted file mode 100755 index 1799c2b4eb..0000000000 --- a/icu4j/src/com/ibm/text/TransliteratorIDParser.java +++ /dev/null @@ -1,780 +0,0 @@ -/* -********************************************************************** -* Copyright (c) 2002, International Business Machines Corporation -* and others. All Rights Reserved. -********************************************************************** -* Date Name Description -* 01/14/2002 aliu Creation. -********************************************************************** -*/ - -package com.ibm.text; - -import com.ibm.util.CaseInsensitiveString; -import com.ibm.util.Utility; -import java.text.ParsePosition; -import java.util.Hashtable; -import java.util.Vector; - -/** - * Parsing component for transliterator IDs. This class contains only - * static members; it cannot be instantiated. Methods in this class - * parse various ID formats, including the following: - * - * A basic ID, which contains source, target, and variant, but no - * filter and no explicit inverse. Examples include - * "Latin-Greek/UNGEGN" and "Null". - * - * A single ID, which is a basic ID plus optional filter and optional - * explicit inverse. Examples include "[a-zA-Z] Latin-Greek" and - * "Lower (Upper)". - * - * A compound ID, which is a sequence of one or more single IDs, - * separated by semicolons, with optional forward and reverse global - * filters. The global filters are UnicodeSet patterns prepended or - * appended to the IDs, separated by semicolons. An appended filter - * must be enclosed in parentheses and applies in the reverse - * direction. - * - * @author Alan Liu - */ -class TransliteratorIDParser { - - private static final char ID_DELIM = ';'; - - private static final char TARGET_SEP = '-'; - - private static final char VARIANT_SEP = '/'; - - private static final char OPEN_REV = '('; - - private static final char CLOSE_REV = ')'; - - private static final String ANY = "Any"; - - private static final int FORWARD = Transliterator.FORWARD; - - private static final int REVERSE = Transliterator.REVERSE; - - private static final Hashtable SPECIAL_INVERSES = new Hashtable(); - - /** - * A structure containing the parsed data of a filtered ID, that - * is, a basic ID optionally with a filter. - * - * 'source' and 'target' will always be non-null. The 'variant' - * will be non-null only if a non-empty variant was parsed. - * - * 'sawSource' is true if there was an explicit source in the - * parsed id. If there was no explicit source, then an implied - * source of ANY is returned and 'sawSource' is set to false. - * - * 'filter' is the parsed filter pattern, or null if there was no - * filter. - */ - private static class Specs { - public String source; // not null - public String target; // not null - public String variant; // may be null - public String filter; // may be null - public boolean sawSource; - Specs(String s, String t, String v, boolean sawS, String f) { - source = s; - target = t; - variant = v; - sawSource = sawS; - filter = f; - } - } - - /** - * A structure containing the canonicalized data of a filtered ID, - * that is, a basic ID optionally with a filter. - * - * 'canonID' is always non-null. It may be the empty string "". - * It is the id that should be assigned to the created - * transliterator. It _cannot_ be instantiated directly. - * - * 'basicID' is always non-null and non-empty. It is always of - * the form S-T or S-T/V. It is designed to be fed to low-level - * instantiation code that only understands these two formats. - * - * 'filter' may be null, if there is none, or non-null and - * non-empty. - */ - public static class SingleID { - public String canonID; - public String basicID; - public String filter; - SingleID(String c, String b, String f) { - canonID = c; - basicID = b; - filter = f; - } - SingleID(String c, String b) { - this(c, b, null); - } - Transliterator getInstance() { - Transliterator t; - if (basicID == null || basicID.length() == 0) { - t = Transliterator.getBasicInstance("Any-Null", canonID); - } else { - t = Transliterator.getBasicInstance(basicID, canonID); - } - if (t != null) { - if (filter != null) { - t.setFilter(new UnicodeSet(filter)); - } - } - return t; - } - } - - /** - * Parse a basic ID from the given string. A basic ID contains - * only a single source, target, and variant. It does not contain - * a filter or an explicit inverse. - * @param id the id to be parsed - * @param pos INPUT-OUTPUT parameter. On input, the position of - * the first character to parse. On output, the position after - * the last character parsed. If the parse fails pos[0] will be - * unchanged. - * @return the parsed ID in canonical format, or null on parse - * failure. If the parsed ID did not contain a source, the return - * ID will not. - */ - public static String parseBasicID(String id, int[] pos) { - Specs specs = parseFilterID(id, pos, false); - if (specs != null) { - StringBuffer buf = new StringBuffer(); - if (specs.sawSource) { - buf.append(specs.source); - buf.append(TARGET_SEP); - } - buf.append(specs.target); - if (specs.variant != null) { - buf.append(VARIANT_SEP); - buf.append(specs.variant); - } - return buf.toString(); - } - return null; - } - - /** - * Parse a single ID, that is, an ID of the general form - * "[f1] s1-t1/v1 ([f2] s2-t3/v2)", with the parenthesized element - * optional, the filters optional, and the variants optional. - * @param id the id to be parsed - * @param pos INPUT-OUTPUT parameter. On input, the position of - * the first character to parse. On output, the position after - * the last character parsed. - * @param dir the direction. If the direction is REVERSE then the - * SingleID is constructed for the reverse direction. - * @return a SingleID object or null - */ - public static SingleID parseSingleID(String id, int[] pos, int dir) { - - int start = pos[0]; - - // The ID will be of the form A, A(), A(B), or (B), where - // A and B are filter IDs. - Specs specsA = null; - Specs specsB = null; - boolean sawParen = false; - - // On the first pass, look for (B) or (). If this fails, then - // on the second pass, look for A, A(B), or A(). - for (int pass=1; pass<=2; ++pass) { - if (pass == 2) { - specsA = parseFilterID(id, pos, true); - if (specsA == null) { - pos[0] = start; - return null; - } - } - if (Utility.parseChar(id, pos, OPEN_REV)) { - sawParen = true; - if (!Utility.parseChar(id, pos, CLOSE_REV)) { - specsB = parseFilterID(id, pos, true); - // Must close with a ')' - if (specsB == null || !Utility.parseChar(id, pos, CLOSE_REV)) { - pos[0] = start; - return null; - } - } - break; - } - } - - // Assemble return results - SingleID single; - if (sawParen) { - if (dir == FORWARD) { - single = specsToID(specsA, FORWARD); - single.canonID = single.canonID + - OPEN_REV + specsToID(specsB, FORWARD).canonID + CLOSE_REV; - if (specsA != null) { - single.filter = specsA.filter; - } - } else { - single = specsToID(specsB, FORWARD); - single.canonID = single.canonID + - OPEN_REV + specsToID(specsA, FORWARD).canonID + CLOSE_REV; - if (specsB != null) { - single.filter = specsB.filter; - } - } - } else { - // assert(specsA != null); - if (dir == FORWARD) { - single = specsToID(specsA, FORWARD); - } else { - single = specsToSpecialInverse(specsA); - if (single == null) { - single = specsToID(specsA, REVERSE); - } - } - single.filter = specsA.filter; - } - - return single; - } - - /** - * Parse a global filter of the form "[f]" or "([f])", depending - * on 'withParens'. - * @param id the pattern the parse - * @param pos INPUT-OUTPUT parameter. On input, the position of - * the first character to parse. On output, the position after - * the last character parsed. - * @param dir the direction. - * @param withParens INPUT-OUTPUT parameter. On entry, if - * withParens[0] is 0, then parens are disallowed. If it is 1, - * then parens are requires. If it is -1, then parens are - * optional, and the return result will be set to 0 or 1. - * @param canonID OUTPUT parameter. The pattern for the filter - * added to the canonID, either at the end, if dir is FORWARD, or - * at the start, if dir is REVERSE. The pattern will be enclosed - * in parentheses if appropriate, and will be suffixed with an - * ID_DELIM character. May be null. - * @return a UnicodeSet object or null. A non-null results - * indicates a successful parse, regardless of whether the filter - * applies to the given direction. The caller should discard it - * if withParens != (dir == REVERSE). - */ - public static UnicodeSet parseGlobalFilter(String id, int[] pos, int dir, - int[] withParens, - StringBuffer canonID) { - UnicodeSet filter = null; - int start = pos[0]; - - if (withParens[0] == -1) { - withParens[0] = Utility.parseChar(id, pos, OPEN_REV) ? 1 : 0; - } else if (withParens[0] == 1) { - if (!Utility.parseChar(id, pos, OPEN_REV)) { - pos[0] = start; - return null; - } - } - - Utility.skipWhitespace(id, pos); - - if (UnicodeSet.resemblesPattern(id, pos[0])) { - ParsePosition ppos = new ParsePosition(pos[0]); - try { - filter = new UnicodeSet(id, ppos, null); - } catch (IllegalArgumentException e) { - pos[0] = start; - return null; - } - - String pattern = id.substring(pos[0], ppos.getIndex()); - pos[0] = ppos.getIndex(); - - if (withParens[0] == 1 && !Utility.parseChar(id, pos, CLOSE_REV)) { - pos[0] = start; - return null; - } - - // In the forward direction, append the pattern to the - // canonID. In the reverse, insert it at zero, and invert - // the presence of parens ("A" <-> "(A)"). - if (canonID != null) { - if (dir == FORWARD) { - if (withParens[0] == 1) { - pattern = String.valueOf(OPEN_REV) + pattern + CLOSE_REV; - } - canonID.append(pattern + ID_DELIM); - } else { - if (withParens[0] == 0) { - pattern = String.valueOf(OPEN_REV) + pattern + CLOSE_REV; - } - canonID.insert(0, pattern + ID_DELIM); - } - } - } - - return filter; - } - - /** - * Parse a compound ID, consisting of an optional forward global - * filter, a separator, one or more single IDs delimited by - * separators, an an optional reverse global filter. The - * separator is a semicolon. The global filters are UnicodeSet - * patterns. The reverse global filter must be enclosed in - * parentheses. - * @param id the pattern the parse - * @param dir the direction. - * @param canonID OUTPUT parameter that receives the canonical ID, - * consisting of canonical IDs for all elements, as returned by - * parseSingleID(), separated by semicolons. Previous contents - * are discarded. - * @param list OUTPUT parameter that receives a list of SingleID - * objects representing the parsed IDs. Previous contents are - * discarded. - * @param globalFilter OUTPUT parameter that receives a pointer to - * a newly created global filter for this ID in this direction, or - * null if there is none. - * @return true if the parse succeeds, that is, if the entire - * id is consumed without syntax error. - */ - public static boolean parseCompoundID(String id, int dir, - StringBuffer canonID, - Vector list, - UnicodeSet[] globalFilter) { - int[] pos = new int[] { 0 }; - int[] withParens = new int[1]; - list.removeAllElements(); - UnicodeSet filter; - globalFilter[0] = null; - canonID.setLength(0); - - // Parse leading global filter, if any - withParens[0] = 0; // parens disallowed - filter = parseGlobalFilter(id, pos, dir, withParens, canonID); - if (filter != null) { - if (!Utility.parseChar(id, pos, ID_DELIM)) { - // Not a global filter; backup and resume - canonID.setLength(0); - pos[0] = 0; - } - if (dir == FORWARD) { - globalFilter[0] = filter; - } - } - - boolean sawDelimiter = true; - for (;;) { - SingleID single = parseSingleID(id, pos, dir); - if (single == null) { - break; - } - if (dir == FORWARD) { - list.addElement(single); - } else { - list.insertElementAt(single, 0); - } - if (!Utility.parseChar(id, pos, ID_DELIM)) { - sawDelimiter = false; - break; - } - } - - if (list.size() == 0) { - return false; - } - - // Construct canonical ID - for (int i=0; i i) { - --insertIndex; - } - } else { - t = single.getInstance(); - if (t == null) { - throw new IllegalArgumentException("Illegal ID " + single.canonID); - } - list.setElementAt(t, i); - ++i; - } - } - - // An empty list is equivalent to a Null transliterator. - if (list.size() == 0) { - t = Transliterator.getBasicInstance("Any-Null", null); - if (t == null) { - // Should never happen - throw new IllegalArgumentException("Internal error; cannot instantiate Any-Null"); - } - list.addElement(t); - } - - return insertIndex; - } - - /** - * Parse an ID into pieces. Take IDs of the form T, T/V, S-T, - * S-T/V, or S/V-T. If the source is missing, return a source of - * ANY. - * @param id the id string, in any of several forms - * @return an array of 4 strings: source, target, variant, and - * isSourcePresent. If the source is not present, ANY will be - * given as the source, and isSourcePresent will be null. Otherwise - * isSourcePresent will be non-null. The target may be empty if the - * id is not well-formed. The variant may be empty. - */ - public static String[] IDtoSTV(String id) { - String source = ANY; - String target = null; - String variant = ""; - - int sep = id.indexOf(TARGET_SEP); - int var = id.indexOf(VARIANT_SEP); - if (var < 0) { - var = id.length(); - } - boolean isSourcePresent = false; - - if (sep < 0) { - // Form: T/V or T (or /V) - target = id.substring(0, var); - variant = id.substring(var); - } else if (sep < var) { - // Form: S-T/V or S-T (or -T/V or -T) - if (sep > 0) { - source = id.substring(0, sep); - isSourcePresent = true; - } - target = id.substring(++sep, var); - variant = id.substring(var); - } else { - // Form: (S/V-T or /V-T) - if (var > 0) { - source = id.substring(0, var); - isSourcePresent = true; - } - variant = id.substring(var, sep++); - target = id.substring(sep); - } - - if (variant.length() > 0) { - variant = variant.substring(1); - } - - return new String[] { source, target, variant, - isSourcePresent ? "" : null }; - } - - /** - * Register two targets as being inverses of one another. For - * example, calling registerSpecialInverse("NFC", "NFD", true) causes - * Transliterator to form the following inverse relationships: - * - *

NFC => NFD
-     * Any-NFC => Any-NFD
-     * NFD => NFC
-     * Any-NFD => Any-NFC
- * - * (Without the special inverse registration, the inverse of NFC - * would be NFC-Any.) Note that NFD is shorthand for Any-NFD, but - * that the presence or absence of "Any-" is preserved. - * - *

The relationship is symmetrical; registering (a, b) is - * equivalent to registering (b, a). - * - *

The relevant IDs must still be registered separately as - * factories or classes. - * - *

Only the targets are specified. Special inverses always - * have the form Any-Target1 <=> Any-Target2. The target should - * have canonical casing (the casing desired to be produced when - * an inverse is formed) and should contain no whitespace or other - * extraneous characters. - * - * @param target the target against which to register the inverse - * @param inverseTarget the inverse of target, that is - * Any-target.getInverse() => Any-inverseTarget - * @param bidirectional if true, register the reverse relation - * as well, that is, Any-inverseTarget.getInverse() => Any-target - */ - public static void registerSpecialInverse(String target, - String inverseTarget, - boolean bidirectional) { - SPECIAL_INVERSES.put(new CaseInsensitiveString(target), inverseTarget); - if (bidirectional && !target.equalsIgnoreCase(inverseTarget)) { - SPECIAL_INVERSES.put(new CaseInsensitiveString(inverseTarget), target); - } - } - - //---------------------------------------------------------------- - // Private implementation - //---------------------------------------------------------------- - - /** - * Parse an ID into component pieces. Take IDs of the form T, - * T/V, S-T, S-T/V, or S/V-T. If the source is missing, return a - * source of ANY. - * @param id the id string, in any of several forms - * @param pos INPUT-OUTPUT parameter. On input, pos[0] is the - * offset of the first character to parse in id. On output, - * pos[0] is the offset after the last parsed character. If the - * parse failed, pos[0] will be unchanged. - * @param allowFilter if true, a UnicodeSet pattern is allowed - * at any location between specs or delimiters, and is returned - * as the fifth string in the array. - * @return a Specs object, or null if the parse failed. If - * neither source nor target was seen in the parsed id, then the - * parse fails. If allowFilter is true, then the parsed filter - * pattern is returned in the Specs object, otherwise the returned - * filter reference is null. If the parse fails for any reason - * null is returned. - */ - private static Specs parseFilterID(String id, int[] pos, - boolean allowFilter) { - String first = null; - String source = null; - String target = null; - String variant = null; - String filter = null; - char delimiter = 0; - int specCount = 0; - int start = pos[0]; - - // This loop parses one of the following things with each - // pass: a filter, a delimiter character (either '-' or '/'), - // or a spec (source, target, or variant). - for (;;) { - Utility.skipWhitespace(id, pos); - if (pos[0] == id.length()) { - break; - } - - // Parse filters - if (allowFilter && filter == null && - UnicodeSet.resemblesPattern(id, pos[0])) { - - ParsePosition ppos = new ParsePosition(pos[0]); - UnicodeSet set = new UnicodeSet(id, ppos, null); - filter = id.substring(pos[0], ppos.getIndex()); - pos[0] = ppos.getIndex(); - continue; - } - - if (delimiter == 0) { - char c = id.charAt(pos[0]); - if ((c == TARGET_SEP && target == null) || - (c == VARIANT_SEP && variant == null)) { - delimiter = c; - ++pos[0]; - continue; - } - } - - // We are about to try to parse a spec with no delimiter - // when we can no longer do so (we can only do so at the - // start); break. - if (delimiter == 0 && specCount > 0) { - break; - } - - String spec = Utility.parseUnicodeIdentifier(id, pos); - if (spec == null) { - // Note that if there was a trailing delimiter, we - // consume it. So Foo-, Foo/, Foo-Bar/, and Foo/Bar- - // are legal. - break; - } - - switch (delimiter) { - case 0: - first = spec; - break; - case TARGET_SEP: - target = spec; - break; - case VARIANT_SEP: - variant = spec; - break; - } - ++specCount; - delimiter = 0; - } - - // A spec with no prior character is either source or target, - // depending on whether an explicit "-target" was seen. - if (first != null) { - if (target == null) { - target = first; - } else { - source = first; - } - } - - // Must have either source or target - if (source == null && target == null) { - pos[0] = start; - return null; - } - - // Empty source or target defaults to ANY - boolean sawSource = true; - if (source == null) { - source = ANY; - sawSource = false; - } - if (target == null) { - target = ANY; - } - - return new Specs(source, target, variant, sawSource, filter); - } - - /** - * Givens a Spec object, convert it to a SingleID object. The - * Spec object is a more unprocessed parse result. The SingleID - * object contains information about canonical and basic IDs. - * @return a SingleID; never returns null. Returned object always - * has 'filter' field of null. - */ - private static SingleID specsToID(Specs specs, int dir) { - String canonID = ""; - String basicID = ""; - String basicPrefix = ""; - if (specs != null) { - StringBuffer buf = new StringBuffer(); - if (dir == FORWARD) { - if (specs.sawSource) { - buf.append(specs.source).append(TARGET_SEP); - } else { - basicPrefix = specs.source + TARGET_SEP; - } - buf.append(specs.target); - } else { - buf.append(specs.target).append(TARGET_SEP).append(specs.source); - } - if (specs.variant != null) { - buf.append(VARIANT_SEP).append(specs.variant); - } - basicID = basicPrefix + buf.toString(); - if (specs.filter != null) { - buf.insert(0, specs.filter); - } - canonID = buf.toString(); - } - return new SingleID(canonID, basicID); - } - - /** - * Given a Specs object, return a SingleID representing the - * special inverse of that ID. If there is no special inverse - * then return null. - * @return a SingleID or null. Returned object always has - * 'filter' field of null. - */ - private static SingleID specsToSpecialInverse(Specs specs) { - if (!specs.source.equalsIgnoreCase(ANY)) { - return null; - } - String inverseTarget = (String) SPECIAL_INVERSES.get( - new CaseInsensitiveString(specs.target)); - if (inverseTarget != null) { - // If the original ID contained "Any-" then make the - // special inverse "Any-Foo"; otherwise make it "Foo". - // So "Any-NFC" => "Any-NFD" but "NFC" => "NFD". - StringBuffer buf = new StringBuffer(); - if (specs.filter != null) { - buf.append(specs.filter); - } - if (specs.sawSource) { - buf.append(ANY).append(TARGET_SEP); - } - buf.append(inverseTarget); - - String basicID = ANY + TARGET_SEP + inverseTarget; - - if (specs.variant != null) { - buf.append(VARIANT_SEP).append(specs.variant); - basicID = basicID + VARIANT_SEP + specs.variant; - } - return new SingleID(buf.toString(), basicID); - } - return null; - } -} - -//eof diff --git a/icu4j/src/com/ibm/text/TransliteratorParser.java b/icu4j/src/com/ibm/text/TransliteratorParser.java deleted file mode 100755 index d29f2fb0f6..0000000000 --- a/icu4j/src/com/ibm/text/TransliteratorParser.java +++ /dev/null @@ -1,1486 +0,0 @@ -/* -********************************************************************** -* Copyright (c) 2001, International Business Machines -* Corporation and others. All Rights Reserved. -********************************************************************** -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/TransliteratorParser.java,v $ -* $Date: 2002/02/07 00:53:54 $ -* $Revision: 1.17 $ -********************************************************************** -*/ -package com.ibm.text; - -import com.ibm.text.resources.ResourceReader; -import com.ibm.util.Utility; -import java.util.Stack; -import java.util.Vector; -import java.text.ParsePosition; - -class TransliteratorParser { - - //---------------------------------------------------------------------- - // Data members - //---------------------------------------------------------------------- - - /** - * PUBLIC data member containing the parsed data object, or null if - * there were no rules. - */ - public RuleBasedTransliterator.Data data; - - /** - * PUBLIC data member. - * The block of ::IDs, both at the top and at the bottom. - * Inserted into these may be additional rules at the - * idSplitPoint. - */ - public String idBlock; - - /** - * PUBLIC data member. - * In a compound RBT, the index at which the RBT rules are - * inserted into the ID block. Index 0 means before any IDs - * in the block. Index idBlock.length() means after all IDs - * in the block. Index is a string index. - */ - public int idSplitPoint; - - /** - * PUBLIC data member containing the parsed compound filter, if any. - */ - public UnicodeSet compoundFilter; - - - // The number of rules parsed. This tells us if there were - // any actual transliterator rules, or if there were just ::ID - // block IDs. - private int ruleCount; - - private int direction; - - /** - * Temporary symbol table used during parsing. - */ - private ParseData parseData; - - /** - * Temporary vector of set variables. When parsing is complete, this - * is copied into the array data.variables. As with data.variables, - * element 0 corresponds to character data.variablesBase. - */ - private Vector variablesVector; - - /** - * String of standins for segments. Used during the parsing of a single - * rule. segmentStandins.charAt(0) is the standin for "$1" and corresponds - * to StringMatcher object segmentObjects.elementAt(0), etc. - */ - private StringBuffer segmentStandins; - - /** - * Vector of StringMatcher objects for segments. Used during the - * parsing of a single rule. - * segmentStandins.charAt(0) is the standin for "$1" and corresponds - * to StringMatcher object segmentObjects.elementAt(0), etc. - */ - private Vector segmentObjects; - - /** - * The next available stand-in for variables. This starts at some point in - * the private use area (discovered dynamically) and increments up toward - * variableLimit. At any point during parsing, available - * variables are variableNext..variableLimit-1. - */ - private char variableNext; - - /** - * The last available stand-in for variables. This is discovered - * dynamically. At any point during parsing, available variables are - * variableNext..variableLimit-1. During variable definition - * we use the special value variableLimit-1 as a placeholder. - */ - private char variableLimit; - - /** - * When we encounter an undefined variable, we do not immediately signal - * an error, in case we are defining this variable, e.g., "$a = [a-z];". - * Instead, we save the name of the undefined variable, and substitute - * in the placeholder char variableLimit - 1, and decrement - * variableLimit. - */ - private String undefinedVariableName; - - /** - * The stand-in character for the 'dot' set, represented by '.' in - * patterns. This is allocated the first time it is needed, and - * reused thereafter. - */ - private int dotStandIn = -1; - - //---------------------------------------------------------------------- - // Constants - //---------------------------------------------------------------------- - - // Indicator for ID blocks - private static final String ID_TOKEN = "::"; - private static final int ID_TOKEN_LEN = 2; - - // Operators - private static final char VARIABLE_DEF_OP = '='; - private static final char FORWARD_RULE_OP = '>'; - private static final char REVERSE_RULE_OP = '<'; - private static final char FWDREV_RULE_OP = '~'; // internal rep of <> op - - private static final String OPERATORS = "=><"; - private static final String HALF_ENDERS = "=><;"; - - // Other special characters - private static final char QUOTE = '\''; - private static final char ESCAPE = '\\'; - private static final char END_OF_RULE = ';'; - private static final char RULE_COMMENT_CHAR = '#'; - - private static final char CONTEXT_ANTE = '{'; // ante{key - private static final char CONTEXT_POST = '}'; // key}post - private static final char CURSOR_POS = '|'; - private static final char CURSOR_OFFSET = '@'; - private static final char ANCHOR_START = '^'; - - private static final char KLEENE_STAR = '*'; - private static final char ONE_OR_MORE = '+'; - private static final char ZERO_OR_ONE = '?'; - - private static final char DOT = '.'; - private static final String DOT_SET = "[^[:Zp:][:Zl:]\r\n$]"; - - // By definition, the ANCHOR_END special character is a - // trailing SymbolTable.SYMBOL_REF character. - // private static final char ANCHOR_END = '$'; - - // Segments of the input string are delimited by "(" and ")". In the - // output string these segments are referenced as "$1", "$2", etc. - private static final char SEGMENT_OPEN = '('; - private static final char SEGMENT_CLOSE = ')'; - - // A function is denoted &Source-Target/Variant(text) - private static final char FUNCTION = '&'; - - // Special characters disallowed at the top level - private static UnicodeSet ILLEGAL_TOP = new UnicodeSet("[\\)]"); - - // Special characters disallowed within a segment - private static UnicodeSet ILLEGAL_SEG = new UnicodeSet("[\\{\\}\\|\\@]"); - - // Special characters disallowed within a function argument - private static UnicodeSet ILLEGAL_FUNC = new UnicodeSet("[\\^\\(\\.\\*\\+\\?\\{\\}\\|\\@]"); - - //---------------------------------------------------------------------- - // class ParseData - //---------------------------------------------------------------------- - - /** - * This class implements the SymbolTable interface. It is used - * during parsing to give UnicodeSet access to variables that - * have been defined so far. Note that it uses variablesVector, - * _not_ data.variables. - */ - private class ParseData implements SymbolTable { - - /** - * Implement SymbolTable API. - */ - public char[] lookup(String name) { - return (char[]) data.variableNames.get(name); - } - - /** - * Implement SymbolTable API. - */ - public UnicodeMatcher lookupMatcher(int ch) { - // Note that we cannot use data.lookup() because the - // set array has not been constructed yet. - int i = ch - data.variablesBase; - if (i >= 0 && i < variablesVector.size()) { - return (UnicodeMatcher) variablesVector.elementAt(i); - } - return null; - } - - /** - * Implement SymbolTable API. Parse out a symbol reference - * name. - */ - public String parseReference(String text, ParsePosition pos, int limit) { - int start = pos.getIndex(); - int i = start; - while (i < limit) { - char c = text.charAt(i); - if ((i==start && !Character.isUnicodeIdentifierStart(c)) || - !Character.isUnicodeIdentifierPart(c)) { - break; - } - ++i; - } - if (i == start) { // No valid name chars - return null; - } - pos.setIndex(i); - return text.substring(start, i); - } - - /** - * Return true if the given character is a matcher standin or a plain - * character (non standin). - */ - public boolean isMatcher(int ch) { - // Note that we cannot use data.lookup() because the - // set array has not been constructed yet. - int i = ch - data.variablesBase; - if (i >= 0 && i < variablesVector.size()) { - return variablesVector.elementAt(i) instanceof UnicodeMatcher; - } - return true; - } - - /** - * Return true if the given character is a replacer standin or a plain - * character (non standin). - */ - public boolean isReplacer(int ch) { - // Note that we cannot use data.lookup() because the - // set array has not been constructed yet. - int i = ch - data.variablesBase; - if (i >= 0 && i < variablesVector.size()) { - return variablesVector.elementAt(i) instanceof UnicodeReplacer; - } - return true; - } - } - - //---------------------------------------------------------------------- - // classes RuleBody, RuleArray, and RuleReader - //---------------------------------------------------------------------- - - /** - * A private abstract class representing the interface to rule - * source code that is broken up into lines. Handles the - * folding of lines terminated by a backslash. This folding - * is limited; it does not account for comments, quotes, or - * escapes, so its use to be limited. - */ - private static abstract class RuleBody { - - /** - * Retrieve the next line of the source, or return null if - * none. Folds lines terminated by a backslash into the - * next line, without regard for comments, quotes, or - * escapes. - */ - String nextLine() { - String s = handleNextLine(); - if (s != null && - s.length() > 0 && - s.charAt(s.length() - 1) == '\\') { - - StringBuffer b = new StringBuffer(s); - do { - b.deleteCharAt(b.length()-1); - s = handleNextLine(); - if (s == null) { - break; - } - b.append(s); - } while (s.length() > 0 && - s.charAt(s.length() - 1) == '\\'); - - s = b.toString(); - } - return s; - } - - /** - * Reset to the first line of the source. - */ - abstract void reset(); - - /** - * Subclass method to return the next line of the source. - */ - abstract String handleNextLine(); - }; - - /** - * RuleBody subclass for a String[] array. - */ - private static class RuleArray extends RuleBody { - String[] array; - int i; - public RuleArray(String[] array) { this.array = array; i = 0; } - public String handleNextLine() { - return (i < array.length) ? array[i++] : null; - } - public void reset() { - i = 0; - } - }; - - /** - * RuleBody subclass for a ResourceReader. - */ - private static class RuleReader extends RuleBody { - ResourceReader reader; - public RuleReader(ResourceReader reader) { this.reader = reader; } - public String handleNextLine() { - try { - return reader.readLine(); - } catch (java.io.IOException e) {} - return null; - } - public void reset() { - reader.reset(); - } - }; - - //---------------------------------------------------------------------- - // class RuleHalf - //---------------------------------------------------------------------- - - /** - * A class representing one side of a rule. This class knows how to - * parse half of a rule. It is tightly coupled to the method - * TransliteratorParser.parseRule(). - */ - private static class RuleHalf { - - public String text; - - public int cursor = -1; // position of cursor in text - public int ante = -1; // position of ante context marker '{' in text - public int post = -1; // position of post context marker '}' in text - - // Record the offset to the cursor either to the left or to the - // right of the key. This is indicated by characters on the output - // side that allow the cursor to be positioned arbitrarily within - // the matching text. For example, abc{def} > | @@@ xyz; changes - // def to xyz and moves the cursor to before abc. Offset characters - // must be at the start or end, and they cannot move the cursor past - // the ante- or postcontext text. Placeholders are only valid in - // output text. The length of the ante and post context is - // determined at runtime, because of supplementals and quantifiers. - public int cursorOffset = 0; // only nonzero on output side - - // Position of first CURSOR_OFFSET on _right_. This will be -1 - // for |@, -2 for |@@, etc., and 1 for @|, 2 for @@|, etc. - private int cursorOffsetPos = 0; - - public boolean anchorStart = false; - public boolean anchorEnd = false; - - /** - * The segment number from 1..n of the next '(' we see - * during parsing; 1-based. - */ - private int nextSegmentNumber = 1; - - /** - * Parse one side of a rule, stopping at either the limit, - * the END_OF_RULE character, or an operator. - * @return the index after the terminating character, or - * if limit was reached, limit - */ - public int parse(String rule, int pos, int limit, - TransliteratorParser parser) { - int start = pos; - StringBuffer buf = new StringBuffer(); - pos = parseSection(rule, pos, limit, parser, buf, ILLEGAL_TOP, false); - text = buf.toString(); - - if (cursorOffset > 0 && cursor != cursorOffsetPos) { - syntaxError("Misplaced " + CURSOR_POS, rule, start); - } - - return pos; - } - - /** - * Parse a section of one side of a rule, stopping at either - * the limit, the END_OF_RULE character, an operator, or a - * segment close character. This method parses both a - * top-level rule half and a segment within such a rule half. - * It calls itself recursively to parse segments and nested - * segments. - * @param buf buffer into which to accumulate the rule pattern - * characters, either literal characters from the rule or - * standins for UnicodeMatcher objects including segments. - * @param illegal the set of special characters that is illegal during - * this parse. - * @param isSegment if true, then we've already seen a '(' and - * pos on entry points right after it. Accumulate everything - * up to the closing ')', put it in a segment matcher object, - * generate a standin for it, and add the standin to buf. As - * a side effect, update the segments vector with a reference - * to the segment matcher. This works recursively for nested - * segments. If isSegment is false, just accumulate - * characters into buf. - * @return the index after the terminating character, or - * if limit was reached, limit - */ - private int parseSection(String rule, int pos, int limit, - TransliteratorParser parser, - StringBuffer buf, - UnicodeSet illegal, - boolean isSegment) { - int start = pos; - ParsePosition pp = null; - int quoteStart = -1; // Most recent 'single quoted string' - int quoteLimit = -1; - int varStart = -1; // Most recent $variableReference - int varLimit = -1; - int[] iref = new int[1]; - int bufStart = buf.length(); - - main: - while (pos < limit) { - // Since all syntax characters are in the BMP, fetching - // 16-bit code units suffices here. - char c = rule.charAt(pos++); - if (Character.isWhitespace(c)) { - // Ignore whitespace. Note that this is not Unicode - // spaces, but Java spaces -- a subset, representing - // whitespace likely to be seen in code. - continue; - } - // HALF_ENDERS is all chars that end a rule half: "<>=;" - if (HALF_ENDERS.indexOf(c) >= 0) { - if (isSegment) { - syntaxError("Unclosed segment", rule, start); - } - break main; - } - if (anchorEnd) { - // Text after a presumed end anchor is a syntax err - syntaxError("Malformed variable reference", rule, start); - } - if (UnicodeSet.resemblesPattern(rule, pos-1)) { - if (pp == null) { - pp = new ParsePosition(0); - } - pp.setIndex(pos-1); // Backup to opening '[' - buf.append(parser.parseSet(rule, pp)); - pos = pp.getIndex(); - continue; - } - // Handle escapes - if (c == ESCAPE) { - if (pos == limit) { - syntaxError("Trailing backslash", rule, start); - } - iref[0] = pos; - int escaped = Utility.unescapeAt(rule, iref); - pos = iref[0]; - if (escaped == -1) { - syntaxError("Malformed escape", rule, start); - } - parser.checkVariableRange(escaped, rule, start); - UTF16.append(buf, escaped); - continue; - } - // Handle quoted matter - if (c == QUOTE) { - int iq = rule.indexOf(QUOTE, pos); - if (iq == pos) { - buf.append(c); // Parse [''] outside quotes as ['] - ++pos; - } else { - /* This loop picks up a run of quoted text of the - * form 'aaaa' each time through. If this run - * hasn't really ended ('aaaa''bbbb') then it keeps - * looping, each time adding on a new run. When it - * reaches the final quote it breaks. - */ - quoteStart = buf.length(); - for (;;) { - if (iq < 0) { - syntaxError("Unterminated quote", rule, start); - } - buf.append(rule.substring(pos, iq)); - pos = iq+1; - if (pos < limit && rule.charAt(pos) == QUOTE) { - // Parse [''] inside quotes as ['] - iq = rule.indexOf(QUOTE, pos+1); - // Continue looping - } else { - break; - } - } - quoteLimit = buf.length(); - - for (iq=quoteStart; iq= 1 && r <= 9) { - iref[0] = pos; - r = Utility.parseNumber(rule, iref, 10); - if (r < 0) { - syntaxError("Undefined segment reference", - rule, start); - } - pos = iref[0]; - buf.append(parser.getSegmentStandin(r)); - } else { - if (pp == null) { // Lazy create - pp = new ParsePosition(0); - } - pp.setIndex(pos); - String name = parser.parseData. - parseReference(rule, pp, limit); - if (name == null) { - // This means the '$' was not followed by a - // valid name. Try to interpret it as an - // end anchor then. If this also doesn't work - // (if we see a following character) then signal - // an error. - anchorEnd = true; - break; - } - pos = pp.getIndex(); - // If this is a variable definition statement, - // then the LHS variable will be undefined. In - // that case appendVariableDef() will append the - // special placeholder char variableLimit-1. - varStart = buf.length(); - parser.appendVariableDef(name, buf); - varLimit = buf.length(); - } - } - break; - case DOT: - buf.append(parser.getDotStandIn()); - break; - case KLEENE_STAR: - case ONE_OR_MORE: - case ZERO_OR_ONE: - // Quantifiers. We handle single characters, quoted strings, - // variable references, and segments. - // a+ matches aaa - // 'foo'+ matches foofoofoo - // $v+ matches xyxyxy if $v == xy - // (seg)+ matches segsegseg - { - if (isSegment && buf.length() == bufStart) { - // The */+ immediately follows '(' - syntaxError("Misplaced quantifier", rule, start); - break; - } - - int qstart, qlimit; - // The */+ follows an isolated character or quote - // or variable reference - if (buf.length() == quoteLimit) { - // The */+ follows a 'quoted string' - qstart = quoteStart; - qlimit = quoteLimit; - } else if (buf.length() == varLimit) { - // The */+ follows a $variableReference - qstart = varStart; - qlimit = varLimit; - } else { - // The */+ follows a single character, possibly - // a segment standin - qstart = buf.length() - 1; - qlimit = qstart + 1; - } - - UnicodeMatcher m = - new StringMatcher(buf.toString(), qstart, qlimit, - 0, parser.data); - int min = 0; - int max = Quantifier.MAX; - switch (c) { - case ONE_OR_MORE: - min = 1; - break; - case ZERO_OR_ONE: - min = 0; - max = 1; - break; - // case KLEENE_STAR: - // do nothing -- min, max already set - } - m = new Quantifier(m, min, max); - buf.setLength(qstart); - buf.append(parser.generateStandInFor(m)); - } - break; - - //------------------------------------------------------ - // Elements allowed ONLY WITHIN segments - //------------------------------------------------------ - case SEGMENT_CLOSE: - // assert(isSegment); - // We're done parsing a segment. - break main; - - //------------------------------------------------------ - // Elements allowed ONLY OUTSIDE segments - //------------------------------------------------------ - case CONTEXT_ANTE: - if (ante >= 0) { - syntaxError("Multiple ante contexts", rule, start); - } - ante = buf.length(); - break; - case CONTEXT_POST: - if (post >= 0) { - syntaxError("Multiple post contexts", rule, start); - } - post = buf.length(); - break; - case CURSOR_POS: - if (cursor >= 0) { - syntaxError("Multiple cursors", rule, start); - } - cursor = buf.length(); - break; - case CURSOR_OFFSET: - if (cursorOffset < 0) { - if (buf.length() > 0) { - syntaxError("Misplaced " + c, rule, start); - } - --cursorOffset; - } else if (cursorOffset > 0) { - if (buf.length() != cursorOffsetPos || cursor >= 0) { - syntaxError("Misplaced " + c, rule, start); - } - ++cursorOffset; - } else { - if (cursor == 0 && buf.length() == 0) { - cursorOffset = -1; - } else if (cursor < 0) { - cursorOffsetPos = buf.length(); - cursorOffset = 1; - } else { - syntaxError("Misplaced " + c, rule, start); - } - } - break; - - //------------------------------------------------------ - // Non-special characters - //------------------------------------------------------ - default: - // Disallow unquoted characters other than [0-9A-Za-z] - // in the printable ASCII range. These characters are - // reserved for possible future use. - if (c >= 0x0021 && c <= 0x007E && - !((c >= '0' && c <= '9') || - (c >= 'A' && c <= 'Z') || - (c >= 'a' && c <= 'z'))) { - syntaxError("Unquoted " + c, rule, start); - } - buf.append(c); - break; - } - } - return pos; - } - - /** - * Remove context. - */ - void removeContext() { - text = text.substring(ante < 0 ? 0 : ante, - post < 0 ? text.length() : post); - ante = post = -1; - anchorStart = anchorEnd = false; - } - - /** - * Return true if this half looks like valid output, that is, does not - * contain quantifiers or other special input-only elements. - */ - public boolean isValidOutput(TransliteratorParser parser) { - for (int i=0; i1, ::id->0 - // mode == 1: in rules: rule->1, ::id->2 - // mode == 2: in footer rule block: rule->ERROR, ::id->2 - int mode = 0; - - // The compound filter offset is an index into idBlockResult. - // If it is 0, then the compound filter occurred at the start, - // and it is the offset to the _start_ of the compound filter - // pattern. Otherwise it is the offset to the _limit_ of the - // compound filter pattern within idBlockResult. - this.compoundFilter = null; - int compoundFilterOffset = -1; - - // The number of ::ID block entries we have parsed - int idBlockCount = 0; - - main: - for (;;) { - String rule = ruleArray.nextLine(); - if (rule == null) { - break; - } - int pos = 0; - int limit = rule.length(); - while (pos < limit) { - char c = rule.charAt(pos++); - if (Character.isWhitespace(c)) { - // Ignore leading whitespace. Note that this is not - // Unicode spaces, but Java spaces -- a subset, - // representing whitespace likely to be seen in code. - continue; - } - // Skip lines starting with the comment character - if (c == RULE_COMMENT_CHAR) { - pos = rule.indexOf("\n", pos) + 1; - if (pos == 0) { - break; // No "\n" found; rest of rule is a commnet - } - continue; // Either fall out or restart with next line - } - // Often a rule file contains multiple errors. It's - // convenient to the rule author if these are all reported - // at once. We keep parsing rules even after a failure, up - // to a specified limit, and report all errors at once. - try { - // We've found the start of a rule or ID. c is its first - // character, and pos points past c. - --pos; - // Look for an ID token. Must have at least ID_TOKEN_LEN + 1 - // chars left. - if ((pos + ID_TOKEN_LEN + 1) <= limit && - rule.regionMatches(pos, ID_TOKEN, 0, ID_TOKEN_LEN)) { - pos += ID_TOKEN_LEN; - c = rule.charAt(pos); - while (UCharacter.isWhitespace(c) && pos < limit) { - ++pos; - c = rule.charAt(pos); - } - if (mode == 1) { - // We have just entered the footer ::ID block - mode = 2; - // In the forward direction add elements at the end. - // In the reverse direction add elements at the start. - idSplitPoint = idBlockCount; - } - int[] p = new int[] { pos }; - - TransliteratorIDParser.SingleID id = - TransliteratorIDParser.parseSingleID( - rule, p, direction); - if (p[0] != pos && Utility.parseChar(rule, p, END_OF_RULE)) { - // Successful ::ID parse. - - if (direction == Transliterator.FORWARD) { - idBlockResult.append(id.canonID).append(END_OF_RULE); - } else { - idBlockResult.insert(0, id.canonID + END_OF_RULE); - } - - ++idBlockCount; - - } else { - // Couldn't parse an ID. Try to parse a global filter - int[] withParens = new int[] { -1 }; - UnicodeSet f = TransliteratorIDParser.parseGlobalFilter(rule, p, direction, withParens, idBlockResult); - if (f != null && Utility.parseChar(rule, p, END_OF_RULE)) { - if ((direction == Transliterator.FORWARD) == - (withParens[0] == 0)) { - if (compoundFilter != null) { - // Multiple compound filters - syntaxError("Multiple global filters", rule, pos); - } - compoundFilter = f; - compoundFilterOffset = idBlockCount; - } - } else { - // Invalid ::id - // Can be parsed as neither an ID nor a global filter - syntaxError("Invalid ::ID", rule, pos); - } - } - - pos = p[0]; - } else if (resemblesPragma(rule, pos, limit)) { - int ppp = parsePragma(rule, pos, limit); - if (ppp < 0) { - syntaxError("Unrecognized pragma", rule, pos); - } - pos = ppp; - } else { - // Parse a rule - pos = parseRule(rule, pos, limit); - ++ruleCount; - if (mode == 2) { - // ::id in illegal position (because a rule - // occurred after the ::id footer block) - syntaxError("::ID in illegal position", rule, pos); - } - mode = 1; - } - } catch (IllegalArgumentException e) { - if (errorCount == 30) { - errors.append("\nMore than 30 errors; further messages squelched"); - break main; - } - if (errors == null) { - errors = new StringBuffer(e.getMessage()); - } else { - errors.append("\n" + e.getMessage()); - } - ++errorCount; - pos = ruleEnd(rule, pos, limit) + 1; // +1 advances past ';' - } - } - } - - idBlock = idBlockResult.toString(); - - if (idSplitPoint < 0) { - idSplitPoint = idBlockCount; - } - - if (direction == Transliterator.REVERSE) { - idSplitPoint = idBlockCount - idSplitPoint; - } - - // Convert the set vector to an array - data.variables = new Object[variablesVector.size()]; - variablesVector.copyInto(data.variables); - variablesVector = null; - - // Do more syntax checking and index the rules - try { - if (compoundFilter != null) { - if ((direction == Transliterator.FORWARD && - compoundFilterOffset != 0) || - (direction == Transliterator.REVERSE && - compoundFilterOffset != idBlockCount)) { - throw new IllegalArgumentException("Compound filters misplaced"); - } - } - - data.ruleSet.freeze(); - - if (ruleCount == 0) { - data = null; - } - } catch (IllegalArgumentException e) { - if (errors == null) { - errors = new StringBuffer(e.getMessage()); - } else { - errors.append("\n").append(e.getMessage()); - } - } - - if (errors != null) { - throw new IllegalArgumentException(errors.toString()); - } - } - - /** - * MAIN PARSER. Parse the next rule in the given rule string, starting - * at pos. Return the index after the last character parsed. Do not - * parse characters at or after limit. - * - * Important: The character at pos must be a non-whitespace character - * that is not the comment character. - * - * This method handles quoting, escaping, and whitespace removal. It - * parses the end-of-rule character. It recognizes context and cursor - * indicators. Once it does a lexical breakdown of the rule at pos, it - * creates a rule object and adds it to our rule list. - * - * This method is tightly coupled to the inner class RuleHalf. - */ - private int parseRule(String rule, int pos, int limit) { - // Locate the left side, operator, and right side - int start = pos; - char operator = 0; - - // Set up segments data - segmentStandins = new StringBuffer(); - segmentObjects = new Vector(); - - RuleHalf left = new RuleHalf(); - RuleHalf right = new RuleHalf(); - - undefinedVariableName = null; - pos = left.parse(rule, pos, limit, this); - - if (pos == limit || - OPERATORS.indexOf(operator = rule.charAt(--pos)) < 0) { - syntaxError("No operator pos=" + pos, rule, start); - } - ++pos; - - // Found an operator char. Check for forward-reverse operator. - if (operator == REVERSE_RULE_OP && - (pos < limit && rule.charAt(pos) == FORWARD_RULE_OP)) { - ++pos; - operator = FWDREV_RULE_OP; - } - - pos = right.parse(rule, pos, limit, this); - - if (pos < limit) { - if (rule.charAt(--pos) == END_OF_RULE) { - ++pos; - } else { - // RuleHalf parser must have terminated at an operator - syntaxError("Unquoted operator", rule, start); - } - } - - if (operator == VARIABLE_DEF_OP) { - // LHS is the name. RHS is a single character, either a literal - // or a set (already parsed). If RHS is longer than one - // character, it is either a multi-character string, or multiple - // sets, or a mixture of chars and sets -- syntax error. - - // We expect to see a single undefined variable (the one being - // defined). - if (undefinedVariableName == null) { - syntaxError("Missing '$' or duplicate definition", rule, start); - } - if (left.text.length() != 1 || left.text.charAt(0) != variableLimit) { - syntaxError("Malformed LHS", rule, start); - } - if (left.anchorStart || left.anchorEnd || - right.anchorStart || right.anchorEnd) { - syntaxError("Malformed variable def", rule, start); - } - // We allow anything on the right, including an empty string. - int n = right.text.length(); - char[] value = new char[n]; - right.text.getChars(0, n, value, 0); - data.variableNames.put(undefinedVariableName, value); - - ++variableLimit; - return pos; - } - - // If this is not a variable definition rule, we shouldn't have - // any undefined variable names. - if (undefinedVariableName != null) { - syntaxError("Undefined variable $" + undefinedVariableName, - rule, start); - } - - // Verify segments - if (segmentStandins.length() > segmentObjects.size()) { - syntaxError("Undefined segment reference", rule, start); - } - for (int i=0; i= 0 || right.post >= 0 || left.cursor >= 0 || - (right.cursorOffset != 0 && right.cursor < 0) || - // - The following two checks were used to ensure that the - // - the cursor offset stayed within the ante- or postcontext. - // - However, with the addition of quantifiers, we have to - // - allow arbitrary cursor offsets and do runtime checking. - //(right.cursorOffset > (left.text.length() - left.post)) || - //(-right.cursorOffset > left.ante) || - right.anchorStart || right.anchorEnd || - !left.isValidInput(this) || !right.isValidOutput(this) || - left.ante > left.post) { - syntaxError("Malformed rule", rule, start); - } - - // Flatten segment objects vector to an array - UnicodeMatcher[] segmentsArray = null; - if (segmentObjects.size() > 0) { - segmentsArray = new UnicodeMatcher[segmentObjects.size()]; - segmentObjects.toArray(segmentsArray); - } - - data.ruleSet.addRule(new TransliterationRule( - left.text, left.ante, left.post, - right.text, right.cursor, right.cursorOffset, - segmentsArray, - left.anchorStart, left.anchorEnd, - data)); - - return pos; - } - - /** - * Set the variable range to [start, end] (inclusive). - */ - private void setVariableRange(int start, int end) { - if (start > end || start < 0 || end > 0xFFFF) { - throw new IllegalArgumentException("Invalid variable range " + start + ", " + end); - } - - data.variablesBase = variableNext = (char) start; // first private use - variableLimit = (char) (end + 1); - } - - /** - * Assert that the given character is NOT within the variable range. - * If it is, signal an error. This is neccesary to ensure that the - * variable range does not overlap characters used in a rule. - */ - private void checkVariableRange(int ch, String rule, int start) { - if (ch >= data.variablesBase && ch < variableLimit) { - syntaxError("Variable range character in rule", rule, start); - } - } - - /** - * Set the maximum backup to 'backup', in response to a pragma - * statement. - */ - private void pragmaMaximumBackup(int backup) { - //TODO Finish - throw new IllegalArgumentException("use maximum backup pragma not implemented yet"); - } - - /** - * Begin normalizing all rules using the given mode, in response - * to a pragma statement. - */ - private void pragmaNormalizeRules(Normalizer.Mode mode) { - //TODO Finish - throw new IllegalArgumentException("use normalize rules pragma not implemented yet"); - } - - /** - * Return true if the given rule looks like a pragma. - * @param pos offset to the first non-whitespace character - * of the rule. - * @param limit pointer past the last character of the rule. - */ - static boolean resemblesPragma(String rule, int pos, int limit) { - // Must start with /use\s/i - return Utility.parsePattern(rule, pos, limit, "use ", null) >= 0; - } - - /** - * Parse a pragma. This method assumes resemblesPragma() has - * already returned true. - * @param pos offset to the first non-whitespace character - * of the rule. - * @param limit pointer past the last character of the rule. - * @return the position index after the final ';' of the pragma, - * or -1 on failure. - */ - private int parsePragma(String rule, int pos, int limit) { - int[] array = new int[2]; - - // resemblesPragma() has already returned true, so we - // know that pos points to /use\s/i; we can skip 4 characters - // immediately - pos += 4; - - // Here are the pragmas we recognize: - // use variable range 0xE000 0xEFFF; - // use maximum backup 16; - // use nfd rules; - int p = Utility.parsePattern(rule, pos, limit, "~variable range # #~;", array); - if (p >= 0) { - setVariableRange(array[0], array[1]); - return p; - } - - p = Utility.parsePattern(rule, pos, limit, "~maximum backup #~;", array); - if (p >= 0) { - pragmaMaximumBackup(array[0]); - return p; - } - - p = Utility.parsePattern(rule, pos, limit, "~nfd rules~;", null); - if (p >= 0) { - pragmaNormalizeRules(Normalizer.DECOMP); - return p; - } - - p = Utility.parsePattern(rule, pos, limit, "~nfc rules~;", null); - if (p >= 0) { - pragmaNormalizeRules(Normalizer.COMPOSE); - return p; - } - - // Syntax error: unable to parse pragma - return -1; - } - - /** - * Throw an exception indicating a syntax error. Search the rule string - * for the probable end of the rule. Of course, if the error is that - * the end of rule marker is missing, then the rule end will not be found. - * In any case the rule start will be correctly reported. - * @param msg error description - * @param rule pattern string - * @param start position of first character of current rule - */ - static final void syntaxError(String msg, String rule, int start) { - int end = ruleEnd(rule, start, rule.length()); - throw new IllegalArgumentException(msg + " in \"" + - Utility.escape(rule.substring(start, end)) + '"'); - } - - static final int ruleEnd(String rule, int start, int limit) { - int end = Utility.quotedIndexOf(rule, start, limit, ";"); - if (end < 0) { - end = limit; - } - return end; - } - - /** - * Parse a UnicodeSet out, store it, and return the stand-in character - * used to represent it. - */ - private final char parseSet(String rule, ParsePosition pos) { - UnicodeSet set = new UnicodeSet(rule, pos, parseData); - if (variableNext >= variableLimit) { - throw new RuntimeException("Private use variables exhausted"); - } - set.compact(); - return generateStandInFor(set); - } - - /** - * Generate and return a stand-in for a new UnicodeMatcher or UnicodeReplacer. - * Store the object. - */ - char generateStandInFor(Object obj) { - // assert(obj != null); - - // Look up previous stand-in, if any. This is a short list - // (typical n is 0, 1, or 2); linear search is optimal. - for (int i=0; i= variableLimit) { - throw new RuntimeException("Variable range exhausted"); - } - variablesVector.addElement(obj); - return variableNext++; - } - - /** - * Return the standin for segment seg (1-based). - */ - public char getSegmentStandin(int seg) { - if (segmentStandins.length() < seg) { - segmentStandins.setLength(seg); - } - char c = segmentStandins.charAt(seg-1); - if (c == 0) { - if (variableNext >= variableLimit) { - throw new RuntimeException("Variable range exhausted"); - } - c = variableNext++; - // Set a placeholder in the master variables vector that will be - // filled in later by setSegmentObject(). We know that we will get - // called first because setSegmentObject() will call us. - variablesVector.addElement(null); - segmentStandins.setCharAt(seg-1, c); - } - return c; - } - - /** - * Set the object for segment seg (1-based). - */ - public void setSegmentObject(int seg, StringMatcher obj) { - // Since we call parseSection() recursively, nested - // segments will result in segment i+1 getting parsed - // and stored before segment i; be careful with the - // vector handling here. - if (segmentObjects.size() < seg) { - segmentObjects.setSize(seg); - } - int index = getSegmentStandin(seg) - data.variablesBase; - if (segmentObjects.elementAt(seg-1) != null || - variablesVector.elementAt(index) != null) { - throw new RuntimeException(); // should never happen - } - segmentObjects.setElementAt(obj, seg-1); - variablesVector.setElementAt(obj, index); - } - - /** - * Return the stand-in for the dot set. It is allocated the first - * time and reused thereafter. - */ - char getDotStandIn() { - if (dotStandIn == -1) { - dotStandIn = generateStandInFor(new UnicodeSet(DOT_SET)); - } - return (char) dotStandIn; - } - - /** - * Append the value of the given variable name to the given - * StringBuffer. - * @exception IllegalArgumentException if the name is unknown. - */ - private void appendVariableDef(String name, StringBuffer buf) { - char[] ch = (char[]) data.variableNames.get(name); - if (ch == null) { - // We allow one undefined variable so that variable definition - // statements work. For the first undefined variable we return - // the special placeholder variableLimit-1, and save the variable - // name. - if (undefinedVariableName == null) { - undefinedVariableName = name; - if (variableNext >= variableLimit) { - throw new RuntimeException("Private use variables exhausted"); - } - buf.append((char) --variableLimit); - } else { - throw new IllegalArgumentException("Undefined variable $" - + name); - } - } else { - buf.append(ch); - } - } -} - -//eof diff --git a/icu4j/src/com/ibm/text/TransliteratorRegistry.java b/icu4j/src/com/ibm/text/TransliteratorRegistry.java deleted file mode 100755 index edde74cd99..0000000000 --- a/icu4j/src/com/ibm/text/TransliteratorRegistry.java +++ /dev/null @@ -1,918 +0,0 @@ -/* -********************************************************************** -* Copyright (c) 2001, International Business Machines -* Corporation and others. All Rights Reserved. -********************************************************************** -* Date Name Description -* 08/19/2001 aliu Creation. -********************************************************************** -*/ - -package com.ibm.text; -import java.util.*; -import java.io.UnsupportedEncodingException; -import com.ibm.text.resources.ResourceReader; -import com.ibm.util.CaseInsensitiveString; - -class TransliteratorRegistry { - - // char constants - private static final char LOCALE_SEP = '_'; - private static final char ID_SEP = '-'; - private static final char VARIANT_SEP = '/'; - - // String constants - private static final String NO_VARIANT = ""; // empty string - private static final String ANY = "Any"; - - /** - * Resource bundle key for the RuleBasedTransliterator rule. - */ - private static final String RB_RULE = "Rule"; - - /** - * Resource bundle containing locale-specific transliterator data. - */ - private static final String RB_LOCALE_ELEMENTS = - "com.ibm.text.resources.LocaleElements"; - - /** - * Locale indicating the root. - */ - private static final Locale ROOT_LOCALE = new Locale("", "", ""); - - /** - * Dynamic registry mapping full IDs to Entry objects. This - * contains both public and internal entities. The visibility is - * controlled by whether an entry is listed in availableIDs and - * specDAG or not. - * - * Keys are CaseInsensitiveString objects. - * Values are objects of class Class (subclass of Transliterator), - * RuleBasedTransliterator.Data, Transliterator.Factory, or one - * of the entry classes defined here (AliasEntry or ResourceEntry). - */ - private Hashtable registry; - - /** - * DAG of visible IDs by spec. Hashtable: source => (Hashtable: - * target => (UVector: variant)) The UVector of variants is never - * empty. For a source-target with no variant, the special - * variant NO_VARIANT (the empty string) is stored in slot zero of - * the UVector. - * - * Keys are CaseInsensitiveString objects. - * Values are Hashtable of (CaseInsensitiveString -> Vector of - * CaseInsensitiveString) - */ - private Hashtable specDAG; - - /** - * Vector of public full IDs (CaseInsensitiveString objects). - */ - private Vector availableIDs; - - //---------------------------------------------------------------------- - // class Spec - //---------------------------------------------------------------------- - - /** - * A Spec is a string specifying either a source or a target. In more - * general terms, it may also specify a variant, but we only use the - * Spec class for sources and targets. - * - * A Spec may be a locale or a script. If it is a locale, it has a - * fallback chain that goes xx_YY_ZZZ -> xx_YY -> xx -> ssss, where - * ssss is the script mapping of xx_YY_ZZZ. The Spec API methods - * hasFallback(), next(), and reset() iterate over this fallback - * sequence. - * - * The Spec class canonicalizes itself, so the locale is put into - * canonical form, or the script is transformed from an abbreviation - * to a full name. - */ - static class Spec { - - private String top; // top spec - private String spec; // current spec - private String nextSpec; // next spec - private String scriptName; // script name equivalent of top, if != top - private boolean isSpecLocale; // TRUE if spec is a locale - private boolean isNextLocale; // TRUE if nextSpec is a locale - private ResourceBundle res; - - public Spec(String theSpec) { - top = theSpec; - spec = null; - scriptName = null; - - Locale toploc = getLocale(top); - res = ResourceBundle.getBundle(RB_LOCALE_ELEMENTS, toploc); - // Make sure we got the bundle we wanted; otherwise, don't use it - if (isFallbackOf(res.getLocale().toString(), top)) { - isSpecLocale = true; - } else { - isSpecLocale = false; - res = null; - } - - // Canonicalize script name -or- do locale->script mapping - int[] s = UScript.getCode(top); - if (s != null) { - scriptName = UScript.getName(s[0]); - // If the script name is the same as top then it's redundant - if (scriptName.equalsIgnoreCase(top)) { - scriptName = null; - } - } - - // assert(spec != top); - reset(); - } - - public boolean hasFallback() { - return nextSpec != null; - } - - public void reset() { - if (spec != top) { // [sic] pointer comparison - spec = top; - isSpecLocale = (res != null); - setupNext(); - } - } - - private void setupNext() { - isNextLocale = false; - if (isSpecLocale) { - nextSpec = spec; - int i = nextSpec.lastIndexOf(LOCALE_SEP); - // If i == 0 then we have _FOO, so we fall through - // to the scriptName. - if (i > 0) { - nextSpec = spec.substring(0, i); - isNextLocale = true; - } else { - nextSpec = scriptName; // scriptName may be null - } - } else { - // Fallback to the script, which may be null - nextSpec = scriptName; - } - } - - // Protocol: - // for(String& s(spec.get()); - // spec.hasFallback(); s(spec.next())) { ... - - public String next() { - spec = nextSpec; - isSpecLocale = isNextLocale; - setupNext(); - return spec; - } - - public String get() { - return spec; - } - - public boolean isLocale() { - return isSpecLocale; - } - - /** - * Return the ResourceBundle for this spec, at the current - * level of iteration. The level of iteration goes from - * aa_BB_CCC to aa_BB to aa. If the bundle does not - * correspond to the current level of iteration, return null. - * If isLocale() is false, always return null. - */ - public ResourceBundle getBundle() { - if (res != null && - res.getLocale().toString().equals(spec)) { - return res; - } - return null; - } - - public String getTop() { - return top; - } - - // Internal helper function to convert string of the form - // aa_bb_CC to a locale object. Why isn't this in Locale? - private static Locale getLocale(String name) { - String language = ""; - String country = ""; - String variant = ""; - - int i1 = name.indexOf('_'); - if (i1 < 0) { - language = name; - } else { - language = name.substring(0, i1); - ++i1; - int i2 = name.indexOf('_', i1); - if (i2 < 0) { - country = name.substring(i1); - } else { - country = name.substring(i1, i2); - variant = name.substring(i2+1); - } - } - return new Locale(language, country, variant); - } - - // Compare two locale strings of the form aa_bb_CC, and - // return true if parent is a fallback of child, that is, - // if child =~ /^parent(_.+)*/ (roughly). - private static boolean isFallbackOf(String parent, String child) { - if (!child.startsWith(parent)) { - return false; - } - int i = parent.length(); - return (i == child.length() || - child.charAt(i) == '_'); - } - } - - //---------------------------------------------------------------------- - // Entry classes - //---------------------------------------------------------------------- - - static class ResourceEntry { - public String resourceName; - public String encoding; - public int direction; - public ResourceEntry(String n, String enc, int d) { - resourceName = n; - encoding = enc; - direction = d; - } - } - - // An entry representing a rule in a locale resource bundle - static class LocaleEntry { - public String rule; - public int direction; - public LocaleEntry(String r, int d) { - rule = r; - direction = d; - } - } - - static class AliasEntry { - public String alias; - public AliasEntry(String a) { - alias = a; - } - } - - static class CompoundRBTEntry { - private String ID; - private String idBlock; - private int idSplitPoint; - private RuleBasedTransliterator.Data data; - private UnicodeSet compoundFilter; - - public CompoundRBTEntry(String theID, String theIDBlock, - int theIDSplitPoint, - RuleBasedTransliterator.Data theData, - UnicodeSet theCompoundFilter) { - ID = theID; - idBlock = theIDBlock; - idSplitPoint = theIDSplitPoint; - data = theData; - compoundFilter = theCompoundFilter; - } - - public Transliterator getInstance() { - Transliterator t = new RuleBasedTransliterator("_", data, null); - t = new CompoundTransliterator(ID, idBlock, idSplitPoint, t); - t.setFilter(compoundFilter); - return t; - } - } - - //---------------------------------------------------------------------- - // class TransliteratorRegistry: Basic public API - //---------------------------------------------------------------------- - - public TransliteratorRegistry() { - registry = new Hashtable(); - specDAG = new Hashtable(); - availableIDs = new Vector(); - } - - /** - * Given a simple ID (forward direction, no inline filter, not - * compound) attempt to instantiate it from the registry. Return - * 0 on failure. - * - * Return a non-empty aliasReturn value if the ID points to an alias. - * We cannot instantiate it ourselves because the alias may contain - * filters or compounds, which we do not understand. Caller should - * make aliasReturn empty before calling. - */ - public Transliterator get(String ID, - StringBuffer aliasReturn) { - Object[] entry = find(ID); - return (entry == null) ? null - : instantiateEntry(ID, entry, aliasReturn); - } - - /** - * Register a class. This adds an entry to the - * dynamic store, or replaces an existing entry. Any entry in the - * underlying static locale resource store is masked. - */ - public void put(String ID, - Class transliteratorSubclass, - boolean visible) { - registerEntry(ID, transliteratorSubclass, visible); - } - - /** - * Register an ID and a factory function pointer. This adds an - * entry to the dynamic store, or replaces an existing entry. Any - * entry in the underlying static locale resource store is masked. - */ - public void put(String ID, - Transliterator.Factory factory, - boolean visible) { - registerEntry(ID, factory, visible); - } - - /** - * Register an ID and a resource name. This adds an entry to the - * dynamic store, or replaces an existing entry. Any entry in the - * underlying static locale resource store is masked. - */ - public void put(String ID, - String resourceName, - String encoding, - int dir, - boolean visible) { - registerEntry(ID, new ResourceEntry(resourceName, encoding, dir), visible); - } - - /** - * Register an ID and an alias ID. This adds an entry to the - * dynamic store, or replaces an existing entry. Any entry in the - * underlying static locale resource store is masked. - */ - public void put(String ID, - String alias, - boolean visible) { - registerEntry(ID, new AliasEntry(alias), visible); - } - - /** - * Unregister an ID. This removes an entry from the dynamic store - * if there is one. The static locale resource store is - * unaffected. - */ - public void remove(String ID) { - String[] stv = TransliteratorIDParser.IDtoSTV(ID); - // Only need to do this if ID.indexOf('-') < 0 - String id = STVtoID(stv[0], stv[1], stv[2]); - registry.remove(new CaseInsensitiveString(id)); - removeSTV(stv[0], stv[1], stv[2]); - availableIDs.removeElement(new CaseInsensitiveString(id)); - } - - //---------------------------------------------------------------------- - // class TransliteratorRegistry: Public ID and spec management - //---------------------------------------------------------------------- - - /** - * An internal class that adapts an enumeration over - * CaseInsensitiveStrings to an enumeration over Strings. - */ - private static class IDEnumeration implements Enumeration { - Enumeration enum; - - public IDEnumeration(Enumeration e) { - enum = e; - } - - public boolean hasMoreElements() { - return enum != null && enum.hasMoreElements(); - } - - public Object nextElement() { - return ((CaseInsensitiveString) enum.nextElement()).getString(); - } - } - - /** - * Returns an enumeration over the programmatic names of visible - * registered transliterators. - * - * @return An Enumeration over String objects - */ - public Enumeration getAvailableIDs() { - // Since the cache contains CaseInsensitiveString objects, but - // the caller expects Strings, we have to use an intermediary. - return new IDEnumeration(availableIDs.elements()); - } - - /** - * Returns an enumeration over all visible source names. - * - * @return An Enumeration over String objects - */ - public Enumeration getAvailableSources() { - return new IDEnumeration(specDAG.keys()); - } - - /** - * Returns an enumeration over visible target names for the given - * source. - * - * @return An Enumeration over String objects - */ - public Enumeration getAvailableTargets(String source) { - CaseInsensitiveString cisrc = new CaseInsensitiveString(source); - Hashtable targets = (Hashtable) specDAG.get(cisrc); - if (targets == null) { - return new IDEnumeration(null); - } - return new IDEnumeration(targets.keys()); - } - - /** - * Returns an enumeration over visible variant names for the given - * source and target. - * - * @return An Enumeration over String objects - */ - public Enumeration getAvailableVariants(String source, String target) { - CaseInsensitiveString cisrc = new CaseInsensitiveString(source); - CaseInsensitiveString citrg = new CaseInsensitiveString(target); - Hashtable targets = (Hashtable) specDAG.get(cisrc); - if (targets == null) { - return new IDEnumeration(null); - } - Vector variants = (Vector) targets.get(citrg); - if (variants == null) { - return new IDEnumeration(null); - } - return new IDEnumeration(variants.elements()); - } - - //---------------------------------------------------------------------- - // class TransliteratorRegistry: internal - //---------------------------------------------------------------------- - - /** - * Given source, target, and variant strings, concatenate them into a - * full ID. If the source is empty, then "Any" will be used for the - * source, so the ID will always be of the form s-t/v or s-t. - */ - private String STVtoID(String source, - String target, - String variant) { - StringBuffer id = new StringBuffer(source); - if (id.length() == 0) { - id.append(ANY); - } - id.append(ID_SEP).append(target); - if (variant != null && variant.length() != 0) { - id.append(VARIANT_SEP).append(variant); - } - return id.toString(); - } - - /** - * Convenience method. Calls 6-arg registerEntry(). - */ - private void registerEntry(String source, - String target, - String variant, - Object entry, - boolean visible) { - String s = source; - if (s.length() == 0) { - s = ANY; - } - String ID = STVtoID(source, target, variant); - registerEntry(ID, s, target, variant, entry, visible); - } - - /** - * Convenience method. Calls 6-arg registerEntry(). - */ - private void registerEntry(String ID, - Object entry, - boolean visible) { - String[] stv = TransliteratorIDParser.IDtoSTV(ID); - // Only need to do this if ID.indexOf('-') < 0 - String id = STVtoID(stv[0], stv[1], stv[2]); - registerEntry(id, stv[0], stv[1], stv[2], entry, visible); - } - - /** - * Register an entry object (adopted) with the given ID, source, - * target, and variant strings. - */ - private void registerEntry(String ID, - String source, - String target, - String variant, - Object entry, - boolean visible) { - CaseInsensitiveString ciID = new CaseInsensitiveString(ID); - - // Store the entry within an array so it can be modified later - if (!(entry instanceof Object[])) { - entry = new Object[] { entry }; - } - - registry.put(ciID, entry); - if (visible) { - registerSTV(source, target, variant); - if (!availableIDs.contains(ciID)) { - availableIDs.addElement(ciID); - } - } else { - removeSTV(source, target, variant); - availableIDs.removeElement(ciID); - } - } - - /** - * Register a source-target/variant in the specDAG. Variant may be - * empty, but source and target must not be. If variant is empty then - * the special variant NO_VARIANT is stored in slot zero of the - * UVector of variants. - */ - private void registerSTV(String source, - String target, - String variant) { - // assert(source.length() > 0); - // assert(target.length() > 0); - CaseInsensitiveString cisrc = new CaseInsensitiveString(source); - CaseInsensitiveString citrg = new CaseInsensitiveString(target); - CaseInsensitiveString civar = new CaseInsensitiveString(variant); - Hashtable targets = (Hashtable) specDAG.get(cisrc); - if (targets == null) { - targets = new Hashtable(); - specDAG.put(cisrc, targets); - } - Vector variants = (Vector) targets.get(citrg); - if (variants == null) { - variants = new Vector(); - targets.put(citrg, variants); - } - // assert(NO_VARIANT == ""); - // We add the variant string. If it is the special "no variant" - // string, that is, the empty string, we add it at position zero. - if (!variants.contains(civar)) { - if (variant.length() > 0) { - variants.addElement(civar); - } else { - variants.insertElementAt(civar, 0); - } - } - } - - /** - * Remove a source-target/variant from the specDAG. - */ - private void removeSTV(String source, - String target, - String variant) { - // assert(source.length() > 0); - // assert(target.length() > 0); - CaseInsensitiveString cisrc = new CaseInsensitiveString(source); - CaseInsensitiveString citrg = new CaseInsensitiveString(target); - CaseInsensitiveString civar = new CaseInsensitiveString(variant); - Hashtable targets = (Hashtable) specDAG.get(cisrc); - if (targets == null) { - return; // should never happen for valid s-t/v - } - Vector variants = (Vector) targets.get(citrg); - if (variants == null) { - return; // should never happen for valid s-t/v - } - variants.removeElement(variant); - if (variants.size() == 0) { - targets.remove(citrg); // should delete variants - if (targets.size() == 0) { - specDAG.remove(cisrc); // should delete targets - } - } - } - - private static final boolean DEBUG = false; - - /** - * Attempt to find a source-target/variant in the dynamic registry - * store. Return 0 on failure. - */ - private Object[] findInDynamicStore(Spec src, - Spec trg, - String variant) { - String ID = STVtoID(src.get(), trg.get(), variant); - if (DEBUG) { - System.out.println("TransliteratorRegistry.findInDynamicStore:" + - ID); - } - return (Object[]) registry.get(new CaseInsensitiveString(ID)); - } - - /** - * Attempt to find a source-target/variant in the static locale - * resource store. Do not perform fallback. Return 0 on failure. - * - * On success, create a new entry object, register it in the dynamic - * store, and return a pointer to it, but do not make it public -- - * just because someone requested something, we do not expand the - * available ID list (or spec DAG). - */ - private Object[] findInStaticStore(Spec src, - Spec trg, - String variant) { - if (DEBUG) { - String ID = STVtoID(src.get(), trg.get(), variant); - System.out.println("TransliteratorRegistry.findInStaticStore:" + - ID); - } - Object[] entry = null; - if (src.isLocale()) { - entry = findInBundle(src, trg, variant, Transliterator.FORWARD); - } else if (trg.isLocale()) { - entry = findInBundle(trg, src, variant, Transliterator.REVERSE); - } - - // If we found an entry, store it in the Hashtable for next - // time. - if (entry != null) { - registerEntry(src.getTop(), trg.getTop(), variant, entry, false); - } - - return entry; - } - - /** - * Attempt to find an entry in a single resource bundle. This is - * a one-sided lookup. findInStaticStore() performs up to two such - * lookups, one for the source, and one for the target. - * - * Do not perform fallback. Return 0 on failure. - * - * On success, create a new Entry object, populate it, and return it. - * The caller owns the returned object. - */ - private Object[] findInBundle(Spec specToOpen, - Spec specToFind, - String variant, - int direction) { - // assert(specToOpen.isLocale()); - ResourceBundle res = specToOpen.getBundle(); - if (res == null) { - // This means that the bundle's locale does not match - // the current level of iteration for the spec. - return null; - } - - for (int pass=0; pass<2; ++pass) { - StringBuffer tag = new StringBuffer(); - // First try either TransliteratorTo_xxx or - // TransliterateFrom_xxx, then try the bidirectional - // Transliterate_xxx. This precedence order is arbitrary - // but must be consistent and documented. - if (pass == 0) { - tag.append(direction == Transliterator.FORWARD ? - "TransliterateTo_" : "TransliterateFrom_"); - } else { - tag.append("Transliterate_"); - } - tag.append(specToFind.get().toUpperCase()); - - try { - // The Transliterate*_xxx resource is an array of - // strings of the format { , , ... }. Each - // is a variant name, and each is a rule. - String[] subres = res.getStringArray(tag.toString()); - - // assert(subres != null); - // assert(subres.length % 2 == 0); - int i = 0; - if (variant.length() != 0) { - for (i=0; i= 2) { - if (args[1].equalsIgnoreCase("NFD")) { - m = Normalizer.DECOMP; - } else if (args[1].equalsIgnoreCase("NFKD")) { - m = Normalizer.DECOMP_COMPAT; - } else { - usage(); - } - } - if (args.length >= 3) { - if (args[2].equalsIgnoreCase("lower")) { - lowerFirst = true; - } else { - usage(); - } - } - if (args.length > 3) { - usage(); - } - showSourceSet(args[0], m, lowerFirst); - } - } - - /** - * Hook to allow tools to access package private method. - */ - public static UnicodeSet getSourceSet(Transliterator t) { - return t.getSourceSet(); - } - - static void showSourceSet(String ID, Normalizer.Mode m, boolean lowerFirst) throws IOException { - File f = new File("UnicodeSetClosure.txt"); - String filename = f.getCanonicalFile().toString(); - out = new PrintWriter( - new OutputStreamWriter( - new FileOutputStream(filename), "UTF-8")); - out.print('\uFEFF'); // BOM - System.out.println(); - System.out.println("Writing " + filename); - Transliterator t = Transliterator.getInstance(ID); - showSourceSetAux(t, m, lowerFirst, true); - showSourceSetAux(t.getInverse(), m, lowerFirst, false); - out.close(); - } - - static PrintWriter out; - - static void showSourceSetAux(Transliterator t, Normalizer.Mode m, boolean lowerFirst, boolean forward) throws IOException { - UnicodeSet sourceSet = t.getSourceSet(); - if (m != Normalizer.NO_OP || lowerFirst) { - UnicodeSetClosure.close(sourceSet, m, lowerFirst); - } - System.out.println(t.getID() + ": " + - sourceSet.toPattern(true)); - out.println("# MINIMAL FILTER GENERATED FOR: " + t.getID() + (forward ? "" : " REVERSE")); - out.println(":: " - + (forward ? "" : "( ") - + sourceSet.toPattern(true) - + (forward ? "" : " )") - + " ;"); - out.println("# Unicode: " + sourceSet.toPattern(false)); - out.println(); - } - - static void usage() { - System.err.println("Usage: ID [ NFD|NFKD [lower] ]"); - System.exit(1); - } -} diff --git a/icu4j/src/com/ibm/text/UCharacter.java b/icu4j/src/com/ibm/text/UCharacter.java deleted file mode 100755 index 58c442be94..0000000000 --- a/icu4j/src/com/ibm/text/UCharacter.java +++ /dev/null @@ -1,2421 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UCharacter.java,v $ -* $Date: 2002/02/15 02:53:32 $ -* $Revision: 1.22 $ -* -******************************************************************************* -*/ - - -package com.ibm.text; - -import java.util.Locale; -import com.ibm.util.Utility; -import com.ibm.icu.util.RangeValueIterator; -import com.ibm.text.BreakIterator; -import com.ibm.text.RuleBasedBreakIterator; - -/** -*

-* The UCharacter class provides extensions to the -* -* java.lang.Character class. These extensions provide support for -* Unicode 3.1 properties and together with the UTF16 -* class, provide support for supplementary characters (those with code -* points above U+FFFF). -*

-*

-* Code points are represented in these API using ints. While it would be -* more convenient in Java to have a separate primitive datatype for them, -* ints suffice in the meantime. -*

-*

-* To use this class please add the jar file name icu4j.jar to the -* class path, since it contains data files which supply the information used -* by this file.
-* E.g. In Windows
-* set CLASSPATH=%CLASSPATH%;$JAR_FILE_PATH/ucharacter.jar.
-* Otherwise, another method would be to copy the files uprops.dat and -* unames.dat from the icu4j source subdirectory -* $ICU4J_SRC/src/com/ibm/text/resources to your class directory -* $ICU4J_CLASS/com/ibm/text/resources. -*

-*

-* For more information about the data file format, please refer to -* -* Read Me. -*

-*

-* Aside from the additions for UTF-16 support, and the updated Unicode 3.1 -* properties, the main differences between UCharacter and Character are: -*

    -*
  • UCharacter is not designed to be a char wrapper and does not have -* APIs to which involves management of that single char.
    -* These include: -*
      -*
    • char charValue(), -*
    • int compareTo(java.lang.Character, java.lang.Character), etc. -*
    -*
  • UCharacter does not include Character APIs that are deprecated, not -* does it include the Java-specific character information, such as -* boolean isJavaIdentifierPart(char ch). -*
  • Character maps characters 'A' - 'Z' and 'a' - 'z' to the numeric -* values '10' - '35'. UCharacter also does this in digit and -* getNumericValue, to adhere to the java semantics of these -* methods. New methods unicodeDigit, and -* getUnicodeNumericValue do not treat the above code points -* as having numeric values. This is a semantic change from ICU4J 1.3.1. -*
  • For consistency with ICU4C's data, control code points below have their -* Unicode general category reset to the types below. -*
      -*
    • TAB 0x9 : U_SPACE_SEPARATOR -*
    • VT 0xb : U_SPACE_SEPARATOR -*
    • LF 0xa : U_PARAGRAPH_SEPARATOR -*
    • FF 0xc : U_LINE_SEPARATOR -*
    • CR 0xd : U_PARAGRAPH_SEPARATOR -*
    • FS 0x1c : U_PARAGRAPH_SEPARATOR -*
    • GS 0x1d : U_PARAGRAPH_SEPARATOR -*
    • RS 0x1e : U_PARAGRAPH_SEPARATOR -*
    • US 0x1f : U_SPACE_SEPARATOR -*
    • NL 0x85 : U_PARAGRAPH_SEPARATOR -*
    -*

    -* Further detail differences can be determined from the program -* -* com.ibm.icu.test.text.UCharacterCompare -*

    -* @author Syn Wee Quek -* @since oct 06 2000 -* @see com.ibm.text.UCharacterCategory -* @see com.ibm.text.UCharacterDirection -*/ - -public final class UCharacter -{ - // public data members ----------------------------------------------- - - /** - * The lowest Unicode code point value. - */ - public static final int MIN_VALUE = 0; - - /** - * The highest Unicode code point value (scalar value) according to the - * Unicode Standard.
    - * This is a 21-bit value (21 bits, rounded up).
    - * Up-to-date Unicode implementation of java.lang.Character.MIN_VALUE - */ - public static final int MAX_VALUE = 0x10ffff; - - /** - * The minimum value for Supplementary code points - */ - public static final int SUPPLEMENTARY_MIN_VALUE = 0x10000; - - /** - * Unicode value used when translating into Unicode encoding form and there - * is no existing character. - */ - public static final int REPLACEMENT_CHAR = '\uFFFD'; - - - // public methods ---------------------------------------------------- - - /** - * Retrieves the numeric value of a decimal digit code point. - *
    This method observes the semantics of - * java.lang.Character.digit(). Note that this - * will return positive values for code points for which isDigit - * returns false, just like java.lang.Character. - *
    Semantic Change: In release 1.3.1 and - * prior, this did not treat the European letters as having a - * digit value, and also treated numeric letters and other numbers as - * digits. - * This has been changed to conform to the java semantics. - *
    A code point is a valid digit if and only if: - *
      - *
    • ch is a decimal digit or one of the european letters, and - *
    • the value of ch is less than the specified radix. - *
    - * @param ch the code point to query - * @param radix the radix - * @return the numeric value represented by the code point in the - * specified radix, or -1 if the code point is not a decimal digit - * or if its value is too large for the radix - */ - public static int digit(int ch, int radix) - { - int props = getProps(ch); - int result = -1; - // if props == 0, it will just fall through and return -1 - if (!UCharacterProperty.isExceptionIndicator(props)) { - // not contained in exception data - if (UCharacterProperty.getPropType(props) == - UCharacterCategory.DECIMAL_DIGIT_NUMBER) { - result = UCharacterProperty.getSignedValue(props); - } - } - - if (result < 0 && radix > 10) { - result = getEuropeanDigit(ch); - } - - if (result < 0 || result >= radix) { - return -1; - } - return result; - } - - /** - * Retrieves the numeric value of a decimal digit code point. - *
    This is a convenience overload of digit(int, int) - * that provides a decimal radix. - *
    Semantic Change: In release 1.3.1 and prior, this - * treated numeric letters and other numbers as digits. This has - * been changed to conform to the java semantics. - * @param ch the code point to query - * @return the numeric value represented by the code point, - * or -1 if the code point is not a decimal digit or if its - * value is too large for a decimal radix - */ - public static int digit(int ch) - { - return digit(ch, DECIMAL_RADIX_); - } - - /** - * Returns the Unicode numeric value of the code point as a nonnegative - * integer. - *
    If the code point does not have a numeric value, then -1 is returned. - *
    - * If the code point has a numeric value that cannot be represented as a - * nonnegative integer (for example, a fractional value), then -2 is - * returned. - *
    Semantic Change: In release 1.3.1 and - * prior, this returned -1 for ASCII letters and their - * fullwidth counterparts. This has been changed to - * conform to the java semantics. - * @param ch the code point to query - * @return the numeric value of the code point, or -1 if it has no numeric - * value, or -2 if it has a numeric value that cannot be represented as a - * nonnegative integer - */ - public static int getNumericValue(int ch) - { - return getNumericValueInternal(ch, true); - } - - /** - * Returns the Unicode numeric value of the code point as a nonnegative - * integer. - *
    If the code point does not have a numeric value, then -1 is returned.
    - * If the code point has a numeric value that cannot be represented as a - * nonnegative integer (for example, a fractional value), then -2 is - * returned. - * This returns values other than -1 for all and only those code points - * whose type is a numeric type. - * @param ch the code point to query - * @return the numeric value of the code point, or -1 if it has no numeric - * value, or -2 if it has a numeric value that cannot be represented as a - * nonnegative integer - */ - public static int getUnicodeNumericValue(int ch) - { - return getNumericValueInternal(ch, false); - } - - /** - * Returns a value indicating a code point's Unicode category.
    - * Up-to-date Unicode implementation of java.lang.Character.getType() except - * for the above mentioned code points that had their category changed.
    - * Return results are constants from the interface - * UCharacterCategory - * @param ch code point whose type is to be determined - * @return category which is a value of UCharacterCategory - */ - public static int getType(int ch) - { - return UCharacterProperty.getPropType(getProps(ch)); - } - - /** - * Determines if a code point has a defined meaning in the up-to-date Unicode - * standard.
    - * E.g. supplementary code points though allocated space are not defined in - * Unicode yet.
    - * Up-to-date Unicode implementation of java.lang.Character.isDefined() - * @param ch code point to be determined if it is defined in the most current - * version of Unicode - * @return true if this code point is defined in unicode - */ - public static boolean isDefined(int ch) - { - return getProps(ch) != 0; - } - - /** - * Determines if a code point is a Java digit. - *
    This method observes the semantics of - * java.lang.Character.isDigit(). It returns true for - * decimal digits only. - *
    Semantic Change: In release 1.3.1 and prior, this - * treated numeric letters and other numbers as digits. This has - * been changed to conform to the java semantics. - * @param ch code point to query - * @return true if this code point is a digit */ - public static boolean isDigit(int ch) - { - return getType(ch) == UCharacterCategory.DECIMAL_DIGIT_NUMBER; - } - - /** - * Determines if the specified code point is an ISO control character.
    - * A code point is considered to be an ISO control character if it is in the - * range \u0000 through \u001F or in the range \u007F through - * \u009F.
    - * Up-to-date Unicode implementation of java.lang.Character.isISOControl() - * @param ch code point to determine if it is an ISO control character - * @return true if code point is a ISO control character - */ - public static boolean isISOControl(int ch) - { - return ch >= 0 && ch <= APPLICATION_PROGRAM_COMMAND_ && - ((ch <= UNIT_SEPERATOR_) || (ch >= DELETE_)); - } - - /** - * Determines if the specified code point is a letter.
    - * Up-to-date Unicode implementation of java.lang.Character.isLetter() - * @param ch code point to determine if it is a letter - * @return true if code point is a letter - */ - public static boolean isLetter(int ch) - { - int cat = getType(ch); - // if props == 0, it will just fall through and return false - return cat == UCharacterCategory.UPPERCASE_LETTER || - cat == UCharacterCategory.LOWERCASE_LETTER || - cat == UCharacterCategory.TITLECASE_LETTER || - cat == UCharacterCategory.MODIFIER_LETTER || - cat == UCharacterCategory.OTHER_LETTER; - } - - /** - * Determines if the specified code point is a letter or digit.
    - * Note this method, unlike java.lang.Character does not regard the ascii - * characters 'A' - 'Z' and 'a' - 'z' as digits. - * @param ch code point to determine if it is a letter or a digit - * @return true if code point is a letter or a digit - */ - public static boolean isLetterOrDigit(int ch) - { - return isDigit(ch) || isLetter(ch); - } - - /** - * Determines if the specified code point is a lowercase character.
    - * UnicodeData only contains case mappings for code points where they are - * one-to-one mappings; it also omits information about context-sensitive - * case mappings.
    For more information about Unicode case mapping please - * refer to the - * Technical report #21.
    - * Up-to-date Unicode implementation of java.lang.Character.isLowerCase() - * @param ch code point to determine if it is in lowercase - * @return true if code point is a lowercase character - */ - public static boolean isLowerCase(int ch) - { - // if props == 0, it will just fall through and return false - return getType(ch) == UCharacterCategory.LOWERCASE_LETTER; - } - - /** - * Determines if the specified code point is a white space character.
    - * A code point is considered to be an whitespace character if and only - * if it satisfies one of the following criteria: - *
      - *
    • It is a Unicode space separator (category "Zs"), but is not - * a no-break space (\u00A0 or \u202F or \uFEFF). - *
    • It is a Unicode line separator (category "Zl"). - *
    • It is a Unicode paragraph separator (category "Zp"). - *
    - * Up-to-date Unicode implementation of java.lang.Character.isWhitespace(). - * @param ch code point to determine if it is a white space - * @return true if the specified code point is a white space character - */ - public static boolean isWhitespace(int ch) - { - int cat = getType(ch); - // exclude no-break spaces - // if props == 0, it will just fall through and return false - return (cat == UCharacterCategory.SPACE_SEPARATOR || - cat == UCharacterCategory.LINE_SEPARATOR || - cat == UCharacterCategory.PARAGRAPH_SEPARATOR) && - (ch != NO_BREAK_SPACE_) && (ch != NARROW_NO_BREAK_SPACE_) && - (ch != ZERO_WIDTH_NO_BREAK_SPACE_); - } - - /** - * Determines if the specified code point is a Unicode specified space - * character, ie if code point is in the category Zs, Zl and Zp.
    - * Up-to-date Unicode implementation of java.lang.Character.isSpaceChar(). - * @param ch code point to determine if it is a space - * @return true if the specified code point is a space character - */ - public static boolean isSpaceChar(int ch) - { - int cat = getType(ch); - // if props == 0, it will just fall through and return false - return cat == UCharacterCategory.SPACE_SEPARATOR || - cat == UCharacterCategory.LINE_SEPARATOR || - cat == UCharacterCategory.PARAGRAPH_SEPARATOR; - } - - /** - * Determines if the specified code point is a titlecase character.
    - * UnicodeData only contains case mappings for code points where they are - * one-to-one mappings; it also omits information about context-sensitive - * case mappings.
    - * For more information about Unicode case mapping please refer to the - * - * Technical report #21.
    - * Up-to-date Unicode implementation of java.lang.Character.isTitleCase(). - * @param ch code point to determine if it is in title case - * @return true if the specified code point is a titlecase character - */ - public static boolean isTitleCase(int ch) - { - int cat = getType(ch); - // if props == 0, it will just fall through and return false - return cat == UCharacterCategory.TITLECASE_LETTER; - } - - /** - * Determines if the specified code point may be any part of a Unicode - * identifier other than the starting character.
    - * A code point may be part of a Unicode identifier if and only if it is one - * of the following: - *
      - *
    • Lu Uppercase letter - *
    • Ll Lowercase letter - *
    • Lt Titlecase letter - *
    • Lm Modifier letter - *
    • Lo Other letter - *
    • Nl Letter number - *
    • Pc Connecting punctuation character - *
    • Nd decimal number - *
    • Mc Spacing combining mark - *
    • Mn Non-spacing mark - *
    • Cf formatting code - *
    - * Up-to-date Unicode implementation of - * java.lang.Character.isUnicodeIdentifierPart().
    - * See UTR #8. - * @param ch code point to determine if is can be part of a Unicode identifier - * @return true if code point is any character belonging a unicode identifier - * suffix after the first character - */ - public static boolean isUnicodeIdentifierPart(int ch) - { - int cat = getType(ch); - // if props == 0, it will just fall through and return false - return cat == UCharacterCategory.UPPERCASE_LETTER || - cat == UCharacterCategory.LOWERCASE_LETTER || - cat == UCharacterCategory.TITLECASE_LETTER || - cat == UCharacterCategory.MODIFIER_LETTER || - cat == UCharacterCategory.OTHER_LETTER || - cat == UCharacterCategory.LETTER_NUMBER || - cat == UCharacterCategory.CONNECTOR_PUNCTUATION || - cat == UCharacterCategory.DECIMAL_DIGIT_NUMBER || - cat == UCharacterCategory.COMBINING_SPACING_MARK || - cat == UCharacterCategory.NON_SPACING_MARK || - // cat == UCharacterCategory.FORMAT; - isIdentifierIgnorable(ch); - } - - /** - * Determines if the specified code point is permissible as the first - * character in a Unicode identifier.
    - * A code point may start a Unicode identifier if it is of type either - *
      - *
    • Lu Uppercase letter - *
    • Ll Lowercase letter - *
    • Lt Titlecase letter - *
    • Lm Modifier letter - *
    • Lo Other letter - *
    • Nl Letter number - *
    - * Up-to-date Unicode implementation of - * java.lang.Character.isUnicodeIdentifierStart().
    - * See UTR #8. - * @param ch code point to determine if it can start a Unicode identifier - * @return true if code point is the first character belonging a unicode - * identifier - */ - public static boolean isUnicodeIdentifierStart(int ch) - { - int cat = getType(ch); - // if props == 0, it will just fall through and return false - return cat == UCharacterCategory.UPPERCASE_LETTER || - cat == UCharacterCategory.LOWERCASE_LETTER || - cat == UCharacterCategory.TITLECASE_LETTER || - cat == UCharacterCategory.MODIFIER_LETTER || - cat == UCharacterCategory.OTHER_LETTER || - cat == UCharacterCategory.LETTER_NUMBER; - } - - /** - * Determines if the specified code point should be regarded as an ignorable - * character in a Unicode identifier.
    - * A character is ignorable in the Unicode standard if it is of the type Cf, - * Formatting code.
    - * Up-to-date Unicode implementation of - * java.lang.Character.isIdentifierIgnorable().
    - * See UTR #8. - * @param ch code point to be determined if it can be ignored in a Unicode - * identifier. - * @return true if the code point is ignorable - */ - public static boolean isIdentifierIgnorable(int ch) - { - /* - int cat = getType(ch); - // if props == 0, it will just fall through and return false - return cat == UCharacterCategory.FORMAT; - */ - // see java.lang.Character.isIdentifierIgnorable() on range of - // ignorable characters. - return ch <= 8 || (ch >= 0xe && ch <= 0x1b) || - (ch >= 0x7f && ch <= 0x9f) || - getType(ch) == UCharacterCategory.FORMAT; - } - - /** - * Determines if the specified code point is an uppercase character.
    - * UnicodeData only contains case mappings for code point where they are - * one-to-one mappings; it also omits information about context-sensitive - * case mappings.
    - * For language specific case conversion behavior, use - * toUpperCase(locale, str).
    - * For example, the case conversion for dot-less i and dotted I in Turkish, - * or for final sigma in Greek. - * For more information about Unicode case mapping please refer to the - * - * Technical report #21.
    - * Up-to-date Unicode implementation of java.lang.Character.isUpperCase(). - * @param ch code point to determine if it is in uppercase - * @return true if the code point is an uppercase character - */ - public static boolean isUpperCase(int ch) - { - int cat = getType(ch); - // if props == 0, it will just fall through and return false - return cat == UCharacterCategory.UPPERCASE_LETTER; - } - - /** - * The given code point is mapped to its lowercase equivalent; if the code - * point has no lowercase equivalent, the code point itself is returned.
    - * UnicodeData only contains case mappings for code point where they are - * one-to-one mappings; it also omits information about context-sensitive - * case mappings.
    - * For language specific case conversion behavior, use - * toLowerCase(locale, str).
    - * For example, the case conversion for dot-less i and dotted I in Turkish, - * or for final sigma in Greek. - * For more information about Unicode case mapping please refer to the - * - * Technical report #21.
    - * Up-to-date Unicode implementation of java.lang.Character.toLowerCase() - * @param ch code point whose lowercase equivalent is to be retrieved - * @return the lowercase equivalent code point - */ - public static int toLowerCase(int ch) - { - int props = getProps(ch); - // if props == 0, it will just fall through and return itself - if(!UCharacterProperty.isExceptionIndicator(props)) { - int cat = UCharacterProperty.getPropType(props); - if (cat == UCharacterCategory.UPPERCASE_LETTER || - cat == UCharacterCategory.TITLECASE_LETTER) { - return ch + UCharacterProperty.getSignedValue(props); - } - } - else - { - int index = UCharacterProperty.getExceptionIndex(props); - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_LOWERCASE_)) { - return PROPERTY_.getException(index, - UCharacterProperty.EXC_LOWERCASE_); - } - } - return ch; - } - - /** - * Converts argument code point and returns a String object representing the - * code point's value in UTF16 format.
    - * The result is a string whose length is 1 for non-supplementary code points, - * 2 otherwise.
    - * com.ibm.ibm.icu.UTF16 can be used to parse Strings generated by this - * function.
    - * Up-to-date Unicode implementation of java.lang.Character.toString() - * @param ch code point - * @return string representation of the code point, null if code point is not - * defined in unicode - */ - public static String toString(int ch) - { - if (ch < MIN_VALUE || ch > MAX_VALUE) { - return null; - } - - if (ch < UCharacter.SUPPLEMENTARY_MIN_VALUE) { - return String.valueOf((char)ch); - } - - char result[] = new char[2]; - result[0] = (char)UTF16.getLeadSurrogate(ch); - result[1] = (char)UTF16.getTrailSurrogate(ch); - return new String(result); - } - - /** - * Converts the code point argument to titlecase.
    - * UnicodeData only contains case mappings for code points where they are - * one-to-one mappings; it also omits information about context-sensitive - * case mappings.
    - * There are only four Unicode characters that are truly titlecase forms - * that are distinct from uppercase forms. - * For more information about Unicode case mapping please refer - * to the - * Technical report #21.
    - * If no titlecase is available, the uppercase is returned. If no uppercase - * is available, the code point itself is returned.
    - * Up-to-date Unicode implementation of java.lang.Character.toTitleCase() - * @param ch code point whose title case is to be retrieved - * @return titlecase code point - */ - public static int toTitleCase(int ch) - { - int props = getProps(ch); - // if props == 0, it will just fall through and return itself - if (!UCharacterProperty.isExceptionIndicator(props)) { - if (UCharacterProperty.getPropType(props) == - UCharacterCategory.LOWERCASE_LETTER) { - // here, titlecase is same as uppercase - return ch - UCharacterProperty.getSignedValue(props); - } - } - else { - int index = UCharacterProperty.getExceptionIndex(props); - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_TITLECASE_)) { - return PROPERTY_.getException(index, - UCharacterProperty.EXC_TITLECASE_); - } - else { - // here, titlecase is same as uppercase - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_UPPERCASE_)) { - return PROPERTY_.getException(index, - UCharacterProperty.EXC_UPPERCASE_); - } - } - } - return ch; // no mapping - return c itself - } - - /** - * Converts the character argument to uppercase.
    - * UnicodeData only contains case mappings for characters where they are - * one-to-one mappings; it also omits information about context-sensitive - * case mappings.
    - * For more information about Unicode case mapping please refer - * to the - * Technical report #21.
    - * If no uppercase is available, the character itself is returned.
    - * Up-to-date Unicode implementation of java.lang.Character.toUpperCase() - * @param ch code point whose uppercase is to be retrieved - * @return uppercase code point - */ - public static int toUpperCase(int ch) - { - int props = getProps(ch); - // if props == 0, it will just fall through and return itself - if (!UCharacterProperty.isExceptionIndicator(props)) { - if (UCharacterProperty.getPropType(props) == - UCharacterCategory.LOWERCASE_LETTER) { - // here, titlecase is same as uppercase */ - return ch - UCharacterProperty.getSignedValue(props); - } - } - else - { - int index = UCharacterProperty.getExceptionIndex(props); - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_UPPERCASE_)) { - return PROPERTY_.getException(index, - UCharacterProperty.EXC_UPPERCASE_); - } - } - return ch; // no mapping - return c itself - } - - // extra methods not in java.lang.Character -------------------------- - - /** - * Determines if the code point is a supplementary character.
    - * A code point is a supplementary character if and only if it is greater than - * SUPPLEMENTARY_MIN_VALUE - * @param ch code point to be determined if it is in the supplementary plane - * @return true if code point is a supplementary character - */ - public static boolean isSupplementary(int ch) - { - return ch >= UCharacter.SUPPLEMENTARY_MIN_VALUE && - ch <= UCharacter.MAX_VALUE; - } - - /** - * Determines if the code point is in the BMP plane.
    - * @param ch code point to be determined if it is not a supplementary - * character - * @return true if code point is not a supplementary character - */ - public static boolean isBMP(int ch) - { - return (ch >= 0 && ch < LAST_CHAR_MASK_); - } - - /** - * Determines whether the specified code point is a printable character - * according to the Unicode standard. - * @param ch code point to be determined if it is printable - * @return true if the code point is a printable character - */ - public static boolean isPrintable(int ch) - { - if (isISOControl(ch)) { - return false; - } - int cat = getType(ch); - // if props == 0, it will just fall through and return false - return (cat != UCharacterCategory.UNASSIGNED && - cat != UCharacterCategory.CONTROL && - cat != UCharacterCategory.FORMAT && - cat != UCharacterCategory.PRIVATE_USE && - cat != UCharacterCategory.SURROGATE && - cat != UCharacterCategory.GENERAL_OTHER_TYPES); - } - - /** - * Determines whether the specified code point is of base form.
    - * A code point of base form does not graphically combine with preceding - * characters, and is neither a control nor a format character. - * @param ch code point to be determined if it is of base form - * @return true if the code point is of base form - */ - public static boolean isBaseForm(int ch) - { - int cat = getType(ch); - // if props == 0, it will just fall through and return false - return cat == UCharacterCategory.DECIMAL_DIGIT_NUMBER || - cat == UCharacterCategory.OTHER_NUMBER || - cat == UCharacterCategory.LETTER_NUMBER || - cat == UCharacterCategory.UPPERCASE_LETTER || - cat == UCharacterCategory.LOWERCASE_LETTER || - cat == UCharacterCategory.TITLECASE_LETTER || - cat == UCharacterCategory.MODIFIER_LETTER || - cat == UCharacterCategory.OTHER_LETTER || - cat == UCharacterCategory.NON_SPACING_MARK || - cat == UCharacterCategory.ENCLOSING_MARK || - cat == UCharacterCategory.COMBINING_SPACING_MARK; - } - - /** - * Returns the Bidirection property of a code point.
    - * For example, 0x0041 (letter A) has the LEFT_TO_RIGHT directional - * property.
    - * Result returned belongs to the interface - * UCharacterDirection - * @param ch the code point to be determined its direction - * @return direction constant from UCharacterDirection. Otherwise is - * character is not defined, UCharacterDirection.BOUNDARY_NEUTRAL - * will be returned. - */ - public static int getDirection(int ch) - { - int props = getProps(ch); - if (props != 0) { - return UCharacterProperty.getDirection(props); - } - return UCharacterDirection.LEFT_TO_RIGHT; - } - - /** - * Determines whether the code point has the "mirrored" property.
    - * This property is set for characters that are commonly used in - * Right-To-Left contexts and need to be displayed with a "mirrored" - * glyph. - * @param ch code point whose mirror is to be determined - * @return true if the code point has the "mirrored" property - */ - public static boolean isMirrored(int ch) - { - int props = getProps(ch); - // if props == 0, it will just fall through and return false - return UCharacterProperty.isMirrored(props); - } - - /** - * Maps the specified code point to a "mirror-image" code point.
    - * For code points with the "mirrored" property, implementations sometimes - * need a "poor man's" mapping to another code point such that the default - * glyph may serve as the mirror-image of the default glyph of the specified - * code point.
    - * This is useful for text conversion to and from codepages with visual - * order, and for displays without glyph selection capabilities. - * @param ch code point whose mirror is to be retrieved - * @return another code point that may serve as a mirror-image substitute, or - * ch itself if there is no such mapping or ch does not have the - * "mirrored" property - */ - public static int getMirror(int ch) - { - int props = getProps(ch); - // mirrored - the value is a mirror offset - // if props == 0, it will just fall through and return false - if (UCharacterProperty.isMirrored(props)) { - if(!UCharacterProperty.isExceptionIndicator(props)) { - return ch + UCharacterProperty.getSignedValue(props); - } - else - { - int index = UCharacterProperty.getExceptionIndex(props); - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_MIRROR_MAPPING_)) - return PROPERTY_.getException(index, - UCharacterProperty.EXC_MIRROR_MAPPING_); - } - } - return ch; - } - - /** - * Gets the combining class of the argument codepoint - * @param ch code point whose combining is to be retrieved - * @return the combining class of the codepoint - */ - public static int getCombiningClass(int ch) - { - int props = getProps(ch); - if(!UCharacterProperty.isExceptionIndicator(props)) { - if (UCharacterProperty.getPropType(props) == - UCharacterCategory.NON_SPACING_MARK) { - return PROPERTY_.getUnsignedValue(props); - } - else { - return 0; - } - } - else { - // the combining class is in bits 23..16 of the first exception value - return (PROPERTY_.getException( - PROPERTY_.getExceptionIndex(props), - UCharacterProperty.EXC_COMBINING_CLASS_) - >> SHIFT_16_) & LAST_BYTE_MASK_; - } - } - - /** - * A code point is illegal if and only if - *
      - *
    • Out of bounds, less than 0 or greater than UCharacter.MAX_VALUE - *
    • A surrogate value, 0xD800 to 0xDFFF - *
    • Not-a-character, having the form 0x xxFFFF or 0x xxFFFE - *
    - * Note: legal does not mean that it is assigned in this version of Unicode. - * @param ch code point to determine if it is a legal code point by itself - * @return true if and only if legal. - */ - public static boolean isLegal(int ch) - { - if (ch < MIN_VALUE) { - return false; - } - if (ch < SURROGATE_MIN_VALUE_) { - return true; - } - if (ch <= SURROGATE_MAX_VALUE_) { - return false; - } - if (isNonCharacter(ch)) { - return false; - } - return (ch <= MAX_VALUE); - } - - /** - * A string is legal iff all its code points are legal. - * A code point is illegal if and only if - *
      - *
    • Out of bounds, less than 0 or greater than UCharacter.MAX_VALUE - *
    • A surrogate value, 0xD800 to 0xDFFF - *
    • Not-a-character, having the form 0x xxFFFF or 0x xxFFFE - *
    - * Note: legal does not mean that it is assigned in this version of Unicode. - * @param ch code point to determine if it is a legal code point by itself - * @return true if and only if legal. - */ - public static boolean isLegal(String str) - { - int size = str.length(); - int codepoint; - for (int i = 0; i < size; i ++) - { - codepoint = UTF16.charAt(str, i); - if (!isLegal(codepoint)) { - return false; - } - if (isSupplementary(codepoint)) { - i ++; - } - } - return true; - } - - /** - * Gets the version of Unicode data used. - * @return the unicode version number used - */ - public static String getUnicodeVersion() - { - return PROPERTY_.m_unicodeVersion_; - } - - /** - * Retrieve the most current Unicode name of the argument code point, or - * null if the character is unassigned or outside the range - * UCharacter.MIN_VALUE and UCharacter.MAX_VALUE or does not have a name. - *
    - * Note calling any methods related to code point names, e.g. get*Name*() - * incurs a one-time initialisation cost to construct the name tables. - * @param ch the code point for which to get the name - * @return most current Unicode name - */ - public static String getName(int ch) - { - return NAME_.getName(ch, UCharacterNameChoice.U_UNICODE_CHAR_NAME); - } - - /** - * Retrieve the earlier version 1.0 Unicode name of the argument code point, - * or null if the character is unassigned or outside the range - * UCharacter.MIN_VALUE and UCharacter.MAX_VALUE or does not have a name. - *
    - * Note calling any methods related to code point names, e.g. get*Name*() - * incurs a one-time initialisation cost to construct the name tables. - * @param ch the code point for which to get the name - * @return version 1.0 Unicode name - */ - public static String getName1_0(int ch) - { - return NAME_.getName(ch, - UCharacterNameChoice.U_UNICODE_10_CHAR_NAME); - } - - /** - *

    Retrieves a name for a valid codepoint. Unlike, getName(int) and - * getName1_0(int), this method will return a name even for codepoints that - * are not assigned a name in UnicodeData.txt. - *

    - * The names are returned in the following order. - *
      - *
    • Most current Unicode name if there is any - *
    • Unicode 1.0 name if there is any - *
    • Extended name in the form of "". - * E.g. - *
    - * Note calling any methods related to code point names, e.g. get*Name*() - * incurs a one-time initialisation cost to construct the name tables. - * @param ch the code point for which to get the name - * @return a name for the argument codepoint - * @draft 2.1 - */ - public static String getExtendedName(int ch) - { - return NAME_.getName(ch, UCharacterNameChoice.U_EXTENDED_CHAR_NAME); - } - - /** - *

    Find a Unicode code point by its most current Unicode name and - * return its code point value. All Unicode names are in uppercase.

    - * Note calling any methods related to code point names, e.g. get*Name*() - * incurs a one-time initialisation cost to construct the name tables. - * @param name most current Unicode character name whose code point is to be - * returned - * @return code point or -1 if name is not found - */ - public static int getCharFromName(String name) - { - return NAME_.getCharFromName( - UCharacterNameChoice.U_UNICODE_CHAR_NAME, name); - } - - /** - *

    Find a Unicode character by its version 1.0 Unicode name and return - * its code point value. All Unicode names are in uppercase.

    - * Note calling any methods related to code point names, e.g. get*Name*() - * incurs a one-time initialisation cost to construct the name tables. - * @param name Unicode 1.0 code point name whose code point is to - * returned - * @return code point or -1 if name is not found - */ - public static int getCharFromName1_0(String name) - { - return NAME_.getCharFromName( - UCharacterNameChoice.U_UNICODE_10_CHAR_NAME, name); - } - - /** - *

    Find a Unicode character by either its name and return its code - * point value. All Unicode names are in uppercase. - * Extended names are all lowercase except for numbers and are contained - * within angle brackets.

    - * The names are searched in the following order - *
      - *
    • Most current Unicode name if there is any - *
    • Unicode 1.0 name if there is any - *
    • Extended name in the form of "". - * E.g. - *
    - * Note calling any methods related to code point names, e.g. get*Name*() - * incurs a one-time initialisation cost to construct the name tables. - * @param name codepoint name - * @return code point associated with the name or -1 if the name is not - * found. - * @draft 2.1 - */ - public static int getCharFromExtendedName(String name) - { - return NAME_.getCharFromName( - UCharacterNameChoice.U_EXTENDED_CHAR_NAME, name); - } - - /** - * Returns a code pointcorresponding to the two UTF16 characters.
    - * If the argument lead is not a high surrogate character or trail is not a - * low surrogate character, UCharacter.REPLACEMENT_CHAR is returned. - * @param lead the lead char - * @param trail the trail char - * @return code point or UCharacter.REPLACEMENT_CHAR if surrogate characters - * are invalid. - */ - public static int getCodePoint(char lead, char trail) - { - if (UTF16.isLeadSurrogate(lead) && UTF16.isTrailSurrogate(trail)) { - return getRawSupplementary(lead, trail); - } - return UCharacter.REPLACEMENT_CHAR; - } - - /** - * Returns the code point corresponding to the UTF16 character.
    - * If argument char16 is a surrogate character, UCharacter.REPLACEMENT_CHAR - * is returned - * @param char16 the UTF16 character - * @return code point or UCharacter.REPLACEMENT_CHAR if argument is not a - * invalid character. - * @exception IllegalArgumentException thrown when char16 is not a valid - * codepoint - */ - public static int getCodePoint(char char16) - { - if (UCharacter.isLegal(char16)) { - return char16; - } - throw new IllegalArgumentException("Illegal codepoint"); - } - - /** - * Gets uppercase version of the argument string. - * Casing is dependent on the default locale and context-sensitive. - * @param str source string to be performed on - * @return uppercase version of the argument string - */ - public static String toUpperCase(String str) - { - return toUpperCase(Locale.getDefault(), str); - } - - /** - * Gets lowercase version of the argument string. - * Casing is dependent on the default locale and context-sensitive - * @param str source string to be performed on - * @return lowercase version of the argument string - */ - public static String toLowerCase(String str) - { - return toLowerCase(Locale.getDefault(), str); - } - - /** - *

    Gets the titlecase version of the argument string.

    - *

    Position for titlecasing is determined by the argument break - * iterator, hence the user can customized his break iterator for - * a specialized titlecasing. In this case only the forward iteration - * needs to be implemented. - * If the break iterator passed in is null, the default Unicode algorithm - * will be used to determine the titlecase positions. - *

    - *

    Only positions returned by the break iterator will be title cased, - * character in between the positions will all be in lower case.

    - *

    Casing is dependent on the default locale and context-sensitive

    - * @param str source string to be performed on - * @param breakiter break iterator to determine the positions in which - * the character should be title cased. - * @return lowercase version of the argument string - */ - public static String toTitleCase(String str, BreakIterator breakiter) - { - if (breakiter == null) { - String rules = "$cased=[[:Lu:][:Lt:][:Ll:]];" + - "$case_ignorable=[[:Mn:][:Me:][:Cf:][:Lm:][:Sk:]" - + " \\u0027\u00AD\u2019];" + - "$not_cased=[^$cased$case_ignorable];" + - "[$not_cased$case_ignorable]*/" + - "$cased[$cased$case_ignorable]*$not_cased*;"; - breakiter = new RuleBasedBreakIterator(rules); - } - - return str; - } - - /** - * Gets uppercase version of the argument string. - * Casing is dependent on the argument locale and context-sensitive. - * @param locale which string is to be converted in - * @param str source string to be performed on - * @return uppercase version of the argument string - */ - public static String toUpperCase(Locale locale, String str) - { - int size = str.length(); - StringBuffer result = new StringBuffer(size); // initial buffer - int offset = 0; - - while (offset < size) - { - int ch = UTF16.charAt(str, offset); - int chsize = UTF16.getCharCount(ch); - int props = PROPERTY_.getProperty(ch); - if (!UCharacterProperty.isExceptionIndicator(props)) - { - if (UCharacterProperty.getPropType(props) == - UCharacterCategory.LOWERCASE_LETTER) { - ch -= UCharacterProperty.getSignedValue(props); - } - UTF16.append(result, ch); - } - else - { - int index = UCharacterProperty.getExceptionIndex(props); - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_SPECIAL_CASING_)) { - getSpecialUpperCase(ch, index, result, str, offset, - locale); - } - else { - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_UPPERCASE_)) { - ch = PROPERTY_.getException(index, - UCharacterProperty.EXC_UPPERCASE_); - } - UTF16.append(result, ch); - } - } - offset += chsize; - } - return result.toString(); - } - - /** - * Gets lowercase version of the argument string. - * Casing is dependent on the argument locale and context-sensitive - * @param locale which string is to be converted in - * @param str source string to be performed on - * @return lowercase version of the argument string - */ - public static String toLowerCase(Locale locale, String str) - { - // case mapping loop - int offset = 0; - int length = str.length(); - StringBuffer result = new StringBuffer(length); - while (offset < length) { - int ch = UTF16.charAt(str, offset); - int chsize = UTF16.getCharCount(ch); - int props = PROPERTY_.getProperty(ch); - if (!UCharacterProperty.isExceptionIndicator(props)) { - int type = UCharacterProperty.getPropType(props); - if (type == UCharacterCategory.UPPERCASE_LETTER || - type == UCharacterCategory.TITLECASE_LETTER) { - ch += UCharacterProperty.getSignedValue(props); - } - UTF16.append(result, ch); - } - else { - int index = UCharacterProperty.getExceptionIndex(props); - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_SPECIAL_CASING_)) { - getSpecialLowerCase(ch, index, result, str, offset, - locale); - } - else { - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_LOWERCASE_)) { - ch = PROPERTY_.getException(index, - UCharacterProperty.EXC_LOWERCASE_); - } - UTF16.append(result, ch); - } - } - offset += chsize; - } - return result.toString(); - } - - /** - *

    Gets the titlecase version of the argument string.

    - *

    Position for titlecasing is determined by the argument break - * iterator, hence the user can customized his break iterator for - * a specialized titlecasing. In this case only the forward iteration - * needs to be implemented. - * If the break iterator passed in is null, the default Unicode algorithm - * will be used to determine the titlecase positions. - *

    - *

    Only positions returned by the break iterator will be title cased, - * character in between the positions will all be in lower case.

    - *

    Casing is dependent on the argument locale and context-sensitive

    - * @param locale which string is to be converted in - * @param str source string to be performed on - * @param breakiter break iterator to determine the positions in which - * the character should be title cased. - * @return lowercase version of the argument string - */ - public static String toTitleCase(Locale locale, String str, - BreakIterator breakiter) - { - return str; - } - - /** - * The given character is mapped to its case folding equivalent according to - * UnicodeData.txt and CaseFolding.txt; if the character has no case folding - * equivalent, the character itself is returned. - * Only "simple", single-code point case folding mappings are used. - * For "full", multiple-code point mappings use the API - * foldCase(String str, boolean defaultmapping). - * @param ch the character to be converted - * @param defaultmapping Indicates if all mappings defined in CaseFolding.txt - * is to be used, otherwise the mappings for dotted I - * and dotless i marked with 'I' in CaseFolding.txt will - * be skipped. - * @return the case folding equivalent of the character, if any; - * otherwise the character itself. - * @see #foldCase(String, boolean) - */ - public static int foldCase(int ch, boolean defaultmapping) - { - int props = PROPERTY_.getProperty(ch); - if (!UCharacterProperty.isExceptionIndicator(props)) { - int type = UCharacterProperty.getPropType(props); - if (type == UCharacterCategory.UPPERCASE_LETTER || - type == UCharacterCategory.TITLECASE_LETTER) { - return ch + UCharacterProperty.getSignedValue(props); - } - } - else { - int index = UCharacterProperty.getExceptionIndex(props); - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_CASE_FOLDING_)) { - int exception = PROPERTY_.getException(index, - UCharacterProperty.EXC_CASE_FOLDING_); - if (exception != 0) { - int foldedcasech = - PROPERTY_.getFoldCase(exception & LAST_CHAR_MASK_); - if (foldedcasech != 0){ - return foldedcasech; - } - } - else { - // special case folding mappings, hardcoded - if (defaultmapping && - (ch == LATIN_SMALL_LETTER_DOTLESS_I_ || - ch == LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE_)) { - // map dotted I and dotless i to U+0069 small i - return LATIN_SMALL_LETTER_I_; - } - // return ch itself because it is excluded from case folding - return ch; - } - } - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_LOWERCASE_)) { - // not else! - allow to fall through from above - return PROPERTY_.getException(index, - UCharacterProperty.EXC_LOWERCASE_); - } - } - - return ch; // no mapping - return the character itself - } - - /** - * The given string is mapped to its case folding equivalent according to - * UnicodeData.txt and CaseFolding.txt; if any character has no case folding - * equivalent, the character itself is returned. - * "Full", multiple-code point case folding mappings are returned here. - * For "simple" single-code point mappings use the API - * foldCase(int ch, boolean defaultmapping). - * @param str the String to be converted - * @param defaultmapping Indicates if all mappings defined in CaseFolding.txt - * is to be used, otherwise the mappings for dotted I - * and dotless i marked with 'I' in CaseFolding.txt will - * be skipped. - * @return the case folding equivalent of the character, if any; - * otherwise the character itself. - * @see #foldCase(int, boolean) - */ - public static String foldCase(String str, boolean defaultmapping) - { - int size = str.length(); - StringBuffer result = new StringBuffer(size); - int offset = 0; - int ch; - - // case mapping loop - while (offset < size) { - ch = UTF16.charAt(str, offset); - offset += UTF16.getCharCount(ch); - int props = PROPERTY_.getProperty(ch); - if (!UCharacterProperty.isExceptionIndicator(props)) { - int type = UCharacterProperty.getPropType(props); - if (type == UCharacterCategory.UPPERCASE_LETTER || - type == UCharacterCategory.TITLECASE_LETTER) { - ch += UCharacterProperty.getSignedValue(props); - } - } - else { - int index = UCharacterProperty.getExceptionIndex(props); - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_CASE_FOLDING_)) { - int exception = PROPERTY_.getException(index, - UCharacterProperty.EXC_CASE_FOLDING_); - if (exception != 0) { - PROPERTY_.getFoldCase(exception & LAST_CHAR_MASK_, - exception >> SHIFT_24_, result); - } - else { - // special case folding mappings, hardcoded - if (defaultmapping && - (ch == LATIN_SMALL_LETTER_DOTLESS_I_ || - ch == LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE_)) { - // map dotted I and dotless i to U+0069 small i - result.append(LATIN_SMALL_LETTER_I_); - } - else { - // output c itself because it is excluded from - // case folding - UTF16.append(result, ch); - } - } - // do not fall through to the output of c - continue; - } - else { - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_LOWERCASE_)) { - ch = PROPERTY_.getException(index, - UCharacterProperty.EXC_LOWERCASE_); - } - } - } - - // handle 1:1 code point mappings from UnicodeData.txt - UTF16.append(result, ch); - } - - return result.toString(); - } - - /** - * Return numeric value of Han code points. - *
    This returns the value of Han 'numeric' code points, - * including those for zero, ten, hundred, thousand, ten thousand, - * and hundred million. Unicode does not consider these to be - * numeric. This includes both the standard and 'checkwriting' - * characters, the 'big circle' zero character, and the standard - * zero character. - * @draft - * @param ch code point to query - * @return value if it is a Han 'numeric character,' otherwise return -1. - */ - public static int getHanNumericValue(int ch) - { - switch(ch) - { - case IDEOGRAPHIC_NUMBER_ZERO_ : - case CJK_IDEOGRAPH_COMPLEX_ZERO_ : - return 0; // Han Zero - case CJK_IDEOGRAPH_FIRST_ : - case CJK_IDEOGRAPH_COMPLEX_ONE_ : - return 1; // Han One - case CJK_IDEOGRAPH_SECOND_ : - case CJK_IDEOGRAPH_COMPLEX_TWO_ : - return 2; // Han Two - case CJK_IDEOGRAPH_THIRD_ : - case CJK_IDEOGRAPH_COMPLEX_THREE_ : - return 3; // Han Three - case CJK_IDEOGRAPH_FOURTH_ : - case CJK_IDEOGRAPH_COMPLEX_FOUR_ : - return 4; // Han Four - case CJK_IDEOGRAPH_FIFTH_ : - case CJK_IDEOGRAPH_COMPLEX_FIVE_ : - return 5; // Han Five - case CJK_IDEOGRAPH_SIXTH_ : - case CJK_IDEOGRAPH_COMPLEX_SIX_ : - return 6; // Han Six - case CJK_IDEOGRAPH_SEVENTH_ : - case CJK_IDEOGRAPH_COMPLEX_SEVEN_ : - return 7; // Han Seven - case CJK_IDEOGRAPH_EIGHTH_ : - case CJK_IDEOGRAPH_COMPLEX_EIGHT_ : - return 8; // Han Eight - case CJK_IDEOGRAPH_NINETH_ : - case CJK_IDEOGRAPH_COMPLEX_NINE_ : - return 9; // Han Nine - case CJK_IDEOGRAPH_TEN_ : - case CJK_IDEOGRAPH_COMPLEX_TEN_ : - return 10; - case CJK_IDEOGRAPH_HUNDRED_ : - case CJK_IDEOGRAPH_COMPLEX_HUNDRED_ : - return 100; - case CJK_IDEOGRAPH_THOUSAND_ : - case CJK_IDEOGRAPH_COMPLEX_THOUSAND_ : - return 1000; - case CJK_IDEOGRAPH_TEN_THOUSAND_ : - return 10000; - case CJK_IDEOGRAPH_HUNDRED_MILLION_ : - return 100000000; - } - return -1; // no value - } - - /** - *

    Gets an iterator for character types, iterating over codepoints.

    - * Example of use:
    - *
    -    * RangeValueIterator iterator = UCharacter.getTypeIterator();
    -    * while (iterator.next()) {
    -    *     System.out.println("Codepoint \\u" + 
    -    *                        Integer.toHexString(iterator.getStart()) + 
    -    *                        " to codepoint \\u" +
    -    *                        Integer.toHexString(iterator.getLimit() - 1) + 
    -    *                        " has the character type " + 
    -    *                        iterator.getValue());
    -    * }
    -    * 
    - * @return an iterator - * @draft 2.1 - */ - public static RangeValueIterator getTypeIterator() - { - return new UCharacterTypeIterator(); - } - - // protected data members -------------------------------------------- - - /** - * Database storing the sets of character property - */ - protected static final UCharacterProperty PROPERTY_; - - /** - * Initialization of the UCharacterProperty instance. - * RuntimeException thrown when data is missing or data has been corrupted. - */ - static - { - try - { - PROPERTY_ = new UCharacterProperty(); - } - catch (Exception e) - { - throw new RuntimeException(e.getMessage()); - } - } - - /** - * Shift and mask value for surrogates - */ - protected static final int LEAD_SURROGATE_SHIFT_ = 10; - protected static final int TRAIL_SURROGATE_MASK_ = 0x3FF; - - // protected methods ------------------------------------------------- - - /** - * Forms a supplementary code point from the argument character
    - * Note this is for internal use hence no checks for the validity of the - * surrogate characters are done - * @param lead lead surrogate character - * @param trail trailing surrogate character - * @return code point of the supplementary character - */ - protected static int getRawSupplementary(char lead, char trail) - { - return (lead << LEAD_SURROGATE_SHIFT_) + trail + SURROGATE_OFFSET_; - } - - // TODO: Make public API - /** - * returns the maximum amount that a single character will expand in - * upper, lower, title, or fold case operations - */ - static int getMaxCaseExpansion() { - return 10; - } - - // TODO: Make public API? - /** - * produces the result of converting a single (possibly surrogate) - * character in a string. - * @param result - * @return length of returned value IF there is a change. -1 otherwise. - */ - static int toLowerCase(Locale locale, String str, int offset, - char[] result) { - // NOTE: we have to keep the original string around, because it is - // used for the context - - int ch = UTF16.charAt(str, offset); - int props = PROPERTY_.getProperty(ch); - if (!UCharacterProperty.isExceptionIndicator(props)) { - int type = UCharacterProperty.getPropType(props); - if (type == UCharacterCategory.UPPERCASE_LETTER || - type == UCharacterCategory.TITLECASE_LETTER) { - int chDelta = UCharacterProperty.getSignedValue(props); - if (chDelta == 0) return -1; - return UTF16.append(result, 0, ch + chDelta); - } - } else { - int index = UCharacterProperty.getExceptionIndex(props); - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_SPECIAL_CASING_)) { - // TODO: avoid StringBuffer, put directly into array? - StringBuffer buf = new StringBuffer(); - getSpecialLowerCase(ch, index, buf, str, offset, - locale); - Utility.getChars(buf, 0, buf.length(), result, 0); - return buf.length(); - } else if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_LOWERCASE_)) { - return UTF16.append(result, 0, PROPERTY_.getException(index, - UCharacterProperty.EXC_LOWERCASE_)); - } - } - return -1; - } - - // TODO: Make public API? - /** - * produces the result of converting a single (possibly surrogate) - * character in a string. - * @param result - * @return length of returned value IF there is a change. -1 otherwise. - */ - static int toUpperCase(Locale locale, String str, int offset, - char[] result) { - // NOTE: we have to keep the original string around, because it is - // used for the context - - int ch = UTF16.charAt(str, offset); - int props = PROPERTY_.getProperty(ch); - if (!UCharacterProperty.isExceptionIndicator(props)) { - int type = UCharacterProperty.getPropType(props); - if (type == UCharacterCategory.LOWERCASE_LETTER || - type == UCharacterCategory.TITLECASE_LETTER) { - int chDelta = UCharacterProperty.getSignedValue(props); - if (chDelta == 0) return -1; - return UTF16.append(result, 0, ch - chDelta); - } - } else { - int index = UCharacterProperty.getExceptionIndex(props); - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_SPECIAL_CASING_)) { - // TODO: avoid StringBuffer, put directly into array? - StringBuffer buf = new StringBuffer(); - getSpecialUpperCase(ch, index, buf, str, offset, - locale); - Utility.getChars(buf, 0, buf.length(), result, 0); - return buf.length(); - } else if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_UPPERCASE_)) { - return UTF16.append(result, 0, PROPERTY_.getException(index, - UCharacterProperty.EXC_UPPERCASE_)); - } - } - return -1; - } - - // TODO: Make public API? - /** - * produces the result of converting a single (possibly surrogate) - * character in a string. - * @param result - * @return length of returned value IF there is a change. -1 otherwise. - */ - static int toTitleCase(Locale locale, String str, int offset, - char[] result) { - // NOTE: we have to keep the original string around, because it is - // used for the context - // TODO: simplify code by checking for the few special titlecases, - // and just jump to uppercase for the rest. - - int ch = UTF16.charAt(str, offset); - int props = PROPERTY_.getProperty(ch); - if (!UCharacterProperty.isExceptionIndicator(props)) { - int type = UCharacterProperty.getPropType(props); - if (type == UCharacterCategory.LOWERCASE_LETTER) { - // here, titlecase is same as uppercase - int chDelta = UCharacterProperty.getSignedValue(props); - if (chDelta == 0) return -1; - return UTF16.append(result, 0, ch - chDelta); - } - } else { - int index = UCharacterProperty.getExceptionIndex(props); - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_TITLECASE_)) { - return UTF16.append(result, 0, PROPERTY_.getException(index, - UCharacterProperty.EXC_TITLECASE_)); - } else if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_SPECIAL_CASING_)) { - // TODO: avoid StringBuffer, put directly into array? - StringBuffer buf = new StringBuffer(); - getSpecialUpperCase(ch, index, buf, str, offset, - locale); - Utility.getChars(buf, 0, buf.length(), result, 0); - return buf.length(); - } else if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_UPPERCASE_)) { - return UTF16.append(result, 0, PROPERTY_.getException(index, - UCharacterProperty.EXC_UPPERCASE_)); - } - } - return -1; - } - - // private variables ------------------------------------------------- - - /** - * Database storing the sets of character name - */ - private static final UCharacterName NAME_; - - // block to initialise name database and unicode 1.0 data indicator - static - { - try - { - NAME_ = new UCharacterName(); - } - catch (Exception e) - { - throw new RuntimeException(e.getMessage()); - } - } - - /** - * Offset to add to combined surrogate pair to avoid msking. - */ - private static final int SURROGATE_OFFSET_ = - SUPPLEMENTARY_MIN_VALUE - (0xD800 << LEAD_SURROGATE_SHIFT_) - 0xDC00; - - /** - * Surrogate code point values - */ - private static final int SURROGATE_MIN_VALUE_ = 0xD800; - private static final int SURROGATE_MAX_VALUE_ = 0xDFFF; - - /** - * To get the last character out from a data type - */ - private static final int LAST_CHAR_MASK_ = 0xFFFF; - - /** - * To get the last byte out from a data type - */ - private static final int LAST_BYTE_MASK_ = 0xFF; - - /** - * Shift 16 bits - */ - private static final int SHIFT_16_ = 16; - - /** - * Shift 24 bits - */ - private static final int SHIFT_24_ = 24; - - /** - * Minimum suffix value that indicates if a character is non character. - * Unicode 3.0 non characters - */ - private static final int NON_CHARACTER_SUFFIX_MIN_3_0_ = 0xFFFE; - - /** - * New minimum non character in Unicode 3.1 - */ - private static final int NON_CHARACTER_MIN_3_1_ = 0xFDD0; - - /** - * New non character range in Unicode 3.1 - */ - private static final int NON_CHARACTER_RANGE_3_1_ = - 0xFDEF - NON_CHARACTER_MIN_3_1_; - - /** - * Decimal radix - */ - private static final int DECIMAL_RADIX_ = 10; - - /** - * No break space code point - */ - private static final int NO_BREAK_SPACE_ = 0xA0; - - /** - * Narrow no break space code point - */ - private static final int NARROW_NO_BREAK_SPACE_ = 0x202F; - - /** - * Zero width no break space code point - */ - private static final int ZERO_WIDTH_NO_BREAK_SPACE_ = 0xFEFF; - - /** - * Ideographic number zero code point - */ - private static final int IDEOGRAPHIC_NUMBER_ZERO_ = 0x3007; - - /** - * CJK Ideograph, First code point - */ - private static final int CJK_IDEOGRAPH_FIRST_ = 0x4e00; - - /** - * CJK Ideograph, Second code point - */ - private static final int CJK_IDEOGRAPH_SECOND_ = 0x4e8c; - - /** - * CJK Ideograph, Third code point - */ - private static final int CJK_IDEOGRAPH_THIRD_ = 0x4e09; - - /** - * CJK Ideograph, Fourth code point - */ - private static final int CJK_IDEOGRAPH_FOURTH_ = 0x56d8; - - /** - * CJK Ideograph, FIFTH code point - */ - private static final int CJK_IDEOGRAPH_FIFTH_ = 0x4e94; - - /** - * CJK Ideograph, Sixth code point - */ - private static final int CJK_IDEOGRAPH_SIXTH_ = 0x516d; - - /** - * CJK Ideograph, Seventh code point - */ - private static final int CJK_IDEOGRAPH_SEVENTH_ = 0x4e03; - - /** - * CJK Ideograph, Eighth code point - */ - private static final int CJK_IDEOGRAPH_EIGHTH_ = 0x516b; - - /** - * CJK Ideograph, Nineth code point - */ - private static final int CJK_IDEOGRAPH_NINETH_ = 0x4e5d; - - /** - * Application Program command code point - */ - private static final int APPLICATION_PROGRAM_COMMAND_ = 0x009F; - - /** - * Unit seperator code point - */ - private static final int UNIT_SEPERATOR_ = 0x001F; - - /** - * Delete code point - */ - private static final int DELETE_ = 0x007F; - - /** - * Turkish ISO 639 2 character code - */ - private static final String TURKISH_ = "tr"; - - /** - * Azerbaijani ISO 639 2 character code - */ - private static final String AZERBAIJANI_ = "az"; - - /** - * Lithuanian ISO 639 2 character code - */ - private static final String LITHUANIAN_ = "lt"; - - /** - * Latin owercase i - */ - private static final char LATIN_SMALL_LETTER_I_ = 0x69; - - /** - * Latin uppercase I - */ - private static final char LATIN_CAPITAL_LETTER_I_ = 0x49; - - /** - * Latin capital letter i with dot above - */ - private static final char LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE_ = 0x130; - - /** - * Latin small letter i with dot above - */ - private static final char LATIN_SMALL_LETTER_DOTLESS_I_ = 0x131; - - /** - * Combining dot above - */ - private static final char COMBINING_DOT_ABOVE_ = 0x307; - - /** - * Greek capital letter sigma - */ - private static final char GREEK_CAPITAL_LETTER_SIGMA_ = 0x3a3; - - /** - * Greek small letter sigma - */ - private static final char GREEK_SMALL_LETTER_SIGMA_ = 0x3c3; - - /** - * Greek small letter rho - */ - private static final char GREEK_SMALL_LETTER_RHO_ = 0x3c2; - - /** - * ISO control character first range upper limit 0x0 - 0x1F - */ - private static final int ISO_CONTROL_FIRST_RANGE_MAX_ = 0x1F; - - /** - * Han digit characters - */ - private static final int CJK_IDEOGRAPH_COMPLEX_ZERO_ = 0x96f6; - private static final int CJK_IDEOGRAPH_COMPLEX_ONE_ = 0x58f9; - private static final int CJK_IDEOGRAPH_COMPLEX_TWO_ = 0x8cb3; - private static final int CJK_IDEOGRAPH_COMPLEX_THREE_ = 0x53c3; - private static final int CJK_IDEOGRAPH_COMPLEX_FOUR_ = 0x8086; - private static final int CJK_IDEOGRAPH_COMPLEX_FIVE_ = 0x4f0d; - private static final int CJK_IDEOGRAPH_COMPLEX_SIX_ = 0x9678; - private static final int CJK_IDEOGRAPH_COMPLEX_SEVEN_ = 0x67d2; - private static final int CJK_IDEOGRAPH_COMPLEX_EIGHT_ = 0x634c; - private static final int CJK_IDEOGRAPH_COMPLEX_NINE_ = 0x7396; - private static final int CJK_IDEOGRAPH_TEN_ = 0x5341; - private static final int CJK_IDEOGRAPH_COMPLEX_TEN_ = 0x62fe; - private static final int CJK_IDEOGRAPH_HUNDRED_ = 0x767e; - private static final int CJK_IDEOGRAPH_COMPLEX_HUNDRED_ = 0x4f70; - private static final int CJK_IDEOGRAPH_THOUSAND_ = 0x5343; - private static final int CJK_IDEOGRAPH_COMPLEX_THOUSAND_ = 0x4edf; - private static final int CJK_IDEOGRAPH_TEN_THOUSAND_ = 0x824c; - private static final int CJK_IDEOGRAPH_HUNDRED_MILLION_ = 0x5104; - - /** - * Hyphens - */ - private static final int HYPHEN_ = 0x2010; - private static final int SOFT_HYPHEN_ = 0xAD; - - /** - * LATIN SMALL LETTER J - */ - private static final int LATIN_SMALL_LETTER_J_ = 0x6a; - - /** - * LATIN SMALL LETTER I WITH OGONEK - */ - private static final int LATIN_SMALL_LETTER_I_WITH_OGONEK_ = 0x12f; - - /** - * LATIN SMALL LETTER I WITH TILDE BELOW - */ - private static final int LATIN_SMALL_LETTER_I_WITH_TILDE_BELOW_ = 0x1e2d; - - /** - * LATIN SMALL LETTER I WITH DOT BELOW - */ - private static final int LATIN_SMALL_LETTER_I_WITH_DOT_BELOW_ = 0x1ecb; - - /** - * Combining class for combining mark above - */ - private static final int COMBINING_MARK_ABOVE_CLASS_ = 230; - - /** - * LATIN CAPITAL LETTER J - */ - private static final int LATIN_CAPITAL_LETTER_J_ = 0x4a; - - /** - * LATIN CAPITAL LETTER I WITH OGONEK - */ - private static final int LATIN_CAPITAL_I_WITH_OGONEK_ = 0x12e; - - /** - * LATIN CAPITAL LETTER I WITH TILDE - */ - private static final int LATIN_CAPITAL_I_WITH_TILDE_ = 0x128; - - /** - * LATIN CAPITAL LETTER I WITH GRAVE - */ - private static final int LATIN_CAPITAL_I_WITH_GRAVE_ = 0xcc; - - /** - * LATIN CAPITAL LETTER I WITH ACUTE - */ - private static final int LATIN_CAPITAL_I_WITH_ACUTE_ = 0xcd; - - /** - * COMBINING GRAVE ACCENT - */ - private static final int COMBINING_GRAVE_ACCENT_ = 0x300; - - /** - * COMBINING ACUTE ACCENT - */ - private static final int COMBINING_ACUTE_ACCENT_ = 0x301; - - /** - * COMBINING TILDE - */ - private static final int COMBINING_TILDE_ = 0x303; - - // private constructor ----------------------------------------------- - - /** - * Private constructor to prevent instantiation - */ - private UCharacter() - { - } - - // private methods --------------------------------------------------- - - /** - * Gets the correct property information from UCharacterProperty - * @param ch character whose information is to be retrieved - * @return a 32 bit information, returns 0 if no data is found. - */ - private static int getProps(int ch) - { - if (ch >= UCharacter.MIN_VALUE & ch <= UCharacter.MAX_VALUE) { - return PROPERTY_.getProperty(ch); - } - return 0; - } - - /** - * Getting the locales used for case mapping - * @param locale to work with - * @return locale which the actual case mapping works with - */ - private static Locale getCaseLocale(Locale locale) - { - String language = locale.getLanguage(); - - // the locale can have no language - if (language.length() != 2) { - return locale; - } - - if (language.equals(TURKISH_) || language.equals(AZERBAIJANI_)) { - return new Locale("tr", "TR"); - } - if (language.equals(LITHUANIAN_)) { - return new Locale("lt", "LT"); - } - return locale; - } - - /** - * In Unicode 3.1.1, an ignorable sequence is a sequence of *zero* or more - * characters from the set {HYPHEN, SOFT HYPHEN, general category = Mn}. - * (Expected to change!) - * @param ch codepoint - * @param cat category of the argument codepoint - * @return true if ch is case ignorable. - */ - private static boolean isIgnorable(int ch, int cat) - { - return cat == UCharacterCategory.NON_SPACING_MARK || ch == HYPHEN_ || - ch == SOFT_HYPHEN_; - } - - /** - * Determines if offset is not followed by a sequence consisting of - * an ignorable sequence and then a cased letter {Ll, Lu, Lt}. - * @param str string to determine - * @param offset offset in string to check - * @return false if any character after index in src is a cased letter - * @see SpecialCasing.txt - */ - private static boolean isCFINAL(String str, int offset) - { - int length = str.length(); - offset += UTF16.getCharCount(UTF16.charAt(str, offset)); - while (offset < length) { - int ch = UTF16.charAt(str, offset); - int cat = getType(ch); - if (cat == UCharacterCategory.LOWERCASE_LETTER || - cat == UCharacterCategory.UPPERCASE_LETTER || - cat == UCharacterCategory.TITLECASE_LETTER) { - return false; // followed by cased letter - } - if (!isIgnorable(ch, cat)) { - return true; // not ignorable - } - offset += UTF16.getCharCount(ch); - } - - return true; - } - - /** - * Determines if offset is not preceded by a sequence consisting of a cased - * letter {Ll, Lu, Lt} and an ignorable sequence. - * @param str string to determine - * @param offset offset in string to check - * @return true if any character before index in src is a cased letter - * @see SpecialCasing.txt - */ - private static boolean isNotCINITIAL(String str, int offset) - { - offset --; - while (offset >= 0) { - int ch = UTF16.charAt(str, offset); - int cat = getType(ch); - if (cat == UCharacterCategory.LOWERCASE_LETTER || - cat == UCharacterCategory.UPPERCASE_LETTER || - cat == UCharacterCategory.TITLECASE_LETTER) { - return true; // preceded by cased letter - } - if (!isIgnorable(ch, cat)) { - return false; // not ignorable - } - offset -= UTF16.getCharCount(ch); - } - - return false; - } - - /** - * Determines if a string at offset is preceded by any base characters - * { 'i', 'j', U+012f, U+1e2d, U+1ecb } with no intervening character with - * combining class = 230 - * @param str string to be determined - * @param offset offset in string to check - * @return true if some characters preceding the offset index belongs to - * the set { 'i', 'j', U+012f, U+1e2d, U+1ecb } - * @see SpecialCasing.txt - */ - private static boolean isAFTER_i(String str, int offset) - { - offset --; - while (offset >= 0) { - int ch = UTF16.charAt(str, offset); - if (ch == LATIN_SMALL_LETTER_I_ || ch == LATIN_SMALL_LETTER_J_ || - ch == LATIN_SMALL_LETTER_I_WITH_OGONEK_ || - ch == LATIN_SMALL_LETTER_I_WITH_TILDE_BELOW_ || - ch == LATIN_SMALL_LETTER_I_WITH_DOT_BELOW_) { - return true; // preceded by TYPE_i - } - - int cc = getCombiningClass(ch); - if (cc == 0 || cc == COMBINING_MARK_ABOVE_CLASS_) { - // preceded by different base character not TYPE_i), or - // intervening cc == 230 - return false; - } - offset -= UTF16.getCharCount(ch); - } - - return false; // not preceded by TYPE_i - } - - /** - * Determines if a string at offset is preceded by base characters 'I' with - * no intervening combining class = 230 - * @param str string to be determined - * @param offset offset in string to check - * @return true if some characters preceding the offset index is the - * character 'I' with no intervening combining class = 230 - * @see SpecialCasing.txt - */ - private static boolean isAFTER_I(String str, int offset) - { - offset --; - while (offset >= 0) { - int ch = UTF16.charAt(str, offset); - if (ch == LATIN_CAPITAL_LETTER_I_) { - return true; // preceded by I - } - - int cc = getCombiningClass(ch); - if (cc == 0 || cc == COMBINING_MARK_ABOVE_CLASS_) { - // preceded by different base character (not I), or - // intervening cc == 230 - return false; - } - offset -= UTF16.getCharCount(ch); - } - - return false; // not preceded by I - } - - /** - * Determines if a string at offset is followed by one or more characters - * of combining class = 230. - * @param str string to be determined - * @param offset offset in string to check - * @return true if a string at offset is followed by one or more characters - * of combining class = 230. - * @see SpecialCasing.txt - */ - private static boolean isFollowedByMOREABOVE(String str, int offset) - { - int length = str.length(); - offset += UTF16.getCharCount(UTF16.charAt(str, 0)); - while (offset < length) { - int ch = UTF16.charAt(str, offset); - int cc = getCombiningClass(ch); - if (cc == COMBINING_MARK_ABOVE_CLASS_) { - return true; // at least one cc==230 following - } - if (cc == 0) { - return false; // next base character, no more cc==230 following - } - offset += UTF16.getCharCount(ch); - } - - return false; // no more cc == 230 following - } - - /** - * Determines if a string at offset is followed by a dot above - * with no characters of combining class == 230 in between - * @param str string to be determined - * @param offset offset in string to check - * @return true if a string at offset is followed by oa dot above - * with no characters of combining class == 230 in between - * @see SpecialCasing.txt - */ - private static boolean isFollowedByDotAbove(String str, int offset) - { - int length = str.length(); - offset += UTF16.getCharCount(UTF16.charAt(str, 0)); - while (offset < length) { - int ch = UTF16.charAt(str, offset); - if (ch == COMBINING_DOT_ABOVE_) { - return true; - } - int cc = getCombiningClass(ch); - if (cc == 0 || cc == COMBINING_MARK_ABOVE_CLASS_) { - return false; // next base character or cc==230 in between - } - offset += UTF16.getCharCount(ch); - } - - return false; // no dot above following - } - - /** - * Special casing uppercase management - * @param ch code point to convert - * @param index of exception containing special case information - * @param buffer to add uppercase - * @param str original string - * @param offset index of ch in str - * @param tr_az if uppercase is to be made with TURKISH or AZERBAIJANI - * in mind - * @param lt if uppercase is to be made with LITHUANIAN in mind - */ - private static void getSpecialUpperCase(int ch, int index, - StringBuffer buffer, String str, - int offset, Locale locale) - { - int exception = PROPERTY_.getException(index, - UCharacterProperty.EXC_SPECIAL_CASING_); - if (exception < 0) { - String language = locale.getLanguage(); - // use hardcoded conditions and mappings - if ((language.equals(TURKISH_) || language.equals(AZERBAIJANI_)) - && ch == LATIN_SMALL_LETTER_I_) { - // turkish: i maps to dotted I - buffer.append(LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE_); - } - else { - if (language.equals(LITHUANIAN_) && ch == COMBINING_DOT_ABOVE_ - && isAFTER_i(str, offset)) { - // lithuanian: remove DOT ABOVE after U+0069 "i" with - // upper or titlecase - return; // remove the dot (continue without output) - } - else { - // no known conditional special case mapping, use a normal - // mapping - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_UPPERCASE_)) { - UTF16.append(buffer, PROPERTY_.getException(index, - UCharacterProperty.EXC_UPPERCASE_)); - } - else { - UTF16.append(buffer, ch); - } - } - } - } - else { - // get the special case mapping string from the data file - index = exception & LAST_CHAR_MASK_; - PROPERTY_.getUpperCase(index, buffer); - } - } - - /** - * Special casing lowercase management - * @param ch code point to convert - * @param index of exception containing special case information - * @param buffer to add lowercase - * @param str original string - * @param offset index of ch in str - * @param locale current locale - */ - private static void getSpecialLowerCase(int ch, int index, - StringBuffer buffer, String str, - int offset, Locale locale) - { - int exception = PROPERTY_.getException(index, - UCharacterProperty.EXC_SPECIAL_CASING_); - if (exception < 0) { - // fill u and i with the case mapping result string - // use hardcoded conditions and mappings - if (locale.getLanguage().equals(LITHUANIAN_) && - // base characters, find accents above - (((ch == LATIN_CAPITAL_LETTER_I_ || - ch == LATIN_CAPITAL_LETTER_J_ || - ch == LATIN_CAPITAL_I_WITH_OGONEK_) && - isFollowedByMOREABOVE(str, offset)) || - // precomposed with accent above, no need to find one - (ch == LATIN_CAPITAL_I_WITH_GRAVE_ || - ch == LATIN_CAPITAL_I_WITH_ACUTE_ || - ch == LATIN_CAPITAL_I_WITH_TILDE_))) { - // lithuanian: add a dot above if there are more accents - // above (to always have the dot) - switch(ch) { - case LATIN_CAPITAL_LETTER_I_: - buffer.append((char)LATIN_SMALL_LETTER_I_); - buffer.append((char)COMBINING_DOT_ABOVE_); - break; - case LATIN_CAPITAL_LETTER_J_: - buffer.append((char)LATIN_SMALL_LETTER_J_); - buffer.append((char)COMBINING_DOT_ABOVE_); - break; - case LATIN_CAPITAL_I_WITH_OGONEK_: - buffer.append((char)LATIN_SMALL_LETTER_I_WITH_OGONEK_); - buffer.append((char)COMBINING_DOT_ABOVE_); - break; - case LATIN_CAPITAL_I_WITH_GRAVE_: - buffer.append((char)LATIN_SMALL_LETTER_I_); - buffer.append((char)COMBINING_DOT_ABOVE_); - buffer.append((char)COMBINING_GRAVE_ACCENT_); - break; - case LATIN_CAPITAL_I_WITH_ACUTE_: - buffer.append((char)LATIN_SMALL_LETTER_I_); - buffer.append((char)COMBINING_DOT_ABOVE_); - buffer.append((char)COMBINING_ACUTE_ACCENT_); - break; - case LATIN_CAPITAL_I_WITH_TILDE_: - buffer.append((char)LATIN_SMALL_LETTER_I_); - buffer.append((char)COMBINING_DOT_ABOVE_); - buffer.append((char)COMBINING_TILDE_); - break; - } - /* - Note: This handling of I and of dot above differs from - Unicode 3.1.1's SpecialCasing-5.txt because the AFTER_i - condition there does not work for decomposed I+dot above. - This fix is being proposed to the UTC. - */ - } - else { - String language = locale.getLanguage(); - if ((language.equals(TURKISH_) || - language.equals(AZERBAIJANI_)) && - ch == LATIN_CAPITAL_LETTER_I_ && - !isFollowedByDotAbove(str, offset)) { - // turkish: I maps to dotless i - // other languages or turkish with decomposed I+dot above: - // I maps to i - buffer.append(LATIN_SMALL_LETTER_DOTLESS_I_); - } - else { - if (ch == COMBINING_DOT_ABOVE_ && - isAFTER_I(str, offset) && - !isFollowedByMOREABOVE(str, offset)) { - // decomposed I+dot above becomes i (see handling of - // U+0049 for turkish) and removes the dot above - return; // remove the dot (continue without output) - } - else { - if (ch == GREEK_CAPITAL_LETTER_SIGMA_ && - isCFINAL(str, offset) && - isNotCINITIAL(str, offset)) { - // greek capital sigma maps depending on - // surrounding cased letters - buffer.append(GREEK_SMALL_LETTER_RHO_); - } - else { - // no known conditional special case mapping, use - // a normal mapping - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_LOWERCASE_)) { - UTF16.append(buffer, - PROPERTY_.getException(index, - UCharacterProperty.EXC_LOWERCASE_)); - } - else { - UTF16.append(buffer, ch); - } - } - } - } - } - } - else { - // get the special case mapping string from the data file - index = exception & LAST_CHAR_MASK_; - PROPERTY_.getLowerCase(index, buffer); - } - } - - /** - * Determines if codepoint is a non character - * @param ch codepoint - * @return true if codepoint is a non character false otherwise - */ - private static boolean isNonCharacter(int ch) - { - if ((ch & LAST_CHAR_MASK_) >= NON_CHARACTER_SUFFIX_MIN_3_0_) { - return true; - } - - int difference = ch - NON_CHARACTER_MIN_3_1_; - return difference >= 0 && difference <= NON_CHARACTER_RANGE_3_1_; - } - - private static boolean isEuropeanDigit(int ch) { - return (ch <= 0x7a && ((ch >= 0x41 && ch <= 0x5a) || ch >= 0x61)) || - (ch >= 0xff21 && (ch <= 0xff3a || (ch >= 0xff41 && ch <= 0xff5a))); - } - - private static int getEuropeanDigit(int ch) { - if (ch <= 0x7a) { - if (ch >= 0x41 && ch <= 0x5a) { - return ch + 10 - 0x41; - } else if (ch >= 0x61) { - return ch + 10 - 0x61; - } - } else if (ch >= 0xff21) { - if (ch <= 0xff3a) { - return ch + 10 - 0xff21; - } else if (ch >= 0xff41 && ch <= 0xff5a) { - return ch + 10 - 0xff41; - } - } - return -1; - } - - private static int getNumericValueInternal(int ch, boolean useEuropean) - { - int props = getProps(ch); - int type = UCharacterProperty.getPropType(props); - - // if props == 0, it will just fall through and return -1 - if (type != UCharacterCategory.DECIMAL_DIGIT_NUMBER && - type != UCharacterCategory.LETTER_NUMBER && - type != UCharacterCategory.OTHER_NUMBER) { - - return useEuropean ? getEuropeanDigit(ch) : -1; - } - - int result = -1; - if (!UCharacterProperty.isExceptionIndicator(props)) { - // not contained in exception data - result = UCharacterProperty.getSignedValue(props); - } - else { - // contained in exception data - int index = UCharacterProperty.getExceptionIndex(props); - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_DIGIT_VALUE_)) { - result = PROPERTY_.getException(index, - UCharacterProperty.EXC_DIGIT_VALUE_) & - LAST_CHAR_MASK_; - } - else { - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_DENOMINATOR_VALUE_)) { - return -2; - } - if (PROPERTY_.hasExceptionValue(index, - UCharacterProperty.EXC_NUMERIC_VALUE_)) { - result = PROPERTY_.getException(index, - UCharacterProperty.EXC_NUMERIC_VALUE_); - } - } - } - - return result; - } -} - diff --git a/icu4j/src/com/ibm/text/UCharacterCategory.java b/icu4j/src/com/ibm/text/UCharacterCategory.java deleted file mode 100755 index 66196edfe1..0000000000 --- a/icu4j/src/com/ibm/text/UCharacterCategory.java +++ /dev/null @@ -1,309 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: -* /usr/cvs/icu4j/icu4j/src/com/ibm/icu/text/UCharacterCategory.java $ -* $Date: 2002/02/15 02:53:35 $ -* $Revision: 1.4 $ -* -******************************************************************************* -*/ - -package com.ibm.text; - -/** -* Enumerated Unicode category types from the UnicodeData.txt file. -* Used as return results from UCharacter -* Equivalent to icu's UCharCategory. -* Refer to -* Unicode Consortium for more information about UnicodeData.txt. -* @author Syn Wee Quek -* @since oct0300 -*/ - -public class UCharacterCategory -{ - // public variable ----------------------------------------------------- - - /** - * Unassigned character type - */ - public static final int UNASSIGNED = 0; - /** - * Character type Cn - * Not Assigned (no characters in [UnicodeData.txt] have this property) - * @draft 2.1 - */ - public static final int GENERAL_OTHER_TYPES = 0; - /** - * Character type Lu - */ - public static final int UPPERCASE_LETTER = 1; - /** - * Character type Ll - */ - public static final int LOWERCASE_LETTER = 2; - /** - * Character type Lt - */ - public static final int TITLECASE_LETTER = 3; - /** - * Character type Lm - */ - public static final int MODIFIER_LETTER = 4; - /** - * Character type Lo - */ - public static final int OTHER_LETTER = 5; - /** - * Character type Mn - */ - public static final int NON_SPACING_MARK = 6; - /** - * Character type Me - */ - public static final int ENCLOSING_MARK = 7; - /** - * Character type Mc - */ - public static final int COMBINING_SPACING_MARK = 8; - /** - * Character type Nd - */ - public static final int DECIMAL_DIGIT_NUMBER = 9; - /** - * Character type Nl - */ - public static final int LETTER_NUMBER = 10; - - // start of 11------------ - - /** - * Character type No - */ - public static final int OTHER_NUMBER = 11; - /** - * Character type Zs - */ - public static final int SPACE_SEPARATOR = 12; - /** - * Character type Zl - */ - public static final int LINE_SEPARATOR = 13; - /** - * Character type Zp - */ - public static final int PARAGRAPH_SEPARATOR = 14; - /** - * Character type Cc - */ - public static final int CONTROL = 15; - /** - * Character type Cf - */ - public static final int FORMAT = 16; - /** - * Character type Co - */ - public static final int PRIVATE_USE = 17; - /** - * Character type Cs - */ - public static final int SURROGATE = 18; - /** - * Character type Pd - */ - public static final int DASH_PUNCTUATION = 19; - /** - * Character type Ps - */ - public static final int START_PUNCTUATION = 20; - - // start of 21 ------------ - - /** - * Character type Pe - */ - public static final int END_PUNCTUATION = 21; - /** - * Character type Pc - */ - public static final int CONNECTOR_PUNCTUATION = 22; - /** - * Character type Po - */ - public static final int OTHER_PUNCTUATION = 23; - /** - * Character type Sm - */ - public static final int MATH_SYMBOL = 24; - /** - * Character type Sc - */ - public static final int CURRENCY_SYMBOL = 25; - /** - * Character type Sk - */ - public static final int MODIFIER_SYMBOL = 26; - /** - * Character type So - */ - public static final int OTHER_SYMBOL = 27; - /** - * Character type Pi - */ - public static final int INITIAL_PUNCTUATION = 28; - /** - * Character type Pf - */ - public static final int FINAL_PUNCTUATION = 29; - - // start of 31 ------------ - - /** - * Character type count - */ - public static final int CHAR_CATEGORY_COUNT = 30; - - /** - * Gets the name of the argument category - * @param category to retrieve name - * @return category name - */ - public static String toString(int category) - { - switch (category) - { - case UPPERCASE_LETTER : - return "Letter, Uppercase"; - case LOWERCASE_LETTER : - return "Letter, Lowercase"; - case TITLECASE_LETTER : - return "Letter, Titlecase"; - case MODIFIER_LETTER : - return "Letter, Modifier"; - case OTHER_LETTER : - return "Letter, Other"; - case NON_SPACING_MARK : - return "Mark, Non-Spacing"; - case ENCLOSING_MARK : - return "Mark, Enclosing"; - case COMBINING_SPACING_MARK : - return "Mark, Spacing Combining"; - case DECIMAL_DIGIT_NUMBER : - return "Number, Decimal Digit"; - case LETTER_NUMBER : - return "Number, Letter"; - case OTHER_NUMBER : - return "Number, Other"; - case SPACE_SEPARATOR : - return "Separator, Space"; - case LINE_SEPARATOR : - return "Separator, Line"; - case PARAGRAPH_SEPARATOR : - return "Separator, Paragraph"; - case CONTROL : - return "Other, Control"; - case FORMAT : - return "Other, Format"; - case PRIVATE_USE : - return "Other, Private Use"; - case SURROGATE : - return "Other, Surrogate"; - case DASH_PUNCTUATION : - return "Punctuation, Dash"; - case START_PUNCTUATION : - return "Punctuation, Open"; - case END_PUNCTUATION : - return "Punctuation, Close"; - case CONNECTOR_PUNCTUATION : - return "Punctuation, Connector"; - case OTHER_PUNCTUATION : - return "Punctuation, Other"; - case MATH_SYMBOL : - return "Symbol, Math"; - case CURRENCY_SYMBOL : - return "Symbol, Currency"; - case MODIFIER_SYMBOL : - return "Symbol, Modifier"; - case OTHER_SYMBOL : - return "Symbol, Other"; - case INITIAL_PUNCTUATION : - return "Punctuation, Initial quote "; - case FINAL_PUNCTUATION : - return "Punctuation, Final quote "; - } - return "Unassigned"; - } - - // private constructor ----------------------------------------------- - - /** - * Private constructor to prevent initialisation - */ - private UCharacterCategory() - { - } - - // package private data members -------------------------------------- - - /** - * Not a character type - */ - static final int NON_CHARACTER_ = CHAR_CATEGORY_COUNT; - /** - * Lead surrogate type - */ - static final int LEAD_SURROGATE_ = CHAR_CATEGORY_COUNT + 1; - /** - * Trail surrogate type - */ - static final int TRAIL_SURROGATE_ = CHAR_CATEGORY_COUNT + 2; - /** - * Extended category count - */ - static final int EXTENDED_CATEGORY_ = CHAR_CATEGORY_COUNT + 3; - /** - * Type names used for extended names - */ - static final String TYPE_NAMES_[] = {"unassigned", - "uppercase letter", - "lowercase letter", - "titlecase letter", - "modifier letter", - "other letter", - "non spacing mark", - "enclosing mark", - "combining spacing mark", - "decimal digit number", - "letter number", - "other number", - "space separator", - "line separator", - "paragraph separator", - "control", - "format", - "private use area", - "surrogate", - "dash punctuation", - "start punctuation", - "end punctuation", - "connector punctuation", - "other punctuation", - "math symbol", - "currency symbol", - "modifier symbol", - "other symbol", - "initial punctuation", - "final punctuation", - "noncharacter", - "lead surrogate", - "trail surrogate"}; - /** - * Unknown type name - */ - static final String UNKNOWN_TYPE_NAME_ = "unknown"; -} diff --git a/icu4j/src/com/ibm/text/UCharacterDirection.java b/icu4j/src/com/ibm/text/UCharacterDirection.java deleted file mode 100755 index 91b6b1a707..0000000000 --- a/icu4j/src/com/ibm/text/UCharacterDirection.java +++ /dev/null @@ -1,171 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: -* /usr/cvs/icu4j/icu4j/src/com/ibm/icu/text/UCharacterDirection.java $ -* $Date: 2001/03/23 19:51:38 $ -* $Revision: 1.2 $ -* -******************************************************************************* -*/ - -package com.ibm.text; - -/** -* Enumerated Unicode character linguistic direction constants. -* Used as return results from UCharacter -* @author Syn Wee Quek -* @since oct0300 -*/ - -public final class UCharacterDirection -{ - // private constructor ========================================= - - /** - * Private constructor to prevent initialisation - */ - private UCharacterDirection() - { - } - - // public variable ============================================= - - /** - * Directional type L - */ - public static final int LEFT_TO_RIGHT = 0; - /** - * Directional type R - */ - public static final int RIGHT_TO_LEFT = 1; - /** - * Directional type EN - */ - public static final int EUROPEAN_NUMBER = 2; - /** - * Directional type ES - */ - public static final int EUROPEAN_NUMBER_SEPARATOR = 3; - /** - * Directional type ET - */ - public static final int EUROPEAN_NUMBER_TERMINATOR = 4; - /** - * Directional type AN - */ - public static final int ARABIC_NUMBER = 5; - /** - * Directional type CS - */ - public static final int COMMON_NUMBER_SEPARATOR = 6; - /** - * Directional type B - */ - public static final int BLOCK_SEPARATOR = 7; - /** - * Directional type S - */ - public static final int SEGMENT_SEPARATOR = 8; - /** - * Directional type WS - */ - public static final int WHITE_SPACE_NEUTRAL = 9; - - // start of 11 --------------- - - /** - * Directional type ON - */ - public static final int OTHER_NEUTRAL = 10; - /** - * Directional type LRE - */ - public static final int LEFT_TO_RIGHT_EMBEDDING = 11; - /** - * Directional type LRO - */ - public static final int LEFT_TO_RIGHT_OVERRIDE = 12; - /** - * Directional type AL - */ - public static final int RIGHT_TO_LEFT_ARABIC = 13; - /** - * Directional type RLE - */ - public static final int RIGHT_TO_LEFT_EMBEDDING = 14; - /** - * Directional type RLO - */ - public static final int RIGHT_TO_LEFT_OVERRIDE = 15; - /** - * Directional type PDF - */ - public static final int POP_DIRECTIONAL_FORMAT = 16; - /** - * Directional type NSM - */ - public static final int DIR_NON_SPACING_MARK = 17; - /** - * Directional type BN - */ - public static final int BOUNDARY_NEUTRAL = 18; - /** - * Number of directional type - */ - public static final int CHAR_DIRECTION_COUNT = 19; - - /** - * Gets the name of the argument direction - * @param dir direction type to retrieve name - * @return directional name - */ - public static String toString(int dir) - { - switch(dir) - { - case LEFT_TO_RIGHT : - return "Left-to-Right"; - case RIGHT_TO_LEFT : - return "Right-to-Left"; - case EUROPEAN_NUMBER : - return "European Number"; - case EUROPEAN_NUMBER_SEPARATOR : - return "European Number Separator"; - case EUROPEAN_NUMBER_TERMINATOR : - return "European Number Terminator"; - case ARABIC_NUMBER : - return "Arabic Number"; - case COMMON_NUMBER_SEPARATOR : - return "Common Number Separator"; - case BLOCK_SEPARATOR : - return "Paragraph Separator"; - case SEGMENT_SEPARATOR : - return "Segment Separator"; - case WHITE_SPACE_NEUTRAL : - return "Whitespace"; - case OTHER_NEUTRAL : - return "Other Neutrals"; - case LEFT_TO_RIGHT_EMBEDDING : - return "Left-to-Right Embedding"; - case LEFT_TO_RIGHT_OVERRIDE : - return "Left-to-Right Override"; - case RIGHT_TO_LEFT_ARABIC : - return "Right-to-Left Arabic"; - case RIGHT_TO_LEFT_EMBEDDING : - return "Right-to-Left Embedding"; - case RIGHT_TO_LEFT_OVERRIDE : - return "Right-to-Left Override"; - case POP_DIRECTIONAL_FORMAT : - return "Pop Directional Format"; - case DIR_NON_SPACING_MARK : - return "Non-Spacing Mark"; - case BOUNDARY_NEUTRAL : - return "Boundary Neutral"; - } - return "Unassigned"; - } -} diff --git a/icu4j/src/com/ibm/text/UCharacterName.java b/icu4j/src/com/ibm/text/UCharacterName.java deleted file mode 100755 index aaa9854f99..0000000000 --- a/icu4j/src/com/ibm/text/UCharacterName.java +++ /dev/null @@ -1,1085 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: -* /usr/cvs/icu4j/icu4j/src/com/ibm/icu/text/UCharacterName.java $ -* $Date: 2002/02/15 02:53:34 $ -* $Revision: 1.7 $ -* -******************************************************************************* -*/ -package com.ibm.text; - -import java.util.Locale; -import java.io.InputStream; -import java.io.DataInputStream; -import java.io.BufferedInputStream; -import java.io.IOException; -import com.ibm.util.Utility; - -/** -* Internal class to manage character names. -* Since data in UCharacterNameDB is stored -* in an array of char, by default indexes used in this class is refering to -* a 2 byte count, unless otherwise stated. Cases where the index is refering -* to a byte count, the index is halved and depending on whether the index is -* even or odd, the MSB or LSB of the result char at the halved index is -* returned. For indexes to an array of int, the index is multiplied by 2, -* result char at the multiplied index and its following char is returned as an -* int. -* UCharacter acts as a public facade for this class -* Note : 0 - 0x1F are control characters without names in Unicode 3.0 -* Information on parsing of the binary data is located at -* -* ReadMe -* @author Syn Wee Quek -* @since nov0700 -*/ - -final class UCharacterName -{ - // public methods ---------------------------------------------------- - - /** - * toString method for printing - */ - public String toString() - { - StringBuffer result = new StringBuffer("names content \n"); - /*result.append(super.toString()); - result.append('\n'); - result.append("token string offset "); - result.append(m_tokenstringoffset_); - result.append("\n"); - result.append("group offset "); - result.append(m_groupsoffset_); - result.append("\n"); - result.append("group string offset "); - result.append(m_groupstringoffset_); - result.append("\n"); - result.append("alg names offset "); - result.append(m_algnamesoffset_); - result.append("\n"); - */ - return result.toString(); - } - - // package protected inner class ------------------------------------- - - /** - * Algorithmic name class - */ - static final class AlgorithmName - { - // protected data members ---------------------------------------- - - /** - * Constant type value of the different AlgorithmName - */ - protected static final int TYPE_0_ = 0; - protected static final int TYPE_1_ = 1; - - // protected constructors ---------------------------------------- - - /** - * Constructor - */ - protected AlgorithmName() - { - } - - // protected methods --------------------------------------------- - - /** - * Sets the information for accessing the algorithmic names - * @param rangestart starting code point that lies within this name group - * @param rangeend end code point that lies within this name group - * @param type algorithm type. There's 2 kinds of algorithmic type. First - * which uses code point as part of its name and the other uses - * variant postfix strings - * @param variant algorithmic variant - * @return true if values are valid - */ - protected boolean setInfo(int rangestart, int rangeend, byte type, - byte variant) - { - if (rangestart >= UCharacter.MIN_VALUE && rangestart <= rangeend - && rangeend <= UCharacter.MAX_VALUE && - (type == TYPE_0_ || type == TYPE_1_)) { - m_rangestart_ = rangestart; - m_rangeend_ = rangeend; - m_type_ = type; - m_variant_ = variant; - return true; - } - return false; - } - - /** - * Sets the factor data - * @param array of factor - * @return true if factors are valid - */ - protected boolean setFactor(char factor[]) - { - if (factor.length == m_variant_) { - m_factor_ = factor; - return true; - } - return false; - } - - /** - * Sets the name prefix - * @param prefix - * @return true if prefix is set - */ - protected boolean setPrefix(String prefix) - { - if (prefix != null && prefix.length() > 0) { - m_prefix_ = prefix; - return true; - } - return false; - } - - /** - * Sets the variant factorized name data - * @param string variant factorized name data - * @return true if values are set - */ - protected boolean setFactorString(byte string[]) - { - // factor and variant string can be empty for things like - // hanggul code points - m_factorstring_ = string; - return true; - } - - /** - * Checks if code point lies in Algorithm object at index - * @param ch code point - */ - protected boolean contains(int ch) - { - return m_rangestart_ <= ch && ch <= m_rangeend_; - } - - /** - * Appends algorithm name of code point into StringBuffer. - * Note this method does not check for validity of code point in Algorithm, - * result is undefined if code point does not belong in Algorithm. - * @param ch code point - * @param str StringBuffer to append to - */ - protected void appendName(int ch, StringBuffer str) - { - str.append(m_prefix_); - switch (m_type_) - { - case TYPE_0_: - // prefix followed by hex digits indicating variants - Utility.hex(ch, m_variant_, str); - break; - case TYPE_1_: - // prefix followed by factorized-elements - int offset = ch - m_rangestart_; - int indexes[] = new int[m_variant_]; - int factor; - - // write elements according to the factors - // the factorized elements are determined by modulo - // arithmetic - for (int i = m_variant_ - 1; i > 0; i --) - { - factor = m_factor_[i] & 0x00FF; - indexes[i] = offset % factor; - offset /= factor; - } - - // we don't need to calculate the last modulus because - // start <= code <= end guarantees here that - // code <= factors[0] - indexes[0] = offset; - - // joining up the factorized strings - String s[] = getFactorString(indexes); - if (s != null && s.length > 0) - { - int size = s.length; - for (int i = 0; i < size; i ++) - str.append(s[i]); - } - break; - } - } - - /** - * Gets the character for the argument algorithmic name - * @return the algorithmic char or -1 otherwise. - */ - protected int getAlgorithmChar(String name) - { - int prefixlen = m_prefix_.length(); - if (name.length() < prefixlen || - !m_prefix_.equals(name.substring(0, prefixlen))) { - return -1; - } - - switch (m_type_) - { - case TYPE_0_ : - try - { - int result = Integer.parseInt(name.substring(prefixlen), - 16); - // does it fit into the range? - if (m_rangestart_ <= result && result <= m_rangeend_) { - return result; - } - } - catch (NumberFormatException e) - { - return -1; - } - break; - case TYPE_1_ : - // repetitative suffix name comparison done here - // offset is the character code - start - for (int ch = m_rangestart_; ch <= m_rangeend_; ch ++) - { - int offset = ch - m_rangestart_; - int indexes[] = new int[m_variant_]; - int factor; - - // write elements according to the factors - // the factorized elements are determined by modulo - // arithmetic - for (int i = m_variant_ - 1; i > 0; i --) - { - factor = m_factor_[i] & 0x00FF; - indexes[i] = offset % factor; - offset /= factor; - } - - // we don't need to calculate the last modulus - // because start <= code <= end guarantees here that - // code <= factors[0] - indexes[0] = offset; - - // joining up the factorized strings - if (compareFactorString(indexes, - name.substring(prefixlen))) { - return ch; - } - } - } - - return -1; - } - - // private data members ------------------------------------------ - - /** - * Algorithmic data information - */ - private int m_rangestart_; - private int m_rangeend_; - private byte m_type_; - private byte m_variant_; - private char m_factor_[]; - private String m_prefix_; - private byte m_factorstring_[]; - - // private methods ----------------------------------------------- - - /** - * Gets the indexth string in each of the argument factor block - * @param index array with each index corresponding to each factor block - * @return array of indexth factor string in factor block - */ - private String[] getFactorString(int index[]) - { - int size = m_factor_.length; - if (index == null || index.length != size) { - return null; - } - - String result[] = new String[size]; - StringBuffer str = new StringBuffer(); - int count = 0; - int factor; - size --; - for (int i = 0; i <= size; i ++) { - factor = m_factor_[i]; - count = UCharacterUtil.skipNullTermByteSubString( - m_factorstring_, count, index[i]); - count = UCharacterUtil.getNullTermByteSubString( - str, m_factorstring_, count); - if (i != size) { - count = UCharacterUtil.skipNullTermByteSubString( - m_factorstring_, count, - factor - index[i] - 1); - } - result[i] = str.toString(); - str.delete(0, str.length()); - } - return result; - } - - /** - * Compares the indexth string in each of the argument factor block with - * the argument string - * @param index array with each index corresponding to each factor block - * @param str string to compare with - * @return true if string matches - */ - private boolean compareFactorString(int index[], String str) - { - int size = m_factor_.length; - if (index == null || index.length != size) - return false; - - int count = 0; - int strcount = 0; - int factor; - size --; - for (int i = 0; i <= size; i ++) - { - factor = m_factor_[i]; - count = UCharacterUtil.skipNullTermByteSubString( - m_factorstring_, count, index[i]); - strcount = UCharacterUtil.compareNullTermByteSubString(str, - m_factorstring_, strcount, count); - if (strcount < 0) { - return false; - } - - if (i != size) { - count = UCharacterUtil.skipNullTermByteSubString( - m_factorstring_, count, factor - index[i]); - } - } - if (strcount != str.length()) { - return false; - } - return true; - } - } - - // protected constructor --------------------------------------------- - - /** - *

    Protected constructor for use in UCharacter.

    - * @exception IOException thrown when data reading fails - */ - protected UCharacterName() throws IOException - { - InputStream i = getClass().getResourceAsStream(NAME_FILE_NAME_); - BufferedInputStream b = new BufferedInputStream(i, - NAME_BUFFER_SIZE_); - UCharacterNameReader reader = new UCharacterNameReader(b); - reader.read(this); - i.close(); - UNICODE_1_ = (';' >= m_tokentable_.length) || - (m_tokentable_[(int)';'] == 0xFFFF); - } - - // protected methods ------------------------------------------------- - - /** - * Retrieve the name of a Unicode code point. - * Depending on choice, the character name written into the - * buffer is the "modern" name or the name that was defined in Unicode - * version 1.0. - * The name contains only "invariant" characters - * like A-Z, 0-9, space, and '-'. - * - * @param ch the code point for which to get the name. - * @param choice Selector for which name to get. - * @return if code point is above 0x1fff, null is returned - */ - protected String getName(int ch, int choice) - { - if (ch < UCharacter.MIN_VALUE || ch > UCharacter.MAX_VALUE || - choice >= UCharacterNameChoice.U_CHAR_NAME_CHOICE_COUNT) { - return null; - } - - int tempChoice = choice; - if (tempChoice == UCharacterNameChoice.U_EXTENDED_CHAR_NAME) { - tempChoice = UCharacterNameChoice.U_UNICODE_CHAR_NAME; - } - - String result = ""; - - // Do not write algorithmic Unicode 1.0 names because Unihan names are - // the same as the modern ones, extension A was only introduced with - // Unicode 3.0, and the Hangul syllable block was moved and changed around - // Unicode 1.1.5. - if (tempChoice == UCharacterNameChoice.U_UNICODE_CHAR_NAME) { - // try getting algorithmic name first - result = getAlgName(ch); - } - - // getting normal character name - if (result == null || result.length() == 0) { - if (choice == UCharacterNameChoice.U_EXTENDED_CHAR_NAME) { - result = getExtendedName(ch); - } else { - result = getGroupName(ch, choice); - } - } - - return result; - } - - /** - * Find a character by its name and return its code point value - * @param character name - * @param choice selector to indicate if argument name is a Unicode 1.0 - * or the most current version - * @return code point - */ - protected int getCharFromName(int choice, String name) - { - // checks for illegal arguments - if (choice >= UCharacterNameChoice.U_CHAR_NAME_CHOICE_COUNT || - name == null || name.length() == 0) { - return -1; - } - - // try extended names first - int result = getExtendedChar(name, choice); - if (result >= -1) { - return result; - } - // try algorithmic names first, if fails then try group names - // int result = getAlgorithmChar(choice, uppercasename); - int tempChoice = choice; - if (choice == UCharacterNameChoice.U_EXTENDED_CHAR_NAME) { - tempChoice = UCharacterNameChoice.U_UNICODE_CHAR_NAME; - } - - String upperCaseName = UCharacter.toUpperCase(Locale.ENGLISH, name); - // try algorithmic names now, 1.0 has no algorithmic names - if (choice != UCharacterNameChoice.U_UNICODE_CHAR_NAME) { - return getGroupChar(upperCaseName, tempChoice); - } - int count = 0; - if (m_algorithm_ != null) { - count = m_algorithm_.length; - } - for (count --; count >= 0; count --) { - result = m_algorithm_[count].getAlgorithmChar(name); - if (result >= 0) { - return result; - } - } - - result = getGroupChar(upperCaseName, tempChoice); - if (result == -1 && - choice == UCharacterNameChoice.U_EXTENDED_CHAR_NAME) { - result = getGroupChar(upperCaseName, - UCharacterNameChoice.U_UNICODE_10_CHAR_NAME); - } - return result; - } - - /** - * Sets the token data - * @param token array of tokens - * @param tokenstring array of string values of the tokens - * @return false if there is a data error - */ - protected boolean setToken(char token[], byte tokenstring[]) - { - if (token != null && tokenstring != null && token.length > 0 && - tokenstring.length > 0) { - m_tokentable_ = token; - m_tokenstring_ = tokenstring; - return true; - } - return false; - } - - /** - * Set the algorithm name information array - * @param algorithm information array - * @return true if the group string offset has been set correctly - */ - protected boolean setAlgorithm(AlgorithmName alg[]) - { - if (alg != null && alg.length != 0) { - m_algorithm_ = alg; - return true; - } - return false; - } - - /** - * Sets the number of group and size of each group in number of char - * @param count number of groups - * @param size size of group in char - * @return true if group size is set correctly - */ - protected boolean setGroupCountSize(int count, int size) - { - if (count <= 0 || size <= 0) { - return false; - } - m_groupcount_ = count; - m_groupsize_ = size; - return true; - } - - /** - * Sets the group name data - * @param group index information array - * @param groupstring name information array - * @return false if there is a data error - */ - protected boolean setGroup(char group[], byte groupstring[]) - { - if (group != null && groupstring != null && group.length > 0 && - groupstring.length > 0) { - m_groupinfo_ = group; - m_groupstring_ = groupstring; - return true; - } - return false; - } - - // private data members ---------------------------------------------- - - /** - * Data used in unames.dat - */ - private char m_tokentable_[]; - private byte m_tokenstring_[]; - private char m_groupinfo_[]; - private byte m_groupstring_[]; - private AlgorithmName m_algorithm_[]; - - /** - * Number of group sets - */ - private int m_groupcount_ = 0; - private int m_groupsize_ = 0; - - /** - * Default name of the name datafile - */ - private static final String NAME_FILE_NAME_ = "resources/unames.dat"; - - /** - * Default buffer size of datafile - */ - private static final int NAME_BUFFER_SIZE_ = 100000; - - /** - * Shift count to retrieve group information - */ - private static final int GROUP_SHIFT_ = 5; - - /** - * Number of lines per group - */ - private static final int LINES_PER_GROUP_ = 1 << GROUP_SHIFT_; - - /** - * Mask to retrieve the offset for a particular character within a group - */ - private static final int GROUP_MASK_ = LINES_PER_GROUP_ - 1; - - /** - * Position of offsethigh in group information array - */ - private static final int OFFSET_HIGH_OFFSET_ = 1; - - /** - * Position of offsetlow in group information array - */ - private static final int OFFSET_LOW_OFFSET_ = 2; - - /** - * Indicator of if Unicode 1.0 names are available - */ - private static boolean UNICODE_1_; - - /** - * Double nibble indicator, any nibble > this number has to be combined - * with its following nibble - */ - private static final int SINGLE_NIBBLE_MAX_ = 11; - - // private methods --------------------------------------------------- - - /** - * Gets the algorithmic name for the argument character - * @param ch character to determine name for - * @return the algorithmic name or null if not found - */ - private String getAlgName(int ch) - { - // index in terms integer index - StringBuffer s = new StringBuffer(); - - for (int index = m_algorithm_.length - 1; index >= 0; index --) { - if (m_algorithm_[index].contains(ch)) { - if (index >= 0) { - m_algorithm_[index].appendName(ch, s); - return s.toString(); - } - } - } - return null; - } - - /** - * Getting the character with the tokenized argument name - * @param name of the character - * @return character with the tokenized argument name or -1 if character - * is not found - */ - private int getGroupChar(String name, int choice) - { - int result = 0; - - for (int i = 0; i < m_groupcount_; i ++) { - result = getGroupChar(i, name, choice); - if (result != -1) { - return result; - } - } - return -1; - } - - /** - * Reads a block of compressed lengths of 32 strings and expands them into - * offsets and lengths for each string. Lengths are stored with a - * variable-width encoding in consecutive nibbles: - * If a nibble<0xc, then it is the length itself (0 = empty string). - * If a nibble>=0xc, then it forms a length value with the following - * nibble. - * The offsets and lengths arrays must be at least 33 (one more) long - * because there is no check here at the end if the last nibble is still - * used. - * @param index of group string object in array - * @param offsets array to store the value of the string offsets - * @param lengths array to store the value of the string length - * @return next index of the data string immediately after the lengths - * in terms of byte address - */ - private int getGroupLengths(int index, char offsets[], char lengths[]) - { - char length = 0xffff; - byte b = 0, - n = 0; - int shift; - index = index * m_groupsize_; // byte count offsets of group strings - int stringoffset = UCharacterUtil.toInt( - m_groupinfo_[index + OFFSET_HIGH_OFFSET_], - m_groupinfo_[index + OFFSET_LOW_OFFSET_]); - - offsets[0] = 0; - - // all 32 lengths must be read to get the offset of the first group - // string - for (int i = 0; i < LINES_PER_GROUP_; stringoffset ++) { - b = m_groupstring_[stringoffset]; - shift = 4; - - while (shift >= 0) { - // getting nibble - n = (byte)((b >> shift) & 0x0F); - if (length == 0xffff && n > SINGLE_NIBBLE_MAX_) { - length = (char)((n - 12) << 4); - } - else { - if (length != 0xffff) { - lengths[i] = (char)((length | n) + 12); - } - else { - lengths[i] = (char)n; - } - - if (i < LINES_PER_GROUP_) { - offsets[i + 1] = (char)(offsets[i] + lengths[i]); - } - - length = 0xffff; - i ++; - } - - shift -= 4; - } - } - return stringoffset; - } - - /** - * Gets the name of the argument group index - * @param index of the group name string in byte count - * @param length of the group name string - * @param choice of Unicode 1.0 name or the most current name - * @return name of the group - */ - private String getGroupName(int index, int length, int choice) - { - if (choice != UCharacterNameChoice.U_UNICODE_CHAR_NAME) { - int oldindex = index; - index += UCharacterUtil.skipByteSubString(m_groupstring_, index, - length, (byte)';'); - length -= (index - oldindex); - } - - StringBuffer s = new StringBuffer(); - byte b; - char token; - for (int i = 0; i < length;) { - b = m_groupstring_[index + i]; - i ++; - - if (b >= m_tokentable_.length) { - if (b == ';') { - break; - } - s.append(b); // implicit letter - } - else { - token = m_tokentable_[b & 0x00ff]; - if (token == 0xFFFE) { - // this is a lead byte for a double-byte token - token = m_tokentable_[b << 8 | - (m_groupstring_[index + i] & 0x00ff)]; - i ++; - } - if (token == 0xFFFF) { - if (b == ';') { - break; - } - s.append((char)(b & 0x00ff)); // explicit letter - } - else { // write token word - UCharacterUtil.getNullTermByteSubString(s, - m_tokenstring_, token); - } - } - } - - if (s.length() == 0) { - return null; - } - return s.toString(); - } - - /** - * Compares and retrieve character if name is found within the argument - * group - * @param index index where the set of names reside in the group block - * @param length list of lengths of the strings - * @param name character name to search for - * @param choice of either 1.0 or the most current unicode name - * @return relative character in the group which matches name, otherwise if - * not found, -1 will be returned - */ - private int getGroupChar(int index, char length[], String name, - int choice) - { - byte b = 0; - char token; - int len; - int namelen = name.length(); - int nindex; - int count; - - for (int result = 0; result <= LINES_PER_GROUP_; result ++) { - nindex = 0; - len = length[result]; - - if (choice != UCharacterNameChoice.U_UNICODE_CHAR_NAME) { - int oldindex = index; - index += UCharacterUtil.skipByteSubString(m_groupstring_, - index, len, (byte)';'); - len -= (index - oldindex); - } - - // number of tokens is > the length of the name - // write each letter directly, and write a token word per token - for (count = 0; count < len && nindex != -1 && nindex < namelen; - ) { - b = m_groupstring_[index + count]; - count ++; - - if (b >= m_tokentable_.length) { - if (name.charAt(nindex ++) != (b & 0xFF)) { - nindex = -1; - } - } - else { - token = m_tokentable_[b & 0xFF]; - if (token == 0xFFFE) { - // this is a lead byte for a double-byte token - token = m_tokentable_[b << 8 | - (m_groupstring_[index + count] & 0x00ff)]; - count ++; - } - if (token == 0xFFFF) { - if (name.charAt(nindex ++) != (b & 0xFF)) { - nindex = -1; - } - } - else { - // compare token with name - nindex = UCharacterUtil.compareNullTermByteSubString( - name, m_tokenstring_, nindex, token); - } - } - } - - if (namelen == nindex && - (count == len || m_groupstring_[index + count] == ';')) { - return result; - } - - index += len; - } - return -1; - } - - /** - * Binary search for the group strings set that contains the argument Unicode - * code point's most significant bits. - * The return value is always a valid group string set that contain msb. - * If group string set is not found, -1 is returned - * @param ch the code point to look for - * @return group string set index in datatable otherwise -1 is returned if - * group string set is not found - */ - private int getGroupStringIndex(int ch) - { - // gets the msb - int msb = ch >> GROUP_SHIFT_, - end = m_groupcount_, - start, - gindex = 0; - - // binary search for the group of names that contains the one for code - for (start = 0; start < end - 1;) { - gindex = (start + end) >> 1; - if (msb < m_groupinfo_[gindex * m_groupsize_]) { - end = gindex; - } - else { - start = gindex; - } - } - - // return this if it is an exact match - if (msb == m_groupinfo_[start * m_groupsize_]) { - start = start * m_groupsize_; - return UCharacterUtil.toInt( - m_groupinfo_[start + OFFSET_HIGH_OFFSET_], - m_groupinfo_[start + OFFSET_LOW_OFFSET_]); - } - return -1; - } - - /** - * Gets the group name of the character - * @param ch character to get the group name - * @param choice name choice selector to choose a unicode 1.0 or newer name - */ - private String getGroupName(int ch, int choice) - { - if (choice != UCharacterNameChoice.U_UNICODE_CHAR_NAME && - !UNICODE_1_) { - // if not modern name requested and semicolon byte value is a - // character, not a token number, otherwise since only modern - // names are stored in unames.dat and there is no such requested - // Unicode 1.0 name here - return null; - } - - // gets the msb - int msb = ch >> GROUP_SHIFT_, - end = m_groupcount_, - start, - gindex = 0; - - // binary search for the group of names that contains the one for - // code - for (start = 0; start < end - 1;) { - gindex = (start + end) >> 1; - if (msb < m_groupinfo_[gindex * m_groupsize_]) { - end = gindex; - } - else { - start = gindex; - } - } - - // return this if it is an exact match - if (msb == m_groupinfo_[start * m_groupsize_]) { - char offsets[] = new char[LINES_PER_GROUP_ + 1]; - char lengths[] = new char[LINES_PER_GROUP_ + 1]; - - int index = getGroupLengths(start, offsets, lengths); - int offset = ch & GROUP_MASK_; - return getGroupName(index + offsets[offset], lengths[offset], - choice); - } - - return null; - } - - /** - * Getting the character with the tokenized argument name - * @param index of the group to check - * @param name of the character - * @param choice of Unicode version used - * @return character with the tokenized argument name or -1 if character - * is not found - */ - private int getGroupChar(int index, String name, int choice) - { - if (choice != UCharacterNameChoice.U_UNICODE_CHAR_NAME && - !UNICODE_1_) { - // semicolon byte value is a token number , therefore only - // modern names are stored in unames.dat and there is no such - // requested Unicode 1.0 name here - return -1; - } - - // populating the data set of grouptable - char offsets[] = new char[LINES_PER_GROUP_ + 1]; - char lengths[] = new char[LINES_PER_GROUP_ + 1]; - int startgpstrindex = getGroupLengths(index, offsets, lengths); - - // shift out to function - int result = getGroupChar(startgpstrindex, lengths, name, choice); - if (result != -1) { - return (m_groupinfo_[index * m_groupsize_] << GROUP_SHIFT_) | - result; - } - return -1; - } - - /** - * Getting the character with extended name of the form <....>. - * @param name of the character to be found - * @param choice name choice - * @return character associated with the name, -1 if such character is not - * found and -2 if we should continue with the search. - */ - private int getExtendedChar(String name, int choice) - { - if (name.charAt(0) == '<') { - if (choice == UCharacterNameChoice.U_EXTENDED_CHAR_NAME) { - int endIndex = name.length() - 1; - if (name.charAt(endIndex) == '>') { - int startIndex = name.lastIndexOf('-'); - if (startIndex >= 0) { // We've got a category. - startIndex ++; - int result = -1; - try { - result = Integer.parseInt( - name.substring(startIndex, endIndex), - 16); - } - catch (NumberFormatException e) { - return -1; - } - // Now validate the category name. We could use a - // binary search, or a trie, if we really wanted to. - String type = name.substring(1, startIndex - 1); - int length = UCharacterCategory.TYPE_NAMES_.length; - for (int i = 0; i < length; ++ i) { - if (type.compareToIgnoreCase( - UCharacterCategory.TYPE_NAMES_[i]) == 0) { - if (getType(result) == i) { - return result; - } - break; - } - } - } - } - } - return -1; - } - return -2; - } - - /** - * Gets the character extended type - * @param ch character to be tested - * @return extended type it is associated with - */ - private int getType(int ch) - { - if ((ch & 0xFFFE) == 0xFFFE || (ch >= 0xFDD0 && ch <= 0xFDEF)) { - // not a character we return a invalid category count - return UCharacterCategory.NON_CHARACTER_; - } - // Undo ICU exceptions to the UCD when determining the category. - int result; - if (UCharacter.isISOControl(ch)) { - result = UCharacterCategory.CONTROL; - } - else { - result = UCharacter.getType(ch); - if (result == UCharacterCategory.SURROGATE) { - if (UTF16.isLeadSurrogate((char)ch)) { - result = UCharacterCategory.LEAD_SURROGATE_; - } - else { - result = UCharacterCategory.TRAIL_SURROGATE_; - } - } - } - return result; - } - - /** - * Retrieves the extended name - */ - private String getExtendedName(int ch) - { - String result = getName(ch, UCharacterNameChoice.U_UNICODE_CHAR_NAME); - if (result == null) { - if (getType(ch) == UCharacterCategory.CONTROL) { - result = getName(ch, - UCharacterNameChoice.U_UNICODE_10_CHAR_NAME); - } - if (result == null) { - int type = getType(ch); - // Return unknown if the table of names above is not up to - // date. - if (type >= UCharacterCategory.TYPE_NAMES_.length) { - result = UCharacterCategory.UNKNOWN_TYPE_NAME_; - } - else { - result = UCharacterCategory.TYPE_NAMES_[type]; - } - StringBuffer tempResult = new StringBuffer(result); - tempResult.insert(0, '<'); - tempResult.append('-'); - String chStr = Integer.toHexString(ch).toUpperCase(); - int zeros = 4 - chStr.length(); - while (zeros > 0) { - tempResult.append('0'); - zeros --; - } - tempResult.append(chStr); - tempResult.append('>'); - result = tempResult.toString(); - } - } - return result; - } -} diff --git a/icu4j/src/com/ibm/text/UCharacterNameChoice.java b/icu4j/src/com/ibm/text/UCharacterNameChoice.java deleted file mode 100755 index 68b63e8ce7..0000000000 --- a/icu4j/src/com/ibm/text/UCharacterNameChoice.java +++ /dev/null @@ -1,35 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: -* /usr/cvs/icu4j/icu4j/src/com/ibm/icu/text/UCharacterNameChoiceEnum.java $ -* $Date: 2002/02/15 02:53:35 $ -* $Revision: 1.3 $ -* -******************************************************************************* -*/ - -package com.ibm.text; - -/** -* Internal class containing selector constants for the unicode character names. -* Constants representing the "modern" name of a Unicode character or the name -* that was defined in Unicode version 1.0, before the Unicode standard -* merged with ISO-10646. -* Arguments for UCharacterName -* @author Syn Wee Quek -* @since oct0600 -*/ - -interface UCharacterNameChoice -{ - // public variables ============================================= - - static final int U_UNICODE_CHAR_NAME = 0; - static final int U_UNICODE_10_CHAR_NAME = 1; - static final int U_EXTENDED_CHAR_NAME = 2; - static final int U_CHAR_NAME_CHOICE_COUNT = 3; -} diff --git a/icu4j/src/com/ibm/text/UCharacterNameReader.java b/icu4j/src/com/ibm/text/UCharacterNameReader.java deleted file mode 100755 index 175922c139..0000000000 --- a/icu4j/src/com/ibm/text/UCharacterNameReader.java +++ /dev/null @@ -1,222 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UCharacterNameReader.java,v $ -* $Date: 2002/02/08 23:22:40 $ -* $Revision: 1.2 $ -* -******************************************************************************* -*/ -package com.ibm.text; - -import java.io.InputStream; -import java.io.DataInputStream; -import java.io.IOException; -import java.util.Arrays; -import com.ibm.icu.internal.ICUBinary; - -/** -*

    Internal reader class for ICU data file uname.dat containing -* Unicode codepoint name data.

    -*

    This class simply reads unames.dat, authenticates that it is a valid -* ICU data file and split its contents up into blocks of data for use in -* com.ibm.text.UCharacterName. -*

    -*

    For more information about the format of unames.dat refer to -* -* ReadMe.<\p> -*

    unames.dat which is in big-endian format is jared together with this -* package.

    -* @author Syn Wee Quek -* @since release 2.1, February 1st 2002 -* @draft 2.1 -*/ - -final class UCharacterNameReader -{ - // protected constructor --------------------------------------------- - - /** - *

    Protected constructor.

    - * @param inputStream ICU uprop.dat file input stream - * @exception IOException throw if data file fails authentication - * @draft 2.1 - */ - protected UCharacterNameReader(InputStream inputStream) - throws IOException - { - ICUBinary.readHeader(inputStream, DATA_FORMAT_ID_, - DATA_FORMAT_VERSION_, UNICODE_VERSION_); - m_dataInputStream_ = new DataInputStream(inputStream); - } - - // protected methods ------------------------------------------------- - - /** - * Read and break up the stream of data passed in as arguments - * and fills up UCharacterName. - * If unsuccessful false will be returned. - * @param data instance of datablock - * @exception thrown when there's a data error. - */ - protected void read(UCharacterName data) throws IOException - { - // reading index - m_tokenstringindex_ = m_dataInputStream_.readInt(); - m_groupindex_ = m_dataInputStream_.readInt(); - m_groupstringindex_ = m_dataInputStream_.readInt(); - m_algnamesindex_ = m_dataInputStream_.readInt(); - - // reading tokens - int count = m_dataInputStream_.readChar(); - char token[] = new char[count]; - for (char i = 0; i < count; i ++) { - token[i] = m_dataInputStream_.readChar(); - } - int size = m_groupindex_ - m_tokenstringindex_; - byte tokenstr[] = new byte[size]; - m_dataInputStream_.readFully(tokenstr); - data.setToken(token, tokenstr); - - // reading the group information records - count = m_dataInputStream_.readChar(); - data.setGroupCountSize(count, GROUP_INFO_SIZE_); - count *= GROUP_INFO_SIZE_; - char group[] = new char[count]; - for (int i = 0; i < count; i ++) { - group[i] = m_dataInputStream_.readChar(); - } - - size = m_algnamesindex_ - m_groupstringindex_; - byte groupstring[] = new byte[size]; - m_dataInputStream_.readFully(groupstring); - data.setGroup(group, groupstring); - - count = m_dataInputStream_.readInt(); - UCharacterName.AlgorithmName alg[] = - new UCharacterName.AlgorithmName[count]; - - for (int i = 0; i < count; i ++) - { - UCharacterName.AlgorithmName an = readAlg(); - if (an == null) { - throw new IOException("unames.dat read error: Algorithmic names creation error"); - } - alg[i] = an; - } - data.setAlgorithm(alg); - } - - /** - *

    Checking the file for the correct format.

    - * @param dataformatid - * @param dataformatversio - * @return true if the file format version is correct - * @draft 2.1 - */ - protected boolean authenticate(byte dataformatid[], - byte dataformatversion[]) - { - return Arrays.equals(DATA_FORMAT_ID_, dataformatid) && - Arrays.equals(DATA_FORMAT_VERSION_, dataformatversion); - } - - // private variables ------------------------------------------------- - - /** - * Data input stream for names - */ - private DataInputStream m_dataInputStream_; - /** - * Size of the group information block in number of char - */ - private static final int GROUP_INFO_SIZE_ = 3; - - /** - * Index of the offset information - */ - private int m_tokenstringindex_; - private int m_groupindex_; - private int m_groupstringindex_; - private int m_algnamesindex_; - - /** - * Size of an algorithmic name information group - * start code point size + end code point size + type size + variant size + - * size of data size - */ - private static final int ALG_INFO_SIZE_ = 12; - - /** - * File format version and id that this class understands. - * No guarantees are made if a older version is used - */ - private static final byte DATA_FORMAT_VERSION_[] = - {(byte)0x1, (byte)0x0, (byte)0x0, (byte)0x0}; - private static final byte DATA_FORMAT_ID_[] = {(byte)0x75, (byte)0x6E, - (byte)0x61, (byte)0x6D}; - private static final byte UNICODE_VERSION_[] = {(byte)0x3, (byte)0x1, - (byte)0x1, (byte)0x0}; - - /** - * Corrupted error string - */ - private static final String CORRUPTED_DATA_ERROR_ = - "Data corrupted in character name data file"; - - // private methods --------------------------------------------------- - - /** - * Reads an individual record of AlgorithmNames - * @return an instance of AlgorithNames if read is successful otherwise null - * @exception thrown when file read error occurs or data is corrupted - */ - private UCharacterName.AlgorithmName readAlg() throws IOException - { - UCharacterName.AlgorithmName result = - new UCharacterName.AlgorithmName(); - int rangestart = m_dataInputStream_.readInt(); - int rangeend = m_dataInputStream_.readInt(); - byte type = m_dataInputStream_.readByte(); - byte variant = m_dataInputStream_.readByte(); - if (!result.setInfo(rangestart, rangeend, type, variant)) { - return null; - } - - int size = m_dataInputStream_.readChar(); - if (type == UCharacterName.AlgorithmName.TYPE_1_) - { - char factor[] = new char[variant]; - for (int j = 0; j < variant; j ++) { - factor[j] = m_dataInputStream_.readChar(); - } - - result.setFactor(factor); - size -= (variant << 1); - } - - StringBuffer prefix = new StringBuffer(); - char c = (char)(m_dataInputStream_.readByte() & 0x00FF); - while (c != 0) - { - prefix.append(c); - c = (char)(m_dataInputStream_.readByte() & 0x00FF); - } - - result.setPrefix(prefix.toString()); - - size -= (ALG_INFO_SIZE_ + prefix.length() + 1); - - if (size > 0) - { - byte string[] = new byte[size]; - m_dataInputStream_.readFully(string); - result.setFactorString(string); - } - return result; - } -} - diff --git a/icu4j/src/com/ibm/text/UCharacterProperty.java b/icu4j/src/com/ibm/text/UCharacterProperty.java deleted file mode 100755 index 1c309ab92a..0000000000 --- a/icu4j/src/com/ibm/text/UCharacterProperty.java +++ /dev/null @@ -1,489 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: -* /usr/cvs/icu4j/icu4j/src/com/ibm/icu/text/UCharacterPropertyDB.java $ -* $Date: 2002/02/08 01:12:10 $ -* $Revision: 1.1 $ -* -******************************************************************************* -*/ - -package com.ibm.text; - -import java.io.InputStream; -import java.io.DataInputStream; -import java.io.FileInputStream; -import java.io.BufferedInputStream; -import java.io.IOException; -import com.ibm.icu.internal.util.Trie; -import com.ibm.icu.util.CharTrie; - -/** -*

    Internal class used for Unicode character property database.

    -*

    This classes store binary data read from uprops.dat. -* It does not have the capability to parse the data into more high-level -* information. It only returns bytes of information when required.

    -*

    Due to the form most commonly used for retrieval, array of char is used -* to store the binary data.

    -*

    UCharacterPropertyDB also contains information on accessing indexes to -* significant points in the binary data.

    -*

    Responsibility for molding the binary data into more meaning form lies on -* UCharacter.

    -* @author Syn Wee Quek -* @since release 2.1, february 1st 2002 -* @draft 2.1 -*/ - -final class UCharacterProperty implements Trie.DataManipulate -{ - // public methods ---------------------------------------------------- - - /** - * toString method for printing - */ - public String toString() - { - StringBuffer result = new StringBuffer("Property block\n"); - result.append(super.toString()); - result.append("\nsize of property data "); - result.append(m_property_.length); - result.append("\nsize of exception data "); - result.append(m_exception_.length); - result.append("\nsize of case data "); - result.append(m_case_.length); - return result.toString(); - } - - /** - * Extracts out the type value from property. - * For use in enumeration. - * @param value of trie value associated with a codepoint - */ - public int extract(int value) - { - // access the general category from the 32-bit properties, and those - // from the 16-bit trie value - return getPropType(m_property_[value]); - } - - /** - * Called by com.ibm.icu.util.Trie to extract from a lead surrogate's - * data the index array offset of the indexes for that lead surrogate. - * @param property data value for a surrogate from the trie, including the - * folding offset - * @return data offset or 0 if there is no data for the lead surrogate - */ - public int getFoldingOffset(int value) - { - if ((value & SUPPLEMENTARY_FOLD_INDICATOR_MASK_) != 0) { - return (value & SUPPLEMENTARY_FOLD_OFFSET_MASK_); - } - else { - return 0; - } - } - - // protected constructor --------------------------------------------- - - /** - * Constructor - * @exception thrown when data reading fails or data corrupted - */ - protected UCharacterProperty() throws IOException - { - // jar access - InputStream i = getClass().getResourceAsStream(DATA_FILE_NAME_); - BufferedInputStream b = new BufferedInputStream(i, - DATA_BUFFER_SIZE_); - UCharacterPropertyReader reader = new UCharacterPropertyReader(b); - reader.read(this); - b.close(); - i.close(); - } - - // protected variables ----------------------------------------------- - - /** - * Data type indicators - */ - protected static final int EXC_UPPERCASE_ = 0; - protected static final int EXC_LOWERCASE_ = EXC_UPPERCASE_ + 1; - protected static final int EXC_TITLECASE_ = EXC_LOWERCASE_ + 1; - protected static final int EXC_DIGIT_VALUE_ = EXC_TITLECASE_ + 1; - protected static final int EXC_NUMERIC_VALUE_ = EXC_DIGIT_VALUE_ + 1; - protected static final int EXC_DENOMINATOR_VALUE_ = EXC_NUMERIC_VALUE_ - + 1; - protected static final int EXC_MIRROR_MAPPING_ = EXC_DENOMINATOR_VALUE_ - + 1; - protected static final int EXC_SPECIAL_CASING_ = EXC_MIRROR_MAPPING_ - + 1; - protected static final int EXC_CASE_FOLDING_ = EXC_SPECIAL_CASING_ + 1; - // EXC_COMBINING_CLASS_ is not found in ICU - // Used to retrieve the combining class of the character in the exception - // value - protected static final int EXC_COMBINING_CLASS_ = EXC_CASE_FOLDING_ + 1; - - /** - * Trie data - */ - protected CharTrie m_trie_; - - /** - * Character property table - */ - protected int m_property_[]; - - /** - * Case table - */ - protected char m_case_[]; - - /** - * Exception property table - */ - protected int m_exception_[]; - /** - * Unicode version - */ - protected String m_unicodeVersion_; - - // protected methods ================================================ - - /** - * Gets the property value at the index - * @param ch code point whose property value is to be retrieved - * @return property value of code point - */ - protected int getProperty(int ch) - { - return m_property_[m_trie_.getCodePointValue(ch)]; - } - - /** - * Gets the upper case value at the index - * @param index of the case value to be retrieved - * @param buffer string buffer to add result to - */ - protected void getUpperCase(int index, StringBuffer buffer) - { - int count = m_case_[index]; - // last 5 bits of the first char in m_case_ gives the position of the - // alternate uppercase characters - index += (count & LAST_5_BIT_MASK_) + 1; - count = (count >> SHIFT_5_) & LAST_5_BIT_MASK_; - - for (int j = 0; j < count; j ++) { - buffer.append(m_case_[index + j]); - } - } - - /** - * Gets the lower case value at the index - * @param index of the case value to be retrieved - * @param buffer string buffer to add result to - */ - protected void getLowerCase(int index, StringBuffer buffer) - { - int count = m_case_[index] & LAST_5_BIT_MASK_; - // last 5 bits of the first char in m_case_ gives the size of the - // lowercase characters - index ++; - for (int j = 0; j < count; j ++) { - buffer.append(m_case_[index + j]); - } - } - - /** - * Gets the folded case value at the index - * @param index of the case value to be retrieved - * @return folded case value at index - */ - protected int getFoldCase(int index) - { - char single = m_case_[index]; - if (UTF16.isSurrogate(single)) { - // Convert the UTF-16 surrogate pair if necessary. - // For simplicity in usage, and because the frequency of pairs is low, - // look both directions. - - if (UTF16.isLeadSurrogate(single)) - { - char trail = m_case_[index + 1]; - if (UTF16.isTrailSurrogate(trail)) { - return UCharacter.getRawSupplementary(single, trail); - } - } - else - { - char lead = m_case_[index - 1]; - if (UTF16.isLeadSurrogate(lead)) { - return UCharacter.getRawSupplementary(lead, single); - } - } - } - return single; - } - - /** - * Gets the folded case value at the index - * @param index of the case value to be retrieved - * @param count number of characters to retrieve - * @param buffer string buffer to add result to - */ - protected void getFoldCase(int index, int count, StringBuffer str) - { - // first 2 chars are for the simple mappings - index += 2; - while (count > 0) { - str.append(m_case_[index]); - index ++; - count --; - } - } - - /** - * Determines if the exception value passed in has the kind of information - * which the indicator wants, e.g if the exception value contains the digit - * value of the character - * @param index exception index - * @param indicator type indicator - * @return true if type value exist - */ - protected boolean hasExceptionValue(int index, int indicator) - { - return (m_exception_[index] & (1 << indicator)) != 0; - } - - /** - * Gets the exception value at the index, assuming that data type is - * available. Result is undefined if data is not available. Use - * hasExceptionValue() to determine data's availability. - * @param index - * @param exception data type - * @return exception data type value at index - */ - protected int getException(int index, int etype) - { - // contained in exception data - int evalue = m_exception_[index]; - - switch (etype) - { - case EXC_COMBINING_CLASS_ : - return evalue; - default : - index ++; - // contained in the exception digit address - index = addExceptionOffset(evalue, etype, index); - } - return m_exception_[index]; - } - - /** - * Returns a value indicating a character category from the argument property - * value - * @param unicode character property - * @return category - */ - protected static int getPropType(int prop) - { - // Since character information data are packed together. - // This is the category mask for getting the category information - int result = prop & LAST_5_BIT_MASK_; - return result; - } - - /** - * Determines if the argument props indicates that the exception block has - * to be accessed for data - * @param props property value - * @return true if this is an exception indicator false otherwise - */ - protected static boolean isExceptionIndicator(int props) - { - if ((props & EXCEPTION_MASK_) != 0) { - return true; - } - return false; - } - - /** - * Getting the exception index for argument property - * @param prop character property - */ - protected static int getExceptionIndex(int prop) - { - return (prop >> VALUE_SHIFT_) & UNSIGNED_VALUE_MASK_AFTER_SHIFT_; - } - - /** - * Getting the signed numeric value of a character embedded in the property - * argument - * @param prop the character - * @return signed numberic value - */ - protected static int getSignedValue(int prop) - { - return (prop >> VALUE_SHIFT_); - } - - /** - * Getting the unsigned numeric value of a character embedded in the property - * argument - * @param prop the character - * @return unsigned numberic value - */ - protected static int getUnsignedValue(int prop) - { - return (prop >> VALUE_SHIFT_) & UNSIGNED_VALUE_MASK_AFTER_SHIFT_; - } - - /** - * Checking if property indicates mirror element - * @param prop property value - * @return true if mirror indicator is set, false otherwise - */ - protected static boolean isMirrored(int prop) - { - return (prop & MIRROR_MASK_) != 0; - } - - /** - * Getting the direction data in the property value - * @param prop property value - * @return direction value in property - */ - protected static int getDirection(int prop) - { - return (prop >> BIDI_SHIFT_) & BIDI_MASK_AFTER_SHIFT_; - } - - // private variables ================================================== - - /** - * Default name of the datafile - */ - private static final String DATA_FILE_NAME_ = "resources/uprops.dat"; - - /** - * Default buffer size of datafile - */ - private static final int DATA_BUFFER_SIZE_ = 25000; - - /** - * This, from what i infer is the max size of the indicators used for the - * exception values. - * Number of bits in an 8-bit integer value - */ - private static final int EXC_GROUP_ = 8; - - /** - * Mask to get the group - */ - private static final int EXC_GROUP_MASK_ = 255; - - /** - * Mask to get the digit value in the exception result - */ - private static final int EXC_DIGIT_MASK_ = 0xFFFF; - - /** - * Offset table for data in exception block.
    - * Table formed by the number of bits used for the index, e.g. 0 = 0 bits, - * 1 = 1 bits. - */ - private static final byte FLAGS_OFFSET_[] = - { - 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 - }; - - /** - * Numeric value shift - */ - private static final int VALUE_SHIFT_ = 20; - - /** - * Exception test mask - */ - private static final int EXCEPTION_MASK_ = 0x20; - - /** - * Mask to be applied after shifting to obtain an unsigned numeric value - */ - private static final int UNSIGNED_VALUE_MASK_AFTER_SHIFT_ = 0x7FF; - - /** - * Mirror test mask - */ - private static final int MIRROR_MASK_ = 0x800; - - /** - * Shift to get bidi bits - */ - private static final int BIDI_SHIFT_ = 6; - - /** - * Mask to be applied after shifting to get bidi bits - */ - private static final int BIDI_MASK_AFTER_SHIFT_ = 0x1F; - - /** - * To get the last 5 bits out from a data type - */ - private static final int LAST_5_BIT_MASK_ = 0x1F; - - /** - * Shift 5 bits - */ - private static final int SHIFT_5_ = 5; - - /** - * Folding indicator mask - */ - private static final int SUPPLEMENTARY_FOLD_INDICATOR_MASK_ = 0x8000; - /** - * Folding offset mask - */ - private static final int SUPPLEMENTARY_FOLD_OFFSET_MASK_ = 0x7FFF; - - // private methods --------------------------------------------------- - - /** - * Getting the correct address for data in the exception value - * @param evalue exception value - * @param indicator type of data to retrieve - * @param address current address to move from - * @return the correct address - */ - private int addExceptionOffset(int evalue, int indicator, int address) - { - int result = address; - if (indicator >= EXC_GROUP_) { - result += FLAGS_OFFSET_[evalue & EXC_GROUP_MASK_]; - evalue >>= EXC_GROUP_; - indicator -= EXC_GROUP_; - } - int mask = (1 << indicator) - 1; - result += FLAGS_OFFSET_[evalue & mask]; - return result; - } -} diff --git a/icu4j/src/com/ibm/text/UCharacterPropertyReader.java b/icu4j/src/com/ibm/text/UCharacterPropertyReader.java deleted file mode 100755 index a8cedd5029..0000000000 --- a/icu4j/src/com/ibm/text/UCharacterPropertyReader.java +++ /dev/null @@ -1,139 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UCharacterPropertyReader.java,v $ -* $Date: 2002/02/08 23:22:40 $ -* $Revision: 1.2 $ -* -******************************************************************************* -*/ -package com.ibm.text; - -import java.io.InputStream; -import java.io.DataInputStream; -import java.util.Arrays; -import java.io.IOException; -import com.ibm.icu.util.CharTrie; -import com.ibm.icu.internal.ICUBinary; - -/** -*

    Internal reader class for ICU data file uprops.dat containing -* Unicode codepoint data.

    -*

    This class simply reads uprops.dat, authenticates that it is a valid -* ICU data file and split its contents up into blocks of data for use in -* com.ibm.text.UCharacterProperty. -*

    -*

    For more information about the format of uprops.dat refer to -* -* ReadMe.<\p> -*

    uprops.dat which is in big-endian format is jared together with this -* package.

    -* @author Syn Wee Quek -* @since release 2.1, February 1st 2002 -* @draft 2.1 -*/ - -final class UCharacterPropertyReader -{ - // protected constructor --------------------------------------------- - - /** - *

    Protected constructor.

    - * @param inputStream ICU uprop.dat file input stream - * @exception IOException throw if data file fails authentication - * @draft 2.1 - */ - protected UCharacterPropertyReader(InputStream inputStream) - throws IOException - { - ICUBinary.readHeader(inputStream, DATA_FORMAT_ID_, - DATA_FORMAT_VERSION_, UNICODE_VERSION_); - m_dataInputStream_ = new DataInputStream(inputStream); - } - - // protected methods ------------------------------------------------- - - /** - *

    Reads uprops.dat, parse it into blocks of data to be stored in - * UCharacterProperty.

    - *
    - * UCharacterTypeIterator iterator = UCharacter.getUCharacterTypeIterator();
    - * while (iterator.next()) {
    - *     System.out.println("Codepoint \\u" + 
    - *                        Integer.toHexString(iterator.getStart()) + 
    - *                        " to codepoint \\u" +
    - *                        Integer.toHexString(iterator.getLimit() - 1) + 
    - *                        " has the character type " + iterator.getValue());
    - * }
    - * 
    - * @author synwee - * @see com.ibm.icu.util.TrieIterator - * @since release 2.1, Jan 24 2002 - */ -class UCharacterTypeIterator extends TrieIterator -{ - // protected constructor --------------------------------------------- - - /** - * TrieEnumeration constructor - * @param trie to be used - * @exception IllegalArgumentException throw when argument is null. - * @draft 2.1 - */ - protected UCharacterTypeIterator() - { - super(UCharacter.PROPERTY_.m_trie_); - } - - // protected methods ---------------------------------------------- - - /** - * Called by nextElement() to extracts a 32 bit value from a trie value - * used for comparison. - * This method is to be overwritten if special manipulation is to be done - * to retrieve a relevant comparison. - * The default function is to return the value as it is. - * @param value a value from the trie - * @return extracted value - */ - protected int extract(int value) - { - return UCharacterProperty.getPropType( - UCharacter.PROPERTY_.m_property_[value]); - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/text/UCharacterUtil.java b/icu4j/src/com/ibm/text/UCharacterUtil.java deleted file mode 100755 index 957d25660e..0000000000 --- a/icu4j/src/com/ibm/text/UCharacterUtil.java +++ /dev/null @@ -1,271 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UCharacterUtil.java,v $ -* $Date: 2001/03/23 19:51:38 $ -* $Revision: 1.3 $ -* -******************************************************************************* -*/ -package com.ibm.text; - -/** -* Internal character utility class for simple data type conversion and String -* parsing functions. Does not have an analog in the JDK. -* @author Syn Wee Quek -* @since sep2900 -*/ - -final class UCharacterUtil -{ - // constructor ===================================================== - - /** - * private constructor to avoid initialisation - */ - private UCharacterUtil() - { - } - - // protected methods =============================================== - - /** - * joining 2 chars to form an int - * @param msc most significant char - * @param lsc least significant char - * @return int form - */ - protected static int toInt(char msc, char lsc) - { - return ((msc << 16) | lsc); - } - - /** - * converting first 2 bytes of a byte array into char - * if array size is < 2 then algorithmn will only return value == 1 byte - * @param bytes 2 byte argument - * @return char form - */ - protected static char toChar(byte bytes[]) - { - if (bytes == null || bytes.length == 0) { - return 0; - } - if (bytes.length == 1) { - return toChar(bytes[0]); - } - - char firstbyte = (char)(toChar(bytes[0]) << 8); - char secondbyte = toChar(bytes[1]); - - return (char)(firstbyte | secondbyte); - } - - /** - * converting 2 bytes into a char - * @param msb the most significant byte - * @param lsb the least significant byte - * @return char form - */ - protected static char toChar(byte msb, byte lsb) - { - char firstbyte = (char)(toChar(msb) << 8); - char secondbyte = toChar(lsb); - - return (char)(firstbyte | secondbyte); - } - - /** - * converting first 4 bytes of a byte array into int - * if array size is < 4 then algorithmn will only return value == # bytes - * @param bytes 4 byte argument - * @return int form - */ - protected static int toInt(byte bytes[]) - { - if (bytes == null || bytes.length == 0) - return 0; - int size = bytes.length; - if (size > 4) - size = 4; - int result = 0; - for (int i = 0; i < size; i ++) - result = (result << 8) | (0x000000FF & bytes[i]); - return result; - } - - /** - * converting a byte into char - * @param onebyte - * @return char form - */ - protected static char toChar(byte onebyte) - { - char result = (char)(onebyte & 0x000000ff); - return result; - } - - /** - * converting a integer to a array of 4 characters where each character - * corresponds to its respective byte - * @param i integer to be converted - * @return array of 4 characters - */ - protected static char[] to4Char(int i) - { - char result[] = new char[4]; - result[0] = (char)((i >> 24) & 0xFF); - result[1] = (char)((i & 0x00FF0000) >> 16); - result[2] = (char)((i & 0x0000FF00) >> 8); - result[3] = (char)(i & 0xFF); - return result; - } - - /** - * Retrieves a null terminated substring from an array of bytes. - * Substring is a set of non-zero bytes starting from argument start to the - * next zero byte. If the first byte is a zero, the next byte will be taken as - * the first byte. - * @param str stringbuffer to store data in, data will be store with each - * byte as a char - * @param array byte array - * @param index to start substring in byte count - * @return the end position of the substring within the character array - */ - protected static int getNullTermByteSubString(StringBuffer str, byte[] array, - int index) - { - byte b = 1; - - while (b != 0) - { - b = array[index]; - if (b != 0) { - str.append((char)(b & 0x00FF)); - } - index ++; - } - return index; - } - - /** - * Compares a null terminated substring from an array of bytes. - * Substring is a set of non-zero bytes starting from argument start to the - * next zero byte. if the first byte is a zero, the next byte will be taken as - * the first byte. - * @param str string to compare - * @param array byte array - * @param strindex index within str to start comparing - * @param aindex array index to start in byte count - * @return the end position of the substring within str if matches otherwise - * a -1 - */ - protected static int compareNullTermByteSubString(String str, byte[] array, - int strindex, int aindex) - { - byte b = 1; - int length = str.length(); - - while (b != 0) - { - b = array[aindex]; - aindex ++; - if (b == 0) { - break; - } - // if we have reached the end of the string and yet the array has not - // reached the end of their substring yet, abort - if (strindex == length || (str.charAt(strindex) != (char)(b & 0xFF))) { - return -1; - } - strindex ++; - } - return strindex; - } - - /** - * Skip null terminated substrings from an array of bytes. - * Substring is a set of non-zero bytes starting from argument start to the - * next zero byte. If the first byte is a zero, the next byte will be taken as - * the first byte. - * @param array byte array - * @param index to start substrings in byte count - * @param skipcount number of null terminated substrings to skip - * @return the end position of the substrings within the character array - */ - protected static int skipNullTermByteSubString(byte[] array, int index, - int skipcount) - { - byte b; - for (int i = 0; i < skipcount; i ++) - { - b = 1; - while (b != 0) - { - b = array[index]; - index ++; - } - } - return index; - } - - /** - * skip substrings from an array of characters, where each character is a set - * of 2 bytes. substring is a set of non-zero bytes starting from argument - * start to the byte of the argument value. skips up to a max number of - * characters - * @param array byte array to parse - * @param index to start substrings in byte count - * @param length the max number of bytes to skip - * @param skipend value of byte to skip to - * @return the number of bytes skipped - */ - protected static int skipByteSubString(byte[] array, int index, int length, - byte skipend) - { - int result; - byte b; - - for (result = 0; result < length; result ++) - { - b = array[index + result]; - if (b == skipend) - { - result ++; - break; - } - } - - return result; - } - - /** - * skip substrings from an array of characters, where each character is a set - * of 2 bytes. substring is a set of non-zero bytes starting from argument - * start to the byte of the argument value. - * @param array byte array to parse - * @param index to start substrings in byte count - * @param skipend value of byte to skip to - * @return the number of bytes skipped - */ - protected static int skipByteSubString(byte[] array, int index, byte skipend) - { - int result = 0; - byte b; - - while (true) - { - b = array[index + result]; - result ++; - if (b == skipend) { - break; - } - } - - return result; - } -} - diff --git a/icu4j/src/com/ibm/text/UScript.java b/icu4j/src/com/ibm/text/UScript.java deleted file mode 100755 index dcfd01972a..0000000000 --- a/icu4j/src/com/ibm/text/UScript.java +++ /dev/null @@ -1,944 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -*/ - -package com.ibm.text; - -import com.ibm.text.resources.LocaleScript; -import java.util.ResourceBundle; -import java.util.Locale; -import java.util.MissingResourceException; -import com.ibm.text.UCharacter; - -/** - * A class to reflect UTR #24: Script Names - * (based on ISO 15924:2000, "Code for the representation of names of - * scripts".) UTR #24 describes the basis for a new Unicode data file, - * Scripts.txt. - */ -public final class UScript { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a92001 IBM Corp. All rights reserved."; - - public static final int INVALID_CODE = -1; - public static final int COMMON = 0; /* Zyyy */ - public static final int INHERITED = 1; /* Qaai */ - public static final int ARABIC = 2; /* Arab */ - public static final int ARMENIAN = 3; /* Armn */ - public static final int BENGALI = 4; /* Beng */ - public static final int BOPOMOFO = 5; /* Bopo */ - public static final int CHEROKEE = 6; /* Cher */ - public static final int COPTIC = 7; /* Qaac */ - public static final int CYRILLIC = 8; /* Cyrl (Cyrs) */ - public static final int DESERET = 9; /* Dsrt */ - public static final int DEVANAGARI = 10; /* Deva */ - public static final int ETHIOPIC = 11; /* Ethi */ - public static final int GEORGIAN = 12; /* Geor (Geon; Geoa) */ - public static final int GOTHIC = 13; /* Goth */ - public static final int GREEK = 14; /* Grek */ - public static final int GUJARATI = 15; /* Gujr */ - public static final int GURMUKHI = 16; /* Guru */ - public static final int HAN = 17; /* Hani */ - public static final int HANGUL = 18; /* Hang */ - public static final int HEBREW = 19; /* Hebr */ - public static final int HIRAGANA = 20; /* Hira */ - public static final int KANNADA = 21; /* Knda */ - public static final int KATAKANA = 22; /* Kana */ - public static final int KHMER = 23; /* Khmr */ - public static final int LAO = 24; /* Laoo */ - public static final int LATIN = 25; /* Latn (Latf; Latg) */ - public static final int MALAYALAM = 26; /* Mlym */ - public static final int MONGOLIAN = 27; /* Mong */ - public static final int MYANMAR = 28; /* Mymr */ - public static final int OGHAM = 29; /* Ogam */ - public static final int OLD_ITALIC = 30; /* Ital */ - public static final int ORIYA = 31; /* Orya */ - public static final int RUNIC = 32; /* Runr */ - public static final int SINHALA = 33; /* Sinh */ - public static final int SYRIAC = 34; /* Syrc (Syrj; Syrn; Syre) */ - public static final int TAMIL = 35; /* Taml */ - public static final int TELUGU = 36; /* Telu */ - public static final int THAANA = 37; /* Thaa */ - public static final int THAI = 38; /* Thai */ - public static final int TIBETAN = 39; /* Tibt */ - public static final int UCAS = 40; /* Cans */ - public static final int YI = 41; /* Yiii */ - public static final int CODE_LIMIT = 42; - - private static final String scriptNames[]={ - "ARABIC", /* ARABIC */ - "ARMENIAN", /* ARMENIAN */ - "BENGALI", /* BENGALI */ - "BOPOMOFO", /* BOPOMOFO */ - "CANADIAN-ABORIGINAL", /* UCAS */ - "CHEROKEE", /* CHEROKEE */ - "COMMON", /* COMMON */ - "CYRILLIC", /* CYRILLIC */ - "DESERET", /* DESERET */ - "DEVANAGARI", /* DEVANAGARI */ - "ETHIOPIC", /* ETHIOPIC */ - "GEORGIAN", /* GEORGIAN */ - "GOTHIC", /* GOTHIC */ - "GREEK", /* GREEK */ - "GUJARATI", /* GUJARATI */ - "GURMUKHI", /* GURMUKHI */ - "HAN", /* HAN */ - "HANGUL", /* HANGUL */ - "HEBREW", /* HEBREW */ - "HIRAGANA", /* HIRAGANA */ - "INHERITED", /* INHERITED */ - "KANNADA", /* KANNADA */ - "KATAKANA", /* KATAKANA */ - "KHMER", /* KHMER */ - "LATIN", /* LATIN */ - "MALAYALAM", /* MALAYALAM */ - "MONGOLIAN", /* MONGOLIAN */ - "MYANMAR", /* MYANMAR */ - "OGHAM", /* OGHAM */ - "OLD-ITALIC", /* OLD_ITALIC */ - "ORIYA", /* ORIYA */ - "RUNIC", /* RUNIC */ - "SINHALA", /* SINHALA */ - "SYRIAC", /* SYRIAC */ - "TAMIL", /* TAMIL */ - "TELUGU", /* TELUGU */ - "THAANA", /* THANA */ - "THAI", /* THAI */ - "TIBETAN", /* TIBETAN */ - "UCAS", /* UCAS */ - "YI", /* YI */ - - }; - - private static final String scriptAbbr[]= { - "Arab", /* ARABIC */ - "Armn", /* ARMENIAN */ - "Beng", /* BENGALI */ - "Bopo", /* BOPOMOFO */ - "Cans", /* UCAS */ - "Cher", /* CHEROKEE */ - "Cyrl", /* CYRILLIC */ - /* "Cyrs", */ /* CYRILLIC */ - "Deva", /* DEVANAGARI */ - "Dsrt", /* DESERET */ - "Ethi", /* ETHIOPIC */ - /* "Geoa", */ /* GEORGIAN */ - /* "Geon", */ /* GEORGIAN */ - "Geor", /* GEORGIAN */ - "Goth", /* GOTHIC */ - "Grek", /* GREEK */ - "Gujr", /* GUJARATI */ - "Guru", /* GURMUKHI */ - "Hang", /* HANGUL */ - "Hani", /* HAN */ - "Hebr", /* HEBREW */ - "Hira", /* HIRAGANA */ - "Ital", /* OLD_ITALIC */ - "Kana", /* KATAKANA */ - "Khmr", /* KHMER */ - "Knda", /* KANNADA */ - "Lao", /* LAO */ - /*"Laoo", */ /* LAO */ - /*"Latf", */ /* LATIN */ - /*"Latg", */ /* LATIN */ - "Latn", /* LATIN */ - "Mlym", /* MALAYALAM */ - "Mong", /* MONGOLIAN */ - "Mymr", /* MYANMAR */ - "Ogam", /* OGHAM */ - "Orya", /* ORIYA */ - "Qaac", /* COPTIC */ - "Qaai", /* INHERITED */ - "Runr", /* RUNIC */ - "Sinh", /* SINHALA */ - "Syrc", /* SYRIAC */ - /* "Syre", */ /* SYRIAC */ - /* "Syrj", */ /* SYRIAC */ - /* "Syrn", */ /* SYRIAC */ - "Taml", /* TAMIL */ - "Telu", /* TELUGU */ - "Thaa", /* THANA */ - "Thai", /* THAI */ - "Tibt", /* TIBETAN */ - "Yiii", /* YI */ - "Zyyy", /* COMMON */ - }; - - - private static final int scriptNameCodes[]= { - ARABIC , - ARMENIAN , - BENGALI , - BOPOMOFO , - UCAS , - CHEROKEE , - COMMON , - CYRILLIC , - DESERET , - DEVANAGARI , - ETHIOPIC , - GEORGIAN , - GOTHIC , - GREEK , - GUJARATI , - GURMUKHI , - HAN , - HANGUL , - HEBREW , - HIRAGANA , - INHERITED , - KANNADA , - KATAKANA , - KHMER , - LATIN , - MALAYALAM , - MONGOLIAN , - MYANMAR , - OGHAM , - OLD_ITALIC , - ORIYA , - RUNIC , - SINHALA , - SYRIAC , - TAMIL , - TELUGU , - THAANA , - THAI , - TIBETAN , - UCAS , - YI - }; - - - private static final int scriptAbbrCodes[] = { - ARABIC , - ARMENIAN , - BENGALI , - BOPOMOFO , - UCAS , - CHEROKEE , - CYRILLIC , - /* CYRILLIC , */ - DEVANAGARI , - DESERET , - ETHIOPIC , - /* GEORGIAN , */ - /* GEORGIAN , */ - GEORGIAN , - GOTHIC , - GREEK , - GUJARATI , - GURMUKHI , - HANGUL , - HAN , - HEBREW , - HIRAGANA , - OLD_ITALIC , - KATAKANA , - KHMER , - KANNADA , - LAO , - /* LAO , */ - /* LATIN , */ - /* LATIN , */ - LATIN , - MALAYALAM , - MONGOLIAN , - MYANMAR , - OGHAM , - ORIYA , - COPTIC , - INHERITED , - RUNIC , - SINHALA , - /* SYRIAC , */ - /* SYRIAC , */ - /* SYRIAC , */ - SYRIAC , - TAMIL , - TELUGU , - THAANA , - THAI , - TIBETAN , - YI , - COMMON , - }; - /********************************************************** - * - * WARNING: The below map is machine generated - * by genscrpt after parsing Scripts.txt, - * plese donot edit unless you know what you are doing - * - * TODO: Remove after merging script names to uprops.dat - * - ********************************************************** - */ - private static final class UScriptCodeMap { - int firstCodepoint; - int lastCodepoint; - int scriptCode; - public UScriptCodeMap(int firstCp, int lastCp, int code){ - firstCodepoint = firstCp; - lastCodepoint = lastCp; - scriptCode = code ; - } - }; - - private static final UScriptCodeMap[] scriptCodeIndex = { - new UScriptCodeMap(0x00000000, 0x00000000, COMMON) , - new UScriptCodeMap(0x00000041, 0x0000005A, LATIN ) , - new UScriptCodeMap(0x00000061, 0x0000007A, LATIN ) , - new UScriptCodeMap(0x000000AA, 0x000000AA, LATIN ) , - new UScriptCodeMap(0x000000B5, 0x000000B5, GREEK ) , - new UScriptCodeMap(0x000000BA, 0x000000BA, LATIN ) , - new UScriptCodeMap(0x000000C0, 0x000000D6, LATIN ) , - new UScriptCodeMap(0x000000D8, 0x000000F6, LATIN ) , - new UScriptCodeMap(0x000000F8, 0x000001BA, LATIN ) , - new UScriptCodeMap(0x000001BB, 0x000001BB, LATIN ) , - new UScriptCodeMap(0x000001BC, 0x000001BF, LATIN ) , - new UScriptCodeMap(0x000001C0, 0x000001C3, LATIN ) , - new UScriptCodeMap(0x000001C4, 0x0000021F, LATIN ) , - new UScriptCodeMap(0x00000222, 0x00000233, LATIN ) , - new UScriptCodeMap(0x00000250, 0x000002AD, LATIN ) , - new UScriptCodeMap(0x000002B0, 0x000002B8, LATIN ) , - new UScriptCodeMap(0x000002E0, 0x000002E4, LATIN ) , - new UScriptCodeMap(0x00000300, 0x0000034E, INHERITED ) , - new UScriptCodeMap(0x00000360, 0x00000362, INHERITED ) , - new UScriptCodeMap(0x0000037A, 0x0000037A, GREEK ) , - new UScriptCodeMap(0x00000386, 0x00000386, GREEK ) , - new UScriptCodeMap(0x00000388, 0x0000038A, GREEK ) , - new UScriptCodeMap(0x0000038C, 0x0000038C, GREEK ) , - new UScriptCodeMap(0x0000038E, 0x000003A1, GREEK ) , - new UScriptCodeMap(0x000003A3, 0x000003CE, GREEK ) , - new UScriptCodeMap(0x000003D0, 0x000003D7, GREEK ) , - new UScriptCodeMap(0x000003DA, 0x000003F5, GREEK ) , - new UScriptCodeMap(0x00000400, 0x00000481, CYRILLIC ) , - new UScriptCodeMap(0x00000483, 0x00000486, CYRILLIC ) , - new UScriptCodeMap(0x00000488, 0x00000489, INHERITED ) , - new UScriptCodeMap(0x0000048C, 0x000004C4, CYRILLIC ) , - new UScriptCodeMap(0x000004C7, 0x000004C8, CYRILLIC ) , - new UScriptCodeMap(0x000004CB, 0x000004CC, CYRILLIC ) , - new UScriptCodeMap(0x000004D0, 0x000004F5, CYRILLIC ) , - new UScriptCodeMap(0x000004F8, 0x000004F9, CYRILLIC ) , - new UScriptCodeMap(0x00000531, 0x00000556, ARMENIAN ) , - new UScriptCodeMap(0x00000559, 0x00000559, ARMENIAN ) , - new UScriptCodeMap(0x00000561, 0x00000587, ARMENIAN ) , - new UScriptCodeMap(0x00000591, 0x000005A1, INHERITED ) , - new UScriptCodeMap(0x000005A3, 0x000005B9, INHERITED ) , - new UScriptCodeMap(0x000005BB, 0x000005BD, INHERITED ) , - new UScriptCodeMap(0x000005BF, 0x000005BF, INHERITED ) , - new UScriptCodeMap(0x000005C1, 0x000005C2, INHERITED ) , - new UScriptCodeMap(0x000005C4, 0x000005C4, INHERITED ) , - new UScriptCodeMap(0x000005D0, 0x000005EA, HEBREW ) , - new UScriptCodeMap(0x000005F0, 0x000005F2, HEBREW ) , - new UScriptCodeMap(0x00000621, 0x0000063A, ARABIC ) , - new UScriptCodeMap(0x00000641, 0x0000064A, ARABIC ) , - new UScriptCodeMap(0x0000064B, 0x00000655, INHERITED ) , - new UScriptCodeMap(0x00000670, 0x00000670, INHERITED ) , - new UScriptCodeMap(0x00000671, 0x000006D3, ARABIC ) , - new UScriptCodeMap(0x000006D5, 0x000006D5, ARABIC ) , - new UScriptCodeMap(0x000006D6, 0x000006DC, INHERITED ) , - new UScriptCodeMap(0x000006DD, 0x000006DE, INHERITED ) , - new UScriptCodeMap(0x000006DF, 0x000006E4, INHERITED ) , - new UScriptCodeMap(0x000006E5, 0x000006E6, ARABIC ) , - new UScriptCodeMap(0x000006E7, 0x000006E8, INHERITED ) , - new UScriptCodeMap(0x000006EA, 0x000006ED, INHERITED ) , - new UScriptCodeMap(0x000006FA, 0x000006FC, ARABIC ) , - new UScriptCodeMap(0x00000710, 0x00000710, SYRIAC ) , - new UScriptCodeMap(0x00000711, 0x00000711, SYRIAC ) , - new UScriptCodeMap(0x00000712, 0x0000072C, SYRIAC ) , - new UScriptCodeMap(0x00000730, 0x0000074A, SYRIAC ) , - new UScriptCodeMap(0x00000780, 0x000007A5, THAANA ) , - new UScriptCodeMap(0x000007A6, 0x000007B0, THAANA ) , - new UScriptCodeMap(0x00000901, 0x00000902, DEVANAGARI ) , - new UScriptCodeMap(0x00000903, 0x00000903, DEVANAGARI ) , - new UScriptCodeMap(0x00000905, 0x00000939, DEVANAGARI ) , - new UScriptCodeMap(0x0000093C, 0x0000093C, DEVANAGARI ) , - new UScriptCodeMap(0x0000093D, 0x0000093D, DEVANAGARI ) , - new UScriptCodeMap(0x0000093E, 0x00000940, DEVANAGARI ) , - new UScriptCodeMap(0x00000941, 0x00000948, DEVANAGARI ) , - new UScriptCodeMap(0x00000949, 0x0000094C, DEVANAGARI ) , - new UScriptCodeMap(0x0000094D, 0x0000094D, DEVANAGARI ) , - new UScriptCodeMap(0x00000950, 0x00000950, DEVANAGARI ) , - new UScriptCodeMap(0x00000951, 0x00000954, DEVANAGARI ) , - new UScriptCodeMap(0x00000958, 0x00000961, DEVANAGARI ) , - new UScriptCodeMap(0x00000962, 0x00000963, DEVANAGARI ) , - new UScriptCodeMap(0x00000966, 0x0000096F, DEVANAGARI ) , - new UScriptCodeMap(0x00000981, 0x00000981, BENGALI ) , - new UScriptCodeMap(0x00000985, 0x0000098C, BENGALI ) , - new UScriptCodeMap(0x0000098F, 0x00000990, BENGALI ) , - new UScriptCodeMap(0x00000993, 0x000009A8, BENGALI ) , - new UScriptCodeMap(0x000009AA, 0x000009B0, BENGALI ) , - new UScriptCodeMap(0x000009B2, 0x000009B2, BENGALI ) , - new UScriptCodeMap(0x000009B6, 0x000009B9, BENGALI ) , - new UScriptCodeMap(0x000009BC, 0x000009BC, BENGALI ) , - new UScriptCodeMap(0x000009BE, 0x000009C0, BENGALI ) , - new UScriptCodeMap(0x000009C1, 0x000009C4, BENGALI ) , - new UScriptCodeMap(0x000009C7, 0x000009C8, BENGALI ) , - new UScriptCodeMap(0x000009CB, 0x000009CC, BENGALI ) , - new UScriptCodeMap(0x000009CD, 0x000009CD, BENGALI ) , - new UScriptCodeMap(0x000009D7, 0x000009D7, BENGALI ) , - new UScriptCodeMap(0x000009DC, 0x000009DD, BENGALI ) , - new UScriptCodeMap(0x000009DF, 0x000009E1, BENGALI ) , - new UScriptCodeMap(0x000009E2, 0x000009E3, BENGALI ) , - new UScriptCodeMap(0x000009E6, 0x000009EF, BENGALI ) , - new UScriptCodeMap(0x000009F0, 0x000009F1, BENGALI ) , - new UScriptCodeMap(0x00000A02, 0x00000A02, GURMUKHI ) , - new UScriptCodeMap(0x00000A05, 0x00000A0A, GURMUKHI ) , - new UScriptCodeMap(0x00000A0F, 0x00000A10, GURMUKHI ) , - new UScriptCodeMap(0x00000A13, 0x00000A28, GURMUKHI ) , - new UScriptCodeMap(0x00000A2A, 0x00000A30, GURMUKHI ) , - new UScriptCodeMap(0x00000A32, 0x00000A33, GURMUKHI ) , - new UScriptCodeMap(0x00000A35, 0x00000A36, GURMUKHI ) , - new UScriptCodeMap(0x00000A38, 0x00000A39, GURMUKHI ) , - new UScriptCodeMap(0x00000A3C, 0x00000A3C, GURMUKHI ) , - new UScriptCodeMap(0x00000A3E, 0x00000A40, GURMUKHI ) , - new UScriptCodeMap(0x00000A41, 0x00000A42, GURMUKHI ) , - new UScriptCodeMap(0x00000A47, 0x00000A48, GURMUKHI ) , - new UScriptCodeMap(0x00000A4B, 0x00000A4D, GURMUKHI ) , - new UScriptCodeMap(0x00000A59, 0x00000A5C, GURMUKHI ) , - new UScriptCodeMap(0x00000A5E, 0x00000A5E, GURMUKHI ) , - new UScriptCodeMap(0x00000A66, 0x00000A6F, GURMUKHI ) , - new UScriptCodeMap(0x00000A70, 0x00000A71, GURMUKHI ) , - new UScriptCodeMap(0x00000A72, 0x00000A74, GURMUKHI ) , - new UScriptCodeMap(0x00000A81, 0x00000A82, GUJARATI ) , - new UScriptCodeMap(0x00000A83, 0x00000A83, GUJARATI ) , - new UScriptCodeMap(0x00000A85, 0x00000A8B, GUJARATI ) , - new UScriptCodeMap(0x00000A8D, 0x00000A8D, GUJARATI ) , - new UScriptCodeMap(0x00000A8F, 0x00000A91, GUJARATI ) , - new UScriptCodeMap(0x00000A93, 0x00000AA8, GUJARATI ) , - new UScriptCodeMap(0x00000AAA, 0x00000AB0, GUJARATI ) , - new UScriptCodeMap(0x00000AB2, 0x00000AB3, GUJARATI ) , - new UScriptCodeMap(0x00000AB5, 0x00000AB9, GUJARATI ) , - new UScriptCodeMap(0x00000ABC, 0x00000ABC, GUJARATI ) , - new UScriptCodeMap(0x00000ABD, 0x00000ABD, GUJARATI ) , - new UScriptCodeMap(0x00000ABE, 0x00000AC0, GUJARATI ) , - new UScriptCodeMap(0x00000AC1, 0x00000AC5, GUJARATI ) , - new UScriptCodeMap(0x00000AC7, 0x00000AC8, GUJARATI ) , - new UScriptCodeMap(0x00000AC9, 0x00000AC9, GUJARATI ) , - new UScriptCodeMap(0x00000ACB, 0x00000ACC, GUJARATI ) , - new UScriptCodeMap(0x00000ACD, 0x00000ACD, GUJARATI ) , - new UScriptCodeMap(0x00000AD0, 0x00000AD0, GUJARATI ) , - new UScriptCodeMap(0x00000AE0, 0x00000AE0, GUJARATI ) , - new UScriptCodeMap(0x00000AE6, 0x00000AEF, GUJARATI ) , - new UScriptCodeMap(0x00000B01, 0x00000B01, ORIYA ) , - new UScriptCodeMap(0x00000B02, 0x00000B03, ORIYA ) , - new UScriptCodeMap(0x00000B05, 0x00000B0C, ORIYA ) , - new UScriptCodeMap(0x00000B0F, 0x00000B10, ORIYA ) , - new UScriptCodeMap(0x00000B13, 0x00000B28, ORIYA ) , - new UScriptCodeMap(0x00000B2A, 0x00000B30, ORIYA ) , - new UScriptCodeMap(0x00000B32, 0x00000B33, ORIYA ) , - new UScriptCodeMap(0x00000B36, 0x00000B39, ORIYA ) , - new UScriptCodeMap(0x00000B3C, 0x00000B3C, ORIYA ) , - new UScriptCodeMap(0x00000B3D, 0x00000B3D, ORIYA ) , - new UScriptCodeMap(0x00000B3E, 0x00000B3E, ORIYA ) , - new UScriptCodeMap(0x00000B3F, 0x00000B3F, ORIYA ) , - new UScriptCodeMap(0x00000B40, 0x00000B40, ORIYA ) , - new UScriptCodeMap(0x00000B41, 0x00000B43, ORIYA ) , - new UScriptCodeMap(0x00000B47, 0x00000B48, ORIYA ) , - new UScriptCodeMap(0x00000B4B, 0x00000B4C, ORIYA ) , - new UScriptCodeMap(0x00000B4D, 0x00000B4D, ORIYA ) , - new UScriptCodeMap(0x00000B56, 0x00000B56, ORIYA ) , - new UScriptCodeMap(0x00000B57, 0x00000B57, ORIYA ) , - new UScriptCodeMap(0x00000B5C, 0x00000B5D, ORIYA ) , - new UScriptCodeMap(0x00000B5F, 0x00000B61, ORIYA ) , - new UScriptCodeMap(0x00000B66, 0x00000B6F, ORIYA ) , - new UScriptCodeMap(0x00000B82, 0x00000B82, TAMIL ) , - new UScriptCodeMap(0x00000B83, 0x00000B83, TAMIL ) , - new UScriptCodeMap(0x00000B85, 0x00000B8A, TAMIL ) , - new UScriptCodeMap(0x00000B8E, 0x00000B90, TAMIL ) , - new UScriptCodeMap(0x00000B92, 0x00000B95, TAMIL ) , - new UScriptCodeMap(0x00000B99, 0x00000B9A, TAMIL ) , - new UScriptCodeMap(0x00000B9C, 0x00000B9C, TAMIL ) , - new UScriptCodeMap(0x00000B9E, 0x00000B9F, TAMIL ) , - new UScriptCodeMap(0x00000BA3, 0x00000BA4, TAMIL ) , - new UScriptCodeMap(0x00000BA8, 0x00000BAA, TAMIL ) , - new UScriptCodeMap(0x00000BAE, 0x00000BB5, TAMIL ) , - new UScriptCodeMap(0x00000BB7, 0x00000BB9, TAMIL ) , - new UScriptCodeMap(0x00000BBE, 0x00000BBF, TAMIL ) , - new UScriptCodeMap(0x00000BC0, 0x00000BC0, TAMIL ) , - new UScriptCodeMap(0x00000BC1, 0x00000BC2, TAMIL ) , - new UScriptCodeMap(0x00000BC6, 0x00000BC8, TAMIL ) , - new UScriptCodeMap(0x00000BCA, 0x00000BCC, TAMIL ) , - new UScriptCodeMap(0x00000BCD, 0x00000BCD, TAMIL ) , - new UScriptCodeMap(0x00000BD7, 0x00000BD7, TAMIL ) , - new UScriptCodeMap(0x00000BE7, 0x00000BEF, TAMIL ) , - new UScriptCodeMap(0x00000BF0, 0x00000BF2, TAMIL ) , - new UScriptCodeMap(0x00000C01, 0x00000C03, TELUGU ) , - new UScriptCodeMap(0x00000C05, 0x00000C0C, TELUGU ) , - new UScriptCodeMap(0x00000C0E, 0x00000C10, TELUGU ) , - new UScriptCodeMap(0x00000C12, 0x00000C28, TELUGU ) , - new UScriptCodeMap(0x00000C2A, 0x00000C33, TELUGU ) , - new UScriptCodeMap(0x00000C35, 0x00000C39, TELUGU ) , - new UScriptCodeMap(0x00000C3E, 0x00000C40, TELUGU ) , - new UScriptCodeMap(0x00000C41, 0x00000C44, TELUGU ) , - new UScriptCodeMap(0x00000C46, 0x00000C48, TELUGU ) , - new UScriptCodeMap(0x00000C4A, 0x00000C4D, TELUGU ) , - new UScriptCodeMap(0x00000C55, 0x00000C56, TELUGU ) , - new UScriptCodeMap(0x00000C60, 0x00000C61, TELUGU ) , - new UScriptCodeMap(0x00000C66, 0x00000C6F, TELUGU ) , - new UScriptCodeMap(0x00000C82, 0x00000C83, KANNADA ) , - new UScriptCodeMap(0x00000C85, 0x00000C8C, KANNADA ) , - new UScriptCodeMap(0x00000C8E, 0x00000C90, KANNADA ) , - new UScriptCodeMap(0x00000C92, 0x00000CA8, KANNADA ) , - new UScriptCodeMap(0x00000CAA, 0x00000CB3, KANNADA ) , - new UScriptCodeMap(0x00000CB5, 0x00000CB9, KANNADA ) , - new UScriptCodeMap(0x00000CBE, 0x00000CBE, KANNADA ) , - new UScriptCodeMap(0x00000CBF, 0x00000CBF, KANNADA ) , - new UScriptCodeMap(0x00000CC0, 0x00000CC4, KANNADA ) , - new UScriptCodeMap(0x00000CC6, 0x00000CC6, KANNADA ) , - new UScriptCodeMap(0x00000CC7, 0x00000CC8, KANNADA ) , - new UScriptCodeMap(0x00000CCA, 0x00000CCB, KANNADA ) , - new UScriptCodeMap(0x00000CCC, 0x00000CCD, KANNADA ) , - new UScriptCodeMap(0x00000CD5, 0x00000CD6, KANNADA ) , - new UScriptCodeMap(0x00000CDE, 0x00000CDE, KANNADA ) , - new UScriptCodeMap(0x00000CE0, 0x00000CE1, KANNADA ) , - new UScriptCodeMap(0x00000CE6, 0x00000CEF, KANNADA ) , - new UScriptCodeMap(0x00000D02, 0x00000D03, MALAYALAM ) , - new UScriptCodeMap(0x00000D05, 0x00000D0C, MALAYALAM ) , - new UScriptCodeMap(0x00000D0E, 0x00000D10, MALAYALAM ) , - new UScriptCodeMap(0x00000D12, 0x00000D28, MALAYALAM ) , - new UScriptCodeMap(0x00000D2A, 0x00000D39, MALAYALAM ) , - new UScriptCodeMap(0x00000D3E, 0x00000D40, MALAYALAM ) , - new UScriptCodeMap(0x00000D41, 0x00000D43, MALAYALAM ) , - new UScriptCodeMap(0x00000D46, 0x00000D48, MALAYALAM ) , - new UScriptCodeMap(0x00000D4A, 0x00000D4C, MALAYALAM ) , - new UScriptCodeMap(0x00000D4D, 0x00000D4D, MALAYALAM ) , - new UScriptCodeMap(0x00000D57, 0x00000D57, MALAYALAM ) , - new UScriptCodeMap(0x00000D60, 0x00000D61, MALAYALAM ) , - new UScriptCodeMap(0x00000D66, 0x00000D6F, MALAYALAM ) , - new UScriptCodeMap(0x00000D82, 0x00000D83, SINHALA ) , - new UScriptCodeMap(0x00000D85, 0x00000D96, SINHALA ) , - new UScriptCodeMap(0x00000D9A, 0x00000DB1, SINHALA ) , - new UScriptCodeMap(0x00000DB3, 0x00000DBB, SINHALA ) , - new UScriptCodeMap(0x00000DBD, 0x00000DBD, SINHALA ) , - new UScriptCodeMap(0x00000DC0, 0x00000DC6, SINHALA ) , - new UScriptCodeMap(0x00000DCA, 0x00000DCA, SINHALA ) , - new UScriptCodeMap(0x00000DCF, 0x00000DD1, SINHALA ) , - new UScriptCodeMap(0x00000DD2, 0x00000DD4, SINHALA ) , - new UScriptCodeMap(0x00000DD6, 0x00000DD6, SINHALA ) , - new UScriptCodeMap(0x00000DD8, 0x00000DDF, SINHALA ) , - new UScriptCodeMap(0x00000DF2, 0x00000DF3, SINHALA ) , - new UScriptCodeMap(0x00000E01, 0x00000E30, THAI ) , - new UScriptCodeMap(0x00000E31, 0x00000E31, THAI ) , - new UScriptCodeMap(0x00000E32, 0x00000E33, THAI ) , - new UScriptCodeMap(0x00000E34, 0x00000E3A, THAI ) , - new UScriptCodeMap(0x00000E40, 0x00000E45, THAI ) , - new UScriptCodeMap(0x00000E46, 0x00000E46, THAI ) , - new UScriptCodeMap(0x00000E47, 0x00000E4E, THAI ) , - new UScriptCodeMap(0x00000E50, 0x00000E59, THAI ) , - new UScriptCodeMap(0x00000E81, 0x00000E82, LAO ) , - new UScriptCodeMap(0x00000E84, 0x00000E84, LAO ) , - new UScriptCodeMap(0x00000E87, 0x00000E88, LAO ) , - new UScriptCodeMap(0x00000E8A, 0x00000E8A, LAO ) , - new UScriptCodeMap(0x00000E8D, 0x00000E8D, LAO ) , - new UScriptCodeMap(0x00000E94, 0x00000E97, LAO ) , - new UScriptCodeMap(0x00000E99, 0x00000E9F, LAO ) , - new UScriptCodeMap(0x00000EA1, 0x00000EA3, LAO ) , - new UScriptCodeMap(0x00000EA5, 0x00000EA5, LAO ) , - new UScriptCodeMap(0x00000EA7, 0x00000EA7, LAO ) , - new UScriptCodeMap(0x00000EAA, 0x00000EAB, LAO ) , - new UScriptCodeMap(0x00000EAD, 0x00000EB0, LAO ) , - new UScriptCodeMap(0x00000EB1, 0x00000EB1, LAO ) , - new UScriptCodeMap(0x00000EB2, 0x00000EB3, LAO ) , - new UScriptCodeMap(0x00000EB4, 0x00000EB9, LAO ) , - new UScriptCodeMap(0x00000EBB, 0x00000EBC, LAO ) , - new UScriptCodeMap(0x00000EBD, 0x00000EBD, LAO ) , - new UScriptCodeMap(0x00000EC0, 0x00000EC4, LAO ) , - new UScriptCodeMap(0x00000EC6, 0x00000EC6, LAO ) , - new UScriptCodeMap(0x00000EC8, 0x00000ECD, LAO ) , - new UScriptCodeMap(0x00000ED0, 0x00000ED9, LAO ) , - new UScriptCodeMap(0x00000EDC, 0x00000EDD, LAO ) , - new UScriptCodeMap(0x00000F00, 0x00000F00, TIBETAN ) , - new UScriptCodeMap(0x00000F18, 0x00000F19, TIBETAN ) , - new UScriptCodeMap(0x00000F20, 0x00000F29, TIBETAN ) , - new UScriptCodeMap(0x00000F2A, 0x00000F33, TIBETAN ) , - new UScriptCodeMap(0x00000F35, 0x00000F35, TIBETAN ) , - new UScriptCodeMap(0x00000F37, 0x00000F37, TIBETAN ) , - new UScriptCodeMap(0x00000F39, 0x00000F39, TIBETAN ) , - new UScriptCodeMap(0x00000F40, 0x00000F47, TIBETAN ) , - new UScriptCodeMap(0x00000F49, 0x00000F6A, TIBETAN ) , - new UScriptCodeMap(0x00000F71, 0x00000F7E, TIBETAN ) , - new UScriptCodeMap(0x00000F7F, 0x00000F7F, TIBETAN ) , - new UScriptCodeMap(0x00000F80, 0x00000F84, TIBETAN ) , - new UScriptCodeMap(0x00000F86, 0x00000F87, TIBETAN ) , - new UScriptCodeMap(0x00000F88, 0x00000F8B, TIBETAN ) , - new UScriptCodeMap(0x00000F90, 0x00000F97, TIBETAN ) , - new UScriptCodeMap(0x00000F99, 0x00000FBC, TIBETAN ) , - new UScriptCodeMap(0x00000FC6, 0x00000FC6, TIBETAN ) , - new UScriptCodeMap(0x00001000, 0x00001021, MYANMAR ) , - new UScriptCodeMap(0x00001023, 0x00001027, MYANMAR ) , - new UScriptCodeMap(0x00001029, 0x0000102A, MYANMAR ) , - new UScriptCodeMap(0x0000102C, 0x0000102C, MYANMAR ) , - new UScriptCodeMap(0x0000102D, 0x00001030, MYANMAR ) , - new UScriptCodeMap(0x00001031, 0x00001031, MYANMAR ) , - new UScriptCodeMap(0x00001032, 0x00001032, MYANMAR ) , - new UScriptCodeMap(0x00001036, 0x00001037, MYANMAR ) , - new UScriptCodeMap(0x00001038, 0x00001038, MYANMAR ) , - new UScriptCodeMap(0x00001039, 0x00001039, MYANMAR ) , - new UScriptCodeMap(0x00001040, 0x00001049, MYANMAR ) , - new UScriptCodeMap(0x00001050, 0x00001055, MYANMAR ) , - new UScriptCodeMap(0x00001056, 0x00001057, MYANMAR ) , - new UScriptCodeMap(0x00001058, 0x00001059, MYANMAR ) , - new UScriptCodeMap(0x000010A0, 0x000010C5, GEORGIAN ) , - new UScriptCodeMap(0x000010D0, 0x000010F6, GEORGIAN ) , - new UScriptCodeMap(0x00001100, 0x00001159, HANGUL ) , - new UScriptCodeMap(0x0000115F, 0x000011A2, HANGUL ) , - new UScriptCodeMap(0x000011A8, 0x000011F9, HANGUL ) , - new UScriptCodeMap(0x00001200, 0x00001206, ETHIOPIC ) , - new UScriptCodeMap(0x00001208, 0x00001246, ETHIOPIC ) , - new UScriptCodeMap(0x00001248, 0x00001248, ETHIOPIC ) , - new UScriptCodeMap(0x0000124A, 0x0000124D, ETHIOPIC ) , - new UScriptCodeMap(0x00001250, 0x00001256, ETHIOPIC ) , - new UScriptCodeMap(0x00001258, 0x00001258, ETHIOPIC ) , - new UScriptCodeMap(0x0000125A, 0x0000125D, ETHIOPIC ) , - new UScriptCodeMap(0x00001260, 0x00001286, ETHIOPIC ) , - new UScriptCodeMap(0x00001288, 0x00001288, ETHIOPIC ) , - new UScriptCodeMap(0x0000128A, 0x0000128D, ETHIOPIC ) , - new UScriptCodeMap(0x00001290, 0x000012AE, ETHIOPIC ) , - new UScriptCodeMap(0x000012B0, 0x000012B0, ETHIOPIC ) , - new UScriptCodeMap(0x000012B2, 0x000012B5, ETHIOPIC ) , - new UScriptCodeMap(0x000012B8, 0x000012BE, ETHIOPIC ) , - new UScriptCodeMap(0x000012C0, 0x000012C0, ETHIOPIC ) , - new UScriptCodeMap(0x000012C2, 0x000012C5, ETHIOPIC ) , - new UScriptCodeMap(0x000012C8, 0x000012CE, ETHIOPIC ) , - new UScriptCodeMap(0x000012D0, 0x000012D6, ETHIOPIC ) , - new UScriptCodeMap(0x000012D8, 0x000012EE, ETHIOPIC ) , - new UScriptCodeMap(0x000012F0, 0x0000130E, ETHIOPIC ) , - new UScriptCodeMap(0x00001310, 0x00001310, ETHIOPIC ) , - new UScriptCodeMap(0x00001312, 0x00001315, ETHIOPIC ) , - new UScriptCodeMap(0x00001318, 0x0000131E, ETHIOPIC ) , - new UScriptCodeMap(0x00001320, 0x00001346, ETHIOPIC ) , - new UScriptCodeMap(0x00001348, 0x0000135A, ETHIOPIC ) , - new UScriptCodeMap(0x00001369, 0x00001371, ETHIOPIC ) , - new UScriptCodeMap(0x00001372, 0x0000137C, ETHIOPIC ) , - new UScriptCodeMap(0x000013A0, 0x000013F4, CHEROKEE ) , - new UScriptCodeMap(0x00001401, 0x0000166C, UCAS ) , - new UScriptCodeMap(0x0000166F, 0x00001676, UCAS ) , - new UScriptCodeMap(0x00001681, 0x0000169A, OGHAM ) , - new UScriptCodeMap(0x000016A0, 0x000016EA, RUNIC ) , - new UScriptCodeMap(0x000016EE, 0x000016F0, RUNIC ) , - new UScriptCodeMap(0x00001780, 0x000017B3, KHMER ) , - new UScriptCodeMap(0x000017B4, 0x000017B6, KHMER ) , - new UScriptCodeMap(0x000017B7, 0x000017BD, KHMER ) , - new UScriptCodeMap(0x000017BE, 0x000017C5, KHMER ) , - new UScriptCodeMap(0x000017C6, 0x000017C6, KHMER ) , - new UScriptCodeMap(0x000017C7, 0x000017C8, KHMER ) , - new UScriptCodeMap(0x000017C9, 0x000017D3, KHMER ) , - new UScriptCodeMap(0x000017E0, 0x000017E9, KHMER ) , - new UScriptCodeMap(0x00001810, 0x00001819, MONGOLIAN ) , - new UScriptCodeMap(0x00001820, 0x00001842, MONGOLIAN ) , - new UScriptCodeMap(0x00001843, 0x00001843, MONGOLIAN ) , - new UScriptCodeMap(0x00001844, 0x00001877, MONGOLIAN ) , - new UScriptCodeMap(0x00001880, 0x000018A8, MONGOLIAN ) , - new UScriptCodeMap(0x000018A9, 0x000018A9, MONGOLIAN ) , - new UScriptCodeMap(0x00001E00, 0x00001E9B, LATIN ) , - new UScriptCodeMap(0x00001EA0, 0x00001EF9, LATIN ) , - new UScriptCodeMap(0x00001F00, 0x00001F15, GREEK ) , - new UScriptCodeMap(0x00001F18, 0x00001F1D, GREEK ) , - new UScriptCodeMap(0x00001F20, 0x00001F45, GREEK ) , - new UScriptCodeMap(0x00001F48, 0x00001F4D, GREEK ) , - new UScriptCodeMap(0x00001F50, 0x00001F57, GREEK ) , - new UScriptCodeMap(0x00001F59, 0x00001F59, GREEK ) , - new UScriptCodeMap(0x00001F5B, 0x00001F5B, GREEK ) , - new UScriptCodeMap(0x00001F5D, 0x00001F5D, GREEK ) , - new UScriptCodeMap(0x00001F5F, 0x00001F7D, GREEK ) , - new UScriptCodeMap(0x00001F80, 0x00001FB4, GREEK ) , - new UScriptCodeMap(0x00001FB6, 0x00001FBC, GREEK ) , - new UScriptCodeMap(0x00001FBE, 0x00001FBE, GREEK ) , - new UScriptCodeMap(0x00001FC2, 0x00001FC4, GREEK ) , - new UScriptCodeMap(0x00001FC6, 0x00001FCC, GREEK ) , - new UScriptCodeMap(0x00001FD0, 0x00001FD3, GREEK ) , - new UScriptCodeMap(0x00001FD6, 0x00001FDB, GREEK ) , - new UScriptCodeMap(0x00001FE0, 0x00001FEC, GREEK ) , - new UScriptCodeMap(0x00001FF2, 0x00001FF4, GREEK ) , - new UScriptCodeMap(0x00001FF6, 0x00001FFC, GREEK ) , - new UScriptCodeMap(0x0000207F, 0x0000207F, LATIN ) , - new UScriptCodeMap(0x000020D0, 0x000020DC, INHERITED ) , - new UScriptCodeMap(0x000020DD, 0x000020E0, INHERITED ) , - new UScriptCodeMap(0x000020E1, 0x000020E1, INHERITED ) , - new UScriptCodeMap(0x000020E2, 0x000020E3, INHERITED ) , - new UScriptCodeMap(0x00002126, 0x00002126, GREEK ) , - new UScriptCodeMap(0x0000212A, 0x0000212B, LATIN ) , - new UScriptCodeMap(0x00002E80, 0x00002E99, HAN ) , - new UScriptCodeMap(0x00002E9B, 0x00002EF3, HAN ) , - new UScriptCodeMap(0x00002F00, 0x00002FD5, HAN ) , - new UScriptCodeMap(0x00003005, 0x00003005, HAN ) , - new UScriptCodeMap(0x00003007, 0x00003007, HAN ) , - new UScriptCodeMap(0x00003021, 0x00003029, HAN ) , - new UScriptCodeMap(0x0000302A, 0x0000302F, INHERITED ) , - new UScriptCodeMap(0x00003038, 0x0000303A, HAN ) , - new UScriptCodeMap(0x00003041, 0x00003094, HIRAGANA ) , - new UScriptCodeMap(0x00003099, 0x0000309A, INHERITED ) , - new UScriptCodeMap(0x0000309D, 0x0000309E, HIRAGANA ) , - new UScriptCodeMap(0x000030A1, 0x000030FA, KATAKANA ) , - new UScriptCodeMap(0x000030FD, 0x000030FE, KATAKANA ) , - new UScriptCodeMap(0x00003105, 0x0000312C, BOPOMOFO ) , - new UScriptCodeMap(0x00003131, 0x0000318E, HANGUL ) , - new UScriptCodeMap(0x000031A0, 0x000031B7, BOPOMOFO ) , - new UScriptCodeMap(0x00003400, 0x00004DB5, HAN ) , - new UScriptCodeMap(0x00004E00, 0x00009FA5, HAN ) , - new UScriptCodeMap(0x0000A000, 0x0000A48C, YI ) , - new UScriptCodeMap(0x0000A490, 0x0000A4A1, YI ) , - new UScriptCodeMap(0x0000A4A4, 0x0000A4B3, YI ) , - new UScriptCodeMap(0x0000A4B5, 0x0000A4C0, YI ) , - new UScriptCodeMap(0x0000A4C2, 0x0000A4C4, YI ) , - new UScriptCodeMap(0x0000A4C6, 0x0000A4C6, YI ) , - new UScriptCodeMap(0x0000AC00, 0x0000D7A3, HANGUL ) , - new UScriptCodeMap(0x0000F900, 0x0000FA2D, HAN ) , - new UScriptCodeMap(0x0000FB00, 0x0000FB06, LATIN ) , - new UScriptCodeMap(0x0000FB13, 0x0000FB17, ARMENIAN ) , - new UScriptCodeMap(0x0000FB1D, 0x0000FB1D, HEBREW ) , - new UScriptCodeMap(0x0000FB1E, 0x0000FB1E, INHERITED ) , - new UScriptCodeMap(0x0000FB1F, 0x0000FB28, HEBREW ) , - new UScriptCodeMap(0x0000FB2A, 0x0000FB36, HEBREW ) , - new UScriptCodeMap(0x0000FB38, 0x0000FB3C, HEBREW ) , - new UScriptCodeMap(0x0000FB3E, 0x0000FB3E, HEBREW ) , - new UScriptCodeMap(0x0000FB40, 0x0000FB41, HEBREW ) , - new UScriptCodeMap(0x0000FB43, 0x0000FB44, HEBREW ) , - new UScriptCodeMap(0x0000FB46, 0x0000FB4F, HEBREW ) , - new UScriptCodeMap(0x0000FB50, 0x0000FBB1, ARABIC ) , - new UScriptCodeMap(0x0000FBD3, 0x0000FD3D, ARABIC ) , - new UScriptCodeMap(0x0000FD50, 0x0000FD8F, ARABIC ) , - new UScriptCodeMap(0x0000FD92, 0x0000FDC7, ARABIC ) , - new UScriptCodeMap(0x0000FDF0, 0x0000FDFB, ARABIC ) , - new UScriptCodeMap(0x0000FE20, 0x0000FE23, INHERITED ) , - new UScriptCodeMap(0x0000FE70, 0x0000FE72, ARABIC ) , - new UScriptCodeMap(0x0000FE74, 0x0000FE74, ARABIC ) , - new UScriptCodeMap(0x0000FE76, 0x0000FEFC, ARABIC ) , - new UScriptCodeMap(0x0000FF21, 0x0000FF3A, LATIN ) , - new UScriptCodeMap(0x0000FF41, 0x0000FF5A, LATIN ) , - new UScriptCodeMap(0x0000FF66, 0x0000FF6F, KATAKANA ) , - new UScriptCodeMap(0x0000FF71, 0x0000FF9D, KATAKANA ) , - new UScriptCodeMap(0x0000FFA0, 0x0000FFBE, HANGUL ) , - new UScriptCodeMap(0x0000FFC2, 0x0000FFC7, HANGUL ) , - new UScriptCodeMap(0x0000FFCA, 0x0000FFCF, HANGUL ) , - new UScriptCodeMap(0x0000FFD2, 0x0000FFD7, HANGUL ) , - new UScriptCodeMap(0x0000FFDA, 0x0000FFDC, HANGUL ) , - new UScriptCodeMap(0x00010300, 0x0001031E, OLD_ITALIC ) , - new UScriptCodeMap(0x00010330, 0x00010349, GOTHIC ) , - new UScriptCodeMap(0x0001034A, 0x0001034A, GOTHIC ) , - new UScriptCodeMap(0x00010400, 0x00010425, DESERET ) , - new UScriptCodeMap(0x00010428, 0x0001044D, DESERET ) , - new UScriptCodeMap(0x0001D167, 0x0001D169, INHERITED ) , - new UScriptCodeMap(0x0001D17B, 0x0001D182, INHERITED ) , - new UScriptCodeMap(0x0001D185, 0x0001D18B, INHERITED ) , - new UScriptCodeMap(0x0001D1AA, 0x0001D1AD, INHERITED ) , - new UScriptCodeMap(0x00020000, 0x0002A6D6, HAN ) , - }; - - - /* binary search the string array */ - private static int findStringIndex(String[] sortedArr, String target){ - int size = sortedArr.length; - int left, middle, right,rc; - left =0; - right= size-1; - - while(left <= right){ - middle = (left+right)/2; - rc=sortedArr[middle].toUpperCase().compareTo(target.toUpperCase()); - if(rc<0){ - left = middle+1; - }else if(rc >0){ - right = middle -1; - }else{ - return middle; - } - } - return -1; - } - - /* linearly search the array and return the index */ - private static int findCodeIndex(int[] unsorted, int target){ - int size = unsorted.length; - int i=0; - while(i0){ - temp = temp.substring(0,index); - }else{ - break; - } - continue; - } - } - }catch( MissingResourceException ex){ - throw new InternalError(); - } - return code; - } - - /* binary search the string array */ - private static int findScriptCode(int codepoint){ - int left, middle, right,rc; - left =0; - - right= scriptCodeIndex.length-1; - - while(left <= right){ - middle = (left+right)/2; - /* check if the codepoint is the valid range */ - if(scriptCodeIndex[middle].firstCodepoint<= codepoint && - scriptCodeIndex[middle].lastCodepoint>= codepoint){ - rc = 0; - }else if(codepoint> scriptCodeIndex[middle].lastCodepoint){ - rc =-1; - }else { - rc = 1; - } - - if(rc<0){ - left = middle+1; - }else if(rc >0){ - right = middle -1; - }else{ - return scriptCodeIndex[middle].scriptCode; - } - } - return -1; - } - - - /** - * Gets a script codes associated with the given locale or ISO 15924 abbreviation or name. - * Returns MALAYAM given "Malayam" OR "Mlym". - * Returns LATIN given "en" OR "en_US" - * @param locale Locale - * @return The script codes array. null if the the code cannot be found. - * @exception MissingResourceException - * @draft - */ - public static final int[] getCode(Locale locale) - throws MissingResourceException{ - return findCodeFromLocale(locale); - } - - /** - * Gets a script codes associated with the given locale or ISO 15924 abbreviation or name. - * Returns MALAYAM given "Malayam" OR "Mlym". - * Returns LATIN given "en" OR "en_US" - * @param nameOrAbbrOrLocale name of the script or ISO 15924 code or locale - * @return The script codes array. null if the the code cannot be found. - * @draft - */ - public static final int[] getCode(String nameOrAbbrOrLocale){ - - int[] code = new int[1]; - code[0] = INVALID_CODE; - int strIndex=0; - - /* try the Names array first */ - strIndex = findStringIndex(scriptNames, nameOrAbbrOrLocale); - - if(strIndex>=0 && strIndex < scriptNames.length){ - code[0] = scriptNameCodes[strIndex]; - } - /* we did not find in names array so try abbr array*/ - if(code[0] == INVALID_CODE){ - strIndex = findStringIndex(scriptAbbr, nameOrAbbrOrLocale); - if(strIndex>=0 && strIndex < scriptAbbr.length){ - code[0] = scriptAbbrCodes[strIndex]; - } - } - /* we still haven't found it try locale */ - if(code[0]==INVALID_CODE){ - code = findCodeFromLocale(new Locale(nameOrAbbrOrLocale,"")); - } - return code; - } - /** - * Gets the script code associated with the given codepoint. - * Returns UScript.MALAYAM given 0x0D02 - * @param codepoint UChar32 codepoint - * @param err the error status code. - * @return The script code - * @exception IllegalArgumentException - * @draft - */ - public static final int getScript(int codepoint){ - if (codepoint >= UCharacter.MIN_VALUE & codepoint <= UCharacter.MAX_VALUE) { - return findScriptCode(codepoint); - }else{ - throw new IllegalArgumentException(Integer.toString(codepoint)); - } - } - - /** - * Gets a script name associated with the given script code. - * Returns "Malayam" given MALAYAM - * @param scriptCode int script code - * @return script name as a string in full as given in TR#24 - * @exception IllegalArgumentException - * @draft - */ - public static final String getName(int scriptCode){ - int index = -1; - if(scriptCode > CODE_LIMIT){ - throw new IllegalArgumentException(Integer.toString(scriptCode)); - } - index = findCodeIndex(scriptNameCodes,scriptCode); - if(index >=0){ - return scriptNames[index]; - }else{ - throw new IllegalArgumentException(Integer.toString(scriptCode)); - } - } - - /** - * Gets a script name associated with the given script code. - * Returns "Mlym" given MALAYAM - * @param scriptCode int script code - * @return script abbreviated name as a string as given in TR#24 - * @exception IllegalArgumentException - * @draft - */ - public static final String getShortName(int scriptCode){ - int index = -1; - if(scriptCode > CODE_LIMIT){ - throw new IllegalArgumentException(Integer.toString(scriptCode)); - } - index = findCodeIndex(scriptAbbrCodes,scriptCode); - if(index >=0){ - return scriptAbbr[index]; - }else{ - throw new IllegalArgumentException(Integer.toString(scriptCode)); - } - } -} - diff --git a/icu4j/src/com/ibm/text/UTF16.java b/icu4j/src/com/ibm/text/UTF16.java deleted file mode 100755 index c06c49f1b0..0000000000 --- a/icu4j/src/com/ibm/text/UTF16.java +++ /dev/null @@ -1,2172 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2001, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UTF16.java,v $ -* $Date: 2002/02/08 01:13:42 $ -* $Revision: 1.11 $ -* -******************************************************************************* -*/ - -package com.ibm.text; - -/** -* Standalone utility class providing UTF16 character conversions and indexing -* conversions. -*

    Code that uses strings alone rarely need modification. -* By design, UTF-16 does not allow overlap, so searching for strings is a safe -* operation. Similarly, concatenation is always safe. Substringing is safe if -* the start and end are both on UTF-32 boundaries. In normal code, the values -* for start and end are on those boundaries, since they arose from operations -* like searching. If not, the nearest UTF-32 boundaries can be determined -* using bounds(). -* Examples: -*

    The following examples illustrate use of some of these methods. -*

    -* // iteration forwards: Original
    -* for (int i = 0; i < s.length(); ++i) {
    -*   char ch = s.charAt(i);
    -*   doSomethingWith(ch);
    -* }
    -*
    -* // iteration forwards: Changes for UTF-32
    -* int ch;
    -* for (int i = 0; i < s.length(); i+=UTF16.getCharCount(ch)) {
    -*   ch = UTF16.charAt(s,i);
    -*   doSomethingWith(ch);
    -* }
    -*
    -* // iteration backwards: Original
    -* for (int i = s.length() -1; i >= 0; --i) {
    -*   char ch = s.charAt(i);
    -*   doSomethingWith(ch);
    -* }
    -*  
    -* // iteration backwards: Changes for UTF-32
    -* int ch;
    -* for (int i = s.length() -1; i > 0; i-=UTF16.getCharCount(ch)) {
    -*   ch = UTF16.charAt(s,i);
    -*   doSomethingWith(ch);
    -* }
    -* 
    -* Notes: -*
      -*
    • -* Naming: For clarity, High and Low surrogates are called -* Lead and Trail in the API, which gives a better -* sense of their ordering in a string. offset16 and -* offset32 are used to distinguish offsets to UTF-16 -* boundaries vs offsets to UTF-32 boundaries. int char32 is -* used to contain UTF-32 characters, as opposed to char16, -* which is a UTF-16 code unit. -*
    • -*
    • -* Roundtripping Offsets: You can always roundtrip from a -* UTF-32 offset to a UTF-16 offset and back. Because of the difference in -* structure, you can roundtrip from a UTF-16 offset to a UTF-32 offset and -* back if and only if bounds(string, offset16) != TRAIL. -*
    • -*
    • -* Exceptions: The error checking will throw an exception -* if indices are out of bounds. Other than than that, all methods will -* behave reasonably, even if unmatched surrogates or out-of-bounds UTF-32 -* values are present. UCharacter.isLegal() can be used to check -* for validity if desired. -*
    • -*
    • -* Unmatched Surrogates: If the string contains unmatched -* surrogates, then these are counted as one UTF-32 value. This matches -* their iteration behavior, which is vital. It also matches common display -* practice as missing glyphs (see the Unicode Standard Section 5.4, 5.5). -*
    • -*
    • -* Optimization: The method implementations may need -* optimization if the compiler doesn't fold static final methods. Since -* surrogate pairs will form an exceeding small percentage of all the text -* in the world, the singleton case should always be optimized for. -*
    • -*
    -* @author Mark Davis, with help from Markus Scherer -* @since Nov2400 -*/ - -public final class UTF16 -{ - // public variables ============================================= - - /** - * Value returned in - * bounds(). - * These values are chosen specifically so that it actually represents - * the position of the character - * [offset16 - (value >> 2), offset16 + (value & 3)] - */ - public static final int SINGLE_CHAR_BOUNDARY = 1, - LEAD_SURROGATE_BOUNDARY = 2, - TRAIL_SURROGATE_BOUNDARY = 5; - - // private variables ============================================ - - /** - * Lead surrogates values from LEAD_SURROGATE_MIN_VALUE_ to - * LEAD_SURROGATE_MAX_VALUE_ - */ - private static final int LEAD_SURROGATE_MIN_VALUE_ = 0xD800; - private static final int LEAD_SURROGATE_MAX_VALUE_ = 0xDBFF; - - /** - * Surrogate lead offset, to be used when breaking up UTF32 into surrogate - * pair - */ - private static final int LEAD_SURROGATE_OFFSET_ = - LEAD_SURROGATE_MIN_VALUE_ - - (UCharacter.SUPPLEMENTARY_MIN_VALUE - >> UCharacter.LEAD_SURROGATE_SHIFT_); - - /** - * Trail surrogates values from TRAIL_SURROGATE_MIN_VALUE_ to - * TRAIL_SURROGATE_MAX_VALUE_ - */ - private static final int TRAIL_SURROGATE_MIN_VALUE_ = 0xDC00; - private static final int TRAIL_SURROGATE_MAX_VALUE_ = 0xDFFF; - - // constructor ================================================== - - /** - * Prevent instance from being created. - */ - private UTF16() - { - } - - // public method ================================================ - - /** - * Extract a single UTF-32 value from a string. - * Used when iterating forwards or backwards (with - * UTF16.getCharCount(), as well as random access. If a - * validity check is required, use - * - * UCharacter.isLegal() on the return value. - * If the char retrieved is part of a surrogate pair, its supplementary - * character will be returned. If a complete supplementary character is - * not found the incomplete character will be returned - * @param source array of UTF-16 chars - * @param offset16 UTF-16 offset to the start of the character. - * @return UTF-32 value for the UTF-32 value that contains the char at - * offset16. The boundaries of that codepoint are the same as in - * bounds32(). - * @exception IndexOutOfBoundsException thrown if offset16 is out of - * bounds. - */ - public static int charAt(String source, int offset16) - { - if (offset16 < 0 || offset16 >= source.length()) { - throw new StringIndexOutOfBoundsException(offset16); - } - - char single = source.charAt(offset16); - if (!isSurrogate(single)) { - return single; - } - - // Convert the UTF-16 surrogate pair if necessary. - // For simplicity in usage, and because the frequency of pairs is - // low, look both directions. - - if (isLeadSurrogate(single)) - { - ++ offset16; - if (source.length() != offset16) - { - char trail = source.charAt(offset16); - if (isTrailSurrogate(trail)) - return UCharacter.getRawSupplementary(single, trail); - } - } - else - { - -- offset16; - if (offset16 >= 0) - { - // single is a trail surrogate so - char lead = source.charAt(offset16); - if (isLeadSurrogate(lead)) - return UCharacter.getRawSupplementary(lead, single); - } - } - return single; // return unmatched surrogate - } - - /** - * Extract a single UTF-32 value from a string. - * Used when iterating forwards or backwards (with - * UTF16.getCharCount(), as well as random access. If a - * validity check is required, use - * UCharacter.isLegal() - * on the return value. - * If the char retrieved is part of a surrogate pair, its supplementary - * character will be returned. If a complete supplementary character is - * not found the incomplete character will be returned - * @param source UTF-16 chars string buffer - * @param offset16 UTF-16 offset to the start of the character. - * @return UTF-32 value for the UTF-32 value that contains the char at - * offset16. The boundaries of that codepoint are the same as in - * bounds32(). - * @exception IndexOutOfBoundsException thrown if offset16 is out of - * bounds. - */ - public static int charAt(StringBuffer source, int offset16) - { - if (offset16 < 0 || offset16 >= source.length()) { - throw new StringIndexOutOfBoundsException(offset16); - } - - char single = source.charAt(offset16); - if (!isSurrogate(single)) { - return single; - } - - // Convert the UTF-16 surrogate pair if necessary. - // For simplicity in usage, and because the frequency of pairs is - // low, look both directions. - - if (isLeadSurrogate(single)) - { - ++ offset16; - if (source.length() != offset16) - { - char trail = source.charAt(offset16); - if (isTrailSurrogate(trail)) - return UCharacter.getRawSupplementary(single, trail); - } - } - else - { - -- offset16; - if (offset16 >= 0) - { - // single is a trail surrogate so - char lead = source.charAt(offset16); - if (isLeadSurrogate(lead)) { - return UCharacter.getRawSupplementary(lead, single); - } - } - } - return single; // return unmatched surrogate - } - - /** - * Extract a single UTF-32 value from a substring. - * Used when iterating forwards or backwards (with - * UTF16.getCharCount(), as well as random access. If a - * validity check is required, use - * UCharacter.isLegal() - * on the return value. - * If the char retrieved is part of a surrogate pair, its supplementary - * character will be returned. If a complete supplementary character is - * not found the incomplete character will be returned - * @param source array of UTF-16 chars - * @param start offset to substring in the source array for analyzing - * @param limit offset to substring in the source array for analyzing - * @param offset16 UTF-16 offset relative to start - * @return UTF-32 value for the UTF-32 value that contains the char at - * offset16. The boundaries of that codepoint are the same as in - * bounds32(). - * @exception IndexOutOfBoundsException thrown if offset16 is not within - * the range of start and limit. - */ - public static int charAt(char source[], int start, int limit, - int offset16) - { - offset16 += start; - if (offset16 < start || offset16 >= limit) { - throw new ArrayIndexOutOfBoundsException(offset16); - } - - char single = source[offset16]; - if (!isSurrogate(single)) { - return single; - } - - // Convert the UTF-16 surrogate pair if necessary. - // For simplicity in usage, and because the frequency of pairs is - // low, look both directions. - if (isLeadSurrogate(single)) { - offset16 ++; - if (offset16 >= limit) { - return single; - } - char trail = source[offset16]; - if (isTrailSurrogate(trail)) { - return UCharacter.getRawSupplementary(single, trail); - } - } - else { // isTrailSurrogate(single), so - if (offset16 == start) { - return single; - } - offset16 --; - char lead = source[offset16]; - if (isLeadSurrogate(lead)) - return UCharacter.getRawSupplementary(lead, single); - } - return single; // return unmatched surrogate - } - - /** - * Extract a single UTF-32 value from a string. - * Used when iterating forwards or backwards (with - * UTF16.getCharCount(), as well as random access. If a - * validity check is required, use - * UCharacter.isLegal() - * on the return value. - * If the char retrieved is part of a surrogate pair, its supplementary - * character will be returned. If a complete supplementary character is - * not found the incomplete character will be returned - * @param source UTF-16 chars string buffer - * @param offset16 UTF-16 offset to the start of the character. - * @return UTF-32 value for the UTF-32 value that contains the char at - * offset16. The boundaries of that codepoint are the same as in - * bounds32(). - * @exception IndexOutOfBoundsException thrown if offset16 is out of - * bounds. - */ - public static int charAt(Replaceable source, int offset16) - { - if (offset16 < 0 || offset16 >= source.length()) { - throw new StringIndexOutOfBoundsException(offset16); - } - - char single = source.charAt(offset16); - if (!isSurrogate(single)) { - return single; - } - - // Convert the UTF-16 surrogate pair if necessary. - // For simplicity in usage, and because the frequency of pairs is - // low, look both directions. - - if (isLeadSurrogate(single)) - { - ++ offset16; - if (source.length() != offset16) - { - char trail = source.charAt(offset16); - if (isTrailSurrogate(trail)) - return UCharacter.getRawSupplementary(single, trail); - } - } - else - { - -- offset16; - if (offset16 >= 0) - { - // single is a trail surrogate so - char lead = source.charAt(offset16); - if (isLeadSurrogate(lead)) { - return UCharacter.getRawSupplementary(lead, single); - } - } - } - return single; // return unmatched surrogate - } - - /** - * Extract a single UTF-32 value from a string. - * If a validity check is required, use - * - * UCharacter.isLegal() on the return value. - * If tbe char retrieved is part of a surrogate pair, its supplementary - * character will be returned. If a complete supplementary character is - * not found the incomplete character will be returned - * @return UTF-32 value for the UTF-32 value that contains the char at - * offset16. The boundaries of that codepoint are the same as in - * bounds32(). - * @param source array of UTF-16 chars - * @param offset32 UTF-32 offset to the start of the character. - * @return a single UTF32 value - * @exception IndexOutOfBoundsException if offset16 is out of bounds. - * @deprecated to be removed after the year 2002, replaced by - * UTF16.charAt(source, UTF16.findOffsetFromCodePoint(source, - * offset32)); - */ - public static int charAtCodePointOffset(String source, int offset32) - { - return charAt(source, findOffsetFromCodePoint(source, offset32)); - } - - /** - * Determines how many chars this char32 requires. - * If a validity check is required, use - * isLegal() on - * char32 before calling. - * @param ch the input character. - * @return 2 if is in surrogate space, otherwise 1. - */ - public static int getCharCount(int char32) - { - if (char32 < UCharacter.SUPPLEMENTARY_MIN_VALUE) { - return 1; - } - return 2; - } - - /** - * Returns the type of the boundaries around the char at offset16. - * Used for random access. - * @param source text to analyse - * @param offset16 UTF-16 offset - * @return
      - *
    • SINGLE_CHAR_BOUNDARY : a single char; the bounds are - * [offset16, offset16+1] - *
    • LEAD_SURROGATE_BOUNDARY : a surrogate pair starting at - * offset16; - * the bounds are - * [offset16, offset16 + 2] - *
    • TRAIL_SURROGATE_BOUNDARY : a surrogate pair starting at - * offset16 - 1; the bounds are - * [offset16 - 1, offset16 + 1] - *
    - * For bit-twiddlers, the return values for these are chosen so - * that the boundaries can be gotten by: - * [offset16 - (value >> 2), offset16 + (value & 3)]. - * @exception IndexOutOfBoundsException if offset16 is out of bounds. - */ - public static int bounds(String source, int offset16) - { - char ch = source.charAt(offset16); - if (isSurrogate(ch)) { - if (isLeadSurrogate(ch)) - { - if (++ offset16 < source.length() && - isTrailSurrogate(source.charAt(offset16))) { - return LEAD_SURROGATE_BOUNDARY; - } - } - else { - // isTrailSurrogate(ch), so - -- offset16; - if (offset16 >= 0 && isLeadSurrogate(source.charAt(offset16))) { - return TRAIL_SURROGATE_BOUNDARY; - } - } - } - return SINGLE_CHAR_BOUNDARY; - } - - /** - * Returns the type of the boundaries around the char at offset16. Used - * for random access. - * @param source string buffer to analyse - * @param offset16 UTF16 offset - * @return - *
      - *
    • SINGLE_CHAR_BOUNDARY : a single char; the bounds are - * [offset16, offset16 + 1] - *
    • LEAD_SURROGATE_BOUNDARY : a surrogate pair starting at - * offset16; the bounds are - * [offset16, offset16 + 2] - *
    • TRAIL_SURROGATE_BOUNDARY : a surrogate pair starting at - * offset16 - 1; the bounds are - * [offset16 - 1, offset16 + 1] - *
    - * For bit-twiddlers, the return values for these are chosen so that the - * boundaries can be gotten by: - * [offset16 - (value >> 2), offset16 + (value & 3)]. - * @exception IndexOutOfBoundsException if offset16 is out of bounds. - */ - public static int bounds(StringBuffer source, int offset16) - { - char ch = source.charAt(offset16); - if (isSurrogate(ch)) { - if (isLeadSurrogate(ch)) - { - if (++ offset16 < source.length() && - isTrailSurrogate(source.charAt(offset16))) { - return LEAD_SURROGATE_BOUNDARY; - } - } - else { - // isTrailSurrogate(ch), so - -- offset16; - if (offset16 >= 0 && - isLeadSurrogate(source.charAt(offset16))) { - return TRAIL_SURROGATE_BOUNDARY; - } - } - } - return SINGLE_CHAR_BOUNDARY; - } - - /** - * Returns the type of the boundaries around the char at offset16. Used - * for random access. Note that the boundaries are determined with respect - * to the subarray, hence the char array {0xD800, 0xDC00} has the result - * SINGLE_CHAR_BOUNDARY for start = offset16 = 0 and limit = 1. - * @param source char array to analyse - * @param start offset to substring in the source array for analyzing - * @param limit offset to substring in the source array for analyzing - * @param offset16 UTF16 offset relative to start - * @return - *
      - *
    • SINGLE_CHAR_BOUNDARY : a single char; the bounds are - *
    • LEAD_SURROGATE_BOUNDARY : a surrogate pair starting at - * offset16; the bounds are [offset16, offset16 + 2] - *
    • TRAIL_SURROGATE_BOUNDARY : a surrogate pair starting at - * offset16 - 1; the bounds are [offset16 - 1, offset16 + 1] - *
    - * For bit-twiddlers, the boundary values for these are chosen so that the - * boundaries can be gotten by: [offset16 - (boundvalue >> 2), offset16 - * + (boundvalue & 3)]. - * @exception IndexOutOfBoundsException if offset16 is not within the - * range of start and limit. - */ - public static int bounds(char source[], int start, int limit, - int offset16) - { - offset16 += start; - if (offset16 < start || offset16 >= limit) { - throw new ArrayIndexOutOfBoundsException(offset16); - } - char ch = source[offset16]; - if (isSurrogate(ch)) { - if (isLeadSurrogate(ch)) { - ++ offset16; - if (offset16 < limit && isTrailSurrogate(source[offset16])) { - return LEAD_SURROGATE_BOUNDARY; - } - } - else { // isTrailSurrogate(ch), so - -- offset16; - if (offset16 >= start && isLeadSurrogate(source[offset16])) { - return TRAIL_SURROGATE_BOUNDARY; - } - } - } - return SINGLE_CHAR_BOUNDARY; - } - - /** - * Returns the type of the boundaries around the char at offset32. Used - * for random access. - * @param source string to analyse - * @param offset32 UTF32 offset - * @return - *
      - *
    • SINGLE_CHAR_BOUNDARY : a single char - *
    • LEAD_SURROGATE_BOUNDARY : a surrogate pair starting at - * offset32 - *
    - * For bit-twiddlers, see - * bounds(java.lang.String, int) for information on the choice of the - * boundary values. - * @exception IndexOutOfBoundsException if offset16 is out of bounds. - * @deprecated will be removed after end of year 2002, replaced by - * UTF16.bounds(source, UTF16.findOffsetFromCodePoint(source, offset32)); - */ - public static int boundsAtCodePointOffset(String source, int offset32) - { - return bounds(source, findOffsetFromCodePoint(source, offset32)); - } - - /** - * Determines whether the code value is a surrogate. - * @param ch the input character. - * @return true iff the input character is a surrogate. - */ - public static boolean isSurrogate(char char16) - { - return LEAD_SURROGATE_MIN_VALUE_ <= char16 && - char16 <= TRAIL_SURROGATE_MAX_VALUE_; - } - - /** - * Determines whether the character is a trail surrogate. - * @param char16 the input character. - * @return true iff the input character is a trail surrogate. - */ - public static boolean isTrailSurrogate(char char16) - { - return (TRAIL_SURROGATE_MIN_VALUE_ <= char16 && - char16 <= TRAIL_SURROGATE_MAX_VALUE_); - } - - /** - * Determines whether the character is a lead surrogate. - * @param char16 the input character. - * @return true iff the input character is a lead surrogate - */ - public static boolean isLeadSurrogate(char char16) - { - return LEAD_SURROGATE_MIN_VALUE_ <= char16 && - char16 <= LEAD_SURROGATE_MAX_VALUE_; - } - - /** - * Returns the lead surrogate. - * If a validity check is required, use - * isLegal() - * on char32 before calling. - * @param char32 the input character. - * @return lead surrogate if the getCharCount(ch) is 2;
    - * and 0 otherwise (note: 0 is not a valid lead surrogate). - */ - public static char getLeadSurrogate(int char32) - { - if (char32 >= UCharacter.SUPPLEMENTARY_MIN_VALUE) { - return (char)(LEAD_SURROGATE_OFFSET_ + - (char32 >> UCharacter.LEAD_SURROGATE_SHIFT_)); - } - - return 0; - } - - /** - * Returns the trail surrogate. - * If a validity check is required, use - * isLegal() - * on char32 before calling. - * @param char32 the input character. - * @return the trail surrogate if the getCharCount(ch) is 2;
    otherwise - * the character itself - */ - public static char getTrailSurrogate(int char32) - { - if (char32 >= UCharacter.SUPPLEMENTARY_MIN_VALUE) { - return (char)(TRAIL_SURROGATE_MIN_VALUE_ + (char32 & - UCharacter.TRAIL_SURROGATE_MASK_)); - } - - return (char)char32; - } - - /** - * Convenience method corresponding to String.valueOf(char). Returns a one - * or two char string containing the UTF-32 value in UTF16 format. If a - * validity check is required, use - * isLegal() on - * char32 before calling. - * @param char32 the input character. - * @return string value of char32 in UTF16 format - * @exception IllegalArgumentException thrown if char32 is a invalid - * codepoint. - */ - public static String valueOf(int char32) - { - if (char32 < UCharacter.MIN_VALUE || char32 > UCharacter.MAX_VALUE) { - throw new IllegalArgumentException("Illegal codepoint"); - } - if (char32 < UCharacter.SUPPLEMENTARY_MIN_VALUE) { - return String.valueOf((char)char32); - } - char str[] = new char[2]; - str[0] = (char)(LEAD_SURROGATE_OFFSET_ + - (char32 >> UCharacter.LEAD_SURROGATE_SHIFT_)); - str[1] = (char)(TRAIL_SURROGATE_MIN_VALUE_ + - (char32 & UCharacter.TRAIL_SURROGATE_MASK_)); - return String.valueOf(str); - } - - /** - * Convenience method corresponding to String.valueOf(codepoint at - * offset16). - * Returns a one or two char string containing the UTF-32 value in UTF16 - * format. If offset16 indexes a surrogate character, the whole - * supplementary codepoint will be returned. - * If a validity check is required, use - * isLegal() on the - * codepoint at offset16 before calling. - * The result returned will be a newly created String obtained by calling - * source.substring(..) with the appropriate indexes. - * @param source the input string. - * @param offset16 the UTF16 index to the codepoint in source - * @return string value of char32 in UTF16 format - */ - public static String valueOf(String source, int offset16) - { - switch (bounds(source, offset16)) { - case LEAD_SURROGATE_BOUNDARY: - return source.substring(offset16, offset16 + 2); - case TRAIL_SURROGATE_BOUNDARY: - return source.substring(offset16 - 1, offset16 + 1); - default: return source.substring(offset16, offset16 + 1); - } - } - - /** - * Convenience method corresponding to - * StringBuffer.valueOf(codepoint at offset16). - * Returns a one or two char string containing the UTF-32 value in UTF16 - * format. If offset16 indexes a surrogate character, the whole - * supplementary codepoint will be returned. - * If a validity check is required, use - * isLegal() on the - * codepoint at offset16 before calling. - * The result returned will be a newly created String obtained by calling - * source.substring(..) with the appropriate indexes. - * @param source the input string buffer. - * @param offset16 the UTF16 index to the codepoint in source - * @return string value of char32 in UTF16 format - */ - public static String valueOf(StringBuffer source, int offset16) - { - switch (bounds(source, offset16)) { - case LEAD_SURROGATE_BOUNDARY: - return source.substring(offset16, offset16 + 2); - case TRAIL_SURROGATE_BOUNDARY: - return source.substring(offset16 - 1, offset16 + 1); - default: return source.substring(offset16, offset16 + 1); - } - } - - /** - * Convenience method. - * Returns a one or two char string containing the UTF-32 value in UTF16 - * format. If offset16 indexes a surrogate character, the whole - * supplementary codepoint will be returned, except when either the - * leading or trailing surrogate character lies out of the specified - * subarray. In the latter case, only the surrogate character within - * bounds will be returned. - * If a validity check is required, use - * isLegal() on the - * codepoint at offset16 before calling. - * The result returned will be a newly created String containing the - * relevant characters. - * @param source the input char array. - * @param start start index of the subarray - * @param limit end index of the subarray - * @param offset16 the UTF16 index to the codepoint in source relative to - * start - * @return string value of char32 in UTF16 format - */ - public static String valueOf(char source[], int start, int limit, - int offset16) - { - switch (bounds(source, start, limit, offset16)) { - case LEAD_SURROGATE_BOUNDARY: - return new String(source, start + offset16, 2); - case TRAIL_SURROGATE_BOUNDARY: - return new String(source, start + offset16 - 1, 2); - } - return new String(source, start + offset16, 1); - } - - /** - * Returns the UTF-16 offset that corresponds to a UTF-32 offset. - * Used for random access. See the class description - * for notes on roundtripping. - * @param source the UTF-16 string - * @param offset32 UTF-32 offset - * @return UTF-16 offset - * @exception IndexOutOfBoundsException if offset32 is out of bounds. - */ - public static int findOffsetFromCodePoint(String source, int offset32) - { - char ch; - int size = source.length(), - result = 0, - count = offset32; - if (offset32 < 0 || offset32 > size) { - throw new StringIndexOutOfBoundsException(offset32); - } - while (result < size && count > 0) - { - ch = source.charAt(result); - if (isLeadSurrogate(ch) && ((result + 1) < size) && - isTrailSurrogate(source.charAt(result + 1))) { - result ++; - } - - count --; - result ++; - } - if (count != 0) { - throw new StringIndexOutOfBoundsException(offset32); - } - return result; - } - - /** - * Returns the UTF-16 offset that corresponds to a UTF-32 offset. - * Used for random access. See the class description - * for notes on roundtripping. - * @param source the UTF-16 string buffer - * @param offset32 UTF-32 offset - * @return UTF-16 offset - * @exception IndexOutOfBoundsException if offset32 is out of bounds. - */ - public static int findOffsetFromCodePoint(StringBuffer source, - int offset32) - { - char ch; - int size = source.length(), - result = 0, - count = offset32; - if (offset32 < 0 || offset32 > size) { - throw new StringIndexOutOfBoundsException(offset32); - } - while (result < size && count > 0) - { - ch = source.charAt(result); - if (isLeadSurrogate(ch) && ((result + 1) < size) && - isTrailSurrogate(source.charAt(result + 1))) { - result ++; - } - - count --; - result ++; - } - if (count != 0) { - throw new StringIndexOutOfBoundsException(offset32); - } - return result; - } - - /** - * Returns the UTF-16 offset that corresponds to a UTF-32 offset. - * Used for random access. See the class description - * for notes on roundtripping. - * @param source the UTF-16 char array whose substring is to be analysed - * @param start offset of the substring to be analysed - * @param limit offset of the substring to be analysed - * @param offset32 UTF-32 offset relative to start - * @return UTF-16 offset relative to start - * @exception IndexOutOfBoundsException if offset32 is out of bounds. - */ - public static int findOffsetFromCodePoint(char source[], int start, - int limit, int offset32) - { - char ch; - int result = start, - count = offset32; - if (offset32 > limit - start) { - throw new ArrayIndexOutOfBoundsException(offset32); - } - while (result < limit && count > 0) - { - ch = source[result]; - if (isLeadSurrogate(ch) && ((result + 1) < limit) && - isTrailSurrogate(source[result + 1])) { - result ++; - } - - count --; - result ++; - } - if (count != 0) { - throw new ArrayIndexOutOfBoundsException(offset32); - } - return result - start; - } - - /** - * Returns the UTF-32 offset corresponding to the first UTF-32 boundary at - * or after the given UTF-16 offset. Used for random access. See the - * class description for notes on roundtripping.
    - * Note: If the UTF-16 offset is into the middle of a surrogate pair, - * then the UTF-32 offset of the lead of the pair is - * returned. - * - *

    - * To find the UTF-32 length of a string, use: - *

    -    *     len32 = countCodePoint(source, source.length());
    -    *   
    - *

    - *

    - * @param source text to analyse - * @param offset16 UTF-16 offset < source text length. - * @return UTF-32 offset - * @exception IndexOutOfBoundsException if offset16 is out of bounds. - */ - public static int findCodePointOffset(String source, int offset16) - { - if (offset16 < 0 || offset16 > source.length()) { - throw new StringIndexOutOfBoundsException(offset16); - } - - int result = 0; - char ch; - boolean hadLeadSurrogate = false; - - for (int i = 0; i < offset16; ++ i) - { - ch = source.charAt(i); - if (hadLeadSurrogate && isTrailSurrogate(ch)) { - hadLeadSurrogate = false; // count valid trail as zero - } - else - { - hadLeadSurrogate = isLeadSurrogate(ch); - ++ result; // count others as 1 - } - } - - if (offset16 == source.length()) { - return result; - } - - // end of source being the less significant surrogate character - // shift result back to the start of the supplementary character - if (hadLeadSurrogate && (isTrailSurrogate(source.charAt(offset16)))) { - result --; - } - - return result; - } - - /** - * Returns the UTF-32 offset corresponding to the first UTF-32 boundary at - * the given UTF-16 offset. Used for random access. See the - * class description for notes on roundtripping.
    - * Note: If the UTF-16 offset is into the middle of a surrogate pair, - * then the UTF-32 offset of the lead of the pair is - * returned. - * - *

    - * To find the UTF-32 length of a string, use: - *

    -    *     len32 = countCodePoint(source);
    -    *   
    - *

    - *

    - * @param source text to analyse - * @param offset16 UTF-16 offset < source text length. - * @return UTF-32 offset - * @exception IndexOutOfBoundsException if offset16 is out of bounds. - */ - public static int findCodePointOffset(StringBuffer source, int offset16) - { - if (offset16 < 0 || offset16 > source.length()) { - throw new StringIndexOutOfBoundsException(offset16); - } - - int result = 0; - char ch; - boolean hadLeadSurrogate = false; - - for (int i = 0; i < offset16; ++ i) - { - ch = source.charAt(i); - if (hadLeadSurrogate && isTrailSurrogate(ch)) { - hadLeadSurrogate = false; // count valid trail as zero - } - else - { - hadLeadSurrogate = isLeadSurrogate(ch); - ++ result; // count others as 1 - } - } - - if (offset16 == source.length()) { - return result; - } - - // end of source being the less significant surrogate character - // shift result back to the start of the supplementary character - if (hadLeadSurrogate && (isTrailSurrogate(source.charAt(offset16)))) - { - result --; - } - - return result; - } - - /** - * Returns the UTF-32 offset corresponding to the first UTF-32 boundary at - * the given UTF-16 offset. Used for random access. See the - * class description for notes on roundtripping.
    - * Note: If the UTF-16 offset is into the middle of a surrogate pair, - * then the UTF-32 offset of the lead of the pair is - * returned. - * - *

    - * To find the UTF-32 length of a substring, use: - *

    -    *     len32 = countCodePoint(source, start, limit);
    -    *   
    - *

    - *

    - * @param source text to analyse - * @param start offset of the substring - * @param limit offset of the substring - * @param offset16 UTF-16 relative to start - * @return UTF-32 offset relative to start - * @exception IndexOutOfBoundsException if offset16 is not within the - * range of start and limit. - */ - public static int findCodePointOffset(char source[], int start, int limit, - int offset16) - { - offset16 += start; - if (offset16 > limit) { - throw new StringIndexOutOfBoundsException(offset16); - } - - int result = 0; - char ch; - boolean hadLeadSurrogate = false; - - for (int i = start; i < offset16; ++ i) - { - ch = source[i]; - if (hadLeadSurrogate && isTrailSurrogate(ch)) { - hadLeadSurrogate = false; // count valid trail as zero - } - else - { - hadLeadSurrogate = isLeadSurrogate(ch); - ++ result; // count others as 1 - } - } - - if (offset16 == limit) { - return result; - } - - // end of source being the less significant surrogate character - // shift result back to the start of the supplementary character - if (hadLeadSurrogate && (isTrailSurrogate(source[offset16]))) { - result --; - } - - return result; - } - - /** - * Append a single UTF-32 value to the end of a StringBuffer. - * If a validity check is required, use - * isLegal() on - * char32 before calling. - * @param char32 value to append. If out of bounds, substitutes - * UTF32.REPLACEMENT_CHAR. - * @return the updated StringBuffer - */ - public static StringBuffer append(StringBuffer target, int char32) - { - // Check for irregular values - if (char32 < UCharacter.MIN_VALUE || char32 > UCharacter.MAX_VALUE) { - throw new IllegalArgumentException("Illegal codepoint"); - } - - // Write the UTF-16 values - if (char32 >= UCharacter.SUPPLEMENTARY_MIN_VALUE) - { - target.append(getLeadSurrogate(char32)); - target.append(getTrailSurrogate(char32)); - } - else { - target.append((char)char32); - } - return target; - } - - /** - * Adds a codepoint to offset16 position of the argument char array. - * @param target char array to be append with the new code point - * @param limit UTF16 offset which the codepoint will be appended. - * @param char32 code point to be appended - * @return offset after char32 in the array. - * @exception IndexOutOfBoundsException thrown if there is not enough - * space for the append. - */ - public static int append(char[] target, int limit, int char32) - { - // Check for irregular values - if (char32 < UCharacter.MIN_VALUE || char32 > UCharacter.MAX_VALUE) { - throw new IllegalArgumentException("Illegal codepoint"); - } - // Write the UTF-16 values - if (char32 >= UCharacter.SUPPLEMENTARY_MIN_VALUE) - { - target[limit ++] = getLeadSurrogate(char32); - target[limit ++] = getTrailSurrogate(char32); - } - else { - target[limit ++] = (char)char32; - } - return limit; - } - - /** - * Number of codepoints in a UTF16 String - * @param source UTF16 string - * @return number of codepoint in string - */ - public static int countCodePoint(String source) - { - if (source == null || source.length() == 0) { - return 0; - } - return findCodePointOffset(source, source.length()); - } - - /** - * Number of codepoints in a UTF16 String buffer - * @param source UTF16 string buffer - * @return number of codepoint in string - */ - public static int countCodePoint(StringBuffer source) - { - if (source == null || source.length() == 0) { - return 0; - } - return findCodePointOffset(source, source.length()); - } - - /** - * Number of codepoints in a UTF16 char array substring - * @param source UTF16 char array - * @param start offset of the substring - * @param limit offset of the substring - * @return number of codepoint in the substring - * @exception IndexOutOfBoundsException if start and limit are not valid. - */ - public static int countCodePoint(char source[], int start, int limit) - { - if (source == null || source.length == 0) { - return 0; - } - return findCodePointOffset(source, start, limit, limit) - - findCodePointOffset(source, start, limit, start); - } - - /** - * Sets a code point into a UTF32 position. - * Adjusts target according if we are replacing a non-supplementary - * codepoint with a supplementary and vice versa. - * @param target stringbuffer - * @param offset32 UTF32 position to insert into - * @exception IndexOutOfBoundsException if offset32 is out of bounds. - * @param char32 code point - * @deprecated to be removed after the year 2002, - * UTF16.setCharAt(target, - * findOffsetFromCodePoint(target.toString(), offset32), - * char32); - */ - public static void setCharAtCodePointOffset(StringBuffer target, - int offset32, int char32) - { - int offset16 = findOffsetFromCodePoint(target.toString(), offset32); - setCharAt(target, offset16, char32); - } - - /** - * Set a code point into a UTF16 position. - * Adjusts target according if we are replacing a non-supplementary - * codepoint with a supplementary and vice versa. - * @param target stringbuffer - * @param offset16 UTF16 position to insert into - * @param char32 code point - */ - public static void setCharAt(StringBuffer target, int offset16, - int char32) - { - int count = 1; - char single = target.charAt(offset16); - - if (isSurrogate(single)) - { - // pairs of the surrogate with offset16 at the lead char found - if (isLeadSurrogate(single) && (target.length() > offset16 + 1) - && isTrailSurrogate(target.charAt(offset16 + 1))) { - count ++; - } - else { - // pairs of the surrogate with offset16 at the trail char - // found - if (isTrailSurrogate(single) && (offset16 > 0) && - isLeadSurrogate(target.charAt(offset16 -1))) - { - offset16 --; - count ++; - } - } - } - target.replace(offset16, offset16 + count, valueOf(char32)); - } - - /** - * Set a code point into a UTF16 position in a char array. - * Adjusts target according if we are replacing a non-supplementary - * codepoint with a supplementary and vice versa. - * @param target char array - * @param limit numbers of valid chars in target, different from - * target.length. limit counts the number of chars in target - * that represents a string, not the size of array target. - * @param offset16 UTF16 position to insert into - * @param char32 code point - * @return new number of chars in target that represents a string - * @exception IndexOutOfBoundsException if offset16 is out of range - */ - public static int setCharAt(char target[], int limit, - int offset16, int char32) - { - if (offset16 >= limit) { - throw new ArrayIndexOutOfBoundsException(offset16); - } - int count = 1; - char single = target[offset16]; - - if (isSurrogate(single)) - { - // pairs of the surrogate with offset16 at the lead char found - if (isLeadSurrogate(single) && (target.length > offset16 + 1) && - isTrailSurrogate(target[offset16 + 1])) { - count ++; - } - else { - // pairs of the surrogate with offset16 at the trail char - // found - if (isTrailSurrogate(single) && (offset16 > 0) && - isLeadSurrogate(target[offset16 -1])) - { - offset16 --; - count ++; - } - } - } - - String str = valueOf(char32); - int result = limit; - int strlength = str.length(); - target[offset16] = str.charAt(0); - if (count == strlength) { - if (count == 2) { - target[offset16 + 1] = str.charAt(1); - } - } - else { - // this is not exact match in space, we'll have to do some - // shifting - System.arraycopy(target, offset16 + count, target, - offset16 + strlength, limit - (offset16 + count)); - if (count < strlength) { - // char32 is a supplementary character trying to squeeze into - // a non-supplementary space - target[offset16 + 1] = str.charAt(1); - result ++; - if (result < target.length) { - target[result] = 0; - } - } - else { - // char32 is a non-supplementary character trying to fill - // into a supplementary space - result --; - target[result] = 0; - } - } - return result; - } - - /** - * Shifts offset16 by the argument number of codepoints - * @param source string - * @param offset16 UTF16 position to shift - * @param shift32 number of codepoints to shift - * @return new shifted offset16 - * @exception IndexOutOfBoundsException if the new offset16 is out of - * bounds. - */ - public static int moveCodePointOffset(String source, int offset16, - int shift32) - { - int size = source.length(); - if (offset16 < 0 || shift32 + offset16 > size) { - throw new StringIndexOutOfBoundsException(offset16); - } - char ch; - int result = offset16; - int count = shift32; - while (result < size && count > 0) - { - ch = source.charAt(result); - if (isLeadSurrogate(ch) && ((result + 1) < size) && - isTrailSurrogate(source.charAt(result + 1))) { - result ++; - } - - count --; - result ++; - } - if (count != 0) { - throw new StringIndexOutOfBoundsException(shift32); - } - return result; - } - - /** - * Shifts offset16 by the argument number of codepoints - * @param target string buffer - * @param offset16 UTF16 position to shift - * @param shift32 number of codepoints to shift - * @return new shifted offset16 - * @exception IndexOutOfBoundsException if the new offset16 is out of - * bounds. - */ - public static int moveCodePointOffset(StringBuffer source, int offset16, - int shift32) - { - int size = source.length(); - if (offset16 < 0 || shift32 + offset16 > size) { - throw new StringIndexOutOfBoundsException(offset16); - } - char ch; - int result = offset16; - int count = shift32; - while (result < size && count > 0) - { - ch = source.charAt(result); - if (isLeadSurrogate(ch) && ((result + 1) < size) && - isTrailSurrogate(source.charAt(result + 1))) { - result ++; - } - - count --; - result ++; - } - if (count != 0) { - throw new StringIndexOutOfBoundsException(shift32); - } - return result; - } - - /** - * Shifts offset16 by the argument number of codepoints within a subarray. - * @param target char array - * @param start position of the subarray to be performed on - * @param limit position of the subarray to be performed on - * @param offset16 UTF16 position to shift relative to start - * @param shift32 number of codepoints to shift - * @return new shifted offset16 relative to start - * @exception IndexOutOfBoundsException if the new offset16 is out of - * bounds with respect to the subarray. - */ - public static int moveCodePointOffset(char source[], int start, int limit, - int offset16, int shift32) - { - offset16 += start; - if (shift32 + offset16 > limit) { - throw new StringIndexOutOfBoundsException(offset16); - } - char ch; - int result = offset16; - int count = shift32; - while (result < limit && count > 0) - { - ch = source[result]; - if (isLeadSurrogate(ch) && ((result + 1) < limit) && - isTrailSurrogate(source[result + 1])) { - result ++; - } - - count --; - result ++; - } - if (count != 0) { - throw new StringIndexOutOfBoundsException(shift32); - } - return result - start; - } - - /** - * Inserts char32 codepoint into target at the argument offset16. - * If the offset16 is in the middle of a supplementary codepoint, char32 - * will be inserted after the supplementary codepoint. - * The length of target increases by one if codepoint is non-supplementary, - * 2 otherwise. - *

    - * The overall effect is exactly as if the argument were converted to a - * string by the method valueOf(char) and the characters in that string - * were then inserted into target at the position indicated by offset16. - *

    - *

    - * The offset argument must be greater than or equal to 0, and less than - * or equal to the length of source. - * @param target string buffer to insert to - * @param offset16 offset which char32 will be inserted in - * @param char32 codepoint to be inserted - * @return a reference to target - * @exception IndexOutOfBoundsException thrown if offset16 is invalid. - */ - public static StringBuffer insert(StringBuffer target, int offset16, - int char32) - { - String str = valueOf(char32); - if (offset16 != target.length() && - bounds(target, offset16) == TRAIL_SURROGATE_BOUNDARY) { - offset16 ++; - } - target.insert(offset16, str); - return target; - } - - /** - * Inserts char32 codepoint into target at the argument offset16. - * If the offset16 is in the middle of a supplementary codepoint, char32 - * will be inserted after the supplementary codepoint. - * Limit increases by one if codepoint is non-supplementary, 2 otherwise. - *

    - * The overall effect is exactly as if the argument were converted to a - * string by the method valueOf(char) and the characters in that string - * were then inserted into target at the position indicated by offset16. - *

    - *

    - * The offset argument must be greater than or equal to 0, and less than - * or equal to the limit. - * @param target char array to insert to - * @param limit end index of the char array, limit <= target.length - * @param offset16 offset which char32 will be inserted in - * @param char32 codepoint to be inserted - * @return new limit size - * @exception IndexOutOfBoundsException thrown if offset16 is invalid. - */ - public static int insert(char target[], int limit, int offset16, - int char32) - { - String str = valueOf(char32); - if (offset16 != limit && - bounds(target, 0, limit, offset16) == TRAIL_SURROGATE_BOUNDARY) { - offset16 ++; - } - int size = str.length(); - if (limit + size > target.length) { - throw new ArrayIndexOutOfBoundsException(offset16 + size); - } - System.arraycopy(target, offset16, target, offset16 + size, - limit - offset16); - target[offset16] = str.charAt(0); - if (size == 2) { - target[offset16 + 1] = str.charAt(1); - } - return limit + size; - } - - /** - * Removes the codepoint at the specified position in this target - * (shortening target by 1 character if the codepoint is a - * non-supplementary, 2 otherwise). - * @param target string buffer to remove codepoint from - * @param offset16 offset which the codepoint will be removed - * @return a reference to target - * @exception IndexOutOfBoundsException thrown if offset16 is invalid. - */ - public static StringBuffer delete(StringBuffer target, int offset16) - { - int count = 1; - switch (bounds(target, offset16)) { - case LEAD_SURROGATE_BOUNDARY: - count ++; - break; - case TRAIL_SURROGATE_BOUNDARY: - count ++; - offset16 --; - break; - } - target.delete(offset16, offset16 + count); - return target; - } - - /** - * Removes the codepoint at the specified position in this target - * (shortening target by 1 character if the codepoint is a - * non-supplementary, 2 otherwise). - * @param target string buffer to remove codepoint from - * @param limit end index of the char array, limit <= target.length - * @param offset16 offset which the codepoint will be removed - * @return a new limit size - * @exception IndexOutOfBoundsException thrown if offset16 is invalid. - */ - public static int delete(char target[], int limit, int offset16) - { - int count = 1; - switch (bounds(target, 0, limit, offset16)) { - case LEAD_SURROGATE_BOUNDARY: - count ++; - break; - case TRAIL_SURROGATE_BOUNDARY: - count ++; - offset16 --; - break; - } - System.arraycopy(target, offset16 + count, target, offset16, - limit - (offset16 + count)); - target[limit - count] = 0; - return limit - count; - } - - /** - * Returns the index within the argument UTF16 format Unicode string of - * the first occurrence of the argument codepoint. ie, the smallest - * index i such that: UTF16.charAt(source, i) == char32 is true. - *

    If no such character occurs in this string, then -1 is returned.

    - *

    - * Examples:
    - * UTF16.indexOf("abc", 'a') returns 0
    - * UTF16.indexOf("abc\ud800\udc00", 0x10000) returns 3
    - * UTF16.indexOf("abc\ud800\udc00", 0xd800) returns -1
    - *

    - * Note this method is provided as support to jdk 1.3, which does not - * support supplementary characters to its fullest. - * @param source UTF16 format Unicode string that will be searched - * @param char32 codepoint to search for - * @return the index of the first occurrence of the codepoint in the - * argument Unicode string, or -1 if the codepoint does not occur. - * @draft since release 2.1 - */ - public static int indexOf(String source, int char32) - { - if (char32 < UCharacter.MIN_VALUE || char32 > UCharacter.MAX_VALUE) { - throw new IllegalArgumentException( - "Argument char32 is not a valid codepoint"); - } - // non-surrogate bmp - if (char32 < LEAD_SURROGATE_MIN_VALUE_ || - (char32 > TRAIL_SURROGATE_MIN_VALUE_ && - char32 < UCharacter.SUPPLEMENTARY_MIN_VALUE)) { - return source.indexOf((char)char32); - } - // surrogate - if (char32 < UCharacter.SUPPLEMENTARY_MIN_VALUE) { - int result = source.indexOf((char)char32); - if (result >= 0) { - if (isLeadSurrogate((char)char32) && - (result < source.length() - 1) && - isTrailSurrogate(source.charAt(result + 1))) { - return indexOf(source, char32, result + 1); - } - // trail surrogate - if (result > 0 && - isLeadSurrogate(source.charAt(result - 1))) { - return indexOf(source, char32, result + 1); - } - } - return result; - } - // supplementary - String char32str = UCharacter.toString(char32); - return source.indexOf(char32str); - } - - /** - * Returns the index within the argument UTF16 format Unicode string of - * the first occurrence of the argument string str. This method is - * implemented based on codepoints, hence a "lead surrogate character + - * trail surrogate character" is treated as one entity.e - * Hence if the str starts with trail surrogate character at index 0, a - * source with a leading a surrogate character before str found at in - * source will not have a valid match. Vice versa for lead surrogates - * that ends str. - * See example below. - *

    If no such string str occurs in this source, then -1 is returned. - *

    - * Examples:
    - * UTF16.indexOf("abc", "ab") returns 0
    - * UTF16.indexOf("abc\ud800\udc00", "\ud800\udc00") returns 3
    - * UTF16.indexOf("abc\ud800\udc00", "\ud800") returns -1
    - *

    - * Note this method is provided as support to jdk 1.3, which does not - * support supplementary characters to its fullest. - * @param source UTF16 format Unicode string that will be searched - * @param str UTF16 format Unicode string to search for - * @return the index of the first occurrence of the codepoint in the - * argument Unicode string, or -1 if the codepoint does not occur. - * @draft since release 2.1 - */ - public static int indexOf(String source, String str) - { - int strLength = str.length(); - // non-surrogate ends - if (!isTrailSurrogate(str.charAt(0)) && - !isLeadSurrogate(str.charAt(strLength - 1))) { - return source.indexOf(str); - } - - int result = source.indexOf(str); - int resultEnd = result + strLength; - if (result >= 0) { - // check last character - if (isLeadSurrogate(str.charAt(strLength - 1)) && - (result < source.length() - 1) && - isTrailSurrogate(source.charAt(resultEnd + 1))) { - return indexOf(source, str, resultEnd + 1); - } - // check first character which is a trail surrogate - if (isTrailSurrogate(str.charAt(0)) && result > 0 && - isLeadSurrogate(source.charAt(result - 1))) { - return indexOf(source, str, resultEnd + 1); - } - } - return result; - } - - /** - * Returns the index within the argument UTF16 format Unicode string of - * the first occurrence of the argument codepoint. ie, the smallest - * index i such that:
    - * (UTF16.charAt(source, i) == char32 && i >= fromIndex) is true. - *

    If no such character occurs in this string, then -1 is returned.

    - *

    - * Examples:
    - * UTF16.indexOf("abc", 'a', 1) returns -1
    - * UTF16.indexOf("abc\ud800\udc00", 0x10000, 1) returns 3
    - * UTF16.indexOf("abc\ud800\udc00", 0xd800, 1) returns -1
    - *

    - * Note this method is provided as support to jdk 1.3, which does not - * support supplementary characters to its fullest. - * @param source UTF16 format Unicode string that will be searched - * @param char32 codepoint to search for - * @param fromIndex the index to start the search from. - * @return the index of the first occurrence of the codepoint in the - * argument Unicode string at or after fromIndex, or -1 if the - * codepoint does not occur. - * @draft since release 2.1 - */ - public static int indexOf(String source, int char32, int fromIndex) - { - if (char32 < UCharacter.MIN_VALUE || char32 > UCharacter.MAX_VALUE) { - throw new IllegalArgumentException( - "Argument char32 is not a valid codepoint"); - } - // non-surrogate bmp - if (char32 < LEAD_SURROGATE_MIN_VALUE_ || - (char32 > TRAIL_SURROGATE_MIN_VALUE_ && - char32 < UCharacter.SUPPLEMENTARY_MIN_VALUE)) { - return source.indexOf((char)char32, fromIndex); - } - // surrogate - if (char32 < UCharacter.SUPPLEMENTARY_MIN_VALUE) { - int result = source.indexOf((char)char32, fromIndex); - if (result >= 0) { - if (isLeadSurrogate((char)char32) && - (result < source.length() - 1) && - isTrailSurrogate(source.charAt(result + 1))) { - return indexOf(source, char32, result + 1); - } - // trail surrogate - if (result > 0 && - isLeadSurrogate(source.charAt(result - 1))) { - return indexOf(source, char32, result + 1); - } - } - return result; - } - // supplementary - String char32str = UCharacter.toString(char32); - return source.indexOf(char32str, fromIndex); - } - - /** - * Returns the index within the argument UTF16 format Unicode string of - * the first occurrence of the argument string str. This method is - * implemented based on codepoints, hence a "lead surrogate character + - * trail surrogate character" is treated as one entity.e - * Hence if the str starts with trail surrogate character at index 0, a - * source with a leading a surrogate character before str found at in - * source will not have a valid match. Vice versa for lead surrogates - * that ends str. - * See example below. - *

    If no such string str occurs in this source, then -1 is returned. - *

    - * Examples:
    - * UTF16.indexOf("abc", "ab", 0) returns 0
    - * UTF16.indexOf("abc\ud800\udc00", "\ud800\udc00", 0) returns 3
    - * UTF16.indexOf("abc\ud800\udc00", "\ud800\udc00", 2) returns 3
    - * UTF16.indexOf("abc\ud800\udc00", "\ud800", 0) returns -1
    - *

    - * Note this method is provided as support to jdk 1.3, which does not - * support supplementary characters to its fullest. - * @param source UTF16 format Unicode string that will be searched - * @param str UTF16 format Unicode string to search for - * @param fromIndex the index to start the search from. - * @return the index of the first occurrence of the codepoint in the - * argument Unicode string, or -1 if the codepoint does not occur. - * @draft since release 2.1 - */ - public static int indexOf(String source, String str, int fromIndex) - { - int strLength = str.length(); - // non-surrogate ends - if (!isTrailSurrogate(str.charAt(0)) && - !isLeadSurrogate(str.charAt(strLength - 1))) { - return source.indexOf(str, fromIndex); - } - - int result = source.indexOf(str, fromIndex); - int resultEnd = result + strLength; - if (result >= 0) { - // check last character - if (isLeadSurrogate(str.charAt(strLength - 1)) && - (result < source.length() - 1) && - isTrailSurrogate(source.charAt(resultEnd + 1))) { - return indexOf(source, str, resultEnd + 1); - } - // check first character which is a trail surrogate - if (isTrailSurrogate(str.charAt(0)) && result > 0 && - isLeadSurrogate(source.charAt(result - 1))) { - return indexOf(source, str, resultEnd + 1); - } - } - return result; - } - - /** - * Returns the index within the argument UTF16 format Unicode string of - * the last occurrence of the argument codepoint. ie, the index returned - * is the largest value i such that: UTF16.charAt(source, i) == char32 - * is true. - *

    - * Examples:
    - * UTF16.lastIndexOf("abc", 'a') returns 0
    - * UTF16.lastIndexOf("abc\ud800\udc00", 0x10000) returns 3
    - * UTF16.lastIndexOf("abc\ud800\udc00", 0xd800) returns -1
    - *

    - *

    source is searched backwards starting at the last character.

    - * Note this method is provided as support to jdk 1.3, which does not - * support supplementary characters to its fullest. - * @param source UTF16 format Unicode string that will be searched - * @param char32 codepoint to search for - * @return the index of the last occurrence of the codepoint in source, - * or -1 if the codepoint does not occur. - * @draft since release 2.1 - */ - public static int lastIndexOf(String source, int char32) - { - if (char32 < UCharacter.MIN_VALUE || char32 > UCharacter.MAX_VALUE) { - throw new IllegalArgumentException( - "Argument char32 is not a valid codepoint"); - } - // non-surrogate bmp - if (char32 < LEAD_SURROGATE_MIN_VALUE_ || - (char32 > TRAIL_SURROGATE_MIN_VALUE_ && - char32 < UCharacter.SUPPLEMENTARY_MIN_VALUE)) { - return source.lastIndexOf((char)char32); - } - // surrogate - if (char32 < UCharacter.SUPPLEMENTARY_MIN_VALUE) { - int result = source.lastIndexOf((char)char32); - if (result >= 0) { - if (isLeadSurrogate((char)char32) && - (result < source.length() - 1) && - isTrailSurrogate(source.charAt(result + 1))) { - return lastIndexOf(source, char32, result - 1); - } - // trail surrogate - if (result > 0 && - isLeadSurrogate(source.charAt(result - 1))) { - return lastIndexOf(source, char32, result - 1); - } - } - return result; - } - // supplementary - String char32str = UCharacter.toString(char32); - return source.lastIndexOf(char32str); - } - - /** - * Returns the index within the argument UTF16 format Unicode string of - * the last occurrence of the argument string str. This method is - * implemented based on codepoints, hence a "lead surrogate character + - * trail surrogate character" is treated as one entity.e - * Hence if the str starts with trail surrogate character at index 0, a - * source with a leading a surrogate character before str found at in - * source will not have a valid match. Vice versa for lead surrogates - * that ends str. - * See example below. - *

    - * Examples:
    - * UTF16.lastIndexOf("abc", "a") returns 0
    - * UTF16.lastIndexOf("abc\ud800\udc00", "\ud800\udc00") returns 3
    - * UTF16.lastIndexOf("abc\ud800\udc00", "\ud800") returns -1
    - *

    - *

    source is searched backwards starting at the last character.

    - * Note this method is provided as support to jdk 1.3, which does not - * support supplementary characters to its fullest. - * @param source UTF16 format Unicode string that will be searched - * @param str UTF16 format Unicode string to search for - * @return the index of the last occurrence of the codepoint in source, - * or -1 if the codepoint does not occur. - * @draft since release 2.1 - */ - public static int lastIndexOf(String source, String str) - { - int strLength = str.length(); - // non-surrogate ends - if (!isTrailSurrogate(str.charAt(0)) && - !isLeadSurrogate(str.charAt(strLength - 1))) { - return source.lastIndexOf(str); - } - - int result = source.lastIndexOf(str); - if (result >= 0) { - // check last character - if (isLeadSurrogate(str.charAt(strLength - 1)) && - (result < source.length() - 1) && - isTrailSurrogate(source.charAt(result + strLength + 1))) { - return lastIndexOf(source, str, result - 1); - } - // check first character which is a trail surrogate - if (isTrailSurrogate(str.charAt(0)) && result > 0 && - isLeadSurrogate(source.charAt(result - 1))) { - return lastIndexOf(source, str, result - 1); - } - } - return result; - } - - /** - * Returns the index within the argument UTF16 format Unicode string of - * the last occurrence of the argument codepoint, that occurred before or - * at the index fromIndex. ie, the index returned - * is the largest value i such that:
    - * (UTF16.charAt(source, i) == char32 && (i <= fromIndex)) is true. - *

    source is searched backwards starting at the last character starting - * at the specified index.

    - *

    - * Examples:
    - * UTF16.lastIndexOf("abc", 'c', 2) returns -1
    - * UTF16.lastIndexOf("abc\ud800\udc00", 0x10000, 5) returns 3
    - * UTF16.lastIndexOf("abc\ud800\udc00", 0x10000, 3) returns -1
    - * UTF16.lastIndexOf("abc\ud800\udc00", 0xd800) returns -1
    - *

    - * Note this method is provided as support to jdk 1.3, which does not - * support supplementary characters to its fullest. - * @param source UTF16 format Unicode string that will be searched - * @param char32 codepoint to search for - * @param fromIndex the index to start the search from. There is no - * restriction on the value of fromIndex. If it is - * greater than or equal to the length of this string, - * it has the same effect as if it were equal to one - * less than the length of this string: this entire - * string may be searched. If it is negative, it has - * the same effect as if it were -1: -1 is returned. - * @return the index of the last occurrence of the codepoint in source, - * or -1 if the codepoint does not occur. - * @draft since release 2.1 - */ - public static int lastIndexOf(String source, int char32, int fromIndex) - { - if (char32 < UCharacter.MIN_VALUE || char32 > UCharacter.MAX_VALUE) { - throw new IllegalArgumentException( - "Argument char32 is not a valid codepoint"); - } - // non-surrogate bmp - if (char32 < LEAD_SURROGATE_MIN_VALUE_ || - (char32 > TRAIL_SURROGATE_MIN_VALUE_ && - char32 < UCharacter.SUPPLEMENTARY_MIN_VALUE)) { - return source.lastIndexOf((char)char32, fromIndex); - } - // surrogate - if (char32 < UCharacter.SUPPLEMENTARY_MIN_VALUE) { - int result = source.lastIndexOf((char)char32, fromIndex); - if (result >= 0) { - if (isLeadSurrogate((char)char32) && - (result < source.length() - 1) && - isTrailSurrogate(source.charAt(result + 1))) { - return lastIndexOf(source, char32, result - 1); - } - // trail surrogate - if (result > 0 && - isLeadSurrogate(source.charAt(result - 1))) { - return lastIndexOf(source, char32, result - 1); - } - } - return result; - } - // supplementary - String char32str = UCharacter.toString(char32); - return source.lastIndexOf(char32str, fromIndex); - } - - /** - * Returns the index within the argument UTF16 format Unicode string of - * the last occurrence of the argument string str. This method is - * implemented based on codepoints, hence a "lead surrogate character + - * trail surrogate character" is treated as one entity.e - * Hence if the str starts with trail surrogate character at index 0, a - * source with a leading a surrogate character before str found at in - * source will not have a valid match. Vice versa for lead surrogates - * that ends str. - * See example below. - *

    - * Examples:
    - * UTF16.lastIndexOf("abc", "c", 2) returns -1
    - * UTF16.lastIndexOf("abc\ud800\udc00", "\ud800\udc00", 5) returns 3
    - * UTF16.lastIndexOf("abc\ud800\udc00", "\ud800\udc00", 3) returns -1
    - * UTF16.lastIndexOf("abc\ud800\udc00", "\ud800", 4) returns -1
    - *

    - *

    source is searched backwards starting at the last character.

    - * Note this method is provided as support to jdk 1.3, which does not - * support supplementary characters to its fullest. - * @param source UTF16 format Unicode string that will be searched - * @param str UTF16 format Unicode string to search for - * @param fromIndex the index to start the search from. There is no - * restriction on the value of fromIndex. If it is - * greater than or equal to the length of this string, - * it has the same effect as if it were equal to one - * less than the length of this string: this entire - * string may be searched. If it is negative, it has - * the same effect as if it were -1: -1 is returned. - * @return the index of the last occurrence of the codepoint in source, - * or -1 if the codepoint does not occur. - * @draft since release 2.1 - */ - public static int lastIndexOf(String source, String str, int fromIndex) - { - int strLength = str.length(); - // non-surrogate ends - if (!isTrailSurrogate(str.charAt(0)) && - !isLeadSurrogate(str.charAt(strLength - 1))) { - return source.lastIndexOf(str, fromIndex); - } - - int result = source.lastIndexOf(str, fromIndex); - if (result >= 0) { - // check last character - if (isLeadSurrogate(str.charAt(strLength - 1)) && - (result < source.length() - 1) && - isTrailSurrogate(source.charAt(result + strLength + 1))) { - return lastIndexOf(source, str, result - 1); - } - // check first character which is a trail surrogate - if (isTrailSurrogate(str.charAt(0)) && result > 0 && - isLeadSurrogate(source.charAt(result - 1))) { - return lastIndexOf(source, str, result - 1); - } - } - return result; - } - - /** - * Returns a new UTF16 format Unicode string resulting from replacing all - * occurrences of oldChar32 in source with newChar32. - * If the character oldChar32 does not occur in the UTF16 format Unicode - * string source, then source will be returned. Otherwise, a new String - * object is created that represents a codepoint sequence identical to the - * codepoint sequence represented by source, except that every occurrence - * of oldChar32 is replaced by an occurrence of newChar32. - *

    - * Examples:
    - * UTF16.replace("mesquite in your cellar", 'e', 'o');
    - * returns "mosquito in your collar"
    - * UTF16.replace("JonL", 'q', 'x');
    - * returns "JonL" (no change)
    - * UTF16.replace("Supplementary character \ud800\udc00", 0x10000, '!'); - *
    returns "Supplementary character !"
    - * UTF16.replace("Supplementary character \ud800\udc00", 0xd800, '!'); - *
    returns "Supplementary character \ud800\udc00"
    - *

    - * Note this method is provided as support to jdk 1.3, which does not - * support supplementary characters to its fullest. - * @param source UTF16 format Unicode string which the codepoint - * replacements will be based on. - * @param oldChar32 non-zero old codepoint to be replaced. - * @param newChar32 the new codepoint to replace oldChar32 - * @return new String derived from source by replacing every occurrence - * of oldChar32 with newChar32, unless when no oldChar32 is found - * in source then source will be returned. - * @draft since release 2.1 - */ - public static String replace(String source, int oldChar32, - int newChar32) - { - if (oldChar32 <= 0 || oldChar32 > UCharacter.MAX_VALUE) { - throw new IllegalArgumentException( - "Argument oldChar32 is not a valid codepoint"); - } - if (newChar32 <= 0 || newChar32 > UCharacter.MAX_VALUE) { - throw new IllegalArgumentException( - "Argument newChar32 is not a valid codepoint"); - } - - int index = indexOf(source, oldChar32); - if (index == -1) { - return source; - } - String newChar32Str = UCharacter.toString(newChar32); - int oldChar32Size = 1; - int newChar32Size = newChar32Str.length(); - StringBuffer result = new StringBuffer(source); - int resultIndex = index; - - if (oldChar32 >= UCharacter.SUPPLEMENTARY_MIN_VALUE) { - oldChar32Size = 2; - } - - while (index != -1) { - int endResultIndex = resultIndex + oldChar32Size; - result.replace(resultIndex, endResultIndex, newChar32Str); - int lastEndIndex = index + oldChar32Size; - index = indexOf(source, oldChar32, lastEndIndex); - resultIndex += newChar32Size + index - lastEndIndex; - } - return result.toString(); - } - - /** - * Returns a new UTF16 format Unicode string resulting from replacing all - * occurrences of oldStr in source with newStr. - * If the character oldStr does not occur in the UTF16 format Unicode - * string source, then source will be returned. Otherwise, a new String - * object is created that represents a codepoint sequence identical to the - * codepoint sequence represented by source, except that every occurrence - * of oldStr is replaced by an occurrence of newStr. - *

    - * Examples:
    - * UTF16.replace("mesquite in your cellar", "e", "o");
    - * returns "mosquito in your collar"
    - * UTF16.replace("mesquite in your cellar", "mesquite", "cat");
    - * returns "cat in your collar"
    - * UTF16.replace("JonL", "q", "x");
    - * returns "JonL" (no change)
    - * UTF16.replace("Supplementary character \ud800\udc00", "\ud800\udc00", - * '!'); - *
    returns "Supplementary character !"
    - * UTF16.replace("Supplementary character \ud800\udc00", "\ud800", '!'); - *
    returns "Supplementary character \ud800\udc00"
    - *

    - * Note this method is provided as support to jdk 1.3, which does not - * support supplementary characters to its fullest. - * @param source UTF16 format Unicode string which the codepoint - * replacements will be based on. - * @param oldChar32 non-zero old codepoint to be replaced. - * @param newChar32 the new codepoint to replace oldChar32 - * @return new String derived from source by replacing every occurrence - * of oldChar32 with newChar32, unless when no oldChar32 is found - * in source then source will be returned. - * @draft since release 2.1 - */ - public static String replace(String source, String oldStr, - String newStr) - { - int index = indexOf(source, oldStr); - if (index == -1) { - return source; - } - int oldStrSize = oldStr.length(); - int newStrSize = newStr.length(); - StringBuffer result = new StringBuffer(source); - int resultIndex = index; - - while (index != -1) { - int endResultIndex = resultIndex + oldStrSize; - result.replace(resultIndex, endResultIndex, newStr); - int lastEndIndex = index + oldStrSize; - index = indexOf(source, oldStr, lastEndIndex); - resultIndex += newStrSize + index - lastEndIndex; - } - return result.toString(); - } - - /** - * Reverses a UTF16 format Unicode string and replaces source's content - * with it. - * This method will reverse surrogate characters correctly, instead of - * blindly reversing every character. - *

    - * Examples:
    - * UTF16.reverse(new StringBuffer( - * "Supplementary characters \ud800\udc00\ud801\udc01"))
    - * returns "\ud801\udc01\ud800\udc00 sretcarahc yratnemelppuS". - * @param source the source StringBuffer that contains UTF16 format - * Unicode string to be reversed - * @return a modified source with reversed UTF16 format Unicode string. - * @draft since release 2.1 - */ - public static StringBuffer reverse(StringBuffer source) - { - StringBuffer result = source.reverse(); - int resultLength = result.length(); - int maxLeadLength = resultLength - 2; - int i = 0; - while (i < resultLength) { - if (i <= maxLeadLength && isTrailSurrogate(result.charAt(i)) && - isLeadSurrogate(result.charAt(i + 1))) { - char trail = result.charAt(i); - result.deleteCharAt(i); - result.insert(i + 1, trail); - i += 2; - } - else { - i ++; - } - } - return result; - } - - /** - * Compare strings using Unicode code point order, instead of UTF-16 code - * unit order. - */ - public static final class StringComparator implements java.util.Comparator - { - /** - * Standard String compare. Only one small section is different, marked in - * the code. - */ - public int compare(Object a, Object b) - { - if (a == b) { - return 0; - } - if (a == null) { - return -1; - } - if (b == null) { - return 1; - } - - String sa = (String) a; - String sb = (String) b; - int lena = sa.length(); - int lenb = sb.length(); - int len = lena; - if (len > lenb) { - len = lenb; - } - - for (int i = 0; i < len; ++i) - { - char ca = sa.charAt(i); - char cb = sb.charAt(i); - if (ca == cb) { - continue; // skip remap if equal - } - - // start of only different section - // what this part does is to rearrange the characters 0xE000 to 0xFFFF - // to the region starting from 0xD800 - // and shift the surrogate characters to above this region - if (ca >= LEAD_SURROGATE_MIN_VALUE_) { - ca += (ca <= TRAIL_SURROGATE_MAX_VALUE_) ? 0x2000 : -0x800; - } - if (cb >= LEAD_SURROGATE_MIN_VALUE_) { - cb += (cb <= TRAIL_SURROGATE_MAX_VALUE_) ? 0x2000 : -0x800; - } - // end of only different section - - if (ca < cb) { - return -1; - } - - return 1; // wasn't equal, so return 1 - } - - if (lena < lenb) { - return -1; - } - - if (lena > lenb) { - return 1; - } - - return 0; - } - } -} diff --git a/icu4j/src/com/ibm/text/UnescapeTransliterator.java b/icu4j/src/com/ibm/text/UnescapeTransliterator.java deleted file mode 100755 index 4558c0836d..0000000000 --- a/icu4j/src/com/ibm/text/UnescapeTransliterator.java +++ /dev/null @@ -1,252 +0,0 @@ -/* -********************************************************************** -* Copyright (c) 2001, International Business Machines -* Corporation and others. All Rights Reserved. -********************************************************************** -* Date Name Description -* 11/19/2001 aliu Creation. -********************************************************************** -*/ -package com.ibm.text; -import com.ibm.util.Utility; - -/** - * A transliterator that converts Unicode escape forms to the - * characters they represent. Escape forms have a prefix, a suffix, a - * radix, and minimum and maximum digit counts. - * - *

    This class is package private. It registers several standard - * variants with the system which are then accessed via their IDs. - * - * @author Alan Liu - * @version $RCSfile: UnescapeTransliterator.java,v $ $Revision: 1.3 $ $Date: 2002/02/09 01:01:47 $ - */ -class UnescapeTransliterator extends Transliterator { - - /** - * The encoded pattern specification. The pattern consists of - * zero or more forms. Each form consists of a prefix, suffix, - * radix, minimum digit count, and maximum digit count. These - * values are stored as a five character header. That is, their - * numeric values are cast to 16-bit characters and stored in the - * string. Following these five characters, the prefix - * characters, then suffix characters are stored. Each form thus - * takes n+5 characters, where n is the total length of the prefix - * and suffix. The end is marked by a header of length one - * consisting of the character END. - */ - private char spec[]; - - /** - * Special character marking the end of the spec[] array. - */ - private static final char END = 0xFFFF; - - /** - * Registers standard variants with the system. Called by - * Transliterator during initialization. - */ - static void register() { - // Unicode: "U+10FFFF" hex, min=4, max=6 - Transliterator.registerFactory("Hex-Any/Unicode", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new UnescapeTransliterator("Hex-Any/Unicode", new char[] { - 2, 0, 16, 4, 6, 'U', '+', - END - }); - } - }); - - // Java: "\\uFFFF" hex, min=4, max=4 - Transliterator.registerFactory("Hex-Any/Java", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new UnescapeTransliterator("Hex-Any/Java", new char[] { - 2, 0, 16, 4, 4, '\\', 'u', - END - }); - } - }); - - // C: "\\uFFFF" hex, min=4, max=4; \\U0010FFFF hex, min=8, max=8 - Transliterator.registerFactory("Hex-Any/C", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new UnescapeTransliterator("Hex-Any/C", new char[] { - 2, 0, 16, 4, 4, '\\', 'u', - 2, 0, 16, 8, 8, '\\', 'U', - END - }); - } - }); - - // XML: "􏿿" hex, min=1, max=6 - Transliterator.registerFactory("Hex-Any/XML", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new UnescapeTransliterator("Hex-Any/XML", new char[] { - 3, 1, 16, 1, 6, '&', '#', 'x', ';', - END - }); - } - }); - - // XML10: "&1114111;" dec, min=1, max=7 (not really "Hex-Any") - Transliterator.registerFactory("Hex-Any/XML10", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new UnescapeTransliterator("Hex-Any/XML10", new char[] { - 2, 1, 10, 1, 7, '&', '#', ';', - END - }); - } - }); - - // Perl: "\\x{263A}" hex, min=1, max=6 - Transliterator.registerFactory("Hex-Any/Perl", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new UnescapeTransliterator("Hex-Any/Perl", new char[] { - 3, 1, 16, 1, 6, '\\', 'x', '{', '}', - END - }); - } - }); - - // All: Java, C, Perl, XML, XML10, Unicode - Transliterator.registerFactory("Hex-Any", new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new UnescapeTransliterator("Hex-Any", new char[] { - 2, 0, 16, 4, 6, 'U', '+', // Unicode - 2, 0, 16, 4, 4, '\\', 'u', // Java - 2, 0, 16, 8, 8, '\\', 'U', // C (surrogates) - 3, 1, 16, 1, 6, '&', '#', 'x', ';', // XML - 2, 1, 10, 1, 7, '&', '#', ';', // XML10 - 3, 1, 16, 1, 6, '\\', 'x', '{', '}', // Perl - END - }); - } - }); - } - - /** - * Package private constructor. Takes the encoded spec array. - */ - UnescapeTransliterator(String ID, char spec[]) { - super(ID, null); - this.spec = spec; - } - - /** - * Implements {@link Transliterator#handleTransliterate}. - */ - protected void handleTransliterate(Replaceable text, - Position pos, boolean isIncremental) { - int start = pos.start; - int limit = pos.limit; - int i, j, ipat; - - loop: - while (start < limit) { - // Loop over the forms in spec[]. Exit this loop when we - // match one of the specs. Exit the outer loop if a - // partial match is detected and isIncremental is true. - for (j=0, ipat=0; spec[ipat] != END; ++j) { - - // Read the header - int prefixLen = spec[ipat++]; - int suffixLen = spec[ipat++]; - int radix = spec[ipat++]; - int minDigits = spec[ipat++]; - int maxDigits = spec[ipat++]; - - // s is a copy of start that is advanced over the - // characters as we parse them. - int s = start; - boolean match = true; - - for (i=0; i= limit) { - if (i > 0) { - // We've already matched a character. This is - // a partial match, so we return if in - // incremental mode. In non-incremental mode, - // go to the next spec. - if (isIncremental) { - break loop; - } - match = false; - break; - } - } - char c = text.charAt(s++); - if (c != spec[ipat + i]) { - match = false; - break; - } - } - - if (match) { - int u = 0; - int digitCount = 0; - for (;;) { - if (s >= limit) { - // Check for partial match in incremental mode. - if (s > start && isIncremental) { - break loop; - } - break; - } - int ch = text.char32At(s); - int digit = UCharacter.digit(ch, radix); - if (digit < 0) { - break; - } - s += UTF16.getCharCount(ch); - u = (u * radix) + digit; - if (++digitCount == maxDigits) { - break; - } - } - - match = (digitCount >= minDigits); - - if (match) { - for (i=0; i= limit) { - // Check for partial match in incremental mode. - if (s > start && isIncremental) { - break loop; - } - match = false; - break; - } - char c = text.charAt(s++); - if (c != spec[ipat + prefixLen + i]) { - match = false; - break; - } - } - - if (match) { - // At this point, we have a match - String str = UTF16.valueOf(u); - text.replace(start, s, str); - limit -= s - start - str.length(); - // The following break statement leaves the - // loop that is traversing the forms in - // spec[]. We then parse the next input - // character. - break; - } - } - } - - ipat += prefixLen + suffixLen; - } - - if (start < limit) { - start += UTF16.getCharCount(text.char32At(start)); - } - } - - pos.contextLimit += limit - pos.limit; - pos.limit = limit; - pos.start = start; - } -} diff --git a/icu4j/src/com/ibm/text/UnicodeCompressor.java b/icu4j/src/com/ibm/text/UnicodeCompressor.java deleted file mode 100755 index c68646e184..0000000000 --- a/icu4j/src/com/ibm/text/UnicodeCompressor.java +++ /dev/null @@ -1,1009 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UnicodeCompressor.java,v $ - * $Date: 2000/03/10 04:07:25 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -/** -* A compression engine implementing the Standard Compression Scheme -* for Unicode (SCSU) as outlined in Unicode Technical -* Report #6. -* -*

    The SCSU works by using dynamically positioned windows -* consisting of 128 consecutive characters in Unicode. During compression, -* characters within a window are encoded in the compressed stream as the bytes -* 0x7F - 0xFF. The SCSU provides transparency for the characters -* (bytes) between U+0000 - U+00FF. The SCSU approximates the -* storage size of traditional character sets, for example 1 byte per -* character for ASCII or Latin-1 text, and 2 bytes per character for CJK -* ideographs.

    -* -*

    USAGE

    -* -*

    The static methods on UnicodeCompressor may be used in a -* straightforward manner to compress simple strings:

    -* -*
    -*  String s = ... ; // get string from somewhere
    -*  byte [] compressed = UnicodeCompressor.compress(s);
    -* 
    -* -*

    The static methods have a fairly large memory footprint. -* For finer-grained control over memory usage, -* UnicodeCompressor offers more powerful APIs allowing -* iterative compression:

    -* -*
    -*  // Compress an array "chars" of length "len" using a buffer of 512 bytes
    -*  // to the OutputStream "out"
    -*
    -*  UnicodeCompressor myCompressor         = new UnicodeCompressor();
    -*  final static int  BUFSIZE              = 512;
    -*  byte []           byteBuffer           = new byte [ BUFSIZE ];
    -*  int               bytesWritten         = 0;
    -*  int []            unicharsRead         = new int [1];
    -*  int               totalCharsCompressed = 0;
    -*  int               totalBytesWritten    = 0;
    -*
    -*  do {
    -*    // do the compression
    -*    bytesWritten = myCompressor.compress(chars, totalCharsCompressed, 
    -*                                         len, unicharsRead,
    -*                                         byteBuffer, 0, BUFSIZE);
    -*
    -*    // do something with the current set of bytes
    -*    out.write(byteBuffer, 0, bytesWritten);
    -*
    -*    // update the no. of characters compressed
    -*    totalCharsCompressed += unicharsRead[0];
    -*
    -*    // update the no. of bytes written
    -*    totalBytesWritten += bytesWritten;
    -*
    -*  } while(totalCharsCompressed < len);
    -*
    -*  myCompressor.reset(); // reuse compressor
    -* 
    -* -* @see UnicodeDecompressor -* -* @author Stephen F. Booth -* @version 1.5 05 Aug 99 -* @version 1.4 21 Jul 99 -* @version 1.3 10 Mar 99 -* @version 1.2 08 Mar 99 -* @version 1.1 11 Jan 99 -*/ - -/* -* -* COMPRESSION STRATEGY -* -* Single Byte Mode -* -* There are three relevant cases. -* If the character is in the current window or is Latin-1 (U+0000, -* U+0009, U+000A, U+000D, U+0020 - U+007F), the character is placed -* directly in the stream as a single byte. -* -* 1. Current character is in defined, inactive window. -* 2. Current character is in undefined window. -* 3. Current character is uncompressible Unicode (U+3400 - U+DFFF). -* -* 1. Current character is in defined, inactive window -* A. Look ahead two characters -* B. If both following characters in same window as current character, -* switch to defined window -* C. If only next character is in same window as current character, -* quote defined window -* D. If neither of following characters is in same window as current, -* quote defined window -* -* 2. Current character is in undefined window -* A. Look ahead two characters -* B. If both following characters in same window as current character, -* define new window -* C. If only next character in same window as current character, -* switch to Unicode mode -* NOTE: This costs us one extra byte. However, -* since we have a limited number of windows to work with, it is -* assumed the cost will pay off later in savings from a window with -* more characters in it. -* D. If neither of following characters in same window as current, -* switch to Unicode mode. Alternative to above: just quote -* Unicode (same byte cost) -* -* 3. Current character is uncompressible Unicode (U+3400 - U+DFFF) -* A. Look ahead one character -* B. If next character in non-compressible region, switch to -* Unicode mode -* C. If next character not in non-compressible region, quote Unicode -* -* -* The following chart illustrates the bytes required for encoding characters -* in each possible way -* -* -* SINGLE BYTE MODE -* Characters in a row with same index -* tag encountered 1 2 3 4 -* --------------------------------------------------------------- -* none (in current window) 1 2 3 4 -* -* quote Unicode 3 6 9 12 -* -* window not switch to Unicode 3 5 7 9 byte -* defined define window 3 4 5 6 cost -* -* window switch to window 2 3 4 5 -* defined quote window 2 4 6 8 -* -* Unicode Mode -* -* There are two relevant cases. -* If the character is in the non-compressible region -* (U+3400 - U+DFFF), the character is simply written to the -* stream as a pair of bytes. -* -* 1. Current character is in defined, inactive window. -* 2. Current character is in undefined window. -* -* 1.Current character is in defined, inactive window -* A. Look ahead one character -* B. If next character has same index as current character, -* switch to defined window (and switch to single-byte mode) -* C. If not, just put bytes in stream -* -* -* 2. Current character is in undefined window -* A. Look ahead two characters -* B. If both in same window as current character, define window -* (and switch to single-byte mode) -* C. If only next character in same window, just put bytes in stream -* NOTE: This costs us one extra byte. However, -* since we have a limited number of windows to work with, it is -* assumed the cost will pay off later in savings from a window with -* more characters in it. -* D. If neither in same window, put bytes in stream -* -* -* The following chart illustrates the bytes required for encoding characters -* in each possible way -* -* -* UNICODE MODE -* Characters in a row with same index -* tag encountered 1 2 3 4 -* --------------------------------------------------------------- -* none 2 4 6 8 -* -* quote Unicode 3 6 9 12 -* -* window not define window 3 4 5 6 byte -* defined cost -* window switch to window 2 3 4 5 -* defined -*/ -public final class UnicodeCompressor implements SCSU -{ - //========================== - // Class variables - //========================== - - /** For quick identification of a byte as a single-byte mode tag */ - private static boolean [] sSingleTagTable = { - // table generated by CompressionTableGenerator - false, true, true, true, true, true, true, true, true, false, - false, true, true, false, true, true, true, true, true, true, - true, true, true, true, true, true, true, true, true, true, - true, true, false, false, false, false, false, false,false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false - }; - - /** For quick identification of a byte as a unicode mode tag */ - private static boolean [] sUnicodeTagTable = { - // table generated by CompressionTableGenerator - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, false, - false, false, false, false, false, false, false, false, true, - true, true, true, true, true, true, true, true, true, true, - true, true, true, true, true, true, true, true, false, false, - false, false, false, false, false, false, false, false, false, - false, false - }; - - //========================== - // Instance variables - //========================== - - /** Alias to current dynamic window */ - private int fCurrentWindow = 0; - - /** Dynamic compression window offsets */ - private int [] fOffsets = new int [ NUMWINDOWS ]; - - /** Current compression mode */ - private int fMode = SINGLEBYTEMODE; - - /** Keeps count of times character indices are encountered */ - private int [] fIndexCount = new int [ MAXINDEX + 1 ]; - - /** The time stamps indicate when a window was last defined */ - private int [] fTimeStamps = new int [ NUMWINDOWS ]; - - /** The current time stamp */ - private int fTimeStamp = 0; - - - /** - * Create a UnicodeCompressor. - * Sets all windows to their default values. - * @see #reset - */ - public UnicodeCompressor() - { - reset(); // initialize to defaults - } - - /** - * Compress a string into a byte array. - * @param buffer The string to compress. - * @return A byte array containing the compressed characters. - * @see #compress(char [], int, int) - */ - public static byte [] compress(String buffer) - { - return compress(buffer.toCharArray(), 0, buffer.length()); - } - - /** - * Compress a Unicode character array into a byte array. - * @param buffer The character buffer to compress. - * @param start The start of the character run to compress. - * @param limit The limit of the character run to compress. - * @return A byte array containing the compressed characters. - * @see #compress(String) - */ - public static byte [] compress(char [] buffer, - int start, - int limit) - { - UnicodeCompressor comp = new UnicodeCompressor(); - - // use a buffer that we know will never overflow - // in the worst case, each character will take 3 bytes - // to encode: UQU, hibyte, lobyte. In this case, the - // compressed data will look like: SCU, UQU, hibyte, lobyte, ... - // buffer must be at least 4 bytes in size - int len = Math.max(4, 3 * (limit - start) + 1); - byte [] temp = new byte [len]; - - int byteCount = comp.compress(buffer, start, limit, null, - temp, 0, len); - - byte [] result = new byte [byteCount]; - System.arraycopy(temp, 0, result, 0, byteCount); - return result; - } - - /** - * Compress a Unicode character array into a byte array. - * - * This function will only consume input that can be completely - * output. - * - * @param charBuffer The character buffer to compress. - * @param charBufferStart The start of the character run to compress. - * @param charBufferLimit The limit of the character run to compress. - * @param charsRead A one-element array. If not null, on return - * the number of characters read from charBuffer. - * @param byteBuffer A buffer to receive the compressed data. This - * buffer must be at minimum four bytes in size. - * @param byteBufferStart The starting offset to which to write - * compressed data. - * @param byteBufferLimit The limiting offset for writing compressed data. - * @return The number of bytes written to byteBuffer. - */ - public int compress(char [] charBuffer, - int charBufferStart, - int charBufferLimit, - int [] charsRead, - byte [] byteBuffer, - int byteBufferStart, - int byteBufferLimit) - { - // the current position in the target byte buffer - int bytePos = byteBufferStart; - - // the current position in the source unicode character buffer - int ucPos = charBufferStart; - - // the current unicode character from the source buffer - int curUC = INVALIDCHAR; - - // the index for the current character - int curIndex = -1; - - // look ahead - int nextUC = INVALIDCHAR; - int forwardUC = INVALIDCHAR; - - // temporary for window searching - int whichWindow = 0; - - // high and low bytes of the current unicode character - int hiByte = 0; - int loByte = 0; - - - // byteBuffer must be at least 4 bytes in size - if(byteBuffer.length < 4 || (byteBufferLimit - byteBufferStart) < 4) - throw new IllegalArgumentException("byteBuffer.length < 4"); - - mainLoop: - while(ucPos < charBufferLimit && bytePos < byteBufferLimit) { - switch(fMode) { - // main single byte mode compression loop - case SINGLEBYTEMODE: - singleByteModeLoop: - while(ucPos < charBufferLimit && bytePos < byteBufferLimit) { - // get current char - curUC = charBuffer[ucPos++]; - - // get next char - if(ucPos < charBufferLimit) - nextUC = charBuffer[ucPos]; - else - nextUC = INVALIDCHAR; - - // chars less than 0x0080 (excluding tags) go straight - // in stream - if(curUC < 0x0080) { - loByte = curUC & 0xFF; - - // we need to check and make sure we don't - // accidentally write a single byte mode tag to - // the stream unless it's quoted - if(sSingleTagTable[loByte]) { - // make sure there is enough room to - // write both bytes if not, rewind the - // source stream and break out - if( (bytePos + 1) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - // since we know the byte is less than 0x80, SQUOTE0 - // will use static window 0, or ASCII - byteBuffer[bytePos++] = (byte) SQUOTE0; - } - - byteBuffer[bytePos++] = (byte) loByte; - } - - // if the char belongs to current window, convert it - // to a byte by adding the generic compression offset - // and subtracting the window's offset - else if(inDynamicWindow(curUC, fCurrentWindow) ) { - byteBuffer[bytePos++] = (byte) - (curUC - fOffsets[ fCurrentWindow ] - + COMPRESSIONOFFSET); - } - - // if char is not in compressible range, either switch to or - // quote from unicode - else if( ! isCompressible(curUC) ) { - // only check next character if it is valid - if(nextUC != INVALIDCHAR && isCompressible(nextUC)) { - // make sure there is enough room to - // write all three bytes if not, - // rewind the source stream and break - // out - if( (bytePos + 2) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - byteBuffer[bytePos++] = (byte) SQUOTEU; - byteBuffer[bytePos++] = (byte) (curUC >>> 8); - byteBuffer[bytePos++] = (byte) (curUC & 0xFF); - } - else { - // make sure there is enough room to - // write all four bytes if not, rewind - // the source stream and break out - if((bytePos + 3) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - byteBuffer[bytePos++] = (byte) SCHANGEU; - - hiByte = curUC >>> 8; - loByte = curUC & 0xFF; - - if(sUnicodeTagTable[hiByte]) - // add quote Unicode tag - byteBuffer[bytePos++] = (byte) UQUOTEU; - - byteBuffer[bytePos++] = (byte) hiByte; - byteBuffer[bytePos++] = (byte) loByte; - - fMode = UNICODEMODE; - break singleByteModeLoop; - } - } - - // if the char is in a currently defined dynamic - // window, figure out which one, and either switch to - // it or quote from it - else if((whichWindow = findDynamicWindow(curUC)) - != INVALIDWINDOW ) { - // look ahead - if( (ucPos + 1) < charBufferLimit ) - forwardUC = charBuffer[ucPos + 1]; - else - forwardUC = INVALIDCHAR; - - // all three chars in same window, switch to that - // window inDynamicWindow will return false for - // INVALIDCHAR - if(inDynamicWindow(nextUC, whichWindow) - && inDynamicWindow(forwardUC, whichWindow)) { - // make sure there is enough room to - // write both bytes if not, rewind the - // source stream and break out - if( (bytePos + 1) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - byteBuffer[bytePos++] = (byte)(SCHANGE0 + whichWindow); - byteBuffer[bytePos++] = (byte) - (curUC - fOffsets[whichWindow] - + COMPRESSIONOFFSET); - fTimeStamps [ whichWindow ] = ++fTimeStamp; - fCurrentWindow = whichWindow; - } - - // either only next char or neither in same - // window, so quote - else { - // make sure there is enough room to - // write both bytes if not, rewind the - // source stream and break out - if((bytePos + 1) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - byteBuffer[bytePos++] = (byte) (SQUOTE0 + whichWindow); - byteBuffer[bytePos++] = (byte) - (curUC - fOffsets[whichWindow] - + COMPRESSIONOFFSET); - } - } - - // if a static window is defined, and the following - // character is not in that static window, quote from - // the static window Note: to quote from a static - // window, don't add 0x80 - else if((whichWindow = findStaticWindow(curUC)) - != INVALIDWINDOW - && ! inStaticWindow(nextUC, whichWindow) ) { - // make sure there is enough room to write both - // bytes if not, rewind the source stream and - // break out - if((bytePos + 1) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - byteBuffer[bytePos++] = (byte) (SQUOTE0 + whichWindow); - byteBuffer[bytePos++] = (byte) - (curUC - sOffsets[whichWindow]); - } - - // if a window is not defined, decide if we want to - // define a new one or switch to unicode mode - else { - // determine index for current char (char is compressible) - curIndex = makeIndex(curUC); - fIndexCount[curIndex]++; - - // look ahead - if((ucPos + 1) < charBufferLimit) - forwardUC = charBuffer[ucPos + 1]; - else - forwardUC = INVALIDCHAR; - - // if we have encountered this index at least once - // before, define a new window - // OR - // three chars in a row with same index, define a - // new window (makeIndex will return RESERVEDINDEX - // for INVALIDCHAR) - if((fIndexCount[curIndex] > 1) || - (curIndex == makeIndex(nextUC) - && curIndex == makeIndex(forwardUC))) { - // make sure there is enough room to write all - // three bytes if not, rewind the source - // stream and break out - if( (bytePos + 2) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - // get least recently defined window - whichWindow = getLRDefinedWindow(); - - byteBuffer[bytePos++] = (byte)(SDEFINE0 + whichWindow); - byteBuffer[bytePos++] = (byte) curIndex; - byteBuffer[bytePos++] = (byte) - (curUC - sOffsetTable[curIndex] - + COMPRESSIONOFFSET); - - fOffsets[whichWindow] = sOffsetTable[curIndex]; - fCurrentWindow = whichWindow; - fTimeStamps [whichWindow] = ++fTimeStamp; - } - - // only two chars in a row with same index, so - // switch to unicode mode (makeIndex will return - // RESERVEDINDEX for INVALIDCHAR) - // OR - // three chars have different indices, so switch - // to unicode mode - else { - // make sure there is enough room to write all - // four bytes if not, rewind the source stream - // and break out - if((bytePos + 3) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - byteBuffer[bytePos++] = (byte) SCHANGEU; - - hiByte = curUC >>> 8; - loByte = curUC & 0xFF; - - if(sUnicodeTagTable[hiByte]) - // add quote Unicode tag - byteBuffer[bytePos++] = (byte) UQUOTEU; - - byteBuffer[bytePos++] = (byte) hiByte; - byteBuffer[bytePos++] = (byte) loByte; - - fMode = UNICODEMODE; - break singleByteModeLoop; - } - } - } - break; - - case UNICODEMODE: - // main unicode mode compression loop - unicodeModeLoop: - while(ucPos < charBufferLimit && bytePos < byteBufferLimit) { - // get current char - curUC = charBuffer[ucPos++]; - - // get next char - if( ucPos < charBufferLimit ) - nextUC = charBuffer[ucPos]; - else - nextUC = INVALIDCHAR; - - // if we have two uncompressible chars in a row, - // put the current char's bytes in the stream - if( ! isCompressible(curUC) - || (nextUC != INVALIDCHAR && ! isCompressible(nextUC))) { - // make sure there is enough room to write all three bytes - // if not, rewind the source stream and break out - if( (bytePos + 2) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - hiByte = curUC >>> 8; - loByte = curUC & 0xFF; - - if(sUnicodeTagTable[ hiByte ]) - // add quote Unicode tag - byteBuffer[bytePos++] = (byte) UQUOTEU; - - byteBuffer[bytePos++] = (byte) hiByte; - byteBuffer[bytePos++] = (byte) loByte; - } - - // bytes less than 0x80 can go straight in the stream, - // but in single-byte mode - else if(curUC < 0x0080) { - loByte = curUC & 0xFF; - - // if two chars in a row below 0x80 and the - // current char is not a single-byte mode tag, - // switch to single-byte mode - if(nextUC != INVALIDCHAR - && nextUC < 0x0080 && ! sSingleTagTable[ loByte ] ) { - // make sure there is enough room to - // write both bytes if not, rewind the - // source stream and break out - if( (bytePos + 1) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - // use the last-active window - whichWindow = fCurrentWindow; - byteBuffer[bytePos++] = (byte)(UCHANGE0 + whichWindow); - byteBuffer[bytePos++] = (byte) loByte; - - //fCurrentWindow = 0; - fTimeStamps [whichWindow] = ++fTimeStamp; - fMode = SINGLEBYTEMODE; - break unicodeModeLoop; - } - - // otherwise, just write the bytes to the stream - // (this will cover the case of only 1 char less than 0x80 - // and single-byte mode tags) - else { - // make sure there is enough room to - // write both bytes if not, rewind the - // source stream and break out - if((bytePos + 1) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - // since the character is less than 0x80, the - // high byte is always 0x00 - no need for - // (curUC >>> 8) - byteBuffer[bytePos++] = (byte) 0x00; - byteBuffer[bytePos++] = (byte) loByte; - } - } - - // figure out if the current char is in a defined window - else if((whichWindow = findDynamicWindow(curUC)) - != INVALIDWINDOW ) { - // if two chars in a row in the same window, - // switch to that window and go to single-byte mode - // inDynamicWindow will return false for INVALIDCHAR - if(inDynamicWindow(nextUC, whichWindow)) { - // make sure there is enough room to - // write both bytes if not, rewind the - // source stream and break out - if((bytePos + 1) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - byteBuffer[bytePos++] = (byte)(UCHANGE0 + whichWindow); - byteBuffer[bytePos++] = (byte) - (curUC - fOffsets[whichWindow] - + COMPRESSIONOFFSET); - - fTimeStamps [ whichWindow ] = ++fTimeStamp; - fCurrentWindow = whichWindow; - fMode = SINGLEBYTEMODE; - break unicodeModeLoop; - } - - // otherwise, just quote the unicode for the char - else { - // make sure there is enough room to - // write all three bytes if not, - // rewind the source stream and break - // out - if((bytePos + 2) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - hiByte = curUC >>> 8; - loByte = curUC & 0xFF; - - if(sUnicodeTagTable[ hiByte ]) - // add quote Unicode tag - byteBuffer[bytePos++] = (byte) UQUOTEU; - - byteBuffer[bytePos++] = (byte) hiByte; - byteBuffer[bytePos++] = (byte) loByte; - } - } - - // char is not in a defined window - else { - // determine index for current char (char is compressible) - curIndex = makeIndex(curUC); - fIndexCount[curIndex]++; - - // look ahead - if( (ucPos + 1) < charBufferLimit ) - forwardUC = charBuffer[ucPos + 1]; - else - forwardUC = INVALIDCHAR; - - // if we have encountered this index at least once - // before, define a new window for it that hasn't - // previously been redefined - // OR - // if three chars in a row with the same index, - // define a new window (makeIndex will return - // RESERVEDINDEX for INVALIDCHAR) - if((fIndexCount[curIndex] > 1) || - (curIndex == makeIndex(nextUC) - && curIndex == makeIndex(forwardUC))) { - // make sure there is enough room to - // write all three bytes if not, - // rewind the source stream and break - // out - if((bytePos + 2) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - // get least recently defined window - whichWindow = getLRDefinedWindow(); - - byteBuffer[bytePos++] = (byte)(UDEFINE0 + whichWindow); - byteBuffer[bytePos++] = (byte) curIndex; - byteBuffer[bytePos++] = (byte) - (curUC - sOffsetTable[curIndex] - + COMPRESSIONOFFSET); - - fOffsets[whichWindow] = sOffsetTable[curIndex]; - fCurrentWindow = whichWindow; - fTimeStamps [whichWindow] = ++fTimeStamp; - fMode = SINGLEBYTEMODE; - break unicodeModeLoop; - } - - // otherwise just quote the unicode, and save our - // windows for longer runs - else { - // make sure there is enough room to - // write all three bytes if not, - // rewind the source stream and break - // out - if((bytePos + 2) >= byteBufferLimit) - { --ucPos; break mainLoop; } - - hiByte = curUC >>> 8; - loByte = curUC & 0xFF; - - if(sUnicodeTagTable[ hiByte ]) - // add quote Unicode tag - byteBuffer[bytePos++] = (byte) UQUOTEU; - - byteBuffer[bytePos++] = (byte) hiByte; - byteBuffer[bytePos++] = (byte) loByte; - } - } - } - } // end switch - } - - // fill in output parameter - if(charsRead != null) - charsRead [0] = (ucPos - charBufferStart); - - // return # of bytes written - return (bytePos - byteBufferStart); - } - - /** Reset the compressor to its initial state. */ - public void reset() - { - int i; - - // reset dynamic windows - fOffsets[0] = 0x0080; // Latin-1 - fOffsets[1] = 0x00C0; // Latin-1 Supplement + Latin Extended-A - fOffsets[2] = 0x0400; // Cyrillic - fOffsets[3] = 0x0600; // Arabic - fOffsets[4] = 0x0900; // Devanagari - fOffsets[5] = 0x3040; // Hiragana - fOffsets[6] = 0x30A0; // Katakana - fOffsets[7] = 0xFF00; // Fullwidth ASCII - - - // reset time stamps - for(i = 0; i < NUMWINDOWS; i++) { - fTimeStamps[i] = 0; - } - - // reset count of seen indices - for(i = 0; i <= MAXINDEX; i++ ) { - fIndexCount[i] = 0; - } - - fTimeStamp = 0; // Reset current time stamp - fCurrentWindow = 0; // Make current window Latin-1 - fMode = SINGLEBYTEMODE; // Always start in single-byte mode - } - - //========================== - // Determine the index for a character - //========================== - - /** - * Create the index value for a character. - * For more information on this function, refer to table X-3 - * UTR6. - * @param c The character in question. - * @return An index for c - */ - private static int makeIndex(int c) - { - // check the predefined indices - if(c >= 0x00C0 && c < 0x0140) - return LATININDEX; - else if(c >= 0x0250 && c < 0x02D0) - return IPAEXTENSIONINDEX; - else if(c >= 0x0370 && c < 0x03F0) - return GREEKINDEX; - else if(c >= 0x0530 && c < 0x0590) - return ARMENIANINDEX; - else if(c >= 0x3040 && c < 0x30A0) - return HIRAGANAINDEX; - else if(c >= 0x30A0 && c < 0x3120) - return KATAKANAINDEX; - else if(c >= 0xFF60 && c < 0xFF9F) - return HALFWIDTHKATAKANAINDEX; - - // calculate index - else if(c >= 0x0080 && c < 0x3400) - return (c / 0x80) & 0xFF; - else if(c >= 0xE000 && c <= 0xFFFF) - return ((c - 0xAC00) / 0x80) & 0xFF; - - // should never happen - else { - return RESERVEDINDEX; - } - } - - //========================== - // Check if a given character fits in a window - //========================== - - /** - * Determine if a character is in a dynamic window. - * @param c The character to test - * @param whichWindow The dynamic window the test - * @return true if c will fit in whichWindow, - * false otherwise. - */ - private boolean inDynamicWindow(int c, - int whichWindow) - { - return (c >= fOffsets[whichWindow] - && c < (fOffsets[whichWindow] + 0x80)); - } - - /** - * Determine if a character is in a static window. - * @param c The character to test - * @param whichWindow The static window the test - * @return true if c will fit in whichWindow, - * false otherwise. - */ - private static boolean inStaticWindow(int c, - int whichWindow) - { - return (c >= sOffsets[whichWindow] - && c < (sOffsets[whichWindow] + 0x80)); - } - - //========================== - // Check if a given character is compressible - //========================== - - /** - * Determine if a character is compressible. - * @param c The character to test. - * @return true if the c is compressible, false otherwise. - */ - private static boolean isCompressible(int c) - { - return (c < 0x3400 || c >= 0xE000); - } - - //========================== - // Check if a window is defined for a given character - //========================== - - /** - * Determine if a dynamic window for a certain character is defined - * @param c The character in question - * @return The dynamic window containing c, or - * INVALIDWINDOW if not defined. - */ - private int findDynamicWindow(int c) - { - // supposedly faster to count down - //for(int i = 0; i < NUMWINDOWS; i++) { - for(int i = NUMWINDOWS - 1; i >= 0; --i) { - if(inDynamicWindow(c, i)) { - ++fTimeStamps[i]; - return i; - } - } - - return INVALIDWINDOW; - } - - /** - * Determine if a static window for a certain character is defined - * @param c The character in question - * @return The static window containing c, or - * INVALIDWINDOW if not defined. - */ - private static int findStaticWindow(int c) - { - // supposedly faster to count down - //for(int i = 0; i < NUMSTATICWINDOWS; i++) { - for(int i = NUMSTATICWINDOWS - 1; i >= 0; --i) { - if(inStaticWindow(c, i)) { - return i; - } - } - - return INVALIDWINDOW; - } - - //========================== - // Find the least-recently used window - //========================== - - /** Find the least-recently defined window */ - private int getLRDefinedWindow() - { - int leastRU = Integer.MAX_VALUE; - int whichWindow = INVALIDWINDOW; - - // find least recently used window - // supposedly faster to count down - //for( int i = 0; i < NUMWINDOWS; i++ ) { - for(int i = NUMWINDOWS - 1; i >= 0; --i ) { - if( fTimeStamps[i] < leastRU ) { - leastRU = fTimeStamps[i]; - whichWindow = i; - } - } - - return whichWindow; - } - -}; diff --git a/icu4j/src/com/ibm/text/UnicodeDecompressor.java b/icu4j/src/com/ibm/text/UnicodeDecompressor.java deleted file mode 100755 index bc19b0314f..0000000000 --- a/icu4j/src/com/ibm/text/UnicodeDecompressor.java +++ /dev/null @@ -1,565 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UnicodeDecompressor.java,v $ - * $Date: 2000/03/10 04:07:25 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -package com.ibm.text; - -/** -* A decompression engine implementing the Standard Compression Scheme -* for Unicode (SCSU) as outlined in Unicode Technical -* Report #6. -* -*

    USAGE

    -* -*

    The static methods on UnicodeDecompressor may be used in a -* straightforward manner to decompress simple strings:

    -* -*
    -*  byte [] compressed = ... ; // get compressed bytes from somewhere
    -*  String result = UnicodeDecompressor.decompress(compressed);
    -* 
    -* -*

    The static methods have a fairly large memory footprint. -* For finer-grained control over memory usage, -* UnicodeDecompressor offers more powerful APIs allowing -* iterative decompression:

    -* -*
    -*  // Decompress an array "bytes" of length "len" using a buffer of 512 chars
    -*  // to the Writer "out"
    -*
    -*  UnicodeDecompressor myDecompressor         = new UnicodeDecompressor();
    -*  final static int    BUFSIZE                = 512;
    -*  char []             charBuffer             = new char [ BUFSIZE ];
    -*  int                 charsWritten           = 0;
    -*  int []              bytesRead              = new int [1];
    -*  int                 totalBytesDecompressed = 0;
    -*  int                 totalCharsWritten      = 0;
    -*
    -*  do {
    -*    // do the decompression
    -*    charsWritten = myDecompressor.decompress(bytes, totalBytesDecompressed, 
    -*                                             len, bytesRead,
    -*                                             charBuffer, 0, BUFSIZE);
    -*
    -*    // do something with the current set of chars
    -*    out.write(charBuffer, 0, charsWritten);
    -*
    -*    // update the no. of bytes decompressed
    -*    totalBytesDecompressed += bytesRead[0];
    -*
    -*    // update the no. of chars written
    -*    totalCharsWritten += charsWritten;
    -*
    -*  } while(totalBytesDecompressed < len);
    -*
    -*  myDecompressor.reset(); // reuse decompressor
    -* 
    -* -*

    Decompression is performed according to the standard set forth in -* Unicode Technical -* Report #6

    -* -* @see UnicodeCompressor -* -* @author Stephen F. Booth -* @version 1.5 05 Aug 99 -* @version 1.4 21 Jul 99 -* @version 1.3 10 Mar 99 -* @version 1.2 08 Mar 99 -* @version 1.1 11 Jan 99 -*/ -public final class UnicodeDecompressor implements SCSU -{ - //========================== - // Instance variables - //========================== - - /** Alias to current dynamic window */ - private int fCurrentWindow = 0; - - /** Dynamic compression window offsets */ - private int [] fOffsets = new int [ NUMWINDOWS ]; - - /** Current compression mode */ - private int fMode = SINGLEBYTEMODE; - - /** Size of our internal buffer */ - private final static int BUFSIZE = 3; - - /** Internal buffer for saving state */ - private byte [] fBuffer = new byte [BUFSIZE]; - - /** Number of characters in our internal buffer */ - private int fBufferLength = 0; - - - /** - * Create a UnicodeDecompressor. - * Sets all windows to their default values. - * @see #reset - */ - public UnicodeDecompressor() - { - reset(); // initialize to defaults - } - - /** - * Decompress a byte array into a String. - * @param buffer The byte array to decompress. - * @return A String containing the decompressed characters. - * @see #decompress(byte [], int, int) - */ - public static String decompress(byte [] buffer) - { - char [] buf = decompress(buffer, 0, buffer.length); - return new String(buf); - } - - /** - * Decompress a byte array into a Unicode character array. - * @param buffer The byte array to decompress. - * @param start The start of the byte run to decompress. - * @param limit The limit of the byte run to decompress. - * @return A character array containing the decompressed bytes. - * @see #decompress(byte []) - */ - public static char [] decompress(byte [] buffer, - int start, - int limit) - { - UnicodeDecompressor comp = new UnicodeDecompressor(); - - // use a buffer we know will never overflow - // in the worst case, each byte will decompress - // to a surrogate pair (buffer must be at least 2 chars) - int len = Math.max(2, 2 * (limit - start)); - char [] temp = new char [len]; - - int charCount = comp.decompress(buffer, start, limit, null, - temp, 0, len); - - char [] result = new char [charCount]; - System.arraycopy(temp, 0, result, 0, charCount); - return result; - } - - /** - * Decompress a byte array into a Unicode character array. - * - * This function will either completely fill the output buffer, - * or consume the entire input. - * - * @param byteBuffer The byte buffer to decompress. - * @param byteBufferStart The start of the byte run to decompress. - * @param byteBufferLimit The limit of the byte run to decompress. - * @param bytesRead A one-element array. If not null, on return - * the number of bytes read from byteBuffer. - * @param charBuffer A buffer to receive the decompressed data. - * This buffer must be at minimum two characters in size. - * @param charBufferStart The starting offset to which to write - * decompressed data. - * @param charBufferLimit The limiting offset for writing - * decompressed data. - * @return The number of Unicode characters written to charBuffer. - */ - public int decompress(byte [] byteBuffer, - int byteBufferStart, - int byteBufferLimit, - int [] bytesRead, - char [] charBuffer, - int charBufferStart, - int charBufferLimit) - { - // the current position in the source byte buffer - int bytePos = byteBufferStart; - - // the current position in the target char buffer - int ucPos = charBufferStart; - - // the current byte from the source buffer - int aByte = 0x00; - - - // charBuffer must be at least 2 chars in size - if(charBuffer.length < 2 || (charBufferLimit - charBufferStart) < 2) - throw new IllegalArgumentException("charBuffer.length < 2"); - - // if our internal buffer isn't empty, flush its contents - // to the output buffer before doing any more decompression - if(fBufferLength > 0) { - - int newBytes = 0; - - // fill the buffer completely, to guarantee one full character - if(fBufferLength != BUFSIZE) { - newBytes = fBuffer.length - fBufferLength; - - // verify there are newBytes bytes in byteBuffer - if(byteBufferLimit - byteBufferStart < newBytes) - newBytes = byteBufferLimit - byteBufferStart; - - System.arraycopy(byteBuffer, byteBufferStart, - fBuffer, fBufferLength, newBytes); - } - - // reset buffer length to 0 before recursive call - fBufferLength = 0; - - // call self recursively to decompress the buffer - int count = decompress(fBuffer, 0, fBuffer.length, null, - charBuffer, charBufferStart, - charBufferLimit); - - // update the positions into the arrays - ucPos += count; - bytePos += newBytes; - } - - // the main decompression loop - mainLoop: - while(bytePos < byteBufferLimit && ucPos < charBufferLimit) { - switch(fMode) { - case SINGLEBYTEMODE: - // single-byte mode decompression loop - singleByteModeLoop: - while(bytePos < byteBufferLimit && ucPos < charBufferLimit) { - aByte = byteBuffer[bytePos++] & 0xFF; - switch(aByte) { - // All bytes from 0x80 through 0xFF are remapped - // to chars or surrogate pairs according to the - // currently active window - case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: - case 0x85: case 0x86: case 0x87: case 0x88: case 0x89: - case 0x8A: case 0x8B: case 0x8C: case 0x8D: case 0x8E: - case 0x8F: case 0x90: case 0x91: case 0x92: case 0x93: - case 0x94: case 0x95: case 0x96: case 0x97: case 0x98: - case 0x99: case 0x9A: case 0x9B: case 0x9C: case 0x9D: - case 0x9E: case 0x9F: case 0xA0: case 0xA1: case 0xA2: - case 0xA3: case 0xA4: case 0xA5: case 0xA6: case 0xA7: - case 0xA8: case 0xA9: case 0xAA: case 0xAB: case 0xAC: - case 0xAD: case 0xAE: case 0xAF: case 0xB0: case 0xB1: - case 0xB2: case 0xB3: case 0xB4: case 0xB5: case 0xB6: - case 0xB7: case 0xB8: case 0xB9: case 0xBA: case 0xBB: - case 0xBC: case 0xBD: case 0xBE: case 0xBF: case 0xC0: - case 0xC1: case 0xC2: case 0xC3: case 0xC4: case 0xC5: - case 0xC6: case 0xC7: case 0xC8: case 0xC9: case 0xCA: - case 0xCB: case 0xCC: case 0xCD: case 0xCE: case 0xCF: - case 0xD0: case 0xD1: case 0xD2: case 0xD3: case 0xD4: - case 0xD5: case 0xD6: case 0xD7: case 0xD8: case 0xD9: - case 0xDA: case 0xDB: case 0xDC: case 0xDD: case 0xDE: - case 0xDF: case 0xE0: case 0xE1: case 0xE2: case 0xE3: - case 0xE4: case 0xE5: case 0xE6: case 0xE7: case 0xE8: - case 0xE9: case 0xEA: case 0xEB: case 0xEC: case 0xED: - case 0xEE: case 0xEF: case 0xF0: case 0xF1: case 0xF2: - case 0xF3: case 0xF4: case 0xF5: case 0xF6: case 0xF7: - case 0xF8: case 0xF9: case 0xFA: case 0xFB: case 0xFC: - case 0xFD: case 0xFE: case 0xFF: - // For offsets <= 0xFFFF, convert to a single char - // by adding the window's offset and subtracting - // the generic compression offset - if(fOffsets[ fCurrentWindow ] <= 0xFFFF) { - charBuffer[ucPos++] = (char) - (aByte + fOffsets[ fCurrentWindow ] - - COMPRESSIONOFFSET); - } - // For offsets > 0x10000, convert to a surrogate pair by - // normBase = window's offset - 0x10000 - // high surr. = 0xD800 + (normBase >> 10) - // low surr. = 0xDC00 + (normBase & 0x3FF) + (byte & 0x7F) - else { - // make sure there is enough room to write - // both characters - // if not, save state and break out - if((ucPos + 1) >= charBufferLimit) { - --bytePos; - System.arraycopy(byteBuffer, bytePos, - fBuffer, 0, - byteBufferLimit - bytePos); - fBufferLength = byteBufferLimit - bytePos; - bytePos += fBufferLength; - break mainLoop; - } - - int normalizedBase = fOffsets[ fCurrentWindow ] - - 0x10000; - charBuffer[ucPos++] = (char) - (0xD800 + (normalizedBase >> 10)); - charBuffer[ucPos++] = (char) - (0xDC00 + (normalizedBase & 0x3FF)+(aByte & 0x7F)); - } - break; - - // bytes from 0x20 through 0x7F are treated as ASCII and - // are remapped to chars by padding the high byte - // (this is the same as quoting from static window 0) - // NUL (0x00), HT (0x09), CR (0x0A), LF (0x0D) - // are treated as ASCII as well - case 0x00: case 0x09: case 0x0A: case 0x0D: - case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: - case 0x25: case 0x26: case 0x27: case 0x28: case 0x29: - case 0x2A: case 0x2B: case 0x2C: case 0x2D: case 0x2E: - case 0x2F: case 0x30: case 0x31: case 0x32: case 0x33: - case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: - case 0x39: case 0x3A: case 0x3B: case 0x3C: case 0x3D: - case 0x3E: case 0x3F: case 0x40: case 0x41: case 0x42: - case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: - case 0x48: case 0x49: case 0x4A: case 0x4B: case 0x4C: - case 0x4D: case 0x4E: case 0x4F: case 0x50: case 0x51: - case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: - case 0x57: case 0x58: case 0x59: case 0x5A: case 0x5B: - case 0x5C: case 0x5D: case 0x5E: case 0x5F: case 0x60: - case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: - case 0x66: case 0x67: case 0x68: case 0x69: case 0x6A: - case 0x6B: case 0x6C: case 0x6D: case 0x6E: case 0x6F: - case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: - case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: - case 0x7A: case 0x7B: case 0x7C: case 0x7D: case 0x7E: - case 0x7F: - charBuffer[ucPos++] = (char) aByte; - break; - - // quote unicode - case SQUOTEU: - // verify we have two bytes following tag - // if not, save state and break out - if( (bytePos + 1) >= byteBufferLimit ) { - --bytePos; - System.arraycopy(byteBuffer, bytePos, - fBuffer, 0, - byteBufferLimit - bytePos); - fBufferLength = byteBufferLimit - bytePos; - bytePos += fBufferLength; - break mainLoop; - } - - aByte = byteBuffer[bytePos++]; - charBuffer[ucPos++] = (char) - (aByte << 8 | (byteBuffer[bytePos++] & 0xFF)); - break; - - // switch to Unicode mode - case SCHANGEU: - fMode = UNICODEMODE; - break singleByteModeLoop; - //break; - - // handle all quote tags - case SQUOTE0: case SQUOTE1: case SQUOTE2: case SQUOTE3: - case SQUOTE4: case SQUOTE5: case SQUOTE6: case SQUOTE7: - // verify there is a byte following the tag - // if not, save state and break out - if(bytePos >= byteBufferLimit) { - --bytePos; - System.arraycopy(byteBuffer, bytePos, - fBuffer, 0, - byteBufferLimit - bytePos); - fBufferLength = byteBufferLimit - bytePos; - bytePos += fBufferLength; - break mainLoop; - } - - // if the byte is in the range 0x00 - 0x7F, use - // static window n otherwise, use dynamic window n - int dByte = byteBuffer[bytePos++] & 0xFF; - charBuffer[ucPos++] = (char) - (dByte+ (dByte >= 0x00 && dByte < 0x80 - ? sOffsets[aByte - SQUOTE0] - : (fOffsets[aByte - SQUOTE0] - - COMPRESSIONOFFSET))); - break; - - // handle all change tags - case SCHANGE0: case SCHANGE1: case SCHANGE2: case SCHANGE3: - case SCHANGE4: case SCHANGE5: case SCHANGE6: case SCHANGE7: - fCurrentWindow = aByte - SCHANGE0; - break; - - // handle all define tags - case SDEFINE0: case SDEFINE1: case SDEFINE2: case SDEFINE3: - case SDEFINE4: case SDEFINE5: case SDEFINE6: case SDEFINE7: - // verify there is a byte following the tag - // if not, save state and break out - if(bytePos >= byteBufferLimit) { - --bytePos; - System.arraycopy(byteBuffer, bytePos, - fBuffer, 0, - byteBufferLimit - bytePos); - fBufferLength = byteBufferLimit - bytePos; - bytePos += fBufferLength; - break mainLoop; - } - - fCurrentWindow = aByte - SDEFINE0; - fOffsets[fCurrentWindow] = - sOffsetTable[byteBuffer[bytePos++] & 0xFF]; - break; - - // handle define extended tag - case SDEFINEX: - // verify we have two bytes following tag - // if not, save state and break out - if((bytePos + 1) >= byteBufferLimit ) { - --bytePos; - System.arraycopy(byteBuffer, bytePos, - fBuffer, 0, - byteBufferLimit - bytePos); - fBufferLength = byteBufferLimit - bytePos; - bytePos += fBufferLength; - break mainLoop; - } - - aByte = byteBuffer[bytePos++] & 0xFF; - fCurrentWindow = (aByte & 0xE0) >> 5; - fOffsets[fCurrentWindow] = 0x10000 + - (0x80 * (((aByte & 0x1F) << 8) - | (byteBuffer[bytePos++] & 0xFF))); - break; - - // reserved, shouldn't happen - case SRESERVED: - break; - - } // end switch - } // end while - break; - - case UNICODEMODE: - // unicode mode decompression loop - unicodeModeLoop: - while(bytePos < byteBufferLimit && ucPos < charBufferLimit) { - aByte = byteBuffer[bytePos++] & 0xFF; - switch(aByte) { - // handle all define tags - case UDEFINE0: case UDEFINE1: case UDEFINE2: case UDEFINE3: - case UDEFINE4: case UDEFINE5: case UDEFINE6: case UDEFINE7: - // verify there is a byte following tag - // if not, save state and break out - if(bytePos >= byteBufferLimit ) { - --bytePos; - System.arraycopy(byteBuffer, bytePos, - fBuffer, 0, - byteBufferLimit - bytePos); - fBufferLength = byteBufferLimit - bytePos; - bytePos += fBufferLength; - break mainLoop; - } - - fCurrentWindow = aByte - UDEFINE0; - fOffsets[fCurrentWindow] = - sOffsetTable[byteBuffer[bytePos++] & 0xFF]; - fMode = SINGLEBYTEMODE; - break unicodeModeLoop; - //break; - - // handle define extended tag - case UDEFINEX: - // verify we have two bytes following tag - // if not, save state and break out - if((bytePos + 1) >= byteBufferLimit ) { - --bytePos; - System.arraycopy(byteBuffer, bytePos, - fBuffer, 0, - byteBufferLimit - bytePos); - fBufferLength = byteBufferLimit - bytePos; - bytePos += fBufferLength; - break mainLoop; - } - - aByte = byteBuffer[bytePos++] & 0xFF; - fCurrentWindow = (aByte & 0xE0) >> 5; - fOffsets[fCurrentWindow] = 0x10000 + - (0x80 * (((aByte & 0x1F) << 8) - | (byteBuffer[bytePos++] & 0xFF))); - fMode = SINGLEBYTEMODE; - break unicodeModeLoop; - //break; - - // handle all change tags - case UCHANGE0: case UCHANGE1: case UCHANGE2: case UCHANGE3: - case UCHANGE4: case UCHANGE5: case UCHANGE6: case UCHANGE7: - fCurrentWindow = aByte - UCHANGE0; - fMode = SINGLEBYTEMODE; - break unicodeModeLoop; - //break; - - // quote unicode - case UQUOTEU: - // verify we have two bytes following tag - // if not, save state and break out - if(bytePos >= byteBufferLimit - 1) { - --bytePos; - System.arraycopy(byteBuffer, bytePos, - fBuffer, 0, - byteBufferLimit - bytePos); - fBufferLength = byteBufferLimit - bytePos; - bytePos += fBufferLength; - break mainLoop; - } - - aByte = byteBuffer[bytePos++]; - charBuffer[ucPos++] = (char) - (aByte << 8 | (byteBuffer[bytePos++] & 0xFF)); - break; - - default: - // verify there is a byte following tag - // if not, save state and break out - if(bytePos >= byteBufferLimit ) { - --bytePos; - System.arraycopy(byteBuffer, bytePos, - fBuffer, 0, - byteBufferLimit - bytePos); - fBufferLength = byteBufferLimit - bytePos; - bytePos += fBufferLength; - break mainLoop; - } - - charBuffer[ucPos++] = (char) - (aByte << 8 | (byteBuffer[bytePos++] & 0xFF)); - break; - - } // end switch - } // end while - break; - - } // end switch( fMode ) - } // end while - - // fill in output parameter - if(bytesRead != null) - bytesRead [0] = (bytePos - byteBufferStart); - - // return # of chars written - return (ucPos - charBufferStart); - } - - /** Reset the decompressor to its initial state. */ - public void reset() - { - // reset dynamic windows - fOffsets[0] = 0x0080; // Latin-1 - fOffsets[1] = 0x00C0; // Latin-1 Supplement + Latin Extended-A - fOffsets[2] = 0x0400; // Cyrillic - fOffsets[3] = 0x0600; // Arabic - fOffsets[4] = 0x0900; // Devanagari - fOffsets[5] = 0x3040; // Hiragana - fOffsets[6] = 0x30A0; // Katakana - fOffsets[7] = 0xFF00; // Fullwidth ASCII - - - fCurrentWindow = 0; // Make current window Latin-1 - fMode = SINGLEBYTEMODE; // Always start in single-byte mode - fBufferLength = 0; // Empty buffer - } -}; diff --git a/icu4j/src/com/ibm/text/UnicodeFilter.java b/icu4j/src/com/ibm/text/UnicodeFilter.java deleted file mode 100755 index 46a1b22582..0000000000 --- a/icu4j/src/com/ibm/text/UnicodeFilter.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UnicodeFilter.java,v $ - * $Date: 2002/02/09 01:01:48 $ - * $Revision: 1.9 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -/** - * UnicodeFilter defines a protocol for selecting a - * subset of the full range (U+0000 to U+FFFF) of Unicode characters. - * Currently, filters are used in conjunction with classes like {@link - * Transliterator} to only process selected characters through a - * transformation. - * - * {@link UnicodeFilterLogic} - */ -public abstract class UnicodeFilter implements UnicodeMatcher { - - /** - * Returns true for characters that are in the selected - * subset. In other words, if a character is to be - * filtered, then contains() returns - * false. - */ - public abstract boolean contains(int c); - - /** - * Default implementation of UnicodeMatcher::matches() for Unicode - * filters. Matches a single 16-bit code unit at offset. - */ - public int matches(Replaceable text, - int[] offset, - int limit, - boolean incremental) { - int c; - if (offset[0] < limit && - contains(c = text.char32At(offset[0]))) { - offset[0] += UTF16.getCharCount(c); - return U_MATCH; - } - if (offset[0] > limit && - contains(c = text.char32At(offset[0]))) { - // Backup offset by 1, unless the preceding character is a - // surrogate pair -- then backup by 2 (keep offset pointing at - // the lead surrogate). - --offset[0]; - if (offset[0] >= 0) { - offset[0] -= UTF16.getCharCount(text.char32At(offset[0])) - 1; - } - return U_MATCH; - } - if (incremental && offset[0] == limit) { - return U_PARTIAL_MATCH; - } - return U_MISMATCH; - } - - /** - * Stubbed out UnicodeMatcher implementation for filters that do - * not implement a pattern. - */ - public String toPattern(boolean escapeUnprintable) { - return ""; - } - - /** - * Stubbed out UnicodeMatcher implementation for filters that do - * not implement indexing. - */ - public boolean matchesIndexValue(int v) { - return false; - } - - /** - * Stubbed out implementation of UnicodeMatcher API. - * @param toUnionTo the set into which to union the source characters - * @return a reference to toUnionTo - */ - public UnicodeSet getMatchSet(UnicodeSet toUnionTo) { - return toUnionTo; - } -} diff --git a/icu4j/src/com/ibm/text/UnicodeFilterLogic.java b/icu4j/src/com/ibm/text/UnicodeFilterLogic.java deleted file mode 100755 index 4a6fb6623b..0000000000 --- a/icu4j/src/com/ibm/text/UnicodeFilterLogic.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UnicodeFilterLogic.java,v $ - * $Date: 2001/09/24 19:57:18 $ - * $Revision: 1.4 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -/** - * UnicodeFilterLogic provides logical operators on - * {@link UnicodeFilter} objects. This class cannot be instantiated; - * it consists only of static methods. The static methods return - * filter objects that perform logical inversion (not), - * intersection (and), or union (or) of the given - * filter objects. - */ -public final class UnicodeFilterLogic { - - /** - * Returns a UnicodeFilter that implements the inverse of - * the given filter. - */ - public static UnicodeFilter not(final UnicodeFilter f) { - return new UnicodeFilter() { - public boolean contains(int c) { - return !f.contains(c); - } - }; - } - - /** - * Returns a UnicodeFilter that implements a short - * circuit AND of the result of the two given filters. That is, - * if f.contains() is false, then g.contains() - * is not called, and contains() returns false. - * - *

    Either f or g must be non-null. - */ - public static UnicodeFilter and(final UnicodeFilter f, - final UnicodeFilter g) { - if (f == null) { - return g; - } - if (g == null) { - return f; - } - return new UnicodeFilter() { - public boolean contains(int c) { - return f.contains(c) && g.contains(c); - } - }; - } - - /** - * Returns a UnicodeFilter that implements a short - * circuit AND of the result of the given filters. That is, if - * f[i].contains() is false, then - * f[j].contains() is not called, where j > i, and - * contains() returns false. - */ - public static UnicodeFilter and(final UnicodeFilter[] f) { - return new UnicodeFilter() { - public boolean contains(int c) { - for (int i=0; iUnicodeFilter that implements a short - * circuit OR of the result of the two given filters. That is, if - * f.contains() is true, then g.contains() is - * not called, and contains() returns true. - * - *

    Either f or g must be non-null. - */ - public static UnicodeFilter or(final UnicodeFilter f, - final UnicodeFilter g) { - if (f == null) { - return g; - } - if (g == null) { - return f; - } - return new UnicodeFilter() { - public boolean contains(int c) { - return f.contains(c) || g.contains(c); - } - }; - } - - /** - * Returns a UnicodeFilter that implements a short - * circuit OR of the result of the given filters. That is, if - * f[i].contains() is false, then - * f[j].contains() is not called, where j > i, and - * contains() returns true. - */ - public static UnicodeFilter or(final UnicodeFilter[] f) { - return new UnicodeFilter() { - public boolean contains(int c) { - for (int i=0; iUnicodeMatcher defines a protocol for objects that can - * match a range of characters in a Replaceable string. - */ -public interface UnicodeMatcher { - - /** - * Constant returned by matches() indicating a - * mismatch between the text and this matcher. The text contains - * a character which does not match, or the text does not contain - * all desired characters for a non-incremental match. - */ - public static final int U_MISMATCH = 0; - - /** - * Constant returned by matches() indicating a - * partial match between the text and this matcher. This value is - * only returned for incremental match operations. All characters - * of the text match, but more characters are required for a - * complete match. Alternatively, for variable-length matchers, - * all characters of the text match, and if more characters were - * supplied at limit, they might also match. - */ - public static final int U_PARTIAL_MATCH = 1; - - /** - * Constant returned by matches() indicating a - * complete match between the text and this matcher. For an - * incremental variable-length match, this value is returned if - * the given text matches, and it is known that additional - * characters would not alter the extent of the match. - */ - public static final int U_MATCH = 2; - - /** - * Return a UMatchDegree value indicating the degree of match for - * the given text at the given offset. Zero, one, or more - * characters may be matched. - * - * Matching in the forward direction is indicated by limit > - * offset. Characters from offset forwards to limit-1 will be - * considered for matching. - * - * Matching in the reverse direction is indicated by limit < - * offset. Characters from offset backwards to limit+1 will be - * considered for matching. - * - * If limit == offset then the only match possible is a zero - * character match (which subclasses may implement if desired). - * - * As a side effect, advance the offset parameter to the limit of - * the matched substring. In the forward direction, this will be - * the index of the last matched character plus one. In the - * reverse direction, this will be the index of the last matched - * character minus one. - * - * @param text the text to be matched - * @param offset on input, the index into text at which to begin - * matching. On output, the limit of the matched text. The - * number of matched characters is the output value of offset - * minus the input value. Offset should always point to the - * HIGH SURROGATE (leading code unit) of a pair of surrogates, - * both on entry and upon return. - * @param limit the limit index of text to be matched. Greater - * than offset for a forward direction match, less than offset for - * a backward direction match. The last character to be - * considered for matching will be text.charAt(limit-1) in the - * forward direction or text.charAt(limit+1) in the backward - * direction. - * @param incremental if TRUE, then assume further characters may - * be inserted at limit and check for partial matching. Otherwise - * assume the text as given is complete. - * @return a match degree value indicating a full match, a partial - * match, or a mismatch. If incremental is FALSE then - * U_PARTIAL_MATCH should never be returned. - */ - public abstract int matches(Replaceable text, - int[] offset, - int limit, - boolean incremental); - - /** - * Returns a string representation of this matcher. If the result of - * calling this function is passed to the appropriate parser, it - * will produce another matcher that is equal to this one. - * @param escapeUnprintable if TRUE then convert unprintable - * character to their hex escape representations, \\uxxxx or - * \\Uxxxxxxxx. Unprintable characters are those other than - * U+000A, U+0020..U+007E. - */ - public abstract String toPattern(boolean escapeUnprintable); - - /** - * Returns TRUE if this matcher will match a character c, where c - * & 0xFF == v, at offset, in the forward direction (with limit > - * offset). This is used by RuleBasedTransliterator for - * indexing. - * - *

    Note: This API uses an int even though the value will be - * restricted to 8 bits in order to avoid complications with - * signedness (bytes convert to ints in the range -128..127). - */ - public abstract boolean matchesIndexValue(int v); - - /** - * Union the set of all characters that may be matched by this object - * into the given set. - * @param toUnionTo the set into which to union the source characters - * @return a reference to toUnionTo - */ - public abstract UnicodeSet getMatchSet(UnicodeSet toUnionTo); -} - -//eof diff --git a/icu4j/src/com/ibm/text/UnicodeNameTransliterator.java b/icu4j/src/com/ibm/text/UnicodeNameTransliterator.java deleted file mode 100755 index 595ee04c7c..0000000000 --- a/icu4j/src/com/ibm/text/UnicodeNameTransliterator.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 1996-2001, International Business Machines Corporation and - * others. All Rights Reserved. - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UnicodeNameTransliterator.java,v $ - * $Date: 2002/02/09 01:01:48 $ - * $Revision: 1.6 $ - */ -package com.ibm.text; -import java.util.*; - -/** - * A transliterator that performs character to name mapping. - * @author Alan Liu - */ -class UnicodeNameTransliterator extends Transliterator { - - char openDelimiter; - char closeDelimiter; - - static final String _ID = "Any-Name"; - - /** - * System registration hook. - */ - static void register() { - Transliterator.registerFactory(_ID, new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new UnicodeNameTransliterator(null); - } - }); - } - - /** - * Constructs a transliterator. - */ - public UnicodeNameTransliterator(char openDelimiter, char closeDelimiter, - UnicodeFilter filter) { - super(_ID, filter); - this.openDelimiter = openDelimiter; - this.closeDelimiter = closeDelimiter; - } - - /** - * Constructs a transliterator with the default delimiters '{' and - * '}'. - */ - public UnicodeNameTransliterator(UnicodeFilter filter) { - this('{', '}', filter); - } - - /** - * Implements {@link Transliterator#handleTransliterate}. - */ - protected void handleTransliterate(Replaceable text, - Position offsets, boolean isIncremental) { - int cursor = offsets.start; - int limit = offsets.limit; - - StringBuffer str = new StringBuffer(); - str.append(openDelimiter); - int len; - String name; - - while (cursor < limit) { - int c = text.char32At(cursor); - if ((name=UCharacter.getName(c)) != null) { - - str.setLength(1); - str.append(name).append(closeDelimiter); - - int clen = UTF16.getCharCount(c); - text.replace(cursor, cursor+clen, str.toString()); - len = str.length(); - cursor += len; // advance cursor by 1 and adjust for new text - limit += len-clen; // change in length - } else { - ++cursor; - } - } - - offsets.contextLimit += limit - offsets.limit; - offsets.limit = limit; - offsets.start = cursor; - } -} diff --git a/icu4j/src/com/ibm/text/UnicodePropertySet.java b/icu4j/src/com/ibm/text/UnicodePropertySet.java deleted file mode 100755 index d5af4e100b..0000000000 --- a/icu4j/src/com/ibm/text/UnicodePropertySet.java +++ /dev/null @@ -1,639 +0,0 @@ -/* -********************************************************************** -* Copyright (c) 2001, International Business Machines -* Corporation and others. All Rights Reserved. -********************************************************************** -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UnicodePropertySet.java,v $ -* $Date: 2001/11/21 21:43:40 $ -* $Revision: 1.8 $ -********************************************************************** -*/ -package com.ibm.text; - -import java.text.*; -import java.util.*; -import com.ibm.util.Utility; - -/** - * INTERNAL CLASS implementing the UnicodeSet properties as outlined - * at: - * - * http://oss.software.ibm.com/cvs/icu/~checkout~/icuhtml/design/unicodeset_properties.html - * - * Recognized syntax: - * - * [:foo:] [:^foo:] - white space not allowed within "[:" or ":]" - * \p{foo} \P{foo} - white space not allowed within "\p" or "\P" - * - * Other than the above restrictions, white space is ignored. Case - * is ignored except in "\p" and "\P". - * - * This class cannot be instantiated. It has a public static method, - * createPropertySet(), with takes a pattern to be parsed and returns - * a new UnicodeSet. Another public static method, - * resemblesPattern(), returns true if a given pattern string appears - * to be a property set pattern, and therefore should be passed in to - * createPropertySet(). - * - * NOTE: Current implementation is incomplete. The following list - * indicates which properties are supported. - * - * + GeneralCategory - * CombiningClass - * BidiClass - * DecompositionType - * + NumericValue - * NumericType - * EastAsianWidth - * LineBreak - * JoiningType - * + Script - * - * '+' indicates a supported property. - * - * @author Alan Liu - * @version $RCSfile: UnicodePropertySet.java,v $ $Revision: 1.8 $ $Date: 2001/11/21 21:43:40 $ - */ -class UnicodePropertySet { - - private static Hashtable NAME_MAP = null; - - private static Hashtable CATEGORY_MAP = null; - - /** - * A cache mapping character category integers, as returned by - * UCharacter.getType(), to sets. Entries are initially - * null and are created on demand. - */ - private static UnicodeSet[] CATEGORY_CACHE = null; - - /** - * A cache mapping script integers, as defined by - * UScript, to sets. Entries are initially - * null and are created on demand. - */ - private static UnicodeSet[] SCRIPT_CACHE = null; - - // Special value codes - private static final int ANY = -1; // general category: all code points - - // >From UnicodeData: - // 3400;;Lo;0;L;;;;;N;;;;; - // 4DB5;;Lo;0;L;;;;;N;;;;; - // 4E00;;Lo;0;L;;;;;N;;;;; - // 9FA5;;Lo;0;L;;;;;N;;;;; - // AC00;;Lo;0;L;;;;;N;;;;; - // D7A3;;Lo;0;L;;;;;N;;;;; - // D800;;Cs;0;L;;;;;N;;;;; - // DB7F;;Cs;0;L;;;;;N;;;;; - // DB80;;Cs;0;L;;;;;N;;;;; - // DBFF;;Cs;0;L;;;;;N;;;;; - // DC00;;Cs;0;L;;;;;N;;;;; - // DFFF;;Cs;0;L;;;;;N;;;;; - // E000;;Co;0;L;;;;;N;;;;; - // F8FF;;Co;0;L;;;;;N;;;;; - // 20000;;Lo;0;L;;;;;N;;;;; - // 2A6D6;;Lo;0;L;;;;;N;;;;; - // F0000;;Co;0;L;;;;;N;;;;; - // FFFFD;;Co;0;L;;;;;N;;;;; - // 100000;;Co;0;L;;;;;N;;;;; - // 10FFFD;;Co;0;L;;;;;N;;;;; - // - // >Large Blocks of Unassigned: (from DerivedGeneralCategory) - // 1044E..1CFFF ; Cn # [52146] - // 1D800..1FFFF ; Cn # [10240] - // 2A6D7..2F7FF ; Cn # [20777] - // 2FA1E..E0000 ; Cn # [722403] - // E0080..EFFFF ; Cn # [65408] - - // TODO: The Inclusion List should be generated from the UCD for each - // version, and thus should be accessed from the properties data file - // (Even better: move the logic into UCharacter for building these - // properties, since that is where it belongs!) - - /** - * A set of all characters _except_ the second through last characters of - * certain ranges. These ranges are ranges of characters whose - * properties are all exactly alike, e.g. CJK Ideographs from - * U+4E00 to U+9FA5. - */ - private static final UnicodeSet INCLUSIONS = - new UnicodeSet("[^\\u3401-\\u4DB5 \\u4E01-\\u9FA5 \\uAC01-\\uD7A3 \\uD801-\\uDB7F \\uDB81-\\uDBFF \\uDC01-\\uDFFF \\uE001-\\uF8FF \\U0001044F-\\U0001CFFF \\U0001D801-\\U0001FFFF \\U00020001-\\U0002A6D6 \\U0002A6D8-\\U0002F7FF \\U0002FA1F-\\U000E0000 \\U000E0081-\\U000EFFFF \\U000F0001-\\U000FFFFD \\U00100001-\\U0010FFFD]"); - - //---------------------------------------------------------------- - // Public API - //---------------------------------------------------------------- - - /** - * Return true if the given position, in the given pattern, appears - * to be the start of a property set pattern [:foo:], \p{foo}, or - * \P{foo}. - */ - public static boolean resemblesPattern(String pattern, int pos) { - // Patterns are at least 5 characters long - if ((pos+5) > pattern.length()) { - return false; - } - - // Look for an opening [:, [:^, \p, or \P - return pattern.regionMatches(pos, "[:", 0, 2) || - pattern.regionMatches(true, pos, "\\p", 0, 2); - } - - /** - * Create a UnicodeSet by parsing the given pattern at the given - * parse position. - * - * @param pattern the pattern string - * @param ppos on entry, the position at which to begin parsing. - * This shold be one of the locations marked '^': - * - * [:blah:] \p{blah} \P{blah} - * ^ % ^ % ^ % - * - * On return, the position after the last character parsed, that is, - * the locations marked '%'. If the parse fails, ppos is returned - * unchanged. - * @return a newly-constructed UnicodeSet object, or null upon - * failure. - */ - public static UnicodeSet createFromPattern(String pattern, ParsePosition ppos) { - init(); - - UnicodeSet set = null; - - int pos = ppos.getIndex(); - - // On entry, ppos should point to one of the following locations: - - // Minimum length is 5 characters, e.g. \p{L} - if ((pos+5) > pattern.length()) { - return null; - } - - boolean posix = false; // true for [:pat:], false for \p{pat} \P{pat} - boolean invert = false; - - // Look for an opening [:, [:^, \p, or \P - if (pattern.regionMatches(pos, "[:", 0, 2)) { - posix = true; - pos = Utility.skipWhitespace(pattern, pos+2); - if (pos < pattern.length() && pattern.charAt(pos) == '^') { - ++pos; - invert = true; - } - } else if (pattern.regionMatches(true, pos, "\\p", 0, 2)) { - invert = (pattern.charAt(pos+1) == 'P'); - pos = Utility.skipWhitespace(pattern, pos+2); - if (pos == pattern.length() || pattern.charAt(pos++) != '{') { - // Syntax error; "\p" or "\P" not followed by "{" - return null; - } - } else { - // Open delimiter not seen - return null; - } - - // Look for the matching close delimiter, either :] or } - int close = pattern.indexOf(posix ? ":]" : "}", pos); - if (close < 0) { - // Syntax error; close delimiter missing - return null; - } - - // Look for an '=' sign. If this is present, we will parse a - // medium \p{gc=Cf} or long \p{GeneralCategory=Format} - // pattern. - int equals = pattern.indexOf('=', pos); - if (equals >= 0 && equals < close) { - // Equals seen; parse medium/long pattern - String typeName = munge(pattern, pos, equals); - String valueName = munge(pattern, equals+1, close); - SetFactory factory; - factory = (SetFactory) NAME_MAP.get(typeName); - if (factory == null) { - // Syntax error; type name not recognized - return null; - } - set = factory.create(valueName); - } else { - // No equals seen; parse short format \p{Cf} - String shortName = munge(pattern, pos, close); - - // First try general category - set = createCategorySet(shortName); - - // If this fails, try script - if (set == null) { - set = createScriptSet(shortName); - } - } - - if (invert) { - set.complement(); - } - - // Move to the limit position after the close delimiter - ppos.setIndex(close + (posix ? 2 : 1)); - - return set; - } - - //---------------------------------------------------------------- - // Property set factory classes - // NOTE: This will change/go away when we implement UCharacter - // based property retrieval. - //---------------------------------------------------------------- - - static interface SetFactory { - - UnicodeSet create(String valueName); - } - - static class NumericValueFactory implements SetFactory { - NumericValueFactory() {} - public UnicodeSet create(String valueName) { - double value = Double.parseDouble(valueName); - final int ivalue = (int) value; - if (ivalue != value || ivalue < 0) { - // UCharacter doesn't support negative or non-integral - // values, so just return an empty set - return new UnicodeSet(); - } - return createSetFromFilter(new Filter() { - public boolean contains(int cp) { - return UCharacter.getUnicodeNumericValue(cp) == ivalue; - } - }); - } - } - - //---------------------------------------------------------------- - // Property set factory static methods - // NOTE: This will change/go away when we implement UCharacter - // based property retrieval. - //---------------------------------------------------------------- - - /** - * Given a general category value name, create a corresponding - * set and return it, or return null if the name is invalid. - * @param valueName a pre-munged general category value name - */ - private static UnicodeSet createCategorySet(String valueName) { - Integer valueObj; - valueObj = (Integer) CATEGORY_MAP.get(valueName); - if (valueObj == null) { - return null; - } - int valueCode = valueObj.intValue(); - - UnicodeSet set = new UnicodeSet(); - if (valueCode == ANY) { - set.complement(); - return set; - } - for (int cat=0; cat= 0) { - set.add(startHasProperty, ch-1); - startHasProperty = -1; - } - } - } - if (startHasProperty >= 0) { - set.add(startHasProperty, 0x10FFFF); - } - - return set; - } - - //---------------------------------------------------------------- - // Type and value name maps - //---------------------------------------------------------------- - - /** - * Add a type mapping to the name map. - */ - private static void addType(String shortName, String longName, - SetFactory factory) { - // DEBUGGING CODE: DISABLE FOR PRODUCTION BUILD - if (false) { - if (NAME_MAP.get(shortName) != null) { - throw new InternalError("Duplicate name " + shortName); - } - if (NAME_MAP.get(longName) != null) { - throw new InternalError("Duplicate name " + longName); - } - } - - NAME_MAP.put(shortName, factory); - NAME_MAP.put(longName, factory); - } - - /** - * Add a value mapping to the name map. - */ - private static void addValue(Hashtable map, - String shortName, String longName, - int value) { - // DEBUGGING CODE: DISABLE FOR PRODUCTION BUILD - if (true) { - if (map.get(shortName) != null) { - throw new InternalError("Duplicate name " + shortName); - } - if (longName != null && map.get(longName) != null) { - throw new InternalError("Duplicate name " + longName); - } - } - - Integer valueObj = new Integer(value); - map.put(shortName, valueObj); - if (longName != null) { - map.put(longName, valueObj); - } - } - - static void init() { - if (NAME_MAP != null) { - return; - } - - NAME_MAP = new Hashtable(); - CATEGORY_MAP = new Hashtable(); - CATEGORY_CACHE = new UnicodeSet[UCharacterCategory.CHAR_CATEGORY_COUNT]; - SCRIPT_CACHE = new UnicodeSet[UScript.CODE_LIMIT]; - - // NOTE: We munge all search keys to have no whitespace - // and upper case. As such, all stored keys should have - // this format. - - // Load the map with type data - - addType("GC", "GENERALCATEGORY", new SetFactory() { - public UnicodeSet create(String valueName) { - return createCategorySet(valueName); - } - }); - - //addType("CC", "COMBININGCLASS", COMBINING_CLASS); - //addType("BC", "BIDICLASS", BIDI_CLASS); - //addType("DT", "DECOMPOSITIONTYPE", DECOMPOSITION_TYPE); - - addType("NV", "NUMERICVALUE", new NumericValueFactory()); - - //addType("NT", "NUMERICTYPE", NUMERIC_TYPE); - //addType("EA", "EASTASIANWIDTH", EAST_ASIAN_WIDTH); - //addType("LB", "LINEBREAK", LINE_BREAK); - //addType("JT", "JOININGTYPE", JOINING_TYPE); - - addType("SC", "SCRIPT", new SetFactory() { - public UnicodeSet create(String valueName) { - return createScriptSet(valueName); - } - }); - - // Load the map with value data - - // General Category - - addValue(CATEGORY_MAP, "ANY", null, ANY); // special case - - addValue(CATEGORY_MAP, "C", "OTHER", - (1 << UCharacterCategory.CONTROL) | - (1 << UCharacterCategory.FORMAT) | - (1 << UCharacterCategory.GENERAL_OTHER_TYPES) | - (1 << UCharacterCategory.PRIVATE_USE) | - (1 << UCharacterCategory.SURROGATE)); - - addValue(CATEGORY_MAP, "CC", "CONTROL", - 1 << UCharacterCategory.CONTROL); - addValue(CATEGORY_MAP, "CF", "FORMAT", - 1 << UCharacterCategory.FORMAT); - addValue(CATEGORY_MAP, "CN", "UNASSIGNED", - 1 << UCharacterCategory.GENERAL_OTHER_TYPES); - addValue(CATEGORY_MAP, "CO", "PRIVATEUSE", - 1 << UCharacterCategory.PRIVATE_USE); - addValue(CATEGORY_MAP, "CS", "SURROGATE", - 1 << UCharacterCategory.SURROGATE); - - addValue(CATEGORY_MAP, "L", "LETTER", - (1 << UCharacterCategory.LOWERCASE_LETTER) | - (1 << UCharacterCategory.MODIFIER_LETTER) | - (1 << UCharacterCategory.OTHER_LETTER) | - (1 << UCharacterCategory.TITLECASE_LETTER) | - (1 << UCharacterCategory.UPPERCASE_LETTER)); - - addValue(CATEGORY_MAP, "LL", "LOWERCASELETTER", - 1 << UCharacterCategory.LOWERCASE_LETTER); - addValue(CATEGORY_MAP, "LM", "MODIFIERLETTER", - 1 << UCharacterCategory.MODIFIER_LETTER); - addValue(CATEGORY_MAP, "LO", "OTHERLETTER", - 1 << UCharacterCategory.OTHER_LETTER); - addValue(CATEGORY_MAP, "LT", "TITLECASELETTER", - 1 << UCharacterCategory.TITLECASE_LETTER); - addValue(CATEGORY_MAP, "LU", "UPPERCASELETTER", - 1 << UCharacterCategory.UPPERCASE_LETTER); - - addValue(CATEGORY_MAP, "M", "MARK", - (1 << UCharacterCategory.NON_SPACING_MARK) | - (1 << UCharacterCategory.COMBINING_SPACING_MARK) | - (1 << UCharacterCategory.ENCLOSING_MARK)); - - addValue(CATEGORY_MAP, "MN", "NONSPACINGMARK", - 1 << UCharacterCategory.NON_SPACING_MARK); - addValue(CATEGORY_MAP, "MC", "SPACINGMARK", - 1 << UCharacterCategory.COMBINING_SPACING_MARK); - addValue(CATEGORY_MAP, "ME", "ENCLOSINGMARK", - 1 << UCharacterCategory.ENCLOSING_MARK); - - addValue(CATEGORY_MAP, "N", "NUMBER", - (1 << UCharacterCategory.DECIMAL_DIGIT_NUMBER) | - (1 << UCharacterCategory.LETTER_NUMBER) | - (1 << UCharacterCategory.OTHER_NUMBER)); - - addValue(CATEGORY_MAP, "ND", "DECIMALNUMBER", - 1 << UCharacterCategory.DECIMAL_DIGIT_NUMBER); - addValue(CATEGORY_MAP, "NL", "LETTERNUMBER", - 1 << UCharacterCategory.LETTER_NUMBER); - addValue(CATEGORY_MAP, "NO", "OTHERNUMBER", - 1 << UCharacterCategory.OTHER_NUMBER); - - addValue(CATEGORY_MAP, "P", "PUNCTUATION", - (1 << UCharacterCategory.CONNECTOR_PUNCTUATION) | - (1 << UCharacterCategory.DASH_PUNCTUATION) | - (1 << UCharacterCategory.END_PUNCTUATION) | - (1 << UCharacterCategory.FINAL_PUNCTUATION) | - (1 << UCharacterCategory.INITIAL_PUNCTUATION) | - (1 << UCharacterCategory.OTHER_PUNCTUATION) | - (1 << UCharacterCategory.START_PUNCTUATION)); - - addValue(CATEGORY_MAP, "PC", "CONNECTORPUNCTUATION", - 1 << UCharacterCategory.CONNECTOR_PUNCTUATION); - addValue(CATEGORY_MAP, "PD", "DASHPUNCTUATION", - 1 << UCharacterCategory.DASH_PUNCTUATION); - addValue(CATEGORY_MAP, "PE", "ENDPUNCTUATION", - 1 << UCharacterCategory.END_PUNCTUATION); - addValue(CATEGORY_MAP, "PF", "FINALPUNCTUATION", - 1 << UCharacterCategory.FINAL_PUNCTUATION); - addValue(CATEGORY_MAP, "PI", "INITIALPUNCTUATION", - 1 << UCharacterCategory.INITIAL_PUNCTUATION); - addValue(CATEGORY_MAP, "PO", "OTHERPUNCTUATION", - 1 << UCharacterCategory.OTHER_PUNCTUATION); - addValue(CATEGORY_MAP, "PS", "STARTPUNCTUATION", - 1 << UCharacterCategory.START_PUNCTUATION); - - addValue(CATEGORY_MAP, "S", "SYMBOL", - (1 << UCharacterCategory.CURRENCY_SYMBOL) | - (1 << UCharacterCategory.MODIFIER_SYMBOL) | - (1 << UCharacterCategory.MATH_SYMBOL) | - (1 << UCharacterCategory.OTHER_SYMBOL)); - - addValue(CATEGORY_MAP, "SC", "CURRENCYSYMBOL", - 1 << UCharacterCategory.CURRENCY_SYMBOL); - addValue(CATEGORY_MAP, "SK", "MODIFIERSYMBOL", - 1 << UCharacterCategory.MODIFIER_SYMBOL); - addValue(CATEGORY_MAP, "SM", "MATHSYMBOL", - 1 << UCharacterCategory.MATH_SYMBOL); - addValue(CATEGORY_MAP, "SO", "OTHERSYMBOL", - 1 << UCharacterCategory.OTHER_SYMBOL); - - addValue(CATEGORY_MAP, "Z", "SEPARATOR", - (1 << UCharacterCategory.LINE_SEPARATOR) | - (1 << UCharacterCategory.PARAGRAPH_SEPARATOR) | - (1 << UCharacterCategory.SPACE_SEPARATOR)); - - addValue(CATEGORY_MAP, "ZL", "LINESEPARATOR", - 1 << UCharacterCategory.LINE_SEPARATOR); - addValue(CATEGORY_MAP, "ZP", "PARAGRAPHSEPARATOR", - 1 << UCharacterCategory.PARAGRAPH_SEPARATOR); - addValue(CATEGORY_MAP, "ZS", "SPACESEPARATOR", - 1 << UCharacterCategory.SPACE_SEPARATOR); - } -} diff --git a/icu4j/src/com/ibm/text/UnicodeReplacer.java b/icu4j/src/com/ibm/text/UnicodeReplacer.java deleted file mode 100755 index 16f745febc..0000000000 --- a/icu4j/src/com/ibm/text/UnicodeReplacer.java +++ /dev/null @@ -1,57 +0,0 @@ -/* -********************************************************************** -* Copyright (c) 2002, International Business Machines Corporation -* and others. All Rights Reserved. -********************************************************************** -* Date Name Description -* 01/14/2002 aliu Creation. -********************************************************************** -*/ - -package com.ibm.text; - -/** - * UnicodeReplacer defines a protocol for objects that - * replace a range of characters in a Replaceable string with output - * text. The replacement is done via the Replaceable API so as to - * preserve out-of-band data. - * @author Alan Liu - */ -interface UnicodeReplacer { - - /** - * Replace characters in 'text' from 'start' to 'limit' with the - * output text of this object. Update the 'cursor' parameter to - * give the cursor position and return the length of the - * replacement text. - * - * @param text the text to be matched - * @param start inclusive start index of text to be replaced - * @param limit exclusive end index of text to be replaced; - * must be greater than or equal to start - * @param cursor output parameter for the cursor position. - * Not all replacer objects will update this, but in a complete - * tree of replacer objects, representing the entire output side - * of a transliteration rule, at least one must update it. - * @return the number of 16-bit code units in the text replacing - * the characters at offsets start..(limit-1) in text - */ - public abstract int replace(Replaceable text, - int start, - int limit, - int[] cursor); - - /** - * Returns a string representation of this replacer. If the - * result of calling this function is passed to the appropriate - * parser, typically TransliteratorParser, it will produce another - * replacer that is equal to this one. - * @param escapeUnprintable if TRUE then convert unprintable - * character to their hex escape representations, \\uxxxx or - * \\Uxxxxxxxx. Unprintable characters are defined by - * Utility.isUnprintable(). - */ - public abstract String toReplacerPattern(boolean escapeUnprintable); -} - -//eof diff --git a/icu4j/src/com/ibm/text/UnicodeSet.java b/icu4j/src/com/ibm/text/UnicodeSet.java deleted file mode 100755 index c0cccc3b6b..0000000000 --- a/icu4j/src/com/ibm/text/UnicodeSet.java +++ /dev/null @@ -1,1772 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UnicodeSet.java,v $ - * $Date: 2001/12/13 23:00:49 $ - * $Revision: 1.54 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import java.text.*; -import com.ibm.util.Utility; - -/** - * A mutable set of Unicode characters. Objects of this class - * represent character classes used in regular expressions. - * A character specifies a subset of Unicode code points. Legal - * code points are U+0000 to U+10FFFF, inclusive. - * - *

    UnicodeSet supports two APIs. The first is the - * operand API that allows the caller to modify the value of - * a UnicodeSet object. It conforms to Java 2's - * java.util.Set interface, although - * UnicodeSet does not actually implement that - * interface. All methods of Set are supported, with the - * modification that they take a character range or single character - * instead of an Object, and they take a - * UnicodeSet instead of a Collection. The - * operand API may be thought of in terms of boolean logic: a boolean - * OR is implemented by add, a boolean AND is implemented - * by retain, a boolean XOR is implemented by - * complement taking an argument, and a boolean NOT is - * implemented by complement with no argument. In terms - * of traditional set theory function names, add is a - * union, retain is an intersection, remove - * is an asymmetric difference, and complement with no - * argument is a set complement with respect to the superset range - * MIN_VALUE-MAX_VALUE - * - *

    The second API is the - * applyPattern()/toPattern() API from the - * java.text.Format-derived classes. Unlike the - * methods that add characters, add categories, and control the logic - * of the set, the method applyPattern() sets all - * attributes of a UnicodeSet at once, based on a - * string pattern. - * - *

    Pattern syntax

    - * - * Patterns are accepted by the constructors and the - * applyPattern() methods and returned by the - * toPattern() method. These patterns follow a syntax - * similar to that employed by version 8 regular expression character - * classes: - * - *
    - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    pattern :=  ('[' '^'? item* ']') | - * property
    item :=  char | (char '-' char) | pattern-expr
    - *
    pattern-expr :=  pattern | pattern-expr pattern | - * pattern-expr op pattern
    - *
    op :=  '&' | '-'
    - *
    special :=  '[' | ']' | '-'
    - *
    char :=  any character that is not special
    - * | ('\u005C'
    any character)
    - * | ('\u005Cu' hex hex hex hex)
    - *
    hex :=  any character for which - * Character.digit(c, 16) - * returns a non-negative result
    property :=  a Unicode property set pattern
    - *
    - * - * - * - * - *
    Legend: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
    a := b  a may be replaced by b
    a?zero or one instance of a
    - *
    a*one or more instances of a
    - *
    a | beither a or b
    - *
    'a'the literal string between the quotes
    - *
    - *
    - * - * Any character may be preceded by a backslash in order to remove any special - * meaning. White space characters, as defined by UCharacter.isWhitespace(), are - * ignored, unless they are escaped. - * - *

    Property patterns specify a set of characters having a certain - * property as defined by the Unicode standard. Both the POSIX-like - * "[:Lu:]" and the Perl-like syntax "\p{Lu}" are recognized. For a - * complete list of supported property patterns, see the User's Guide - * for UnicodeSet at - * - * http://oss.software.ibm.com/icu/userguide/unicodeset.html. - * Actual determination of property data is defined by the underlying - * Unicode database as implemented by UCharacter. - * - *

    Patterns specify individual characters, ranges of characters, and - * Unicode property sets. When elements are concatenated, they - * specify their union. To complement a set, place a '^' immediately - * after the opening '['. Property patterns are inverted by modifying - * their delimiters; "[:^foo]" and "\P{foo}". In any other location, - * '^' has no special meaning. - * - *

    Ranges are indicated by placing two a '-' between two - * characters, as in "a-z". This specifies the range of all - * characters from the left to the right, in Unicode order. If the - * left character is greater than or equal to the - * right character it is a syntax error. If a '-' occurs as the first - * character after the opening '[' or '[^', or if it occurs as the - * last character before the closing ']', then it is taken as a - * literal. Thus "[a\u005C-b]", "[-ab]", and "[ab-]" all indicate the same - * set of three characters, 'a', 'b', and '-'. - * - *

    Sets may be intersected using the '&' operator or the asymmetric - * set difference may be taken using the '-' operator, for example, - * "[[:L:]&[\u005Cu0000-\u005Cu0FFF]]" indicates the set of all Unicode letters - * with values less than 4096. Operators ('&' and '|') have equal - * precedence and bind left-to-right. Thus - * "[[:L:]-[a-z]-[\u005Cu0100-\u005Cu01FF]]" is equivalent to - * "[[[:L:]-[a-z]]-[\u005Cu0100-\u005Cu01FF]]". This only really matters for - * difference; intersection is commutative. - * - * - *
    [a]The set containing 'a' - *
    [a-z]The set containing 'a' - * through 'z' and all letters in between, in Unicode order - *
    [^a-z]The set containing - * all characters but 'a' through 'z', - * that is, U+0000 through 'a'-1 and 'z'+1 through U+10FFFF - *
    [[pat1][pat2]] - * The union of sets specified by pat1 and pat2 - *
    [[pat1]&[pat2]] - * The intersection of sets specified by pat1 and pat2 - *
    [[pat1]-[pat2]] - * The asymmetric difference of sets specified by pat1 and - * pat2 - *
    [:Lu:] or \p{Lu} - * The set of characters having the specified - * Unicode property; in - * this case, Unicode uppercase letters - *
    [:^Lu:] or \P{Lu} - * The set of characters not having the given - * Unicode property - *
    - * @author Alan Liu - * @version $RCSfile: UnicodeSet.java,v $ $Revision: 1.54 $ $Date: 2001/12/13 23:00:49 $ - */ -public class UnicodeSet extends UnicodeFilter { - - private static final int LOW = 0x000000; // LOW <= all valid values. ZERO for codepoints - private static final int HIGH = 0x110000; // HIGH > all valid values. 10000 for code units. - // 110000 for codepoints - - /** - * Minimum value that can be stored in a UnicodeSet. - */ - public static final int MIN_VALUE = LOW; - - /** - * Maximum value that can be stored in a UnicodeSet. - */ - public static final int MAX_VALUE = HIGH - 1; - - private int len; // length used; list may be longer to minimize reallocs - private int[] list; // MUST be terminated with HIGH - private int[] rangeList; // internal buffer - private int[] buffer; // internal buffer - - /** - * The pattern representation of this set. This may not be the - * most economical pattern. It is the pattern supplied to - * applyPattern(), with variables substituted and whitespace - * removed. For sets constructed without applyPattern(), or - * modified using the non-pattern API, this string will be null, - * indicating that toPattern() must generate a pattern - * representation from the inversion list. - */ - private String pat = null; - - private static final int START_EXTRA = 16; // initial storage. Must be >= 0 - private static final int GROW_EXTRA = START_EXTRA; // extra amount for growth. Must be >= 0 - - //---------------------------------------------------------------- - // Public API - //---------------------------------------------------------------- - - /** - * Constructs an empty set. - */ - public UnicodeSet() { - list = new int[1 + START_EXTRA]; - list[len++] = HIGH; - } - - /** - * Constructs a copy of an existing set. - */ - public UnicodeSet(UnicodeSet other) { - set(other); - } - - /** - * Constructs a set containing the given range. If end > - * start then an empty set is created. - * - * @param start first character, inclusive, of range - * @param end last character, inclusive, of range - */ - public UnicodeSet(int start, int end) { - this(); - complement(start, end); - } - - /** - * Constructs a set from the given pattern. See the class description - * for the syntax of the pattern language. Whitespace is ignored. - * @param pattern a string specifying what characters are in the set - * @exception java.lang.IllegalArgumentException if the pattern contains - * a syntax error. - */ - public UnicodeSet(String pattern) { - this(pattern, true); - } - - /** - * Constructs a set from the given pattern. See the class description - * for the syntax of the pattern language. - * @param pattern a string specifying what characters are in the set - * @param ignoreWhitespace if true, ignore characters for which - * Character.isWhitespace() returns true - * @exception java.lang.IllegalArgumentException if the pattern contains - * a syntax error. - */ - public UnicodeSet(String pattern, boolean ignoreWhitespace) { - this(); - applyPattern(pattern, ignoreWhitespace); - } - - /** - * Constructs a set from the given pattern. See the class description - * for the syntax of the pattern language. - * @param pattern a string specifying what characters are in the set - * @param pos on input, the position in pattern at which to start parsing. - * On output, the position after the last character parsed. - * @param symbols a symbol table mapping variables to char[] arrays - * and chars to UnicodeSets - * @exception java.lang.IllegalArgumentException if the pattern - * contains a syntax error. - */ - public UnicodeSet(String pattern, ParsePosition pos, SymbolTable symbols) { - this(); - applyPattern(pattern, pos, symbols, true); - } - - // Delete the following when the category constructor is removed - private static final String CATEGORY_NAMES = - // 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 - //0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 8 9 0 1 2 3 4 5 6 7 8 - "CnLuLlLtLmLoMnMeMcNdNlNoZsZlZpCcCf--CoCsPdPsPePcPoSmScSkSo"; - /** - * DEPRECATED - Constructs a set from the given Unicode character - * category. - * @param category an integer indicating the character category as - * returned by java.lang.Character.getType(). Note - * that this is different from the UCharacterCategory - * codes. - * @exception java.lang.IllegalArgumentException if the given - * category is invalid. - * @deprecated this will be removed Dec-31-2002 - */ - public UnicodeSet(int category) { - if (category < 0 || category > java.lang.Character.OTHER_SYMBOL || - category == 17) { - throw new IllegalArgumentException("Invalid category"); - } - String pat = "[:" + CATEGORY_NAMES.substring(2*category, 2*category+2) + ":]"; - applyPattern(pat, false); - } - - /** - * Return a new set that is equivalent to this one. - */ - public Object clone() { - return new UnicodeSet(this); - } - - /** - * Make this object represent the range start - end. - * If end > start then this object is set to an - * an empty range. - * - * @param start first character in the set, inclusive - * @rparam end last character in the set, inclusive - */ - public void set(int start, int end) { - clear(); - complement(start, end); - } - - /** - * Make this object represent the same set as other. - * @param other a UnicodeSet whose value will be - * copied to this object - */ - public void set(UnicodeSet other) { - list = (int[]) other.list.clone(); - len = other.len; - pat = other.pat; - } - - /** - * Modifies this set to represent the set specified by the given pattern. - * See the class description for the syntax of the pattern language. - * Whitespace is ignored. - * @param pattern a string specifying what characters are in the set - * @exception java.lang.IllegalArgumentException if the pattern - * contains a syntax error. - */ - public final void applyPattern(String pattern) { - applyPattern(pattern, true); - } - - /** - * Modifies this set to represent the set specified by the given pattern, - * optionally ignoring whitespace. - * See the class description for the syntax of the pattern language. - * @param pattern a string specifying what characters are in the set - * @param ignoreWhitespace if true then characters for which - * Character.isWhitespace() returns true are ignored - * @exception java.lang.IllegalArgumentException if the pattern - * contains a syntax error. - */ - public void applyPattern(String pattern, boolean ignoreWhitespace) { - ParsePosition pos = new ParsePosition(0); - applyPattern(pattern, pos, null, ignoreWhitespace); - - int i = pos.getIndex(); - - // Skip over trailing whitespace - if (ignoreWhitespace) { - i = Utility.skipWhitespace(pattern, i); - } - - if (i != pattern.length()) { - throw new IllegalArgumentException("Parse of \"" + pattern + - "\" failed at " + i); - } - } - - /** - * Return true if the given position, in the given pattern, appears - * to be the start of a UnicodeSet pattern. - */ - public static boolean resemblesPattern(String pattern, int pos) { - return ((pos+1) < pattern.length() && - pattern.charAt(pos) == '[') || - UnicodePropertySet.resemblesPattern(pattern, pos); - } - - /** - * Append the toPattern() representation of a - * character to the given StringBuffer. - */ - private static void _appendToPat(StringBuffer buf, int c, boolean useHexEscape) { - if (useHexEscape) { - // Use hex escape notation (uxxxx or Uxxxxxxxx) for anything - // unprintable - if (Utility.escapeUnprintable(buf, c)) { - return; - } - } - // Okay to let ':' pass through - switch (c) { - case '[': // SET_OPEN: - case ']': // SET_CLOSE: - case '-': // HYPHEN: - case '^': // COMPLEMENT: - case '&': // INTERSECTION: - case '\\': //BACKSLASH: - case '{': - case '}': - case '$': - case ':': - buf.append('\\'); - break; - default: - // Escape whitespace - if (UCharacter.isWhitespace(c)) { - buf.append('\\'); - } - break; - } - UTF16.append(buf, c); - } - - /** - * Returns a string representation of this set. If the result of - * calling this function is passed to a UnicodeSet constructor, it - * will produce another set that is equal to this one. - */ - public String toPattern(boolean escapeUnprintable) { - StringBuffer result = new StringBuffer(); - return _toPattern(result, escapeUnprintable).toString(); - } - - /** - * Append a string representation of this set to result. This will be - * a cleaned version of the string passed to applyPattern(), if there - * is one. Otherwise it will be generated. - */ - private StringBuffer _toPattern(StringBuffer result, - boolean escapeUnprintable) { - if (pat != null) { - int i; - int backslashCount = 0; - for (i=0; i 1 && - getRangeStart(0) == MIN_VALUE && - getRangeEnd(count-1) == MAX_VALUE) { - - // Emit the inverse - result.append('^'); - - for (int i = 1; i < count; ++i) { - int start = getRangeEnd(i-1)+1; - int end = getRangeStart(i)-1; - _appendToPat(result, start, escapeUnprintable); - if (start != end) { - result.append('-'); - _appendToPat(result, end, escapeUnprintable); - } - } - } - - // Default; emit the ranges as pairs - else { - for (int i = 0; i < count; ++i) { - int start = getRangeStart(i); - int end = getRangeEnd(i); - _appendToPat(result, start, escapeUnprintable); - if (start != end) { - result.append('-'); - _appendToPat(result, end, escapeUnprintable); - } - } - } - - return result.append(']'); - } - - /** - * Returns the number of elements in this set (its cardinality), - * n, where 0 <= n <= 65536. - * - * @return the number of elements in this set (its cardinality). - */ - public int size() { - int n = 0; - int count = getRangeCount(); - for (int i = 0; i < count; ++i) { - n += getRangeEnd(i) - getRangeStart(i) + 1; - } - return n; - } - - /** - * Returns true if this set contains no elements. - * - * @return true if this set contains no elements. - */ - public boolean isEmpty() { - return len == 1; - } - - /** - * Returns true if this set contains every character - * in the specified range of chars. - * If end > start then the results of this method - * are undefined. - * - * @return true if this set contains the specified range - * of chars. - */ - public boolean contains(int start, int end) { - if (start < MIN_VALUE || start > MAX_VALUE) { - throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(start, 6)); - } - if (end < MIN_VALUE || end > MAX_VALUE) { - throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(end, 6)); - } - int i = -1; - while (true) { - if (start < list[++i]) break; - } - return ((i & 1) != 0 && end < list[i]); - } - - /** - * Implementation of UnicodeMatcher API. Returns true if - * this set contains any character whose low byte is the given - * value. This is used by RuleBasedTransliterator for - * indexing. - */ - public boolean matchesIndexValue(int v) { - /* The index value v, in the range [0,255], is contained in this set if - * it is contained in any pair of this set. Pairs either have the high - * bytes equal, or unequal. If the high bytes are equal, then we have - * aaxx..aayy, where aa is the high byte. Then v is contained if xx <= - * v <= yy. If the high bytes are unequal we have aaxx..bbyy, bb>aa. - * Then v is contained if xx <= v || v <= yy. (This is identical to the - * time zone month containment logic.) - */ - for (int i=0; icharAt(). - * @return an index from 0..size()-1, or -1 - */ - public int indexOf(int c) { - if (c < MIN_VALUE || c > MAX_VALUE) { - throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(c, 6)); - } - int i = 0; - int n = 0; - for (;;) { - int start = list[i++]; - if (c < start) { - return -1; - } - int limit = list[i++]; - if (c < limit) { - return n + c - start; - } - n += limit - start; - } - } - - /** - * Returns the character at the given index within this set, where - * the set is ordered by ascending code point. If the index is - * out of range, return -1. The inverse of this method is - * indexOf(). - * @param index an index from 0..size()-1 - * @return the character at the given index, or -1. - */ - public int charAt(int index) { - if (index >= 0) { - // len2 is the largest even integer <= len, that is, it is len - // for even values and len-1 for odd values. With odd values - // the last entry is UNICODESET_HIGH. - int len2 = len & ~1; - for (int i=0; i < len2;) { - int start = list[i++]; - int count = list[i++] - start; - if (index < count) { - return start + index; - } - index -= count; - } - } - return -1; - } - - /** - * Returns true if this set contains the specified char. - * - * @return true if this set contains the specified char. - */ - public boolean contains(int c) { - if (c < MIN_VALUE || c > MAX_VALUE) { - throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(c, 6)); - } - // catch degenerate cases (not needed unless HIGH > 0x10000 - if (c == HIGH) { // catch final, so we don't do it in loop! - return (len & 1) == 0; // even length includes everything - } - // Set i to the index of the start item greater than ch - // We know we will terminate without length test! - // LATER: for large sets, add binary search - int i = -1; - while (true) { - if (c < list[++i]) break; - } - return ((i & 1) != 0); // return true if odd - } - - /** - * Adds the specified range to this set if it is not already - * present. If this set already contains the specified range, - * the call leaves this set unchanged. If end > start - * then an empty range is added, leaving the set unchanged. - * - * @param start first character, inclusive, of range to be added - * to this set. - * @param end last character, inclusive, of range to be added - * to this set. - */ - public void add(int start, int end) { - if (start < MIN_VALUE || start > MAX_VALUE) { - throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(start, 6)); - } - if (end < MIN_VALUE || end > MAX_VALUE) { - throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(end, 6)); - } - if (start <= end) { - add(range(start, end), 2, 0); - } - } - - /** - * Adds the specified character to this set if it is not already - * present. If this set already contains the specified character, - * the call leaves this set unchanged. - */ - public final void add(int c) { - add(c, c); - } - - /** - * Retain only the elements in this set that are contained in the - * specified range. If end > start then an empty range is - * retained, leaving the set empty. - * - * @param start first character, inclusive, of range to be retained - * to this set. - * @param end last character, inclusive, of range to be retained - * to this set. - */ - public void retain(int start, int end) { - if (start < MIN_VALUE || start > MAX_VALUE) { - throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(start, 6)); - } - if (end < MIN_VALUE || end > MAX_VALUE) { - throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(end, 6)); - } - if (start <= end) { - retain(range(start, end), 2, 0); - } else { - clear(); - } - } - - /** - * Retain the specified character from this set if it is present. - */ - public final void retain(int c) { - retain(c, c); - } - - /** - * Removes the specified range from this set if it is present. - * The set will not contain the specified range once the call - * returns. If end > start then an empty range is - * removed, leaving the set unchanged. - * - * @param start first character, inclusive, of range to be removed - * from this set. - * @param end last character, inclusive, of range to be removed - * from this set. - */ - public void remove(int start, int end) { - if (start < MIN_VALUE || start > MAX_VALUE) { - throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(start, 6)); - } - if (end < MIN_VALUE || end > MAX_VALUE) { - throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(end, 6)); - } - if (start <= end) { - retain(range(start, end), 2, 2); - } - } - - /** - * Removes the specified character from this set if it is present. - * The set will not contain the specified character once the call - * returns. - */ - public final void remove(int c) { - remove(c, c); - } - - /** - * Complements the specified range in this set. Any character in - * the range will be removed if it is in this set, or will be - * added if it is not in this set. If end > start - * then an empty range is complemented, leaving the set unchanged. - * - * @param start first character, inclusive, of range to be removed - * from this set. - * @param end last character, inclusive, of range to be removed - * from this set. - */ - public void complement(int start, int end) { - if (start < MIN_VALUE || start > MAX_VALUE) { - throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(start, 6)); - } - if (end < MIN_VALUE || end > MAX_VALUE) { - throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(end, 6)); - } - if (start <= end) { - xor(range(start, end), 2, 0); - } - } - - /** - * Complements the specified character in this set. The character - * will be removed if it is in this set, or will be added if it is - * not in this set. - */ - public final void complement(int c) { - complement(c, c); - } - - /** - * Inverts this set. This operation modifies this set so that its - * value is its complement. This is equivalent to - * complement(MIN_VALUE, MAX_VALUE). - */ - public void complement() { - if (list[0] == LOW) { - System.arraycopy(list, 1, list, 0, len-1); - --len; - } else { - ensureCapacity(len+1); - System.arraycopy(list, 0, list, 1, len); - list[0] = LOW; - ++len; - } - pat = null; - } - - /** - * Returns true if the specified set is a subset - * of this set. - * - * @param c set to be checked for containment in this set. - * @return true if this set contains all of the elements of the - * specified set. - */ - public boolean containsAll(UnicodeSet c) { - // The specified set is a subset if all of its pairs are contained in - // this set. It's possible to code this more efficiently in terms of - // direct manipulation of the inversion lists if the need arises. - int n = c.getRangeCount(); - for (int i=0; iunion of the two - * sets. The behavior of this operation is unspecified if the specified - * collection is modified while the operation is in progress. - * - * @param c set whose elements are to be added to this set. - */ - public void addAll(UnicodeSet c) { - add(c.list, c.len, 0); - } - - /** - * Retains only the elements in this set that are contained in the - * specified set. In other words, removes from this set all of - * its elements that are not contained in the specified set. This - * operation effectively modifies this set so that its value is - * the intersection of the two sets. - * - * @param c set that defines which elements this set will retain. - */ - public void retainAll(UnicodeSet c) { - retain(c.list, c.len, 0); - } - - /** - * Removes from this set all of its elements that are contained in the - * specified set. This operation effectively modifies this - * set so that its value is the asymmetric set difference of - * the two sets. - * - * @param c set that defines which elements will be removed from - * this set. - */ - public void removeAll(UnicodeSet c) { - retain(c.list, c.len, 2); - } - - /** - * Complements in this set all elements contained in the specified - * set. Any character in the other set will be removed if it is - * in this set, or will be added if it is not in this set. - * - * @param c set that defines which elements will be complemented from - * this set. - */ - public void complementAll(UnicodeSet c) { - xor(c.list, c.len, 0); - } - - /** - * Removes all of the elements from this set. This set will be - * empty after this call returns. - */ - public void clear() { - list[0] = HIGH; - len = 1; - pat = null; - } - - /** - * Iteration method that returns the number of ranges contained in - * this set. - * @see #getRangeStart - * @see #getRangeEnd - */ - public int getRangeCount() { - return len/2; - } - - /** - * Iteration method that returns the first character in the - * specified range of this set. - * @exception ArrayIndexOutOfBoundsException if index is outside - * the range 0..getRangeCount()-1 - * @see #getRangeCount - * @see #getRangeEnd - */ - public int getRangeStart(int index) { - return list[index*2]; - } - - /** - * Iteration method that returns the last character in the - * specified range of this set. - * @exception ArrayIndexOutOfBoundsException if index is outside - * the range 0..getRangeCount()-1 - * @see #getRangeStart - * @see #getRangeEnd - */ - public int getRangeEnd(int index) { - return (list[index*2 + 1] - 1); - } - - /** - * Reallocate this objects internal structures to take up the least - * possible space, without changing this object's value. - */ - public void compact() { - if (len != list.length) { - int[] temp = new int[len]; - System.arraycopy(list, 0, temp, 0, len); - list = temp; - } - rangeList = null; - buffer = null; - } - - /** - * Compares the specified object with this set for equality. Returns - * true if the specified object is also a set, the two sets - * have the same size, and every member of the specified set is - * contained in this set (or equivalently, every member of this set is - * contained in the specified set). - * - * @param o Object to be compared for equality with this set. - * @return true if the specified Object is equal to this set. - */ - public boolean equals(Object o) { - try { - UnicodeSet that = (UnicodeSet) o; - if (len != that.len) return false; - for (int i = 0; i < len; ++i) { - if (list[i] != that.list[i]) return false; - } - } catch (Exception e) { - return false; - } - return true; - } - - /** - * Returns the hash code value for this set. - * - * @return the hash code value for this set. - * @see Object#hashCode() - */ - public int hashCode() { - int result = len; - for (int i = 0; i < len; ++i) { - result *= 1000003; - result += list[i]; - } - return result; - } - - /** - * Return a programmer-readable string representation of this object. - */ - public String toString() { - return getClass().getName() + '(' + toPattern(false) + ')'; - } - - //---------------------------------------------------------------- - // Implementation: Pattern parsing - //---------------------------------------------------------------- - - /** - * Parses the given pattern, starting at the given position. The character - * at pattern.charAt(pos.getIndex()) must be '[', or the parse fails. - * Parsing continues until the corresponding closing ']'. If a syntax error - * is encountered between the opening and closing brace, the parse fails. - * Upon return from a successful parse, the ParsePosition is updated to - * point to the character following the closing ']', and an inversion - * list for the parsed pattern is returned. This method - * calls itself recursively to parse embedded subpatterns. - * - * @param pattern the string containing the pattern to be parsed. The - * portion of the string from pos.getIndex(), which must be a '[', to the - * corresponding closing ']', is parsed. - * @param pos upon entry, the position at which to being parsing. The - * character at pattern.charAt(pos.getIndex()) must be a '['. Upon return - * from a successful parse, pos.getIndex() is either the character after the - * closing ']' of the parsed pattern, or pattern.length() if the closing ']' - * is the last character of the pattern string. - * @return an inversion list for the parsed substring - * of pattern - * @exception java.lang.IllegalArgumentException if the parse fails. - */ - void applyPattern(String pattern, - ParsePosition pos, - SymbolTable symbols, - boolean ignoreWhitespace) { - - // Need to build the pattern in a temporary string because - // _applyPattern calls add() etc., which set pat to empty. - StringBuffer rebuiltPat = new StringBuffer(); - _applyPattern(pattern, pos, symbols, rebuiltPat, ignoreWhitespace); - pat = rebuiltPat.toString(); - } - - void _applyPattern(String pattern, ParsePosition pos, - SymbolTable symbols, StringBuffer rebuiltPat, - boolean ignoreWhitespace) { - - // If the pattern contains any of the following, we save a - // rebuilt (variable-substituted) copy of the source pattern: - // - a category - // - an intersection or subtraction operator - // - an anchor (trailing '$', indicating RBT ether) - boolean rebuildPattern = false; - StringBuffer newPat = new StringBuffer("["); - int nestedPatStart = -1; // see below for usage - boolean nestedPatDone = false; // see below for usage - - boolean invert = false; - clear(); - - final int NONE = -1; - int lastChar = NONE; // This is either a char (0..10FFFF) or -1 - boolean isLastLiteral = false; // TRUE if lastChar was a literal - char lastOp = 0; - - /* This loop iterates over the characters in the pattern. We start at - * the position specified by pos. We exit the loop when either a - * matching closing ']' is seen, or we read all characters of the - * pattern. In the latter case an error will be thrown. - */ - - /* Pattern syntax: - * pat := '[' '^'? elem* ']' - * elem := a | a '-' a | set | set op set - * set := pat | (a set variable) - * op := '&' | '-' - * a := (a character, possibly defined by a var) - */ - - // mode 0: No chars parsed yet; next must be '[' - // mode 1: '[' seen; if next is '^' or ':' then special - // mode 2: '[' '^'? seen; parse pattern and close with ']' - // mode 3: '[:' seen; parse category and close with ':]' - // mode 4: ']' seen; parse complete - // mode 5: Top-level property pattern seen - int mode = 0; - int start = pos.getIndex(); - int i = start; - int limit = pattern.length(); - /* In the case of an embedded SymbolTable variable, we look it up and - * then take characters from the resultant char[] array. These chars - * are subjected to an extra level of lookup in the SymbolTable in case - * they are stand-ins for a nested UnicodeSet. */ - char[] varValueBuffer = null; - int ivarValueBuffer = 0; - int anchor = 0; - int c; - while (i 0) { - ++anchor; - } - - // Parse the opening '[' and optional following '^' - switch (mode) { - case 0: - if (UnicodePropertySet.resemblesPattern(pattern, i-1)) { - mode = 3; - break; // Fall through - } else if (c == '[') { - mode = 1; // Next look for '^' - continue; - } else { - throw new IllegalArgumentException("Missing opening '['"); - } - case 1: - mode = 2; - switch (c) { - case '^': - invert = true; - newPat.append((char) c); - continue; // Back to top to fetch next character - case '-': - isLiteral = true; // Treat leading '-' as a literal - break; // Fall through - } - // else fall through and parse this character normally - } - - // After opening matter is parsed ("[", "[^", or "[:"), the mode - // will be 2 if we want a closing ']', or 3 if we should parse a - // category and close with ":]". - - // Only process escapes, variable references, and nested sets - // if we are _not_ retrieving characters from the variable - // buffer. Characters in the variable buffer have already - // benn through escape and variable reference processing. - if (varValueBuffer == null) { - /** - * Handle property set patterns. - */ - if (UnicodePropertySet.resemblesPattern(pattern, i-1)) { - ParsePosition pp = new ParsePosition(i-1); - nestedSet = UnicodePropertySet.createFromPattern(pattern, pp); - if (nestedSet == null) { - // assert(pp.getIndex() == i-1); - throw new IllegalArgumentException("Invalid property pattern " + - pattern.substring(i-1)); - } - nestedPatStart = newPat.length(); - nestedPatDone = true; // we're going to do it just below - - switch (lastOp) { - case '-': - case '&': - newPat.append(lastOp); - break; - } - - // If we have a top-level property pattern, then trim - // off the opening '[' and use the property pattern - // as the entire pattern. - if (mode == 3) { - newPat.deleteCharAt(0); - } - newPat.append(pattern.substring(i-1, pp.getIndex())); - rebuildPattern = true; - - i = pp.getIndex(); // advance past property pattern - - if (mode == 3) { - // Entire pattern is a category; leave parse - // loop. This is one of 2 ways we leave this - // loop if the pattern is well-formed. - set(nestedSet); - mode = 5; - break; - } - } - - /* Handle escapes. If a character is escaped, then it assumes its - * literal value. This is true for all characters, both special - * characters and characters with no special meaning. We also - * interpret '\\uxxxx' Unicode escapes here (as literals). - */ - else if (c == '\\') { - int[] offset = new int[] { i }; - int escaped = Utility.unescapeAt(pattern, offset); - if (escaped == -1) { - int sta = Math.max(i - 8, 0); - int lim = Math.min(i + 16, pattern.length()); - throw new IllegalArgumentException("Invalid escape sequence " + - pattern.substring(sta, i-1) + - "|" + - pattern.substring(i-1, lim)); - } - i = offset[0]; - isLiteral = true; - c = escaped; - } - - /* Parse variable references. These are treated as literals. If a - * variable refers to a UnicodeSet, its stand in character is - * returned in the char[] buffer. - * Variable names are only parsed if varNameToChar is not null. - * Set variables are only looked up if varCharToSet is not null. - */ - else if (symbols != null && !isLiteral && c == SymbolTable.SYMBOL_REF) { - pos.setIndex(i); - String name = symbols.parseReference(pattern, pos, limit); - if (name != null) { - varValueBuffer = symbols.lookup(name); - if (varValueBuffer == null) { - throw new IllegalArgumentException("Undefined variable: " - + name); - } - ivarValueBuffer = 0; - i = pos.getIndex(); // Make i point PAST last char of var name - } else { - // Got a null; this means we have an isolated $. - // Tentatively assume this is an anchor. - anchor = 1; - } - continue; // Back to the top to get varValueBuffer[0] - } - - /* An opening bracket indicates the first bracket of a nested - * subpattern. - */ - else if (!isLiteral && c == '[') { - // Record position before nested pattern - nestedPatStart = newPat.length(); - - // Recurse to get the pairs for this nested set. - // Backup i to '['. - pos.setIndex(--i); - switch (lastOp) { - case '-': - case '&': - newPat.append(lastOp); - break; - } - nestedSet = new UnicodeSet(); - nestedSet._applyPattern(pattern, pos, symbols, newPat, ignoreWhitespace); - nestedPatDone = true; - i = pos.getIndex(); - } - } - - /* At this point we have either a character c, or a nested set. If - * we have encountered a nested set, either embedded in the pattern, - * or as a variable, we have a non-null nestedSet, and c should be - * ignored. Otherwise c is the current character, and isLiteral - * indicates whether it is an escaped literal (or variable) or a - * normal unescaped character. Unescaped characters '-', '&', and - * ']' have special meanings. - */ - if (nestedSet != null) { - if (lastChar != NONE) { - if (lastOp != 0) { - throw new IllegalArgumentException("Illegal rhs for " + lastChar + lastOp); - } - add(lastChar, lastChar); - if (nestedPatDone) { - // If there was a character before the nested set, - // then we need to insert it in newPat before the - // pattern for the nested set. This position was - // recorded in nestedPatStart. - StringBuffer s = new StringBuffer(); - _appendToPat(s, lastChar, false); - newPat.insert(nestedPatStart, s.toString()); - } else { - _appendToPat(newPat, lastChar, false); - } - lastChar = NONE; - } - switch (lastOp) { - case '-': - removeAll(nestedSet); - break; - case '&': - retainAll(nestedSet); - break; - case 0: - addAll(nestedSet); - break; - } - - // Get the pattern for the nested set, if we haven't done so - // already. - if (!nestedPatDone) { - if (lastOp != 0) { - newPat.append(lastOp); - } - nestedSet._toPattern(newPat, false); - } - rebuildPattern = true; - - lastOp = 0; - - } else if (!isLiteral && c == ']') { - // Final closing delimiter. This is the only way we leave this - // loop if the pattern is well-formed. - if (anchor > 2 || anchor == 1) { - throw new IllegalArgumentException("Syntax error near $" + pattern); - - } - if (anchor == 2) { - rebuildPattern = true; - newPat.append(SymbolTable.SYMBOL_REF); - add(TransliterationRule.ETHER); - } - mode = 4; - break; - } else if (lastOp == 0 && !isLiteral && (c == '-' || c == '&')) { - lastOp = (char) c; - } else if (lastOp == '-') { - if (lastChar >= c) { - // Don't allow redundant (a-a) or empty (b-a) ranges; - // these are most likely typos. - throw new IllegalArgumentException("Invalid range " + lastChar + - '-' + c); - } - add(lastChar, c); - _appendToPat(newPat, lastChar, false); - newPat.append('-'); - _appendToPat(newPat, c, false); - lastOp = 0; - lastChar = NONE; - } else if (lastOp != 0) { - // We have & or & - throw new IllegalArgumentException("Unquoted " + lastOp); - } else { - if (lastChar != NONE) { - // We have - add(lastChar, lastChar); - _appendToPat(newPat, lastChar, false); - } - lastChar = c; - isLastLiteral = isLiteral; - } - } - - if (mode < 4) { - throw new IllegalArgumentException("Missing ']'"); - } - - // Treat a trailing '$' as indicating ETHER. This code is only - // executed if symbols == NULL; otherwise other code parses the - // anchor. - if (lastChar == SymbolTable.SYMBOL_REF && !isLastLiteral) { - rebuildPattern = true; - newPat.append((char) lastChar); - add(TransliterationRule.ETHER); - } - - else if (lastChar != NONE) { - add(lastChar, lastChar); - _appendToPat(newPat, lastChar, false); - } - - // Handle unprocessed stuff preceding the closing ']' - if (lastOp == '-') { - // Trailing '-' is treated as literal - add(lastOp, lastOp); - newPat.append('-'); - } else if (lastOp == '&') { - throw new IllegalArgumentException("Unquoted trailing " + lastOp); - } - - if (mode == 4) { - newPat.append(']'); - } - - /** - * If we saw a '^' after the initial '[' of this pattern, then perform - * the complement. (Inversion after '[:' is handled elsewhere.) - */ - if (invert) { - complement(); - } - - pos.setIndex(i); - - // Use the rebuilt pattern (newPat) only if necessary. Prefer the - // generated pattern. - if (rebuildPattern) { - rebuiltPat.append(newPat.toString()); - } else { - _generatePattern(rebuiltPat, false); - } - - if (false) { - // Debug parser - System.out.println("UnicodeSet(" + - pattern.substring(start, i+1) + ") -> " + - com.ibm.util.Utility.escape(toString())); - } - } - - //---------------------------------------------------------------- - // Implementation: Utility methods - //---------------------------------------------------------------- - - private void ensureCapacity(int newLen) { - if (newLen <= list.length) return; - int[] temp = new int[newLen + GROW_EXTRA]; - System.arraycopy(list, 0, temp, 0, len); - list = temp; - } - - private void ensureBufferCapacity(int newLen) { - if (buffer != null && newLen <= buffer.length) return; - buffer = new int[newLen + GROW_EXTRA]; - } - - /** - * Assumes start <= end. - */ - private int[] range(int start, int end) { - if (rangeList == null) { - rangeList = new int[] { start, end+1, HIGH }; - } else { - rangeList[0] = start; - rangeList[1] = end+1; - } - return rangeList; - } - - //---------------------------------------------------------------- - // Implementation: Fundamental operations - //---------------------------------------------------------------- - - // polarity = 0, 3 is normal: x xor y - // polarity = 1, 2: x xor ~y == x === y - - private UnicodeSet xor(int[] other, int otherLen, int polarity) { - ensureBufferCapacity(len + otherLen); - int i = 0, j = 0, k = 0; - int a = list[i++]; - int b; - if (polarity == 1 || polarity == 2) { - b = LOW; - if (other[j] == LOW) { // skip base if already LOW - ++j; - b = other[j]; - } - } else { - b = other[j++]; - } - // simplest of all the routines - // sort the values, discarding identicals! - while (true) { - if (a < b) { - buffer[k++] = a; - a = list[i++]; - } else if (b < a) { - buffer[k++] = b; - b = other[j++]; - } else if (a != HIGH) { // at this point, a == b - // discard both values! - a = list[i++]; - b = other[j++]; - } else { // DONE! - buffer[k++] = HIGH; - len = k; - break; - } - } - // swap list and buffer - int[] temp = list; - list = buffer; - buffer = temp; - pat = null; - return this; - } - - // polarity = 0 is normal: x union y - // polarity = 2: x union ~y - // polarity = 1: ~x union y - // polarity = 3: ~x union ~y - - private UnicodeSet add(int[] other, int otherLen, int polarity) { - ensureBufferCapacity(len + otherLen); - int i = 0, j = 0, k = 0; - int a = list[i++]; - int b = other[j++]; - // change from xor is that we have to check overlapping pairs - // polarity bit 1 means a is second, bit 2 means b is. - main: - while (true) { - switch (polarity) { - case 0: // both first; take lower if unequal - if (a < b) { // take a - // Back up over overlapping ranges in buffer[] - if (k > 0 && a <= buffer[k-1]) { - // Pick latter end value in buffer[] vs. list[] - a = max(list[i], buffer[--k]); - } else { - // No overlap - buffer[k++] = a; - a = list[i]; - } - i++; // Common if/else code factored out - polarity ^= 1; - } else if (b < a) { // take b - if (k > 0 && b <= buffer[k-1]) { - b = max(other[j], buffer[--k]); - } else { - buffer[k++] = b; - b = other[j]; - } - j++; - polarity ^= 2; - } else { // a == b, take a, drop b - if (a == HIGH) break main; - // This is symmetrical; it doesn't matter if - // we backtrack with a or b. - liu - if (k > 0 && a <= buffer[k-1]) { - a = max(list[i], buffer[--k]); - } else { - // No overlap - buffer[k++] = a; - a = list[i]; - } - i++; - polarity ^= 1; - b = other[j++]; polarity ^= 2; - } - break; - case 3: // both second; take higher if unequal, and drop other - if (b <= a) { // take a - if (a == HIGH) break main; - buffer[k++] = a; - } else { // take b - if (b == HIGH) break main; - buffer[k++] = b; - } - a = list[i++]; polarity ^= 1; // factored common code - b = other[j++]; polarity ^= 2; - break; - case 1: // a second, b first; if b < a, overlap - if (a < b) { // no overlap, take a - buffer[k++] = a; a = list[i++]; polarity ^= 1; - } else if (b < a) { // OVERLAP, drop b - b = other[j++]; polarity ^= 2; - } else { // a == b, drop both! - if (a == HIGH) break main; - a = list[i++]; polarity ^= 1; - b = other[j++]; polarity ^= 2; - } - break; - case 2: // a first, b second; if a < b, overlap - if (b < a) { // no overlap, take b - buffer[k++] = b; b = other[j++]; polarity ^= 2; - } else if (a < b) { // OVERLAP, drop a - a = list[i++]; polarity ^= 1; - } else { // a == b, drop both! - if (a == HIGH) break main; - a = list[i++]; polarity ^= 1; - b = other[j++]; polarity ^= 2; - } - break; - } - } - buffer[k++] = HIGH; // terminate - len = k; - // swap list and buffer - int[] temp = list; - list = buffer; - buffer = temp; - pat = null; - return this; - } - - // polarity = 0 is normal: x intersect y - // polarity = 2: x intersect ~y == set-minus - // polarity = 1: ~x intersect y - // polarity = 3: ~x intersect ~y - - private UnicodeSet retain(int[] other, int otherLen, int polarity) { - ensureBufferCapacity(len + otherLen); - int i = 0, j = 0, k = 0; - int a = list[i++]; - int b = other[j++]; - // change from xor is that we have to check overlapping pairs - // polarity bit 1 means a is second, bit 2 means b is. - main: - while (true) { - switch (polarity) { - case 0: // both first; drop the smaller - if (a < b) { // drop a - a = list[i++]; polarity ^= 1; - } else if (b < a) { // drop b - b = other[j++]; polarity ^= 2; - } else { // a == b, take one, drop other - if (a == HIGH) break main; - buffer[k++] = a; a = list[i++]; polarity ^= 1; - b = other[j++]; polarity ^= 2; - } - break; - case 3: // both second; take lower if unequal - if (a < b) { // take a - buffer[k++] = a; a = list[i++]; polarity ^= 1; - } else if (b < a) { // take b - buffer[k++] = b; b = other[j++]; polarity ^= 2; - } else { // a == b, take one, drop other - if (a == HIGH) break main; - buffer[k++] = a; a = list[i++]; polarity ^= 1; - b = other[j++]; polarity ^= 2; - } - break; - case 1: // a second, b first; - if (a < b) { // NO OVERLAP, drop a - a = list[i++]; polarity ^= 1; - } else if (b < a) { // OVERLAP, take b - buffer[k++] = b; b = other[j++]; polarity ^= 2; - } else { // a == b, drop both! - if (a == HIGH) break main; - a = list[i++]; polarity ^= 1; - b = other[j++]; polarity ^= 2; - } - break; - case 2: // a first, b second; if a < b, overlap - if (b < a) { // no overlap, drop b - b = other[j++]; polarity ^= 2; - } else if (a < b) { // OVERLAP, take a - buffer[k++] = a; a = list[i++]; polarity ^= 1; - } else { // a == b, drop both! - if (a == HIGH) break main; - a = list[i++]; polarity ^= 1; - b = other[j++]; polarity ^= 2; - } - break; - } - } - buffer[k++] = HIGH; // terminate - len = k; - // swap list and buffer - int[] temp = list; - list = buffer; - buffer = temp; - pat = null; - return this; - } - - private static final int max(int a, int b) { - return (a > b) ? a : b; - } -} diff --git a/icu4j/src/com/ibm/text/UnicodeSetIterator.java b/icu4j/src/com/ibm/text/UnicodeSetIterator.java deleted file mode 100755 index 9f78b58f45..0000000000 --- a/icu4j/src/com/ibm/text/UnicodeSetIterator.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UnicodeSetIterator.java,v $ - * $Date: 2002/02/01 02:05:35 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.text; - -import com.ibm.util.Utility; -//import java.text.*; -import java.util.*; -import java.io.*; - -/** - * Class that allows simple iteration over a UnicodeSet. - * @author M. Davis - * @draft - */ -public final class UnicodeSetIterator { - - /** - *@set set to iterate over - */ - public UnicodeSetIterator(UnicodeSet set) { - reset(set); - } - - /** - *@return next character in the set. Returns -1 when done! - */ - public int next() { - if (abbreviated) { - if (element >= startElement + 50 && element <= endElement - 50) { - element = endElement - 50; - } - } - if (element < endElement) { - return ++element; - } - if (range >= endRange) return -1; - ++range; - endElement = set.getRangeEnd(range); - startElement = set.getRangeStart(range); - element = set.getRangeStart(range); - return element; - } - - /** - *@param set the set to iterate over. This allows reuse of the iterator. - */ - public void reset(UnicodeSet set) { - this.set = set; - endRange = set.getRangeCount() - 1; - resetInternal(); - } - - /** - * Resets to the start, to allow the iteration to start over again. - */ - public void reset() { - endRange = set.getRangeCount() - 1; - resetInternal(); - } - - /** - * TODO: Move to UnicodeSet! - *@param s the string to test - *@return true if and only if no character from s are in the set. - */ - public static boolean containsNone(UnicodeSet set, String s) { - int cp; - for (int i = 0; i < s.length(); i += UTF16.getCharCount(i)) { - cp = UTF16.charAt(s, i); - if (set.contains(cp)) return false; - } - return true; - } - - /** - * TODO: Move to UnicodeSet! - *@param s the string to test - *@return true if and only if all characters from s are in the set. - */ - public static boolean containsAll(UnicodeSet set, String s) { - int cp; - for (int i = 0; i < s.length(); i += UTF16.getCharCount(i)) { - cp = UTF16.charAt(s, i); - if (!set.contains(cp)) return false; - } - return true; - } - - // ======================= PRIVATES =========================== - - private UnicodeSet set; - private int endRange = 0; - private int range = 0; - private int startElement = 0; - private int endElement; - private int element; - private boolean abbreviated = false; - - private void resetInternal() { - range = 0; - endElement = 0; - element = 0; - if (endRange >= 0) { - element = set.getRangeStart(range); - endElement = set.getRangeEnd(range); - startElement = set.getRangeStart(range); - } - } -} diff --git a/icu4j/src/com/ibm/text/UnicodeToHexTransliterator.java b/icu4j/src/com/ibm/text/UnicodeToHexTransliterator.java deleted file mode 100755 index 43bc7d2c18..0000000000 --- a/icu4j/src/com/ibm/text/UnicodeToHexTransliterator.java +++ /dev/null @@ -1,325 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UnicodeToHexTransliterator.java,v $ - * $Date: 2001/09/28 20:23:42 $ - * $Revision: 1.11 $ - * - ***************************************************************************************** - */ -package com.ibm.text; -import java.util.*; - -/** - * A transliterator that converts from Unicode characters to - * hexadecimal Unicode escape sequences. It outputs a - * prefix specified in the constructor and optionally converts the hex - * digits to uppercase. - * - *

    The format of the output is set by a pattern. This pattern - * follows the same syntax as HexToUnicodeTransliterator, - * except it does not allow multiple specifications. The pattern sets - * the prefix string, suffix string, and minimum and maximum digit - * count. There are no setters or getters for these attributes; they - * are set only through the pattern. - * - *

    The setUppercase() and isUppercase() methods control whether 'a' - * through 'f' or 'A' through 'F' are output as hex digits. This is - * not controlled through the pattern; only through the methods. The - * default is uppercase. - * - * @author Alan Liu - * @version $RCSfile: UnicodeToHexTransliterator.java,v $ $Revision: 1.11 $ $Date: 2001/09/28 20:23:42 $ - */ -public class UnicodeToHexTransliterator extends Transliterator { - - private static final String COPYRIGHT = - "\u00A9 IBM Corporation 1999. All rights reserved."; - - /** - * Package accessible ID for this transliterator. - */ - static final String _ID = "Any-Hex"; - - private static final char[] HEX_DIGITS = { - '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', - '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', - }; - - // Character constants for special pattern chars - private static final char ZERO = '0'; - private static final char POUND = '#'; - private static final char BACKSLASH = '\\'; - - /** - * The pattern set by applyPattern() and returned by toPattern(). - */ - private String pattern; - - /** - * The string preceding the hex digits, parsed from the pattern. - */ - private String prefix; - - /** - * The string following the hex digits, parsed from the pattern. - */ - private String suffix; - - /** - * The minimum number of hex digits to output, between 1 and 4, - * inclusive. Parsed from the pattern. - */ - private int minDigits; - - /** - * If true, output uppercase hex digits; otherwise output - * lowercase. Set by setUppercase() and returned by isUppercase(). - */ - private boolean uppercase; - - /** - * Constructs a transliterator. - * @param pattern The pattern for this transliterator. See - * applyPattern() for pattern syntax. - * @param uppercase if true, the four hex digits will be - * converted to uppercase; otherwise they will be lowercase. - * Ignored if direction is HEX_UNICODE. - * @param filter the filter for this transliterator, or - * null if none. - */ - public UnicodeToHexTransliterator(String pattern, boolean uppercase, - UnicodeFilter filter) { - super(_ID, filter); - this.uppercase = uppercase; - applyPattern(pattern); - } - - /** - * Constructs an uppercase transliterator with no filter. - * @param pattern The pattern for this transliterator. See - * applyPattern() for pattern syntax. - */ - public UnicodeToHexTransliterator(String pattern) { - this(pattern, true, null); - } - - /** - * Constructs a transliterator with the default prefix "\u" - * that outputs four uppercase hex digits. - */ - public UnicodeToHexTransliterator() { - super(_ID, null); - pattern = "\\\\u0000"; - prefix = "\\u"; - suffix = ""; - minDigits = 4; - uppercase = true; - } - - /** - * Set the pattern recognized by this transliterator. The pattern - * must contain zero or more prefix characters, one or more digit - * characters, and zero or more suffix characters. The digit - * characters indicates optional digits ('#') followed by required - * digits ('0'). The total number of digits cannot exceed 4, and - * must be at least 1 required digit. Use a backslash ('\\') to - * escape any of the special characters. An empty pattern is not - * allowed. - * - *

    Example: "U+0000" specifies a prefix of "U+", exactly four - * digits, and no suffix. "<###0>" has a prefix of "<", between - * one and four digits, and a suffix of ">". - * - *

    -     * pattern := prefix-char* digit-spec suffix-char*
    -     * digit-spec := '#'* '0'+
    -     * prefix-char := [^special-char] | '\\' special-char
    -     * suffix-char := [^special-char] | '\\' special-char
    -     * special-char := ';' | '0' | '#' | '\\'
    -     * 
    - * - *

    Limitations: There is no way to set the uppercase attribute - * in the pattern. (applyPattern() does not alter the uppercase - * attribute.) - */ - public void applyPattern(String thePattern) { - StringBuffer prefixBuf = null; - StringBuffer suffixBuf = null; - int minDigits = 0; - int maxDigits = 0; - - /* The mode specifies where we are in each spec. - * mode 0 = in prefix - * mode 1 = in optional digits (#) - * mode 2 = in required digits (0) - * mode 3 = in suffix - */ - int mode = 0; - - for (int i=0; i 4) { - // Invalid min/max digit count - throw new IllegalArgumentException("Invalid min/max digit count"); - } - - pattern = thePattern; - prefix = (prefixBuf == null) ? "" : prefixBuf.toString(); - suffix = (suffixBuf == null) ? "" : suffixBuf.toString(); - this.minDigits = minDigits; - } - - /** - * Return this transliterator's pattern. - */ - public String toPattern() { - return pattern; - } - - /** - * Returns the string that precedes the four hex digits. - * @return prefix string - */ - public String getPrefix() { - return prefix; - } - - /** - * Sets the string that precedes the four hex digits. - * - *

    Callers must take care if a transliterator is in use by - * multiple threads. The prefix should not be changed by one - * thread while another thread may be transliterating. - * @param prefix prefix string - */ - public void setPrefix(String prefix) { - this.prefix = prefix; - } - - /** - * Returns true if this transliterator outputs uppercase hex digits. - */ - public boolean isUppercase() { - return uppercase; - } - - /** - * Sets if this transliterator outputs uppercase hex digits. - * - *

    Callers must take care if a transliterator is in use by - * multiple threads. The uppercase mode should not be changed by - * one thread while another thread may be transliterating. - * @param outputUppercase if true, then this transliterator - * outputs uppercase hex digits. - */ - public void setUppercase(boolean outputUppercase) { - uppercase = outputUppercase; - } - - /** - * Implements {@link Transliterator#handleTransliterate}. - */ - protected void handleTransliterate(Replaceable text, - Position offsets, boolean incremental) { - /** - * Performs transliteration changing all characters to - * Unicode hexadecimal escapes. For example, '@' -> "U+0040", - * assuming the prefix is "U+". - */ - int cursor = offsets.start; - int limit = offsets.limit; - - StringBuffer hex = new StringBuffer(prefix); - int prefixLen = prefix.length(); - - while (cursor < limit) { - char c = text.charAt(cursor); - - hex.setLength(prefixLen); - boolean showRest = false; - for (int i=3; i>=0; --i) { - int d = (c >> (i*4)) & 0xF; - if (showRest || (d != 0) || minDigits > i) { - hex.append(HEX_DIGITS[uppercase ? (d|16) : d]); - showRest = true; - } - } - hex.append(suffix); - - text.replace(cursor, cursor+1, hex.toString()); - int len = hex.length(); - cursor += len; // Advance cursor by 1 and adjust for new text - --len; - limit += len; - } - - offsets.contextLimit += limit - offsets.limit; - offsets.limit = limit; - offsets.start = cursor; - } -} diff --git a/icu4j/src/com/ibm/text/UppercaseTransliterator.java b/icu4j/src/com/ibm/text/UppercaseTransliterator.java deleted file mode 100755 index a810968ad0..0000000000 --- a/icu4j/src/com/ibm/text/UppercaseTransliterator.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/Attic/UppercaseTransliterator.java,v $ - * $Date: 2001/11/25 23:12:23 $ - * $Revision: 1.5 $ - * - ***************************************************************************************** - */ -package com.ibm.text; -import java.util.*; - -/** - * A transliterator that performs locale-sensitive toUpper() - * case mapping. - */ -class UppercaseTransliterator extends Transliterator { - - /** - * Package accessible ID. - */ - static final String _ID = "Any-Upper"; - // TODO: Add variants for tr, az, lt, default = default locale - - /** - * System registration hook. - */ - static void register() { - Transliterator.registerFactory(_ID, new Transliterator.Factory() { - public Transliterator getInstance(String ID) { - return new UppercaseTransliterator(Locale.US); - } - }); - } - - private Locale loc; - - /** - * Constructs a transliterator. - */ - public UppercaseTransliterator(Locale loc) { - super(_ID, null); - this.loc = loc; - } - - /** - * Implements {@link Transliterator#handleTransliterate}. - */ - protected void handleTransliterate(Replaceable text, - Position offsets, boolean isIncremental) { - int textPos = offsets.start; - if (textPos >= offsets.limit) return; - - // get string for context - // TODO: add convenience method to do this, since we do it all over - - char[] strBuffer = new char[offsets.contextLimit - offsets.contextStart]; // get whole context - text.getChars(offsets.contextStart, offsets.contextLimit, strBuffer, 0); - String original = new String(strBuffer); - - // Walk through original string - // If there is a case change, modify corresponding position in replaceable - - int i = textPos - offsets.contextStart; - int limit = offsets.limit - offsets.contextStart; - int cp; - int oldLen; - - for (; i < limit; i += oldLen) { - cp = UTF16.charAt(original, i); - oldLen = UTF16.getCharCount(cp); - int newLen = UCharacter.toUpperCase(loc, original, i, buffer); - if (newLen >= 0) { - text.replace(textPos, textPos + oldLen, buffer, 0, newLen); - if (newLen != oldLen) { - textPos += newLen; - offsets.limit += newLen - oldLen; - offsets.contextLimit += newLen - oldLen; - continue; - } - } - textPos += oldLen; - } - offsets.start = offsets.limit; - } - - private char buffer[] = new char[UCharacter.getMaxCaseExpansion()]; - -} diff --git a/icu4j/src/com/ibm/text/package.html b/icu4j/src/com/ibm/text/package.html deleted file mode 100755 index cf1ea67179..0000000000 --- a/icu4j/src/com/ibm/text/package.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - -Classes for RuleBasedBreakIterator, DictionaryBasedBreakIterator -Normalizer, RuleBasedNumberFormat, BigNumberFormat, -Unicode compression, International Searching, and Transliterator. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/text/resources/BreakIteratorRules.java b/icu4j/src/com/ibm/text/resources/BreakIteratorRules.java deleted file mode 100755 index 8fe5afa8a6..0000000000 --- a/icu4j/src/com/ibm/text/resources/BreakIteratorRules.java +++ /dev/null @@ -1,365 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/BreakIteratorRules.java,v $ - * $Date: 2001/10/19 23:06:38 $ - * $Revision: 1.8 $ - * - ***************************************************************************************** - */ -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * Default break-iterator rules. These rules are more or less general for - * all locales, although there are probably a few we're missing. The - * behavior currently mimics the behavior of BreakIterator in JDK 1.2. - * There are known deficiencies in this behavior, including the fact that - * the logic for handling CJK characters works for Japanese but not for - * Chinese, and that we don't currently have an appropriate locale for - * Thai. The resources will eventually be updated to fix these problems. - */ - - /* Modified for Hindi 3/1/99. */ - -public class BreakIteratorRules extends ListResourceBundle { - public Object[][] getContents() { - return contents; - } - - static final Object[][] contents = { - // BreakIteratorClasses lists the class names to instantiate for each - // built-in type of BreakIterator - { "BreakIteratorClasses", - new String[] { "RuleBasedBreakIterator", // character-break iterator class - "RuleBasedBreakIterator", // word-break iterator class - "RuleBasedBreakIterator", // line-break iterator class - "RuleBasedBreakIterator" } // sentence-break iterator class - }, - - // rules describing how to break between logical characters - { "CharacterBreakRules", - // ignore non-spacing marks and enclosing marks (since we never - // put a break before ignore characters, this keeps combining - // accents with the base characters they modify) - // FIXME: the virama thing is probably a hack... - "$devaVirama=[\u094d];" - + "$_ignore_=[[[:Mn:]-$devaVirama][:Me:]];" - - // other category definitions - + "$choseong=[\u1100-\u115f];" - + "$jungseong=[\u1160-\u11a7];" - + "$jongseong=[\u11a8-\u11ff];" - + "$surr_hi=[\ud800-\udbff];" - + "$surr_lo=[\udc00-\udfff];" - - // break after every character, except as follows: - + ".;" - - // keep CRLF sequences together - + "\r\n;" - - // keep surrogate pairs together - + "$surr_hi$surr_lo;" - - // keep Hangul syllables spelled out using conjoining jamo together - + "$choseong*$jungseong*$jongseong*;" - - // revised Devanagari support - full syllables - // simplified by allowing some nonsense syllables - // FIXME: nukta, non-spacing matras, and the modifiers - // are all ignorable, so they don't need to be mentioned - // here... (but the rules read better if they are...) - + "$devaNukta=[\u093c];" - + "$devaVowel=[\u0905-\u0914];" - + "$devaMatra=[\u093e-\u094c\u0962\u0963];" - + "$devaConsonant=[\u0915-\u0939\u0958-\u095f];" - + "$devaModifier=[\u0901-\u0903\u0951-\u0954];" - + "$zwnj=[\u200c];" - + "$zwj=[\u200d];" - - // consonant followed optionally by a nukta - + "$devaCN=($devaConsonant$devaNukta?);" - - // a virama followed by an optional zwj or zwnj - + "$devaJoin=($devaVirama[$zwj$zwnj]?);" - - // a syllable with at least one consonant - + "($devaCN$devaJoin)*$devaCN($devaJoin|$devaMatra?$devaModifier*);" - - // a syllable without consonants - + "$devaVowel$devaModifier*;" - }, - - // default rules for finding word boundaries - { "WordBreakRules", - - // Surrogates. Until better support is available, ignore low surrogates - // and classify high surrogates according to the characters within the block. - "$surr_lo=[\udc00-\udfff];" - + "$surr_hi_let=[\ud800\ud801\ud834\ud835];" // Hi Surrogates for Old Italic, Gothic, Deseret, Music, Math - + "$surr_hi_ideo=[\ud840-\ud880];" // Hi Surrogates for CJK - + "$surr_hi_tag=[\udb40];" // Hi Surrogates for Tags - + "$surr_hi_pua=[\udb80-\udbff];" // Hi Surrogates for Private Use. - - // Private Use Area. Treat like ideographs. - + "$pua=[\ue000-\uf8ff$surr_hi_pua];" - - // ignore non-spacing marks, enclosing marks, and format characters, - // all of which should not influence the algorithm - + "$_ignore_=[[:Mn:][:Me:][:Cf:]$surr_lo$surr_hi_tag];" - - // Hindi phrase separator, kanji, katakana, hiragana, CJK diacriticals, - // other letters, and digits - + "$danda=[\u0964\u0965];" - + "$kanji=[\u3005\u4e00-\u9fa5\uf900-\ufa2d$surr_hi_ideo$pua];" - + "$kata=[\u3099-\u309c\u30a1-\u30fe];" - + "$hira=[\u3041-\u309e\u30fc];" - + "$let=[[[:L:][:Mc:]$surr_hi_let]-[$kanji$kata$hira]];" - + "$dgt=[:N:];" - - // punctuation that can occur in the middle of a word: currently - // dashes, apostrophes, quotation marks, and periods - + "$mid_word=[[:Pd:]\u00ad\u2027\\\"\\\'\\.];" - - // punctuation that can occur in the middle of a number: currently - // apostrophes, qoutation marks, periods, commas, and the Arabic - // decimal point - + "$mid_num=[\\\"\\\'\\,\u066b\\.];" - - // punctuation that can occur at the beginning of a number: currently - // the period, the number sign, and all currency symbols except the cents sign - + "$pre_num=[[[:Sc:]-[\u00a2]]\\#\\.];" - - // punctuation that can occur at the end of a number: currently - // the percent, per-thousand, per-ten-thousand, and Arabic percent - // signs, the cents sign, and the ampersand - + "$post_num=[\\%\\&\u00a2\u066a\u2030\u2031];" - - // line separators: currently LF, FF, PS, and LS - + "$ls=[\n\u000c\u2028\u2029];" - - // whitespace: all space separators and the tab character - + "$ws=[[:Zs:]\t];" - - // a word is a sequence of letters that may contain internal - // punctuation, as long as it begins and ends with a letter and - // never contains two punctuation marks in a row - + "$word=($let+($mid_word$let+)*$danda?);" - - // a number is a sequence of digits that may contain internal - // punctuation, as long as it begins and ends with a digit and - // never contains two punctuation marks in a row. - + "$number=($dgt+($mid_num$dgt+)*);" - - // break after every character, with the following exceptions - // (this will cause punctuation marks that aren't considered - // part of words or numbers to be treated as words unto themselves) - + ".;" - - // keep together any sequence of contiguous words and numbers - // (including just one of either), plus an optional trailing - // number-suffix character - + "$word?($number$word)*($number$post_num?)?;" - - // keep together and sequence of contiguous words and numbers - // that starts with a number-prefix character and a number, - // and may end with a number-suffix character - + "$pre_num($number$word)*($number$post_num?)?;" - - // keep together runs of whitespace (optionally with a single trailing - // line separator or CRLF sequence) - + "$ws*\r?$ls?;" - - // keep together runs of Katakana - + "$kata*;" - - // keep together runs of Hiragana - + "$hira*;" - - // keep together runs of Kanji - + "$kanji*;" - }, - - // default rules for determining legal line-breaking positions - { "LineBreakRules", - // Surrogates. Until better support is available, ignore low surrogates - // and classify high surrogates according to the characters within the block. - "$surr_lo=[\udc00-\udfff];" - + "$surr_hi_let=[\ud800\ud801\ud834\ud835];" // Hi Surrogates for Old Italic, Gothic, Deseret, Music, Math - + "$surr_hi_ideo=[\ud840-\ud880];" // Hi Surrogates for CJK - + "$surr_hi_tag=[\udb40];" // Hi Surrogates for Tags - + "$surr_hi_pua=[\udb80-\udbff];" // Hi Surrogates for Private Use. - - // Private Use Area. Treat like ideographs. - + "$pua=[\ue000-\uf8ff$surr_hi_pua];" - - // ignore non-spacing marks, enclosing marks, and format characters - + "$_ignore_=[[:Mn:][:Me:][:Cf:]$surr_lo$surr_hi_tag];" - - // Hindi phrase separators - + "$danda=[\u0964\u0965];" - - // characters that always cause a break: ETX, tab, LF, FF, LS, and PS - + "$break=[\u0003\t\n\f\u2028\u2029];" - - // characters that always prevent a break: the non-breaking space - // and similar characters - + "$nbsp=[\u00a0\u2007\u2011\ufeff];" - - // whitespace: space separators and control characters, except for - // CR and the other characters mentioned above - + "$space=[[[:Zs:][:Cc:]]-[$nbsp$break\r]];" - - // dashes: dash punctuation and the discretionary hyphen, except for - // non-breaking hyphens - + "$dash=[[[:Pd:]\u00ad]-[$nbsp]];" - - // characters that stick to a word if they precede it: currency symbols - // (except the cents sign) and starting punctuation - + "$pre_word=[[[:Sc:]-[\u00a2]][:Ps:][:Pi:]\\\"\\\'];" - - // characters that stick to a word if they follow it: ending punctuation, - // other punctuation that usually occurs at the end of a sentence, - // small Kana characters, some CJK diacritics, etc. - + "$post_word=[[:Pe:][:Pf:]\\!\\\"\\\'\\%\\.\\,\\:\\;\\?\u00a2\u00b0\u066a\u2030-\u2034" - + "\u2103\u2105\u2109\u3001\u3002\u3005\u3041\u3043\u3045\u3047\u3049\u3063" - + "\u3083\u3085\u3087\u308e\u3099-\u309e\u30a1\u30a3\u30a5\u30a7\u30a9" - + "\u30c3\u30e3\u30e5\u30e7\u30ee\u30f5\u30f6\u30fc-\u30fe\uff01\uff0c" - + "\uff0e\uff1f];" - - // Kanji: actually includes both Kanji and Kana, except for small Kana and - // CJK diacritics - + "$kanji=[[$surr_hi_ideo$pua\u4e00-\u9fa5\uf900-\ufa2d\u3041-\u3094\u30a1-\u30fa]-[$post_word$_ignore_]];" - - // digits - + "$digit=[[:Nd:][:No:]];" - - // punctuation that can occur in the middle of a number: periods and commas - + "$mid_num=[\\.\\,];" - - // everything not mentioned above, plus the quote marks (which are both - // , , and ) - + "$char=[^$break$space$dash$kanji$nbsp$_ignore_$pre_word$post_word$mid_num$danda\r\\\"\\\'];" - - // a "number" is a run of prefix characters and dashes, followed by one or - // more digits with isolated number-punctuation characters interspersed - + "$number=([$pre_word$dash]*$digit+($mid_num$digit+)*);" - - // the basic core of a word can be either a "number" as defined above, a single - // "Kanji" character, or a run of any number of not-explicitly-mentioned - // characters (this includes Latin letters) - + "$word_core=([$pre_word$char]*|$kanji|$number);" - - // a word may end with an optional suffix that be either a run of one or - // more dashes or a run of word-suffix characters, followed by an optional - // run of whitespace - + "$word_suffix=(($dash+|$post_word*)$space*);" - - // a word, thus, is an optional run of word-prefix characters, followed by - // a word core and a word suffix (the syntax of and - // actually allows either of them to match the empty string, putting a break - // between things like ")(" or "aaa(aaa" - + "$word=($pre_word*$word_core$word_suffix);" - - // finally, the rule that does the work: Keep together any run of words that - // are joined by runs of one of more non-spacing mark. Also keep a trailing - // line-break character or CRLF combination with the word. (line separators - // "win" over nbsp's) - + "$word($nbsp+$word)*\r?$break?;" - }, - - // default rules for finding sentence boundaries - { "SentenceBreakRules", - // Surrogates. Until better support is available, ignore low surrogates - // and classify high surrogates according to the characters within the block. - "$surr_lo=[\udc00-\udfff];" - - // ignore non-spacing marks, enclosing marks, and format characters - + "$_ignore_=[[:Mn:][:Me:][:Cf:]$surr_lo];" - - // lowercase letters - + "$lc=[:Ll:];" - - // uppercase Latin letters - + "$ucLatin=[A-Z];" - - // whitespace (line separators are treated as whitespace) - + "$space=[\t\r\f\n\u2028[:Zs:]];" - - // punctuation which may occur at the beginning of a sentence: "starting - // punctuation" and quotation marks - + "$start=[[:Ps:][:Pi:]\\\"\\\'];" - - // punctuation with may occur at the end of a sentence: "ending punctuation" - // and quotation marks - + "$end=[[:Pe:][:Pf:]\\\"\\\'];" - - // digits - + "$digit=[:N:];" - - // characters that unambiguously signal the end of a sentence - + "$term=[\\!\\?\u3002\uff01\uff1f];" - - // periods, which MAY signal the end of a sentence - + "$period=[\\.\uff0e];" - - // characters that may occur at the beginning of a sentence: basically anything - // not mentioned above (lowercase letters and digits are specifically excluded) - + "$sent_start=[^$lc$ucLatin$space$start$end$digit$term$period\u2029$_ignore_];" - - // Hindi phrase separator - + "$danda=[\u0964\u0965];" - - // always break sentences after paragraph separators - + ".*?\u2029?;" - - // always break after a danda, if it's followed by whitespace - + ".*?$danda$space*;" - - // if you see a period, skip over additional periods and ending punctuation - // and if the next character is a paragraph separator, break after the - // paragraph separator - + ".*?$period[$period$end]*$space*\u2029;" - - // if you see a period, skip over additional periods and ending punctuation, - // followed by optional whitespace, followed by optional starting punctuation, - // and if the next character is something that can start a sentence - // (basically, a capital letter), then put the sentence break between the - // whitespace and the opening punctuation - + ".*?$period[$period$end]*$space*/($start*$sent_start|$start+$ucLatin);" - - // same as above, except that there's a sentence break before a Latin capital - // letter only if there's at least one space after the period - + ".*?$period[$period$end]*$space+/$ucLatin;" - - // if you see a sentence-terminating character, skip over any additional - // terminators, periods, or ending punctuation, followed by any whitespace, - // followed by a SINGLE optional paragraph separator, and put the break there - + ".*?$term[$term$period$end]*$space*\u2029?;" - - // The following rules are here to aid in backwards iteration. The automatically - // generated backwards state table will rewind to the beginning of the - // paragraph all the time (or all the way to the beginning of the document - // if the document doesn't use the Unicode PS character) because the only - // unambiguous character pairs are those involving paragraph separators. - // These specify a few more unambiguous breaking situations. - - // if you see a sentence-starting character, followed by starting punctuation - // (remember, we're iterating backwards), followed by an optional run of - // whitespace, followed by an optional run of ending punctuation, followed - // by a period, this is a safe place to turn around - + "![$sent_start$ucLatin]$start*$space+$end*$period;" - - // if you see a letter or a digit, followed by an optional run of - // starting punctuation, followed by an optional run of whitespace, - // followed by an optional run of ending punctuation, followed by - // a sentence terminator, this is a safe place to turn around - + "![$sent_start$lc$digit]$start*$space*$end*$term;" - } - }; -} diff --git a/icu4j/src/com/ibm/text/resources/BreakIteratorRules_th.java b/icu4j/src/com/ibm/text/resources/BreakIteratorRules_th.java deleted file mode 100755 index 6a18a20b07..0000000000 --- a/icu4j/src/com/ibm/text/resources/BreakIteratorRules_th.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/BreakIteratorRules_th.java,v $ - * $Date: 2001/11/16 23:13:37 $ - * $Revision: 1.6 $ - * - ***************************************************************************************** - */ -package com.ibm.text.resources; - -import java.util.ListResourceBundle; -import java.util.MissingResourceException; -import java.net.URL; - -public class BreakIteratorRules_th extends ListResourceBundle { - public Object[][] getContents() { - - URL url = getClass().getResource("thai_dict"); - - // if dictionary wasn't found, then this resource bundle doesn't have - // much to contribute... - if (url == null) { - return new Object[0][0]; - } - - return new Object[][] { - // names of classes to instantiate for the different kinds of break - // iterator. Notice we're now using DictionaryBasedBreakIterator - // for word and line breaking. - { "BreakIteratorClasses", - new String[] { "RuleBasedBreakIterator", // character-break iterator class - "DictionaryBasedBreakIterator", // word-break iterator class - "DictionaryBasedBreakIterator", // line-break iterator class - "RuleBasedBreakIterator" } // sentence-break iterator class - }, - - { "WordBreakRules", - "$_dictionary_=[\u0e01-\u0e2e\u0e30-\u0e3a\u0e40-\u0e44\u0e47-\u0e4e];" // this rule breaks the iterator with mixed Thai and English - - // Surrogates. Until better support is available, ignore low surrogates - // and classify high surrogates according to the characters within the block. - + "$surr_lo=[\udc00-\udfff];" - + "$surr_hi_let=[\ud800\ud801\ud834\ud835];" // Hi Surrogates for Old Italic, Gothic, Deseret, Music, Math - + "$surr_hi_ideo=[\ud840-\ud880];" // Hi Surrogates for CJK - + "$surr_hi_tag=[\udb40];" // Hi Surrogates for Tags - + "$surr_hi_pua=[\udb80-\udbff];" // Hi Surrogates for Private Use. - - // Private Use Area. Treat like ideographs. - + "$pua=[\ue000-\uf8ff$surr_hi_pua];" - - // ignore non-spacing marks, enclosing marks, and format characters, - // all of which should not influence the algorithm - + "$_ignore_=[[[:Mn:][:Me:][:Cf:]$surr_lo$surr_hi_tag]-$_dictionary_];" - - + "$paiyannoi=[\u0e2f];" - + "$maiyamok=[\u0e46];" - - - // Hindi phrase separator, kanji, katakana, hiragana, CJK diacriticals, - // other letters, and digits - + "$danda=[\u0964\u0965];" - + "$kanji=[\u3005\u4e00-\u9fa5\uf900-\ufa2d$surr_hi_ideo$pua];" - + "$kata=[\u30a1-\u30fa];" - + "$hira=[\u3041-\u3094];" - + "$cjk_diacrit=[\u3099-\u309c];" - + "$let=[[[:L:][:Mc:]$surr_hi_let]-[$kanji$kata$hira$cjk_diacrit$_dictionary_]];" - + "$dgt=[:N:];" - - // punctuation that can occur in the middle of a word: currently - // dashes, apostrophes, quotation marks, and periods - + "$mid_word=[[:Pd:]\u00ad\u2027\\\"\\\'\\.];" - - // punctuation that can occur in the middle of a number: currently - // apostrophes, qoutation marks, periods, commas, and the Arabic - // decimal point - + "$mid_num=[\\\"\\\'\\,\u066b\\.];" - - // punctuation that can occur at the beginning of a number: currently - // the period, the number sign, and all currency symbols except the cents sign - + "$pre_num=[[[:Sc:]-[\u00a2]]\\#\\.];" - - // punctuation that can occur at the end of a number: currently - // the percent, per-thousand, per-ten-thousand, and Arabic percent - // signs, the cents sign, and the ampersand - + "$post_num=[\\%\\&\u00a2\u066a\u2030\u2031];" - - // line separators: currently LF, FF, PS, and LS - + "$ls=[\n\u000c\u2028\u2029];" - - // whitespace: all space separators and the tab character - + "$ws=[[:Zs:]\t];" - - // a word is a sequence of letters that may contain internal - // punctuation, as long as it begins and ends with a letter and - // never contains two punctuation marks in a row - + "$word=(($let+($mid_word$let+)*)$danda?);" - - // a number is a sequence of digits that may contain internal - // punctuation, as long as it begins and ends with a digit and - // never contains two punctuation marks in a row. - + "$number=($dgt+($mid_num$dgt+)*);" - - + "$thai_etc=($paiyannoi\u0e25$paiyannoi);" - - - // break after every character, with the following exceptions - // (this will cause punctuation marks that aren't considered - // part of words or numbers to be treated as words unto themselves) - + ".;" - - // keep together any sequence of contiguous words and numbers - // (including just one of either), plus an optional trailing - // number-suffix character - + "$word?($number$word)*($number$post_num?)?;" - + "$pre_num($number$word)*($number$post_num?)?;" - - //+ "$_dictionary_+($paiyannoi$maiyamok?)?;" - + "$_dictionary_+($paiyannoi?$maiyamok)?;" - - + "$_dictionary_+$paiyannoi/([^\u0e25$maiyamok$_ignore_]" - + "|\u0e25[^$paiyannoi$_ignore_]);" - - + "$thai_etc;" - - // keep together runs of whitespace (optionally with a single trailing - // line separator or CRLF sequence) - + "$ws*\r?$ls?;" - - // keep together runs of Katakana - + "[$kata$cjk_diacrit]*;" - - // keep together runs of Hiragana - + "[$hira$cjk_diacrit]*;" - - // keep together runs of Kanji - + "$kanji*;" - }, - - { "LineBreakRules", - "$_dictionary_=[\u0e01-\u0e2e\u0e30-\u0e3a\u0e40-\u0e44\u0e47-\u0e4e];" // this rule breaks the iterator with mixed Thai and English - - // Surrogates. Until better support is available, ignore low surrogates - // and classify high surrogates according to the characters within the block. - + "$surr_lo=[\udc00-\udfff];" - + "$surr_hi_let=[\ud800\ud801\ud834\ud835];" // Hi Surrogates for Old Italic, Gothic, Deseret, Music, Math - + "$surr_hi_ideo=[\ud840-\ud880];" // Hi Surrogates for CJK - + "$surr_hi_tag=[\udb40];" // Hi Surrogates for Tags - + "$surr_hi_pua=[\udb80-\udbff];" // Hi Surrogates for Private Use. - - // Private Use Area. Treat like ideographs. - + "$pua=[\ue000-\uf8ff$surr_hi_pua];" - - // ignore non-spacing marks, enclosing marks, and format characters - + "$_ignore_=[[[:Mn:][:Me:][:Cf:]$surr_lo$surr_hi_tag]-[$_dictionary_]];" - - // Hindi phrase separators - + "$danda=[\u0964\u0965];" - - // characters that always cause a break: ETX, tab, LF, FF, LS, and PS - + "$break=[\u0003\t\n\f\u2028\u2029];" - - // characters that always prevent a break: the non-breaking space - // and similar characters - + "$nbsp=[\u00a0\u2007\u2011\ufeff];" - - // whitespace: space separators and control characters, except for - // CR and the other characters mentioned above - + "$space=[[[:Zs:][:Cc:]]-[$nbsp$break\r]];" - - // dashes: dash punctuation and the discretionary hyphen, except for - // non-breaking hyphens - + "$dash=[[[:Pd:]\u00ad]-$nbsp];" - - + "$paiyannoi=[\u0e2f];" - + "$maiyamok=[\u0e46];" - + "$thai_etc=($paiyannoi\u0e25$paiyannoi);" - - // characters that stick to a word if they precede it: currency symbols - // (except the cents sign) and starting punctuation - + "$pre_word=[[[:Sc:]-[\u00a2]][:Ps:][:Pi:]\\\"];" - - // characters that stick to a word if they follow it: ending punctuation, - // other punctuation that usually occurs at the end of a sentence, - // small Kana characters, some CJK diacritics, etc. - + "$post_word=[[:Pe:][:Pf:]\\!\\%\\.\\,\\:\\;\\?\\\"\u00a2\u00b0\u066a\u2030-\u2034\u2103" - + "\u2105\u2109\u3001\u3002\u3005\u3041\u3043\u3045\u3047\u3049\u3063" - + "\u3083\u3085\u3087\u308e\u3099-\u309e\u30a1\u30a3\u30a5\u30a7\u30a9" - + "\u30c3\u30e3\u30e5\u30e7\u30ee\u30f5\u30f6\u30fc-\u30fe\uff01\uff0e" - + "\uff1f$maiyamok];" - - // Kanji: actually includes both Kanji and Kana, except for small Kana and - // CJK diacritics - + "$kanji=[[$surr_hi_ideo$pua\u4e00-\u9fa5\uf900-\ufa2d\u3041-\u3094\u30a1-\u30fa]-[$post_word$_ignore_]];" - - // digits - + "$digit=[[:Nd:][:No:]];" - - // punctuation that can occur in the middle of a number: periods and commas - + "$mid_num=[\\.\\,];" - - // everything not mentioned above, plus the quote marks (which are both - // , , and ) - + "$char=[^$break$space$dash$kanji$nbsp$_ignore_$pre_word$post_word" - + "$mid_num\r$danda$_dictionary_$paiyannoi$maiyamok];" - - // a "number" is a run of prefix characters and dashes, followed by one or - // more digits with isolated number-punctuation characters interspersed - + "$number=([$pre_word$dash]*$digit+($mid_num$digit+)*);" - - // the basic core of a word can be either a "number" as defined above, a single - // "Kanji" character, or a run of any number of not-explicitly-mentioned - // characters (this includes Latin letters) - + "$word_core=($char*|$kanji|$number|$_dictionary_+|$thai_etc);" - - // a word may end with an optional suffix that be either a run of one or - // more dashes or a run of word-suffix characters, followed by an optional - // run of whitespace - + "$word_suffix=(($dash+|$post_word*)$space*);" - - // a word, thus, is an optional run of word-prefix characters, followed by - // a word core and a word suffix (the syntax of and - // actually allows either of them to match the empty string, putting a break - // between things like ")(" or "aaa(aaa" - + "$word=($pre_word*$word_core$word_suffix);" - - // finally, the rule that does the work: Keep together any run of words that - // are joined by runs of one of more non-spacing mark. Also keep a trailing - // line-break character or CRLF combination with the word. (line separators - // "win" over nbsp's) - + "$word($nbsp+$word)*(\r?$break?|$paiyannoi\r$break|$paiyannoi$break)?;" - + "$word($nbsp+$word)*$paiyannoi/([^[\u0e25$_ignore_]]|" - + "\u0e25[^$paiyannoi$_ignore_]);" - }, - - { "WordBreakDictionary", url }, - { "LineBreakDictionary", url } - }; - } -} diff --git a/icu4j/src/com/ibm/text/resources/LocaleElements.java b/icu4j/src/com/ibm/text/resources/LocaleElements.java deleted file mode 100755 index c702003a19..0000000000 --- a/icu4j/src/com/ibm/text/resources/LocaleElements.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/LocaleElements.java,v $ - * $Date: 2001/03/01 22:46:33 $ - * $Revision: 1.5 $ - * - ***************************************************************************************** - */ -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -public class LocaleElements extends ListResourceBundle { - /** - * Overrides ListResourceBundle - */ - public Object[][] getContents() { - return new Object[][] { - { "TransliteratorNamePattern", - /* Format for the display name of a Transliterator. - * This is the language-neutral form of this resource. - */ - "{0,choice,0#|1#{1}|2#{1}-{2}}", // Display name - }, - }; - } -} diff --git a/icu4j/src/com/ibm/text/resources/LocaleElements_el.java b/icu4j/src/com/ibm/text/resources/LocaleElements_el.java deleted file mode 100755 index d4eac8a45e..0000000000 --- a/icu4j/src/com/ibm/text/resources/LocaleElements_el.java +++ /dev/null @@ -1,255 +0,0 @@ -/************************************************************************** - * Copyright (C) 1996-2001, International Business Machines Corporation and - * others. All Rights Reserved. - ************************************************************************** - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/LocaleElements_el.java,v $ - * $Date: 2001/12/01 03:02:34 $ - * $Revision: 1.9 $ - ************************************************************************** - */ - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -public class LocaleElements_el extends ListResourceBundle { - /** - * Overrides ListResourceBundle - */ - public Object[][] getContents() { - return new Object[][] { - { "Transliterate_LATIN", - new String[] { "UNGEGN", - -"# Rules are predicated on running NFD first, and NFC afterwards\n"+ -// MINIMAL FILTER GENERATED FOR: Greek-Latin/UNGEGN -// WARNING: need to add accents to both filters ### -":: [\u0301\u0304\u0306\u0308;\u00B5\u00B7\u00C0\u00C2\u00C8\u00CA\u00CC\u00CE\u00D2\u00D4\u00D9\u00DB\u00E0\u00E2\u00E8\u00EA\u00EC\u00EE\u00F2\u00F4\u00F9\u00FB\u0108-\u0109\u011C-\u011D\u0124-\u0125\u0134-\u0135\u015C-\u015D\u0174-\u0177\u01DB-\u01DC\u01F8-\u01F9\u0300\u0302\u0313-\u0314\u0340\u0342-\u0343\u0345\u037A\u037E\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D6\u03F0-\u03F5\u0400\u040D\u0450\u045D\u1E14-\u1E15\u1E50-\u1E51\u1E80-\u1E81\u1E90-\u1E91\u1EA4-\u1EAD\u1EB0-\u1EB1\u1EBE-\u1EC7\u1ED0-\u1ED9\u1EDC-\u1EDD\u1EEA-\u1EEB\u1EF2-\u1EF3\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC1-\u1FC4\u1FC6-\u1FCD\u1FCF-\u1FD3\u1FD6-\u1FDB\u1FDD\u1FDF-\u1FED\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126] ;"+ - -// ":: [\\u0000-\\u007F \\u00B7 [:Greek:] [:nonspacing mark:]] ;"+ -"::NFD (NFC) ; "+ - -"# For modern Greek.\n"+ - -"# Useful variables\n"+ - -"$lower = [[:latin:][:greek:] & [:Ll:]] ; "+ -"$upper = [[:latin:][:greek:] & [:Lu:]] ; "+ -"$accent = [:M:] ; "+ - -"$macron = \u0304 ;"+ -"$ddot = \u0308 ;"+ - -"$lcgvowel = [\u03b1\u03b5\u03b7\u03b9\u03bf\u03c5\u03c9] ; "+ -"$ucgvowel = [\u0391\u0395\u0397\u0399\u039f\u03a5\u03a9] ; "+ -"$gvowel = [$lcgvowel $ucgvowel] ; "+ -"$lcgvowelC = [$lcgvowel $accent] ; "+ - -"$evowel = [aeiouyAEIOUY];"+ -"$vowel = [ $evowel $gvowel] ; "+ - -"$beforeLower = $accent * $lower ; "+ - -"$gammaLike = [\u0393\u039a\u039e\u03a7\u03b3\u03ba\u03be\u03c7\u03f0] ; "+ -"$egammaLike = [GKXCgkxc] ; "+ -"$smooth = \u0313 ; "+ -"$rough = \u0314 ; "+ -"$iotasub = \u0345 ; "+ - -"$softener = [\u03b2\u0392\u03b3\u0393\u03b4\u0394\u03b6\u0396\u03bb\u039b\u03bc\u039c\u03bd\u039d\u03c1\u03a1$gvowel] ;"+ - -"$under = \u0331;"+ - -"$caron = \u030C;"+ - -"$afterLetter = [:L:] [\\'[:M:]]* ;"+ -"$beforeLetter = [\\'[:M:]]* [:L:] ;"+ - - -"# Fix punctuation\n"+ - -"\\; <> \\? ;"+ -"\u00b7 <> \\: ;"+ - -"# Fix any ancient characters that creep in\n"+ - -"\u0342 > \u0301 ;"+ -"\u0302 > \u0301 ;"+ -"\u0300 > \u0301 ;"+ -"$smooth > ;"+ -"$rough > ;"+ -"$iotasub > ;"+ -"\u037A > ;"+ - -"# need to have these up here so the rules don't mask\n"+ - -"\u03b7 <> i $under ;"+ -"\u0397 <> I $under ;"+ - -"\u03a8 } $beforeLower <> Ps ; "+ -"\u03a8 <> PS ; "+ -"\u03c8 <> ps ; "+ - -"\u03c9 <> o $under ;"+ -"\u03a9 <> O $under;"+ - -"# at begining or end of word, convert mp to b\n"+ - -"[^[:L:][:M:]] { \u03bc\u03c0 > b ; "+ -"\u03bc\u03c0 } [^[:L:][:M:]] > b ; "+ -"[^[:L:][:M:]] { [\u039c\u03bc][\u03a0\u03c0] > B ; "+ -"[\u039c\u03bc][\u03a0\u03c0] } [^[:L:][:M:]] > B ;"+ - -"\u03bc\u03c0 < b ; "+ -"\u039c\u03c0 < B } $beforeLower ; "+ -"\u039c\u03a0 < B ; "+ - -"# handle diphthongs ending with upsilon\n"+ - -"$vowel { \u03c5 } $softener <> v $under ; "+ -"$vowel { \u03c5 } <> f $under; "+ -"\u03c5 <> y ; "+ -"$vowel { \u03a5 } $softener <> V $under ; "+ -"$vowel { \u03a5 <> U $under ; "+ -"\u03a5 <> Y ; "+ - -"# NORMAL\n"+ - -"\u03b1 <> a ; "+ -"\u0391 <> A ; "+ - -"\u03b2 <> v ; "+ -"\u0392 <> V ; "+ - -"\u03b3 } $gammaLike <> n } $egammaLike ; "+ -"\u03b3 <> g ; "+ -"\u0393 } $gammaLike <> N } $egammaLike ; "+ -"\u0393 <> G ; "+ - -"\u03b4 <> d ; "+ -"\u0394 <> D ; "+ - -"\u03b5 <> e ; "+ -"\u0395 <> E ; "+ - -"\u03b6 <> z ; "+ -"\u0396 <> Z ; "+ - -"\u03b8 <> th ; "+ -"\u0398 } $beforeLower <> Th ; "+ -"\u0398 <> TH ; "+ - -"\u03b9 <> i ; "+ -"\u0399 <> I ; "+ - -"\u03ba <> k ;"+ -"\u039a <> K ; "+ - -"\u03bb <> l ; "+ -"\u039b <> L ; "+ - -"\u03bc <> m ; "+ -"\u039c <> M ; "+ - -"\u03bd } $gammaLike > n\\' ; "+ -"\u03bd <> n ; "+ -"\u039d } $gammaLike <> N\\' ; "+ -"\u039d <> N ; "+ - -"\u03be <> x ; "+ -"\u039e <> X ; "+ - -"\u03bf <> o ; "+ -"\u039f <> O ; "+ - -"\u03c0 <> p ; "+ -"\u03a0 <> P ; "+ - -"\u03c1 <> r ; "+ -"\u03a1 <> R ; "+ - -"[Pp] { } \u03c2 > \\' ; "+ -"[Pp] { } \u03c3 > \\' ;"+ - -"# Caron means exception\n"+ - -"# before a letter, initial\n"+ -"\u03c2 } $beforeLetter <> s $under } $beforeLetter;"+ -"\u03c3 } $beforeLetter <> s } $beforeLetter;"+ - -"# otherwise, after a letter = final\n"+ -"$afterLetter { \u03c3 <> $afterLetter { s $under;"+ -"$afterLetter { \u03c2 <> $afterLetter { s ;"+ - -"# otherwise (isolated) = initial\n"+ -"\u03c2 <> s $under;"+ -"\u03c3 <> s ;"+ - -"[Pp] { \u03a3 <> \\'S ; "+ -"\u03a3 <> S ; "+ - -"\u03c4 <> t ; "+ -"\u03a4 <> T ; "+ - -"\u03c6 <> f ; "+ -"\u03a6 <> F ;"+ - -"\u03c7 <> ch ; "+ -"\u03a7 } $beforeLower <> Ch ; "+ -"\u03a7 <> CH ; "+ - -"# Completeness for ASCII\n"+ - -// "$ignore = [[:Mark:]''] * ;"+ - -"| ch < h ;"+ -"| k < c ;"+ -"| i < j ;"+ -"| k < q ;"+ -"| b < u } $vowel ;"+ -"| b < w } $vowel ;"+ -"| y < u ;"+ -"| y < w ;"+ - -"| Ch < H ;"+ -"| K < C ;"+ -"| I < J ;"+ -"| K < Q ;"+ -"| B < W } $vowel ;"+ -"| B < U } $vowel ;"+ -"| Y < W ;"+ -"| Y < U ;"+ - -"# Completeness for Greek\n"+ - -"\u03d0 > | \u03b2 ;"+ -"\u03d1 > | \u03b8 ;"+ -"\u03d2 > | \u03a5 ;"+ -"\u03d5 > | \u03c6 ;"+ -"\u03d6 > | \u03c0 ;"+ - -"\u03f0 > | \u03ba ;"+ -"\u03f1 > | \u03c1 ;"+ -"\u03f2 > | \u03c3 ;"+ -"\u03f3 > j ;"+ -"\u03f4 > | \u0398 ;"+ -"\u03f5 > | \u03b5 ;"+ -"\u00B5 > | \u03BC ; " + - -"# delete any trailing ' marks used for roundtripping\n"+ - -" < [\u03a0\u03c0] { \\' } [Ss] ;"+ -" < [\u039d\u03bd] { \\' } $egammaLike ;"+ - -"::NFC (NFD) ; "+ - -// MINIMAL FILTER GENERATED FOR: Latin-Greek/UNGEGN BACKWARD -":: ( [\u0301\u0304\u0306\u0308':?A-Za-z\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E1\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u01FB\u0200-\u021B\u021E-\u021F\u0226-\u0233\u0331\u1E00-\u1E99\u1EA0-\u1EF9\u212A-\u212B] ) ;" - -// ":: ([\\u0000-\\u007F [:Latin:] [:nonspacing mark:]]) ;" - - } - } - }; - } -} diff --git a/icu4j/src/com/ibm/text/resources/LocaleElements_en.java b/icu4j/src/com/ibm/text/resources/LocaleElements_en.java deleted file mode 100755 index d6a1b133c8..0000000000 --- a/icu4j/src/com/ibm/text/resources/LocaleElements_en.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/LocaleElements_en.java,v $ - * $Date: 2000/03/10 04:07:27 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -// WARNING : the format of this file may change in the future! - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -public class LocaleElements_en extends ListResourceBundle { - /** - * Overrides ListResourceBundle - */ - public Object[][] getContents() { - return new Object[][] { - { "TransliteratorNamePattern", - /* Format for the display name of a Transliterator. - * This is the English form of this resource. - */ - "{0,choice,0#|1#{1}|2#{1} to {2}}" - }, - - // Transliterator display names - { "%Translit%Hex", "Hex Escape" }, - { "%Translit%UnicodeName", "Unicode Name" }, - { "%Translit%UnicodeChar", "Unicode Character" }, - }; - } -} diff --git a/icu4j/src/com/ibm/text/resources/LocaleElements_xx_CH.java b/icu4j/src/com/ibm/text/resources/LocaleElements_xx_CH.java deleted file mode 100755 index 5d5a68b58a..0000000000 --- a/icu4j/src/com/ibm/text/resources/LocaleElements_xx_CH.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 1996-2000, International Business Machines Corporation and - * others. All Rights Reserved. - */ -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -public class LocaleElements_xx_CH extends ListResourceBundle { - /** - * Overrides ListResourceBundle - */ - public Object[][] getContents() { - return new Object[][] { - // The purpose of this overlay is to implement nickel - // rounding for Switzerland - { "NumberPatterns", - new String[] { - "#,##0.###;-#,##0.###", - "\u00A4 #,##0.05;\u00A4-#,##0.05", - "#,##0%", - } - }, - }; - } -} diff --git a/icu4j/src/com/ibm/text/resources/LocaleElements_xx_ES.java b/icu4j/src/com/ibm/text/resources/LocaleElements_xx_ES.java deleted file mode 100755 index 4228df8388..0000000000 --- a/icu4j/src/com/ibm/text/resources/LocaleElements_xx_ES.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 1996-2000, International Business Machines Corporation and - * others. All Rights Reserved. - */ -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -public class LocaleElements_xx_ES extends ListResourceBundle { - /** - * Overrides ListResourceBundle - */ - public Object[][] getContents() { - return new Object[][] { - // The purpose of this overlay is to make sure the number - // of fractional digits for Pesetas is zero; it is - // non-zero in some JDKs. - { "NumberPatterns", - new String[] { - "#,##0.###;-#,##0.###", // decimal pattern - "#,##0 \u00A4;-#,##0 \u00A4", // currency pattern - "#,##0%" // percent pattern - } - }, - }; - } -} diff --git a/icu4j/src/com/ibm/text/resources/LocaleElements_xx_IN.java b/icu4j/src/com/ibm/text/resources/LocaleElements_xx_IN.java deleted file mode 100755 index 7ed4466503..0000000000 --- a/icu4j/src/com/ibm/text/resources/LocaleElements_xx_IN.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 1996-2000, International Business Machines Corporation and - * others. All Rights Reserved. - */ -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -public class LocaleElements_xx_IN extends ListResourceBundle { - /** - * Overrides ListResourceBundle - */ - public Object[][] getContents() { - return new Object[][] { - // The purpose of this overlay is to specify the secondary - // grouping separator for Indian numbers. - { "NumberPatterns", - new String[] { - "#,##,##0.###", - "\u00A4 #,##,##0.00;-\u00A4 #,##,##0.00", - "#,##,##0%" - } - }, - }; - } -} diff --git a/icu4j/src/com/ibm/text/resources/LocaleScript.java b/icu4j/src/com/ibm/text/resources/LocaleScript.java deleted file mode 100755 index 687b0f8990..0000000000 --- a/icu4j/src/com/ibm/text/resources/LocaleScript.java +++ /dev/null @@ -1,424 +0,0 @@ -/* -******************************************************************************* -* Copyright (C) 2001-2003, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -*/ -package com.ibm.text.resources; - -import java.util.ListResourceBundle; -import com.ibm.text.UScript; - -public class LocaleScript extends ListResourceBundle { - - public Object[][] getContents() { - return localeScript; - } - - private static final Object[][] localeScript = new Object[][] { - { - "af", new int[] { - UScript.LATIN, - } - }, - { - "am", new int[] { - UScript.ETHIOPIC, - } - }, - { - "ar", new int[] { - UScript.ARABIC, - } - }, - { - "az", new int[] { - UScript.CYRILLIC, - } - }, - { - "be", new int[] { - UScript.CYRILLIC, - } - }, - { - "bg", new int[] { - UScript.CYRILLIC, - } - }, - { - "bn", new int[] { - UScript.BENGALI, - } - }, - { - "ca", new int[] { - UScript.LATIN, - } - }, - { - "cs", new int[] { - UScript.LATIN, - } - }, - { - "da", new int[] { - UScript.LATIN, - } - }, - { - "de", new int[] { - UScript.LATIN, - } - }, - { - "div", new int[] { - UScript.THAANA, - } - }, - { - "el", new int[] { - UScript.GREEK, - } - }, - { - "en", new int[] { - UScript.LATIN, - } - }, - { - "eo", new int[] { - UScript.LATIN, - } - }, - { - "es", new int[] { - UScript.LATIN, - } - }, - { - "et", new int[] { - UScript.LATIN, - } - }, - { - "eu", new int[] { - UScript.LATIN, - } - }, - { - "fa", new int[] { - UScript.ARABIC, - } - }, - { - "fi", new int[] { - UScript.LATIN, - } - }, - { - "fo", new int[] { - UScript.LATIN, - } - }, - { - "fr", new int[] { - UScript.LATIN, - } - }, - { - "ga", new int[] { - UScript.LATIN, - } - }, - { - "gl", new int[] { - UScript.LATIN, - } - }, - { - "gu", new int[] { - UScript.GUJARATI, - } - }, - { - "gv", new int[] { - UScript.LATIN, - } - }, - { - "he", new int[] { - UScript.HEBREW, - } - }, - { - "hi", new int[] { - UScript.DEVANAGARI, - } - }, - { - "hr", new int[] { - UScript.LATIN, - } - }, - { - "hu", new int[] { - UScript.LATIN, - } - }, - { - "hy", new int[] { - UScript.ARMENIAN, - } - }, - { - "id", new int[] { - UScript.LATIN, - } - }, - { - "is", new int[] { - UScript.LATIN, - } - }, - { - "it", new int[] { - UScript.LATIN, - } - }, - { - "iw", new int[] { - UScript.HEBREW, - } - }, - { - "ja", new int[] { - UScript.KATAKANA, - UScript.HIRAGANA, - UScript.HAN, - } - }, - { - "ka", new int[] { - UScript.GEORGIAN, - } - }, - { - "kk", new int[] { - UScript.CYRILLIC, - } - }, - { - "kl", new int[] { - UScript.LATIN, - } - }, - { - "kn", new int[] { - UScript.KANNADA, - } - }, - { - "ko", new int[] { - UScript.HANGUL, - UScript.HAN, - } - }, - { - "kok", new int[] { - UScript.DEVANAGARI, - } - }, - { - "kw", new int[] { - UScript.LATIN, - } - }, - { - "ky", new int[] { - UScript.LATIN, - } - }, - { - "lt", new int[] { - UScript.LATIN, - } - }, - { - "lv", new int[] { - UScript.LATIN, - } - }, - { - "mk", new int[] { - UScript.CYRILLIC, - } - }, - { - "mn", new int[] { - UScript.CYRILLIC, - } - }, - { - "mr", new int[] { - UScript.DEVANAGARI, - } - }, - { - "ms", new int[] { - UScript.LATIN, - } - }, - { - "mt", new int[] { - UScript.LATIN, - } - }, - { - "nb", new int[] { - UScript.LATIN, - } - }, - { - "nl", new int[] { - UScript.LATIN, - } - }, - { - "nn", new int[] { - UScript.LATIN, - } - }, - { - "pa", new int[] { - UScript.GURMUKHI, - } - }, - { - "pl", new int[] { - UScript.LATIN, - } - }, - { - "pt", new int[] { - UScript.LATIN, - } - }, - { - "ro", new int[] { - UScript.LATIN, - } - }, - { - "root", new int[] { - UScript.LATIN, - } - }, - { - "ru", new int[] { - UScript.CYRILLIC, - } - }, - { - "sa", new int[] { - UScript.DEVANAGARI, - } - }, - { - "sh", new int[] { - UScript.LATIN, - } - }, - { - "sk", new int[] { - UScript.LATIN, - } - }, - { - "sl", new int[] { - UScript.LATIN, - } - }, - { - "sq", new int[] { - UScript.LATIN, - } - }, - { - "sr", new int[] { - UScript.CYRILLIC, - } - }, - { - "sv", new int[] { - UScript.LATIN, - } - }, - { - "sw", new int[] { - UScript.LATIN, - } - }, - { - "syr", new int[] { - UScript.SYRIAC, - } - }, - { - "ta", new int[] { - UScript.TAMIL, - } - }, - { - "te", new int[] { - UScript.TELUGU, - } - }, - { - "th", new int[] { - UScript.THAI, - } - }, - { - "tr", new int[] { - UScript.LATIN, - } - }, - { - "tt", new int[] { - UScript.CYRILLIC, - } - }, - { - "uk", new int[] { - UScript.CYRILLIC, - } - }, - { - "ur", new int[] { - UScript.ARABIC, - } - }, - { - "uz", new int[] { - UScript.CYRILLIC, - } - }, - { - "vi", new int[] { - UScript.LATIN, - } - }, - { - "zh", new int[] { - UScript.HAN, - } - }, - { - "zh_TW", new int[] { - UScript.HAN, - UScript.BOPOMOFO, - } - }, - }; -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules.java deleted file mode 100755 index 565e43ed61..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/NumberFormatRules.java,v $ - * $Date: 2001/11/07 00:30:31 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * Base resource for RuleBasedNumberFormat data. Each resource contains - * rule sets for three uses: spelled-out numerical values, ordinal - * abbreviations, and durations in seconds. This resource contains the - * U.S. English data. - * - * @author Richard Gillam - * @version $Version$ $Date: 2001/11/07 00:30:31 $ - */ -public class NumberFormatRules extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - /* - * Default used to be English (US) rules, but now default just formats - * like DecimalFormat. The former default rules are now the _en rules. - */ - { "SpelloutRules", - "=#,##0.######=;\n" - }, - { "OrdinalRules", - "=#,##0=;\n" - }, - { "DurationRules", - "=#,##0=;\n" - } - }; -} diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_de.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_de.java deleted file mode 100755 index 64136d5718..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_de.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/NumberFormatRules_de.java,v $ - * $Date: 2000/03/10 04:07:27 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * RuleBasedNumberFormat data for German - * - * @author Richard Gillam - * @version $Version$ $Date: 2000/03/10 04:07:27 $ - */ -public class NumberFormatRules_de extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - /** - * Spellout rules for German. German also adds some interesting - * characteristics. For values below 1,000,000, numbers are customarily - * written out as a single word. And the ones digit PRECEDES the tens - * digit (e.g., 23 is "dreiundzwanzig," not "zwanzigunddrei"). - */ - { "SpelloutRules", - // 1 is "eins" when by itself, but turns into "ein" in most - // combinations - "%alt-ones:\n" - + " null; eins; =%%main=;\n" - + "%%main:\n" - // words for numbers from 0 to 12. Notice that the values - // from 13 to 19 can derived algorithmically, unlike in most - // other languages - + " null; ein; zwei; drei; vier; f\u00fcnf; sechs; sieben; acht; neun;\n" - + " zehn; elf; zw\u00f6lf; >>zehn;\n" - // rules for the multiples of 10. Notice that the ones digit - // goes on the front - + " 20: [>>und]zwanzig;\n" - + " 30: [>>und]drei\u00dfig;\n" - + " 40: [>>und]vierzig;\n" - + " 50: [>>und]f\u00fcnfzig;\n" - + " 60: [>>und]sechzig;\n" - + " 70: [>>und]siebzig;\n" - + " 80: [>>und]achtzig;\n" - + " 90: [>>und]neunzig;\n" - + " 100: hundert[>%alt-ones>];\n" - + " 200: <%alt-ones>];\n" - + " 1000: tausend[>%alt-ones>];\n" - + " 2000: <%alt-ones>];\n" - + " 1,000,000: eine Million[ >%alt-ones>];\n" - + " 2,000,000: << Millionen[ >%alt-ones>];\n" - + " 1,000,000,000: eine Milliarde[ >%alt-ones>];\n" - + " 2,000,000,000: << Milliarden[ >%alt-ones>];\n" - + " 1,000,000,000,000: eine Billion[ >%alt-ones>];\n" - + " 2,000,000,000,000: << Billionen[ >%alt-ones>];\n" - + " 1,000,000,000,000,000: =#,##0=;" - + "%%lenient-parse:\n" - + " & ae , \u00e4 & ae , \u00c4\n" - + " & oe , \u00f6 & oe , \u00d6\n" - + " & ue , \u00fc & ue , \u00dc\n" - } - - // again, I'm not 100% sure of these rules. I think both "hundert" and - // "einhundert" are correct or 100, but I'm not sure which is preferable - // in situations where this framework is likely to be used. Also, is it - // really true that numbers are run together into compound words all the - // time? And again, I'm missing information on negative numbers and - // decimals. - }; -} - diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_en.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_en.java deleted file mode 100755 index 8cac2cff13..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_en.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/NumberFormatRules_en.java,v $ - * $Date: 2001/11/07 00:30:32 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * Default RuleBasedNumberFormat data for English. This resource - * inherits everything from the default. - * - * @author Richard Gillam - * @version $Version$ $Date: 2001/11/07 00:30:32 $ - */ -public class NumberFormatRules_en extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - public Object[][] getContents() { - return contents; - } - - // This used to be the root rules, but they are English-specific, so for - // now we just don't have any interesting rules for the root. This includes - // the comments that used to be in the root rules. - Object[][] contents = { - /* - * Spellout rules for U.S. English. This rule set has two variants: - * %simplified is a set of rules showing the simple method of spelling - * out numbers in English: 289 is formatted as "two hundred eighty-nine". - * %default uses a more complicated algorithm to format - * numbers in a more natural way: 289 is formatted as "two hundred AND - * eighty-nine" and commas are inserted between the thousands groups for - * values above 100,000. - */ - { "SpelloutRules", - // This rule set shows the normal simple formatting rules for English - "%simplified:\n" - // negative number rule. This rule is used to format negative - // numbers. The result of formatting the number's absolute - // value is placed where the >> is. - + " -x: minus >>;\n" - // faction rule. This rule is used for formatting numbers - // with fractional parts. The result of formatting the - // number's integral part is substituted for the <<, and - // the result of formatting the number's fractional part - // (one digit at a time, e.g., 0.123 is "zero point one two - // three") replaces the >>. - + " x.x: << point >>;\n" - // the rules for the values from 0 to 19 are simply the - // words for those numbers - + " zero; one; two; three; four; five; six; seven; eight; nine;\n" - + " ten; eleven; twelve; thirteen; fourteen; fifteen; sixteen;\n" - + " seventeen; eighteen; nineteen;\n" - // beginning at 20, we use the >> to mark the position where - // the result of formatting the number's ones digit. Thus, - // we only need a new rule at every multiple of 10. Text in - // backets is omitted if the value being formatted is an - // even multiple of 10. - + " 20: twenty[->>];\n" - + " 30: thirty[->>];\n" - + " 40: forty[->>];\n" - + " 50: fifty[->>];\n" - + " 60: sixty[->>];\n" - + " 70: seventy[->>];\n" - + " 80: eighty[->>];\n" - + " 90: ninety[->>];\n" - // beginning at 100, we can use << to mark the position where - // the result of formatting the multiple of 100 is to be - // inserted. Notice also that the meaning of >> has shifted: - // here, it refers to both the ones place and the tens place. - // The meanings of the << and >> tokens depend on the base value - // of the rule. A rule's divisor is (usually) the highest - // power of 10 that is less than or equal to the rule's base - // value. The value being formatted is divided by the rule's - // divisor, and the integral quotient is used to get the text - // for <<, while the remainder is used to produce the text - // for >>. Again, text in brackets is omitted if the value - // being formatted is an even multiple of the rule's divisor - // (in this case, an even multiple of 100) - + " 100: << hundred[ >>];\n" - // The rules for the higher numbers work the same way as the - // rule for 100: Again, the << and >> tokens depend on the - // rule's divisor, which for all these rules is also the rule's - // base value. To group by thousand, we simply don't have any - // rules between 1,000 and 1,000,000. - + " 1000: << thousand[ >>];\n" - + " 1,000,000: << million[ >>];\n" - + " 1,000,000,000: << billion[ >>];\n" - + " 1,000,000,000,000: << trillion[ >>];\n" - // overflow rule. This rule specifies that values of a - // quadrillion or more are shown in numerals rather than words. - // The == token means to format (with new rules) the value - // being formatted by this rule and place the result where - // the == is. The #,##0 inside the == signs is a - // DecimalFormat pattern. It specifies that the value should - // be formatted with a DecimalFormat object, and that it - // should be formatted with no decimal places, at least one - // digit, and a thousands separator. - + " 1,000,000,000,000,000: =#,##0=;\n" - - // %default is a more elaborate form of %simplified; It is basically - // the same, except that it introduces "and" before the ones digit - // when appropriate (basically, between the tens and ones digits) and - // separates the thousands groups with commas in values over 100,000. - + "%default:\n" - // negative-number and fraction rules. These are the same - // as those for %simplified, but ave to be stated here too - // because this is an entry point - + " -x: minus >>;\n" - + " x.x: << point >>;\n" - // just use %simplified for values below 100 - + " =%simplified=;\n" - // for values from 100 to 9,999 use %%and to decide whether or - // not to interpose the "and" - + " 100: << hundred[ >%%and>];\n" - + " 1000: << thousand[ >%%and>];\n" - // for values of 100,000 and up, use %%commas to interpose the - // commas in the right places (and also to interpose the "and") - + " 100,000>>: << thousand[>%%commas>];\n" - + " 1,000,000: << million[>%%commas>];\n" - + " 1,000,000,000: << billion[>%%commas>];\n" - + " 1,000,000,000,000: << trillion[>%%commas>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - // if the value passed to this rule set is greater than 100, don't - // add the "and"; if it's less than 100, add "and" before the last - // digits - + "%%and:\n" - + " and =%default=;\n" - + " 100: =%default=;\n" - // this rule set is used to place the commas - + "%%commas:\n" - // for values below 100, add "and" (the apostrophe at the - // beginning is ignored, but causes the space that follows it - // to be significant: this is necessary because the rules - // calling %%commas don't put a space before it) - + " ' and =%default=;\n" - // put a comma after the thousands (or whatever preceded the - // hundreds) - + " 100: , =%default=;\n" - // put a comma after the millions (or whatever precedes the - // thousands) - + " 1000: , <%default< thousand, >%default>;\n" - // and so on... - + " 1,000,000: , =%default=;" - // %%lenient-parse isn't really a set of number formatting rules; - // it's a set of collation rules. Lenient-parse mode uses a Collator - // object to compare fragments of the text being parsed to the text - // in the rules, allowing more leeway in the matching text. This set - // of rules tells the formatter to ignore commas when parsing (it - // already ignores spaces, which is why we refer to the space; it also - // ignores hyphens, making "twenty one" and "twenty-one" parse - // identically) - + "%%lenient-parse:\n" - + " & ' ' , ',' ;\n" }, - - /* - * This rule set adds an English ordinal abbreviation to the end of a - * number. For example, 2 is formatted as "2nd". Parsing doesn't work with - * this rule set. To parse, use DecimalFormat on the numeral. - */ - { "OrdinalRules", - // this rule set formats the numeral and calls %%abbrev to - // supply the abbreviation - "%main:\n" - + " =#,##0==%%abbrev=;\n" - // this rule set supplies the abbreviation - + "%%abbrev:\n" - // the abbreviations. Everything from 4 to 19 ends in "th" - + " th; st; nd; rd; th;\n" - // at 20, we begin repeating the cycle every 10 (13 is "13th", - // but 23 and 33 are "23rd" and "33rd") We do this by - // ignoring all bug the ones digit in selecting the abbreviation - + " 20: >>;\n" - // at 100, we repeat the whole cycle by considering only the - // tens and ones digits in picking an abbreviation - + " 100: >>;\n" }, - - /* - * This rule set formats a number of seconds in sexagesimal notation - * (i.e., hours, minutes, and seconds). %with-words formats it with - * words (3,740 is "1 hour, 2 minutes, 20 seconds") and %in-numerals - * formats it entirely in numerals (3,740 is "1:02:20"). - */ - { "DurationRules", - // main rule set for formatting with words - "%with-words:\n" - // take care of singular and plural forms of "second" - + " 0 seconds; 1 second; =0= seconds;\n" - // use %%min to format values greater than 60 seconds - + " 60/60: <%%min<[, >>];\n" - // use %%hr to format values greater than 3,600 seconds - // (the ">>>" below causes us to see the number of minutes - // when when there are zero minutes) - + " 3600/60: <%%hr<[, >>>];\n" - // this rule set takes care of the singular and plural forms - // of "minute" - + "%%min:\n" - + " 0 minutes; 1 minute; =0= minutes;\n" - // this rule set takes care of the singular and plural forms - // of "hour" - + "%%hr:\n" - + " 0 hours; 1 hour; =0= hours;\n" - - // main rule set for formatting in numerals - + "%in-numerals:\n" - // values below 60 seconds are shown with "sec." - + " =0= sec.;\n" - // higher values are shown with colons: %%min-sec is used for - // values below 3,600 seconds... - + " 60: =%%min-sec=;\n" - // ...and %%hr-min-sec is used for values of 3,600 seconds - // and above - + " 3600: =%%hr-min-sec=;\n" - // this rule causes values of less than 10 minutes to show without - // a leading zero - + "%%min-sec:\n" - + " 0: :=00=;\n" - + " 60/60: <0<>>;\n" - // this rule set is used for values of 3,600 or more. Minutes are always - // shown, and always shown with two digits - + "%%hr-min-sec:\n" - + " 0: :=00=;\n" - + " 60/60: <00<>>;\n" - + " 3600/60: <#,##0<:>>>;\n" - // the lenient-parse rules allow several different characters to be used - // as delimiters between hours, minutes, and seconds - + "%%lenient-parse:\n" - + " & ':' = '.' = ' ' = '-';\n" } - }; -} diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_en_GB.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_en_GB.java deleted file mode 100755 index 79ddda9a55..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_en_GB.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/NumberFormatRules_en_GB.java,v $ - * $Date: 2000/03/10 04:07:28 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * RuleBasedNumberFormat data for U.K. English. - * - * @author Richard Gillam - * @version $Version$ $Date: 2000/03/10 04:07:28 $ - */ -public class NumberFormatRules_en_GB extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - /** - * Spellout rules for U.K. English. U.K. English has one significant - * difference from U.S. English: the names for values of 1,000,000,000 - * and higher. In American English, each successive "-illion" is 1,000 - * times greater than the preceding one: 1,000,000,000 is "one billion" - * and 1,000,000,000,000 is "one trillion." In British English, each - * successive "-illion" is one million times greater than the one before: - * "one billion" is 1,000,000,000,000 (or what Americans would call a - * "trillion"), and "one trillion" is 1,000,000,000,000,000,000. - * 1,000,000,000 in British English is "one thousand million." (This - * value is sometimes called a "milliard," but this word seems to have - * fallen into disuse.) - */ - { "SpelloutRules", - "%simplified:\n" - + " -x: minus >>;\n" - + " x.x: << point >>;\n" - + " zero; one; two; three; four; five; six; seven; eight; nine;\n" - + " ten; eleven; twelve; thirteen; fourteen; fifteen; sixteen;\n" - + " seventeen; eighteen; nineteen;\n" - + " 20: twenty[->>];\n" - + " 30: thirty[->>];\n" - + " 40: forty[->>];\n" - + " 50: fifty[->>];\n" - + " 60: sixty[->>];\n" - + " 70: seventy[->>];\n" - + " 80: eighty[->>];\n" - + " 90: ninety[->>];\n" - + " 100: << hundred[ >>];\n" - + " 1000: << thousand[ >>];\n" - + " 1,000,000: << million[ >>];\n" - + " 1,000,000,000,000: << billion[ >>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - + "%default:\n" - + " -x: minus >>;\n" - + " x.x: << point >>;\n" - + " =%simplified=;\n" - + " 100: << hundred[ >%%and>];\n" - + " 1000: << thousand[ >%%and>];\n" - + " 100,000>>: << thousand[>%%commas>];\n" - + " 1,000,000: << million[>%%commas>];\n" - + " 1,000,000,000,000: << billion[>%%commas>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - + "%%and:\n" - + " and =%default=;\n" - + " 100: =%default=;\n" - + "%%commas:\n" - + " ' and =%default=;\n" - + " 100: , =%default=;\n" - + " 1000: , <%default< thousand, >%default>;\n" - + " 1,000,000: , =%default=;" - + "%%lenient-parse:\n" - + " & ' ' , ',' ;\n" } - // Could someone please correct me if I'm wrong about "milliard" falling - // into disuse, or have missed any other details of how large numbers - // are rendered. Also, could someone please provide me with information - // on which other English-speaking countries use which system? Right now, - // I'm assuming that the U.S. system is used in Canada and that all the - // other English-speaking countries follow the British system. Can - // someone out there confirm this? - }; -} diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_eo.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_eo.java deleted file mode 100755 index 471bdd4b6d..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_eo.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2001, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - */ - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * RuleBasedNumberFormat data for Esperanto - * - * @author Doug Felt - * @version %W% %E% - */ -public class NumberFormatRules_eo extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a92001 IBM Corp. All rights reserved."; - - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - /** - * Spellout rules for Esperanto. - * data from 'Esperanto-programita 1' courtesy of Markus Scherer - */ - { "SpelloutRules", - "-x: minus >>;\n" + - "x.x: << komo >>;\n" + - "nulo; unu; du; tri; kvar; kvin; ses; sep; ok; na\u016d;\n" + - "10: dek[ >>];\n" + - "20: <>];\n" + - "100: cent[ >>];\n" + - "200: <>];\n" + - "1000: mil[ >>];\n" + - "2000: <>];\n" + - "10000: dekmil[ >>];\n" + - "11000>: << mil[ >>];\n" + - "1,000,000: miliono[ >>];\n" + - "2,000,000: << milionoj[ >>];\n" + - "1,000,000,000: miliardo[ >>];\n" + - "2,000,000,000: << miliardoj[ >>];\n" + - "1,000,000,000,000: biliono[ >>];\n" + - "2,000,000,000,000: << bilionoj[ >>];\n" + - "1,000,000,000,000,000: =#,##0=;\n" - } - }; -} - diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_es.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_es.java deleted file mode 100755 index aec02dcf62..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_es.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/NumberFormatRules_es.java,v $ - * $Date: 2000/03/10 04:07:28 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * RuleBasedNumberFormat data for Spanish. - * - * @author Richard Gillam - * @version $Version$ $Date: 2000/03/10 04:07:28 $ - */ -public class NumberFormatRules_es extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - /** - * Spellout rules for Spanish. The Spanish rules are quite similar to - * the English rules, but there are some important differences: - * First, we have to provide separate rules for most of the twenties - * because the ones digit frequently picks up an accent mark that it - * doesn't have when standing alone. Second, each multiple of 100 has - * to be specified separately because the multiplier on 100 very often - * changes form in the contraction: 500 is "quinientos," not - * "cincocientos." In addition, the word for 100 is "cien" when - * standing alone, but changes to "ciento" when followed by more digits. - * There also some other differences. - */ - { "SpelloutRules", - // negative-number and fraction rules - "-x: menos >>;\n" - + "x.x: << punto >>;\n" - // words for values from 0 to 19 - + "cero; uno; dos; tres; cuatro; cinco; seis; siete; ocho; nueve;\n" - + "diez; once; doce; trece; catorce; quince; diecis\u00e9is;\n" - + " diecisiete; dieciocho; diecinueve;\n" - // words for values from 20 to 29 (necessary because the ones digit - // often picks up an accent mark it doesn't have when standing alone) - + "veinte; veintiuno; veintid\u00f3s; veintitr\u00e9s; veinticuatro;\n" - + " veinticinco; veintis\u00e9is; veintisiete; veintiocho;\n" - + " veintinueve;\n" - // words for multiples of 10 (notice that the tens digit is separated - // from the ones digit by the word "y".) - + "30: treinta[ y >>];\n" - + "40: cuarenta[ y >>];\n" - + "50: cincuenta[ y >>];\n" - + "60: sesenta[ y >>];\n" - + "70: setenta[ y >>];\n" - + "80: ochenta[ y >>];\n" - + "90: noventa[ y >>];\n" - // 100 by itself is "cien," but 100 followed by something is "cineto" - + "100: cien;\n" - + "101: ciento >>;\n" - // words for multiples of 100 (must be stated because they're - // rarely simple concatenations) - + "200: doscientos[ >>];\n" - + "300: trescientos[ >>];\n" - + "400: cuatrocientos[ >>];\n" - + "500: quinientos[ >>];\n" - + "600: seiscientos[ >>];\n" - + "700: setecientos[ >>];\n" - + "800: ochocientos[ >>];\n" - + "900: novecientos[ >>];\n" - // for 1,000, the multiplier on "mil" is omitted: 2,000 is "dos mil," - // but 1,000 is just "mil." - + "1000: mil[ >>];\n" - + "2000: << mil[ >>];\n" - // 1,000,000 is "un millon," not "uno millon" - + "1,000,000: un mill\u00f3n[ >>];\n" - + "2,000,000: << mill\u00f3n[ >>];\n" - // overflow rule - + "1,000,000,000: =#,##0= (incomplete data);" } - // The Spanish rules are incomplete. I'm missing information on negative - // numbers and numbers with fractional parts. I also don't have - // information on numbers higher than the millions. - }; -} diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_fr.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_fr.java deleted file mode 100755 index b0c59dfd43..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_fr.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/NumberFormatRules_fr.java,v $ - * $Date: 2000/03/10 04:07:28 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * Default RuleBasedNumberFormat data for French - * - * @author Richard Gillam - * @version $Version$ $Date: 2000/03/10 04:07:28 $ - */ -public class NumberFormatRules_fr extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - /** - * Spellout rules for French. French adds some interesting quirks of its - * own: 1) The word "et" is interposed between the tens and ones digits, - * but only if the ones digit if 1: 20 is "vingt," and 2 is "vingt-deux," - * but 21 is "vingt-et-un." 2) There are no words for 70, 80, or 90. - * "quatre-vingts" ("four twenties") is used for 80, and values proceed - * by score from 60 to 99 (e.g., 73 is "soixante-treize" ["sixty-thirteen"]). - * Numbers from 1,100 to 1,199 are rendered as hundreds rather than - * thousands: 1,100 is "onze cents" ("eleven hundred"), rather than - * "mille cent" ("one thousand one hundred") - */ - { "SpelloutRules", - // the main rule set - "%main:\n" - + " -x: moins >>;\n" - + " x.x: << virgule >>;\n" - // words for numbers from 0 to 10 - + " z\u00e9ro; un; deux; trois; quatre; cinq; six; sept; huit; neuf;\n" - + " dix; onze; douze; treize; quatorze; quinze; seize;\n" - + " dix-sept; dix-huit; dix-neuf;\n" - // ords for the multiples of 10: %%alt-ones inserts "et" - // when needed - + " 20: vingt[->%%alt-ones>];\n" - + " 30: trente[->%%alt-ones>];\n" - + " 40: quarante[->%%alt-ones>];\n" - + " 50: cinquante[->%%alt-ones>];\n" - // rule for 60. The /20 causes this rule's multiplier to be - // 20 rather than 10, allowinhg us to recurse for all values - // from 60 to 79... - + " 60/20: soixante[->%%alt-ones>];\n" - // ...except for 71, which must be special-cased - + " 71: soixante et onze;\n" - // at 72, we have to repeat the rule for 60 to get us to 79 - + " 72/20: soixante->%%alt-ones>;\n" - // at 80, we state a new rule with the phrase for 80. Since - // it changes form when there's a ones digit, we need a second - // rule at 81. This rule also includes "/20," allowing it to - // be used correctly for all values up to 99 - + " 80: quatre-vingts; 81/20: quatre-vingt->>;\n" - // "cent" becomes plural when preceded by a multiplier, and - // the multiplier is omitted from the singular form - + " 100: cent[ >>];\n" - + " 200: << cents[ >>];\n" - + " 1000: mille[ >>];\n" - // values from 1,100 to 1,199 are rendered as "onze cents..." - // instead of "mille cent..." The > after "1000" decreases - // the rule's exponent, causing its multiplier to be 100 instead - // of 1,000. This prevents us from getting "onze cents cent - // vingt-deux" ("eleven hundred one hundred twenty-two"). - + " 1100>: onze cents[ >>];\n" - // at 1,200, we go back to formating in thousands, so we - // repeat the rule for 1,000 - + " 1200: mille >>;\n" - // at 2,000, the multiplier is added - + " 2000: << mille[ >>];\n" - + " 1,000,000: << million[ >>];\n" - + " 1,000,000,000: << milliarde[ >>];\n" - + " 1,000,000,000,000: << billion[ >>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - // %%alt-ones is used to insert "et" when the ones digit is 1 - + "%%alt-ones:\n" - + " ; et-un; =%main=;" } - }; -} diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_fr_CH.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_fr_CH.java deleted file mode 100755 index 607d776eaf..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_fr_CH.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/NumberFormatRules_fr_CH.java,v $ - * $Date: 2000/03/10 04:07:28 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * RuleBasedNumberFormat data for Swiss French. - * - * @author Richard Gillam - * @version $Version$ $Date: 2000/03/10 04:07:28 $ - */ -public class NumberFormatRules_fr_CH extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - /** - * Spellout rules for Swiss French. Swiss French differs from French French - * in that it does have words for 70, 80, and 90. This rule set shows them, - * and is simpler as a result. - */ - { "SpelloutRules", - "%main:\n" - + " -x: moins >>;\n" - + " x.x: << virgule >>;\n" - + " z\u00e9ro; un; deux; trois; quatre; cinq; six; sept; huit; neuf;\n" - + " dix; onze; douze; treize; quatorze; quinze; seize;\n" - + " dix-sept; dix-huit; dix-neuf;\n" - + " 20: vingt[->%%alt-ones>];\n" - + " 30: trente[->%%alt-ones>];\n" - + " 40: quarante[->%%alt-ones>];\n" - + " 50: cinquante[->%%alt-ones>];\n" - + " 60: soixante[->%%alt-ones>];\n" - // notice new words for 70, 80, and 90 - + " 70: septante[->%%alt-ones>];\n" - + " 80: octante[->%%alt-ones>];\n" - + " 90: nonante[->%%alt-ones>];\n" - + " 100: cent[ >>];\n" - + " 200: << cents[ >>];\n" - + " 1000: mille[ >>];\n" - + " 1100>: onze cents[ >>];\n" - + " 1200: mille >>;\n" - + " 2000: << mille[ >>];\n" - + " 1,000,000: << million[ >>];\n" - + " 1,000,000,000: << milliarde[ >>];\n" - + " 1,000,000,000,000: << billion[ >>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - + "%%alt-ones:\n" - + " ; et-un; =%main=;" } - // again, I'm missing information on negative numbers and decimals for - // these to rule sets. Also, I'm not 100% sure about Swiss French. Is - // this correct? Is "onze cents" commonly used for 1,100 in both France - // and Switzerland? Can someone fill me in on the rules for the other - // French-speaking countries? I've heard conflicting opinions on which - // version is used in Canada, and I understand there's an alternate set - // of words for 70, 80, and 90 that is used somewhere, but I don't know - // what those words are or where they're used. - }; -} diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_it.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_it.java deleted file mode 100755 index d74d5ef4b6..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_it.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/NumberFormatRules_it.java,v $ - * $Date: 2000/03/10 04:07:28 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * RuleBasedNumberFormat data for Italian - * - * @author Richard Gillam - * @version $Version$ $Date: 2000/03/10 04:07:28 $ - */ -public class NumberFormatRules_it extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - /** - * Spellout rules for Italian. Like German, most Italian numbers are - * written as single words. What makes these rules complicated is the rule - * that says that when a word ending in a vowel and a word beginning with - * a vowel are combined into a compound, the vowel is dropped from the - * end of the first word: 180 is "centottanta," not "centoottanta." - * The complexity of this rule set is to produce this behavior. - */ - { "SpelloutRules", - // main rule set. Follows the patterns of the preceding rule sets, - // except that the final vowel is omitted from words ending in - // vowels when they are followed by another word; instead, we have - // separate rule sets that are identical to this one, except that - // all the words that don't begin with a vowel have a vowel tacked - // onto them at the front. A word ending in a vowel calls a - // substitution that will supply that vowel, unless that vowel is to - // be elided. - "%main:\n" - + " -x: meno >>;\n" - + " x.x: << virgola >>;\n" - + " zero; uno; due; tre; quattro; cinque; sei; sette; otto;\n" - + " nove;\n" - + " dieci; undici; dodici; tredici; quattordici; quindici; sedici;\n" - + " diciasette; diciotto; diciannove;\n" - + " 20: venti; vent>%%with-i>;\n" - + " 30: trenta; trent>%%with-i>;\n" - + " 40: quaranta; quarant>%%with-a>;\n" - + " 50: cinquanta; cinquant>%%with-a>;\n" - + " 60: sessanta; sessant>%%with-a>;\n" - + " 70: settanta; settant>%%with-a>;\n" - + " 80: ottanta; ottant>%%with-a>;\n" - + " 90: novanta; novant>%%with-a>;\n" - + " 100: cento; cent[>%%with-o>];\n" - + " 200: <%%with-o>];\n" - + " 1000: mille; mill[>%%with-i>];\n" - + " 2000: <%%with-a>];\n" - + " 100,000>>: <>];\n" - + " 1,000,000: =#,##0= (incomplete data);\n" - + "%%with-a:\n" - + " azero; uno; adue; atre; aquattro; acinque; asei; asette; otto;\n" - + " anove;\n" - + " adieci; undici; adodici; atredici; aquattordici; aquindici; asedici;\n" - + " adiciasette; adiciotto; adiciannove;\n" - + " 20: aventi; avent>%%with-i>;\n" - + " 30: atrenta; atrent>%%with-i>;\n" - + " 40: aquaranta; aquarant>%%with-a>;\n" - + " 50: acinquanta; acinquant>%%with-a>;\n" - + " 60: asessanta; asessant>%%with-a>;\n" - + " 70: asettanta; asettant>%%with-a>;\n" - + " 80: ottanta; ottant>%%with-a>;\n" - + " 90: anovanta; anovant>%%with-a>;\n" - + " 100: acento; acent[>%%with-o>];\n" - + " 200: <%%with-a%%with-o>];\n" - + " 1000: amille; amill[>%%with-i>];\n" - + " 2000: <%%with-a%%with-a>];\n" - + " 100,000: =%main=;\n" - + "%%with-i:\n" - + " izero; uno; idue; itre; iquattro; icinque; isei; isette; otto;\n" - + " inove;\n" - + " idieci; undici; idodici; itredici; iquattordici; iquindici; isedici;\n" - + " idiciasette; idiciotto; idiciannove;\n" - + " 20: iventi; ivent>%%with-i>;\n" - + " 30: itrenta; itrent>%%with-i>;\n" - + " 40: iquaranta; iquarant>%%with-a>;\n" - + " 50: icinquanta; icinquant>%%with-a>;\n" - + " 60: isessanta; isessant>%%with-a>;\n" - + " 70: isettanta; isettant>%%with-a>;\n" - + " 80: ottanta; ottant>%%with-a>;\n" - + " 90: inovanta; inovant>%%with-a>;\n" - + " 100: icento; icent[>%%with-o>];\n" - + " 200: <%%with-i%%with-o>];\n" - + " 1000: imille; imill[>%%with-i>];\n" - + " 2000: <%%with-i%%with-a>];\n" - + " 100,000: =%main=;\n" - + "%%with-o:\n" - + " ozero; uno; odue; otre; oquattro; ocinque; osei; osette; otto;\n" - + " onove;\n" - + " odieci; undici; ododici; otredici; oquattordici; oquindici; osedici;\n" - + " odiciasette; odiciotto; odiciannove;\n" - + " 20: oventi; ovent>%%with-i>;\n" - + " 30: otrenta; otrent>%%with-i>;\n" - + " 40: oquaranta; oquarant>%%with-a>;\n" - + " 50: ocinquanta; ocinquant>%%with-a>;\n" - + " 60: osessanta; osessant>%%with-a>;\n" - + " 70: osettanta; osettant>%%with-a>;\n" - + " 80: ottanta; ottant>%%with-a>;\n" - + " 90: onovanta; onovant>%%with-a>;\n" - + " 100: ocento; ocent[>%%with-o>];\n" - + " 200: <%%with-o%%with-o>];\n" - + " 1000: omille; omill[>%%with-i>];\n" - + " 2000: <%%with-o%%with-a>];\n" - + " 100,000: =%main=;\n" } - // Can someone confirm that I did the vowel-eliding thing right? I'm - // not 100% sure I'm doing it in all the right places, or completely - // correctly. Also, I don't have information for negatives and decimals, - // and I lack words fror values from 1,000,000 on up. - }; -} diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_iw.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_iw.java deleted file mode 100755 index ac39373d5d..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_iw.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/NumberFormatRules_iw.java,v $ - * $Date: 2000/03/10 04:07:28 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * RuleBasedNumberFormat data for Hebrew - * - * @author Richard Gillam - * @version $Version$ $Date: 2000/03/10 04:07:28 $ - */ -public class NumberFormatRules_iw extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - /** - * Spellout rules for Hebrew. Hebrew actually has inflected forms for - * most of the lower-order numbers. The masculine forms are shown - * here. - */ - { "SpelloutRules", - "zero (incomplete data); \u05d0\u05d4\u05d3; \u05e9\u05d2\u05d9\u05d9\u05dd; \u05e9\u05dc\u05d5\u05e9\u05d4;\n" - + "4: \u05d0\u05d3\u05d1\u05e6\u05d4; \u05d7\u05d2\u05d5\u05d9\u05e9\u05d4; \u05e9\u05e9\u05d4;\n" - + "7: \u05e9\u05d1\u05e6\u05d4; \u05e9\u05de\u05d5\u05d2\u05d4; \u05ea\u05e9\u05e6\u05d4;\n" - + "10: \u05e6\u05e9\u05d3\u05d4[ >>];\n" - + "20: \u05e6\u05e9\u05d3\u05d9\u05dd[ >>];\n" - + "30: \u05e9\u05dc\u05d5\u05e9\u05d9\u05dd[ >>];\n" - + "40: \u05d0\u05d3\u05d1\u05e6\u05d9\u05dd[ >>];\n" - + "50: \u05d7\u05de\u05d9\u05e9\u05d9\u05dd[ >>];\n" - + "60: \u05e9\u05e9\u05d9\u05dd[ >>];\n" - + "70: \u05e9\u05d1\u05e6\u05d9\u05dd[ >>];\n" - + "80: \u05e9\u05de\u05d5\u05d2\u05d9\u05dd[ >>];\n" - + "90: \u05ea\u05e9\u05e6\u05d9\u05dd[ >>];\n" - + "100: \u05de\u05d0\u05d4[ >>];\n" - + "200: << \u05de\u05d0\u05d4[ >>];\n" - + "1000: \u05d0\u05dc\u05e3[ >>];\n" - + "2000: << \u05d0\u05dc\u05e3[ >>];\n" - + "1,000,000: =#,##0= (incomplete data);" } - // This data is woefully incomplete. Can someone fill me in on the - // various inflected forms of the numbers, which seem to be necessary - // to do Hebrew correctly? Can somone supply me with data for values - // from 1,000,000 on up? What about the word for zero? What about - // information on negatives and decimals? - }; -} diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_ja.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_ja.java deleted file mode 100755 index 3d17369657..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_ja.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/NumberFormatRules_ja.java,v $ - * $Date: 2000/03/10 04:07:28 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * RuleBasedNumberFormat data for Japanese - * - * @author Richard Gillam - * @version $Version$ $Date: 2000/03/10 04:07:28 $ - */ -public class NumberFormatRules_ja extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - /** - * Spellout rules for Japanese. In Japanese, there really isn't any - * distinction between a number written out in digits and a number - * written out in words: the ideographic characters are both digits - * and words. This rule set provides two variants: %traditional - * uses the traditional CJK numerals (which are also used in China - * and Korea). %financial uses alternate ideographs for many numbers - * that are harder to alter than the traditional numerals (one could - * fairly easily change a one to - * a three just by adding two strokes, for example). This is also done in - * the other countries using Chinese idographs, but different ideographs - * are used in those places. - */ - { "SpelloutRules", - "%financial:\n" - + " \u96f6; \u58f1; \u5f10; \u53c2; \u56db; \u4f0d; \u516d; \u4e03; \u516b; \u4e5d;\n" - + " \u62fe[>>];\n" - + " 20: <<\u62fe[>>];\n" - + " 100: <<\u767e[>>];\n" - + " 1000: <<\u5343[>>];\n" - + " 10,000: <<\u4e07[>>];\n" - + " 100,000,000: <<\u5104[>>];\n" - + " 1,000,000,000,000: <<\u5146[>>];\n" - + " 10,000,000,000,000,000: =#,##0=;\n" - + "%traditional:\n" - + " \u96f6; \u4e00; \u4e8c; \u4e09; \u56db; \u4e94; \u516d; \u4e03; \u516b; \u4e5d;\n" - + " \u5341[>>];\n" - + " 20: <<\u5341[>>];\n" - + " 100: <<\u767e[>>];\n" - + " 1000: <<\u5343[>>];\n" - + " 10,000: <<\u4e07[>>];\n" - + " 100,000,000: <<\u5104[>>];\n" - + " 1,000,000,000,000: <<\u5146[>>];\n" - + " 10,000,000,000,000,000: =#,##0=;" } - // Can someone supply me with the right fraud-proof ideographs for - // Simplified and Traditional Chinese, and for Korean? Can someone - // supply me with information on negatives and decimals? - }; -} diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_nl.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_nl.java deleted file mode 100755 index d27ec6027e..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_nl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/NumberFormatRules_nl.java,v $ - * $Date: 2000/03/10 04:07:29 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * RuleBasedNumberFormat data for Dutch - * - * @author Richard Gillam - * @version $Version$ $Date: 2000/03/10 04:07:29 $ - */ -class NumberFormatRules_nl extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - /** - * Spellout rules for Swedish. - */ - { "SpelloutRules", - " -x: min >>;\n" - + "x.x: << komma >>;\n" - + "(zero?); een; twee; drie; vier; vijf; zes; zeven; acht; negen;\n" - + "tien; elf; twaalf; dertien; veertien; vijftien; zestien;\n" - + "zeventien; achtien; negentien;\n" - + "20: [>> en ]twintig;\n" - + "30: [>> en ]dertig;\n" - + "40: [>> en ]veertig;\n" - + "50: [>> en ]vijftig;\n" - + "60: [>> en ]zestig;\n" - + "70: [>> en ]zeventig;\n" - + "80: [>> en ]tachtig;\n" - + "90: [>> en ]negentig;\n" - + "100: << honderd[ >>];\n" - + "1000: << duizend[ >>];\n" - + "1,000,000: << miljoen[ >>];\n" - + "1,000,000,000: << biljoen[ >>];\n" - + "1,000,000,000,000: =#,##0=" } - // can someone supply me with information on negatives and decimals? - }; -} diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_ru.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_ru.java deleted file mode 100755 index 3ab07cd084..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_ru.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/NumberFormatRules_ru.java,v $ - * $Date: 2000/03/10 04:07:29 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * RuleBasedNumberFormat data for Russian - * - * @author Richard Gillam - * @version $Version$ $Date: 2000/03/10 04:07:29 $ - */ -public class NumberFormatRules_ru extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - /** - * Spellout rules for Russian. - */ - { "SpelloutRules", - "\u043d\u043e\u043b\u044c; \u043e\u0434\u0438\u043d; \u0434\u0432\u0430; \u0442\u0440\u0438; " - + "\u0447\u0435\u0442\u044b\u0440\u0435; \u043f\u044f\u0442; \u0448\u0435\u0441\u0442; " - + "\u0441\u0435\u043c\u044c; \u0432\u043e\u0441\u0435\u043c\u044c; \u0434\u0435\u0432\u044f\u0442;\n" - + "10: \u0434\u0435\u0441\u044f\u0442; " - + "\u043e\u0434\u0438\u043d\u043d\u0430\u0434\u0446\u0430\u0442\u044c;\n" - + "\u0434\u0432\u0435\u043d\u043d\u0430\u0434\u0446\u0430\u0442\u044c; " - + "\u0442\u0440\u0438\u043d\u0430\u0434\u0446\u0430\u0442\u044c; " - + "\u0447\u0435\u0442\u044b\u0440\u043d\u0430\u0434\u0446\u0430\u0442\u044c;\n" - + "15: \u043f\u044f\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u044c; " - + "\u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u044c; " - + "\u0441\u0435\u043c\u043d\u0430\u0434\u0446\u0430\u0442\u044c; " - + "\u0432\u043e\u0441\u0435\u043c\u043d\u0430\u0434\u0446\u0430\u0442\u044c; " - + "\u0434\u0435\u0432\u044f\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u044c;\n" - + "20: \u0434\u0432\u0430\u0434\u0446\u0430\u0442\u044c[ >>];\n" - + "30: \u0442\u0440\u043b\u0434\u0446\u0430\u0442\u044c[ >>];\n" - + "40: \u0441\u043e\u0440\u043e\u043a[ >>];\n" - + "50: \u043f\u044f\u0442\u044c\u0434\u0435\u0441\u044f\u0442[ >>];\n" - + "60: \u0448\u0435\u0441\u0442\u044c\u0434\u0435\u0441\u044f\u0442[ >>];\n" - + "70: \u0441\u0435\u043c\u044c\u0434\u0435\u0441\u044f\u0442[ >>];\n" - + "80: \u0432\u043e\u0441\u0435\u043c\u044c\u0434\u0435\u0441\u044f\u0442[ >>];\n" - + "90: \u0434\u0435\u0432\u044f\u043d\u043e\u0441\u0442\u043e[ >>];\n" - + "100: \u0441\u0442\u043e[ >>];\n" - + "200: << \u0441\u0442\u043e[ >>];\n" - + "1000: \u0442\u044b\u0441\u044f\u0447\u0430[ >>];\n" - + "2000: << \u0442\u044b\u0441\u044f\u0447\u0430[ >>];\n" - + "1,000,000: \u043c\u0438\u043b\u043b\u0438\u043e\u043d[ >>];\n" - + "2,000,000: << \u043c\u0438\u043b\u043b\u0438\u043e\u043d[ >>];\n" - + "1,000,000,000: =#,##0=;" } - // Can someone supply me with information on negatives and decimals? - // How about words for billions and trillions? - }; -} diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_sv.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_sv.java deleted file mode 100755 index f851486855..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_sv.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/NumberFormatRules_sv.java,v $ - * $Date: 2001/11/12 20:02:26 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ - -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * RuleBasedNumberFormat data for Swedish - * - * @author Richard Gillam - * @version $Version$ $Date: 2001/11/12 20:02:26 $ - */ -public class NumberFormatRules_sv extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a91997-1998 IBM Corp. All rights reserved."; - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - /** - * Spellout rules for Swedish. - * Thanks to Kent Karlsson for cleaning up these rules. - */ - { "SpelloutRules", - "%year:\n" - + "=%neutrum=;\n" - + "1000>: <%neutrum>];\n" - + "10,000: =%neutrum=;\n" - // the same as default except we change the one's digit, wish there were a better way - + "%neutrum:\n" - + "-x: minus >>;\n" - + "x.x: << komma >>;\n" - + "noll; ett; tv\u00e5; tre; fyra; fem; sex; sju; \u00e5tta; nio;\n" - + "tio; elva; tolv; tretton; fjorton; femton; sexton; sjutton; arton; nitton;\n" - + "20: tjugo[>>];\n" - + "30: trettio[>>];\n" - + "40: fyrtio[>>];\n" - + "50: femtio[>>];\n" - + "60: sextio[>>];\n" - + "70: sjuttio[>>];\n" - + "80: \u00e5ttio[>>];\n" - + "90: nittio[>>];\n" - + "100: <>];\n" - + "1000: ettusen[ >>];\n" - + "2000: <%default<\u00adtusen[ >>];\n" - + "1,000,000: en miljon[ >>];\n" - + "2,000,000: <%default< miljoner[ >>];\n" - + "1,000,000,000: en miljard[ >>];\n" - + "2,000,000,000: <%default< miljarder[ >>];\n" - + "1,000,000,000,000: en biljon[ >>];\n" - + "2,000,000,000,000: <%default< biljoner[ >>];\n" - + "1,000,000,000,000,000: en triljon[ >>];\n" - + "2,000,000,000,000,000: <%default< triljoner[ >>];\n" - + "1,000,000,000,000,000,000: =#,##0=;\n" - + "%default:\n" - + "-x: minus >>;\n" - + "x.x: << komma >>;\n" - + "noll; en; tv\u00e5; tre; fyra; fem; sex; sju; \u00e5tta; nio;\n" - + "tio; elva; tolv; tretton; fjorton; femton; sexton; sjutton; arton; nitton;\n" - + "20: tjugo[>>];\n" - + "30: trettio[>>];\n" - + "40: fyrtio[>>];\n" - + "50: femtio[>>];\n" - + "60: sextio[>>];\n" - + "70: sjuttio[>>];\n" - + "80: \u00e5ttio[>>];\n" - + "90: nittio[>>];\n" - + "100: etthundra[\u00ad>>];\n" - + "200: <>];\n" - + "1000: ettusen[ >>];\n" - + "2000: <<\u00adtusen[ >>];\n" - + "1,000,000: en miljon[ >>];\n" - + "2,000,000: << miljoner[ >>];\n" - + "1,000,000,000: en miljard[ >>];\n" - + "2,000,000,000: << miljarder[ >>];\n" - + "1,000,000,000,000: en biljon[ >>];\n" - + "2,000,000,000,000: << biljoner[ >>];\n" - + "1,000,000,000,000,000: en triljon[ >>];\n" - + "2,000,000,000,000,000: << triljoner[ >>];\n" - + "1,000,000,000,000,000,000: =#,##0=;\n" -/* - * Current implementation can't handle these magnitudes) - + "1,000,000,000,000,000,000: en triljard[ >>];\n" - + "2,000,000,000,000,000,000: << triljarder[ >>];\n" - + "1,000,000,000,000,000,000,000: en kvartiljon[ >>];\n" - + "2,000,000,000,000,000,000,000: << kvartiljoner[ >>];\n" - + "1,000,000,000,000,000,000,000,000: en kvartiljard[ >>];\n" - + "2,000,000,000,000,000,000,000,000: << kvartiljarder[ >>];\n" - + "1,000,000,000,000,000,000,000,000,000: en kvintiljon[ >>];\n" - + "2,000,000,000,000,000,000,000,000,000: << kvintiljoner[ >>];\n" - + "1,000,000,000,000,000,000,000,000,000,000: en kvintiljard[ >>];\n" - + "2,000,000,000,000,000,000,000,000,000,000: << kvintiljarder[ >>];\n" - + "1,000,000,000,000,000,000,000,000,000,000,000: en sextiljon[ >>];\n" - + "2,000,000,000,000,000,000,000,000,000,000,000: << sextiljoner[ >>];\n" - + "1,000,000,000,000,000,000,000,000,000,000,000,000: en sextiljard[ >>];\n" - + "2,000,000,000,000,000,000,000,000,000,000,000,000: << sextiljarder[ >>];\n" - + "1,000,000,000,000,000,000,000,000,000,000,000,000,000: =#,##0=" -*/ - } - }; -} diff --git a/icu4j/src/com/ibm/text/resources/NumberFormatRules_th.java b/icu4j/src/com/ibm/text/resources/NumberFormatRules_th.java deleted file mode 100755 index b33aef2878..0000000000 --- a/icu4j/src/com/ibm/text/resources/NumberFormatRules_th.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.ibm.text.resources; - -import java.util.ListResourceBundle; - -/** - * Default RuleBasedNumberFormat data for Thai. - * - * @author Suwit - */ -public class NumberFormatRules_th extends ListResourceBundle { - /** - * Puts a copyright in the .class file - */ - private static final String copyrightNotice - = "Copyright \u00a92001 IBM Corp. All rights reserved."; - - public Object[][] getContents() { - return contents; - } - - Object[][] contents = { - { "SpelloutRules", - "%default:\n" - + " -x: \u0e25\u0e1a>>;\n" - + " x.x: <<\u0e08\u0e38\u0e14>>>;\n" - + " \u0e28\u0e39\u0e19\u0e22\u0e4c; \u0e2b\u0e19\u0e36\u0e48\u0e07; \u0e2a\u0e2d\u0e07; \u0e2a\u0e32\u0e21;\n" - + " \u0e2a\u0e35\u0e48; \u0e2b\u0e49\u0e32; \u0e2b\u0e01; \u0e40\u0e08\u0e47\u0e14; \u0e41\u0e1b\u0e14;\n" - + " \u0e40\u0e01\u0e49\u0e32; \u0e2a\u0e34\u0e1a; \u0e2a\u0e34\u0e1a\u0e40\u0e2d\u0e47\u0e14;\n" - + " \u0e2a\u0e34\u0e1a\u0e2a\u0e2d\u0e07; \u0e2a\u0e34\u0e1a\u0e2a\u0e32\u0e21;\n" - + " \u0e2a\u0e34\u0e1a\u0e2a\u0e35\u0e48; \u0e2a\u0e34\u0e1a\u0e2b\u0e49\u0e32;\n" - + " \u0e2a\u0e34\u0e1a\u0e2b\u0e01; \u0e2a\u0e34\u0e1a\u0e40\u0e08\u0e47\u0e14;\n" - + " \u0e2a\u0e34\u0e1a\u0e41\u0e1b\u0e14; \u0e2a\u0e34\u0e1a\u0e40\u0e01\u0e49\u0e32;\n" - + " 20: \u0e22\u0e35\u0e48\u0e2a\u0e34\u0e1a[>%%alt-ones>];\n" - + " 30: \u0e2a\u0e32\u0e21\u0e2a\u0e34\u0e1a[>%%alt-ones>];\n" - + " 40: \u0e2a\u0e35\u0e48\u0e2a\u0e34\u0e1a[>%%alt-ones>];\n" - + " 50: \u0e2b\u0e49\u0e32\u0e2a\u0e34\u0e1a[>%%alt-ones>];\n" - + " 60: \u0e2b\u0e01\u0e2a\u0e34\u0e1a[>%%alt-ones>];\n" - + " 70: \u0e40\u0e08\u0e47\u0e14\u0e2a\u0e34\u0e1a[>%%alt-ones>];\n" - + " 80: \u0e41\u0e1b\u0e14\u0e2a\u0e34\u0e1a[>%%alt-ones>];\n" - + " 90: \u0e40\u0e01\u0e49\u0e32\u0e2a\u0e34\u0e1a[>%%alt-ones>];\n" - + " 100: <<\u0e23\u0e49\u0e2d\u0e22[>>];\n" - + " 1000: <<\u0e1e\u0e31\u0e19[>>];\n" - + " 10000: <<\u0e2b\u0e21\u0e37\u0e48\u0e19[>>];\n" - + " 100000: <<\u0e41\u0e2a\u0e19[>>];\n" - + " 1,000,000: <<\u0e25\u0e49\u0e32\u0e19[>>];\n" - + " 1,000,000,000: <<\u0e1e\u0e31\u0e19\u0e25\u0e49\u0e32\u0e19[>>];\n" - + " 1,000,000,000,000: <<\u0e25\u0e49\u0e32\u0e19\u0e25\u0e49\u0e32\u0e19[>>];\n" - + " 1,000,000,000,000,000: =#,##0=;\n" - + "%%alt-ones:\n" - + " \u0e28\u0e39\u0e19\u0e22\u0e4c;\n" - + " \u0e40\u0e2d\u0e47\u0e14;\n" - + " =%default=;\n" - } - }; -} diff --git a/icu4j/src/com/ibm/text/resources/ResourceReader.java b/icu4j/src/com/ibm/text/resources/ResourceReader.java deleted file mode 100755 index 1a1f5de277..0000000000 --- a/icu4j/src/com/ibm/text/resources/ResourceReader.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.ibm.text.resources; -import java.io.*; - -/** - * A reader for text resource data in the current package. The - * resource data is loaded through the class loader, so it will - * typically be a file in the same directory as the *.class files, or - * a file within a JAR file in the corresponding subdirectory. The - * file must be a text file in one of the supported encodings; when the - * resource is opened by constructing a ResourceReader - * object the encoding is specified. - * - *

    Although this class has a public API, it is designed for - * internal use by classes in the com.ibm.text package. - * - * @author Alan Liu - */ -public class ResourceReader { - private BufferedReader reader; - private String resourceName; - private String encoding; // null for default encoding - private boolean isReset; // TRUE if we are at the start of the file - - /** - * Construct a reader object for the text file of the given name - * in this package, using the given encoding. - * @param resourceName the name of the text file located in this - * package - * @param encoding the encoding of the text file; if unsupported - * an exception is thrown - * @exception UnsupportedEncodingException if - * encoding is not supported by the JDK. - */ - public ResourceReader(String resourceName, String encoding) - throws UnsupportedEncodingException { - - this.resourceName = resourceName; - this.encoding = encoding; - isReset = false; - _reset(); - } - - /** - * Construct a reader object for the text file of the given name - * in this package, using the default encoding. - * @param resourceName the name of the text file located in this - * package - */ - public ResourceReader(String resourceName) { - this.resourceName = resourceName; - this.encoding = null; - isReset = false; - try { - _reset(); - } catch (UnsupportedEncodingException e) {} - } - - /** - * Read and return the next line of the file or null - * if the end of the file has been reached. - */ - public String readLine() throws IOException { - if (isReset) { - // Remove BOMs - isReset = false; - String line = reader.readLine(); - if (line.charAt(0) == '\uFFEF' || - line.charAt(0) == '\uFEFF') { - return line.substring(1); - } - return line; - } - return reader.readLine(); - } - - /** - * Reset this reader so that the next call to - * readLine() returns the first line of the file - * again. This is a somewhat expensive call, however, calling - * reset() after calling it the first time does - * nothing if readLine() has not been called in - * between. - */ - public void reset() { - try { - _reset(); - } catch (UnsupportedEncodingException e) {} - // We swallow this exception, if there is one. If the encoding is - // invalid, the constructor will have thrown this exception already and - // the caller shouldn't use the object afterwards. - } - - /** - * Reset to the start by reconstructing the stream and readers. - * We could also use mark() and reset() on the stream or reader, - * but that would cause them to keep the stream data around in - * memory. We don't want that because some of the resource files - * are large, e.g., 400k. - */ - private void _reset() throws UnsupportedEncodingException { - if (isReset) { - return; - } - InputStream is = getClass().getResourceAsStream(resourceName); - if (is == null) { - throw new IllegalArgumentException("Can't open " + resourceName); - } - InputStreamReader isr = - (encoding == null) ? new InputStreamReader(is) : - new InputStreamReader(is, encoding); - reader = new BufferedReader(isr); - isReset = true; - } -} diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Any_Accents.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Any_Accents.txt deleted file mode 100755 index 92d38d8cdd..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Any_Accents.txt +++ /dev/null @@ -1,294 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/Transliterator_Any_Accents.txt,v $ -# $Date: 2001/09/25 22:58:55 $ -# $Revision: 1.3 $ -#-------------------------------------------------------------------- - -:: NFD (NFC) ; - -# to do: make reversible - -# define special conversion characters. -# varients of this could use different characters, or set one or the other to null. - -$pre = \< ; -$post = \> ; - -# Provide keyboard equivalents for common diacritics used in transliteration - -$pre \` $post <> \u0300 ; # COMBINING GRAVE ACCENT -$pre \' $post <> \u0301 ; # COMBINING ACUTE ACCENT -$pre \^ $post <> \u0302 ; # COMBINING CIRCUMFLEX ACCENT -$pre \~ $post <> \u0303 ; # COMBINING TILDE -$pre \- $post <> \u0304 ; # COMBINING MACRON -$pre \" $post <> \u0308 ; # COMBINING DIAERESIS -$pre \* $post <> \u030A ; # COMBINING RING ABOVE -$pre \, $post <> \u0327 ; # COMBINING CEDILLA -$pre '/' $post <> \u0338 ; # COMBINING LONG SOLIDUS OVERLAY -$pre \. $post <> \u0323 ; # COMBINING DOT BELOW - -# Combine common characters - -$pre AE $post <> \u00C6 ; # LATIN CAPITAL LETTER AE -$pre ae $post <> \u00E6 ; # LATIN SMALL LETTER AE -$pre D $post <> \u00D0 ; # LATIN CAPITAL LETTER ETH -$pre d $post <> \u00F0 ; # LATIN SMALL LETTER ETH -$pre O'/' $post <> \u00D8 ; # LATIN CAPITAL LETTER O WITH STROKE -$pre o'/' $post <> \u00F8 ; # LATIN SMALL LETTER O WITH STROKE -$pre TH $post <> \u00DE ; # LATIN CAPITAL LETTER THORN -$pre th $post <> \u00FE ; # LATIN SMALL LETTER THORN -$pre OE $post <> \u0152 ; # LATIN CAPITAL LIGATURE OE -$pre oe $post <> \u0153 ; # LATIN SMALL LIGATURE OE - -$pre ss $post <> \u00DF ; # LATIN SMALL LETTER SHARP S - -$pre NG $post <> \u014A ; # LATIN CAPITAL LETTER ENG -$pre ng $post <> \u014B ; # LATIN SMALL LETTER ENG - -$pre T $post <> \u0398 ; # THETA -$pre t $post <> \u03B8 ; # THETA -$pre SH $post <> \u01A9 ; # LATIN CAPITAL LETTER ESH -$pre sh $post <> \u0283 ; # LATIN SMALL LETTER ESH -$pre ZH $post <> \u01B7 ; # LATIN CAPITAL LETTER EZH -$pre zh $post <> \u0292 ; # LATIN SMALL LETTER EZH - -$pre U $post <> \u01B1 ; # LATIN CAPITAL LETTER UPSILON -$pre u $post <> \u028A ; # LATIN SMALL LETTER UPSILON -$pre A $post <> \u018F ; # LATIN CAPITAL LETTER SCHWA -$pre a $post <> \u0259 ; # LATIN SMALL LETTER SCHWA -$pre O $post <> \u0186 ; # LATIN CAPITAL LETTER OPEN O -$pre o $post <> \u0254 ; # LATIN SMALL LETTER OPEN O -$pre E $post <> \u0190 ; # LATIN CAPITAL LETTER OPEN E -$pre e $post <> \u025B ; # LATIN SMALL LETTER OPEN E - -# three that don't have uppercases - -$pre '?' $post <> \u0294 ; # LATIN LETTER GLOTTAL STOP -$pre i $post <> \u026A ; # LATIN LETTER SMALL CAPITAL I -$pre v $post <> \u028C ; # LATIN SMALL LETTER TURNED V - -# Additional Characters that may be added in the future - -# $pre XXX $post <> \u0306 ; # COMBINING BREVE -# $pre XXX $post <> \u0307 ; # COMBINING DOT ABOVE -# $pre XXX $post <> \u0309 ; # COMBINING HOOK ABOVE -# $pre XXX $post <> \u030B ; # COMBINING DOUBLE ACUTE ACCENT -# $pre XXX $post <> \u030C ; # COMBINING CARON -# $pre XXX $post <> \u030F ; # COMBINING DOUBLE GRAVE ACCENT -# $pre XXX $post <> \u0311 ; # COMBINING INVERTED BREVE -# $pre XXX $post <> \u0313 ; # COMBINING COMMA ABOVE -# $pre XXX $post <> \u0314 ; # COMBINING REVERSED COMMA ABOVE -# $pre XXX $post <> \u031B ; # COMBINING HORN -# $pre XXX $post <> \u0324 ; # COMBINING DIAERESIS BELOW -# $pre XXX $post <> \u0325 ; # COMBINING RING BELOW -# $pre XXX $post <> \u0326 ; # COMBINING COMMA BELOW -# $pre XXX $post <> \u0328 ; # COMBINING OGONEK -# $pre XXX $post <> \u032D ; # COMBINING CIRCUMFLEX ACCENT BELOW -# $pre XXX $post <> \u032E ; # COMBINING BREVE BELOW -# $pre XXX $post <> \u0330 ; # COMBINING TILDE BELOW -# $pre XXX $post <> \u0331 ; # COMBINING MACRON BELOW - -# $pre YYY $post <> \u00AA ; # FEMININE ORDINAL INDICATOR -# $pre YYY $post <> \u00BA ; # MASCULINE ORDINAL INDICATOR -# $pre YYY $post <> \u0110 ; # LATIN CAPITAL LETTER D WITH STROKE -# $pre YYY $post <> \u0111 ; # LATIN SMALL LETTER D WITH STROKE -# $pre YYY $post <> \u0126 ; # LATIN CAPITAL LETTER H WITH STROKE -# $pre YYY $post <> \u0127 ; # LATIN SMALL LETTER H WITH STROKE -# $pre YYY $post <> \u0131 ; # LATIN SMALL LETTER DOTLESS I -# $pre YYY $post <> \u0138 ; # LATIN SMALL LETTER KRA -# $pre YYY $post <> \u013F ; # LATIN CAPITAL LETTER L WITH MIDDLE DOT -# $pre YYY $post <> \u0140 ; # LATIN SMALL LETTER L WITH MIDDLE DOT -# $pre YYY $post <> \u0141 ; # LATIN CAPITAL LETTER L WITH STROKE -# $pre YYY $post <> \u0142 ; # LATIN SMALL LETTER L WITH STROKE -# $pre YYY $post <> \u0149 ; # LATIN SMALL LETTER N PRECEDED BY APOSTROPHE -# $pre YYY $post <> \u0166 ; # LATIN CAPITAL LETTER T WITH STROKE -# $pre YYY $post <> \u0167 ; # LATIN SMALL LETTER T WITH STROKE -# $pre YYY $post <> \u017F ; # LATIN SMALL LETTER LONG S -# $pre YYY $post <> \u0180 ; # LATIN SMALL LETTER B WITH STROKE -# $pre YYY $post <> \u0181 ; # LATIN CAPITAL LETTER B WITH HOOK -# $pre YYY $post <> \u0182 ; # LATIN CAPITAL LETTER B WITH TOPBAR -# $pre YYY $post <> \u0183 ; # LATIN SMALL LETTER B WITH TOPBAR -# $pre YYY $post <> \u0184 ; # LATIN CAPITAL LETTER TONE SIX -# $pre YYY $post <> \u0185 ; # LATIN SMALL LETTER TONE SIX -# $pre YYY $post <> \u0187 ; # LATIN CAPITAL LETTER C WITH HOOK -# $pre YYY $post <> \u0188 ; # LATIN SMALL LETTER C WITH HOOK -# $pre YYY $post <> \u0189 ; # LATIN CAPITAL LETTER AFRICAN D -# $pre YYY $post <> \u018A ; # LATIN CAPITAL LETTER D WITH HOOK -# $pre YYY $post <> \u018B ; # LATIN CAPITAL LETTER D WITH TOPBAR -# $pre YYY $post <> \u018C ; # LATIN SMALL LETTER D WITH TOPBAR -# $pre YYY $post <> \u018D ; # LATIN SMALL LETTER TURNED DELTA -# $pre YYY $post <> \u018E ; # LATIN CAPITAL LETTER REVERSED E -# $pre YYY $post <> \u0191 ; # LATIN CAPITAL LETTER F WITH HOOK -# $pre YYY $post <> \u0192 ; # LATIN SMALL LETTER F WITH HOOK -# $pre YYY $post <> \u0193 ; # LATIN CAPITAL LETTER G WITH HOOK -# $pre YYY $post <> \u0194 ; # LATIN CAPITAL LETTER GAMMA -# $pre YYY $post <> \u0195 ; # LATIN SMALL LETTER HV -# $pre YYY $post <> \u0196 ; # LATIN CAPITAL LETTER IOTA -# $pre YYY $post <> \u0197 ; # LATIN CAPITAL LETTER I WITH STROKE -# $pre YYY $post <> \u0198 ; # LATIN CAPITAL LETTER K WITH HOOK -# $pre YYY $post <> \u0199 ; # LATIN SMALL LETTER K WITH HOOK -# $pre YYY $post <> \u019A ; # LATIN SMALL LETTER L WITH BAR -# $pre YYY $post <> \u019B ; # LATIN SMALL LETTER LAMBDA WITH STROKE -# $pre YYY $post <> \u019C ; # LATIN CAPITAL LETTER TURNED M -# $pre YYY $post <> \u019D ; # LATIN CAPITAL LETTER N WITH LEFT HOOK -# $pre YYY $post <> \u019E ; # LATIN SMALL LETTER N WITH LONG RIGHT LEG -# $pre YYY $post <> \u019F ; # LATIN CAPITAL LETTER O WITH MIDDLE TILDE -# $pre YYY $post <> \u01A2 ; # LATIN CAPITAL LETTER OI -# $pre YYY $post <> \u01A3 ; # LATIN SMALL LETTER OI -# $pre YYY $post <> \u01A4 ; # LATIN CAPITAL LETTER P WITH HOOK -# $pre YYY $post <> \u01A5 ; # LATIN SMALL LETTER P WITH HOOK -# $pre YYY $post <> \u01A6 ; # LATIN LETTER YR -# $pre YYY $post <> \u01A7 ; # LATIN CAPITAL LETTER TONE TWO -# $pre YYY $post <> \u01A8 ; # LATIN SMALL LETTER TONE TWO -# $pre YYY $post <> \u01AA ; # LATIN LETTER REVERSED ESH LOOP -# $pre YYY $post <> \u01AB ; # LATIN SMALL LETTER T WITH PALATAL HOOK -# $pre YYY $post <> \u01AC ; # LATIN CAPITAL LETTER T WITH HOOK -# $pre YYY $post <> \u01AD ; # LATIN SMALL LETTER T WITH HOOK -# $pre YYY $post <> \u01AE ; # LATIN CAPITAL LETTER T WITH RETROFLEX HOOK -# $pre YYY $post <> \u01B2 ; # LATIN CAPITAL LETTER V WITH HOOK -# $pre YYY $post <> \u01B3 ; # LATIN CAPITAL LETTER Y WITH HOOK -# $pre YYY $post <> \u01B4 ; # LATIN SMALL LETTER Y WITH HOOK -# $pre YYY $post <> \u01B5 ; # LATIN CAPITAL LETTER Z WITH STROKE -# $pre YYY $post <> \u01B6 ; # LATIN SMALL LETTER Z WITH STROKE -# $pre YYY $post <> \u01B8 ; # LATIN CAPITAL LETTER EZH REVERSED -# $pre YYY $post <> \u01B9 ; # LATIN SMALL LETTER EZH REVERSED -# $pre YYY $post <> \u01BA ; # LATIN SMALL LETTER EZH WITH TAIL -# $pre YYY $post <> \u01BB ; # LATIN LETTER TWO WITH STROKE -# $pre YYY $post <> \u01BC ; # LATIN CAPITAL LETTER TONE FIVE -# $pre YYY $post <> \u01BD ; # LATIN SMALL LETTER TONE FIVE -# $pre YYY $post <> \u01BE ; # LATIN LETTER INVERTED GLOTTAL STOP WITH STROKE -# $pre YYY $post <> \u01BF ; # LATIN LETTER WYNN -# $pre YYY $post <> \u01C0 ; # LATIN LETTER DENTAL CLICK -# $pre YYY $post <> \u01C1 ; # LATIN LETTER LATERAL CLICK -# $pre YYY $post <> \u01C2 ; # LATIN LETTER ALVEOLAR CLICK -# $pre YYY $post <> \u01C3 ; # LATIN LETTER RETROFLEX CLICK -# $pre YYY $post <> \u01C4 ; # LATIN CAPITAL LETTER DZ WITH CARON -# $pre YYY $post <> \u01C5 ; # LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON -# $pre YYY $post <> \u01C6 ; # LATIN SMALL LETTER DZ WITH CARON -# $pre YYY $post <> \u01C7 ; # LATIN CAPITAL LETTER LJ -# $pre YYY $post <> \u01C8 ; # LATIN CAPITAL LETTER L WITH SMALL LETTER J -# $pre YYY $post <> \u01C9 ; # LATIN SMALL LETTER LJ -# $pre YYY $post <> \u01CA ; # LATIN CAPITAL LETTER NJ -# $pre YYY $post <> \u01CB ; # LATIN CAPITAL LETTER N WITH SMALL LETTER J -# $pre YYY $post <> \u01CC ; # LATIN SMALL LETTER NJ -# $pre YYY $post <> \u01DD ; # LATIN SMALL LETTER TURNED E -# $pre YYY $post <> \u01E4 ; # LATIN CAPITAL LETTER G WITH STROKE -# $pre YYY $post <> \u01E5 ; # LATIN SMALL LETTER G WITH STROKE -# $pre YYY $post <> \u01F1 ; # LATIN CAPITAL LETTER DZ -# $pre YYY $post <> \u01F2 ; # LATIN CAPITAL LETTER D WITH SMALL LETTER Z -# $pre YYY $post <> \u01F3 ; # LATIN SMALL LETTER DZ -# $pre YYY $post <> \u01F6 ; # LATIN CAPITAL LETTER HWAIR -# $pre YYY $post <> \u01F7 ; # LATIN CAPITAL LETTER WYNN -# $pre YYY $post <> \u021C ; # LATIN CAPITAL LETTER YOGH -# $pre YYY $post <> \u021D ; # LATIN SMALL LETTER YOGH -# $pre YYY $post <> \u0222 ; # LATIN CAPITAL LETTER OU -# $pre YYY $post <> \u0223 ; # LATIN SMALL LETTER OU -# $pre YYY $post <> \u0224 ; # LATIN CAPITAL LETTER Z WITH HOOK -# $pre YYY $post <> \u0225 ; # LATIN SMALL LETTER Z WITH HOOK -# $pre YYY $post <> \u0250 ; # LATIN SMALL LETTER TURNED A -# $pre YYY $post <> \u0251 ; # LATIN SMALL LETTER ALPHA -# $pre YYY $post <> \u0252 ; # LATIN SMALL LETTER TURNED ALPHA -# $pre YYY $post <> \u0253 ; # LATIN SMALL LETTER B WITH HOOK -# $pre YYY $post <> \u0255 ; # LATIN SMALL LETTER C WITH CURL -# $pre YYY $post <> \u0256 ; # LATIN SMALL LETTER D WITH TAIL -# $pre YYY $post <> \u0257 ; # LATIN SMALL LETTER D WITH HOOK -# $pre YYY $post <> \u0258 ; # LATIN SMALL LETTER REVERSED E -# $pre YYY $post <> \u025A ; # LATIN SMALL LETTER SCHWA WITH HOOK -# $pre YYY $post <> \u025C ; # LATIN SMALL LETTER REVERSED OPEN E -# $pre YYY $post <> \u025D ; # LATIN SMALL LETTER REVERSED OPEN E WITH HOOK -# $pre YYY $post <> \u025E ; # LATIN SMALL LETTER CLOSED REVERSED OPEN E -# $pre YYY $post <> \u025F ; # LATIN SMALL LETTER DOTLESS J WITH STROKE -# $pre YYY $post <> \u0260 ; # LATIN SMALL LETTER G WITH HOOK -# $pre YYY $post <> \u0261 ; # LATIN SMALL LETTER SCRIPT G -# $pre YYY $post <> \u0262 ; # LATIN LETTER SMALL CAPITAL G -# $pre YYY $post <> \u0263 ; # LATIN SMALL LETTER GAMMA -# $pre YYY $post <> \u0264 ; # LATIN SMALL LETTER RAMS HORN -# $pre YYY $post <> \u0265 ; # LATIN SMALL LETTER TURNED H -# $pre YYY $post <> \u0266 ; # LATIN SMALL LETTER H WITH HOOK -# $pre YYY $post <> \u0267 ; # LATIN SMALL LETTER HENG WITH HOOK -# $pre YYY $post <> \u0268 ; # LATIN SMALL LETTER I WITH STROKE -# $pre YYY $post <> \u0269 ; # LATIN SMALL LETTER IOTA -# $pre YYY $post <> \u026B ; # LATIN SMALL LETTER L WITH MIDDLE TILDE -# $pre YYY $post <> \u026C ; # LATIN SMALL LETTER L WITH BELT -# $pre YYY $post <> \u026D ; # LATIN SMALL LETTER L WITH RETROFLEX HOOK -# $pre YYY $post <> \u026E ; # LATIN SMALL LETTER LEZH -# $pre YYY $post <> \u026F ; # LATIN SMALL LETTER TURNED M -# $pre YYY $post <> \u0270 ; # LATIN SMALL LETTER TURNED M WITH LONG LEG -# $pre YYY $post <> \u0271 ; # LATIN SMALL LETTER M WITH HOOK -# $pre YYY $post <> \u0272 ; # LATIN SMALL LETTER N WITH LEFT HOOK -# $pre YYY $post <> \u0273 ; # LATIN SMALL LETTER N WITH RETROFLEX HOOK -# $pre YYY $post <> \u0274 ; # LATIN LETTER SMALL CAPITAL N -# $pre YYY $post <> \u0275 ; # LATIN SMALL LETTER BARRED O -# $pre YYY $post <> \u0276 ; # LATIN LETTER SMALL CAPITAL OE -# $pre YYY $post <> \u0277 ; # LATIN SMALL LETTER CLOSED OMEGA -# $pre YYY $post <> \u0278 ; # LATIN SMALL LETTER PHI -# $pre YYY $post <> \u0279 ; # LATIN SMALL LETTER TURNED R -# $pre YYY $post <> \u027A ; # LATIN SMALL LETTER TURNED R WITH LONG LEG -# $pre YYY $post <> \u027B ; # LATIN SMALL LETTER TURNED R WITH HOOK -# $pre YYY $post <> \u027C ; # LATIN SMALL LETTER R WITH LONG LEG -# $pre YYY $post <> \u027D ; # LATIN SMALL LETTER R WITH TAIL -# $pre YYY $post <> \u027E ; # LATIN SMALL LETTER R WITH FISHHOOK -# $pre YYY $post <> \u027F ; # LATIN SMALL LETTER REVERSED R WITH FISHHOOK -# $pre YYY $post <> \u0280 ; # LATIN LETTER SMALL CAPITAL R -# $pre YYY $post <> \u0281 ; # LATIN LETTER SMALL CAPITAL INVERTED R -# $pre YYY $post <> \u0282 ; # LATIN SMALL LETTER S WITH HOOK -# $pre YYY $post <> \u0284 ; # LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK -# $pre YYY $post <> \u0285 ; # LATIN SMALL LETTER SQUAT REVERSED ESH -# $pre YYY $post <> \u0286 ; # LATIN SMALL LETTER ESH WITH CURL -# $pre YYY $post <> \u0287 ; # LATIN SMALL LETTER TURNED T -# $pre YYY $post <> \u0288 ; # LATIN SMALL LETTER T WITH RETROFLEX HOOK -# $pre YYY $post <> \u0289 ; # LATIN SMALL LETTER U BAR -# $pre YYY $post <> \u028B ; # LATIN SMALL LETTER V WITH HOOK -# $pre YYY $post <> \u028D ; # LATIN SMALL LETTER TURNED W -# $pre YYY $post <> \u028E ; # LATIN SMALL LETTER TURNED Y -# $pre YYY $post <> \u028F ; # LATIN LETTER SMALL CAPITAL Y -# $pre YYY $post <> \u0290 ; # LATIN SMALL LETTER Z WITH RETROFLEX HOOK -# $pre YYY $post <> \u0291 ; # LATIN SMALL LETTER Z WITH CURL -# $pre YYY $post <> \u0293 ; # LATIN SMALL LETTER EZH WITH CURL -# $pre YYY $post <> \u0294 ; # LATIN LETTER GLOTTAL STOP -# $pre YYY $post <> \u0295 ; # LATIN LETTER PHARYNGEAL VOICED FRICATIVE -# $pre YYY $post <> \u0296 ; # LATIN LETTER INVERTED GLOTTAL STOP -# $pre YYY $post <> \u0297 ; # LATIN LETTER STRETCHED C -# $pre YYY $post <> \u0298 ; # LATIN LETTER BILABIAL CLICK -# $pre YYY $post <> \u0299 ; # LATIN LETTER SMALL CAPITAL B -# $pre YYY $post <> \u029A ; # LATIN SMALL LETTER CLOSED OPEN E -# $pre YYY $post <> \u029B ; # LATIN LETTER SMALL CAPITAL G WITH HOOK -# $pre YYY $post <> \u029C ; # LATIN LETTER SMALL CAPITAL H -# $pre YYY $post <> \u029D ; # LATIN SMALL LETTER J WITH CROSSED-TAIL -# $pre YYY $post <> \u029E ; # LATIN SMALL LETTER TURNED K -# $pre YYY $post <> \u029F ; # LATIN LETTER SMALL CAPITAL L -# $pre YYY $post <> \u02A0 ; # LATIN SMALL LETTER Q WITH HOOK -# $pre YYY $post <> \u02A1 ; # LATIN LETTER GLOTTAL STOP WITH STROKE -# $pre YYY $post <> \u02A2 ; # LATIN LETTER REVERSED GLOTTAL STOP WITH STROKE -# $pre YYY $post <> \u02A3 ; # LATIN SMALL LETTER DZ DIGRAPH -# $pre YYY $post <> \u02A4 ; # LATIN SMALL LETTER DEZH DIGRAPH -# $pre YYY $post <> \u02A5 ; # LATIN SMALL LETTER DZ DIGRAPH WITH CURL -# $pre YYY $post <> \u02A6 ; # LATIN SMALL LETTER TS DIGRAPH -# $pre YYY $post <> \u02A7 ; # LATIN SMALL LETTER TESH DIGRAPH -# $pre YYY $post <> \u02A8 ; # LATIN SMALL LETTER TC DIGRAPH WITH CURL -# $pre YYY $post <> \u02A9 ; # LATIN SMALL LETTER FENG DIGRAPH -# $pre YYY $post <> \u02AA ; # LATIN SMALL LETTER LS DIGRAPH -# $pre YYY $post <> \u02AB ; # LATIN SMALL LETTER LZ DIGRAPH -# $pre YYY $post <> \u02AC ; # LATIN LETTER BILABIAL PERCUSSIVE -# $pre YYY $post <> \u02AD ; # LATIN LETTER BIDENTAL PERCUSSIVE -# $pre YYY $post <> \u02B0 ; # MODIFIER LETTER SMALL H -# $pre YYY $post <> \u02B1 ; # MODIFIER LETTER SMALL H WITH HOOK -# $pre YYY $post <> \u02B2 ; # MODIFIER LETTER SMALL J -# $pre YYY $post <> \u02B3 ; # MODIFIER LETTER SMALL R -# $pre YYY $post <> \u02B4 ; # MODIFIER LETTER SMALL TURNED R -# $pre YYY $post <> \u02B5 ; # MODIFIER LETTER SMALL TURNED R WITH HOOK -# $pre YYY $post <> \u02B6 ; # MODIFIER LETTER SMALL CAPITAL INVERTED R -# $pre YYY $post <> \u02B7 ; # MODIFIER LETTER SMALL W -# $pre YYY $post <> \u02B8 ; # MODIFIER LETTER SMALL Y -# $pre YYY $post <> \u02E0 ; # MODIFIER LETTER SMALL GAMMA -# $pre YYY $post <> \u02E1 ; # MODIFIER LETTER SMALL L -# $pre YYY $post <> \u02E2 ; # MODIFIER LETTER SMALL S -# $pre YYY $post <> \u02E3 ; # MODIFIER LETTER SMALL X -# $pre YYY $post <> \u02E4 ; # MODIFIER LETTER SMALL REVERSED GLOTTAL STOP -# $pre YYY $post <> \u1E9A ; # LATIN SMALL LETTER A WITH RIGHT HALF RING -# $pre YYY $post <> \u207F ; # SUPERSCRIPT LATIN SMALL LETTER N - -:: NFC (NFD) ; \ No newline at end of file diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Any_Publishing.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Any_Publishing.txt deleted file mode 100755 index fd064edf5e..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Any_Publishing.txt +++ /dev/null @@ -1,38 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/Transliterator_Any_Publishing.txt,v $ -# $Date: 2001/10/23 00:23:46 $ -# $Revision: 1.4 $ -#-------------------------------------------------------------------- - -# Test case -# "The" "(quick)" ('brown') `fox' ` jumped -- "over?" - -# Variables - -$single = \' ; -$space = ' ' ; -$double = \" ; -$back = \` ; -$tab = '\u0008' ; -$makeRight = [[:Z:][:Ps:][:Pi:]$] ; - -# fix UNIX quotes - -$back $back > “ ; -$back > ‘ ; - -# fix typewriter quotes, by context - -$makeRight {$double} <> “ ; -$double <> †; - -$makeRight {$single} <> ‘ ; -$single <> ’; - -# fix multiple spaces and hyphens - -$space {$space} > ; -'--' <> — ; diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Bengali_InterIndic.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Bengali_InterIndic.txt deleted file mode 100755 index 32ba36fa78..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Bengali_InterIndic.txt +++ /dev/null @@ -1,107 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Bengali_InterIndic -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:41:57 2001 -#-------------------------------------------------------------------- -# Bengali-InterIndic -#:: NFD (NFC) ; -\u09C7\u09BE>\uE04B; # VOWEL SIGN O -\u09C7\u09D7>\uE04C; # VOWEL SIGN AU -\u0981>\uE001; # SIGN CANDRABINDU -\u0982>\uE002; # SIGN ANUSVARA -\u0983>\uE003; # SIGN VISARGA -\u0985>\uE005; # LETTER A -\u0986>\uE006; # LETTER AA -\u0987>\uE007; # LETTER I -\u0988>\uE008; # LETTER II -\u0989>\uE009; # LETTER U -\u098A>\uE00A; # LETTER UU -\u098B>\uE00B; # LETTER VOCALIC R -\u098C>\uE00C; # LETTER VOCALIC L -\u098F>\uE00F; # LETTER E -\u0990>\uE010; # LETTER AI -\u0993>\uE013; # LETTER O -\u0994>\uE014; # LETTER AU -\u0995>\uE015; # LETTER KA -\u0996>\uE016; # LETTER KHA -\u0997>\uE017; # LETTER GA -\u0998>\uE018; # LETTER GHA -\u0999>\uE019; # LETTER NGA -\u099A>\uE01A; # LETTER CA -\u099B>\uE01B; # LETTER CHA -\u099C>\uE01C; # LETTER JA -\u099D>\uE01D; # LETTER JHA -\u099E>\uE01E; # LETTER NYA -\u099F>\uE01F; # LETTER TTA -\u09A0>\uE020; # LETTER TTHA -\u09A1>\uE021; # LETTER DDA -\u09A2>\uE022; # LETTER DDHA -\u09A3>\uE023; # LETTER NNA -\u09A4>\uE024; # LETTER TA -\u09A5>\uE025; # LETTER THA -\u09A6>\uE026; # LETTER DA -\u09A7>\uE027; # LETTER DHA -\u09A8>\uE028; # LETTER NA -\u09AA>\uE02A; # LETTER PA -\u09AB>\uE02B; # LETTER PHA -\u09AC>\uE02C; # LETTER BA -\u09AD>\uE02D; # LETTER BHA -\u09AE>\uE02E; # LETTER MA -\u09AF>\uE02F; # LETTER YA -\u09B0>\uE030; # LETTER RA -\u09B2>\uE032; # LETTER LA -\u09B6>\uE036; # LETTER SHA -\u09B7>\uE037; # LETTER SSA -\u09B8>\uE038; # LETTER SA -\u09B9>\uE039; # LETTER HA -\u09BC>\uE03C; # SIGN NUKTA -\u09BE>\uE03E; # VOWEL SIGN AA -\u09BF>\uE03F; # VOWEL SIGN I -\u09C0>\uE040; # VOWEL SIGN II -\u09C1>\uE041; # VOWEL SIGN U -\u09C2>\uE042; # VOWEL SIGN UU -\u09C3>\uE043; # VOWEL SIGN VOCALIC R -\u09C4>\uE044; # VOWEL SIGN VOCALIC RR -\u09C7>\uE047; # VOWEL SIGN E -\u09C8>\uE048; # VOWEL SIGN AI -\u09CB>\uE04B; -\u09CC>\uE04C; -# -\u09CD>\uE04D; # SIGN VIRAMA -\u09D7>\uE057; # AU LENGTH MARK -# -\u09E0>\uE060; # LETTER VOCALIC RR -\u09E1>\uE061; # LETTER VOCALIC LL -\u09E2>\uE062; # VOWEL SIGN VOCALIC L -\u09E3>\uE063; # VOWEL SIGN VOCALIC LL -\u09E6>\uE066; # DIGIT ZERO -\u09E7>\uE067; # DIGIT ONE -\u09E8>\uE068; # DIGIT TWO -\u09E9>\uE069; # DIGIT THREE -\u09EA>\uE06A; # DIGIT FOUR -\u09EB>\uE06B; # DIGIT FIVE -\u09EC>\uE06C; # DIGIT SIX -\u09ED>\uE06D; # DIGIT SEVEN -\u09EE>\uE06E; # DIGIT EIGHT -\u09EF>\uE06F; # DIGIT NINE -\u09F0>\uE070; # UNMAPPED Bengali-InterIndic: LETTER RA WITH MIDDLE DIAGONAL -\u09F1>\uE071; # UNMAPPED Bengali-InterIndic: LETTER RA WITH LOWER DIAGONAL -\u09F2>; # UNMAPPED Bengali-InterIndic: RUPEE MARK -\u09F3>; # UNMAPPED Bengali-InterIndic: RUPEE SIGN -\u09F4>; # UNMAPPED Bengali-InterIndic: CURRENCY NUMERATOR ONE -\u09F5>; # UNMAPPED Bengali-InterIndic: CURRENCY NUMERATOR TWO -\u09F6>; # UNMAPPED Bengali-InterIndic: CURRENCY NUMERATOR THREE -\u09F7>; # UNMAPPED Bengali-InterIndic: CURRENCY NUMERATOR FOUR -\u09F8>; # UNMAPPED Bengali-InterIndic: CURRENCY NUMERATOR ONE LESS THAN THE DENOMINATOR -\u09F9>; # UNMAPPED Bengali-InterIndic: CURRENCY DENOMINATOR SIXTEEN -\u09FA>\uE070; # ISSHAR -\u0964>\ue064; # DANDA -\u0965>\ue065; # DOUBLE DANDA -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Cyrillic_Latin.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Cyrillic_Latin.txt deleted file mode 100755 index b9231e77f1..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Cyrillic_Latin.txt +++ /dev/null @@ -1,310 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/Transliterator_Cyrillic_Latin.txt,v $ -# $Date: 2001/12/01 00:14:55 $ -# $Revision: 1.9 $ -#-------------------------------------------------------------------- -# TODO: add remaining characters -# Should add variants for Russian-English, Russian-German -# Those can use this as a base, and then remap cases -# like a $hat to ya or ja. - -# :: [\u0000-\u007E \u02B9 \u02BA [:Cyrillic:] [:Latin:] [:nonspacing mark:]] ; -### WARNING, \u0308 must be added to the generated filters, in both directions ### -# MINIMAL FILTER -:: [\u0308\u0102-\u0103\u0114-\u0115\u011E-\u011F\u012C-\u012D\u014E-\u014F\u016C-\u016D\u0306\u0400-\u045F\u0490-\u0495\u0498-\u0499\u04C1-\u04C2\u04D0-\u04DF\u04E2-\u04E7\u04EC-\u04F5\u04F8-\u04F9\u1E1C-\u1E1D\u1EAE-\u1EB7\u1FB0\u1FB8\u1FD0\u1FD8\u1FE0\u1FE8] ; -:: NFD (NFC) ; - -$modprime = \u02B9; -$modprime2 = \u02BA; - -$grave = \u0300; -$acute = \u0301; -$hat = \u0302; -$breve = \u0306 ; -$dot = \u0307 ; -$caron = \u030C ; -$comma = \u0326 ; -$under = \u0331 ; - -# move up so not masked - -Ñ <> a $hat ; # CYRILLIC SMALL LETTER YA -Я <> A $hat ; # CYRILLIC CAPITAL LETTER YA - -ч <> c $caron ; # CYRILLIC SMALL LETTER CHE -Ч <> C $caron; # CYRILLIC CAPITAL LETTER CHE -# Ò· <> XXX ; # CYRILLIC SMALL LETTER CHE WITH DESCENDER -# Ò¶ <> XXX ; # CYRILLIC CAPITAL LETTER CHE WITH DESCENDER -# ÓŒ <> XXX ; # CYRILLIC SMALL LETTER KHAKASSIAN CHE -# Ó‹ <> XXX ; # CYRILLIC CAPITAL LETTER KHAKASSIAN CHE -# Ò¹ <> XXX ; # CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE -# Ò¸ <> XXX ; # CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE - -Ñ <> e $acute; # CYRILLIC SMALL LETTER E -Э <> E $acute; # CYRILLIC CAPITAL LETTER E -Ñ” <> e $hat; # CYRILLIC SMALL LETTER UKRAINIAN IE -Є <> E $hat; # CYRILLIC CAPITAL LETTER UKRAINIAN IE - -ш <> s $caron ; # CYRILLIC SMALL LETTER SHA -Ш <> S $caron ; # CYRILLIC CAPITAL LETTER SHA -щ <> s $hat ; # CYRILLIC SMALL LETTER SHCHA -Щ <> S $hat; # CYRILLIC CAPITAL LETTER SHCHA - -Ñ• <> z $hat ; # CYRILLIC SMALL LETTER DZE -Ð… <> Z $hat; # CYRILLIC CAPITAL LETTER DZE -# Ó¡ <> XXX ; # CYRILLIC SMALL LETTER ABKHASIAN DZE -# Ó  <> XXX ; # CYRILLIC CAPITAL LETTER ABKHASIAN DZE - -ÑŽ <> u $hat ; # CYRILLIC SMALL LETTER YU -Ю <> U $hat ; # CYRILLIC CAPITAL LETTER YU - -Ñ– <> i $acute; # CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I -І <> I $acute; # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I -ј <> j $caron; # CYRILLIC SMALL LETTER JE -Ј <> J $caron; # CYRILLIC CAPITAL LETTER JE - -Ñ™ <> l $hat ; # CYRILLIC SMALL LETTER LJE -Љ <> L $hat ; # CYRILLIC CAPITAL LETTER LJE -Ñš <> n $hat ; # CYRILLIC SMALL LETTER NJE -Њ <> N $hat ; # CYRILLIC CAPITAL LETTER NJE - -Ñ› <> c $acute ; # CYRILLIC SMALL LETTER TSHE -Ћ <> C $acute ; # CYRILLIC CAPITAL LETTER TSHE - -ÑŸ <> d $hat ; # CYRILLIC SMALL LETTER DZHE -Ð <> D $hat ; # CYRILLIC CAPITAL LETTER DZHE - -# Normal order - -а <> a ; # CYRILLIC SMALL LETTER A -Ð <> A ; # CYRILLIC CAPITAL LETTER A -Ó™ <> \u0259 ; # CYRILLIC SMALL LETTER SCHWA -Ó˜ <> \u018F ; # CYRILLIC CAPITAL LETTER SCHWA -Ó• <> \u00E6 ; # CYRILLIC SMALL LIGATURE A IE -Ó” <> \u00C6 ; # CYRILLIC CAPITAL LIGATURE A IE -б <> b ; # CYRILLIC SMALL LETTER BE -Б <> B ; # CYRILLIC CAPITAL LETTER BE -в <> v ; # CYRILLIC SMALL LETTER VE -Ð’ <> V ; # CYRILLIC CAPITAL LETTER VE - -Ò‘ <> g $grave ; # CYRILLIC SMALL LETTER GHE WITH UPTURN -Ò <> G $grave ; # CYRILLIC CAPITAL LETTER GHE WITH UPTURN -Ò“ <> g $dot ; # CYRILLIC SMALL LETTER GHE WITH STROKE -Ò’ <> G $dot; # CYRILLIC CAPITAL LETTER GHE WITH STROKE -Ò• <> g $breve; # CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK -Ò” <> G $breve; # CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK -г <> g ; # CYRILLIC SMALL LETTER GHE -Г <> G ; # CYRILLIC CAPITAL LETTER GHE - -д <> d; # CYRILLIC SMALL LETTER DE -Д <> D; # CYRILLIC CAPITAL LETTER DE -Ñ’ <> Ä‘ ; # CYRILLIC SMALL LETTER DJE -Ђ <> Ä ; # CYRILLIC CAPITAL LETTER DJE -Ò™ <> z $comma ; # CYRILLIC SMALL LETTER ZE WITH DESCENDER -Ò˜ <> Z $comma ; # CYRILLIC CAPITAL LETTER ZE WITH DESCENDER -е <> e ; # CYRILLIC SMALL LETTER IE -Е <> E; # CYRILLIC CAPITAL LETTER IE - -ж <> z $caron; # CYRILLIC SMALL LETTER ZHE -Ж <> Z $caron; # CYRILLIC CAPITAL LETTER ZHE - -# Ò— <> XXX ; # CYRILLIC SMALL LETTER ZHE WITH DESCENDER -# Ò– <> XXX ; # CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER - -з <> z ; # CYRILLIC SMALL LETTER ZE -З <> Z; # CYRILLIC CAPITAL LETTER ZE - -й <> j ; # CYRILLIC SMALL LETTER I -Й <> J ; # CYRILLIC CAPITAL LETTER I -и <> i ; # CYRILLIC SMALL LETTER I -И <> I ; # CYRILLIC CAPITAL LETTER I - -к <> k ; # CYRILLIC SMALL LETTER KA -К <> K; # CYRILLIC CAPITAL LETTER KA - -# Ò› <> XXX ; # CYRILLIC SMALL LETTER KA WITH DESCENDER -# Òš <> XXX ; # CYRILLIC CAPITAL LETTER KA WITH DESCENDER -# Ó„ <> XXX ; # CYRILLIC SMALL LETTER KA WITH HOOK -# Óƒ <> XXX ; # CYRILLIC CAPITAL LETTER KA WITH HOOK -# Ò¡ <> XXX ; # CYRILLIC SMALL LETTER BASHKIR KA -# Ò  <> XXX ; # CYRILLIC CAPITAL LETTER BASHKIR KA -# ÒŸ <> XXX ; # CYRILLIC SMALL LETTER KA WITH STROKE -# Òž <> XXX ; # CYRILLIC CAPITAL LETTER KA WITH STROKE -# Ò <> XXX ; # CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE -# Òœ <> XXX ; # CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE -л <> l ; # CYRILLIC SMALL LETTER EL -Л <> L; # CYRILLIC CAPITAL LETTER EL - -м <> m ; # CYRILLIC SMALL LETTER EM -Ðœ <> M ; # CYRILLIC CAPITAL LETTER EM -н <> n ; # CYRILLIC SMALL LETTER EN -Ð <> N; # CYRILLIC CAPITAL LETTER EN -# Ò£ <> XXX ; # CYRILLIC SMALL LETTER EN WITH DESCENDER -# Ò¢ <> XXX ; # CYRILLIC CAPITAL LETTER EN WITH DESCENDER -# Óˆ <> XXX ; # CYRILLIC SMALL LETTER EN WITH HOOK -# Ó‡ <> XXX ; # CYRILLIC CAPITAL LETTER EN WITH HOOK -# Ò¥ <> XXX ; # CYRILLIC SMALL LIGATURE EN GHE -# Ò¤ <> XXX ; # CYRILLIC CAPITAL LIGATURE EN GHE - -о <> o ; # CYRILLIC SMALL LETTER O -О <> O ; # CYRILLIC CAPITAL LETTER O -# Ó© <> XXX ; # CYRILLIC SMALL LETTER BARRED O -# Ó¨ <> XXX ; # CYRILLIC CAPITAL LETTER BARRED O -п <> p ; # CYRILLIC SMALL LETTER PE -П <> P ; # CYRILLIC CAPITAL LETTER PE -# Ò§ <> XXX ; # CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK -# Ò¦ <> XXX ; # CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK -# Ò <> XXX ; # CYRILLIC SMALL LETTER KOPPA -# Ò€ <> XXX ; # CYRILLIC CAPITAL LETTER KOPPA -Ñ€ <> r ; # CYRILLIC SMALL LETTER ER -Р <> R ; # CYRILLIC CAPITAL LETTER ER -# Ò <> XXX ; # CYRILLIC SMALL LETTER ER WITH TICK -# ÒŽ <> XXX ; # CYRILLIC CAPITAL LETTER ER WITH TICK -Ñ <> s ; # CYRILLIC SMALL LETTER ES -С <> S ; # CYRILLIC CAPITAL LETTER ES -# Ò« <> XXX ; # CYRILLIC SMALL LETTER ES WITH DESCENDER -# Òª <> XXX ; # CYRILLIC CAPITAL LETTER ES WITH DESCENDER -Ñ‚ <> t ; # CYRILLIC SMALL LETTER TE -Т <> T ; # CYRILLIC CAPITAL LETTER TE -# Ò­ <> XXX ; # CYRILLIC SMALL LETTER TE WITH DESCENDER -# Ò¬ <> XXX ; # CYRILLIC CAPITAL LETTER TE WITH DESCENDER - -у <> u ; # CYRILLIC SMALL LETTER U -У <> U ; # CYRILLIC CAPITAL LETTER U -# Ò¯ <> XXX ; # CYRILLIC SMALL LETTER STRAIGHT U -# Ò® <> XXX ; # CYRILLIC CAPITAL LETTER STRAIGHT U -# Ò± <> XXX ; # CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE -# Ò° <> XXX ; # CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE -# ѹ <> XXX ; # CYRILLIC SMALL LETTER UK -# Ѹ <> XXX ; # CYRILLIC CAPITAL LETTER UK -Ñ„ <> f ; # CYRILLIC SMALL LETTER EF -Ф <> F ; # CYRILLIC CAPITAL LETTER EF -Ñ… <> h ; # CYRILLIC SMALL LETTER HA -Ð¥ <> H; # CYRILLIC CAPITAL LETTER HA -# Ò³ <> XXX ; # CYRILLIC SMALL LETTER HA WITH DESCENDER -# Ò² <> XXX ; # CYRILLIC CAPITAL LETTER HA WITH DESCENDER -# Ò» <> XXX ; # CYRILLIC SMALL LETTER SHHA -# Òº <> XXX ; # CYRILLIC CAPITAL LETTER SHHA -# Ñ¡ <> XXX ; # CYRILLIC SMALL LETTER OMEGA -# Ñ  <> XXX ; # CYRILLIC CAPITAL LETTER OMEGA -# Ñ¿ <> XXX ; # CYRILLIC SMALL LETTER OT -# Ѿ <> XXX ; # CYRILLIC CAPITAL LETTER OT -# ѽ <> XXX ; # CYRILLIC SMALL LETTER OMEGA WITH TITLO -# Ѽ <> XXX ; # CYRILLIC CAPITAL LETTER OMEGA WITH TITLO -# Ñ» <> XXX ; # CYRILLIC SMALL LETTER ROUND OMEGA -# Ѻ <> XXX ; # CYRILLIC CAPITAL LETTER ROUND OMEGA -ц <> c ; # CYRILLIC SMALL LETTER TSE -Ц <> C; # CYRILLIC CAPITAL LETTER TSE -# Òµ <> XXX ; # CYRILLIC SMALL LIGATURE TE TSE -# Ò´ <> XXX ; # CYRILLIC CAPITAL LIGATURE TE TSE - -# Ò½ <> XXX ; # CYRILLIC SMALL LETTER ABKHASIAN CHE -# Ò¼ <> XXX ; # CYRILLIC CAPITAL LETTER ABKHASIAN CHE -# Ò¿ <> XXX ; # CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER -# Ò¾ <> XXX ; # CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER - - -Ъ <> $modprime2 $under ; # CYRILLIC CAPITAL LETTER HARD SIGN -ÑŠ <> $modprime2 ; # CYRILLIC SMALL LETTER HARD SIGN -Ь <> $modprime $under ; # CYRILLIC CAPITAL LETTER SOFT SIGN -ÑŒ <> $modprime ; # CYRILLIC SMALL LETTER SOFT SIGN - -Ñ‹ <> y ; # CYRILLIC SMALL LETTER YERU -Ы <> Y ; # CYRILLIC CAPITAL LETTER YERU - -# Ò <> XXX ; # CYRILLIC SMALL LETTER SEMISOFT SIGN -# ÒŒ <> XXX ; # CYRILLIC CAPITAL LETTER SEMISOFT SIGN -# Ñ£ <> XXX ; # CYRILLIC SMALL LETTER YAT -# Ñ¢ <> XXX ; # CYRILLIC CAPITAL LETTER YAT - -# Ñ¥ <> XXX ; # CYRILLIC SMALL LETTER IOTIFIED E -# Ѥ <> XXX ; # CYRILLIC CAPITAL LETTER IOTIFIED E -# ѧ <> XXX ; # CYRILLIC SMALL LETTER LITTLE YUS -# Ѧ <> XXX ; # CYRILLIC CAPITAL LETTER LITTLE YUS -# Ñ« <> XXX ; # CYRILLIC SMALL LETTER BIG YUS -# Ѫ <> XXX ; # CYRILLIC CAPITAL LETTER BIG YUS -# Ñ© <> XXX ; # CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS -# Ѩ <> XXX ; # CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS -# Ñ­ <> XXX ; # CYRILLIC SMALL LETTER IOTIFIED BIG YUS -# Ѭ <> XXX ; # CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS -# ѯ <> XXX ; # CYRILLIC SMALL LETTER KSI -# Ñ® <> XXX ; # CYRILLIC CAPITAL LETTER KSI -# ѱ <> XXX ; # CYRILLIC SMALL LETTER PSI -# Ñ° <> XXX ; # CYRILLIC CAPITAL LETTER PSI -# ѳ <> XXX ; # CYRILLIC SMALL LETTER FITA -# Ѳ <> XXX ; # CYRILLIC CAPITAL LETTER FITA -# ѵ <> XXX ; # CYRILLIC SMALL LETTER IZHITSA -# Ñ´ <> XXX ; # CYRILLIC CAPITAL LETTER IZHITSA -# Ò© <> XXX ; # CYRILLIC SMALL LETTER ABKHASIAN HA -# Ò¨ <> XXX ; # CYRILLIC CAPITAL LETTER ABKHASIAN HA -# Ó€ <> XXX ; # CYRILLIC LETTER PALOCHKA -### ӑ <> XXX ; # CYRILLIC SMALL LETTER A -### Ð̆ <> XXX ; # CYRILLIC CAPITAL LETTER A -### ӓ <> XXX ; # CYRILLIC SMALL LETTER A -### Ð̈ <> XXX ; # CYRILLIC CAPITAL LETTER A -### ӛ <> XXX ; # CYRILLIC SMALL LETTER SCHWA -### Ӛ <> XXX ; # CYRILLIC CAPITAL LETTER SCHWA -### Ð³Ì <> XXX ; # CYRILLIC SMALL LETTER GHE -### Ð“Ì <> XXX ; # CYRILLIC CAPITAL LETTER GHE -### ѐ <> XXX ; # CYRILLIC SMALL LETTER IE -### Ѐ <> XXX ; # CYRILLIC CAPITAL LETTER IE -### ё <> XXX ; # CYRILLIC SMALL LETTER IE -### Ё <> XXX ; # CYRILLIC CAPITAL LETTER IE -### ӗ <> XXX ; # CYRILLIC SMALL LETTER IE -### Ӗ <> XXX ; # CYRILLIC CAPITAL LETTER IE -### ӂ <> XXX ; # CYRILLIC SMALL LETTER ZHE -### Ӂ <> XXX ; # CYRILLIC CAPITAL LETTER ZHE -### ӝ <> XXX ; # CYRILLIC SMALL LETTER ZHE -### Ӝ <> XXX ; # CYRILLIC CAPITAL LETTER ZHE -### ӟ <> XXX ; # CYRILLIC SMALL LETTER ZE -### Ӟ <> XXX ; # CYRILLIC CAPITAL LETTER ZE -### ѝ <> XXX ; # CYRILLIC SMALL LETTER I -### Ѝ <> XXX ; # CYRILLIC CAPITAL LETTER I -### ӣ <> XXX ; # CYRILLIC SMALL LETTER I -### Ӣ <> XXX ; # CYRILLIC CAPITAL LETTER I -### ӥ <> XXX ; # CYRILLIC SMALL LETTER I -### Ӥ <> XXX ; # CYRILLIC CAPITAL LETTER I -### ї <> XXX ; # CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I -### Ї <> XXX ; # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I -### ӧ <> XXX ; # CYRILLIC SMALL LETTER O -### Ӧ <> XXX ; # CYRILLIC CAPITAL LETTER O -### ӫ <> XXX ; # CYRILLIC SMALL LETTER BARRED O -### Ӫ <> XXX ; # CYRILLIC CAPITAL LETTER BARRED O -### ÐºÌ <> XXX ; # CYRILLIC SMALL LETTER KA -### ÐšÌ <> XXX ; # CYRILLIC CAPITAL LETTER KA -### ӯ <> XXX ; # CYRILLIC SMALL LETTER U -### Ӯ <> XXX ; # CYRILLIC CAPITAL LETTER U -### ў <> XXX ; # CYRILLIC SMALL LETTER U -### Ў <> XXX ; # CYRILLIC CAPITAL LETTER U -### ӱ <> XXX ; # CYRILLIC SMALL LETTER U -### Ӱ <> XXX ; # CYRILLIC CAPITAL LETTER U -### ӳ <> XXX ; # CYRILLIC SMALL LETTER U -### Ӳ <> XXX ; # CYRILLIC CAPITAL LETTER U -### ӵ <> XXX ; # CYRILLIC SMALL LETTER CHE -### Ӵ <> XXX ; # CYRILLIC CAPITAL LETTER CHE -### ӹ <> XXX ; # CYRILLIC SMALL LETTER YERU -### Ӹ <> XXX ; # CYRILLIC CAPITAL LETTER YERU -### Ñ̈ <> XXX ; # CYRILLIC SMALL LETTER E -### Ӭ <> XXX ; # CYRILLIC CAPITAL LETTER E -### ÑµÌ <> XXX ; # CYRILLIC SMALL LETTER IZHITSA -### Ñ´Ì <> XXX ; # CYRILLIC CAPITAL LETTER IZHITSA - -# Completeness -$ignore = [[:Mark:]''] * ; -| k < q ; -| K < Q ; -| u < w ; -| U < W ; -| KS < X } $ignore [:UppercaseLetter:] ; -| KS < [:UppercaseLetter:] $ignore { X ; -| Ks < X ; -| ks < x ; - -:: NFC (NFD) ; -# note: a global filter is more efficient, but MUST include all source chars!! -# :: ([\u0000-\u007E \u02B9 \u02BA [:Cyrillic:] [:Latin:] [:nonspacing mark:]]); -# MINIMAL FILTER: Latin-Cyrillic -:: ( [\u0308A-Za-z\u00C0-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u018F\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0259\u02B9-\u02BA\u0300-\u0302\u0306-\u0307\u030C\u0326\u0331\u0340-\u0341\u0344\u0374\u0385-\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AC-\u03B0\u03CC-\u03CE\u03D3\u0400\u0403\u040C-\u040E\u0419\u0439\u0450\u0453\u045C-\u045E\u04C1-\u04C2\u04D0-\u04D1\u04D6-\u04D7\u1E00-\u1E99\u1E9B\u1EA0-\u1EF9\u1F02-\u1F05\u1F0A-\u1F0D\u1F12-\u1F15\u1F1A-\u1F1D\u1F22-\u1F25\u1F2A-\u1F2D\u1F32-\u1F35\u1F3A-\u1F3D\u1F42-\u1F45\u1F4A-\u1F4D\u1F52-\u1F55\u1F5B\u1F5D\u1F62-\u1F65\u1F6A-\u1F6D\u1F70-\u1F7D\u1F82-\u1F85\u1F8A-\u1F8D\u1F92-\u1F95\u1F9A-\u1F9D\u1FA2-\u1FA5\u1FAA-\u1FAD\u1FB0\u1FB2\u1FB4\u1FB8\u1FBA-\u1FBB\u1FC2\u1FC4\u1FC8-\u1FCB\u1FCD-\u1FCE\u1FD0\u1FD2-\u1FD3\u1FD8\u1FDA-\u1FDB\u1FDD-\u1FDE\u1FE0\u1FE2-\u1FE3\u1FE8\u1FEA-\u1FEB\u1FED-\u1FEE\u1FF2\u1FF4\u1FF8-\u1FFB\u212A-\u212B] ) ; diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Devanagari_InterIndic.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Devanagari_InterIndic.txt deleted file mode 100755 index 7804599d56..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Devanagari_InterIndic.txt +++ /dev/null @@ -1,122 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Devanagari_InterIndic -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:41:57 2001 -#-------------------------------------------------------------------- -# Devanagari-InterIndic -# :: NFD; - #Rules for Decomposed characters - - - \u0901>\uE001; # SIGN CANDRABINDU - \u0902>\uE002; # SIGN ANUSVARA - \u0903>\uE003; # SIGN VISARGA - \u0905>\uE005; # LETTER A - \u0906>\uE006; # LETTER AA - \u0907>\uE007; # LETTER I - \u0908>\uE008; # LETTER II - \u0909>\uE009; # LETTER U - \u090A>\uE00A; # LETTER UU - \u090B>\uE00B; # LETTER VOCALIC R - \u090C>\uE00C; # LETTER VOCALIC L - \u090D>\uE00D; # LETTER CANDRA E (For representing English sounds) - \u090E>\uE00E; # UNMAPPED LETTER SHORT E(For Southern Scripts) - \u090F>\uE00F; # LETTER E - \u0910>\uE010; # LETTER AI - \u0911>\uE011; # LETTER CANDRA O (For representing English sounds) - \u0912>\uE012; # UNMAPPED LETTER SHORT O (For Southern Scripts) - \u0913>\uE013; # LETTER O - \u0914>\uE014; # LETTER AU - \u0915>\uE015; # LETTER KA - \u0916>\uE016; # LETTER KHA - \u0917>\uE017; # LETTER GA - \u0918>\uE018; # LETTER GHA - \u0919>\uE019; # LETTER NGA - \u091A>\uE01A; # LETTER CA - \u091B>\uE01B; # LETTER CHA - \u091C>\uE01C; # LETTER JA - \u091D>\uE01D; # LETTER JHA - \u091E>\uE01E; # LETTER NYA - \u091F>\uE01F; # LETTER TTA - \u0920>\uE020; # LETTER TTHA - \u0921>\uE021; # LETTER DDA - \u0922>\uE022; # LETTER DDHA - \u0923>\uE023; # LETTER NNA - \u0924>\uE024; # LETTER TA - \u0925>\uE025; # LETTER THA - \u0926>\uE026; # LETTER DA - \u0927>\uE027; # LETTER DHA - \u0928>\uE028; # LETTER NA - \u0929>\uE029; - \u092A>\uE02A; # LETTER PA - \u092B>\uE02B; # LETTER PHA - \u092C>\uE02C; # LETTER BA - \u092D>\uE02D; # LETTER BHA - \u092E>\uE02E; # LETTER MA - \u092F>\uE02F; # LETTER YA - \u0930>\uE030; # LETTER RA - \u0931>\uE031; - \u0932>\uE032; # LETTER LA - \u0933>\uE033; # LETTER LLA - \u0934>\uE034; - - \u0935>\uE035; # LETTER VA - \u0936>\uE036; # LETTER SHA - \u0937>\uE037; # LETTER SSA - \u0938>\uE038; # LETTER SA - \u0939>\uE039; # LETTER HA - \u093C>\uE03C; # SIGN NUKTA - \u093D>\uE03D; # SIGN AVAGRAHA - \u093E>\uE03E; # VOWEL SIGN AA - \u093F>\uE03F; # VOWEL SIGN I - \u0940>\uE040; # VOWEL SIGN II - \u0941>\uE041; # VOWEL SIGN U - \u0942>\uE042; # VOWEL SIGN UU - \u0943>\uE043; # VOWEL SIGN VOCALIC R - \u0944>\uE044; # VOWEL SIGN VOCALIC RR - \u0945>\uE045; # VOWEL SIGN CANDRA E - \u0946>\uE046; # UNMAPPED VOWEL SIGN SHORT E - \u0947>\uE047; # VOWEL SIGN E - \u0948>\uE048; # VOWEL SIGN AI - \u0949>\uE049; # VOWEL SIGN CANDRA O - \u094A>\uE04A; # UNMAPPED VOWEL SIGN SHORT O - \u094B>\uE04B; # VOWEL SIGN O - \u094C>\uE04C; # VOWEL SIGN AU - \u094D>\uE04D; # SIGN VIRAMA - \u0950>\uE050; # OM - \u0951>\uE051; # UNMAPPED STRESS SIGN UDATTA - \u0952>\uE052; # UNMAPPED STRESS SIGN ANUDATTA - \u0953>\uE053; # UNMAPPED GRAVE ACCENT - \u0954>\uE054; # UNMAPPED ACUTE ACCENT - \u0958>\uE058; - \u0959>\uE059; - \u095A>\uE05a; - \u095B>\uE05b; - \u095C>\uE05c; - \u095D>\uE05d; - \u095E>\uE05e; - \u095F>\uE05f; - \u0960>\uE060; # LETTER VOCALIC RR - \u0961>\uE061; # LETTER VOCALIC LL - \u0962>\uE062; # VOWEL SIGN VOCALIC L - \u0963>\uE063; # VOWEL SIGN VOCALIC LL - \u0964>\ue064; # DANDA - \u0965>\ue065; # DOUBLE DANDA - \u0966>\uE066; # DIGIT ZERO - \u0967>\uE067; # DIGIT ONE - \u0968>\uE068; # DIGIT TWO - \u0969>\uE069; # DIGIT THREE - \u096A>\uE06A; # DIGIT FOUR - \u096B>\uE06B; # DIGIT FIVE - \u096C>\uE06C; # DIGIT SIX - \u096D>\uE06D; # DIGIT SEVEN - \u096E>\uE06E; # DIGIT EIGHT - \u096F>\uE06F; # DIGIT NINE -# \u0970>; # UNMAPPED Devanagari-InterIndic: ABBREVIATION SIGN -# :: NFC (NFD) ; diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Fullwidth_Halfwidth.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Fullwidth_Halfwidth.txt deleted file mode 100755 index eec8561a36..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Fullwidth_Halfwidth.txt +++ /dev/null @@ -1,273 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:41:57 2001 -#-------------------------------------------------------------------- - -# Fullwidth-Halfwidth - -# Mechanically generated from Unicode Character Database -# IDEOGRAPHIC SPACE then added, and -# FULLWIDTH MACRON changed to map to MACRON, not SPACE + COMBINING MACRON - -# multicharacter - -ガ<>ガ; # to KATAKANA LETTER GA -ã‚®<>ギ; # to KATAKANA LETTER GI -ã‚°<>グ; # to KATAKANA LETTER GU -ゲ<>ゲ; # to KATAKANA LETTER GE -ã‚´<>ゴ; # to KATAKANA LETTER GO -ザ<>ザ; # to KATAKANA LETTER ZA -ジ<>ジ; # to KATAKANA LETTER ZI -ズ<>ズ; # to KATAKANA LETTER ZU -ゼ<>ゼ; # to KATAKANA LETTER ZE -ゾ<>ゾ; # to KATAKANA LETTER ZO -ダ<>ダ; # to KATAKANA LETTER DA -ヂ<>ï¾ï¾ž; # to KATAKANA LETTER DI -ヅ<>ヅ; # to KATAKANA LETTER DU -デ<>デ; # to KATAKANA LETTER DE -ド<>ド; # to KATAKANA LETTER DO -ãƒ<>バ; # to KATAKANA LETTER BA -パ<>パ; # to KATAKANA LETTER PA -ビ<>ビ; # to KATAKANA LETTER BI -ピ<>ピ; # to KATAKANA LETTER PI -ブ<>ブ; # to KATAKANA LETTER BU -プ<>プ; # to KATAKANA LETTER PU -ベ<>ï¾ï¾ž; # to KATAKANA LETTER BE -ペ<>ï¾ï¾Ÿ; # to KATAKANA LETTER PE -ボ<>ボ; # to KATAKANA LETTER BO -ãƒ<>ポ; # to KATAKANA LETTER PO -ヴ<>ヴ; # to KATAKANA LETTER VU -ヷ<>ヷ; # to KATAKANA LETTER VA -ヺ<>ヺ; # to KATAKANA LETTER VO - -# single character - -ï¼<>'!'; # from FULLWIDTH EXCLAMATION MARK -"<>'\"'; # from FULLWIDTH QUOTATION MARK -#<>'#'; # from FULLWIDTH NUMBER SIGN -$<>'$'; # from FULLWIDTH DOLLAR SIGN -ï¼…<>'%'; # from FULLWIDTH PERCENT SIGN -&<>'&'; # from FULLWIDTH AMPERSAND -'<>''; # from FULLWIDTH APOSTROPHE -(<>'('; # from FULLWIDTH LEFT PARENTHESIS -)<>')'; # from FULLWIDTH RIGHT PARENTHESIS -*<>'*'; # from FULLWIDTH ASTERISK -+<>'+'; # from FULLWIDTH PLUS SIGN -,<>','; # from FULLWIDTH COMMA -ï¼<>'-'; # from FULLWIDTH HYPHEN-MINUS -.<>'.'; # from FULLWIDTH FULL STOP -ï¼<>'/'; # from FULLWIDTH SOLIDUS -ï¼<>'0'; # from FULLWIDTH DIGIT ZERO -1<>'1'; # from FULLWIDTH DIGIT ONE -ï¼’<>'2'; # from FULLWIDTH DIGIT TWO -3<>'3'; # from FULLWIDTH DIGIT THREE -ï¼”<>'4'; # from FULLWIDTH DIGIT FOUR -5<>'5'; # from FULLWIDTH DIGIT FIVE -ï¼–<>'6'; # from FULLWIDTH DIGIT SIX -ï¼—<>'7'; # from FULLWIDTH DIGIT SEVEN -8<>'8'; # from FULLWIDTH DIGIT EIGHT -ï¼™<>'9'; # from FULLWIDTH DIGIT NINE -:<>':'; # from FULLWIDTH COLON -ï¼›<>';'; # from FULLWIDTH SEMICOLON -<<>'<'; # from FULLWIDTH LESS-THAN SIGN -ï¼<>'='; # from FULLWIDTH EQUALS SIGN -><>'>'; # from FULLWIDTH GREATER-THAN SIGN -?<>'?'; # from FULLWIDTH QUESTION MARK -ï¼ <>'@'; # from FULLWIDTH COMMERCIAL AT -A<>A; # from FULLWIDTH LATIN CAPITAL LETTER A -ï¼¢<>B; # from FULLWIDTH LATIN CAPITAL LETTER B -ï¼£<>C; # from FULLWIDTH LATIN CAPITAL LETTER C -D<>D; # from FULLWIDTH LATIN CAPITAL LETTER D -ï¼¥<>E; # from FULLWIDTH LATIN CAPITAL LETTER E -F<>F; # from FULLWIDTH LATIN CAPITAL LETTER F -G<>G; # from FULLWIDTH LATIN CAPITAL LETTER G -H<>H; # from FULLWIDTH LATIN CAPITAL LETTER H -I<>I; # from FULLWIDTH LATIN CAPITAL LETTER I -J<>J; # from FULLWIDTH LATIN CAPITAL LETTER J -K<>K; # from FULLWIDTH LATIN CAPITAL LETTER K -L<>L; # from FULLWIDTH LATIN CAPITAL LETTER L -ï¼­<>M; # from FULLWIDTH LATIN CAPITAL LETTER M -ï¼®<>N; # from FULLWIDTH LATIN CAPITAL LETTER N -O<>O; # from FULLWIDTH LATIN CAPITAL LETTER O -ï¼°<>P; # from FULLWIDTH LATIN CAPITAL LETTER P -ï¼±<>Q; # from FULLWIDTH LATIN CAPITAL LETTER Q -ï¼²<>R; # from FULLWIDTH LATIN CAPITAL LETTER R -ï¼³<>S; # from FULLWIDTH LATIN CAPITAL LETTER S -ï¼´<>T; # from FULLWIDTH LATIN CAPITAL LETTER T -ï¼µ<>U; # from FULLWIDTH LATIN CAPITAL LETTER U -V<>V; # from FULLWIDTH LATIN CAPITAL LETTER V -ï¼·<>W; # from FULLWIDTH LATIN CAPITAL LETTER W -X<>X; # from FULLWIDTH LATIN CAPITAL LETTER X -ï¼¹<>Y; # from FULLWIDTH LATIN CAPITAL LETTER Y -Z<>Z; # from FULLWIDTH LATIN CAPITAL LETTER Z -ï¼»<>'['; # from FULLWIDTH LEFT SQUARE BRACKET -ï¼¼<>'\\'; # from FULLWIDTH REVERSE SOLIDUS {double escape - aliu} -ï¼½<>']'; # from FULLWIDTH RIGHT SQUARE BRACKET -ï¼¾<>'^'; # from FULLWIDTH CIRCUMFLEX ACCENT -_<>'_'; # from FULLWIDTH LOW LINE -ï½€<>'`'; # from FULLWIDTH GRAVE ACCENT -ï½<>a; # from FULLWIDTH LATIN SMALL LETTER A -b<>b; # from FULLWIDTH LATIN SMALL LETTER B -c<>c; # from FULLWIDTH LATIN SMALL LETTER C -d<>d; # from FULLWIDTH LATIN SMALL LETTER D -ï½…<>e; # from FULLWIDTH LATIN SMALL LETTER E -f<>f; # from FULLWIDTH LATIN SMALL LETTER F -g<>g; # from FULLWIDTH LATIN SMALL LETTER G -h<>h; # from FULLWIDTH LATIN SMALL LETTER H -i<>i; # from FULLWIDTH LATIN SMALL LETTER I -j<>j; # from FULLWIDTH LATIN SMALL LETTER J -k<>k; # from FULLWIDTH LATIN SMALL LETTER K -l<>l; # from FULLWIDTH LATIN SMALL LETTER L -ï½<>m; # from FULLWIDTH LATIN SMALL LETTER M -n<>n; # from FULLWIDTH LATIN SMALL LETTER N -ï½<>o; # from FULLWIDTH LATIN SMALL LETTER O -ï½<>p; # from FULLWIDTH LATIN SMALL LETTER P -q<>q; # from FULLWIDTH LATIN SMALL LETTER Q -ï½’<>r; # from FULLWIDTH LATIN SMALL LETTER R -s<>s; # from FULLWIDTH LATIN SMALL LETTER S -ï½”<>t; # from FULLWIDTH LATIN SMALL LETTER T -u<>u; # from FULLWIDTH LATIN SMALL LETTER U -ï½–<>v; # from FULLWIDTH LATIN SMALL LETTER V -ï½—<>w; # from FULLWIDTH LATIN SMALL LETTER W -x<>x; # from FULLWIDTH LATIN SMALL LETTER X -ï½™<>y; # from FULLWIDTH LATIN SMALL LETTER Y -z<>z; # from FULLWIDTH LATIN SMALL LETTER Z -ï½›<>'{'; # from FULLWIDTH LEFT CURLY BRACKET -|<>'|'; # from FULLWIDTH VERTICAL LINE -ï½<>'}'; # from FULLWIDTH RIGHT CURLY BRACKET -~<>'~'; # from FULLWIDTH TILDE -。<>。; # to HALFWIDTH IDEOGRAPHIC FULL STOP -「<>ï½¢; # to HALFWIDTH LEFT CORNER BRACKET -ã€<>ï½£; # to HALFWIDTH RIGHT CORNER BRACKET -ã€<>、; # to HALFWIDTH IDEOGRAPHIC COMMA -・<>ï½¥; # to HALFWIDTH KATAKANA MIDDLE DOT -ヲ<>ヲ; # to HALFWIDTH KATAKANA LETTER WO -ã‚¡<>ァ; # to HALFWIDTH KATAKANA LETTER SMALL A -ã‚£<>ィ; # to HALFWIDTH KATAKANA LETTER SMALL I -ã‚¥<>ゥ; # to HALFWIDTH KATAKANA LETTER SMALL U -ェ<>ェ; # to HALFWIDTH KATAKANA LETTER SMALL E -ã‚©<>ォ; # to HALFWIDTH KATAKANA LETTER SMALL O -ャ<>ャ; # to HALFWIDTH KATAKANA LETTER SMALL YA -ュ<>ï½­; # to HALFWIDTH KATAKANA LETTER SMALL YU -ョ<>ï½®; # to HALFWIDTH KATAKANA LETTER SMALL YO -ッ<>ッ; # to HALFWIDTH KATAKANA LETTER SMALL TU -ー<>ï½°; # to HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK -ã‚¢<>ï½±; # to HALFWIDTH KATAKANA LETTER A -イ<>ï½²; # to HALFWIDTH KATAKANA LETTER I -ウ<>ï½³; # to HALFWIDTH KATAKANA LETTER U -エ<>ï½´; # to HALFWIDTH KATAKANA LETTER E -オ<>ï½µ; # to HALFWIDTH KATAKANA LETTER O -ã‚«<>カ; # to HALFWIDTH KATAKANA LETTER KA -ã‚­<>ï½·; # to HALFWIDTH KATAKANA LETTER KI -ク<>ク; # to HALFWIDTH KATAKANA LETTER KU -ケ<>ï½¹; # to HALFWIDTH KATAKANA LETTER KE -コ<>コ; # to HALFWIDTH KATAKANA LETTER KO -サ<>ï½»; # to HALFWIDTH KATAKANA LETTER SA -ã‚·<>ï½¼; # to HALFWIDTH KATAKANA LETTER SI -ス<>ï½½; # to HALFWIDTH KATAKANA LETTER SU -ã‚»<>ï½¾; # to HALFWIDTH KATAKANA LETTER SE -ソ<>ソ; # to HALFWIDTH KATAKANA LETTER SO -ã‚¿<>ï¾€; # to HALFWIDTH KATAKANA LETTER TA -ãƒ<>ï¾; # to HALFWIDTH KATAKANA LETTER TI -ツ<>ツ; # to HALFWIDTH KATAKANA LETTER TU -テ<>テ; # to HALFWIDTH KATAKANA LETTER TE -ト<>ト; # to HALFWIDTH KATAKANA LETTER TO -ナ<>ï¾…; # to HALFWIDTH KATAKANA LETTER NA -ニ<>ニ; # to HALFWIDTH KATAKANA LETTER NI -ヌ<>ヌ; # to HALFWIDTH KATAKANA LETTER NU -ãƒ<>ネ; # to HALFWIDTH KATAKANA LETTER NE -ノ<>ノ; # to HALFWIDTH KATAKANA LETTER NO -ãƒ<>ハ; # to HALFWIDTH KATAKANA LETTER HA -ヒ<>ヒ; # to HALFWIDTH KATAKANA LETTER HI -フ<>フ; # to HALFWIDTH KATAKANA LETTER HU -ヘ<>ï¾; # to HALFWIDTH KATAKANA LETTER HE -ホ<>ホ; # to HALFWIDTH KATAKANA LETTER HO -マ<>ï¾; # to HALFWIDTH KATAKANA LETTER MA -ミ<>ï¾; # to HALFWIDTH KATAKANA LETTER MI -ム<>ム; # to HALFWIDTH KATAKANA LETTER MU -メ<>ï¾’; # to HALFWIDTH KATAKANA LETTER ME -モ<>モ; # to HALFWIDTH KATAKANA LETTER MO -ヤ<>ï¾”; # to HALFWIDTH KATAKANA LETTER YA -ユ<>ユ; # to HALFWIDTH KATAKANA LETTER YU -ヨ<>ï¾–; # to HALFWIDTH KATAKANA LETTER YO -ラ<>ï¾—; # to HALFWIDTH KATAKANA LETTER RA -リ<>リ; # to HALFWIDTH KATAKANA LETTER RI -ル<>ï¾™; # to HALFWIDTH KATAKANA LETTER RU -レ<>レ; # to HALFWIDTH KATAKANA LETTER RE -ロ<>ï¾›; # to HALFWIDTH KATAKANA LETTER RO -ワ<>ワ; # to HALFWIDTH KATAKANA LETTER WA -ン<>ï¾; # to HALFWIDTH KATAKANA LETTER N -ã‚™<>゙; # to HALFWIDTH KATAKANA VOICED SOUND MARK -ã‚š<>゚; # to HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK -á… <>ï¾ ; # to HALFWIDTH HANGUL FILLER -á„€<>ᄀ; # to HALFWIDTH HANGUL LETTER KIYEOK -á„<>ï¾¢; # to HALFWIDTH HANGUL LETTER SSANGKIYEOK -ᆪ<>ï¾£; # to HALFWIDTH HANGUL LETTER KIYEOK-SIOS -á„‚<>ᄂ; # to HALFWIDTH HANGUL LETTER NIEUN -ᆬ<>ï¾¥; # to HALFWIDTH HANGUL LETTER NIEUN-CIEUC -ᆭ<>ᆭ; # to HALFWIDTH HANGUL LETTER NIEUN-HIEUH -ᄃ<>ᄃ; # to HALFWIDTH HANGUL LETTER TIKEUT -á„„<>ᄄ; # to HALFWIDTH HANGUL LETTER SSANGTIKEUT -á„…<>ᄅ; # to HALFWIDTH HANGUL LETTER RIEUL -ᆰ<>ᆰ; # to HALFWIDTH HANGUL LETTER RIEUL-KIYEOK -ᆱ<>ᆱ; # to HALFWIDTH HANGUL LETTER RIEUL-MIEUM -ᆲ<>ᆲ; # to HALFWIDTH HANGUL LETTER RIEUL-PIEUP -ᆳ<>ï¾­; # to HALFWIDTH HANGUL LETTER RIEUL-SIOS -ᆴ<>ï¾®; # to HALFWIDTH HANGUL LETTER RIEUL-THIEUTH -ᆵ<>ᆵ; # to HALFWIDTH HANGUL LETTER RIEUL-PHIEUPH -á„š<>ï¾°; # to HALFWIDTH HANGUL LETTER RIEUL-HIEUH -ᄆ<>ï¾±; # to HALFWIDTH HANGUL LETTER MIEUM -ᄇ<>ï¾²; # to HALFWIDTH HANGUL LETTER PIEUP -ᄈ<>ï¾³; # to HALFWIDTH HANGUL LETTER SSANGPIEUP -á„¡<>ï¾´; # to HALFWIDTH HANGUL LETTER PIEUP-SIOS -ᄉ<>ï¾µ; # to HALFWIDTH HANGUL LETTER SIOS -á„Š<>ᄊ; # to HALFWIDTH HANGUL LETTER SSANGSIOS -á„‹<>ï¾·; # to HALFWIDTH HANGUL LETTER IEUNG -á„Œ<>ᄌ; # to HALFWIDTH HANGUL LETTER CIEUC -á„<>ï¾¹; # to HALFWIDTH HANGUL LETTER SSANGCIEUC -á„Ž<>ᄎ; # to HALFWIDTH HANGUL LETTER CHIEUCH -á„<>ï¾»; # to HALFWIDTH HANGUL LETTER KHIEUKH -á„<>ï¾¼; # to HALFWIDTH HANGUL LETTER THIEUTH -á„‘<>ï¾½; # to HALFWIDTH HANGUL LETTER PHIEUPH -á„’<>ï¾¾; # to HALFWIDTH HANGUL LETTER HIEUH -á…¡<>ï¿‚; # to HALFWIDTH HANGUL LETTER A -á…¢<>ᅢ; # to HALFWIDTH HANGUL LETTER AE -á…£<>ï¿„; # to HALFWIDTH HANGUL LETTER YA -á…¤<>ï¿…; # to HALFWIDTH HANGUL LETTER YAE -á…¥<>ᅥ; # to HALFWIDTH HANGUL LETTER EO -á…¦<>ᅦ; # to HALFWIDTH HANGUL LETTER E -á…§<>ï¿Š; # to HALFWIDTH HANGUL LETTER YEO -á…¨<>ï¿‹; # to HALFWIDTH HANGUL LETTER YE -á…©<>ï¿Œ; # to HALFWIDTH HANGUL LETTER O -á…ª<>ï¿; # to HALFWIDTH HANGUL LETTER WA -á…«<>ï¿Ž; # to HALFWIDTH HANGUL LETTER WAE -á…¬<>ï¿; # to HALFWIDTH HANGUL LETTER OE -á…­<>ï¿’; # to HALFWIDTH HANGUL LETTER YO -á…®<>ï¿“; # to HALFWIDTH HANGUL LETTER U -á…¯<>ï¿”; # to HALFWIDTH HANGUL LETTER WEO -á…°<>ï¿•; # to HALFWIDTH HANGUL LETTER WE -á…±<>ï¿–; # to HALFWIDTH HANGUL LETTER WI -á…²<>ï¿—; # to HALFWIDTH HANGUL LETTER YU -á…³<>ï¿š; # to HALFWIDTH HANGUL LETTER EU -á…´<>ï¿›; # to HALFWIDTH HANGUL LETTER YI -á…µ<>ï¿œ; # to HALFWIDTH HANGUL LETTER I -ï¿ <>'¢'; # from FULLWIDTH CENT SIGN -ï¿¡<>'£'; # from FULLWIDTH POUND SIGN -ï¿¢<>'¬'; # from FULLWIDTH NOT SIGN -ï¿£<>'¯'; # from FULLWIDTH MACRON -' '<>' '; # ideographic space (place this after MACRON) -¦<>'¦'; # from FULLWIDTH BROKEN BAR -ï¿¥<>'Â¥'; # from FULLWIDTH YEN SIGN -₩<>â‚©; # from FULLWIDTH WON SIGN -│<>│; # to HALFWIDTH FORMS LIGHT VERTICAL -â†<>ï¿©; # to HALFWIDTH LEFTWARDS ARROW -↑<>↑; # to HALFWIDTH UPWARDS ARROW -→<>ï¿«; # to HALFWIDTH RIGHTWARDS ARROW -↓<>↓; # to HALFWIDTH DOWNWARDS ARROW -â– <>ï¿­; # to HALFWIDTH BLACK SQUARE -â—‹<>ï¿®; # to HALFWIDTH WHITE CIRCLE - -# eof - diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Greek_Latin.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Greek_Latin.txt deleted file mode 100755 index 76c0972ab6..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Greek_Latin.txt +++ /dev/null @@ -1,336 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/Transliterator_Greek_Latin.txt,v $ -# $Date: 2001/11/30 22:27:01 $ -# $Revision: 1.19 $ -#-------------------------------------------------------------------- - -# Rules are predicated on running NFD first, and NFC afterwards -# :: [\u0000-\u007F \u0370-\u03FF [:Greek:] [:nonspacing mark:]] ; -# MINIMAL FILTER GENERATED FOR: Greek-Latin -:: [;\u00B5\u00B7\u00C4\u00CB\u00CF\u00D6\u00DC\u00E4\u00EB\u00EF\u00F6\u00FC\u00FF-\u0101\u0112-\u0113\u012A-\u012B\u014C-\u014D\u016A-\u016B\u0178\u01D5-\u01DC\u01DE-\u01E3\u01EC-\u01ED\u022A-\u022D\u0230-\u0233\u0304\u0308\u0313-\u0314\u0342-\u0345\u037A\u037E\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03D7\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F5\u0401\u0407\u0451\u0457\u04D2-\u04D3\u04DA-\u04DF\u04E2-\u04E7\u04EA-\u04F1\u04F4-\u04F5\u04F8-\u04F9\u1E14-\u1E17\u1E20-\u1E21\u1E26-\u1E27\u1E2E-\u1E2F\u1E38-\u1E39\u1E4E-\u1E53\u1E5C-\u1E5D\u1E7A-\u1E7B\u1E84-\u1E85\u1E8C-\u1E8D\u1E97\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC1-\u1FC4\u1FC6-\u1FCC\u1FCF-\u1FD3\u1FD6-\u1FDB\u1FDF-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2126] ; - -:: NFD (NFC) ; - -# TEST CASES - -# Ὀλίγοι ἔμφονες πολλῶν ἀφÏόνων φοβεÏώτεÏοι — Πλάτωνος -# ᾂ á¾’ á¾¢ ᾃ ᾓ á¾£ -# á¾³ ῃ ῳ ὃ ὄ -# á½ Ï‚ ὡς ὢς ὣς -# Ὠς Ὡς Ὢς Ὣς -# ὨΣ ὩΣ ὪΣ ὫΣ -# Ạ, ạ, Ẹ, ẹ, Ọ, á» - -# Useful variables - -$lower = [[:latin:][:greek:] & [:Ll:]]; -$glower = [[:greek:] & [:Ll:]]; -$upper = [[:latin:][:greek:] & [:Lu:]] ; -$accent = [:M:] ; - -# NOTE: restrict to just the Greek & Latin accents that we care about -# TODO: broaden out once interation is fixed -$accentMinus = [ [\u0300-\u0345] & [:M:] - [\u0338]] ; - -$macron = \u0304 ; -$ddot = \u0308 ; -$ddotmac = [$ddot$macron]; - -$lcgvowel = [αεηιουω] ; -$ucgvowel = [ΑΕΗΙΟΥΩ] ; -$gvowel = [$lcgvowel $ucgvowel] ; -$lcgvowelC = [$lcgvowel $accent] ; - -$evowel = [aeiouyAEIOUY]; -$vowel = [ $evowel $gvowel] ; - -$gammaLike = [ΓΚΞΧγκξχϰ] ; -$egammaLike = [GKXCgkxc] ; -$smooth = Ì“ ; -$rough = Ì” ; -$iotasub = Í… ; - -$evowel_i = [$evowel-[iI]] ; - -$underbar = \u0331; - -$afterLetter = [:L:] [[:M:]\']* ; -$beforeLetter = [[:M:]\']* [:L:] ; -$beforeLower = $accent * $lower ; - -$notLetter = [^[:L:][:M:]] ; - -# Fix punctuation - -\; <> \? ; -· <> \: ; - -# CIRCUMFLEX: convert greek circumflex to normal one. Could use tilde or inverted breve - -\u0342 <> \u0302 ; - -# IOTA: convert iota subscript to iota -# first make previous alpha long! - -$accent_minus = [[$accent]-[$iotasub$macron]]; - -Α } $accent_minus * $iotasub > | Α $macron ; -α } $accent_minus * $iotasub > | α $macron ; - -# now convert to uppercase if after uppercase, ow to lowercase - -$upper $accent * { $iotasub > I ; -$iotasub > i ; - -| $1 $iotasub < ($evowel $macron $accentMinus *) i ; -| $1 $iotasub < ($evowel $macron $accentMinus *) I ; - -# BREATHING - -# Convert rough breathing to h, and move before letters. - -# Make A ` x = > H a x - - Α ($macron?) $rough } $beforeLower > H | α $1; - Ε $rough } $beforeLower > H | ε; - Η $rough } $beforeLower > H | η ; - Ι ($ddot?) $rough } $beforeLower > H | ι $1; - Ο $rough } $beforeLower > H | ο ; - Î¥ $rough } $beforeLower > H | Ï… ; - Ω ($ddot?) $rough } $beforeLower > H | ω $1; - -# Make A x ` = > H a x - -Α ($glower $macron?) $rough > H | α $1 ; -Ε ($glower) $rough > H | ε $1 ; -Η ($glower) $rough > H | η $1 ; -Ι ($glower $ddot?) $rough > H | ι $1 ; -Ο ($glower) $rough > H | ο $1 ; -Î¥ ($glower) $rough > H | Ï… $1 ; -Ω ($glower $ddot?) $rough > H | ω $1 ; - -#Otherwise, make x ` into h x and X ` into H X - -($lcgvowel + $ddotmac? ) $rough > h | $1 ; -($gvowel + $ddotmac? ) $rough > H | $1 ; - -# Go backwards with H - -| $1 $rough < h ($evowel $macron $ddot? $evowel_i $macron?) ; -| $1 $rough < h ($evowel $ddot? $evowel $macron?) ; -| $1 $rough < h ($evowel $macron? $ddot?) ; - -| $1 $rough < H ([AEIOUY] $macron $ddot? $evowel_i $macron?) ; -| $1 $rough < H ([AEIOUY] $ddot? $evowel $macron?) ; -| $1 $rough < H ([AEIOUY] $macron? $ddot?) ; - -# titlecase, have to fix individually -# in the future, we should add &uppercase() to make this easier - -| A $1 $rough < H a ($macron $ddot? $evowel_i $macron?) ; -| E $1 $rough < H e ($macron $ddot? $evowel_i $macron?) ; -| I $1 $rough < H i ($macron $ddot? $evowel_i $macron?) ; -| O $1 $rough < H o ($macron $ddot? $evowel_i $macron?) ; -| U $1 $rough < H u ($macron $ddot? $evowel_i $macron?) ; -| Y $1 $rough < H y ($macron $ddot? $evowel_i $macron?) ; - -| A $1 $rough < H a ($ddot? $evowel $macron?) ; -| E $1 $rough < H e ($ddot? $evowel $macron?) ; -| I $1 $rough < H i ($ddot? $evowel $macron?) ; -| O $1 $rough < H o ($ddot? $evowel $macron?) ; -| U $1 $rough < H u ($ddot? $evowel $macron?) ; -| Y $1 $rough < H y ($ddot? $evowel $macron?) ; - -| A $1 $rough < H a ($macron? $ddot? ) ; -| E $1 $rough < H e ($macron? $ddot? ) ; -| I $1 $rough < H i ($macron? $ddot? ) ; -| O $1 $rough < H o ($macron? $ddot? ) ; -| U $1 $rough < H u ($macron? $ddot? ) ; -| Y $1 $rough < H y ($macron? $ddot? ) ; - -# Now do smooth - -#delete smooth breathing for Latin -$smooth > ; - -# insert in Greek -# the assumption is that all Marks are on letters. - - | $1 $smooth < $notLetter { ([rR]) } [^hH$smooth$rough] ; - | $1 $smooth < $notLetter { ($evowel $macron? $evowel $macron?) } [^$smooth$rough] ; - | $1 $smooth < $notLetter { ($evowel $macron?) } [^$evowel$smooth$rough] ; - -# TODO: preserve smooth/rough breathing if not -# on initial vowel sequence - -# need to have these up here so the rules don't mask - -# remove now superfluous macron when returning - -Α < A $macron ; -α < a $macron ; - -η <> e $macron ; -Η <> E $macron ; - -φ <> ph ; -Ψ } $beforeLower <> Ps ; -Ψ <> PS ; - -Φ } $beforeLower <> Ph ; -Φ <> PH ; -ψ <> ps ; - -ω <> o $macron ; -Ω <> O $macron; - -# NORMAL - -α <> a ; -Α <> A ; - -β <> b ; -Î’ <> B ; - -γ } $gammaLike <> n } $egammaLike ; -γ <> g ; -Γ } $gammaLike <> N } $egammaLike ; -Γ <> G ; - -δ <> d ; -Δ <> D ; - -ε <> e ; -Ε <> E ; - -ζ <> z ; -Ζ <> Z ; - -θ <> th ; -Θ } $beforeLower <> Th ; -Θ <> TH ; - -ι <> i ; -Ι <> I ; - -κ <> k ; -Κ <> K ; - -λ <> l ; -Λ <> L ; - -μ <> m ; -Îœ <> M ; - -ν } $gammaLike > n\' ; -ν <> n ; -Î } $gammaLike <> N\' ; -Î <> N ; - -ξ <> x ; -Ξ <> X ; - -ο <> o ; -Ο <> O ; - -Ï€ <> p ; -Π <> P ; - -Ï $rough <> rh; -Ρ $rough } $beforeLower <> Rh ; -Ρ $rough <> RH ; -Ï <> r ; -Ρ <> R ; - -# insert separator - -[Pp] { } Ï‚ > \' ; -[Pp] { } σ > \' ; - -# underbar means exception - -# before a letter, initial -Ï‚ } $beforeLetter <> s $underbar } $beforeLetter; -σ } $beforeLetter <> s } $beforeLetter; - -# otherwise, after a letter = final -$afterLetter { σ <> $afterLetter { s $underbar; -$afterLetter { Ï‚ <> $afterLetter { s ; - -# otherwise (isolated) = initial -Ï‚ <> s $underbar; -σ <> s ; - -[Pp] { Σ <> \'S ; -Σ <> S ; - -Ï„ <> t ; -Τ <> T ; - -$vowel {Ï… } <> u ; -Ï… <> y ; -$vowel { Î¥ <> U ; -Î¥ <> Y ; - -χ <> ch ; -Χ } $beforeLower <> Ch ; -Χ <> CH ; - -# Completeness for ASCII - -$ignore = [[:Mark:]''] * ; - -| k < c ; -| ph < f ; -| i < j ; -| k < q ; -| b < v } $vowel ; -| b < w } $vowel; -| u < v ; -| u < w; -| K < C ; -| Ph < F ; -| I < J ; -| K < Q ; -| B < V } $vowel ; -| B < W } $vowel ; -| U < V ; -| U < W ; - -$rough } $ignore [:UppercaseLetter:] > H ; -$ignore [:UppercaseLetter:] { $rough > H ; -$rough < H ; -$rough <> h ; - -# Completeness for Greek - -Ï > | β ; -Ï‘ > | θ ; -Ï’ > | Î¥ ; -Ï• > | φ ; -Ï– > | Ï€ ; - -Ï° > | κ ; -ϱ > | Ï ; -ϲ > | σ ; -ϳ > j ; -Ï´ > | Θ ; -ϵ > | ε ; - -µ > | μ ; - - ͺ > i; - -# delete any trailing ' marks used for roundtripping - - < [Ππ] { \' } [Ss] ; - < [Îν] { \' } $egammaLike ; - -::NFC (NFD) ; -# ([\u0000-\u007F [:Latin:] [:Greek:] [:nonspacing mark:]]) ; -# ([\u0000-\u007F \u00B7 [:Latin:] [:nonspacing mark:]]) ; -# MINIMAL FILTER GENERATED FOR: Latin-Greek BACKWARD -:: ( [':?A-Za-z\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0300-\u0337\u0339-\u0345\u0385-\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AA-\u03B0\u03CA-\u03CE\u03D3-\u03D4\u0400-\u0401\u0403\u0407\u040C-\u040E\u0419\u0439\u0450-\u0451\u0453\u0457\u045C-\u045E\u0476-\u0477\u04C1-\u04C2\u04D0-\u04D3\u04D6-\u04D7\u04DA-\u04DF\u04E2-\u04E7\u04EA-\u04F5\u04F8-\u04F9\u1E00-\u1E99\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FC1-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEE\u1FF2-\u1FF4\u1FF6-\u1FFC\u212A-\u212B] ) ; diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Gujarati_InterIndic.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Gujarati_InterIndic.txt deleted file mode 100755 index 3a134fdd94..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Gujarati_InterIndic.txt +++ /dev/null @@ -1,100 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_Gujarati_InterIndic.utf8.txt -# Date: Thu Mar 1 20:03:54 2001 -#-------------------------------------------------------------------- -# Gujarati_InterIndic -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:41:58 2001 -#-------------------------------------------------------------------- -# Gujarati-InterIndic -#:: NFD (NFC) ; -\u0a81>\ue001; # SIGN CANDRABINDU -\u0a82>\ue002; # SIGN ANUSVARA -\u0a83>\ue003; # SIGN VISARGA -\u0a85>\ue005; # LETTER A -\u0a86>\ue006; # LETTER AA -\u0a87>\ue007; # LETTER I -\u0a88>\ue008; # LETTER II -\u0a89>\ue009; # LETTER U -\u0a8a>\ue00a; # LETTER UU -\u0a8b>\ue00b; # LETTER VOCALIC R -\u0a8d>\ue00d; # UNMAPPED Gujarati-InterIndic: VOWEL CANDRA E -\u0a8f>\ue00f; # LETTER E -\u0a90>\ue010; # LETTER AI -\u0a91>\ue011; # UNMAPPED Gujarati-InterIndic: VOWEL CANDRA O -\u0a93>\ue013; # LETTER O -\u0a94>\ue014; # LETTER AU -\u0a95>\ue015; # LETTER KA -\u0a96>\ue016; # LETTER KHA -\u0a97>\ue017; # LETTER GA -\u0a98>\ue018; # LETTER GHA -\u0a99>\ue019; # LETTER NGA -\u0a9a>\ue01a; # LETTER CA -\u0a9b>\ue01b; # LETTER CHA -\u0a9c>\ue01c; # LETTER JA -\u0a9d>\ue01d; # LETTER JHA -\u0a9e>\ue01e; # LETTER NYA -\u0a9f>\ue01f; # LETTER TTA -\u0aa0>\ue020; # LETTER TTHA -\u0aa1>\ue021; # LETTER DDA -\u0aa2>\ue022; # LETTER DDHA -\u0aa3>\ue023; # LETTER NNA -\u0aa4>\ue024; # LETTER TA -\u0aa5>\ue025; # LETTER THA -\u0aa6>\ue026; # LETTER DA -\u0aa7>\ue027; # LETTER DHA -\u0aa8>\ue028; # LETTER NA -\u0aaa>\ue02a; # LETTER PA -\u0aab>\ue02b; # LETTER PHA -\u0aac>\ue02c; # LETTER BA -\u0aad>\ue02d; # LETTER BHA -\u0aae>\ue02e; # LETTER MA -\u0aaf>\ue02f; # LETTER YA -\u0ab0>\ue030; # LETTER RA -\u0ab2>\ue032; # LETTER LA -\u0ab3>\ue033; # LETTER LLA -\u0ab5>\ue035; # LETTER VA -\u0ab6>\ue036; # LETTER SHA -\u0ab7>\ue037; # LETTER SSA -\u0ab8>\ue038; # LETTER SA -\u0ab9>\ue039; # LETTER HA -\u0abc>\ue03c; # SIGN NUKTA -\u0abd>\ue03d; # SIGN AVAGRAHA -\u0abe>\ue03e; # VOWEL SIGN AA -\u0abf>\ue03f; # VOWEL SIGN I -\u0ac0>\ue040; # VOWEL SIGN II -\u0ac1>\ue041; # VOWEL SIGN U -\u0ac2>\ue042; # VOWEL SIGN UU -\u0ac3>\ue043; # VOWEL SIGN VOCALIC R -\u0ac4>\ue044; # VOWEL SIGN VOCALIC RR -\u0ac5>\ue045; # VOWEL SIGN CANDRA E -\u0ac7>\ue047; # VOWEL SIGN E -\u0ac8>\ue048; # VOWEL SIGN AI -\u0ac9>\ue049; # VOWEL SIGN CANDRA O -\u0acb>\ue04b; # VOWEL SIGN O -\u0acc>\ue04c; # VOWEL SIGN AU -\u0acd>\ue04d; # SIGN VIRAMA -\u0ad0>\ue050; # OM -\u0ae0>\ue060; # LETTER VOCALIC RR -\u0ae6>\ue066; # DIGIT ZERO -\u0ae7>\ue067; # DIGIT ONE -\u0ae8>\ue068; # DIGIT TWO -\u0ae9>\ue069; # DIGIT THREE -\u0aea>\ue06a; # DIGIT FOUR -\u0aeb>\ue06b; # DIGIT FIVE -\u0aec>\ue06c; # DIGIT SIX -\u0aed>\ue06d; # DIGIT SEVEN -\u0aee>\ue06e; # DIGIT EIGHT -\u0aef>\ue06f; # DIGIT NINE -\u0964>\ue064; # DANDA -\u0965>\ue065; # DOUBLE DANDA -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Gurmukhi_InterIndic.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Gurmukhi_InterIndic.txt deleted file mode 100755 index 46c0f8c8ce..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Gurmukhi_InterIndic.txt +++ /dev/null @@ -1,104 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_Gurmukhi_InterIndic.utf8.txt -# Date: Thu Mar 1 20:03:54 2001 -#-------------------------------------------------------------------- -# Gurmukhi_InterIndic -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:41:58 2001 -#-------------------------------------------------------------------- -# Gurmukhi-InterIndic -#:: NFD (NFC) ; - -#\u0A16\u0A3C>\uE059; # LETTER KHHA -#\u0A17\u0A3C>\uE05A; # LETTER GHHA -#\u0A1C\u0A3C>\uE05B; # LETTER ZA -#\u0A38\u0A3C>\uE036; # LETTER SHA -#\u0A32\u0A3C>\uE033; # LETTER LLA -#\u0A2B\u0A3C>\uE05E; # LETTER FA - -\u0A02>\uE001; # REMAP (indicExceptions.txt): \u0a01>\u0a02 = SIGN CANDRABINDU>SIGN BINDI -\u0A05>\uE005; # LETTER A -\u0A06>\uE006; # LETTER AA -\u0A07>\uE007; # LETTER I -\u0A08>\uE008; # LETTER II -\u0A09>\uE009; # LETTER U -\u0A0A>\uE00A; # LETTER UU -\u0A0F>\uE00F; # LETTER EE -\u0A10>\uE010; # LETTER AI -\u0A13>\uE013; # LETTER OO -\u0A14>\uE014; # LETTER AU -\u0A15>\uE015; # LETTER KA -\u0A16>\uE016; # LETTER KHA -\u0A17>\uE017; # LETTER GA -\u0A18>\uE018; # LETTER GHA -\u0A19>\uE019; # LETTER NGA -\u0A1A>\uE01A; # LETTER CA -\u0A1B>\uE01B; # LETTER CHA -\u0A1C>\uE01C; # LETTER JA -\u0A1D>\uE01D; # LETTER JHA -\u0A1E>\uE01E; # LETTER NYA -\u0A1F>\uE01F; # LETTER TTA -\u0A20>\uE020; # LETTER TTHA -\u0A21>\uE021; # LETTER DDA -\u0A22>\uE022; # LETTER DDHA -\u0A23>\uE023; # LETTER NNA -\u0A24>\uE024; # LETTER TA -\u0A25>\uE025; # LETTER THA -\u0A26>\uE026; # LETTER DA -\u0A27>\uE027; # LETTER DHA -\u0A28>\uE028; # LETTER NA -\u0A2A>\uE02A; # LETTER PA -\u0A2B>\uE02B; # LETTER PHA -\u0A2C>\uE02C; # LETTER BA -\u0A2D>\uE02D; # LETTER BHA -\u0A2E>\uE02E; # LETTER MA -\u0A2F>\uE02F; # LETTER YA -\u0A30>\uE030; # LETTER RA -\u0A32>\uE032; # LETTER LA - -\u0A35>\uE035; # LETTER VA - -\u0A38>\uE038; # LETTER SA -\u0A39>\uE039; # LETTER HA -\u0A3C>\uE03C; # SIGN NUKTA -\u0A3E>\uE03E; # VOWEL SIGN AA -\u0A3F>\uE03F; # VOWEL SIGN I -\u0A40>\uE040; # VOWEL SIGN II -\u0A41>\uE041; # VOWEL SIGN U -\u0A42>\uE042; # VOWEL SIGN UU -\u0A47>\uE047; # VOWEL SIGN EE -\u0A48>\uE048; # VOWEL SIGN AI -\u0A4B>\uE04B; # VOWEL SIGN OO -\u0A4C>\uE04C; # VOWEL SIGN AU -\u0A4D>\uE04D; # SIGN VIRAMA - -\u0A5C>\uE05C; # LETTER RRA - -\u0A66>\uE066; # DIGIT ZERO -\u0A67>\uE067; # DIGIT ONE -\u0A68>\uE068; # DIGIT TWO -\u0A69>\uE069; # DIGIT THREE -\u0A6A>\uE06A; # DIGIT FOUR -\u0A6B>\uE06B; # DIGIT FIVE -\u0A6C>\uE06C; # DIGIT SIX -\u0A6D>\uE06D; # DIGIT SEVEN -\u0A6E>\uE06E; # DIGIT EIGHT -\u0A6F>\uE06F; # DIGIT NINE -\u0A70>\uE070; # TIPPI -\u0A71>\uE071; # ADDAK -\u0A72>\uE072; # IRI -\u0A73>\uE073; # URA -\u0A74>\uE074; # EK ONKAR -\u0964>\ue064; # DANDA -\u0965>\ue065; # DOUBLE DANDA -# :: NFC (NFD) ; -# eof - diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Hiragana_Katakana.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Hiragana_Katakana.txt deleted file mode 100755 index fe0fd0f7e6..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Hiragana_Katakana.txt +++ /dev/null @@ -1,209 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 2001 -#-------------------------------------------------------------------- - -# note: a global filter is more efficient, but MUST include all source chars -:: [\u0000-\u007E \u3001\u3002 \u3099-\u309C \u30A1-\u30FC \uFF61-\uFF9Fー[:Hiragana:] [:Katakana:] [:nonspacing mark:]] ; -:: NFKC (); - -# Hiragana-Katakana - -# This is largely a one-to-one mapping, but it has a -# few kinks: - -# 1. The Katakana va/vi/ve/vo (30F7-30FA) have no -# Hiragana equivalents. We use Hiragana wa/wi/we/wo -# (308F-3092) with a voicing mark (3099), which is -# semantically equivalent. However, this is a non- -# roundtripping transformation. - -# 2. The Katakana small ka/ke (30F5,30F6) have no -# Hiragana equiavlents. We convert them to normal -# Hiragana ka/ke (304B,3051). This is a one-way -# information-losing transformation and precludes -# round-tripping of 30F5 and 30F6. - -# 3. The combining marks 3099-309C are in the Hiragana -# block, but they apply to Katakana as well, so we -# leave them untouched. - -# 4. The Katakana prolonged sound mark 30FC doubles the -# preceding vowel. This is a one-way information- -# losing transformation from Katakana to Hiragana. - -# 5. The Katakana middle dot separates words in foreign -# expressions; we leave this unmodified. - -# The above points preclude successful round-trip -# transformations of arbitrary input text. However, -# they provide naturalistic results that should conform -# to user expectations. - - -# Combining equivalents va/vi/ve/vo -ã‚ã‚™ <> ヷ; -ã‚ã‚™ <> ヸ; -ã‚‘ã‚™ <> ヹ; -ã‚’ã‚™ <> ヺ; - -# One-to-one mappings, main block -# 3041:3094 <> 30A1:30F4 -# 309D,E <> 30FD,E -ã <> ã‚¡; -ã‚ <> ã‚¢; -ム<> ã‚£; -ã„ <> イ; -ã… <> ã‚¥; -ㆠ<> ウ; -㇠<> ェ; -㈠<> エ; -㉠<> ã‚©; -㊠<> オ; -ã‹ <> ã‚«; -㌠<> ガ; -ã <> ã‚­; -㎠<> ã‚®; -ã <> ク; -ã <> ã‚°; -ã‘ <> ケ; -ã’ <> ゲ; -ã“ <> コ; -ã” <> ã‚´; -ã• <> サ; -ã– <> ザ; -ã— <> ã‚·; -㘠<> ジ; -ã™ <> ス; -ãš <> ズ; -ã› <> ã‚»; -㜠<> ゼ; -ã <> ソ; -ãž <> ゾ; -㟠<> ã‚¿; -ã  <> ダ; -ã¡ <> ãƒ; -㢠<> ヂ; -㣠<> ッ; -㤠<> ツ; -㥠<> ヅ; -㦠<> テ; -㧠<> デ; -㨠<> ト; -ã© <> ド; -㪠<> ナ; -ã« <> ニ; -㬠<> ヌ; -ã­ <> ãƒ; -ã® <> ノ; -㯠<> ãƒ; -ã° <> ãƒ; -ã± <> パ; -ã² <> ヒ; -ã³ <> ビ; -ã´ <> ピ; -ãµ <> フ; -㶠<> ブ; -ã· <> プ; -㸠<> ヘ; -ã¹ <> ベ; -㺠<> ペ; -ã» <> ホ; -ã¼ <> ボ; -ã½ <> ãƒ; -ã¾ <> マ; -ã¿ <> ミ; -ã‚€ <> ム; -ã‚ <> メ; -ã‚‚ <> モ; -ゃ <> ャ; -ã‚„ <> ヤ; -ã‚… <> ュ; -ゆ <> ユ; -ょ <> ョ; -よ <> ヨ; -ら <> ラ; -ã‚Š <> リ; -ã‚‹ <> ル; -ã‚Œ <> レ; -ã‚ <> ロ; -ã‚Ž <> ヮ; -ã‚ <> ワ; -ã‚ <> ヰ; -ã‚‘ <> ヱ; -ã‚’ <> ヲ; -ã‚“ <> ン; -ã‚” <> ヴ; -ã‚ <> ヽ; -ã‚ž <> ヾ; - -# One-way Katakana-Hiragana xform of small K ka/ke to -# normal H ka/ke. -ã‹ < ヵ; -ã‘ < ヶ; - -# Katakana followed by a prolonged sound mark 30FC has -# its final vowel doubled. This is a Katakana-Hiragana -# one-way information-losing transformation. We -# include the small Katakana (e.g., small A 3041) and -# do not distinguish them from their large -# counterparts. It doesn't make sense to double a -# small counterpart vowel as a small Hiragana vowel, so -# we don't do so. In natural text this should never -# occur anyway. If a 30FC is seen without a preceding -# vowel sound (e.g., after n 30F3) we do not change it. - -### $long = ー; - -# The following categories are Hiragana, not Katakana -# as might be expected, since by the time we get to the -# 30FC, the preceding character will have already been -# transformed to Hiragana. - -# {The following mechanically generated from the -# Unicode 3.0 data:} - -$xa = [ \ -ã ゠㋠㌠㕠㖠\ -ãŸ ã  ãª ã¯ ã° ã± \ -㾠ゃ ã‚„ ら ã‚Ž ã‚ \ -]; - -$xi = [ \ -ムㄠã ㎠㗠㘠\ -㡠㢠㫠㲠㳠㴠\ -ã¿ ã‚Š ã‚ \ -]; - -$xu = [ \ -ã… ã† ã ã ã™ ãš \ -㣠㤠㥠㬠㵠㶠\ -ã· ã‚€ ã‚… ゆ ã‚‹ ã‚” \ -]; - -$xe = [ \ -㇠㈠㑠㒠㛠㜠\ -㦠㧠㭠㸠㹠㺠\ -ã‚ ã‚Œ ã‚‘ \ -]; - -$xo = [ \ -㉠㊠㓠㔠ã ãž \ -㨠㩠㮠㻠㼠㽠\ -ã‚‚ ょ よ ã‚ ã‚’ \ -]; - -ã‚ < $xa {ー}; -ã„ < $xi {ー}; -ㆠ< $xu {ー}; -㈠< $xe {ー}; -㊠< $xo {ー}; - -:: (NFKC) ; - -# note: a global filter is more efficient, but MUST include all source chars!! -:: ([\u0000-\u007E \u3001\u3002 \u3099-\u309C \u30A1-\u30FC \uFF61-\uFF9Fー[:Hiragana:] [:Katakana:] [:nonspacing mark:]]); - -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Hiragana_Latin.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Hiragana_Latin.txt deleted file mode 100755 index 0fa6700676..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Hiragana_Latin.txt +++ /dev/null @@ -1,18 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/Transliterator_Hiragana_Latin.txt,v $ -# $Date: 2001/11/30 22:21:15 $ -# $Revision: 1.6 $ -#-------------------------------------------------------------------- - -:: [\u3041-\u3094\u3099\u309D-\u309E\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0\u30D3\u30D6\u30D9\u30DC\u30F4\u30F7-\u30FA\u30FE] ; -:: NFD ; - -:: Hiragana-Katakana; -:: Katakana-Latin; - -:: NFC ; -:: (Lower) ; -:: ([',.A-Za-z~\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0304\u04E2-\u04E3\u04EE-\u04EF\u1E00-\u1E99\u1EA0-\u1EF9\u1FB1\u1FB9\u1FD1\u1FD9\u1FE1\u1FE9\u212A-\u212B]) ; diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Bengali.txt b/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Bengali.txt deleted file mode 100755 index 1c38002e4e..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Bengali.txt +++ /dev/null @@ -1,135 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_InterIndic_Bengali.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# InterIndic_Bengali -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:41:59 2001 -#-------------------------------------------------------------------- -# InterIndic-Bengali -#:: NFD (NFC) ; -\uE001>\u0981; # SIGN CANDRABINDU -\uE002>\u0982; # SIGN ANUSVARA -\uE003>\u0983; # SIGN VISARGA -\uE005>\u0985; # LETTER A -\uE006>\u0986; # LETTER AA -\uE007>\u0987; # LETTER I -\uE008>\u0988; # LETTER II -\uE009>\u0989; # LETTER U -\uE00A>\u098A; # LETTER UU -\uE00B>\u098B; # LETTER VOCALIC R -\uE00C>\u098C; # LETTER VOCALIC L -\uE00D>\u098F; # FALLBACK -\uE00E>\u098F; # FALLBACK -\uE00F>\u098F; # LETTER E -\uE010>\u0990; # LETTER AI -\uE011>\u0993; # FALLBACK -\uE012>\u0993; # FALLBACK -\uE013>\u0993; # LETTER O -\uE014>\u0994; # LETTER AU -\uE015>\u0995; # LETTER KA -\uE016>\u0996; # LETTER KHA -\uE017>\u0997; # LETTER GA -\uE018>\u0998; # LETTER GHA -\uE019>\u0999; # LETTER NGA -\uE01A>\u099A; # LETTER CA -\uE01B>\u099B; # LETTER CHA -\uE01C>\u099C; # LETTER JA -\uE01D>\u099D; # LETTER JHA -\uE01E>\u099E; # LETTER NYA -\uE01F>\u099F; # LETTER TTA -\uE020>\u09A0; # LETTER TTHA -\uE021>\u09A1; # LETTER DDA -\uE022>\u09A2; # LETTER DDHA -\uE023>\u09A3; # LETTER NNA -\uE024>\u09A4; # LETTER TA -\uE025>\u09A5; # LETTER THA -\uE026>\u09A6; # LETTER DA -\uE027>\u09A7; # LETTER DHA -\uE028>\u09A8; # LETTER NA -\uE029>\u09A8\u09BC; # REMAP (indicExceptions.txt): \u09a9>\u09a8 = LETTER NNNA>LETTER NA -\uE02A>\u09AA; # LETTER PA -\uE02B>\u09AB; # LETTER PHA -\uE02C>\u09AC; # LETTER BA -\uE02D>\u09AD; # LETTER BHA -\uE02E>\u09AE; # LETTER MA -\uE02F>\u09AF; # LETTER YA -\uE030>\u09B0; # LETTER RA -\uE031>\u09B0\u09BC; # FALLBACK to RA -\uE032>\u09B2; # LETTER LA -\uE033>\u09B2; # REMAP (indicExceptions.txt): \u09b3>\u09b2 = LETTER LLA>LETTER LA -\uE034>\u09B2; # REMAP (indicExceptions.txt): \u09b4>\u09b2 = LETTER LLLA>LETTER LA -\uE035>\u09AC; # REMAP (indicExceptions.txt): \u09b5>\u09ac = LETTER VA>LETTER BA -\uE036>\u09B6; # LETTER SHA -\uE037>\u09B7; # LETTER SSA -\uE038>\u09B8; # LETTER SA -\uE039>\u09B9; # LETTER HA -\uE03C>\u09BC; # SIGN NUKTA -\uE03D>; # FALLBACK BLOW AWAY AVAGRAHA -\uE03E>\u09BE; # VOWEL SIGN AA -\uE03F>\u09BF; # VOWEL SIGN I -\uE040>\u09C0; # VOWEL SIGN II -\uE041>\u09C1; # VOWEL SIGN U -\uE042>\u09C2; # VOWEL SIGN UU -\uE043>\u09C3; # VOWEL SIGN VOCALIC R -\uE044>\u09C4; # VOWEL SIGN VOCALIC RR -\uE045>\u09C7; # REMAP (indicExceptions.txt): \u09c5>\u09c7 = VOWEL SIGN CANDRA E>VOWEL SIGN E -\uE046>\u09C7; # FALLBACK -\uE047>\u09C7; # VOWEL SIGN E -\uE048>\u09C8; # VOWEL SIGN AI -\uE049>\u09C7\u09BE; # REMAP (indicExceptions.txt): \u09c9>\u09cb = VOWEL SIGN CANDRA O>VOWEL SIGN O -\uE04A>\u09C7\u09BE; # FALLBACK -\uE04B>\u09C7\u09BE; # VOWEL SIGN O -\uE04C>\u09C7\u09D7; # VOWEL SIGN AU -\uE04D>\u09CD; # SIGN VIRAMA -\uE050>\u0993\u0982; # InterIndic-Bengali: OM -\ue051>; -\ue052>; -\ue053>; -\ue054>; -\uE055>; # UNMAPPED InterIndic-Bengali: LENGTH MARK -\uE056>\u09C8; # REMAP (indicExceptions.txt): \u09d6>\u09c8 = AI LENGTH MARK>VOWEL SIGN AI -\uE057>\u09D7; # AU LENGTH MARK -\uE058>\u0995\u09BC; # FALLBACK -\uE059>\u0996\u09BC; # REMAP (indicExceptions.txt): \u09d9>\u0996 = LETTER KHHA>LETTER KHA -\uE05A>\u0997\u09BC; # REMAP (indicExceptions.txt): \u09da>\u0997 = LETTER GHHA>LETTER GA -\uE05B>\u099C\u09BC; # REMAP (indicExceptions.txt): \u09db>\u099c = LETTER ZA>LETTER JA -\uE05C>\u09A1\u09BC; # FALLBACK -\uE05D>\u09A2\u09BC; # LETTER RHA -\uE05E>\u09AB\u09BC; # REMAP (indicExceptions.txt): \u09de>\u09ab = LETTER FA>LETTER PHA -\uE05F>\u09AF\u09BC; # LETTER YYA -\uE060>\u09E0; # LETTER VOCALIC RR -\uE061>\u09E1; # LETTER VOCALIC LL -\uE062>\u09E2; # VOWEL SIGN VOCALIC L -\uE063>\u09E3; # VOWEL SIGN VOCALIC LL -\uE064>\u0964; # DANDA -\uE065>\u0965; # DOUBLE DANDA -\uE066>\u09E6; # DIGIT ZERO -\uE067>\u09E7; # DIGIT ONE -\uE068>\u09E8; # DIGIT TWO -\uE069>\u09E9; # DIGIT THREE -\uE06A>\u09EA; # DIGIT FOUR -\uE06B>\u09EB; # DIGIT FIVE -\uE06C>\u09EC; # DIGIT SIX -\uE06D>\u09ED; # DIGIT SEVEN -\uE06E>\u09EE; # DIGIT EIGHT -\uE06F>\u09EF; # DIGIT NINE -\uE070>; -\uE071>; -\uE0FA>\u09FA; # ISSHAR -0 > \u09E6; # FALLBACK FOR TAMIL -1 > \u09E7; -\ue072>; -\ue073>; -\ue074>; - -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Devanagari.txt b/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Devanagari.txt deleted file mode 100755 index 2e97c18406..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Devanagari.txt +++ /dev/null @@ -1,162 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_InterIndic_Devanagari.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# InterIndic_Devanagari -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:41:59 2001 -#-------------------------------------------------------------------- -# InterIndic-Devanagari -#:: NFD (NFC) ; -#Rules for Decomposed characters - \ue028\ue03c > \u0929; #\ue029 - \ue030\ue03c > \u0931; #\ue031 - \ue033\ue03c > \u0934; #\ue034 - \ue015\ue03c > \u0958; #\ue058 LETTER QA (For Urdu) - \ue016\ue03c > \u0959; #\ue059 LETTER KHHA (For Urdu) - \ue017\ue03c > \u095a; #\ue05a LETTER GHHA (For Urdu) - \ue01c\ue03c > \u095b; #\ue05b LETTER ZA (For Urdu) - \ue021\ue03c > \u095c; #\ue05c LETTER DDDHA (pronounced RRA) - \ue022\ue03c > \u095d; #\ue05d LETTER RHA (pronounced RRHA) - \ue02b\ue03c > \u095e; #\ue05e LETTER FA - \ue02f\ue03c > \u095f; #\ue05f LETTER YYA - - #Decomposed compatibility transliterations - \ue012\ue057>\u0914; # FALLBACK FOR TAMIL AU - 0 > \u0966; # FALLBACK FOR TAMIL - 1 > \u0967; - - \ue055>; # FALLBACK BLOW AWAY KANNADA AND TELUGU LENGTH MARK - \ue056>; # FALLBACK BLOW AWAY KANNADA AND TELUGU AI LENGTH MARK - \ue057>; # FALLBACK BLOW AWAY TAMIL AU LENGTH MARK - \ue070>; # FALLBACK BLOW AWAY GURMUKHI - \ue071>; # FALLBACK BLOW AWAY GURMUKHI - \ue072>; # FALLBACK BLOW AWAY GURMUKHI - \ue073>; # FALLBACK BLOW AWAY GURMUKHI - \ue074>; # FALLBACK BLOW AWAY GURMUKHI - - - \ue001 > \u0901; # SIGN CANDRABINDU - \ue002 > \u0902; # SIGN ANUSVARA - \ue003 > \u0903; # SIGN VISARGA - \ue005 > \u0905; # LETTER A - \ue006 > \u0906; # LETTER AA - \ue007 > \u0907; # LETTER I - \ue008 > \u0908; # LETTER II - \ue009 > \u0909; # LETTER U - \ue00a > \u090a; # LETTER UU - \ue00b > \u090b; # LETTER VOCALIC R - \ue00c > \u090c; # LETTER VOCALIC L - \ue00d > \u090d; # LETTER CANDRA E (For representing English sounds) - \ue00e > \u090e; # UNMAPPED LETTER SHORT E(For Southern Scripts) - #\ue00e > \u090f; - \ue00f > \u090f; # LETTER E - \ue010 > \u0910; # LETTER AI - \ue011 > \u0911; # LETTER CANDRA O (For representing English sounds) - \ue012 > \u0912; # UNMAPPED LETTER SHORT O (For Southern Scripts) - #\ue012 > \u0913; - \ue013 > \u0913; # LETTER O - \ue014 > \u0914; # LETTER AU - \ue015 > \u0915; # LETTER KA - \ue016 > \u0916; # LETTER KHA - \ue017 > \u0917; # LETTER GA - \ue018 > \u0918; # LETTER GHA - \ue019 > \u0919; # LETTER NGA - \ue01a > \u091a; # LETTER CA - \ue01b > \u091b; # LETTER CHA - \ue01c > \u091c; # LETTER JA - \ue01d > \u091d; # LETTER JHA - \ue01e > \u091e; # LETTER NYA - \ue01f > \u091f; # LETTER TTA - \ue020 > \u0920; # LETTER TTHA - \ue021 > \u0921; # LETTER DDA - \ue022 > \u0922; # LETTER DDHA - \ue023 > \u0923; # LETTER NNA - \ue024 > \u0924; # LETTER TA - \ue025 > \u0925; # LETTER THA - \ue026 > \u0926; # LETTER DA - \ue027 > \u0927; # LETTER DHA - \ue028 > \u0928; # LETTER NA - \ue029 > \u0929; # LETTER NNNA - \ue02a > \u092a; # LETTER PA - \ue02b > \u092b; # LETTER PHA - \ue02c > \u092c; # LETTER BA - \ue02d > \u092d; # LETTER BHA - \ue02e > \u092e; # LETTER MA - \ue02f > \u092f; # LETTER YA - \ue030 > \u0930; # LETTER RA - \ue031 > \u0931; # LETTER RRA (Eyelash RA for Southern scripts) - #\ue031 > \u0930; - \ue032 > \u0932; # LETTER LA - \ue033 > \u0933; # LETTER LLA - \ue034 > \u0934; # LETTER LLLA (LLLA for Southern scripts) - #\ue034 > \u0933; - \ue035 > \u0935; # LETTER VA - \ue036 > \u0936; # LETTER SHA - \ue037 > \u0937; # LETTER SSA - \ue038 > \u0938; # LETTER SA - \ue039 > \u0939; # LETTER HA - \ue03c > \u093c; # SIGN NUKTA - \ue03d > \u093d; # SIGN AVAGRAHA - \ue03e > \u093e; # VOWEL SIGN AA - \ue03f > \u093f; # VOWEL SIGN I - \ue040 > \u0940; # VOWEL SIGN II - \ue041 > \u0941; # VOWEL SIGN U - \ue042 > \u0942; # VOWEL SIGN UU - \ue043 > \u0943; # VOWEL SIGN VOCALIC R - \ue044 > \u0944; # VOWEL SIGN VOCALIC RR - \ue045 > \u0945; # VOWEL SIGN CANDRA E - \ue046 > \u0946; # UNMAPPED VOWEL SIGN SHORT E - #\ue046 > \u0947; - \ue047 > \u0947; # VOWEL SIGN E - \ue048 > \u0948; # VOWEL SIGN AI - \ue049 > \u0949; # VOWEL SIGN CANDRA O - \ue04a > \u094a; # UNMAPPED VOWEL SIGN SHORT O - #\ue04a > \u094b; - \ue04b > \u094b; # VOWEL SIGN O - \ue04c > \u094c; # VOWEL SIGN AU - \ue04d > \u094d; # SIGN VIRAMA - \ue050 > \u0950; # OM - \ue051 > \u0951; # UNMAPPED STRESS SIGN UDATTA - \ue052 > \u0952; # UNMAPPED STRESS SIGN ANUDATTA - \ue053 > \u0953; # UNMAPPED GRAVE ACCENT - \ue054 > \u0954; # UNMAPPED ACUTE ACCENT - \ue058 > \u0958; # LETTER QA (For Urdu) - \ue059 > \u0959; # LETTER KHHA (For Urdu) - \ue05a > \u095a; # LETTER GHHA (For Urdu) - \ue05b > \u095b; # LETTER ZA (For Urdu) - \ue05c > \u095c; # LETTER DDDHA (pronounced RRA) - \ue05d > \u095d; # LETTER RHA (pronounced RRHA) - \ue05e > \u095e; # LETTER FA - \ue05f > \u095f; # LETTER YYA - \ue060 > \u0960; # LETTER VOCALIC RR - \ue061 > \u0961; # LETTER VOCALIC LL - \ue062 > \u0962; # VOWEL SIGN VOCALIC L - \ue063 > \u0963; # VOWEL SIGN VOCALIC LL - \ue064 > \u0964; # UNMAPPED Devanagari-InterIndic: DANDA - \ue065 > \u0965; # UNMAPPED Devanagari-InterIndic: DOUBLE DANDA - \ue066 > \u0966; # DIGIT ZERO - \ue067 > \u0967; # DIGIT ONE - \ue068 > \u0968; # DIGIT TWO - \ue069 > \u0969; # DIGIT THREE - \ue06a > \u096a; # DIGIT FOUR - \ue06b > \u096b; # DIGIT FIVE - \ue06c > \u096c; # DIGIT SIX - \ue06d > \u096d; # DIGIT SEVEN - \ue06e > \u096e; # DIGIT EIGHT - \ue06f > \u096f; # DIGIT NINE - \ue0f0 > \u0930; # FALLBACK RA - \ue0f1 > \u0930; # FALLBACK RA - - -# \u0970 # UNMAPPED Devanagari-InterIndic: ABBREVIATION SIGN -# :: NFC; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Gujarati.txt b/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Gujarati.txt deleted file mode 100755 index 746de3837b..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Gujarati.txt +++ /dev/null @@ -1,136 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_InterIndic_Gujarati.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# InterIndic_Gujarati -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:41:59 2001 -#-------------------------------------------------------------------- -# InterIndic-Gujarati -#:: NFD (NFC) ; -\ue001>\u0a81; # SIGN CANDRABINDU -\ue002>\u0a82; # SIGN ANUSVARA -\ue003>\u0a83; # SIGN VISARGA -\ue005>\u0a85; # LETTER A -\ue006>\u0a86; # LETTER AA -\ue007>\u0a87; # LETTER I -\ue008>\u0a88; # LETTER II -\ue009>\u0a89; # LETTER U -\ue00a>\u0a8a; # LETTER UU -\ue00b>\u0a8b; # LETTER VOCALIC R -\ue00c>\u0ab2\u0ac3; # REMAP (indicExceptions.txt): \u0a8c>\u0ab2\u0ac3 = LETTER VOCALIC L>LETTER LA.VOWEL SIGN VOCALIC R -\ue00d>\u0a8d; # GUJARATI VOWEL CANDRA E -\ue00e>\u0a8f; # FALLBACK -\ue00f>\u0a8f; # InterIndic-Gujarati: LETTER EE (\u0a8f = LETTER E) -\ue010>\u0a90; # LETTER AI -\ue011>\u0a91; # FALLBACK -\ue012>\u0a93; # FALLBACK -\ue013>\u0a93; # UNMAPPED InterIndic-Gujarati: LETTER OO (\u0a93 = LETTER O) -\ue014>\u0a94; # LETTER AU -\ue015>\u0a95; # LETTER KA -\ue016>\u0a96; # LETTER KHA -\ue017>\u0a97; # LETTER GA -\ue018>\u0a98; # LETTER GHA -\ue019>\u0a99; # LETTER NGA -\ue01a>\u0a9a; # LETTER CA -\ue01b>\u0a9b; # LETTER CHA -\ue01c>\u0a9c; # LETTER JA -\ue01d>\u0a9d; # LETTER JHA -\ue01e>\u0a9e; # LETTER NYA -\ue01f>\u0a9f; # LETTER TTA -\ue020>\u0aa0; # LETTER TTHA -\ue021>\u0aa1; # LETTER DDA -\ue022>\u0aa2; # LETTER DDHA -\ue023>\u0aa3; # LETTER NNA -\ue024>\u0aa4; # LETTER TA -\ue025>\u0aa5; # LETTER THA -\ue026>\u0aa6; # LETTER DA -\ue027>\u0aa7; # LETTER DHA -\ue028>\u0aa8; # LETTER NA -\ue029>\u0aa8\u0abc; # FALLBACK to NA+NUKTA -\ue02a>\u0aaa; # LETTER PA -\ue02b>\u0aab; # LETTER PHA -\ue02c>\u0aac; # LETTER BA -\ue02d>\u0aad; # LETTER BHA -\ue02e>\u0aae; # LETTER MA -\ue02f>\u0aaf; # LETTER YA -\ue030>\u0ab0; # LETTER RA -\ue031>\u0ab0\u0abc; # FALLBACK -\ue032>\u0ab2; # LETTER LA -\ue033>\u0ab3; # LETTER LLA -\ue034>\u0ab3\u0abc; # LETTER LLLA>LETTER LLA+NUKTA -\ue035>\u0ab5; # LETTER VA -\ue036>\u0ab6; # LETTER SHA -\ue037>\u0ab7; # LETTER SSA -\ue038>\u0ab8; # LETTER SA -\ue039>\u0ab9; # LETTER HA -\ue03c>\u0abc; # SIGN NUKTA -\ue03d>\u0abd; # SIGN AVAGRAHA -\ue03e>\u0abe; # VOWEL SIGN AA -\ue03f>\u0abf; # VOWEL SIGN I -\ue040>\u0ac0; # VOWEL SIGN II -\ue041>\u0ac1; # VOWEL SIGN U -\ue042>\u0ac2; # VOWEL SIGN UU -\ue043>\u0ac3; # VOWEL SIGN VOCALIC R -\ue044>\u0ac4; # VOWEL SIGN VOCALIC RR -\ue045>\u0ac5; # VOWEL SIGN CANDRA E -\ue046>\u0ac7; # FALLBACK -\ue047>\u0ac7; # InterIndic-Gujarati: VOWEL SIGN EE (\u0ac7 = VOWEL SIGN E) -\ue048>\u0ac8; # VOWEL SIGN AI -\ue049>\u0ac9; # VOWEL SIGN CANDRA O -\ue04a>\u0acb; # FALLBACK -\ue04b>\u0acb; # UNMAPPED InterIndic-Gujarati: VOWEL SIGN OO (\u0acb = VOWEL SIGN O) -\ue04c>\u0acc; # VOWEL SIGN AU -\ue04d>\u0acd; # SIGN VIRAMA -\ue050>\u0ad0; # OM -\ue051>; -\ue052>; -\ue053>; -\ue054>; -\ue055>; # UNMAPPED InterIndic-Gujarati: LENGTH MARK -\ue056>\u0ac8; # REMAP (indicExceptions.txt): \u0ad6>\u0ac8 = AI LENGTH MARK>VOWEL SIGN AI -\ue057>\u0acc; # REMAP (indicExceptions.txt): \u0ad7>\u0acc = AU LENGTH MARK>VOWEL SIGN AU -\ue058>\u0a95\u0abc; # FALLBACK -\ue059>\u0a96\u0abc; # REMAP (indicExceptions.txt): \u0ad9>\u0a96\u0abc = LETTER KHHA>LETTER KHA.SIGN NUKTA -\ue05a>\u0a97\u0abc; # REMAP (indicExceptions.txt): \u0ada>\u0a97\u0abc = LETTER GHHA>LETTER GA.SIGN NUKTA -\ue05b>\u0a9c\u0abc; # REMAP (indicExceptions.txt): \u0adb>\u0a9c\u0abc = LETTER ZA>LETTER JA.SIGN NUKTA -\ue05c>\u0aa1\u0abc; # FALLBACK -\ue05d>\u0aa2\u0abc; # REMAP (indicExceptions.txt): \u0add>\u0aa2\u0abc = LETTER RHA>LETTER DDHA.SIGN NUKTA -\ue05e>\u0aab\u0abc; # REMAP (indicExceptions.txt): \u0ade>\u0aab\u0abc = LETTER FA>LETTER PHA.SIGN NUKTA -\ue05f>\u0aaf\u0abc; # REMAP (indicExceptions.txt): \u0adf>\u0aaf\u0abc = LETTER YYA>LETTER YA.SIGN NUKTA -\ue060>\u0ae0; # LETTER VOCALIC RR -\ue061>\u0ab2\u0ac3; # REMAP (indicExceptions.txt): \u0ae1>\u0ab2\u0ac3 = LETTER VOCALIC LL>LETTER LA.VOWEL SIGN VOCALIC R -\ue062>\u0abf\u0abc; # REMAP (indicExceptions.txt): \u0ae2>\u0abf\u0abc = VOWEL SIGN VOCALIC L>VOWEL SIGN I.SIGN NUKTA -\ue063>\u0ac0\u0abc; # REMAP (indicExceptions.txt): \u0ae3>\u0ac0\u0abc = VOWEL SIGN VOCALIC LL>VOWEL SIGN II.SIGN NUKTA -\uE064>\u0964; # DANDA -\uE065>\u0965; # DOUBLE DANDA -\ue066>\u0ae6; # DIGIT ZERO -\ue067>\u0ae7; # DIGIT ONE -\ue068>\u0ae8; # DIGIT TWO -\ue069>\u0ae9; # DIGIT THREE -\ue06a>\u0aea; # DIGIT FOUR -\ue06b>\u0aeb; # DIGIT FIVE -\ue06c>\u0aec; # DIGIT SIX -\ue06d>\u0aed; # DIGIT SEVEN -\ue06e>\u0aee; # DIGIT EIGHT -\ue06f>\u0aef; # DIGIT NINE -\ue070>; -\ue071>; -\ue072>; -\ue073>; -\ue074>; -0 > \u0ae6; # FALLBACK FOR TAMIL -1 > \u0ae7; -\ue0f0 > \u0ab0; # FALLBACK RA -\ue0f1 > \u0ab0; # FALLBACK RA -#\ue080>; # UNMAPPED InterIndic-Gujarati: ISSHAR -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Gurmukhi.txt b/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Gurmukhi.txt deleted file mode 100755 index 72b68b9dfb..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Gurmukhi.txt +++ /dev/null @@ -1,141 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_InterIndic_Gurmukhi.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# InterIndic_Gurmukhi -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:42:00 2001 -#-------------------------------------------------------------------- -# InterIndic-Gurmukhi -#:: NFD (NFC) ; -\ue001>\u0a02; # REMAP (indicExceptions.txt): \u0a01>\u0a02 = SIGN CANDRABINDU>SIGN BINDI -\ue002>; # FALLBACK BLOW AWAY SIGN ANUSVARA (\u0a02 = SIGN BINDI) -\ue003>; # FALLBACK BLOW AWAY SIGN VISARGA -\ue005>\u0a05; # LETTER A -\ue006>\u0a06; # LETTER AA -\ue007>\u0a07; # LETTER I -\ue008>\u0a08; # LETTER II -\ue009>\u0a09; # LETTER U -\ue00a>\u0a0a; # LETTER UU -\ue00b>\u0a30\u0a3f; # REMAP (indicExceptions.txt): \u0a0b>\u0a30\u0a3f = LETTER VOCALIC R>LETTER RA.VOWEL SIGN I -\ue00c>\u0a33; # FALLBACK -\ue00d>\u0a0f; # FALLBACK -\ue00e>\u0a0f; # FALLBACK -\ue00f>\u0a0f; # LETTER EE -\ue010>\u0a10; # LETTER AI -\ue011>\u0a13; # FALLBACK -\ue012>\u0a13; # FALLBACK -\ue013>\u0a13; # LETTER OO -\ue014>\u0a14; # LETTER AU -\ue015>\u0a15; # LETTER KA -\ue016>\u0a16; # LETTER KHA -\ue017>\u0a17; # LETTER GA -\ue018>\u0a18; # LETTER GHA -\ue019>\u0a19; # LETTER NGA -\ue01a>\u0a1a; # LETTER CA -\ue01b>\u0a1b; # LETTER CHA -\ue01c>\u0a1c; # LETTER JA -\ue01d>\u0a1d; # LETTER JHA -\ue01e>\u0a1e; # LETTER NYA -\ue01f>\u0a1f; # LETTER TTA -\ue020>\u0a20; # LETTER TTHA -\ue021>\u0a21; # LETTER DDA -\ue022>\u0a22; # LETTER DDHA -\ue023>\u0a23; # LETTER NNA -\ue024>\u0a24; # LETTER TA -\ue025>\u0a25; # LETTER THA -\ue026>\u0a26; # LETTER DA -\ue027>\u0a27; # LETTER DHA -\ue028>\u0a28; # LETTER NA -\ue029>\u0a28\u0a3c; # REMAP (indicExceptions.txt): \u0a29>\u0a28 = LETTER NNNA>LETTER NA -\ue02a>\u0a2a; # LETTER PA -\ue02b>\u0a2b; # LETTER PHA -\ue02c>\u0a2c; # LETTER BA -\ue02d>\u0a2d; # LETTER BHA -\ue02e>\u0a2e; # LETTER MA -\ue02f>\u0a2f; # LETTER YA -\ue030>\u0a30; # LETTER RA -\ue031>\u0a30\u0a3c; # FALLBACK LETTER RA+NUKTA -\ue032>\u0a32; # LETTER LA -\ue033>\u0a33; # LETTER LLA -\ue034>\u0a33; # REMAP (indicExceptions.txt): \u0a34>\u0a33 = LETTER LLLA>LETTER LLA -\ue035>\u0a35; # LETTER VA -\ue036>\u0a36; # LETTER SHA -\ue037>\u0a36; # REMAP (indicExceptions.txt): \u0a37>\u0a36 = LETTER SSA>LETTER SHA -\ue038>\u0a38; # LETTER SA -\ue039>\u0a39; # LETTER HA -\ue03c>\u0a3c; # SIGN NUKTA -\ue03d>; # FALLBACK BLOW AWAY SIGN AVAGRAHA -\ue03e>\u0a3e; # VOWEL SIGN AA -\ue03f>\u0a3f; # VOWEL SIGN I -\ue040>\u0a40; # VOWEL SIGN II -\ue041>\u0a41; # VOWEL SIGN U -\ue042>\u0a42; # VOWEL SIGN UU -\ue043>; # FALLBACK BLOW AWAY VOWEL SIGN VOCALIC R -\ue044>; # FALLBACK BLOW AWAY VOWEL SIGN VOCALIC RR -\ue045>\u0a48; # REMAP (indicExceptions.txt): \u0a45>\u0a48 = VOWEL SIGN CANDRA E>VOWEL SIGN AI -\ue046>\u0a47; # FALLABCK -\ue047>\u0a47; # VOWEL SIGN EE -\ue048>\u0a48; # VOWEL SIGN AI -\ue049>\u0a4c; # REMAP (indicExceptions.txt): \u0a49>\u0a4c = VOWEL SIGN CANDRA O>VOWEL SIGN AU -\ue04a>\u0a4b; # FALLBACK -\ue04b>\u0a4b; # VOWEL SIGN OO -\ue04c>\u0a4c; # VOWEL SIGN AU -\ue04d>\u0a4d; # SIGN VIRAMA -\ue050>\u0a0f\u0a02; # FALLBACK to OO+BINDI : OM -\ue051>; -\ue052>; -\ue053>; -\ue054>; -\ue055>; # FALLBACK BLOW AWAY LENGTH MARK -\ue056>\u0a48; # REMAP (indicExceptions.txt): \u0a56>\u0a48 = AI LENGTH MARK>VOWEL SIGN AI -\ue057>\u0a4c; # REMAP (indicExceptions.txt): \u0a57>\u0a4c = AU LENGTH MARK>VOWEL SIGN AU -\ue058>\u0a15\u0a3c; # FALLBACK RA+ NUKTA -\ue059>\u0a59; # LETTER KHHA -\ue05a>\u0a5a; # LETTER GHHA -\ue05b>\u0a5b; # LETTER ZA -\ue05c>\u0a5c; # LETTER RRA -\ue05d>\u0a22\u0a3c; # REMAP (indicExceptions.txt): \u0a5d>\u0a22\u0a3c = LETTER RHA>LETTER DDHA.SIGN NUKTA -\ue05e>\u0a5e; # LETTER FA -\ue05f>\u0a2f\u0a3c; # REMAP (indicExceptions.txt): \u0a5f>\u0a2f = LETTER YYA>LETTER YA -\ue060>\u0a30\u0a3f; # REMAP (indicExceptions.txt): \u0a60>\u0a30\u0a3f = LETTER VOCALIC RR>LETTER RA.VOWEL SIGN I -\ue061>\u0a33\u0a3c; # -\ue062>\u0a3f\u0a3c; # REMAP (indicExceptions.txt): \u0a62>\u0a3f\u0a3c = VOWEL SIGN VOCALIC L>VOWEL SIGN I.SIGN NUKTA -\ue063>\u0a40\u0a3c; # REMAP (indicExceptions.txt): \u0a63>\u0a40\u0a3c = VOWEL SIGN VOCALIC LL>VOWEL SIGN II.SIGN NUKTA -\uE064>\u0964; # DANDA -\uE065>\u0965; # DOUBLE DANDA -\ue066>\u0a66; # DIGIT ZERO -\ue067>\u0a67; # DIGIT ONE -\ue068>\u0a68; # DIGIT TWO -\ue069>\u0a69; # DIGIT THREE -\ue06a>\u0a6a; # DIGIT FOUR -\ue06b>\u0a6b; # DIGIT FIVE -\ue06c>\u0a6c; # DIGIT SIX -\ue06d>\u0a6d; # DIGIT SEVEN -\ue06e>\u0a6e; # DIGIT EIGHT -\ue06f>\u0a6f; # DIGIT NINE -\ue070>\u0a70; # TIPPI -\ue071>\u0a71; # ADDAK -\ue072>\u0a72; # IRI -\ue073>\u0a73; # URA -\ue074>\u0a74; # EK ONKAR -\ue080>; # FALLBACK BLOW AWAY ISSHAR -\ue081>; # FALLBACK BLOW AWAY LETTER E -\ue082>; # FALLBACK BLOW AWAY LETTER O (\u0a02 = SIGN BINDI) -\ue084>; # FALLBACK BLOW AWAY VOWEL SIGN E -\ue085>; # FALLBACK BLOW AWAY VOWEL SIGN O (\u0a05 = LETTER A) - -0 > \u0a66; # FALLBACK FOR TAMIL -1 > \u0a67; -\ue0f0 > \u0a30; # FALLBACK RA -\ue0f1 > \u0a30; # FALLBACK RA -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Kannada.txt b/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Kannada.txt deleted file mode 100755 index 6ed1b54b3d..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Kannada.txt +++ /dev/null @@ -1,140 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_InterIndic_Kannada.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# InterIndic_Kannada -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:42:00 2001 -#-------------------------------------------------------------------- -# InterIndic-Kannada -#:: NFD (NFC) ; -\ue02b\ue03c>\u0cde; # LETTER FA -\ue001>\u0c82; # REMAP (indicExceptions.txt): \u0c81>\u0c82 = SIGN CANDRABINDU>SIGN ANUSVARA -\ue002>\u0c82; # SIGN ANUSVARA -\ue003>\u0c83; # SIGN VISARGA -\ue005>\u0c85; # LETTER A -\ue006>\u0c86; # LETTER AA -\ue007>\u0c87; # LETTER I -\ue008>\u0c88; # LETTER II -\ue009>\u0c89; # LETTER U -\ue00a>\u0c8a; # LETTER UU -\ue00b>\u0c8b; # LETTER VOCALIC R -\ue00c>\u0c8c; # LETTER VOCALIC L -\ue00d>\u0c8e; # LETTER E -\ue00e>\u0c8e; # FALLBACK -\ue00f>\u0c8f; # LETTER EE -\ue010>\u0c90; # LETTER AI -\ue011>\u0c92; # FALLBACK -\ue012>\u0c92; # LETTER O -\ue013>\u0c93; # LETTER OO -\ue014>\u0c94; # LETTER AU -\ue015>\u0c95; # LETTER KA -\ue016>\u0c96; # LETTER KHA -\ue017>\u0c97; # LETTER GA -\ue018>\u0c98; # LETTER GHA -\ue019>\u0c99; # LETTER NGA -\ue01a>\u0c9a; # LETTER CA -\ue01b>\u0c9b; # LETTER CHA -\ue01c>\u0c9c; # LETTER JA -\ue01d>\u0c9d; # LETTER JHA -\ue01e>\u0c9e; # LETTER NYA -\ue01f>\u0c9f; # LETTER TTA -\ue020>\u0ca0; # LETTER TTHA -\ue021>\u0ca1; # LETTER DDA -\ue022>\u0ca2; # LETTER DDHA -\ue023>\u0ca3; # LETTER NNA -\ue024>\u0ca4; # LETTER TA -\ue025>\u0ca5; # LETTER THA -\ue026>\u0ca6; # LETTER DA -\ue027>\u0ca7; # LETTER DHA -\ue028>\u0ca8; # LETTER NA -\ue029>\u0ca8; # REMAP (indicExceptions.txt): \u0ca9>\u0ca8 = LETTER NNNA>LETTER NA -\ue02a>\u0caa; # LETTER PA -\ue02b>\u0cab; # LETTER PHA -\ue02c>\u0cac; # LETTER BA -\ue02d>\u0cad; # LETTER BHA -\ue02e>\u0cae; # LETTER MA -\ue02f>\u0caf; # LETTER YA -\ue030\ue03c>\u0cb1; -\ue030>\u0cb0; # LETTER RA -\ue031>\u0cb1; # LETTER RRA -\ue032>\u0cb2; # LETTER LA -\ue033>\u0cb3; # LETTER LLA -\ue034>\u0cb3; # REMAP (indicExceptions.txt): \u0cb4>\u0cb3 = LETTER LLLA>LETTER LLA -\ue035>\u0cb5; # LETTER VA -\ue036>\u0cb6; # LETTER SHA -\ue037>\u0cb7; # LETTER SSA -\ue038>\u0cb8; # LETTER SA -\ue039>\u0cb9; # LETTER HA - -\ue03c>; # FALLBACK BLOW AWAY NUKTA -\ue03d>; # FALLBACK BLOW AWAY AVAGRAHA - -\ue03e>\u0cbe; # VOWEL SIGN AA -\ue03f>\u0cbf; # VOWEL SIGN I -\ue040>\u0cc0; # VOWEL SIGN II -\ue041>\u0cc1; # VOWEL SIGN U -\ue042>\u0cc2; # VOWEL SIGN UU -\ue043>\u0cc3; # VOWEL SIGN VOCALIC R -\ue044>\u0cc4; # VOWEL SIGN VOCALIC RR -\ue045>\u0cc6; # REMAP (indicExceptions.txt): \u0cc5>\u0cc6 = VOWEL SIGN CANDRA E>VOWEL SIGN E -\ue046>\u0cc6; # VOWEL SIGN E -\ue047>\u0cc7; # VOWEL SIGN EE -\ue048>\u0cc8; # VOWEL SIGN AI -\ue049>\u0cca; # REMAP (indicExceptions.txt): \u0cc9>\u0cca = VOWEL SIGN CANDRA O>VOWEL SIGN O -\ue04a>\u0cca; # VOWEL SIGN O -\ue04b>\u0ccb; # VOWEL SIGN OO -\ue04c>\u0ccc; # VOWEL SIGN AU -\ue04d>\u0ccd; # SIGN VIRAMA -\ue050>\u0c93\u0c82; # REMAP (indicExceptions.txt): \u0cd0>\u0c93\u0c82 = OM>LETTER OO.SIGN ANUSVARA -\ue051>; -\ue052>; -\ue053>; -\ue054>; -\ue055>\u0cd5; # LENGTH MARK -\ue056>\u0cd6; # AI LENGTH MARK -\ue057>\u0ccc; # REMAP (indicExceptions.txt): \u0cd7>\u0ccc = AU LENGTH MARK>VOWEL SIGN AU -\ue058>\u0c95; # FALLBACK -\ue059>\u0c96; # REMAP (indicExceptions.txt): \u0cd9>\u0c96 = LETTER KHHA>LETTER KHA -\ue05a>\u0c97; # REMAP (indicExceptions.txt): \u0cda>\u0c97 = LETTER GHHA>LETTER GA -\ue05b>\u0c9c; # REMAP (indicExceptions.txt): \u0cdb>\u0c9c = LETTER ZA>LETTER JA -\ue05c>\u0ca2; # FALLBACK -\ue05d>\u0ca2; # REMAP (indicExceptions.txt): \u0cdd>\u0ca2 = LETTER RHA>LETTER DDHA -\ue05e>\u0cde; # LETTER FA -\ue05f>\u0caf; # REMAP (indicExceptions.txt): \u0cdf>\u0caf = LETTER YYA>LETTER YA -\ue060>\u0ce0; # LETTER VOCALIC RR -\ue061>\u0ce1; # LETTER VOCALIC LL -\ue062>\u0cbf; # REMAP (indicExceptions.txt): \u0ce2>\u0cbf = VOWEL SIGN VOCALIC L>VOWEL SIGN I -\ue063>\u0cc0; # REMAP (indicExceptions.txt): \u0ce3>\u0cc0 = VOWEL SIGN VOCALIC LL>VOWEL SIGN II -\ue064>'.' ; # FALLBACK FOR DANDA -\ue065>'.' ; # FALLBACK FOR DOUBLE DANDA -\ue066>\u0ce6; # DIGIT ZERO -\ue067>\u0ce7; # DIGIT ONE -\ue068>\u0ce8; # DIGIT TWO -\ue069>\u0ce9; # DIGIT THREE -\ue06a>\u0cea; # DIGIT FOUR -\ue06b>\u0ceb; # DIGIT FIVE -\ue06c>\u0cec; # DIGIT SIX -\ue06d>\u0ced; # DIGIT SEVEN -\ue06e>\u0cee; # DIGIT EIGHT -\ue06f>\u0cef; # DIGIT NINE -\ue080>; # UNMAPPED InterIndic-Kannada: ISSHAR -\ue070>; -\ue071>; -\ue072>; -\ue073>; -\ue074>; -0 > \u0ce6; # FALLBACK FOR TAMIL -1 > \u0ce7; -\ue0f0 > \u0cb0; # FALLBACK RA -\ue0f1 > \u0cb0; # FALLBACK RA -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Latin.txt b/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Latin.txt deleted file mode 100755 index 511e4c01ed..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Latin.txt +++ /dev/null @@ -1,522 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 2001-2004, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# InterIndic-Latin - #\u0e00 reserved - #consonants - $chandrabindu=\ue001; - $anusvara=\ue002; - $visarga=\ue003; - #\u0e004 reserved - # w represents the stand-alone form - $wa=\ue005; - $waa=\ue006; - $wi=\ue007; - $wii=\ue008; - $wu=\ue009; - $wuu=\ue00a; - $wr=\ue00b; - $wl=\ue00c; - $wce=\ue00d; # LETTER CANDRA E - $wse=\ue00e; # LETTER SHORT E - $we=\ue00f; # \u090f LETTER E - $wai=\ue010; - $wco=\ue011; # LETTER CANDRA O - $wso=\ue012; # LETTER SHORT O - $wo=\ue013; # \u0913 LETTER O - $wau=\ue014; - $ka=\ue015; - $kha=\ue016; - $ga=\ue017; - $gha=\ue018; - $nga=\ue019; - $ca=\ue01a; - $cha=\ue01b; - $ja=\ue01c; - $jha=\ue01d; - $nya=\ue01e; - $tta=\ue01f; - $ttha=\ue020; - $dda=\ue021; - $ddha=\ue022; - $nna=\ue023; - $ta=\ue024; - $tha=\ue025; - $da=\ue026; - $dha=\ue027; - $na=\ue028; - $ena=\ue029; #compatibility - $pa=\ue02a; - $pha=\ue02b; - $ba=\ue02c; - $bha=\ue02d; - $ma=\ue02e; - $ya=\ue02f; - $ra=\ue030; - $rra=\ue031; - $la=\ue032; - $lla=\ue033; - $ela=\ue034; #compatibility - $va=\ue035; - $sha=\ue036; - $ssa=\ue037; - $sa=\ue038; - $ha=\ue039; -#\u093a Reserved -#\u093b Reserved - $nukta=\ue03c; - $avagraha=\ue03d; # SIGN AVAGRAHA - # represents the dependent form - $aa=\ue03e; - $i=\ue03f; - $ii=\ue040; - $u=\ue041; - $uu=\ue042; - $rh=\ue043; - $lh=\ue044; - $ce=\ue045; #VOWEL SIGN CANDRA E - $se=\ue046; #VOWEL SIGN SHORT E - $e=\ue047; - $ai=\ue048; - $co=\ue049; # VOWEL SIGN CANDRA O - $so=\ue04a; # VOWEL SIGN SHORT O - $o=\ue04b; # \u094b - $au=\ue04c; - $virama=\ue04d; -# \u094e Reserved -# \u094f Reserved - $om=\ue050; # OM - \ue051>; # UNMAPPED STRESS SIGN UDATTA - \ue052>; # UNMAPPED STRESS SIGN ANUDATTA - \ue053>; # UNMAPPED GRAVE ACCENT - \ue054>; # UNMAPPED ACUTE ACCENT - $lm = \ue055;# Telugu Length Mark - $ailm=\ue056;# AI Length Mark - $aulm=\ue057;# AU Length Mark - #urdu compatibity forms - $uka=\ue058; - $ukha=\ue059; - $ugha=\ue05a; - $ujha=\ue05b; - $uddha=\ue05c; - $udha=\ue05d; - $ufa=\ue05e; - $uya=\ue05f; - $wrr=\ue060; - $wll=\ue061; - $rrh=\ue062; - $llh=\ue063; - $danda=\ue064; - $doubleDanda=\ue065; - $zero=\ue066; # DIGIT ZERO - $one=\ue067; # DIGIT ONE - $two=\ue068; # DIGIT TWO - $three=\ue069; # DIGIT THREE - $four=\ue06a; # DIGIT FOUR - $five=\ue06b; # DIGIT FIVE - $six=\ue06c; # DIGIT SIX - $seven=\ue06d; # DIGIT SEVEN - $eight=\ue06e; # DIGIT EIGHT - $nine=\ue06f; # DIGIT NINE - # For all other scripts - $ecp0=\ue070; - $ecp1=\ue071; - $ecp2=\ue072; - $ecp3=\ue073; - $ecp4=\ue074; - $ecp5=\ue075; - $ecp6=\ue076; - $ecp7=\ue077; - $ecp8=\ue078; - $ecp9=\ue079; - $ecpA=\ue07a; - $ecpB=\ue07b; - $ecpC=\ue07c; - $ecpD=\ue07d; - $ecpE=\ue07e; - $ecpF=\ue07f; -# \u0970>; # UNMAPPED ABBREVIATION SIGN - $depVowelAbove=[\ue03e-\ue040\ue045-\ue04c]; - $depVowelBelow=[\ue041-\ue044]; - # $x was originally called '&'; $z was '%' - $x=[$aa$ai$au$ii$i$uu$u$rrh$rh$lh$llh$e$o$se$ce$so$co]; - $z=[bcdfghjklmnpqrstvwxyz]; - $vowels=[aeiour\u0304\u0325\u0306]; - $forceIndependentMatra = [^[[:L:][\u0300-\u034c]]]; - ###################################################################### - # convert from Native letters to Latin letters - ###################################################################### - #transliterations for anusvara - $anusvara} [$ka$kha$ga$gha$nga] > n\u0307; - $anusvara} [$ca$cha$ja$jha$nya] > n\u0304; - $anusvara} [$tta$ttha$dda$ddha$nna] > n\u0323; - $anusvara} [$ta$tha$da$dha$na] > n ; - $anusvara} [$pa$pha$ba$bha$ma] > m ; - $anusvara} [$ya$ra$lla$la$va$ssa$sha$sa$ha] > n ; - $anusvara> m\u0307; - - # Urdu compatibility - $ya$nukta}$x > y\u0307 ; - $ya$nukta$virama > y\u0307 ; - $ya$nukta > y\u0307a ; - - $la$nukta }$x > l\u0331 ; - $la$nukta$virama > l\u0331 ; - $la$nukta > l\u0331a ; - - $na$nukta }$x > n\u0331 ; - $na$nukta$virama > n\u0331 ; - $na$nukta > n\u0331a ; - - $ena }$x > n\u0331 ; - $ena$virama > n\u0331 ; - $ena > n\u0331a ; - $ka$nukta }$x > q ; - $ka$nukta$virama > q ; - $ka$nukta > qa ; - $kha$nukta }$x > k\u0331h\u0331 ; - $kha$nukta$virama > k\u0331h\u0331 ; - $kha$nukta > k\u0331h\u0331a ; - $ukha$virama > k\u0331h\u0331; - $ukha > k\u0331h\u0331a; - $ga$nukta }$x > g\u0307 ; - $ga$nukta$virama > g\u0307 ; - $ga$nukta > g\u0307a ; - $ja$nukta }$x > z ; - $ja$nukta$virama > z ; - $ja$nukta > za ; - $ddha$nukta}$x > r\u0323h ; - $ddha$nukta$virama > r\u0323h ; - $ddha$nukta > r\u0323ha; - - $uddha}$x > r\u0323 ; - $uddha$virama > r\u0323 ; - $uddha > r\u0323a; - - $dda$nukta}$x > r\u0323 ; - $dda$nukta$virama > r\u0323 ; - $dda$nukta > r\u0323a ; - $pha$nukta }$x > f ; - $pha$nukta$virama > f ; - $pha$nukta > fa ; - $ufa }$x > f ; - $ufa$virama > f ; - $ufa > fa ; - - $ra$nukta}$x > r\u0331; - $ra$nukta$virama > r\u0331; - $ra$nukta > r\u0331a; - $lla$nukta}$x > l\u0331; - $lla$nukta$virama > l\u0331; - $lla$nukta > l\u0331a; - - $ela}$x > l\u0331; - $ela$virama > l\u0331; - $ela > l\u0331a; - - $uya}$x > y\u0307; - $uya$virama > y\u0307; - $uya > y\u0307a; - - - # normal consonants - $ka$virama}$ha>k''; - $ka}$x>k; - $ka$virama>k; - $ka>ka; - $kha}$x>kh; - $kha$virama>kh; - $kha>kha; - $ga$virama}$ha>g''; - $ga}$x>g; - $ga$virama>g; - $ga>ga; - - $gha}$x>gh; - $gha$virama>gh; - $gha>gha; - - $nga}$x>n\u0307; - $nga$virama>n\u0307; - $nga>n\u0307a ; - $ca$virama}$ha>c''; - $ca}$x>c; - $ca$virama>c; - $ca>ca; - - $cha}$x>ch; - $cha$virama>ch; - $cha>cha; - $ja$virama}$ha>j''; - $ja}$x>j; - $ja$virama>j; - $ja>ja; - - $jha}$x>jh; - $jha$virama>jh; - $jha>jha; - - $nya }$x>n\u0303 ; - $nya$virama>n\u0303; - $nya > n\u0303a ; - - - $tta$virama}$ha>t\u0323''; - $tta}$x>t\u0323; - $tta$virama>t\u0323; - $tta>t\u0323a; - - $ttha}$x>t\u0323h; - $ttha$virama>t\u0323h; - $ttha>t\u0323ha; - $dda}$x$ha>d\u0323''; - $dda}$x>d\u0323; - $dda$virama>d\u0323; - $dda>d\u0323a; - - $ddha}$x>d\u0323h; - $ddha$virama>d\u0323h; - $ddha>d\u0323ha; - - $nna}$x>n\u0323 ; - $nna$virama>n\u0323; - $nna>n\u0323a ; - - - $ta$virama}$ha>t''; - $ta$virama}$ttha>t''; - $ta$virama}$tta>t''; - $ta$virama}$tha>t''; - $ta}$x>t; - $ta$virama>t; - $ta>ta; - $tha}$x>th; - $tha$virama>th; - $tha>tha; - - $da$virama}$ha>d''; - $da$virama}$ddha>d''; - $da$virama}$dda>d''; - $da$virama}$dha>d''; - $da}$x>d; - $da$virama>d; - $da>da; - $dha}$x>dh; - $dha$virama>dh; - $dha>dha; - $na$virama}$ga>n''; - $na$virama}$ya>n''; - $na}$x>n; - $na$virama>n; - $na>na; - - - $pa$virama}$ha>p''; - $pa}$x>p; - $pa$virama>p; - $pa>pa; - $pha}$x>ph; - $pha$virama>ph; - $pha>pha; - $ba$virama}$ha>b''; - $ba}$x>b; - $ba$virama>b; - $ba>ba; - - $bha}$x>bh; - $bha$virama>bh; - $bha>bha; - - $ma$virama}$ma>m''; - $ma}$x>m; - $ma$virama>m; - $ma>ma; - - $ya}$x>y; - $ya$virama>y; - $ya>ya; - $ra$virama}$ha>r''; - $ra}$x>r; - $ra$virama>r; - $ra>ra; - $rra$virama}$ha>r\u0331''; - $rra}$x>r\u0331; - $rra$virama>r\u0331; - $rra>r\u0331a; - $la$virama}$ha>l''; - $la}$x>l; - $la$virama>l; - $la>la; - $lla$virama}$ha>l\u0323''; - $lla}$x>l\u0323; - $lla$virama>l\u0323; - $lla>l\u0323a; - $va}$x>v; - $va$virama>v; - $va>va; - $sa$virama}$ha>s''; - $sa$virama}$sha>s''; - $sa$virama}$ssa>s''; - $sa$virama}$sa>s''; - $sa}$x>s; - $sa$virama>s; - - #for gurmukhi - $sa$nukta}$x>s\u0301; - $sa$nukta$virama>s\u0301; - $sa$nukta>s\u0301a; - $sa>sa; - - $sha}$x>s\u0301; - $sha$virama>s\u0301; - $sha>s\u0301a; - - $ssa}$x>s\u0323; - $ssa$virama>s\u0323; - $ssa>s\u0323a; - $ha}$x>h; - $ha$virama>h; - $ha>ha; - - # dependent vowels (should never occur except following consonants) - $forceIndependentMatra{$aa > \u0314a\u0304 ; - $forceIndependentMatra{$ai > \u0314ai ; - $forceIndependentMatra{$au > \u0314au ; - $forceIndependentMatra{$ii > \u0314i\u0304 ; - $forceIndependentMatra{$i > \u0314i ; - $forceIndependentMatra{$uu > \u0314u\u0304 ; - $forceIndependentMatra{$u > \u0314u ; - $forceIndependentMatra{$rrh > \u0314r\u0325\u0304 ; - $forceIndependentMatra{$rh > \u0314r\u0325 ; - $forceIndependentMatra{$llh > \u0314l\u0325\u0304 ; - $forceIndependentMatra{$lh > \u0314l\u0325 ; - $forceIndependentMatra{$e > \u0314e\u0304 ; - $forceIndependentMatra{$o > \u0314o\u0304 ; - #extra vowels - $forceIndependentMatra{$ce > \u0314e\u0306 ; - $forceIndependentMatra{$co > \u0314o\u0306 ; - $forceIndependentMatra{$se > \u0314e ; - $forceIndependentMatra{$so > \u0314o ; - $forceIndependentMatra{$nukta >; # Nukta cannot appear independently or as first character - $forceIndependentMatra{$virama >; # Virama cannot appear independently or as first character - $aa > a\u0304 ; - $ai > ai ; - $au > au ; - $ii > i\u0304 ; - $i > i ; - $uu > u\u0304 ; - $u > u ; - $rrh > r\u0325\u0304 ; - $rh > r\u0325 ; - $llh > l\u0325\u0304 ; - $lh > l\u0325 ; - $e > e\u0304 ; - $o > o\u0304 ; - #extra vowels - $ce > e\u0306 ; - $co > o\u0306 ; - $se > e ; - $so > o ; - #dependent vowels when following independent vowels. Generally Illegal only for roundtripping - $waa} $x > a\u0304\u0314 ; - $wai} $x > ai\u0314 ; - $wau} $x > au\u0314 ; - $wii} $x > i\u0304\u0314 ; - $wi } $x > i\u0314 ; - $wuu} $x > u\u0304\u0314 ; - $wu } $x > u\u0314 ; - $wrr} $x > r\u0325\u0304\u0314 ; - $wr } $x > r\u0325\u0314 ; - $wll} $x > l\u0325\u0304\u0314 ; - $wl } $x > l\u0325\u0314 ; - $we } $x > e\u0304\u0314 ; - $wo } $x > o\u0304\u0314 ; - $wa } $x > a\u0314 ; - #extra vowels - $wce} $x > e\u0306\u0314 ; - $wco} $x > o\u0306\u0314 ; - $wse} $x > e\u0314 ; - $wso} $x > o\u0314 ; - $om} $x > ''om\u0314 ; - - # independent vowels when preceeded by vowels - $vowels{$waa > ''a\u0304 ; - $vowels{$wai > ''ai ; - $vowels{$wau > ''au ; - $vowels{$wii > ''i\u0304 ; - $vowels{$wi > ''i ; - $vowels{$wuu > ''u\u0304 ; - $vowels{$wu > ''u ; - $vowels{$wrr > ''r\u0325\u0304 ; - $vowels{$wr > ''r\u0325 ; - $vowels{$wll > ''l\u0325\u0304 ; - $vowels{$wl > ''l\u0325 ; - $vowels{$we > ''e\u0304 ; - $vowels{$wo > ''o\u0304 ; - $vowels{$wa > ''a ; - #extra vowels - $vowels{$wce > ''e\u0306 ; - $vowels{$wco > ''o\u0306 ; - $vowels{$wse > ''e ; - $vowels{$wso > ''o ; - - # independent vowels (otherwise) - $waa > a\u0304 ; - $wai > ai ; - $wau > au ; - $wii > i\u0304 ; - $wi > i ; - $wuu > u\u0304 ; - $wu > u ; - $wrr > r\u0325\u0304 ; - $wr > r\u0325 ; - $wll > l\u0325\u0304 ; - $wl > l\u0325 ; - $we > e\u0304 ; - $wo > o\u0304 ; - $wa > a ; - #extra vowels - $wce > e\u0306 ; - $wco > o\u0306 ; - $wse > e ; - $wso > o ; - $om > ''om ; - - #stress marks - $avagraha > \u0315; - $chandrabindu$anusvara>\u0303; - $chandrabindu > m\u0310; - $visarga>h\u0323; - #numbers - $zero > 0; - $one > 1; - $two > 2; - $three > 3; - $four > 4; - $five > 5; - $six > 6; - $seven > 7; - $eight > 8; - $nine > 9; - $lm >; - $ailm >; - $aulm >; - $ecp0 >; - $ecp1 >; - $ecp2 >; - $ecp3 >; - $ecp4 >; - $ecp5 >; - $ecp6 >; - $ecp7 >; - $ecp8 >; - $ecp9 >; - $ecpA >; - $ecpB >; - $ecpC >; - $ecpD >; - $ecpE >; - $ecpF >; - $danda>'.'; - $doubleDanda>'.'; \ No newline at end of file diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Malayalam.txt b/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Malayalam.txt deleted file mode 100755 index fc7201fdfc..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Malayalam.txt +++ /dev/null @@ -1,142 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_InterIndic_Malayalam.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# InterIndic_Malayalam -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:42:00 2001 -#-------------------------------------------------------------------- -# InterIndic-Malayalam -#:: NFD (NFC) ; -\ue001>\u0d02; # REMAP (indicExceptions.txt): \u0d01>\u0d02 = SIGN CANDRABINDU>SIGN ANUSVARA -\ue002>\u0d02; # SIGN ANUSVARA -\ue003>\u0d03; # SIGN VISARGA -\ue005>\u0d05; # LETTER A -\ue006>\u0d06; # LETTER AA -\ue007>\u0d07; # LETTER I -\ue008>\u0d08; # LETTER II -\ue009>\u0d09; # LETTER U -\ue00a>\u0d0a; # LETTER UU -\ue00b>\u0d0b; # LETTER VOCALIC R -\ue00c>\u0d0c; # LETTER VOCALIC L -\ue00d>\u0d0e; # FALLLBACK LETTER E -\ue00e>\u0d0e; # LETTER E -\ue00f>\u0d0f; # LETTER EE -\ue010>\u0d10; # LETTER AI -\ue011>\u0d12; # FALLBACK TO O -\ue012>\u0d12; # LETTER O -\ue013>\u0d13; # LETTER OO -\ue014>\u0d14; # LETTER AU -\ue015>\u0d15; # LETTER KA -\ue016>\u0d16; # LETTER KHA -\ue017>\u0d17; # LETTER GA -\ue018>\u0d18; # LETTER GHA -\ue019>\u0d19; # LETTER NGA -\ue01a>\u0d1a; # LETTER CA -\ue01b>\u0d1b; # LETTER CHA -\ue01c>\u0d1c; # LETTER JA -\ue01d>\u0d1d; # LETTER JHA -\ue01e>\u0d1e; # LETTER NYA -\ue01f>\u0d1f; # LETTER TTA -\ue020>\u0d20; # LETTER TTHA -\ue021>\u0d21; # LETTER DDA -\ue022>\u0d22; # LETTER DDHA -\ue023>\u0d23; # LETTER NNA -\ue024>\u0d24; # LETTER TA -\ue025>\u0d25; # LETTER THA -\ue026>\u0d26; # LETTER DA -\ue027>\u0d27; # LETTER DHA -\ue028>\u0d28; # LETTER NA -\ue029>\u0d28; # REMAP (indicExceptions.txt): \u0d29>\u0d28 = LETTER NNNA>LETTER NA -\ue02a>\u0d2a; # LETTER PA -\ue02b>\u0d2b; # LETTER PHA -\ue02c>\u0d2c; # LETTER BA -\ue02d>\u0d2d; # LETTER BHA -\ue02e>\u0d2e; # LETTER MA -\ue02f>\u0d2f; # LETTER YA -\ue030\ue03c>\u0d31; -\ue030>\u0d30; # LETTER RA -\ue031>\u0d31; # LETTER RRA -\ue032>\u0d32; # LETTER LA -\ue033\ue03c>\u0d34; -\ue033>\u0d33; # LETTER LLA -\ue034>\u0d34; # LETTER LLLA -\ue035>\u0d35; # LETTER VA -\ue036>\u0d36; # LETTER SHA -\ue037>\u0d37; # LETTER SSA -\ue038>\u0d38; # LETTER SA -\ue039>\u0d39; # LETTER HA - -\ue03c>; # FALLBACK BLOW AWAY NUKTA -\ue03d>; # FALLBACK BLOW AWAY AVAGRAHA - -\ue03e>\u0d3e; # VOWEL SIGN AA -\ue03f>\u0d3f; # VOWEL SIGN I -\ue040>\u0d40; # VOWEL SIGN II -\ue041>\u0d41; # VOWEL SIGN U -\ue042>\u0d42; # VOWEL SIGN UU -\ue043>\u0d43; # VOWEL SIGN VOCALIC R -\ue044>; # FALLBACK BLOW AWAY VOWEL SIGN VOCALIC RR -\ue045>\u0d3e; # REMAP (indicExceptions.txt): \u0d45>\u0d3e = VOWEL SIGN CANDRA E>VOWEL SIGN AA -\ue046>\u0d46; # VOWEL SIGN E -\ue047>\u0d47; # VOWEL SIGN EE -\ue048>\u0d48; # VOWEL SIGN AI -\ue049>\u0d4b; # REMAP (indicExceptions.txt): \u0d49>\u0d4b = VOWEL SIGN CANDRA O>VOWEL SIGN OO -\ue04a>\u0d4a; # VOWEL SIGN O -\ue04b>\u0d4b; # VOWEL SIGN OO -\ue04c>\u0d4c; # VOWEL SIGN AU -\ue04d>\u0d4d; # SIGN VIRAMA -\ue050>\u0d13\u0d02; # UNMAPPED InterIndic-Malayalam: OM -\ue051>; -\ue052>; -\ue053>; -\ue054>; -\ue055>; # FALLBACK BLOW AWAY LENGTH MARK -\ue056>\u0d48; # REMAP (indicExceptions.txt): \u0d56>\u0d48 = AI LENGTH MARK>VOWEL SIGN AI -\ue057>\u0d57; # AU LENGTH MARK -\ue058>\u0d15; # FALLBACK -\ue059>\u0d16; # REMAP (indicExceptions.txt): \u0d59>\u0d16 = LETTER KHHA>LETTER KHA -\ue05a>\u0d17; # REMAP (indicExceptions.txt): \u0d5a>\u0d17 = LETTER GHHA>LETTER GA -\ue05b>\u0d1c; # REMAP (indicExceptions.txt): \u0d5b>\u0d1c = LETTER ZA>LETTER JA -\ue05d>\u0d22; # REMAP (indicExceptions.txt): \u0d5d>\u0d22 = LETTER RHA>LETTER DDHA -\ue05c>\u0d21; # FALLBACK -\ue05e>\u0d2b; # REMAP (indicExceptions.txt): \u0d5e>\u0d2b = LETTER FA>LETTER PHA -\ue05f>\u0d2f; # REMAP (indicExceptions.txt): \u0d5f>\u0d2f = LETTER YYA>LETTER YA -\ue060>\u0d60; # LETTER VOCALIC RR -\ue061>\u0d61; # LETTER VOCALIC LL -\ue062>; # FALLBACK BLOW AWAY VOWEL SIGN VOCALIC L -\ue063>; # FALLBACK BLOW AWAY VOWEL SIGN VOCALIC LL -\ue064>'.' ; # FALLBACK FOR DANDA -\ue065>'.' ; # FALLBACK FOR DOUBLE DANDA -\ue066>\u0d66; # DIGIT ZERO -\ue067>\u0d67; # DIGIT ONE -\ue068>\u0d68; # DIGIT TWO -\ue069>\u0d69; # DIGIT THREE -\ue06a>\u0d6a; # DIGIT FOUR -\ue06b>\u0d6b; # DIGIT FIVE -\ue06c>\u0d6c; # DIGIT SIX -\ue06d>\u0d6d; # DIGIT SEVEN -\ue06e>\u0d6e; # DIGIT EIGHT -\ue06f>\u0d6f; # DIGIT NINE -\ue080>; # UNMAPPED InterIndic-Malayalam: ISSHAR -\ue070>; -\ue071>; -\ue072>; -\ue073>; -\ue074>; -0 > \u0d66; # FALLBACK FOR TAMIL -1 > \u0d67; -\ue0f0 > \u0d30; # FALLBACK RA -\ue0f1 > \u0d30; # FALLBACK RA - - -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Oriya.txt b/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Oriya.txt deleted file mode 100755 index 04829b12c1..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Oriya.txt +++ /dev/null @@ -1,135 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_InterIndic_Oriya.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# InterIndic_Oriya -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:42:01 2001 -#-------------------------------------------------------------------- -# InterIndic-Oriya -#:: NFD (NFC) ; -\ue001>\u0b01; # SIGN CANDRABINDU -\ue002>\u0b02; # SIGN ANUSVARA -\ue003>\u0b03; # SIGN VISARGA -\ue005>\u0b05; # LETTER A -\ue006>\u0b06; # LETTER AA -\ue007>\u0b07; # LETTER I -\ue008>\u0b08; # LETTER II -\ue009>\u0b09; # LETTER U -\ue00a>\u0b0a; # LETTER UU -\ue00b>\u0b0b; # LETTER VOCALIC R -\ue00c>\u0b0c; # LETTER VOCALIC L -\ue00d>\u0b0f; # FALLBACK -\ue00e>\u0b0f; # FALLBACK -\ue00f>\u0b0f; # LETTER E -\ue010>\u0b10; # LETTER AI -\ue011>\u0b13; # FALLBACK -\ue012>\u0b13; # FALLBACK -\ue013>\u0b13; # UNMAPPED InterIndic-Oriya: LETTER OO (\u0b13 = LETTER O) -\ue014>\u0b14; # LETTER AU -\ue015>\u0b15; # LETTER KA -\ue016>\u0b16; # LETTER KHA -\ue017>\u0b17; # LETTER GA -\ue018>\u0b18; # LETTER GHA -\ue019>\u0b19; # LETTER NGA -\ue01a>\u0b1a; # LETTER CA -\ue01b>\u0b1b; # LETTER CHA -\ue01c>\u0b1c; # LETTER JA -\ue01d>\u0b1d; # LETTER JHA -\ue01e>\u0b1e; # LETTER NYA -\ue01f>\u0b1f; # LETTER TTA -\ue020>\u0b20; # LETTER TTHA -\ue021>\u0b21; # LETTER DDA -\ue022>\u0b22; # LETTER DDHA -\ue023>\u0b23; # LETTER NNA -\ue024>\u0b24; # LETTER TA -\ue025>\u0b25; # LETTER THA -\ue026>\u0b26; # LETTER DA -\ue027>\u0b27; # LETTER DHA -\ue028>\u0b28; # LETTER NA -\ue029>\u0b28\u0b3c; # REMAP (indicExceptions.txt): \u0b29>\u0b28 = LETTER NNNA>LETTER NA -\ue02a>\u0b2a; # LETTER PA -\ue02b>\u0b2b; # LETTER PHA -\ue02c>\u0b2c; # LETTER BA -\ue02d>\u0b2d; # LETTER BHA -\ue02e>\u0b2e; # LETTER MA -\ue02f>\u0b2f; # LETTER YA -\ue030>\u0b30; # LETTER RA -\ue031>\u0b5c; # LETTER RRA -\ue032>\u0b32; # LETTER LA -\ue033>\u0b33; # LETTER LLA -\ue034>\u0b33\u0b3c; # REMAP (indicExceptions.txt): \u0b34>\u0b33 = LETTER LLLA>LETTER LLA -\ue035>\u0b2c; # REMAP (indicExceptions.txt): \u0b35>\u0b2c = LETTER VA>LETTER BA -\ue036>\u0b36; # LETTER SHA -\ue037>\u0b37; # LETTER SSA -\ue038>\u0b38; # LETTER SA -\ue039>\u0b39; # LETTER HA -\ue03c>\u0b3c; # SIGN NUKTA -\ue03d>\u0b3d; # SIGN AVAGRAHA -\ue03e>\u0b3e; # VOWEL SIGN AA -\ue03f>\u0b3f; # VOWEL SIGN I -\ue040>\u0b40; # VOWEL SIGN II -\ue041>\u0b41; # VOWEL SIGN U -\ue042>\u0b42; # VOWEL SIGN UU -\ue043>\u0b43; # VOWEL SIGN VOCALIC R -\ue044>\u0b43\u0b3c; # REMAP (indicExceptions.txt): \u0b44>\u0b43\u0b3c = VOWEL SIGN VOCALIC RR>VOWEL SIGN VOCALIC R.SIGN NUKTA -\ue045>\u0b47; # FALLBACK -\ue046>\u0b47; # FALLBACK -\ue047>\u0b47; # VOWEL SIGN E -\ue048>\u0b48; # VOWEL SIGN AI -\ue049>\u0b4b; # FALLBACK -\ue04a>\u0b4b; # FALLBACK -\ue04b>\u0b4b; # VOWEL SIGN E -\ue04c>\u0b4c; # VOWEL SIGN AU -\ue04d>\u0b4d; # SIGN VIRAMA -\ue050>\u0b13\u0b01; # REMAP (indicExceptions.txt): \u0b50>\u0b13\u0b01 = OM>LETTER O.SIGN CANDRABINDU -\ue051>; -\ue052>; -\ue053>; -\ue054>; -\ue055>; # UNMAPPED InterIndic-Oriya: LENGTH MARK -\ue056>\u0b56; # AI LENGTH MARK -\ue057>\u0b57; # AU LENGTH MARK -\ue059>\u0b16\u0b3c; # REMAP (indicExceptions.txt): \u0b59>\u0b16\u0b3c = LETTER KHHA>LETTER KHA.SIGN NUKTA -\ue058>\u0b15\u0b3c; # FALLBACK -\ue05a>\u0b17\u0b3c; # REMAP (indicExceptions.txt): \u0b5a>\u0b17\u0b3c = LETTER GHHA>LETTER GA.SIGN NUKTA -\ue05b>\u0b1c\u0b3c; # REMAP (indicExceptions.txt): \u0b5b>\u0b1c\u0b3c = LETTER ZA>LETTER JA.SIGN NUKTA -\ue05c>\u0b21\u0b3c; # FALLBACK -\ue05d>\u0b5d; # LETTER RHA -\ue05e>\u0b2b\u0b3c; # REMAP (indicExceptions.txt): \u0b5e>\u0b2b\u0b3c = LETTER FA>LETTER PHA.SIGN NUKTA -\ue05f>\u0b5f; # LETTER YYA -\ue060>\u0b60; # LETTER VOCALIC RR -\ue061>\u0b61; # LETTER VOCALIC LL -\ue062>\u0b56\u0b3c; # REMAP (indicExceptions.txt): \u0b62>\u0b56\u0b3c = VOWEL SIGN VOCALIC L>AI LENGTH MARK.SIGN NUKTA -\ue063>\u0b57\u0b3c; # REMAP (indicExceptions.txt): \u0b63>\u0b57\u0b3c = VOWEL SIGN VOCALIC LL>AU LENGTH MARK.SIGN NUKTA -\uE064>\u0964; # DANDA -\uE065>\u0965; # DOUBLE DANDA -\ue066>\u0b66; # DIGIT ZERO -\ue067>\u0b67; # DIGIT ONE -\ue068>\u0b68; # DIGIT TWO -\ue069>\u0b69; # DIGIT THREE -\ue06a>\u0b6a; # DIGIT FOUR -\ue06b>\u0b6b; # DIGIT FIVE -\ue06c>\u0b6c; # DIGIT SIX -\ue06d>\u0b6d; # DIGIT SEVEN -\ue06e>\u0b6e; # DIGIT EIGHT -\ue06f>\u0b6f; # DIGIT NINE -\ue070>\u0b70; # ISSHAR -\ue071>; -\ue072>; -\ue073>; -\ue074>; -0 > \u0b66; # FALLBACK FOR TAMIL -1 > \u0b67; -\ue0f0 > \u0b30; # FALLBACK RA -\ue0f1 > \u0b30; # FALLBACK RA -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Tamil.txt b/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Tamil.txt deleted file mode 100755 index 13afad75c3..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Tamil.txt +++ /dev/null @@ -1,153 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_InterIndic_Tamil.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# InterIndic_Tamil -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:42:01 2001 -#-------------------------------------------------------------------- -# InterIndic-Tamil -#:: NFD (NFC) ; -\ue001>\u0b82; # FALLBACK SIGN CANDRABINDU -\ue002>\u0b82; # SIGN ANUSVARA -\ue003>\u0b83; # SIGN VISARGA -\ue005>\u0b85; # LETTER A -\ue006>\u0b86; # LETTER AA -\ue007>\u0b87; # LETTER I -\ue008>\u0b88; # LETTER II -\ue009>\u0b89; # LETTER U -\ue00a>\u0b8a; # LETTER UU -\ue00b>\u0bb0\u0bbf; # REMAP (indicExceptions.txt): \u0b8b>\u0bb0\u0bbf = LETTER VOCALIC R>LETTER RA.VOWEL SIGN I -\ue00c>\u0b87; # REMAP (indicExceptions.txt): \u0b8c>\u0b87 = LETTER VOCALIC L>LETTER I -\ue00d>\u0b8f; # FALLBACK -\ue00e>\u0b8e; # LETTER E -\ue00f>\u0b8f; # LETTER EE -\ue010>\u0b90; # LETTER AI -\ue011>\u0b92; # FALLBACK -\ue012>\u0b92; # LETTER O -\ue013>\u0b93; # LETTER OO -\ue014>\u0b94; # LETTER AU -\ue015>\u0b95; # LETTER KA -\ue016>\u0b95; # REMAP (indicExceptions.txt): \u0b96>\u0b95 = LETTER KHA>LETTER KA -\ue017>\u0b95; # REMAP (indicExceptions.txt): \u0b97>\u0b95 = LETTER GA>LETTER KA -\ue018>\u0b95; # REMAP (indicExceptions.txt): \u0b98>\u0b95 = LETTER GHA>LETTER KA -\ue019>\u0b99; # LETTER NGA -\ue01a>\u0b9a; # LETTER CA -\ue01b>\u0b9a; # REMAP (indicExceptions.txt): \u0b9b>\u0b9a = LETTER CHA>LETTER CA -\ue01c>\u0b9c; # LETTER JA -\ue01d>\u0b9a; # REMAP (indicExceptions.txt): \u0b9d>\u0b9a = LETTER JHA>LETTER CA -\ue01e>\u0b9e; # LETTER NYA -\ue01f>\u0b9f; # LETTER TTA -\ue020>\u0b9f; # REMAP (indicExceptions.txt): \u0ba0>\u0b9f = LETTER TTHA>LETTER TTA -\ue021>\u0b9f; # REMAP (indicExceptions.txt): \u0ba1>\u0b9f = LETTER DDA>LETTER TTA -\ue022>\u0b9f; # REMAP (indicExceptions.txt): \u0ba2>\u0b9f = LETTER DDHA>LETTER TTA -\ue023>\u0ba3; # LETTER NNA -\ue024>\u0ba4; # LETTER TA -\ue025>\u0ba4; # REMAP (indicExceptions.txt): \u0ba5>\u0ba4 = LETTER THA>LETTER TA -\ue026>\u0ba4; # REMAP (indicExceptions.txt): \u0ba6>\u0ba4 = LETTER DA>LETTER TA -\ue027>\u0ba4; # REMAP (indicExceptions.txt): \u0ba7>\u0ba4 = LETTER DHA>LETTER TA -\ue028\ue03c>\u0ba9; -\ue028>\u0ba8; # LETTER NA -\ue029>\u0ba9; # LETTER NNNA -\ue02a>\u0baa; # LETTER PA -\ue02b>\u0baa; # REMAP (indicExceptions.txt): \u0bab>\u0baa = LETTER PHA>LETTER PA -\ue02c>\u0baa; # REMAP (indicExceptions.txt): \u0bac>\u0baa = LETTER BA>LETTER PA -\ue02d>\u0baa; # REMAP (indicExceptions.txt): \u0bad>\u0baa = LETTER BHA>LETTER PA -\ue02e>\u0bae; # LETTER MA -\ue02f>\u0baf; # LETTER YA -\ue030\ue03c>\u0bb1; -\ue030>\u0bb0; # LETTER RA -\ue031>\u0bb1; # LETTER RRA -\ue032>\u0bb2; # LETTER LA -\ue033\ue03c>\u0bb4; -\ue033>\u0bb3; # LETTER LLA -\ue034>\u0bb4; # LETTER LLLA -\ue035>\u0bb5; # LETTER VA -\ue036>\u0bb7; # REMAP (indicExceptions.txt): \u0bb6>\u0bb7 = LETTER SHA>LETTER SSA -\ue037>\u0bb7; # LETTER SSA -\ue038>\u0bb8; # LETTER SA -\ue039>\u0bb9; # LETTER HA - -\ue03c>; # FALLBACK BLOW AWAY NUKTA -\ue03d>; # FALLBACK BLOW AWAY AVAGRAHA - -\ue03e>\u0bbe; # VOWEL SIGN AA -\ue03f>\u0bbf; # VOWEL SIGN I -\ue040>\u0bc0; # VOWEL SIGN II -\ue041>\u0bc1; # VOWEL SIGN U -\ue042>\u0bc2; # VOWEL SIGN UU -\ue043>\u0bcd\u0bb0\u0bbf; # REMAP (indicExceptions.txt): \u0bc3>\u0bcd\u0bb0\u0bbf = VOWEL SIGN VOCALIC R>SIGN VIRAMA.LETTER RA.VOWEL SIGN I -\ue044>\u0bcd\u0bb0\u0bbf; # REMAP (indicExceptions.txt): \u0bc4>\u0bcd\u0bb0\u0bbf = VOWEL SIGN VOCALIC RR>SIGN VIRAMA.LETTER RA.VOWEL SIGN I -\ue045>\u0bbe; # REMAP (indicExceptions.txt): \u0bc5>\u0bbe = VOWEL SIGN CANDRA E>VOWEL SIGN AA -\ue046>\u0bc6; # VOWEL SIGN E -\ue047>\u0bc7; # VOWEL SIGN EE -\ue048>\u0bc8; # VOWEL SIGN AI -\ue049>\u0bbe; # REMAP (indicExceptions.txt): \u0bc9>\u0bbe = VOWEL SIGN CANDRA O>VOWEL SIGN AA -\ue04a>\u0bca; # VOWEL SIGN O -\ue04b>\u0bcb; # VOWEL SIGN OO -\ue04c>\u0bcc; # VOWEL SIGN AU -\ue04d>\u0bcd; # SIGN VIRAMA -\ue050>\u0b93\u0bae\u0bcd; # REMAP (indicExceptions.txt): \u0bd0>\u0b93\u0bae\u0bcd = OM>LETTER OO.LETTER MA.SIGN VIRAMA -\ue051>; -\ue052>; -\ue053>; -\ue054>; -\ue055>; # UNMAPPED InterIndic-Tamil: LENGTH MARK -\ue056>\u0bc8; # REMAP (indicExceptions.txt): \u0bd6>\u0bc8 = AI LENGTH MARK>VOWEL SIGN AI -\ue057>\u0bd7; # AU LENGTH MARK -\ue058>\u0b95; # FALLBACK -\ue059>\u0b95; # REMAP (indicExceptions.txt): \u0bd9>\u0b95 = LETTER KHHA>LETTER KA -\ue05a>\u0b95; # REMAP (indicExceptions.txt): \u0bda>\u0b95 = LETTER GHHA>LETTER KA -\ue05b>\u0b9c; # REMAP (indicExceptions.txt): \u0bdb>\u0b9c = LETTER ZA>LETTER JA -\ue05c>\u0ba4; # FALLBACK -\ue05d>\u0b9f; # REMAP (indicExceptions.txt): \u0bdd>\u0b9f = LETTER RHA>LETTER TTA -\ue05e>\u0baa; # REMAP (indicExceptions.txt): \u0bde>\u0baa = LETTER FA>LETTER PA -\ue05f>\u0baf; # REMAP (indicExceptions.txt): \u0bdf>\u0baf = LETTER YYA>LETTER YA -\ue060>\u0bb0\u0bbf; # REMAP (indicExceptions.txt): \u0be0>\u0bb0\u0bbf = LETTER VOCALIC RR>LETTER RA.VOWEL SIGN I -\ue061>\u0b88; # REMAP (indicExceptions.txt): \u0be1>\u0b88 = LETTER VOCALIC LL>LETTER II -\ue062>\u0bbf;# FALLBACK VOWEL SIGN VOCALIC L -\ue063>\u0bc0;# FALLBACK VOWEL SIGN VOCALIC LL -\ue064>'.' ; # FALLBACK FOR DANDA -\ue065>'.' ; # FALLBACK FOR DOUBLE DANDA - -\ue066>\u0030; # FALLBACK DIGIT ZERO - -\ue067\ue066\ue066\ue066>\u0bF2; -\ue067\ue066\ue066>\u0bf1; -\ue067\ue066>\u0bF0; - -\ue067>\u0be7; # DIGIT ONE -\ue068>\u0be8; # DIGIT TWO -\ue069>\u0be9; # DIGIT THREE -\ue06a>\u0bea; # DIGIT FOUR -\ue06b>\u0beb; # DIGIT FIVE -\ue06c>\u0bec; # DIGIT SIX -\ue06d>\u0bed; # DIGIT SEVEN -\ue06e>\u0bee; # DIGIT EIGHT -\ue06f>\u0bef; # DIGIT NINE - -1000 >\u0BF2; # UNMAPPED Tamil-InterIndic: NUMBER ONE THOUSAND -100 >\u0BF1; # UNMAPPED Tamil-InterIndic: NUMBER ONE HUNDRED -10 >\u0BF0; # UNMAPPED Tamil-InterIndic: NUMBER TEN - - - -\ue080>; # UNMAPPED InterIndic-Tamil: ISSHAR -\ue070>; -\ue071>; -\ue072>; -\ue073>; -\ue074>; - -\ue0f0 > \u0bb0; # FALLBACK RA -\ue0f1 > \u0bb0; # FALLBACK RA -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Telugu.txt b/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Telugu.txt deleted file mode 100755 index 357f4c2f6b..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_InterIndic_Telugu.txt +++ /dev/null @@ -1,141 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_InterIndic_Telugu.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# InterIndic_Telugu -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:42:01 2001 -#-------------------------------------------------------------------- -# InterIndic-Telugu -#:: NFD (NFC) ; -\ue001>\u0c01; # SIGN CANDRABINDU -\ue002>\u0c02; # SIGN ANUSVARA -\ue003>\u0c03; # SIGN VISARGA -\ue005>\u0c05; # LETTER A -\ue006>\u0c06; # LETTER AA -\ue007>\u0c07; # LETTER I -\ue008>\u0c08; # LETTER II -\ue009>\u0c09; # LETTER U -\ue00a>\u0c0a; # LETTER UU -\ue00b>\u0c0b; # LETTER VOCALIC R -\ue00c>\u0c0c; # LETTER VOCALIC L -\ue00d>\u0c0E; # FALLBACK MAPPING -\ue00e>\u0c0E; # LETTER E -\ue00f>\u0c0f; # LETTER EE -\ue010>\u0c10; # LETTER AI -\ue011>\u0c12; # FALBACK MAPPING -\ue012>\u0c12; # LETTER O -\ue013>\u0c13; # LETTER OO -\ue014>\u0c14; # LETTER AU -\ue015>\u0c15; # LETTER KA -\ue016>\u0c16; # LETTER KHA -\ue017>\u0c17; # LETTER GA -\ue018>\u0c18; # LETTER GHA -\ue019>\u0c19; # LETTER NGA -\ue01a>\u0c1a; # LETTER CA -\ue01b>\u0c1b; # LETTER CHA -\ue01c>\u0c1c; # LETTER JA -\ue01d>\u0c1d; # LETTER JHA -\ue01e>\u0c1e; # LETTER NYA -\ue01f>\u0c1f; # LETTER TTA -\ue020>\u0c20; # LETTER TTHA -\ue021>\u0c21; # LETTER DDA -\ue022>\u0c22; # LETTER DDHA -\ue023>\u0c23; # LETTER NNA -\ue024>\u0c24; # LETTER TA -\ue025>\u0c25; # LETTER THA -\ue026>\u0c26; # LETTER DA -\ue027>\u0c27; # LETTER DHA -\ue028>\u0c28; # LETTER NA -\ue029>\u0c28; # REMAP (indicExceptions.txt): \u0c29>\u0c28 = LETTER NNNA>LETTER NA -\ue02a>\u0c2a; # LETTER PA -\ue02b>\u0c2b; # LETTER PHA -\ue02c>\u0c2c; # LETTER BA -\ue02d>\u0c2d; # LETTER BHA -\ue02e>\u0c2e; # LETTER MA -\ue02f>\u0c2f; # LETTER YA -\ue030\ue03c>\u0c31; -\ue030>\u0c30; # LETTER RA -\ue031>\u0c31; # LETTER RRA -\ue032>\u0c32; # LETTER LA -\ue033>\u0c33; # LETTER LLA -\ue034>\u0c33; # REMAP (indicExceptions.txt): \u0c34>\u0c33 = LETTER LLLA>LETTER LLA -\ue035>\u0c35; # LETTER VA -\ue036>\u0c36; # LETTER SHA -\ue037>\u0c37; # LETTER SSA -\ue038>\u0c38; # LETTER SA -\ue039>\u0c39; # LETTER HA - -\ue03c>; # FALLBACK BLOW AWAY NUKTA -\ue03d>; # FALLBACK BLOW AWAY AVAGRAHA - -\ue03e>\u0c3e; # VOWEL SIGN AA -\ue03f>\u0c3f; # VOWEL SIGN I -\ue040>\u0c40; # VOWEL SIGN II -\ue041>\u0c41; # VOWEL SIGN U -\ue042>\u0c42; # VOWEL SIGN UU -\ue043>\u0c43; # VOWEL SIGN VOCALIC R -\ue044>\u0c44; # VOWEL SIGN VOCALIC RR -\ue045>\u0c46; # VOWEL SIGN CANDRA E>VOWEL SIGN E -\ue047>\u0c47; # VOWEL SIGN EE -\ue048>\u0c48; # VOWEL SIGN AI -\ue049>\u0c4a; # REMAP (indicExceptions.txt): \u0c49>\u0c4a = VOWEL SIGN CANDRA O>VOWEL SIGN O -\ue04b>\u0c4b; # VOWEL SIGN OO -\ue04c>\u0c4c; # VOWEL SIGN AU -\ue04d>\u0c4d; # SIGN VIRAMA -\ue050>\u0c13\u0c02; # REMAP (indicExceptions.txt): \u0c50>\u0c13\u0c02 = OM>LETTER OO.SIGN ANUSVARA -\ue051>; -\ue052>; -\ue053>; -\ue054>; -\ue055>\u0c55; # LENGTH MARK -\ue056>\u0c56; # AI LENGTH MARK -\ue057>\u0c4c; # REMAP (indicExceptions.txt): \u0c57>\u0c4c = AU LENGTH MARK>VOWEL SIGN AU -\ue058>\u0c15; # REMAP -\ue059>\u0c16; # REMAP (indicExceptions.txt): \u0c59>\u0c16 = LETTER KHHA>LETTER KHA -\ue05a>\u0c17; # REMAP (indicExceptions.txt): \u0c5a>\u0c17 = LETTER GHHA>LETTER GA -\ue05b>\u0c1c; # REMAP (indicExceptions.txt): \u0c5b>\u0c1c = LETTER ZA>LETTER JA -\ue05c>\u0c22; # REMAP -\ue05d>\u0c22; # REMAP (indicExceptions.txt): \u0c5d>\u0c22 = LETTER RHA>LETTER DDHA -\ue05e>\u0c2b; # REMAP (indicExceptions.txt): \u0c5e>\u0c2b = LETTER FA>LETTER PHA -\ue05f>\u0c2f; # REMAP (indicExceptions.txt): \u0c5f>\u0c2f = LETTER YYA>LETTER YA -\ue060>\u0c60; # LETTER VOCALIC RR -\ue061>\u0c61; # LETTER VOCALIC LL -\ue062>\u0c3f; # REMAP (indicExceptions.txt): \u0c62>\u0c3f = VOWEL SIGN VOCALIC L>VOWEL SIGN I -\ue063>\u0c40; # REMAP (indicExceptions.txt): \u0c63>\u0c40 = VOWEL SIGN VOCALIC LL>VOWEL SIGN II -\ue064>'.' ; # FALLBACK FOR DANDA -\ue065>'.' ; # FALLBACK FOR DOUBLE DANDA -\ue066>\u0c66; # DIGIT ZERO -\ue067>\u0c67; # DIGIT ONE -\ue068>\u0c68; # DIGIT TWO -\ue069>\u0c69; # DIGIT THREE -\ue06a>\u0c6a; # DIGIT FOUR -\ue06b>\u0c6b; # DIGIT FIVE -\ue06c>\u0c6c; # DIGIT SIX -\ue06d>\u0c6d; # DIGIT SEVEN -\ue06e>\u0c6e; # DIGIT EIGHT -\ue06f>\u0c6f; # DIGIT NINE -# \ue080>; # UNMAPPED InterIndic-Telugu: ISSHAR - - -\ue046>\u0c46; # VOWEL SIGN E -\ue04a>\u0c4a; # VOWEL SIGN O -\ue070>; -\ue071>; -\ue072>; -\ue073>; -\ue074>; -0 > \u0c66; # FALLBACK FOR TAMIL -1 > \u0c67; -\ue0f0 > \u0c30; # FALLBACK RA -\ue0f1 > \u0c30; # FALLBACK RA -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Kannada_InterIndic.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Kannada_InterIndic.txt deleted file mode 100755 index 0c251f1547..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Kannada_InterIndic.txt +++ /dev/null @@ -1,101 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_Kannada_InterIndic.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# Kannada_InterIndic -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:42:05 2001 -#-------------------------------------------------------------------- -# Kannada-InterIndic -\u0CC6\u0CD5>\uE047; # VOWEL SIGN EE -\u0CC6\u0CCD\u0CD6>\uE048\ue04d; # VOWEL SIGN AI -\u0CC6\u0CD6>\uE048; # VOWEL SIGN AI -\u0CC6\u0CC2\u0CD5>\uE04B; # VOWEL SIGN OO -\u0CC6\u0CC2>\uE04A; # VOWEL SIGN O -\u0CBF\u0CD5>\uE040; # VOWEL SIGN II - -\u0C82>\uE002; # SIGN ANUSVARA -\u0C83>\uE003; # SIGN VISARGA -\u0C85>\uE005; # LETTER A -\u0C86>\uE006; # LETTER AA -\u0C87>\uE007; # LETTER I -\u0C88>\uE008; # LETTER II -\u0C89>\uE009; # LETTER U -\u0C8A>\uE00A; # LETTER UU -\u0C8B>\uE00B; # LETTER VOCALIC R -\u0C8C>\uE00C; # LETTER VOCALIC L -\u0C8E>\uE00E; # LETTER E -\u0C8F>\uE00F; # LETTER EE -\u0C90>\uE010; # LETTER AI -\u0C92>\uE012; # LETTER O -\u0C93>\uE013; # LETTER OO -\u0C94>\uE014; # LETTER AU -\u0C95>\uE015; # LETTER KA -\u0C96>\uE016; # LETTER KHA -\u0C97>\uE017; # LETTER GA -\u0C98>\uE018; # LETTER GHA -\u0C99>\uE019; # LETTER NGA -\u0C9A>\uE01A; # LETTER CA -\u0C9B>\uE01B; # LETTER CHA -\u0C9C>\uE01C; # LETTER JA -\u0C9D>\uE01D; # LETTER JHA -\u0C9E>\uE01E; # LETTER NYA -\u0C9F>\uE01F; # LETTER TTA -\u0CA0>\uE020; # LETTER TTHA -\u0CA1>\uE021; # LETTER DDA -\u0CA2>\uE022; # LETTER DDHA -\u0CA3>\uE023; # LETTER NNA -\u0CA4>\uE024; # LETTER TA -\u0CA5>\uE025; # LETTER THA -\u0CA6>\uE026; # LETTER DA -\u0CA7>\uE027; # LETTER DHA -\u0CA8>\uE028; # LETTER NA -\u0CAA>\uE02A; # LETTER PA -\u0CAB>\uE02B; # LETTER PHA -\u0CAC>\uE02C; # LETTER BA -\u0CAD>\uE02D; # LETTER BHA -\u0CAE>\uE02E; # LETTER MA -\u0CAF>\uE02F; # LETTER YA -\u0CB0>\uE030; # LETTER RA -\u0CB1>\uE031; # LETTER RRA -\u0CB2>\uE032; # LETTER LA -\u0CB3>\uE033; # LETTER LLA -\u0CB5>\uE035; # LETTER VA -\u0CB6>\uE036; # LETTER SHA -\u0CB7>\uE037; # LETTER SSA -\u0CB8>\uE038; # LETTER SA -\u0CB9>\uE039; # LETTER HA -\u0CBE>\uE03E; # VOWEL SIGN AA -\u0CBF>\uE03F; # VOWEL SIGN I -\u0CC1>\uE041; # VOWEL SIGN U -\u0CC2>\uE042; # VOWEL SIGN UU -\u0CC3>\uE043; # VOWEL SIGN VOCALIC R -\u0CC4>\uE044; # VOWEL SIGN VOCALIC RR -\u0CC6>\uE046; # VOWEL SIGN E -\u0CCC>\uE04C; # VOWEL SIGN AU -\u0CCD>\uE04D; # SIGN VIRAMA -\u0CD5>\uE055; # LENGTH MARK -\u0CD6>\uE056; # AI LENGTH MARK -\u0CDE>\uE05E; # LETTER FA -\u0CE0>\uE060; # LETTER VOCALIC RR -\u0CE1>\uE061; # LETTER VOCALIC LL -\u0CE6>\uE066; # DIGIT ZERO -\u0CE7>\uE067; # DIGIT ONE -\u0CE8>\uE068; # DIGIT TWO -\u0CE9>\uE069; # DIGIT THREE -\u0CEA>\uE06A; # DIGIT FOUR -\u0CEB>\uE06B; # DIGIT FIVE -\u0CEC>\uE06C; # DIGIT SIX -\u0CED>\uE06D; # DIGIT SEVEN -\u0CEE>\uE06E; # DIGIT EIGHT -\u0CEF>\uE06F; # DIGIT NINE - -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Latin_InterIndic.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Latin_InterIndic.txt deleted file mode 100755 index 479a2b19de..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Latin_InterIndic.txt +++ /dev/null @@ -1,380 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 2001-2004, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Latin-InterIndic - #:: NFD; - #\u0e00 reserved - #consonants - $chandrabindu=\ue001; - $anusvara=\ue002; - $visarga=\ue003; - #\u0e004 reserved - # w represents the stand-alone form - $wa=\ue005; - $waa=\ue006; - $wi=\ue007; - $wii=\ue008; - $wu=\ue009; - $wuu=\ue00a; - $wr=\ue00b; - $wl=\ue00c; - $wce=\ue00d; # LETTER CANDRA E - $wse=\ue00e; # LETTER SHORT E - $we=\ue00f; # \u090f LETTER E - $wai=\ue010; - $wco=\ue011; # LETTER CANDRA O - $wso=\ue012; # LETTER SHORT O - $wo=\ue013; # \u0913 LETTER O - $wau=\ue014; - $ka=\ue015; - $kha=\ue016; - $ga=\ue017; - $gha=\ue018; - $nga=\ue019; - $ca=\ue01a; - $cha=\ue01b; - $ja=\ue01c; - $jha=\ue01d; - $nya=\ue01e; - $tta=\ue01f; - $ttha=\ue020; - $dda=\ue021; - $ddha=\ue022; - $nna=\ue023; - $ta=\ue024; - $tha=\ue025; - $da=\ue026; - $dha=\ue027; - $na=\ue028; - $ena=\ue029; #compatibility - $pa=\ue02a; - $pha=\ue02b; - $ba=\ue02c; - $bha=\ue02d; - $ma=\ue02e; - $ya=\ue02f; - $ra=\ue030; - $rra=\ue031; - $la=\ue032; - $lla=\ue033; - $ela=\ue034; #compatibility - $va=\ue035; - $sha=\ue036; - $ssa=\ue037; - $sa=\ue038; - $ha=\ue039; -#\u093a Reserved -#\u093b Reserved - $nukta=\ue03c; - $avagraha=\ue03d; # SIGN AVAGRAHA - # represents the dependent form - $aa=\ue03e; - $i=\ue03f; - $ii=\ue040; - $u=\ue041; - $uu=\ue042; - $rh=\ue043; - $lh=\ue044; - $ce=\ue045; #VOWEL SIGN CANDRA E - $se=\ue046; #VOWEL SIGN SHORT E - $e=\ue047; - $ai=\ue048; - $co=\ue049; # VOWEL SIGN CANDRA O - $so=\ue04a; # VOWEL SIGN SHORT O - $o=\ue04b; # \u094b - $au=\ue04c; - $virama=\ue04d; -# \u094e Reserved -# \u094f Reserved - $om = \ue050; # OM -# \u0951>; # UNMAPPED STRESS SIGN UDATTA -# \u0952>; # UNMAPPED STRESS SIGN ANUDATTA -# \u0953>; # UNMAPPED GRAVE ACCENT -# \u0954>; # UNMAPPED ACUTE ACCENT - $lm = \ue055;# Telugu Length Mark - $ailm=\ue056;# AI Length Mark - $aulm=\ue057;# AU Length Mark - #urdu compatibity forms - $uka=\ue058; - $ukha=\ue059; - $ugha=\ue05a; - $ujha=\ue05b; - $uddha=\ue05c; - $udha=\ue05d; - $ufa=\ue05e; - $uya=\ue05f; - $wrr=\ue060; - $wll=\ue061; - $rrh=\ue062; - $llh=\ue063; - $danda=\ue064; - $doubleDanda=\ue065; - $zero=\ue066; # DIGIT ZERO - $one=\ue067; # DIGIT ONE - $two=\ue068; # DIGIT TWO - $three=\ue069; # DIGIT THREE - $four=\ue06a; # DIGIT FOUR - $five=\ue06b; # DIGIT FIVE - $six=\ue06c; # DIGIT SIX - $seven=\ue06d; # DIGIT SEVEN - $eight=\ue06e; # DIGIT EIGHT - $nine=\ue06f; # DIGIT NINE - # For all other scripts - $ecp0=\ue070; - $ecp1=\ue071; - $ecp2=\ue072; - $ecp3=\ue073; - $ecp4=\ue074; - $ecp5=\ue075; - $ecp6=\ue076; - $ecp7=\ue077; - $ecp8=\ue078; - $ecp9=\ue079; - $ecpA=\ue07a; - $ecpB=\ue07b; - $ecpC=\ue07c; - $ecpD=\ue07d; - $ecpE=\ue07e; - $ecpF=\ue07f; -# \u0970>; # UNMAPPED ABBREVIATION SIGN - $depVowelAbove=[\ue03e-\ue040\ue045-\ue04c]; - $depVowelBelow=[\ue041-\ue044]; - $endThing=[$danda$doubleDanda]; - # $x was originally called '&'; $z was '%' - $x=[$virama$aa$ai$au$ii$i$uu$u$rrh$rh$lh$e$o$se$ce$so$co]; - $z=[bcdfghjklmnpqrstvwxyz]; - $consonants=[[$ka-$ha]$z[\u0915-\u0939][\u0995-\u09b9][\u0a15-\u0a39][\u0a95-\u0ab9][\u0b15-\u0b39][\u0b95-\u0bb9][\u0c15-\u0c39][\u0c95-\u0cb9][\u0d15-\u0d39]]; - \u0315 > $avagraha; - \u0303>$chandrabindu$anusvara; - m\u0310>$chandrabindu; - h\u0323>$visarga; - x>$ka$virama$sa; -# convert to independent forms at start of word or syllable: -# dependent forms for roundtrip - \u0314a\u0304>$aa; - \u0314ai>$ai; - \u0314au>$au; - \u0314ii>$ii; - \u0314i\u0304>$ii; - \u0314i>$i; - \u0314u\u0304>$uu; - \u0314u>$u; - \u0314r\u0325\u0304>$rrh; - \u0314r\u0325>$rh; - \u0314l\u0325\u0304>$llh; - \u0314lh>$lh; - \u0314l\u0325>$lh; - \u0314e\u0304>$e; - \u0314o\u0304>$o; - \u0314a>; - \u0314e\u0306>$ce; - \u0314o\u0306>$co; - \u0314e>$se; - \u0314o>$so; - -# preceeded by consonants - $consonants{ a\u0304>$aa; - $consonants{ ai>$ai; - $consonants{ au>$au; - $consonants{ ii>$ii; - $consonants{ i\u0304>$ii; - $consonants{ i>$i; - $consonants{ u\u0304>$uu; - $consonants{ u>$u; - $consonants{ r\u0325\u0304>$rrh; - $consonants{ r\u0325a>$rh; - $consonants{ r\u0325>$rh; - $consonants{ l\u0325\u0304>$llh; - $consonants{ lh>$lh; - $consonants{ l\u0325>$lh; - $consonants{ e\u0304>$e; - $consonants{ o\u0304>$o; - $consonants{ e\u0306>$ce; - $consonants{ o\u0306>$co; - $consonants{ e>$se; - $consonants{ o>$so; - -# e.g. keai -> {ka}{e}{wai}; k'ai -> {ka}{wai}; (ai) -> ({wai}) - a\u0304>$waa; - ai>$wai; - au>$wau; - i\u0304>$wii; - i>$wi; - u\u0304>$wuu; - u>$wu; - r\u0325\u0304>$wrr; - r\u0325>$wr; - l\u0325\u0304>$wll; - lh>$wl; - l\u0325>$wl; - e\u0304>$we; - o\u0304>$wo; - a>$wa; - e\u0306>$wce; - o\u0306>$wco; - e>$wse; - ''om>$om; - o>$wso; - - # rules for anusvara - n}r\u0325 > $na|$virama; - n}l\u0325 > $na|$virama; - n}na > $na|$virama; - n\u0307}[kg] > $anusvara; - n\u0307}n\u0307 > $anusvara; - n\u0304}[cj] > $anusvara; - n\u0304}n\u0303 > $anusvara; - n\u0323}[tdn]\u0323 > $anusvara; - n}[tdn] > $anusvara; - m}[pbm] > $anusvara; - n}[ylvshr] > $anusvara; - m\u0307 > $anusvara; - - #urdu compatibility - q>$uka|$virama; - k\u0331h\u0331>$ukha |$virama; - g\u0307> $ugha | $virama; - z > $ujha |$virama; - f > $ufa|$virama; - - # dev - y\u0307>$uya|$virama; - l\u0331>$ela|$virama; - n\u0331>$ena|$virama; - n\u0307>$nga|$virama; - n\u0303>$nya|$virama; - n\u0323>$nna|$virama; - t\u0323h>$ttha|$virama; - t\u0323>$tta|$virama; - r\u0323h>$udha|$virama; - r\u0323>$uddha|$virama; - d\u0323h>$ddha|$virama; - d\u0323>$dda|$virama; - kh>$kha|$virama; - k>$ka|$virama; - gh>$gha|$virama; - g>$ga|$virama; - ch>$cha|$virama; - c>$ca|$virama; - jh>$jha|$virama; - j>$ja|$virama; - ny>$nya|$virama; - tth>$ttha|$virama; - ddh>$ddha|$virama; - th>$tha|$virama; - t>$ta|$virama; - dh>$dha|$virama; - d>$da|$virama; - n>$na|$virama; - ph>$pha|$virama; - p>$pa|$virama; - bh>$bha|$virama; - b>$ba|$virama; - m>$ma|$virama; - y>$ya|$virama; - r\u0331>$rra|$virama; - r>$ra|$virama; - l\u0323>$lla|$virama; - l>$la|$virama; - v>$va|$virama; - w>$va|$virama; - sh>$sha|$virama; - ss>$ssa|$virama; - s\u0323>$ssa|$virama; - s\u0301>$sha|$virama; - s>$sa|$virama; - h>$ha|$virama; - '.'>$danda; - $danda'.'>$doubleDanda; - $depVowelAbove{'~'>$anusvara; - $depVowelBelow{'~'>$chandrabindu; -# convert to dependent forms after consonant with no vowel: -# e.g. kai -> {ka}{virama}ai -> {ka}{ai} - #$virama aa>$aa; - $virama a\u0304>$aa; - $virama ai>$ai; - $virama au>$au; - $virama ii>$ii; - $virama i\u0304>$ii; - $virama i>$i; - #$virama uu>$uu; - $virama u\u0304>$uu; - $virama u>$u; - #$virama rrh>$rrh; - $virama r\u0325\u0304>$rrh; - #$virama rh>$rh; - $virama r\u0325a>$rh; - $virama r\u0325>$rh; - $virama l\u0325\u0304>$llh; - $virama lh>$lh; - $virama l\u0325>$lh; - $virama e\u0304>$e; - $virama o\u0304>$o; - $virama a>; - $virama e\u0306>$ce; - $virama o\u0306>$co; - $virama e>$se; - $virama o>$so; - - -# otherwise convert independent forms when separated by ': k'ai -> {ka}{virama}{wai} - #$virama''aa>$waa; - $virama''a\u0304>$waa; - $virama''ai>$wai; - $virama''au>$wau; - #$virama''ii>$wii; - $virama''i\u0304>$wii; - $virama''i>$wi; - #$virama''uu>$wuu; - $virama''u\u0304>$wuu; - $virama''u>$wu; - #$virama''rrh>$wrr; - $virama''r\u0325\u0304>$wrr; - #$virama''rh>$wr; - $virama''r\u0325>$wr; - $virama''l\u0325\u0304>$wll; - #$virama''lh>$wl; - $virama''l\u0325>$wl; - $virama''e\u0304>$we; - $virama''o\u0304>$wo; - $virama''a>$wa; - $virama''e\u0306>$wce; - $virama''o\u0306>$wco; - $virama''e>$wse; - $virama''o>$wso; -# no virama - ''a\u0304>$waa; - ''ai>$wai; - ''au>$wau; - ''i\u0304>$wii; - ''i>$wi; - ''u\u0304>$wuu; - ''u>$wu; - ''r\u0325\u0304>$wrr; - ''r\u0325>$wr; - ''l\u0325\u0304>$wll; - ''l\u0325>$wl; - ''e\u0304>$we; - ''o\u0304>$wo; - ''a>$wa; - ''e\u0306>$wce; - ''o\u0306>$wco; - ''e>$wse; - ''o>$wso; - - $virama } [$z] > $virama; - $virama } ' ' > $virama ; - $virama}$endThing>; - 0>$zero; - 1>$one; - 2>$two; - 3>$three; - 4>$four; - 5>$five; - 6>$six; - 7>$seven; - 8>$eight; - 9>$nine; - ''>; - #:: NFC (NFD) ; diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Latin_Jamo.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Latin_Jamo.txt deleted file mode 100755 index 0d07c4e1a0..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Latin_Jamo.txt +++ /dev/null @@ -1,522 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- - -#- N.B. DO NOT put any filters, NFD, etc. here -- those are aliased in -#- the INDEX file. This transliterator is, by itself, not -#- instantiated. It is used as a part of Latin-Jamo, Latin-Hangul, or -#- inverses thereof. - -# Transliteration from Latin characters to Korean script is done in -# two steps: Latin to Jamo, then Jamo to Hangul. The Jamo-Hangul -# transliteration is done algorithmically following Unicode 3.0 -# section 3.11. This file implements the Latin to Jamo -# transliteration using rules. - -# Jamo occupy the block 1100-11FF. Within this block there are three -# groups of characters: initial consonants or choseong (I), medial -# vowels or jungseong (M), and trailing consonants or jongseong (F). -# Standard Korean syllables are of the form I+M+F*. - -# Section 3.11 describes the use of 'filler' jamo to convert -# nonstandard syllables to standard form: the choseong filler 115F and -# the junseong filler 1160. In this transliterator, we will not use -# 115F or 1160. - -# We will, however, insert two 'null' jamo to make foreign words -# conform to Korean syllable structure. These are the null initial -# consonant 110B (IEUNG) and the null vowel 1173 (EU). In Latin text, -# we will use the separator in order to disambiguate strings, -# e.g. "kan-ggan" (initial GG) vs. "kanggan" (final NG + initial G). - -# We will not use all of the characters in the jamo block. We will -# only use the 19 initials, 21 medials, and 27 finals possessing a -# jamo short name as defined in section 4.4 of the Unicode book. - -# Rules of thumb. These guidelines provide the basic framework -# for the rules. They are phrased in terms of Latin-Jamo transliteration. -# The Jamo-Latin rules derive from these, since the Jamo-Latin rules are -# just context-free transliteration of jamo to corresponding short names, -# with the addition of separators to maintain round-trip integrity -# in the context of the Latin-Jamo rules. - -# A sequence of vowels: -# - Take the longest sequence you can. If there are too many, or you don't -# have a starting consonant, introduce a 110B necessary. - -# A sequence of consonants. -# - First join the double consonants: G + G -> GG -# - In the remaining list, -# -- If there is no preceding vowel, take the first consonant, and insert EU -# after it. Continue with the rest of the consonants. -# -- If there is one consonant, attach to the following vowel -# -- If there are two consonants and a following vowel, attach one to the -# preceeding vowel, and one to the following vowel. -# -- If there are more than two consonants, join the first two together if you -# can: L + G => LG -# -- If you still end up with more than 2 consonants, insert EU after the -# first one, and continue with the rest of the consonants. - -#---------------------------------------------------------------------- -# Variables - -# Some latin consonants or consonant pairs only occur as initials, and -# some only as finals, but some occur as both. This makes some jamo -# consonants ambiguous when transliterated into latin. -# Initial only: IEUNG BB DD JJ R -# Final only: BS GS L LB LG LH LM LP LS LT NG NH NJ -# Initial and Final: B C D G GG H J K M N P S SS T - - $Gi = \u1100; - $GGi = \u1101; - $Ni = \u1102; - $Di = \u1103; - $DD = \u1104; - $R = \u1105; - $Mi = \u1106; - $Bi = \u1107; - $BB = \u1108; - $Si = \u1109; - $SSi = \u110A; - $IEUNG = \u110B; # null initial, inserted during Latin-Jamo - $Ji = \u110C; - $JJ = \u110D; - $Ci = \u110E; - $Ki = \u110F; - $Ti = \u1110; - $Pi = \u1111; - $Hi = \u1112; - - $A = \u1161; - $AE = \u1162; - $YA = \u1163; - $YAE = \u1164; - $EO = \u1165; - $E = \u1166; - $YEO = \u1167; - $YE = \u1168; - $O = \u1169; - $WA = \u116A; - $WAE = \u116B; - $OE = \u116C; - $YO = \u116D; - $U = \u116E; - $WEO = \u116F; - $WE = \u1170; - $WI = \u1171; - $YU = \u1172; - $EU = \u1173; # null medial, inserted during Latin-Jamo - $YI = \u1174; - $I = \u1175; - - $Gf = \u11A8; - $GGf = \u11A9; - $GS = \u11AA; - $Nf = \u11AB; - $NJ = \u11AC; - $NH = \u11AD; - $Df = \u11AE; - $L = \u11AF; - $LG = \u11B0; - $LM = \u11B1; - $LB = \u11B2; - $LS = \u11B3; - $LT = \u11B4; - $LP = \u11B5; - $LH = \u11B6; - $Mf = \u11B7; - $Bf = \u11B8; - $BS = \u11B9; - $Sf = \u11BA; - $SSf = \u11BB; - $NG = \u11BC; - $Jf = \u11BD; - $Cf = \u11BE; - $Kf = \u11BF; - $Tf = \u11C0; - $Pf = \u11C1; - $Hf = \u11C2; - - $jamoInitial = [\u1100-\u1112]; - - $jamoMedial = [\u1161-\u1175]; - - $latinInitial = [bcdghjkmnprst]; - - # Any character in the latin transliteration of a medial - $latinMedial = [aeiouwy]; - - # The last character of the latin transliteration of a medial - $latinMedialEnd = [aeiou]; - - # Disambiguation separator - $sep = \'; - -#---------------------------------------------------------------------- -# Jamo-Latin - -# Jamo to latin is relatively simple, since it is the latin that is -# ambiguous. Most rules are straightforward, and we encode them below -# as simple add-on back rule, e.g.: - -# $jamoMedial {bs} > $BS; - -# becomes - -# $jamoMedial {bs} <> $BS; - -# Furthermore, we don't care about the ordering for Jamo-Latin because -# we are going from single characters, so we can very easily piggyback -# on the Latin-Jamo. - -# The main issue with Jamo-Latin is when to insert separators. -# Separators are inserted to obtain correct round trip behavior. For -# example, the sequence Ki A Gf Gi E, if transliterated to "kagge", -# would then round trip to Ki A GGi E. To prevent this, we insert a -# separator: "kag-ge". IMPORTANT: The need for separators depends -# very specifically on the behavior of the Latin-Jamo rules. A change -# in the Latin-Jamo behavior can completely change the way the -# separator insertion must be done. - -# First try to preserve actual separators in the jamo text by doubling -# them. This fixes problems like: -# (Di)(A)(Ji)(U)(NG)-(IEUNG)(YEO)(Nf)(Gi)(YEO)(L) => dajung-yeongyeol -# => (Di)(A)(Ji)(U)(NG)(IEUNG)(YEO)(Nf)(Gi)(YEO)(L). This is optional -# -- if we don't care about losing separators in the jamo, we can delete -# this rule. - - $sep $sep <> $sep; - -# Triple consonants. For three consonants "axxx" we insert a -# separator between the first and second "x" if XXf, Xf, and Xi all -# exist, and we have A Xf XXi. This prevents the reverse -# transliteration to A XXf Xi. - - $sep < $latinMedialEnd g {} $GGi; - $sep < $latinMedialEnd s {} $SSi; - -# For vowels the rule is similar. If there is a vowel "ae" such that -# "a" by itself and "e" by itself are vowels, then we want to map A E -# to "a-e" so as not to round trip to AE. However, in the text Ki EO -# IEUNG E we don't need to map to "keo-e". "keoe" suffices. For -# vowels of the form "aei", both "ae" + "i" and "a" + "ei" must be -# tested. NOTE: These rules used to have a left context of -# $latinInitial instead of [^$latinMedial]. The problem with this is -# sequences where an initial IEUNG is transliterated away: -# (IEUNG)(A)(IEUNG)(EO) => aeo => (IEUNG)(AE)(IEUNG)(O) - - $sep < [^$latinMedial] [y w] e {} [$O $OE]; - $sep < [^$latinMedial] e {} [$O $OE $U]; - $sep < [^$latinMedial] [o a] {} [$E $EO $EU]; - $sep < [^$latinMedial] [w y] a {} [$E $EO $EU]; - -# Similar to the above, but with an intervening $IEUNG. - - $sep < [^$latinMedial] [y w] e {} $IEUNG [$O $OE]; - $sep < [^$latinMedial] e {} $IEUNG [$O $OE $U]; - $sep < [^$latinMedial] [o a] {} $IEUNG [$E $EO $EU]; - $sep < [^$latinMedial] [w y] a {} $IEUNG [$E $EO $EU]; - -# Single finals followed by IEUNG. The jamo sequence A Xf IEUNG E, -# where Xi also exists, must be transliterated as "ax-e" to prevent -# the round trip conversion to A Xi E. - - $sep < $latinMedialEnd b {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd c {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd d {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd g {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd h {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd j {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd k {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd m {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd n {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd p {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd s {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd t {} $IEUNG $jamoMedial; - -# Double finals followed by IEUNG. Similar to the single finals -# followed by IEUNG. Any latin consonant pair X Y, between medials, -# that we would split by Latin-Jamo, we must handle when it occurs as -# part of A XYf IEUNG E, to prevent round trip conversion to A Xf Yi -# E. - - $sep < $latinMedialEnd b s {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd g g {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd g s {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd l b {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd l g {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd l h {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd l m {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd l p {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd l s {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd l t {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd n g {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd n h {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd n j {} $IEUNG $jamoMedial; - $sep < $latinMedialEnd s s {} $IEUNG $jamoMedial; - -# Split doubles. Text of the form A Xi Xf E, where XXi also occurs, -# we transliterate as "ax-xe" to prevent round trip transliteration as -# A XXi E. - - $sep < $latinMedialEnd b {} $Bi $jamoMedial; - $sep < $latinMedialEnd d {} $Di $jamoMedial; - $sep < $latinMedialEnd j {} $Ji $jamoMedial; - $sep < $latinMedialEnd g {} $Gi $jamoMedial; - $sep < $latinMedialEnd s {} $Si $jamoMedial; - -# XYY. This corresponds to the XYY rule in Latin-Jamo. By default -# Latin-Jamo maps "xyy" to Xf YYi, to keep YY together. As a result, -# "xyy" forms that correspond to XYf Yi must be transliterated as -# "xy-y". - - $sep < $latinMedialEnd b s {} [$Si $SSi]; - $sep < $latinMedialEnd g s {} [$Si $SSi]; - $sep < $latinMedialEnd l b {} [$Bi $BB]; - $sep < $latinMedialEnd l g {} [$Gi $GGi]; - $sep < $latinMedialEnd l s {} [$Si $SSi]; - $sep < $latinMedialEnd n g {} [$Gi $GGi]; - $sep < $latinMedialEnd n j {} [$Ji $JJ]; - -# Deletion of IEUNG is handled below. - -#---------------------------------------------------------------------- -# Latin-Jamo - -# [Basic, context-free Jamo-Latin rules are embedded here too. See -# above.] - -# Split digraphs: Text of the form 'axye', where 'xy' is a final -# digraph, 'x' is a final (by itself), 'y' is an initial, and 'a' and -# 'e' are medials, we want to transliterate this as A Xf Yi E rather -# than A XYf IEUNG E. We do NOT include text of the form "axxe", -# since that is handled differently below. These rules are generated -# programmatically from the jamo data. - - $jamoMedial {b s} $latinMedial > $Bf $Si; - $jamoMedial {g s} $latinMedial > $Gf $Si; - $jamoMedial {l b} $latinMedial > $L $Bi; - $jamoMedial {l g} $latinMedial > $L $Gi; - $jamoMedial {l h} $latinMedial > $L $Hi; - $jamoMedial {l m} $latinMedial > $L $Mi; - $jamoMedial {l p} $latinMedial > $L $Pi; - $jamoMedial {l s} $latinMedial > $L $Si; - $jamoMedial {l t} $latinMedial > $L $Ti; - $jamoMedial {n g} $latinMedial > $Nf $Gi; - $jamoMedial {n h} $latinMedial > $Nf $Hi; - $jamoMedial {n j} $latinMedial > $Nf $Ji; - -# Single consonants are initials: Text of the form 'axe', where 'x' -# can be an initial or a final, and 'a' and 'e' are medials, we want -# to transliterate as A Xi E rather than A Xf IEUNG E. - - $jamoMedial {b} $latinMedial > $Bi; - $jamoMedial {c} $latinMedial > $Ci; - $jamoMedial {d} $latinMedial > $Di; - $jamoMedial {g} $latinMedial > $Gi; - $jamoMedial {h} $latinMedial > $Hi; - $jamoMedial {j} $latinMedial > $Ji; - $jamoMedial {k} $latinMedial > $Ki; - $jamoMedial {m} $latinMedial > $Mi; - $jamoMedial {n} $latinMedial > $Ni; - $jamoMedial {p} $latinMedial > $Pi; - $jamoMedial {s} $latinMedial > $Si; - $jamoMedial {t} $latinMedial > $Ti; - -# Doubled initials. The sequence "axxe", where XX exists as an initial -# (XXi), and also Xi and Xf exist (true of all digraphs XX), we want -# to transliterate as A XXi E, rather than split to A Xf Xi E. - - $jamoMedial {b b} $latinMedial > $BB; - $jamoMedial {d d} $latinMedial > $DD; - $jamoMedial {j j} $latinMedial > $JJ; - $jamoMedial {g g} $latinMedial > $GGi; - $jamoMedial {s s} $latinMedial > $SSi; - -# XYY. Because doubled consonants bind more strongly than XY -# consonants, we must handle the sequence "axyy" specially. Here XYf -# and YYi must exist. In these cases, we map to Xf YYi rather than -# XYf. - - $jamoMedial {b} s s > $Bf; - $jamoMedial {g} s s > $Gf; - $jamoMedial {l} b b > $L; - $jamoMedial {l} g g > $L; - $jamoMedial {l} s s > $L; - $jamoMedial {n} g g > $Nf; - $jamoMedial {n} j j > $Nf; - -# Finals: Attach consonant with preceding medial to preceding medial. -# Do this BEFORE mapping consonants to initials. Longer keys must -# precede shorter keys that they start with, e.g., the rule for 'bs' -# must precede 'b'. - -# [BASIC Jamo-Latin FINALS handled here. Order irrelevant within this -# block for Jamo-Latin.] - - $jamoMedial {bs} <> $BS; - $jamoMedial {b} <> $Bf; - $jamoMedial {c} <> $Cf; - $jamoMedial {d} <> $Df; - $jamoMedial {gg} <> $GGf; - $jamoMedial {gs} <> $GS; - $jamoMedial {g} <> $Gf; - $jamoMedial {h} <> $Hf; - $jamoMedial {j} <> $Jf; - $jamoMedial {k} <> $Kf; - $jamoMedial {lb} <> $LB; $jamoMedial {lg} <> $LG; - $jamoMedial {lh} <> $LH; - $jamoMedial {lm} <> $LM; - $jamoMedial {lp} <> $LP; - $jamoMedial {ls} <> $LS; - $jamoMedial {lt} <> $LT; - $jamoMedial {l} <> $L; - $jamoMedial {m} <> $Mf; - $jamoMedial {ng} <> $NG; - $jamoMedial {nh} <> $NH; - $jamoMedial {nj} <> $NJ; - $jamoMedial {n} <> $Nf; - $jamoMedial {p} <> $Pf; - $jamoMedial {ss} <> $SSf; - $jamoMedial {s} <> $Sf; - $jamoMedial {t} <> $Tf; - -# Initials: Attach single consonant to following medial. Do this -# AFTER mapping finals. Longer keys must precede shorter keys that -# they start with, e.g., the rule for 'gg' must precede 'g'. - -# [BASIC Jamo-Latin INITIALS handled here. Order irrelevant within -# this block for Jamo-Latin.] - - {gg} $latinMedial <> $GGi; - {g} $latinMedial <> $Gi; - {n} $latinMedial <> $Ni; - {dd} $latinMedial <> $DD; - {d} $latinMedial <> $Di; - {r} $latinMedial <> $R; - {m} $latinMedial <> $Mi; - {bb} $latinMedial <> $BB; - {b} $latinMedial <> $Bi; - {ss} $latinMedial <> $SSi; - {s} $latinMedial <> $Si; - {jj} $latinMedial <> $JJ; - {j} $latinMedial <> $Ji; - {c} $latinMedial <> $Ci; - {k} $latinMedial <> $Ki; - {t} $latinMedial <> $Ti; - {p} $latinMedial <> $Pi; - {h} $latinMedial <> $Hi; - -# 'r' in final position. Because of the equivalency of the 'l' and -# 'r' jamo (the glyphs are the same), we try to provide the same -# equivalency in Latin-Jamo. The 'l' to 'r' conversion is handled -# below. If we see an 'r' in an apparent final position, treat it -# like 'l'. For example, "karka" => Ki A R EU Ki A without this rule. -# Instead, we want Ki A L Ki A. - - $jamoMedial {r} $latinInitial > | l; - -# Initial + Final: If we match the next rule, we have initial then -# final consonant with no intervening medial. We insert the null -# vowel BEFORE it to create a well-formed syllable. (In the next rule -# we insert a null vowel AFTER an anomalous initial.) - - $jamoInitial {} [bcdghjklmnpst] > $EU; - -# Initial + X: This block matches an initial consonant not followed by -# a medial. We insert the null vowel after it. We handle double -# initials explicitly here; for single initial consonants we insert EU -# (as Latin) after them and let standard rules do the rest. - -# BREAKS ROUND TRIP INTEGRITY - - gg > $GGi $EU; - dd > $DD $EU; - bb > $BB $EU; - ss > $SSi $EU; - jj > $JJ $EU; - - ([bcdghjkmnprst]) > | $1 eu; - -# X + Final: Finally we have to deal with a consonant that can only be -# interpreted as a final (not an initial) and which is preceded -# neither by an initial nor a medial. It is the start of the -# syllable, but cannot be. Most of these will already be handled by -# the above rules. 'bs' splits into Bi EU Sf. Similar for 'gs' 'ng' -# 'nh' 'nj'. The only problem is 'l' and digraphs starting with 'l'. -# For this isolated case, we could add a null initial and medial, -# which would give "la" => IEUNG EU L IEUNG A, for example. A more -# economical solution is to transliterate isolated "l" (that is, -# initial "l") to "r". (Other similar conversions of consonants that -# occur neither as initials nor as finals are handled below.) - - l > | r; - -# Medials. If a medial is preceded by an initial, then we proceed -# normally. As usual, longer keys must precede shorter ones. - -# [BASIC Jamo-Latin MEDIALS handled here. Order irrelevant within -# this block for Jamo-Latin.] - - $jamoInitial {ae} <> $AE; - $jamoInitial {a} <> $A; - $jamoInitial {eo} <> $EO; - $jamoInitial {eu} <> $EU; - $jamoInitial {e} <> $E; - $jamoInitial {i} <> $I; - $jamoInitial {oe} <> $OE; - $jamoInitial {o} <> $O; - $jamoInitial {u} <> $U; - $jamoInitial {wae} <> $WAE; - $jamoInitial {wa} <> $WA; - $jamoInitial {weo} <> $WEO; - $jamoInitial {we} <> $WE; - $jamoInitial {wi} <> $WI; - $jamoInitial {yae} <> $YAE; - $jamoInitial {ya} <> $YA; - $jamoInitial {yeo} <> $YEO; - $jamoInitial {ye} <> $YE; - $jamoInitial {yi} <> $YI; - $jamoInitial {yo} <> $YO; - $jamoInitial {yu} <> $YU; - -# We may see an anomalous isolated 'w' or 'y'. In that case, we -# interpret it as 'wi' and 'yu', respectively. - -# BREAKS ROUND TRIP INTEGRITY - - $jamoInitial {w} > | wi; - $jamoInitial {y} > | yu; - -# Otherwise, insert a null consonant IEUNG before the medial (which is -# still an untransliterated latin vowel). - - ($latinMedial) > $IEUNG | $1; - -# Convert non-jamo latin consonants to equivalents. These occur as -# neither initials nor finals in jamo. 'l' occurs as a final, but not -# an initial; it is handled above. The following letters (left hand -# side) will never be output by Jamo-Latin. - - f > | p; - q > | k; - v > | b; - x > | ks; - z > | s; - -# Delete separators (Latin-Jamo). - - $sep > ; - -# Delete null consonants (Jamo-Latin). Do NOT delete null EU vowels, -# since these may also occur in text. - - < $IEUNG; - -#- N.B. DO NOT put any filters, NFD, etc. here -- those are aliased in -#- the INDEX file. This transliterator is, by itself, not -#- instantiated. It is used as a part of Latin-Jamo, Latin-Hangul, or -#- inverses thereof. - -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Latin_Katakana.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Latin_Katakana.txt deleted file mode 100755 index c8bcd412be..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Latin_Katakana.txt +++ /dev/null @@ -1,499 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/text/resources/Attic/Transliterator_Latin_Katakana.txt,v $ -# $Date: 2001/12/03 02:10:26 $ -# $Revision: 1.19 $ -#-------------------------------------------------------------------- - -# note: a global filter is more efficient, but MUST include all source chars -#:: [\u0000-\u007E \u3001\u3002 \u3099-\u309C \u30A1-\u30FC \uFF61-\uFF9F [:Latin:][:Katakana:] [:nonspacing mark:]] ; -# MINIMAL FILTER GENERATED FOR: Latin-Katakana -### WARNING -- must add width filter, both here and below!!! ### -:: [[\u1100-\u1112\u111A\u1121\u1160-\u1175\u11AA\u11AC-\u11AD\u11B0-\u11B5\u2190-\u2193\u2502\u25A0\u25CB\u3000-\u3002\u300C-\u300D\u3099-\u309A\u30A1-\u30ED\u30EF\u30F2-\u30F4\u30F7\u30FA-\u30FC\uFF01-\uFF5E\uFFE0-\uFFE6][',.A-Za-z~\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0304\u04E2-\u04E3\u04EE-\u04EF\u1E00-\u1E99\u1EA0-\u1EF9\u1FB1\u1FB9\u1FD1\u1FD9\u1FE1\u1FE9\u212A-\u212B]] ; - -:: [:Latin:] fullwidth-halfwidth (); -:: NFD (NFC); -:: Lower (); # whenever transliterating from cased to uncased script, include this -# :: NFD () ; # this would catch the odd cases where a lowercase is not in NFD, but none are important for Japanese - -# Uses modified Hepburn. Small changes to make unambiguous. - -# | Kunrei-shiki: Hepburn/MHepburn -# | ------------------------------ -# | si: shi -# | si ~ya: sha -# | si ~yu: shu -# | si ~yo: sho -# | zi: ji -# | zi ~ya: ja -# | zi ~yu: ju -# | zi ~yo: jo -# | ti: chi -# | ti ~ya: cha -# | ti ~yu: chu -# | ti ~yu: cho -# | tu: tsu -# | di: ji/dji -# | du: zu/dzu -# | hu: fu - -# | For foreign words: -# | ----------------- -# | se ~i si -# | si ~e she -# | -# | ze ~i zi -# | zi ~e je -# | -# | te ~i ti -# | ti ~e che -# | te ~u tu -# | -# | de ~i di -# | de ~u du -# | de ~i di -# | -# | he ~u: hu -# | hu ~a fa -# | hu ~i fi -# | hu ~e he -# | hu ~o ho - -# Most small forms are generated, but if necessary -# explicit small forms are given with ~a, ~ya, etc. - -#------------------------------------------------------ -# Variables - -$vowel = [aeiou] ; -$consonant = [bcdfghjklmnpqrstvwxyz] ; -$macron = \u0304 ; - -# Variables used for doubled-consonants with tsu - -$kana = [\u3041-\u3094] ; - -$voice = [\u3099\u309B]; -$semivoice = [\u309A\u309C]; - -$k_start = [カキクケコã‹ããã‘ã“] ; - -$s_start = [サシスセソã•ã—ã™ã›ã] ; - -$j_start = [ã‚·ã—] $voice ; - -$t_start = [ã‚¿ãƒãƒ„テトãŸã¡ã¤ã¦ã¨] ; - -$n_start = [ナニヌãƒãƒŽãƒ³ãªã«ã¬ã­ã®] ; - -$h_start = [ãƒãƒ’ヘホã¯ã²ã¸ã»] ; -$f_start = [フãµ] ; - -$m_start = [マミムメモã¾ã¿ã‚€ã‚ã‚‚] ; - -$y_start = [ヤユヨやゆよ] ; - -$r_start = [ラリルレロらりるれã‚] ; - -$w_start = [ワヰヱヲã‚ã‚ã‚‘ã‚’] ; - -$v_start = [ワヰヱヲ]ã‚™ ; - -# if ン is followed by $n_quoter, then it needs an -# apostrophe after its romaji form to disambiguate it. -# e.g., ン ã‚¢ ! = ナ, so represent as "n'a", not "na". - -$n_quoter = [ã‚¢ イ ウ エ オ ナ ニ ヌ ムノ ヤ ユ ヨ ン] ; - -$small_y = [ャィュェョ] ; - -$iteration = \u309D ; - -#------------------------------------------------------ -# katakana rules - -# Punctuation - -'.' <> 。; -',' <> ã€; -# ' ' } [a-z] > ; # delete spaces before latin -# ' ' < [^' '\u30A0-\u30ff] {} ['\u30A0-\u30ff] ; #insert spaces before hiragana - -# Iteration Mark -# Copy previous letter & marks - -# TODO -# | $1 $1 < ($kana [[:M:]$voice$semivoice]?) $iteration - -# Specials for katakana -- not shared with hiragana - -va <> ヷ ; -vi <> ヸ ; -ve <> ヹ ; -vo <> ヺ ; -'~ka' <> ヵ ; -'~ke' <> ヶ ; - -# ~~~ begin shared rules ~~~ - -#special - -ya < '~'ャ; -yi < '~'ã‚£ ; -yu < '~'ュ; -ye < '~'ェ; -yo < '~'ョ; - -#normal - -a <> ã‚¢ ; - -b | '~' < ヒ ã‚™} $small_y ; -by } $vowel > ビ | '~y' ; - -ba <> ãƒã‚™ ; -bi <> ビ ; -bu <> ブ ; -be <> ベ ; -bo <> ボ ; - -c } i > | s ; -c } e > | s ; - -da <> ã‚¿ã‚™ ; -di <> ディ ; -du <> デゥ ; -de <> デ ; -do <> ド ; -dzu <> ヅ ; -dja < ãƒã‚™ãƒ£ ; -dji'~i' < ãƒã‚™ã‚£ ; # liu -dju < ãƒã‚™ãƒ¥ ; -dje < ãƒã‚™ã‚§ ; -djo < ãƒã‚™ãƒ§ ; -dji <> ãƒã‚™ ; -dj } $vowel > ãƒã‚™ | '~y' ; - -# TODO: QUESTION: use ĵĴżŻ instead of dj, dz - -cha < ãƒãƒ£ ; -chi'~i' < ãƒã‚£ ; # liu -chu < ãƒãƒ¥ ; -che < ãƒã‚§ ; -cho < ãƒãƒ§ ; -chi <> ム; -ch } $vowel > ム| '~y' ; - -e <> エ ; - -g | '~' < ã‚­ã‚™} $small_y ; -gy } $vowel > ã‚­ã‚™ | '~y' ; - -ga <> ã‚«ã‚™ ; -gi <> ã‚­ã‚™ ; -gu <> グ ; -ge <> ゲ ; -go <> ゴ ; - -i <> イ ; - -# j } $vowel > ã‚·ã‚™ | '~y' ; - -ja <> ジャ ; -ji'~i' < ジィ ; # liu -ju <> ジュ ; -je <> ジェ ; -jo <> ジョ ; -ji <> ã‚·ã‚™ ; - -k | '~' < ã‚­} $small_y ; -ky } $vowel > ã‚­ | '~y' ; - -ka <> ã‚« ; -ki <> ã‚­ ; -ku <> ク ; -ke <> ケ ; -ko <> コ ; - -m | '~' < ミ} $small_y ; -my } $vowel > ミ | '~y' ; - -ma <> マ ; -mi <> ミ ; -mu <> ム ; -me <> メ ; -mo <> モ ; - -m } [pbfv] > ン ; - -n | '~' < ニ } $small_y ; -ny } $vowel > ニ | '~y' ; - -na <> ナ ; -ni <> ニ ; -nu <> ヌ ; -ne <> ム; -no <> ノ ; - -o <> オ ; - -p | '~' < ピ } $small_y ; -py } $vowel > ピ | '~y' ; - -pa <> ãƒã‚š ; -pi <> ピ ; -pu <> プ ; -pe <> ペ ; -po <> ポ ; - -h | '~' < ヒ } $small_y ; -hy } $vowel > ヒ | '~y' ; - -ha <> ム; -hi <> ヒ ; -hu <> ヘゥ ; -he <> ヘ ; -ho <> ホ ; - -# f | '~' < フ } $small_y ; -# f } $vowel > フ | '~' ; - -fa <> ファ ; -fi <> フィ ; -fe <> フェ ; -fo <> フォ ; -fu <> フ ; - -r | '~' < リ } $small_y ; -ry } $vowel > リ | '~y' ; - -ra <> ラ ; -ri <> リ ; -ru <> ル ; -re <> レ ; -ro <> ロ ; - -za <> ザ ; -zi <> ゼィ ; -zu <> ズ ; -ze <> ゼ ; -zo <> ゾ ; - -sa <> サ ; -si <> セィ ; -su <> ス ; -se <> ã‚» ; -so <> ソ ; - -sha < シャ ; -shi'~i' < ã‚·ã‚£ ; # liu -shu < シュ ; -she < シェ ; -sho < ショ ; -shi <> ã‚· ; -sh } $vowel > ã‚· | '~y' ; - -ta <> ã‚¿ ; -ti <> ティ ; -tu <> テゥ ; -te <> テ ; -to <> ト ; - -tsu <> ツ ; - -# v } $vowel > ヴ | '~' ; - -#'v~a' < ヴァ ; # liu -#'v~i' < ヴィ ; # liu -#'v~e' < ヴェ ; # liu -#'v~o' < ヴォ ; # liu -vu <> ヴ ; - -u <> ウ ; - -# w } $vowel > ウ | '~' ; - -wa <> ワ ; -wi <> ヰ ; -wu > ウ ; -we <> ヱ ; -wo <> ヲ ; - -ya <> ヤ ; -yi > イ ; -yu <> ユ ; -ye > エ ; -yo <> ヨ ; - -# double consonants - -#specials -s } sh > ッ ; -t } ch > ッ ; - -#voiced - -j } j <> ッ } $j_start ; -b } b <> ッ } [$h_start$f_start] $voice; -d } d <> ッ } $t_start $voice; -g } g <> ッ } $k_start $voice; -p } p <> ッ } [$h_start$f_start] $semivoice; -# v } v <> ッ } [ワヰウヱヲã†] $voice ; -z } z <> ッ } $s_start $voice; -v } v <> ッ } $v_start; - -# normal - -k } k <> ッ } $k_start ; -m } m <> ッ } $m_start ; -n } n <> ッ } $n_start ; -h } h <> ッ } $h_start ; -f } f <> ッ } $f_start ; -r } r <> ッ } $r_start ; -t } t <> ッ } $t_start ; -s } s <> ッ } $s_start ; - -w } w <> ッ } $w_start; -y } y <> ッ } $y_start; - -# completeness -x } x > ッ ; -c } k > ッ ; -c } c > ッ ; -c } q > ッ ; -l } l > ッ ; -q } q > ッ ; -# y } y > ッ ; -# w } w > ッ ; - -# prolonged vowel mark. this indicates a doubling of -# the preceding vowel sound - -#a < a { ー ; # liu -#e < e { ー ; # liu -#i < i { ー ; # liu -#o < o { ー ; # liu -#u < u { ー ; # liu - -$macron <> ー ; - -# small forms - -'~a' <> ã‚¡ ; -'~i' <> ã‚£ ; -'~u' <> ã‚¥ ; -'~e' <> ェ ; -'~o' <> ã‚© ; -'~tsu' <> ッ ; -'~wa' <> ヮ ; -'~ya' <> ャ ; -'~yi' > ã‚£ ; -'~yu' <> ュ ; -'~ye' > ェ ; -'~yo' <> ョ ; - -# iteration marks -# TODO: make more accurate - -j $1 < sh (y* $vowel) {ヽ$voice ; -dj $1 < ch (y* $vowel) {ヽ$voice ; -dz $1 < ts (y* $vowel) {ヽ$voice ; - -g $1 < k (y* $vowel) {ヽ$voice ; -z $1 < s (y* $vowel) {ヽ$voice ; -d $1 < t (y* $vowel) {ヽ$voice ; -h $1 < b (y* $vowel) {ヽ$voice ; -v $1 < w (y* $vowel) {ヽ$voice ; - -sh $1 < sh (y* $vowel) {ヽ$voice ; -j $1 < j (y* $vowel) {ヽ$voice ; -ch $1 < ch (y* $vowel) {ヽ$voice ; -dj $1 < dj(y* $vowel) {ヽ$voice ; -ts $1 < ts (y* $vowel) {ヽ$voice ; -dz $1 < dz (y* $vowel) {ヽ$voice ; - -$1 < ($consonant y* $vowel) {ヽ$voice? ; -$1 < (.) {ヽ $voice? ; # otherwise repeat last character - < ヽ $voice? ; # delete if no characters found - -# h- rule: lengthens vowel if not followed by a vowel - -[aeiou] } h > ー ; - -# one-way latin- > kana rules. these do not occur in -# well-formed romaji representing actual japanese text. -# their purpose is to make all romaji map to kana of -# some sort. - -# the following are not really necessary, but produce -# slightly more natural results. - -cy > セィ ; -dy > ディ ; -hy > ヒ ; -sy > セィ ; -ty > ティ ; -zy > ゼィ ; - -h > ヘ ; - -# isolated consonants listed here so as not to mask -# longer rules above. - -ch > ãƒ; -sh > ã‚· ; -dz > ヅ ; -dj > ãƒã‚™; - -b > ブ ; -d > デ ; -g > グ ; -k > ク ; -m > ム ; -n'' < ン } $n_quoter ; -n <> ン ; -p > プ ; -r > ル ; -s > ス ; -t > テ ; -y > イ ; -z > ズ ; -v > ヴ ; - -f > フ; -j > ã‚·ã‚™; -w > ウ; - -ß > | ss ; -æ > | e ; -ð > | d ; -ø > | u ; -þ > | th ; - -# simple substitutions using backup - -c > | k ; -l > | r ; -q > | k ; -x > | ks ; - -# ~~~ END shared rules ~~~ - -#------------------------------------------------------ -# Final cleanup - -'~' > ; # delete stray tildes between letters -[:Katakana:] { '' } [:Latin:] > ; # delete stray quotes between letters -# [\u02BE[:Nonspacing Mark:]-[\u3099-\u309C]] > ; # delete any non-spacing marks that we didn't use - -:: NFC (NFD) ; -:: ([:Katakana:] halfwidth-fullwidth); - -# note: a global filter is more efficient, but MUST include all source chars!! -#:: ([\u0000-\u007E \u3001\u3002 \u3099-\u309C \u30A1-\u30FC \uFF61-\uFF9F [:Latin:][:Katakana:] [:nonspacing mark:]]); -# MINIMAL FILTER GENERATED FOR: Latin-Katakana BACKWARD -:: ( [[\ -~\u00A2-\u00A3\u00A5-\u00A6\u00AC\u0304\u20A9\uFF61-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE8-\uFFEE][~\u3001-\u3002\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062\u3065\u3067\u3069\u3070-\u3071\u3073-\u3074\u3076-\u3077\u3079-\u307A\u307C-\u307D\u3094\u3099-\u309B\u309E\u30A1-\u30FA\u30FC-\u30FE]] ) ; - -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Malayalam_InterIndic.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Malayalam_InterIndic.txt deleted file mode 100755 index cf8a0c4218..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Malayalam_InterIndic.txt +++ /dev/null @@ -1,96 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_Malayalam_InterIndic.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# Malayalam_InterIndic -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:42:06 2001 -#-------------------------------------------------------------------- -# Malayalam-InterIndic -#:: NFD (NFC) ; - -\u0D02>\uE002; # SIGN ANUSVARA -\u0D03>\uE003; # SIGN VISARGA -\u0D05>\uE005; # LETTER A -\u0D06>\uE006; # LETTER AA -\u0D07>\uE007; # LETTER I -\u0D08>\uE008; # LETTER II -\u0D09>\uE009; # LETTER U -\u0D0A>\uE00A; # LETTER UU -\u0D0B>\uE00B; # LETTER VOCALIC R -\u0D0C>\uE00C; # LETTER VOCALIC L -\u0D0E>\uE00E; # LETTER E -\u0D0F>\uE00F; # LETTER EE -\u0D10>\uE010; # LETTER AI -\u0D12>\uE012; # LETTER O -\u0D13>\uE013; # LETTER OO -\u0D14>\uE014; # LETTER AU -\u0D15>\uE015; # LETTER KA -\u0D16>\uE016; # LETTER KHA -\u0D17>\uE017; # LETTER GA -\u0D18>\uE018; # LETTER GHA -\u0D19>\uE019; # LETTER NGA -\u0D1A>\uE01A; # LETTER CA -\u0D1B>\uE01B; # LETTER CHA -\u0D1C>\uE01C; # LETTER JA -\u0D1D>\uE01D; # LETTER JHA -\u0D1E>\uE01E; # LETTER NYA -\u0D1F>\uE01F; # LETTER TTA -\u0D20>\uE020; # LETTER TTHA -\u0D21>\uE021; # LETTER DDA -\u0D22>\uE022; # LETTER DDHA -\u0D23>\uE023; # LETTER NNA -\u0D24>\uE024; # LETTER TA -\u0D25>\uE025; # LETTER THA -\u0D26>\uE026; # LETTER DA -\u0D27>\uE027; # LETTER DHA -\u0D28>\uE028; # LETTER NA -\u0D2A>\uE02A; # LETTER PA -\u0D2B>\uE02B; # LETTER PHA -\u0D2C>\uE02C; # LETTER BA -\u0D2D>\uE02D; # LETTER BHA -\u0D2E>\uE02E; # LETTER MA -\u0D2F>\uE02F; # LETTER YA -\u0D30>\uE030; # LETTER RA -\u0D31>\uE031; # LETTER RRA -\u0D32>\uE032; # LETTER LA -\u0D33>\uE033; # LETTER LLA -\u0D34>\uE034; # LETTER LLLA -\u0D35>\uE035; # LETTER VA -\u0D36>\uE036; # LETTER SHA -\u0D37>\uE037; # LETTER SSA -\u0D38>\uE038; # LETTER SA -\u0D39>\uE039; # LETTER HA -\u0D3E>\uE03E; # VOWEL SIGN AA -\u0D3F>\uE03F; # VOWEL SIGN I -\u0D40>\uE040; # VOWEL SIGN II -\u0D41>\uE041; # VOWEL SIGN U -\u0D42>\uE042; # VOWEL SIGN UU -\u0D43>\uE043; # VOWEL SIGN VOCALIC R -\u0D46>\uE046; # VOWEL SIGN E -\u0D47>\uE047; # VOWEL SIGN EE -\u0D48>\uE048; # VOWEL SIGN AI -\u0D4D>\uE04D; # SIGN VIRAMA -\u0D57>\uE057; # AU LENGTH MARK -\u0D60>\uE060; # LETTER VOCALIC RR -\u0D61>\uE061; # LETTER VOCALIC LL -\u0D66>\uE066; # DIGIT ZERO -\u0D67>\uE067; # DIGIT ONE -\u0D68>\uE068; # DIGIT TWO -\u0D69>\uE069; # DIGIT THREE -\u0D6A>\uE06A; # DIGIT FOUR -\u0D6B>\uE06B; # DIGIT FIVE -\u0D6C>\uE06C; # DIGIT SIX -\u0D6D>\uE06D; # DIGIT SEVEN -\u0D6E>\uE06E; # DIGIT EIGHT -\u0D6F>\uE06F; # DIGIT NINE -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Oriya_InterIndic.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Oriya_InterIndic.txt deleted file mode 100755 index 926d888131..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Oriya_InterIndic.txt +++ /dev/null @@ -1,102 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_Oriya_InterIndic.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# Oriya_InterIndic -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:42:07 2001 -#-------------------------------------------------------------------- -# Oriya-InterIndic -#:: NFD (NFC) ; -#\u0B21\u0B3C>\uE05C;# LETTER RRA -#\u0B22\u0B3C>\uE05D;# LETTER RHA -\u0B47\u0B56>\uE048;# VOWEL SIGN AI -\u0B47\u0B3E>\uE04B;# VOWEL SIGN O -\u0B47\u0B57>\uE04C;# VOWEL SIGN AU - -\u0B01>\uE001; # SIGN CANDRABINDU -\u0B02>\uE002; # SIGN ANUSVARA -\u0B03>\uE003; # SIGN VISARGA -\u0B05>\uE005; # LETTER A -\u0B06>\uE006; # LETTER AA -\u0B07>\uE007; # LETTER I -\u0B08>\uE008; # LETTER II -\u0B09>\uE009; # LETTER U -\u0B0A>\uE00A; # LETTER UU -\u0B0B>\uE00B; # LETTER VOCALIC R -\u0B0C>\uE00C; # LETTER VOCALIC L -\u0B0F>\uE00F; # LETTER E -\u0B10>\uE010; # LETTER AI -\u0B13>\uE013; # LETTER O -\u0B14>\uE014; # LETTER AU -\u0B15>\uE015; # LETTER KA -\u0B16>\uE016; # LETTER KHA -\u0B17>\uE017; # LETTER GA -\u0B18>\uE018; # LETTER GHA -\u0B19>\uE019; # LETTER NGA -\u0B1A>\uE01A; # LETTER CA -\u0B1B>\uE01B; # LETTER CHA -\u0B1C>\uE01C; # LETTER JA -\u0B1D>\uE01D; # LETTER JHA -\u0B1E>\uE01E; # LETTER NYA -\u0B1F>\uE01F; # LETTER TTA -\u0B20>\uE020; # LETTER TTHA -\u0B21>\uE021; # LETTER DDA -\u0B22>\uE022; # LETTER DDHA -\u0B23>\uE023; # LETTER NNA -\u0B24>\uE024; # LETTER TA -\u0B25>\uE025; # LETTER THA -\u0B26>\uE026; # LETTER DA -\u0B27>\uE027; # LETTER DHA -\u0B28>\uE028; # LETTER NA -\u0B2A>\uE02A; # LETTER PA -\u0B2B>\uE02B; # LETTER PHA -\u0B2C>\uE02C; # LETTER BA -\u0B2D>\uE02D; # LETTER BHA -\u0B2E>\uE02E; # LETTER MA -\u0B2F>\uE02F; # LETTER YA -\u0B30>\uE030; # LETTER RA -\u0B32>\uE032; # LETTER LA -\u0B33>\uE033; # LETTER LLA -\u0B36>\uE036; # LETTER SHA -\u0B37>\uE037; # LETTER SSA -\u0B38>\uE038; # LETTER SA -\u0B39>\uE039; # LETTER HA -\u0B3C>\uE03C; # SIGN NUKTA -\u0B3D>\uE03D; # SIGN AVAGRAHA -\u0B3E>\uE03E; # VOWEL SIGN AA -\u0B3F>\uE03F; # VOWEL SIGN I -\u0B40>\uE040; # VOWEL SIGN II -\u0B41>\uE041; # VOWEL SIGN U -\u0B42>\uE042; # VOWEL SIGN UU -\u0B43>\uE043; # VOWEL SIGN VOCALIC R -\u0B47>\uE047; # VOWEL SIGN E -# -\u0B4D>\uE04D; # SIGN VIRAMA -\u0B56>\uE056; # AI LENGTH MARK -\u0B57>\uE057; # AU LENGTH MARK -# -\u0B5F>\uE05F; # LETTER YYA -\u0B60>\uE060; # LETTER VOCALIC RR -\u0B61>\uE061; # LETTER VOCALIC LL -\u0B66>\uE066; # DIGIT ZERO -\u0B67>\uE067; # DIGIT ONE -\u0B68>\uE068; # DIGIT TWO -\u0B69>\uE069; # DIGIT THREE -\u0B6A>\uE06A; # DIGIT FOUR -\u0B6B>\uE06B; # DIGIT FIVE -\u0B6C>\uE06C; # DIGIT SIX -\u0B6D>\uE06D; # DIGIT SEVEN -\u0B6E>\uE06E; # DIGIT EIGHT -\u0B6F>\uE06F; # DIGIT NINE -\u0B70>\uE070; # ISSHAR -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Tamil_InterIndic.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Tamil_InterIndic.txt deleted file mode 100755 index 63bdc6f791..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Tamil_InterIndic.txt +++ /dev/null @@ -1,86 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_Tamil_InterIndic.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# Tamil_InterIndic -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:42:07 2001 -#-------------------------------------------------------------------- -# Tamil-InterIndic -#:: NFD (NFC) ; - -\u0BC6\u0BBE>\uE04A;# VOWEL SIGN O -\u0BC7\u0BBE>\uE04B;# VOWEL SIGN OO -\u0BC6\u0BD7>\uE04C;# VOWEL SIGN AU -\u0B92\u0BD7>\uE014;# LETTER AU - -\u0B82>\uE002; # SIGN ANUSVARA -\u0B83>\uE003; # SIGN VISARGA -\u0B85>\uE005; # LETTER A -\u0B86>\uE006; # LETTER AA -\u0B87>\uE007; # LETTER I -\u0B88>\uE008; # LETTER II -\u0B89>\uE009; # LETTER U -\u0B8A>\uE00A; # LETTER UU -\u0B8E>\uE00E; # LETTER E -\u0B8F>\uE00F; # LETTER EE -\u0B90>\uE010; # LETTER AI -\u0B92>\uE012; # LETTER O -\u0B93>\uE013; # LETTER OO -\u0B95>\uE015; # LETTER KA -\u0B99>\uE019; # LETTER NGA -\u0B9A>\uE01A; # LETTER CA -\u0B9C>\uE01C; # LETTER JA -\u0B9E>\uE01E; # LETTER NYA -\u0B9F>\uE01F; # LETTER TTA -\u0BA3>\uE023; # LETTER NNA -\u0BA4>\uE024; # LETTER TA -\u0BA8>\uE028; # LETTER NA -\u0BA9>\uE029; # LETTER NNNA -\u0BAA>\uE02A; # LETTER PA -\u0BAE>\uE02E; # LETTER MA -\u0BAF>\uE02F; # LETTER YA -\u0BB0>\uE030; # LETTER RA -\u0BB1>\uE031; # LETTER RRA -\u0BB2>\uE032; # LETTER LA -\u0BB3>\uE033; # LETTER LLA -\u0BB4>\uE034; # LETTER LLLA -\u0BB5>\uE035; # LETTER VA -\u0BB7>\uE037; # LETTER SSA -\u0BB8>\uE038; # LETTER SA -\u0BB9>\uE039; # LETTER HA -\u0BBE>\uE03E; # VOWEL SIGN AA -\u0BBF>\uE03F; # VOWEL SIGN I -\u0BC0>\uE040; # VOWEL SIGN II -\u0BC1>\uE041; # VOWEL SIGN U -\u0BC2>\uE042; # VOWEL SIGN UU -\u0BC6>\uE046; # VOWEL SIGN E -\u0BC7>\uE047; # VOWEL SIGN EE -\u0BC8>\uE048; # VOWEL SIGN AI - -\u0BCD>\uE04D; # SIGN VIRAMA -\u0BD7>\uE057; # AU LENGTH MARK -\u0BE7>\uE067; # DIGIT ONE -\u0BE8>\uE068; # DIGIT TWO -\u0BE9>\uE069; # DIGIT THREE -\u0BEA>\uE06A; # DIGIT FOUR -\u0BEB>\uE06B; # DIGIT FIVE -\u0BEC>\uE06C; # DIGIT SIX -\u0BED>\uE06D; # DIGIT SEVEN -\u0BEE>\uE06E; # DIGIT EIGHT -\u0BEF>\uE06F; # DIGIT NINE -\u0BF0>\uE067\uE066; # UNMAPPED Tamil-InterIndic: NUMBER TEN -\u0BF1>\uE067\uE066\uE066; # UNMAPPED Tamil-InterIndic: NUMBER ONE HUNDRED -\u0BF2>\uE067\uE066\uE066\uE066;# UNMAPPED Tamil-InterIndic: NUMBER ONE THOUSAND -0>\ue066; - -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_Telugu_InterIndic.txt b/icu4j/src/com/ibm/text/resources/Transliterator_Telugu_InterIndic.txt deleted file mode 100755 index 45cdb499ed..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_Telugu_InterIndic.txt +++ /dev/null @@ -1,101 +0,0 @@ -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# THIS IS A MACHINE-GENERATED FILE -# Tool: dumpICUrules.bat -# Source: \u005cicu4j\u005csrc\u005ccom\u005cibm\u005ctext\u005cresources/Transliterator_Telugu_InterIndic.utf8.txt -# Date: Thu Mar 1 20:03:55 2001 -#-------------------------------------------------------------------- -# Telugu_InterIndic -#-------------------------------------------------------------------- -# Copyright (c) 1999-2001, International Business Machines -# Corporation and others. All Rights Reserved. -#-------------------------------------------------------------------- -# Date: Tue Jan 23 12:42:07 2001 -#-------------------------------------------------------------------- -# Telugu-InterIndic -#:: NFD (NFC) ; -\u0c46\u0c4d\u0c56>\ue048\ue04d; -\u0C46\u0C56>\uE048;# VOWEL SIGN AI -\u0C01>\uE001; # SIGN CANDRABINDU -\u0C02>\uE002; # SIGN ANUSVARA -\u0C03>\uE003; # SIGN VISARGA -\u0C05>\uE005; # LETTER A -\u0C06>\uE006; # LETTER AA -\u0C07>\uE007; # LETTER I -\u0C08>\uE008; # LETTER II -\u0C09>\uE009; # LETTER U -\u0C0A>\uE00A; # LETTER UU -\u0C0B>\uE00B; # LETTER VOCALIC R -\u0C0C>\uE00C; # LETTER VOCALIC L -\u0C0E>\uE00E; # LETTER E -\u0C0F>\uE00F; # LETTER EE -\u0C10>\uE010; # LETTER AI -\u0C12>\uE012; # LETTER O -\u0C13>\uE013; # LETTER OO -\u0C14>\uE014; # LETTER AU -\u0C15>\uE015; # LETTER KA -\u0C16>\uE016; # LETTER KHA -\u0C17>\uE017; # LETTER GA -\u0C18>\uE018; # LETTER GHA -\u0C19>\uE019; # LETTER NGA -\u0C1A>\uE01A; # LETTER CA -\u0C1B>\uE01B; # LETTER CHA -\u0C1C>\uE01C; # LETTER JA -\u0C1D>\uE01D; # LETTER JHA -\u0C1E>\uE01E; # LETTER NYA -\u0C1F>\uE01F; # LETTER TTA -\u0C20>\uE020; # LETTER TTHA -\u0C21>\uE021; # LETTER DDA -\u0C22>\uE022; # LETTER DDHA -\u0C23>\uE023; # LETTER NNA -\u0C24>\uE024; # LETTER TA -\u0C25>\uE025; # LETTER THA -\u0C26>\uE026; # LETTER DA -\u0C27>\uE027; # LETTER DHA -\u0C28>\uE028; # LETTER NA -\u0C2A>\uE02A; # LETTER PA -\u0C2B>\uE02B; # LETTER PHA -\u0C2C>\uE02C; # LETTER BA -\u0C2D>\uE02D; # LETTER BHA -\u0C2E>\uE02E; # LETTER MA -\u0C2F>\uE02F; # LETTER YA -\u0C30>\uE030; # LETTER RA -\u0C31>\uE031; # LETTER RRA -\u0C32>\uE032; # LETTER LA -\u0C33>\uE033; # LETTER LLA -\u0C35>\uE035; # LETTER VA -\u0C36>\uE036; # LETTER SHA -\u0C37>\uE037; # LETTER SSA -\u0C38>\uE038; # LETTER SA -\u0C39>\uE039; # LETTER HA -\u0C3E>\uE03E; # VOWEL SIGN AA -\u0C3F>\uE03F; # VOWEL SIGN I -\u0C40>\uE040; # VOWEL SIGN II -\u0C41>\uE041; # VOWEL SIGN U -\u0C42>\uE042; # VOWEL SIGN UU -\u0C43>\uE043; # VOWEL SIGN VOCALIC R -\u0C44>\uE044; # VOWEL SIGN VOCALIC RR -\u0C46>\uE046; # VOWEL SIGN E -\u0C47>\uE047; # VOWEL SIGN EE -\u0C4A>\uE04A; # VOWEL SIGN O -\u0C4B>\uE04B; # VOWEL SIGN OO -\u0C4C>\uE04C; # VOWEL SIGN AU -\u0C4D>\uE04D; # SIGN VIRAMA -\u0C55>\uE055; # LENGTH MARK -\u0C56>\uE056; # AI LENGTH MARK -\u0C60>\uE060; # LETTER VOCALIC RR -\u0C61>\uE061; # LETTER VOCALIC LL -\u0C66>\uE066; # DIGIT ZERO -\u0C67>\uE067; # DIGIT ONE -\u0C68>\uE068; # DIGIT TWO -\u0C69>\uE069; # DIGIT THREE -\u0C6A>\uE06A; # DIGIT FOUR -\u0C6B>\uE06B; # DIGIT FIVE -\u0C6C>\uE06C; # DIGIT SIX -\u0C6D>\uE06D; # DIGIT SEVEN -\u0C6E>\uE06E; # DIGIT EIGHT -\u0C6F>\uE06F; # DIGIT NINE -# :: NFC (NFD) ; -# eof diff --git a/icu4j/src/com/ibm/text/resources/Transliterator_index.txt b/icu4j/src/com/ibm/text/resources/Transliterator_index.txt deleted file mode 100755 index 644145a771..0000000000 --- a/icu4j/src/com/ibm/text/resources/Transliterator_index.txt +++ /dev/null @@ -1,206 +0,0 @@ -# Copyright (c) 2001, International Business Machines Corporation and -# others. All Rights Reserved. -# -# TRANSLITERATOR INDEX FILE. This file lists the non-algorithmic -# system transliterators. It allows arbitrary mappings between -# transliterator IDs and file names, and also allows the system to -# define aliases for transliterators, so that "Latin-Hangul", for -# example, can be implemented transparently as the compound -# "Latin-Jamo;Jamo-Hangul". Internal IDs may also be defined; these -# are invisible to the user, but can be composed together by the -# system to create visible transliterators. -# -# Blank lines and lines beginning with '#' are ignored. -# -# Lines in this file have one of the following forms (text not -# enclosed by <> is literal): -# -# :file::: -# :internal::: -# :alias: -# -# is the ID of the system transliterator being defined. These -# are public IDs enumerated by Transliterator.getAvailableIDs(), -# unless the second field is "internal". -# -# is a ResourceReader resource name. Currently these refer -# to file names under com/ibm/text/resources. This string is passed -# directly to ResourceReader, together with . -# -# is the character encoding to use when reading ; -# passed directly to ResourceReader. E.g., "UTF8". -# -# is either "FORWARD" or "REVERSE". -# -# is a string to be passed directly to -# Transliterator.getInstance(). The returned Transliterator object -# then has its ID changed to and is returned. - - -# Bidirectional rule files - -Fullwidth-Halfwidth:file:Transliterator_Fullwidth_Halfwidth.txt:UTF8:FORWARD -Halfwidth-Fullwidth:file:Transliterator_Fullwidth_Halfwidth.txt:UTF8:REVERSE - -Latin-Cyrillic:file:Transliterator_Cyrillic_Latin.txt:UTF8:REVERSE -Cyrillic-Latin:file:Transliterator_Cyrillic_Latin.txt:UTF8:FORWARD - -Latin-Greek:file:Transliterator_Greek_Latin.txt:UTF8:REVERSE -Greek-Latin:file:Transliterator_Greek_Latin.txt:UTF8:FORWARD - -Latin-Greek/UNGEGN:alias:Latin-el -Greek-Latin/UNGEGN:alias:el-Latin - -Latin-Katakana:file:Transliterator_Latin_Katakana.txt:UTF8:FORWARD -Katakana-Latin:file:Transliterator_Latin_Katakana.txt:UTF8:REVERSE - -Latin-Hiragana:file:Transliterator_Hiragana_Latin.txt:UTF8:REVERSE -Hiragana-Latin:file:Transliterator_Hiragana_Latin.txt:UTF8:FORWARD - -Hiragana-Katakana:file:Transliterator_Hiragana_Katakana.txt:UTF8:FORWARD -Katakana-Hiragana:file:Transliterator_Hiragana_Katakana.txt:UTF8:REVERSE - -Any-Accents:file:Transliterator_Any_Accents.txt:UTF8:FORWARD -Accents-Any:file:Transliterator_Any_Accents.txt:UTF8:REVERSE - -Any-Publishing:file:Transliterator_Any_Publishing.txt:UTF8:FORWARD -Publishing-Any:file:Transliterator_Any_Publishing.txt:UTF8:REVERSE - -# Korean -# N.B. Don't end Latin-Jamo with NFC; that produces Hangul. For -# Hangul output use Latin-Hangul. - -LowerLatin-Jamo:internal:Transliterator_Latin_Jamo.txt:UTF8:FORWARD -Jamo-LowerLatin:internal:Transliterator_Latin_Jamo.txt:UTF8:REVERSE -Latin-Jamo:alias:['A-Za-z\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E1\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u01FB\u0200-\u021B\u021E-\u021F\u0226-\u0233\u1E00-\u1E99\u1EA0-\u1EF9\u212A-\u212B];NFD;Lower;LowerLatin-Jamo -Jamo-Latin:alias:['\u1100-\u1112\u1161-\u1175\u11A8-\u11C2\uAC00-\uD7A3];NFD;Jamo-LowerLatin;NFC -Latin-Hangul:alias:['A-Za-z\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E1\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u01FB\u0200-\u021B\u021E-\u021F\u0226-\u0233\u1E00-\u1E99\u1EA0-\u1EF9\u212A-\u212B];NFD;Lower;LowerLatin-Jamo;NFC -Hangul-Latin:alias:['\u1100-\u1112\u1161-\u1175\u11A8-\u11C2\u3131-\u313F\u3141-\u3143\u3145-\u3163\u3200-\u321C\u3260-\u327B\uAC00-\uD7A3\uFF07\uFFA1-\uFFAF\uFFB1-\uFFB3\uFFB5-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC];NFKD;Jamo-LowerLatin;NFC - -# Inter-Indic composed rules -Latin-InterIndic:internal:Transliterator_Latin_InterIndic.txt:UTF8:FORWARD -Devanagari-InterIndic:internal:Transliterator_Devanagari_InterIndic.txt:UTF8:FORWARD -Bengali-InterIndic:internal:Transliterator_Bengali_InterIndic.txt:UTF8:FORWARD -Gurmukhi-InterIndic:internal:Transliterator_Gurmukhi_InterIndic.txt:UTF8:FORWARD -Gujarati-InterIndic:internal:Transliterator_Gujarati_InterIndic.txt:UTF8:FORWARD -Oriya-InterIndic:internal:Transliterator_Oriya_InterIndic.txt:UTF8:FORWARD -Tamil-InterIndic:internal:Transliterator_Tamil_InterIndic.txt:UTF8:FORWARD -Telugu-InterIndic:internal:Transliterator_Telugu_InterIndic.txt:UTF8:FORWARD -Kannada-InterIndic:internal:Transliterator_Kannada_InterIndic.txt:UTF8:FORWARD -Malayalam-InterIndic:internal:Transliterator_Malayalam_InterIndic.txt:UTF8:FORWARD - -InterIndic-Latin:internal:Transliterator_InterIndic_Latin.txt:UTF8:FORWARD -InterIndic-Devanagari:internal:Transliterator_InterIndic_Devanagari.txt:UTF8:FORWARD -InterIndic-Bengali:internal:Transliterator_InterIndic_Bengali.txt:UTF8:FORWARD -InterIndic-Gurmukhi:internal:Transliterator_InterIndic_Gurmukhi.txt:UTF8:FORWARD -InterIndic-Gujarati:internal:Transliterator_InterIndic_Gujarati.txt:UTF8:FORWARD -InterIndic-Oriya:internal:Transliterator_InterIndic_Oriya.txt:UTF8:FORWARD -InterIndic-Tamil:internal:Transliterator_InterIndic_Tamil.txt:UTF8:FORWARD -InterIndic-Telugu:internal:Transliterator_InterIndic_Telugu.txt:UTF8:FORWARD -InterIndic-Kannada:internal:Transliterator_InterIndic_Kannada.txt:UTF8:FORWARD -InterIndic-Malayalam:internal:Transliterator_InterIndic_Malayalam.txt:UTF8:FORWARD - -#Latin-Indic transliterators -Latin-Devanagari:alias:['.0-9A-Za-z~\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0301\u0303-\u0304\u0306-\u0307\u0310\u0314-\u0315\u0323\u0325\u0331\u0341\u0344\u0385-\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AC-\u03B0\u03CC-\u03CE\u03D3\u0403\u040C\u040E\u0419\u0439\u0453\u045C\u045E\u04C1-\u04C2\u04D0-\u04D1\u04D6-\u04D7\u04E2-\u04E3\u04EE-\u04EF\u1E00-\u1E99\u1EA0-\u1EF9\u1F01\u1F03-\u1F05\u1F07\u1F09\u1F0B-\u1F0D\u1F0F\u1F11\u1F13-\u1F15\u1F19\u1F1B-\u1F1D\u1F21\u1F23-\u1F25\u1F27\u1F29\u1F2B-\u1F2D\u1F2F\u1F31\u1F33-\u1F35\u1F37\u1F39\u1F3B-\u1F3D\u1F3F\u1F41\u1F43-\u1F45\u1F49\u1F4B-\u1F4D\u1F51\u1F53-\u1F55\u1F57\u1F59\u1F5B\u1F5D\u1F5F\u1F61\u1F63-\u1F65\u1F67\u1F69\u1F6B-\u1F6D\u1F6F\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1F81\u1F83-\u1F85\u1F87\u1F89\u1F8B-\u1F8D\u1F8F\u1F91\u1F93-\u1F95\u1F97\u1F99\u1F9B-\u1F9D\u1F9F\u1FA1\u1FA3-\u1FA5\u1FA7\u1FA9\u1FAB-\u1FAD\u1FAF-\u1FB1\u1FB4\u1FB8-\u1FB9\u1FBB\u1FC4\u1FC9\u1FCB\u1FCE\u1FD0-\u1FD1\u1FD3\u1FD8-\u1FD9\u1FDB\u1FDE\u1FE0-\u1FE1\u1FE3\u1FE5\u1FE8-\u1FE9\u1FEB-\u1FEC\u1FEE\u1FF4\u1FF9\u1FFB\u212A-\u212B\uE04D\uE064];NFD;Lower;Latin-InterIndic;InterIndic-Devanagari;NFC -Latin-Bengali:alias:['.0-9A-Za-z~\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0301\u0303-\u0304\u0306-\u0307\u0310\u0314-\u0315\u0323\u0325\u0331\u0341\u0344\u0385-\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AC-\u03B0\u03CC-\u03CE\u03D3\u0403\u040C\u040E\u0419\u0439\u0453\u045C\u045E\u04C1-\u04C2\u04D0-\u04D1\u04D6-\u04D7\u04E2-\u04E3\u04EE-\u04EF\u1E00-\u1E99\u1EA0-\u1EF9\u1F01\u1F03-\u1F05\u1F07\u1F09\u1F0B-\u1F0D\u1F0F\u1F11\u1F13-\u1F15\u1F19\u1F1B-\u1F1D\u1F21\u1F23-\u1F25\u1F27\u1F29\u1F2B-\u1F2D\u1F2F\u1F31\u1F33-\u1F35\u1F37\u1F39\u1F3B-\u1F3D\u1F3F\u1F41\u1F43-\u1F45\u1F49\u1F4B-\u1F4D\u1F51\u1F53-\u1F55\u1F57\u1F59\u1F5B\u1F5D\u1F5F\u1F61\u1F63-\u1F65\u1F67\u1F69\u1F6B-\u1F6D\u1F6F\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1F81\u1F83-\u1F85\u1F87\u1F89\u1F8B-\u1F8D\u1F8F\u1F91\u1F93-\u1F95\u1F97\u1F99\u1F9B-\u1F9D\u1F9F\u1FA1\u1FA3-\u1FA5\u1FA7\u1FA9\u1FAB-\u1FAD\u1FAF-\u1FB1\u1FB4\u1FB8-\u1FB9\u1FBB\u1FC4\u1FC9\u1FCB\u1FCE\u1FD0-\u1FD1\u1FD3\u1FD8-\u1FD9\u1FDB\u1FDE\u1FE0-\u1FE1\u1FE3\u1FE5\u1FE8-\u1FE9\u1FEB-\u1FEC\u1FEE\u1FF4\u1FF9\u1FFB\u212A-\u212B\uE04D\uE064];NFD;Lower;Latin-InterIndic;InterIndic-Bengali;NFC -Latin-Gurmukhi:alias:['.0-9A-Za-z~\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0301\u0303-\u0304\u0306-\u0307\u0310\u0314-\u0315\u0323\u0325\u0331\u0341\u0344\u0385-\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AC-\u03B0\u03CC-\u03CE\u03D3\u0403\u040C\u040E\u0419\u0439\u0453\u045C\u045E\u04C1-\u04C2\u04D0-\u04D1\u04D6-\u04D7\u04E2-\u04E3\u04EE-\u04EF\u1E00-\u1E99\u1EA0-\u1EF9\u1F01\u1F03-\u1F05\u1F07\u1F09\u1F0B-\u1F0D\u1F0F\u1F11\u1F13-\u1F15\u1F19\u1F1B-\u1F1D\u1F21\u1F23-\u1F25\u1F27\u1F29\u1F2B-\u1F2D\u1F2F\u1F31\u1F33-\u1F35\u1F37\u1F39\u1F3B-\u1F3D\u1F3F\u1F41\u1F43-\u1F45\u1F49\u1F4B-\u1F4D\u1F51\u1F53-\u1F55\u1F57\u1F59\u1F5B\u1F5D\u1F5F\u1F61\u1F63-\u1F65\u1F67\u1F69\u1F6B-\u1F6D\u1F6F\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1F81\u1F83-\u1F85\u1F87\u1F89\u1F8B-\u1F8D\u1F8F\u1F91\u1F93-\u1F95\u1F97\u1F99\u1F9B-\u1F9D\u1F9F\u1FA1\u1FA3-\u1FA5\u1FA7\u1FA9\u1FAB-\u1FAD\u1FAF-\u1FB1\u1FB4\u1FB8-\u1FB9\u1FBB\u1FC4\u1FC9\u1FCB\u1FCE\u1FD0-\u1FD1\u1FD3\u1FD8-\u1FD9\u1FDB\u1FDE\u1FE0-\u1FE1\u1FE3\u1FE5\u1FE8-\u1FE9\u1FEB-\u1FEC\u1FEE\u1FF4\u1FF9\u1FFB\u212A-\u212B\uE04D\uE064];NFD;Lower;Latin-InterIndic;InterIndic-Gurmukhi;NFC -Latin-Gujarati:alias:['.0-9A-Za-z~\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0301\u0303-\u0304\u0306-\u0307\u0310\u0314-\u0315\u0323\u0325\u0331\u0341\u0344\u0385-\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AC-\u03B0\u03CC-\u03CE\u03D3\u0403\u040C\u040E\u0419\u0439\u0453\u045C\u045E\u04C1-\u04C2\u04D0-\u04D1\u04D6-\u04D7\u04E2-\u04E3\u04EE-\u04EF\u1E00-\u1E99\u1EA0-\u1EF9\u1F01\u1F03-\u1F05\u1F07\u1F09\u1F0B-\u1F0D\u1F0F\u1F11\u1F13-\u1F15\u1F19\u1F1B-\u1F1D\u1F21\u1F23-\u1F25\u1F27\u1F29\u1F2B-\u1F2D\u1F2F\u1F31\u1F33-\u1F35\u1F37\u1F39\u1F3B-\u1F3D\u1F3F\u1F41\u1F43-\u1F45\u1F49\u1F4B-\u1F4D\u1F51\u1F53-\u1F55\u1F57\u1F59\u1F5B\u1F5D\u1F5F\u1F61\u1F63-\u1F65\u1F67\u1F69\u1F6B-\u1F6D\u1F6F\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1F81\u1F83-\u1F85\u1F87\u1F89\u1F8B-\u1F8D\u1F8F\u1F91\u1F93-\u1F95\u1F97\u1F99\u1F9B-\u1F9D\u1F9F\u1FA1\u1FA3-\u1FA5\u1FA7\u1FA9\u1FAB-\u1FAD\u1FAF-\u1FB1\u1FB4\u1FB8-\u1FB9\u1FBB\u1FC4\u1FC9\u1FCB\u1FCE\u1FD0-\u1FD1\u1FD3\u1FD8-\u1FD9\u1FDB\u1FDE\u1FE0-\u1FE1\u1FE3\u1FE5\u1FE8-\u1FE9\u1FEB-\u1FEC\u1FEE\u1FF4\u1FF9\u1FFB\u212A-\u212B\uE04D\uE064];NFD;Lower;Latin-InterIndic;InterIndic-Gujarati;NFC -Latin-Oriya:alias:['.0-9A-Za-z~\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0301\u0303-\u0304\u0306-\u0307\u0310\u0314-\u0315\u0323\u0325\u0331\u0341\u0344\u0385-\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AC-\u03B0\u03CC-\u03CE\u03D3\u0403\u040C\u040E\u0419\u0439\u0453\u045C\u045E\u04C1-\u04C2\u04D0-\u04D1\u04D6-\u04D7\u04E2-\u04E3\u04EE-\u04EF\u1E00-\u1E99\u1EA0-\u1EF9\u1F01\u1F03-\u1F05\u1F07\u1F09\u1F0B-\u1F0D\u1F0F\u1F11\u1F13-\u1F15\u1F19\u1F1B-\u1F1D\u1F21\u1F23-\u1F25\u1F27\u1F29\u1F2B-\u1F2D\u1F2F\u1F31\u1F33-\u1F35\u1F37\u1F39\u1F3B-\u1F3D\u1F3F\u1F41\u1F43-\u1F45\u1F49\u1F4B-\u1F4D\u1F51\u1F53-\u1F55\u1F57\u1F59\u1F5B\u1F5D\u1F5F\u1F61\u1F63-\u1F65\u1F67\u1F69\u1F6B-\u1F6D\u1F6F\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1F81\u1F83-\u1F85\u1F87\u1F89\u1F8B-\u1F8D\u1F8F\u1F91\u1F93-\u1F95\u1F97\u1F99\u1F9B-\u1F9D\u1F9F\u1FA1\u1FA3-\u1FA5\u1FA7\u1FA9\u1FAB-\u1FAD\u1FAF-\u1FB1\u1FB4\u1FB8-\u1FB9\u1FBB\u1FC4\u1FC9\u1FCB\u1FCE\u1FD0-\u1FD1\u1FD3\u1FD8-\u1FD9\u1FDB\u1FDE\u1FE0-\u1FE1\u1FE3\u1FE5\u1FE8-\u1FE9\u1FEB-\u1FEC\u1FEE\u1FF4\u1FF9\u1FFB\u212A-\u212B\uE04D\uE064];NFD;Lower;Latin-InterIndic;InterIndic-Oriya;NFC -Latin-Tamil:alias:['.0-9A-Za-z~\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0301\u0303-\u0304\u0306-\u0307\u0310\u0314-\u0315\u0323\u0325\u0331\u0341\u0344\u0385-\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AC-\u03B0\u03CC-\u03CE\u03D3\u0403\u040C\u040E\u0419\u0439\u0453\u045C\u045E\u04C1-\u04C2\u04D0-\u04D1\u04D6-\u04D7\u04E2-\u04E3\u04EE-\u04EF\u1E00-\u1E99\u1EA0-\u1EF9\u1F01\u1F03-\u1F05\u1F07\u1F09\u1F0B-\u1F0D\u1F0F\u1F11\u1F13-\u1F15\u1F19\u1F1B-\u1F1D\u1F21\u1F23-\u1F25\u1F27\u1F29\u1F2B-\u1F2D\u1F2F\u1F31\u1F33-\u1F35\u1F37\u1F39\u1F3B-\u1F3D\u1F3F\u1F41\u1F43-\u1F45\u1F49\u1F4B-\u1F4D\u1F51\u1F53-\u1F55\u1F57\u1F59\u1F5B\u1F5D\u1F5F\u1F61\u1F63-\u1F65\u1F67\u1F69\u1F6B-\u1F6D\u1F6F\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1F81\u1F83-\u1F85\u1F87\u1F89\u1F8B-\u1F8D\u1F8F\u1F91\u1F93-\u1F95\u1F97\u1F99\u1F9B-\u1F9D\u1F9F\u1FA1\u1FA3-\u1FA5\u1FA7\u1FA9\u1FAB-\u1FAD\u1FAF-\u1FB1\u1FB4\u1FB8-\u1FB9\u1FBB\u1FC4\u1FC9\u1FCB\u1FCE\u1FD0-\u1FD1\u1FD3\u1FD8-\u1FD9\u1FDB\u1FDE\u1FE0-\u1FE1\u1FE3\u1FE5\u1FE8-\u1FE9\u1FEB-\u1FEC\u1FEE\u1FF4\u1FF9\u1FFB\u212A-\u212B\uE04D\uE064];NFD;Lower;Latin-InterIndic;InterIndic-Tamil;NFC -Latin-Telugu:alias:['.0-9A-Za-z~\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0301\u0303-\u0304\u0306-\u0307\u0310\u0314-\u0315\u0323\u0325\u0331\u0341\u0344\u0385-\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AC-\u03B0\u03CC-\u03CE\u03D3\u0403\u040C\u040E\u0419\u0439\u0453\u045C\u045E\u04C1-\u04C2\u04D0-\u04D1\u04D6-\u04D7\u04E2-\u04E3\u04EE-\u04EF\u1E00-\u1E99\u1EA0-\u1EF9\u1F01\u1F03-\u1F05\u1F07\u1F09\u1F0B-\u1F0D\u1F0F\u1F11\u1F13-\u1F15\u1F19\u1F1B-\u1F1D\u1F21\u1F23-\u1F25\u1F27\u1F29\u1F2B-\u1F2D\u1F2F\u1F31\u1F33-\u1F35\u1F37\u1F39\u1F3B-\u1F3D\u1F3F\u1F41\u1F43-\u1F45\u1F49\u1F4B-\u1F4D\u1F51\u1F53-\u1F55\u1F57\u1F59\u1F5B\u1F5D\u1F5F\u1F61\u1F63-\u1F65\u1F67\u1F69\u1F6B-\u1F6D\u1F6F\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1F81\u1F83-\u1F85\u1F87\u1F89\u1F8B-\u1F8D\u1F8F\u1F91\u1F93-\u1F95\u1F97\u1F99\u1F9B-\u1F9D\u1F9F\u1FA1\u1FA3-\u1FA5\u1FA7\u1FA9\u1FAB-\u1FAD\u1FAF-\u1FB1\u1FB4\u1FB8-\u1FB9\u1FBB\u1FC4\u1FC9\u1FCB\u1FCE\u1FD0-\u1FD1\u1FD3\u1FD8-\u1FD9\u1FDB\u1FDE\u1FE0-\u1FE1\u1FE3\u1FE5\u1FE8-\u1FE9\u1FEB-\u1FEC\u1FEE\u1FF4\u1FF9\u1FFB\u212A-\u212B\uE04D\uE064];NFD;Lower;Latin-InterIndic;InterIndic-Telugu;NFC -Latin-Kannada:alias:['.0-9A-Za-z~\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0301\u0303-\u0304\u0306-\u0307\u0310\u0314-\u0315\u0323\u0325\u0331\u0341\u0344\u0385-\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AC-\u03B0\u03CC-\u03CE\u03D3\u0403\u040C\u040E\u0419\u0439\u0453\u045C\u045E\u04C1-\u04C2\u04D0-\u04D1\u04D6-\u04D7\u04E2-\u04E3\u04EE-\u04EF\u1E00-\u1E99\u1EA0-\u1EF9\u1F01\u1F03-\u1F05\u1F07\u1F09\u1F0B-\u1F0D\u1F0F\u1F11\u1F13-\u1F15\u1F19\u1F1B-\u1F1D\u1F21\u1F23-\u1F25\u1F27\u1F29\u1F2B-\u1F2D\u1F2F\u1F31\u1F33-\u1F35\u1F37\u1F39\u1F3B-\u1F3D\u1F3F\u1F41\u1F43-\u1F45\u1F49\u1F4B-\u1F4D\u1F51\u1F53-\u1F55\u1F57\u1F59\u1F5B\u1F5D\u1F5F\u1F61\u1F63-\u1F65\u1F67\u1F69\u1F6B-\u1F6D\u1F6F\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1F81\u1F83-\u1F85\u1F87\u1F89\u1F8B-\u1F8D\u1F8F\u1F91\u1F93-\u1F95\u1F97\u1F99\u1F9B-\u1F9D\u1F9F\u1FA1\u1FA3-\u1FA5\u1FA7\u1FA9\u1FAB-\u1FAD\u1FAF-\u1FB1\u1FB4\u1FB8-\u1FB9\u1FBB\u1FC4\u1FC9\u1FCB\u1FCE\u1FD0-\u1FD1\u1FD3\u1FD8-\u1FD9\u1FDB\u1FDE\u1FE0-\u1FE1\u1FE3\u1FE5\u1FE8-\u1FE9\u1FEB-\u1FEC\u1FEE\u1FF4\u1FF9\u1FFB\u212A-\u212B\uE04D\uE064];NFD;Lower;Latin-InterIndic;InterIndic-Kannada;NFC -Latin-Malayalam:alias:['.0-9A-Za-z~\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01ED\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0301\u0303-\u0304\u0306-\u0307\u0310\u0314-\u0315\u0323\u0325\u0331\u0341\u0344\u0385-\u0386\u0388-\u038A\u038C\u038E-\u0390\u03AC-\u03B0\u03CC-\u03CE\u03D3\u0403\u040C\u040E\u0419\u0439\u0453\u045C\u045E\u04C1-\u04C2\u04D0-\u04D1\u04D6-\u04D7\u04E2-\u04E3\u04EE-\u04EF\u1E00-\u1E99\u1EA0-\u1EF9\u1F01\u1F03-\u1F05\u1F07\u1F09\u1F0B-\u1F0D\u1F0F\u1F11\u1F13-\u1F15\u1F19\u1F1B-\u1F1D\u1F21\u1F23-\u1F25\u1F27\u1F29\u1F2B-\u1F2D\u1F2F\u1F31\u1F33-\u1F35\u1F37\u1F39\u1F3B-\u1F3D\u1F3F\u1F41\u1F43-\u1F45\u1F49\u1F4B-\u1F4D\u1F51\u1F53-\u1F55\u1F57\u1F59\u1F5B\u1F5D\u1F5F\u1F61\u1F63-\u1F65\u1F67\u1F69\u1F6B-\u1F6D\u1F6F\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1F81\u1F83-\u1F85\u1F87\u1F89\u1F8B-\u1F8D\u1F8F\u1F91\u1F93-\u1F95\u1F97\u1F99\u1F9B-\u1F9D\u1F9F\u1FA1\u1FA3-\u1FA5\u1FA7\u1FA9\u1FAB-\u1FAD\u1FAF-\u1FB1\u1FB4\u1FB8-\u1FB9\u1FBB\u1FC4\u1FC9\u1FCB\u1FCE\u1FD0-\u1FD1\u1FD3\u1FD8-\u1FD9\u1FDB\u1FDE\u1FE0-\u1FE1\u1FE3\u1FE5\u1FE8-\u1FE9\u1FEB-\u1FEC\u1FEE\u1FF4\u1FF9\u1FFB\u212A-\u212B\uE04D\uE064];NFD;Lower;Latin-InterIndic;InterIndic-Malayalam;NFC - -#Indic-Latin transliterators -Devanagari-Latin:alias:[\u0901-\u0903\u0905-\u0939\u093C-\u094D\u0950-\u0954\u0958-\u096F];NFD;Devanagari-InterIndic;InterIndic-Latin;NFC -Bengali-Latin:alias:[\u0964-\u0965\u0981-\u0983\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC\u09BE-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09DC-\u09DD\u09DF-\u09E3\u09E6-\u09FA];NFD;Bengali-InterIndic;InterIndic-Latin;NFC -Gurmukhi-Latin:alias:[\u0964-\u0965\u0A02\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A59-\u0A5C\u0A5E\u0A66-\u0A74];NFD;Gurmukhi-InterIndic;InterIndic-Latin;NFC -Gujarati-Latin:alias:[\u0964-\u0965\u0A81-\u0A83\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0\u0AE6-\u0AEF];NFD;Gujarati-InterIndic;InterIndic-Latin;NFC -Oriya-Latin:alias:[\u0B01-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3C-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B5C-\u0B5D\u0B5F-\u0B61\u0B66-\u0B70];NFD;Oriya-InterIndic;InterIndic-Latin;NFC -Tamil-Latin:alias:[0\u0B82-\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE7-\u0BF2];NFD;Tamil-InterIndic;InterIndic-Latin;NFC -Telugu-Latin:alias:[\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C60-\u0C61\u0C66-\u0C6F];NFD;Telugu-InterIndic;InterIndic-Latin;NFC -Kannada-Latin:alias:[\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE1\u0CE6-\u0CEF];NFD;Kannada-InterIndic;InterIndic-Latin;NFC -Malayalam-Latin:alias:[\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D60-\u0D61\u0D66-\u0D6F];NFD;Malayalam-InterIndic;InterIndic-Latin;NFC - -Devanagari-Bengali:alias:[\u0901-\u0903\u0905-\u0939\u093C-\u094D\u0950-\u0954\u0958-\u096F];NFD;Devanagari-InterIndic;InterIndic-Bengali;NFC -Devanagari-Gurmukhi:alias:[\u0901-\u0903\u0905-\u0939\u093C-\u094D\u0950-\u0954\u0958-\u096F];NFD;Devanagari-InterIndic;InterIndic-Gurmukhi;NFC -Devanagari-Gujarati:alias:[\u0901-\u0903\u0905-\u0939\u093C-\u094D\u0950-\u0954\u0958-\u096F];NFD;Devanagari-InterIndic;InterIndic-Gujarati;NFC -Devanagari-Oriya:alias:[\u0901-\u0903\u0905-\u0939\u093C-\u094D\u0950-\u0954\u0958-\u096F];NFD;Devanagari-InterIndic;InterIndic-Oriya;NFC -Devanagari-Tamil:alias:[\u0901-\u0903\u0905-\u0939\u093C-\u094D\u0950-\u0954\u0958-\u096F];NFD;Devanagari-InterIndic;InterIndic-Tamil;NFC -Devanagari-Telugu:alias:[\u0901-\u0903\u0905-\u0939\u093C-\u094D\u0950-\u0954\u0958-\u096F];NFD;Devanagari-InterIndic;InterIndic-Telugu;NFC -Devanagari-Kannada:alias:[\u0901-\u0903\u0905-\u0939\u093C-\u094D\u0950-\u0954\u0958-\u096F];NFD;Devanagari-InterIndic;InterIndic-Kannada;NFC -Devanagari-Malayalam:alias:[\u0901-\u0903\u0905-\u0939\u093C-\u094D\u0950-\u0954\u0958-\u096F];NFD;Devanagari-InterIndic;InterIndic-Malayalam;NFC - -Bengali-Devanagari:alias:[\u0964-\u0965\u0981-\u0983\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC\u09BE-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09DC-\u09DD\u09DF-\u09E3\u09E6-\u09FA];NFD;Bengali-InterIndic;InterIndic-Devanagari;NFC -Bengali-Gurmukhi:alias:[\u0964-\u0965\u0981-\u0983\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC\u09BE-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09DC-\u09DD\u09DF-\u09E3\u09E6-\u09FA];NFD;Bengali-InterIndic;InterIndic-Gurmukhi;NFC -Bengali-Gujarati:alias:[\u0964-\u0965\u0981-\u0983\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC\u09BE-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09DC-\u09DD\u09DF-\u09E3\u09E6-\u09FA];NFD;Bengali-InterIndic;InterIndic-Gujarati;NFC -Bengali-Oriya:alias:[\u0964-\u0965\u0981-\u0983\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC\u09BE-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09DC-\u09DD\u09DF-\u09E3\u09E6-\u09FA];NFD;Bengali-InterIndic;InterIndic-Oriya;NFC -Bengali-Tamil:alias:[\u0964-\u0965\u0981-\u0983\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC\u09BE-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09DC-\u09DD\u09DF-\u09E3\u09E6-\u09FA];NFD;Bengali-InterIndic;InterIndic-Tamil;NFC -Bengali-Telugu:alias:[\u0964-\u0965\u0981-\u0983\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC\u09BE-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09DC-\u09DD\u09DF-\u09E3\u09E6-\u09FA];NFD;Bengali-InterIndic;InterIndic-Telugu;NFC -Bengali-Kannada:alias:[\u0964-\u0965\u0981-\u0983\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC\u09BE-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09DC-\u09DD\u09DF-\u09E3\u09E6-\u09FA];NFD;Bengali-InterIndic;InterIndic-Kannada;NFC -Bengali-Malayalam:alias:[\u0964-\u0965\u0981-\u0983\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC\u09BE-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09DC-\u09DD\u09DF-\u09E3\u09E6-\u09FA];NFD;Bengali-InterIndic;InterIndic-Malayalam;NFC - -Gurmukhi-Devanagari:alias:[\u0964-\u0965\u0A02\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A59-\u0A5C\u0A5E\u0A66-\u0A74];NFD;Gurmukhi-InterIndic;InterIndic-Devanagari;NFC -Gurmukhi-Bengali:alias:[\u0964-\u0965\u0A02\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A59-\u0A5C\u0A5E\u0A66-\u0A74];NFD;Gurmukhi-InterIndic;InterIndic-Bengali;NFC -Gurmukhi-Gujarati:alias:[\u0964-\u0965\u0A02\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A59-\u0A5C\u0A5E\u0A66-\u0A74];NFD;Gurmukhi-InterIndic;InterIndic-Gujarati;NFC -Gurmukhi-Oriya:alias:[\u0964-\u0965\u0A02\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A59-\u0A5C\u0A5E\u0A66-\u0A74];NFD;Gurmukhi-InterIndic;InterIndic-Oriya;NFC -Gurmukhi-Tamil:alias:[\u0964-\u0965\u0A02\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A59-\u0A5C\u0A5E\u0A66-\u0A74];NFD;Gurmukhi-InterIndic;InterIndic-Tamil;NFC -Gurmukhi-Telugu:alias:[\u0964-\u0965\u0A02\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A59-\u0A5C\u0A5E\u0A66-\u0A74];NFD;Gurmukhi-InterIndic;InterIndic-Telugu;NFC -Gurmukhi-Kannada:alias:[\u0964-\u0965\u0A02\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A59-\u0A5C\u0A5E\u0A66-\u0A74];NFD;Gurmukhi-InterIndic;InterIndic-Kannada;NFC -Gurmukhi-Malayalam:alias:[\u0964-\u0965\u0A02\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A59-\u0A5C\u0A5E\u0A66-\u0A74];NFD;Gurmukhi-InterIndic;InterIndic-Malayalam;NFC - -Gujarati-Devanagari:alias:[\u0964-\u0965\u0A81-\u0A83\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0\u0AE6-\u0AEF];NFD;Gujarati-InterIndic;InterIndic-Devanagari;NFC -Gujarati-Bengali:alias:[\u0964-\u0965\u0A81-\u0A83\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0\u0AE6-\u0AEF];NFD;Gujarati-InterIndic;InterIndic-Bengali;NFC -Gujarati-Gurmukhi:alias:[\u0964-\u0965\u0A81-\u0A83\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0\u0AE6-\u0AEF];NFD;Gujarati-InterIndic;InterIndic-Gurmukhi;NFC -Gujarati-Oriya:alias:[\u0964-\u0965\u0A81-\u0A83\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0\u0AE6-\u0AEF];NFD;Gujarati-InterIndic;InterIndic-Oriya;NFC -Gujarati-Tamil:alias:[\u0964-\u0965\u0A81-\u0A83\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0\u0AE6-\u0AEF];NFD;Gujarati-InterIndic;InterIndic-Tamil;NFC -Gujarati-Telugu:alias:[\u0964-\u0965\u0A81-\u0A83\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0\u0AE6-\u0AEF];NFD;Gujarati-InterIndic;InterIndic-Telugu;NFC -Gujarati-Kannada:alias:[\u0964-\u0965\u0A81-\u0A83\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0\u0AE6-\u0AEF];NFD;Gujarati-InterIndic;InterIndic-Kannada;NFC -Gujarati-Malayalam:alias:[\u0964-\u0965\u0A81-\u0A83\u0A85-\u0A8B\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0\u0AE6-\u0AEF];NFD;Gujarati-InterIndic;InterIndic-Malayalam;NFC - -Oriya-Devanagari:alias:[\u0B01-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3C-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B5C-\u0B5D\u0B5F-\u0B61\u0B66-\u0B70];NFD;Oriya-InterIndic;InterIndic-Devanagari;NFC -Oriya-Bengali:alias:[\u0B01-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3C-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B5C-\u0B5D\u0B5F-\u0B61\u0B66-\u0B70];NFD;Oriya-InterIndic;InterIndic-Bengali;NFC -Oriya-Gurmukhi:alias:[\u0B01-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3C-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B5C-\u0B5D\u0B5F-\u0B61\u0B66-\u0B70];NFD;Oriya-InterIndic;InterIndic-Gurmukhi;NFC -Oriya-Gujarati:alias:[\u0B01-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3C-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B5C-\u0B5D\u0B5F-\u0B61\u0B66-\u0B70];NFD;Oriya-InterIndic;InterIndic-Gujarati;NFC -Oriya-Tamil:alias:[\u0B01-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3C-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B5C-\u0B5D\u0B5F-\u0B61\u0B66-\u0B70];NFD;Oriya-InterIndic;InterIndic-Tamil;NFC -Oriya-Telugu:alias:[\u0B01-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3C-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B5C-\u0B5D\u0B5F-\u0B61\u0B66-\u0B70];NFD;Oriya-InterIndic;InterIndic-Telugu;NFC -Oriya-Kannada:alias:[\u0B01-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3C-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B5C-\u0B5D\u0B5F-\u0B61\u0B66-\u0B70];NFD;Oriya-InterIndic;InterIndic-Kannada;NFC -Oriya-Malayalam:alias:[\u0B01-\u0B03\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B36-\u0B39\u0B3C-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B5C-\u0B5D\u0B5F-\u0B61\u0B66-\u0B70];NFD;Oriya-InterIndic;InterIndic-Malayalam;NFC - -Tamil-Devanagari:alias:[0\u0B82-\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE7-\u0BF2];NFD;Tamil-InterIndic;InterIndic-Devanagari;NFC -Tamil-Bengali:alias:[0\u0B82-\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE7-\u0BF2];NFD;Tamil-InterIndic;InterIndic-Bengali;NFC -Tamil-Gurmukhi:alias:[0\u0B82-\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE7-\u0BF2];NFD;Tamil-InterIndic;InterIndic-Gurmukhi;NFC -Tamil-Gujarati:alias:[0\u0B82-\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE7-\u0BF2];NFD;Tamil-InterIndic;InterIndic-Gujarati;NFC -Tamil-Oriya:alias:[0\u0B82-\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE7-\u0BF2];NFD;Tamil-InterIndic;InterIndic-Oriya;NFC -Tamil-Telugu:alias:[0\u0B82-\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE7-\u0BF2];NFD;Tamil-InterIndic;InterIndic-Telugu;NFC -Tamil-Kannada:alias:[0\u0B82-\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE7-\u0BF2];NFD;Tamil-InterIndic;InterIndic-Kannada;NFC -Tamil-Malayalam:alias:[0\u0B82-\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB5\u0BB7-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE7-\u0BF2];NFD;Tamil-InterIndic;InterIndic-Malayalam;NFC - -Telugu-Devanagari:alias:[\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C60-\u0C61\u0C66-\u0C6F];NFD;Telugu-InterIndic;InterIndic-Devanagari;NFC -Telugu-Bengali:alias:[\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C60-\u0C61\u0C66-\u0C6F];NFD;Telugu-InterIndic;InterIndic-Bengali;NFC -Telugu-Gurmukhi:alias:[\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C60-\u0C61\u0C66-\u0C6F];NFD;Telugu-InterIndic;InterIndic-Gurmukhi;NFC -Telugu-Gujarati:alias:[\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C60-\u0C61\u0C66-\u0C6F];NFD;Telugu-InterIndic;InterIndic-Gujarati;NFC -Telugu-Oriya:alias:[\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C60-\u0C61\u0C66-\u0C6F];NFD;Telugu-InterIndic;InterIndic-Oriya;NFC -Telugu-Tamil:alias:[\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C60-\u0C61\u0C66-\u0C6F];NFD;Telugu-InterIndic;InterIndic-Tamil;NFC -Telugu-Kannada:alias:[\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C60-\u0C61\u0C66-\u0C6F];NFD;Telugu-InterIndic;InterIndic-Kannada;NFC -Telugu-Malayalam:alias:[\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C60-\u0C61\u0C66-\u0C6F];NFD;Telugu-InterIndic;InterIndic-Malayalam;NFC - -Kannada-Devanagari:alias:[\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE1\u0CE6-\u0CEF];NFD;Kannada-InterIndic;InterIndic-Devanagari;NFC -Kannada-Bengali:alias:[\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE1\u0CE6-\u0CEF];NFD;Kannada-InterIndic;InterIndic-Bengali;NFC -Kannada-Gurmukhi:alias:[\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE1\u0CE6-\u0CEF];NFD;Kannada-InterIndic;InterIndic-Gurmukhi;NFC -Kannada-Gujarati:alias:[\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE1\u0CE6-\u0CEF];NFD;Kannada-InterIndic;InterIndic-Gujarati;NFC -Kannada-Oriya:alias:[\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE1\u0CE6-\u0CEF];NFD;Kannada-InterIndic;InterIndic-Oriya;NFC -Kannada-Tamil:alias:[\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE1\u0CE6-\u0CEF];NFD;Kannada-InterIndic;InterIndic-Tamil;NFC -Kannada-Telugu:alias:[\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE1\u0CE6-\u0CEF];NFD;Kannada-InterIndic;InterIndic-Telugu;NFC -Kannada-Malayalam:alias:[\u0C82-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0CDE\u0CE0-\u0CE1\u0CE6-\u0CEF];NFD;Kannada-InterIndic;InterIndic-Malayalam;NFC - -Malayalam-Devanagari:alias:[\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D60-\u0D61\u0D66-\u0D6F];NFD;Malayalam-InterIndic;InterIndic-Devanagari;NFC -Malayalam-Bengali:alias:[\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D60-\u0D61\u0D66-\u0D6F];NFD;Malayalam-InterIndic;InterIndic-Bengali;NFC -Malayalam-Gurmukhi:alias:[\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D60-\u0D61\u0D66-\u0D6F];NFD;Malayalam-InterIndic;InterIndic-Gurmukhi;NFC -Malayalam-Gujarati:alias:[\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D60-\u0D61\u0D66-\u0D6F];NFD;Malayalam-InterIndic;InterIndic-Gujarati;NFC -Malayalam-Oriya:alias:[\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D60-\u0D61\u0D66-\u0D6F];NFD;Malayalam-InterIndic;InterIndic-Oriya;NFC -Malayalam-Tamil:alias:[\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D60-\u0D61\u0D66-\u0D6F];NFD;Malayalam-InterIndic;InterIndic-Tamil;NFC -Malayalam-Telugu:alias:[\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D60-\u0D61\u0D66-\u0D6F];NFD;Malayalam-InterIndic;InterIndic-Telugu;NFC -Malayalam-Kannada:alias:[\u0D02-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D60-\u0D61\u0D66-\u0D6F];NFD;Malayalam-InterIndic;InterIndic-Kannada;NFC - -# eof diff --git a/icu4j/src/com/ibm/text/resources/package.html b/icu4j/src/com/ibm/text/resources/package.html deleted file mode 100755 index f823e50a16..0000000000 --- a/icu4j/src/com/ibm/text/resources/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Resource data used by classes in com.ibm.text. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/text/resources/thai_dict b/icu4j/src/com/ibm/text/resources/thai_dict deleted file mode 100755 index 9f8f77f44e..0000000000 Binary files a/icu4j/src/com/ibm/text/resources/thai_dict and /dev/null differ diff --git a/icu4j/src/com/ibm/text/resources/unames.dat b/icu4j/src/com/ibm/text/resources/unames.dat deleted file mode 100755 index 42abaa1453..0000000000 --- a/icu4j/src/com/ibm/text/resources/unames.dat +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1ed19d9146453552669cb90761883420f1001aaba4881a0eaa8d199c49551b10 -size 119500 diff --git a/icu4j/src/com/ibm/text/resources/uprops.dat b/icu4j/src/com/ibm/text/resources/uprops.dat deleted file mode 100755 index 2bd95310d5..0000000000 --- a/icu4j/src/com/ibm/text/resources/uprops.dat +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:29853113f69ed8b1ac5f97cf490f39c45fa352ea675bc11bb02b385d7a9f7274 -size 32144 diff --git a/icu4j/src/com/ibm/textlayout/FontUtils.java b/icu4j/src/com/ibm/textlayout/FontUtils.java deleted file mode 100755 index 9d09528e0e..0000000000 --- a/icu4j/src/com/ibm/textlayout/FontUtils.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * @(#)$RCSfile: FontUtils.java,v $ $Revision: 1.1 $ $Date: 2000/04/20 17:30:44 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -// Requires Java2 -package com.ibm.textlayout; - -import java.awt.Font; - -public final class FontUtils { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - - public static Font getFont(java.util.Map attributes) { - - return Font.getFont(attributes); - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/textlayout/Graphics2DConversion.java b/icu4j/src/com/ibm/textlayout/Graphics2DConversion.java deleted file mode 100755 index ab4e927b50..0000000000 --- a/icu4j/src/com/ibm/textlayout/Graphics2DConversion.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * @(#)$RCSfile: Graphics2DConversion.java,v $ $Revision: 1.1 $ $Date: 2000/04/20 17:30:44 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -// Requires Java2 -package com.ibm.textlayout; - -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Paint; - -/** - * This class allows JDK 1.1 code to use a "fake" Graphics2D - * for source-code compatibility with Java2 code. On Java2 it's - * a trivial class. The JDK 1.1 version of this class does interesting - * work. - */ -public final class Graphics2DConversion { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - - public static Graphics2D getGraphics2D(Graphics g) { - return (Graphics2D) g; - } - - public static Graphics getGraphics(Graphics2D g) { - return g; - } - - /** - * Will return an instance of Paint. - */ - public static Object getColorState(Graphics2D g) { - - return g.getPaint(); - } - - /** - * State must be an instance of Paint. - */ - public static void restoreColorState(Graphics2D g, Object state) { - - g.setPaint((Paint) state); - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/textlayout/attributes/AttributeKey.java b/icu4j/src/com/ibm/textlayout/attributes/AttributeKey.java deleted file mode 100755 index 6f44db4b1c..0000000000 --- a/icu4j/src/com/ibm/textlayout/attributes/AttributeKey.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * @(#)$RCSfile: AttributeKey.java,v $ $Revision: 1.1 $ $Date: 2000/04/20 17:33:07 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -package com.ibm.textlayout.attributes; - -import java.io.Serializable; - -/** - * This class provides a cannonical mapping between fields in TextAttribute - * and instances of itself. It is used by AttributeMap to serialize - * and deserialize TextAttribute to preserve uniqueness of TextAttribute - * instances (ie so that TextAttribute instances remain singletons), - * and to provide compatability between 1.1 and 1.2 versions of - * TextAttribute. - *

    - * Example use - instead of doing this: - *

    - *     out.writeObject(anAttribute);
    - * 
    - * do this: - *
    - *     out.writeObject(AttributeKey.mapAttributeToKey(anAttribute));
    - * 
    - * Similarly, instead of this: - *
    - *     anAttribute = in.readObject();
    - * 
    - * do this: - *
    - *     anAttribute = AttributeKey.mapKeyToAttribute(in.readObject());
    - * 
    - *

    - * If anAttribute is not a known TextAttribute, then mapAttributeToKey - * will just return its argument. Similarly, mapKeyToAttribute will - * return its argument if the argument is not a known AttributeKey. - */ - -/*public*/ final class AttributeKey implements Serializable { - -/* - In this implementation, two parallel Vectors are - maintained. TextAttribute(i) maps to AttributeKey(i). - For compatability with existing data, this mapping must - be maintained in the future! So, when new attributes - are added, add them to the end of the list. -*/ - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - private static final long serialVersionUID = 3772371253277107294L; - - private static Object[] fgTextAttributes; - private static Object[] fgAttributeKeys; - - static { - fgTextAttributes = new Object[] { - TextAttribute.FONT, - TextAttribute.FAMILY, - TextAttribute.WEIGHT, - TextAttribute.POSTURE, - TextAttribute.SIZE, - TextAttribute.SUPERSCRIPT, - TextAttribute.FOREGROUND, - TextAttribute.BACKGROUND, - TextAttribute.UNDERLINE, - TextAttribute.STRIKETHROUGH, - TextAttribute.CHAR_REPLACEMENT, - TextAttribute.EXTRA_LINE_SPACING, - TextAttribute.FIRST_LINE_INDENT, - TextAttribute.MIN_LINE_SPACING, - TextAttribute.LINE_FLUSH, - TextAttribute.LEADING_MARGIN, - TextAttribute.TRAILING_MARGIN, - TextAttribute.TAB_RULER, - TextAttribute.RUN_DIRECTION, - TextAttribute.BIDI_EMBEDDING, - TextAttribute.JUSTIFICATION, - }; - - final int attrCount = fgTextAttributes.length; - fgAttributeKeys = new Object[attrCount]; - - for (int i=0; i < attrCount; i += 1) { - fgAttributeKeys[i] = new AttributeKey(i); - } - } - - /** - * Return the TextAttribute corresponding to the given key. - * If key is an instance of AttributeKey it will be mapped to - * a TextAttribute. Otherwise, the key is returned. - * @param key the key to map to a TextAttribute field - * @return the TextAttribute for key if key - * is an AttributeKey; otherwise key is returned - */ - /*public*/ static Object mapKeyToAttribute(Object key) { - - try { - AttributeKey aKey = (AttributeKey) key; - if (aKey.fId < fgTextAttributes.length) { - return fgTextAttributes[aKey.fId]; - } - else { - return key; - } - } - catch(ClassCastException e) { - return key; - } - } - - /** - * If attribute is a known TextAttribute, return an AttributeKey - * for it. Otherwise the object is returned. - * @param attribute the attribute to map to an AttributeKey - * @return an AttributeKey for attribute - * if attribute is a known attribute; otherwise - * attribute is returned - */ - /*public*/ static Object mapAttributeToKey(Object attribute) { - - final int attrCount = fgTextAttributes.length; - - for (int index = 0; index < attrCount; index += 1) { - if (fgTextAttributes[index].equals(attribute)) { - return fgAttributeKeys[index]; - } - } - - return attribute; - } - - - private int fId; - - private AttributeKey(int id) { - - fId = id; - } - - public boolean equals(Object rhs) { - - try { - return ((AttributeKey)rhs).fId == fId; - } - catch(ClassCastException e) { - return false; - } - } - - public int hashCode() { - - return fId; - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/textlayout/attributes/AttributeMap.java b/icu4j/src/com/ibm/textlayout/attributes/AttributeMap.java deleted file mode 100755 index c8239288ed..0000000000 --- a/icu4j/src/com/ibm/textlayout/attributes/AttributeMap.java +++ /dev/null @@ -1,529 +0,0 @@ -/* - * @(#)$RCSfile: AttributeMap.java,v $ $Revision: 1.1 $ $Date: 2000/04/20 17:33:31 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -// Requires Java2 -package com.ibm.textlayout.attributes; - -import java.util.Collection; -import java.util.Collections; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Set; - -import java.io.Externalizable; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.io.IOException; - - -/** - * AttributeMap is an immutable Map. Additionally, there are - * several methods for common operations (union, - * remove, intersect); these methods return new AttributeMap - * instances. - *

    - * Although any non-null Object can be a key or value in an - * AttributeMap, typically the keys are fields of TextAttribute. - * @see TextAttribute - */ -public final class AttributeMap implements java.util.Map, - com.ibm.textlayout.attributes.Map, - Externalizable { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - private static final int CURRENT_VERSION = 1; - - private static final long serialVersionUID = 9510803; - - private static final String errString = "StyleSets are immutable."; - - // This is passed to the Hashtable constructor as the - // load factor argument. It is chosen to avoid resizing - // the Hashtable whenever possible. I think that 1 - // does this. - private static final int LOAD_FACTOR = 1; - - private Hashtable styleTable; - private transient AttributeSet cachedKeySet = null; - private transient Collection cachedValueCollection = null; - private transient Set cachedEntrySet = null; - - /** - * An empty AttributeMap. - */ - public static final AttributeMap EMPTY_ATTRIBUTE_MAP = new AttributeMap(); - -// ============== -// Constructors -// ============== - - /** - * Create a new, empty AttributeMap. EMPTY_STYLE_SET can be used - * in place of an AttributeMap produced by this constructor. - */ - public AttributeMap() { - - styleTable = new Hashtable(1, LOAD_FACTOR); - } - - /** - * Create an AttributeMap with the same key-value - * entries as the given Map. - * @param map a Map whose key-value entries will - * become the entries for this AttributeMap. map - * is not modified, and must not contain null keys or values. - */ - public AttributeMap(java.util.Map map) { - - styleTable = new Hashtable(map.size(), LOAD_FACTOR); - styleTable.putAll(map); - } - - /** - * Create an AttributeMap with the same key-value - * entries as the given Hashtable. - * @param table a Hashtable whose key-value entries will - * become the entries for this AttributeMap. table - * is not modified. - */ - public AttributeMap(Hashtable hashtable) { - - this((java.util.Map) hashtable); - } - - /** - * Create an AttributeMap with a single entry of - * {attribute, value}. - * @param attribute the key in this AttributeMap's single entry - * @param value the value in this AttributeMap's single entry - */ - public AttributeMap(Object key, Object value) { - - styleTable = new Hashtable(1, LOAD_FACTOR); - - // hashtable checks value for null - styleTable.put(key, value); - } - - // For internal use only. - private AttributeMap(Hashtable table, boolean clone) { - - if (clone) { - styleTable = (Hashtable) table.clone(); - } - else { - this.styleTable = table; - } - } - - public void writeExternal(ObjectOutput out) throws IOException { - - out.writeInt(CURRENT_VERSION); - out.writeInt(styleTable.size()); - Enumeration e = styleTable.keys(); - while (e.hasMoreElements()) { - Object key = e.nextElement(); - out.writeObject(AttributeKey.mapAttributeToKey(key)); - out.writeObject(styleTable.get(key)); - } - } - - public void readExternal(ObjectInput in) throws IOException, - ClassNotFoundException { - - if (in.readInt() != CURRENT_VERSION) { - throw new IOException("Invalid version of StyleBuffer"); - } - - int count = in.readInt(); - for (int i=0; i < count; i += 1) { - Object key = AttributeKey.mapKeyToAttribute(in.readObject()); - Object value = in.readObject(); - styleTable.put(key, value); - } - } - -// ============== -// Map interface -// ============== - -// queries - /** - * Return the number of entries in the AttributeMap. - * @return the number of entries in the AttributeMap - */ - public int size() { - - return styleTable.size(); - } - - /** - * Return true if the number of entries in the AttributeMap - * is 0. - * @return true if the number of entries in the AttributeMap - * is 0 - */ - public boolean isEmpty() { - - return styleTable.isEmpty(); - } - - /** - * Return true if the given key is in this AttributeMap. - * @param key the key to test - * @return true if key is in this AttributeMap - */ - public boolean containsKey(Object key) { - - return styleTable.containsKey(key); - } - - /** - * Return true if the given value is in this AttributeMap. - * @param key the value to test - * @return true if value is in this AttributeMap - */ - public boolean containsValue(Object value) { - - return styleTable.containsValue(value); - } - - /** - * Return the value associated with the given key. If the - * key is not in this AttributeMap null is returned. - * @param key the key to look up - * @return the value associated with key, or - * null if key is not in this AttributeMap - */ - public Object get(Object key) { - - return styleTable.get(key); - } - -// modifiers - all throw exceptions - - /** - * Throws UnsupportedOperationException. - * @see #addAttribute - * @throws UnsupportedOperationException - */ - public Object put(Object key, Object value) { - - throw new UnsupportedOperationException(errString); - } - - /** - * Throws UnsupportedOperationException. - * @see #removeAttributes - * @throws UnsupportedOperationException - */ - public Object remove(Object key) { - - throw new UnsupportedOperationException(errString); - } - - /** - * Throws UnsupportedOperationException. - * @see #addAttributes - * @throws UnsupportedOperationException - */ - public void putAll(java.util.Map t) { - - throw new UnsupportedOperationException(errString); - } - - /** - * Throws UnsupportedOperationException. - * @see #EMPTY_ATTRIBUTE_MAP - * @throws UnsupportedOperationException - */ - public void clear() { - - throw new UnsupportedOperationException(errString); - } - -// views - - /** - * Return an AttributeSet containing every key in this AttributeMap. - * @return an AttributeSet containing every key in this AttributeMap - */ - public Set keySet() { - - return getKeySet(); - } - - /** - * Return an AttributeSet containing every key in this AttributeMap. - * @return an AttributeSet containing every key in this AttributeMap - */ - public AttributeSet getKeySet() { - - AttributeSet result = cachedKeySet; - - if (result == null) { - result = AttributeSet.createKeySet(styleTable); - cachedKeySet = result; - } - - return result; - } - - /** - * Return a Collection containing every value in this AttributeMap. - * @return a Collection containing every value in this AttributeMap - */ - public Collection values() { - - Collection result = cachedValueCollection; - - if (result == null) { - result = Collections.unmodifiableCollection(styleTable.values()); - cachedValueCollection = result; - } - - return result; - } - - /** - * Return a Set containing all entries in this AttributeMap. - */ - public Set entrySet() { - - Set result = cachedEntrySet; - - if (result == null) { - result = Collections.unmodifiableSet(styleTable.entrySet()); - cachedEntrySet = result; - } - - return result; - } - - public boolean equals(Object rhs) { - - if (rhs == this) { - return true; - } - - if (rhs == null) { - return false; - } - - AttributeMap rhsStyleSet = null; - - try { - rhsStyleSet = (AttributeMap) rhs; - } - catch(ClassCastException e) { - return false; - } - - return styleTable.equals(rhsStyleSet.styleTable); - } - - public int hashCode() { - - return styleTable.hashCode(); - } - - public String toString() { - - return styleTable.toString(); - } - -// ============== -// Operations -// ============== - - /** - * Return a AttributeMap which contains entries in this AttributeMap, - * along with an entry for . If attribute - * is already present in this AttributeMap its value becomes value. - */ - public AttributeMap addAttribute(Object key, Object value) { - - // try to optimize for case where is already there? - Hashtable newTable = new Hashtable(styleTable.size() + 1, LOAD_FACTOR); - newTable.putAll(styleTable); - newTable.put(key, value); - return new AttributeMap(newTable, false); - } - - /** - * Return a AttributeMap which contains entries in this AttributeMap - * and in rhs. If an attribute appears in both StyleSets the - * value from rhs is used. - */ - public AttributeMap addAttributes(AttributeMap rhs) { - - int thisSize = size(); - - if (thisSize == 0) { - return rhs; - } - - int otherSize = rhs.size(); - - if (otherSize == 0) { - return this; - } - - Hashtable newTable = new Hashtable(thisSize + otherSize, LOAD_FACTOR); - - newTable.putAll(styleTable); - newTable.putAll(rhs); - - return new AttributeMap(newTable, false); - } - - /** - * Return a AttributeMap which contains entries in this AttributeMap - * and in rhs. If an attribute appears in both StyleSets the - * value from rhs is used. - * The Map's keys and values must be non-null. - */ - public AttributeMap addAttributes(java.util.Map rhs) { - - if (rhs instanceof AttributeMap) { - return addAttributes((AttributeMap)rhs); - } - - Hashtable newTable = new Hashtable(size() + rhs.size(), LOAD_FACTOR); - - newTable.putAll(styleTable); - newTable.putAll(rhs); - - return new AttributeMap(newTable, false); - } - - /** - * Return a AttributeMap with the entries in this AttributeMap, but - * without attribute as a key. - */ - public AttributeMap removeAttribute(Object attribute) { - - if (!containsKey(attribute)) { - return this; - } - - Hashtable newTable = new Hashtable(styleTable.size(), LOAD_FACTOR); - newTable.putAll(styleTable); - newTable.remove(attribute); - - return new AttributeMap(newTable, false); - } - - /** - * Return a AttributeMap with the entries of this AttributeMap whose - * attributes are not in the Set. - */ - public AttributeMap removeAttributes(AttributeSet attributes) { - - Set set = attributes; - return removeAttributes(set); - } - - /** - * Return a AttributeMap with the entries of this AttributeMap whose - * attributes are not in the Set. - */ - public AttributeMap removeAttributes(Set attributes) { - - // Create newTable on demand; if null at - // end of iteration then return this set. - // Should we intersect styleTable.keySet with - // attributes instead? - - Hashtable newTable = null; - Iterator attrIter = attributes.iterator(); - while (attrIter.hasNext()) { - Object current = attrIter.next(); - if (current != null && styleTable.containsKey(current)) { - if (newTable == null) { - newTable = new Hashtable(styleTable.size(), LOAD_FACTOR); - newTable.putAll(styleTable); - } - newTable.remove(current); - } - } - - if (newTable != null) { - return new AttributeMap(newTable, false); - } - else { - return this; - } - } - - /** - * Return a AttributeMap with the keys of this AttributeMap which - * are also in the Set. The set must not contain null. - */ - public AttributeMap intersectWith(AttributeSet attributes) { - - Set set = attributes; - return intersectWith(set); - } - - /** - * Return a AttributeMap with the keys of this AttributeMap which - * are also in the Set. The set must not contain null. - */ - public AttributeMap intersectWith(Set attributes) { - - // For now, forget about optimizing for the case when - // the return value is equivalent to this set. - - int attrSize = attributes.size(); - int styleTableSize = styleTable.size(); - int size = Math.min(attrSize, styleTableSize); - Hashtable newTable = new Hashtable(size, LOAD_FACTOR); - - if (attrSize < styleTableSize) { - Iterator attrIter = attributes.iterator(); - while (attrIter.hasNext()) { - Object current = attrIter.next(); - if (current != null) { - Object value = styleTable.get(current); - if (value != null) { - newTable.put(current, value); - } - } - } - } - else { - Iterator attrIter = keySet().iterator(); - while (attrIter.hasNext()) { - Object current = attrIter.next(); - if (attributes.contains(current)) { - newTable.put(current, styleTable.get(current)); - } - } - } - - return new AttributeMap(newTable, false); - } - - /** - * Put all entries in this AttributeMap into the given Map. - * @param rhs the Map into which entries are placed - */ - public void putAllInto(java.util.Map rhs) { - - rhs.putAll(this); - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/textlayout/attributes/AttributeSet.java b/icu4j/src/com/ibm/textlayout/attributes/AttributeSet.java deleted file mode 100755 index bc384250cc..0000000000 --- a/icu4j/src/com/ibm/textlayout/attributes/AttributeSet.java +++ /dev/null @@ -1,345 +0,0 @@ -/* - * @(#)$RCSfile: AttributeSet.java,v $ $Revision: 1.1 $ $Date: 2000/04/20 17:33:31 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -// Requires Java2 -package com.ibm.textlayout.attributes; - -import java.util.Hashtable; -import java.util.Enumeration; -import java.util.Iterator; -import java.util.Set; -import java.util.Collection; - -/** - * An AttributeSet is an immutable collection of unique Objects. - * It has several operations - * which return new AttributeSet instances. - */ -public final class AttributeSet implements Set { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - - /** - * An AttributeSet with no members. - */ - public static final AttributeSet EMPTY_SET = new AttributeSet(); - - private Hashtable elements; - - private static final String errString = "AttributeSet is immutable."; - - private AttributeSet(Hashtable elements) { - - this.elements = elements; - } - - /** - * Package only. For AttributeMap use. - */ - static AttributeSet createKeySet(Hashtable hashtable) { - - Hashtable newElements = new Hashtable(); - - Enumeration e = hashtable.keys(); - while (e.hasMoreElements()) { - Object next = e.nextElement(); - newElements.put(next, next); - } - - return new AttributeSet(newElements); - } - - /** - * Create a new, empty AttributeSet. The set is semantically - * equivalent to EMPTY_SET. - */ - public AttributeSet() { - - elements = new Hashtable(); - } - - /** - * Create a new AttributeSet with the single element elem. - */ - public AttributeSet(Object elem) { - - elements = new Hashtable(1, 1); - elements.put(elem, elem); - } - - /** - * Create a new AttributeSet containing the items in the array elems. - */ - public AttributeSet(Object[] elems) { - - elements = new Hashtable(elems.length, 1); - for (int i=0; i < elems.length; i++) { - Object next = elems[i]; - elements.put(next, next); - } - } - - /** - * Return true if the number of elements in this set is 0. - * @return true if the number of elements in this set is 0 - */ - public boolean isEmpty() { - - return elements.isEmpty(); - } - - /** - * Return the number of elements in this set. - * @return the number of elements in this set - */ - public int size() { - - return elements.size(); - } - - public boolean equals(Object rhs) { - - try { - return equals((AttributeSet) rhs); - } - catch(ClassCastException e) { - return false; - } - } - - public boolean equals(AttributeSet rhs) { - - if (rhs == null) { - return false; - } - - return elements.equals(rhs.elements); - } - - /** - * Return true if this set contains the given Object - * @return true if this set contains o - */ - public boolean contains(Object o) { - - Object value = elements.get(o); - return value != null; - } - - /** - * Return true if this set contains all elements in the given - * Collection - * @param coll the collection to compare with - * @return true if this set contains all elements in the given - * Collection - */ - public boolean containsAll(Collection coll) { - - return elements.keySet().containsAll(coll); - } - - /** - * Return an Enumeration of the elements in this set. - * @return an Enumeration of the elements in this set - */ - public Enumeration elements() { - - return elements.keys(); - } - - /** - * Return an Iterator with the elements in this set. - * @return an Iterator with the elements in this set. - * The Iterator cannot be used to modify this AttributeSet. - */ - public Iterator iterator() { - - return new EnumerationIterator(elements.keys()); - } - - /** - * Fill in the given array with the elements in this set. - * @param storage an array to fill with this set's elements. - * The array cannot be null. - * @return the storage array. - */ - public Object[] toArray(Object[] storage) { - - Enumeration keys = elements.keys(); - int n=0; - while (keys.hasMoreElements()) { - storage[n++] = keys.nextElement(); - } - return storage; - } - - /** - * Return an array with the elements in this set. - * @return an array with the elements in this set - */ - public Object[] toArray() { - - return toArray(new Object[size()]); - } - - /** - * Throws UnsupportedOperationException. - * @see #addElement - * @throws UnsupportedOperationException - */ - public boolean add(Object o){ - throw new UnsupportedOperationException(errString); - } - - /** - * Throws UnsupportedOperationException. - * @throws UnsupportedOperationException - */ - public boolean remove(Object o) { - throw new UnsupportedOperationException(errString); - } - - /** - * Throws UnsupportedOperationException. - * @see #unionWith - * @throws UnsupportedOperationException - */ - public boolean addAll(Collection coll) { - throw new UnsupportedOperationException(errString); - } - - /** - * Throws UnsupportedOperationException. - * @see #subtract - * @throws UnsupportedOperationException - */ - public boolean removeAll(Collection coll) { - throw new UnsupportedOperationException(errString); - } - - /** - * Throws UnsupportedOperationException. - * @see #intersectWith - * @throws UnsupportedOperationException - */ - public boolean retainAll(Collection coll) { - throw new UnsupportedOperationException(errString); - } - - /** - * Throws UnsupportedOperationException. - * @see #EMPTY_SET - * @throws UnsupportedOperationException - */ - public void clear() { - throw new UnsupportedOperationException(errString); - } - - /** - * Return an AttributeSet containing the elements of this set - * and the given element - * @param element the element to add - * @return an AttributeSet like this one, with element - * added - */ - public AttributeSet addElement(Object element) { - - Hashtable newElements = (Hashtable) elements.clone(); - newElements.put(element, element); - return new AttributeSet(newElements); - } - - /** - * Return an AttributeSet which is the union of - * this set with the given set. - * @param s the set to union with - * @return an AttributeSet of the elements in this set or - * in s - */ - public AttributeSet unionWith(AttributeSet s) { - - Hashtable newElements = (Hashtable) elements.clone(); - - Iterator iter = s.iterator(); - while (iter.hasNext()) { - Object next = iter.next(); - newElements.put(next, next); - } - - return new AttributeSet(newElements); - } - - /** - * Return an AttributeSet which is the intersection of - * this set with the given set. - * @param s the set to intersect with - * @return an AttributeSet of the elements in this set which - * are in s - */ - public AttributeSet intersectWith(AttributeSet s) { - - Hashtable newElements = new Hashtable(); - - Iterator iter = s.iterator(); - while (iter.hasNext()) { - Object next = iter.next(); - if (elements.get(next) != null) { - newElements.put(next, next); - } - } - - return new AttributeSet(newElements); - } - - /** - * Return an AttributeSet with the elements in this set which - * are not in the given set. - * @param s the set of elements to exclude - * @return an AttributeSet of the elements in this set which - * are not in s - */ - public AttributeSet subtract(AttributeSet s) { - - Hashtable newElements = (Hashtable) elements.clone(); - - Iterator iter = s.iterator(); - while (iter.hasNext()) { - newElements.remove(iter.next()); - } - - return new AttributeSet(newElements); - } - - private static final class EnumerationIterator implements Iterator { - - private Enumeration e; - - EnumerationIterator(Enumeration e) { - this.e = e; - } - - public boolean hasNext() { - return e.hasMoreElements(); - } - - public Object next() { - return e.nextElement(); - } - - public void remove() { - throw new UnsupportedOperationException(errString); - } - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/textlayout/attributes/Map.java b/icu4j/src/com/ibm/textlayout/attributes/Map.java deleted file mode 100755 index da5b38db5b..0000000000 --- a/icu4j/src/com/ibm/textlayout/attributes/Map.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * @(#)$RCSfile: Map.java,v $ $Revision: 1.1 $ $Date: 2000/04/20 17:33:07 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -// Requires Java2 -package com.ibm.textlayout.attributes; - -/** - * A Map is a collection of key-value pairs (or entries), where each - * key in the Map is unique. This interface is a subset of the - * JDK 1.2 Map interface. It is used by JDK 1.1-compatible code. - */ -public interface Map { - - static final String COPYRIGHT = - "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved"; - /** - * Return the number of entries in this Map. - * @return the number of entries in this Map - */ - public int size(); - - /** - * Return true if this Map has no entries. - * @return true if this Map has no entries - */ - public boolean isEmpty(); - - /** - * Return the value of the given key. - * @return the value of the given key. If the key does not have - * a value in this Map, null is returned. - */ - public Object get(Object key); - - /** - * Return true if this Map contains the given key. - * @return true if this Map contains the given key - */ - public boolean containsKey(Object key); -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/textlayout/attributes/TextAttribute.java b/icu4j/src/com/ibm/textlayout/attributes/TextAttribute.java deleted file mode 100755 index 36ca6d7616..0000000000 --- a/icu4j/src/com/ibm/textlayout/attributes/TextAttribute.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * @(#)$RCSfile: TextAttribute.java,v $ $Revision: 1.2 $ $Date: 2000/04/25 00:18:51 $ - * - * (C) Copyright IBM Corp. 1998-1999. All Rights Reserved. - * - * The program is provided "as is" without any warranty express or - * implied, including the warranty of non-infringement and the implied - * warranties of merchantibility and fitness for a particular purpose. - * IBM will not be liable for any damages suffered by you as a result - * of using the Program. In no event will IBM be liable for any - * special, indirect or consequential damages or lost profits even if - * IBM has been advised of the possibility of their occurrence. IBM - * will not be liable for any third party claims against you. - */ -// Requires Java2 -package com.ibm.textlayout.attributes; - -import java.util.Hashtable; -import java.text.AttributedCharacterIterator.Attribute; -import java.io.InvalidObjectException; - -/** - * This class contains a number of keys (or attributes) for specifying text styles - * in a Map. A text style is a collection of key-value pairs, where - * the key represents a certain characteristic (such as size) and - * the value tells how that characteristic is realized (ie what the - * size is). - *

    - * All of the attributes in TextAttribute specify a class for their value. - * Map does not enforce these class specifications; however, text rendering code - * will tend to fail with a ClassCastException if a key's value - * has an unexpected class. - *

    - * Some attributes are meaningful for entire paragraphs, not individual - * characters. These attributes are documented as applying to paragraphs. - * All other attributes apply to characters. - *

    - * Many of the field names and values in this class - * are taken from the JDK 1.2 - * java.awt.font.TextAttribute class. - * @see Map - */ -public class TextAttribute extends Attribute { - - private static final Hashtable instanceMap = new Hashtable(9); - - protected TextAttribute(String name) { - super(name); - if (this.getClass() == TextAttribute.class) { - instanceMap.put(name, this); - } - } - - protected Object readResolve() throws InvalidObjectException { - if (this.getClass() != TextAttribute.class) { - throw new InvalidObjectException("subclass didn't correctly implement readResolve"); - } - - TextAttribute instance = (TextAttribute) instanceMap.get(getName()); - if (instance != null) { - return instance; - } else { - throw new InvalidObjectException("unknown attribute name"); - } - } - - public static final Object FONT = java.awt.font.TextAttribute.FONT; - - public static final Object FAMILY = java.awt.font.TextAttribute.FAMILY; - - public static final Object WEIGHT = java.awt.font.TextAttribute.WEIGHT; - public static final Float WEIGHT_BOLD = java.awt.font.TextAttribute.WEIGHT_BOLD; - - public static final Object POSTURE = java.awt.font.TextAttribute.POSTURE; - public static final Float POSTURE_OBLIQUE = java.awt.font.TextAttribute.POSTURE_OBLIQUE; - - public static final Object SIZE = java.awt.font.TextAttribute.SIZE; - - public static final Object SUPERSCRIPT = java.awt.font.TextAttribute.SUPERSCRIPT; - public static final Integer SUPERSCRIPT_SUPER = java.awt.font.TextAttribute.SUPERSCRIPT_SUPER; - public static final Integer SUPERSCRIPT_SUB = java.awt.font.TextAttribute.SUPERSCRIPT_SUB; - - /** - * Attribute key for the foreground and background color adornment. - */ - public static final Object FOREGROUND = java.awt.font.TextAttribute.FOREGROUND; - public static final Object BACKGROUND = java.awt.font.TextAttribute.BACKGROUND; - - public static final Object UNDERLINE = java.awt.font.TextAttribute.UNDERLINE; - public static final Integer UNDERLINE_ON = java.awt.font.TextAttribute.UNDERLINE_ON; - - public static final Object STRIKETHROUGH = java.awt.font.TextAttribute.STRIKETHROUGH; - public static final Boolean STRIKETHROUGH_ON = java.awt.font.TextAttribute.STRIKETHROUGH_ON; - - public static final Object OFFSET = new TextAttribute("offset"); - - public static final Object CHAR_REPLACEMENT = java.awt.font.TextAttribute.CHAR_REPLACEMENT; -// Paragraph Styles - -// values are Floats: - public static final Object EXTRA_LINE_SPACING = new TextAttribute("extra_line_spacing"); - public static final Object EXTRA_FIRST_LINE_SPACING = new TextAttribute("extra_first_line_spacing"); - - /** - * Amount beyond leading margin to indent the first line of a paragraph. - */ - public static final Object FIRST_LINE_INDENT = new TextAttribute("first_line_indent"); - - public static final Object MIN_LINE_SPACING = new TextAttribute("min_line_spacing"); - public static final Object MIN_FIRST_LINE_SPACING = new TextAttribute("min_first_line_spacing"); - - /** - * Flush lines left, right, or center. - */ - public static final Object LINE_FLUSH = new TextAttribute("line_flush"); - - public static final Integer FLUSH_LEADING = new Integer(0); - public static final Integer FLUSH_CENTER = new Integer(1); - public static final Integer FLUSH_TRAILING = new Integer(2); - /** - * Value of LINE_FLUSH for full justification. - */ - public static final Integer FULLY_JUSTIFIED = new Integer(3); - - /** - * Leading and trailing margin in paragraph. - */ - public static final Object LEADING_MARGIN = new TextAttribute("leading_margin"); - public static final Object TRAILING_MARGIN = new TextAttribute("trailing_margin"); - - /** - * Tab ruler. Values are MTabRuler instances. - */ - public static final Object TAB_RULER = new TextAttribute("tab_ruler"); - - /** - * Attribute key for the run direction of the line. - * - *

    - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *

    Key

    RUN_DIRECTION

    Value

    Boolean

    Constants

    RUN_DIRECTION_LTR = true, RUN_DIRECTION_RTL = false - *

    Default

    Use the default Unicode base direction from the BIDI - * algorithm.

    Description

    Specifies which base run direction to use when - * positioning mixed directional runs within a paragraph. If this value is - * RUN_DIRECTION_DEFAULT, TextLayout uses the default Unicode - * base direction from the BIDI algorithm.

    - *

    This attribute should have the same value over the whole - * paragraph.

    - */ - public static final Object RUN_DIRECTION = java.awt.font.TextAttribute.RUN_DIRECTION; - - /** - * Left-to-right run direction. - * @see #RUN_DIRECTION - */ - public static final Boolean RUN_DIRECTION_LTR = java.awt.font.TextAttribute.RUN_DIRECTION_LTR; - - /** - * Right-to-left run direction. - * @see #RUN_DIRECTION - */ - public static final Boolean RUN_DIRECTION_RTL = java.awt.font.TextAttribute.RUN_DIRECTION_RTL; - - /** - * Attribute key for the embedding level for nested bidirectional runs. - * - *

    - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *

    Key

    BIDI_EMBEDDING

    Value

    Integer

    Limits

    Positive values 1 through 15 are embedding - * levels, negative values
    through -15 are override levels - *

    Default

    Use standard BIDI to compute levels from formatting - * characters in the text.

    Description

    Specifies the bidi embedding level of the character. - * When this attribute is present anywhere in a paragraph, then the - * Unicode characters RLO, LRO, RLE, LRE, PDF are disregarded in the BIDI - * analysis of that paragraph. - * See the Unicode Standard v. 2.0, section 3-11. - *
    - */ - public static final Object BIDI_EMBEDDING = java.awt.font.TextAttribute.BIDI_EMBEDDING; - - /** - * Attribute key for the justification of a paragraph. - * - *

    - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *

    Key

    JUSTIFICATION

    Value

    Float

    Limits

    0.0 through1.0

    Default

    1.0

    Description

    Specifies which fraction of the extra space to use - * when justification is requested. For example, if the line is 50 points - * wide and the margins are 70 points apart, a value of 0.5 means that the - * line is padded to reach a width of 60 points.

    - *

    This attribute should have the same value over the whole - * paragraph.

    - */ - public static final Object JUSTIFICATION = java.awt.font.TextAttribute.JUSTIFICATION; - - /** - * Justify the line to the full requested width. - * @see #JUSTIFICATION - */ - public static final Float JUSTIFICATION_FULL = java.awt.font.TextAttribute.JUSTIFICATION_FULL; - - /** - * Do not allow the line to be justified. - * @see #JUSTIFICATION - */ - public static final Float JUSTIFICATION_NONE = java.awt.font.TextAttribute.JUSTIFICATION_NONE; -} diff --git a/icu4j/src/com/ibm/tools/compression/CompressionTableGenerator.java b/icu4j/src/com/ibm/tools/compression/CompressionTableGenerator.java deleted file mode 100755 index 9d6d8d9722..0000000000 --- a/icu4j/src/com/ibm/tools/compression/CompressionTableGenerator.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/compression/Attic/CompressionTableGenerator.java,v $ - * $Date: 2000/03/10 04:17:56 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.compression; - -import com.ibm.text.*; - -/** - * Utility class to generate the tables used by the SCSU interface and - * the UnicodeCompressor class. - * - * @author Stephen F. Booth - * @version 1.0 08 Mar 99 - */ -class CompressionTableGenerator -{ - // duplicate of constants in SCSU - - final static int LATININDEX = 0xF9; - final static int IPAEXTENSIONINDEX = 0xFA; - final static int GREEKINDEX = 0xFB; - final static int ARMENIANINDEX = 0xFC; - final static int HIRAGANAINDEX = 0xFD; - final static int KATAKANAINDEX = 0xFE; - final static int HALFWIDTHKATAKANAINDEX = 0xFF; - - final static int SDEFINEX = 0x0B; - final static int SRESERVED = 0x0C; // reserved value - final static int SQUOTEU = 0x0E; - final static int SCHANGEU = 0x0F; - - final static int SQUOTE0 = 0x01; - final static int SQUOTE1 = 0x02; - final static int SQUOTE2 = 0x03; - final static int SQUOTE3 = 0x04; - final static int SQUOTE4 = 0x05; - final static int SQUOTE5 = 0x06; - final static int SQUOTE6 = 0x07; - final static int SQUOTE7 = 0x08; - - final static int SCHANGE0 = 0x10; - final static int SCHANGE1 = 0x11; - final static int SCHANGE2 = 0x12; - final static int SCHANGE3 = 0x13; - final static int SCHANGE4 = 0x14; - final static int SCHANGE5 = 0x15; - final static int SCHANGE6 = 0x16; - final static int SCHANGE7 = 0x17; - - final static int SDEFINE0 = 0x18; - final static int SDEFINE1 = 0x19; - final static int SDEFINE2 = 0x1A; - final static int SDEFINE3 = 0x1B; - final static int SDEFINE4 = 0x1C; - final static int SDEFINE5 = 0x1D; - final static int SDEFINE6 = 0x1E; - final static int SDEFINE7 = 0x1F; - - //========================== - // Unicode mode tags - //========================== - final static int UCHANGE0 = 0xE0; - final static int UCHANGE1 = 0xE1; - final static int UCHANGE2 = 0xE2; - final static int UCHANGE3 = 0xE3; - final static int UCHANGE4 = 0xE4; - final static int UCHANGE5 = 0xE5; - final static int UCHANGE6 = 0xE6; - final static int UCHANGE7 = 0xE7; - - final static int UDEFINE0 = 0xE8; - final static int UDEFINE1 = 0xE9; - final static int UDEFINE2 = 0xEA; - final static int UDEFINE3 = 0xEB; - final static int UDEFINE4 = 0xEC; - final static int UDEFINE5 = 0xED; - final static int UDEFINE6 = 0xEE; - final static int UDEFINE7 = 0xEF; - - final static int UQUOTEU = 0xF0; - final static int UDEFINEX = 0xF1; - final static int URESERVED = 0xF2; // reserved value - - final static int BLOCKSIZE = 0xFF; - - /** - * Generate the table used as sOffsetTable in SCSU. - * This table contains preformed indices so we can do array lookups - * instead of calculations for speed during decompression. - */ - static void printOffsetTable() - { - int i = 0; - int [] offsetTable = new int [ BLOCKSIZE + 1 ]; - - // 0x00 is reserved - - // half blocks from U+0080 to U+3380 - for( i = 0x01; i < 0x68; i++ ) - offsetTable[i] = i * 0x80; - - // half blocks from U+E000 to U+FF80 - for( i = 0x68; i < 0xA8; i++ ) - offsetTable[i] = (i * 0x80) + 0xAC00; - - // 0xA8..0xF8 is reserved - - offsetTable[ LATININDEX ] = 0x00C0; - offsetTable[ IPAEXTENSIONINDEX ] = 0x0250; - offsetTable[ GREEKINDEX ] = 0x0370; - offsetTable[ ARMENIANINDEX ] = 0x0530; - offsetTable[ HIRAGANAINDEX ] = 0x3040; - offsetTable[ KATAKANAINDEX ] = 0x30A0; - offsetTable[ HALFWIDTHKATAKANAINDEX ] = 0xFF60; - - // dump the generated table - System.out.println("static int [] sOffsetTable = {"); - for(i = 0; i < offsetTable.length - 1; i++) - System.out.print("0x" + Integer.toHexString(offsetTable[i]) - + ", "); - for(i = offsetTable.length - 1; i < offsetTable.length; i++) - System.out.print("0x" + Integer.toHexString(offsetTable[i])); - System.out.println(); - System.out.println("};"); - } - - /** - * Generate the table used as sSingleTagTable in UnicodeCompressor. - * This table contains boolean values indicating if a byte is a - * single-byte mode tag. - */ - static void printSingleTagTable() - { - int i = 0; - boolean [] singleTagTable = new boolean [ BLOCKSIZE + 1 ]; - - for( i = 0x00; i <= BLOCKSIZE; i++ ) { - switch( i ) { - - case SQUOTEU: case SCHANGEU: - case SDEFINEX: case SRESERVED: - case SQUOTE0: case SQUOTE1: - case SQUOTE2: case SQUOTE3: - case SQUOTE4: case SQUOTE5: - case SQUOTE6: case SQUOTE7: - case SCHANGE0: case SCHANGE1: - case SCHANGE2: case SCHANGE3: - case SCHANGE4: case SCHANGE5: - case SCHANGE6: case SCHANGE7: - case SDEFINE0: case SDEFINE1: - case SDEFINE2: case SDEFINE3: - case SDEFINE4: case SDEFINE5: - case SDEFINE6: case SDEFINE7: - singleTagTable[i] = true; - break; - - default: - singleTagTable[i] = false; - break; - } - } - - // dump the generated table - System.out.println("private static boolean [] sSingleTagTable = {"); - for(i = 0; i < singleTagTable.length - 1; i++) - System.out.print(singleTagTable[i] + ", "); - for(i = singleTagTable.length - 1; i < singleTagTable.length; i++) - System.out.print(singleTagTable[i]); - System.out.println(); - System.out.println("};"); - } - - - /** - * Generate the table used as sUnicodeTagTable in - * This table contains boolean values indicating if a byte is a - * unicode mode tag. - */ - static void printUnicodeTagTable() - { - int i = 0; - boolean [] unicodeTagTable = new boolean [ BLOCKSIZE + 1 ]; - - for( i = 0x00; i <= BLOCKSIZE; i++ ) { - switch( i ) { - case UQUOTEU: case UDEFINEX: - case URESERVED: - case UCHANGE0: case UCHANGE1: - case UCHANGE2: case UCHANGE3: - case UCHANGE4: case UCHANGE5: - case UCHANGE6: case UCHANGE7: - case UDEFINE0: case UDEFINE1: - case UDEFINE2: case UDEFINE3: - case UDEFINE4: case UDEFINE5: - case UDEFINE6: case UDEFINE7: - unicodeTagTable[i] = true; - break; - - default: - unicodeTagTable[i] = false; - break; - } - } - - // dump the generated table - System.out.println("private static boolean [] sUnicodeTagTable = {"); - for(i = 0; i < unicodeTagTable.length - 1; i++) - System.out.print(unicodeTagTable[i] + ", "); - for(i = unicodeTagTable.length - 1; i < unicodeTagTable.length; i++) - System.out.print(unicodeTagTable[i]); - System.out.println(); - System.out.println("};"); - } - - public static void main(String[] argv) - { - printOffsetTable(); - printSingleTagTable(); - printUnicodeTagTable(); - } -}; diff --git a/icu4j/src/com/ibm/tools/compression/package.html b/icu4j/src/com/ibm/tools/compression/package.html deleted file mode 100755 index 97c7e2bbf7..0000000000 --- a/icu4j/src/com/ibm/tools/compression/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Tool used to rebuild tables used by the Unicode compression classes. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/localeconverter/ArrayEnumeration.java b/icu4j/src/com/ibm/tools/localeconverter/ArrayEnumeration.java deleted file mode 100755 index c3a74c7c95..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/ArrayEnumeration.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/ArrayEnumeration.java,v $ - * $Date: 2002/01/31 01:21:23 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.util.*; - -public final class ArrayEnumeration implements Enumeration { - - public ArrayEnumeration(Object[] array, int start, int limit) { - this.array = array; - position = start; - this.limit = limit; - } - - public ArrayEnumeration(byte[] array, int start, int limit) { - this.array = new Object[array.length]; - for (int i = 0; i < array.length; ++i) { - this.array[i] = new Byte(array[i]); - } - position = start; - this.limit = limit; - } - - public ArrayEnumeration(char[] array, int start, int limit) { - this.array = new Object[array.length]; - for (int i = 0; i < array.length; ++i) { - this.array[i] = new Character(array[i]); - } - position = start; - this.limit = limit; - } - - public ArrayEnumeration(short[] array, int start, int limit) { - this.array = new Object[array.length]; - for (int i = 0; i < array.length; ++i) { - this.array[i] = new Short(array[i]); - } - position = start; - this.limit = limit; - } - - public ArrayEnumeration(int[] array, int start, int limit) { - this.array = new Object[array.length]; - for (int i = 0; i < array.length; ++i) { - this.array[i] = new Integer(array[i]); - } - position = start; - this.limit = limit; - } - - public ArrayEnumeration(float[] array, int start, int limit) { - this.array = new Object[array.length]; - for (int i = 0; i < array.length; ++i) { - this.array[i] = new Float(array[i]); - } - position = start; - this.limit = limit; - } - - public ArrayEnumeration(double[] array, int start, int limit) { - this.array = new Object[array.length]; - for (int i = 0; i < array.length; ++i) { - this.array[i] = new Double(array[i]); - } - position = start; - this.limit = limit; - } - - public boolean hasMoreElements() { - return position < limit; - } - - public Object nextElement() { - if (position < limit) - return array[position++]; - else - throw new java.util.NoSuchElementException(); - } - // privates - private Object[] array; - private int position = 0; - private int limit = 0; -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/localeconverter/CollationItem.java b/icu4j/src/com/ibm/tools/localeconverter/CollationItem.java deleted file mode 100755 index cd74a87b37..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/CollationItem.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/CollationItem.java,v $ - * $Date: 2002/01/31 01:21:23 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -/** - * A CollationItem represents a single entry in a collation sequence. - */ -public class CollationItem { - private static final char[] OP_CHARS = {'=', '<', ';', ',', '&' }; - private static final char[] SPECIAL_CHARS = { '&', '@' , '=', '<', ';', ',' }; - public static final int NONE = 0; - public static final int PRIMARY = 1; - public static final int SECONDARY = 2; - public static final int TERTIARY = 3; - private static final int FIRST = 4; - public int op; - public String item; - public String expansion; - public String comment; - - public static final CollationItem FORWARD = new CollationItem(NONE, "") { - public String toString() { return ""; } - }; - public static final CollationItem BACKWARD = new CollationItem(NONE, "") { - public String toString() { return "@"; } - }; - - public CollationItem(String item) { - this.op = FIRST; - this.item = cleanString(item); - this.expansion = ""; - } - - public CollationItem(int op, String item) { - this(op, item, null); - } - - public CollationItem(int op, String item, String expansion) { - this.op = Math.abs(op); - if (this.op > TERTIARY) this.op = TERTIARY; - this.item = cleanString(item); - this.expansion = cleanString(expansion); - } - - public void setComment(String comment) { - this.comment = comment; - } - - public String toString() { - String itemString = item; - if (expansion.length() == 0) { - return ""+OP_CHARS[op]+item; - } else { - return "&"+expansion+OP_CHARS[op]+item; - } - } - - private String cleanString(String source) { - if (source == null) return ""; - String result = source; - for (int i = 0; i < result.length(); i++) { - final char c = result.charAt(i); - if ((c == '@') || (c == '\t') || (c == '\n') - || (c == '\f') || (c =='\r') || (c == '\013') - || ((c <= '\u002F') && (c >= '\u0020')) - || ((c <= '\u003F') && (c >= '\u003A')) - || ((c <= '\u0060') && (c >= '\u005B')) - || ((c <= '\u007E') && (c >= '\u007B'))) { - if (i < result.length()-1) { - result = result.substring(0, i) - + "'" + c +"'" - + result.substring(i+1); - } else { - result = result.substring(0, i) - + "'" + c +"'"; - } - i += 2; //skip the two characters we inserted - } - } - return result; - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/localeconverter/Comparable.java b/icu4j/src/com/ibm/tools/localeconverter/Comparable.java deleted file mode 100755 index 7791f48fd3..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/Comparable.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/Comparable.java,v $ - * $Date: 2002/01/31 01:21:24 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -public interface Comparable { - /** - returns 0 if objects are equal, -1 if a is less than b, 1 otherwise. - */ - public int compareTo(Object b); -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/localeconverter/Comparator.java b/icu4j/src/com/ibm/tools/localeconverter/Comparator.java deleted file mode 100755 index a0013de7b6..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/Comparator.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/Comparator.java,v $ - * $Date: 2002/01/31 01:21:27 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -public interface Comparator { - /** - returns 0 if objects are equal, -1 if a is less than b, 1 otherwise. - */ - public int compare(Object a, Object b); -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/ComplexTransition.java b/icu4j/src/com/ibm/tools/localeconverter/ComplexTransition.java deleted file mode 100755 index 5918c27c6c..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/ComplexTransition.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/ComplexTransition.java,v $ - * $Date: 2002/01/31 01:21:27 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -/** - * A ComplexTransition is conceptually a single transition that - * consumes multiple input characters. - */ -public abstract class ComplexTransition implements Lex.Transition { - //the value that is returned by subclasses indicating that - //the transition was successfull. This value is then - //discarded and the value passed to the constructor - //is then returned to the caller. - protected static final int SUCCESS = Lex.END_OF_FILE - 1; - private int success; //value to return if successfull - private Lex parser; //the parser used for this transition - - public ComplexTransition(int success) { - this.success = success; - this.parser = new Lex(null); - //this.parser.debug(true); - } - - public int doAction(int c, PushbackReader input, StringBuffer buffer) throws IOException { - input.unread(c); - parser.setStates(getStates()); - parser.setInput(input); - try { - int s = parser.nextToken(); - handleSuccess(parser, buffer); - return success; - } catch (IOException e) { - handleFailure(parser, buffer); - throw e; - } - } - - //called after a successful parse - protected void handleSuccess(Lex parser, StringBuffer output) throws IOException { - parser.appendDataTo(output); - } - - //called after a failed parse - protected void handleFailure(Lex parser, StringBuffer output) { - } - - //subclasses should return the states to use to parse this - //transition - protected abstract Lex.Transition[][] getStates(); - - public ComplexTransition debug(boolean debug) { - parser.debug(debug); - return this; - } - - public ComplexTransition debug(boolean debug, String tag) { - parser.debug(debug, tag); - return this; - } -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/ConvertAllJavaLocales.java b/icu4j/src/com/ibm/tools/localeconverter/ConvertAllJavaLocales.java deleted file mode 100755 index 6f95503228..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/ConvertAllJavaLocales.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -/** - -The ConvertJavaLocale application converts java locales to -Java and ICU Locale files. It's usage is as follows - - ConvertJavaLocale [-11] [-12] [-icu] locale... - -Usage - --11 - If this option is specified, data is output in - Java 1.1.x locale format. - --12 - If this option is specified, data is output in - Java 1.2.x locale format. If an output format - is not specified, -12 is the default. - --icu - If this option is specified, data is output in - ICU locale format. - -locale - The locale to convert - - -*/ -import java.lang.reflect.*; -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/ConvertAllJavaLocales.java,v $ - * $Date: 2002/01/31 01:21:28 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -public class ConvertAllJavaLocales { - public static void main(String args[]) { - try { - new ConvertAllJavaLocales(args); - } catch (Throwable t) { - System.err.println("Unknown error: "+t); - } - } - - public ConvertAllJavaLocales(String argsIn[]) { - try { - String packageName = argsIn[0]; - System.out.println("This is the packagename : "+packageName); - String classname = packageName+".Locale"; - //classname.concat(); - System.out.println("This is the classname : "+classname); - /* Class cl = Class.forName(classname); - Class[] paramList=null; - Method gvl = cl.getMethod("getAvailableLocales", paramList); - Object[] params = new Object[]{""}; - gvl.invoke(null,params);*/ - final Locale[] locales = java.util.Locale.getAvailableLocales();//(Locale[])gvl.invoke(null,params);; - - for (int i = 0; i < locales.length; i++) { - final String localeName = locales[i].toString(); - final String[] args = {"-package",packageName,"-icu", localeName}; - - System.out.println("Converting "+localeName); - - final FileOutputStream outFile = new FileOutputStream("ICULocale_"+localeName); - final PrintStream out = new PrintStream(outFile, true); - - new ConvertJavaLocale(args, out); - - out.close(); - } - } catch (IOException e) { - System.err.println("Unexpected IO error"); - }catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/ConvertJavaLocale.java b/icu4j/src/com/ibm/tools/localeconverter/ConvertJavaLocale.java deleted file mode 100755 index 81a88a66f5..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/ConvertJavaLocale.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/ConvertJavaLocale.java,v $ - * $Date: 2002/01/31 01:21:29 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -/** - -The ConvertJavaLocale application converts java locales to -Java and ICU Locale files. It's usage is as follows - - ConvertJavaLocale [-11] [-12] [-icu] locale... - -Usage - --11 - If this option is specified, data is output in - Java 1.1.x locale format. - --12 - If this option is specified, data is output in - Java 1.2.x locale format. If an output format - is not specified, -12 is the default. - --icu - If this option is specified, data is output in - ICU locale format. - -locale - The locale to convert - - -*/ - -public class ConvertJavaLocale { - private static final byte OPT_11 = (byte)0x01; - private static final byte OPT_12 = (byte)0x02; - private static final byte OPT_ICU = (byte)0x04; - private static final byte OPT_PACKAGE = (byte)0x08; - private static final byte OPT_UNKNOWN = (byte)0x80; - private static final String USER_OPTIONS[] = { - "-11", - "-12", - "-icu", - "-package" - }; - - private static final String[] tags = { - "LocaleString", - "LocaleID", - "ShortLanguage", - "ShortCountry", - "Languages", - "Countries", - "MonthNames", - "MonthAbbreviations", - "DayNames", - "DayAbbreviations", - "AmPmMarkers", - "Eras", - "NumberPatterns", - "NumberElements", - "CurrencyElements", - "DateTimePatterns", - "DateTimeElements", - "CollationElements", - "zoneStrings", - "localPatternChars", - }; - - - - public static void main(String args[]) { - try { - new ConvertJavaLocale(args, System.out); - } catch (Throwable t) { - System.err.println("Unknown error: "+t); - } - } - - public ConvertJavaLocale(String args[], PrintStream out) { - process(args, out); - } - - public void process(String args[], PrintStream out) { - short options = identifyOptions(args); - if ((args.length < 1) || ((options & OPT_UNKNOWN) != 0)) { - printUsage(); - } else { - String localeName = null; - String packagename = null; - for (int i = 0; i < args.length; i++) { - final String thisArg = args[i]; - if(args[i].equalsIgnoreCase("-package")){ - i++; - packagename = args[i]; - }else if(args[i].equalsIgnoreCase("-icu")){ - }else if (!args[i].startsWith("-")) { - localeName = args[i]; - } - } - final Hashtable data = new Hashtable(); - final String localeElements = packagename+".LocaleElements" + - (String)((localeName != null) ? "_"+localeName : ""); - final String DateFormatZoneData = packagename+".DateFormatZoneData" + - (String)((localeName != null) ? "_"+localeName : ""); - addLocaleData(localeElements, data); - addLocaleData(DateFormatZoneData, data); - final Locale locale = localeFromString(localeName); - if ((options & OPT_11) != 0) { - new Java1LocaleWriter(out, System.err).write(locale, data); - } - if ((options & OPT_12) != 0) { - new JavaLocaleWriter(out, System.err).write(locale, data); - } - if ((options & OPT_ICU) != 0) { - new ICULocaleWriter(out, System.err).write(locale, data); - } - } - } - - private void addLocaleData(final String bundleClassName, final Hashtable data) { - try { - final Class bundleClass = Class.forName(bundleClassName); - final ResourceBundle bundle = (ResourceBundle)bundleClass.newInstance(); - for (int i = 0; i < tags.length; i++) { - try { - final Object resource = bundle.getObject(tags[i]); - data.put(tags[i], resource); - } catch (MissingResourceException e) { - } - } - } catch (ClassNotFoundException e) { - System.err.println("Could not find bundle class for bundle: "+bundleClassName); - } catch (InstantiationException e) { - System.err.println("Could not create bundle instance for bundle: "+bundleClassName); - } catch (IllegalAccessException e) { - System.err.println("Could not create bundle instance for bundle: "+bundleClassName); - } - } - - private void printUsage() { - System.err.println("Usage: ConvertJavaLocale [-11] [-12] [-icu] localeName"); - } - - private short identifyOptions(String[] options) { - short result = 0; - for (int j = 0; j < options.length; j++) { - String option = options[j]; - if (option.startsWith("-")) { - boolean optionRecognized = false; - for (short i = 0; i < USER_OPTIONS.length; i++) { - if (USER_OPTIONS[i].equals(option)) { - result |= (short)(1 << i); - optionRecognized = true; - break; - } - } - if (!optionRecognized) { - result |= OPT_UNKNOWN; - } - } - } - return result; - } - - private Locale localeFromString(final String localeName) { - if (localeName == null) return new Locale("", "", ""); - String language = localeName; - String country = ""; - String variant = ""; - - int ndx = language.indexOf('_'); - if (ndx >= 0) { - country = language.substring(ndx+1); - language = language.substring(0, ndx); - } - ndx = country.indexOf('_'); - if (ndx >= 0) { - variant = country.substring(ndx+1); - country = country.substring(0, ndx); - } - return new Locale(language, country, variant); - } -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/ConvertLocaleTest.java b/icu4j/src/com/ibm/tools/localeconverter/ConvertLocaleTest.java deleted file mode 100755 index 22747f2ca7..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/ConvertLocaleTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/ConvertLocaleTest.java,v $ - * $Date: 2002/01/31 01:21:30 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ - -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; -/* - -ConvertPOSIXLocale [-11] [-12] [-icu] [-icu2] localeDataFile [charMapFile ...] - -*/ - -public class ConvertLocaleTest { - public static void main(String args[]) { -/* - ConvertPOSIXLocale.main( new String[] { - "-12", - "C:\\projects\\com\\taligent\\localeconverter\\collationTest.txt" - } ); - - ConvertPOSIXLocale.main( new String[] { - "-icu", - "C:\\projects\\com\\taligent\\localeconverter\\collationTest2.txt", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\ISO-8859-1", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\mnemonic.ds", - } ); - - ConvertPOSIXLocale.main( new String[] { - "-icu", "-LC_MESSAGES", - "C:\\projects\\com\\taligent\\localeconverter\\Locales\\Vivnx43.ibm", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\ibm1129-2-UniCode.chm", - } ); -/* ConvertPOSIXLocale.main( new String[] { - "-12", - "C:\\projects\\com\\taligent\\localeconverter\\Locales\\POSIXLocales\\en_US", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\ISO-8859-1", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\mnemonic.ds", - }); -/* ConvertPOSIXLocale.main( new String[] { - "-12", - "C:\\projects\\com\\taligent\\localeconverter\\Locales\\POSIXLocales\\fi_FI", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\ISO-8859-1", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\mnemonic.ds", - }); - - ConvertPOSIXLocale.main( new String[] { - "-12", "en_BE", - "C:\\projects\\com\\taligent\\localeconverter\\Locales\\ENBEWIN.IBM", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\Ibm1252.chm", - }); - - ConvertPOSIXLocale.main( new String[] { - "-12", "vi_VN", - "C:\\projects\\com\\taligent\\localeconverter\\Locales\\Vivnx43.ibm", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\ibm1129-2-UniCode.chm", - }); - - ConvertPOSIXLocale.main( new String[] { - "-icu", "fr_FR", - "C:\\projects\\com\\taligent\\localeconverter\\Locales\\POSIXLocales\\fr_FR", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\ISO-8859-1", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\mnemonic.ds", - }); - - ConvertPOSIXLocale.main( new String[] { - "-icu", "fo_FO", - "C:\\projects\\com\\taligent\\localeconverter\\Locales\\POSIXLocales\\fo_FO", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\ISO-8859-1", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\mnemonic.ds", - }); -*/ - ConvertPOSIXLocale.main( new String[] { - "-icu", "fr_LU", - "C:\\projects\\com\\taligent\\localeconverter\\Locales\\POSIXLocales\\fr_LU", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\ISO-8859-1", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\mnemonic.ds", - }); -/* - ConvertPOSIXLocale.main( new String[] { - "-icu", "de_LU", - "C:\\projects\\com\\taligent\\localeconverter\\Locales\\POSIXLocales\\de_LU", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\ISO-8859-1", - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps\\mnemonic.ds", - }); -*/ - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/localeconverter/ConvertPOSIXLocale.java b/icu4j/src/com/ibm/tools/localeconverter/ConvertPOSIXLocale.java deleted file mode 100755 index 27179e41f4..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/ConvertPOSIXLocale.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/ConvertPOSIXLocale.java,v $ - * $Date: 2002/01/31 01:21:31 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ - -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -/** - -The ConvertPOSIXLocale application converts POSIX locale files to -Java and ICU Locale files. It's usage is as follows - - ConvertPOSIXLocale - [-LC_CTYPE] - [-LC_TIME] - [-LC_NUMERIC] - [-LC_MONETARY] - [-LC_MESSAGES] - [-11] - [-12] - [-icu] - [-icu2] - localeName - localeDataFile - [charMapFile ...] - -The application is invoked with options specifying the format(s) of -the locale file(s) to generate as well as the POSIX locale file and -character mapping files. - -Usage - --LC_CTYPE - If the -LC_CTYPE option is specified, the - following items are added to the locale if they - are present in the source: upper, lower, alpha, digit, - space, cntrl, punct, graph, print, xdigit, blank, - toupper, tolower. - --LC_TIME - If the -LC_TIME option is specified, the following - items will be included if they are present in the POSIX source: - abday, day, abmon, mon, d_t_fmt, d_ftm, t_fmt, am_pm, - t_fmt_ampm, era, era_year, era_d_fmt, alt_digits. - --LC_NUMERIC - If the -LC_NUMERIC option is specified, the following - items will be included if they are present in the source: - decimal_point, thousands_sep, grouping - --LC_MONETARY - If the -LC_MONETARY option is specified, the following - items will be included if they are present in the source: - int_curr_symbol, currency_symbol, mon_decimal_point, - mon_thousands_sep, mon_grouping, positive_sign, - negative_sign, int_frac_digits, frac_digits, p_cs_precedes, - p_sep_by_space, n_cs_precedes, n_sep_by_space, p_sign_posn. - --LC_MESSAGES - If the -LC_MESSAGES option is specified, the - following items are added to the locale if they - are present in the source: yesexpr, noexpr - --11 - If this option is specified, data is output in - Java 1.1.x locale format. - --12 - If this option is specified, data is output in - Java 1.2.x locale format. If an output format - is not specified, -12 is the default. - --icu - If this option is specified, data is output in - ICU locale format. - -localeName - The name of the locale in the localeDataFile. Ex. en_US. - -localeDataFile - The localeDataFile path is required and specifies the path - to the locale data file. If a "copy" directive is encountered - while processing the localeDataFile, ConvertPOSIXLocale will look - in the same directory as the localeDataFile for additional - POSIX locale data files. Files must be in the POSIX format - specified in ISO/IEC 9945- with exceptions noted below. Exactly - one localeDataFile must be specified. - -charMapFile - Zero or more character mapping files may be specified. charMapFiles are used - to map symbols in the localeDataFile to Unicode values. They are processed - as follows. ConvertPOSIXLocale searchs for a line containing only the - word "CHARMAP" and reads symbol mappings until it reaches a line - containing only the words "END CHARMAP". Symbol mappings have - the form " " where "" is any symbol valid - in a localeDataFile and "hhhh" is four hexidecimal digits representing - the Unicode value for that symbol. Surrogate pairs are not supported - in charMapFiles. An example charMapFile might contain the following: - - CHARMAP - - - - END CHARMAP - - specifying that the symbol should be replaced by - the Unicode value of 0x0002 wherever it occurs. - - When multiple charMapFiles are specified, mappings in files listed - later take precedence over earlier ones. - - -Conversion to ICU and Java: - -CollationElements - Converted from the LC_COLLATE section. The "..." directive is ignored. - The "replace-after" directive is ignored. - -CurrencyElements - element 0 is set to currency_symbol - element 1 is set to int_curr_symbol - element 2 is set to mon_decimal_point - All other elements default. - -NumberElements - element 0 is set to decimal_point - element 1 is set to thousands_sep - -MonthNames is set to mon - -MonthAbbreviations is set to abmon - -DayNames is set to day - -DayAbbreviations is set to abday - -AmPmMarkers is set to am_pm - -DateTimePatterns - elements 0 through 3 are set to t_fmt_ampm with the patterns converted - elements 4 through 7 are set to d_fmt with the patterns converted - - -Adition POSIX data may be included in the Locale as follows: - -LC_TYPE - This section is ignored unless the -LC_CTYPE option is - specified. If the -LC_CTYPE option is specified, the - following items are added to the locale if they - are present in the source: upper, lower, alpha, digit, - space, cntrl, punct, graph, print, xdigit, blank, - toupper, tolower. - -LC_MESSAGES - -LC_MONETARY - -LC_NUMERIC - -LC_TIME - If the -LC_TIME option is specified, the following - items will be included if they are present in the source: - abday, day, abmon, mon, d_t_fmt, d_ftm, t_fmt, am_pm, - t_fmt_ampm, era, era_year, era_d_fmt, alt_digits. - -LC_COLLATE - Converted to CollationElements in the resource file. - - -*/ - -public class ConvertPOSIXLocale { - private static final short OPT_LC_CTYPE = 0x001; - private static final short OPT_LC_TIME = 0x002; - private static final short OPT_LC_NUMERIC = 0x004; - private static final short OPT_LC_MONETARY = 0x008; - private static final short OPT_LC_MESSAGES = 0x010; - private static final short OPT_11 = 0x020; - private static final short OPT_12 = 0x040; - private static final short OPT_ICU = 0x080; - private static final short OPT_ICU2 = 0x100; - private static final short OPT_RAW = 0x200; - private static final short OPT_UNKNOWN = 0x4000; - private static final String USER_OPTIONS[] = { - "-LC_CTYPE", - "-LC_TIME", - "-LC_NUMERIC", - "-LC_MONETARY", - "-LC_MESSAGES", - "-11", - "-12", - "-icu", - "-icu2", - "-RAW", - "-enc", - }; - private static final short OPT_CONVERT = (short)(OPT_LC_CTYPE | OPT_LC_TIME - | OPT_LC_NUMERIC | OPT_LC_MONETARY | OPT_LC_MESSAGES); - - private Hashtable data; - - public static void main(String args[]) { - try { - new ConvertPOSIXLocale(args); - } catch (Throwable t) { - t.printStackTrace(); - System.err.println("Unknown error: "+t); - } - } - - public ConvertPOSIXLocale(String args[]) { - process(args); - //{{INIT_CONTROLS - //}} -} - - public void process(String args[]) { - short options = identifyOptions(args); - String enc=""; - if ((args.length < 2) || ((options & OPT_UNKNOWN) != 0)) { - printUsage(); - } else { - Vector mapFiles = new Vector(); - Locale locale = null; - String fileName = null; - for (int i = 0; i < args.length; i++) { - final String thisArg = args[i]; - if (thisArg.startsWith("-")) { - if(thisArg.startsWith("-enc")){ - enc = args[++i]; - } - } else if (locale == null) { - locale = localeFromString(thisArg); - } else if (fileName == null) { - fileName = thisArg; - } else { - mapFiles.addElement(thisArg); - } - - } - if ((fileName == null) || (locale == null) || (options == 0)) { - printUsage(); - } else { - PosixCharMap map = new PosixCharMap(); - Enumeration enum = mapFiles.elements(); - while (enum.hasMoreElements()) { - String mapFile = (String)enum.nextElement(); - System.err.println("Locale: "+locale); - System.err.println("Loading character map file: "+mapFile); - try { - map.load(new File(mapFile),enc); - } catch (IOException e) { - System.err.println("Error loading map file: "+mapFile+" "+e); - System.err.println("File skipped"); - } - } - SymbolTransition.setCharMap(map); - File dataFile = new File(fileName); - System.err.println("Locale directory: "+dataFile.getParent()); - POSIXLocaleReader reader = new POSIXLocaleReader(dataFile.getParent(), locale); - System.err.println("Parsing file: "+dataFile.getName()); - try { - data = reader.parse(dataFile.getName(), (byte)(options & OPT_CONVERT)); - System.err.println("Converting...."); - if ((options & OPT_11) != 0) { - new Java1LocaleWriter(System.out, System.err).write(locale, data); - } - if ((options & OPT_12) != 0) { - new JavaLocaleWriter(System.out, System.err).write(locale, data); - } - if ((options & OPT_ICU) != 0) { - new ICULocaleWriter(System.out, System.err).write(locale, data); - } - if ((options & OPT_ICU2) != 0) { - new ICU2LocaleWriter(System.out, System.err).write(locale, data); - } - if ((options & OPT_RAW) != 0) { - new ICULocaleWriter(System.out, System.err).write(locale, data); - } - } catch (IOException e) { - System.err.println(e); - } - } - } - } - - private void printUsage() { - System.err.println("Usage: ConvertPOSIXLocale [-LC_CTYPE] [-LC_TIME]"+ - " [-LC_NUMERIC] [-LC_MONETARY] [-LC_MESSAGES] [-11] [-12] [-icu]"+ - " localeName localeDataFile [charMapFile ...]"); - } - - private short identifyOptions(String[] options) { - short result = 0; - for (int j = 0; j < options.length; j++) { - String option = options[j]; - if (option.startsWith("-")) { - boolean optionRecognized = false; - for (short i = 0; i < USER_OPTIONS.length; i++) { - if (USER_OPTIONS[i].equals(option)) { - result |= (short)(1 << i); - optionRecognized = true; - break; - } - } - if (!optionRecognized) { - result |= OPT_UNKNOWN; - } - } - } - return result; - } - - private Locale localeFromString(final String localeName) { - String language = localeName; - String country = ""; - String variant = ""; - - int ndx = language.indexOf('_'); - if (ndx >= 0) { - country = language.substring(ndx+1); - language = language.substring(0, ndx); - } - ndx = country.indexOf('_'); - if (ndx >= 0) { - variant = country.substring(ndx+1); - country = country.substring(0, ndx); - } - ndx = country.indexOf('@'); - if(ndx>0){ - variant = country.substring(ndx+1); - country = country.substring(0,ndx); - } - return new Locale(language, country, variant); - } - //{{DECLARE_CONTROLS - //}} -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/EOLTransition.java b/icu4j/src/com/ibm/tools/localeconverter/EOLTransition.java deleted file mode 100755 index 953325db99..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/EOLTransition.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/EOLTransition.java,v $ - * $Date: 2002/01/31 03:24:29 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ - -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -/** - * This transition parses an end-of-line sequence. The comment character - * can be set to an arbitrary character, but it is shared globally. - * A comment may only occur after an end-of-line. - * EOL := | [ ]* - * EOL_SEGMENT := | | - * SPACE_CHARS := " \t"; - * EOL_CHARS = "\r\n\u2028\u2029"; - * COMMENT_STRING := - * COMMENT_CHAR = "#"; - * COMMENT_BODY = [ ~ & ~ ]* - */ -public class EOLTransition extends ComplexTransition { - public static final String EOL_CHARS = "\f\r\n\u2028\u2029"; - public static final char DEFAULT_COMMENT_CHAR = '#'; - public static char COMMENT_CHAR = DEFAULT_COMMENT_CHAR; - public static final EOLTransition GLOBAL = new EOLTransition(SUCCESS); - - /** Restore the comment character to the default value */ - public static synchronized char setDefaultCommentChar() { - return setCommentChar(DEFAULT_COMMENT_CHAR); - } - - /** Set a new comment character */ - public static synchronized char setCommentChar(char c) { - char result = COMMENT_CHAR; - COMMENT_CHAR = c; - states = null; //flush states - return result; - } - - public EOLTransition(int success) { - super(success); - //{{INIT_CONTROLS - //}} -} - public boolean accepts(int c) { - return EOL_CHARS.indexOf((char)c) >= 0; - } - protected Lex.Transition[][] getStates() { - synchronized (getClass()) { - if (states == null) { - //cache the states so they can be shared. This states - //need to be flushed and rebuilt when the comment - //character changes. - states = new Lex.Transition[][] { - { //state 0: - new Lex.StringTransition(EOL_CHARS, Lex.IGNORE_CONSUME, -1), - new Lex.EOFTransition(SUCCESS), - new Lex.ParseExceptionTransition("bad characters in EOL") - }, - { //state 1: - new Lex.CharTransition(COMMENT_CHAR, Lex.IGNORE_CONSUME, -2), - new Lex.StringTransition(EOL_CHARS, Lex.IGNORE_CONSUME, -1), - new Lex.StringTransition(SpaceTransition.SPACE_CHARS, Lex.IGNORE_CONSUME, -1), - new Lex.EOFTransition(SUCCESS), - new Lex.DefaultTransition(Lex.IGNORE_PUTBACK, SUCCESS) - }, - { //state 2: - new Lex.StringTransition(EOL_CHARS, Lex.IGNORE_CONSUME, -1), - new Lex.EOFTransition(SUCCESS), - new Lex.DefaultTransition(Lex.IGNORE_CONSUME, -2) - } - }; - } - } - return states; - } - private static Lex.Transition[][] states; - - public static void main(String args[]) { - try { - Lex.Transition[][] states = {{ - new EOLTransition(SUCCESS).debug(true), - new Lex.EOFTransition(), - new Lex.ParseExceptionTransition("bad test input") - }}; - String text = "\n\r\n# Hello World\n\r\n\n\n\r\r\n#hello kdsj\n"; - StringReader sr = new StringReader(text); - PushbackReader pr = new PushbackReader(sr); - Lex parser = new Lex(states, pr); - parser.debug(true); - //parser.debug(true); - int s = parser.nextToken(); - while (s == SUCCESS) { - //System.out.println(parser.getData()); - s = parser.nextToken(); - } - } catch (Exception e) { - System.out.println(e); - } - } - //{{DECLARE_CONTROLS - //}} -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/EscapeTransition.java b/icu4j/src/com/ibm/tools/localeconverter/EscapeTransition.java deleted file mode 100755 index e288883a1a..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/EscapeTransition.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/EscapeTransition.java,v $ - * $Date: 2002/01/31 01:21:32 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; -import java.io.*; -import java.util.*; - -/** - * An escape transition parses a POSIX escape sequence. An escape - * sequence can be a hex, octal, or decimal constant, or an escaped - * character. The resultant value is ALWAYS on byte long. Longer - * escaped values (ie.\xFF63) overflow and are truncated. An escape - * character followed by an EOL sequence is silently eaten. - */ -public class EscapeTransition extends ComplexTransition { - public static final EscapeTransition GLOBAL = new EscapeTransition(SUCCESS); - - public static final char DEFAULT_ESCAPE_CHAR = '\\'; - public static char ESCAPE_CHAR = DEFAULT_ESCAPE_CHAR; - - private static final int DECIMAL = 1; //decimal escape sequence was parsed - private static final int OCTAL = 2; //octal escape sequence was parsed - private static final int HEX = 3; //hex escape sequence was parsed - private static final int ESCAPE = 4; //character escape sequence was parsed - private static final int EOL = 5; //an escape character followed by EOF eaten - - private static final String OCTAL_CHARS = "01234567"; - private static final String DECIMAL_CHARS = "0123456789"; - private static final String HEX_CHARS = "0123456789abcdefABCDEF"; - - /** Set the escape character to the default */ - public static synchronized char setDefaultEscapeChar() { - return setEscapeChar(DEFAULT_ESCAPE_CHAR); - } - - /** Set the escape character */ - public static synchronized char setEscapeChar(char c) { - char result = ESCAPE_CHAR; - ESCAPE_CHAR = c; - theStates = null; - return result; - } - - public EscapeTransition(int success) { - super(success); - //{{INIT_CONTROLS - //}} -} - - public boolean accepts(int c) { - return ESCAPE_CHAR == (char)c; - } - - /** Convert the accepted text into the appropriate unicode character */ - protected void handleSuccess(Lex parser, StringBuffer output) throws IOException { - switch (parser.getState()) { - case DECIMAL: - output.append((char)parser.dataAsNumber(10)); - break; - case OCTAL: - output.append((char)parser.dataAsNumber(8)); - break; - case HEX: - output.append((char)parser.dataAsNumber(16)); - break; - case ESCAPE: - parser.appendDataTo(output); - break; - case EOL: - //silently eat the EOL characters - break; - default: - //should never get here - throw new Lex.ParseException("Internal error parsing escape sequence"); -// parser.appendDataTo(output); - } - } - /** return the states for this transaction */ - protected Lex.Transition[][] getStates() { - synchronized (getClass()) { - if (theStates == null) { - //cache the states so they can be shared. They must - //be rebuilt when the escape character is changed. - theStates = new Lex.Transition[][] { - { //state 0: - new Lex.CharTransition(ESCAPE_CHAR, Lex.IGNORE_CONSUME, -1), - new Lex.ParseExceptionTransition("illegal escape character") - }, - { //state 1: - new Lex.EOFTransition(OCTAL), - new Lex.CharTransition('d', Lex.IGNORE_CONSUME, -3), - new Lex.CharTransition('x', Lex.IGNORE_CONSUME, -2), - new Lex.StringTransition(OCTAL_CHARS, Lex.ACCUMULATE_CONSUME, -4), - new Lex.CharTransition(ESCAPE_CHAR, Lex.ACCUMULATE_CONSUME, ESCAPE), - new EOLTransition(EOL), - new Lex.DefaultTransition(Lex.ACCUMULATE_CONSUME, ESCAPE) - }, - { //state 2: hex - new Lex.EOFTransition(HEX), - new Lex.StringTransition(HEX_CHARS, Lex.ACCUMULATE_CONSUME, -2), - new Lex.DefaultTransition(Lex.IGNORE_PUTBACK, HEX) - }, - { //state 3: decimal - new Lex.EOFTransition(DECIMAL), - new Lex.StringTransition(DECIMAL_CHARS, Lex.ACCUMULATE_CONSUME, -3), - new Lex.DefaultTransition(Lex.IGNORE_PUTBACK, DECIMAL) - }, - { //state 4: octal - new Lex.EOFTransition(OCTAL), - new Lex.StringTransition(OCTAL_CHARS, Lex.ACCUMULATE_CONSUME, -4), - new Lex.DefaultTransition(Lex.IGNORE_PUTBACK, OCTAL) - }, - }; - } - } - return theStates; - } - private static Lex.Transition[][] theStates = null; - - public static void main(String args[]) { - try { - Lex.Transition[][] states = {{ - new EscapeTransition(SUCCESS), - new Lex.EOFTransition(), - new Lex.ParseExceptionTransition("bad test input") - }}; - String text = "\\d100\\xAf\\\\\\777\\\n\\123\\x2028\\x2029"; - StringReader sr = new StringReader(text); - PushbackReader pr = new PushbackReader(sr); - Lex parser = new Lex(states, pr); - //parser.debug(true); - int s = parser.nextToken(); - while (s == SUCCESS) { - System.out.println(parser.getState()); - s = parser.nextToken(); - } - } catch (Exception e) { - System.out.println(e); - } - } - //{{DECLARE_CONTROLS - //}} -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/ICU2LocaleWriter.java b/icu4j/src/com/ibm/tools/localeconverter/ICU2LocaleWriter.java deleted file mode 100755 index 8f8126f33b..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/ICU2LocaleWriter.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/ICU2LocaleWriter.java,v $ - * $Date: 2002/01/31 01:21:32 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ - -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -public class ICU2LocaleWriter extends LocaleWriter { - public ICU2LocaleWriter(PrintStream out) { - super(out); - //{{INIT_CONTROLS - //}} -} - public ICU2LocaleWriter(PrintStream out, PrintStream err) { - super(out, err); - } - protected void open(Locale locale) { - print(locale.toString()); - println(" {"); - indent(); - } - protected void write(String tag, String value) { - print(tag); - print(" { "); - printString(value); - println(" }"); - } - protected void write(String tag, String[] value) { - if (tag != null) { - print(tag); - println(" { "); - } else { - println("{"); - } - indent(); - for (int i = 0; i < value.length; i++) { - printString(value[i]); - println(","); - } - outdent(); - println("}"); - } - protected void write(String tag, Object o) { - if ("CollationElements".equals(tag)) { - writeTagged(tag,(Object[][])o); - } else if (!(o instanceof CollationItem[])) { - super.write(tag, o); - } else { - CollationItem[] items = (CollationItem[])o; - print("CollationElements"); - println(" { "); - for (int i = 0; i < items.length; i++) { - if(items[i]!=null){ - printString(items[i].toString()); - if (items[i].comment != null) { - tabTo(30); - print("//"); - println(items[i].comment); - } - } - } - } - } - protected void writeTagged(String tag, Object[][] value) { - print(tag); - println(" { "); - indent(); - for (int i = 0; i < value.length; i++) { - write((String)value[i][0], value[i][1]); - } - outdent(); - println("}"); - } - protected void write2D(String tag, String[][] value) { - print(tag); - println(" { "); - indent(); - for (int i = 0; i < value.length; i++) { - write(null, value[i]); - } - outdent(); - println("}"); - } - protected void writeTagged(String tag, String[][] value) { - print(tag); - println(" { "); - indent(); - for (int i = 0; i < value.length; i++) { - write(value[i][0], value[i][1]); - } - outdent(); - println("}"); - } - protected void close() { - outdent(); - println("}"); - } - - protected String getStringJoiningCharacter() { - return ""; - } - - protected boolean isEscapeChar(final char c) { - return true; - } - protected String getEscapeChar() { - return "%u"; - } - //{{DECLARE_CONTROLS - //}} -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/localeconverter/ICULocaleWriter.java b/icu4j/src/com/ibm/tools/localeconverter/ICULocaleWriter.java deleted file mode 100755 index d40cdb88e0..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/ICULocaleWriter.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/ICULocaleWriter.java,v $ - * $Date: 2002/01/31 01:21:32 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -public class ICULocaleWriter extends LocaleWriter { - public ICULocaleWriter(PrintStream out) { - super(out); - } - public ICULocaleWriter(PrintStream out, PrintStream err) { - super(out, err); - } - protected void open(Locale locale) { - print(locale.toString()); - println(" {"); - indent(); - } - protected void write(String tag, Object o) { - if ("CollationElements".equals(tag)) { - if(o instanceof Object[][]){ - writeTagged(tag,(Object[][])o); - }else{ - write(tag,(String)o); - } - } else if (!(o instanceof CollationItem[])) { - super.write(tag, o); - } else { - CollationItem[] items = (CollationItem[])o; - print("CollationElements"); - println(" { "); - for (int i = 0; i < items.length; i++) { - if(items[i]!=null){ - printString(items[i].toString()); - if (items[i].comment != null) { - tabTo(30); - print("//"); - println(items[i].comment); - } - } - } - } - } - protected void write(String tag, String value) { - print(tag); - print(" { "); - printString(value); - println(" }"); - } - protected void write(String tag, String[] value) { - if (tag != null) { - print(tag); - println(" { "); - } else { - println("{"); - } - indent(); - for (int i = 0; i < value.length; i++) { - printString(value[i]); - println(","); - } - outdent(); - println("}"); - } - protected void write2D(String tag, String[][] value) { - print(tag); - println(" { "); - indent(); - for (int i = 0; i < value.length; i++) { - write(null, value[i]); - } - outdent(); - println("}"); - } - protected void writeTagged(String tag, Object[][] value) { - print(tag); - println(" { "); - indent(); - for (int i = 0; i < value.length; i++) { - write((String)value[i][0], value[i][1]); - } - outdent(); - println("}"); - } - protected void writeTagged(String tag, String[][] value) { - print(tag); - println(" { "); - indent(); - for (int i = 0; i < value.length; i++) { - write(value[i][0], value[i][1]); - } - outdent(); - println("}"); - } - protected void close() { - outdent(); - println("}"); - super.closeFileHandle(); - } - - protected String getStringJoiningCharacter() { - return ""; - } -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/Java1LocaleWriter.java b/icu4j/src/com/ibm/tools/localeconverter/Java1LocaleWriter.java deleted file mode 100755 index f456b3f245..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/Java1LocaleWriter.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/Java1LocaleWriter.java,v $ - * $Date: 2002/01/31 01:21:32 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -public class Java1LocaleWriter extends LocaleWriter { - public Java1LocaleWriter(PrintStream out) { - super(out); - //{{INIT_CONTROLS - //}} - } - - public Java1LocaleWriter(PrintStream out, PrintStream err) { - super(out, err); - } - - public void write(Locale locale, Hashtable localeData) { - try { - Hashtable temp = new NeutralToJ1Converter(locale).convert(localeData); - super.write(locale, temp); - } catch (LocaleConverter.ConversionError e) { - err.println(e); - } - } - - protected void open(Locale locale) { - print(HEADER1); - print(locale.toString()); - print(HEADER2); - print(locale.toString()); - println(HEADER3); - indent(3); - } - protected void write(String tag, String value) { - print("{ "); - printString(tag); - print(", "); - printString(value); - println(" },"); - } - protected void write(String tag, String[] value) { - print("{ "); - if (tag != null) { - printString(tag); - println(","); - } else { - println(""); - } - indent(); - println("new String[] {"); - indent(); - for (int i = 0; i < value.length; i++) { - printString(value[i]); - println(","); - } - outdent(); - println("}"); - outdent(); - println("},"); - } - protected void write2D(String tag, String[][] value) { - print("{ "); - printString(tag); - println(","); - indent(); - println("new String[][] {"); - indent(); - for (int i = 0; i < value.length; i++) { - println("{"); - indent(); - for (int j = 0; j < value[i].length; j++) { - printString(value[i][j]); - println(","); - } - outdent(); - println("},"); - } - outdent(); - println("}"); - outdent(); - println("},"); - } - protected void writeTagged(String tag, String[][] value) { - print("{ "); - printString(tag); - println(","); - indent(); - println("new String[][] {"); - indent(); - for (int i = 0; i < value.length; i++) { - write(value[i][0], value[i][1]); - } - outdent(); - println("}"); - outdent(); - println("},"); - } - protected void close() { - outdent(3); - print(FOOTER); - } - - protected void appendEscapedChar(char c, StringBuffer buffer) { - if (c < '\u0020' || c == '"' || c == '\\') { - buffer.append('\\'); - buffer.append(HEX_DIGIT[(c & 0700) >> 6]); // HEX_DIGIT works for octal - buffer.append(HEX_DIGIT[(c & 0070) >> 3]); - buffer.append(HEX_DIGIT[(c & 0007)]); - } else { - super.appendEscapedChar(c, buffer); - } - } - - protected String getStringJoiningCharacter() { - return "+"; - } - - private static final String HEADER1 = - "package java.text.resources;\n"+ - "public class LocaleElements_"; - private static final String HEADER2 = - " extends LocaleData {\n"+ - " public LocaleElements_"; - private static final String HEADER3 = - "() {\n"+ - " super.init(table);\n"+ - " }\n"+ - " static String table []="; - - private static final String FOOTER = - " }\n"+ - "}"; - //{{DECLARE_CONTROLS - //}} -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/JavaLocaleWriter.java b/icu4j/src/com/ibm/tools/localeconverter/JavaLocaleWriter.java deleted file mode 100755 index 01ef2f5911..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/JavaLocaleWriter.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/JavaLocaleWriter.java,v $ - * $Date: 2002/01/31 01:21:32 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -public class JavaLocaleWriter extends LocaleWriter { - public JavaLocaleWriter(PrintStream out) { - super(out); - } - public JavaLocaleWriter(PrintStream out, PrintStream err) { - super(out, err); - } - public void open(Locale locale) { - println(HEADER); - indent(3); - } - protected void write(String tag, Object o) { - if ("CollationElements".equals(tag)) { - writeTagged(tag,(Object[][])o); - } else if (!(o instanceof CollationItem[])) { - super.write(tag, o); - } else { - CollationItem[] items = (CollationItem[])o; - print("{ "); - printString("CollationElements"); - println(", "); - for (int i = 0; i < items.length; i++) { - if(items[i]!=null){ - printString(items[i].toString()); - if (items[i].comment != null) { - print("+"); - tabTo(30); - print("//"); - println(items[i].comment); - } else { - println("+"); - } - } - } - println("\"\""); - println(" },"); - } - } - - public void write(String tag, String value) { - print("{ "); - printString(tag); - print(", "); - printString(value); - println(" },"); - } - public void write(String tag, String[] value) { - print("{ "); - if (tag != null) { - printString(tag); - println(","); - } else { - println(""); - } - indent(); - println("new String[] {"); - indent(); - for (int i = 0; i < value.length; i++) { - printString(value[i]); - println(","); - } - outdent(); - println("}"); - outdent(); - println("},"); - } - public void write2D(String tag, String[][] value) { - print("{ "); - printString(tag); - println(","); - indent(); - println("new String[][] {"); - indent(); - for (int i = 0; i < value.length; i++) { - println("{"); - indent(); - for (int j = 0; j < value[i].length; j++) { - printString(value[i][j]); - println(","); - } - outdent(); - println("},"); - } - outdent(); - println("}"); - outdent(); - println("},"); - } - public void writeTagged(String tag, String[][] value) { - print("{ "); - printString(tag); - println(","); - indent(); - println("new String[][] {"); - indent(); - for (int i = 0; i < value.length; i++) { - write(value[i][0], value[i][1]); - } - outdent(); - println("}"); - outdent(); - println("},"); - } - public void writeTagged(String tag, Object[][] value) { - print("{ "); - printString(tag); - println(","); - indent(); - println("new String[][] {"); - indent(); - for (int i = 0; i < value.length; i++) { - write((String)value[i][0], value[i][1]); - } - outdent(); - println("}"); - outdent(); - println("},"); - } - public void close() { - outdent(3); - print(FOOTER); - println(""); - } - - protected void appendEscapedChar(char c, StringBuffer buffer) { - if (c < '\u0020' || c == '"' || c == '\\') { - buffer.append('\\'); - buffer.append(HEX_DIGIT[(c & 0700) >> 6]); // HEX_DIGIT works for octal - buffer.append(HEX_DIGIT[(c & 0070) >> 3]); - buffer.append(HEX_DIGIT[(c & 0007)]); - } else { - super.appendEscapedChar(c, buffer); - } - } - - protected String getStringJoiningCharacter() { - return "+"; - } - - private static final String HEADER = - "package java.text.resources;\n"+ - "import java.util.ListResourceBundle;\n"+ - "public class TestLocaleElements extends ListResourceBundle {\n"+ - " public Object[][] getContents() {\n"+ - " return new Object[][] {"; - - private static final String FOOTER = - " };\n"+ - " }\n"+ - "}"; - //{{DECLARE_CONTROLS - //}} -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/Lex.java b/icu4j/src/com/ibm/tools/localeconverter/Lex.java deleted file mode 100755 index 9549baf86e..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/Lex.java +++ /dev/null @@ -1,420 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/Lex.java,v $ - * $Date: 2002/01/31 03:00:29 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -/** - * A Lex is a state machine. Transitions can be activated - * arbitrarily and can consume arbitrary amounts of text. - * A transition simply says it can consume the next character - * and returns the state that the machine should transition into. - * States that are > 0 are final states and cause the nextToken - * routine to return a value. - */ -public final class Lex { - private Transition[][] states; //final - private PushbackReader input; //final - private int state; - private String data; - private final StringBuffer dataBuffer = new StringBuffer(); - private boolean debugMessagesOn; - private String debugTag; - - public static final int END_OF_FILE = Integer.MAX_VALUE; - - /** Construct a new machine. NOTE: setInput must be - * called before nextToken is called */ - public Lex(final Transition[][] states) { - this.states = states; - //{{INIT_CONTROLS - //}} -} - - /** Construct a new machine. */ - public Lex(final Transition[][] statesIn, final PushbackReader inputIn) { - states = statesIn; - input = inputIn; - } - - /** Return the current state */ - public int getState() { - return state; - } - - /** Return the data resulting from the last call to nextToken */ - public String getData() { - if (data == null) { - data = dataBuffer.toString(); - } - return data; - } - - /** Return the input reader used by this machine */ - public PushbackReader getInput() { - return input; - } - - /** set the input reader used by this machine */ - public void setInput(PushbackReader input) { - this.input = input; - } - - /** Return the states used by this machine */ - public Transition[][] getStates() { - return states; - } - - public void setStates(Transition[][] states) { - this.states = states; - } - - /** Return true if the specified string equals the - * string returned by getData(). This routine - * may be faster than calling getData because - * it does not create a string on the heap. - */ - public boolean dataEquals(final String other) { - if (data != null) { - //if dataBuffer has already been converted to - //a string, just compare the strings. - return data.equals(other); - } else { - if (other.length() != dataBuffer.length()) return false; - final int len = dataBuffer.length(); - for (int i = 0; i < len; i++) { - if (other.charAt(i) != dataBuffer.charAt(i)) { - return false; - } - } - return true; - } - } - - /** - * Append the data returned from getData() to the - * specified StringBuffer. This routine avoids - * the creation of a String on the heap. - */ - public void appendDataTo(StringBuffer buffer) { - buffer.append(dataBuffer); - } - - /** - * Return true if the data returned by getData() - * starts with the specified string. This routine avoids - * the creation of a String on the heap. - */ - public boolean dataStartsWith(String s) { - if (dataBuffer.length() < s.length()) { - return false; - } else { - final int sLength = s.length(); - for (int i = 0; i < sLength; i++) { - if (dataBuffer.charAt(i) != s.charAt(i)) { - return false; - } - } - return true; - } - } - - /** - * Convert the contents of the data buffer to an integer - * of the specified radix - */ - public int dataAsNumber(int radix) { - int value = 0; - final int len = dataBuffer.length(); - for (int i = 0; i < len; i++) { - value = value*radix + Character.digit(dataBuffer.charAt(i), radix); - } - return value; - } - - /** - * Get the next token from the input stream. The - * dataBuffer is cleared and the state is set to zero before - * parsing begins. Parsing continues until a state - * greater of equal to 0 s reached or an exception is thrown. - * After each non-terminal transition, the state machine - * walks through all the transitions, in order, for the current - * state until it finds one that will accept the current - * input character and then calls doAction on that transition. - */ - public int nextToken() throws IOException { - state = 0; - dataBuffer.setLength(0); - - do { - int c = input.read(); - final Transition[] transition = states[-state]; - for (int i = 0; i < transition.length; i++) { - if (transition[i].accepts(c)) { - //System.out.println("state["+ -state+"].transition["+i+"] on "+c+" '"+(char)c+"' to state["); - state = transition[i].doAction(c, input, dataBuffer); - //println("" + -state + "]"); - break; - } - } - } while (state <= 0); - data = null; //dump the cached data string - return state; - } - - /** - * Get the next token and throw an acception if - * the state machine is not in the specified state. - */ - public void accept(final int neededState) throws IOException { - if (neededState != nextToken()) { - Exception e = new Exception(); - e.printStackTrace(); - throw new ParseException("Unexpected token - "+getData()); - } - } - - /** - * Get the next token and throw an exception if the - * state machine is not in the specified state and the - * value returned by getData() does not match the - * specified value. - */ - public void accept(final int neededState, final String neededValue) throws IOException { - accept(neededState); - if (!dataEquals(neededValue)) { - Exception e = new Exception(); - e.printStackTrace(); - throw new ParseException("Unexpected token - "+getData()); - } - } - - public void debug(boolean debugMessagesOn) { - this.debugMessagesOn = debugMessagesOn; - debugTag = null; - } - - public void debug(boolean debugMessagesOn, String tag) { - this.debugMessagesOn = debugMessagesOn; - this.debugTag = tag; - } - -/* private void print(String s) { - if (debugMessagesOn) { - System.out.print(s); - } - } - - private void println(String s) { - if (debugMessagesOn) { - System.out.println(s+" <"+debugTag); - } - } - - /** - * The interface for state machine transitions. - */ - public interface Transition { - /** - * Return true if the transition can accept the current input - * character. - */ - public boolean accepts(int c); - /** - * Perform the transition. - * @param c the current input character - * @param input the current input stream, minus the current input character - * @param buffer the current output buffer - * @return the state the machine should be in next - */ - public int doAction(int c, PushbackReader input, StringBuffer buffer) throws IOException; - } - - /* constants for BaseTransitions */ - /** Don't copy the current character to the output */ - public static final byte IGNORE = 0x01; - /** Append the current character to the output */ - public static final byte ACCUMULATE = 0x00; - private static final byte BUFFER_MASK = 0x01; - - /** Remove the current character from the input stream */ - public static final byte CONSUME = 0x00; - /** Return the current character to the input stream */ - public static final byte PUTBACK = 0x10; - private static final byte INPUT_MASK = 0x10; - - public static final byte - ACCUMULATE_CONSUME = (byte)(ACCUMULATE | CONSUME), - IGNORE_CONSUME = (byte)(IGNORE | CONSUME), - ACCUMULATE_PUTBACK = (byte)(ACCUMULATE | PUTBACK), - IGNORE_PUTBACK = (byte)(IGNORE | PUTBACK); - - /** - * Base class for simple transition classes - */ - public static abstract class BaseTransition implements Transition { - private final boolean addToBuffer; - private final boolean unreadInput; - private final int next; - /** - * Construct a new transition. On execution, the - * specified action is performed and the - * specified state is returned. - * @param action the actions to perform to the - * input and output buffers. - * @param next the next state the machine should - * move into - */ - public BaseTransition(byte action, int next) { - this.addToBuffer = (action & BUFFER_MASK) == ACCUMULATE; - this.unreadInput = (action & INPUT_MASK) == PUTBACK; - this.next = next; - } - public abstract boolean accepts(int c); - public int doAction(final int c, - final PushbackReader input, - final StringBuffer buffer) throws IOException { - - if (addToBuffer) { - buffer.append((char)c); - } - if (unreadInput) { - input.unread(c); - } - return next; - } - } - - /** - * Accept end-of-file. - */ - public static final class EOFTransition extends BaseTransition { - public EOFTransition() { - this(IGNORE_CONSUME, END_OF_FILE); - } - public EOFTransition(int next) { - this(IGNORE_CONSUME, next); - } - public EOFTransition(byte action, int next) { - super(action, next); - } - public boolean accepts(int c) { - return c == -1; - } - } - - /** - * Accept anything. - */ - public static final class DefaultTransition extends BaseTransition { - public DefaultTransition(byte action, int nextState) { - super(action, nextState); - } - public boolean accepts(int c) { - return true; - } - } - - /** - * Accept any characters in the specified string. - */ - public static final class StringTransition extends BaseTransition { - private String chars; - public StringTransition(String chars, byte action, int nextState) { - super(action, nextState); - this.chars = chars; - } - public boolean accepts(int c) { - return chars.indexOf((char)c) != -1; - } - } - - /** - * Accept only the specified character. - */ - public static final class CharTransition extends BaseTransition { - private char c; - public CharTransition(char c, byte action, int nextState) { - super(action, nextState); - this.c = c; - } - public boolean accepts(int c) { - return this.c == (char)c; - } - } - - /** - * Accept anything, but throw the specified exception after - * performing the specified action - */ - public static final class ExceptionTransition extends BaseTransition { - private IOException e; - public ExceptionTransition(IOException e) { - super(IGNORE_PUTBACK, END_OF_FILE); //state is ignored - } - public ExceptionTransition(byte action, IOException e) { - super(action, END_OF_FILE); //state is ignored - } - public boolean accepts(int c) { - return true; - } - public final int doAction(final int c, - final PushbackReader input, - final StringBuffer buffer) throws IOException { - super.doAction(c, input, buffer); - throw e; - } - } - - /** - * The base class for parse exceptions. Exceptions - * resulting from parsing errors should be subclasses of this - * class. - */ - public static final class ParseException extends IOException { - public final String reason; - public ParseException() { - this.reason = "unkown"; - } - public ParseException(String reason) { - this.reason = reason; - } - public String toString() { - return reason; - } - } - - /** - * Accept anything, execute as IGNORE_PUTBACK, and throw - * a ParseException with the specified message - */ - public static final class ParseExceptionTransition implements Transition { - private String reason; - public ParseExceptionTransition(String reason) { - this.reason = reason; - } - public boolean accepts(int c) { - return true; - } - public final int doAction(final int c, - final PushbackReader input, - final StringBuffer buffer) throws IOException { - input.unread((char)c); - throw new ParseException(reason); - } - } - - //{{DECLARE_CONTROLS - //}} -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/LineCharNumberReader.java b/icu4j/src/com/ibm/tools/localeconverter/LineCharNumberReader.java deleted file mode 100755 index 53fca84bb3..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/LineCharNumberReader.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/LineCharNumberReader.java,v $ - * $Date: 2002/01/31 01:21:33 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; - -/** - * A LineCharNumberReader is a BufferedReader that - * keeps track of the line number and character offset - * on that line of the current input stream. - */ -public class LineCharNumberReader extends BufferedReader { - private int lineNumber = 0; - private int charNumber = 0; - private int markedLineNumber; - private int markedCharNumber; - private boolean skipLF; - - public LineCharNumberReader(Reader in) { - super(in); - //{{INIT_CONTROLS - //}} -} - - public LineCharNumberReader(Reader in, int sz) { - super(in, sz); - } - - public int getLineNumber() { - return lineNumber; - } - - public int getCharNumber() { - return charNumber; - } - - public int read() throws IOException { - synchronized (lock) { - int c = super.read(); - charNumber++; - if (skipLF) { - if (c == '\n') c = super.read(); - skipLF = false; - } - switch (c) { - case '\r': - skipLF = true; - case '\n': /* Fall through */ - case '\u2028': /* Fall through */ - case '\u2029': /* Fall through */ - lineNumber++; - charNumber = 0; - return '\n'; - } - return c; - } - } - - public int read(char cbuf[], int off, int len) throws IOException { - synchronized (lock) { - int n = super.read(cbuf, off, len); - - for (int i = off; i < off + len; i++) { - int c = cbuf[i]; - charNumber++; - if (skipLF) { - skipLF = false; - if (c == '\n') - continue; - } - switch (c) { - case '\r': - skipLF = true; - case '\n': /* Fall through */ - case '\u2028': /* Fall through */ - case '\u2029': /* Fall through */ - lineNumber++; - charNumber = 0; - break; - } - } - - return n; - } - } - - public String readLine() throws IOException { - synchronized (lock) { - String l = super.readLine(); - if (l != null) - lineNumber++; - charNumber = 0; - skipLF = false; - return l; - } - } - - private static final int maxSkipBufferSize = 8192; - - private char skipBuffer[] = null; - - public long skip(long n) throws IOException { - int nn = (int) Math.min(n, maxSkipBufferSize); - synchronized (lock) { - if ((skipBuffer == null) || (skipBuffer.length < nn)) - skipBuffer = new char[nn]; - long r = n; - while (r > 0) { - int nc = read(skipBuffer, 0, nn); - if (nc == -1) - break; - r -= nc; - } - return n - r; - } - } - - public void mark(int readAheadLimit) throws IOException { - synchronized (lock) { - super.mark(readAheadLimit); - markedLineNumber = lineNumber; - markedCharNumber = charNumber; - } - } - - public void reset() throws IOException { - synchronized (lock) { - super.reset(); - lineNumber = markedLineNumber; - charNumber = markedCharNumber; - } - } - - //{{DECLARE_CONTROLS - //}} -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/LocaleConverter.java b/icu4j/src/com/ibm/tools/localeconverter/LocaleConverter.java deleted file mode 100755 index c3b3830f2f..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/LocaleConverter.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/LocaleConverter.java,v $ - * $Date: 2002/01/31 01:21:35 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -public class LocaleConverter { - public Hashtable convert(Hashtable table) throws ConversionError { - Hashtable result = new Hashtable(); - convert(result, table); - return result; - } - - protected void convert(Hashtable result, Hashtable source) throws ConversionError { - Enumeration enum = source.keys(); - while (enum.hasMoreElements()) { - String key = (String)enum.nextElement(); - Object data = source.get(key); - result.put(key, data); - } - } - - public static class ConversionError extends Exception { - public ConversionError() { - } - - public ConversionError(String reason) { - super(reason); - } - } -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/LocaleWriter.java b/icu4j/src/com/ibm/tools/localeconverter/LocaleWriter.java deleted file mode 100755 index d6432650b2..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/LocaleWriter.java +++ /dev/null @@ -1,418 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/LocaleWriter.java,v $ - * $Date: 2002/01/31 02:47:26 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; -import com.ibm.text.*; -import java.io.*; -import java.util.*; -/** - * A LocaleWriter takes locale data in standard form and - * writes it to standard output in a form suitable for - * loading programatically. - */ -public abstract class LocaleWriter { - private static final String INDENT_CHARS = - " "+ - " "+ - " "; - private static final char EOL_CHARS[] = {'\r', '\n', '\u2028', '\u2029'}; - - private static final int INDENT_SIZE = 4; - private static final int MAX_LINE_LENGTH = 80; - private int indentLevel; - private String indentString; - private boolean needsIndent; - protected StringBuffer lineBuffer = new StringBuffer(); - private int lineLength; - protected PrintStream out; - protected PrintStream err; - public static final HexToUnicodeTransliterator huTranslit = new HexToUnicodeTransliterator(""); - public static final UnicodeToHexTransliterator uhTranslit = new UnicodeToHexTransliterator("\\\\u0000"); - final File outFile = new File( "cnvLoc.txt"); - FileOutputStream outFileStream; - BufferedWriter outBufWrite; - PrintWriter myOut; - - public LocaleWriter(PrintStream out) { - this.out = out; - this.err = out; - try{ - outFile.canWrite(); - outFileStream = new FileOutputStream(outFile); - outBufWrite = new BufferedWriter(new OutputStreamWriter(outFileStream,"UTF8")); - } - catch(java.io.IOException e){ - System.out.println("Encoding unsupported"); - return; - } - } - public LocaleWriter(PrintStream out, PrintStream err) { - this.out = out; - this.err = err; - try{ - outFile.canWrite(); - outFileStream = new FileOutputStream(outFile); - outBufWrite = new BufferedWriter(new OutputStreamWriter(outFileStream,"UTF8")); - } - catch(java.io.IOException e){ - System.out.println("Encoding unsupported"); - return; - } - } - - public void write(Locale locale, Hashtable localeData) { - open(locale); - //sort the key so the tags are in order in the resource file - SortedVector order = new SortedVector(localeData.keys(), new SortedVector.StringComparator()); - Enumeration e = order.elements(); - while (e.hasMoreElements()) { - final String key = (String)e.nextElement(); - final Object data = localeData.get(key); - if (isDuplicateOfInheritedValue(locale, key, data)) { - println("///* Discarding duplicate data for tag: "+key+" */"); - } else { - write(key, data); - } - } - - close(); - } - public void closeFileHandle(){ - try{ - outBufWrite.close(); - } - catch(java.io.IOException excp){ - out.println("could not close the output file"); - } - } - - protected void write(String tag, Object o) { - if (o instanceof String) { - write(tag, (String)o); - } else if (o instanceof String[]) { - write(tag, (String[]) o); - } else if (o instanceof String[][]) { - write(tag, (String[][])o); - } else if (o instanceof Object[]) { - Object[] data = (Object[])o; - String[] temp = new String[data.length]; - for (int i = 0; i < data.length; i++) { - temp[i] = data[i].toString(); - } - write(tag, temp); - } else if (o instanceof Object[][]) { - Object[][] data = (Object[][])o; - String[][] temp = new String[data.length][]; - for (int i = 0; i < data.length; i++) { - temp[i] = new String[data[i].length]; - for (int j = 0; j < temp[i].length; j++) { - temp[i][j] = data[i][j].toString(); - } - } - write(tag, temp); - } else { - write(tag, o.toString()); - } - } - protected final void write(String tag, String[][] value) { - if (value.length > 0) { - if (value[0].length > 2) { - write2D(tag, value); - } else { - writeTagged(tag, value); - } - } else { - writeTagged(tag, value); - } - } - - protected abstract void open(Locale locale); - protected abstract void write(String tag, String value); - protected abstract void write(String tag, String[] value); - protected abstract void write2D(String tag, String[][] value); - protected abstract void writeTagged(String tag, String[][] value); - protected abstract void close(); - protected abstract String getStringJoiningCharacter(); - - protected void tabTo(int pos) { - if (pos > lineLength) { - for (int i = lineLength; i < pos; i++) { - print(" "); - } - } - } - protected void writeToFile(String str){ - ReplaceableString tempStr = new ReplaceableString(); - tempStr.replace(0,tempStr.length(),str); - - //huTranslit.transliterate(tempStr); - //uhTranslit.transliterate(tempStr); - try{ - outBufWrite.write(tempStr.toString()); - } - catch(java.io.IOException e){ - out.println("Could not write to file"); - } - } - - protected void print(String val) { - if (needsIndent) { - out.print(indentString); - writeToFile(indentString); - lineLength += indentString.length(); - needsIndent = false; - } - ReplaceableString tempStr = new ReplaceableString(); - tempStr.replace(0,tempStr.length(),val); - huTranslit.transliterate(tempStr); - String tval = tempStr.toString(); - if(tval.length()< val.length()){ - // uhTranslit.transliterate(tempStr); - tval=prependEsc(tempStr.toString()); - } - if (tval != null) { - out.print(tval); - writeToFile(tval); - int len = 0; - for (int i = 0; i < EOL_CHARS.length; i++) { - len = Math.max(len, tval.lastIndexOf(EOL_CHARS[i])); - } - if (len == 0) { - lineLength += tval.length(); - } else { - lineLength = tval.length() - len; - } - } - } - protected String prependEsc(String str){ - StringBuffer myStr = new StringBuffer(); - for(int i=0;i 0x007f){ - myStr.append("\\u"); - myStr.append(toHexString(ch,16,4)); - } - else{ - myStr.append(ch); - } - } - return myStr.toString(); - } - protected String toHexString(char ch, int radix, int pad){ - final int MAX_DIGITS = 10; - int length = 0; - char buffer[] = new char[10]; - int num = 0; - int digit; - int j; - char temp; - int i = (int)ch; - do{ - digit = (int)(i % radix); - buffer[length++]=(char)(digit<=9?(0x0030+digit):(0x0030+digit+7)); - i=(i/radix); - }while(i>0); - - while (length < pad){ - buffer[length++] = 0x0030;/*zero padding */ - } - /* null terminate the buffer */ - if(length=length) ? pad :length; - - /* Reverses the string */ - for (j = 0; j < (num / 2); j++){ - temp = buffer[(length-1) - j]; - buffer[(length-1) - j] = buffer[j]; - buffer[j] = temp; - } - return new String(buffer,0,length); - } - - protected void println(String val) { - print(val); - out.println(); - writeToFile("\n"); - lineLength = 0; - needsIndent = true; - } - - protected void printString(String val) { - if (val != null) { - indent(); - lineBuffer.setLength(0); - lineBuffer.append("\""); - final int size = val.length(); - for (int i = 0; i < size; i++) { - append(val.charAt(i)); - /*if (!append(val.charAt(i))) { - lineBuffer.append("\""); - lineBuffer.append(getStringJoiningCharacter()); - println(lineBuffer.toString()); - lineBuffer.setLength(0); - lineBuffer.append("\""); - }*/ - } - - lineBuffer.append("\""); - print(lineBuffer.toString()); - outdent(); - } else { - print("\"\""); - } - } - - protected boolean append(final char c) { - boolean escape = isEscapeChar(c); - if (escape) { - appendEscapedChar(c, lineBuffer); - } else { - lineBuffer.append(c); - } - return (lineLength + lineBuffer.length() < MAX_LINE_LENGTH); - } - - protected boolean isEscapeChar(final char c) { - switch (c) { - case '"': - case '\\': - case '\n': - case '\r': - case '\u2028': - case '\u2029': - return true; - default: - return (c < ' ') || (c > 0x07F); - } - } - - protected void appendEscapedChar(char c, StringBuffer buffer) { - buffer.append(getEscapeChar()); - int value = ((int)c) & 0xFFFF; - buffer.append(HEX_DIGIT[(value & 0xF000) >> 12]); - buffer.append(HEX_DIGIT[(value & 0x0F00) >> 8]); - buffer.append(HEX_DIGIT[(value & 0x00F0) >> 4]); - buffer.append(HEX_DIGIT[(value & 0x000F)]); - } - - protected String getEscapeChar() { - return "\\u"; - } - - protected final void indent() { - indent(1); - } - protected void indent(int amount) { - indentLevel += amount; - indentString = INDENT_CHARS.substring(0, indentLevel*INDENT_SIZE); - } - - protected final void outdent() { - outdent(1); - } - protected void outdent(int amount) { - indentLevel -= amount; - indentString = INDENT_CHARS.substring(0, indentLevel*INDENT_SIZE); - } - - static final char[] HEX_DIGIT = {'0','1','2','3','4','5','6','7', - '8','9','A','B','C','D','E','F'}; - - /** Return true if the value for the specified tag is the same - * as the value inherited from the parent for that tag */ - private boolean isDuplicateOfInheritedValue(final Locale loc, String tag, Object value) { - if (value == null) return true; - try { - final ResourceBundle parentBundle = getParentBundle(loc); - if (parentBundle == null) return false; - Object parentValue = parentBundle.getObject(tag); - if (!objectsAreEqual(value, parentValue)) { - return false; - } else { - return true; - } - } catch (java.util.MissingResourceException e) { - return false; - } - } - - private boolean objectsAreEqual(final Object item, final Object parentItem) { - if (item instanceof Object[] && parentItem instanceof Object[]) { - return arraysAreEqual((Object[])item, (Object[])parentItem); - } else { - return item.equals(parentItem); - } - } - - private boolean arraysAreEqual(final Object[] item, final Object[] parentItem) { - boolean matches = item.length == parentItem.length; - for (int i = 0; i < item.length && matches; i++) { - matches = objectsAreEqual(item[i], parentItem[i]); - } - return matches; - } - - private ResourceBundle getParentBundle(final Locale loc) { - try { - final String x = loc.toString(); - final int ndx = x.lastIndexOf('_'); - if (ndx < 0) { - return null; - } else { - final String parentLocName = x.substring(0, ndx); - final Locale parentLoc = localeFromString(parentLocName); - return ResourceBundle.getBundle("com.ibm.tools.localeconverter.myLocaleElements", parentLoc); - } - } catch (MissingResourceException e) { - return null; - } - } - - private String replace(String source, String target, String replacement) { - if (target.equals(replacement)) { - return source; - } else { - StringBuffer result = new StringBuffer(); - int lastNdx = 0; - int ndx = source.indexOf(target); - while (ndx >= 0) { - result.append(source.substring(lastNdx, ndx)); - result.append(replacement); - ndx += target.length(); - lastNdx = ndx; - ndx = source.indexOf(target, ndx); - } - result.append(source.substring(lastNdx)); - return result.toString(); - } - } - - public Locale localeFromString(final String localeName) { - String language = localeName; - String country = ""; - String variant = ""; - - int ndx = language.indexOf('_'); - if (ndx >= 0) { - country = language.substring(ndx+1); - language = language.substring(0, ndx); - } - ndx = country.indexOf('_'); - if (ndx >= 0) { - variant = country.substring(ndx); - country = country.substring(0, ndx); - } - return new Locale(language, country, variant); - } -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/NeutralToJ1Converter.java b/icu4j/src/com/ibm/tools/localeconverter/NeutralToJ1Converter.java deleted file mode 100755 index 469215bb62..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/NeutralToJ1Converter.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/NeutralToJ1Converter.java,v $ - * $Date: 2002/01/31 02:47:27 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -public class NeutralToJ1Converter extends LocaleConverter { - private static class Conversion { - private String propName; - private int ndx; - protected Conversion() { - } - public Conversion(String propName) { - this.propName = propName; - this.ndx = -1; - } - public Conversion(String propName, int ndx) { - this.propName = propName; - this.ndx = ndx; - } - public String getPropName() { - return propName; - } - public String convert(Hashtable source) throws ConversionError { - Object sourceData = source.get(propName); - if (sourceData == null) { - return null; - } - if (ndx >= 0) { - if (sourceData instanceof String[]) { - sourceData = ((String[])sourceData)[ndx]; - } else if (sourceData instanceof String[][]) { - sourceData = ((String[][])sourceData)[ndx]; - } - } - if (sourceData instanceof String) { - return (String)sourceData; - } else if (sourceData instanceof String[]) { - String[] data = (String[])sourceData; - StringBuffer result = new StringBuffer(); - for (int i = 0; i < data.length; i++) { - if (i > 0) result.append(';'); - result.append(data[i]); - } - return result.toString(); - } else { - throw new ConversionError("could not convert tag: "+propName); - } - } - } - - private static class CollationConversion extends Conversion { - public String convert(Hashtable source) throws ConversionError { - Object[][] elements = (Object[][])source.get("CollationElements"); - CollationItem[] items = (CollationItem[])elements[2][1]; - if (items == null) { - return ""; - } else { - StringBuffer result = new StringBuffer(); - for (int i = 0; i < items.length; i++) { - if(items[i]!=null){ - result.append(items[i].toString()); - } - } - return result.toString(); - } - } - } - - private static final Conversion[] conversions = { - new Conversion("LocaleString"), /*locale id based on iso codes*/ - new Conversion("LocaleID"), /*Windows id*/ - new Conversion("ShortLanguage"), /*iso-3 abbrev lang name*/ - new Conversion("ShortCountry"), /*iso-3 abbrev country name*/ - new Conversion("Languages"), /*language names*/ - new Conversion("Countries"), /*country names*/ - new Conversion("MonthNames",0), /*january*/ - new Conversion("MonthNames",1), /*february*/ - new Conversion("MonthNames",2), /*march*/ - new Conversion("MonthNames",3), /*april*/ - new Conversion("MonthNames",4), /*may*/ - new Conversion("MonthNames",5), /*june*/ - new Conversion("MonthNames",6), /*july*/ - new Conversion("MonthNames",7), /*august*/ - new Conversion("MonthNames",8), /*september*/ - new Conversion("MonthNames",9), /*october*/ - new Conversion("MonthNames",10), /*november*/ - new Conversion("MonthNames",11), /*december*/ - new Conversion("MonthNames",12), /*month 13 if applicable*/ - new Conversion("MonthAbbreviations",0), /*abb january*/ - new Conversion("MonthAbbreviations",1), /*abb february*/ - new Conversion("MonthAbbreviations",2), /*abb march*/ - new Conversion("MonthAbbreviations",3), /*abb april*/ - new Conversion("MonthAbbreviations",4), /*abb may*/ - new Conversion("MonthAbbreviations",5), /*abb june*/ - new Conversion("MonthAbbreviations",6), /*abb july*/ - new Conversion("MonthAbbreviations",7), /*abb august*/ - new Conversion("MonthAbbreviations",8), /*abb september*/ - new Conversion("MonthAbbreviations",9), /*abb october*/ - new Conversion("MonthAbbreviations",10), /*abb november*/ - new Conversion("MonthAbbreviations",11), /*abb december*/ - new Conversion("MonthAbbreviations",12), /*abb month 13 if applicable*/ - new Conversion("DayNames",0), /*Monday*/ - new Conversion("DayNames",1), /*Tuesday*/ - new Conversion("DayNames",2), /*Wednesday*/ - new Conversion("DayNames",3), /*Thursday*/ - new Conversion("DayNames",4), /*Friday*/ - new Conversion("DayNames",5), /*Saturday*/ - new Conversion("DayNames",6), /*Sunday*/ - new Conversion("DayAbbreviations",0), /*abb Monday*/ - new Conversion("DayAbbreviations",1), /*abb Tuesday*/ - new Conversion("DayAbbreviations",2), /*abb Wednesday*/ - new Conversion("DayAbbreviations",3), /*abb Thursday*/ - new Conversion("DayAbbreviations",4), /*abb Friday*/ - new Conversion("DayAbbreviations",5), /*abb Saturday*/ - new Conversion("DayAbbreviations",6), /*abb Sunday*/ - new Conversion("AmPmMarkers",0), /*am marker*/ - new Conversion("AmPmMarkers",1), /*pm marker*/ - new Conversion("Eras"),/*era strings*/ - new Conversion("NumberPatterns",0), /*decimal pattern*/ - new Conversion("NumberPatterns",1), /*currency pattern*/ - new Conversion("NumberPatterns",2), /*percent pattern*/ - new Conversion("NumberElements",0), /*decimal separator*/ - new Conversion("NumberElements",1), /*group (thousands) separator*/ - new Conversion("NumberElements",2), /*list separator*/ - new Conversion("NumberElements",3), /*percent sign*/ - new Conversion("NumberElements",4), /*native 0 digit*/ - new Conversion("NumberElements",5), /*pattern digit*/ - new Conversion("NumberElements",6), /*minus sign*/ - new Conversion("NumberElements",7), /*exponential*/ - new Conversion("CurrencyElements",0), /*local currency symbol*/ - new Conversion("CurrencyElements",1), /*intl currency symbol*/ - new Conversion("CurrencyElements",2), /*monetary decimal separator*/ - new Conversion("DateTimePatterns",0), /*full time pattern*/ - new Conversion("DateTimePatterns",1), /*long time pattern*/ - new Conversion("DateTimePatterns",2), /*medium time pattern*/ - new Conversion("DateTimePatterns",3), /*short time pattern*/ - new Conversion("DateTimePatterns",4), /*full date pattern*/ - new Conversion("DateTimePatterns",5), /*long date pattern*/ - new Conversion("DateTimePatterns",6), /*medium date pattern*/ - new Conversion("DateTimePatterns",7), /*short date pattern*/ - new Conversion("DateTimePatterns",8), /*date-time pattern*/ - new Conversion("DateTimeElements",9), /*first day of week*/ - new Conversion("DateTimeElements",10), /*min days in first week*/ - new CollationConversion(), /*collation order*/ - }; - private Locale locale; - private Locale parentLocale; - private ResourceBundle defaultData; - - public NeutralToJ1Converter(Locale locale) { - this.locale = locale; - String language = locale.toString(); - String country = ""; - String variant = ""; - - int ndx = language.indexOf('_'); - if (ndx >= 0) { - country = language.substring(ndx+1); - language = language.substring(0, ndx); - } - ndx = country.indexOf('_'); - if (ndx >= 0) { - variant = country.substring(ndx); - country = country.substring(0, ndx); - } - - if ("".equals(country)) { - language = ""; - variant = ""; - } else if ("".equals(variant)) { - country = ""; - } - - parentLocale = new Locale(language, country, variant); - defaultData = - ResourceBundle.getBundle("com.ibm.tools.localeconverter.myLocaleElements", parentLocale); - //{{INIT_CONTROLS - //}} -} - - /** convert the source table to the result */ - protected void convert(Hashtable result, Hashtable source) throws ConversionError { - Vector localeElements = new Vector(); - for (int i = 0; i < conversions.length; i++) { - final Conversion conv = conversions[i]; - final String newValue = conv.convert(source); - if (newValue != null) { - localeElements.addElement(newValue); - } else { - localeElements.addElement(defaultData.getObject(conv.getPropName())); - } - } - result.put("LocaleElements", localeElements); - } - //{{DECLARE_CONTROLS - //}} -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/localeconverter/POSIXLocaleReader.java b/icu4j/src/com/ibm/tools/localeconverter/POSIXLocaleReader.java deleted file mode 100755 index 8fad4bae4a..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/POSIXLocaleReader.java +++ /dev/null @@ -1,407 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/POSIXLocaleReader.java,v $ - * $Date: 2002/01/31 01:22:24 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -public class POSIXLocaleReader { - private final String localeDataPath; - private final Locale locale; - - public static final int TAG_TOKEN = 1; - public static final int SEPARATOR_TOKEN = 2; - public static final int EOL_TOKEN = 3; - public static final int EOF_TOKEN = 4; - - //these states are used to parse the bulk of the - //input file. They translate escaped characters - //and symolic character references inline. - static final Lex.Transition[][] dataStates = { - { //state 0: start - new SpaceTransition(0), - new Lex.CharTransition(';', Lex.IGNORE_CONSUME, SEPARATOR_TOKEN), - new Lex.CharTransition(',', Lex.IGNORE_CONSUME, SEPARATOR_TOKEN), - new EOLTransition(EOL_TOKEN), - new TokenTransition(TAG_TOKEN), - new Lex.EOFTransition(EOF_TOKEN), - new Lex.ParseExceptionTransition("unexpected characters") - } - }; - - static final Lex.Transition[][] LCStates = { - { //state 0: start - new SpaceTransition(0), - new EOLTransition(EOL_TOKEN), - new Lex.EOFTransition(EOF_TOKEN), - new Lex.DefaultTransition(Lex.ACCUMULATE_CONSUME, -1) - }, - { //grab first word - new Lex.StringTransition(SpaceTransition.SPACE_CHARS, Lex.IGNORE_PUTBACK, TAG_TOKEN), - new Lex.StringTransition(EOLTransition.EOL_CHARS, Lex.IGNORE_PUTBACK, TAG_TOKEN), - new Lex.EOFTransition(TAG_TOKEN), - new Lex.DefaultTransition(Lex.ACCUMULATE_CONSUME, -1) - } - }; - - public POSIXLocaleReader(final String localeDataPath, final Locale locale) { - this.localeDataPath = localeDataPath; - this.locale = locale; - //{{INIT_CONTROLS - //}} -} - - public Hashtable parse(String fileName, byte flags) throws IOException { - try { - Hashtable table = parseNative(fileName); - Hashtable result = new PosixToNeutralConverter(flags, locale,fileName).convert(table); - return result; - } catch (LocaleConverter.ConversionError e) { - System.err.println("Internal error converting locale data"); - return null; - } - } - - public Hashtable parseNative(String fileName) throws IOException { - char oldEscapeChar = EscapeTransition.setDefaultEscapeChar(); - char oldCommentChar = EOLTransition.setDefaultCommentChar(); - Hashtable table = new Hashtable(); - try { - - LineCharNumberReader lines = new LineCharNumberReader( - new BufferedReader( - new FileReader( - new File(localeDataPath, fileName) - ) - ) - ); - PushbackReader reader = new PushbackReader(lines); - - //Shove a newline at the start of the file. This has the affect of allowing - //the file to start with a comment, since the parser only allows comments as - //part of an EOL - reader.unread('\n'); - - String sectionTag = seekLC(reader); - while (sectionTag != null) { - try { - parseSection(table, reader, sectionTag); - } catch (Lex.ParseException e) { - System.err.println("ERROR parsing: "+e.reason); - System.err.println(" Line: "+lines.getLineNumber()); - System.err.println(" char: "+lines.getCharNumber()); - seekEND(reader); - System.err.println("Skipped to line: "+(lines.getLineNumber()+1)); - } - sectionTag = seekLC(reader); - } - } finally { - EscapeTransition.setEscapeChar(oldEscapeChar); - EOLTransition.setCommentChar(oldCommentChar); - } - return table; - } - - private void parseSection(Hashtable table, PushbackReader reader, String sectionTag) throws IOException { - if (sectionTag.equals("LC_CTYPE")) { - parseCTYPE(table, reader); - } else if (sectionTag.equals("LC_COLLATE")) { - parseCOLLATE(table, reader); - } else if (sectionTag.equals("LC_MONETARY")) { - parseLC(table, reader, sectionTag); - } else if (sectionTag.equals("LC_NUMERIC")) { - parseLC(table, reader, sectionTag); - } else if (sectionTag.equals("LC_TIME")) { - parseLC(table, reader, sectionTag); - } else if (sectionTag.equals("LC_MESSAGES")) { - parseLC(table, reader, sectionTag); - }else if(sectionTag.equals("LC_MEASUREMENT")){ - parseLC(table, reader, sectionTag); - }else if(sectionTag.equals("LC_ADDRESS")){ - parseLC(table, reader, sectionTag); - }else if(sectionTag.equals("LC_PAPER")){ - parseLC(table, reader, sectionTag); - }else if(sectionTag.equals("LC_NAME")){ - parseLC(table, reader, sectionTag); - }else if(sectionTag.equals("LC_IDENTIFICATION")){ - parseLC(table, reader, sectionTag); - }else if(sectionTag.equals("LC_TELEPHONE")){ - parseLC(table, reader, sectionTag); - - }else { - System.out.println("Unrecognised section:"+sectionTag); - System.out.println("Default parsing applied."); - parseLC(table, reader, sectionTag); - } - } - - private PushbackReader createParserInput(String localeName) throws IOException { - PushbackReader reader = new PushbackReader( - new BufferedReader( - new FileReader( - new File(localeDataPath, localeName) - ) - ) - ); - //Shove a newline at the start of the file. This has the affect of allowing - //the file to start with a comment, since the parser only allows comments as - //part of an EOL - reader.unread('\n'); - return reader; - } - - private String seekLC(PushbackReader reader) throws IOException { - Lex p = new Lex(LCStates, reader); - final String LC = "LC_"; - int s = p.nextToken(); - while ((s != EOF_TOKEN)) { - if (s == TAG_TOKEN) { - if (p.dataStartsWith(LC)) { - String tag = p.getData(); - do { - s = p.nextToken(); - } while (s != EOL_TOKEN && s != EOF_TOKEN); - return tag; - } else if (p.dataEquals("escape_char")) { - s = p.nextToken(); - if (s == TAG_TOKEN || p.getData().length() != 1) { - String escape_char = p.getData(); - EscapeTransition.setEscapeChar(escape_char.charAt(0)); - } else { - System.out.println("Error in escape_char directive. Directive ignored."); - } - } else if (p.dataEquals("comment_char")) { - s = p.nextToken(); - if (s == TAG_TOKEN || p.getData().length() != 1) { - String comment_char = p.getData(); - EOLTransition.setCommentChar(comment_char.charAt(0)); - } else { - System.out.println("Error in escape_char directive. Directive ignored."); - } - } - } - s = p.nextToken(); - } - return null; - } - - private boolean seekEND(PushbackReader reader) throws IOException { - Lex p = new Lex(LCStates, reader); - final String END = "END"; - int s = p.nextToken(); - while ((s != EOF_TOKEN)) { - if (s == TAG_TOKEN) { - if (p.dataStartsWith(END)) { - do { - s = p.nextToken(); - } while (s != EOL_TOKEN && s != EOF_TOKEN); - return true; - } - } - s = p.nextToken(); - } - return false; - } - - private void parseCTYPE(Hashtable table, PushbackReader reader) throws IOException { - Lex p = new Lex(dataStates, reader); - StringBuffer temp = new StringBuffer(); - int s = p.nextToken(); - if ((s == TAG_TOKEN) && p.dataEquals("copy")) { - p.accept(TAG_TOKEN); - parseCopy("LC_CTYPE", p.getData(), table); - p.accept(EOL_TOKEN); - p.accept(TAG_TOKEN, "END"); - p.accept(TAG_TOKEN, "LC_CTYPE"); - } else { - while ((s == TAG_TOKEN) && !p.dataEquals("END")) { - String key = p.getData(); - temp.setLength(0); - p.accept(TAG_TOKEN); - p.appendDataTo(temp); - s = p.nextToken(); - while (s == SEPARATOR_TOKEN) { - p.accept(TAG_TOKEN); - p.appendDataTo(temp); - s = p.nextToken(); - } - if (s != EOL_TOKEN) { - throw new IOException(); - } else { - table.put(key, temp.toString()); - } - s = p.nextToken(); - } - p.accept(TAG_TOKEN, "LC_CTYPE"); - } - } - - private void parseCopy(String section, String toCopy, Hashtable t) throws IOException { - char oldEscapeChar = EscapeTransition.setDefaultEscapeChar(); - char oldCommentChar = EOLTransition.setDefaultCommentChar(); - try { - PushbackReader reader = createParserInput(toCopy); - String tag = seekLC(reader); - while (tag != null && !section.equals(tag)) { - tag = seekLC(reader); - } - if (tag != null) { - parseSection(t, reader, section); - } else { - //hey {jf} - is this an error? - } - } finally { - EscapeTransition.setEscapeChar(oldEscapeChar); - EOLTransition.setCommentChar(oldCommentChar); - } - } - - private void parseLC(Hashtable t, PushbackReader reader, String sectionTag) throws IOException { - Lex input = new Lex(dataStates, reader); - input.accept(TAG_TOKEN); - if (input.dataEquals("copy")) { - input.accept(TAG_TOKEN); - parseCopy(sectionTag, input.getData(), t); - } else { - while ((input.getState() == TAG_TOKEN) && !input.dataEquals("END")) { - String label = input.getData(); - Vector values = new Vector(); - input.accept(TAG_TOKEN); - String temp = input.getData(); - values.addElement(temp); - while (input.nextToken() == SEPARATOR_TOKEN) { - input.accept(TAG_TOKEN); - String value = input.getData(); - values.addElement(value); - } - if (values.size() > 1) { - String[] data = new String[values.size()]; - values.copyInto(data); - t.put(label, data); - } else { - t.put(label, values.elementAt(0)); - } - if (input.getState() != EOL_TOKEN) { - System.out.println(label); - throw new IOException(); - } - input.nextToken(); - } - } - input.accept(TAG_TOKEN, sectionTag); - } - - private void parseCOLLATE(Hashtable table, PushbackReader reader) - throws IOException { - PosixCharMap map = new PosixCharMap(SymbolTransition.getCharMap()); - SymbolTransition.setCharMap(map); - try { - Lex input = new Lex(dataStates, reader); - PosixCollationBuilder builder = new PosixCollationBuilder(map); - - int s = input.nextToken(); - while (s == EOL_TOKEN) s = input.nextToken(); - while (s == TAG_TOKEN) { - if (input.dataEquals("END")) { - break; - } else if (input.dataEquals("UNDEFINED")) { - System.err.println("WARNING: Undefined characters will sort last."); - s = input.nextToken(); - while (s != EOF_TOKEN && s != EOL_TOKEN) { - s = input.nextToken(); - } - } else if (input.dataEquals("copy")) { - //copy collation rules from another locale - input.accept(TAG_TOKEN); - String toCopy = input.getData(); - input.accept(EOL_TOKEN); - parseCopy("LC_COLLATE", toCopy, table); - System.err.println("Copying collation rules from "+toCopy+"..."); - } else if (input.dataEquals("...")) { - //fill the space between the last element and the next element - System.err.println("ERROR: Ellipsis not supported in collation rules."); - System.err.println(" Line ignored"); - } else if (input.dataEquals("replace-after")) { - System.err.println("ERROR: Replace-after not supported in collation rules."); - System.err.println(" Skipping until next replace-end."); - s = input.nextToken(); - while (s != EOF_TOKEN) { - if (s == TAG_TOKEN && input.dataEquals("replace-end")) { - input.accept(EOL_TOKEN); - break; - } - } - } else if (input.dataEquals("collating-element")) { - //Several characters should sort as a single element. - input.accept(TAG_TOKEN); //get the symbol - String key = input.getData(); - input.accept(TAG_TOKEN, "from"); - input.accept(TAG_TOKEN); //get the expansion - String value = input.getData(); - builder.defineContraction(key, value); - input.accept(EOL_TOKEN); - } else if (input.dataEquals("collating-symbol")) { - //define a weight symbol. This symbol does not represent a character. - //It's only used for comparison purposes. We define the character - //value for this character to be in the private area since our - //collation stuff doesn't sort that area. - input.accept(TAG_TOKEN); - builder.defineWeightSymbol(input.getData()); - input.accept(EOL_TOKEN); - } else if (input.dataEquals("order_start")) { - Vector tempVector = new Vector(); - //start reading collation ordering rules. - input.accept(TAG_TOKEN); - tempVector.addElement(input.getData()); - s = input.nextToken(); - while (s == SEPARATOR_TOKEN) { - input.accept(TAG_TOKEN); - tempVector.addElement(input.getData()); - s = input.nextToken(); - } - String[] order_start = new String[tempVector.size()]; - tempVector.copyInto(order_start); - table.put("sort_order", order_start); - } else if (input.dataEquals("order_end")) { - //build a list of ordered collation elements - input.accept(EOL_TOKEN); - SortedVector order = builder.getSortOrder(); - PosixCollationBuilder.CollationRule[] ruleSource = - new PosixCollationBuilder.CollationRule[order.size()]; - order.copyInto(ruleSource); //copy into an array so we can add it to the output table - //this is only for information purposes so we can retrieve the source of the - //collationItems with the weights if we want them later - table.put("posix_sort_rules", ruleSource); - } else { - //add a collation item to the list - builder.addRule(input.getData()); - s = input.nextToken(); - while (s == TAG_TOKEN) { - //we're expecting weights here - builder.addWeight(input.getData()); - s = input.nextToken(); - if (s == SEPARATOR_TOKEN) { - s = input.nextToken(); - } - } - } - s = input.nextToken(); - } - input.accept(TAG_TOKEN, "LC_COLLATE"); - } finally { - SymbolTransition.setCharMap(map.getParent()); - } - } - //{{DECLARE_CONTROLS - //}} -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/PosixCharMap.java b/icu4j/src/com/ibm/tools/localeconverter/PosixCharMap.java deleted file mode 100755 index a87ed9f574..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/PosixCharMap.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/PosixCharMap.java,v $ - * $Date: 2002/01/31 01:22:21 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ - -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; -import com.ibm.text.*; - -public class PosixCharMap { - private Hashtable table = new Hashtable(); - private Hashtable backTable = null; - private PosixCharMap parentMap; - private String encoding; - - public PosixCharMap() { - } - - public PosixCharMap(PosixCharMap parent) { - parentMap = parent; - } - - public PosixCharMap(String fileName) throws IOException { - this(new FileReader(fileName)); - } - - public PosixCharMap(String pathName, String fileName) throws IOException { - this(new FileReader(new File(pathName, fileName))); - } - - public PosixCharMap(Reader inputReader) throws IOException { - load(new BufferedReader(inputReader)); - } - - public PosixCharMap getParent() { - return parentMap; - } - - public void setParent(PosixCharMap parent) { - parentMap = parent; - } - - public void load(String pathName, String fileName) throws IOException { - load(new File(pathName, fileName),""); - } - public void load(String pathName, String fileName, String enc)throws IOException{ - load(new File(pathName, fileName),enc); - } - - public void load(File file, String enc) throws IOException { - encoding =enc; - load(new BufferedReader(new FileReader(file))); - } - public void load(Reader inputReader) throws IOException { - PosixCharMap oldMap = SymbolTransition.getCharMap(); - SymbolTransition.setCharMap(null); - try { - final int TOKEN = 1; - final int EOF = 2; - final int EOL = 3; - final int RANGE = 4; - final Lex.Transition[][] states1 = { - { //state 0: start - new SpaceTransition(0), - new EOLTransition(EOL), - new Lex.EOFTransition(EOF), - new Lex.DefaultTransition(Lex.ACCUMULATE_CONSUME, -1) - }, - { //grab first word - new Lex.StringTransition(SpaceTransition.SPACE_CHARS, Lex.IGNORE_CONSUME, TOKEN), - new Lex.StringTransition(EOLTransition.EOL_CHARS, Lex.IGNORE_CONSUME, TOKEN), - new Lex.EOFTransition(TOKEN), - new Lex.DefaultTransition(Lex.ACCUMULATE_CONSUME, -1) - } - }; - - final Lex.Transition[][] states2 = { - { //These states only return . All - //other text is ignored. - new Lex.EOFTransition(EOF), - new EOLTransition(EOL), - new SymbolTransition(TOKEN), - new SpaceTransition(0), - new RangeTransition(RANGE), - new Lex.DefaultTransition(Lex.ACCUMULATE_CONSUME, 0) - }, - }; - - PushbackReader input = new PushbackReader(inputReader); - Lex p = new Lex(states1, input); - int state; - do { - state = p.nextToken(); - } while ((state != EOF) && !p.dataEquals("CHARMAP")); - p.accept(EOL); - if (state != EOF) { - p = new Lex(states2, input); - state = p.nextToken(); - while (state != EOF) { - String key = p.getData(); - state = p.nextToken(); - while (state == EOL) { - String data = p.getData(); - data.trim(); - if (data.startsWith(""),""+(char)digit++); - beginRange++; - } - - state = p.nextToken(); - key=p.getData(); - } - - - //state = p.nextToken(); - } - } - } catch (EOFException e) { - } finally { - SymbolTransition.setCharMap(oldMap); - } - } - public int[] getInt(String data){ - int i=0; - int[] retVal = new int[2]; - int len =data.length(); - while(i< len){ - if((data.charAt(i))-0x30 < (0x39-0x30)){ - break; - } - i++; - } - String sub =data.substring(i,len-1); - retVal[0] =i; - retVal[1]=Integer.parseInt(sub,10); - return retVal; - } - public int hexToByte(String data, byte[] retval){ - String tData = data; - int i=0; - for(i=0;i < data.length()/4; i++){ - if(tData.charAt(0)=='\\' && tData.charAt(1)=='x'){ - String numData = tData.substring(2,4); - retval[i] = (byte) Integer.parseInt(numData,16); - tData = tData.substring(4,tData.length()); - } - } - return i; - } - public void defineMapping(String from, String to) { - table.put(from, to); - backTable = null; - } - - public void undefineMapping(String from) { - table.remove(from); - backTable = null; - } - - public void swap() { - Hashtable newTable = new Hashtable(); - Enumeration enum = table.keys(); - while (enum.hasMoreElements()) { - String key = (String)enum.nextElement(); - String code = (String)table.get(key); - - String newKey = toSymbol(code); - String newCode = toLiteral(key); - String prevCode = (String)newTable.get(newKey); - if (prevCode == null || prevCode.compareTo(newCode) > 0) { - newTable.put(newKey, newCode); - } - } - table = newTable; - } - - private String toLiteral(String code) { - String data = code.substring(2,code.length()-1); - int digit = Integer.parseInt(data, 16); - return "" + (char)digit; - } - - private String toSymbol(String code) { - StringBuffer escapeBuffer = new StringBuffer(); - escapeBuffer.append(">"); - for (int i = 0; i < code.length(); i++) { - int value = ((int)code.charAt(i)) & 0xFFFF; - while ((value > 0) || (escapeBuffer.length() < 5)) { - char digit = Character.forDigit(value % 16, 16); - escapeBuffer.append(digit); - value >>= 4; - } - } - escapeBuffer.append("U<"); - escapeBuffer.reverse(); - return escapeBuffer.toString(); - } - - public void dump(PrintStream out) { - StringBuffer escapeBuffer = new StringBuffer(); - Enumeration enum = table.keys(); - while (enum.hasMoreElements()) { - String key = (String)enum.nextElement(); - String code = (String)table.get(key); - out.print(key); - out.print(" 0) || (escapeBuffer.length() < 4)) { - char digit = Character.forDigit(value % 16, 16); - escapeBuffer.append(digit); - value >>= 4; - } - escapeBuffer.reverse(); - out.print(escapeBuffer.toString()); - } - out.println(">"); - } - } - - public String mapKey(final String key) { - String result = (String)table.get(key); - if (result == null) { - if (parentMap != null) { - result = parentMap.mapKey(key); - } else { - result = key; - } - } - return result; - } - - public String backmapValue(final String value) { - if (backTable == null) { - backTable = new Hashtable(); - Enumeration enum = table.keys(); - while (enum.hasMoreElements()) { - String key = (String)enum.nextElement(); - String val = (String)table.get(key); - backTable.put(val, key); - } - } - String result = (String)backTable.get(value); - if (result == null) { - if (parentMap != null) { - result = parentMap.backmapValue(value); - } else { - result = value; - } - } - return result; - } - - public Enumeration keys() { - return table.keys(); - } - - public Enumeration elements() { - return table.elements(); - } - - public static void main(String args[]) { - try { - PosixCharMap map1 = new PosixCharMap( - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps", - "IBM-1129.UPMAP100.txt"); - map1.swap(); - map1.dump(System.out); - - SymbolTransition.setCharMap(map1); - System.out.println(); System.out.println(); - - //PosixCharMap map = new PosixCharMap("C:\\projects\\data\\ISO-8859-1.html"); - PosixCharMap map = new PosixCharMap( - "C:\\projects\\com\\taligent\\localeconverter\\CharMaps", - "ibm1129.txt"); - map.dump(System.out); - System.out.println(); - } catch (Exception e) { - System.out.println(e); - } - } -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/PosixCollationBuilder.java b/icu4j/src/com/ibm/tools/localeconverter/PosixCollationBuilder.java deleted file mode 100755 index 2463d67a4f..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/PosixCollationBuilder.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/PosixCollationBuilder.java,v $ - * $Date: 2002/01/31 01:22:24 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ - -package com.ibm.tools.localeconverter; -import com.ibm.text.*; -import java.io.*; -import java.util.*; - -class PosixCollationBuilder { - private static final int MAX_WEIGHTS = 4; - private static final int MAX_COMPOSITION = 4; - private static int nextCharNumber = 1; - private Hashtable weightSymbols = new Hashtable(); - private Hashtable contractions = new Hashtable(); - private Hashtable rules = new Hashtable(); - private CollationRule lastRule = null; - private PosixCharMap map; - private SortedVector order; - private static int FIRST_WEIGHT_CHAR = 0x0000F7FF; - private int nextWeightChar = FIRST_WEIGHT_CHAR; - private CollationRule ignoreRule; //rule for the collating-symbol IGNORE - - public class CollationRule { - int charNumber; - String value; - int nextWeight = 0; - String[] weightSource = new String[MAX_WEIGHTS]; - int weight[][] = null; - StringBuffer source = new StringBuffer(); - - public CollationRule(String symbol) { - charNumber= nextCharNumber++; - value = symbol; - for (int i = 0; i < MAX_WEIGHTS; i++) { - weightSource[i] = symbol; - } - source.append(map.backmapValue(symbol)); - source.append("\t\t"); - } - private CollationRule(CollationRule other, int composition) { - charNumber = other.charNumber; - value = other.value; - nextWeight = other.nextWeight; - for (int i = 0; i < MAX_WEIGHTS; i++) { - String source = other.weightSource[i]; - if (source.length() > composition) { - weightSource[i] = ""+source.charAt(composition); - } else { - weightSource[i] = value; - } - } - } - //HexToUnicodeTransliterator myTranslit = new HexToUnicodeTransliterator(""); - public void addWeight(String symbol) { - // ReplaceableString tSymbol = new ReplaceableString(symbol); - // myTranslit.transliterate(tSymbol); - //limit the size of a single weight - if (symbol.length() > MAX_COMPOSITION) { - System.err.println("WARNING: Weights of composition greater than "+MAX_COMPOSITION+" were truncated."); - symbol = symbol.substring(0, MAX_COMPOSITION); - } - //limit the number of weights - if (nextWeight < MAX_WEIGHTS) { - if (nextWeight > 0) { - source.append(";"); - } - for (int i = 0; i < symbol.length(); i++) { - source.append(map.backmapValue(""+symbol.charAt(i))); - } - weightSource[nextWeight++] = symbol; - weight = null; - } - } - public int compare(CollationRule other) { - if (other == null) return compare(ignoreRule); - resolveWeights(); - other.resolveWeights(); - int compareSize = Math.min(getSize(), other.getSize()); - for (int j = 0; j < compareSize; j++) { - for (int i = 0; i < MAX_WEIGHTS; i++) { - int diff = weight[j][i] - other.weight[j][i]; - if (diff < 0) { - return -(i+1); - } if (diff > 0) { - return i+1; - } - } - } - return getSize() - other.getSize(); - } - public boolean isMultiWeight() { - return getSize() > 1; - } - public int getSize() { - int size = 0; - for (int i = 1; i < weightSource.length; i++) { - size = Math.max(size, weightSource[i].length()); - } - return size; - } - public CollationRule getComponent(int ndx) { - return new CollationRule(this, ndx); - } - public String getValue() { - return value; - } - public String getSymbol() { - String newValue = isContraction(); - if (newValue != null) { - return newValue; - } else { - newValue = isWeightSymbol(); - if (newValue != null) { - return newValue; - } else { - return value; - } - } - } - public String getSource() { - return source.toString(); - } - private String isContraction() { - return (String)contractions.get(value); - } - private String isWeightSymbol() { - return (String)weightSymbols.get(value); - } - public CollationRule seeksToRule() { - CollationRule comp; - if (getSize() <= 1) { - comp = this; //save an object creation - } else { - comp = getComponent(0); - } - int ndx = order.indexOf(comp); - if (ndx == 0) { - return this; - } else { - CollationRule exp; - do { - exp = (CollationRule)order.elementAt(ndx--); - } while (ndx > 0 && exp.getSize() > 1); - return exp; - } - } - public String getExpansion() { - if (getSize() <= 1) { - return null; - } else { - StringBuffer expansion = new StringBuffer(); - for (int j = 0; j < getSize(); j++) { - CollationRule comp = getComponent(j); - int ndx = order.indexOf(comp); - CollationRule exp; - do { - exp = (CollationRule)order.elementAt(ndx--); - } while (ndx >= 0 && exp.getSize() > 1); - expansion.append(exp.getSymbol()); - } - return expansion.toString(); - } - } - public String toString() { - return source.toString(); -/* resolveWeights(); - StringBuffer buf = new StringBuffer(); - buf.append(charNumber); - buf.append(' '); - buf.append(value); - buf.append(' '); - buf.append(getSymbol()); - buf.append(' '); - buf.append((isWeightSymbol() != null)?"W":" "); - buf.append(' '); - for (int i = 0; i < MAX_WEIGHTS; i++) { - buf.append(weightSource[i]); - buf.append(' '); - } - for (int i = 0; i < getSize(); i++) { - buf.append("[ "); - for (int j = 0; j < MAX_WEIGHTS; j++) { - int w = weight[i][j]; - buf.append(w); - buf.append(' '); - } - buf.append(']'); - } - return buf.toString(); -*/ - } - private void resolveWeights() { - if (weight == null) { - weight = new int[MAX_COMPOSITION][MAX_WEIGHTS]; - for (int j = 0; j < MAX_WEIGHTS; j++) { - String symbol = weightSource[j]; - if (symbol.length() <= 1) { - weight[0][j] = ordinalityOf(symbol); - } else { - for (int i = 0; i < symbol.length(); i++) { - char c = symbol.charAt(i); - weight[i][j] = ordinalityOf(""+c); - } - } - } - } - } - } - - public PosixCollationBuilder(PosixCharMap map) { - this.map = map; - String ignoreSymbol = defineWeightSymbol("IGNORE"); - ignoreRule = new CollationRule(ignoreSymbol); - rules.put(ignoreSymbol, ignoreRule); - lastRule = ignoreRule; - //{{INIT_CONTROLS - //}} -} - - public String defineWeightSymbol(String symbol) { - order = null; - String c = nextFreeWeightChar(); - map.defineMapping(symbol, c); - weightSymbols.put(c, symbol); - weightSymbols.put(symbol, c); - return c; - } - - public String defineContraction(String symbol, String value) { - order = null; - String c = nextFreeWeightChar(); - map.defineMapping(symbol, c); - contractions.put(c, value); - return c; - } - - private String nextFreeWeightChar() { - String result = ""; - String mappedSource; - do { - result = ""+(char)nextWeightChar--; - mappedSource = map.backmapValue(result); - } while (result != mappedSource); - return result; - } - - public int ordinalityOf(String symbol) { -// HexToUnicodeTransliterator newTranslit = new HexToUnicodeTransliterator(); -// ReplaceableString tSymbol = new ReplaceableString(symbol); -// newTranslit.transliterate(tSymbol); - CollationRule w = (CollationRule)rules.get(symbol); - if (w != null) { - return w.charNumber; - } else { - System.err.print("ERROR: Weight symbol not found: "); - for (int i = 0 ; i < symbol.length(); i++) { - char c = symbol.charAt(i); - System.err.print("\\u"); - System.err.print(HEX_DIGIT[(c & 0x0F000) >> 12]); // HEX_DIGIT works for octal - System.err.print(HEX_DIGIT[(c & 0x0F00) >> 8]); // HEX_DIGIT works for octal - System.err.print(HEX_DIGIT[(c & 0x00F0) >> 4]); - System.err.println(HEX_DIGIT[(c & 0x000F)]); - } - System.err.println(" Weight given maximum possible value."); - return Integer.MAX_VALUE; - } - } -// HexToUnicodeTransliterator myTranslit = new HexToUnicodeTransliterator(""); - public void addRule(String symbol) { - // ReplaceableString tSymbol = new ReplaceableString(symbol); - // myTranslit.transliterate(tSymbol); - if (symbol.length() > 1) { - System.err.println("WARNING: Undefined element '"+symbol+"'. collating-symbol generated."); - symbol = defineWeightSymbol(symbol); - } - - order = null; - lastRule = new CollationRule(symbol); - rules.put(symbol, lastRule); - } - - public void addRule(CollationRule rule) { - order = null; - lastRule = rule; - rules.put(rule.value, rule); - } - - public void addWeight(String weight) { - if (weight.length() > 1) { - //check to see if it's a bogus weight symbol. - weight = map.mapKey(weight); - } - order = null; - lastRule.addWeight(weight); - } - - public Enumeration getRules() { - return rules.elements(); - } - - public SortedVector getSortOrder() { - if (order == null) { - order = new SortedVector( - new Comparator() { - public int compare(final Object i, final Object j) { - final CollationRule o1 = (CollationRule)i; - final CollationRule o2 = (CollationRule)j; - final boolean w1 = o1.isWeightSymbol() != null; - final boolean w2 = o2.isWeightSymbol() != null; - //sort weights first - if (w1 && !w2) { - return -1; - } else if (!w1 && w2) { - return 1; - } else { - return o1.compare(o2); - } - } - } - ); - order.addElements(rules.elements()); - //remove weight symbols from the list - int i; - for (i = 0; i < order.size(); i++) { - CollationRule r = (CollationRule)order.elementAt(i); - if (r.isWeightSymbol() == null) { - break; - } - } - order.removeElements(0, i); - } - return order; - } - - static final char[] HEX_DIGIT = {'0','1','2','3','4','5','6','7', - '8','9','A','B','C','D','E','F'}; - //{{DECLARE_CONTROLS - //}} -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/PosixToNeutralConverter.java b/icu4j/src/com/ibm/tools/localeconverter/PosixToNeutralConverter.java deleted file mode 100755 index 7966569754..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/PosixToNeutralConverter.java +++ /dev/null @@ -1,1247 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/PosixToNeutralConverter.java,v $ - * $Date: 2002/01/31 02:47:28 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; -import com.ibm.text.*; -import java.io.*; -import java.util.*; - -public class PosixToNeutralConverter extends LocaleConverter { - public static final byte LC_CTYPE = 0x01; - public static final byte LC_TIME = 0x02; - public static final byte LC_NUMERIC = 0x04; - public static final byte LC_MONETARY = 0x08; - public static final byte LC_MESSAGES = 0x10; - public static final byte LC_MEASUREMENT = 0x11; - public static final byte LC_ADDRESS = 0x12; - public static final byte LC_PAPER = 0x13; - public static final byte LC_NAME = 0x14; - public static final byte LC_IDENTIFICATION = 0x15; - public static final byte LC_TELEPHONE = 0x16; - public static final HexToUnicodeTransliterator myTranslit = new HexToUnicodeTransliterator(); - - private static final byte[] masks = { - LC_CTYPE, LC_TIME, LC_NUMERIC, LC_MONETARY, LC_MESSAGES, - LC_MEASUREMENT,LC_ADDRESS,LC_PAPER,LC_NAME,LC_IDENTIFICATION, - LC_TELEPHONE - }; - - private static final String[][] props = { - //LC_CTYPE - { - "upper", "lower", "alpha", "digit", "space", "cntrl", - "punct", "graph", "print", "xdigit", "blank", - "toupper", "tolower" - }, - //LC_TIME - { - "abday", "day", "abmon", "mon", "d_t_fmt", "d_ftm", "t_fmt", - "am_pm", "t_fmt_ampm", "era", "era_year", "era_d_fmt", "alt_digits" - }, - //LC_NUMERIC - { - "decimal_point", "thousands_sep", "grouping" - }, - //LC_MONETARY - { - "int_curr_symbol", "currency_symbol", "mon_decimal_point", - "mon_thousands_sep", "mon_grouping", "positive_sign", - "negative_sign", "int_frac_digits", "frac_digits", "p_cs_precedes", - "p_sep_by_space", "n_cs_precedes", "n_sep_by_space", "p_sign_posn", - }, - //LC_MESSAGES - { - "yesexpr", "noexpr" - }, - - //LC_MEASUREMENT - { - "measurement" - }, - //LC_ADDRESS - { - "copy","postal_fmt","country_name","country_post", - "country_ab2","country_ab3","country_num","country_car", - "country_isbn","lang_name","lang_ab","lang_term","lang_lib" - - }, - //LC_PAPER - { - "height","width","copy" - }, - //LC_NAME - { - "copy","name_fmt","name_gen","name_miss","name_mr","name_mrs","name_ms" - }, - //LC_IDENTIFICATION - { - "title","source","address","contact","email","tel","fax","language", - "territory","revision ","date" - }, - //LC_TELEPHONE - { - "copy","tel_int_fmt","tel_dom_fmt","int_select","int_prefix" - }, - - - }; - private final byte flags; - private final Locale locale; - private final Locale parentLocale; - private final String sfileName; - public PosixToNeutralConverter(byte flags, final Locale locale,final String fileName) { - this.flags = flags; - this.locale = locale; - this.sfileName=fileName; - myTranslit.applyPattern(""); - String language = locale.getLanguage(); - String country = locale.getCountry(); - String variant = ""; - - int ndx = language.indexOf('_'); - if (ndx >= 0) { - country = language.substring(ndx+1); - language = language.substring(0, ndx); - } - ndx = country.indexOf('_'); - if (ndx >= 0) { - variant = country.substring(ndx); - country = country.substring(0, ndx); - } - - if ("".equals(country)) { - language = ""; - variant = ""; - } else if ("".equals(variant)) { - country = ""; - } - - parentLocale = new Locale(language, country, variant); - //{{INIT_CONTROLS - //}} - } - - protected void convert(final Hashtable result, final Hashtable source) - throws ConversionError { -// convertMESSAGES(result,source); - writePosixCompData(result,source); - convertMEASUREMENT(result, source); - convertCOUNTRYNUMBER(result, source); - convertCOUNTRYISBNNUMBER(result, source); - convertLANGUAGELIB(result, source); - convertPAPERSIZE(result, source); - convertMONETARY(result, source); - convertNUMERIC(result, source); - convertTIME(result, source); - convertCOLLATE(result, source); - for (int i = 0; i < masks.length; i++) { - if ((flags & masks[i]) != 0) { - for (int j = 0; j < props[i].length; j++) { - final String prop = props[i][j]; - final Object val = source.get(prop); - if (val != null) { - resultPut(result, prop, val); - } - } - } - } - } - public String[][] clone2DArr(String[][]str2Darray){ - String[][] newStr2DArr = new String[str2Darray.length][str2Darray[0].length]; - for(int i=0; i"); - patterns[0] = replace(patterns[0], elements[1], ""); - patterns[0] = replace(patterns[0], "", decimalPoint); - patterns[0] = replace(patterns[0], "", thousandsSep); - - patterns[2] = replace(patterns[2], elements[1], ""); - patterns[2] = replace(patterns[2], "", thousandsSep); - } else { - final int grouping = Integer.parseInt(groupingString); - //for a grouping of 5 - //#####0##### - final StringBuffer pattern = new StringBuffer(); - pattern.append(patternDigit); - pattern.append(thousandsSep); - for (int i = Math.max(1, grouping - 1); i > 0; i--) { - pattern.append(patternDigit); - } - pattern.append(zeroDigit); - pattern.append(decimalPoint); - for (int i = Math.max(1, grouping - 1); i >= 0; i--) { - pattern.append(patternDigit); - } - final String patternString = pattern.toString(); - patterns[0] = patternString + ";" + negativeSign + patternString; - - pattern.setLength(0); - pattern.append(patternDigit); - pattern.append(thousandsSep); - for (int i = Math.max(1, grouping - 1); i > 0; i--) { - pattern.append(patternDigit); - } - pattern.append(zeroDigit); - pattern.append(percentSign); - patterns[2] = pattern.toString(); - - final String[] currencyElements = ((String[])getDefault("CurrencyElements")); - String currency_symbol = (String)source.get("currency_symbol"); - currency_symbol = (currency_symbol != null) ? currency_symbol : (String)source.get("int_curr_symbol"); - currency_symbol = (currency_symbol != null) ? currency_symbol : ""; - - String mon_decimal_point = (String)source.get("mon_decimal_point"); - mon_decimal_point = (mon_decimal_point != null) ? mon_decimal_point : ""; - - String mon_thousands_sep = (String)source.get("mon_thousands_sep"); - mon_thousands_sep = (mon_thousands_sep != null) ? mon_thousands_sep : ""; - - String mon_grouping_string; - final Object monGroupingObj = source.get("mon_grouping"); - if (monGroupingObj instanceof String[]) { - mon_grouping_string = ((String[])monGroupingObj)[0]; - } else { - mon_grouping_string = (String)monGroupingObj; - } - final int mon_grouping = (mon_grouping_string == null) ? grouping : Integer.parseInt(mon_grouping_string); - - final String frac_digits_string = (String)source.get("frac_digits"); - final int frac_digits = (frac_digits_string == null) ? mon_grouping : Integer.parseInt(frac_digits_string); - - String positive_sign = (String)source.get("positive_sign"); - positive_sign = (positive_sign != null) ? positive_sign : ""; - - String negative_sign = (String)source.get("negative_sign"); - negative_sign = (negative_sign != null) ? negative_sign : ""; - - String p_sign_posn = (String)source.get("p_sign_posn"); - p_sign_posn = (p_sign_posn != null) ? p_sign_posn : ""; - - String n_sign_posn = (String)source.get("n_sign_posn"); - n_sign_posn = (n_sign_posn != null) ? n_sign_posn : ""; - - final boolean p_cs_precedes = !"0".equals(source.get("p_cs_precedes")); - final String p_sep_by_space = (String)source.get("p_sep_by_space"); - final boolean n_cs_precedes = !"0".equals(source.get("n_cs_precedes")); - final String n_sep_by_space = (String)source.get("n_sep_by_space"); - - pattern.setLength(0); - -/* - patterns[1] = - createPatternString(currency_symbol, mon_decimal_point, mon_thousands_sep, mon_grouping, frac_digits, - positive_sign, p_cs_precedes, p_sep_by_space, p_sign_posn, patternDigit, zeroDigit) - + ";" - + createPatternString(currency_symbol, mon_decimal_point, mon_thousands_sep, mon_grouping, frac_digits, - negative_sign, n_cs_precedes, n_sep_by_space, n_sign_posn, patternDigit, zeroDigit); -*/ - -/* patterns[1] = - createPatternString(currency_symbol, ".", ",", mon_grouping, frac_digits, - positive_sign, p_cs_precedes, p_sep_by_space, p_sign_posn, patternDigit, zeroDigit) - + ";" - + createPatternString(currency_symbol, ".", ",", mon_grouping, frac_digits, - negative_sign, n_cs_precedes, n_sep_by_space, n_sign_posn, patternDigit, zeroDigit); -*/ - patterns[1] = - createPatternString(".", ",", mon_grouping, frac_digits, - positive_sign, p_cs_precedes, p_sep_by_space, p_sign_posn, patternDigit, zeroDigit) - + ";" - + createPatternString(".", ",", mon_grouping, frac_digits, - negative_sign, n_cs_precedes, n_sep_by_space, n_sign_posn, patternDigit, zeroDigit); - - } - resultPut(result, "NumberPatterns", patterns); - } - - /** - * This routine creates currency formats from all the posix stuff. - */ - private String createPatternString(String decimal, String thousands, int grouping, int fracDigits, - String sign, boolean preceeds, String sep_by_space, String sign_posn, String digit, - String requiredDigit) { - StringBuffer buffer = new StringBuffer(); - final String currency = "\u00A4"; - if ("2".equals(sep_by_space) && ("".equals(currency) || "".equals(sign))) { - sep_by_space = "0"; - } - if ("1".equals(sep_by_space) && "".equals(currency)) { - sep_by_space = "0"; - } - - final String sign_currency_seperator = ("2".equals(sep_by_space)) ? " " : ""; - final String quantity_currency_seperator = ("1".equals(sep_by_space)) ? " " : ""; - - if ("0".equals(sign_posn)) { - buffer.append('('); - } - if ("1".equals(sign_posn)) { - buffer.append(sign); - if (preceeds) { - buffer.append(sign_currency_seperator); - } - } - if (preceeds) { - if ("3".equals(sign_posn)) { - buffer.append(sign); - buffer.append(sign_currency_seperator); - } - buffer.append(currency); - if ("4".equals(sign_posn)) { - buffer.append(sign_currency_seperator); - buffer.append(sign); - } - buffer.append(quantity_currency_seperator); - } - - buffer.append(digit); - if (grouping > 0) { - buffer.append(thousands); - for (int i = grouping-1; i > 0; i--) { - buffer.append(digit); - } - } - buffer.append(requiredDigit); - buffer.append(decimal); - if (fracDigits > 0) { - for (int i = fracDigits-1; i >= 0; i--) { - buffer.append(requiredDigit); - } - } else { - buffer.append(digit); - } - - if (!preceeds) { - buffer.append(quantity_currency_seperator); - if ("1".equals(sign_posn)) { - buffer.append(sign_currency_seperator); - } - if ("3".equals(sign_posn)) { - buffer.append(sign); - buffer.append(sign_currency_seperator); - } - buffer.append(currency); - if ("4".equals(sign_posn)) { - buffer.append(sign_currency_seperator); - buffer.append(sign); - } - } - if ("2".equals(sign_posn)) { - buffer.append(sign_currency_seperator); - buffer.append(sign); - } - if ("0".equals(sign_posn)) { - buffer.append(')'); - } - - return buffer.toString(); - } - - private void convertTIME(Hashtable result, Hashtable source) { - resultPut(result, "DayNames", source.get("day")); - resultPut(result, "DayAbbreviations", source.get("abday")); - String[] temp = (String[])source.get("am_pm"); - if (temp != null) { - final String[] defaultAMPM = (String[])getDefault("AmPmMarkers"); - if ("".equals(temp[0])) temp[0] = defaultAMPM[0]; - if ("".equals(temp[1])) temp[1] = defaultAMPM[1]; - resultPut(result, "AmPmMarkers", temp); - } - - temp = (String[])source.get("mon"); - if (temp != null) { - //add empty 13th month - String[] newTemp = new String[13]; - System.arraycopy(temp, 0, newTemp, 0, 12); - newTemp[12] = ""; - resultPut(result, "MonthNames", newTemp); - } - temp = (String[])source.get("abmon"); - if (temp != null) { - //add empty 13th month - String[] newTemp = new String[13]; - System.arraycopy(temp, 0, newTemp, 0, 12); - newTemp[12] = ""; - resultPut(result, "MonthAbbreviations", newTemp); - } - - final String t_fmt_ampm = (String)source.get("t_fmt_ampm"); - final String t_fmt = (String)source.get("t_fmt"); - final String d_t_fmt = (String)source.get("d_t_fmt"); - final String d_fmt = (String)source.get("d_fmt"); - final String nlldate = (String)source.get("nlldate"); //non-standard IBM thing - - final String DEFAULT_DATETIME_ELEMENTS[] = (String[])getDefault("DateTimePatterns"); - final String[] elements = (String[])DEFAULT_DATETIME_ELEMENTS.clone(); - final String X_pattern = elements[3]; - final String x_pattern = elements[7]; - final String c_pattern = elements[4] + " " + elements[0]; - - elements[0] = (t_fmt_ampm != null && t_fmt_ampm.length() > 0) ? t_fmt_ampm : t_fmt; - elements[1] = (t_fmt != null) ? t_fmt : t_fmt_ampm; - elements[2] = (t_fmt != null) ? t_fmt : t_fmt_ampm; - elements[3] = (t_fmt != null) ? t_fmt : t_fmt_ampm; - - String longishDateFormat = (nlldate != null) ? nlldate : d_fmt; - if (d_t_fmt != null) { - if (t_fmt != null) { - //try to build a detailed data format by taking the - //date-time format and removing the time portion - int ndx = d_t_fmt.indexOf(t_fmt); - if (ndx >= 0) { - if (ndx < (d_t_fmt.length() - t_fmt.length())/2) { - elements[8] = "{0} {1}"; - } - - longishDateFormat = replace(d_t_fmt, t_fmt, ""); - longishDateFormat = replace(longishDateFormat, "%Z", ""); - longishDateFormat = replace(longishDateFormat, " ", " "); - longishDateFormat = replace(longishDateFormat, " ", " "); - if (longishDateFormat.charAt(0) == ' ') { - longishDateFormat = longishDateFormat.substring(1); - } - longishDateFormat.trim(); - } - } - } - elements[4] = longishDateFormat; - elements[5] = d_t_fmt; - elements[6] = (nlldate != null) ? nlldate : d_fmt; - elements[7] = d_fmt; - - for (int i = 0; i < 8; i++) { - if (elements[i] != null) { - elements[i] = convertFormats(elements[i], X_pattern, x_pattern, c_pattern); - } else { - elements[i] = DEFAULT_DATETIME_ELEMENTS[i]; - } - } - resultPut(result, "DateTimePatterns", elements); - } - - private String convertFormats(String pattern, String X_pattern, - String x_pattern, String c_pattern) { - - HexToUnicodeTransliterator huTranslit =myTranslit; - huTranslit.applyPattern(""); - ReplaceableString tempStr = new ReplaceableString(); - tempStr.replace(0,tempStr.length(),pattern); - huTranslit.transliterate(tempStr); - String tpattern = tempStr.toString(); - StringBuffer result = new StringBuffer(); - for (int i = 0; i < tpattern.length(); i++) { - char c = tpattern.charAt(i); - if (c != '%') { - result.append(c); - } else { - i++; - c = tpattern.charAt(i); - switch (c) { - case 'a': - result.append("EEE"); - break; - case 'A': - result.append("EEEE"); - break; - case 'b': - result.append("MMM"); - break; - case 'B': - result.append("MMMM"); - break; - case 'c': - result.append(c_pattern); - break; - case 'C': //** hey {jf} - this is supposed to be the century only. - result.append("YYYY"); - break; - case 'd': - result.append("dd"); - break; - case 'D': - result.append("mm/dd/yy"); - break; - case 'e': - result.append("dd"); - break; - case 'h': - result.append("MMM"); - break; - case 'H': - result.append("HH"); - break; - case 'I': - result.append("hh"); - break; - case 'j': - result.append("DDD"); - break; - case 'm': - result.append("MM"); - break; - case 'M': - result.append("mm"); - break; - case 'n': - result.append('\n'); - break; - case 'p': - result.append("aa"); - break; - case 'r': - result.append(convertFormats("%I:%M:%S %p", X_pattern, x_pattern, c_pattern)); - break; - case 'S': - result.append("ss"); - break; - case 't': - result.append('\t'); - break; - case 'T': - result.append(convertFormats("%I:%M:%S", X_pattern, x_pattern, c_pattern)); - break; - case 'U': - result.append("ww"); - break; - case 'w': - result.append("E"); - break; - case 'W': - result.append("ww"); - break; - case 'x': - result.append(x_pattern); - break; - case 'X': - result.append(X_pattern); - break; - case 'y': - result.append("yy"); - break; - case 'Y': - result.append("yyyy"); - break; - case 'Z': - result.append("z"); - break; - case '%': - result.append("%"); - break; - default: - result.append('%'); - result.append(c); - break; - } - } - } - return result.toString(); - } - - private void convertCOLLATE(Hashtable result, Hashtable source) { - String[] sortOrder = (String[])source.get("sort_order"); - HexToUnicodeTransliterator huTranslit =myTranslit; - huTranslit.applyPattern(""); - ReplaceableString tempStr = new ReplaceableString(); - //tempStr.replace(0,tempStr.length(),sortOrder); - final Object[][] DEFAULT_COLLATION=(Object[][]) getDefault("CollationElements"); - final Object[][] elements=(Object[][])clone2DArr(DEFAULT_COLLATION); - huTranslit.transliterate(tempStr); - if (sortOrder != null) { - if (!"forward".equals(sortOrder[0])) { - System.err.println("ERROR: Unsupported primary sort order: "+sortOrder[0]); - } - if (sortOrder.length == 2 && !"forward".equals(sortOrder[1]) && !"backward".equals(sortOrder[1])) { - System.err.println("ERROR: Unsupported secondary sort order: "+sortOrder[1]); - } - if (sortOrder.length == 3 && !"forward".equals(sortOrder[2])) { - System.err.println("ERROR: Unsupported tertiary sort order: "+sortOrder[2]); - } - if (sortOrder.length > 3) { - System.err.println("WARNING: Sort levels of order greater than three ignored."); - } - } - - PosixCollationBuilder.CollationRule[] ruleSource = - (PosixCollationBuilder.CollationRule[])source.get("posix_sort_rules"); - - if (ruleSource != null) { - //allocate a list of collationItems. Add an extra entry for secondary ordering - CollationItem[] rules = new CollationItem[ruleSource.length+1]; - PosixCollationBuilder.CollationRule prevRule = null; - //add all the rules for non-expanding characters - int i = 0; - for (int ndx = 0; ndx < ruleSource.length; ndx++) { - PosixCollationBuilder.CollationRule rule = ruleSource[ndx]; - //add non-expanding characters to the sort list - if (rule.getSize() <= 1) { - int diff; - if (prevRule == null) { - //if it's the first rule, don't compare to anything, - //seek back so it can be appended to the default rules - rules[i] = new CollationItem(rule.getSymbol()); - } else { - //compare to previous item - diff = prevRule.compare(rule); - rules[i] = new CollationItem(diff, rule.getSymbol()); - } - rules[i++].setComment(rule.getSource()); - prevRule = rule; - } - } - //add rules for expanding characters - String prevSeek = null; - prevRule = null; - for (int ndx = 0; ndx < ruleSource.length; ndx++) { - PosixCollationBuilder.CollationRule rule = ruleSource[ndx]; - if (rule.getSize() > 1) { - //find out what this character expands to - String seek = rule.getExpansion(); - if (!seek.equals(prevSeek)) { - //if it's not the same as the previous character - //then seek to the first character of the expansion - //and compare to that - PosixCollationBuilder.CollationRule seekRule = rule.seeksToRule(); - rules[i] = new CollationItem( - seekRule.compare(rule), rule.getSymbol(), rule.getExpansion()); - prevSeek = seek; - } else if (prevRule != null) { - //it expands to the same characters as the previous expansion, - //so compare to the previous expansion - rules[i] = new CollationItem( - prevRule.compare(rule), rule.getSymbol(), prevRule.getSymbol()); - } else { - //The unlikely case that the first character will - //be an expanding character...I don't think - //this is even possible... - rules[i] = new CollationItem(rule.getSymbol()); - } - rules[i++].setComment(rule.getSource()); - } - prevRule = rule; - } - if ("backward".equals(sortOrder[1])) { - elements[1][1] = "true"; - } else { - elements[1][1] = "false"; - } - elements[2][1]=(Object)rules; - resultPut(result, "CollationElements", elements); - } - } - - private void resultPut(Hashtable resultTable, String tag, Object value) { - if (value == null) return; - resultTable.put(tag, value); - } - - private Object getDefault(String desiredResource) { - return getParentBundle().getObject(desiredResource); - } - - private ResourceBundle getParentBundle() { - return ResourceBundle.getBundle("com.ibm.tools.localeconverter.myLocaleElements", parentLocale); - } - - private String replace(String source, String target, String replacement) { - if (target.equals(replacement)) { - return source; - } else { - StringBuffer result = new StringBuffer(); - int lastNdx = 0; - int ndx = source.indexOf(target); - while (ndx >= 0) { - result.append(source.substring(lastNdx, ndx)); - result.append(replacement); - ndx += target.length(); - lastNdx = ndx; - ndx = source.indexOf(target, ndx); - } - result.append(source.substring(lastNdx)); - return result.toString(); - } - } - //{{DECLARE_CONTROLS - //}} -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/localeconverter/QuoteTransition.java b/icu4j/src/com/ibm/tools/localeconverter/QuoteTransition.java deleted file mode 100755 index 8d9f928ac4..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/QuoteTransition.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/QuoteTransition.java,v $ - * $Date: 2002/01/31 01:22:25 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -public class QuoteTransition extends ComplexTransition { - public static final QuoteTransition GLOBAL = new QuoteTransition(SUCCESS); - - public static final char STRING_CHAR = '"'; - - public QuoteTransition(int success) { - super(success); - //{{INIT_CONTROLS - //}} - } - public boolean accepts(int c) { - return STRING_CHAR == (char)c; - } - protected Lex.Transition[][] getStates() { - return states; - } - private static final Lex.Transition[][] states = { - { //state 0: - new Lex.CharTransition(STRING_CHAR, Lex.IGNORE_CONSUME, -1), - new Lex.ParseExceptionTransition("illegal character in quoted string") - }, - { //state 1: - new Lex.CharTransition(STRING_CHAR, Lex.IGNORE_CONSUME, SUCCESS), - new Lex.StringTransition(EOLTransition.EOL_CHARS, Lex.IGNORE_CONSUME, -2), - new EscapeTransition(-1), - new SymbolTransition(-1), - new Lex.EOFTransition(-2), - new Lex.DefaultTransition(Lex.ACCUMULATE_CONSUME, -1) - }, - { //state 2: failure from eof - new Lex.ParseExceptionTransition("unterminated string") - } - }; - - public static void main(String args[]) { - try { - Lex.Transition[][] states = {{ - new QuoteTransition(SUCCESS), - new Lex.EOFTransition(), - new Lex.ParseExceptionTransition("bad test input") - }}; - EscapeTransition.setEscapeChar('/'); - String text = "\"hello<\"/>>/d32world\"\"/\n\""; - StringReader sr = new StringReader(text); - PushbackReader pr = new PushbackReader(sr); - Lex parser = new Lex(states, pr); - //parser.debug(true); - int s = parser.nextToken(); - while (s == SUCCESS) { - System.out.println(parser.getData()); - s = parser.nextToken(); - } - } catch (Exception e) { - System.out.println(e); - } - } - //{{DECLARE_CONTROLS - //}} -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/RangeTransition.java b/icu4j/src/com/ibm/tools/localeconverter/RangeTransition.java deleted file mode 100755 index 23adeb8959..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/RangeTransition.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/RangeTransition.java,v $ - * $Date: 2002/01/31 01:22:25 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ - -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -public class RangeTransition extends ComplexTransition { - public static final RangeTransition GLOBAL = new RangeTransition(SUCCESS); - public static final String RANGE_CHARS = "..."; - public RangeTransition(int success){ - super(success); - } - - public boolean accepts(int c){ - return RANGE_CHARS.indexOf((char)c) >=0; - } - - protected Lex.Transition[][]getStates(){ - return states; - } - private static final Lex.Transition[][] states= { - - { //state 0: - new Lex.StringTransition(RANGE_CHARS, Lex.IGNORE_CONSUME, -1), - new Lex.ParseExceptionTransition("illegal space character") - }, - { //state 1: - new Lex.EOFTransition(SUCCESS), - new Lex.StringTransition(RANGE_CHARS, Lex.IGNORE_CONSUME, -1), - new Lex.DefaultTransition(Lex.IGNORE_PUTBACK, SUCCESS) - }, - }; -} - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/localeconverter/SortedVector.java b/icu4j/src/com/ibm/tools/localeconverter/SortedVector.java deleted file mode 100755 index 62212870f7..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/SortedVector.java +++ /dev/null @@ -1,356 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/SortedVector.java,v $ - * $Date: 2002/01/31 01:22:25 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.util.Vector; -import java.util.Enumeration; -/** - Implements a sorted vector. You can add anything to it; when you access any element, it sorts - the array internally when necessary. -

    A Comparator is used to compare the elements, allowing arbitrary orderings. - If no Comparator is supplied, then one is constructed based on the type - of the first element added. Only Numbers and Comparables are handled. -

    Duplicates are allowed. -*/ -final public class SortedVector { - /** - Copies elements of vector, enumeration or array - Note: the objects in the source are NOT cloned. - Do not change them or the sorting will be invalid. - */ - public SortedVector(Object[] newValues, Comparator comparator) { - this.comparator = comparator; - addElements(newValues); - //{{INIT_CONTROLS - //}} -} - - public SortedVector(Vector newValues, Comparator comparator) { - this.comparator = comparator; - addElements(newValues); - } - - public SortedVector(Enumeration newValues, Comparator comparator) { - this.comparator = comparator; - addElements(newValues); - } - - public SortedVector(Object[] newValues) { - addElements(newValues); - } - - public SortedVector(Comparator comparator) { - this.comparator = comparator; - } - - public SortedVector(Vector newValues) { - addElements(newValues); - } - - public SortedVector(Enumeration newValues) { - addElements(newValues); - } - - public SortedVector() { - } - - /** - Adds one element. - */ - public void addElement(Object element) { - if (count >= dataArray.length) setCapacity(count*2 + 17); - dataArray[count++] = element; - isValid = false; - } - - /** - Adds multiple elements. Faster than adding one at a time. - */ - public void addElements(Object[] newValues) { - int newCount = count + newValues.length; - if (newCount > dataArray.length) setCapacity(newCount); - for (int i = count; i < newCount; ++i) - dataArray[i] = newValues[i-count]; - count = newCount; - isValid = false; - } - - public void addElements(Vector newValues) { - int newCount = count + newValues.size(); - if (newCount > dataArray.length) setCapacity(newCount); - for (int i = count; i < newCount; ++i) - dataArray[i] = newValues.elementAt(i-count); - count = newCount; - isValid = false; - } - - public void addElements(Enumeration newValues) { - while (newValues.hasMoreElements()) { - addElement(newValues.nextElement()); - } - } - - /** - Removes elements at indices >= startIndex and < endIndex - */ - public void removeElements(int startIndex, int endIndex) { - if (!isValid) validate(); - System.arraycopy(dataArray,endIndex,dataArray,startIndex,count - endIndex); - for (int i = count - (endIndex - startIndex); i < count;++i) - dataArray[i] = null; // free up storage - count -= (endIndex - startIndex); - } - - /** - Sets comparator - */ - public void setComparator(Comparator comparator) { - this.comparator = comparator; - isValid = false; - } - - public Comparator getComparator() { - if (comparator == null) validateComparator(); - return this.comparator; - } - - /** - Gets size, the actual number of elements. - */ - public int size() { - return count; - } - - /** - Gets capacity, the number of elements you can have without growing the array. - */ - public int capacity() { - return dataArray.length; - } - - /** - Sets capacity, the number of elements you can have without growing the array. - */ - public void setCapacity(int newSize) { - Object[] temp = new Object[newSize]; - System.arraycopy(dataArray, 0, temp, 0, Math.min(count,newSize)); - dataArray = temp; - } - - /** - Trims the array. - */ - public void trimToSize() { - setCapacity(count); - } - - /** - Gets the element at the index - */ - public Object elementAt (int index) { - if (!isValid) validate(); - if (index >= count) return dataArray[dataArray.length]; - return dataArray[index]; - } - - /** - Sees whether the vector contains the object - */ - public boolean contains (Object value) { - int index = indexOf(value); - return (index >= 0 && comparator.compare(value,dataArray[index]) == 0); - } - - /** - Gets an enumeration - */ - public Enumeration elements() { - if (!isValid) validate(); - return new ArrayEnumeration(dataArray,0,count); - } - - public void copyInto(Object[] toFill) { - if (!isValid) validate(); - System.arraycopy(dataArray,0,toFill,0,toFill.length); - } - - /** - Finds first index whose value is greater than or equal to searchValue - If there are none, returns -1 - */ - public int indexOf(Object searchValue) - { - if (!isValid) validate(); - int index = startIndex; - if (0 <= comparator.compare(searchValue, dataArray[auxStart])) { - index += auxStart; - } - // very fast, completely unrolled binary search - // each case deliberately falls through to the next - switch (power) { - case 31: if (0 > comparator.compare(searchValue, dataArray[index-0x40000000])) index -= 0x40000000; - case 30: if (0 > comparator.compare(searchValue, dataArray[index-0x20000000])) index -= 0x20000000; - case 29: if (0 > comparator.compare(searchValue, dataArray[index-0x10000000])) index -= 0x10000000; - - case 28: if (0 > comparator.compare(searchValue, dataArray[index-0x8000000])) index -= 0x8000000; - case 27: if (0 > comparator.compare(searchValue, dataArray[index-0x4000000])) index -= 0x4000000; - case 26: if (0 > comparator.compare(searchValue, dataArray[index-0x2000000])) index -= 0x2000000; - case 25: if (0 > comparator.compare(searchValue, dataArray[index-0x1000000])) index -= 0x1000000; - - case 24: if (0 > comparator.compare(searchValue, dataArray[index-0x800000])) index -= 0x800000; - case 23: if (0 > comparator.compare(searchValue, dataArray[index-0x400000])) index -= 0x400000; - case 22: if (0 > comparator.compare(searchValue, dataArray[index-0x200000])) index -= 0x200000; - case 21: if (0 > comparator.compare(searchValue, dataArray[index-0x100000])) index -= 0x100000; - - case 20: if (0 > comparator.compare(searchValue, dataArray[index-0x80000])) index -= 0x80000; - case 19: if (0 > comparator.compare(searchValue, dataArray[index-0x40000])) index -= 0x40000; - case 18: if (0 > comparator.compare(searchValue, dataArray[index-0x20000])) index -= 0x20000; - case 17: if (0 > comparator.compare(searchValue, dataArray[index-0x10000])) index -= 0x10000; - - case 16: if (0 > comparator.compare(searchValue, dataArray[index-0x8000])) index -= 0x8000; - case 15: if (0 > comparator.compare(searchValue, dataArray[index-0x4000])) index -= 0x4000; - case 14: if (0 > comparator.compare(searchValue, dataArray[index-0x2000])) index -= 0x2000; - case 13: if (0 > comparator.compare(searchValue, dataArray[index-0x1000])) index -= 0x1000; - - case 12: if (0 > comparator.compare(searchValue, dataArray[index-0x800])) index -= 0x800; - case 11: if (0 > comparator.compare(searchValue, dataArray[index-0x400])) index -= 0x400; - case 10: if (0 > comparator.compare(searchValue, dataArray[index-0x200])) index -= 0x200; - case 9: if (0 > comparator.compare(searchValue, dataArray[index-0x100])) index -= 0x100; - - case 8: if (0 > comparator.compare(searchValue, dataArray[index-0x80])) index -= 0x80; - case 7: if (0 > comparator.compare(searchValue, dataArray[index-0x40])) index -= 0x40; - case 6: if (0 > comparator.compare(searchValue, dataArray[index-0x20])) index -= 0x20; - case 5: if (0 > comparator.compare(searchValue, dataArray[index-0x10])) index -= 0x10; - - case 4: if (0 > comparator.compare(searchValue, dataArray[index-0x8])) index -= 8; - case 3: if (0 > comparator.compare(searchValue, dataArray[index-0x4])) index -= 4; - case 2: if (0 > comparator.compare(searchValue, dataArray[index-0x2])) index -= 2; - case 1: if (0 > comparator.compare(searchValue, dataArray[index-0x1])) index -= 1; - - case 0: if (0 > comparator.compare(searchValue, dataArray[index])) index -= 1; - } - return index; - } - - // ================= privates ================== - /** Only call if comparator is null - */ - private void validateComparator() { - try { - Object trial = dataArray[0]; - if (trial instanceof Float || trial instanceof Double) { - comparator = new DoubleComparator(); - } else if (trial instanceof Integer) { - comparator = new IntegerComparator(); - } else if (trial instanceof Number) { - comparator = new LongComparator(); - } else if (trial instanceof String) { - comparator = new StringComparator(); - } else { - comparator = new ComparableComparator(); - } - } catch (Exception e) {} // leave null - } - - private void validate() { - if (isValid) return; - // if the Comparator is null, then pick a reasonable one - if (comparator == null) validateComparator(); - - // determine search parameters - - // find least power of 2 greater than count - for (power = exp2.length-1; power > 0 && count < exp2[power]; power--) {} - - // determine the starting point - if (exp2[power] != count) { - auxStart = count - exp2[power]; - } else { - auxStart = 0; - } - startIndex = exp2[power]-1; - - // shell sort. Later, make this a QuickSort - int lo = 0; - int up = count-1; - for (int step = up - lo + 1; step > 1;) { - if (step < 5) - step = 1; - else step = (5 * step - 1) / 11; - for (int i = up - step; i >= lo; --i) { - Object temp = dataArray[i]; - int j; - for (j = i + step; j <= up && 0 > comparator.compare(dataArray[j],temp); j += step) - dataArray[j-step] = dataArray[j]; - dataArray[j-step] = temp; - } - } - isValid = true; - } - - private Object[] dataArray = new Object[16]; - private Comparator comparator; - private int count = 0; - private boolean isValid = false; - private int auxStart; - private int startIndex; - private int power; - private static final int exp2[] = { - 0x1, 0x2, 0x4, 0x8, - 0x10, 0x20, 0x40, 0x80, - 0x100, 0x200, 0x400, 0x800, - 0x1000, 0x2000, 0x4000, 0x8000, - 0x10000, 0x20000, 0x40000, 0x80000, - 0x100000, 0x200000, 0x400000, 0x800000, - 0x1000000, 0x2000000, 0x4000000, 0x8000000, - 0x10000000, 0x20000000, 0x40000000}; - - // Utility Classes - - public static final class LongComparator implements Comparator { - public int compare(Object a, Object b) { - long aa = ((Number)a).longValue(); - long bb = ((Number)b).longValue(); - return (aa < bb ? -1 : aa > bb ? 1 : 0); - } - } - - public static final class IntegerComparator implements Comparator { - public int compare(Object a, Object b) { - return (((Number)a).intValue() - ((Number)b).intValue()); - } - } - - public static final class DoubleComparator implements Comparator { - public int compare(Object a, Object b) { - double aa = ((Number)a).doubleValue(); - double bb = ((Number)b).doubleValue(); - return (aa < bb ? -1 : aa > bb ? 1 : 0); - } - } - - public static final class ComparableComparator implements Comparator { - public int compare(Object a, Object b) { - return ((Comparable)a).compareTo(b); - } - } - - public static final class StringComparator implements Comparator { - public int compare(Object a, Object b) { - return ((String)a).compareTo((String)b); - }; - } - //{{DECLARE_CONTROLS - //}} -} - diff --git a/icu4j/src/com/ibm/tools/localeconverter/SpaceTransition.java b/icu4j/src/com/ibm/tools/localeconverter/SpaceTransition.java deleted file mode 100755 index 0477e39a7b..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/SpaceTransition.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/SpaceTransition.java,v $ - * $Date: 2002/01/31 01:22:25 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -public class SpaceTransition extends ComplexTransition { - public static final SpaceTransition GLOBAL = new SpaceTransition(SUCCESS); - public static final String SPACE_CHARS = " \t"; - - public SpaceTransition(int success) { - super(success); - //{{INIT_CONTROLS - //}} - } - public boolean accepts(int c) { - return SPACE_CHARS.indexOf((char)c) >= 0; - } - protected Lex.Transition[][] getStates() { - return states; - } - private static final Lex.Transition[][] states = { - { //state 0: - new Lex.StringTransition(SPACE_CHARS, Lex.IGNORE_CONSUME, -1), - new Lex.ParseExceptionTransition("illegal space character") - }, - { //state 1: - new Lex.EOFTransition(SUCCESS), - new Lex.StringTransition(SPACE_CHARS, Lex.IGNORE_CONSUME, -1), - new Lex.DefaultTransition(Lex.IGNORE_PUTBACK, SUCCESS) - }, - }; - //{{DECLARE_CONTROLS - //}} -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/SymbolTransition.java b/icu4j/src/com/ibm/tools/localeconverter/SymbolTransition.java deleted file mode 100755 index 51b4bb674f..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/SymbolTransition.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/SymbolTransition.java,v $ - * $Date: 2002/01/31 01:22:25 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -public class SymbolTransition extends ComplexTransition { - private static PosixCharMap mapping = new PosixCharMap(); - public static final SymbolTransition GLOBAL = new SymbolTransition(SUCCESS); - public static void setCharMap(PosixCharMap mappingIn) { - mapping = mappingIn; - if (mapping == null) { - mapping = new PosixCharMap(); - } - } - - public static PosixCharMap getCharMap() { - return mapping; - } - - public SymbolTransition(int success) { - super(success); - //{{INIT_CONTROLS - //}} - } - public boolean accepts(int c) { - return '<' == (char)c; - } - protected void handleSuccess(Lex parser, StringBuffer output) { - String text = parser.getData(); - String mappedText = mapping.mapKey(text); - if (mappedText != null) { - output.append(mappedText); - } else { - output.append(text); - } - } - protected Lex.Transition[][] getStates() { - synchronized (getClass()) { - if (states == null) { - states = new Lex.Transition[][] { - { //state 0: - new Lex.CharTransition('<', Lex.ACCUMULATE_CONSUME, -1), - new Lex.ParseExceptionTransition("illegal characters in symbol") - }, - { //state 1: - new Lex.CharTransition('/', Lex.ACCUMULATE_CONSUME, -2), - new Lex.CharTransition('>', Lex.ACCUMULATE_CONSUME, SUCCESS), - new Lex.StringTransition(EOLTransition.EOL_CHARS, Lex.IGNORE_PUTBACK, -3), - new Lex.EOFTransition(-3), - new Lex.DefaultTransition(Lex.ACCUMULATE_CONSUME, -1) - }, - { //state 2: - new Lex.CharTransition('>', Lex.ACCUMULATE_CONSUME, -1), - new Lex.CharTransition('/', Lex.ACCUMULATE_CONSUME, -1), - new Lex.ParseExceptionTransition("illegal escape character in symbol") - }, - { //state 3: failure - new Lex.ParseExceptionTransition("unexpected end of line/file") - } - }; - } - } - return states; - } - private static Lex.Transition[][] states; - - public static void main(String args[]) { - try { - Lex.Transition[][] states = {{ - new SymbolTransition(SUCCESS), - new Lex.EOFTransition(), - new Lex.ParseExceptionTransition("bad test input") - }}; - //String text = "<\"<>"; - String text = " "; - StringReader sr = new StringReader(text); - PushbackReader pr = new PushbackReader(sr); - Lex parser = new Lex(states, pr); - //parser.debug(true); - int s = parser.nextToken(); - while (s == SUCCESS) { - System.out.println(parser.getData()); - s = parser.nextToken(); - } - } catch (Exception e) { - System.out.println(e); - } - } - //{{DECLARE_CONTROLS - //}} -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/TokenTransition.java b/icu4j/src/com/ibm/tools/localeconverter/TokenTransition.java deleted file mode 100755 index aea902335a..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/TokenTransition.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/TokenTransition.java,v $ - * $Date: 2002/01/31 01:22:25 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.localeconverter; - -import java.io.*; -import java.util.*; - -public class TokenTransition extends ComplexTransition { - public static final TokenTransition GLOBAL = new TokenTransition(SUCCESS); - public static final String SEPARATOR_CHARS = ";" + SpaceTransition.SPACE_CHARS; - - public TokenTransition(int success) { - super(success); - //{{INIT_CONTROLS - //}} -} - public boolean accepts(int c) { - return (c > 0) && - !EOLTransition.GLOBAL.accepts(c) && - !SpaceTransition.GLOBAL.accepts(c) && - ( - (SEPARATOR_CHARS.indexOf((char)c) < 0) || - SymbolTransition.GLOBAL.accepts(c) || - QuoteTransition.GLOBAL.accepts(c) || - EscapeTransition.GLOBAL.accepts(c) - ); - } - protected Lex.Transition[][] getStates() { - return states; - } - private static final Lex.Transition[][] states = { - { //state 0: - new SymbolTransition(-1), - new QuoteTransition(-1), - new EscapeTransition(-1), - new Lex.StringTransition(EOLTransition.EOL_CHARS, Lex.IGNORE_PUTBACK, -2), - new Lex.StringTransition(SEPARATOR_CHARS, Lex.IGNORE_PUTBACK, -3), - new Lex.EOFTransition(-4), - new Lex.DefaultTransition(Lex.ACCUMULATE_CONSUME, -1) - }, - { //state 1: - new SymbolTransition(-1), - new QuoteTransition(-1), - new EscapeTransition(-1), - new Lex.StringTransition(EOLTransition.EOL_CHARS, Lex.IGNORE_PUTBACK, SUCCESS), - new Lex.StringTransition(SEPARATOR_CHARS, Lex.IGNORE_PUTBACK, SUCCESS), - new Lex.EOFTransition(SUCCESS), - new Lex.DefaultTransition(Lex.ACCUMULATE_CONSUME, -1) - }, - { //state 2: failure - unexpected EOL - new Lex.ParseExceptionTransition("unexpected EOL in token") - }, - { //state 3: failure - new Lex.ParseExceptionTransition("unexpected seperator character in token") - }, - { //state 4: failure - new Lex.ParseExceptionTransition("unexpected EOF in token") - }, - }; - //{{DECLARE_CONTROLS - //}} -} diff --git a/icu4j/src/com/ibm/tools/localeconverter/myLocaleElements.java b/icu4j/src/com/ibm/tools/localeconverter/myLocaleElements.java deleted file mode 100755 index 84e15c4177..0000000000 --- a/icu4j/src/com/ibm/tools/localeconverter/myLocaleElements.java +++ /dev/null @@ -1,603 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 2002-2004, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/localeconverter/Attic/myLocaleElements.java,v $ - * $Date: 2002/01/31 01:22:21 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ - -/* - * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved - * (C) Copyright IBM Corp. 1996, 1997 - All Rights Reserved - * - * Portions copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved. - * - * The original version of this source code and documentation is copyrighted - * and owned by Taligent, Inc., a wholly-owned subsidiary of IBM. These - * materials are provided under terms of a License Agreement between Taligent - * and Sun. This technology is protected by multiple US and International - * patents. This notice and attribution to Taligent may not be removed. - * Taligent is a registered trademark of Taligent, Inc. - * - * Permission to use, copy, modify, and distribute this software - * and its documentation for NON-COMMERCIAL purposes and without - * fee is hereby granted provided that this copyright notice - * appears in all copies. Please refer to the file "copyright.html" - * for further important copyright and licensing information. - * - * - */ - -/** - * - * Table of Java supplied standard locale elements - * - * automatically generated by java LocaleTool LocaleElements.java - * - * Date Created: Wed Aug 21 15:47:57 1996 - * - * Locale Elements and Patterns: last update 10/23/96 - * - * - */ - -// WARNING : the format of this file will change in the future! - -package com.ibm.tools.localeconverter; - -import java.util.ListResourceBundle; - -public class myLocaleElements extends ListResourceBundle { - /** - * Overrides ListResourceBundle - */ - public Object[][] getContents() { - return new Object[][] { - { "LocaleString", "en_US" }, // locale id based on iso codes - { "LocaleID", "0409" }, // Windows id - { "ShortLanguage", "eng" }, // iso-3 abbrev lang name - { "ShortCountry", "USA" }, // iso-3 abbrev country name - { "Languages", // language names - new String[][] { - { "ab", "Abkhazian" }, - { "aa", "Afar" }, - { "af", "Afrikaans" }, - { "sq", "Albanian" }, - { "am", "Amharic" }, - { "ar", "Arabic" }, - { "hy", "Armenian" }, - { "as", "Assamese" }, - { "ay", "Aymara" }, - { "az", "Azerbaijani" }, - { "ba", "Bashkir" }, - { "eu", "Basque" }, - { "bn", "Bengali" }, - { "dz", "Bhutani" }, - { "bh", "Bihari" }, - { "bi", "Bislama" }, - { "br", "Breton" }, - { "bg", "Bulgarian" }, - { "my", "Burmese" }, - { "be", "Byelorussian" }, - { "km", "Cambodian" }, - { "ca", "Catalan" }, - { "zh", "Chinese" }, - { "co", "Corsican" }, - { "hr", "Croatian" }, - { "cs", "Czech" }, - { "da", "Danish" }, - { "nl", "Dutch" }, - { "en", "English" }, - { "eo", "Esperanto" }, - { "et", "Estonian" }, - { "fo", "Faeroese" }, - { "fj", "Fiji" }, - { "fi", "Finnish" }, - { "fr", "French" }, - { "fy", "Frisian" }, - { "gl", "Galician" }, - { "ka", "Georgian" }, - { "de", "German" }, - { "el", "Greek" }, - { "kl", "Greenlandic" }, - { "gn", "Guarani" }, - { "gu", "Gujarati" }, - { "ha", "Hausa" }, - { "iw", "Hebrew" }, - { "hi", "Hindi" }, - { "hu", "Hungarian" }, - { "is", "Icelandic" }, - { "in", "Indonesian" }, - { "ia", "Interlingua" }, - { "ie", "Interlingue" }, - { "ik", "Inupiak" }, - { "ga", "Irish" }, - { "it", "Italian" }, - { "ja", "Japanese" }, - { "jw", "Javanese" }, - { "kn", "Kannada" }, - { "ks", "Kashmiri" }, - { "kk", "Kazakh" }, - { "rw", "Kinyarwanda" }, - { "ky", "Kirghiz" }, - { "rn", "Kirundi" }, - { "ko", "Korean" }, - { "ku", "Kurdish" }, - { "lo", "Laothian" }, - { "la", "Latin" }, - { "lv", "Latvian (Lettish)" }, - { "ln", "Lingala" }, - { "lt", "Lithuanian" }, - { "mk", "Macedonian" }, - { "mg", "Malagasy" }, - { "ms", "Malay" }, - { "ml", "Malayalam" }, - { "mt", "Maltese" }, - { "mi", "Maori" }, - { "mr", "Marathi" }, - { "mo", "Moldavian" }, - { "mn", "Mongolian" }, - { "na", "Nauru" }, - { "ne", "Nepali" }, - { "no", "Norwegian" }, - { "oc", "Occitan" }, - { "or", "Oriya" }, - { "om", "Oromo (Afan)" }, - { "ps", "Pashto (Pushto)" }, - { "fa", "Persian" }, - { "pl", "Polish" }, - { "pt", "Portuguese" }, - { "pa", "Punjabi" }, - { "qu", "Quechua" }, - { "rm", "Rhaeto-Romance" }, - { "ro", "Romanian" }, - { "ru", "Russian" }, - { "sm", "Samoan" }, - { "sg", "Sangro" }, - { "sa", "Sanskrit" }, - { "gd", "Scots Gaelic" }, - { "sr", "Serbian" }, - { "sh", "Serbo-Croatian" }, - { "st", "Sesotho" }, - { "tn", "Setswana" }, - { "sn", "Shona" }, - { "sd", "Sindhi" }, - { "si", "Singhalese" }, - { "ss", "Siswati" }, - { "sk", "Slovak" }, - { "sl", "Slovenian" }, - { "so", "Somali" }, - { "es", "Spanish" }, - { "su", "Sundanese" }, - { "sw", "Swahili" }, - { "sv", "Swedish" }, - { "tl", "Tagalog" }, - { "tg", "Tajik" }, - { "ta", "Tamil" }, - { "tt", "Tatar" }, - { "te", "Telugu" }, - { "th", "Thai" }, - { "bo", "Tibetan" }, - { "ti", "Tigrinya" }, - { "to", "Tonga" }, - { "ts", "Tsonga" }, - { "tr", "Turkish" }, - { "tk", "Turkmen" }, - { "tw", "Twi" }, - { "uk", "Ukrainian" }, - { "ur", "Urdu" }, - { "uz", "Uzbek" }, - { "vi", "Vietnamese" }, - { "vo", "Volapuk" }, - { "cy", "Welsh" }, - { "wo", "Wolof" }, - { "xh", "Xhosa" }, - { "ji", "Yiddish" }, - { "yo", "Yoruba" }, - { "zu", "Zulu" } - } - }, - { "Countries", // country names - new String[][] { - { "AF", "Afghanistan" }, - { "AL", "Albania" }, - { "DZ", "Algeria" }, - { "AD", "Andorra" }, - { "AO", "Angola" }, - { "AI", "Anguilla" }, - { "AR", "Argentina" }, - { "AM", "Armenia" }, - { "AW", "Aruba" }, - { "AU", "Australia" }, - { "AT", "Austria" }, - { "AZ", "Azerbaijan" }, - { "BS", "Bahamas" }, - { "BH", "Bahrain" }, - { "BD", "Bangladesh" }, - { "BB", "Barbados" }, - { "BY", "Belarus" }, - { "BE", "Belgium" }, - { "BZ", "Belize" }, - { "BJ", "Benin" }, - { "BM", "Bermuda" }, - { "BT", "Bhutan" }, - { "BO", "Bolivia" }, - { "BA", "Bosnia and Herzegovina" }, - { "BW", "Botswana" }, - { "BR", "Brazil" }, - { "BN", "Brunei Darussalam" }, - { "BG", "Bulgaria" }, - { "BF", "Burkina Faso" }, - { "BI", "Burundi" }, - { "KH", "Cambodia" }, - { "CM", "Cameroon" }, - { "CA", "Canada" }, - { "CV", "Cape Verde" }, - { "CF", "Central African Republic" }, - { "TD", "Chad" }, - { "CL", "Chile" }, - { "CN", "China" }, - { "CO", "Colombia" }, - { "KM", "Comoros" }, - { "CG", "Congo" }, - { "CR", "Costa Rica" }, - { "CI", "Cote D'ivoire" }, - { "HR", "Croatia" }, - { "CU", "Cuba" }, - { "CY", "Cyprus" }, - { "CZ", "Czech Republic" }, - { "DK", "Denmark" }, - { "DJ", "Djibouti" }, - { "DM", "Dominica" }, - { "DO", "Dominican Republic" }, - { "TP", "East Timor" }, - { "EC", "Ecuador" }, - { "EG", "Egypt" }, - { "SV", "El Salvador" }, - { "GQ", "Equatorial Guinea" }, - { "ER", "Eritrea" }, - { "EE", "Estonia" }, - { "ET", "Ethiopia" }, - { "FJ", "Fiji" }, - { "FI", "Finland" }, - { "FR", "France" }, - { "GF", "French Guiana" }, - { "PF", "French Polynesia" }, - { "TF", "French Southern Territories" }, - { "GA", "Gabon" }, - { "GM", "Gambia" }, - { "GE", "Georgia" }, - { "DE", "Germany" }, - { "GH", "Ghana" }, - { "GR", "Greece" }, - { "GP", "Guadeloupe" }, - { "GT", "Guatemala" }, - { "GN", "Guinea" }, - { "GW", "Guinea-Bissau" }, - { "GY", "Guyana" }, - { "HT", "Haiti" }, - { "HN", "Honduras" }, - { "HK", "Hong Kong" }, - { "HU", "Hungary" }, - { "IS", "Iceland" }, - { "IN", "India" }, - { "ID", "Indonesia" }, - { "IR", "Iran" }, - { "IQ", "Iraq" }, - { "IE", "Ireland" }, - { "IL", "Israel" }, - { "IT", "Italy" }, - { "JM", "Jamaica" }, - { "JP", "Japan" }, - { "JO", "Jordan" }, - { "KZ", "Kazakhstan" }, - { "KE", "Kenya" }, - { "KI", "Kiribati" }, - { "KP", "North Korea" }, - { "KR", "South Korea" }, - { "KW", "Kuwait" }, - { "KG", "Kyrgyzstan" }, - { "LA", "Laos" }, - { "LV", "Latvia" }, - { "LB", "Lebanon" }, - { "LS", "Lesotho" }, - { "LR", "Liberia" }, - { "LY", "Libyan Arab Jamahiriya" }, - { "LI", "Liechtenstein" }, - { "LT", "Lithuania" }, - { "LU", "Luxembourg" }, - { "MK", "Macedonia" }, - { "MG", "Madagascar" }, - { "MY", "Malaysia" }, - { "ML", "Mali" }, - { "MT", "Malta" }, - { "MQ", "Martinique" }, - { "MR", "Mauritania" }, - { "MU", "Mauritius" }, - { "YT", "Mayotte" }, - { "MX", "Mexico" }, - { "FM", "Micronesia" }, - { "MD", "Moldova" }, - { "MC", "Monaco" }, - { "MN", "Mongolia" }, - { "MS", "Montserrat" }, - { "MA", "Morocco" }, - { "MZ", "Mozambique" }, - { "MM", "Myanmar" }, - { "NA", "Namibia" }, - { "NP", "Nepal" }, - { "NL", "Netherlands" }, - { "AN", "Netherlands Antilles" }, - { "NC", "New Caledonia" }, - { "NZ", "New Zealand" }, - { "NI", "Nicaragua" }, - { "NE", "Niger" }, - { "NG", "Nigeria" }, - { "NU", "Niue" }, - { "NO", "Norway" }, - { "OM", "Oman" }, - { "PK", "Pakistan" }, - { "PA", "Panama" }, - { "PG", "Papua New Guinea" }, - { "PY", "Paraguay" }, - { "PE", "Peru" }, - { "PH", "Philippines" }, - { "PL", "Poland" }, - { "PT", "Portugal" }, - { "PR", "Puerto Rico" }, - { "QA", "Qatar" }, - { "RO", "Romania" }, - { "RU", "Russian Federation" }, - { "RW", "Rwanda" }, - { "SA", "Saudi Arabia" }, - { "SN", "Senegal" }, - { "SP", "Serbia" }, - { "SC", "Seychelles" }, - { "SL", "Sierra Leone" }, - { "SG", "Singapore" }, - { "SK", "Slovakia" }, - { "SI", "Slovenia" }, - { "SO", "Somalia" }, - { "ZA", "South Africa" }, - { "ES", "Spain" }, - { "LK", "Sri Lanka" }, - { "SD", "Sudan" }, - { "SR", "Suriname" }, - { "SZ", "Swaziland" }, - { "SE", "Sweden" }, - { "CH", "Switzerland" }, - { "SY", "Syria" }, - { "TW", "Taiwan" }, - { "TJ", "Tajikistan" }, - { "TZ", "Tanzania" }, - { "TH", "Thailand" }, - { "TG", "Togo" }, - { "TK", "Tokelau" }, - { "TO", "Tonga" }, - { "TT", "Trinidad and Tobago" }, - { "TN", "Tunisia" }, - { "TR", "Turkey" }, - { "TM", "Turkmenistan" }, - { "UG", "Uganda" }, - { "UA", "Ukraine" }, - { "AE", "United Arab Emirates" }, - { "GB", "United Kingdom" }, - { "US", "United States" }, - { "UY", "Uruguay" }, - { "UZ", "Uzbekistan" }, - { "VU", "Vanuatu" }, - { "VA", "Vatican" }, - { "VE", "Venezuela" }, - { "VN", "Viet Nam" }, - { "VG", "British Virgin Islands" }, - { "VI", "U.S. Virgin Islands" }, - { "EH", "Western Sahara" }, - { "YE", "Yemen" }, - { "YU", "Yugoslavia" }, - { "ZR", "Zaire" }, - { "ZM", "Zambia" }, - { "ZW", "Zimbabwe" } - } - }, - { "%%EURO", "Euro" }, // Euro variant display name - { "LocaleNamePatterns", - /* Formats for the display name of a locale, for a list of - * items, and for composing two items in a list into one item. - * The list patterns are used in the variant name and in the - * full display name. - */ - new String[] { - "{0,choice,0#|1#{1}|2#{1} ({2})}", // Display name - "{0,choice,0#|1#{1}|2#{1},{2}|3#{1},{2},{3}}", // List - "{0},{1}" // List composition - } - }, - { "MonthNames", - new String[] { - "January", // january - "February", // february - "March", // march - "April", // april - "May", // may - "June", // june - "July", // july - "August", // august - "September", // september - "October", // october - "November", // november - "December", // december - "" // month 13 if applicable - } - }, - { "MonthAbbreviations", - new String[] { - "Jan", // abb january - "Feb", // abb february - "Mar", // abb march - "Apr", // abb april - "May", // abb may - "Jun", // abb june - "Jul", // abb july - "Aug", // abb august - "Sep", // abb september - "Oct", // abb october - "Nov", // abb november - "Dec", // abb december - "" // abb month 13 if applicable - } - }, - { "DayNames", - new String[] { - "Sunday", // Sunday - "Monday", // Monday - "Tuesday", // Tuesday - "Wednesday", // Wednesday - "Thursday", // Thursday - "Friday", // Friday - "Saturday" // Saturday - } - }, - { "DayAbbreviations", - new String[] { - "Sun", // abb Sunday - "Mon", // abb Monday - "Tue", // abb Tuesday - "Wed", // abb Wednesday - "Thu", // abb Thursday - "Fri", // abb Friday - "Sat" // abb Saturday - } - }, - { "AmPmMarkers", - new String[] { - "AM", // am marker - "PM" // pm marker - } - }, - { "Eras", - new String[] { // era strings - "BC", - "AD" - } - }, - { "NumberPatterns", - new String[] { - "#,##0.###;-#,##0.###", // decimal pattern - "$#,##0.00;($#,##0.00)", // currency pattern - "#,##0%" // percent pattern - } - }, - { "NumberElements", - new String[] { - ".", // decimal separator - ",", // group (thousands) separator - ";", // list separator - "%", // percent sign - "0", // native 0 digit - "#", // pattern digit - "-", // minus sign - "E", // exponential - "\u2030", // per mille - "\u221e", // infinity - "\ufffd" // NaN - } - }, - { "CurrencyElements", - new String[] { - "$", // local currency symbol - "USD", // intl currency symbol - "." // monetary decimal separator - } - }, - { "DateTimePatterns", - new String[] { - "h:mm:ss 'o''''clock' a z", // full time pattern - "h:mm:ss a z", // long time pattern - "h:mm:ss a", // medium time pattern - "h:mm a", // short time pattern - "EEEE, MMMM d, yyyy", // full date pattern - "MMMM d, yyyy", // long date pattern - "dd-MMM-yy", // medium date pattern - "M/d/yy", // short date pattern - "{1} {0}" // date-time pattern - } - }, - { "DateTimeElements", - new String[] { - "1", // first day of week - "1" // min days in first week - } - }, - { "CollationElements",new String[][]{ - {"Version","1.0"}, - {"Overide","false"}, - {"Sequence",""} - } - }, - { "Measurement" ,""}, - { "CountryNumber" , ""}, - { "CountryISBNNumber" , ""}, - { "LanguageLibraryUse" , ""}, - { "PaperSize", new String[][]{ - {"Hieght",""}, - {"Width",""}, - {"Units", ""} - } - }, - - { "Messages" , new String[][] { - {"yesExpression",""}, /* yes expression */ - {"noExpression",""} /* no expression */ - } - }, - { "AddressFormat", new String[][]{ - {"PostalFormat",""}, - } - }, - - {"NameFormat", new String[][]{ - {"NamePattern",""}, - {"GeneralSalutaion", ""}, - {"ShortSalutationMr", ""}, - {"ShortSalutationMiss",""}, - {"ShortSalutationMrs",""}, - {"LongSalutationMr",""}, - {"LongSalutationMiss",""}, - {"LongSalutationMrs",""} - } - }, - { "Identification", new String[][]{ - {"Title",""}, - {"Source",""}, - {"Address",""}, - {"Contact",""}, - {"Email",""}, - {"Telephone", ""}, - {"Fax", ""}, - {"Language",""}, - {"Territory",""}, - {"Audience", ""}, - {"Application", ""}, - {"Abbreviation", ""}, - {"Revision", ""}, - {"Date",""} - } - - }, - { "TelephoneFormat", new String[][]{ - {"InternationalFormat",""}, - {"DomesticFormat",""}, - {"InternationalDialCode",""}, - {"InternationalPrefix",""} - } - } - }; - } -} - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/normalizer/CPPWriter.java b/icu4j/src/com/ibm/tools/normalizer/CPPWriter.java deleted file mode 100755 index 3bf951df21..0000000000 --- a/icu4j/src/com/ibm/tools/normalizer/CPPWriter.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/normalizer/Attic/CPPWriter.java,v $ - * $Date: 2000/09/21 22:37:55 $ - * $Revision: 1.6 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.normalizer; - -import com.ibm.text.*; -import com.ibm.util.*; -import com.ibm.util.CompactByteArray; -import com.ibm.util.CompactCharArray; -import com.ibm.util.Utility; -import java.io.*; - -/** - * CPPWriter knows how to write data structures out to C++ source and header files - */ -class CPPWriter extends SourceWriter { - PrintWriter source; - PrintWriter header; - - String className; - - public CPPWriter(String fileName, String cName) throws FileNotFoundException { - className = cName; - int i = fileName.lastIndexOf('/'); - String name = (i >= 0) ? fileName.substring(i+1) : fileName; - - // Find the class name - header = new PrintWriter(new FileOutputStream(fileName + ".h")); - writeHeader(header); - header.println("#include \"unicode/utypes.h\""); - header.println("#include \"ucmp8.h\""); - header.println("#include \"ucmp16.h\""); - header.println(""); - header.println("struct " + className + " {"); // "struct" makes everything public - - source = new PrintWriter(new FileOutputStream(fileName + ".cpp")); - writeHeader(source); - source.println("#include \"" + name + ".h\" "); - source.println(""); - } - - public void close() { - header.println("};"); - header.close(); - source.close(); - header = null; - source = null; - } - - public void write(String name, short value) { - header.println(" enum { " + name + " = " + value + " };"); - } - - public void write(String name, int value) { - header.println(" enum { " + name + " = " + value + " };"); - } - - public void writeHex(String name, char value) { - header.println(" enum { " + name + " = 0x" + Utility.hex(value) + " };"); - } - - public void writeHex(String name, int value) { - header.println(" enum { " + name + " = 0x" + Integer.toString(value,16) + " };"); - } - - public void write(String name, CompactCharArray array) { - array.compact(false); - - String indexName = name + "_index"; - String valueName = name + "_values"; - - write(indexName, array.getIndexArray()); - write(valueName, array.getValueArray()); - - header.println(""); - header.println(" static CompactShortArray _" + name + ";"); - header.println(""); - header.println(" static const CompactShortArray* " + name + ";"); - - source.println(""); - source.println("CompactShortArray " + - className + "::_" + name + ";"); - source.println(""); - source.println("const CompactShortArray* " + - className + "::" + name + " = "); - source.println(" ucmp16_initAliasWithBlockShift(&" + className + "::_" + name + ","); - source.println(" (uint16_t*)" + indexName + ","); - source.println(" (int16_t*)" + valueName + ","); - source.println(" " + - array.getValueArray().length + ", " + - "0x0000, " + // default value - CompactCharArray.BLOCKSHIFT + ");"); - } - - public void write(String name, CompactByteArray array) { - array.compact(false); - - String indexName = name + "_index"; - String valueName = name + "_values"; - - write(indexName, array.getIndexArray()); - write(valueName, array.getValueArray()); - - header.println(""); - header.println(" static CompactByteArray _" + name + ";"); - header.println(""); - header.println(" static const CompactByteArray* " + name + ";"); - - source.println(""); - source.println("CompactByteArray " + - className + "::_" + name + ";"); - source.println(""); - source.println("const CompactByteArray* " + - className + "::" + name + " = "); - source.println(" ucmp8_initAlias(&" + className + "::_" + name + ","); - source.println(" (uint16_t*)" + indexName + ","); - source.println(" (int8_t*)" + valueName + ","); - source.println(" " + array.getValueArray().length + ");"); - } - - public void write(String name, StringBuffer str) { - write(name, str.toString().toCharArray()); - } - - public void write(String name, char[] array) { - header.println(""); - header.println(" static const uint16_t " + name + "[];"); - - source.println(""); - source.println("const uint16_t " + className + "::" + name + "[] = {"); - - source.print(" "); - for (int i = 0; i < array.length; i++) { - if (i > 0 && i % 8 == 0) { - source.print(Utility.LINE_SEPARATOR + " "); - } - source.print("0x" + Utility.hex(array[i]) + ", "); - } - source.println("};"); - } - - public void write(String name, short[] array) { - header.println(""); - header.println(" static const uint16_t " + name + "[];"); - - source.println(""); - source.println("const uint16_t " + className + "::" + name + "[] = {"); - - source.print(" "); - for (int i = 0; i < array.length; i++) { - if (i > 0 && i % 8 == 0) { - source.print(Utility.LINE_SEPARATOR + " "); - } - source.print("0x" + Utility.hex((char)array[i]) + ", "); - } - source.println("};"); - } - - public void write(String name, int[] array) { - header.println(""); - header.println(" static const int32_t " + name + "[];"); - - source.println(""); - source.println("const int32_t " + className + "::" + name + "[] = {"); - - source.print(" "); - for (int i = 0; i < array.length; i++) { - if (i > 0 && i % 8 == 0) { - source.print(Utility.LINE_SEPARATOR + " "); - } - source.print("0x" + Integer.toString(array[i],16) + ", "); - } - source.println("};"); - } - - public void write(String name, byte[] array) { - header.println(""); - header.println(" static const uint8_t " + name + "[];"); - - source.println(""); - source.println("const uint8_t " + className + "::" + name + "[] = {"); - - source.print(" "); - for (int i = 0; i < array.length; i++) { - if (i > 0 && i % 8 == 0) { - source.print(Utility.LINE_SEPARATOR + " "); - } - source.print("0x" + hex2(array[i]) + ", "); - } - source.println("};"); - } - - private static StringBuffer __buf = new StringBuffer(); - - // This method not multithread safe! - private static final String hex2(int x) { - __buf.setLength(0); - __buf.append(hex1(x>>4)).append(hex1(x)); - return __buf.toString(); - } - - private static final char hex1(int x) { - return "0123456789ABCDEF".charAt(x & 0xF); - } -} diff --git a/icu4j/src/com/ibm/tools/normalizer/FCDBuilder.java b/icu4j/src/com/ibm/tools/normalizer/FCDBuilder.java deleted file mode 100755 index 14c377a69e..0000000000 --- a/icu4j/src/com/ibm/tools/normalizer/FCDBuilder.java +++ /dev/null @@ -1,138 +0,0 @@ -/* -****************************************************************************** -* Copyright (C) 1996-2000, International Business Machines Corporation and * -* others. All Rights Reserved. * -****************************************************************************** -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/normalizer/Attic/FCDBuilder.java,v $ -* $Date: 2001/10/30 02:42:49 $ -* $Revision: 1.6 $ -* -****************************************************************************** -*/ - -package com.ibm.tools.normalizer; - -import java.io.BufferedWriter; -import java.io.FileWriter; -import java.io.Writer; -import com.ibm.util.CharTrie; -import com.ibm.text.UCharacter; -import com.ibm.text.UTF16; -import com.ibm.text.Normalizer; - -/** -* Class to generate modified checkFCD data for collation. -* Data generated is used only in internal ICU collation. -* FCD is the set of strings such that for each string if you simply decomposed -* any composites (including singleton composites) without canonical reordering. -* FCD is not a normalization form, since there's no uniqueness. -* @deprecated ICU4J 2.0, since ICU has written its own tool. -*/ -public class FCDBuilder -{ - // public methods ---------------------------------------------------- - - /** - * constructor with default output file path - * @deprecated ICU4J 2.0, since ICU has written its own tool. - */ - public FCDBuilder() - { - } - - /** - * Building method. - * Each unicode character will be used to generate data, output to the default - * file path - * @deprecated ICU4J 2.0, since ICU has written its own tool. - */ - public void build() - { - build(DEFAULT_OUTPUT_PATH_); - } - - /** - * Building method. - * Each unicode character will be used to generate data. - * @param output file path - * @deprecated ICU4J 2.0, since ICU has written its own tool. - */ - public void build(String output) - { - char result[] = new char[UCharacter.MAX_VALUE + 1]; - - for (int ch = UCharacter.MIN_VALUE; ch <= UCharacter.MAX_VALUE; ch ++) { - result[ch] = getFCD(ch); - } - - CharTrie trie = new CharTrie(result); - - // testing, checking trie values - for (int ch = UCharacter.MIN_VALUE; ch <= UCharacter.MAX_VALUE; ch ++) { - if (trie.getValue(ch) != getFCD(ch)) - { - System.out.println("error at 0x" + Integer.toHexString(ch) + " " + - getFCD(ch)); - break; - } - } - - try - { - FileWriter f = new FileWriter(output); - BufferedWriter w = new BufferedWriter(f); - String s = trie.toString(); - w.write(s); - w.close(); - } - catch(Exception e) - { - e.printStackTrace(); - } - } - - /** - * Main method - */ - public static void main(String arg[]) - { - FCDBuilder fcdb = new FCDBuilder(); - fcdb.build(); - } - - // private methods ----------------------------------------------------- - - /** - * Retrieved the FCDcheck value of the argument codepoint. - * f(ch) = combining class of - * (first codepoint in (NFD of ch)) | (last code point in (NFD of ch)) - * @param ch character to get FCD from - */ - private char getFCD(int ch) - { - String cstr = UCharacter.toString(ch), - nfd = Normalizer.decompose(cstr, false, 0); - int firstch = UTF16.charAt(nfd, 0); - int lastch = UTF16.charAt(nfd, nfd.length() - 1); - return (char)((UCharacter.getCombiningClass(firstch) << LEAD_CC_SHIFT_) | - (UCharacter.getCombiningClass(lastch) & LAST_BYTE_MASK_)); - } - - // private data members ------------------------------------------------ - - /** - * Output file path - */ - private final String DEFAULT_OUTPUT_PATH_ = "fcdcheck.txt"; - - /** - * Lead combining class shift - */ - private final int LEAD_CC_SHIFT_ = 8; - - /** - * Last byte mask - */ - private final int LAST_BYTE_MASK_ = 0xFF; -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/normalizer/JavaWriter.java b/icu4j/src/com/ibm/tools/normalizer/JavaWriter.java deleted file mode 100755 index 479e1c4395..0000000000 --- a/icu4j/src/com/ibm/tools/normalizer/JavaWriter.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/normalizer/Attic/JavaWriter.java,v $ - * $Date: 2000/07/12 16:41:26 $ - * $Revision: 1.4 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.normalizer; - -//import com.ibm.text.*; -import com.ibm.util.Utility; -import com.ibm.util.CompactCharArray; -import com.ibm.util.CompactByteArray; -import java.io.*; - -/** - * JavaWriter knows how to write data structures out to a Java source file - */ -class JavaWriter extends SourceWriter { - PrintWriter out; - - public JavaWriter(String name) throws FileNotFoundException { - // Find the class name - int cIndex = name.lastIndexOf('/'); - String cName = (cIndex >= 0) ? name.substring(cIndex+1) : name; - - out = new PrintWriter(new FileOutputStream(name + ".java")); - - writeHeader(out); - out.println("class " + cName + " {"); - } - - public void close() { - out.println("}"); - out.close(); - out = null; - } - - public void write(String name, short value) { - out.println(" static final short " + name + " = " + value + ";"); - } - - public void write(String name, int value) { - out.println(" static final int " + name + " = " + value + ";"); - } - - public void writeHex(String name, char value) { - out.println(" static final char " + name + " = 0x" + Integer.toString((int)value,16) + ";"); - } - - public void writeHex(String name, int value) { - out.println(" static final int " + name + " = 0x" + Integer.toString(value,16) + ";"); - } - - public void write(String name, CompactCharArray array) { - array.compact(false); - out.println(""); - out.println(" static final CompactCharArray " + name + " = new CompactCharArray("); - out.println(Utility.formatForSource(Utility.arrayToRLEString(array.getIndexArray()))); - out.println(" ," ); - out.println(Utility.formatForSource(Utility.arrayToRLEString(array.getValueArray()))); - out.println(" );" ); - } - - public void write(String name, CompactByteArray array) { - array.compact(false); - out.println(""); - out.println(" static final CompactByteArray " + name + " = new CompactByteArray("); - out.println(Utility.formatForSource(Utility.arrayToRLEString(array.getIndexArray()))); - out.println(" ," ); - out.println(Utility.formatForSource(Utility.arrayToRLEString(array.getValueArray()))); - out.println(" );" ); - } - - public void write(String name, StringBuffer str) { - out.println(""); - out.println(" static final String " + name + " = "); - out.println(Utility.formatForSource(str.toString())); - out.println(" ;"); - } - - public void write(String name, char[] array) { - out.println(""); - out.println(" static final char[] " + name + " = Utility.RLEStringToCharArray("); - out.println(Utility.formatForSource(Utility.arrayToRLEString(array))); - out.println(" );"); - } - - public void write(String name, int[] array) { - out.println(""); - out.println(" static final int[] " + name + " = Utility.RLEStringToIntArray("); - out.println(Utility.formatForSource(Utility.arrayToRLEString(array))); - out.println(" );"); - } - - void writeHeader(PrintWriter out) { - super.writeHeader(out); - out.println(""); - out.println("package com.ibm.text;"); - out.println("import com.ibm.util.*;"); - out.println(""); - } -} - diff --git a/icu4j/src/com/ibm/tools/normalizer/MutableChar.java b/icu4j/src/com/ibm/tools/normalizer/MutableChar.java deleted file mode 100755 index 600e1965d2..0000000000 --- a/icu4j/src/com/ibm/tools/normalizer/MutableChar.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/normalizer/Attic/MutableChar.java,v $ - * $Date: 2000/03/10 04:17:56 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -// MutableChar.java - -package com.ibm.tools.normalizer; - -import com.ibm.text.*; -import java.lang.Comparable; -import java.io.Serializable; - -class MutableChar implements Cloneable, Comparable, Serializable { - - public char value; - - public MutableChar(char newValue) { - value = newValue; - } - public MutableChar set(char newValue) { - value = newValue; - return this; - } - public boolean equals(Object other) { - return value == ((MutableChar)other).value; - } - public int hashCode() { - return value; - } - public String toString() { - return String.valueOf(value); - } - public int compareTo(Object b) { - char ch = ((MutableChar)b).value; - return value == ch ? 0 : value < ch ? -1 : 1; - } -} - diff --git a/icu4j/src/com/ibm/tools/normalizer/NormalizerBuilder.java b/icu4j/src/com/ibm/tools/normalizer/NormalizerBuilder.java deleted file mode 100755 index f14aa07a03..0000000000 --- a/icu4j/src/com/ibm/tools/normalizer/NormalizerBuilder.java +++ /dev/null @@ -1,1154 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/normalizer/Attic/NormalizerBuilder.java,v $ - * $Date: 2001/09/08 01:18:03 $ - * $Revision: 1.13 $ - * - ***************************************************************************************** - */ - -package com.ibm.tools.normalizer; - -import java.io.*; -import java.util.*; -import com.ibm.text.*; -import com.ibm.util.CompactByteArray; -import com.ibm.util.CompactCharArray; -import com.ibm.util.Utility; -import com.ibm.icu.internal.UInfo; - -public final class NormalizerBuilder -{ - public static void main(String args[]) throws IOException { - try { - NormalizerBuilder foo = new NormalizerBuilder(args); - foo = null; - } catch (Throwable e) { - System.err.println(e.getLocalizedMessage()); - e.printStackTrace(); - System.in.read(); - } - } - - private UInfo uinfo; - - /** - * Map char->String. Each entry maps a character with a - * decomposition (either canonical or compatibility) to that - * decomposition. The decomposition is in canonical order. - */ - private DecompMap decomps = new DecompMap(); - - /** - * Map of characters whose full canonical decomposition is - * DIFFERENT from their full compatibility decomposition. - */ - private DecompMap explodeCompat = new DecompMap(); - - /** - * Map of characters with a decomposition that are neither - * in explodeCompat nor in permutedCompositions. - */ - private DecompMap explodeOnly = new DecompMap(); - - /** - * Map of String->char of permutations that compose to a - * character. This does not include singletons or other - * composition exclusions. It is an inverse list, with valid - * permutations, for canonical decomposition. - */ - private CompMap permutedCompositions = new CompMap(); - private CompMap binaryCompositions = new CompMap(); - - /** - * A set of characters that form the base of a combining - * sequence. - */ - private CharSet bases = new CharSet(); - - /** - * A set of characters that form the combining character of - * a combining sequence. - */ - private CharSet combining = new CharSet(); - - private Map pairExplosions = new HashMap(); - - private boolean fVerbose = false; - private boolean fWriteData = false; - private boolean fShowSizes = false; - private boolean fPrompt = false; - private boolean fJava = true; - private boolean fCPP = false; - private String fOutDir = null; // output directory for either Java or C++ - - /** - * The highest Unicode character that has a canonical - * decomposition. (i.e. largest char that can result from a - * primary canonical composition.) This is the largest char in - * permutedCompositions. - */ - char largestChar = 0; - - public NormalizerBuilder(String[] args) throws IOException - { - // Parse my command line - for (int i = 0; i < args.length; i++) - { - if (args[i].equals("-data")) { - uinfo = new UInfo(args[++i], args[++i]); - } - else if (args[i].equals("-write")) { - fWriteData = true; - } - else if (args[i].equals("-verbose") || args[i]. equals("-v")) { - fVerbose = true; - } - else if (args[i].equals("-size")) { - fShowSizes = true; - } - else if (args[i].equals("-prompt")) { - fPrompt = true; - } - else if (args[i].equals("-java")) { - fJava = true; - fCPP = false; - } - else if (args[i].equals("-cpp")) { - fCPP = true; - fJava = false; - } - else if (args[i].equals("-outdir")) { - fOutDir = args[++i]; - } - } - if (uinfo == null) { - uinfo = new UInfo(); - } - if (fOutDir == null) { - fOutDir = fJava ? "src/com/ibm/text/" - : "./"; - } - if (!fOutDir.endsWith("/")) { fOutDir += '/'; } - - // not used boolean canonicalOnly = true; - - // Build decomps, a char->String mapping of characters to their - // decompositions, either canonical or compatibility. - createDecompositions(); - - outv("\nGenerating permuted compositions..."); - - // Form the list of all the permuted sequences that are - // canonically equivalent to the canonical decompositions. As - // a by-product, find out which are not combining character - // sequences. - - for (char ch = 0; ch < 0xFFFF; ch++) { - String decomp = decomps.get(ch); - - if (decomp != null) { - boolean done = false; - - if (!uinfo.getFullDecomposition(ch,true).equals( - uinfo.getFullDecomposition(ch,false))) - { - explodeCompat.put(ch, uinfo.getFullDecomposition(ch, false)); - done = true; - } - // It's always a combining base sequence, so removed last check - liu - if (uinfo.hasCanonicalDecomposition(ch) && decomp.length() > 1 - && !uinfo.isExcludedComposition(ch) /*&& uinfo.isCBS(decomp)*/) - { - if (decomp.length() <= 2) { - permutedCompositions.put(decomp, ch); - } - else { - /* Create a comprehensive list of - * permutations. Assume the first char is a - * base char, so don't permute it into the - * middle of the string -- just concatenate it - * onto the front. However, there may be - * embedded base characters, so we do a - * further check for canonical decomposition - * equivalence below. */ - List alternatives = concat(decomp.charAt(0), - jumble(decomp.substring(1, decomp.length()))); - - for (int i = 0; i < alternatives.size(); ++i) - { - String variant = (String)alternatives.get(i); - String normalized = uinfo.fixCanonical(variant); - - if (normalized.equals(decomp)) { - permutedCompositions.put(variant, ch); - } - } - } - largestChar = ch; - done = true; - } - if (!done) { - explodeOnly.put(ch, decomp); // Disparaged - } - } - } - - outv("\nLargest composed char: " + Utility.hex(largestChar)); - - // Form the binary compositions - outv("\nGenerating pairwise compositions..."); - - Iterator list = permutedCompositions.keySet().iterator(); - while (list.hasNext()) { - String decomp = (String)list.next(); - char ch = permutedCompositions.get(decomp); - - if (decomp.length() > 2) { - // - // If this is a composition of more than two characters, - // see if its initial portion is also a composition. If so, that lets - // us build up this composed character iteratively. - // - for (int i = decomp.length()-1; i > 1; --i) { - String partial = decomp.substring(0,i); - char partialMap = permutedCompositions.get(partial); - if (partialMap != 0) { - decomp = partialMap + decomp.substring(i); - break; - } - } - } - if (decomp.length() <= 2) { - binaryCompositions.put(decomp, ch); - } else { - // - // The composition takes more than two characters, and there's - // no way to build it up from smaller ones. - // - if (decomp.equals(uinfo.fixCanonical(decomp))) - { - // If the decomp is in canonical order, we're in trouble, - // since that means there's no way to generate this composed - // character from its canonically decomposed equivalent. - err("No pairwise compose of " + Utility.hex(decomp) + - " > " + Utility.hex(ch) + " " + uinfo.getName(ch,true) ); - } - else { - // If the decomp is *not* in canonical order, it's not as - // bad, since composition will still work as long as - warn("No pairwise compose of non-canon " + Utility.hex(decomp) + - " > " + Utility.hex(ch) + " " + uinfo.getName(ch,true) ); - } - } - - bases.add(decomp.charAt(0)); - - // add to list of all combining characters in composites - for (int q = 1; q < decomp.length(); ++q) { - combining.add(decomp.charAt(q)); - } - } - - - // Generate the pairwise explosions, where a composed char + combining char - // transforms into a different pair of characters, usually because the - // canonical combining classes are reversed. - - outv("\nGenerating exploding pairs...."); - - List binaryValues = new ArrayList(binaryCompositions.values()); - Collections.sort(binaryValues); - - for (char addOn = 0; addOn < 0xFFFF; addOn++) { - if (combining.contains(addOn)) - { - list = binaryValues.iterator(); - - while (list.hasNext()) { - MutableChar unichar = (MutableChar)list.next(); - String chStr = String.valueOf(unichar.value); - String source = chStr + addOn; - - String comp = binaryComposition(source); - - if (comp.length() == 1) continue; // don't care if combines - if (comp.charAt(0) == addOn || comp.charAt(1) == addOn) continue; // rearranges - - if (!source.equals(comp)) { - String decomp = fullDecomposition(source); - decomp = null; - pairExplosions.put(source,comp); - bases.add(unichar); - } - } - } - } - - buildDecompData(); - buildComposeData(); - outv("Success!"); - - if (fPrompt) { - System.out.println("\nHit any key to continue..."); - System.in.read(); - } - } - - public String fullDecomposition(String s) { - return fullDecomposition(s, new StringBuffer()).toString(); - } - - public StringBuffer fullDecomposition(char ch, StringBuffer output) { - String value = decomps.get(ch); - if (value == null) { - bubbleAppend(output, ch); - } - else { - bubbleAppend(output, value); - } - return output; - } - - public StringBuffer fullDecomposition(String s, StringBuffer output) { - for (int i = 0; i < s.length(); ++i) { - fullDecomposition(s.charAt(i),output); - } - return output; - } - - public String binaryComposition(String sr) { - // set up decomposed string, init variables - StringBuffer output = new StringBuffer(); - StringBuffer decomp = new StringBuffer(); - - if (sr.length() == 0) return output.toString(); - - // First generate the full decomposition of the input string - fullDecomposition(sr, decomp); - int basePosition = 0; - char base = decomp.charAt(0); - output.append(base); - - // handle degenerate case--no base character at start - if (uinfo.getCanonicalClass(base) != 0) { - // later - } - - // loop through, composing items with base - for (int i = 1; i < decomp.length(); ++i) { - char ch = decomp.charAt(i); - short can = uinfo.getCanonicalClass(ch); - - char value = binaryCompositions.get(String.valueOf(base) + ch); - - if (value != 0 && noObstructions(output, basePosition, can)) { - base = value; - output.setCharAt(basePosition, base); - } else if (can == 0) { - basePosition = output.length(); - base = ch; - output.append(ch); - } else { - bubbleAppend(output, ch, can); - } - } - return output.toString(); - } - - public boolean noObstructions(StringBuffer buffer, int pos, short can) { - for (int j = buffer.length()-1; j > pos; --j) { - if (can == uinfo.getCanonicalClass(buffer.charAt(j))) { - return false; - } - } - return true; - } - - public void bubbleAppend(StringBuffer buffer, char ch, short can) { - for (int j = buffer.length()-1; j >= 0; --j) { - if (can >= uinfo.getCanonicalClass(buffer.charAt(j))) { - buffer.insert(j + 1, ch); - return; - } - } - buffer.insert(0, ch); - } - - public void bubbleAppend(StringBuffer buffer, char ch) { - bubbleAppend(buffer, ch, uinfo.getCanonicalClass(ch)); - } - - public void bubbleAppend(StringBuffer buffer, String s) { - for (int i = 0; i < s.length(); ++i) { - bubbleAppend(buffer, s.charAt(i)); - } - } - - String getDecomposition(char ch) { - return decomps.get(ch); - } - - - /** - * Generate a Map of all decompositions in Unicode. The keys in - * the map are MutableChar objects, one for each character that - * has a decomposition. The values are String objects containing - * the full decomposition for the character, in canonical order. - */ - private void createDecompositions() - { - outv("\nGenerating Full decompositions..."); - StringBuffer temp = new StringBuffer(); - - short compatCount=0, canonCount=0; - - for (char ch = 0; ch < 0xFFFF; ++ch) { - if (ch >= '\u4E00' && ch <= '\uD7A3') continue; // skip ideos - - short category = uinfo.getCategory(ch); - - if (category == uinfo.UNASSIGNED) continue; //skip reserved - if (category == uinfo.CONTROL) continue; - if (category == uinfo.FORMAT) continue; - if (category == uinfo.PRIVATE_USE) continue; - if (category == uinfo.SURROGATE) continue; - - boolean canon = uinfo.hasCanonicalDecomposition(ch); - boolean compat = uinfo.hasCompatibilityDecomposition(ch); - - if (canon) canonCount++; - if (compat) compatCount++; - - if (canon || compat) { - String decomp = uinfo.getFullDecomposition(ch, canon); - temp.setLength(0); - temp.append(decomp); - uinfo.fixCanonical(temp); // put into canonical order - - decomps.put(ch, temp.toString() ); - } - } - } - - /** - * Modify a list in place by prepending the given character to all - * of its elements, which are assumed to be strings. - */ - static List concat(char ch, List a) { - for (int i = 0; i < a.size(); ++i) { - a.set(i, ch + (String)a.get(i)); - } - return a; - } - - /** - * Return a list of Strings for all possible permutations of the - * characters in the input string. - */ - static List jumble (String source) - { - ArrayList result = new ArrayList(); - if (source.length() == 1) { - result.add(source); - } else for (int i = 0; i < source.length(); ++i) { - result.addAll( concat( source.charAt(i), - jumble(source.substring(0,i) - + source.substring(i+1,source.length())))); - } - return result; - } - - static final int STR_INDEX_SHIFT = 2; - static final int STR_LENGTH_MASK = 0x0003; - - static final int DECOMP_RECURSE = 0x00008000; - static final int DECOMP_MASK = 0x00007FFF; - - /** - * Generate a new "DecompData.java" that contains the CompactArray definitions - * used in the {@link Normalizer.DECOMPOSE} operation. - */ - void buildDecompData() throws IOException { - - outv("\nGenerating DecompData.java...."); - // - // For each Unicode character that has a decomposition, we put its - // fully-decomposed form at the end of the "contents" string, followed - // by a null, and we put its index in "contents" into the CompactArray. - // If it does not have a decomposition, we store a bogus index. - // - // We do this first for all of the compatibility decompositions, save - // the index in MAX_COMPAT, and then do it again for the canonical - // decompositions. When the array is used later, any character whose - // decomp has an index greater than MAX_COMPAT is a canonical decomp. - // - int canonIndex = 0; - int compatIndex = 0; - - // Map from Unicode character to replacement string index - CompactCharArray offsets = new CompactCharArray((char)0); - - // We also need a place to store the replacement strings. Add a char at - // the front so that "0" won't be the index of any of the replacement strings. - StringBuffer replace = new StringBuffer().append("\uffff"); - - for (char ch = 0; ch < 0xFFFF; ch++) { - if (uinfo.hasCompatibilityDecomposition(ch)) { - compatIndex = putLength(replace, decomps.get(ch), 0); - offsets.setElementAt(ch, (char)compatIndex); - } - } - - // Add the canonical decomps. Their indices must be > compatIndex. - for (char ch = 0; ch < 0xFFFF; ch++) { - if (uinfo.hasCanonicalDecomposition(ch)) { - - if (ch == 0x0f77) { - outv("0F77: decomps.get() = " + Utility.hex(decomps.get(ch))); - outv("0F77: fullDecomp = " + Utility.hex(uinfo.getFullDecomposition(ch,false))); - } - - canonIndex = putLength(replace, decomps.get(ch), compatIndex); - - // If this character's full compatibility decomposition is different from - // its canonical decomp, that means one of the characters in its - // canonical decomp itself has a compatibility decomp. To deal with this, - // we set a bit flag telling the decomposer to recurse on this character. - - if (!uinfo.getFullDecomposition(ch,true).equals(uinfo.getFullDecomposition(ch,false))) { - offsets.setElementAt(ch, (char)(canonIndex | DECOMP_RECURSE)); - } else { - offsets.setElementAt(ch, (char)canonIndex); - } - } - } - - // - // Now generate another CompactArray containing the combining class of every - // character in Unicode - // - final byte BASE = 0; - CompactByteArray canonClasses = new CompactByteArray(BASE); - - for (char ch = 0; ch < 0xFFFF; ch++) { - short canonClass = uinfo.getCanonicalClass(ch); - if (canonClass != 0) { - canonClasses.setElementAt(ch, (byte)canonClass); - } - } - - // Finally, write the data out to a compilable Java source file - - if (fJava) { - String f = fOutDir + "DecompData"; - out("Writing " + f); - writeDecompData(new JavaWriter(f), - canonIndex, compatIndex, BASE, offsets, replace, canonClasses); - - } - - if (fCPP) { - String f = fOutDir + "dcmpdata"; - out("Writing " + f + ".(cpp|h)"); - writeDecompData(new CPPWriter(f, "DecompData"), - canonIndex, compatIndex, BASE, offsets, replace, canonClasses); - } - - outv("Decomp data: MAX_CANONICAL = " + canonIndex + ", MAX_DECOMP = " + compatIndex); - - if (fShowSizes) { - int offsetSize = offsets.getIndexArray().length * 2 + offsets.getValueArray().length * 2; - int canonSize = canonClasses.getIndexArray().length * 2 + canonClasses.getValueArray().length; - int replaceLength = replace.length(); - - outv("Total runtime size of decomp data is " - + (offsetSize + canonSize + replaceLength)); - - outv(" offsets: " + offsetSize); - outv(" canonClasses: " + canonSize); - outv(" replace: " + replaceLength); - } - } - - void writeDecompData(SourceWriter out, int maxCanon, int maxCompat, short BASE, - CompactCharArray offsets, StringBuffer contents, - CompactByteArray canonClasses) - { - out.write("MAX_CANONICAL", maxCanon ); - out.write("MAX_COMPAT", maxCompat ); - out.write("DECOMP_MASK", DECOMP_MASK ); - out.write("DECOMP_RECURSE", DECOMP_RECURSE ); - out.write("BASE", BASE ); - out.write("offsets", offsets ); - out.write("contents", contents ); - out.write("canonClass", canonClasses ); - out.close(); - } - - - //========================================================================================== - // Methods for generating and writing the composition data - // - final int TYPE_MASK = 0x0007; - final int INDEX_MASK = 0xFFF8; - final int INDEX_SHIFT = 3; - - // MAX_BASES is used to map a 2-diminsional (base,combining) index pair onto a - // one-dimensional CompactArray. We could just use baseCount, but making it a power - // of two allows slightly better compaction. - - final int MAX_BASES = 1024; // Product must be <= 64K - final int MAX_COMBINE = 65536/MAX_BASES; - - final char // for character types - IGNORE = 0, - BASE = 1, - EXPLODING_BASE = 2, - COMBINING = 3, - INITIAL_JAMO = 4, - MEDIAL_JAMO = 5, - FINAL_JAMO = 6, - HANGUL = 7; - - // These variables actually hold the composition data. - short baseCount = 1; // Leave 0 as an invalid index - short combineCount = 1; // Leave 0 as an invalid index - short nccCount = 0; - int maxCompat = 0; - int maxCanon = 0; - - // This array contains types (from the set above) and indices into the "replace" - // and "actions" arrays - CompactCharArray lookup = new CompactCharArray(IGNORE); - - // We also need a place to store the strings that result from replacements, - // explosions, and combinations. Add a char at the front so that "0" won't - // be the index of any of the replacement strings. - StringBuffer replace = new StringBuffer().append(" "); - - // We need to represent each canonical character class as a single bit - // so that we can OR together a mask of all combining char classes seen - // Build an array that maps from combining class to a compacted integer - // from 0..n-1, where n is the number of distinct combining classes. - // E.g., in 3.0, there are 53 distinct combining classes. - int[] classMap = new int[256]; - int[] typeBit; - - // Build a two-dimensional array of the action to take for each base/combining pair - CompactCharArray actions = new CompactCharArray((char)0); - - char[] actionIndex; - - /** - * Generate a new "ComposeData.java" that contains the CompactArray definitions - * used in the {@link Normalizer.COMPOSE} operation. - */ - void buildComposeData() throws IOException - { - outv("\nGenerating ComposeData.java...."); - - BitSet usedIndices = new BitSet(); - CharSet explodingBases = new CharSet(); - NonComposingCombiningMap nccMap = new NonComposingCombiningMap(); - - // Find all characters that are both bases *and* have compatibility - // decompositions. These are weird - for (char ch = 0; ch < 0xFFFF; ch++) { - if (bases.contains(ch) && uinfo.hasCompatibilityDecomposition(ch)) { - // - // Add this character's explosion to the replacement string list. - // We're going to make sure that its "base index", i.e. the - // index for it in the actions array, is the same as the - // explosion's index in the replace string. This lets - // us use the same index for the character's two behaviors - // - int index = put(replace, explodeCompat.get(ch), 0); - - outv(Utility.hex(ch) + " is base and has compat explosion " - + Utility.hex(explodeCompat.get(ch)) ); - - addChar(lookup, ch, EXPLODING_BASE, index); - usedIndices.set(index); - explodingBases.add(ch); - } - } - - // First add the base characters to the array. - // At the same time, compute their indices. - // Leave an empty base index of 0 as a placeholder for null operations. - // - - for (char ch = 0; ch < 0xFFFF; ch++) - { - - if (explodingBases.contains(ch)) { - continue; - } - - short cclass = uinfo.getCanonicalClass(ch); - - if (bases.contains(ch)) { - // Make sure that we don't use a base index that was already used - // for an exploding base character. - while (usedIndices.get(baseCount)) { - baseCount++; - } - // Now add the character to lookup as a base - addChar(lookup, ch, BASE, baseCount++); - } - if (combining.contains(ch)) { - classMap[cclass] = 1; // Mark this combining class as being used - addChar(lookup, ch, COMBINING, combineCount++); - } - - if (ch >= '\u1100' && ch < '\u1160') { - addChar(lookup, ch, INITIAL_JAMO, 0); - } - if (ch >= '\u1161' && ch < '\u11a6') { - addChar(lookup, ch, MEDIAL_JAMO, 0); - } - if (ch >= '\u11a7' && ch < '\u11fa') { - addChar(lookup, ch, FINAL_JAMO, 0); - } - if (ch >= 0xac00 && ch <= 0xd7a4) { - addChar(lookup, ch, HANGUL, 0); - } - - // Add explosions for all compatibility decompositions, - // including the Jamo --> Conjoining Jamo decomps. - // If the canonical decomposition is exactly one character - // one (4 hex digits) then we deal with it separately below. - if (explodeCompat.contains(ch) && - uinfo.getDecomposition(ch).length() != 4) - { - maxCompat = put(replace, explodeCompat.get(ch), 0); - addExplosion(lookup, ch, maxCompat); - } - } - - // Now add the explosions resulting from canonical decompositions - // These will all have indices greater than "maxCompat" so we can distinguish them. - // - for (char ch = 0; ch < 0xFFFF; ch++) { - short cclass = uinfo.getCanonicalClass(ch); - // not used String explosion = null; - - if (explodeOnly.contains(ch) && uinfo.hasCanonicalDecomposition(ch)) { - maxCanon = put(replace, explodeOnly.get(ch), maxCompat); - addExplosion(lookup, ch, maxCanon); - } - -// else if (!combining.contains(ch) && cclass != 0 && classMap[cclass] != 0) { -// // -// // If a combining character didn't happen to end up in one of -// // the pairwise combinations or explosions we use but still has -// // a combining class that is the same as a character we *do* use, -// // we need to save its class so that we don't combine things "past" it. -// // -// // However, if the character has an explosion we *don't* need it, because -// // we'll never see it, only the results of its explosion. -// // -// addChar(lookup, ch, COMBINING, 0); -// nccCount++; -// } - - // I'm rewriting this logic. Having an index of zero means that - // the typeBit[index] gets overwritten with multiple different - // values. So we must use real index values that are unique - // per combining class. Also, it doesn't matter if the class - // has been seen or not; we still need to record the character - // in order to have its type and class during composition. - else if (!combining.contains(ch) && cclass != 0) { - // If a combining character didn't happen to end up in one of - // the pairwise combinations or explosions we use but still has - // a combining class that is the same as a character we *do* use, - // we need to save its class. - - // As our index, use combineCount and up. Reuse values by - // mapping them through nccMap, which keeps track of previously - // used values and allocates new ones only as needed, starting - // with zero. - Liu - classMap[cclass] = 1; // Mark this combining class as being used - addChar(lookup, ch, COMBINING, combineCount + nccMap.getIndexFor(cclass)); - } - } - - nccCount = (short) nccMap.getIndexCount(); // Liu - - // Remap characters that have a canonical decomposition to a singleton, - // and also different compatibility and canonical full decompositions - // (that is, also are members of explodeCompat). These characters can't - // be exploded to their full decomposition since that breaks canonical - // composition (normalization form C). Instead, we place their - // singleton decomposition in the table, at the end. This works because - // the singleton will get recursively exploded by Normalizer. As of - // Unicode 3.0, this fix applies to U+1FFE, 1FFD, 2000, and 2001. - Liu - int singleton = replace.length(); - for (char ch = 0; ch < 0xFFFF; ch++) { - if (!explodingBases.contains(ch) && - explodeCompat.contains(ch) && - uinfo.getDecomposition(ch).length() == 4) { - - // There might be a cleaner way to do this, perhaps by folding - // this logic into the code above (perhaps calling - // addExplosion() instead of addChar()), but I couldn't find it. - char remap = (char) - Integer.parseInt(uinfo.getDecomposition(ch), 16); - - int index = put(replace, String.valueOf(remap), singleton); - addChar(lookup, ch, EXPLODING_BASE, index); - - outv("Canonical singleton " + Utility.hex(ch) + - " remaps to " + Utility.hex(remap) + " index=" + index); - } - } - - // Now run through the combining classes again and assign bit numbers - // in the same ascending order as the canonical classes - // not used int maskShift = 0; - int bit = 0; - for (int i = 0; i < 256; i++) { - if (classMap[i] != 0) { - classMap[i] = ++bit; - } - } - if (bit >= 64) { - err(String.valueOf(bit+1) + " combining classes; max is 64"); - } - outv("# of combining classes is " + (bit+1)); - - outv("baseCount=" + baseCount + ", combineCount=" + combineCount - + ", nccCount=" + nccCount); - - if (baseCount > MAX_BASES) { - err(Integer.toString(baseCount) + " bases, limit is " + MAX_BASES); - err(Integer.toString(combineCount) + " combining chars, limit is " + MAX_COMBINE); - } - - // Now build the "actions" array that tells what to do when each base / - // combining pair is seen. - // - // First do character pairs that combine into a single character... - // - Iterator iter = binaryCompositions.keySet().iterator(); - while (iter.hasNext()) { - String source = (String)iter.next(); - char ch = binaryCompositions.get(source); - - int baseIndex = lookup.elementAt(source.charAt(0)) >>> INDEX_SHIFT; - int combiningIndex = lookup.elementAt(source.charAt(1)) >>> INDEX_SHIFT; - - actions.setElementAt((char)(baseIndex + MAX_BASES*combiningIndex), ch); - } - - - // - // Pair explosions: base/combining pairs that explode into something else - // We're squeezing the indices for these in between MAX_COMPOSED and 0xFFFF, - // which means they can't be indexes into the "replace" string; those are too big. - // Instead they're indexes into the "actionIndex" array, which in turn contains - // indices in "replace" - // - actionIndex = new char[ pairExplosions.size() ]; - short index = 0; - - iter = pairExplosions.keySet().iterator(); - while (iter.hasNext()) { - String source = (String)iter.next(); - char base = source.charAt(0); - char combining = source.charAt(1); - - int strIndex = put(replace, (String)pairExplosions.get(source), 0); - actionIndex[index] = (char)strIndex; - - int baseIndex = lookup.elementAt(base) >>> INDEX_SHIFT; - int combiningIndex = lookup.elementAt(combining) >>> INDEX_SHIFT; - - actions.setElementAt((char)(baseIndex + MAX_BASES*combiningIndex), - (char)(index + largestChar)); - index++; - } - - // Fill in the array that maps from combining class value - // to a bit numbe representing the canonical combining class. - // That is, map from 0..240 (in 3.0) to 0..52. - typeBit = new int[combineCount + nccCount]; - - for (char ch = 0; ch < 0xFFFF; ch++) { - int value = lookup.elementAt(ch); - int type = value & TYPE_MASK; - - if (type == COMBINING) { - int ind = value >>> INDEX_SHIFT; - int cclass = uinfo.getCanonicalClass(ch); - if (typeBit[ind] != 0 && typeBit[ind] != classMap[cclass]) { - err("Overwriting typeBit[" + ind + "], was " + - typeBit[ind] + ", changing to " + classMap[cclass] + " for class " + cclass); - } - typeBit[ind] = classMap[cclass]; - } - } - - if (fJava) { - String f = fOutDir + "ComposeData"; - out("Writing " + f); - writeComposeData(new JavaWriter(f)); - } - if (fCPP) { - String f = fOutDir + "compdata"; - out("Writing " + f + ".(cpp|h)"); - writeComposeData(new CPPWriter(f, "ComposeData")); - } - - if (fShowSizes) { - int lookupSize = lookup.getIndexArray().length * 2 + lookup.getValueArray().length * 2; - int actionSize = actions.getIndexArray().length * 2 + actions.getValueArray().length * 2; - int actIndexSize = actionIndex.length * 2; - int replaceSize = replace.length(); - int typeBitSize = typeBit.length * 2; - - outv("Total runtime size of compose data is " - + (lookupSize + actionSize + actIndexSize + replaceSize + typeBitSize)); - - outv(" lookup: " + lookupSize); - outv(" actions: " + actionSize); - outv(" actionIndex: " + actIndexSize); - outv(" typeBit: " + typeBitSize); - outv(" replace: " + replaceSize); - } - } - - void writeComposeData(SourceWriter out) { - out.write("BASE_COUNT", baseCount); - out.write("COMBINING_COUNT", combineCount); - out.write("MAX_COMPAT", maxCompat); - out.write("MAX_CANONICAL", maxCanon); - - out.writeHex("MAX_COMPOSED", largestChar); - - int maxIndex = replace.length(); - out.write("MAX_INDEX", maxIndex ); - out.write("INITIAL_JAMO_INDEX", maxIndex + 1); - out.write("MEDIAL_JAMO_INDEX", maxIndex + 2); - - out.write("MAX_BASES", MAX_BASES ); - out.write("MAX_COMBINE", MAX_COMBINE); - - out.writeHex("TYPE_MASK", TYPE_MASK); - out.write("INDEX_SHIFT", INDEX_SHIFT); - - // The character types - out.write("IGNORE", (int)IGNORE); - out.write("BASE", (int)BASE); - out.write("NON_COMPOSING_COMBINING", (int)EXPLODING_BASE); - out.write("COMBINING", (int)COMBINING); - out.write("INITIAL_JAMO", (int)INITIAL_JAMO); - out.write("MEDIAL_JAMO", (int)MEDIAL_JAMO); - out.write("FINAL_JAMO", (int)FINAL_JAMO); - out.write("HANGUL", (int)HANGUL); - - out.write("lookup", lookup ); - out.write("actions", actions ); - out.write("actionIndex", actionIndex ); - out.write("replace", replace ); - out.write("typeBit", typeBit); - - out.close(); - } - - void addChar(CompactCharArray lookup, char ch, int type, int index) - { - // First make sure it's not already present - if (lookup.elementAt(ch) != IGNORE) - { - char oldValue = lookup.elementAt(ch); - err(typeName(type) + " char is also " - + typeName(oldValue & TYPE_MASK) + ": " - + Utility.hex(ch) + " " + uinfo.getName(ch,true)); - } - else if ((index << INDEX_SHIFT) > 65536) { - err("not enough bits: index " + index + " << INDEX_SHIFT = " + (index << INDEX_SHIFT)); - } else { - lookup.setElementAt(ch, (char)(type | (index << INDEX_SHIFT))); - } - } - - void addExplosion(CompactCharArray lookup, char ch, int index) - { - // First make sure it doesn't already have an index - char oldValue = lookup.elementAt(ch); - int oldIndex = oldValue >>> INDEX_SHIFT; - - if (oldValue != IGNORE) { - err("Exploding char is already " + typeName(oldValue & TYPE_MASK) - + " (index " + oldIndex + "): " - + Utility.hex(ch) + " " + uinfo.getName(ch,true)); - } - - if (oldIndex != 0) { - err("Exploding char is already " + typeName(oldValue & TYPE_MASK) - + " (index " + oldIndex + "): " - + Utility.hex(ch) + " " + uinfo.getName(ch,true)); - } - else if ((index << INDEX_SHIFT) > 65536) { - err("not enough bits: index " + index + " << INDEX_SHIFT = " + (index << INDEX_SHIFT)); - } else { - lookup.setElementAt(ch, (char)((oldValue & ~INDEX_MASK) | (index << INDEX_SHIFT))); - } - } - - String typeName(int type) { - switch (type) { - case IGNORE: return "Ignored"; - case BASE: return "Base"; - case EXPLODING_BASE: return "Exploding Base"; - case COMBINING: return "Combining"; - case INITIAL_JAMO: return "Initial Jamo"; - case MEDIAL_JAMO: return "Medial Jamo"; - case FINAL_JAMO: return "Final Jamo"; - case HANGUL: return "Hangul"; - default: return "Unknown"; - } - } - - - static final int put(StringBuffer buf, String str, int minIndex) - { - str = str + '\u0000'; // Add trailing null - - int index = buf.toString().indexOf(str); - if (index <= minIndex) { - index = buf.length(); - buf.append(str); - } - return index; - } - - static final int putLength(StringBuffer buf, String str, int minIndex) { - int length = str.length(); - - if (length >= (1 << STR_INDEX_SHIFT)) { - // There's no room to store the length in the index, so - // add a null terminator and use a 0 length to flag this - str = str + '\u0000'; - length = 0; - } - - int index = buf.toString().indexOf(str); - if (index <= minIndex) { - index = buf.length(); - buf.append(str); - } - return (index << STR_INDEX_SHIFT) | length; - } - - //-------------------------------------------------------------------------------- - // Output & formatting - - void out(String str) { - System.out.println(str); - } - void outv(String str) { - if (fVerbose) System.out.println(str); - } - void warn(String str) { - System.err.println("Warning: " + str); - } - void err(String str) { - System.err.println("ERROR: " + str); - } -} - -//----------------------------------------------------------------------------- -// Utility classes -//----------------------------------------------------------------------------- - -class DecompMap extends HashMap { - public DecompMap() { - } - - void put(char ch, String value) { - put(new MutableChar(ch), value); - } - - String get(char ch) { - Object obj = get(probe.set(ch)); - return (obj != null) ? (String)obj : null; - } - - boolean contains(char ch) { - return containsKey(probe.set(ch)); - } - - MutableChar probe = new MutableChar(' '); -} - -class CompMap extends HashMap { - public CompMap() { - } - - void put(String key, char value) { - put(key, new MutableChar(value)); - } - - char get(String key) { - Object obj = get((Object)key); - return (obj != null) ? ((MutableChar)obj).value : 0; - } -} - -class CharSet extends HashSet { - public CharSet() { - } - - public void add(char ch) { - add(new MutableChar(ch)); - } - - public boolean contains(char ch) { - return contains(probe.set(ch)); - } - MutableChar probe = new MutableChar(' '); -} - -/** - * An int->int map. Each time a non-existent key is looked up, - * create a new mapping to the next available integer value. - */ -class NonComposingCombiningMap { - int index; - Hashtable hash; - - public NonComposingCombiningMap() { - index = 0; - hash = new Hashtable(); - } - - /** - * Return the existing mapping of class. If no such mapping - * exists, create one and return it. New mappings map to - * zero, then one, etc. - */ - public int getIndexFor(int cclass) { - Integer cl = new Integer(cclass); - Integer ind = (Integer) hash.get(cl); - if (ind != null) { - return ind.intValue(); - } - hash.put(cl, new Integer(index)); - return index++; - } - - /** - * Return the number of mappings made so far. That is, getIndexFor() - * has returned integers 0..getIndexCount()-1. - */ - public int getIndexCount() { - return index; - } -} diff --git a/icu4j/src/com/ibm/tools/normalizer/QuickCheckBuilder.java b/icu4j/src/com/ibm/tools/normalizer/QuickCheckBuilder.java deleted file mode 100755 index 2ca318bc9c..0000000000 --- a/icu4j/src/com/ibm/tools/normalizer/QuickCheckBuilder.java +++ /dev/null @@ -1,489 +0,0 @@ -/* -****************************************************************************** -* Copyright (C) 1996-2000, International Business Machines Corporation and * -* others. All Rights Reserved. * -****************************************************************************** -* -* $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/normalizer/Attic/QuickCheckBuilder.java,v $ -* $Date: 2001/10/30 02:42:49 $ -* $Revision: 1.6 $ -* -****************************************************************************** -*/ - -package com.ibm.tools.normalizer; - -import java.io.BufferedWriter; -import java.io.FileWriter; -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.Writer; -import java.io.Reader; -import java.io.EOFException; -import java.util.StringTokenizer; - -import com.ibm.util.ByteTrie; -import com.ibm.text.UCharacter; -import com.ibm.text.UTF16; - -/** -* Class to generate modified quickcheck data for collation. -* Data generated is a trie of normalization form corresponding to the index -* code point. -* Hence codepoint 0xABCD will have normalization form -* -* quickcheck[codepoint] = -* STAGE_3_[STAGE_2_[STAGE_1_[codepoint >> STAGE_1_SHIFT_] + -* ((codepoint >> STAGE_2_SHIFT_) & STAGE_2_MASK_AFTER_SHIFT_)] + -* (codepoint & STAGE_3_MASK_)]; -* -* value is a byte containing 2 sets of 4 bits information.
    -* bits 1 2 3 4 5678
    -* NFKC NFC NFKD NFD MAYBES NFKC NFC NFKD NFD YES
    -* ie if quick[0xABCD] = 10000001, this means that 0xABCD is in NFD form and -* maybe in NFKC form. -* @deprecated ICU4J 2.0, since ICU has written its own tool. -*/ -public class QuickCheckBuilder -{ - // public methods ---------------------------------------------------- - - /** - * constructor with default input, output file path - * @deprecated ICU4J 2.0, since ICU has written its own tool. - */ - public QuickCheckBuilder() - { - } - - /** - * Building method. - * Each unicode character will be used to generate data, output to the default - * file path - * @deprecated ICU4J 2.0, since ICU has written its own tool. - */ - public void build() - { - build(DEFAULT_INPUT_PATH_, DEFAULT_OUTPUT_PATH_); - } - - /** - * Building method. - * Each unicode character will be used to generate data. - * @param input file path - * @param output file path - * @deprecated ICU4J 2.0, since ICU has written its own tool. - */ - public void build(String input, String output) - { - try - { - byte result[] = getQuickCheckArray(input); - int notyes[] = getNotYesFirstCP(result); - ByteTrie trie = new ByteTrie(result); - FileWriter f = new FileWriter(output); - BufferedWriter w = new BufferedWriter(f); - - w.write("# QuickCheck data\n"); - w.write("# Generated from NormalizationQuickCheck.txt\n\n"); - w.write("int UQUICK_CHECK_MIN_VALUES_[] = {"); - w.write("0x" + Integer.toHexString(notyes[0]) + ", 0x" + - Integer.toHexString(notyes[1]) + ", 0x" + - Integer.toHexString(notyes[2]) + ", 0x" + - Integer.toHexString(notyes[3]) + "};\n"); - - String s = trie.toString(); - w.write(s); - w.close(); - System.out.println("test " + test(input, trie)); - } - catch(Exception e) - { - e.printStackTrace(); - } - } - - /** - * Main method - */ - public static void main(String arg[]) - { - QuickCheckBuilder qcb = new QuickCheckBuilder(); - qcb.build(); - } - - // private methods ----------------------------------------------------- - - /** - * Method to manipulate the values of the read in normalized form - * @param array of quickcheck values - * @param startcp starting code point - * @param endcp ending code point - * @param normalizationformat normalization format and the following argument - * state indicates if codepoints from startcp to endcp are of the - * indicated normalization format - * @param state indicates if codepoints from startcp to endcp are of the - * argument normalization format - */ - private void formQuickCheckValue(byte[] array, int startcp, int endcp, - String normalizationformat, String state) - { - byte value = NFD_MAYBE_MASK_; - byte clear = NFD_NO_MASK_; - - if (normalizationformat.equals(NFC_)) { - clear = NFC_NO_MASK_; - if (state.equals(NO_)) { - value = NFC_NO_MASK_; - } - else { - if (state.equals(YES_)) { - value = NFC_YES_MASK_; - } - else { - value = NFC_MAYBE_MASK_; - } - } - } - else { - if (normalizationformat.equals(NFD_)) { - if (state.equals(NO_)) { - value = NFD_NO_MASK_; - } - else { - if (state.equals(YES_)) { - value = NFD_YES_MASK_; - } - } - } - else { - if (normalizationformat.equals(NFKC_)) { - clear = NFKC_NO_MASK_; - if (state.equals(NO_)) { - value = NFKC_NO_MASK_; - } - else { - if (state.equals(YES_)) { - value = NFKC_YES_MASK_; - } - else { - value = NFKC_MAYBE_MASK_; - } - } - } - else { - if (normalizationformat.equals(NFKD_)) { - clear = NFKD_NO_MASK_; - if (state.equals(NO_)) { - value = NFKD_NO_MASK_; - } - else { - if (state.equals(YES_)) { - value = NFKD_YES_MASK_; - } - else { - value = NFKD_MAYBE_MASK_; - } - } - } - } - } - } - - for (; startcp <= endcp; startcp ++) { - array[startcp] &= clear; - if (value != clear) { - array[startcp] |= value; - } - } - } - - /** - * Reads in the NormalizationQuickCheck.txt file and generates a byte of - * QuickCheck data for each codepoint - * @param input file path - * @exception thrown when file reading error occurs - */ - private byte[] getQuickCheckArray(String input) throws Exception - { - byte result[] = new byte[UCharacter.MAX_VALUE + 1]; - - // initializing quickcheck array - initializeQuickCheckArray(result); - - StringTokenizer st; - // read in start and end codepoint - int startcp, - endcp; - // read in normalization format and its corresponding value - String nf, - check; - - try - { - FileReader f = new FileReader(input); - BufferedReader r = new BufferedReader(f); - String s = ""; - while (true) - { - s = r.readLine(); - if (s == null) - break; - - if (!s.equals("") && s.charAt(0) != '#') - { - st = new StringTokenizer(s, "; "); - startcp = Integer.parseInt(st.nextToken(), 16); - endcp = Integer.parseInt(st.nextToken(), 16); - nf = st.nextToken(); - check = st.nextToken(); - formQuickCheckValue(result, startcp, endcp, nf, check); - } - } - r.close(); - } - catch(EOFException e) - { - return result; - } - - return result; - } - - /** - * Initializing quickcheck array. - * All assigned codepoints have the value Y, all unassigned codepoints have - * the value M, all non-character codepoints (D800..DFFF, *FFFE, *FFFF) have - * the value N. - * @param array quickcheck byte array - */ - private void initializeQuickCheckArray(byte[] array) - { - for (int ch = UCharacter.MIN_VALUE; ch <= UCharacter.MAX_VALUE; ch ++) - { - array[ch] = DEFINED_CHAR_NORM_VALUE_; - if ((ch >= SURROGATE_START_ && ch <= SURROGATE_END_) || - ((ch & MASK_LAST_16_BITS_) >= - MIN_NOT_A_CHAR_AFTER_MASK_LAST_16_BITS_)) - array[ch] = NOT_A_CHARACTER_VALUE_; - } - } - - /** - * Tests the generated trie with the data in the input file. - * @param input file path - * @param trie object - * @exception thrown when file reading error occurs - */ - private boolean test(String input, ByteTrie trie) throws Exception - { - StringTokenizer st; - // read in start and end codepoint - int startcp, - endcp; - // read in normalization format and its corresponding value - String nf, - check; - byte temp; - - try - { - FileReader f = new FileReader(input); - BufferedReader r = new BufferedReader(f); - String s = ""; - while (true) - { - s = r.readLine(); - if (s == null) - break; - - if (!s.equals("") && s.charAt(0) != '#') - { - st = new StringTokenizer(s, "; "); - startcp = Integer.parseInt(st.nextToken(), 16); - endcp = Integer.parseInt(st.nextToken(), 16); - nf = st.nextToken(); - check = st.nextToken(); - - byte mask = 0; - - if (nf.equals(NFC_)) - mask = (byte)0x44; - else - if (nf.equals(NFD_)) - mask = (byte)0x11; - else - if (nf.equals(NFKC_)) - mask = (byte)0x88; - else - if (nf.equals(NFKD_)) - mask = (byte)0x22; - for (; startcp <= endcp; startcp ++) - { - temp = (byte)(trie.getValue(startcp) & mask); - if (check.equals(NO_) && (temp != 0)) - { - System.out.println("Error at NO " + startcp); - return false; - } - - if (check.equals(YES_) && (temp < 0 || temp > 0x8)) - { - System.out.println("Error at YES " + startcp); - return false; - } - - if (check.equals(MAYBE_) && (temp < 0x10) && (temp != -128)) - { - System.out.println("Error at MAYBE " + startcp); - return false; - } - } - } - } - r.close(); - } - catch(EOFException e) - { - return true; - } - return true; - } - - /** - * Returns an array of the first codepoints that do not have a YES for their - * respective normalization format. Hence - *

    getNotYesFirstCP[0] is the first codepoint that is not a NFD_YES
    - * getNotYesFirstCP[1] is the first codepoint that is not a NFKD_YES
    - * getNotYesFirstCP[2] is the first codepoint that is not a NFC_YES
    - * getNotYesFirstCP[3] is the first codepoint that is not a NFKC_YES
    - * @param quickcheck array of quickcheck values - * @return array of first codepoints not a YES - */ - private int[] getNotYesFirstCP(byte[] quickcheck) - { - int result[] = {UCharacter.MAX_VALUE, UCharacter.MAX_VALUE, - UCharacter.MAX_VALUE, UCharacter.MAX_VALUE}; - byte value; - for (int codepoint = 0; codepoint < UCharacter.MAX_VALUE; codepoint ++) - { - value = quickcheck[codepoint]; - if ((value & NFD_YES_MASK_) == 0 && (codepoint < result[0])) - result[0] = codepoint; - if ((value & NFKD_YES_MASK_) == 0 && (codepoint < result[1])) - result[1] = codepoint; - if ((value & NFC_YES_MASK_) == 0 && (codepoint < result[2])) - result[2] = codepoint; - if ((value & NFKC_YES_MASK_) == 0 && (codepoint < result[3])) - result[3] = codepoint; - } - return result; - } - - // private data members ------------------------------------------------ - - /** - * Input file path - */ - private final String DEFAULT_INPUT_PATH_ = - "data//unicode//NormalizationQuickCheck.txt"; - - /** - * Output file path - */ - private final String DEFAULT_OUTPUT_PATH_ = "QuickCheck.txt"; - - /** - * 16 bits mask - */ - private final int MASK_LAST_16_BITS_ = 0xFFFF; - - /** - * Minimum value of a not-a-character after the 16 bit masking - */ - private final int MIN_NOT_A_CHAR_AFTER_MASK_LAST_16_BITS_ = 0xFFFE; - - /** - * Surrogate code points - */ - private final int SURROGATE_START_ = 0xD800; - private final int SURROGATE_END_ = 0xDBFF; - - /** - * NFD 2 bit mask - */ - private final byte NFD_NO_MASK_ = (byte)0xEE; - private final byte NFD_YES_MASK_ = (byte)0x01; - private final byte NFD_MAYBE_MASK_ = (byte)0x10; - - /** - * NFKD 2 bit mask - */ - private final byte NFKD_NO_MASK_ = (byte)0xDD; - private final byte NFKD_YES_MASK_ = (byte)0x02; - private final byte NFKD_MAYBE_MASK_ = (byte)0xd0; - - /** - * NFC 2 bit mask - */ - private final byte NFC_NO_MASK_ = (byte)0xBB; - private final byte NFC_YES_MASK_ = (byte)0x04; - private final byte NFC_MAYBE_MASK_ = (byte)0x40; - - /** - * NFKC 2 bit mask - */ - private final byte NFKC_NO_MASK_ = (byte)0x77; - private final byte NFKC_YES_MASK_ = (byte)0x08; - private final byte NFKC_MAYBE_MASK_ = (byte)0x80; - - /** - * Default value for undefined characters - */ - private final byte UNDEFINED_CHAR_NORM_VALUE_ = (byte)0xF0; - - /** - * Default value for defined characters - */ - private final byte DEFINED_CHAR_NORM_VALUE_ = (byte)0x0F; - - /** - * Default value for not-a-character - */ - private final byte NOT_A_CHARACTER_VALUE_ = (byte)0x00; - - /** - * NFC name - */ - private final String NFC_ = "NFC"; - - /** - * NFKC name - */ - private final String NFKC_ = "NFKC"; - - /** - * NFD name - */ - private final String NFD_ = "NFD"; - - /** - * NFKD name - */ - private final String NFKD_ = "NFKD"; - - /** - * YES - */ - private final String YES_ = "Y"; - - /** - * NO - */ - private final String NO_ = "N"; - - /** - * MAYBE - */ - private final String MAYBE_ = "M"; -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/normalizer/SourceWriter.java b/icu4j/src/com/ibm/tools/normalizer/SourceWriter.java deleted file mode 100755 index e951f4b6c5..0000000000 --- a/icu4j/src/com/ibm/tools/normalizer/SourceWriter.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/normalizer/Attic/SourceWriter.java,v $ - * $Date: 2000/07/12 16:41:26 $ - * $Revision: 1.3 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.normalizer; - -import com.ibm.text.*; -import com.ibm.util.CompactCharArray; -import com.ibm.util.CompactByteArray; -import java.io.PrintWriter; -import java.util.Date; - -//=========================================================================================== -// Utilities for writing data out as compilable source code -// -public abstract class SourceWriter { - abstract public void close(); - abstract public void write(String name, short value); - abstract public void write(String name, int value); - - abstract public void write(String name, CompactCharArray array); - abstract public void write(String name, CompactByteArray array); - abstract public void write(String name, StringBuffer str); - - abstract public void write(String name, char[] array); - abstract public void write(String name, int[] array); - - abstract public void writeHex(String name, char value); - abstract public void writeHex(String name, int value); - - void writeHeader(PrintWriter out) { - out.println("/*"); - out.println("************************************************************************"); - out.println("* Copyright (c) 1997-2000, International Business Machines"); - out.println("* Corporation and others. All Rights Reserved."); - out.println("************************************************************************"); - out.println("* > THIS FILE WAS MACHINE GENERATED <"); - out.println("* > DO NOT EDIT BY HAND <"); - out.println("* > RUN TOOL TO REGENERATE <"); - out.println("* Tool: " + Normalizer.class.getName()); - out.println("* Creation date: " + new Date()); - out.println("*/"); - } -} diff --git a/icu4j/src/com/ibm/tools/normalizer/package.html b/icu4j/src/com/ibm/tools/normalizer/package.html deleted file mode 100755 index 11eaccd51e..0000000000 --- a/icu4j/src/com/ibm/tools/normalizer/package.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -Tool used to rebuild data tables used by Normalizer. - - \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/rbbi/BuildDictionaryFile.java b/icu4j/src/com/ibm/tools/rbbi/BuildDictionaryFile.java deleted file mode 100755 index 8c1e0d0790..0000000000 --- a/icu4j/src/com/ibm/tools/rbbi/BuildDictionaryFile.java +++ /dev/null @@ -1,877 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/rbbi/Attic/BuildDictionaryFile.java,v $ - * $Date: 2001/12/04 20:09:08 $ - * $Revision: 1.2 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.rbbi; - -import com.ibm.util.CompactByteArray; -import com.ibm.text.UnicodeSet; -import com.ibm.util.Utility; -import java.io.*; -import java.util.Enumeration; -import java.util.Vector; - -public class BuildDictionaryFile { - public static void main(String args[]) - throws FileNotFoundException, UnsupportedEncodingException, IOException { - String filename = args[0]; - String encoding = ""; - String outputFile = ""; - String listingFile = ""; - - if (args.length >= 2) - encoding = args[1]; - - if(args.length >= 3) - outputFile = args[2]; - - if (args.length >= 4) - listingFile = args[3]; - - BuildDictionaryFile dictionary = new BuildDictionaryFile(); - dictionary.build(filename, encoding); - - DataOutputStream out = null; - if (outputFile.length() != 0) { - out = new DataOutputStream(new FileOutputStream(outputFile)); - dictionary.writeDictionaryFile(out); - } - - PrintWriter listing = null; - if (listingFile.length() != 0) { - listing = new PrintWriter(new OutputStreamWriter(new FileOutputStream(listingFile), "UnicodeLittle")); - dictionary.printWordList("", 0, listing); - listing.close(); - } - } - - public BuildDictionaryFile() { - } - - public void build(String filename, String encoding) - throws FileNotFoundException, UnsupportedEncodingException, IOException { - FileInputStream file = new FileInputStream(filename); - InputStreamReader in; - if (encoding.length() == 0) - in = new InputStreamReader(file); - else - in = new InputStreamReader(file, encoding); - - buildColumnMap(in); - - file = new FileInputStream(filename); - if (encoding.length() == 0) - in = new InputStreamReader(file); - else - in = new InputStreamReader(file, encoding); - - buildStateTable(in); -//printTable(); - } - - public void buildColumnMap(InputStreamReader in) throws IOException { -System.out.println("Building column map..."); - UnicodeSet charsInFile = new UnicodeSet(); - int c = in.read(); -int totalChars = 0; - while (c >= 0) { -++totalChars; if (totalChars > 0 && totalChars % 5000 == 0) System.out.println("Read " + totalChars + " characters..."); - if (c > ' ') - charsInFile.add((char)c); - c = in.read(); - } -// Test.debugPrintln(charsInFile.toString()); - - StringBuffer tempReverseMap = new StringBuffer(); - tempReverseMap.append(' '); - - columnMap = new CompactByteArray(); - int n = charsInFile.getRangeCount(); - byte p = 1; - for (int i=0; i= 0) { - charsInWord++; - short column = columnMap.elementAt((char)c); - - row = (int[])(tempTable.elementAt(state)); - if (column != 0) { - if (row[column] == 0) { - row[column] = tempTable.size(); - ++row[numCols]; - state = (tempTable.size()); - tempTable.addElement(new int[numCols + 1]); - } - else - state = row[column]; - } - else if (state != 0) { - if (row[0] != -1) { - row[0] = -1; - ++row[numCols]; - uniqueWords++; - totalUniqueWordChars += charsInWord; - } - totalWords++; -if (totalWords % 5000 == 0) System.out.println("Read " + totalWords + " words, " + tempTable.size() + " rows..."); - charsInWord = 0; - state = 0; - } - c = in.read(); - } - if (state != 0) { - row = (int[])(tempTable.elementAt(state)); - if (row[0] != -1) { - row[0] = -1; - uniqueWords++; - totalUniqueWordChars += charsInWord; - } - totalWords++; - } - - compress(tempTable); - - table = new short[numCols * tempTable.size()]; - for (int i = 0; i < tempTable.size(); i++) { - row = (int[])tempTable.elementAt(i); - for (int j = 0; j < numCols; j++) - table[i * numCols + j] = (short)row[j]; - } - } - - private void compress(Vector tempTable) { -System.out.println("Before compression:"); -System.out.println(" Number of rows = " + tempTable.size()); -System.out.println(" Number of columns = " + numCols); -System.out.println(" Number of cells = " + tempTable.size() * numCols); - deleteDuplicateRows(tempTable); -System.out.println("After removing duplicate rows:"); -System.out.println(" Number of rows = " + tempTable.size()); -System.out.println(" Number of columns = " + numCols); -System.out.println(" Number of cells = " + tempTable.size() * numCols); - stackRows(tempTable); -if (tempTable.size() > 32767) throw new IllegalArgumentException("Too many rows in table!"); -System.out.println("After doubling up on rows:"); -System.out.println(" Number of rows = " + tempTable.size()); -System.out.println(" Number of columns = " + numCols); -System.out.println(" Number of cells = " + tempTable.size() * numCols); - } - -/* -experimental... - private void deleteDuplicateRows(Vector tempTable) { - int[] rowNumMap = new int[tempTable.size()]; - for (int i = 0; i < rowNumMap.length; i++) - rowNumMap[i] = i; - - int nextClass = numCols; - int currentClass; - int lastClass; - boolean split; - int[] row1, row2, tempRow; - int tempCat; - - do { -System.out.println("Making a pass (" + nextClass + " classes)..."); - currentClass = 0; - lastClass = nextClass; - while (currentClass < nextClass) { -System.out.println(" currentClass = " + currentClass); - split = false; - row1 = row2 = null; - for (int i = 0; i < tempTable.size(); i++) { - tempRow = (int[])tempTable.elementAt(i); - if (tempRow[numCols] == currentClass) { - if (row1 == null) { - row1 = (int[])tempTable.elementAt(i); - } - else { - row2 = (int[])tempTable.elementAt(i); - for (int j = 0; j < numCols; j++) { - if ((row1[j] == 0) != (row2[j] == 0) || - (row1[j] == -1) != (row2[j] == -1)) { - row2[numCols] = nextClass; - split = true; - break; - } - else if (row1[j] != 0 && row2[j] != 0 && row1[j] != -1 - && row2[j] != -1) { - tempRow = (int[])tempTable.elementAt(row1[j]); - tempCat = tempRow[numCols]; - tempRow = (int[])tempTable.elementAt(row2[j]); - if (tempCat != tempRow[numCols]) { - row2[numCols] = nextClass; - split = true; - break; - } - } - } - } - } - } - if (split) - ++nextClass; - ++currentClass; -//System.out.println(); - } - } while (lastClass != nextClass); - - int[] representatives = new int[nextClass]; - for (int i = 1; i < tempTable.size(); i++) { - tempRow = (int[])tempTable.elementAt(i); - if (representatives[tempRow[numCols]] == 0) - representatives[tempRow[numCols]] = i; - else - rowNumMap[i] = representatives[tempRow[numCols]]; - } -System.out.println("Renumbering..."); - - // renumber all remaining rows - for (int i = 0; i < rowNumMap.length; i++) - if (rowNumMap[i] != i) - tempTable.setElementAt(null, i); - int newRowNum = 0; - for (int i = 0; i < rowNumMap.length; i++) - if (tempTable.elementAt(i) != null) - rowNumMap[i] = newRowNum++; - for (int i = 0; i < rowNumMap.length; i++) - if (tempTable.elementAt(i) == null) - rowNumMap[i] = rowNumMap[rowNumMap[i]]; - - for (int i = tempTable.size() - 1; i >= 0; i--) { - tempRow = (int[])tempTable.elementAt(i); - if (tempRow == null) - tempTable.removeElementAt(i); - else { - for (int j = 0; j < numCols; j++) - if (tempRow[j] != -1) - tempRow[j] = rowNumMap[j]; - } - } -//for (int i = 1; i < rowNumMap.length; i++) rowNumMap[i] = i; int newRowNum = rowNumMap.length; - } -*/ - - private void deleteDuplicateRows(Vector tempTable) { - Vector work = (Vector)(tempTable.clone()); - boolean didDeleteRow = true; - - Vector tempMapping = new Vector(work.size()); - int[] mapping = new int[work.size()]; - for (int i = 0; i < mapping.length; i++) { - mapping[i] = i; - tempMapping.addElement(new Integer(i)); - } - boolean[] tbd = new boolean[work.size()]; - - while (didDeleteRow) { -System.out.println(" " + work.size() + " rows..."); -int deletedRows = 0; - didDeleteRow = false; - - sortTable(work, tempMapping, mapping, 1, work.size()); - for (int i = 0; i < work.size() - 1; ) { -System.out.print("Deleting, inspecting row " + i + ", deleted " + deletedRows + " rows...\r"); - int rowToDelete = ((Integer)(tempMapping.elementAt(i + 1))).intValue(); - int rowToMapTo = ((Integer)(tempMapping.elementAt(i))).intValue(); - if (compareRows((int[])work.elementAt(i), (int[])work.elementAt(i + 1), - mapping) == 0) { - tbd[rowToDelete] = true; - tempTable.setElementAt(null, rowToDelete); - while (tbd[mapping[rowToMapTo]]) - mapping[rowToMapTo] = mapping[mapping[rowToMapTo]]; - mapping[rowToDelete] = mapping[rowToMapTo]; - didDeleteRow = true; -deletedRows++; - work.removeElementAt(i + 1); - tempMapping.removeElementAt(i + 1); - } - else - i++; - } - for (int i = 0; i < mapping.length; i++) { - if (tbd[i] && tbd[mapping[i]]) - mapping[i] = mapping[mapping[i]]; - } - } - - int decrementBy = 0; - for (int i = 0; i < mapping.length; i++) { - if (tbd[i]) - decrementBy++; - else - mapping[i] -= decrementBy; - } - for (int i = 0; i < mapping.length; i++) { - if (tbd[i]) - mapping[i] = mapping[mapping[i]]; - } - for (int i = tempTable.size() - 1; i >= 0; i--) { - if (tbd[i]) - tempTable.removeElementAt(i); - else { - int[] row = (int[])tempTable.elementAt(i); - for (int j = 0; j < numCols; j++) - row[j] = (row[j] == -1) ? -1 : mapping[row[j]]; - } - } - } - - private void sortTable(Vector table, Vector tempMapping, int[] mapping, int start, int end) { -System.out.print("Sorting (" + start + ", " + end + ")...\r"); - if (start + 1 >= end) - return; - else if (start + 10 >= end) { - for (int i = start + 1; i < end; i++) { - int[] row = (int[])table.elementAt(i); - Integer tempMap = (Integer)tempMapping.elementAt(i); - int j; - for (j = i - 1; j >= start; j--) { - if (compareRows((int[])table.elementAt(j), row, mapping) > 0) { - table.setElementAt((int[])table.elementAt(j), j + 1); - tempMapping.setElementAt((Integer)tempMapping.elementAt(j), j + 1); - } - else { - table.setElementAt(row, j + 1); - tempMapping.setElementAt(tempMap, j + 1); - break; - } - } - if (j < start) { - table.setElementAt(row, start); - tempMapping.setElementAt(tempMap, start); - } - } - } - else { - int boundaryPos = (start + end) / 2; - int i; - boolean allTheSame = true; - int firstDifferent = 0; - - do { - int[] boundary = (int[])table.elementAt(boundaryPos); - i = start; - int j = end - 1; - int[] row = null; - byte compResult; - while (i < j) { - row = (int[])table.elementAt(i); - while (i <= j && compareRows(row, boundary, mapping) < 0) { - i++; - row = (int[])table.elementAt(i); - } - - row = (int[])table.elementAt(j); - compResult = compareRows(row, boundary, mapping); - while (i <= j && (compResult >= 0)) { - if (compResult != 0) { - allTheSame = false; - firstDifferent = j; - } - j--; - row = (int[])table.elementAt(j); - compResult = compareRows(row, boundary, mapping); - } - if (i <= j) { - row = (int[])table.elementAt(j); - table.setElementAt(table.elementAt(i), j); - table.setElementAt(row, i); - Object temp = tempMapping.elementAt(j); - tempMapping.setElementAt(tempMapping.elementAt(i), j); - tempMapping.setElementAt(temp, i); - } - } - if (i <= start) { - if (allTheSame) - return; - else - boundaryPos = firstDifferent; - } - } while (i <= start); - sortTable(table, tempMapping, mapping, start, i); - sortTable(table, tempMapping, mapping, i, end); - } - } - - private byte compareRows(int[] row1, int[] row2, int[] mapping) { - for (int i = 0; i < numCols; i++) { - int c1 = (row1[i] == -1) ? -1 : mapping[row1[i]]; - int c2 = (row2[i] == -1) ? -1 : mapping[row2[i]]; - if (c1 < c2) - return -1; - else if (c1 > c2) - return 1; - } - return 0; - } - - private int[] buildRowIndex(Vector tempTable) { - int[] tempRowIndex = new int[tempTable.size()]; - rowIndexFlagsIndex = new short[tempTable.size()]; - Vector tempRowIndexFlags = new Vector(); - rowIndexShifts = new byte[tempTable.size()]; - - // build the row index. Each entry in the row index starts out referring - // to the original row (so it doesn't actually do any mapping), and we set - // up the index flags to show which cells in the row are populated - for (int i = 0; i < tempTable.size(); i++) { - tempRowIndex[i] = i; - - int[] row = (int[])tempTable.elementAt(i); - if (row[numCols] == 1 && row[0] == 0) { - int j = 0; - while (row[j] == 0) - ++j; - rowIndexFlagsIndex[i] = (short)(-j); - } - else { - int[] flags = new int[numColGroups]; - int nextFlag = 1; - int colGroup = 0; - for (int j = 0; j < numCols; j++) { - if (row[j] != 0) - flags[colGroup] |= nextFlag; - nextFlag <<= 1; - if (nextFlag == 0) { - ++colGroup; - nextFlag = 1; - } - } - colGroup = 0; - int j = 0; - while (j < tempRowIndexFlags.size()) { - if (((Integer)tempRowIndexFlags.elementAt(j)).intValue() == - flags[colGroup]) { - ++colGroup; - ++j; - if (colGroup >= numColGroups) - break; - } - else if (colGroup != 0) - colGroup = 0; - else - ++j; - } - rowIndexFlagsIndex[i] = (short)(j - colGroup); - while (colGroup < numColGroups) { - tempRowIndexFlags.addElement(new Integer(flags[colGroup])); - ++colGroup; - } - } - } - rowIndexFlags = new int[tempRowIndexFlags.size()]; - for (int i = 0; i < rowIndexFlags.length; i++) - rowIndexFlags[i] = ((Integer)tempRowIndexFlags.elementAt(i)).intValue(); -System.out.println("Number of column groups = " + numColGroups); -System.out.println("Size of rowIndexFlags = " + rowIndexFlags.length); - - return tempRowIndex; - } - - private void stackRows(Vector tempTable) { -/* -System.out.print("Row:\t"); -for (int i = 0; i < numCols; i++) -System.out.print(reverseColumnMap[i] + "\t"); -System.out.println(); -for (int i = 0; i < tempTable.size(); i++) { -System.out.print(Integer.toString(i) + ":\t"); -int[] row = (int[])tempTable.elementAt(i); -for (int j = 0; j < row.length; j++) -if (row[j] != 0) System.out.print(Integer.toString(row[j]) + "\t"); -else System.out.print(".\t"); -System.out.println(); -} -*/ - - int[] tempRowIndex = buildRowIndex(tempTable); - boolean[] tbd = new boolean[tempTable.size()]; - - // now we actually go through and stack rows together - for (int i = 0; i < tempTable.size(); i++) { - if (tbd[i]) - continue; -System.out.print("Stacking, inspecting row " + i + "...\r"); -//System.out.println("Stacking, inspecting row " + i + "..."); - - int[] destRow = (int[])tempTable.elementAt(i); - - boolean[] tempFlags = new boolean[numCols]; - boolean[] filledCells = new boolean[numCols]; - for (int j = 0; j < numCols; j++) - filledCells[j] = destRow[j] != 0; - - for (int j = i + 1; destRow[numCols] < numCols && j < tempTable.size(); j++) { - if (tbd[j]) - continue; - - int[] srcRow = (int[])tempTable.elementAt(j); - if (srcRow[numCols] + destRow[numCols] > numCols) - continue; - - int maxLeftShift = -999; - int maxRightShift = 0; - for (int k = 0; k < numCols; k++) { - tempFlags[k] = srcRow[k] != 0; - if (tempFlags[k]) { - if (maxLeftShift == -999) - maxLeftShift = -k; - maxRightShift = (numCols - 1) - k; - } - } - - int shift; - for (shift = maxLeftShift; shift <= maxRightShift; shift++) { - int k; - for (k = 0; k < numCols; k++) { - if (tempFlags[k] && filledCells[k + shift]) - break; - } - if (k >= numCols) - break; - } - if (shift <= maxRightShift) { -//System.out.println("Packing row " + j + " into row " + i + " with shift = " + shift); - for (int k = 0; k < numCols; k++) { - if (tempFlags[k]) { - filledCells[k + shift] = true; - destRow[k + shift] = srcRow[k]; - ++destRow[numCols]; - } - } - tbd[j] = true; - tempRowIndex[j] = i; - rowIndexShifts[j] = (byte)shift; - } - } - } - - // finally, we squeeze out all the deleted rows - int decrementBy = 0; - for (int i = 0; i < tempRowIndex.length; i++) { - if (!tbd[i]) - tempRowIndex[i] -= decrementBy; - else - ++decrementBy; - } - rowIndex = new short[tempRowIndex.length]; - for (int i = tempRowIndex.length - 1; i >= 0; i--) { - if (tbd[i]) { - rowIndex[i] = (short)(tempRowIndex[tempRowIndex[i]]); - tempTable.removeElementAt(i); - } - else - rowIndex[i] = (short)tempRowIndex[i]; - } - } - - private void printTable() { - short cell; - int populatedCells = 0; -/* - System.out.println("Conceptual table:"); - System.out.println(" Row: a b c d e f g h i j k l m n" - + " o p q r s t u v w x y z ' #"); - - boolean[] rowPrintFlags = new boolean[rowIndex.length]; - printConceptualTable("", 0, rowPrintFlags); -*/ - - System.out.println(); - System.out.println("Conceptual table:"); - System.out.print(" Row:"); - for (int i = 0; i < reverseColumnMap.length; i++) { - System.out.print(" " + reverseColumnMap[i]); - } - for (int i = 0; i < rowIndex.length; i++) { - System.out.println(); - printNumber(i, 4); - System.out.print(":"); - for (int j = 0; j < numCols; j++) - printNumber(at(i, j), 4); - } - System.out.println('\n'); - - System.out.println(); - System.out.println("Internally stored table:"); - System.out.print(" Row:"); - for (int i = 0; i < reverseColumnMap.length; i++) { - System.out.print(" " + reverseColumnMap[i]); - } - for (int i = 0; i < table.length; i++) { - if (i % numCols == 0) { - System.out.println(); - printNumber(i / numCols, 4); - System.out.print(":"); - } - cell = table[i]; - if (cell != 0) - populatedCells++; - printNumber(cell, 4); - } - System.out.println('\n'); - -System.out.println("Row index:"); -for (int i = 0; i < rowIndex.length; i++) { - System.out.print(" " + i + " -> " + rowIndex[i]); - if (rowIndexFlagsIndex[i] < 0) - System.out.print(", flags = " + Integer.toBinaryString((1 << (-rowIndexFlagsIndex[i]))) + " (" + rowIndexFlagsIndex[i]); - else - System.out.print(", flags = " + Integer.toBinaryString(rowIndexFlags[rowIndexFlagsIndex[i]]) + " (" + rowIndexFlagsIndex[i]); - System.out.println("), shift = " + rowIndexShifts[i]); -} -/* - int theoreticalMinRows = populatedCells / numCols; - if (populatedCells % numCols != 0) - theoreticalMinRows++; - int oneCellRows = 0; - for (int i = 0; i < rowIndexFlags.length; i++) { - double temp = Math.log(rowIndexFlags[i]) / Math.log(2); - if (temp == (int)temp) - oneCellRows++; - } - - System.out.println('\n'); - System.out.println("Total words in input = " + totalWords); - System.out.println("Total unique words = " + uniqueWords + ", comprising " + - totalUniqueWordChars + " characters\n"); - System.out.println("Number of populated cells = " + populatedCells); - System.out.println("Total number of cells = " + (table.length)); - System.out.println("Residency = " + ((float)populatedCells / table.length * 100) + '%'); - System.out.println("Ratio of populated cells to unique-word characters = " + - ((float)populatedCells / totalUniqueWordChars * 100) + '%'); - System.out.println("Ratio of total cells to unique-word characters = " + - ((float)table.length / totalUniqueWordChars * 100) + '%'); - System.out.println("Number of rows = " + (table.length / numCols)); - System.out.println("Theoretical minimum number of rows = " + theoreticalMinRows); - System.out.println("Ratio of number of rows to theoretical minimum = " + - ((float)(table.length / numCols) / theoreticalMinRows * 100) + '%'); - System.out.println("Number of conceptual rows = " + rowIndex.length); - System.out.println("Conceptual rows with only one populated cell = " + oneCellRows); - System.out.println("Ratio of one-cell rows to total conceptual rows = " + (((float)oneCellRows) - / rowIndex.length * 100) + '%'); - System.out.println("Average number of populated cells in multi-cell rows = " + - ((float)(populatedCells - oneCellRows) / (rowIndex.length - oneCellRows))); - - int storageUsed = table.length * 2 + rowIndex.length * 2 - + rowIndexFlags.length * 4 + rowIndexShifts.length; - System.out.println("Total number of bytes in table (including indexes) = " + - storageUsed); - System.out.println("Bytes of overhead per unique-word character = " + ((double)(storageUsed - - (totalUniqueWordChars * 2)) / totalUniqueWordChars)); -*/ - } - - private void printConceptualTable(String initialString, int state, boolean[] flags) { - if (initialString.length() == 0) - System.out.println("root:"); - else - System.out.println(initialString + ':'); - - if (!flags[state]) { - flags[state] = true; - printNumber(state, 4); - System.out.print(":"); - for (int i = 0; i < numCols; i++) - printNumber(at(state, i), 4); - System.out.println(); - } - - int nextState; - for (int i = 0; i < numCols; i++) { - nextState = at(state, i); - if (nextState > 0 && !flags[nextState]) { - printNumber(nextState, 4); - System.out.print(":"); - for (int j = 0; j < numCols; j++) - printNumber(at(nextState, j), 4); - System.out.println(); - } - } - for (int i = 0; i < numCols; i++) { - nextState = at(state, i); - if (nextState > 0 && !flags[nextState]) { - char nextChar; - if (nextState == 27) - nextChar = ' '; - else if (nextState == 26) - nextChar = '\''; - else - nextChar = (char)(i + 'a'); - flags[nextState] = true; - printConceptualTable(initialString + nextChar, nextState, flags); - } - } - } - - private void printWordList(String partialWord, int state, PrintWriter out) - throws IOException { - if (state == -1) { - System.out.println(partialWord); - if (out != null) - out.println(partialWord); - } - else { - for (int i = 0; i < numCols; i++) { - if (at(state, i) != 0) - printWordList(partialWord + reverseColumnMap[i], at(state, i), out); - } - } - } - - private void writeDictionaryFile(DataOutputStream out) throws IOException { - out.writeInt(0); // version number - - char[] columnMapIndexes = columnMap.getIndexArray(); - out.writeInt(columnMapIndexes.length); - for (int i = 0; i < columnMapIndexes.length; i++) - out.writeShort((short)columnMapIndexes[i]); - byte[] columnMapValues = columnMap.getValueArray(); - out.writeInt(columnMapValues.length); - for (int i = 0; i < columnMapValues.length; i++) - out.writeByte((byte)columnMapValues[i]); - - out.writeInt(numCols); - out.writeInt(numColGroups); - - out.writeInt(rowIndex.length); - for (int i = 0; i < rowIndex.length; i++) - out.writeShort(rowIndex[i]); - - out.writeInt(rowIndexFlagsIndex.length); - for (int i = 0; i < rowIndexFlagsIndex.length; i++) - out.writeShort(rowIndexFlagsIndex[i]); - out.writeInt(rowIndexFlags.length); - for (int i = 0; i < rowIndexFlags.length; i++) - out.writeInt(rowIndexFlags[i]); - - out.writeInt(rowIndexShifts.length); - for (int i = 0; i < rowIndexShifts.length; i++) - out.writeByte(rowIndexShifts[i]); - - out.writeInt(table.length); - for (int i = 0; i < table.length; i++) - out.writeShort(table[i]); - - out.close(); - } - - private void printNumber(int x, int width) { - String s = String.valueOf(x); - if (width > s.length()) - System.out.print(spaces.substring(0, width - s.length())); - if (x != 0) - System.out.print(s); - else - System.out.print('.'); - } - - public final short at(int row, char ch) { - int col = columnMap.elementAt(ch); - return at(row, col); - } - - public final short at(int row, int col) { - if (cellIsPopulated(row, col)) - return internalAt(rowIndex[row], col + rowIndexShifts[row]); - else - return 0; - } - - private final boolean cellIsPopulated(int row, int col) { - if (rowIndexFlagsIndex[row] < 0) - return col == -rowIndexFlagsIndex[row]; - else { - int flags = rowIndexFlags[rowIndexFlagsIndex[row] + (col >> 5)]; - return (flags & (1 << (col & 0x1f))) != 0; - } - } - - private final short internalAt(int row, int col) { - return table[row * numCols + col]; - } - - private CompactByteArray columnMap = null; - private char[] reverseColumnMap = null; - private int numCols; - private int numColGroups; - private short[] table = null; - private short[] rowIndex = null; - private int[] rowIndexFlags = null; - private short[] rowIndexFlagsIndex = null; - private byte[] rowIndexShifts = null; - - private int totalWords = 0; - private int uniqueWords = 0; - private int totalUniqueWordChars = 0; - - private static final String spaces = " "; -} - diff --git a/icu4j/src/com/ibm/tools/rbbi/WriteTablesToFiles.java b/icu4j/src/com/ibm/tools/rbbi/WriteTablesToFiles.java deleted file mode 100755 index 8028a4970c..0000000000 --- a/icu4j/src/com/ibm/tools/rbbi/WriteTablesToFiles.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/rbbi/Attic/WriteTablesToFiles.java,v $ - * $Date: 2000/09/22 18:57:44 $ - * $Revision: 1.1 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.rbbi; - -import java.io.*; -import com.ibm.text.*; - -public class WriteTablesToFiles { - public static void main(String[] args) throws IOException { - writeBatch(true); - writeBatch(false); - } - - public static void writeBatch(boolean littleEndian) throws IOException { - BreakIterator bi; - String suffix = (littleEndian ? "LE" : "BE"); - - bi = BreakIterator.getCharacterInstance(); - ((RuleBasedBreakIterator)bi).writeTablesToFile(new FileOutputStream( - "char" + suffix + ".brk"), littleEndian); - - bi = BreakIterator.getWordInstance(); - ((RuleBasedBreakIterator)bi).writeTablesToFile(new FileOutputStream( - "word" + suffix + ".brk"), littleEndian); - - bi = BreakIterator.getLineInstance(); - ((RuleBasedBreakIterator)bi).writeTablesToFile(new FileOutputStream( - "line" + suffix + ".brk"), littleEndian); - - bi = BreakIterator.getSentenceInstance(); - ((RuleBasedBreakIterator)bi).writeTablesToFile(new FileOutputStream( - "sent" + suffix + ".brk"), littleEndian); - - java.util.Locale thai = new java.util.Locale("th", "", ""); - bi = BreakIterator.getWordInstance(thai); - ((RuleBasedBreakIterator)bi).writeTablesToFile(new FileOutputStream( - "word_th" + suffix + ".brk"), littleEndian); - - bi = BreakIterator.getLineInstance(thai); - ((RuleBasedBreakIterator)bi).writeTablesToFile(new FileOutputStream( - "line_th" + suffix + ".brk"), littleEndian); - } -} diff --git a/icu4j/src/com/ibm/tools/translit/Trans.java b/icu4j/src/com/ibm/tools/translit/Trans.java deleted file mode 100755 index 34548d3151..0000000000 --- a/icu4j/src/com/ibm/tools/translit/Trans.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.ibm.tools.translit; -import com.ibm.text.*; -import java.io.*; - -/** - * A command-line interface to the ICU4J transliterators. - * @author Alan Liu - */ -public class Trans { - - public static void main(String[] args) throws Exception { - boolean isHTML = false; - int pos = 0; - if (args.length < 3) { usage(); } - if (args[pos].equals("-html")) { - ++pos; - isHTML = true; - } - if ((args.length-pos) != 3) { usage(); } - String transName = args[pos++]; - String inName = args[pos++]; - String outName = args[pos++]; - Transliterator trans = Transliterator.getInstance(transName); - BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(inName), "UTF8")); - PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(outName), "UTF8")); - trans(trans, in, out, isHTML); - out.close(); - } - - static void trans(Transliterator trans, - BufferedReader in, PrintWriter out, boolean isHTML) throws IOException { - boolean inTag = false; // If true, we are within a - for (;;) { - String line = in.readLine(); - if (line == null) { - break; - } - if (isHTML) { - // Pass tags between < and > unchanged - StringBuffer buf = new StringBuffer(); - int right = -1; - if (inTag) { - right = line.indexOf('>'); - if (right < 0) { - right = line.length()-1; - } - buf.append(line.substring(0, right+1)); - if (DEBUG) System.out.println("*S:" + line.substring(0, right+1)); - inTag = false; - } - for (;;) { - int left = line.indexOf('<', right+1); - if (left < 0) { - if (right < line.length()-1) { - buf.append(trans.transliterate(line.substring(right+1))); - if (DEBUG) System.out.println("T:" + line.substring(right+1)); - } - break; - } - // Append transliterated segment right+1..left-1 - buf.append(trans.transliterate(line.substring(right+1, left))); - if (DEBUG) System.out.println("T:" + line.substring(right+1, left)); - right = line.indexOf('>', left+1); - if (right < 0) { - inTag = true; - buf.append(line.substring(left)); - if (DEBUG) System.out.println("S:" + line.substring(left)); - break; - } - buf.append(line.substring(left, right+1)); - if (DEBUG) System.out.println("S:" + line.substring(left, right+1)); - } - line = buf.toString(); - } else { - line = trans.transliterate(line); - } - out.println(line); - } - } - - static final boolean DEBUG = false; - - /** - * Emit usage and die. - */ - static void usage() { - System.out.println("Usage: java com.ibm.tools.translit.Trans [-html] "); - System.out.println(" Name of transliterator"); - System.out.println(" Name of input file"); - System.out.println(" Name of output file"); - System.out.println("-html Only transliterate text outside of "); - System.exit(0); - } -} diff --git a/icu4j/src/com/ibm/tools/translit/UnicodeSetClosure.java b/icu4j/src/com/ibm/tools/translit/UnicodeSetClosure.java deleted file mode 100755 index 746a97a1d7..0000000000 --- a/icu4j/src/com/ibm/tools/translit/UnicodeSetClosure.java +++ /dev/null @@ -1,305 +0,0 @@ -/* - ******************************************************************************* - * Copyright (C) 1996-2000, International Business Machines Corporation and * - * others. All Rights Reserved. * - ******************************************************************************* - * - * $Source: /xsrl/Nsvn/icu/icu4j/src/com/ibm/tools/translit/Attic/UnicodeSetClosure.java,v $ - * $Date: 2001/12/03 18:22:59 $ - * $Revision: 1.4 $ - * - ***************************************************************************************** - */ -package com.ibm.tools.translit; -import com.ibm.text.*; -import com.ibm.test.*; -import com.ibm.util.Utility; -//import java.text.*; -import java.io.*; -import java.util.Locale; - -// com.ibm.tools.translit.UnicodeSetClosure -// com.ibm.test.translit.TransliteratorTest - -public class UnicodeSetClosure { - public static void main(String[] args) throws Exception { - - UnicodeSet foo = new UnicodeSet("[\u1FF6-\u1FFD\u2000-\u2001\u2126]"); - - test(); - /* The following is superceded by Alan's tool - - File f = new File("UnicodeSetClosure.txt"); - String filename = f.getCanonicalFile().toString(); - out = new PrintWriter( - new OutputStreamWriter( - new FileOutputStream(filename), "UTF-8")); - System.out.println("Writing " + filename); - out.print('\uFEFF'); // BOM - - generateSets("Latin-Katakana", true, Normalizer.DECOMP_COMPAT, true, -"[',.a-z~\u00DF\u00E6\u00F0\u00F8\u00FE\u02BE\u0300-\u034E\u0360-\u0362\u0483-\u0486\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD\u05BF\u05C1-\u05C2\u05C4\u064B-\u0655\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u0901-\u0902\u093C\u0941-\u0948\u094D\u0951-\u0954\u0962-\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2-\u09E3\u0A02\u0A3C\u0A41-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A70-\u0A71\u0A81-\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7-\u0AC8\u0ACD\u0B01\u0B3C\u0B3F\u0B41-\u0B43\u0B4D\u0B56\u0B82\u0BC0\u0BCD\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0CBF\u0CC6\u0CCC-\u0CCD\u0D41-\u0D43\u0D4D\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86-\u0F87\u0F90-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032\u1036-\u1037\u1039\u1058-\u1059\u17B7-\u17BD\u17C6\u17C9-\u17D3\u18A9\u20D0-\u20DC\u20E1\u302A-\u302F\uFB1E\uFE20-\uFE23\\U0001D167-\\U0001D169\\U0001D17B-\\U0001D182\\U0001D185-\\U0001D18B\\U0001D1AA-\\U0001D1AD]" - ); - generateSets("Latin-Katakana", false, Normalizer.DECOMP_COMPAT, false, -"[~\u3001-\u3002\u30A1-\u30AB\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB\u30BD\u30BF\u30C1\u30C3-\u30C4\u30C6\u30C8\u30CA-\u30CF\u30D2\u30D5\u30D8\u30DB\u30DE-\u30F3\u30F5-\u30F6\u30FC-\u30FD]" - ); - - out.close(); - - ///////////////////////////////////////////////// - if (true) return; // skip the stuff we've done already - - generateSets("Cyrillic-Latin", true, Normalizer.DECOMP, false, - "[\u0402\u0404-\u0406\u0408-\u040B\u040F-\u0418\u041A-\u0438\u043A-\u044F\u0452\u0454-\u0456\u0458-\u045B\u045F\u0490-\u0495\u0498-\u0499\u04D4-\u04D5\u04D8-\u04D9]" - ); - generateSets("Latin-Cyrillic", false, Normalizer.DECOMP, false, - "[A-Za-z\u00C6\u00E6\u0110-\u0111\u018F\u0259\u02B9-\u02BA]" - ); - */ - } - - public static void generateSets(String label, boolean forward, - Normalizer.Mode m, boolean lowerFirst, String rules) { - UnicodeSet s = new UnicodeSet(rules); - System.out.println("Generating " + label + (forward ? "" : " BACKWARD")); - close(s, m, lowerFirst); - out.println("# MINIMAL FILTER GENERATED FOR: " + label + (forward ? "" : " BACKWARD")); - out.println(":: " - + (forward ? "" : "( ") - + s.toPattern(true) - + (forward ? "" : " )") - + " ;"); - out.println(); - out.println("Unicode: " + s.toPattern(false)); - } - - static boolean GENERATE = false; - - public static void test() throws Exception { - File f = new File("TestUnicodeSetClosure.txt"); - String filename = f.getCanonicalFile().toString(); - out = new PrintWriter( - new OutputStreamWriter( - new FileOutputStream(filename), "UTF-8")); - System.out.println("Writing " + filename); - out.print('\uFEFF'); // BOM - - GENERATE = true; - test("[:Devanagari:]"); - /* - test("[\u00E0Bc]"); - test("[m]"); - */ - - out.close(); - } - - static final Normalizer.Mode[] testModes = { - Normalizer.NO_OP, Normalizer.DECOMP, Normalizer.COMPOSE, Normalizer.DECOMP_COMPAT, Normalizer.COMPOSE_COMPAT}; - static final String[] modeNames = { - "NoNF", "NFD", "NFC", "NFKD", "NFKC"}; - - static final boolean[] testCases = { - false, true}; - static final String[] caseNames = { - "noLower", "lower"}; - - public static void test(String testStr) throws Exception { - UnicodeSet original = new UnicodeSet(testStr); - - System.out.println("Testing Closure of: " + original.toPattern(true)); - out.println("Testing Closure of: " + original.toPattern(false)); - UnicodeSet raw = new UnicodeSet(original); - original.complement(); - original.complement(); - if (!raw.equals(original)) { - out.println("Equals:" + original.toPattern(false)); - } - StringWriter swLog = null; - PrintWriter log = null; - - if (GENERATE) { - swLog = new StringWriter(); - log = new PrintWriter(swLog); - log.println("static UnicodeSet[][] UNCHANGED = {"); - } - for (int i = 0; i < testCases.length; ++i) { - if (GENERATE) log.println(" {"); - for (int j = 0; j < testModes.length; ++j) { - UnicodeSet test = new UnicodeSet(original); - close(test, testModes[j], testCases[i]); - if (GENERATE) { - log.println("\tnew UnicodeSet(\"" + generatedSet.toPattern(true) + "\"),"); - } - String label = caseNames[i] + ", " + modeNames[j] ; - System.out.println(label); - out.println(label + ": " + test.toPattern(false)); - test.removeAll(original); - if (test.isEmpty()) { - out.println("\tNo Difference from original"); - } else { - out.println("\tDifference = " + test.toPattern(false)); - } - out.flush(); - } - if (GENERATE) log.println(" },"); - out.println(); - } - - if (GENERATE) { - log.println("};"); - out.print(swLog.getBuffer().toString()); - } - - /* - close(test, Normalizer.DECOMP, false); - print("NFD", test); - - test = new UnicodeSet(testStr); - close(test, Normalizer.NO_OP, true); - print("Lower", test); - - test = new UnicodeSet(testStr); - close(test, Normalizer.COMPOSE, false); - print("NFC", test); - - test = new UnicodeSet(testStr); - close(test, Normalizer.DECOMP_COMPAT, false); - print("NFKD", test); - - test = new UnicodeSet(testStr); - close(test, Normalizer.COMPOSE_COMPAT, false); - print("NFKC", test); - */ - } - - static PrintWriter out; - - /* - public static void print(String label, UnicodeSet test) { - System.out.println(label); - out.println(label + ": " + test.toPattern(false)); - out.println(); - } - */ - - // dumb, slow implementations - public static class NFToString implements Char32ToString { - Normalizer.Mode mode; - boolean lowerFirst; - - NFToString(Normalizer.Mode m, boolean lowerFirst) { - mode = m; - this.lowerFirst = lowerFirst; - } - - public String get(int cp) { - String source = UTF16.valueOf(cp); - String result = source; - if (lowerFirst) result = UCharacter.toLowerCase(Locale.US, result); - result = Normalizer.normalize(result, mode, 0); - if (lowerFirst) result = UCharacter.toLowerCase(Locale.US, result); - if (result.equals(source)) return null; - return result; - } - } - - - /** Returns a mapping from char32 to a string. If there is no change, - * null is returned. - */ - - interface Char32ToString { - public String get(int cp); - } - - static boolean FAST = true; - - public static void close(UnicodeSet s, Normalizer.Mode m, boolean lowerFirst) { - Char32ToString f = new NFToString(m, lowerFirst); - if (FAST) { - int mm; - for (mm = 0; ; ++mm) if (m == testModes[mm]) break; // find mode - close2(s, f, lowerFirst ? 1 : 0, mm); - return; - } - close(s, f); - } - - public static void close(UnicodeSet s, Char32ToString f) { - if (GENERATE) generatedSet = new UnicodeSet(); - - for (int cp = 0; cp <= 0x10FFFF; ++cp) { - int type = UCharacter.getType(cp); - if (type == Character.UNASSIGNED) continue; - - //if (cp == '\u00e7') { - // System.out.println("debug"); - //} - String result = f.get(cp); - if (result == null) continue; - if (GENERATE) { - generatedSet.add(cp); - } - if (!containsSome(s, result)) continue; - s.add(cp); - } - } - - public static void close2(UnicodeSet s, Char32ToString f, int lc, int mode) { - UnicodeSet unchanged = new UnicodeSet(); // UNCHANGED[lc][mode]; - int count = unchanged.getRangeCount(); - for (int i = 0; i < count; ++i) { - int start = unchanged.getRangeStart(i); - int end = unchanged.getRangeEnd(i); - for (int cp = start; cp <= end; ++cp) { - String result = f.get(cp); - if (result == null) throw new IllegalArgumentException("Something wrong -- should never happen"); - if (!containsSome(s, result)) continue; - s.add(cp); - } - } - } - - /* - static final UnicodeSet[][] UNCHANGED = { - { // \u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC1-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4 - new UnicodeSet("[\u1FF6-\u1FFD\u2000-\u2001\u2126]"), - // \u212A-\u212B\u219A-\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u2241\u2244\u2247\u2249\u2260\u2262\u226D-\u2271\u2274-\u2275\u2278 - new UnicodeSet("[\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0134-\u0137\u0139-\u013E\u0143-\u0148\u014C-\u0151\u0154-\u0165\u0168-\u017E\u01A0-\u01A1\u01AF-\u01B0\u01CD-\u01DC\u01DE-\u01E3\u01E6-\u01F0\u01F4-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u0340-\u0341\u0343-\u0344\u0374\u037E\u0385-\u038A\u038C\u038E-\u0390\u03AA-\u03B0\u03CA-\u03CE\u03D3-\u03D4\u0400-\u0401\u0403\u0407\u040C-\u040E\u0419\u0439\u0450-\u0451\u0453\u0457\u045C-\u045E\u0476-\u0477\u04C1-\u04C2\u04D0-\u04D3\u04D6-\u04D7\u04DA-\u04DF\u04E2-\u04E7\u04EA-\u04F5\u04F8-\u04F9\u0622-\u0626\u06C0\u06C2\u06D3\u0929\u0931\u0934\u0958-\u095F\u09CB-\u09CC\u09DC-\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B48\u0B4B-\u0B4C\u0B5C-\u0B5D\u0B94\u0BCA-\u0BCC\u0C48\u0CC0\u0CC7-\u0CC8\u0CCA-\u0CCB\u0D4A-\u0D4C\u0DDA\u0DDC-\u0DDE\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75-\u0F76\u0F78\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1026\u1E00-\u1E99\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC1-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFD\u2000-\u2001\u2126\u212A-\u212B\u219A-\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u2241\u2244\u2247\u2249\u2260\u2262\u226D-\u2271\u2274-\u2275\u2278-\u2279\u2280-\u2281\u2284-\u2285\u2288-\u2289\u22AC-\u22AF\u22E0-\u22E3\u22EA-\u22ED\u2329-\u232A\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062\u3065\u3067\u3069\u3070-\u3071\u3073-\u3074\u3076-\u3077\u3079-\u307A\u307C-\u307D\u3094\u309E\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0-\u30D1\u30D3-\u30D4\u30D6-\u30D7\u30D9-\u30DA\u30DC-\u30DD\u30F4\u30F7-\u30FA\u30FE\uAC00-\uD7A3\uF900-\uFA0D\uFA10\uFA12\uFA15-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA2D\uFB1D\uFB1F\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFB4E]"), - new UnicodeSet("[\u0340-\u0341\u0343-\u0344\u0374\u037E\u0387\u0958-\u095F\u09DC-\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B5C-\u0B5D\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75-\u0F76\u0F78\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1FBB\u1FBE\u1FC9\u1FCB\u1FD3\u1FDB\u1FE3\u1FEB\u1FEE-\u1FEF\u1FF9\u1FFB\u1FFD\u2000-\u2001\u2126\u212A-\u212B\u2329-\u232A\uF900-\uFA0D\uFA10\uFA12\uFA15-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA2D\uFB1F\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFB4E]"), - new UnicodeSet("[\u00A0\u00A8\u00AA\u00AF\u00B2-\u00B5\u00B8-\u00BA\u00BC-\u00BE\u00C0-\u00C5\u00C7-\u00CF\u00D1-\u00D6\u00D9-\u00DD\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u010F\u0112-\u0125\u0128-\u0130\u0132-\u0137\u0139-\u0140\u0143-\u0149\u014C-\u0151\u0154-\u0165\u0168-\u017F\u01A0-\u01A1\u01AF-\u01B0\u01C4-\u01DC\u01DE-\u01E3\u01E6-\u01F5\u01F8-\u021B\u021E-\u021F\u0226-\u0233\u02B0-\u02B8\u02D8-\u02DD\u02E0-\u02E4\u0340-\u0341\u0343-\u0344\u0374\u037A\u037E\u0384-\u038A\u038C\u038E-\u0390\u03AA-\u03B0\u03CA-\u03CE\u03D0-\u03D6\u03F0-\u03F2\u0400-\u0401\u0403\u0407\u040C-\u040E\u0419\u0439\u0450-\u0451\u0453\u0457\u045C-\u045E\u0476-\u0477\u04C1-\u04C2\u04D0-\u04D3\u04D6-\u04D7\u04DA-\u04DF\u04E2-\u04E7\u04EA-\u04F5\u04F8-\u04F9\u0587\u0622-\u0626\u0675-\u0678\u06C0\u06C2\u06D3\u0929\u0931\u0934\u0958-\u095F\u09CB-\u09CC\u09DC-\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B48\u0B4B-\u0B4C\u0B5C-\u0B5D\u0B94\u0BCA-\u0BCC\u0C48\u0CC0\u0CC7-\u0CC8\u0CCA-\u0CCB\u0D4A-\u0D4C\u0DDA\u0DDC-\u0DDE\u0E33\u0EB3\u0EDC-\u0EDD\u0F0C\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75-\u0F79\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1026\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2000-\u200A\u2011\u2017\u2024-\u2026\u202F\u2033-\u2034\u2036-\u2037\u203C\u203E\u2048-\u2049\u2070\u2074-\u208E\u20A8\u2100-\u2103\u2105-\u2107\u2109-\u2113\u2115-\u2116\u2119-\u211D\u2120-\u2122\u2124\u2126\u2128\u212A-\u212D\u212F-\u2131\u2133-\u2139\u2153-\u217F\u219A-\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u222C-\u222D\u222F-\u2230\u2241\u2244\u2247\u2249\u2260\u2262\u226D-\u2271\u2274-\u2275\u2278-\u2279\u2280-\u2281\u2284-\u2285\u2288-\u2289\u22AC-\u22AF\u22E0-\u22E3\u22EA-\u22ED\u2329-\u232A\u2460-\u24EA\u2E9F\u2EF3\u2F00-\u2FD5\u3000\u3036\u3038-\u303A\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062\u3065\u3067\u3069\u3070-\u3071\u3073-\u3074\u3076-\u3077\u3079-\u307A\u307C-\u307D\u3094\u309B-\u309C\u309E\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0-\u30D1\u30D3-\u30D4\u30D6-\u30D7\u30D9-\u30DA\u30DC-\u30DD\u30F4\u30F7-\u30FA\u30FE\u3131-\u318E\u3192-\u319F\u3200-\u321C\u3220-\u3243\u3260-\u327B\u3280-\u32B0\u32C0-\u32CB\u32D0-\u32FE\u3300-\u3376\u337B-\u33DD\u33E0-\u33FE\uAC00-\uD7A3\uF900-\uFA0D\uFA10\uFA12\uFA15-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA2D\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE30-\uFE44\uFE49-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE72\uFE74\uFE76-\uFEFC\uFF01-\uFF5E\uFF61-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE]"), - new UnicodeSet("[\u00A0\u00A8\u00AA\u00AF\u00B2-\u00B5\u00B8-\u00BA\u00BC-\u00BE\u0132-\u0133\u013F-\u0140\u0149\u017F\u01C4-\u01CC\u01F1-\u01F3\u02B0-\u02B8\u02D8-\u02DD\u02E0-\u02E4\u0340-\u0341\u0343-\u0344\u0374\u037A\u037E\u0384-\u0385\u0387\u03D0-\u03D6\u03F0-\u03F2\u0587\u0675-\u0678\u0958-\u095F\u09DC-\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B5C-\u0B5D\u0E33\u0EB3\u0EDC-\u0EDD\u0F0C\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75-\u0F79\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1E9A-\u1E9B\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1FBB\u1FBD-\u1FC1\u1FC9\u1FCB\u1FCD-\u1FCF\u1FD3\u1FDB\u1FDD-\u1FDF\u1FE3\u1FEB\u1FED-\u1FEF\u1FF9\u1FFB\u1FFD-\u1FFE\u2000-\u200A\u2011\u2017\u2024-\u2026\u202F\u2033-\u2034\u2036-\u2037\u203C\u203E\u2048-\u2049\u2070\u2074-\u208E\u20A8\u2100-\u2103\u2105-\u2107\u2109-\u2113\u2115-\u2116\u2119-\u211D\u2120-\u2122\u2124\u2126\u2128\u212A-\u212D\u212F-\u2131\u2133-\u2139\u2153-\u217F\u222C-\u222D\u222F-\u2230\u2329-\u232A\u2460-\u24EA\u2E9F\u2EF3\u2F00-\u2FD5\u3000\u3036\u3038-\u303A\u309B-\u309C\u3131-\u318E\u3192-\u319F\u3200-\u321C\u3220-\u3243\u3260-\u327B\u3280-\u32B0\u32C0-\u32CB\u32D0-\u32FE\u3300-\u3376\u337B-\u33DD\u33E0-\u33FE\uF900-\uFA0D\uFA10\uFA12\uFA15-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA2D\uFB00-\uFB06\uFB13-\uFB17\uFB1F-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE30-\uFE44\uFE49-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE72\uFE74\uFE76-\uFEFC\uFF01-\uFF5E\uFF61-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE]"), - }, - { - new UnicodeSet("[A-Z\u00B2-\u00B3\u00B5\u00B9\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00DE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130-\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178-\u0179\u017B\u017D\u017F\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018B\u018E-\u0191\u0193-\u0194\u0196-\u0198\u019C-\u019D\u019F-\u01A0\u01A2\u01A4\u01A6-\u01A7\u01A9\u01AC\u01AE-\u01AF\u01B1-\u01B3\u01B5\u01B7-\u01B8\u01BC\u01C4-\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1-\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u0345\u0386\u0388-\u038A\u038C\u038E-\u038F\u0391-\u03A1\u03A3-\u03AB\u03C2\u03D0-\u03D1\u03D5-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F0-\u03F2\u03F4-\u03F5\u0400-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C1\u04C3\u04C7\u04CB\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F8\u0531-\u0556\u09F8\u0F2A-\u0F33\u137C\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9B\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FB8-\u1FBC\u1FBE\u1FC8-\u1FCC\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFC\u2070\u2074-\u2079\u2080-\u2089\u2126\u212A-\u212B\u2153-\u215E\u2160-\u217F\u2181-\u2183\u2460-\u2468\u2474-\u247C\u2488-\u2490\u24B6-\u24EA\u2776-\u277E\u2780-\u2788\u278A-\u2792\uFF21-\uFF3A\\U0001034A\\U00010400-\\U00010425\\U0001D165-\\U0001D166\\U0001D16D-\\U0001D172]"), - new UnicodeSet("[A-Z\u00B2-\u00B3\u00B5\u00B9\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00DE\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u0110\u0112-\u0126\u0128-\u0132\u0134-\u0137\u0139-\u013F\u0141\u0143-\u0148\u014A\u014C-\u0152\u0154-\u0166\u0168-\u017F\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018B\u018E-\u0191\u0193-\u0194\u0196-\u0198\u019C-\u019D\u019F-\u01A2\u01A4\u01A6-\u01A7\u01A9\u01AC\u01AE-\u01B3\u01B5\u01B7-\u01B8\u01BC\u01C4-\u01DC\u01DE-\u01E4\u01E6-\u021C\u021E-\u021F\u0222\u0224\u0226-\u0233\u0340-\u0341\u0343-\u0345\u0374\u037E\u0385-\u038A\u038C\u038E-\u03A1\u03A3-\u03B0\u03C2\u03CA-\u03CE\u03D0-\u03D1\u03D3-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F0-\u03F2\u03F4-\u03F5\u0400-\u042F\u0439\u0450-\u0451\u0453\u0457\u045C-\u045E\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476-\u0478\u047A\u047C\u047E\u0480\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C1-\u04C3\u04C7\u04CB\u04D0-\u04D4\u04D6-\u04D8\u04DA-\u04E0\u04E2-\u04E8\u04EA-\u04F5\u04F8-\u04F9\u0531-\u0556\u0622-\u0626\u06C0\u06C2\u06D3\u0929\u0931\u0934\u0958-\u095F\u09CB-\u09CC\u09DC-\u09DD\u09DF\u09F8\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B48\u0B4B-\u0B4C\u0B5C-\u0B5D\u0B94\u0BCA-\u0BCC\u0C48\u0CC0\u0CC7-\u0CC8\u0CCA-\u0CCB\u0D4A-\u0D4C\u0DDA\u0DDC-\u0DDE\u0F2A-\u0F33\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75-\u0F76\u0F78\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1026\u137C\u1E00-\u1E99\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC1-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFD\u2000-\u2001\u2070\u2074-\u2079\u2080-\u2089\u2126\u212A-\u212B\u2153-\u215E\u2160-\u217F\u2181-\u2183\u219A-\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u2241\u2244\u2247\u2249\u2260\u2262\u226D-\u2271\u2274-\u2275\u2278-\u2279\u2280-\u2281\u2284-\u2285\u2288-\u2289\u22AC-\u22AF\u22E0-\u22E3\u22EA-\u22ED\u2329-\u232A\u2460-\u2468\u2474-\u247C\u2488-\u2490\u24B6-\u24EA\u2776-\u277E\u2780-\u2788\u278A-\u2792\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062\u3065\u3067\u3069\u3070-\u3071\u3073-\u3074\u3076-\u3077\u3079-\u307A\u307C-\u307D\u3094\u309E\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0-\u30D1\u30D3-\u30D4\u30D6-\u30D7\u30D9-\u30DA\u30DC-\u30DD\u30F4\u30F7-\u30FA\u30FE\uAC00-\uD7A3\uF900-\uFA0D\uFA10\uFA12\uFA15-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA2D\uFB1D\uFB1F\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFB4E\uFF21-\uFF3A\\U0001034A\\U00010400-\\U00010425\\U0001D165-\\U0001D166\\U0001D16D-\\U0001D172]"), - new UnicodeSet("[A-Z\u00B2-\u00B3\u00B5\u00B9\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00DE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130-\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178-\u0179\u017B\u017D\u017F\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018B\u018E-\u0191\u0193-\u0194\u0196-\u0198\u019C-\u019D\u019F-\u01A0\u01A2\u01A4\u01A6-\u01A7\u01A9\u01AC\u01AE-\u01AF\u01B1-\u01B3\u01B5\u01B7-\u01B8\u01BC\u01C4-\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1-\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u0340-\u0341\u0343-\u0345\u0374\u037E\u0386-\u038A\u038C\u038E-\u038F\u0391-\u03A1\u03A3-\u03AB\u03C2\u03D0-\u03D1\u03D5-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F0-\u03F2\u03F4-\u03F5\u0400-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C1\u04C3\u04C7\u04CB\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F8\u0531-\u0556\u0958-\u095F\u09DC-\u09DD\u09DF\u09F8\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B5C-\u0B5D\u0F2A-\u0F33\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75-\u0F76\u0F78\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u137C\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9B\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FB8-\u1FBC\u1FBE\u1FC8-\u1FCC\u1FD3\u1FD8-\u1FDB\u1FE3\u1FE8-\u1FEC\u1FEE-\u1FEF\u1FF8-\u1FFD\u2000-\u2001\u2070\u2074-\u2079\u2080-\u2089\u2126\u212A-\u212B\u2153-\u215E\u2160-\u217F\u2181-\u2183\u2329-\u232A\u2460-\u2468\u2474-\u247C\u2488-\u2490\u24B6-\u24EA\u2776-\u277E\u2780-\u2788\u278A-\u2792\uF900-\uFA0D\uFA10\uFA12\uFA15-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA2D\uFB1F\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFB4E\uFF21-\uFF3A\\U0001034A\\U00010400-\\U00010425\\U0001D165-\\U0001D166\\U0001D16D-\\U0001D172]"), - new UnicodeSet("[A-Z\u00A0\u00A8\u00AA\u00AF\u00B2-\u00B5\u00B8-\u00BA\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00DE\u00E0-\u00E5\u00E7-\u00EF\u00F1-\u00F6\u00F9-\u00FD\u00FF-\u0110\u0112-\u0126\u0128-\u0137\u0139-\u0141\u0143-\u014A\u014C-\u0152\u0154-\u0166\u0168-\u017F\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018B\u018E-\u0191\u0193-\u0194\u0196-\u0198\u019C-\u019D\u019F-\u01A2\u01A4\u01A6-\u01A7\u01A9\u01AC\u01AE-\u01B3\u01B5\u01B7-\u01B8\u01BC\u01C4-\u01DC\u01DE-\u01E4\u01E6-\u021C\u021E-\u021F\u0222\u0224\u0226-\u0233\u02B0-\u02B8\u02D8-\u02DD\u02E0-\u02E4\u0340-\u0341\u0343-\u0345\u0374\u037A\u037E\u0384-\u038A\u038C\u038E-\u03A1\u03A3-\u03B0\u03C2\u03CA-\u03CE\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F0-\u03F2\u03F4-\u03F5\u0400-\u042F\u0439\u0450-\u0451\u0453\u0457\u045C-\u045E\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476-\u0478\u047A\u047C\u047E\u0480\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C1-\u04C3\u04C7\u04CB\u04D0-\u04D4\u04D6-\u04D8\u04DA-\u04E0\u04E2-\u04E8\u04EA-\u04F5\u04F8-\u04F9\u0531-\u0556\u0587\u0622-\u0626\u0675-\u0678\u06C0\u06C2\u06D3\u0929\u0931\u0934\u0958-\u095F\u09CB-\u09CC\u09DC-\u09DD\u09DF\u09F8\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B48\u0B4B-\u0B4C\u0B5C-\u0B5D\u0B94\u0BCA-\u0BCC\u0C48\u0CC0\u0CC7-\u0CC8\u0CCA-\u0CCB\u0D4A-\u0D4C\u0DDA\u0DDC-\u0DDE\u0E33\u0EB3\u0EDC-\u0EDD\u0F0C\u0F2A-\u0F33\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75-\u0F79\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u1026\u137C\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2000-\u200A\u2011\u2017\u2024-\u2026\u202F\u2033-\u2034\u2036-\u2037\u203C\u203E\u2048-\u2049\u2070\u2074-\u208E\u20A8\u2100-\u2103\u2105-\u2107\u2109-\u2113\u2115-\u2116\u2119-\u211D\u2120-\u2122\u2124\u2126\u2128\u212A-\u212D\u212F-\u2131\u2133-\u2139\u2153-\u217F\u2181-\u2183\u219A-\u219B\u21AE\u21CD-\u21CF\u2204\u2209\u220C\u2224\u2226\u222C-\u222D\u222F-\u2230\u2241\u2244\u2247\u2249\u2260\u2262\u226D-\u2271\u2274-\u2275\u2278-\u2279\u2280-\u2281\u2284-\u2285\u2288-\u2289\u22AC-\u22AF\u22E0-\u22E3\u22EA-\u22ED\u2329-\u232A\u2460-\u24EA\u2776-\u277E\u2780-\u2788\u278A-\u2792\u2E9F\u2EF3\u2F00-\u2FD5\u3000\u3036\u3038-\u303A\u304C\u304E\u3050\u3052\u3054\u3056\u3058\u305A\u305C\u305E\u3060\u3062\u3065\u3067\u3069\u3070-\u3071\u3073-\u3074\u3076-\u3077\u3079-\u307A\u307C-\u307D\u3094\u309B-\u309C\u309E\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0-\u30D1\u30D3-\u30D4\u30D6-\u30D7\u30D9-\u30DA\u30DC-\u30DD\u30F4\u30F7-\u30FA\u30FE\u3131-\u318E\u3192-\u319F\u3200-\u321C\u3220-\u3243\u3260-\u327B\u3280-\u32B0\u32C0-\u32CB\u32D0-\u32FE\u3300-\u3376\u337B-\u33DD\u33E0-\u33FE\uAC00-\uD7A3\uF900-\uFA0D\uFA10\uFA12\uFA15-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA2D\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE30-\uFE44\uFE49-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE72\uFE74\uFE76-\uFEFC\uFF01-\uFF5E\uFF61-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\\U0001034A\\U00010400-\\U00010425\\U0001D165-\\U0001D166\\U0001D16D-\\U0001D172]"), - new UnicodeSet("[A-Z\u00A0\u00A8\u00AA\u00AF\u00B2-\u00B5\u00B8-\u00BA\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00DE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130-\u0134\u0136\u0139\u013B\u013D\u013F-\u0141\u0143\u0145\u0147\u0149-\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178-\u0179\u017B\u017D\u017F\u0181-\u0182\u0184\u0186-\u0187\u0189-\u018B\u018E-\u0191\u0193-\u0194\u0196-\u0198\u019C-\u019D\u019F-\u01A0\u01A2\u01A4\u01A6-\u01A7\u01A9\u01AC\u01AE-\u01AF\u01B1-\u01B3\u01B5\u01B7-\u01B8\u01BC\u01C4-\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1-\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u02B0-\u02B8\u02D8-\u02DD\u02E0-\u02E4\u0340-\u0341\u0343-\u0345\u0374\u037A\u037E\u0384-\u038A\u038C\u038E-\u038F\u0391-\u03A1\u03A3-\u03AB\u03C2\u03D0-\u03D6\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F0-\u03F2\u03F4-\u03F5\u0400-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C1\u04C3\u04C7\u04CB\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F8\u0531-\u0556\u0587\u0675-\u0678\u0958-\u095F\u09DC-\u09DD\u09DF\u09F8\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B5C-\u0B5D\u0E33\u0EB3\u0EDC-\u0EDD\u0F0C\u0F2A-\u0F33\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u0F73\u0F75-\u0F79\u0F81\u0F93\u0F9D\u0FA2\u0FA7\u0FAC\u0FB9\u137C\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9A-\u1E9B\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FB8-\u1FC1\u1FC8-\u1FCF\u1FD3\u1FD8-\u1FDB\u1FDD-\u1FDF\u1FE3\u1FE8-\u1FEF\u1FF8-\u1FFE\u2000-\u200A\u2011\u2017\u2024-\u2026\u202F\u2033-\u2034\u2036-\u2037\u203C\u203E\u2048-\u2049\u2070\u2074-\u208E\u20A8\u2100-\u2103\u2105-\u2107\u2109-\u2113\u2115-\u2116\u2119-\u211D\u2120-\u2122\u2124\u2126\u2128\u212A-\u212D\u212F-\u2131\u2133-\u2139\u2153-\u217F\u2181-\u2183\u222C-\u222D\u222F-\u2230\u2329-\u232A\u2460-\u24EA\u2776-\u277E\u2780-\u2788\u278A-\u2792\u2E9F\u2EF3\u2F00-\u2FD5\u3000\u3036\u3038-\u303A\u309B-\u309C\u3131-\u318E\u3192-\u319F\u3200-\u321C\u3220-\u3243\u3260-\u327B\u3280-\u32B0\u32C0-\u32CB\u32D0-\u32FE\u3300-\u3376\u337B-\u33DD\u33E0-\u33FE\uF900-\uFA0D\uFA10\uFA12\uFA15-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA2D\uFB00-\uFB06\uFB13-\uFB17\uFB1F-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE30-\uFE44\uFE49-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE72\uFE74\uFE76-\uFEFC\uFF01-\uFF5E\uFF61-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\\U0001034A\\U00010400-\\U00010425\\U0001D165-\\U0001D166\\U0001D16D-\\U0001D172]"), - }, - }; - */ - - - static UnicodeSet generatedSet; - - // These should both be public, and on the respective classes - - public static void addAll(UnicodeSet s, String str) { - int cp; - for (int i = 0; i < str.length(); i += UTF16.getCharCount(cp)) { - cp = UTF16.charAt(str,i); - s.add(cp); - } - } - - public static boolean containsSome(UnicodeSet s, String str) { - int cp; - for (int i = 0; i < str.length(); i += UTF16.getCharCount(cp)) { - cp = UTF16.charAt(str,i); - if (s.contains(cp)) return true; - } - return false; - } -} \ No newline at end of file diff --git a/icu4j/src/com/ibm/tools/translit/dumpICUrules.bat b/icu4j/src/com/ibm/tools/translit/dumpICUrules.bat deleted file mode 100755 index d29b75c725..0000000000 --- a/icu4j/src/com/ibm/tools/translit/dumpICUrules.bat +++ /dev/null @@ -1,390 +0,0 @@ -@rem = '--*-Perl-*-- -@echo off -if "%OS%" == "Windows_NT" goto WinNT -perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 -goto endofperl -:WinNT -perl -x -S "%0" %* -if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl -if %errorlevel% == 9009 echo You do not have Perl in your PATH. -goto endofperl -@rem '; -#!perl -#line 14 - -# This perl script creates ICU transliterator data files, that live -# in icu/data, from ICU4J UTF8 transliterator data files, in -# icu4j/src/com/ibm/text/resources. -# -# The transformation that is done is very minimal. The script assumes -# that the input files use only # comments -# and that they follow a rigid format. -# -# The output files are named according to ICU conventions (see NAME_MAP -# below) and created in the current directory. They should be manually -# checked and then copied into the icu/data directory. An ICU build must -# then be initiated, and the standard suite of ICU transliterator tests -# should be run after that. -# -# Alan Liu 5/19/00 2/27/01 - -use Getopt::Long; - -my $DIR = "../../text/resources"; -my $ID = ''; - -GetOptions('dir=s' => \$DIR, - 'id=s' => \$ID, - '<>' => \&usage) || die; - -usage() if (@ARGV); - -$ID =~ s/-/_/; -if (! -d $DIR) { - print STDERR "$DIR is not a directory\n"; - usage(); -} - -sub usage { - my $me = $0; - $me =~ s|.+[/\\]||; - print "Usage: $me [-dir

    ] [-id ]\n"; - print " --dir Specify the directory containing the\n"; - print " Transliterator_*.txt files\n"; - print " --id Specify a single ID to transform, e.g.\n"; - print " Fullwidth-Halfwidth\n"; - die; -} - -$JAVA_ONLY = '-'; - -$OUTDIR = "icu4c"; -mkdir($OUTDIR,0777); - -# Mapping from Java file names to ICU file names -%NAME_MAP = ( - # An ICU name of "" means the ICU name == the ID - - "Any_Accents" => "", - "Any_Publishing" => "", - "Bengali_InterIndic" => "Beng_InterIndic", - "Cyrillic_Latin" => "Cyrl_Latn", - "Devanagari_InterIndic" => "Deva_InterIndic", - "Fullwidth_Halfwidth" => "FWidth_HWidth", - "Greek_Latin" => "Grek_Latn", - "Gujarati_InterIndic" => "Gujr_InterIndic", - "Gurmukhi_InterIndic" => "Guru_InterIndic", - "Hiragana_Katakana" => "Hira_Kana", - "Hiragana_Latin" => "Hira_Latn", - "InterIndic_Bengali" => "InterIndic_Beng", - "InterIndic_Devanagari" => "InterIndic_Deva", - "InterIndic_Gujarati" => "InterIndic_Gujr", - "InterIndic_Gurmukhi" => "InterIndic_Guru", - "InterIndic_Kannada" => "InterIndic_Knda", - "InterIndic_Latin" => "InterIndic_Latn", - "InterIndic_Malayalam" => "InterIndic_Mlym", - "InterIndic_Oriya" => "InterIndic_Orya", - "InterIndic_Tamil" => "InterIndic_Taml", - "InterIndic_Telugu" => "InterIndic_Telu", - "Kannada_InterIndic" => "Knda_InterIndic", - "Latin_InterIndic" => "Latn_InterIndic", - "Latin_Jamo" => "Latn_Jamo", - "Latin_Katakana" => "Latn_Kana", - "Malayalam_InterIndic" => "Mlym_InterIndic", - "Oriya_InterIndic" => "Orya_InterIndic", - "Tamil_InterIndic" => "Taml_InterIndic", - "Telugu_InterIndic" => "Telu_InterIndic", - - "Han_Pinyin" => $JAVA_ONLY, - "Kanji_English" => $JAVA_ONLY, - "Kanji_OnRomaji" => $JAVA_ONLY, - ); - -# Header blocks of text written at start of ICU output files -$HEADER1 = <) { - next if (/~$/); - next if (/_index\.txt$/); - next if ($ID && !/$ID/); - my ($out, $id) = convertFileName($_); - if ($out) { - if ($out eq $JAVA_ONLY) { - print STDERR "$id: Java only\n"; - next; - } - file($id, $_, $out); - } -} - -convertIndex(); - -###################################################################### -# Convert a Java file name to C -# Param: Java file name of the form m|Transliterator_(.+)\.utf8\.txt$| -# Return: A C file name (e.g., ldevan.txt) or the empty string, -# if there is no mapping, or $JAVA_ONLY if the given file isn't -# intended to be incorporated into C. -sub convertFileName { - local $_ = shift; - my $id; - if (m|Transliterator_(.+)\.utf8\.txt$| || - m|Transliterator_(.+)\.txt$|) { - $id = $1; - } else { die "Can't parse Java file name $_"; } - if (!exists $NAME_MAP{$id}) { - print STDERR "ERROR: $id not in map; please update $0\n"; - return ''; - } - my $out = $NAME_MAP{$id}; - if ($out eq '') { - $out = $id; - } - if ($out ne $JAVA_ONLY) { - $out = 't_' . $out; - } - return ($out, $id); -} - -###################################################################### -# Convert the index file from Java to C format -sub convertIndex { - $JAVA_INDEX = "Transliterator_index.txt"; - $C_INDEX = "translit_index.txt"; - open(JAVA_INDEX, "$DIR/$JAVA_INDEX") or die; - open(C_INDEX, ">$OUTDIR/$C_INDEX") or die; - - header(\*C_INDEX, $JAVA_INDEX); - - print C_INDEX <) { - # Comments; change # to // - if (s|^(\s*)\#|$1//|) { - print C_INDEX; - next; - } - # Blank lines - if (!/\S/) { - print C_INDEX; - next; - } - # Content lines - chomp; - my $prefix = ''; - #replace \p with \\p - $_=~ s/\\p/\\\\p/g; - my @a = split(':', $_); - if ($a[1] eq 'file' || $a[1] eq 'internal') { - # Convert the file name - my $id; - ($a[2], $id) = convertFileName($a[2]); - if ($a[2] eq $JAVA_ONLY) { - $prefix = '// Java only: '; - } - - # Delete the encoding field - splice(@a, 3, 1); - } elsif ($a[1] eq 'alias') { - # Pad out with extra blank fields to make the - # 2-d array square - push @a, ""; - } else { - die "Can't parse $_"; - } - print C_INDEX - $prefix, "{ ", - join(", ", map("\"$_\"", @a)), - " },\n"; - } - - print C_INDEX < $C_INDEX\n"; -} - -###################################################################### -# Output a header -# Param: Filehandle -sub header { - my $out = shift; - my $in = shift; - print $out $HEADER1; - print $out "// Tool: $TOOL\n// Source: $in\n"; - print $out "// Date: ", scalar localtime, "\n"; - print $out $HEADER2; - print $out "\n"; -} - -###################################################################### -# Process one file -# Param: ID, e.g. Fullwidth-Halfwidth -# Param: Java input file name, e.g. -# f:/icu4j/src/com/ibm/text/resources/Transliterator_Fullwidth_Halfwidth.utf8.txt -# Param: ICU output file name, e.g. fullhalf -sub file { - my $id = shift; - my $IN = shift; - my $out = shift; - - my $OUT = "$out.txt"; - - # Show input size. Show output size later -- useful for quick sanity check. - print "$id (", -s $IN, ") -> $OUT ("; - - # Open file, write UTF8 marker, close it, and reopen in text mode - open(OUT, ">$OUTDIR/$OUT") or die; - binmode OUT; # Must do this so we can write our UTF8 marker - print OUT pack("C3", 0xEF, 0xBB, 0xBF); # Write UTF8 marker - close(OUT); - - open(OUT, ">>$OUTDIR/$OUT") or die; - print OUT " // -*- Coding: utf-8; -*-\n"; - - header(\*OUT, $IN); - print OUT "// $id\n"; - print OUT "\n"; - print OUT "$out {\n"; - print OUT " Rule {\n"; - - open(IN, $IN) or die; - binmode IN; # IN is a UTF8 file - - my $first = 1; - my $BOM = pack("C3", 239, 187, 191); # a UTF8 byte order mark - - # Process each line by changing # comments to // comments - # and taking other text and enclosing it in double quotes - while () { - my $raw = $_; - - # Look for and delete BOM - if ($first) { - s/^$BOM//; - $first = 0; - } - - # Clean the eol junk up - s/[\x0D\x0A]+$//; - - # If there is a trailing backslash, then delete it -- we don't - # need line continuation in C, since adjacent strings are - # concatenated. Count trailing backslashes; if they are odd, - # one is trailing. - if (m|(\\+)$|) { - if ((length($1) % 2) == 1) { - s|\\$||; - } - } - - # Transform escaped characters - hideEscapes(); - - if (/^(\s*)(\#.*)$/) { - # Comment-only line - my ($white, $cmt) = ($1, $2); - $cmt =~ s|\#|//|; - $_ = $white . $cmt; - - } elsif (!/\S/) { - # Blank line -- leave as-is - - } else { - # Remove single-quoted matter - my @quotes; - my $nquotes = 0; - my $x = $_; - while (s/^([^\']*)(\'[^\']*\')/$1<>/) { - push @quotes, $2; - ++$nquotes; - } - - # Extract comment - my $cmt = ''; - if (s|\#(.*)||) { - $cmt = '//' . $1; - } - - # Add quotes - s|^(\s*)(\S.*?)(\s*)$|$1\"$2\"$3|; - - # Restore single-quoted matter - for (my $i=0; $i<$nquotes; ++$i) { - s|<>|$quotes[$i]|; - } - - # Restore comment - $_ .= $cmt; - } - - # Restore escaped characters - restoreEscapes(); - - print OUT $_, "\n"; - } - - # Finish up - close(IN); - print OUT " }\n"; - print OUT "}\n"; - close(OUT); - - # Write output file size for sanity check - print -s "$OUTDIR/$OUT", ")\n"; -} - -###################################################################### -sub hideEscapes { - # Transform escaped characters - s|\\\\|<>|g; # DO THIS FIRST Transform backslashes - s|\\u([a-zA-Z0-9]{4})|<>|g; # Transform Unicode escapes - s|\\\"|<>|g; # Transform backslash double quote - s|\\\'|<>|g; # Transform backslash single quote - s|\\\#|<>|g; # Transform backslash pound - s|\\(.)|<>|g; # Transform backslash escapes -} - -###################################################################### -sub restoreEscapes { - # Restore escaped characters - s|<>|\\\\|g; - s|<>|\\\\\\\"|g; - s|<>|\\\\\\\'|g; - s|<>|\\\\\\\#|g; - s|<>|\\\\\\$1|g; - s|<>|\\\\u0000|g; # Double escape U+0000 - s|<>|\\u$1|g; -} - -__END__ -:endofperl diff --git a/icu4j/src/com/ibm/tools/translit/genIndexFilters.bat b/icu4j/src/com/ibm/tools/translit/genIndexFilters.bat deleted file mode 100755 index e8517040b0..0000000000 --- a/icu4j/src/com/ibm/tools/translit/genIndexFilters.bat +++ /dev/null @@ -1,115 +0,0 @@ -@rem = '--*-Perl-*-- -@echo off -if "%OS%" == "Windows_NT" goto WinNT -perl -W -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 -goto endofperl -:WinNT -perl -W -x -S "%0" %* -if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl -if %errorlevel% == 9009 echo You do not have Perl in your PATH. -goto endofperl -@rem '; -#!perl -#line 14 - -# This perl script updates the filters in the transliterator index file. -# It does so in a dumb way: -# -# Latin-X NFD lower -# X-Latin NFD -# -# For transliterators using NFKD, or not using Lower in this way, you -# will have to hand-edit the index file. -# -# This script writes a new index file. The new file has to then be -# hand-edited and checked before use; it contains comments indicating -# old lines that were replaced. -# -# Alan Liu 11/29/01 - -use Getopt::Long; - -my $DIR = "../../text/resources"; -my $CLASSES = "../../../../../classes"; - -#GetOptions('dir=s' => \$DIR, -# 'id=s' => \$ID, -# '<>' => \&usage) || die; - -#usage() if (@ARGV); - -#$ID =~ s/-/_/; -if (! -d $DIR) { - print STDERR "$DIR is not a directory\n"; - usage(); -} - -#sub usage { -# my $me = $0; -# $me =~ s|.+[/\\]||; -# print "Usage: $me [-dir ] [-id ]\n"; -# print " --dir Specify the directory containing the\n"; -# print " Transliterator_*.txt files\n"; -# print " --id Specify a single ID to transform, e.g.\n"; -# print " Fullwidth-Halfwidth\n"; -# die; -#} - -convertIndex(); - -###################################################################### -# Convert the index file from Java to C format -# Assume lines are of the form: -# :alias:; -# can be -# Lower;NFX;... -# NFX;Lower;... -# NFX;... -sub convertIndex { - $IN = "Transliterator_index.txt"; - $OUT = "$IN.new"; - open(IN, "$DIR/$IN") or die; - open(OUT, ">$DIR/$OUT") or die; - - while () { - # Look for lines that are aliases with NF* - if (/^([^:]+):alias:(\[.+?);\s*((NF[^\s]*?)\s*;.+)$/i) { - my $id = $1; - my $oldset = $2; - my $remainder = $3; - my $NFXD = $4; - my $lower = ''; - # Check for Lower - # If it comes before NF* then adjust accordingly - if (/^([^:]+):alias:(\[.+?);\s*(Lower\s*;.+)$/i) { - $lower = 'lower'; - if (length($2) < length($oldset)) { - $oldset = $2; - $remainder = $3; - } - } - print STDERR "$id $NFXD $lower\n"; - my $set = getSourceSet($id, $NFXD, $lower); - $_ = "$id:alias:$set;$remainder\n"; - } - print OUT; - } - - close(IN); - close(OUT); - print STDERR "Wrote $DIR/$OUT\n"; -} - -###################################################################### -# Get the source set (call out to Java), optionally with a closure. -sub getSourceSet { - my $ID = shift; - my $NFXD = shift; - my $lower = shift; - my $set = `java -classpath $CLASSES com.ibm.tools.translit.genIndexFilters $ID $NFXD $lower`; - chomp($set); - $set; -} - -__END__ -:endofperl diff --git a/icu4j/src/com/ibm/tools/translit/genIndexFilters.java b/icu4j/src/com/ibm/tools/translit/genIndexFilters.java deleted file mode 100755 index 8df7550625..0000000000 --- a/icu4j/src/com/ibm/tools/translit/genIndexFilters.java +++ /dev/null @@ -1,71 +0,0 @@ -/* -********************************************************************** -* Copyright (c) 2001, International Business Machines -* Corporation and others. All Rights Reserved. -********************************************************************** -* Date Name Description -* 11/29/2001 aliu Creation. -********************************************************************** -*/ -package com.ibm.tools.translit; -import com.ibm.text.*; -import java.util.*; -import java.io.*; - -/** - * Adjunct class to getIndexFilters.bat. Just generates source sets - * and their closures. - * - * Usage: ID [ NFD|NFKD [lower] ] - * - * java -classpath classes com.ibm.tools.translit.genIndexFilters - * Latin-Greek NFD lower - * - * The 'NFD'|'NFKD' and 'lower' args are optional, but 'lower' can - * only be specified if 'NFD' or 'NFKD' is. - * - * DO NOT CHANGE OUTPUT FORMAT. This tool's output is read by a Perl - * script. - */ -public class genIndexFilters { - - public static void main(String[] args) throws IOException { - Normalizer.Mode m = Normalizer.NO_OP; - boolean lowerFirst = false; - if (args.length >= 2) { - if (args[1].equalsIgnoreCase("NFD")) { - m = Normalizer.DECOMP; - } else if (args[1].equalsIgnoreCase("NFKD")) { - m = Normalizer.DECOMP_COMPAT; - } else { - usage(); - } - } - if (args.length >= 3) { - if (args[2].equalsIgnoreCase("lower")) { - lowerFirst = true; - } else { - usage(); - } - } - if (args.length > 3) { - usage(); - } - showSourceSet(args[0], m, lowerFirst); - } - - static void showSourceSet(String ID, Normalizer.Mode m, boolean lowerFirst) throws IOException { - Transliterator t = Transliterator.getInstance(ID); - // TransliteratorUtility gives us access to package private API - UnicodeSet sourceSet = TransliteratorUtility.getSourceSet(t); - if (m != Normalizer.NO_OP || lowerFirst) { - UnicodeSetClosure.close(sourceSet, m, lowerFirst); - } - System.out.println(sourceSet.toPattern(true)); - } - - static void usage() { - System.err.println("Usage: ID [ NFD|NFKD [lower] ]"); - System.exit(1); - } -} diff --git a/icu4j/src/com/ibm/tools/translit/indic.bat b/icu4j/src/com/ibm/tools/translit/indic.bat deleted file mode 100755 index 10223c3cfc..0000000000 --- a/icu4j/src/com/ibm/tools/translit/indic.bat +++ /dev/null @@ -1,17 +0,0 @@ -@echo off -REM Copyright (C) 2000, International Business Machines -REM Corporation and others. All Rights Reserved. - -REM This script is a Windows launcher for the indic.pl script. For this -REM to work, the perl executable must be on the path. We recommend -REM the ActiveState build; see http://www.activestate.com. See the -REM tz.pl script itself for more documentation. - -if "%OS%" == "Windows_NT" goto WinNT -perl -w -x indic.pl %1 %2 %3 %4 %5 %6 %7 %8 %9 -goto end -:WinNT -perl -w -x indic.pl %* -if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto end -if %errorlevel% == 9009 echo You do not have Perl in your PATH. -:end diff --git a/icu4j/src/com/ibm/tools/translit/indic.pl b/icu4j/src/com/ibm/tools/translit/indic.pl deleted file mode 100755 index e59c47f118..0000000000 --- a/icu4j/src/com/ibm/tools/translit/indic.pl +++ /dev/null @@ -1,655 +0,0 @@ -#!perl - -# Usage - $0 -# e.g. - indic indic.txt -# The input file should be a subset of the Unicode data file containing -# the blocks of interest. -# -# The remap file should have lines of the form -# "\u0D01>\u0D02;" -# including the quotes. These will be interpreted as saying that the -# undefined code point U+D01 (derived via mapping from InterIndic) -# can be remapped to U+D02. -# -# The purpose of this script is to process the Indic script data into -# a form usable by the IndicTransliterator, that is, the Indic-Indic -# transliterator. The transliterator needs two things: A mapping of -# the code points in common, and a list of the exceptions. - -# Assume we are located in icu4j/src/com/ibm/tools/translit/. -# We want the Unicode DB in icu4j/src/data/unicode/. -$UNICODE_DB = "../../../../data/unicode/UnicodeData.txt"; -$EXCEPTIONS_FILE = shift; - -# Assume we are located in icu4j/src/com/ibm/tools/translit/. -# We want to output files to icu4j/src/com/ibm/text/resources/. -# Output directory -$OUTDIR = "../../text/resources"; - -# The template file should contain java code that can be used -# to generate RuleBasedTransliterator resource files. The template -# should contain the following embedded symbols, which this script -# will replace: -# $TOOL - name of generating tool -# $DATE - date of generation -# $SCRIPTFROM - name of source script -# $SCRIPTTO - name of target script -# $RULES - rules -$RBT_TEMPLATE = 'rbtTemplate.txt'; - -# Name of this tool in generated RBT files -$RBT_GEN_TOOL = 'icu4j/src/com/ibm/tools/translit/indic.pl'; - -$DUMP = 0; # If 1, dump out internal data - -$DO_HEURISTIC_REMAP = 0; # If 1, do automatic heuristic remapping -$DO_DECOMP_REMAP = 0; # If 1, do decomp remapping - -open(UNICODE_DB); -while () { - next if (m|^0[0-8]|); # Skip up to Devanagari block (0900) - last if (m|^0D[8-F]|i); # Bail out after Malayam block (0D00) - # 0D39;MALAYALAM LETTER HA;Lo;0;L;;;;;N;;;;; - my @data = split(/;/); - my $fullCode = hex($data[0]); # e.g., 0x093F - my $code = $fullCode & 0x7F; # e.g., 0x3F - my ($script, $name) = ($data[1] =~ /(\w+)\s+(.+)/); - die "Can't parse $_" unless ($name); - # e.g., $code/$script/$name = 3F/MALAYALAM/VOWEL SIGN I - - # Titlecase the script - $script = ucfirst(lc($script)); - - # Fix a couple inconsistencies in the 3.0 data - # REVISIT: Is this okay to do? - if ($DO_HEURISTIC_REMAP) { - if ($script eq 'Gujarati' && $code >= 5 && $code <= 0x14) { - $name =~ s/^VOWEL/LETTER/; - } - } - - # Keep track of all script names we encounter. We also note the - # base of the block. - my $base = $fullCode & ~0x7F; # e.g., 0x900; - if (exists $SCRIPT_TO_BASE{$script}) { - die "Script base mismatch for $script: $base vs. $SCRIPT_TO_BASE{$script}" - if ($SCRIPT_TO_BASE{$script} ne $base); - } else { - $SCRIPT_TO_BASE{$script} = $base; - } - - # Build up a mapping by name. For each name, keep a hash keyed by - # code point. For each code point, keep an array of script names. - # Also keep a total use count for each name. - push @{$NAME_CODE_TO_SCRIPTS{$name}{$code}}, $script; - ++$NAME_CODE_TO_SCRIPTS{$name}{count}; - - # Build a map that looks like this: - # $SCRIPT_NAME_TO_CODE{