Re: Java soluton for outputting English?

From: Daniel Sjöblom (dsjoblom_at_mbnet.fi_NOSPAM)
Date: 01/27/04


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


Relevant Pages

  • Re: TomTom Go opinions?
    ... > junctions but the voice directions are very poor and often directly wrong ... > screen in coloured markings on the 3-D images of the roads. ...
    (sci.geo.satellite-nav)
  • TIDBITS 03/25/07
    ... Tidbits may be reprinted without charge -- ... The Jewelry Shop ... in all directions. ...
    (rec.crafts.beads)
  • TIDBITS 03/25/07
    ... Tidbits may be reprinted without charge -- ... The Jewelry Shop ... in all directions. ...
    (rec.crafts.marketplace)
  • TIDBITS 03/25/07
    ... Tidbits may be reprinted without charge -- ... The Jewelry Shop ... in all directions. ...
    (rec.crafts.misc)
  • Re: TomTom Go opinions?
    ... > What that glare complaint disguises is what I consider to be the biggest ... > junctions but the voice directions are very poor and often directly wrong ... > screen in coloured markings on the 3-D images of the roads. ...
    (sci.geo.satellite-nav)

Loading