Description Usage Arguments See Also Examples
PDE_pdfs2txt_searchandfilter
extracts sentences from a single PDF file
according to search and filter words and writes output in the corresponding
folder.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
pdfs |
String. A list of paths to the PDF files to be analyzed. |
out |
String. Directory chosen to save analysis results in. Default:
|
filter.words |
List of strings. The list of filter words. If not
|
ignore.case.fw |
Logical. Are the filter words case-sensitive (does
capitalization matter)? Default: |
filter.word.times |
Numeric. The minimum number of hits described for
|
search.words |
List of strings. List of search words. Regex rules apply (see also https://www.rstudio.com/wp-content/uploads/2016/09/RegExCheatsheet.pdf). |
ignore.case.sw |
Logical. Are the search words case-sensitive (does
capitalization matter)? Default: |
eval.abbrevs |
Logical. Should abbreviations for the search words be
automatically detected and then replaced with the search word + "$*"?
Default: |
out.table.format |
String. Output file format. Either comma separated
file |
context |
Numeric. Number of sentences extracted before and after the
sentence with the detected search word. If |
write.txt.doc.file |
Logical. If |
delete |
Logical. If |
verbose |
Logical. Indicates whether messages will be printed in the console. Default: |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Running a simple analysis with filter and search words to extract sentences
if(PDE_check_Xpdf_install() == TRUE){
outputtables <- PDE_pdfs2txt_searchandfilter(pdf = paste0(system.file(package = "PDE"),
"examples/Methotrexate/29973177_!.pdf"),
out = paste0(system.file(package = "PDE"),"/examples/MTX_txt+-0/"),
filter.words = strsplit("cohort;case-control;group;study population;study participants", ";")[[1]],
ignore.case.fw = TRUE,
search.words = strsplit("(M|m)ethotrexate;(T|t)rexal;(R|r)heumatrex;(O|o)trexup", ";")[[1]],
ignore.case.sw = FALSE)
}
## Running an advanced analysis with filter and search words to
## extract sentences and obtain documentation files
if(PDE_check_Xpdf_install() == TRUE){
outputtables <- PDE_pdfs2txt_searchandfilter(pdf = paste0(system.file(package = "PDE"),
"examples/Methotrexate/29973177_!.pdf"),
out = paste0(system.file(package = "PDE"),"/examples/MTX_txt+-1/"),
context = 1,
filter.words = strsplit("cohort;case-control;group;study population;study participants", ";")[[1]],
ignore.case.fw = TRUE,
filter.word.times = 20,
search.words = strsplit("(M|m)ethotrexate;(T|t)rexal;(R|r)heumatrex;(O|o)trexup", ";")[[1]],
ignore.case.sw = FALSE,
eval.abbrevs = TRUE,
out.table.format = ".csv (WINDOWS-1252)",
write.txt.doc.file = TRUE,
delete = TRUE)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.