Re: A Compiler for Natural Language (transator that translates from natural language to C++)

Chris F Clark <cfc@shell01.TheWorld.com>
16 May 2005 14:30:05 -0400

          From comp.compilers

Related articles
A Compiler for Natural Language (transator that translates from natura shakti.misra@wipro.com (DeltaOne) (2005-05-16)
Re: A Compiler for Natural Language (transator that translates from na nmm1@cus.cam.ac.uk (2005-05-16)
Re: A Compiler for Natural Language (transator that translates from na cfc@shell01.TheWorld.com (Chris F Clark) (2005-05-16)
Re: A Compiler for Natural Language (transator that translates from na joe@burgershack.com (Randy) (2005-05-16)
Re: A Compiler for Natural Language (transator that translates from na kleinecke@astound.net (2005-05-18)
Re: A Compiler for Natural Language (transator that translates from na DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2005-05-18)
Re: A Compiler for Natural Language (transator that translates from na daffra.claudio@gmail.com (claudio daffa) (2013-11-07)
Re: A Compiler for Natural Language (transator that translates from na itz@buug.org (Ian Zimmerman) (2013-11-18)
| List of all articles for this month |
From: Chris F Clark <cfc@shell01.TheWorld.com>
Newsgroups: comp.compilers
Date: 16 May 2005 14:30:05 -0400
Organization: The World Public Access UNIX, Brookline, MA
References: 05-05-141
Keywords: parse
Posted-Date: 16 May 2005 14:30:05 EDT

"DeltaOne" <shakti.misra@wipro.com> writes:
> The input natural language will be a restricted NL. It will be a
> algorithmic language. Well its not possible to give the full design
> here. But the main aim of the language is to get a uniform interface
> for all kind of languages.


You can probably be somewhat successful at getting a nice "human
readable natural language" to C++ translator for some very small
restricted domain. That is doable. However, a uniform interface to a
wide variety of languages (even to a small variety of languages over a
wide domain) is so far beyond the state-of-the-art as to be
inconcievable. The problem is in the subtle differences in semantics.


To make this example concrete, I just recently did a port of the
output of Yacc++ from C++ to C#. That's a very restricted problem and
the languages are in many respects close together and I wasn't coming
from a vague natural language user input specification, but a precise
clear definition (in C++) that I was intimately familiar with having
written much of it myself. The quick "syntactic" conversion took a
matter of days. The harder semantic conversion where I made sure that
all the C++ features worked (not necessarily the same way, but in any
way) in the C# version still has some unattended to tasks.


Thus, if you want your project to succeed, you are going to need to
vastly restrict the input domain to a subset of semantics that are
likely to exist (and be similar or at least compatible) across your
entire language set, perhaps integer arithmetic, fixed size arrays.
Note that in the restricted set (character) strings and I/O are not
likely to make it, as they tend to be highly different in different
languages. Even with such a restricted set, you will find that for
some languages (if you make you language set wide enough) you will not
be able to create the idiomatic program for that language, you will
create some foreign looking program that just happens to run
correctly.


Now, if you have some specific idea as to how this can be done, I
don't want to discourage you. Many times great progress is made by
heretics, who simply refuse to listen to common wisdom, because they
know something can be solved (and know an easy way to solve it).
However, if you don't have an approach in mind, pick a smaller
problem. Translating natural language into C++ for some restricted
set of inputs is "hard enough" and will keep you adequately amused for
some time. And, perhaps as you work on that problem, you will
discover some principles that allow you to go much farther than
expected. Then, you will become a heretic naturally.


Hope this helps,
-Chris


*****************************************************************************
Chris Clark Internet : compres@world.std.com
Compiler Resources, Inc. Web Site : http://world.std.com/~compres
23 Bailey Rd voice : (508) 435-5016
Berlin, MA 01503 USA fax : (978) 838-0263 (24 hours)
------------------------------------------------------------------------------


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.