<commit_before>package imagej.tool.finder;

import imagej.tool.ITool;
import imagej.plugin.Menu;
import imagej.plugin.Plugin;
import imagej.plugin.api.MenuEntry;
import imagej.plugin.api.PluginEntry;

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

import net.java.sezpoz.Index;
import net.java.sezpoz.IndexItem;

public class SezpozToolFinder<T extends ITool>
{
	public void findPlugins(List<PluginEntry> plugins, Class<T> c)
        {
		// use SezPoz to discover available plugins
		for ( final IndexItem<Plugin, T> item :
			Index.load(Plugin.class, c))
		{
			final String pluginClass = item.className();
			final List<MenuEntry> menuPath = new ArrayList<MenuEntry>();

			// parse menu path from annotations
			final Menu[] menu = item.annotation().menu();
			if (menu.length > 0) {
				parseMenuPath(menuPath, menu);
			}
			else {
				// parse menuPath attribute
				final String path = item.annotation().menuPath();
				parseMenuPath(menuPath, path);
			}

			final PluginEntry pluginEntry = new PluginEntry( pluginClass, menuPath );
			plugins.add(pluginEntry);
		}
	}

	private void parseMenuPath( final List<MenuEntry> menuPath, final Menu[] menu )
	{
		for (int i = 0; i < menu.length; i++)
                {
			final String name = menu[i].label();
			final double weight = menu[i].weight();
			final char mnemonic = menu[i].mnemonic();
			final String accelerator = menu[i].accelerator();
			final String icon = menu[i].icon();				
			menuPath.add(new MenuEntry(name, weight, mnemonic, accelerator, icon));
		}
	}

	private void parseMenuPath(final List<MenuEntry> menuPath,
		final String path)
	{
		final String[] menuPathTokens = path.split(">");
		for (String token : menuPathTokens) menuPath.add(new MenuEntry(token));
	}

}<commit_msg>Started adding the ITool java files<commit_after>package imagej.tool.finder;

import imagej.tool.ITool;
import imagej.plugin.Menu;
import imagej.plugin.Plugin;
import imagej.plugin.api.MenuEntry;
import imagej.plugin.api.PluginEntry;

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

import net.java.sezpoz.Index;
import net.java.sezpoz.IndexItem;

public class SezpozToolFinder<T extends ITool>
{
//	public void findPlugins(List<PluginEntry> plugins, Class<T> c)
//        {
//		// use SezPoz to discover available plugins
//		for ( final IndexItem<Plugin, T> item :
//			Index.load(Plugin.class, c))
//		{
//			final String pluginClass = item.className();
//			final List<MenuEntry> menuPath = new ArrayList<MenuEntry>();
//
//			// parse menu path from annotations
//			final Menu[] menu = item.annotation().menu();
//			if (menu.length > 0) {
//				parseMenuPath(menuPath, menu);
//			}
//			else {
//				// parse menuPath attribute
//				final String path = item.annotation().menuPath();
//				parseMenuPath(menuPath, path);
//			}
//
//			final PluginEntry pluginEntry = new PluginEntry( pluginClass, menuPath );
//			plugins.add(pluginEntry);
//		}
//	}
//
//	private void parseMenuPath( final List<MenuEntry> menuPath, final Menu[] menu )
//	{
//		for (int i = 0; i < menu.length; i++)
//                {
//			final String name = menu[i].label();
//			final double weight = menu[i].weight();
//			final char mnemonic = menu[i].mnemonic();
//			final String accelerator = menu[i].accelerator();
//			final String icon = menu[i].icon();
//			menuPath.add(new MenuEntry(name, weight, mnemonic, accelerator, icon));
//		}
//	}
//
//	private void parseMenuPath(final List<MenuEntry> menuPath,
//		final String path)
//	{
//		final String[] menuPathTokens = path.split(">");
//		for (String token : menuPathTokens) menuPath.add(new MenuEntry(token));
//	}

}
{'fraction_non_alphanumeric': 0.1435670900055218, 'fraction_numerical': 0.0011043622308117063, 'mean_word_length': 3.4728395061728397, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, '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': '679645', 'n_tokens_mistral': 1298, 'n_tokens_neox': 1193, 'n_words': 295}