-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
144 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Foundation | ||
|
||
/// Model for a author's details. | ||
public struct Author: Codable, Hashable, Identifiable, Equatable, CustomStringConvertible { | ||
/// Unique identifier for the author. | ||
public let id: GoogleScholarID | ||
/// The name of the author. | ||
public let name: String | ||
/// The affiliation of the author. | ||
public let affiliation: String | ||
/// URL of the author's picture. | ||
public let pictureURL: String | ||
|
||
/// Initializes a new `Author` instance. | ||
/// | ||
/// - Parameters: | ||
/// - id: The Google Scholar author ID. | ||
/// - name: The name of the author. | ||
/// - affiliation: The affiliation of the author. | ||
/// - pictureURL: The URL of the author's picture. | ||
public init(id: GoogleScholarID, name: String, affiliation: String, pictureURL: String) { | ||
self.id = id | ||
self.name = name | ||
self.affiliation = affiliation | ||
self.pictureURL = pictureURL | ||
} | ||
|
||
public var description: String { | ||
return "Author(id: \(id), name: \(name), affiliation: \(affiliation), pictureURL: \(pictureURL))" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Foundation | ||
|
||
/// A struct representing the total citations and publications for a given author. | ||
public struct AuthorMetrics: Codable, Hashable, Equatable, CustomStringConvertible { | ||
|
||
/// The total number of citations across all fetched publications. | ||
public let citations: Int | ||
|
||
/// The total number of publications fetched. | ||
public let publications: Int | ||
|
||
/// Initializes a new `AuthorMetrics` instance. | ||
/// - Parameters: | ||
/// - citations: The total number of citations. | ||
/// - publications: The total number of publications. | ||
public init(citations: Int, publications: Int) { | ||
self.citations = citations | ||
self.publications = publications | ||
} | ||
|
||
public var description: String { | ||
return "AuthorMetrics(citations: \(citations), publications: \(publications)" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters