× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Mon, Jan 14, 2019 at 4:58 PM Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:

This site https://dialect.ca/code/name-case/#output <https://dialect.ca/code/name-case/#output> has a Regex based routine that looks as if it could be converted to Regex in RPG or set up a simple in-house web service or whatever to use it. PHP Source code is here https://dialect.ca/code/name-case/name_case.phps <https://dialect.ca/code/name-case/name_case.phps> but could be adapted quite easily.

The "could be adapted quite easily" definitely does apply to Python,
and this would certainly handle a wide variety of inputs better than
the naive functions that are included with Python (including the ones
mentioned in the Python samples already given in this thread).

But there is already a third-party Python package for this (and more):

https://pypi.org/project/nameparser/

So, if the Python built-ins and standard library aren't enough, the
most practical and idiomatic thing to do would be to install that
package. Assuming you already have IBM's Python 3 for PASE installed,
it would be

pip3 install nameparser

at a PASE command shell. If you have neither PHP nor Python already
installed, but do have Node.js, then the leading package for this
stuff seems to be

https://www.npmjs.com/package/namecase

which you should be able to install similarly easily using npm.

If you don't have any of PHP, Python, or Node.js installed, then you
might as well pick either or both of the latter two, because those are
now super-easy to install using yum.

John Y.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.