Top Fields Constructors Methods
org.jabref.logic.importer.fetcher

public Class GrobidCitationFetcher

extends Object
implements SearchBasedFetcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.SearchBasedFetcher, org.jabref.logic.importer.WebFetcher
Imports
java.io.IOException, java.net.SocketTimeoutException, java.util.Arrays, .Collections, .List, .Optional, java.util.stream.Collectors, org.jabref.logic.importer.FetcherException, .ImportFormatPreferences, .ParseException, .SearchBasedFetcher, org.jabref.logic.importer.util.GrobidService, org.jabref.model.entry.BibEntry, org.apache.lucene.queryparser.flexible.core.nodes.QueryNode, org.jooq.lambda.Unchecked, org.jooq.lambda.UncheckedException, org.jsoup.HttpStatusException, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private final GrobidService
private final ImportFormatPreferences
private static final Logger

Constructor Summary

AccessConstructor and Description
public
GrobidCitationFetcher(GrobidPreferences grobidPreferences, ImportFormatPreferences importFormatPreferences)

pack-priv
GrobidCitationFetcher(ImportFormatPreferences importFormatPreferences, GrobidService grobidService)

Method Summary

Modifier and TypeMethod and Description
public String
getName()

Implements org.jabref.logic.importer.WebFetcher.getName.

Returns the localized name of this fetcher.

private Optional<BibEntry>

Returns:

A BibTeX string if extraction is successful
parseUsingGrobid
(String plainText)

Passes request to grobid server, using consolidateCitations option to improve result.

public List<BibEntry>
performSearch(String
query string that can be parsed into a lucene query
searchQuery
)

Overrides default org.jabref.logic.importer.SearchBasedFetcher.performSearch.

Looks for hits which are matched by the given free-text query.

public List<BibEntry>
performSearch(org.apache.lucene.queryparser.flexible.core.nodes.QueryNode
the root node of the lucene query
luceneQuery
)

Implements org.jabref.logic.importer.SearchBasedFetcher.performSearch.

Not used

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

grobidServiceback to summary
private final GrobidService grobidService
importFormatPreferencesback to summary
private final ImportFormatPreferences importFormatPreferences
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

GrobidCitationFetcherback to summary
public GrobidCitationFetcher(GrobidPreferences grobidPreferences, ImportFormatPreferences importFormatPreferences)
GrobidCitationFetcherback to summary
pack-priv GrobidCitationFetcher(ImportFormatPreferences importFormatPreferences, GrobidService grobidService)

Method Detail

getNameback to summary
public String getName()

Implements org.jabref.logic.importer.WebFetcher.getName.

Doc from org.jabref.logic.importer.WebFetcher.getName.

Returns the localized name of this fetcher. The title can be used to display the fetcher in the menu and in the side pane.

Returns:String

the localized name

Annotations
@Override
parseUsingGrobidback to summary
private Optional<BibEntry> parseUsingGrobid(String plainText) throws FetcherException

Passes request to grobid server, using consolidateCitations option to improve result. Takes a while, since the server has to look up the entry.

Returns:Optional<BibEntry>

A BibTeX string if extraction is successful

performSearchback to summary
public List<BibEntry> performSearch(String searchQuery) throws FetcherException

Overrides default org.jabref.logic.importer.SearchBasedFetcher.performSearch.

Doc from org.jabref.logic.importer.SearchBasedFetcher.performSearch.

Looks for hits which are matched by the given free-text query.

Parameters
searchQuery:String

query string that can be parsed into a lucene query

Returns:List<BibEntry>

a list of BibEntry, which are matched by the query (may be empty)

Annotations
@Override
performSearchback to summary
public List<BibEntry> performSearch(org.apache.lucene.queryparser.flexible.core.nodes.QueryNode luceneQuery) throws FetcherException

Implements org.jabref.logic.importer.SearchBasedFetcher.performSearch.

Not used

Parameters
luceneQuery:org.apache.lucene.queryparser.flexible.core.nodes.QueryNode

Doc from org.jabref.logic.importer.SearchBasedFetcher.performSearch.

the root node of the lucene query

Returns:List<BibEntry>

Doc from org.jabref.logic.importer.SearchBasedFetcher.performSearch.

a list of BibEntry, which are matched by the query (may be empty)

Annotations
@Override