All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.asher_stern.crf.smalltests.DemoTopK_DS Maven / Gradle / Ivy

Go to download

Implementation of linear-chain Conditional Random Fields (CRF) in pure Java

There is a newer version: 1.2.0
Show newest version
package com.asher_stern.crf.smalltests;

import java.util.List;

import com.asher_stern.crf.utilities.TopK_DateStructure;

/**
 * 
 * @author Asher Stern
 * Date: Nov 19, 2014
 *
 */
public class DemoTopK_DS
{

	public static void main(String[] args)
	{
		try
		{
			new DemoTopK_DS().go();
		}
		catch(Throwable t)
		{
			t.printStackTrace(System.out);
		}
	}
	
	public void go()
	{
		int k = 3;
		TopK_DateStructure ds = new TopK_DateStructure(k);
		ds.insert(5);
		ds.insert(4);
		ds.insert(6);
		ds.insert(2);
		ds.insert(9);
		ds.insert(3);
		ds.insert(7);
		ds.insert(4);
		ds.insert(5);
		ds.insert(5);
		ds.insert(6);
		ds.insert(6);
		ds.insert(1);
		ds.insert(0);
		ds.insert(-1);
		ds.insert(7);
		ds.insert(8);
		ds.insert(4);
		ds.insert(6);
		ds.insert(11);
		ds.insert(4);
		ds.insert(6);
		ds.insert(2);
		ds.insert(9);
		ds.insert(3);
		ds.insert(7);
		ds.insert(4);
		ds.insert(5);
		ds.insert(5);
		ds.insert(6);
		ds.insert(6);
		ds.insert(1);
		ds.insert(0);
		ds.insert(-1);
		ds.insert(7);
		ds.insert(8);
		ds.insert(4);
		ds.insert(6);
		ds.insert(5);
		ds.insert(5);
		
		List list = ds.getTopK();
		for (int i : list)
		{
			System.out.println(i);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy