1

Let's say I have a command line app that has the following functions:

function createABox() { console.log("hey"); };
function deleteABox() { console.log("wutsup"); };

The command line app can take any kind of text input. I want the app to call createABox whenever it makes sense to do so from an English speaking perspective. For example:

"create a box", "create box", "new box", "I want a new box", "new container"

should all call createABox. Is this a common linguistics problem and if so what would be the pseudocode algorithm for something like that? Thanks.

4
  • Check naming tag at Programmers.SE for some nice questions on naming conventions. Alternatively, check for articles about developing domain-specific languages (DSL). In any case, I'm afraid this question has nothing to do with linguistics, hence flagging it as offtopic. – bytebuster Sep 27 '13 at 19:58
  • 4
    This question appears to be off-topic because it is about DSL and/or naming conventions – bytebuster Sep 27 '13 at 19:59
  • The question is not about DSL, it's about computational linguistics. – Atamiri Sep 28 '13 at 2:44
  • Computational linguistics is about things like word frequencies and corpora. I see nothing here related at all to computational linguistics. Maybe natural language / AI. But if it's got anything to do with linguistics at all it is certainly not framed appropriately. – hippietrail Sep 28 '13 at 4:50
0

First off all, you'll need a parser. Once you have a syntax tree (provided the input is well-formed according to your grammar) you can try to construct a logical form that can be semantically interpreted in your app. If the domain is very limited, the parser will be comparatively simple. It all depends on where your limits are. Read a good description of definite clause grammars (which are covered in all good books about Prolog).

Not the answer you're looking for? Browse other questions tagged or ask your own question.