@Test public void convert_NO_REFERENCES() { ExtractedDocumentMetadataMergedWithOriginal inputDocument = ExtractedDocumentMetadataMergedWithOriginal.newBuilder() .setId("document-id") .setTitle("Some Title") .setJournal("Journal Something") .setImportedAuthors(Lists.newArrayList(generateAuthor("author-1"), generateAuthor("author-2"))) .setPages(new Range("5", "8")) .setYear(1999) .setReferences(Lists.newArrayList()) .setPublicationType(new PublicationType(true, false)) .build(); DocumentMetadata retDocumentMetadata = converter.convert(inputDocument, emptyReferencePositions); DocumentMetadata expectedDocumentMetadata = DocumentMetadata.newBuilder() .setId("document-id") .setBasicMetadata(BasicMetadata.newBuilder() .setAuthors(Lists.newArrayList("author-1", "author-2")) .setTitle("Some Title") .setJournal("Journal Something") .setPages("5-8") .setYear("1999") .build()) .setReferences(Lists.newArrayList()) .build(); assertEquals(expectedDocumentMetadata, retDocumentMetadata); }
public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions) { Preconditions.checkNotNull(sourceDocument); DocumentMetadata destDocument = DocumentMetadata.newBuilder() .setId(sourceDocument.getId()) .setBasicMetadata(convertBasicMetadata(sourceDocument)) .setReferences(convertReferences(sourceDocument.getReferences(), matchedReferencePositions)) .build(); return destDocument; }
DocumentToCitationDocumentConverter { public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions) { Preconditions.checkNotNull(sourceDocument); DocumentMetadata destDocument = DocumentMetadata.newBuilder() .setId(sourceDocument.getId()) .setBasicMetadata(convertBasicMetadata(sourceDocument)) .setReferences(convertReferences(sourceDocument.getReferences(), matchedReferencePositions)) .build(); return destDocument; } }
DocumentToCitationDocumentConverter { public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions) { Preconditions.checkNotNull(sourceDocument); DocumentMetadata destDocument = DocumentMetadata.newBuilder() .setId(sourceDocument.getId()) .setBasicMetadata(convertBasicMetadata(sourceDocument)) .setReferences(convertReferences(sourceDocument.getReferences(), matchedReferencePositions)) .build(); return destDocument; }  }
DocumentToCitationDocumentConverter { public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions) { Preconditions.checkNotNull(sourceDocument); DocumentMetadata destDocument = DocumentMetadata.newBuilder() .setId(sourceDocument.getId()) .setBasicMetadata(convertBasicMetadata(sourceDocument)) .setReferences(convertReferences(sourceDocument.getReferences(), matchedReferencePositions)) .build(); return destDocument; }  DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions); }
DocumentToCitationDocumentConverter { public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions) { Preconditions.checkNotNull(sourceDocument); DocumentMetadata destDocument = DocumentMetadata.newBuilder() .setId(sourceDocument.getId()) .setBasicMetadata(convertBasicMetadata(sourceDocument)) .setReferences(convertReferences(sourceDocument.getReferences(), matchedReferencePositions)) .build(); return destDocument; }  DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal sourceDocument, Set<Integer> matchedReferencePositions);  }