本文整理汇总了Java中org.ansj.domain.Term.setTo方法的典型用法代码示例。如果您正苦于以下问题:Java Term.setTo方法的具体用法?Java Term.setTo怎么用?Java Term.setTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ansj.domain.Term
的用法示例。
在下文中一共展示了Term.setTo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: optimalRoot
import org.ansj.domain.Term; //导入方法依赖的package包/类
/**
* 取得最优路径的root Term
*
* @return
*/
protected Term optimalRoot() {
Term to = end;
to.clearScore();
Term from = null;
while ((from = to.from()) != null) {
for (int i = from.getOffe() + 1; i < to.getOffe(); i++) {
terms[i] = null;
}
if (from.getOffe() > -1) {
terms[from.getOffe()] = from;
}
// 断开横向链表.节省内存
from.setNext(null);
from.setTo(to);
from.clearScore();
to = from;
}
return root;
}
示例2: optimalRoot
import org.ansj.domain.Term; //导入方法依赖的package包/类
/**
* 取得最优路径的root Term
*
* @return
*/
protected Term optimalRoot() {
Term to = end;
to.clearScore();
Term from = null;
while ((from = to.from()) != null) {
for (int i = from.getOffe() + 1; i < to.getOffe(); i++) {
terms[i] = null;
}
if (from.getOffe() > -1) {
terms[from.getOffe()] = from;
}
// 断开横向链表.节省内存
from.setNext(null);
from.setTo(to);
from.clearScore();
to = from;
}
return root;
}
示例3: termLink
import org.ansj.domain.Term; //导入方法依赖的package包/类
public static void termLink(Term from, Term to) {
if (from == null || to == null)
return;
from.setTo(to);
to.setFrom(from);
}
示例4: setToAndfrom
import org.ansj.domain.Term; //导入方法依赖的package包/类
protected static Term setToAndfrom(Term to, Term from) {
// TODO Auto-generated method stub
from.setTo(to);
to.setFrom(from);
return from;
}
示例5: termLink
import org.ansj.domain.Term; //导入方法依赖的package包/类
public static void termLink(Term from, Term to) {
if (from == null || to == null)
return;
from.setTo(to);
to.setFrom(from);
}
示例6: setToAndfrom
import org.ansj.domain.Term; //导入方法依赖的package包/类
protected static Term setToAndfrom(Term to, Term from) {
from.setTo(to);
to.setFrom(from);
return from;
}