docnodewpos.java

来自「自己写的search engine, 有 boolean search, fuz」· Java 代码 · 共 65 行

JAVA
65
字号
package searchingEngine.dataPreprocessing.wordPosition;

import java.util.LinkedList;

import searchingEngine.dataPreprocessing.invertedFile.DocNode;

public class DocNodeWpos extends DocNode {
	public final LinkedList<Integer> wpos_list;
	
	public DocNodeWpos(int fileid){
		super(fileid);
		this.wpos_list = new LinkedList<Integer>();
	}
	
	public DocNodeWpos(int fileid,LinkedList<Integer> wpos_list){
		super(fileid);
		this.wpos_list = wpos_list;
	}
	
	public DocNodeWpos(int fileid,double tf,double term_doc_wt, LinkedList<Integer> wpos_list){
		super(fileid,tf,term_doc_wt);
		this.wpos_list = wpos_list;
	}
	public DocNodeWpos(int fileid,double tf,double term_doc_wt){
		super(fileid,tf,term_doc_wt);
		this.wpos_list = new LinkedList<Integer>();
	}
	
	public DocNodeWpos(DocNode docNode, LinkedList<Integer> wpos_list){
		super(docNode.fileid,docNode.getTf(),docNode.getTermDocWt());
		this.wpos_list = wpos_list;
	}
	
	public DocNodeWpos(DocNode docNode){
		super(docNode.fileid,docNode.getTf(),docNode.getTermDocWt());
		this.wpos_list = new LinkedList<Integer>();
	}
	
	public String toString(){
		StringBuffer temp = new StringBuffer(fileid + " " + getTf() + " " +  getTermDocWt() +" [ ");
		for (int i =0;i<wpos_list.size();i++) {
			temp.append(wpos_list.get(i)+ " ");
		}
		temp.append("]");
		return temp.toString();
	}
	
	public void increTf() {
	}
	
	public double getTf() {
		return (double)wpos_list.size();
	}
	
	public void setTf(double tf) {
	}
	
	public void setTermDocWt(double term_doc_wt) {
	}
	
	public double getTermDocWt() {
		return 0;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?