Re: Embedded numbers sorting function (begging post)

Liste des GroupesRevenir à l c 
Sujet : Re: Embedded numbers sorting function (begging post)
De : anton.txt (at) *nospam* gmail.moc (Anton Shepelev)
Groupes : comp.lang.c
Date : 15. Jun 2024, 01:07:18
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240615020718.69e82b6efc55f85449a542e0@gmail.moc>
References : 1 2 3 4 5
User-Agent : Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Malcolm McLean:
Anton Shepelev:
Kaz Kylheku:
Kaz Kylheku:
>
Yes; I just whipped up this piece of simplicity in
15 minutes:
>
Additional hack for considering sequences of spaces
and tabs to be one space:
>
A friend of mine is interested in feeding this task to
an LLM.  Can you please provide are more precise
description of what you solution does, than the very
informat one from Malcolm?
>
If you go into my hobby project and check the "bbx_ls"
program, or the equivalent now embedded with the shell,
you will find this function.

I was asking Kaz for a specification or at least a
relatively precise description of the task, rather than a
ready solution.  But I thank you for the reference anyway,
and will use it as another human solution to compare against
that by the LLM.  Yes, I have found Martin Pool's
implementation that you use:

   <https://github.com/sourcefrog/natsort>

and now I see had come across it before.  It does not have
an exact specification, but I get an idea.

It  was not written by me, though I'm surely capable of
writing it if demanded. But it's not entirely
straightforwards.

I thought of representing each string as sequence of
alternating text and numberic chucnks, and compareing them
pairwise, e.g.

   Item 153 of batch 17a

will be parsed into five chunks:

   Item 153 of batch 17a
   111112223333333333445

and comparisons made chunk-wise, according to their types.
Chunks of different types shall be compared as text.

--
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments

Date Sujet#  Auteur
15 Jun 24 * Re: Embedded numbers sorting function (begging post)3Anton Shepelev
15 Jun 24 `* Re: Embedded numbers sorting function (begging post)2Malcolm McLean
15 Jun 24  `- Re: Embedded numbers sorting function (begging post)1Anton Shepelev

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal