mirror of
https://github.com/Febbweiss/scrabble-resolver.git
synced 2026-03-04 22:25:36 +00:00
Optim: compressed resolver
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
package fr.pavnay.scrabble;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
@@ -70,16 +68,15 @@ public class Main {
|
||||
try {
|
||||
Resolver resolver = DictionaryBuilder.generateResolver(new Resolver(), file, min, max);
|
||||
resolver.computeStatistics();
|
||||
resolver.displayStatistics();
|
||||
|
||||
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(new File("src/main/resources/resolvers/" + language)));
|
||||
oos.writeObject(resolver);
|
||||
oos.flush();
|
||||
oos.close();
|
||||
ScrabbleUtils.writeResolver(resolver, language);
|
||||
} catch( IOException e) {
|
||||
System.err.println(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void getEnigma(CommandLine line) {
|
||||
final String language = line.getOptionValue("lang", "");
|
||||
final int min = Integer.parseInt(line.getOptionValue("min", "3"));
|
||||
|
||||
Reference in New Issue
Block a user