Skip to content

Commit

Permalink
Fix to the commander file types on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
marigostra committed Jun 21, 2022
1 parent 4ede84d commit d96c85f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/main/java/org/luwrain/controls/EditSpellChecking.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,9 @@ private void setResult(EditArea editArea, SortedMap<Integer, String> text, List<
return false;
});
}

public SpellChecker getSpellChecker()
{
return checker;
}
}
7 changes: 4 additions & 3 deletions src/main/java/org/luwrain/io/CommanderUtilsVfs.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2012-2021 Michael Pozhidaev <[email protected]>
Copyright 2012-2022 Michael Pozhidaev <[email protected]>
This file is part of LUWRAIN.
Expand Down Expand Up @@ -30,7 +30,8 @@

public final class CommanderUtilsVfs
{
static private final String LOG_COMPONENT = "commander-vfs";
static private final String
LOG_COMPONENT = "commander-vfs";

static public class Model implements CommanderArea.Model<FileObject>
{
Expand All @@ -52,7 +53,7 @@ public FileSystemManager getFileSystemManager()
return EntryType.PARENT;
if (entry instanceof org.apache.commons.vfs2.provider.local.LocalFile)
{
final Path path = Paths.get(entry.getName().getPath());
final Path path = entry.getPath();
if (Files.isSymbolicLink(path))
return Files.isDirectory(path)?EntryType.SYMLINK_DIR:EntryType.SYMLINK;
if (Files.isDirectory(path, LinkOption._LINKS))
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/org/luwrain/nlp/ru/spell/RuSpellChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public RuSpellChecker(Luwrain luwrain)
this.langTool = new JLanguageTool(new Russian());
final File
hunspellDataDir = new File(luwrain.getFileProperty(Luwrain.PROP_DIR_DATA), "hunspell"),
dictFile = new File(hunspellDataDir, "ru.dict"),
affFile = new File(hunspellDataDir, "ru.aff");
dictFile = new File(hunspellDataDir, "ru_RU.dic"),
affFile = new File(hunspellDataDir, "ru_RU.aff");
this.hunspell = new Hunspell(dictFile.getAbsolutePath(), affFile.getAbsolutePath());
}

Expand Down Expand Up @@ -66,7 +66,9 @@ public RuSpellChecker(Luwrain luwrain)

@Override public List<String> suggestCorrections(String word)
{
return null;
if (hunspell == null)
throw new IllegalStateException("Hunspell not initialized");
return hunspell.suggest(word);
}


Expand Down

0 comments on commit d96c85f

Please sign in to comment.