Skip to content

Commit

Permalink
skip loading media_src.txt if not found
Browse files Browse the repository at this point in the history
  • Loading branch information
arysin committed Aug 15, 2019
1 parent 09e2f3a commit 9fec6bb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/tools/groovy/editor/Editor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ dict += new File('data/dict/names-other.lst').readLines()
dict += new File('data/dict/geo-other.lst').readLines()
dict += new File('data/dict/slang.lst').readLines()
@Field
def media = new File('out/toadd/new_lemmas_find.txt').readLines().collectEntries {
def parts = it.split('@@@')
[ (parts[0]): parts.length > 1 ? parts[1..-1] : ["---"] ]
def media = []

def newLemmaFile = new File('out/toadd/new_lemmas_find.txt')
if( newLemmaFile.exists() ) {
media = newLemmaFile.readLines().collectEntries {
def parts = it.split('@@@')
[ (parts[0]): parts.length > 1 ? parts[1..-1] : ["---"] ]
}
}

@Field
def newWords = []
def newWordsFile = new File('new_words.lst')
Expand Down

0 comments on commit 9fec6bb

Please sign in to comment.