Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

Commit

Permalink
Support dictionary_root/appendix/ folder
Browse files Browse the repository at this point in the history
when placing furoku, there can be placed on same folder with honmon.
This patch allow user to place appendix/furoku onto like following;
```
dictionar_root/catalogs
                 /subbook/data/honmon
              /appendix/catalogs
                       /subbook/data/furoku
```
  • Loading branch information
miurahr committed Sep 2, 2021
1 parent 7234159 commit dd8e274
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/io/github/eb4j/ebview/EBDict.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ public class EBDict {
private final SubBook[] subBooks;

public EBDict(final File eBookDir) throws Exception {
String eBookDirectory = eBookDir.getPath();
Book eBookDictionary;
String eBookDirectory = eBookDir.getPath();
String appendixDirectory;
if (new File(eBookDir, "appendix").isDirectory()) {
appendixDirectory = new File(eBookDir, "appendix").getPath();
} else {
appendixDirectory = eBookDirectory;
}
try {
// try dictionary and appendix first.
eBookDictionary = new Book(eBookDirectory, eBookDirectory);
eBookDictionary = new Book(eBookDirectory, appendixDirectory);
LOG.info("Load dictionary with appendix.");
} catch (EBException ignore) {
// There may be no appendix, try again with dictionary only.
Expand Down

0 comments on commit dd8e274

Please sign in to comment.