gov.nist.nlpir.irfapps.hci
Class Bib2AppDocConv
java.lang.Object
|
+--gov.nist.nlpir.irf.conversion.IrfConverter
|
+--gov.nist.nlpir.irfapps.hci.Bib2AppDocConv
- public class Bib2AppDocConv
- extends IrfConverter
Converts TROFF Bibliogrphic documents in a file to HciDoc
documents using Bib2AppDocConv, which creates proxy data elements
as attributes rather than data elements
The class was initially translated verbatim from C++. This was
less than ideal. To make this work better in Java, the lexical
scanning portion of the code was moved to BibToken.java; this has
simplified the method Convert1 significantly. Methods for handling
personal names were added.
- Version:
- $Revision: 1.2 $
- Author:
- This software was produced by NIST, an agency of the
U.S. government, and by statute is not subject to copyright in the
United States. Recipients of this software assume all
responsibilities associated with its operation, modification and
maintenance.
Field Summary |
(package private) java.io.PushbackReader |
file
Reader for use in getting document data from a file |
Constructor Summary |
Bib2AppDocConv()
Makes a new Bib to AppDoc2 Converter |
Method Summary |
ProxyDocument |
convert1()
Converts one document from a file opened using a
PushbackReader |
ProxyDocument |
convert1x(java.io.PushbackReader f,
int ignore)
Converts one document from a file opened using a
PushbackReader. |
static java.lang.String |
firstName(java.lang.String name)
Extracts first name from personal name string. |
int |
ignoreN(int numberOfDocsToSkip)
Skips numberOfDocsToSkip in the input file starting from the
current location |
void |
setRawDocLocation(java.lang.String loc)
Gives the converter the information it needs to access the raw
data for the documents to be converted. |
static java.lang.String |
surName(java.lang.String name)
Extracts surname from personal name string. |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
file
java.io.PushbackReader file
- Reader for use in getting document data from a file
Bib2AppDocConv
public Bib2AppDocConv()
- Makes a new Bib to AppDoc2 Converter
setRawDocLocation
public void setRawDocLocation(java.lang.String loc)
throws java.io.FileNotFoundException
- Gives the converter the information it needs to access the raw
data for the documents to be converted. In the case of this
converter this will be a fully qualified file name.
- Parameters:
loc
- fully qualified name of the file with the raw doc data- Overrides:
- setRawDocLocation in class IrfConverter
ignoreN
public int ignoreN(int numberOfDocsToSkip)
throws java.io.IOException
- Skips numberOfDocsToSkip in the input file starting from the
current location
- Parameters:
numberOfDocsToSkip
- number of documents to skip- Returns:
- number of docs
- Overrides:
- ignoreN in class IrfConverter
convert1
public ProxyDocument convert1()
throws java.io.IOException
- Converts one document from a file opened using a
PushbackReader
- Returns:
- the document converted or null
- Overrides:
- convert1 in class IrfConverter
convert1x
public ProxyDocument convert1x(java.io.PushbackReader f,
int ignore)
throws java.io.IOException
- Converts one document from a file opened using a
PushbackReader.
- Parameters:
f
- PushbackReader file reference.ignore
- Return null document if true.
firstName
public static java.lang.String firstName(java.lang.String name)
- Extracts first name from personal name string.
defined as everything up to the last space.
- Parameters:
name
- personal name
surName
public static java.lang.String surName(java.lang.String name)
- Extracts surname from personal name string.
defined as everything starting after the last space and going to
the end
- Parameters:
name
- personal name