File size: 843 Bytes
ebebfe8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
import sys

sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from plagdetect.oasources import search_core, search_doaj, search_europepmc

for fn, nm in [(search_core, "CORE"), (search_europepmc, "EuropePMC"),
               (search_doaj, "DOAJ")]:
    try:
        r = fn("deep learning neural network", n=3)
        print(f"{nm}: {len(r)} hits")
        for c in r[:2]:
            print(f"   title={c['title'][:46]!r} year={c.get('year')} "
                  f"doi={(c.get('doi') or '')[:28]!r}")
            print(f"      pdf={bool(c.get('pdf_url'))} "
                  f"text_url={bool(c.get('text_url'))} "
                  f"fulltext_chars={len(c.get('fulltext','') or '')} "
                  f"abstract={bool(c.get('abstract'))}")
    except Exception as e:
        print(f"{nm}: ERR {e!r}")