bugGNU Octave - Bugs: bug #36631, get_first_help_sentence does not...

 
 

bug #36631: get_first_help_sentence does not allow for periods in the middle of sentence

Submitted by:  Carnë Draug <carandraug>
Submitted on:  Mon 11 Jun 2012 05:49:00 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Documentation
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 13 Jun 2012 07:13:16 PM UTC, comment #3:

Carnë, I committed your patches. I also applied another one on top to change the period detection to be a period followed by a character in the space class ([\n \t]). This correctly detects things like ellipses ("...") or the id est construction ("i.e.,").

Rik <rik5>
Project Administrator
Mon 11 Jun 2012 09:40:02 PM UTC, comment #2:

FYI: other examples were ".xls", ".ods", ".PCH" (-files).
Dotted numbers (e.g., version strings) come to mind, too.

Philip Nienhuis <philipnienhuis>
Project Member
Mon 11 Jun 2012 06:54:45 PM UTC, comment #1:

Hi

I also noticed that in the lack of a period, the function identifies the end of first sentence by a double newline. However, the way it was set it was actually capturing the first newline (as it would capture the end of a setence period). The new changeset now also fixes it, by simply subtracting 1 (I checked and in the case there's no double new line, the subtraction won't give any errors).

Carnë

(file #26007)

Carnë Draug <carandraug>
Project Member
Mon 11 Jun 2012 05:49:00 PM UTC, original submission:

Hi

this is a really small thing but was annoying for the IO package. The get_first_help_sentence identifies the end of a sentence by finding the first period. This does not allow for the use of periods in a sentence. For example, OpenOffice.Org (I actually can't think of many more examples, maybe an help text would have to mention a decimal number on help text).

The attached changeset fixes that by finding the first period followed by a non-word character.

I have also replaced the call to strfind by regexp so that the option "once" can be used and there's no need for the (:) in min(ind(:)).

Carnë

Carnë Draug <carandraug>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #26007:  help_first_sentence.diff added by carandraug (3KiB - text/x-diff - also fixes the capturing of a newline)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by philipnienhuis (Posted a comment)
  • -unavailable- added by carandraug (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 13 Jun 2012 07:13:16 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Mon 11 Jun 2012 06:54:45 PM UTCcarandraugAttached File-=>Added help_first_sentence.diff, #26007
    Mon 11 Jun 2012 05:49:00 PM UTCcarandraugAttached File-=>Added help_first_sentence.diff, #26006

    Back to the top


    Powered by Savane 3.1-cleanup1