Add a TryGetChapters function to ScriptureRangeParser
@pmachapman ci sta già lavorando.
Dal 14/9/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
When I call ScriptureRangeParser.GetChapters(), I sometimes need to wrap it in a try/catch to ensure that any invalid chapter ranges (i.e. because a versification has changed) do not crash the method calling it, and I would rather the method just skip the range.
Does it make sense to have a ScriptureRangeParser.TryGetChapters(string scriptureRange, out Dictionary<string, List<int>> chapters) method that returns true if the chapters were retrieved, or false if they were not?
Another option could be to have a more forgiving GetChapters() implementation that will just parse the chapter ranges specified, even if they are not precisely the same as the versification requires (i.e. additional chapter numbers are in the range)
In Scripture Forge I created an extension method along the lines of:
public static bool TryGetChapters(
this ScriptureRangeParser scriptureRangeParser,
string chapterSelections,
[NotNullWhen(true)] out Dictionary<string, List<int>>? chapters
)
{
try
{
chapters = scriptureRangeParser.GetChapters(chapterSelections);
return true;
}
catch (ArgumentException)
{
chapters = null;
return false;
}
}
- Lingua principale
- C#
- Stelle
- 29
- Fork
- 17
- Merge medio
- 3g 2h
- PR unite (30g)
- 8
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sillsdev/machine
-
Environment matchers pay for captures they never read; key the traversal on what the caller consumes Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
HermitCrab: Word.ExpandAlternatives discards Unify's success flag and can null the realizational FS Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
Tutte le issue di sillsdev/machine
Issue simili
-
type/automation type/tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
t/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
ci-failure-cause test-failure
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
area:auth FE mvp P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
klasolsson81/jobbliggaren#1788 ·