Closed dogweather closed 7 years ago
@cmc333333 what do you think — I just found that I get errors, e.g.:
Input: 'a b c i ii iii d e i'
Alternates between two different outputs: 0 0 0 1 1 1 0 0 0
(wrong) and 0 0 0 1 1 1 0 0 1
(correct).
(I'm simply taking one of the returned solutions, so I get it that the function is returning two. Seems to me, though, that it shouldn't. I.e., the final i
can only be roman ... assuming a full, correct outline.)
Is there a "strict mode" kind of setting?
Thanks @dogweather! Regs will sometimes skip paragraphs, so that's a correct potential set of indentations. We allow the depth derivation to be configured for exactly this sort of scenario, though, by using the second parameter to derive_depths
. To disallow any gaps between paragraph markers, set the last parameter to the [limit_sequence_gap(1)]
rule (we default to 3 when parsing regtext).
Also, let us know if you need any help with the linting errors. Here's the suggestion for type hints which need to be read by interpreters prior to 3.5.
Type annotations w/ 2.7 compatibility looks like a murky pain. I'll remove it.
Just a line-length linting error left. Happy to resolve if you give the org edit rights on this PR.
This'll be a useful feature, thanks @dogweather!
Providing access to
derive_depths
to other apps. In my case, I'd like to use it from Ruby on Rails.