<commit_before>package test.examples.pubmed;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import main.database.dao.ArticleDao;
import main.database.dao.IdentityDegree;
import main.database.dao.IdentityDegreeDao;
import main.reciter.algorithm.cluster.ReCiterClusterer;
import main.reciter.lucene.DocumentIndexReader;
import main.reciter.lucene.DocumentIndexWriter;
import main.reciter.lucene.DocumentTranslator;
import main.reciter.model.article.ReCiterArticle;
import main.reciter.model.article.ReCiterArticleCoAuthors;
import main.reciter.model.article.ReCiterArticleKeywords;
import main.reciter.model.author.AuthorAffiliation;
import main.reciter.model.author.AuthorName;
import main.reciter.model.author.ReCiterAuthor;
import main.reciter.model.author.TargetAuthor;
import main.reciter.utils.Analysis;
import main.reciter.utils.AnalysisCSVWriter;
import main.reciter.utils.AnalysisObject;
import main.reciter.utils.ReCiterConfigProperty;
import main.reciter.utils.YearDiscrepacyReader;
import main.xml.pubmed.PubmedXmlFetcher;
import main.xml.pubmed.model.MedlineCitationArticleAuthor;
import main.xml.pubmed.model.PubmedArticle;
import main.xml.scopus.ScopusXmlFetcher;
import main.xml.scopus.model.ScopusEntry;
import main.xml.translator.ArticleTranslator;

import org.apache.lucene.document.Document;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ReCiterExampleTest {

	private final static Logger slf4jLogger = LoggerFactory.getLogger(ReCiterExampleTest.class);

	public static double totalPrecision = 0;
	public static double totalRecall = 0;
	public static int numCwids = 0;
	public static void main(String[] args) throws IOException {

		// Keep track of exeuction time of ReCiter.
		long startTime = System.currentTimeMillis();
		Files.walk(Paths.get("data/test_xml")).forEach(filePath -> {
			if (Files.isRegularFile(filePath)) {
				String cwid = filePath.getFileName().toString().replace(".xml", "");
				ReCiterConfigProperty reCiterConfigProperty = new ReCiterConfigProperty();
				try {
					reCiterConfigProperty.loadProperty("data/properties/" + cwid + "/" + cwid + ".properties");
				} catch (Exception e) {
					e.printStackTrace();
				}<commit_msg>Updated directory traversal.<commit_after>package test.examples.pubmed;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import main.database.dao.ArticleDao;
import main.database.dao.IdentityDegree;
import main.database.dao.IdentityDegreeDao;
import main.reciter.algorithm.cluster.ReCiterClusterer;
import main.reciter.lucene.DocumentIndexReader;
import main.reciter.lucene.DocumentIndexWriter;
import main.reciter.lucene.DocumentTranslator;
import main.reciter.model.article.ReCiterArticle;
import main.reciter.model.article.ReCiterArticleCoAuthors;
import main.reciter.model.article.ReCiterArticleKeywords;
import main.reciter.model.author.AuthorAffiliation;
import main.reciter.model.author.AuthorName;
import main.reciter.model.author.ReCiterAuthor;
import main.reciter.model.author.TargetAuthor;
import main.reciter.utils.Analysis;
import main.reciter.utils.AnalysisCSVWriter;
import main.reciter.utils.AnalysisObject;
import main.reciter.utils.ReCiterConfigProperty;
import main.reciter.utils.YearDiscrepacyReader;
import main.xml.pubmed.PubmedXmlFetcher;
import main.xml.pubmed.model.MedlineCitationArticleAuthor;
import main.xml.pubmed.model.PubmedArticle;
import main.xml.scopus.ScopusXmlFetcher;
import main.xml.scopus.model.ScopusEntry;
import main.xml.translator.ArticleTranslator;

import org.apache.lucene.document.Document;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ReCiterExampleTest {

	private final static Logger slf4jLogger = LoggerFactory.getLogger(ReCiterExampleTest.class);

	public static double totalPrecision = 0;
	public static double totalRecall = 0;
	public static int numCwids = 0;
	public static void main(String[] args) throws IOException {

		// Keep track of exeuction time of ReCiter.
		long startTime = System.currentTimeMillis();
		Files.walk(Paths.get("data/xml")).forEach(filePath -> {
			if (Files.isRegularFile(filePath)) {
				String cwid = filePath.getFileName().toString().replace("_0.xml", "");
				ReCiterConfigProperty reCiterConfigProperty = new ReCiterConfigProperty();
				try {	
					reCiterConfigProperty.loadProperty("data/properties/" + cwid + "/" + cwid + ".properties");
				} catch (Exception e) {
					e.printStackTrace();
				}
{'fraction_non_alphanumeric': 0.10536198622991863, 'fraction_numerical': 0.002712288754433549, 'mean_word_length': 5.858369098712446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2552277', 'n_tokens_mistral': 1586, 'n_tokens_neox': 1494, 'n_words': 274}