<commit_before>package com.dianping.cat.report.page;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

import com.google.gson.Gson;

public class PieChart {

	private List<Item> items = new ArrayList<Item>();

	public PieChart() {
	}

	public List<Item> getItems() {
		return items;
	}

	public String getJsonString() {
		return new Gson().toJson(this);
	}

	public void addItems(List<Item> items) {
		Collections.sort(items, new ItemCompartor());
		int size = items.size();
		int maxSize = 10;

		if (size <= maxSize) {
			this.items = items;
		} else {
			for (int i = 0; i < maxSize; i++) {
				this.items.add(items.get(i));
			}
			Item item = new Item();
			item.setTitle("Other");
			double sum = 0;
			for (int i = maxSize; i < size; i++) {
				Item temp = items.get(i);
				sum += temp.getNumber();
			}
			item.setNumber(sum);
			this.items.add(item);
		}
	}

	public static class Item {
		private String title;

		private double number;
<commit_msg>modify the field name<commit_after>package com.dianping.cat.report.page;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

import com.google.gson.Gson;

public class PieChart {

	private List<Item> items = new ArrayList<Item>();

	public PieChart() {
	}

	public List<Item> getItems() {
		return items;
	}

	public String getJsonString() {
		return new Gson().toJson(this);
	}

	public void addItems(List<Item> temps) {
		Collections.sort(temps, new ItemCompartor());
		int size = temps.size();
		int maxSize = 10;

		if (size <= maxSize) {
			this.items = temps;
		} else {
			for (int i = 0; i < maxSize; i++) {
				this.items.add(temps.get(i));
			}
			Item item = new Item();
			item.setTitle("Other");
			double sum = 0;
			for (int i = maxSize; i < size; i++) {
				Item temp = temps.get(i);
				sum += temp.getNumber();
			}
			item.setNumber(sum);
			this.items.add(item);
		}
	}

	public static class Item {
		private String title;

		private double number;

{'fraction_non_alphanumeric': 0.144390243902439, 'fraction_numerical': 0.003902439024390244, 'mean_word_length': 3.3453389830508473, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 11, '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': '4555154', 'n_tokens_mistral': 817, 'n_tokens_neox': 712, 'n_words': 187}