本文整理汇总了Java中no.priv.garshol.duke.RecordImpl.addValue方法的典型用法代码示例。如果您正苦于以下问题:Java RecordImpl.addValue方法的具体用法?Java RecordImpl.addValue怎么用?Java RecordImpl.addValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类no.priv.garshol.duke.RecordImpl
的用法示例。
在下文中一共展示了RecordImpl.addValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import no.priv.garshol.duke.RecordImpl; //导入方法依赖的package包/类
public void run(String[] argv)
throws IOException, SAXException {
Collection<CommandLineParser.Option> options =
Collections.singleton((CommandLineParser.Option) new CommandLineParser.StringOption("maxhits", 'H'));
argv = init(argv, 3, 3, options);
int max_hits = 10000;
if (parser.getOptionValue("maxhits") != null)
max_hits = Integer.parseInt(parser.getOptionValue("maxhits"));
// build record
RecordImpl prototype = new RecordImpl();
prototype.addValue(argv[1], argv[2]);
// search
Collection<Record> records = database.findCandidateMatches(prototype);
int hitno = 1;
for (Record record : records) {
PrintMatchListener.prettyPrint(record, config.getProperties());
System.out.println();
if (hitno++ == max_hits)
break;
}
}
示例2: convertToRecord
import no.priv.garshol.duke.RecordImpl; //导入方法依赖的package包/类
/**
* Helper method which receives an <tt>HpCloudItem</tt> and creates a new <tt>Record</tt> to be
* used by Duke.
*
* @param item The object where the properties' values are going to be read from.
* @return A <tt>Record</tt> containing all the properties specified in the constructor of this
* class.
*/
protected Record convertToRecord(final T item) {
RecordImpl newRecord = new RecordImpl();
// This method is called from a parallelised one. Hence, there is no need for this one to be
// parallelised.
for (String property : propertiesInfo.keySet()) {
String value = item.getCore().getAttributeAsString(propertiesInfo.get(property));
newRecord.addValue(property, value);
}
return newRecord;
}
示例3: addValue
import no.priv.garshol.duke.RecordImpl; //导入方法依赖的package包/类
private void addValue(RecordImpl record, String subject,
String property, String object) {
if (record.isEmpty())
for (Column idcol : columns.get("?uri"))
record.addValue(idcol.getProperty(), subject);
record.addValue(property, object);
}