cc.mallet.types.Alphabet.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(90)

本文整理了Java中cc.mallet.types.Alphabet.<init>()方法的一些代码示例,展示了Alphabet.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Alphabet.<init>()方法的具体详情如下:
包路径:cc.mallet.types.Alphabet
类名称:Alphabet
方法名:<init>

Alphabet.<init>介绍

暂无

代码示例

代码示例来源:origin: cc.mallet/mallet

public TokenSequence2FeatureSequenceWithBigrams (Alphabet dataDict)
{
  super (dataDict, null);
  biDictionary = new Alphabet();
}

代码示例来源:origin: cc.mallet/mallet

public TokenSequence2FeatureVectorSequence (boolean binary, boolean augmentable)
{
  super (new Alphabet(), null);
  this.augmentable = augmentable;
  this.binary = binary;
}

代码示例来源:origin: de.julielab/jcore-mallet-2.0.9

public Token2FeatureVector (boolean binary, boolean augmentable)
{
  super (new Alphabet(), null);
  this.augmentable = augmentable;
  this.binary = binary;
}

代码示例来源:origin: com.github.steveash.mallet/mallet

public TokenSequence2FeatureSequenceWithBigrams ()
{
  super(new Alphabet(), null);
  biDictionary = new Alphabet();
}

代码示例来源:origin: cc.mallet/mallet

/** Load an alphabet from a file, one item per line */
public static Alphabet loadFromFile(File alphabetFile) throws IOException {
  BufferedReader reader = new BufferedReader(new FileReader(alphabetFile));
  Alphabet alphabet = new Alphabet();
  String item;
  while ((item = reader.readLine()) != null) {
    alphabet.lookupIndex(item);
  }
  
  reader.close();
  return alphabet;
}

代码示例来源:origin: cc.mallet/mallet

private static Alphabet dictOfSize (int size)
{
  Alphabet ret = new Alphabet ();
  for (int i = 0; i < size; i++)
    ret.lookupIndex ("feature"+i);
  return ret;
}

代码示例来源:origin: cc.mallet/mallet

private static Alphabet dictOfSize (int size)
{
  Alphabet ret = new Alphabet ();
  for (int i = 0; i < size; i++)
    ret.lookupIndex ("feature"+i);
  return ret;
}

代码示例来源:origin: cc.mallet/mallet

private static Alphabet dictOfSize (int size)
{
  Alphabet ret = new Alphabet ();
  for (int i = 0; i < size; i++)
    ret.lookupIndex ("feature"+i);
  return ret;
}

代码示例来源:origin: cc.mallet/mallet

public ClusteringPipe(int[] exactMatchFields, int[] approxMatchFields,
    int[] substringMatchFields) {
  super(new Alphabet(), new LabelAlphabet());
  this.exactMatchFields = exactMatchFields;
  this.approxMatchFields = approxMatchFields;
  this.substringMatchFields = substringMatchFields;
}

代码示例来源:origin: cc.mallet/mallet

private static Alphabet dictOfSize (int n)
{
 Alphabet dict = new Alphabet ();
 for (int i = 0; i < n; i++) {
  dict.lookupIndex ("feature"+i);
 }
 return dict;
}

代码示例来源:origin: cc.mallet/mallet

private static Alphabet dictOfSize (int size)
{
  Alphabet ret = new Alphabet ();
  for (int i = 0; i < size; i++)
    ret.lookupIndex ("feature"+i);
  return ret;
}

代码示例来源:origin: de.julielab/jcore-mallet-2.0.9

private static Alphabet dictOfSize (int size)
{
  Alphabet ret = new Alphabet ();
  for (int i = 0; i < size; i++)
    ret.lookupIndex ("feature"+i);
  return ret;
}

代码示例来源:origin: de.julielab/jcore-mallet-2.0.9

private static Alphabet dictOfSize (int size)
{
  Alphabet ret = new Alphabet ();
  for (int i = 0; i < size; i++)
    ret.lookupIndex ("feature"+i);
  return ret;
}

代码示例来源:origin: com.github.steveash.mallet/mallet

private static Alphabet dictOfSize (int size)
{
  Alphabet ret = new Alphabet ();
  for (int i = 0; i < size; i++)
    ret.lookupIndex ("feature"+i);
  return ret;
}

代码示例来源:origin: cc.mallet/mallet

/**
 * Creates a new
 * <code>SimpleTaggerSentence2FeatureVectorSequence</code> instance.
 */
public SimpleTaggerSentence2FeatureVectorSequence () {
  super (new Alphabet(), new LabelAlphabet());
}

代码示例来源:origin: de.julielab/jcore-mallet-2.0.9

public GenericAcrfData2TokenSequence ()
{
 super (new Alphabet(), new LabelAlphabet());
   labelDicts.add (getTargetAlphabet());
}

代码示例来源:origin: cc.mallet/mallet

public FeatureDocFreqPipe() {
  super(new Alphabet(), null);
  counter = new FeatureCounter(this.getDataAlphabet());
  numInstances = 0;
}

代码示例来源:origin: com.github.steveash.mallet/mallet

private Alphabet getTransitionAlphabet() {
  Alphabet transitionAlphabet = new Alphabet();
  for (int i = 0; i < numStates(); i++)
    transitionAlphabet.lookupIndex(getState(i).getName(), true);
  return transitionAlphabet;
}

代码示例来源:origin: cc.mallet/mallet

private Alphabet getTransitionAlphabet() {
  Alphabet transitionAlphabet = new Alphabet();
  for (int i = 0; i < numStates(); i++)
    transitionAlphabet.lookupIndex(getState(i).getName(), true);
  return transitionAlphabet;
}

代码示例来源:origin: com.github.steveash.mallet/mallet

public void testReadResolve () throws IOException, ClassNotFoundException
{
 Alphabet dict = new Alphabet ();
 dict.lookupIndex ("TEST1");
 dict.lookupIndex ("TEST2");
 dict.lookupIndex ("TEST3");
 Alphabet dict2 = (Alphabet) TestSerializable.cloneViaSerialization (dict);
 assertTrue (dict == dict2);
}

相关文章