2024-02-04 10:07:15 +01:00
|
|
|
package eu.dnetlib.dhp.enrich.orcid
|
|
|
|
|
2024-04-15 18:19:29 +02:00
|
|
|
import eu.dnetlib.pace.util.AuthorMatchers.matchOrderedTokenAndAbbreviations
|
2024-02-04 10:07:15 +01:00
|
|
|
import org.junit.jupiter.api.Assertions.{assertFalse, assertTrue}
|
|
|
|
import org.junit.jupiter.api.Test
|
|
|
|
|
|
|
|
class ORCIDAuthorMatchersTest {
|
|
|
|
|
|
|
|
@Test def testShortNames(): Unit = {
|
|
|
|
assertTrue(matchOrderedTokenAndAbbreviations("Lasagni Mariozzi Federico", "Lasagni F. Mariozzi"))
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test def testInvertedNames(): Unit = {
|
|
|
|
assertTrue(matchOrderedTokenAndAbbreviations("Andrea, Paolo Marcello", "Marcello Paolo, Andrea"))
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test def testHomonymy(): Unit = {
|
|
|
|
assertTrue(matchOrderedTokenAndAbbreviations("Jang Myung Lee", "J Lee"))
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test def testAmbiguousShortNames(): Unit = {
|
|
|
|
assertFalse(matchOrderedTokenAndAbbreviations("P. Mariozzi", "M. Paolozzi"))
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test def testNonMatches(): Unit = {
|
|
|
|
assertFalse(matchOrderedTokenAndAbbreviations("Giovanni Paolozzi", "Francesco Paolozzi"))
|
|
|
|
assertFalse(matchOrderedTokenAndAbbreviations("G. Paolozzi", "F. Paolozzi"))
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test def testChineseNames(): Unit = {
|
|
|
|
assertTrue(matchOrderedTokenAndAbbreviations("孙林 Sun Lin", "Sun Lin"))
|
|
|
|
// assertTrue(AuthorsMatchRevised.compare("孙林 Sun Lin", "孙林")); // not yet implemented
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|