I am reworking a Marathi-English dictionary to be out on open-source. My dictionary has the Headword in Marathi, followed by its Part of Speech and subsequently by its English glosses as in the examples below;
v i To contract, shrink.
a Eleven.
a Frightful, terrible.
a Frightful, terrible.
m A walnut.
m A walnut.
a That which is not proper to be done; improper.
a Incapable, incompetent.
n Impotence, incapability.
n A bad action, sin.
a Wicked.
a Wicked.
a Intransitive or neuter.
a Exempt from stain, blemish.
f Figure-writing.
m A wiseacre.
a Inconceivable; undevisable
a Unexpected; unthought of.
a Sinless.
n Infelicity; injury.
m Malice, spite, grudge.
a Spiteful, malicious
a Spiteful, malicious
ad Suddenly, unexpectedly, inconsiderately.
ad Suddenly, unexpectedly, inconsiderately.
As can be seen the delimiter of the gloss is either a comma or a semi-colon
To make the dictionary more accessible and easily readable and concise, I want to retain only single words or words with the following
to
A
At present I have written a macro in Ultraedit: a Word processor to do the job. It uses a regex to identify all glosses with single words (with the condition specified above)
However Macros are slow and since the database is around 400.000+ words,I wonder if there is a means of identifying such single glosses through an awk or perl script. Thus in the example above, only the following will be retained
v i To contract, shrink.
a Eleven.
a Frightful, terrible.
a Frightful, terrible.
m A walnut.
m A walnut.
a That which is not proper to be done; improper.
a Incapable, incompetent.
n Impotence, incapability.
n A bad action, sin.
a Wicked.
a Wicked.
a Intransitive,neuter.
a Exempt from stain, blemish.
f Figure-writing.
m A wiseacre.
a Inconceivable; undevisable
a Unexpected; unthought of.
a Sinless.
n Infelicity; injury.
m Malice, spite, grudge.
a Spiteful, malicious
a Spiteful, malicious
ad Suddenly, unexpectedly, inconsiderately.
ad Suddenly, unexpectedly, inconsiderately.
I normally have the painful task of further removing cases where a word has a single gloss as well as a long definition as in
a That which is not proper to be done; improper.
which is reduced to
a improper.
If both stages can be handled, it would really help a lot.
I work in a Windows environment. Many thanks for any help given which will be gratefully acknowledged by the community once this simplified dictionary is put on line.