Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!snorkelwacker!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!nuug!ifi!gisle From: gisle@ifi.uio.no (Gisle Hannemyr) Newsgroups: comp.sources.wanted Subject: Wanted -- ambiguous lookup routine. Message-ID: <1990Aug9.084710.3910@ifi.uio.no> Date: 9 Aug 90 08:47:10 GMT Organization: gisle@ifi.uio.no Lines: 32 Originator: gisle@kyrre.ifi.uio.no I am storing a number of strings (composed of several words) in a list in RAM. For instance (three strings): John Fitzgerald Kennedy John Frank Oppenheimer Lyndon Bird Johnson I want to look up a string using an unambiguous abbreviation of the words in the string. Ie (given the short list above): J F K => John Fitzgerald Kennedy John Fitzgerald Kennedy => John Fitzgerald Kennedy L => Lyndon Bird Johnson J F => (error, ambiguous) J F L => (error, not found) Typical applications for such a function would be phone directory, or a completing unambiguous command parser. Does anyone have a fast C routine that do the above, or know a clever algorithm to accomplish it. My main requirement is speed. Please mail your replies if possible. I do not read these groups regularly. - gisle hannemyr (Norwegian Computing Center) EAN: C=no;PRMD=uninett;O=nr;S=Hannemyr;G=Gisle (X.400 SA format) gisle.hannemyr@nr.no (RFC-822 format) Inet: gisle@ifi.uio.no UUCP: ...!mcvax!ifi!gisle ------------------------------------------------