<commit_before>package club.zhcs.titans.gather;

import java.util.ArrayList;
import java.util.List;

import org.hyperic.sigar.FileSystem;
import org.hyperic.sigar.FileSystemUsage;
import org.hyperic.sigar.Sigar;
import org.hyperic.sigar.SigarException;

/**
 * 磁盘信息收集器
 * 
 * @author wkipy
 *
 */
public class DISKGather {

	private String userHome = System.getProperty("user.home");;

	private String tempDir = System.getProperty("java.io.tmpdir");

	private FileSystem config;
	private FileSystemUsage stat;

	public void populate(Sigar sigar, FileSystem fs) throws SigarException {
		config = fs;
		try {
			stat = sigar.getFileSystemUsage(fs.getDirName());
		} catch (SigarException e) {

		}
	}

	public static List<DISKGather> gather(Sigar sigar) throws SigarException {
		FileSystem[] fsArr = sigar.getFileSystemList();
		List<DISKGather> fsList = new ArrayList<DISKGather>();
		for (FileSystem fs : fsArr) {
			DISKGather fsData = DISKGather.gather(sigar, fs);
			fsList.add(fsData);
		}
<commit_msg>只处理本地磁盘的情况<commit_after>package club.zhcs.titans.gather;

import java.util.ArrayList;
import java.util.List;

import org.hyperic.sigar.FileSystem;
import org.hyperic.sigar.FileSystemUsage;
import org.hyperic.sigar.Sigar;
import org.hyperic.sigar.SigarException;

/**
 * 磁盘信息收集器
 * 
 * @author wkipy
 *
 */
public class DISKGather {

	private String userHome = System.getProperty("user.home");;

	private String tempDir = System.getProperty("java.io.tmpdir");

	private FileSystem config;
	private FileSystemUsage stat;

	public void populate(Sigar sigar, FileSystem fs) throws SigarException {
		config = fs;
		try {
			stat = sigar.getFileSystemUsage(fs.getDirName());
		} catch (SigarException e) {

		}
	}

	public static List<DISKGather> gather(Sigar sigar) throws SigarException {
		FileSystem[] fsArr = sigar.getFileSystemList();
		List<DISKGather> fsList = new ArrayList<DISKGather>();
		for (FileSystem fs : fsArr) {
			if (fs.getType() == FileSystem.TYPE_LOCAL_DISK) {
				DISKGather fsData = DISKGather.gather(sigar, fs);
				fsList.add(fsData);
			}
		}

{'fraction_non_alphanumeric': 0.11673902556681139, 'fraction_numerical': 0.0, 'mean_word_length': 4.651226158038147, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '530412', 'n_tokens_mistral': 775, 'n_tokens_neox': 732, 'n_words': 149}