openbibleinfo / Bible-Passage-Reference-Parser

Coffeescript to identify and understand Bible references like "John 3:16."
221 stars 64 forks source link

How to recognise   as a space #34

Open 1-John opened 7 years ago

1-John commented 7 years ago

Hi,

I am currently struggling with (Lk 19,1–10) and alike references. The dash is ok, but can't make the space work.

I have tried to edit
the parser file in this way: bcv_parser.prototype.regexps.space = "(?:[\s\xa0]| )";

Thank you

1-John commented 7 years ago

So it does not work because it is not used later on...

In bcv_parser.prototype.regexps.get_books: for Czech language I see: { osis: ["Gen"], regexp: /(^|[^0-9A-Za-zªµºÀ-ÖØ-öø-ɏḀ-ỿⱠ-ⱿꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꟿ])((?:Prvn[ií][\s\xa0](?:kniha[\s\xa0]Moj(?:|Moj))|1I|Moj)|[\s\xa0](?:kniha[\s\xa0]Moj|Moj)))|G(?:en(?:esis)?|n))|(?:Prvn[ií][\s\xa0]Moj(?:)|[1I](?:.[\s\xa0]Moj(?:|[\s\xa0](?:kniha[\s\xa0]Moj|Moj))))|[1I][\s\xa0](?:kniha[\s\xa0]Moj(?:|Moj))|[1I][\s\xa0]Moj(?:))(?:(?=[\d\s\xa0.:,;\x1e\x1f&()()[]\/"'\=~-\u2013\u2014])|$)/gi }

with spaces defined as [\s\xa0] instead of bcv_parser.prototype.regexps.space

openbibleinfo commented 4 years ago

Hi, I think \xa0 is equivalent to  , right? Could you convert the  s to the actual unicode character?