Is there a program that translates Scheme/Java/Ruby code to english sentences? [closed]
Asked Answered
H

1

6

I found this article about converting english sentences to Scheme, but can't seem to find any efforts to do the inverse (i.e. Scheme to english sentences): ftp://ftp.cs.utexas.edu/.snapshot/hourly.2/pub/AI-Lab/tech-reports/UT-AI-TR-87-48.pdf Plus, I don't think the article mentioned how to obtain even the code referred to.

Does anyone know of such a project, or am I going to have to try to roll my own?

I'd also be interested in such a translator for Java/Groovy and/or Ruby.

Basically, I would like to use a program that, given a string of code, outputs the algorithm in english sentences.

Edit: Actually, the article mentioned above does have its corresponding code at the bottom of it.

Hieronymus answered 12/2, 2013 at 19:19 Comment(9)
I have never heard of anything like this.Blastopore
i think you could do this with certain symbols (such as saying equals instead of =) but to make it grammatically accurate i think would be nearly impossibleBetroth
I would want it mostly for small segments of code.Hieronymus
I wonder how you would describe something like nested for loops in English, without making a run-on sentence.Blastopore
I would imagine run-on sentences would be a necessary evil. I would think that it should output something more akin to spoken english than the stricter confines of written english.Hieronymus
if you're real good, the code will read like english without a converterRedmer
You might be interested in literate programming .Pissarro
The ambiguity in spoken language is going to be the main obstacle to overcome, and it's the main reason programming languages look the way they do. It's a simpler problem to go from a highly regular, computer readable language to an irregular one, rather than go the other way.Russi
There are a few English-like programming languages that are listed here: #3067877Christopher
A
3

You want a pseudocode converter. There are several pseudocode converters out there which will converter either pseudocode into programming language code or vice versa. Understand that these converters are far from perfect. But they should at least get you to a decent starting point.

Aril answered 13/2, 2013 at 20:30 Comment(1)
Recently, I wrote a pseudocode converter in Python called EngScript. It automatically translates some kinds of English sentences into the Python programming language.Christopher

© 2022 - 2024 — McMap. All rights reserved.