git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] userdiff: add support for Fountain documents

From
Zoë Blade <zoe@bytenoise.co.uk>
Date
Jul 19, 2015, 12:30 UTC
Message-ID
<562D4AFF-BFC1-4234-8362-656D1F54DFD0@bytenoise.co.uk>
In-Reply-To
<xmqq380m1k3g.fsf@gitster.dls.corp.google.com>
On 17 Jul 2015, at 23:43, Junio C Hamano <gitster@pobox.com> wrote:
Show 31 quoted lines
> * Although uppercase is recommended for Scene Headings to increase
>   readability, it is not required.
> 
> * A line beginning with any of the following, followed by either a
>   dot or a space, is considered a Scene Heading (unless the line is
>   preceded by an exclamation point !). Case insensitive.
> 
>      INT
>      EXT
>      EST
>      INT./EXT
>      INT/EXT
>      I/E
> 
> * You can "force" a Scene Heading by starting the line with a
>   single period.
> 
> * Scene Headings can optionally be appended with Scene
>   Numbers. Scene numbers are any alphanumerics (plus dashes and
>   periods), wrapped in #.
> 
> So, it appears wrong to insist on capital letters in the patterns.
> The pattern in the patch does not even accept punctuations on the
> line other than apostrophe.  I won't judge if it is OK to limit to
> US-ASCII ;-)
> 
> IPATTERNS("fountain",
>    "^([.][^.]|(INT|EXT|EST|INT./EXT|INT/EXT|I/E)[. ]",
>    "[^ \t-]+"),
> 
> or something like this, perhaps?
Good points, thanks!
This regex should be a bit sturdier:

$ cat scenes.txt int. yes - day INT. YES - DAY #1A# EXT. YES - DAY .YES TOO !EXT. NO INT/EXT YES - DAY INT./EXT YES - DAY I/E YES - DAY no NO NO. !.NO. int yes - day est yes - day !EXT. NO - DAY

$ grep -E "^((\.|(([Ii][Nn][Tt]|[Ee][Ss][Tt]|[Ee][Xx][Tt])?\\.?|[Ii]([Nn][Tt])?\.?/[Ee]([Xx][Tt])?\.?) ).+)$" scenes.txt int. yes - day INT. YES - DAY #1A# EXT. YES - DAY .YES TOO INT/EXT YES - DAY INT./EXT YES - DAY I/E YES - DAY int yes - day est yes - day

Revised version of patch incoming...
Previous: Junio C Hamano
Message 4 of 4 in “userdiff: add support for Fountain documents”
  1. userdiff: add support for Fountain documentsZoë Blade, Jul 17, 2015
  2. Junio C HamanoJul 17, 2015
  3. Junio C HamanoJul 17, 2015
  4. Zoë BladeJul 19, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.