Re: How many words does GNOME 1.2 has?

Michael Twomey <michael twomey ireland sun com> writes:

Thanks for jumping in!

> for file in `ls *.po`
> do 
> echo -n $file 
> grep -v '#' $file | awk -F'"' '{print $2}' | wc -w
> done
> This prints the filename and then searches for none comment lines.

Nice -- but it will not catch all strings; try

    echo '"one \"xxx\" three"' | \
    grep -v '#' $file | awk -F'"' '{print $2}' | wc -w


    echo '"one \"xxx #\" three"' | \
    grep -v '#' $file | awk -F'"' '{print $2}' | wc -w

I'd say my `grep' line does the job more reliable.

> This one liner assumes that the .po files only have the msgid ready for
> translation and that there is only quotes after the msgstr. i.e. of the
> form:
> msgid "some stuff"
> "some more stuff"
> msgstr ""
> msgid "some stuff"
> msgstr ""

Yes, that's why I voted to use the POT files; by definition these file
are pristine message string files without any translation (msgstr).

> I use this myself to get word counts. (In case you are interested from
> the tarball
> there are about 111000 words in gnome .po messages alone).

It's a good hint to recommend to use the tarball!  I nver thought that
there are so many words :)  (but not all strings are unique).

work : ke suse de                          |          ------    ,__o
     :             |         ------   _-\_<,
home : keichwa gmx net                     |        ------   (*)/'(*)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]