Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revo en ChatGPT #61

Open
stefangrotz opened this issue Nov 17, 2023 · 1 comment
Open

Revo en ChatGPT #61

stefangrotz opened this issue Nov 17, 2023 · 1 comment

Comments

@stefangrotz
Copy link

stefangrotz commented Nov 17, 2023

Mi sukcesis uzi revo.xdxf en ChatGPT uzante "ChatGPT Code interpreter":
chatGPT-revo

I used this prompt with a minified version of an example python code and some information about the data structure:

# reta vortaro - revo.xdxf
When asked about the reta vortaro, revo or generally about complex multi-lingual dictionary questions, you can search revo.xdxf using python. The Esperanto words can be found in the <ar> elements, examples in <ex> and translations to other languages in <dtrn>. For non-Esperanto word searches always search in dtrn and return the corresponding Esperanto word and example if not specified differently. Here is an example of the data structure of translations: <dtrn> /de/ Beispiel, Muster, Vorbild</dtrn> There can be additional elements inside of the elements described above. Write robust code that can handle messy XML.

Here is an example of such a search for an Esperanto word:

import xml.etree.ElementTree as D
def A(file_path,word):
   C='def';E=D.parse(file_path);F=E.getroot()
   for A in F.findall('.//ar'):
   	B=A.find('k')
   	if B is not None and B.text.strip()==word:G=A.find(C).text if A.find(C)is not None else'No definition found';H=[A.text for A in A.findall('.//def/ex')]or['No examples found'];I=[A.text for A in A.findall('dtrn')]or['No translations found'];return{'word':word,'definition':G,'examples':H,'translations':I}
B='revo.xdxf'
C=A(B,'krokodili')
print(C)

Eble estonte mi uzos tion en la projekto "EsperantoGPT" https://github.com/parolteknologio/EsperantoGPT

Kion vi pensas pri tio?

@wdiestel
Copy link
Contributor

Jes, efektive tre interesa. Ankaŭ kiel ĝi klarigas ĉion aldone en la angla. Verŝajne, se vi volas serioze uzi tion, vi ankaŭ devos atentigi ĝin, ke kelkaj artikoloj havas ingigitan strukturon (subsencoj...)

( Ĉu vi povus ankaŭ ĝentile demandi, ĉu la roboto inklinus forigi kelkajn cimojn el mia listo de ne jam solvitaj ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants