octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: first help sentence truncated


From: Rik
Subject: Re: first help sentence truncated
Date: Wed, 29 Aug 2018 14:06:46 -0700

On 08/29/2018 01:41 PM, Juan Pablo Carbajal wrote:
> Hi,
> Just a question, but why instead of re-inventing the english language,
> do not chekc for period followed by non-characters strings and end of
> line?
> something in the lines of (assuming non-greedy *):   '.*[.]\W*$'
> I do not see why a regex cannot handle abbreviations vs. periods.
That would catch multiple sentences.  For example,

octave:1> str = "This is sentence 1. This is sentence 2.\n";
octave:2> str
str = This is sentence 1. This is sentence 2.

octave:3> regexp (str, '.*[.]\W*$')
ans =  1
octave:4> [s,e] = regexp (str, '.*[.]\W*$')
s =  1
e =  40
octave:5> str(1:e)
ans = This is sentence 1. This is sentence 2.

--Rik


>
>
> On Mon, Aug 27, 2018 at 11:47 PM Rik <address@hidden> wrote:
>> On 08/27/2018 01:10 PM, Rik wrote:
>>
>> On 08/27/2018 11:21 AM, Dmitri A. Sergatskov wrote:
>>
>> Also if we truncate the message we could add "..." at the end so it gives a 
>> clue that
>> it is truncated intentionally.
>>
>>
>> Yes, that would be a good addition.
>>
>> --Rik
>>
>>
>> I added this feature to the development branch in this cset: 
>> https://hg.savannah.gnu.org/hgweb/octave/rev/6784059127f5.
>>
>> --Rik
>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]