Top Description Inners Fields Constructors Methods
org.jabref.logic.citationkeypattern

public Class BracketedPattern

extends Object
Class Inheritance
Known Direct Subclasses
org.jabref.logic.citationkeypattern.CitationKeyGenerator
Imports
java.math.BigInteger, java.text.Normalizer, java.util.ArrayList, .Arrays, .Collections, .EnumSet, .List, .Locale, .Objects, .Optional, .Scanner, .StringJoiner, .StringTokenizer, java.util.function.Function, .Predicate, java.util.regex.Matcher, .Pattern, java.util.stream.Collectors, org.jabref.logic.cleanup.Formatter, org.jabref.logic.formatter.Formatters, org.jabref.logic.formatter.casechanger.Word, org.jabref.logic.layout.format.RemoveLatexCommandsFormatter, org.jabref.model.database.BibDatabase, org.jabref.model.entry.Author, .AuthorList, .BibEntry, .Keyword, .KeywordList, org.jabref.model.entry.field.FieldFactory, .InternalField, .StandardField, org.jabref.model.strings.LatexToUnicodeAdapter, .StringUtil, org.slf4j.Logger, .LoggerFactory

This class provides methods to expand bracketed expressions, such as [year]_[author]_[firstpage], using information from a provided BibEntry. The above-mentioned expression would yield 2017_Kitsune_123 when expanded using the BibTeX entry @Article{ authors = {O. Kitsune}, year = {2017}, pages={123-6}}.

The embedding in JabRef is explained at Customize the citation key generator.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private static final int
CHARS_OF_FIRST

The maximum number of characters in the first author's last name.

private static final Pattern
DEPARTMENTS

Matches with "dep"/"dip", case-insensitive

private static final Pattern
INLINE_ABBREVIATION

Matches uppercase english letters between "({" and "})", which should be used to abbreviate the name of an institution

private static final Logger
private static final int
MAX_ALPHA_AUTHORS

The maximum number of name abbreviations that can be used.

private static final Pattern
NOT_CAPITAL_CHARACTER

Matches everything that is not an uppercase ASCII letter.

private static final Pattern
NOT_DECIMAL_DIGIT

Matches everything that is not a unicode decimal digit.

private final String
private static final Pattern

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static String

Returns:

the surname of all authors/editors
allAuthors
(AuthorList authorList)

Gets the last name of all authors/editors.

private static void
appendQuote(StringBuilder
the StringBuilder to which tokens will be appended
stringBuilder
,
StringTokenizer
the tokenizer producing the tokens
tokenizer
)

Appends the content between, and including, two \" to the provided StringBuilder.

pack-priv static String

Returns:

The modified label.
applyModifiers
(final String
The generated label.
label
,
final List<String>
String array containing the modifiers.
parts
,
final int
The number of initial items in the modifiers array to skip.
offset
,
Function<String, String>
a function to expand the content in the parentheses.
expandBracketContent
)

Applies modifiers to a label generated based on a field marker.

pack-priv static String
authAuthEa(AuthorList authorList)

pack-priv static String
authEtal(AuthorList authorList, String delim, String append)

auth.etal, authEtAl, ...

pack-priv static String
authIniN(AuthorList
The authors to format.
authorList
,
int
The maximum number of characters this string will be long. A negative number or zero will lead to "" be returned.
n
)

authIniN format

private static String
authN(AuthorList authorList, int num)

First N chars of the first author's last name.

private static String
authNofMth(AuthorList authorList, int n, int m)

The first N characters of the Mth author's or editor's last name.

pack-priv static String

Returns:

the initials of all authors' names
authorsAlpha
(AuthorList authorList)

Returns the authors according to the BibTeX-alpha-Style

pack-priv static String
authShort(AuthorList authorList)

authshort format

public static String
camelizeSignificantWordsInTitle(String title)

Capitalises the significant words of the "title" field in the given BibTeX entry

private static String
private static String
camelizeTitle_N(String title, int number)

private static String

Returns:

the content enclosed by brackets
contentBetweenBrackets
(StringTokenizer
the tokenizer producing the tokens
tokenizer
,
final String
pattern used by expandBrackets, used for logging
pattern
)

Returns the content enclosed between brackets, including enclosed quotes, and excluding the paired enclosing brackets.

private static AuthorList

Returns:

an AuthorList consisting of authors and institution keys with resolved latex.
createAuthorList
(String
a string representation of authors or editors
unparsedAuthors
)

Parses the provided string to an AuthorList, which are then formatted by LatexToUnicodeAdapter.

public String
expand(BibEntry bibentry)

public String

Returns:

The expanded pattern. The empty string is returned, if it could not be expanded.
expand
(BibEntry
The bibentry to expand.
bibentry
,
BibDatabase
The database to use for string-lookups and cross-refs. May be null.
database
)

Expands the current pattern using the given bibentry and database.

public String

Returns:

The expanded pattern. The empty string is returned, if it could not be expanded.
expand
(BibEntry
The bibentry to expand.
bibentry
,
Character
The keyword delimiter to use.
keywordDelimiter
,
BibDatabase
The database to use for string-lookups and cross-refs. May be null.
database
)

Expands the current pattern using the given bibentry, keyword delimiter, and database.

public static Function<String, String>

Returns:

a function accepting a bracketed expression and returning the result of expanding it
expandBracketContent
(Character
The keyword delimiter to use
keywordDelimiter
,
BibEntry
The BibEntry to use for expansion
entry
,
BibDatabase
The BibDatabase for field resolving. May be null.
database
)

Utility method creating a function taking the string representation of the content of a bracketed expression and expanding it.

public static String

Returns:

The expanded pattern. Not null.
expandBrackets
(String
The pattern to expand
pattern
,
Character
The keyword delimiter to use
keywordDelimiter
,
BibEntry
The bibentry to use for expansion
entry
,
BibDatabase
The database for field resolving. May be null.
database
)

Expands a pattern

public static String

Returns:

The expanded pattern. Not null.
expandBrackets
(String
The pattern to expand
pattern
,
Function<String, String>
A function taking the string representation of the content of a bracketed pattern and expanding it
bracketContentHandler
)

Expands a pattern.

private static String

Returns:

the surname of an author/editor or the von part if no lastname is prsent or "" if no author was found or both firstname+lastname are empty This method is guaranteed to never return null.
firstAuthor
(AuthorList authorList)

Gets the last name of the first author/editor

private static String

Returns:

the first name initial of an author/editor or "" if no author was found This method is guaranteed to never return null.
firstAuthorForenameInitials
(AuthorList authorList)

Gets the first name initials of the first author/editor

private static String

Returns:

the von part and surname of an author/editor or "" if no author was found. This method is guaranteed to never return null.
firstAuthorVonAndLast
(AuthorList authorList)

Gets the von part and the last name of the first author/editor.

public static String

Returns:

the first page number or "" if no number is found in the string
firstPage
(String
(may not be null) a pages string such as 42--111 or 7,41,73--97 or 43+
pages
)

Split the pages field into separate numbers and return the lowest

private static String
formatTitle(String title)

Removes any '-', unnecessary whitespace and latex commands formatting

private static String

Returns:

  • the institution key
  • "" in the case of a failure
  • null if content is null
generateInstitutionKey
(String
the institution to generate a Bibtex key for
content
)

An author or editor may be and institution not a person.

public static String
getCamelizedTitle(String title)

Capitalises and concatenates the words out of the "title" field in the given BibTeX entry

public static String
getCamelizedTitle_N(String title, int number)

Capitalises and concatenates the words out of the "title" field in the given BibTeX entry, to a maximum of N words.

public static String

Returns:

String containing the evaluation result. Empty string if the pattern cannot be resolved.
getFieldValue
(BibEntry
The entry to get the field value from
entry
,
String
A pattern string (such as auth, pureauth, authorLast)
pattern
,
Character
The de
keywordDelimiter
,
BibDatabase
The database to use for field resolving. May be null.
database
)

Evaluates the given pattern to the given bibentry and database

private static String
getSomeWords(int number, String string)

public static String
getTitleWords(int number, String title)

Determines "number" words out of the "title" field in the given BibTeX entry

private static String
getTitleWordsWithSpaces(int number, String title)

private static List<String>
private static boolean

Returns:

true if only the last name is present and it contains at least one whitespace character.
isInstitution
(Author
the checked author
author
)

Checks if an author is an institution which can get a citation key from generateInstitutionKey(String).

private static String

Returns:

a string consisting of authors' last names separated by a `delimiter` and with any authors excess of `maxAuthors` replaced with `suffix`
joinAuthorsOnLastName
(AuthorList
the list of authors
authorList
,
int
the maximum number of authors in the string
maxAuthors
,
String
delimiter separating the last names of the authors
delimiter
,
final String
to replace excess authors with. Also used to replace and others.
suffix
)

Creates a string with all last names separated by a `delimiter`.

private static String
private static String

Returns:

the surname of an author/editor
lastAuthor
(AuthorList authorList)

Gets the last name of the last author/editor

private static String

Returns:

the forename initial of an author/editor or "" if no author was found This method is guaranteed to never return null.
lastAuthorForenameInitials
(AuthorList authorList)

Gets the forename initials of the last author/editor

public static String

Returns:

the first page number or "" if no number is found in the string
lastPage
(String
a pages string such as 42--111 or 7,41,73--97 or 43+
pages
)

Split the pages field into separate numbers and return the highest

private static String

Returns:

Gets the surnames of the first N authors and appends EtAl if there are more than N authors
nAuthors
(AuthorList authorList, int
the number of desired authors
n
)

Gets the surnames of the first N authors and appends EtAl if there are more than N authors

private static boolean
pack-priv static String

Returns:

the surname of all authors/editors
oneAuthorPlusInitials
(AuthorList authorList)

Gets the first part of the last name of the first author/editor, and appends the last name initial of the remaining authors/editors.

public static String

Returns:

the non-digit prefix of pages (like "L" of L7) or "" if no non-digit prefix is found in the string
pagePrefix
(String
a pages string such as L42--111 or L7,41,73--97 or L43+
pages
)

Return the non-digit prefix of pages

protected static List<String>

Returns:

An array of strings representing the parts of the marker
parseFieldAndModifiers
(String
The argument string.
arg
)

Parse a field marker with modifiers, possibly containing a parenthesised modifier, as well as escaped colons and parentheses.

public static String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

CHARS_OF_FIRSTback to summary
private static final int CHARS_OF_FIRST

The maximum number of characters in the first author's last name.

DEPARTMENTSback to summary
private static final Pattern DEPARTMENTS

Matches with "dep"/"dip", case-insensitive

INLINE_ABBREVIATIONback to summary
private static final Pattern INLINE_ABBREVIATION

Matches uppercase english letters between "({" and "})", which should be used to abbreviate the name of an institution

LOGGERback to summary
private static final Logger LOGGER
MAX_ALPHA_AUTHORSback to summary
private static final int MAX_ALPHA_AUTHORS

The maximum number of name abbreviations that can be used. If there are more authors, MAX_ALPHA_AUTHORS - 1 name abbreviations will be displayed, and a + sign will be appended at the end.

NOT_CAPITAL_CHARACTERback to summary
private static final Pattern NOT_CAPITAL_CHARACTER

Matches everything that is not an uppercase ASCII letter. The intended use is to remove all lowercase letters

NOT_DECIMAL_DIGITback to summary
private static final Pattern NOT_DECIMAL_DIGIT

Matches everything that is not a unicode decimal digit.

patternback to summary
private final String pattern
WHITESPACEback to summary
private static final Pattern WHITESPACE

Constructor Detail

BracketedPatternback to summary
public BracketedPattern()
BracketedPatternback to summary
public BracketedPattern(String pattern)

Method Detail

allAuthorsback to summary
pack-priv static String allAuthors(AuthorList authorList)

Gets the last name of all authors/editors. Pattern [authors].

and others is converted to EtAl

Parameters
authorList:AuthorList

an AuthorList

Returns:String

the surname of all authors/editors

appendQuoteback to summary
private static void appendQuote(StringBuilder stringBuilder, StringTokenizer tokenizer)

Appends the content between, and including, two \" to the provided StringBuilder. Intended to be used by BracketedPattern#expandBrackets(String, Character, BibEntry, BibDatabase) when a \" is encountered by the StringTokenizer.

Parameters
stringBuilder:StringBuilder

the StringBuilder to which tokens will be appended

tokenizer:StringTokenizer

the tokenizer producing the tokens

applyModifiersback to summary
pack-priv static String applyModifiers(final String label, final List<String> parts, final int offset, Function<String, String> expandBracketContent)

Applies modifiers to a label generated based on a field marker.

Parameters
label:String

The generated label.

parts:List<String>

String array containing the modifiers.

offset:int

The number of initial items in the modifiers array to skip.

expandBracketContent:Function<String, String>

a function to expand the content in the parentheses.

Returns:String

The modified label.

authAuthEaback to summary
pack-priv static String authAuthEa(AuthorList authorList)
authEtalback to summary
pack-priv static String authEtal(AuthorList authorList, String delim, String append)

auth.etal, authEtAl, ... format

authIniNback to summary
pack-priv static String authIniN(AuthorList authorList, int n)

authIniN format

Parameters
authorList:AuthorList

The authors to format.

n:int

The maximum number of characters this string will be long. A negative number or zero will lead to "" be returned.

authNback to summary
private static String authN(AuthorList authorList, int num)

First N chars of the first author's last name.

authNofMthback to summary
private static String authNofMth(AuthorList authorList, int n, int m)

The first N characters of the Mth author's or editor's last name. M starts counting from 1. In case the Mth author is Author#OTHERS, + is returned.

authorsAlphaback to summary
pack-priv static String authorsAlpha(AuthorList authorList)

Returns the authors according to the BibTeX-alpha-Style

Parameters
authorList:AuthorList

an AuthorList

Returns:String

the initials of all authors' names

authShortback to summary
pack-priv static String authShort(AuthorList authorList)

authshort format

camelizeSignificantWordsInTitleback to summary
public static String camelizeSignificantWordsInTitle(String title)

Capitalises the significant words of the "title" field in the given BibTeX entry

camelizeTitleback to summary
private static String camelizeTitle(String title)
camelizeTitle_Nback to summary
private static String camelizeTitle_N(String title, int number)
contentBetweenBracketsback to summary
private static String contentBetweenBrackets(StringTokenizer tokenizer, final String pattern)

Returns the content enclosed between brackets, including enclosed quotes, and excluding the paired enclosing brackets. There may be brackets in it. Intended to be used by BracketedPattern#expandBrackets(String, Character, BibEntry, BibDatabase) when a [ is encountered, and has been consumed, by the StringTokenizer.

Parameters
tokenizer:StringTokenizer

the tokenizer producing the tokens

pattern:String

pattern used by expandBrackets, used for logging

Returns:String

the content enclosed by brackets

createAuthorListback to summary
private static AuthorList createAuthorList(String unparsedAuthors)

Parses the provided string to an AuthorList, which are then formatted by LatexToUnicodeAdapter. Afterward, any institutions are formatted into an institution key.

Parameters
unparsedAuthors:String

a string representation of authors or editors

Returns:AuthorList

an AuthorList consisting of authors and institution keys with resolved latex.

expandback to summary
public String expand(BibEntry bibentry)
expandback to summary
public String expand(BibEntry bibentry, BibDatabase database)

Expands the current pattern using the given bibentry and database. ";" is used as keyword delimiter.

Parameters
bibentry:BibEntry

The bibentry to expand.

database:BibDatabase

The database to use for string-lookups and cross-refs. May be null.

Returns:String

The expanded pattern. The empty string is returned, if it could not be expanded.

expandback to summary
public String expand(BibEntry bibentry, Character keywordDelimiter, BibDatabase database)

Expands the current pattern using the given bibentry, keyword delimiter, and database.

Parameters
bibentry:BibEntry

The bibentry to expand.

keywordDelimiter:Character

The keyword delimiter to use.

database:BibDatabase

The database to use for string-lookups and cross-refs. May be null.

Returns:String

The expanded pattern. The empty string is returned, if it could not be expanded.

expandBracketContentback to summary
public static Function<String, String> expandBracketContent(Character keywordDelimiter, BibEntry entry, BibDatabase database)

Utility method creating a function taking the string representation of the content of a bracketed expression and expanding it.

Parameters
keywordDelimiter:Character

The keyword delimiter to use

entry:BibEntry

The BibEntry to use for expansion

database:BibDatabase

The BibDatabase for field resolving. May be null.

Returns:Function<String, String>

a function accepting a bracketed expression and returning the result of expanding it

expandBracketsback to summary
public static String expandBrackets(String pattern, Character keywordDelimiter, BibEntry entry, BibDatabase database)

Expands a pattern

Parameters
pattern:String

The pattern to expand

keywordDelimiter:Character

The keyword delimiter to use

entry:BibEntry

The bibentry to use for expansion

database:BibDatabase

The database for field resolving. May be null.

Returns:String

The expanded pattern. Not null.

expandBracketsback to summary
public static String expandBrackets(String pattern, Function<String, String> bracketContentHandler)

Expands a pattern.

Parameters
pattern:String

The pattern to expand

bracketContentHandler:Function<String, String>

A function taking the string representation of the content of a bracketed pattern and expanding it

Returns:String

The expanded pattern. Not null.

firstAuthorback to summary
private static String firstAuthor(AuthorList authorList)

Gets the last name of the first author/editor

Parameters
authorList:AuthorList

an AuthorList

Returns:String

the surname of an author/editor or the von part if no lastname is prsent or "" if no author was found or both firstname+lastname are empty This method is guaranteed to never return null.

firstAuthorForenameInitialsback to summary
private static String firstAuthorForenameInitials(AuthorList authorList)

Gets the first name initials of the first author/editor

Parameters
authorList:AuthorList

an AuthorList

Returns:String

the first name initial of an author/editor or "" if no author was found This method is guaranteed to never return null.

firstAuthorVonAndLastback to summary
private static String firstAuthorVonAndLast(AuthorList authorList)

Gets the von part and the last name of the first author/editor. No spaces are returned.

Parameters
authorList:AuthorList

an AuthorList

Returns:String

the von part and surname of an author/editor or "" if no author was found. This method is guaranteed to never return null.

firstPageback to summary
public static String firstPage(String pages)

Split the pages field into separate numbers and return the lowest

Parameters
pages:String

(may not be null) a pages string such as 42--111 or 7,41,73--97 or 43+

Returns:String

the first page number or "" if no number is found in the string

Exceptions
NullPointerException:
if pages is null
formatTitleback to summary
private static String formatTitle(String title)

Removes any '-', unnecessary whitespace and latex commands formatting

generateInstitutionKeyback to summary
private static String generateInstitutionKey(String content)

An author or editor may be and institution not a person. In that case the key generator builds very long keys, e.g.: for “The Attributed Graph Grammar System (AGG)” -> “TheAttributedGraphGrammarSystemAGG”.

An institution name should be inside {} brackets. If the institution name includes its abbreviation this abbreviation should be in {} brackets. For the previous example the value should look like: {The Attributed Graph Grammar System ({AGG})}.

If an institution includes its abbreviation, i.e. "...({XYZ})", first such abbreviation should be used as the key value part of such author.

If an institution does not include its abbreviation the key should be generated from its name in the following way:

The institution value can contain: institution name, part of the institution, address, etc. These values should be comma separated. Institution name and possible part of the institution should be in the beginning, while address and secondary information should be in the end.

Each part is examined separately:

  1. We remove all tokens of a part which are one of the defined ignore words (the, press), which end with a dot (ltd., co., ...) and which first character is lowercase (of, on, di, ...).
  2. We detect the types of the part: university, technology institute, department, school, rest
    • University: "Uni[NameOfTheUniversity]"
    • Department: If the institution value contains more than one comma separated part, the department will be an abbreviation of all words beginning with the uppercase letter except of words: d[ei]p.*, school, faculty
    • School: same as department
    • Rest: If there are less than 3 tokens in such part than the result is a concatenation of those tokens. Otherwise, the result will be built from the first letter in each token.

Parts are concatenated together in the following way:

  • If there is a university part use it otherwise use the rest part.
  • If there is a school part append it.
  • If there is a department part and it is not same as school part append it.

Rest part is only the first part which do not match any other type. All other parts (address, ...) are ignored.

Parameters
content:String

the institution to generate a Bibtex key for

Returns:String

  • the institution key
  • "" in the case of a failure
  • null if content is null
getCamelizedTitleback to summary
public static String getCamelizedTitle(String title)

Capitalises and concatenates the words out of the "title" field in the given BibTeX entry

getCamelizedTitle_Nback to summary
public static String getCamelizedTitle_N(String title, int number)

Capitalises and concatenates the words out of the "title" field in the given BibTeX entry, to a maximum of N words.

getFieldValueback to summary
public static String getFieldValue(BibEntry entry, String pattern, Character keywordDelimiter, BibDatabase database)

Evaluates the given pattern to the given bibentry and database

Parameters
entry:BibEntry

The entry to get the field value from

pattern:String

A pattern string (such as auth, pureauth, authorLast)

keywordDelimiter:Character

The de

database:BibDatabase

The database to use for field resolving. May be null.

Returns:String

String containing the evaluation result. Empty string if the pattern cannot be resolved.

getSomeWordsback to summary
private static String getSomeWords(int number, String string)
getTitleWordsback to summary
public static String getTitleWords(int number, String title)

Determines "number" words out of the "title" field in the given BibTeX entry

getTitleWordsWithSpacesback to summary
private static String getTitleWordsWithSpaces(int number, String title)
getValidInstitutionNamePartsback to summary
private static List<String> getValidInstitutionNameParts(String name)
isInstitutionback to summary
private static boolean isInstitution(Author author)

Checks if an author is an institution which can get a citation key from generateInstitutionKey(String).

Parameters
author:Author

the checked author

Returns:boolean

true if only the last name is present and it contains at least one whitespace character.

joinAuthorsOnLastNameback to summary
private static String joinAuthorsOnLastName(AuthorList authorList, int maxAuthors, String delimiter, final String suffix)

Creates a string with all last names separated by a `delimiter`. If the number of authors are larger than `maxAuthors`, replace all excess authors with `suffix`.

Parameters
authorList:AuthorList

the list of authors

maxAuthors:int

the maximum number of authors in the string

delimiter:String

delimiter separating the last names of the authors

suffix:String

to replace excess authors with. Also used to replace and others.

Returns:String

a string consisting of authors' last names separated by a `delimiter` and with any authors excess of `maxAuthors` replaced with `suffix`

keepLettersAndDigitsOnlyback to summary
private static String keepLettersAndDigitsOnly(String in)
lastAuthorback to summary
private static String lastAuthor(AuthorList authorList)

Gets the last name of the last author/editor

Parameters
authorList:AuthorList

an AuthorList

Returns:String

the surname of an author/editor

lastAuthorForenameInitialsback to summary
private static String lastAuthorForenameInitials(AuthorList authorList)

Gets the forename initials of the last author/editor

Parameters
authorList:AuthorList

an AuthorList

Returns:String

the forename initial of an author/editor or "" if no author was found This method is guaranteed to never return null.

lastPageback to summary
public static String lastPage(String pages)

Split the pages field into separate numbers and return the highest

Parameters
pages:String

a pages string such as 42--111 or 7,41,73--97 or 43+

Returns:String

the first page number or "" if no number is found in the string

Exceptions
NullPointerException:
if pages is null.
nAuthorsback to summary
private static String nAuthors(AuthorList authorList, int n)

Gets the surnames of the first N authors and appends EtAl if there are more than N authors

Parameters
authorList:AuthorList

an AuthorList

n:int

the number of desired authors

Returns:String

Gets the surnames of the first N authors and appends EtAl if there are more than N authors

noOtherInstitutionKeyWordback to summary
private static boolean noOtherInstitutionKeyWord(String word)

Helper method for BracketedPattern#generateInstitutionKey(String). Checks that the word is not an institution keyword and has an uppercase first letter, except univ/tech key word.

Parameters
word:String

to check

oneAuthorPlusInitialsback to summary
pack-priv static String oneAuthorPlusInitials(AuthorList authorList)

Gets the first part of the last name of the first author/editor, and appends the last name initial of the remaining authors/editors. Maximum 5 characters

Parameters
authorList:AuthorList

an <AuthorList

Returns:String

the surname of all authors/editors

pagePrefixback to summary
public static String pagePrefix(String pages)

Return the non-digit prefix of pages

Parameters
pages:String

a pages string such as L42--111 or L7,41,73--97 or L43+

Returns:String

the non-digit prefix of pages (like "L" of L7) or "" if no non-digit prefix is found in the string

Exceptions
NullPointerException:
if pages is null.
parseFieldAndModifiersback to summary
protected static List<String> parseFieldAndModifiers(String arg)

Parse a field marker with modifiers, possibly containing a parenthesised modifier, as well as escaped colons and parentheses.

Parameters
arg:String

The argument string.

Returns:List<String>

An array of strings representing the parts of the marker

removeSmallWordsback to summary
public static String removeSmallWords(String title)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.jabref.logic.citationkeypattern back to summary

private final Enum BracketedPattern.Institution

extends Enum<BracketedPattern.Institution>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final BracketedPattern.Institution
private static final Pattern
DEPARTMENTS_OR_LABS

Matches with "dep"/"dip"/"lab", case insensitive

public static final BracketedPattern.Institution
private static final Pattern
TECHNOLOGICAL_INSTITUTES

Matches with "tech", case-insensitive

public static final BracketedPattern.Institution
private static final Pattern
UNIVERSITIES

Matches "uni" followed by "v" or "b", at the start of a string or after a space, case insensitive

public static final BracketedPattern.Institution

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static EnumSet<BracketedPattern.Institution>

Returns:

set containing all types that matches
findTypes
(List<String>
a list of words that constitute parts of an institution's name.
nameParts
)

Find which types of institutions have words in common with the given name parts.

public static BracketedPattern.Institution
public static BracketedPattern.Institution[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DEPARTMENTback to summary
public static final BracketedPattern.Institution DEPARTMENT
DEPARTMENTS_OR_LABSback to summary
private static final Pattern DEPARTMENTS_OR_LABS

Matches with "dep"/"dip"/"lab", case insensitive

SCHOOLback to summary
public static final BracketedPattern.Institution SCHOOL
TECHNOLOGICAL_INSTITUTESback to summary
private static final Pattern TECHNOLOGICAL_INSTITUTES

Matches with "tech", case-insensitive

TECHNOLOGYback to summary
public static final BracketedPattern.Institution TECHNOLOGY
UNIVERSITIESback to summary
private static final Pattern UNIVERSITIES

Matches "uni" followed by "v" or "b", at the start of a string or after a space, case insensitive

UNIVERSITYback to summary
public static final BracketedPattern.Institution UNIVERSITY

Constructor Detail

Institutionback to summary
private Institution()

Method Detail

findTypesback to summary
public static EnumSet<BracketedPattern.Institution> findTypes(List<String> nameParts)

Find which types of institutions have words in common with the given name parts.

Parameters
nameParts:List<String>

a list of words that constitute parts of an institution's name.

Returns:EnumSet<BracketedPattern.Institution>

set containing all types that matches

valueOfback to summary
public static BracketedPattern.Institution valueOf(String name)
valuesback to summary
public static BracketedPattern.Institution[] values()