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: Thu, 30 Aug 2018 11:13:11 -0700

On 08/30/2018 09:18 AM, John W. Eaton wrote:
On 08/29/2018 05:06 PM, Rik wrote:
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,


It seems to me we could use the same rules as Texinfo (based on the rules for TeX) for determining the ends of sentences and then require the extra work for those cases when the rules aren't sufficient.  The Texinfo rules may be found here:


https://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Ending-a-Sentence

and


https://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Not-Ending-a-Sentence

I wouldn't work too hard on this, but it seems fairly straightforward if someone who is interested.

Also, for the record, I generally type two spaces at the end of a sentence.  It seems natural to me, as it's a habit formed many years ago when learning to type on real typewriters with fixed-space characters. But I also realize that style is falling out of favor now, even when using fixed-width fonts or lousy "word processors" that don't automatically insert the extra space at ends of sentences that one would expect to see with good quality typesetting.

jwe


I agree, this isn't worth too much time.  I changed the regexp pattern on the development branch:

+  ## Extract first line by searching for a period followed by whitespace
+  ## followed by a capital letter (Nearly the same rule as Texinfo).
+  period_idx = regexp (help_text, '\.\s+(?:[A-Z]|\n)', "once");

This is closer to what is meant by a "sentence" but it still won't work on the motivating example.  The HTML for that is shown below.

Smooths the y vs. x values of 1D data by Tikhonov regularization. The smooth y-values are returned as yhat.

The texinfo has @var{y} and @var{x} so when this is expanded by makeinfo to plain text the result is

Smooths the Y vs. X values of 1D data by Tikhonov regularization. The smooth y-values are returned as YHAT.

The abbreviation "vs." still looks like a sentence end because the next letter following the period is capitalized.  At this point, I think it would be easier to rewrite the help text and expand "vs." to "versus".

--Rik

reply via email to

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