From 2abeae7e1eca4a52a3e4379c1648ce442ba3b473 Mon Sep 17 00:00:00 2001 From: "Moritz Schubotz (physikerwelt)" Date: Tue, 9 Jan 2024 20:24:06 +0100 Subject: [PATCH] Add plain XML test --- tests/data/plain.xml | 282 ++++++++++++++++++++++++++++++++++++++++ tests/test_plain_xml.py | 28 ++++ 2 files changed, 310 insertions(+) create mode 100644 tests/data/plain.xml create mode 100644 tests/test_plain_xml.py diff --git a/tests/data/plain.xml b/tests/data/plain.xml new file mode 100644 index 0000000..748200b --- /dev/null +++ b/tests/data/plain.xml @@ -0,0 +1,282 @@ + + + + + + + + 1 + maynard.james + Maynard, James + + + + + journal article + + + siaulys.jonas + 11807 + Jonas Šiaulys + Jonas Šiaulys (Vilnius) + + The prime \(k\)-tuples and small gaps between prime numbers are considered. Using a refinement of the Goldston-Pintz-Yildirim sieve method [\textit{D. A. Goldston} et al., Ann. Math. (2) 170, No. 2, 819--862 (2009; Zbl 1207.11096)] the author proves, for instance, the following estimates +\[ + \liminf_{n\to\infty}\,(p_{n+m}-p_n)\ll m^3\text{{e}}^{4m}, \quad \liminf_{n\to\infty}\,(p_{n+1}-p_n)\leq 600 +\] + with an absolute constant in sign \(\ll\). Here \(m\) is a natural number, and \(p_{\,l}\) denote the \(l\)-th prime number. + review + + 6383667 + prime number + small gap + sieve method + \(k\)-tuples conjecture + admissible set + Selberg sieve + symmetric polynomial + symmetric matrix + + English + + + + 10.4007/annals.2015.181.1.7 + doi + + + + 1311.4600 + arxiv + + + + 11N05 + msc2020 + Distribution of primes + + + 11N36 + msc2020 + Applications of sieve methods + + + + 1 + P. D. T. A. Elliott and H. Halberstam, ''A conjecture in prime number theory,'' in Symposia Mathematica, Vol. IV, London: Academic Press, 1970, pp. 59-72. + + elliott.peter-d-t-a + halberstam.heini + 3377327 + 11N35 + 11N13 + Zbl + 0 + 1970 + + + + 10.2307/1971450 + 2 + J. Friedlander and A. Granville, ''Limitations to the equi-distribution of primes. I,'' Ann. of Math., vol. 129, iss. 2, pp. 363-382, 1989. + + friedlander.john-b + granville.andrew-j + 4097497 + 11N05 + 11N13 + 11N35 + Zbl + 2531 + 1989 + + + + 10.1112/plms/pdn046 + 3 + D. A. Goldston, S. W. Graham, J. Pintz, and C. Y. Yildirim, ''Small gaps between products of two primes,'' Proc. Lond. Math. Soc., vol. 98, iss. 3, pp. 741-774, 2009. + + graham.sidney-w + yildirim.cem-yalcin + goldston.daniel-alan + pintz.janos + 5551831 + 11N25 + 11N36 + Zbl + 628 + 2009 + + + + 10.7169/facm/1229442618 + 4 + D. A. Goldston, J. Pintz, and C. Y. Yildirim, ''Primes in tuples. III. On the difference \(p_{n+\nu}-p_n\),'' Funct. Approx. Comment. Math., vol. 35, pp. 79-89, 2006. + + yildirim.cem-yalcin + pintz.janos + goldston.daniel-alan + 5135166 + 11N05 + 11N13 + Zbl + 423 + 2006 + + + + 10.4007/annals.2009.170.819 + 5 + D. A. Goldston, J. Pintz, and C. Y. Yildirim, ''Primes in tuples. I,'' Ann. of Math., vol. 170, iss. 2, pp. 819-862, 2009. + + yildirim.cem-yalcin + pintz.janos + goldston.daniel-alan + 5610431 + 11N05 + 11N36 + 11N13 + Zbl + 2531 + 2009 + + + + 10.1112/plms/pdm010 + 6 + D. A. Goldston and C. Y. Yildirim, ''Higher correlations of divisor sums related to primes. III. Small gaps between primes,'' Proc. Lond. Math. Soc., vol. 95, iss. 3, pp. 653-686, 2007. + + yildirim.cem-yalcin + goldston.daniel-alan + 5170700 + 11N05 + 11N37 + Zbl + 628 + 2007 + + + + + 7 + D. H. J. Polymath, New equidistribution estimates of Zhang type, and bounded gaps between primes. + + polymath.d-h-j + 6587992 + 11N35 + 11N05 + Zbl + 8474 + 2014 + + + + + 8 + A. Selberg, Collected Papers. Vol. II, New York: Springer-Verlag, 1991. + + selberg.atle + 195021 + 11-03 + 01A75 + 32-03 + 11M06 + 11M41 + 11N35 + 11N36 + 11F72 + 32N05 + 32N15 + Zbl + 0 + 1991 + + + + 10.4007/annals.2014.179.3.7 + 9 + Y. Zhang, ''Bounded gaps between primes,'' Ann. of Math., vol. 179, iss. 3, pp. 1121-1174, 2014. + + zhang.yitang.1 + 6302171 + 11N05 + 11N13 + 11N35 + 11N36 + 11L07 + Zbl + 2531 + 2014 + + + + + 383-413 + + + + 0003-486X + print + + + 1939-8980 + electronic + + 1 + 339578 + + + Princeton University, Mathematics Department, Princeton, NJ + 2531 + Ann. Math. (2) + Annals of Mathematics. Second Series + 181 + 2015 + + Ann. Math. (2) 181, No. 1, 383-413 (2015). + + + s + item with single author + + + r + item has references + + + c + is cited + + + <addition/> + <original/> + <subtitle/> + <title>Small gaps between primes + + 2015 + https://zbmath.org/6383667 + + ELASTIC + ELASTIC + ELASTIC + ELASTIC + ELASTIC + ELASTIC + ELASTIC + ELASTIC + ELASTIC + ELASTIC + ELASTIC + ELASTIC + ELASTIC + + + + successful request + true + ok + 0.04320859909057617 + 200 + 2024-01-08 15:25:14.541364 + + \ No newline at end of file diff --git a/tests/test_plain_xml.py b/tests/test_plain_xml.py new file mode 100644 index 0000000..b17fdbf --- /dev/null +++ b/tests/test_plain_xml.py @@ -0,0 +1,28 @@ +import os +import unittest +from xml.dom.minidom import parse +from xmldiff import main, formatting +from xmldiff.actions import MoveNode +from zbmath_rest2oai import getAsXml + + +class PlainXmlTest(unittest.TestCase): + def test_similarity(self): + real_string = getAsXml.final_xml2("6383667") + ref_location = os.path.join(os.path.dirname(__file__), './data/plain.xml') + with open(ref_location) as f: + dom = parse(f) + expected_string = dom.toprettyxml() + diff = main.diff_texts(expected_string, real_string, { + 'ratio_mode': 'accurate' + }) + essentials = list(filter(lambda e: not isinstance(e, MoveNode), diff)) + self.assertLessEqual(len(essentials), 333) + diff_text = main.diff_texts(expected_string, real_string, { + 'ratio_mode': 'accurate' + }, formatter=formatting.XMLFormatter()) + print(diff_text) + + +if __name__ == '__main__': + unittest.main()