<commit_before>package de.slikey.effectlib.util;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import org.bukkit.Location;
import org.bukkit.entity.Player;

import de.slikey.effectlib.util.ReflectionHandler.PackageType;
import de.slikey.effectlib.util.ReflectionHandler.PacketType;
import de.slikey.effectlib.util.ReflectionHandler.SubPackageType;

/**
 * ParticleEffect Library v1.4
 * 
 * This library was created by @DarkBlade12 based on content related to
 * particles of @microgeek (names and packet values), it allows you to display
 * all Minecraft particle effects on a Bukkit server
 * 
 * You are welcome to use it, modify it and redistribute it under the following
 * conditions: 1. Don't claim this class as your own 2. Don't remove this text
 * 
 * (Would be nice if you provide credit to me)
 * 
 * @author DarkBlade12
 * @changed Slikey
 */
public enum ParticleEffect {
	/**
	 * @appearance Huge explosions
	 * @displayed by TNT and creepers
	 */
	HUGE_EXPLOSION("hugeexplosion"),
	/**
	 * @appearance Smaller explosions
	 * @displayed by TNT and creepers
	 */
	LARGE_EXPLODE("largeexplode"),
	/**
	 * @appearance Little white sparkling stars
	 * @displayed by Fireworks
	 */
	FIREWORKS_SPARK("fireworksSpark"),
	/**
	 * @appearance Bubbles
	 * @displayed in water
	 */
	BUBBLE("bubble"),
	/**
	 * @appearance Unknown
	 */
	SUSPEND("suspend"),
	/**
	 * @appearance Little gray dots
	 * @displayed in the Void and water
	 */
	DEPTH_SUSPEND("depthSuspend"),
	/**
	 * @appearance Little gray dots
	 * @displayed by Mycelium
	 */
	TOWN_AURA("townaura"),
	/**
	 * @appearance Light brown crosses
	 * @displayed by critical hits
	 */
	CRIT("crit"),
	/**
	 * @appearance Cyan stars
	 * @displayed by hits with an enchanted weapon
	 */
	MAGIC_CRIT("magicCrit"),
	/**
	 * @appearance Little black/gray clouds
	 * @displayed by torches, primed TNT and end portals
	 */
	SMOKE("smoke"),
	/**
	 * @appearance Colored swirls
	 * @displayed by potion effects
	 */
	MOB_SPELL("mobSpell"),
	/**
	 * @appearance Transparent colored swirls
	 * @displayed by beacon effect
	 */
	MOB_SPELL_AMBIENT("mobSpellAmbient"),
	/**
	 * @appearance Colored swirls
	 * @displayed by splash potions
	 */
	SPELL("spell"),
	/**
	 * @appearance Colored crosses
	 * @displayed by instant splash potions (instant health/instant damage)
	 */
	INSTANT_SPELL("instantSpell"),
	/**
	 * @appearance Colored crosses
	 * @displayed by witches
	 */
	WITCH_MAGIC("witchMagic"),
	/**
	 * @appearance Colored notes
	 * @displayed by note blocks
	 */
	NOTE("note"),
	/**
	 * @appearance Little purple clouds
	 * @displayed by nether portals, endermen, ender pearls, eyes of ender and
	 *            ender chests
	 */
	PORTAL("portal"),
	/**
	 * @appearance: White letters
	 * @displayed by enchantment tables that are near bookshelves
	 */
	ENCHANTMENT_TABLE("enchantmenttable"),
	/**
	 * @appearance White clouds
	 */
	EXPLODE("explode"),
	/**
	 * @appearance Little flames
	 * @displayed by torches, furnaces, magma cubes and monster spawners
	 */
	FLAME("flame"),
	/**
	 * @appearance Little orange blobs
	 * @displayed by lava
	 */
	LAVA("lava"),
	/**
	 * @appearance Gray transparent squares
	 */
	FOOTSTEP("footstep"),
	/**
	 * @appearance Blue drops
	 * @displayed by water, rain and shaking wolves
	 */
	SPLASH("splash"),
	/**
	 * @appearance Blue droplets
	 * @displayed on water when fishing
	 */
	WAKE("wake"),
	/**
	 * @appearance Black/Gray clouds
	 * @displayed by fire, minecarts with furance and blazes
	 */
	LARGE_SMOKE("largesmoke"),
	/**
	 * @appearance Large white clouds
	 * @displayed on mob death
	 */
	CLOUD("cloud"),
	/**
	 * @appearance Little colored clouds
	 * @displayed by active redstone wires and redstone torches
	 */
	RED_DUST("reddust"),
	/**
	 * @appearance Little white parts
	 * @displayed by cracking snowballs and eggs
	 */
	SNOWBALL_POOF("snowballpoof"),
	/**
	 * @appearance Blue drips
	 * @displayed by blocks below a water source
	 */
	DRIP_WATER("dripWater"),
	/**
	 * @appearance Orange drips
	 * @displayed by blocks below a lava source
	 */
	DRIP_LAVA("dripLava"),
	/**
	 * @appearance White clouds
	 */
	SNOW_SHOVEL("snowshovel"),
	/**
	 * @appearance Little green parts
	 * @displayed by slimes
	 */
	SLIME("slime"),
	/**
	 * @appearance Red hearts
	 * @displayed when breeding
	 */
	HEART("heart"),
	/**
	 * @appearance Dark gray cracked hearts
	 * @displayed when attacking a villager in a village
	 */
	ANGRY_VILLAGER("angryVillager"),
	/**
	 * @appearance Green stars
	 * @displayed by bone meal and when trading with a villager
	 */
	HAPPY_VILLAGER("happyVillager"),
    /**
     * @version 1.8
     * @appearance "No" Sign
     * @displayed by barrier blocks
     */
    BARRIER("barrier"),
    /**
     * @version 1.8
     * @appearance Droplets
     * @displayed ?
     */
    DROPLET("droplet"),
    /**
     * @version 1.8
     * @appearance Take
     * @displayed ?
     */
    TAKE("take"),
    /**
     * @version 1.8
     * @appearance Mob appearance
     * @displayed The appearance of elder guardians
     */
    MOB_APPEARANCE("mobappearance"),

    ICON_CRACK("iconcrack_{subtype}"),
    BLOCK_CRACK("blockcrack_{subtype}"),
    TILE_CRACK("tilecrack_{subtype}");

	private static final Map<String, ParticleEffect> NAME_MAP = new HashMap<String, ParticleEffect>();
	private static final double MAX_RANGE = 50;
	private static Constructor<?> packetPlayOutWorldParticles;
	private static Class<?> classEnumParticle;
    private static boolean legacy = false;
	private static Method getHandle;
	private static Method getEnumParticle;
	private static Field playerConnection;
	private static Method sendPacket;
	private final String name;

	static {
		for (ParticleEffect p : values())
			NAME_MAP.put(p.name, p);
		try {
			classEnumParticle = ReflectionHandler.getClass("EnumParticle", PackageType.MINECRAFT_SERVER);
			getEnumParticle = classEnumParticle.getMethod("a", Integer.TYPE);
			packetPlayOutWorldParticles = ReflectionHandler.getConstructor(PacketType.PLAY_OUT_WORLD_PARTICLES.getPacket(), String.class, float.class, float.class, float.class, float.class, float.class, float.class, float.class, int.class);
			// 1.6 Backwards compatibility
            if (packetPlayOutWorldParticles == null) {
                packetPlayOutWorldParticles = ReflectionHandler.getConstructor(PacketType.PLAY_OUT_WORLD_PARTICLES.getPacket());
                legacy = true;
            }
            getHandle = ReflectionHandler.getMethod("CraftPlayer", SubPackageType.ENTITY, "getHandle");
			playerConnection = ReflectionHandler.getField("EntityPlayer", PackageType.MINECRAFT_SERVER, "playerConnection");
			sendPacket = ReflectionHandler.getMethod(playerConnection.getType(), "sendPacket", ReflectionHandler.getClass("Packet", PackageType.MINECRAFT_SERVER));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * @param name
	 *            Name of this particle effect
	 */
	private ParticleEffect(String name) {
		this.name = name;
	}

	/**
	 * @return The name of this particle effect
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * Gets a particle effect from name
	 * 
	 * @param name
	 *            Name of the particle effect
	 * @return The particle effect
	 */
	public static ParticleEffect fromName(String name) {
		if (name != null)
			for (Entry<String, ParticleEffect> e : NAME_MAP.entrySet())
				if (e.getKey().equalsIgnoreCase(name))
					return e.getValue();
		return null;
	}

	/**
	 * Gets a list of players in a certain range
	 * 
	 * @param center
	 *            Center location
	 * @param range
	 *            Range
	 * @return The list of players in the specified range
	 */
	private static List<Player> getPlayers(Location center, double range) {
		List<Player> players = new ArrayList<Player>();
		double squared = range * range;
		for (Player p : center.getWorld().getPlayers())
			if (p.getLocation().distanceSquared(center) <= squared)
				players.add(p);
		return players;
	}

	/**
	 * Instantiates a new @PacketPlayOutWorldParticles object through reflection
	 *
	 * @param center
	 *            Center location of the effect
	 * @param offsetX
	 *            Maximum distance particles can fly away from the center on the
	 *            x-axis
	 * @param offsetY
	 *            Maximum distance particles can fly away from the center on the
	 *            y-axis
	 * @param offsetZ
	 *            Maximum distance particles can fly away from the center on the
	 *            z-axis
	 * @param speed
	 *            Display speed of the particles
	 * @param amount
	 *            Amount of particles
	 * @return The packet object
	 * @throws #PacketInstantiationException if the amount is lower than 1 or if
	 *         the @PacketPlayOutWorldParticles has changed its name or
	 *         constructor parameters
	 */
	private Object instantiatePacket(Location center, float offsetX, float offsetY, float offsetZ, float speed, int amount) {
		if (amount < 1)
			amount = 1;
		try {
            if (legacy) {
                // This is really slow, but only here for backwards compatibility.
                Object packet = packetPlayOutWorldParticles.newInstance();
                for (Field field : packet.getClass().getDeclaredFields())
                {
                    field.setAccessible(true);
                    String fieldName = field.getName();
                    if (fieldName.equals("a")) {
                        field.set(packet, getEnumParticle.invoke(null, ordinal()));
                    } else if (fieldName.equals("b")) {
                        field.setFloat(packet, (float)center.getX());
                    } else if (fieldName.equals("c")) {
                        field.setFloat(packet, (float)center.getY());
                    } else if (fieldName.equals("d")) {
                        field.setFloat(packet, (float)center.getZ());
                    } else if (fieldName.equals("e")) {
                        field.setFloat(packet, offsetX);
                    } else if (fieldName.equals("f")) {
                        field.setFloat(packet, offsetY);
                    } else if (fieldName.equals("g")) {
                        field.setFloat(packet, offsetZ);
                    } else if (fieldName.equals("h")) {
                        field.setFloat(packet, speed);
                    } else if (fieldName.equals("i")) {
                        field.setInt(packet, amount);
                    }
                }

                return packet;
            }
			return packetPlayOutWorldParticles.newInstance(name, (float) center.getX(), (float) center.getY(), (float) center.getZ(), offsetX, offsetY, offsetZ, speed, amount);
		} catch (Exception e) {
			throw new PacketInstantiationException("Packet instantiation failed", e);
		}
	}

	/**
	 * Instantiates a new @PacketPlayOutWorldParticles object through reflection
	 * especially for the "iconcrack" effect
	 * 
	 * @param id
	 *            Id of the icon
	 * @param offsetX
	 *            Maximum distance particles can fly away from the center on the
	 *            x-axis
	 * @param offsetY
	 *            Maximum distance particles can fly away from the center on the
	 *            y-axis
	 * @param offsetZ
	 *            Maximum distance particles can fly away from the center on the<commit_msg>Fix 1.8 support and add backwards-compatibility.<commit_after>package de.slikey.effectlib.util;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;

import de.slikey.effectlib.util.ReflectionHandler.PackageType;
import de.slikey.effectlib.util.ReflectionHandler.PacketType;
import de.slikey.effectlib.util.ReflectionHandler.SubPackageType;

/**
 * ParticleEffect Library v1.4
 * 
 * This library was created by @DarkBlade12 based on content related to
 * particles of @microgeek (names and packet values), it allows you to display
 * all Minecraft particle effects on a Bukkit server
 * 
 * You are welcome to use it, modify it and redistribute it under the following
 * conditions: 1. Don't claim this class as your own 2. Don't remove this text
 * 
 * (Would be nice if you provide credit to me)
 * 
 * @author DarkBlade12
 * @changed Slikey
 */
public enum ParticleEffect {
	/**
	 * @appearance Huge explosions
	 * @displayed by TNT and creepers
	 */
	HUGE_EXPLOSION("hugeexplosion"),
	/**
	 * @appearance Smaller explosions
	 * @displayed by TNT and creepers
	 */
	LARGE_EXPLODE("largeexplode"),
	/**
	 * @appearance Little white sparkling stars
	 * @displayed by Fireworks
	 */
	FIREWORKS_SPARK("fireworksSpark"),
	/**
	 * @appearance Bubbles
	 * @displayed in water
	 */
	BUBBLE("bubble"),
	/**
	 * @appearance Unknown
	 */
	SUSPEND("suspend"),
	/**
	 * @appearance Little gray dots
	 * @displayed in the Void and water
	 */
	DEPTH_SUSPEND("depthSuspend"),
	/**
	 * @appearance Little gray dots
	 * @displayed by Mycelium
	 */
	TOWN_AURA("townaura"),
	/**
	 * @appearance Light brown crosses
	 * @displayed by critical hits
	 */
	CRIT("crit"),
	/**
	 * @appearance Cyan stars
	 * @displayed by hits with an enchanted weapon
	 */
	MAGIC_CRIT("magicCrit"),
	/**
	 * @appearance Little black/gray clouds
	 * @displayed by torches, primed TNT and end portals
	 */
	SMOKE("smoke"),
	/**
	 * @appearance Colored swirls
	 * @displayed by potion effects
	 */
	MOB_SPELL("mobSpell"),
	/**
	 * @appearance Transparent colored swirls
	 * @displayed by beacon effect
	 */
	MOB_SPELL_AMBIENT("mobSpellAmbient"),
	/**
	 * @appearance Colored swirls
	 * @displayed by splash potions
	 */
	SPELL("spell"),
	/**
	 * @appearance Colored crosses
	 * @displayed by instant splash potions (instant health/instant damage)
	 */
	INSTANT_SPELL("instantSpell"),
	/**
	 * @appearance Colored crosses
	 * @displayed by witches
	 */
	WITCH_MAGIC("witchMagic"),
	/**
	 * @appearance Colored notes
	 * @displayed by note blocks
	 */
	NOTE("note"),
	/**
	 * @appearance Little purple clouds
	 * @displayed by nether portals, endermen, ender pearls, eyes of ender and
	 *            ender chests
	 */
	PORTAL("portal"),
	/**
	 * @appearance: White letters
	 * @displayed by enchantment tables that are near bookshelves
	 */
	ENCHANTMENT_TABLE("enchantmenttable"),
	/**
	 * @appearance White clouds
	 */
	EXPLODE("explode"),
	/**
	 * @appearance Little flames
	 * @displayed by torches, furnaces, magma cubes and monster spawners
	 */
	FLAME("flame"),
	/**
	 * @appearance Little orange blobs
	 * @displayed by lava
	 */
	LAVA("lava"),
	/**
	 * @appearance Gray transparent squares
	 */
	FOOTSTEP("footstep"),
	/**
	 * @appearance Blue drops
	 * @displayed by water, rain and shaking wolves
	 */
	SPLASH("splash"),
	/**
	 * @appearance Blue droplets
	 * @displayed on water when fishing
	 */
	WAKE("wake"),
	/**
	 * @appearance Black/Gray clouds
	 * @displayed by fire, minecarts with furance and blazes
	 */
	LARGE_SMOKE("largesmoke"),
	/**
	 * @appearance Large white clouds
	 * @displayed on mob death
	 */
	CLOUD("cloud"),
	/**
	 * @appearance Little colored clouds
	 * @displayed by active redstone wires and redstone torches
	 */
	RED_DUST("reddust"),
	/**
	 * @appearance Little white parts
	 * @displayed by cracking snowballs and eggs
	 */
	SNOWBALL_POOF("snowballpoof"),
	/**
	 * @appearance Blue drips
	 * @displayed by blocks below a water source
	 */
	DRIP_WATER("dripWater"),
	/**
	 * @appearance Orange drips
	 * @displayed by blocks below a lava source
	 */
	DRIP_LAVA("dripLava"),
	/**
	 * @appearance White clouds
	 */
	SNOW_SHOVEL("snowshovel"),
	/**
	 * @appearance Little green parts
	 * @displayed by slimes
	 */
	SLIME("slime"),
	/**
	 * @appearance Red hearts
	 * @displayed when breeding
	 */
	HEART("heart"),
	/**
	 * @appearance Dark gray cracked hearts
	 * @displayed when attacking a villager in a village
	 */
	ANGRY_VILLAGER("angryVillager"),
	/**
	 * @appearance Green stars
	 * @displayed by bone meal and when trading with a villager
	 */
	HAPPY_VILLAGER("happyVillager"),
    /**
     * @version 1.8
     * @appearance "No" Sign
     * @displayed by barrier blocks
     */
    BARRIER("barrier"),
    /**
     * @version 1.8
     * @appearance Droplets
     * @displayed ?
     */
    DROPLET("droplet"),
    /**
     * @version 1.8
     * @appearance Take
     * @displayed ?
     */
    TAKE("take"),
    /**
     * @version 1.8
     * @appearance Mob appearance
     * @displayed The appearance of elder guardians
     */
    MOB_APPEARANCE("mobappearance"),

    ICON_CRACK("iconcrack_{subtype}"),
    BLOCK_CRACK("blockcrack_{subtype}"),
    TILE_CRACK("tilecrack_{subtype}");

	private static final Map<String, ParticleEffect> NAME_MAP = new HashMap<String, ParticleEffect>();
	private static final Map<String, Object> PARTICLE_ENUM_MAP = new HashMap<String, Object>();
	private static final double MAX_RANGE = 50;
	private static Constructor<?> packetPlayOutWorldParticles;
    private static boolean legacy = false;
	private static Method getHandle;
	private static Field playerConnection;
	private static Method sendPacket;
	private final String name;

	static {
		try {
			packetPlayOutWorldParticles = ReflectionHandler.getConstructor(PacketType.PLAY_OUT_WORLD_PARTICLES.getPacket(), String.class, float.class, float.class, float.class, float.class, float.class, float.class, float.class, int.class);
			// 1.6 Backwards compatibility
            if (packetPlayOutWorldParticles == null) {
                packetPlayOutWorldParticles = ReflectionHandler.getConstructor(PacketType.PLAY_OUT_WORLD_PARTICLES.getPacket());
                legacy = true;
            }
            getHandle = ReflectionHandler.getMethod("CraftPlayer", SubPackageType.ENTITY, "getHandle");
			playerConnection = ReflectionHandler.getField("EntityPlayer", PackageType.MINECRAFT_SERVER, "playerConnection");
			sendPacket = ReflectionHandler.getMethod(playerConnection.getType(), "sendPacket", ReflectionHandler.getClass("Packet", PackageType.MINECRAFT_SERVER));

			// 1.8 Support with backwards compatibility
			Class<?> classEnumParticle = ReflectionHandler.getClass("EnumParticle", PackageType.MINECRAFT_SERVER);
			Method getNameMethod = classEnumParticle.getMethod("b");
			Object[] particleEnums = classEnumParticle.getEnumConstants();
			for (Object particle : particleEnums)
			{
				String name = (String)getNameMethod.invoke(particle);
				PARTICLE_ENUM_MAP.put(name, particle);
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
		for (ParticleEffect p : values()) {
			NAME_MAP.put(p.name, p);

			// Bind to EnumParticle class

		}
	}

	/**
	 * @param name
	 *            Name of this particle effect
	 */
	private ParticleEffect(String name) {
		this.name = name;
	}

	/**
	 * @return The name of this particle effect
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * Gets a particle effect from name
	 * 
	 * @param name
	 *            Name of the particle effect
	 * @return The particle effect
	 */
	public static ParticleEffect fromName(String name) {
		if (name != null)
			for (Entry<String, ParticleEffect> e : NAME_MAP.entrySet())
				if (e.getKey().equalsIgnoreCase(name))
					return e.getValue();
		return null;
	}

	/**
	 * Gets a list of players in a certain range
	 * 
	 * @param center
	 *            Center location
	 * @param range
	 *            Range
	 * @return The list of players in the specified range
	 */
	private static List<Player> getPlayers(Location center, double range) {
		List<Player> players = new ArrayList<Player>();
		double squared = range * range;
		for (Player p : center.getWorld().getPlayers())
			if (p.getLocation().distanceSquared(center) <= squared)
				players.add(p);
		return players;
	}

	/**
	 * Instantiates a new @PacketPlayOutWorldParticles object through reflection
	 *
	 * @param center
	 *            Center location of the effect
	 * @param offsetX
	 *            Maximum distance particles can fly away from the center on the
	 *            x-axis
	 * @param offsetY
	 *            Maximum distance particles can fly away from the center on the
	 *            y-axis
	 * @param offsetZ
	 *            Maximum distance particles can fly away from the center on the
	 *            z-axis
	 * @param speed
	 *            Display speed of the particles
	 * @param amount
	 *            Amount of particles
	 * @return The packet object
	 * @throws #PacketInstantiationException if the amount is lower than 1 or if
	 *         the @PacketPlayOutWorldParticles has changed its name or
	 *         constructor parameters
	 */
	private Object instantiatePacket(Location center, float offsetX, float offsetY, float offsetZ, float speed, int amount) {
		if (amount < 1)
			amount = 1;
		try {
			Object particleType = PARTICLE_ENUM_MAP.get(name);
			if (particleType == null)
			{
				particleType = name;
			}
            if (legacy) {
                // This is really slow, but only here for backwards compatibility.
                Object packet = packetPlayOutWorldParticles.newInstance();
                for (Field field : packet.getClass().getDeclaredFields())
                {
                    field.setAccessible(true);
                    String fieldName = field.getName();
                    if (fieldName.equals("a")) {
						field.set(packet, particleType);
                    } else if (fieldName.equals("b")) {
                        field.setFloat(packet, (float)center.getX());
                    } else if (fieldName.equals("c")) {
                        field.setFloat(packet, (float)center.getY());
                    } else if (fieldName.equals("d")) {
                        field.setFloat(packet, (float)center.getZ());
                    } else if (fieldName.equals("e")) {
                        field.setFloat(packet, offsetX);
                    } else if (fieldName.equals("f")) {
                        field.setFloat(packet, offsetY);
                    } else if (fieldName.equals("g")) {
                        field.setFloat(packet, offsetZ);
                    } else if (fieldName.equals("h")) {
                        field.setFloat(packet, speed);
                    } else if (fieldName.equals("i")) {
                        field.setInt(packet, amount);
                    }
                }

                return packet;
            }
			return packetPlayOutWorldParticles.newInstance(particleType, (float) center.getX(), (float) center.getY(), (float) center.getZ(), offsetX, offsetY, offsetZ, speed, amount);
		} catch (Exception e) {
			throw new PacketInstantiationException("Packet instantiation failed for " + name, e);
		}
	}

	/**
	 * Instantiates a new @PacketPlayOutWorldParticles object through reflection
	 * especially for the "iconcrack" effect
	 * 
	 * @param id
	 *            Id of the icon
	 * @param offsetX
	 *            Maximum distance particles can fly away from the center on the
	 *            x-axis
	 * @param offsetY
	 *            Maximum distance particles can fly away from the center on the
	 *            y-axis
	 * @param offsetZ
	 *            Maximum distance particles can fly away from the center on the
{'fraction_non_alphanumeric': 0.11042241562300997, 'fraction_numerical': 0.0021226915729144554, 'mean_word_length': 2.828998699609883, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 21, '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': '7318541', 'n_tokens_mistral': 7467, 'n_tokens_neox': 6771, 'n_words': 1946}