Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Extracting words from dtd and properties files for online dictionary

1 view
Skip to first unread message

Michael Wolf

unread,
Oct 10, 2008, 3:58:15 PM10/10/08
to
Hello,

is there a solution ready for use to extract words from dtd and
properties files for creating an online dictionary? The dictionary is
based on php and mysql.

Regards and thanks in advance
Michael

Jesper Kristensen

unread,
Oct 10, 2008, 4:20:46 PM10/10/08
to
Michael Wolf skrev:

I have a python script which reads all strings from a source checkout to
a MySQL table. It uses compare-locales and Silme to do that. My
intension was to make a web site which could translate error messages,
but I didn't manage to make the search work as well as I would like it.
Send me an email if you want the script. mail(at)jesperkristensen.dk

Zbigniew Braniecki

unread,
Oct 11, 2008, 3:41:29 AM10/11/08
to Michael Wolf
On 10/10/08 12:58 PM, Michael Wolf wrote:
> Hello,
>
> is there a solution ready for use to extract words from dtd and
> properties files for creating an online dictionary? The dictionary is
> based on php and mysql.

Silme can make it very easy.

It's a bit early in the game, and Silme has no stable release, but it
can easily read what you need.

I recommend using "multilocale" branch, and then you can write sth like:

#!/usr/bin/python

sys.path.append('./lib')

import silme.core
import silme.fp.object.dtd
import silme.fp.object.properties
import silme.io

io = silme.io.Manager.get('file')
l10nPackage = io.getL10nPackage('./path/to/your/directory/')

print l10nPackage.getPackages()
print l10nPackage.getObjects()
print l10nPackage.getPackage('subdirectory')
print l10nPackage.getObject('file.dtd').getEntities()

and you should understand the rest of API.

If you don't care for structure:

print l10nPackage.getEntities()

will give you all entities from all files from this package.


You can download it from
http://hg.mozilla.org/users/zbraniecki_mozilla.com/silme

Im currently working on releasing more stable version of silme after
merging the branch back to trunk
(https://bugzilla.mozilla.org/show_bug.cgi?id=458441)

Yes. Documentation is a part of the short-term plan :)

Greetings
Zbigniew Braniecki
--

Mozilla (http://www.mozilla.org)

Axel Hecht

unread,
Oct 11, 2008, 8:14:16 AM10/11/08
to
Michael Wolf wrote:
> Hello,
>
> is there a solution ready for use to extract words from dtd and
> properties files for creating an online dictionary? The dictionary is
> based on php and mysql.

My sceptic me mentions that the licensing implications on this are
somewhat tricky, as with language in general.

There is a similar project on the net somewhere, but I don't find the
URL right now. And we had a lenthy discussion about their licensing
scheme, too.

Axel

Axel Hecht

unread,
Oct 12, 2008, 8:12:00 AM10/12/08
to

http://open-tran.eu/ it was, http://open-tran.eu/projects.html lists the
projects and licenses.

Axel

F Wolff

unread,
Oct 14, 2008, 4:01:29 AM10/14/08
to dev-...@lists.mozilla.org

Hallo Michael

I am sure you are aware of the Translate Toolkit that can convert
Mozilla files to PO. With the recent release of the Toolkit, we have a
new tool called poterminology:
http://translate.sourceforge.net/wiki/toolkit/poterminology

It can extract frequent words and short phrases, and can even try to
fill in the translations used for them in the files. There are lots of
parameters to tweak, to control the type of output. The PO file can
easily be converted to other formats that you might prefer, such as CSV.
Poterminology is built on the API of the Translate Toolkit, which is
also used by Open-tran that Axel mentioned.

Keep well
Friedel


--
Recently on my blog:
http://translate.org.za/blogs/friedel/en/content/autocompletion-during-translation

Michael Wolf

unread,
Oct 14, 2008, 2:40:45 PM10/14/08
to
Zbigniew Braniecki napisa:

>
> Silme can make it very easy.
>
> It's a bit early in the game, and Silme has no stable release, but it
> can easily read what you need.
>
> I recommend using "multilocale" branch, and then you can write sth like:

Zbigniew Braniecki napisa:


> Silme can make it very easy.
>
> It's a bit early in the game, and Silme has no stable release, but it
> can easily read what you need.
>
> I recommend using "multilocale" branch, and then you can write sth like:

Hello Zbigniew,

thank you for message. Sorry for the late answer. Hm, to be honest, I
don't know what Silme is. I hoped that there would be a not too
complicated solution (a simple one probably doesn't exist).

I'd know how will be look the output? Mainly I need simple words useful
for a dictionary. Useless words shall be filtered off. there will be
example phrases too, but I think they should be entered manually.

I don't know much about script programming. It's for a new online
lexicon which shall collect Upper Sorbian and Lower Sorbian technical
terms together with their German and English equivalents:

http://www.serbski-leksikon.de/test/

The lexicon is still in development phase, there aren't much words in
it. I look for a method to input entries automatically because manual
entering will be a lot of work.

This lexicon is in fact a new reason to build such a glossary. I've been
translating Mozilla programs to Upper Sorbian (and now for Lower
Sorbian, too) for many years and want already for a long time to build
such a glossary to avoid that I use for the same English word a
different translation e.g. in SeaMonkey and Firefox. The translation
should be homogeneous.

Kind regards,
Michael

Michael Wolf

unread,
Oct 14, 2008, 2:44:54 PM10/14/08
to
Jesper Kristensen napisa:

> I have a python script which reads all strings from a source checkout to
> a MySQL table. It uses compare-locales and Silme to do that. My
> intension was to make a web site which could translate error messages,
> but I didn't manage to make the search work as well as I would like it.
> Send me an email if you want the script. mail(at)jesperkristensen.dk

Hello Jesper,

yes, please send the script. But I haven't much clue about silme and
compare-locales. Is it possible to get some information about them?

Kind regards
Michael

Michael Wolf

unread,
Oct 14, 2008, 2:53:06 PM10/14/08
to
F Wolff napisa:

Michael Wolf

unread,
Oct 14, 2008, 3:01:46 PM10/14/08
to
F Wolff napisa:

>
> Hallo Michael
>
> I am sure you are aware of the Translate Toolkit that can convert
> Mozilla files to PO. With the recent release of the Toolkit, we have a
> new tool called poterminology:
> http://translate.sourceforge.net/wiki/toolkit/poterminology
>
> It can extract frequent words and short phrases, and can even try to
> fill in the translations used for them in the files. There are lots of
> parameters to tweak, to control the type of output. The PO file can
> easily be converted to other formats that you might prefer, such as CSV.
> Poterminology is built on the API of the Translate Toolkit, which is
> also used by Open-tran that Axel mentioned.

Hello Friedel,

yes, I know the Translate Toolkit, I have installed it on my machine but
I don't use it. I use a Unicode editor only to edit the dtd and
properties files. Hm, I see there are already some tools that I don't
know. May be it's because I translate inofficially.

Kind regards
Michael

Michael Wolf

unread,
Oct 14, 2008, 3:10:07 PM10/14/08
to
Axel Hecht napisa:

>> My sceptic me mentions that the licensing implications on this are
>> somewhat tricky, as with language in general.
>>
>> There is a similar project on the net somewhere, but I don't find the
>> URL right now. And we had a lenthy discussion about their licensing
>> scheme, too.
>
> http://open-tran.eu/ it was, http://open-tran.eu/projects.html lists the
> projects and licenses.

Hello Axel,

Yes, a long time ago I read something about open-tran and those
licencing issues. It even contains Upper Sorbian because it covers the
Upper Sorbian translation for KDE. Because my translations are
inofficial they are not contained in open-tran. The main vocabulary
probably will be the same. I think some translations of KDE are even
based on my translations because I've been already translating since
Mozilla 0.98 to Upper Sorbian.

KInd regards,
Michael

0 new messages