本文整理汇总了Python中libvocab.Vocab.addShortName方法的典型用法代码示例。如果您正苦于以下问题:Python Vocab.addShortName方法的具体用法?Python Vocab.addShortName怎么用?Python Vocab.addShortName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libvocab.Vocab
的用法示例。
在下文中一共展示了Vocab.addShortName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeSpec
# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import addShortName [as 别名]
def makeSpec(indir, uri, shortName,outdir,outfile, template, templatedir,indexrdfdir, ontofile):
spec = Vocab( indexrdfdir, ontofile, uri)
spec.addShortName(shortName)
spec.index() # slurp info from sources
out = VocabReport( spec, indir, template, templatedir )
filename = os.path.join(outdir, outfile)
print "Printing to ",filename
f = open(filename,"w")
result = out.generate()
f.write(result)
示例2: makeSpec
# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import addShortName [as 别名]
def makeSpec(indir, uri, shortName,outdir,outfile, template, templatedir, indexrdfdir, ontofile,specurl,name,addGroups):
spec = Vocab( indexrdfdir, ontofile, uri)
spec.addShortName(shortName)
spec.index() # slurp info from sources
#create a Report
out = VocabReport( spec, indir, template, templatedir,specurl,name)
#check template
htmlgroups = None
if (addGroups):
if out.check_template_for_parameter('%groups%'):
groups = Grouping(spec,uri)
htmlgroups = groups.getHTMLGroups();
else:
print "Template doesn't contain %groups% parameter -- skipping groups creation"
filename = os.path.join(outdir, outfile)
print "Printing to ",filename
f = open(filename,"w")
result = out.generate(htmlgroups)
f.write(result)