🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #17512

String encoder

#17512
From: Michael A. Angelo
Date: Thu, 05 Nov 1998 00:00
42 lines
1726 bytes
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: <364253B2.CA3E394F@usa.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,e58745c1d9785d86,start
X-Google-Attributes: gidf74b3,public
From: "Michael A. Angelo" <mikeangelo@usa.net>
Subject: String encoder
Date: 1998/11/05
Message-ID: <364253B2.CA3E394F@usa.net>
X-Deja-AN: 408871559
Content-Transfer-Encoding: 7bit
Organization: Another Netscape Collabra Server User
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language