<commit_before>package org.apache.solr.spelling;
/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.util.LinkedHashMap;
import java.util.Map;

import org.apache.lucene.analysis.Token;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.spelling.PossibilityIterator;
import org.junit.BeforeClass;
import org.junit.Test;

public class SpellPossibilityIteratorTest extends SolrTestCaseJ4 {

	private static Map<Token, LinkedHashMap<String, Integer>> suggestions = new LinkedHashMap<Token, LinkedHashMap<String, Integer>>();

	@BeforeClass
	public static void beforeClass() throws Exception {

		suggestions.clear();

		LinkedHashMap<String, Integer> AYE = new LinkedHashMap<String, Integer>();
		AYE.put("I", 0);
		AYE.put("II", 0);
		AYE.put("III", 0);
		AYE.put("IV", 0);
		AYE.put("V", 0);
		AYE.put("VI", 0);
		AYE.put("VII", 0);
		AYE.put("VIII", 0);
		
		LinkedHashMap<String, Integer> BEE = new LinkedHashMap<String, Integer>();
		BEE.put("alpha", 0);
		BEE.put("beta", 0);
		BEE.put("gamma", 0);
		BEE.put("delta", 0);
		BEE.put("epsilon", 0);
		BEE.put("zeta", 0);
		BEE.put("eta", 0);
		BEE.put("theta", 0);
		BEE.put("iota", 0);
		

		LinkedHashMap<String, Integer> CEE = new LinkedHashMap<String, Integer>();
		CEE.put("one", 0);
		CEE.put("two", 0);
		CEE.put("three", 0);
		CEE.put("four", 0);
		CEE.put("five", 0);
		CEE.put("six", 0);
		CEE.put("seven", 0);
		CEE.put("eight", 0);
		CEE.put("nine", 0);
		CEE.put("ten", 0);

		suggestions.put(new Token("AYE", 0, 2), AYE);
		suggestions.put(new Token("BEE", 0, 2), BEE);
		suggestions.put(new Token("CEE", 0, 2), CEE);
	}

	@Test
	public void testSpellPossibilityIterator() throws Exception {
		PossibilityIterator iter = new PossibilityIterator(suggestions);
		int count = 0;
		while (iter.hasNext()) {
			<commit_msg>fixed testcase which failed with -Dtests.multiplier > 1<commit_after>package org.apache.solr.spelling;
/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.util.LinkedHashMap;
import java.util.Map;

import org.apache.lucene.analysis.Token;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.spelling.PossibilityIterator;
import org.junit.Before;
import org.junit.Test;

public class SpellPossibilityIteratorTest extends SolrTestCaseJ4 {

	private static Map<Token, LinkedHashMap<String, Integer>> suggestions = new LinkedHashMap<Token, LinkedHashMap<String, Integer>>();

	@Before
	public void setUp() throws Exception {
	  super.setUp();
		suggestions.clear();

		LinkedHashMap<String, Integer> AYE = new LinkedHashMap<String, Integer>();
		AYE.put("I", 0);
		AYE.put("II", 0);
		AYE.put("III", 0);
		AYE.put("IV", 0);
		AYE.put("V", 0);
		AYE.put("VI", 0);
		AYE.put("VII", 0);
		AYE.put("VIII", 0);
		
		LinkedHashMap<String, Integer> BEE = new LinkedHashMap<String, Integer>();
		BEE.put("alpha", 0);
		BEE.put("beta", 0);
		BEE.put("gamma", 0);
		BEE.put("delta", 0);
		BEE.put("epsilon", 0);
		BEE.put("zeta", 0);
		BEE.put("eta", 0);
		BEE.put("theta", 0);
		BEE.put("iota", 0);
		

		LinkedHashMap<String, Integer> CEE = new LinkedHashMap<String, Integer>();
		CEE.put("one", 0);
		CEE.put("two", 0);
		CEE.put("three", 0);
		CEE.put("four", 0);
		CEE.put("five", 0);
		CEE.put("six", 0);
		CEE.put("seven", 0);
		CEE.put("eight", 0);
		CEE.put("nine", 0);
		CEE.put("ten", 0);

		suggestions.put(new Token("AYE", 0, 2), AYE);
		suggestions.put(new Token("BEE", 0, 2), BEE);
		suggestions.put(new Token("CEE", 0, 2), CEE);
	}
	
	@Test
	public void testSpellPossibilityIterator() throws Exception {
		PossibilityIterator iter = new PossibilityIterator(suggestions);
		int count = 0;
		while (iter.hasNext()) {
			
{'fraction_non_alphanumeric': 0.14657348087749952, 'fraction_numerical': 0.0157251019219569, 'mean_word_length': 4.40041928721174, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5453394', 'n_tokens_mistral': 1872, 'n_tokens_neox': 1687, 'n_words': 512}