Article View: borland.public.jbuilder.java.language
Article #17515Re: String encoder
From: Michael A. Long
Date: Fri, 06 Nov 1998 00:00
Date: Fri, 06 Nov 1998 00:00
47 lines
1920 bytes
1920 bytes
You need to look at the java.util.StringTokenizer class. It has pretty much everything you are looking for. Michael A. Angelo wrote in message <364253B2.CA3E394F@usa.net>... >OK. This is going to be hard to explain, but here it goes. > >I need to write an application or applet to read a file and parse it >into fields. Easy enough. For the most part it is. The only problem is >that a name field can be a number of different ways. > >Example: > >John Q. Doe >J. Quincy Doe >J. Q. Doe >Mr. John Q. Doe >Dr. J. Q. Doe > >Get the picture. We cannot ask the provider of the data file to conform >to a particular format, and there are many providers hence many formats. > >What I was hoping for is something like encoding according to a pattern. >The patterns could then be stored in a properties type file. Each >provider would have their own property file. The same Java engine would >then be able to process the name. > >Example of algorithm: > >String Pattern Encode Result >-------------- >J. Quincy Doe A. B C C B A Doe Quincy J > A = J (No . because the . is part of the pattern) > B = Quincy > C = Doe > >John Q. Doe A B. C C, A Doe, John > A = John > B = Q (no .) > C = Doe > >Get the picture? > >Any help would be great! If you need a future explanation, let me know. > >Mike >mikeangelo@usa.net >
Technical Details
Message-ID:
<71ukbb$hm39@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<364253B2.CA3E394F@usa.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,e58745c1d9785d86 X-Google-Attributes: gidf74b3,public From: "Michael A. Long" <mlong@cmc.net> Subject: Re: String encoder Date: 1998/11/06 Message-ID: <71ukbb$hm39@forums.borland.com> X-Deja-AN: 408984996 References: <364253B2.CA3E394F@usa.net> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: CSU Chico Newsgroups: borland.public.jbuilder.java.language