[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-libunistring] Detecting word breaks one by one
From: |
Bruno Haible |
Subject: |
Re: [bug-libunistring] Detecting word breaks one by one |
Date: |
Sat, 24 Apr 2010 16:42:00 +0200 |
User-agent: |
KMail/1.9.9 |
Hi Aleksander,
> I was wondering if instead u8_wordbreaks() where the whole input string
> is processed looking for wordbreaks, it would be possible to have a new
> method to find just 'the next' wordbreak position.
>
> This would help cases where for example there's a maximum number of
> words to detect, as the whole string doesn't need to be processed. And
> also wouldn't therefore need allocation of a new array just to store the
> flags.
This is a good suggestion. I'm considering to introduce new functions
extern size_t u8_wordbreak_next (const uint8_t *s, size_t n, size_t startpos,
bool inclusive);
extern size_t u8_wordbreak_prev (const uint8_t *s, size_t n, size_t endpos,
bool inclusive);
I'm putting this on my TODO list. Thanks!
Bruno