Package it.uniroma1.lcl.babelnet
Class BabelNetQuery.Builder
- java.lang.Object
-
- it.uniroma1.lcl.babelnet.BabelNetQuery.Builder
-
- Enclosing class:
- BabelNetQuery
public static class BabelNetQuery.Builder extends Object
Builder ofBabelNetQuery
objects.- Author:
- navigli
-
-
Constructor Summary
Constructors Constructor Description Builder(ResourceID resourceID)
Adds the resource ID for searchBuilder(ResourceID... resourceIDs)
Adds the resource IDs for searchBuilder(String lemma)
Adds a lemma for searchBuilder(String... lemmas)
Adds lemmas for searchBuilder(Collection<? extends ResourceID> resourceIDs)
Adds the resource IDs for search
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BabelNetQuery
build()
Builds a configured instance ofBabelNetQuery
BabelNetQuery.Builder
filterSenses(Predicate<BabelSense> senseFilter)
Sets a filter for each sense in each synset retrievedBabelNetQuery.Builder
filterSynsets(Predicate<BabelSynset> synsetFilter)
Sets a filter for each synset retrievedBabelNetQuery.Builder
from(it.uniroma1.lcl.jlt.util.Language lang)
Sets the search languageBabelNetQuery.Builder
from(it.uniroma1.lcl.jlt.util.Language... langs)
Sets the search languagesBabelNetQuery.Builder
from(Collection<it.uniroma1.lcl.jlt.util.Language> langs)
Sets the search languagesBabelNetQuery.Builder
lemmaType(BabelLemmaType... lemmaType)
Sets theBabelLemmaType
s for the synset searchBabelNetQuery.Builder
normalized(boolean bNormalized)
Sets the normalization for lemma searchBabelNetQuery.Builder
POS(it.uniroma1.lcl.jlt.util.POS pos)
Sets the POS for the synset searchBabelNetQuery.Builder
POS(it.uniroma1.lcl.jlt.util.POS... poses)
Sets the POSes for the synset searchBabelNetQuery.Builder
POS(Collection<? extends it.uniroma1.lcl.jlt.util.POS> poses)
Sets the POS collection for the synset searchBabelNetQuery.Builder
source(BabelSenseSource source)
Sets the source for the synset searchBabelNetQuery.Builder
sources(BabelSenseSource... sources)
Sets the sources for the synset searchBabelNetQuery.Builder
sources(Collection<BabelSenseSource> sources)
Sets the source collection for the synset searchBabelNetQuery.Builder
sources(Predicate<BabelSenseSource> sourceFilter)
Sets a filter for each sources in each synset retrievedBabelNetQuery.Builder
tag(Tag... tags)
Sets theTag
s for the synset searchBabelNetQuery.Builder
tag(Collection<Tag> tags)
Sets the collection ofTag
s for the synset searchBabelNetQuery.Builder
to(it.uniroma1.lcl.jlt.util.Language lang)
Sets the target language to build synsets withBabelNetQuery.Builder
to(it.uniroma1.lcl.jlt.util.Language... langs)
Sets the target languages to build synsets withBabelNetQuery.Builder
to(Collection<it.uniroma1.lcl.jlt.util.Language> langs)
Sets the target language collection to build synsets withBabelNetQuery.Builder
toAllLanguages()
Sets all languages as target languagesBabelNetQuery.Builder
toSameLanguages()
Sets the target languages to the same as the search languages
-
-
-
Constructor Detail
-
Builder
public Builder(ResourceID resourceID)
Adds the resource ID for search- Parameters:
resourceID
- the resource ID to add
-
Builder
public Builder(ResourceID... resourceIDs)
Adds the resource IDs for search- Parameters:
resourceIDs
- the resources ID to add
-
Builder
public Builder(Collection<? extends ResourceID> resourceIDs)
Adds the resource IDs for search- Parameters:
resourceIDs
- the resources ID to add
-
Builder
public Builder(String lemma)
Adds a lemma for search- Parameters:
lemma
- the lemma to search
-
Builder
public Builder(String... lemmas)
Adds lemmas for search- Parameters:
lemmas
- the lemmas to search
-
-
Method Detail
-
from
public BabelNetQuery.Builder from(it.uniroma1.lcl.jlt.util.Language lang)
Sets the search language- Parameters:
lang
- language to search BabelNet- Returns:
- the builder
-
from
public BabelNetQuery.Builder from(it.uniroma1.lcl.jlt.util.Language... langs)
Sets the search languages- Parameters:
langs
- languages to search BabelNet- Returns:
- the builder
-
from
public BabelNetQuery.Builder from(Collection<it.uniroma1.lcl.jlt.util.Language> langs)
Sets the search languages- Parameters:
langs
- language collection to search BabelNet- Returns:
- the builder
-
toSameLanguages
public BabelNetQuery.Builder toSameLanguages()
Sets the target languages to the same as the search languages- Returns:
- the builder
-
toAllLanguages
public BabelNetQuery.Builder toAllLanguages()
Sets all languages as target languages- Returns:
- the builder
-
to
public BabelNetQuery.Builder to(it.uniroma1.lcl.jlt.util.Language lang)
Sets the target language to build synsets with- Parameters:
lang
- language to build synsets with- Returns:
- the builder
-
to
public BabelNetQuery.Builder to(it.uniroma1.lcl.jlt.util.Language... langs)
Sets the target languages to build synsets with- Parameters:
langs
- languages to build synsets with- Returns:
- the builder
-
to
public BabelNetQuery.Builder to(Collection<it.uniroma1.lcl.jlt.util.Language> langs)
Sets the target language collection to build synsets with- Parameters:
langs
- language collection to build synsets with- Returns:
- the builder
-
source
public BabelNetQuery.Builder source(BabelSenseSource source)
Sets the source for the synset search- Parameters:
source
- the synset source for the search- Returns:
- the builder
-
sources
public BabelNetQuery.Builder sources(BabelSenseSource... sources)
Sets the sources for the synset search- Parameters:
sources
- the synset sources for the search- Returns:
- the builder
-
sources
public BabelNetQuery.Builder sources(Collection<BabelSenseSource> sources)
Sets the source collection for the synset search- Parameters:
sources
- the synset source collection for the search- Returns:
- the builder
-
sources
public BabelNetQuery.Builder sources(Predicate<BabelSenseSource> sourceFilter)
Sets a filter for each sources in each synset retrieved- Parameters:
sourceFilter
- source predicate- Returns:
- the builder
-
POS
public BabelNetQuery.Builder POS(it.uniroma1.lcl.jlt.util.POS pos)
Sets the POS for the synset search- Parameters:
pos
- the synset POS for the search- Returns:
- the builder
-
POS
public BabelNetQuery.Builder POS(it.uniroma1.lcl.jlt.util.POS... poses)
Sets the POSes for the synset search- Parameters:
poses
- the synset POSes for the search- Returns:
- the builder
-
POS
public BabelNetQuery.Builder POS(Collection<? extends it.uniroma1.lcl.jlt.util.POS> poses)
Sets the POS collection for the synset search- Parameters:
poses
- the synset POS collection for the search- Returns:
- the builder
-
normalized
public BabelNetQuery.Builder normalized(boolean bNormalized)
Sets the normalization for lemma search- Parameters:
bNormalized
- true if accents etc. should be disregarded during lookup, false otherwise- Returns:
- the builder
-
filterSynsets
public BabelNetQuery.Builder filterSynsets(Predicate<BabelSynset> synsetFilter)
Sets a filter for each synset retrieved- Parameters:
synsetFilter
- synset predicate- Returns:
- the builder
-
filterSenses
public BabelNetQuery.Builder filterSenses(Predicate<BabelSense> senseFilter)
Sets a filter for each sense in each synset retrieved- Parameters:
senseFilter
- sense predicate- Returns:
- the builder
-
lemmaType
public BabelNetQuery.Builder lemmaType(BabelLemmaType... lemmaType)
Sets theBabelLemmaType
s for the synset search- Parameters:
lemmaType
- lemma types- Returns:
- the builder
-
tag
public BabelNetQuery.Builder tag(Collection<Tag> tags)
Sets the collection ofTag
s for the synset search- Parameters:
tags
- the collection ofTag
s for the search- Returns:
- the builder
-
tag
public BabelNetQuery.Builder tag(Tag... tags)
Sets theTag
s for the synset search- Parameters:
tags
- theTag
s for the search- Returns:
- the builder
-
build
public BabelNetQuery build()
Builds a configured instance ofBabelNetQuery
- Returns:
- the query object
-
-