Creating a dictionary with domain name adjuncted


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Creating a dictionary with domain name adjuncted
# 1  
Old 05-04-2013
Creating a dictionary with domain name adjuncted

Hello,
I have created a dictionary which has the following structure:
Code:
DOMAINWORD=(equivalent in English)gloss(es) in Hindi each separated by a comma(equivalent in English)gloss(es) in Hindi each separated by a comma or a semi-colon

An example will make this clear
Code:
blatant=(noisy)ऊधमी,मुखर;(palpable)खुला,साफ़,स्पष्ट;(gaudy)भड़कीला;(flagrant)घोर 
blazonry=भड़कीला प्रदर्शन
fancy{adj.}=विलक्षण,विचित्र,सनकी;(extravagant)मनमाना,अत्याधिक;(ornamental)रंग-बिरंगा,फैंसी,भड़कीला;(costly)महँगा;(special)विशिष्ट 
fine{adj.}=(excellent)उत्तम,उत्कृष्ट,बढ़िया,अच्छा;(pure)विशुध्द,विमल,खरा,परिष्कृत;(weather)सुहावना;(not coarse)महीन,बारीक,सूक्ष्म;(thin)पतला,(delicate)कोमल,सुकुमार,मृदु; (sublte)सूक्ष्म;(sharp)तीक्ष्ण,नुकीला,(handsome)मनोहर,सुन्दर,सुहावना,चारु;(showy)भड़कीला,भड़कदार;(ornate)अलंकृत 
flamboyant{adj.}=भड़कीला,भड़कदार; (style)अलंकृत 
flaming=(burning)प्रज्वलित;(glowing)प्रदीप्त;(fig.,ardent)उत्कट,भावपूर्ण,जोशीला (of person);(showy)भड़कीला, (starting)विस्मयकारी 
flashy=चमकीला,(showy)भड़कीला 
flash{adj.}=भड़कीला,दिखावटी,नक़ली 
florid=(rosy)गुलाबी,लाल,रक्ताभ;(gaudy)भड़कीला;(omate)अलंकृत,आलंकारिक 
fussy=बतंगड़िया;(of dress)ठाठदार,भड़कीला 
gallant{adj.}=बहादुर,वीर,(stately)प्रतापी,भव्य,(showy)भड़कीला,(amorous)श्रृंगारिक, (attentive to ladies)नारीसेवापरायण,रमणीरंजक,नारीभक्त
garish=भड़कीला;(of colours)चटकीला 
gaudy=भड़कीला 
gay=(merry) प्रसन्नचित,प्रफुल्ल, (light hearted) ज़िन्दादिल,विनोदी, (wanton) लम्पट,विषयी,विलासी, (brilliant)भड़कीला,चमकीला 
glare{v.}=चमचमना,(be too showy)भड़कीला या चटकीला होना,(stare)तरेरना 
glaring=(shining)चमकीला,चटकीला, (showy)भड़कीला, (fierce)क्रोधपूर्ण,सुस्पष्ट 
glary=(shining) चमकीला,चटकीला,(showy)भड़कीला,(fierce)क्रोधपूर्ण,सुस्पष्ट 
gorgeous=शानदार,भड़कीला,(of style)अलंकृत,आलंकारिक 
grand=(chief)प्रधान,उच्च,मुख्य,(impose)भव्य,विशाल,शानदार,प्रतापी,वैभवशाली, (great) महान्,महा-,(important)महत्वपूर्ण;(haught)गर्वित,गर्वयुक्त,अभिमानी,(showy)भड़कीला,(llustrious) प्रसिद्ध,प्रतिष्ठीत 
meretricious=वेश्या का,वेश्या-सुलभ;(showy)नकली,भड़कीला,भडकदार 
ostentatious=(of a person)आडम्बरप्रिय,आडम्बरि;दिखावटी,भड़कीला,आडम्बरपूर्ण,आडम्बरी 
rich=धनी,धनवान,धनाढय,मालदार,दौलतमन्द;(abundant)प्रचुर,विपुल;(abounding in)से भरपूर, समृध्द;(valuable)मूल्यवान्;(fertile)उपजाऊ,उर्वर;(splendid)भड़कीला,शानदार;(of food)बढ़िया,स्वादिष्ठ,मसालेदार (spicy);(of colours)चटकीला;(of voice)गंभीर;(amusing)मनोरंजक;(of mixture)गाढ़ा 
showy=(ostentatious)आडम्बरी;(gaudy)भड़कीला,दिखावटी,दिखाऊ;(striking)असाधारण,विशिष्ट,दर्शनीय 
shy{adj.}=(bashful)संकोची,शर्मीला,झेंपू,लज्जालु,(easily startled)भड़कैल,भड़कीला,(wary) चौकन्ना,सतर्क,चौकस,सचेत,(elusive)दुष्प्राप्य,दुर्बोध 
spectacular=(impressive)प्रभावशाली,भव्य,शानदार;(amazing)अपूर्व,चमम्कारीक,आश्र्चर्य-जनक; (showy)आडम्बरपूर्ण,भड़कीला,दिखाऊ,आडम्बरप्रिय,आडम्बरी (of person) 
splendid=(magnificent)भव्य,शानदार,वैभवशाली;(brilliant,shining)चमकीला,भड़कीला (grand,glorious)गौरवपूर्ण,प्रतापमय,प्रतापी,महान्,ख्यातिकर;(excellent)अत्युत्तम,बढ़िया,उत्कृष्ट,अच्छा 
staring=भड़कीला,भड़कदार 
tatty{adj.}=(ragged)फटा-पुराना;(fussily ornate)भड़कीला;(of person)फटीचर 
tawdry{adj.}=भड़कीला,दिखाऊ;भद्दा,बेढंगा 
tinsel{adj.}=भड़कीला,नुमाइशी,लिफ़ाफ़िया 
tinsel{v.}=पन्नी लगाना;भड़कीला बना देना 
trumpery{adj.}=भड़कीला,दिखाऊ,रद्दी,निस्सार

What I need is a script which will do the following:
Code:
domain=(english equivalent) gloss(es) in Hindi

An example will make it clear
INPUT
Code:
blatant=(noisy)ऊधमी,मुखर;(paIpable)खुला,साफ़,स्पष्ट;(gaudy)भड़कीला;(flagrant)घोर 
blazonry=भड़कीला प्रदर्शन

EXPECTED OUTPUT OF THE FIRST TWO ENTRIES. In case 2 there is no bracket so the domain word stands by itself. In case a part of speech is appended to the domain indicated by curly brackets, it should be treated as part of the domain.
Code:
blatant=(noisy)ऊधमी,मुखर
blatant=(palpable)खुला,साफ़,स्पष्ट
blatant=(gaudy)भड़कीला
blatant=(flagrant)घोर

At present I am using a macro which is very slow and takes ages, since the file is huge (62,000+entries).
I work under Windows Vista environment, so an awk or perl script would help.
Many thanks for the generous help of the members
# 2  
Old 05-04-2013
Code:
$
$
$ cat -n input
1 blatant=(noisy)ऊधमी,मुखर;(palpable)खुला,साफ़,स्पष्ट;(gaudy)भड़कीला;(flagrant)घोर
2 blazonry=भड़कीला प्रदर्शन
3 fancy{adj.}=विलक्षण,विचित्र,सनकी;(extravagant)मनमाना,अत्याधिक;(ornamental)रंग-बिरंगा,फैंसी,भड़कीला;(costly)महँगा;(special)विशिष्ट
4 fine{adj.}=(excellent)उत्तम,उत्कृष्ट,बढ़िया,अच्छा;(pure)विशुध्द,विमल,खरा,परिष्कृत;(weather)सुहावना;(not coarse)महीन,बारीक,सूक्ष्म;(thin)पतला,(delicate)कोमल,सुकुमार,मृदु; (sublte)सूक्ष्म;(sharp)तीक्ष्ण,नुकीला,(handsome)मनोहर,सुन्दर,सुहावना,चारु;(showy)भड़कीला,भड़कदार;(ornate)अलंकृत
5 flamboyant{adj.}=भड़कीला,भड़कदार; (style)अलंकृत
6 flaming=(burning)प्रज्वलित;(glowing)प्रदीप्त;(fig.,ardent)उत्कट,भावपूर्ण,जोशीला (of person);(showy)भड़कीला, (starting)विस्मयकारी
7 flashy=चमकीला,(showy)भड़कीला
8 flash{adj.}=भड़कीला,दिखावटी,नक़ली
9 florid=(rosy)गुलाबी,लाल,रक्ताभ;(gaudy)भड़कीला;(omate)अलंकृत,आलंकारिक
10 fussy=बतंगड़िया;(of dress)ठाठदार,भड़कीला
11 gallant{adj.}=बहादुर,वीर,(stately)प्रतापी,भव्य,(showy)भड़कीला,(amorous)श्रृंगारिक, (attentive to ladies)नारीसेवापरायण,रमणीरंजक,नारीभक्त
12 garish=भड़कीला;(of colours)चटकीला
13 gaudy=भड़कीला
14 gay=(merry) प्रसन्नचित,प्रफुल्ल, (light hearted) ज़िन्दादिल,विनोदी, (wanton) लम्पट,विषयी,विलासी, (brilliant)भड़कीला,चमकीला
15 glare{v.}=चमचमना,(be too showy)भड़कीला या चटकीला होना,(stare)तरेरना
16 glaring=(shining)चमकीला,चटकीला, (showy)भड़कीला, (fierce)क्रोधपूर्ण,सुस्पष्ट
17 glary=(shining) चमकीला,चटकीला,(showy)भड़कीला,(fierce)क्रोधपूर्ण,सुस्पष्ट
18 gorgeous=शानदार,भड़कीला,(of style)अलंकृत,आलंकारिक
19 grand=(chief)प्रधान,उच्च,मुख्य,(impose)भव्य,विशाल,शानदार,प्रतापी,वैभवशाली, (great) महान्,महा-,(important)महत्वपूर्ण;(haught)गर्वित,गर्वयुक्त,अभिमानी,(showy)भड़कीला,(llustrious) प्रसिद्ध,प्रतिष्ठीत
20 meretricious=वेश्या का,वेश्या-सुलभ;(showy)नकली,भड़कीला,भडकदार
21 ostentatious=(of a person)आडम्बरप्रिय,आडम्बरि;दिखावटी,भड़कीला,आडम्बरपूर्ण,आडम्बरी
22 rich=धनी,धनवान,धनाढय,मालदार,दौलतमन्द;(abundant)प्रचुर,विपुल;(abounding in)से भरपूर, समृध्द;(valuable)मूल्यवान्;(fertile)उपजाऊ,उर्वर;(splendid)भड़कीला,शानदार;(of food)बढ़िया,स्वादिष्ठ,मसालेदार (spicy);(of colours)चटकीला;(of voice)गंभीर;(amusing)मनोरंजक;(of mixture)गाढ़ा
23 showy=(ostentatious)आडम्बरी;(gaudy)भड़कीला,दिखावटी,दिखाऊ;(striking)असाधारण,विशिष्ट,दर्शनीय
24 shy{adj.}=(bashful)संकोची,शर्मीला,झेंपू,लज्जालु,(easily startled)भड़कैल,भड़कीला,(wary) चौकन्ना,सतर्क,चौकस,सचेत,(elusive)दुष्प्रापय,दर्बोध
25 spectacular=(impressive)प्रभावशाली,भव्य,शानदार;(amazing)अपूर्व,चमम्कारीक,आश्र्चर्य-जनक; (showy)आडम्बरपूर्ण,भड़कीला,दिखाऊ,आडम्बरप्रिय,आडम्बरी (of person)
26 splendid=(magnificent)भव्य,शानदार,वैभवशाली;(brilliant,shining)चमकीला,भड़कीला (grand,glorious)गौरवपूर्ण,प्रतापमय,प्रतापी,महान्,ख्यातिकर;(excellent)अत्युत्तम,बढ़िया,उत्कृष्ट,अच्छा
27 staring=भड़कीला,भड़कदार
28 tatty{adj.}=(ragged)फटा-पुराना;(fussily ornate)भड़कीला;(of person)फटीचर
29 tawdry{adj.}=भड़कीला,दिखाऊ;भद्दा,बेढंगा
30 tinsel{adj.}=भड़कीला,नुमाइशी,लिफ़ाफ़िया
31 tinsel{v.}=पन्नी लगाना;भड़कीला बना देना
32 trumpery{adj.}=भड़कीला,दिखाऊ,रद्दी,निस्सार
$
$
$ perl -lne 'if (/^(.*?=)([^(]*)(.*)/) {
($x,$y,$z)=($1,$2,$3);
print "$x$y" if $y ne "";
while ($z =~ m/(\([^(]+)/g) { print "$x$1" }
}
' input
blatant=(noisy)ऊधमी,मुखर;
blatant=(palpable)खुला,साफ़,स्पष्ट;
blatant=(gaudy)भड़कीला;
blatant=(flagrant)घोर
blazonry=भड़कीला प्रदर्शन
fancy{adj.}=विलक्षण,विचित्र,सनकी;
fancy{adj.}=(extravagant)मनमाना,अत्याधिक;
fancy{adj.}=(ornamental)रंग-बिरंगा,फैंसी,भड़कीला;
fancy{adj.}=(costly)महँगा;
fancy{adj.}=(special)विशिष्ट
fine{adj.}=(excellent)उत्तम,उत्कृष्ट,बढ़िया,अच्छा;
fine{adj.}=(pure)विशुध्द,विमल,खरा,परिष्कृत;
fine{adj.}=(weather)सुहावना;
fine{adj.}=(not coarse)महीन,बारीक,सूक्ष्म;
fine{adj.}=(thin)पतला,
fine{adj.}=(delicate)कोमल,सुकुमार,मृदु;
fine{adj.}=(sublte)सूक्ष्म;
fine{adj.}=(sharp)तीक्ष्ण,नुकीला,
fine{adj.}=(handsome)मनोहर,सुन्दर,सुहावना,चारु;
fine{adj.}=(showy)भड़कीला,भड़कदार;
fine{adj.}=(ornate)अलंकृत
flamboyant{adj.}=भड़कीला,भड़कदार;
flamboyant{adj.}=(style)अलंकृत
flaming=(burning)प्रज्वलित;
flaming=(glowing)प्रदीप्त;
flaming=(fig.,ardent)उत्कट,भावपूर्ण,जोशीला
flaming=(of person);
flaming=(showy)भड़कीला,
flaming=(starting)विस्मयकारी
flashy=चमकीला,
flashy=(showy)भड़कीला
flash{adj.}=भड़कीला,दिखावटी,नक़ली
florid=(rosy)गुलाबी,लाल,रक्ताभ;
florid=(gaudy)भड़कीला;
florid=(omate)अलंकृत,आलंकारिक
fussy=बतंगड़िया;
fussy=(of dress)ठाठदार,भड़कीला
gallant{adj.}=बहादुर,वीर,
gallant{adj.}=(stately)प्रतापी,भव्य,
gallant{adj.}=(showy)भड़कीला,
gallant{adj.}=(amorous)श्रृंगारिक,
gallant{adj.}=(attentive to ladies)नारीसेवापरायण,रमणीरंजक,नारीभक्त
garish=भड़कीला;
garish=(of colours)चटकीला
gaudy=भड़कीला
gay=(merry) प्रसन्नचित,प्रफुल्ल,
gay=(light hearted) ज़िन्दादिल,विनोदी,
gay=(wanton) लम्पट,विषयी,विलासी,
gay=(brilliant)भड़कीला,चमकीला
glare{v.}=चमचमना,
glare{v.}=(be too showy)भड़कीला या चटकीला होना,
glare{v.}=(stare)तरेरना
glaring=(shining)चमकीला,चटकीला,
glaring=(showy)भड़कीला,
glaring=(fierce)क्रोधपूर्ण,सुस्पष्ट
glary=(shining) चमकीला,चटकीला,
glary=(showy)भड़कीला,
glary=(fierce)क्रोधपूर्ण,सुस्पष्ट
gorgeous=शानदार,भड़कीला,
gorgeous=(of style)अलंकृत,आलंकारिक
grand=(chief)प्रधान,उच्च,मुख्य,
grand=(impose)भवय,विशाल,शानदार,परतापी,वैभवशाली,
grand=(great) महान्,महा-,
grand=(important)महत्वपूर्ण;
grand=(haught)गरवित,गरवयुक्त,अभिमानी,
grand=(showy)भड़कीला,
grand=(llustrious) परसिदध,परतिषठीत
meretricious=वया का,वश्या-सुलभ;
meretricious=(showy)नकली,भड़कीला,भडकदार
ostentatious=(of a person)आडम्बरपरिय,आडम्बरि;दिखावटी,भड़कीला,आडम्बरपूर्ण,आडम्बरी
rich=धनी,धनवान,धनाढय,मालदार,दौलतमनद;
rich=(abundant)परचुर,विपुल;
rich=(abounding in)स भरपूर, समृधद;
rich=(valuable)मयवान्;
rich=(fertile)उपजाऊ,उरवर;
rich=(splendid)भडकीला,शानदार;
rich=(of food)बढिया,सवादिष्ठ,मसालेदार
rich=(spicy);
rich=(of colours)चटकीला;
rich=(of voice)गंभीर;
rich=(amusing)मनोरंजक;
rich=(of mixture)गाढ़ा
showy=(ostentatious)आडमबरी;
showy=(gaudy)भड़कीला,दिखावटी,दिखाऊ;
showy=(striking)असाधारण,विशिषट,दरशनीय
shy{adj.}=(bashful)संकोची,शर्मीला,झेंपू,लज्जालु,
shy{adj.}=(easily startled)भड़कैल,भड़कीला,
shy{adj.}=(wary) चौकन्ना,सतर्क,चौकस,सचेत,
shy{adj.}=(elusive)दप्राप्य,दुर्बोध
spectacular=(impressive)परभावशाली,भवय,शानदार;
spectacular=(amazing)अपव,चमम्कारीक,आश्र्चर्य-जनक;
spectacular=(showy)आडमबरपर्ण,भड़कीला,दिखाऊ,आडम्बरप्रिय,आडम्बरी
spectacular=(of person)
splendid=(magnificent)भव्य,शानदार,वभवशाली;
splendid=(brilliant,shining)चमकीला,भडकीला
splendid=(grand,glorious)गौरवपण,प्रतापमय,प्रतापी,महान्,ख्यातिकर;
splendid=(excellent)अतत्तम,बढ़िया,उत्कृष्ट,अच्छा
staring=भड़कीला,भड़कदार
tatty{adj.}=(ragged)फटा-पुराना;
tatty{adj.}=(fussily ornate)भड़कीला;
tatty{adj.}=(of person)फटीचर
tawdry{adj.}=भड़कीला,दिखाऊ;भद्दा,बेढंगा
tinsel{adj.}=भडकीला,नमाइशी,लिफ़ाफ़िया
tinsel{v.}=पन्नी लगाना;भड़कीला बना देना
trumpery{adj.}=भडकीला,दिखाऊ,रददी,निस्सार
$
$

# 3  
Old 05-04-2013
Many thanks. I tried the script. I first catted the file and spewed it out to a new input.
Next I applied the perl script but did not get any results. What did I do wrong.
I even tried to batch the operation. Assuming that ya was my input file, here is what I did.
Code:
cat -n ya2>out
perl -lne 
if (/^(.*?=)([^(]*)(.*)/)
{
($x,$y,$z)=($1,$2,$3);
print "$x$y" if $y ne "";
while ($z =~ m/(\([^(]+)/g) { print "$x$1" }
} out

But to no avail.
Many thanks for your help.
# 4  
Old 05-04-2013
Quote:
Originally Posted by gimley
...I first catted the file and spewed it out to a new input....
Code:
cat -n ya2>out
...

...
Why did you do that?
# 5  
Old 05-04-2013
Dear durden_tyler,
I tried this because when I created a perl script with both the
Code:
cat

and the subsequent part of the perl script, I got no result.
Sorry for hassling like this. I am a tyro in PERL and am still learning.
# 6  
Old 05-04-2013
"Dear" gimley,

Yes I know that.

Quote:
Originally Posted by gimley
Dear durden_tyler,
I tried this because when I created a perl script with both the
Code:
cat

and the subsequent part of the perl script, I got no result.
...
You are simply repeating what you've said earlier. You used "cat", then "perl" and it didn't work. But that's not what I asked. My question was - why are you messing around with "cat" at all?
You see a Perl script in my post; you have your data file - so use the Perl script on your file.
# 7  
Old 05-05-2013
Dear durden_tyler,
I tried this out of sheer desperation. When I run the perl script
below (cut and paste)
Code:
-lne 
if (/^(.*?=)([^(]*)(.*)/) {
($x,$y,$z)=($1,$2,$3);
print "$x$y" if $y ne "";
while ($z =~ m/(\([^(]+)/g) { print "$x$1" }
}

I get the following error
Code:
syntax error at editkamil.pl line 2, near ") {"
syntax error at editkamil.pl line 6, near "}"
Execution of editkamil.pl aborted due to compilation errors.

On the other hand if I remove the
Code:
-lne

I get no output at all.
I hope this clarified the situation.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating verbal structures from a dictionary and a template

My main aim here is to create a database of verbs in a language to Hindi. The output if it works well will be put up on a University site for researchers to use for Machine Translation. This because one of the main weaknesses of MT is in the area of verbs. Sorry for the long post but the problem... (4 Replies)
Discussion started by: gimley
4 Replies

2. Programming

Python Web Page Scraping Urls Creating A Dictionary

I have thrown in the towel and cant figure out how to do this. I have a directory of html files that contain urls that I need to scrape (loop through) and add into a dictionary. An example of the output I would like is: bigbadwolf.htlm: https://www.blah.com, http://www.blahblah.com,... (5 Replies)
Discussion started by: metallica1973
5 Replies

3. Homework & Coursework Questions

How to create a dictionary using cygwin

1. The problem statement, all variables and given/known data: Create a dictionary using cygwin. Display the following menu at the start of execution 1-add a word in the dictionary # specify the meaning 2-search a word # if word exists, show the meaning of the word 2-delete a word... (2 Replies)
Discussion started by: kpopfreakghecky
2 Replies

4. Windows & DOS: Issues & Discussions

How to: Linux BOX in Windows Domain (w/out joining the domain)

Dear Expert, i have linux box that is running in the windows domain, BUT did not being a member of the domain. as I am not the System Administrator so I have no control on the server in the network, such as modify dns entry , add the linux box in AD and domain record and so on that relevant. ... (2 Replies)
Discussion started by: regmaster
2 Replies

5. UNIX for Dummies Questions & Answers

Unix dictionary.

Hey, I am looking for an inbuilt unix dictionary.I tried to look at the path /usr/dict/word and I do not find anything any dict directory in the /usr folder. Can anyone please tell me how to find out this dictionary? Thanks Lee. (1 Reply)
Discussion started by: leepan2008
1 Replies

6. Shell Programming and Scripting

how to give dictionary effect ?

Hello, In google: if we type the text like :- It gives us a question saying :- I want to know how to write a shell script to give this Dictionary effect. example:If we give "lst" then it corrects us saying "list". Can you please help me with a sample code! friends..... (3 Replies)
Discussion started by: nsharath
3 Replies

7. UNIX for Advanced & Expert Users

dictionary words in vim

how can i get the dictionary words in vim using keyboard keys? and how can i get the current directory filename? (1 Reply)
Discussion started by: lakshmananindia
1 Replies

8. UNIX for Dummies Questions & Answers

unix dictionary location

ne1 know where unixs built in dictionary is??? is it in this place /usr/dict/words????? (1 Reply)
Discussion started by: sinner
1 Replies

9. UNIX for Dummies Questions & Answers

nt to unix dictionary

Has anyone ever encountered a good publication or site that is basically a NT(or DOS) to UNIX Dictionary / Translator (i.e. service = daemon or ren = mv, etc) - I've found lots of websites that list like 20 or so command equivalents, but that's about it- what about differences in system folders,... (3 Replies)
Discussion started by: gsumers
3 Replies

10. UNIX for Dummies Questions & Answers

Dictionary File

Could someone please tell me where the dictionary file for Spell is stored. And is it in a text format so I can read it in a windows text editor. Thanks (1 Reply)
Discussion started by: Rukshan
1 Replies
Login or Register to Ask a Question