本文整理汇总了Java中de.tudarmstadt.ukp.wikipedia.parser.SectionContent类的典型用法代码示例。如果您正苦于以下问题:Java SectionContent类的具体用法?Java SectionContent怎么用?Java SectionContent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SectionContent类属于de.tudarmstadt.ukp.wikipedia.parser包,在下文中一共展示了SectionContent类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteParagraph
import de.tudarmstadt.ukp.wikipedia.parser.SectionContent; //导入依赖的package包/类
private void deleteParagraph( int nr, List<Section> sections ){
int temp = nr;
for( Section s: sections ){
nr = temp;
temp -= s.nrOfParagraphs();
if( temp >= 0 ) continue;
if( s.getClass() == SectionContainer.class )
deleteParagraph( nr ,((SectionContainer)s).getSubSections() );
else{
SectionContent sc = (SectionContent)s;
sc.removeParagraph( sc.getParagraph( nr ) );
}
break;
}
}
示例2: checkRange
import de.tudarmstadt.ukp.wikipedia.parser.SectionContent; //导入依赖的package包/类
public static void checkRange( ParsedPage pp ){
for( Section s: pp.getSections() ){
if( s.getClass() == SectionContent.class )
checkRange( (SectionContent)s );
else
checkRange( (SectionContainer)s );
}
}
示例3: eliminateEmptyStructures
import de.tudarmstadt.ukp.wikipedia.parser.SectionContent; //导入依赖的package包/类
/**
* Removes all empty Structures from a SectionContainer and all substructures.
*/
public static SectionContainer eliminateEmptyStructures( SectionContainer sc ){
for( int i=sc.nrOfSubSections()-1; i>=0; i-- ){
Section ss = sc.getSubSection( i );
if( ss.getClass() == SectionContainer.class ){
SectionContainer sci = (SectionContainer)ss;
eliminateEmptyStructures( sci );
}
else if( ss.getClass() == SectionContent.class )
eliminateEmptyStructures( (SectionContent)ss );
if( ss.empty() ) sc.removeSection(ss);
}
//encapsulating Sections
if( sc.nrOfSubSections()==1 && sc.getSubSection(0).getClass()==SectionContainer.class ){
SectionContainer sc0 = (SectionContainer)sc.getSubSection( 0 );
if( sc0.getTitleElement()==null ){
sc.removeSection( sc0 );
for( int i=0; i<sc0.nrOfSubSections(); i++)
sc.addSection( sc0.getSubSection(i) );
}
}
return sc;
}
示例4: checkRange
import de.tudarmstadt.ukp.wikipedia.parser.SectionContent; //导入依赖的package包/类
public static void checkRange( ParsedPage pp ){
for( Section s: pp.getSections() ){
if( s.getClass() == SectionContent.class )
checkRange( (SectionContent)s );
else
checkRange( (SectionContainer)s );
}
}