src/Pure/Tools/spell_checker.scala
changeset 76492 e228be7cd375
parent 75393 87ebf5a50283
child 78592 fdfe9b91d96e
--- 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 {