--- a/src/Pure/Tools/spell_checker.scala Wed Nov 09 14:20:52 2022 +0100
+++ b/src/Pure/Tools/spell_checker.scala Wed Nov 09 19:42:21 2022 +0100
@@ -85,12 +85,14 @@
}
}
- def dictionaries: List[Dictionary] =
+ lazy val dictionaries: List[Dictionary] =
for {
path <- Path.split(Isabelle_System.getenv("JORTHO_DICTIONARIES"))
if path.is_file
} yield new Dictionary(path)
+ def get_dictionary(lang: String): Option[Dictionary] = dictionaries.find(_.lang == lang)
+
/* create spell checker */
@@ -260,7 +262,7 @@
if (options.bool("spell_checker")) {
val lang = options.string("spell_checker_dictionary")
if (current_spell_checker._1 != lang) {
- Spell_Checker.dictionaries.find(_.lang == lang) match {
+ Spell_Checker.get_dictionary(lang) match {
case Some(dictionary) =>
val spell_checker =
Exn.capture { Spell_Checker(dictionary) } match {