<commit_before>package edu.mit.cci.wikilanguage.wiki

import edu.mit.cci.wikilanguage.db.DAO
import edu.mit.cci.wikilanguage.model.active.WikiArticle
import edu.mit.cci.util.U
import org.jsoup.nodes.Element
import edu.mit.cci.wiki.ArticleCache

/**
 * User: pdeboer
 * Date: 10/17/13
 * Time: 10:47 PM
 */
class PersonLinkProcessor(val personId: Int) {
	/**
	 * insert link into database to all people that already exist in database
	 * which this person is referencing
	 */
	def process() {
		println("started processing of " + personId)
		val person = DAO.personById(personId)
		val article = ArticleCache.get(personId, person.name, person.lang)
		article.likelyPersonOutlinks().foreach(l =>
			DAO.insertPeopleConnectionID(person.id, l, person.id, person.lang))
		new PersonLinkAnnotationProcessor().processPerson(person.id) //also annotate links
		println("ended processing of " + personId)
	}



}<commit_msg>directly annotate links on creation<commit_after>package edu.mit.cci.wikilanguage.wiki

import edu.mit.cci.wikilanguage.db.DAO
import edu.mit.cci.wikilanguage.model.active.WikiArticle
import edu.mit.cci.util.U
import org.jsoup.nodes.Element
import edu.mit.cci.wiki.ArticleCache

/**
 * User: pdeboer
 * Date: 10/17/13
 * Time: 10:47 PM
 */
class PersonLinkProcessor(val personId: Int) {
	/**
	 * insert link into database to all people that already exist in database
	 * which this person is referencing
	 */
	def process() {
		println("started processing of " + personId)
		val person = DAO.personById(personId)
		val article = ArticleCache.get(personId, person.name, person.lang)
		article.likelyPersonOutlinks().foreach(l =>
			DAO.insertPeopleConnectionID(person.id, l, person.id, person.lang))
		new PersonLinkAnnotationProcessor().processPerson(person.id) //also annotate links
		println("ended processing of " + personId)
	}

}
{'fraction_non_alphanumeric': 0.11471861471861472, 'fraction_numerical': 0.010822510822510822, 'mean_word_length': 4.519402985074627, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '7322336', 'n_tokens_mistral': 648, 'n_tokens_neox': 587, 'n_words': 140}