Category:Enguage: Difference between revisions

From Rosetta Code
Content added Content deleted
Line 27: Line 27:


The interpretation of language is defined in written specifications, under the '''etc/''' directory.
The interpretation of language is defined in written specifications, under the '''etc/''' directory.
Repertoires, each supporting a concept are under '''etc'rpt''' and unit tests are under '''etc/test'''.
Repertoires, each supporting a concept are under '''etc/rpts''' and unit tests are under '''etc/test'''.
An 'active' dictionary, of entries with an embedded unit test, is under '''etc/dict'''.
An 'active' dictionary, of entries with an embedded unit test, is under '''etc/dict'''.
The interpretation of language can also be supplied by utterance, i.e. by voice, and some of the written specifications use this style.
The interpretation of language can also be supplied by utterance, i.e. by voice, and some of the written specifications use this style.

Revision as of 20:10, 30 May 2023

Language
Enguage
This programming language may be used to instruct a computer to perform a task.
See Also:


Listed below are all of the tasks on Rosetta Code which have been solved using Enguage.

Enguage is a speech understanding algorithm which supports the idea that speech is Turing complete, so respectfully requests a place on Rosetta Code. While the examples here are given in English, it can be applied to any natural language. While untested, it should work with Unicode characters so it could be used to implement John Searle 's Chinese Room. It is therefore the interpreter, and not the language, to which Enguage refers. It can be used to process data, but it is not efficient in doing this. It is unsuitable for interpreting writing, as this is not a discourse.

Hope this is of interest! Happy talking :^)

Background

"Enguage" is a portmanteau of the words Language and Engine - hence its unconventional spelling. It is being actively developed and has been since 2011. It won the British Computer Society's Machine Intelligence Competition in 2016.

Enguage source code repo If you have make and git installed, Enguage can be downloaded, created, and run in three ways, thus:

    $ git clone https://bitbucket.org/martinwheatman/enguage.git
    $ cd enguage
    $ make jar
    $ export PATH=$PATH:./sbin
    $ java -jar lib/enguage.jar -t
    $ java -jar lib/enguage.jar -T hello
    $ java -jar lib/enguage.jar

These three examples of running the interpreter are: -t, the full unit test suite; -T the unit test for a given concept; and, the interactive shell.

The interpretation of language is defined in written specifications, under the etc/ directory. Repertoires, each supporting a concept are under etc/rpts and unit tests are under etc/test. An 'active' dictionary, of entries with an embedded unit test, is under etc/dict. The interpretation of language can also be supplied by utterance, i.e. by voice, and some of the written specifications use this style.

Algorithm

All Enguage does is to swap the user's utterance, "hello", with one of the interpretation's replies, "hello to you too". It does this either directly, On "hello", reply "hello to you too"., or by issuing (thinking?) further utterances and maintaining, and using, a replied answer and the status, or felicitous outcome, of that thought.

Each utterance has one or more interpretations [1], which is the equivalent of a function in a traditional programming language. Each function can be specified in a .txt file, or can be created by utterance, e.g. "to the phrase hello reply hello to you too." A group of utterances, a repertoire, equivalent to an API in traditional languages supports an idea, or concept. For example, a simple repertoire might be: i need a coffee, i do not need a coffee, do i need a coffee and what do i need.

The Turing complete quality of a function is that it is represented as a list of instructions. These instructions can form loops, and can be conditionally operated, and are implemented by the implemented language, not in source code (i.e. within the interpreter). The felicitous nature of a thought can be used by prefixing a subsequent thought with 'if so, ...' if the outcome is positive, and 'if not, ...' if it negative. This supplies the idea of conditional processing and recalling (recursion) is used to create loops, see the FizzBuzz example. Thus, interaction with Enguage is always given as a Turing complete discourse: utterance to reply.

Hooks

As well as the 'reply "..."' imperative, Enguage also has several other such 'hooks' to allow other operations available to the software to be called, such as perform "..." to access the Java classes, and run "..." to run an external command. That Enguage passes off processing to traditional software is regarded as little different to machine code operating an ALU to provide arithmetic operations.

References

Pages in category "Enguage"

The following 2 pages are in this category, out of 2 total.