Update prolog interpreter

This commit is contained in:
Victor Shcherb 2013-07-23 23:13:54 +02:00
parent 5213fb325b
commit e81f6cd636
2 changed files with 7 additions and 9 deletions

View file

@ -76,7 +76,7 @@ public abstract class AbstractPrologCommandPlayer implements CommandPlayer {
public String[] getLibraries(){
return new String[] { "alice.tuprolog.lib.BasicLibrary",
"alice.tuprolog.lib.ISOLibrary"};
"alice.tuprolog.lib.ISOLibrary"/*, "alice.tuprolog.lib.IOLibrary"*/};
}
private void init(String voiceProvider, OsmandSettings settings, String configFile) throws CommandPlayerException {
@ -154,6 +154,9 @@ public abstract class AbstractPrologCommandPlayer implements CommandPlayer {
if(prologSystem == null) {
return files;
}
if (log.isInfoEnabled()) {
log.info("Query speak files " + listCmd);
}
SolveInfo res = prologSystem.solve(new Struct(P_RESOLVE, list, result));
if (res.isSuccess()) {
@ -172,6 +175,9 @@ public abstract class AbstractPrologCommandPlayer implements CommandPlayer {
} catch (NoSolutionException e) {
}
}
if (log.isInfoEnabled()) {
log.info("Speak files " + files);
}
return files;
}

View file

@ -23,7 +23,6 @@ public class CommandBuilder {
protected static final String C_TURN = "turn"; //$NON-NLS-1$
protected static final String C_MAKE_UT = "make_ut"; //$NON-NLS-1$
protected static final String C_MAKE_UTWP = "make_ut_wp"; //$NON-NLS-1$
protected static final String C_PREAMBLE = "preamble"; //$NON-NLS-1$
protected static final String C_AND_ARRIVE_DESTINATION = "and_arrive_destination"; //$NON-NLS-1$
protected static final String C_REACHED_DESTINATION = "reached_destination"; //$NON-NLS-1$
protected static final String C_AND_ARRIVE_INTERMEDIATE = "and_arrive_intermediate"; //$NON-NLS-1$
@ -50,14 +49,7 @@ public class CommandBuilder {
private List<Struct> listStruct = new ArrayList<Struct>();
public CommandBuilder(CommandPlayer commandPlayer){
this(commandPlayer, true);
}
public CommandBuilder(CommandPlayer commandPlayer, boolean preamble) {
this.commandPlayer = commandPlayer;
if (preamble) {
addCommand(C_PREAMBLE);
}
}
private void checkState() {