<commit_before>﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using GitDepend.Configuration;

namespace GitDepend.Visitors
{
	public class BuildAndUpdateDependenciesVisitor : IVisitor
	{
		private static readonly Regex Pattern = new Regex(@"^(?<id>.*?)\.(?<version>(?:\d\.){2,3}\d(?:-.*?)?)$", RegexOptions.Compiled);

		private string CacheDirectory
		{
			get
			{
				var location = Assembly.GetEntryAssembly().Location;
				var dir = Path.GetDirectoryName(location);

				if (dir == null)
				{
					return null;
				}

				var cacheDir = Path.Combine(dir, "cache");
				if (Directory.Exists(cacheDir))
				{
					return cacheDir;<commit_msg>Moves the cache folder to ApplicationData<commit_after>﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using GitDepend.Configuration;

namespace GitDepend.Visitors
{
	public class BuildAndUpdateDependenciesVisitor : IVisitor
	{
		private static readonly Regex Pattern = new Regex(@"^(?<id>.*?)\.(?<version>(?:\d\.){2,3}\d(?:-.*?)?)$", RegexOptions.Compiled);

		private string CacheDirectory
		{
			get
			{
				var dir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "GitDepend");

				var cacheDir = Path.Combine(dir, "cache");
				if (Directory.Exists(cacheDir))
				{
					return cacheDir;
{'fraction_non_alphanumeric': 0.1333743085433313, 'fraction_numerical': 0.002458512599877074, 'mean_word_length': 4.652777777777778, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2010042', 'n_tokens_mistral': 561, 'n_tokens_neox': 489, 'n_words': 111}