User:Visarga/monobook.js

//Sanskrit Auto-Replace Script // //WHAT IT WILL DO: With this script you can type romanized Sanskrit much faster //and with better accuracy. The method of use: simply type the words without //diacritics. They will revert to the proper diacritical form in Sanskrit when you //type a space after the word is finished. // //CAVEATS: the dictionary is not verified (just selected automatically). So please //verify after each word that it matches the one in your citation source. Also, //there are words that cannot be properly replaced, like the pair "kāla" and "kalā" //because without diacritics, they are both "kala". For these cases and the missing //words you can use the second mode of input, as detailed below. // //INSTALLATION //- Edit your monobook.js page and paste in the script //- Your monobook.js file is at http://en.wikipedia.org/wiki/User:YOUR_USER_NAME_GOES_HERE/monobook.js // //AUTHOR : http://en.wikipedia.org/wiki/User:Visarga //DATE  : January 3, 2008 //VERSION: 0.1 // //USAGE: // Mode 1 - auto replacing whole words //   Type in Sakti and it will automatically change to Śakti //   The script will port your case, so it will work for śakti ŚAKTI and Śakti //   all the same // // Mode 2 - inserting diacritics by hand //   Type a double minus "--" after a, i, u, etc and it will become ā, ī, ū, etc //   Similarly, double dot ".." adds the dot under. r.. -> ṛ //   Double cedilla "" adds the cedilla over the n -> ñ //   For the more rare cases of line and dot, like Ḹ, type ".-" after "L" // //Please contact me if you have improvements.

var c;

var vLetters=new Array('a--|ā','A--|Ā','u--|ū','U--|Ū','i--|ī','I--|Ī','r..|ṛ','l..|ḷ','L..|Ḷ','m..|ṃ','M..|Ṃ','h..|ḥ','H..|Ḥ',"S|Ś","s|ś",'s..|ṣ','S..|Ṣ','n..|ṇ','N..|Ṇ','n|ñ','N|Ñ','t..|ṭ','T..|Ṭ','d..|ḍ','D..|Ḍ','r.-|ṝ','R.-|Ṝ','L.-|Ḹ','l.-|ḹ'); var sLetters2=''; var mapLetters=[]; //a-- -> ā var mapLetters2=[]; //ā -> a for (c=0; c<vLetters.length; c++) { var vLine=vLetters[c].split('|'); if (sLetters2 != '') { sLetters2=sLetters2+'|'; } sLetters2=sLetters2+vLine[1]; mapLetters[vLine[0]]=vLine[1]; mapLetters2[vLine[1]]=vLine[0].substr(0,1); } var rxLetters2=new RegExp('('+sLetters2+')', "ig");

function remove_diacritics(str) { str = str.replace(rxLetters2, function ($0, $1) { if (mapLetters2[$0]) { return mapLetters2[$0]; } else { return $0; } } ); return str; }

function extract_last_word(str) { var c; var ch; var word=""; for (c=str.length-1; c>=0; c--) { ch=str.substr(c,1); if ((ch>='a' && ch<='z') || (ch>='A' && ch<='Z') || (mapLetters2[ch]!=undefined)) { word=ch+word; } else { break; } } return new Array(str.substr(0,str.length-word.length), word); }

function preserve_case(str,model) { if (remove_diacritics(str.toLowerCase) != remove_diacritics(model.toLowerCase)) { return str; } var c; var str2=""; for (c=0; c<str.length; c++) { if (model.substr(c,1).toLowerCase==model.substr(c,1)) { //model is lower case str2=str2+str.substr(c,1).toLowerCase; }  else { //model is upper case str2=str2+str.substr(c,1).toUpperCase; }  } return str2; }

function w(str) { var vStr=str.split(','); var c; var vLine=[]; for(c=0; c<vStr.length; c++) { vLine[0]=remove_diacritics(vStr[c]); vLine[1]=vStr[c]; if (vLine[0].length<3) { continue; } mapWords[vLine[0]]=vLine[1]; } }

var mapWords=[]; w('śiva,brahmā,parameśvara,sadāśiva,mālinīvijaya,mudrā,dvādaśānta,prāṇa,viṣṇu,parāparā,vidyā,aparā,īśvara,kalā,mālinī,pāda,mātṛkā,yoginī,maheśvara,nāda,apāna,navātman,kuṇdalinī,svāhā,gaṇeśa,suṣumnā,rauravāgama,mātṛsadbhāva,śrīkaṇṭha,bhāvanā,vāmā,ratiśekhara,pīṭha,kālāgni,siddhānta,hrīm,sādhaka,śambhunātha,vīrabhadra,samanā,rāhu,mahādeva,kriyāpāda,śakti,viṣṇuiti,sāmkhya,vidyāpāda,vidyeśvara,puryaṣṭaka,māyico,kṣemarāja,anāśrita,tuṭi,sambhunātha,kālī,bhārata,vauṣaṭ,ratnamālātantra,īśāna,unmanā,piśāca,vaiśeṣika'); w('māyica,kallaṭa,brahmavidyā,ātman,vāsanā,trikasāra,pramā,nāga,jyeṣṭhā,ghaṭikā,aṭṭahāsa,nyāya,kuṇda,vīrāvalītantra,vāma,tantrasadbhāva,sivatanuśāstra,raudrī,piṇda,paśupati,hāṭaka,dāmara,dīkṣā,caṣaka,bṛhaspati,śākta,āsana,varuṇa,somānanda,sadyojāta,vyāpinī,vapāna,upādhi,tatpuruṣa,tathā,sārṇkhya,sādhya,sarasvatī,ratnamālā,purāṇa,prakṛti,piṇdanātha,niścaya,mālini,macchandanātha,lokāloka,kāmikāgama,kriyā,iśvara,bhīma,adhikāra,śabda,sāyujya,sālokya,suśiva,pātāla,mahākāla,ekavīra,devyāyāmala,brāhmī,śrāddha'); w('ānanda,vīrya,viṣṇuita,umāpati,sāṃkhya,svāyambhuvāgama,samādhi,samskāra,prayāga,pratibhā,pibanī,nādānta,mālinl,mādhavakula,kāmya,kuṣmāṇda,kuṇdagolaka,kumārikā,kiraṇāgama,kiraṇatantra,jvālinī,hazā,chummā,bhadrakālī,arthavāda,aghorā,āśvayuja,śāmbhava,vāyu,sāmīpya,nirṛti,kārttika,kāla,aghorī,āśrama,āṇava,śruta,śivatanuśāstra,ādhāra,yamunā,vīthī,vyāpin,viṣa,vitastā,vimarśa,vidyādhara,varṇa,uccāra,trikasadbhāva,tattvaprakāśa,sṛṣṭi,sukṣma,smṛti,samvitprakāśa,samsāra,sabdarāśi,rākṣasa,pītaa,prāk,praṇava,orsū'); w('niṣkala,mīmāṃsā,mālinlvijaya,manonmanī,kṛṣṇa,kāli,kumārila,kularatnamālā,koṭi,khagendranātha,iśāna,hrīh,guṇa,guruṇā,dhāraṇā,dakṣa,chāgāsya,camatkāra,bhūtirāja,bhīrava,anusamdhāna,ananteśvara,amaranātha,ahamkāra,śākinī,vaiṣṇavī,sāmānya,sthāṇu,srīkaṇṭha,puṣkara,prajāpati,paśu,mārgaśīrṣa,kālarātri,kumāra,kalpanā,jambūdvīpa,himālaya,gandhamādana,dhyāna,caṇda,śrīm,āpyāyana,śivaiti,ādhāraśakti,ṛcchati,śabdarāśi,yakṣa,vāmadeva,vāgīśvarī,vyāsa,vyavahāra,viṣṇuite,viśvam,viṣuvat,vedānta,vatsalikā,utkrānti,upaśobhā'); w('sārupya,surā,sarvavīratantra,sadbhāva,raktā,pāśupata,pāpam,puruṣṭuta,pratyāhāra,pratiṣṭhā,prasamkhyāna,pramāṇastotra,piṇdastha,nyāsa,niśācāratantra,nirācāra,māyā,māyici,māgha,meṣāsya,lakṣmī,lakṣmaṇagupta,kālāgnirudra,kālottaratantra,kālakarṣiṇī,krodheśa,kaṭi,karṇikā,karṇa,kanyā,kalanā,jayā,jayantī,janmādhāra,jambudvīpa,indhikā,icchā,hālā,hṛdaya,hemakuṭa,gṛha,ghurṇi,ghaṭamudrā,ghaṭa,ekaśiva,dhāman,dhenumudrā,dharmādharma,dharmaśiva,caryā,bhāvanā,bhāva,aśvinī,anātha,amarāvatī,akṛta,aindrī,aghoraśiva'); w('adhiṣṭheya,abhiṣikta,abhiṣeka,āṣādha,ānandaśāstra,ādiyāga,vṛddhi,vyomavyāpin,vetāla,uttaraphalgunī,sikhaṇdin,rājavarta,mīnanātha,mālyavat,mahātejas,kṛta,kulakuṇdalinī,ketumāla,kaṇāda,dhṛti,cāmuṇdā,cinmātra,chagalāṇda,bhadrāśva,amṛta,śālagrāma,āvāhana,āveśa,āvaraṇa,ātmā,śrāvaṇa,śrlkaṇṭha,śrinagar,śrikaṇṭha,śodhayet,āmrātakeśvara,āmalasāraka,āmalaka,śloka,īkṣaṇeśāna,śikhā,śikha,āgamica,āditya,ācārya,śambhu,śaiva,śabdarāśer,yānti,yāmyā,yāmala,yojanā,yojanikā,yogasamcāra,yogadhāriṇi,yataḥ,vṛṣabha,vṛtti'); w('vātman,vīreśa,vāmasrotas,vāmanadatta,vāgiśvarī,vācaspatimiśra,vyāpāra,vyāpti,vyāna,viṣāvarta,viṣṇuloka,viśvedeva,vināyaka,vimalā,vilāpana,vidyāpati,vidyāmūrti,vidyādhipati,vidyādhipa,vidyeśa,vibhāga,vedyatā,vaṭuka,varāha,varaṇā,varadevanātha,vajrapāṇi,vaiśeṣikasutra,vairāgya,uṣman,upapīṭha,upaniṣad,udāna,uddeśah,tādana,tuṣakambuka,triśulinī,tripiṇda,tenānande,tatrāpi,tasmāt,tanmātra,tadā,sāradā,sāmsiddhika,sākṣād,sākinī,svātantryāt,svātantrya,svatantreśa,sthāpana,sthāna,sthūla,sthuleśvara,srṣṭi,srikaṇṭha'); w('sravaṇa,spandakārikā,sivastotrāvalī,sitāmśumauli,siddhasādhani,sautrāmaṇī,sarṇvarta,sarvātmanā,sarvavidyādhipa,sandhyā,samāveśa,samtāna,samnidhāna,samhitā,saṃghaṭṭa,samcāra,sadāśive,rāvaṇa,rāpam,rāmakaṇṭha,rājapurī,rāga,rupeṇa,rudrāṇī,pāśātmakah,pāśupatasutra,pāṇi,pārvatī,pārameśvara,prāṇe,prāṇana,prāṇacāra,prātibha,prāptam,prakaṭatā,pradhāna,pitṛ,phālguna,paṭṭilla,parāmarśa,nādī,nādd,niśāṭanatantra,niṣadha,nivṛttih,nivṛtti,nirodhikā,nimeṣa,nihśvāsaśāsana,nihśvāsatantra,nidrā,nidhīśvara,narasiṃhagupta'); w('nairṛta,māyāpuram,māyiche,mātṛ,mātrsadbhāva,mṛtpiṇda,mūrti,māmsa,mākoṭa,māheśī,mṛgendrāgama,mwdrā,mulādhāra,mukuṭatantra,meṣanātha,marukośa,marudeśa,manusmṛti,mahāpreta,mahāphalam,mahādevi,mahābhāṣya,lokapāla,lalitāditya,lakṣmaṇa,lakṣaṇa,kāṭhinya,kāṇda,kṣurikā,kṣobha,kāmikatantra,kāmatattva,kāmarupa,kāll,kālikā,kālasamkarṣiṇī,kṣapaṇa,kṣamasva,kṣam,kuṇdalī,kurukṣetra,kumbhārikā,kuleśvarī,kuleśvari,kuleśvara,kubjikāmata,kheṭapāla,kheṭaka,karṣati,karaṇa,kalādhya,kalyāṇa,kalavikaraṇī,kadalī,jyeṣṭha,harṇsa'); w('guṇd,ghorā,ghoratarā,ghorarūpe,ghaṭṭana,gaṇe,gaṇdikā,gamaśāstra,gahaneśa,erudikā,dīpta,dīnāra,dānava,dīkṣottara,dvāra,dvīpa,dvadaśānta,durgā,dombī,dhāl,dhyānd,dharā,dhaniṣṭhā,daṇdapāṇi,darśana,dakṣiṇāvarta,cāmuṇdī,catuṣkala,caryāpāda,carvaṇā,candraśarman,bīja,bṛhaduttara,bādha,brāhmaṇa,brahmaśiras,brahmayāmala,bhīṣma,bhāvayati,bhāvah,bhutvā,bhutirāja,bhogālasa,bhaṭṭārikā,bhavabhūti,balavikaraṇī,bahukleśa,avadhāna,avabhāsa,asāv,arthakriyā,ardhanārīśvara,anāśritaśiva,anāyāsam,anārambham,anudhyā,amṛtabīja'); w('amśa,akṣara,agnīṣoma,agnīdhra,aghoreśa,adhyavasāya,adhiṣṭhitah,adhiṣṭhita,abhiṣecana,śivah,ācamana,vārāhī,vārendra,vikāritvād,vaṣaṭ,vartamāno,unmeṣa,ujjayinī,uddhāra,tiṣya,sāraśāstra,sāka,suddhavatī,sthaṇdila,samyamanī,sabīja,rauravavārttika,puṣṭi,purvaphalgunī,prāṇanā,pramāṇa,padmamudrā,nārada,nīla,māyottīrṇe,mādhava,mantreśvara,mantramaheśvara,manovatī,lakṣmi,lakulīśa,kāruka,kānti,kṣepa,kauśeya,karmasāmya,kailāsa,jāti,ilāvṛta,ilāvrta,hiraṇmaya,grāhya,dviraṇda,bādham,bhāratavarṣa,bhārabhuti,bhuvaneśa'); w('bhaṭṭa,bhairavī,asidhārā,ambikā,agniṣṭoma,śṛṇu,īśānāya,āśāntam,īśānaśiva,īśānamurdhāya,śāṇdilya,āṣādhin,āṣādhaj,śāstrita,śāstre,śāsanā,āśrayaparāvṛtti,āśraya,āśramasthāna,śārada,śāntātītā,śāntyatīta,śāntika,śāmyaty,śāmbhavopāya,śāmbhavd,śūlarṇ,śākuntalā,śāktarṇ,śāktam,śākinl,śīghra,śūdra,śīdhu,śīdau,āśayam,īṣat,āyuśā,āyudha,āyatanādz,āyatana,āxme,āvṛtitvena,āvāpa,āvartana,āvaha,śuṣkatarka,śuddhih,śubhāśubhāpekṣī,śubhāśubhopekṣī,ītva,ītsva,ītsv,ītsa,ātme,ātmaseka,ātmanā,ātmanirvṛta,ātmani,ātmamūrtaye'); w('ātmaga,ātmabhāvanā,īsva,ṣsono,ḥsgg,āsanavidhi,āsamudratah,āsakti,śrīśaila,śrāvaṇī,śrāvaṇaj,śrīparāmastake,śrīparā,śrīnāthapāda,śrīnātha,śrīnagare,śrīkaṇṭhin,śrīkaṇṭhanātha,āryā,āryapāda,śruti,śrutavidhih,śriśaila,śrinātha,ūrdhvagā,īraṇa,ārabhya,ārabdhakārya,ṣodhā,śodhya,ṣodhaiva,ṣodaśin,śobhā,śobhae,āntaratva,āntara,ānandatantra,ānandanātha,ānandamekhalā,āmṛśya,āmrṣṭa,āmrātikeśa,śmryum,āmarśana,āmardaka,āmarda,āmalakī,ślvaite,ślva,ākṛṣta,ākāśa,ākṛti,ākāra,ākrāmya,ākramaṇa,ākarṣa,śiṣṭa,śiṣyebhyah,śiṣya'); w('śivāya,śivāveśe,śivāvcśoper,śivātmako,śivātmakah,śivānanda,śivāgni,śivābhimānitā,śivopādhyāya,śivaśakti,śivatām,śivatā,śivatattvam,śivastotrāvalī,śivasadbhāva,īivara,śivapurāṇa,śivamurtio,śivaloka,śivadharmin,śivabindutaya,śivabhakti,śirase,śiras,śikhāgre,śikhoda,śikheśa,śihhā,āgneyīm,āgamam,śeṣavṛtti,śeṣa,īetj,ādīyate,ādāna,ādiyāgavuoi,ādiguru,ādhārakārikā,ādhyātmika,ādhipatyd,ādhipatya,ādheya,ādarśa,ādaeya,śatyabodhi,śarīram,śarva,śarabilla,śaktyuccārastha,śaktitā,śaktitattvam,śaktisamāveśa,śaktimaduccārād'); w('śaktihīna,śaktigarbha,śakticakram,śakra,śabda-,śabarabhāṣya,yāti,yāska,yāraata,yāmale,yājya,yāga,yugmatām,yugmarāpā,yuddhāra,yonibīja,yogīśī,yogīśvara,yogānanda,yogāmṛtam,yogācāra,yogābhiprāyatah,yogyatā,yoginīsono,yoginībhu,yogeśī,yogeśvarī,yogeśvaridatta,yogeśi,yogaśāstra,yogavidām,yogamudrā,yogacāratantra,yayā,yathāvastu,yapāna,yamakāli,yakṣī,wpādaz,wdāna,vīṇāsāra-,vāśvayujī,vāyugama,vāyor,vāyave,vāyau,vāyanti,vāvabhasate,vṛttibhāsane,vātsyāyana,vīthi,vītaī,vāsudeva,vāstuyāga,vārāṇasī,vīrāvalihṛdaya'); w('vīryd,vāruṇa,vīranāyaka,vīrabhairava,vāraa,vāpi,vīnā,vāmācārakrameṇa,vāmācāra,vāmeśvarī,vāmeśa,vāmaśāsana,vāmanātha,vāmanaka,vāmana,vāmadevī,vāmadevaguhyāya,vākya,vājapeya,vāgīśī,vāgīśvari,vāgiśvari,vādavāgni,vādarṇ,vācyd,vācyadaśā,vyāpīśa,vyāpārd,vyāptṛtā,vyāpinīe,vyānd,vyomarūpa,vyaūjana,vyavaaāra,vunmanā,viṣāvarte,viṣṇupurāṇa,viśvātmā,viśvāmitra,viśvākalanā,viśveśa,viśvavṛttayah,viśvatarpiṇī,viśvarupiṇī,viśvakāryāya,viśvakarman,viśvabodhi,viśva,viṣuvato,viṣuva,viśtcṣa,viśrāntim,viśrānti,viśrāntah'); w('viśodhayet,viṣnel,viśliṣta,viṣkambha,viśeṣo,viśeṣaś,viśeseṇa,viṣaya,viṣataltva,vivicyamānd,vitastāviṣṇu,visṛjya,visamvāda,virajā,vimśa,vimarśaśakti,vimalīkaraṇa,vimaleśvara,vimalatāraka,vimalaprabhā,vikṛtānanā,vikāsa,vikārd,vikāra,vijjambā,vighaṭate,vidyāmurti,vidvāranya,vidveṣaṇa,vidhiś,vidhivākya,vicārayet,vicāra,vicitranātha,vibhīṣaṇa,vibhāvayet,vibhāvayat,vibhītaka,vibhā,vibhvī,veṣṭayet,vettṛ,vedāntica,vedī,vedyasattā,vedreṃo,veditṛ,vedhaś,vcdikā,vaśīkaraṇa,vauṣat,vatjṣaṭ,vatirātra,vastupiṇda'); w('vastubhāsane,vastrāpada,varāhamihira,varāhagupta,varṇasamvid,varṇasamkhyā,varṣa,varuṇā,varuṇatantra,vartamānatah,varadamudrā,vapuṣmat,vamanī,vaktaṣṭi,vakradṛṣṭayah,vajriṇe,vajrasuā,vajrasucī,vajradharāya,vaiśākha,vaiṣṇavf,vaiṣṇava,vaiśya,vaiparītya,vailomyāt,vaicitryābhāsd,vaibhāṣika,vaibhrāja,vagniṣṭoma,vadhyamokṣe,vabhāvadī,uupakaṇṭha,uttarāṣādha,uttaraṣaṭka,utprekṣā,utpattisthānam,utpalavaiṣṇava,utkarṣa,urmiṇz,urdhvakuṇdalim,upāyatā,upāyah,upāya,upāsate,upāgatah,upādānd,upodghāṭa,upeyānyatvāt,upaśobha'); w('upavījitah,upakārasantāna,upajīvitah,upadvāra,upadiṣṭe,upacāra,unmārjana,unmīlint,unmāda,unmiṣita,unmiṣat,umāpuram,uktvā,ugreśa,udāravīrya,udāra,uddiyāna,uddhṛti,uddeśa,udbubhuṣu,udbhaṭa,udayapradhānam,uccāṭana,uccāraṇa,ucchuṣma,tūṣṇīmbhūta,tīrthayātrā,tāratamyatah,tāratamya,tṛpti,tāmravarṇa,tālapāṭha,tīkā,tādṛśa,tādrśam,tādrupyakrameṇa,tvām,tuṣṭi,tuṣa,trāṇa,troṇana,triśula,triśiromata,tristriguṇam,tripurāntaka,trimśa,trikuṭa,trikaśāsana,trikahṛdaya,triguṇī,tridhā,tridaśa,tribhedatā,tretāyuga,teṣu'); w('tejovatī,tejomālini,taṣya,tattvānīti,tattvarakṣaṇa,tattvapāragay,tatspandā,tatsamkhyāyām,tatromāyāh,tatprasādato,tatparāt,tataś,tataā,tatatvāt,tasyām,tarpayitvā,tanṭra,tantrāloka,tantrasāra,tannimittarṇ,tanmayībhāvita,tanmayabhāvatas,tamopahā,takṣaka,tadāpatti,tadyogāt,tadanyatvāt,sṛṣṭis,sṛṣṭikālī,sṛṣṭikrameṇa,sṛṣza,sāṃkhva,sāṇdilya,sāyujyatah,sāvitrikā,sāttvika,sūtra,sīthara,sārvātmya,sārtham,sāmānyātmaka,sāmānyaspanda,sāmānyarūpatā,sāmānyaper,sāmya,sāmuhya,sāmudāyika,sāmkalpika,sāmastyena,sīmantah'); w('sālmali,sāligrāma,sākṣāt,sākṣān,sūkṣmā,sāhṣāt,sīghra,sādākhya,sādhyāpekṣayā,sādhanaiva,sādhana,sādhakd,sācāra,szddhikāmasya,syād,swṣi,svāyambhuva,svātmanah,svātman,svātantryāttām,svātantryāttam,svātantryeṇa,svātantryaśaktī,svaśaktyā,svayarṇprathana,svayambhūṣṇu,svavṛtti,svaviśeṣa,svatī,svatantraś,svasvātantryeṇa,svasadṛggaṇe,svarṇākṣaka,svargakāmo,svapratiṣṭhāne,svaparāmarśa,svacittavāsana,suṣira,sutraṇayāpi,susūkṣmā,susukṣmikā,sureśvarī,supārśva,suprabhā,suprabhedāgama,sumāyuktaih,sukṣmā,sukṣmarupa'); w('sukṣmagṛha,suhṛṣṭa,sudīpta,stīkṣma,sthitināśakālī,sthilā,sthaṇdilādi,sthaleśvara,srīpīṭha,srīnātha,srīkaṇṭhanātha,srstikālī,srmātha,srlkaṇṭha,sriśrikaṇṭhī,sphāṭika,sphuṭopāyam,sphuṭasya,sphuṭa,sphuraṇa,sphoṭa,spandapradīpikā,spandamānatā,sopāna,smṛtam,smṣmmnā,smartavyāh,smaraṇe,skṛk,sivedasśp,sivaśakti,sivadṛṣṭi,sirṇha,sillāl,silbuṛn,sikhaṇdīśa,siddhātantra,siddhāmata,siddhayogīśv,siddhacāraṇa,shāhā,shsūauh,sevakādih,senānī,sekoddeśa,saṃvara,saṇipuṭīkṛti,savikāro,saukṣmya,saubhāgya,sattāmātra,sattā'); w('sasakhā,sarṛwit,sarṇvittattva,sarṇvarte,sarṇrambha,sarṇpuṭīkaraṇa,sarṇkalpa,sarṇjalpa,sarṛighaṭṭana,sarṇhitā,sarṇdhāna,sarṇdhi,sarvāyeta,sarvātmana,sarvātmakam,sarvārtha,sarvācārahṛdaya,sarvamantrāṇām,sapzasatrī,sanātma,santatatvāc,samāria,samāpatti,samāna,samāhita,samūha,samādhāya,samācāra,samvṛtyuparata,samvartās,samudāya,samudrād,samsārasadma,samsārabhasma,samsuptāmarśa,samstyāna,samsparśa,sampātasamskāra,sampātahoma,sampurṇagrahaṇa,sampaśyet,samnyāsin,samkṣiptatara,samkrāma,samkarṣiṇī,samkarṣaṇa'); w('samkarṣati,samjīvani,samhāram,samhārakālī,samhārakrameṇa,samhitayā,samdhāna,sambhāvya,sambhunāfha,samayaśuddhitah,samayatyāgādi,samayadīkṣā,samanvitāh,samantāt,sakāśāi,sakti-anāsrita,sakalīkaraṇa,saiṇghaṭṭa,saivaparibhāṣā,sahṛdaya,saguṇa,sadāśivatattvam,rāviṇī,rātrikulatantra,rātrikratu,rūpebhyah,rūpam,rāmagupta,rākṣa-,rājaputra,rājagṛha,rīipastha,rṣemarāja,rādhim,rṇandalico,ruruvārttiha,rupaṇād,rundhanī,rudrāṇl,rudrāmśa,rudrāhṣa,rudraśakxi,rudraśakti,rudrasakxivaśāx,rudrasaktivaśāt,rudrakoṭi,rudra-śiva'); w('rsjjhlkṣvyūhau,rshrṣryūm,rohiṇī,rodhikā,rodhanī,roddhrī,riddivivarjitān,ravaṇa,ravarupataś,rauravavārtika,ramyabhāva,raktākṣa,raktakāli,rabhasāt,pāśātmaka,pāśupatāstra,pāśupatya,pāśupatasīitra,pāśupatarṇ,pīṭhākhye,pāśava,pīṭaa,pāśa,pātālavaktra,pṛthide,pītha,pūrṇayā,pūrṇatayā,pūrṇa,pārvika,pārthasārathi,pāribhāṣikī,pāratīyakah,pārada,pāpāntakāriṇi,pāpavimohani,pūjyā,pādmasamhitā,puṇdarika,putrakadlkṣā,purṇasya,purṇagiri,puryākārah,purvāṣādha,purvāparādikā,purvāparādikah,purvatāviṣṭa,purvahāmika,puruṣa'); w('puroditā,puriṇāma,puraṇa-,purastīra,pumskṛteh,pumskṛte,pujānāma,pujyatā,prāṇāyāma,prāṇica,prāṇaśakti,prāṇavṛttī,prāṇavahā,prāṇasamā,prāyaṇīyaś,prāyaṇīya,prāyaścitta,prāsāda,prāpya,prāpanīyah,prāmāṇyd,prākāra,prākrta,prākkarmaikam,prācetasa,pronmukhīkṛta,prokṣaṇa,priyamelāpana,preryamāṇa,preraṇā,pravāha,pravikāsa,praviceṣṭitam,praveśa,pravareśvara,pravakṣyāmi,pratīti,pratyātmakam,pratyāhārd,pratyayadīkṣā,pratiśrutka,prativāraṇī,pratisamdhāna,prathitāyām,prasīdati,prasāda,prasphuṭa,prasarṇkhyāna,prasannadhī'); w('pramātṛtā,pralayākala,prakāśate,prakāśarṇ,prakāśamānatā,prakāśam,prakāśacakra,prakriyā,prakaraṇa,prahvībhāva,pradhānam,pracaṇdadhṛt,pracaṇda,prabodhakabalāt,prabhākara,prabhaūjanas,poṣaṇaper,pmrāha,plṭha,piśāci,piṭhākhyam,piṇdita,piṇdamantra,pitṛvana,pitāmaha,paṇāyate,paṭṭikārāpā,paśwbandha,paśupāśapati,paśpaśāhnika,paśor,paścāt,pauṇdravardhana,paurṇamāsa,pauruṣa,patyaṣṭakam,parāvaha,parātrīśikā,parātrlśikā,parātrimśikā,parāmṛta,parām,parābīja,paropaniṣad,paroditā,paretāsu,paraḥ,paramārśatva,paramārthena'); w('paramārthatah,paramārthasāra,paramārkakālī,paramīkṛti,parameśl,paramaśiva,padmākṣa,padmapurāṇa,padapiṇda,omkāreśa,ojodhātu,nāsatyam,nārāyaṇakaṇṭha,nārāyaṇa,nārāyana,nāropā,nāmāni,nīlepīte,nīlarakta,nākhala,nāgadvīpa,nādāmarśa,nādikā,nādi,nābhi,nyāyasutra,nyāsah,nyunādhikyādi,nyasyā,nuttīrṇa,niśākulatantra,niṣkald,niśisarṇcāra,niścita,nityātantra,nityāt,nityā,nirīkṣaṇa,nirṇaya,nirvāpaṇa,nirvartyā,nirmṛṣṭasattvam,nirmṛṣṭam,nirmaubhāva,niravaśeṣān,nimittasaptamī,nikāya,nijātmanā,nihśvāsakārikā,nihśvāsa'); w('netratrayāya,naṣṭasmṛtih,navātmavaktrāya,navātmamūrdhāya,navātmabhairava,navayāge,nandā,namaskāra,nakṣatrāṇī,nakuleśa,naiṣa,naimiṣa,naimittikī,māziza,māyātattvam,māyāpurī,māyāpura,māyābila,māvica,mātṛṣu,mātṛsadbhāvd,mātṛnandā,mṛtyukālī,mṛtyuhantṛ,mātrā,mātrkā,mātr,māsee,māruteśvara,māruteśa,mūrtidi,mārtaṇdakāli,mārkaṇda,mūrdhan,māraṇa,mānuṣeṣv,māntrarṇ,mālinīsāra,mālinīmantra,mālinya,mūlam,mīirtimantra,māheśl,mṛgamudrā,mṛgamudra,mādhyasthya,mādhyamika,mādhurya,mumukṣu,mulasūtra,mukuṭa,muktāṇu,muktātman'); w('muktāh,muktvā,mukhyatayā,muhūrta,mudrikā,moṭaka,mokṣanātha,mocikā,mlmārnsā,mlecchadeśa,minanātha,mimārṇsā,mfgendrāgama,melāpasthāna,melāpa,mekhalā,medhātithi,maṭhikā,maṇdalikā,maṇdalico,maṇdaleśāna,maṇdaleśvara,matsyendranātha,mataśāstra,martyā,manuṣyatām,mantrārtha,mantrāh,mantravārttika,mantramahānāthe,manoyāga,malanivarhaṇam,maināka,mahāvyāpti,mahāvaha,mahāsāhasa,mahāsiddha,mahārciṣi,mahāparivaha,mahāpadma,mahālaya,mahālacchī,mahākāśa,mahākrodha,mahākośa,mahākala,mahāhāṭakeśvari,mahāhāxakeśvari'); w('mahābhārata,mahābhairava,mahābhadra,mahā,mahodayā,maheśī,mahakalakalī,mahadālaye,mahadāhvaye,mahabhārata,madhyāpekṣayā,madhyadeśa,maaā,līlākāra,lākula,lāhulā,lolībhuta,lolikā,lokāyata,lokavyavahāra,lokadharmiṇī,layāvasthā,layākalāt,layaśiva,layamudrā,laukikī,lakṣyate,lakṣya,lakṣmītantra,lakṣmitantra,lakṣaṇd,lakulīśvara,lakuleśa,lajnānaśakti,kṛśā,kāśyapa,kṣīrikā,kṣīraka,kāśikā,kṛśa,kāyapīṭha,kṣvīm,kṣubhyati,kṛtānta,kātakuṭa,kṛt-,kāryāya,kūrmanātha,kūrmanatha,kārkoṭa,kāraṇāgama,kāraṇeśvara,kāraṇeśa'); w('kṣrah,kṣom,kṣobhiṇī,kṣobhayati,kṣobhaka,kāntatā,kāmiha,kāmanātha,kālāvekṣā,kālāntakā,kālānala,kālīmukhatantra,kṣlām,kālīkula,kālpanika,kāllkulatantra,kālikulatantra,kālidāsa,kāleśa,kālasaṃkarṣiṇl,kālasamkarṣiṇi,kālarudra,kālamāhātmya,kālakarṣiṇl,kālakarsiṇī,kālakarsini,kālajaṃharṣiṇī,kālah,kālagrāsa,kṣetrapāla,kṣetra,kṣemeśa,kṣemendra,kṣema,kṛcchra,kṣaṇa,kṣayāntastha,kṣayānta,kṣamyatām,kuṇdalirii,kuṇdalinīsi,kuṇdalinl,kuryāt,kuntī,kumārī,kulūtā,kulūta,kulāta,kulādri,kulutā,kullālambā,kulaputtalikā'); w('kulamūla,kudyākeśī,kuberāya,krśa,kroṣṭukī,krośamātreṇa,krodheśvara,kriyāvaicitrya,kriyāpada,kramāt,kramān,kramaśas,kramasadbhāva,koṇa,klīm,kleśa,kiraṇa,kimpuruṣa,khecarīmudrā,khecarī,khaṇdd,kerīkuntala,kedāra,kaṇṭhyoṣṭhya,kaṇṭhyosṭhya,kaṇṭhyauṣṭhya,kaṇṭho,kaṇṭha,kaśeru,kavacāya,kaumārī,kaumāri,kaumāra,kaulinī,katharṇ,karīcuka,kartṛtvd,karpāsa,karaṇd,karaṇam,kapāuśa,kapāla,kampamāna,kamalaśila,kalāvehṣā,kalām,kallaṭanātha,kalhaṇa,kalanāt,kaikavīreśa,jūānapravāha,jūāna,jīvita,jīvena,jīvarṇ,jīvanmukta'); w('jīvana,jīva,jātyāyus,jātakarman,jānu,jīmūta,jṛmbhita,jūapti,jyotsnāvatī,jyotsnā,jyotiṣmat,jyotiṣkaśikhara,jyotiṣka,jyesthā,jatī,jatruśabdenātra,janmasthāna,jandhamaṇdala,jananāśaka,jambūdvipa,jalpeśa,jadābhāsa,iśānaf,iṣyamāṇa,iśvaratattvam,iśgdp,itarṇ,ipāśasutrd,indū,indrāya,indrajāla,indradvīpa,indhananiveśana,ilprānae,illāīambā,illātambā,ihāpi,icchāśaktie,icchāyā,icchāmi,hāzaharṣiṇt,hūme,hāma,hālāhalarudra,hīlanam,hāla,hāhārāvā,hṣetrapati,hṛdayāya,hṛdayādy,hṛdayād,hṛdayahārin,hwśa,huṇdalinī,hurṇ'); w('humphaṭ,hsvyūm,hrdādāv,hkṣjah,hiraṇyapāda,hiraṇyapura,himālayana,hidā,hevaztbhāva,hetwvāda,hetutadvattayā,haṭhāt,haṭhatah,haṭakeśvara,haṭaka,hayānanā,hayagrīva,harīndu,halā,gāṇeśa,gāṇapatya,gāndharva,gṛhastha,gāhanika,gṛh-,gurudarśand,guhāyām,guhā,guhyāṣṭakam,gudikānātha,grāsa,grāmyadharma,grahaṇa,gokarṇaka,gokarṇa,ghṛteśa,ghūrṇi,ghurṇita,ghurmā,ghoṣaṇī,ghoratarebhyaś,ghoramukhī,ghaṭa-mudrā,ghanatā,gaṇesāya,gaṇdakī,gaurī,gargikā,garbhāvaraṇa,ganeśa,gandhavatī,gambhīrā,gamaśāsana,gahaneśvara,gadā,eruṇā'); w('elāpurī,elāpura,ekāgra,ekībhāva,ekavīraka,ekavirā,ekatattvāntā,edābhī,dṛśyam,dṛśya,dātṛ,dīrghā,dārdhya,dīpikā,dīpakd,dāne,dānapati,dāmarayāga,dīkṣādāv,dīkṣohtam,dīhṣāpaṭala,dīhsottara,dvāsaśānta,dvāraśobhā,dvāravṛtti,dvāravatī,dvārasandhih,dvādaśaiva,dvaravṛtti,dutī,duraṇda,drṣṭi,drāvayanti,droṇa,draṣṭṛtvd,dravyāin,dravyatvāc,diṛnora,diksamuddeśa,dhīvara,dhātupāṭha,dhātu,dhārya,dhārikā,dhāraṇīm,dhūmra,dhupaghaṇṭā,dhruvā,dhruveśa,dhavatā,dharāyai,dharmanātha,dharmakīrti,deśādhvan,deśvpadeśa,devīkoṭṭa'); w('devīhoṭṭa,devyabhidhā,deveśa,deljambudvīpa,deheśvara,deheśa,dehanīlādīnām,daśāyām,daśeśāna,daśeśa,daśa,darśa,damanī,damaneśa,dakṣiṇapīṭha,daiśika,cāturmāsya,cātra,cāprakāśyam,cāndrāyaṇa,cākurvan,cābhādhitah,cābh,codanāstra,codanā,cittaviśrānti,cittacamatkṛti,citranātha,citrabhānu,cinnātha,cinmātre,cidātmatā,cidaṇu,chāndogya,chummikā,chommā,chagalāṇdaka,cetasā,caṇdāmśu,caṇdikā,catuṣpatha,catuṣkikā,caryākulatantra,cargikā,camaikāra,cakṣuṣah,cakriṇyādyāś,cakrihādyāś,cakravāṭa,cakrasaṇwara,caitrī,bṛāu'); w('bāhya,bṛhatsukha,bṛhatsamhitā,buddhitā,buddhasthāna,bubhukṣu,brāhmā,brāhma,brahmaṇeśa,brahmacārin,bodhāī,bodhaś,biṇdu,bilhaṇa,bhāvyavastu,bhāvd,bhāvavikāra,bhāvatah,bhāvanāmaya,bhāvanābhāvita,bhāvanayā,bhāvam,bhāskara,bhāsate,bhāsanopāya,bhārgava,bhāni,bhṛnel,bhīmeśvara,bhīmamudrā,bhādrapada,bhutādī,bhutiśakti,bhuteśa,bhrātāpi,bhramaṇavedhena,bhogāvasthā,bhogeṣu,bhogaśiva,bhlṣaṇa,bhiṣma,bhinnā,bhikṣāsthāna,bhedābheda,bhedanakrameṇa,bhedadaśāyām,bhaṭṭanātha,bhavābhava,bhaveśāna,bhavadoṣa,bhauteśa,bhartāpi'); w('bhairavākṛteh,bhairavākṛte,bhairavāgama,bhairavagāme,bhadrā,bhadrakāli,bazāt,bandimokṣe,bandhuṣu,balātkārāt,balāt,balāhaka,balādhyakṣa,balavattādhāna,balapramathinī,balapramathanī,badarī,badarikāśrama,aṣṭau,aīyate,aśvin,aśvattha,aśvamedha,aṇuplava,aśoka,aśnute,aṇiman,ayākalāh,ayugmarupā,ayatnāt,avāstavatva,aviśeṣa,avimukteśa,avibhāga,avatāra,avaszwtā,avasthā,avairāgyd,avaguṇṭhana,avagamātmakam,aupāyikamo,audāsīnya,atyantābhāva,atyagniṣṭoma,atiśayena,atimārga,athavā,asādhya,asyāh,astrāya,astamitāparam'); w('astamitā,asphuṭasya,aruṇodaka,arthanātha,arthakāritva,ardhapīṭha,ardhaplṭha,ardhanāri,ardhajaratīya,apānanā,aptoryāma,aprathā,apavāda,aparāz,apararṇ,aparamekhalā,apamārga,apabhramśa,anāśritas,anāśraya,anārabdhakārya,anāmaka,anāma,anākuld,anākhya,anāhatadhvani,anāhata,anādibodha,anācchādita,anyopāya,anyaś,anyataraś,anyaiśper,anxarāxme,anuvāda,anuttaranātha,anusarṇdhānavat,anusarṇdhi,anupāyam,anunmudritākāra,anugṛh-,anugṛh,antyeṣṭi,antaścarantīm,antarātman,antaravedinīm,antahkṛti,anityeṣu,anirdeśya'); w('aniccā,anarṇśa,anantamekhalā,anantakārikā,anaiśvaryam,amāvāsyā,amṛtā,amṛte,amareśa,amanuṣyatārn,akṛtātman,akāma,akṣa,akhaṇditam,akhaṇdamaṇdala,akamkāra,ajitāgama,ajeśa,ajaramekhalā,aiṣṭika,aiśvaryam,aiśvarya,aiśvaro,aikātmyena,ahṛtrima,ahnī,ahaṇ,ahamparāmarśa,agrakoṭau,agrahāyaṇī,agnyādheya,agniṣomasanālma,agnisnāna,agmṣoma,afaḥ,adṛṣṭāmśa,adhyātma,adhyāsa,adhyāropa,adhyavasāyinī,adhvarnaṇlam,adhvamaṇdatam,adhiṣṭhātṛ,adhiṣṭhātf,adhiṣṭhāna,adhiṣṭhiteh,adhiṣlhita,adhivāsa,adhikārāvasthā,adhikārd,adhikāraśiva'); w('adhikriyā,adhastāt,adavī,abhāvd,abhīpsitāyām,abhyāsa,abhyukṣaṇa,abhidhā,abhayamudrā,śaivism,vivaraṇa,parā-trīśikā,kaśmir,pratyabhijñā,aṇḍa,ahaṃkāra,prakāśa,pṛithvī,jñāna,kañcukas,śāstra,pāyu,kuṇḍalinī,śuddha,śaktipāt,spanda-kārikās,parāvāk,pāni,mahābhūtas,kārikā,vaikharī,stavacintāmaṇi,pratyabhijña,śiva-śakti,tanmātras,sparśa,paramārtasra,madhyamā,kārma,kañcuka,antaḥkaraṇa,ambā,śivopaniṣad,śivasūtra,āgama,vimarśinī,vijñāna,upāyaḥ,rūpa,pṛthvī,paśiantī,nāṭyaśāstra,māyīya,kṣemaraja,jñānendriyas,jnānam'); w('dūtī,bandhaḥ,ahaṃ,abhinavabhāratī,śāktopāya,āṇavopāya,āṇavamala,śuddha-vidyā,śrīpūrvaśāstra,śrotra,śrota,śrikanthanath,ānava,ānandavardhana,ākāśic,śivarahasyagama,śivadṛṣṭi,śiddhānta,āgamas,ābhāsana,ābhāsa,ṣaḍādhvān,śañkara,śambhunatha,śaktipāta,śakticalana,śaivists,yoginībhū,yoginī-vaktra,yogeśvar,vākyapadīya,vyāpakatva,viśuddha,vimarśana,vimalakalā,vijñānabhairava,vijñana,vatasikā,vaiṣṇavas,upāyas,ullāsa,tīvra,triśūlābija,sūtras,sāmarasya,suṣupti,sphurattā,saṃskāras,saṃskāra,saṃkoca,saṃhāra,saṃhara'); w('sarvakartṛtva,sarvajñatva,saivāgama,rāmadeva,rudrayāmala,rasanā,pṛthivi,pāta,pūrṇatva,pūrvatantra,pūrvapañcikā,puryaṣtaka,prakāśa-vimarśa,paśyanti,parātrika,parāpara,parā-śakti,parā-prāvesikā,parā-aparā,parā,paramārthacarcā,nātha,mṛgendra,mulā,mokṣa,maṇḍalam,matravīrya,mahābhūta,mahābhutā,madhurāja,lakṣmasṇagupta,laghvī,kārikās,kāra,kailaśa,jāgrat,jñānārṇava,jñānendriya,jñānana,ichhā,hṛdayam,heart-bīja,haridāsa,ghrāṇa,ghaṭakarpara,dṛṣṭi,dhvanyāloka,cit-ānanda,cidānanda,cakṣu,bījāvasthapāna,brahmāṇḍa'); w('bhedābhedopāya,bhaṭṭācāryya,bhartṛhari,bhagavadgītā,aśvini,aśuddha-vidyā,avidyā,asphuṭa,anuttarāṣṭikā,anupāya,ahaṃkara');

function keyHandler1(event) { if (event.keyCode == 32) { var tb = document.editform.wpTextbox1; var text = tb.value; //get the text from the textarea var sel1 = tb.selectionStart; //memorize selection var sel2 = tb.selectionEnd; var scroll = tb.scrollTop; //memorize scroll position var text1=text.substring(0,sel1); //text form beginning to cursor var text2=text.substring(sel1); //text form cursor to the end

var vText1=extract_last_word(text1); // a list containing the last word and the text preceding it  var vt1=vText1[1].toLowerCase; if (mapWords[vt1]!=undefined) { vText1[1]=preserve_case(mapWords[vt1],vText1[1]); } //map the word translation, using substr instead of regex for better speed, especially with large dictionaries text1=vText1[0]+vText1[1]; text = text1 + text2;

if (tb.value != text) { tb.value = text; tb.setSelectionRange(sel1,sel2); //restore cursor position tb.scrollTop = scroll; //restore scroll }  } }

function keyHandler2(event) {  var tb = document.editform.wpTextbox1; var text = tb.value; var sel1 = tb.selectionStart; var sel2 = tb.selectionEnd; var scroll = tb.scrollTop; var text1=text.substring(0,sel1); var text2=text.substring(sel1);

if (text1.length<3) { return; } var text1a=text1.substr(0,text1.length-3); var text1b=text1.substr(text1.length-3,3); if (mapLetters[text1b]!=undefined) { text1b=mapLetters[text1b]; } //map the letter, using substr instead of regex for better speed, especially with large dictionaries sel1=sel1-2; sel2=sel2-2; text1=text1a+text1b; text = text1 + text2;

if (tb.value != text) { tb.value = text; tb.setSelectionRange(sel1,sel2); tb.scrollTop = scroll; } }

document.onkeydown = keyHandler1; document.onkeyup = keyHandler2;