Skip to content

Commit

Permalink
save moses output to file and read results from file instead of stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
mjsduncan committed Oct 18, 2018
1 parent bbddd21 commit 5f719fd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions R/moses2.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ moses <- function( flags = "", DSVfile = "", output = TRUE, ...) {
if(flags == "version") flags <- "--version" # moses() -> moses --version
if(DSVfile != "") flags <- paste("--input-file", DSVfile, "--log-file", paste0(word(DSVfile, sep = fixed(".")), ".log"), "--output-file", paste0(word(DSVfile, sep = fixed(".")), ".out"), flags)
system2("moses", args=flags, stdout = output, ...)
readLines(paste0(word(DSVfile, sep = fixed(".")), ".out"))
}

# run moses on all csv files in a directory. "output" argument can be a file name.
Expand Down

0 comments on commit 5f719fd

Please sign in to comment.