# Libraries to load here.
# library(knitr)
# library(kableExtra)

date <- Sys.Date()

header-includes: - \usepackage{titling} - \pretitle{\begin{center}\vspace{-1.3cm}\LARGE\includegraphics[width=5cm]{ONDRI_full-logo_web.png}\[\bigskipamount]\hfill\break} - \posttitle{\end{center}} - \preauthor{\begin{center} \vspace{0.3cm}} - \postauthor{\vspace{0.3cm} \end{center}} - \predate{\begin{center}} - \postdate{\[\bigskipamount] \vspace{0.3cm} \hrulefill \end{center} \vspace{0.6cm} r params$description} title: r params$title author: r params$author date: r date documentclass: article fontsize: 10pt geometry: margin=2.54cm


# copy the logo to the current directory
file.copy(report_path(), ".")
data <- similar_articles_df()[order(-similar_articles_df()$common_words_weighted),]
for (i in 1:length(data$proposal_title)){
   cat('\n')  
   cat("Proposal Title:", data$proposal_title[i], "\n")
   cat('\n') 
   cat('\n')  
   cat("Author:", data$author_of_proposal_title[i], "\n")
   cat('\n') 
   cat("Similar Proposal Title:", data$most_similar_proposal_title[i], "\n")
   cat('\n') 
   cat('\n')
   cat("Number of Common Words:", length(unlist(data$common_words_list[i])), "\n")
   cat('\n')
   if (length(data$common_words_weighted[i]) == 0) {
      cat('\n')
      cat("Similarity Indicator:","NOT SIMILAR", "\n")
      cat('\n')
   }
     else if (data$common_words_weighted[i] >= 1 & data$common_words_weighted[i] < 6) {
       cat('\n')
       cat("Similarity Indicator:","NOT VERY SIMILAR", "\n")
       cat('\n')
   }
     else if (data$common_words_weighted[i] >= 6 & data$common_words_weighted[i] < 10) {
       cat('\n')
       cat("Similarity Indicator:","SOME SIMILARITY", "\n")
       cat('\n')
   } else if (data$common_words_weighted[i] >= 10) {
       cat('\n')
       cat("Similarity Indicator:","SIMILAR", "\n")
       cat('\n')
   }
   cat("Author of Similar Proposal:", data$author_of_most_similar_proposal[i], "\n")
   cat('\n') 
   cat('\n')
   cat("Common Words List:", paste(unlist(data$common_words_list[i]), collapse=', '), '\n')
   cat('\n') 
   cat("---------------------------------------------------", '\n')
}


roblen001/document_similarity_checker documentation built on Aug. 14, 2022, 9:39 a.m.