use of org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter in project jabref by JabRef.
the class EditorMenus method getNameMenu.
public static List<MenuItem> getNameMenu(TextArea textArea) {
MenuItem normalizeNames = new MenuItem(Localization.lang("Normalize to BibTeX name format"));
//normalizeNames.setTooltip(Localization.lang("If possible, normalize this list of names to conform to standard BibTeX name formatting"))
normalizeNames.setOnAction(event -> textArea.setText(new NormalizeNamesFormatter().format(textArea.getText())));
return Collections.singletonList(normalizeNames);
}
use of org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter in project jabref by JabRef.
the class CiteSeerXFetcher method getSingleCitation.
private static BibEntry getSingleCitation(String urlString) throws IOException {
String cont = new URLDownload(urlString).asString();
// Find title, and create entry if we do. Otherwise assume we did not get an entry:
Matcher m = CiteSeerXFetcher.TITLE_PATTERN.matcher(cont);
if (m.find()) {
BibEntry entry = new BibEntry();
entry.setField(FieldName.TITLE, m.group(1));
// Find authors:
m = CiteSeerXFetcher.AUTHOR_PATTERN.matcher(cont);
if (m.find()) {
String authors = m.group(1);
entry.setField(FieldName.AUTHOR, new NormalizeNamesFormatter().format(authors));
}
// Find year:
m = CiteSeerXFetcher.YEAR_PATTERN.matcher(cont);
if (m.find()) {
entry.setField(FieldName.YEAR, m.group(1));
}
// Find abstract:
m = CiteSeerXFetcher.ABSTRACT_PATTERN.matcher(cont);
if (m.find()) {
entry.setField(FieldName.ABSTRACT, m.group(1));
}
return entry;
} else {
return null;
}
}
use of org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter in project jabref by JabRef.
the class AstrophysicsDataSystem method doPostCleanup.
@Override
public void doPostCleanup(BibEntry entry) {
new FieldFormatterCleanup(FieldName.ABSTRACT, new RemoveBracesFormatter()).cleanup(entry);
new FieldFormatterCleanup(FieldName.TITLE, new RemoveBracesFormatter()).cleanup(entry);
new FieldFormatterCleanup(FieldName.AUTHOR, new NormalizeNamesFormatter()).cleanup(entry);
// Remove ADS note
new FieldFormatterCleanup("adsnote", new ClearFormatter()).cleanup(entry);
// Move adsurl to url field
new MoveFieldCleanup("adsurl", FieldName.URL).cleanup(entry);
}
use of org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter in project jabref by JabRef.
the class IsbnViaEbookDeFetcher method doPostCleanup.
@Override
public void doPostCleanup(BibEntry entry) {
// We MUST NOT clean the URL. this is the deal with ebook.de
// DO NOT add following code:
// new FieldFormatterCleanup(FieldName.URL, new ClearFormatter()).cleanup(entry);
// Fetcher returns page numbers as "30 Seiten" -> remove every non-digit character in the PAGETOTAL field
entry.getField(FieldName.PAGETOTAL).ifPresent(pages -> entry.setField(FieldName.PAGETOTAL, pages.replaceAll("[\\D]", "")));
new FieldFormatterCleanup(FieldName.PAGETOTAL, new NormalizePagesFormatter()).cleanup(entry);
new FieldFormatterCleanup(FieldName.AUTHOR, new NormalizeNamesFormatter()).cleanup(entry);
}
Aggregations