Re: Java soluton for outputting English?
From: Daniel Sjöblom (dsjoblom_at_mbnet.fi_NOSPAM)
Date: 01/27/04
- Next message: Jim Sculley: "Re: running java on terminal"
- Previous message: No Spam: "empty input string"
- In reply to: Conor: "Java soluton for outputting English?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 27 Jan 2004 22:39:16 +0200
Conor wrote:
> Hi, I've generated a program that outputs a series of nodes eg, {A, F, L,
> Z). This corresponds to the recommended route along a certain path. i.e.
> starting at A go to F then L and arrived at destination Z. I want this to be
> generated into English. for eg, I can deleiver to a user a message that
> says.........
>
> When at A turn letf for F
> Then keep straight for L
> fianlly turn left for Z
>
> So there will be a fixed amout of Engkliosh instructions
> 1- turn left:
> 2- turn right:
> 3- go staright:
>
> So basically I need to output a set of directions. In a database I have
> stored information about roads and the different nodes on each road, my
> problem seems to be deciding how each node and road are related to each
> other, in order to instruct for eg' turn left'. To be honest I've racked my
> brains trying to come up with a solution but I'm stuck. Can anyone recommend
> any ideas?
It depends on how you record the directions. If you only need a fixed
amount of directions, why not simply use something like:
class Node
{
Node north, south, east, west;
}
where a node stands for a junction of some sort. It may not be necessary
to have nodes for every shop or restaurant or whatever. Instead, to get
from one shop to another, you can just find the junctions that are
closest to the targets, and find the path between these junctions. After
you've found a path, it is a simple task to look up street info in a
database (indexed by node). And of course, you get the direction
information directly too. But please elaborate on your problem, I'm not
sure I understood it.
-- Daniel Sjöblom
- Next message: Jim Sculley: "Re: running java on terminal"
- Previous message: No Spam: "empty input string"
- In reply to: Conor: "Java soluton for outputting English?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|