diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d234ee2eb..067763562 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,13 +45,21 @@ jobs: sudo apt-get install -y libreoffice poppler-utils python -m pip install --upgrade setuptools wheel pip install . - pip install psycopg2-binary==2.9.3 + pip install psycopg2-binary==2.9.3 unittest-xml-reporting npm ci --no-audit --ignore-scripts --only=prod npm i -g sass - - name: Lint and Run tests + - name: Run tests env: DATABASE_URL: "postgres://postgres:postgres@localhost:5432/peach-jam" + TEST_RUNNER: "xmlrunner.extra.djangotestrunner.XMLTestRunner" run: | pre-commit run --all-files python manage.py test ${{ matrix.app }} --settings=${{ matrix.app }}.settings + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action/linux@v2 + if: success() || failure() + continue-on-error: true + with: + files: test-reports/*.xml diff --git a/africanlii/tests/test_views.py b/africanlii/tests/test_views.py index b70b3a812..7ec67e47f 100644 --- a/africanlii/tests/test_views.py +++ b/africanlii/tests/test_views.py @@ -2,7 +2,7 @@ class AfricanliiViewsTest(TestCase): - fixtures = ["documents/sample_documents"] + fixtures = ["tests/countries", "documents/sample_documents"] def test_homepage(self): response = self.client.get("/") diff --git a/africanlii/views/taxonomy.py b/africanlii/views/taxonomy.py index 7c0f43b8e..2f62127df 100644 --- a/africanlii/views/taxonomy.py +++ b/africanlii/views/taxonomy.py @@ -125,21 +125,21 @@ def add_facets(self, context): "jurisdictions": { "label": _("Judrisdictions"), "type": "checkbox", - "options": [j for j, n, x in res.facets.jurisdiction], + "options": [(j, j) for j, n, x in res.facets.jurisdiction], "values": self.request.GET.getlist("jurisdictions"), }, "years": { "label": _("Years"), "type": "checkbox", "options": [ - str(y) for y, n, x in sorted(res.facets.year, reverse=True) + (str(y), y) for y, n, x in sorted(res.facets.year, reverse=True) ], "values": self.request.GET.getlist("years"), }, "alphabet": { "label": _("Alphabet"), "type": "radio", - "options": lowercase_alphabet(), + "options": [(a, a) for a in lowercase_alphabet()], "values": self.request.GET.get("alphabet"), }, } diff --git a/peachjam/fixtures/documents/sample_documents.json b/peachjam/fixtures/documents/sample_documents.json index 4d4f72f28..90aeb4e10 100644 --- a/peachjam/fixtures/documents/sample_documents.json +++ b/peachjam/fixtures/documents/sample_documents.json @@ -1,3145 +1,45 @@ [ { - "model": "peachjam.courtclass", - "pk": 2, - "fields": { - "name": "High Court", - "description": "" - } - }, - { - "fields": { - "code": "ECOWASCJ", - "court_class": 2, - "name": "ECOWAS Community Court of Justice" - }, - "model": "peachjam.court", - "pk": 1 - }, - { - "fields": { - "area": "390580.00", - "capital": "Harare", - "continent": "AF", - "currency_code": "ZWL", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "ZI", - "geonameid": 878675, - "iso3": "ZWE", - "iso_numeric": 716, - "languages": "en-ZW,sn,nr,nd", - "name": "Zimbabwe", - "neighbours": "ZA,MZ,BW,ZM", - "phone": "263", - "population": 14439018, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".zw" - }, - "model": "countries_plus.country", - "pk": "ZW" - }, - { - "fields": { - "area": "752614.00", - "capital": "Lusaka", - "continent": "AF", - "currency_code": "ZMW", - "currency_name": "Kwacha", - "currency_symbol": null, - "equivalent_fips_code": null, - "fips": "ZA", - "geonameid": 895949, - "iso3": "ZMB", - "iso_numeric": 894, - "languages": "en-ZM,bem,loz,lun,lue,ny,toi", - "name": "Zambia", - "neighbours": "ZW,TZ,MZ,CD,NA,MW,AO", - "phone": "260", - "population": 17351822, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".zm" - }, - "model": "countries_plus.country", - "pk": "ZM" - }, - { - "fields": { - "area": "329560.00", - "capital": "Hanoi", - "continent": "AS", - "currency_code": "VND", - "currency_name": "Dong", - "currency_symbol": "\u20ab", - "equivalent_fips_code": null, - "fips": "VM", - "geonameid": 1562822, - "iso3": "VNM", - "iso_numeric": 704, - "languages": "vi,en,fr,zh,km", - "name": "Vietnam", - "neighbours": "CN,LA,KH", - "phone": "84", - "population": 95540395, - "postal_code_format": "######", - "postal_code_regex": "^(\\d{6})$", - "tld": ".vn" - }, - "model": "countries_plus.country", - "pk": "VN" - }, - { - "fields": { - "area": "12200.00", - "capital": "Port Vila", - "continent": "OC", - "currency_code": "VUV", - "currency_name": "Vatu", - "currency_symbol": "Vt", - "equivalent_fips_code": null, - "fips": "NH", - "geonameid": 2134431, - "iso3": "VUT", - "iso_numeric": 548, - "languages": "bi,en-VU,fr-VU", - "name": "Vanuatu", - "neighbours": null, - "phone": "678", - "population": 292680, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".vu" - }, - "model": "countries_plus.country", - "pk": "VU" - }, - { - "fields": { - "area": "352.00", - "capital": "Charlotte Amalie", - "continent": "NA", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "VQ", - "geonameid": 4796775, - "iso3": "VIR", - "iso_numeric": 850, - "languages": "en-VI", - "name": "U.S. Virgin Islands", - "neighbours": null, - "phone": "+1-340", - "population": 106977, - "postal_code_format": "#####-####", - "postal_code_regex": "^008\\d{2}(?:-\\d{4})?$", - "tld": ".vi" - }, - "model": "countries_plus.country", - "pk": "VI" - }, - { - "fields": { - "area": "0.00", - "capital": null, - "continent": "OC", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": null, - "geonameid": 5854968, - "iso3": "UMI", - "iso_numeric": 581, - "languages": "en-UM", - "name": "United States Minor Outlying Islands", - "neighbours": null, - "phone": "1", - "population": 0, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".um" - }, - "model": "countries_plus.country", - "pk": "UM" - }, - { - "fields": { - "area": "9629091.00", - "capital": "Washington", - "continent": "NA", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "US", - "geonameid": 6252001, - "iso3": "USA", - "iso_numeric": 840, - "languages": "en-US,es-US,haw,fr", - "name": "United States", - "neighbours": "CA,MX,CU", - "phone": "1", - "population": 327167434, - "postal_code_format": "#####-####", - "postal_code_regex": "^\\d{5}(-\\d{4})?$", - "tld": ".us" - }, - "model": "countries_plus.country", - "pk": "US" - }, - { - "fields": { - "area": "244820.00", - "capital": "London", - "continent": "EU", - "currency_code": "GBP", - "currency_name": "Pound", - "currency_symbol": "\u00a3", - "equivalent_fips_code": null, - "fips": "UK", - "geonameid": 2635167, - "iso3": "GBR", - "iso_numeric": 826, - "languages": "en-GB,cy-GB,gd", - "name": "United Kingdom", - "neighbours": "IE", - "phone": "44", - "population": 66488991, - "postal_code_format": "@# #@@|@## #@@|@@# #@@|@@## #@@|@#@ #@@|@@#@ #@@|GIR0AA", - "postal_code_regex": "^([Gg][Ii][Rr]\\s?0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))\\s?[0-9][A-Za-z]{2})$", - "tld": ".uk" - }, - "model": "countries_plus.country", - "pk": "GB" - }, - { - "fields": { - "area": "82880.00", - "capital": "Abu Dhabi", - "continent": "AS", - "currency_code": "AED", - "currency_name": "Dirham", - "currency_symbol": "\u062f.\u0625", - "equivalent_fips_code": null, - "fips": "AE", - "geonameid": 290557, - "iso3": "ARE", - "iso_numeric": 784, - "languages": "ar-AE,fa,en,hi,ur", - "name": "United Arab Emirates", - "neighbours": "SA,OM", - "phone": "971", - "population": 9630959, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".ae" - }, - "model": "countries_plus.country", - "pk": "AE" - }, - { - "fields": { - "area": "236040.00", - "capital": "Kampala", - "continent": "AF", - "currency_code": "UGX", - "currency_name": "Shilling", - "currency_symbol": "Sh", - "equivalent_fips_code": null, - "fips": "UG", - "geonameid": 226074, - "iso3": "UGA", - "iso_numeric": 800, - "languages": "en-UG,lg,sw,ar", - "name": "Uganda", - "neighbours": "TZ,KE,SS,CD,RW", - "phone": "256", - "population": 42723139, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".ug" - }, - "model": "countries_plus.country", - "pk": "UG" - }, - { - "fields": { - "area": "26.00", - "capital": "Funafuti", - "continent": "OC", - "currency_code": "AUD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "TV", - "geonameid": 2110297, - "iso3": "TUV", - "iso_numeric": 798, - "languages": "tvl,en,sm,gil", - "name": "Tuvalu", - "neighbours": null, - "phone": "688", - "population": 11508, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".tv" - }, - "model": "countries_plus.country", - "pk": "TV" - }, - { - "fields": { - "area": "430.00", - "capital": "Cockburn Town", - "continent": "NA", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "TK", - "geonameid": 3576916, - "iso3": "TCA", - "iso_numeric": 796, - "languages": "en-TC", - "name": "Turks and Caicos Islands", - "neighbours": null, - "phone": "+1-649", - "population": 37665, - "postal_code_format": "TKCA 1ZZ", - "postal_code_regex": "^(TKCA 1ZZ)$", - "tld": ".tc" - }, - "model": "countries_plus.country", - "pk": "TC" - }, - { - "fields": { - "area": "5128.00", - "capital": "Port of Spain", - "continent": "NA", - "currency_code": "TTD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "TD", - "geonameid": 3573591, - "iso3": "TTO", - "iso_numeric": 780, - "languages": "en-TT,hns,fr,es,zh", - "name": "Trinidad and Tobago", - "neighbours": null, - "phone": "+1-868", - "population": 1389858, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".tt" - }, - "model": "countries_plus.country", - "pk": "TT" - }, - { - "fields": { - "area": "748.00", - "capital": "Nuku'alofa", - "continent": "OC", - "currency_code": "TOP", - "currency_name": "Pa'anga", - "currency_symbol": "T$", - "equivalent_fips_code": null, - "fips": "TN", - "geonameid": 4032283, - "iso3": "TON", - "iso_numeric": 776, - "languages": "to,en-TO", - "name": "Tonga", - "neighbours": null, - "phone": "676", - "population": 103197, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".to" - }, - "model": "countries_plus.country", - "pk": "TO" - }, - { - "fields": { - "area": "10.00", - "capital": null, - "continent": "OC", - "currency_code": "NZD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "TL", - "geonameid": 4031074, - "iso3": "TKL", - "iso_numeric": 772, - "languages": "tkl,en-TK", - "name": "Tokelau", - "neighbours": null, - "phone": "690", - "population": 1466, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".tk" - }, - "model": "countries_plus.country", - "pk": "TK" - }, - { - "fields": { - "area": "15007.00", - "capital": "Dili", - "continent": "OC", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "TT", - "geonameid": 1966436, - "iso3": "TLS", - "iso_numeric": 626, - "languages": "tet,pt-TL,id,en", - "name": "Timor Leste", - "neighbours": "ID", - "phone": "670", - "population": 1267972, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".tl" - }, - "model": "countries_plus.country", - "pk": "TL" - }, - { - "fields": { - "area": "514000.00", - "capital": "Bangkok", - "continent": "AS", - "currency_code": "THB", - "currency_name": "Baht", - "currency_symbol": "\u0e3f", - "equivalent_fips_code": null, - "fips": "TH", - "geonameid": 1605651, - "iso3": "THA", - "iso_numeric": 764, - "languages": "th,en", - "name": "Thailand", - "neighbours": "LA,MM,KH,MY", - "phone": "66", - "population": 69428524, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".th" - }, - "model": "countries_plus.country", - "pk": "TH" - }, - { - "fields": { - "area": "945087.00", - "capital": "Dodoma", - "continent": "AF", - "currency_code": "TZS", - "currency_name": "Shilling", - "currency_symbol": "Sh", - "equivalent_fips_code": null, - "fips": "TZ", - "geonameid": 149590, - "iso3": "TZA", - "iso_numeric": 834, - "languages": "sw-TZ,en,ar", - "name": "Tanzania", - "neighbours": "MZ,KE,CD,RW,ZM,BI,UG,MW", - "phone": "255", - "population": 56318348, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".tz" - }, - "model": "countries_plus.country", - "pk": "TZ" - }, - { - "fields": { - "area": "185180.00", - "capital": "Damascus", - "continent": "AS", - "currency_code": "SYP", - "currency_name": "Pound", - "currency_symbol": "\u00a3, \u0644.\u0633", - "equivalent_fips_code": null, - "fips": "SY", - "geonameid": 163843, - "iso3": "SYR", - "iso_numeric": 760, - "languages": "ar-SY,ku,hy,arc,fr,en", - "name": "Syria", - "neighbours": "IQ,JO,IL,TR,LB", - "phone": "963", - "population": 16906283, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".sy" - }, - "model": "countries_plus.country", - "pk": "SY" - }, - { - "fields": { - "area": "163270.00", - "capital": "Paramaribo", - "continent": "SA", - "currency_code": "SRD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "NS", - "geonameid": 3382998, - "iso3": "SUR", - "iso_numeric": 740, - "languages": "nl-SR,en,srn,hns,jv", - "name": "Suriname", - "neighbours": "GY,BR,GF", - "phone": "597", - "population": 575991, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".sr" - }, - "model": "countries_plus.country", - "pk": "SR" - }, - { - "fields": { - "area": "1861484.00", - "capital": "Khartoum", - "continent": "AF", - "currency_code": "SDG", - "currency_name": "Pound", - "currency_symbol": "S$", - "equivalent_fips_code": null, - "fips": "SU", - "geonameid": 366755, - "iso3": "SDN", - "iso_numeric": 729, - "languages": "ar-SD,en,fia", - "name": "Sudan", - "neighbours": "SS,TD,EG,ET,ER,LY,CF", - "phone": "249", - "population": 41801533, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".sd" - }, - "model": "countries_plus.country", - "pk": "SD" - }, - { - "fields": { - "area": "65610.00", - "capital": "Colombo", - "continent": "AS", - "currency_code": "LKR", - "currency_name": "Rupee", - "currency_symbol": "\u0bb0\u0bc2", - "equivalent_fips_code": null, - "fips": "CE", - "geonameid": 1227603, - "iso3": "LKA", - "iso_numeric": 144, - "languages": "si,ta,en", - "name": "Sri Lanka", - "neighbours": null, - "phone": "94", - "population": 21670000, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".lk" - }, - "model": "countries_plus.country", - "pk": "LK" - }, - { - "fields": { - "area": "644329.00", - "capital": "Juba", - "continent": "AF", - "currency_code": "SSP", - "currency_name": "Pound", - "currency_symbol": null, - "equivalent_fips_code": null, - "fips": "OD", - "geonameid": 7909807, - "iso3": "SSD", - "iso_numeric": 728, - "languages": "en", - "name": "South Sudan", - "neighbours": "CD,CF,ET,KE,SD,UG", - "phone": "211", - "population": 8260490, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".ss" - }, - "model": "countries_plus.country", - "pk": "SS" - }, - { - "fields": { - "area": "98480.00", - "capital": "Seoul", - "continent": "AS", - "currency_code": "KRW", - "currency_name": "Won", - "currency_symbol": "\u20a9", - "equivalent_fips_code": null, - "fips": "KS", - "geonameid": 1835841, - "iso3": "KOR", - "iso_numeric": 410, - "languages": "ko-KR,en", - "name": "South Korea", - "neighbours": "KP", - "phone": "82", - "population": 51635256, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".kr" - }, - "model": "countries_plus.country", - "pk": "KR" - }, - { - "fields": { - "area": "3903.00", - "capital": "Grytviken", - "continent": "AN", - "currency_code": "GBP", - "currency_name": "Pound", - "currency_symbol": "\u00a3", - "equivalent_fips_code": null, - "fips": "SX", - "geonameid": 3474415, - "iso3": "SGS", - "iso_numeric": 239, - "languages": "en", - "name": "South Georgia and the South Sandwich Islands", - "neighbours": null, - "phone": null, - "population": 30, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".gs" - }, - "model": "countries_plus.country", - "pk": "GS" - }, - { - "fields": { - "area": "1219912.00", - "capital": "Pretoria", - "continent": "AF", - "currency_code": "ZAR", - "currency_name": "Rand", - "currency_symbol": "R", - "equivalent_fips_code": null, - "fips": "SF", - "geonameid": 953987, - "iso3": "ZAF", - "iso_numeric": 710, - "languages": "zu,xh,af,nso,en-ZA,tn,st,ts,ss,ve,nr", - "name": "South Africa", - "neighbours": "ZW,SZ,MZ,BW,NA,LS", - "phone": "27", - "population": 57779622, - "postal_code_format": "####", - "postal_code_regex": "^(\\d{4})$", - "tld": ".za" - }, - "model": "countries_plus.country", - "pk": "ZA" - }, - { - "fields": { - "area": "637657.00", - "capital": "Mogadishu", - "continent": "AF", - "currency_code": "SOS", - "currency_name": "Shilling", - "currency_symbol": "Sh", - "equivalent_fips_code": null, - "fips": "SO", - "geonameid": 51537, - "iso3": "SOM", - "iso_numeric": 706, - "languages": "so-SO,ar-SO,it,en-SO", - "name": "Somalia", - "neighbours": "ET,KE,DJ", - "phone": "252", - "population": 15008154, - "postal_code_format": "@@ #####", - "postal_code_regex": "^([A-Z]{2}\\d{5})$", - "tld": ".so" - }, - "model": "countries_plus.country", - "pk": "SO" - }, - { - "fields": { - "area": "28450.00", - "capital": "Honiara", - "continent": "OC", - "currency_code": "SBD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "BP", - "geonameid": 2103350, - "iso3": "SLB", - "iso_numeric": 90, - "languages": "en-SB,tpi", - "name": "Solomon Islands", - "neighbours": null, - "phone": "677", - "population": 652858, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".sb" - }, - "model": "countries_plus.country", - "pk": "SB" - }, - { - "fields": { - "area": "21.00", - "capital": "Philipsburg", - "continent": "NA", - "currency_code": "ANG", - "currency_name": "Guilder", - "currency_symbol": "\u0192", - "equivalent_fips_code": null, - "fips": "NN", - "geonameid": 7609695, - "iso3": "SXM", - "iso_numeric": 534, - "languages": "nl,en", - "name": "Sint Maarten", - "neighbours": "MF", - "phone": "599", - "population": 40654, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".sx" - }, - "model": "countries_plus.country", - "pk": "SX" - }, - { - "fields": { - "area": "692.70", - "capital": "Singapore", - "continent": "AS", - "currency_code": "SGD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "SN", - "geonameid": 1880251, - "iso3": "SGP", - "iso_numeric": 702, - "languages": "cmn,en-SG,ms-SG,ta-SG,zh-SG", - "name": "Singapore", - "neighbours": null, - "phone": "65", - "population": 5638676, - "postal_code_format": "######", - "postal_code_regex": "^(\\d{6})$", - "tld": ".sg" - }, - "model": "countries_plus.country", - "pk": "SG" - }, - { - "fields": { - "area": "71740.00", - "capital": "Freetown", - "continent": "AF", - "currency_code": "SLL", - "currency_name": "Leone", - "currency_symbol": "Le", - "equivalent_fips_code": null, - "fips": "SL", - "geonameid": 2403846, - "iso3": "SLE", - "iso_numeric": 694, - "languages": "en-SL,men,tem", - "name": "Sierra Leone", - "neighbours": "LR,GN", - "phone": "232", - "population": 7650154, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".sl" - }, - "model": "countries_plus.country", - "pk": "SL" - }, - { - "fields": { - "area": "455.00", - "capital": "Victoria", - "continent": "AF", - "currency_code": "SCR", - "currency_name": "Rupee", - "currency_symbol": "\u20a8", - "equivalent_fips_code": null, - "fips": "SE", - "geonameid": 241170, - "iso3": "SYC", - "iso_numeric": 690, - "languages": "en-SC,fr-SC", - "name": "Seychelles", - "neighbours": null, - "phone": "248", - "population": 96762, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".sc" - }, - "model": "countries_plus.country", - "pk": "SC" - }, - { - "fields": { - "area": "2944.00", - "capital": "Apia", - "continent": "OC", - "currency_code": "WST", - "currency_name": "Tala", - "currency_symbol": "T", - "equivalent_fips_code": null, - "fips": "WS", - "geonameid": 4034894, - "iso3": "WSM", - "iso_numeric": 882, - "languages": "sm,en-WS", - "name": "Samoa", - "neighbours": null, - "phone": "685", - "population": 196130, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".ws" - }, - "model": "countries_plus.country", - "pk": "WS" - }, - { - "fields": { - "area": "389.00", - "capital": "Kingstown", - "continent": "NA", - "currency_code": "XCD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "VC", - "geonameid": 3577815, - "iso3": "VCT", - "iso_numeric": 670, - "languages": "en-VC,fr", - "name": "Saint Vincent and the Grenadines", - "neighbours": null, - "phone": "+1-784", - "population": 110211, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".vc" - }, - "model": "countries_plus.country", - "pk": "VC" - }, - { - "fields": { - "area": "616.00", - "capital": "Castries", - "continent": "NA", - "currency_code": "XCD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "ST", - "geonameid": 3576468, - "iso3": "LCA", - "iso_numeric": 662, - "languages": "en-LC", - "name": "Saint Lucia", - "neighbours": null, - "phone": "+1-758", - "population": 181889, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".lc" - }, - "model": "countries_plus.country", - "pk": "LC" - }, - { - "fields": { - "area": "261.00", - "capital": "Basseterre", - "continent": "NA", - "currency_code": "XCD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "SC", - "geonameid": 3575174, - "iso3": "KNA", - "iso_numeric": 659, - "languages": "en-KN", - "name": "Saint Kitts and Nevis", - "neighbours": null, - "phone": "+1-869", - "population": 52441, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".kn" - }, - "model": "countries_plus.country", - "pk": "KN" - }, - { - "fields": { - "area": "410.00", - "capital": "Jamestown", - "continent": "AF", - "currency_code": "SHP", - "currency_name": "Pound", - "currency_symbol": "\u00a3", - "equivalent_fips_code": null, - "fips": "SH", - "geonameid": 3370751, - "iso3": "SHN", - "iso_numeric": 654, - "languages": "en-SH", - "name": "Saint Helena", - "neighbours": null, - "phone": "290", - "population": 7460, - "postal_code_format": "STHL 1ZZ", - "postal_code_regex": "^(STHL1ZZ)$", - "tld": ".sh" - }, - "model": "countries_plus.country", - "pk": "SH" - }, - { - "fields": { - "area": "26338.00", - "capital": "Kigali", - "continent": "AF", - "currency_code": "RWF", - "currency_name": "Franc", - "currency_symbol": "Fr", - "equivalent_fips_code": null, - "fips": "RW", - "geonameid": 49518, - "iso3": "RWA", - "iso_numeric": 646, - "languages": "rw,en-RW,fr-RW,sw", - "name": "Rwanda", - "neighbours": "TZ,CD,BI,UG", - "phone": "250", - "population": 12301939, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".rw" - }, - "model": "countries_plus.country", - "pk": "RW" - }, - { - "fields": { - "area": "9104.00", - "capital": "San Juan", - "continent": "NA", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "RQ", - "geonameid": 4566966, - "iso3": "PRI", - "iso_numeric": 630, - "languages": "en-PR,es-PR", - "name": "Puerto Rico", - "neighbours": null, - "phone": "+1-787,1-939", - "population": 3195153, - "postal_code_format": "#####-####", - "postal_code_regex": "^00[679]\\d{2}(?:-\\d{4})?$", - "tld": ".pr" - }, - "model": "countries_plus.country", - "pk": "PR" - }, - { - "fields": { - "area": "47.00", - "capital": "Adamstown", - "continent": "OC", - "currency_code": "NZD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "PC", - "geonameid": 4030699, - "iso3": "PCN", - "iso_numeric": 612, - "languages": "en-PN", - "name": "Pitcairn", - "neighbours": null, - "phone": "870", - "population": 46, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".pn" - }, - "model": "countries_plus.country", - "pk": "PN" - }, - { - "fields": { - "area": "300000.00", - "capital": "Manila", - "continent": "AS", - "currency_code": "PHP", - "currency_name": "Peso", - "currency_symbol": "\u20b1", - "equivalent_fips_code": null, - "fips": "RP", - "geonameid": 1694008, - "iso3": "PHL", - "iso_numeric": 608, - "languages": "tl,en-PH,fil,ceb,tgl,ilo,hil,war,pam,bik,bcl,pag,mrw,tsg,mdh,cbk,krj,sgd,msb,akl,ibg,yka,mta,abx", - "name": "Philippines", - "neighbours": null, - "phone": "63", - "population": 106651922, - "postal_code_format": "####", - "postal_code_regex": "^(\\d{4})$", - "tld": ".ph" - }, - "model": "countries_plus.country", - "pk": "PH" - }, - { - "fields": { - "area": "462840.00", - "capital": "Port Moresby", - "continent": "OC", - "currency_code": "PGK", - "currency_name": "Kina", - "currency_symbol": "K", - "equivalent_fips_code": null, - "fips": "PP", - "geonameid": 2088628, - "iso3": "PNG", - "iso_numeric": 598, - "languages": "en-PG,ho,meu,tpi", - "name": "Papua New Guinea", - "neighbours": "ID", - "phone": "675", - "population": 8606316, - "postal_code_format": "###", - "postal_code_regex": "^(\\d{3})$", - "tld": ".pg" - }, - "model": "countries_plus.country", - "pk": "PG" - }, - { - "fields": { - "area": "78200.00", - "capital": "Panama City", - "continent": "NA", - "currency_code": "PAB", - "currency_name": "Balboa", - "currency_symbol": "B/.", - "equivalent_fips_code": null, - "fips": "PM", - "geonameid": 3703430, - "iso3": "PAN", - "iso_numeric": 591, - "languages": "es-PA,en", - "name": "Panama", - "neighbours": "CR,CO", - "phone": "507", - "population": 4176873, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".pa" - }, - "model": "countries_plus.country", - "pk": "PA" - }, - { - "fields": { - "area": "458.00", - "capital": "Melekeok", - "continent": "OC", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "PS", - "geonameid": 1559582, - "iso3": "PLW", - "iso_numeric": 585, - "languages": "pau,sov,en-PW,tox,ja,fil,zh", - "name": "Palau", - "neighbours": null, - "phone": "680", - "population": 17907, - "postal_code_format": "96940", - "postal_code_regex": "^(96940)$", - "tld": ".pw" - }, - "model": "countries_plus.country", - "pk": "PW" - }, - { - "fields": { - "area": "803940.00", - "capital": "Islamabad", - "continent": "AS", - "currency_code": "PKR", - "currency_name": "Rupee", - "currency_symbol": "\u20a8", - "equivalent_fips_code": null, - "fips": "PK", - "geonameid": 1168579, - "iso3": "PAK", - "iso_numeric": 586, - "languages": "ur-PK,en-PK,pa,sd,ps,brh", - "name": "Pakistan", - "neighbours": "CN,AF,IR,IN", - "phone": "92", - "population": 212215030, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".pk" - }, - "model": "countries_plus.country", - "pk": "PK" - }, - { - "fields": { - "area": "212460.00", - "capital": "Muscat", - "continent": "AS", - "currency_code": "OMR", - "currency_name": "Rial", - "currency_symbol": "\u0631.\u0639.", - "equivalent_fips_code": null, - "fips": "MU", - "geonameid": 286963, - "iso3": "OMN", - "iso_numeric": 512, - "languages": "ar-OM,en,bal,ur", - "name": "Oman", - "neighbours": "SA,YE,AE", - "phone": "968", - "population": 4829483, - "postal_code_format": "###", - "postal_code_regex": "^(\\d{3})$", - "tld": ".om" - }, - "model": "countries_plus.country", - "pk": "OM" - }, - { - "fields": { - "area": "477.00", - "capital": "Saipan", - "continent": "OC", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "CQ", - "geonameid": 4041468, - "iso3": "MNP", - "iso_numeric": 580, - "languages": "fil,tl,zh,ch-MP,en-MP", - "name": "Northern Mariana Islands", - "neighbours": null, - "phone": "+1-670", - "population": 56882, - "postal_code_format": "#####", - "postal_code_regex": "^9695\\d{1}$", - "tld": ".mp" - }, - "model": "countries_plus.country", - "pk": "MP" - }, - { - "fields": { - "area": "34.60", - "capital": "Kingston", - "continent": "OC", - "currency_code": "AUD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "NF", - "geonameid": 2155115, - "iso3": "NFK", - "iso_numeric": 574, - "languages": "en-NF", - "name": "Norfolk Island", - "neighbours": null, - "phone": "672", - "population": 1828, - "postal_code_format": "####", - "postal_code_regex": "^(\\d{4})$", - "tld": ".nf" - }, - "model": "countries_plus.country", - "pk": "NF" - }, - { - "fields": { - "area": "260.00", - "capital": "Alofi", - "continent": "OC", - "currency_code": "NZD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "NE", - "geonameid": 4036232, - "iso3": "NIU", - "iso_numeric": 570, - "languages": "niu,en-NU", - "name": "Niue", - "neighbours": null, - "phone": "683", - "population": 2166, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".nu" - }, - "model": "countries_plus.country", - "pk": "NU" - }, - { - "fields": { - "area": "923768.00", - "capital": "Abuja", - "continent": "AF", - "currency_code": "NGN", - "currency_name": "Naira", - "currency_symbol": "\u20a6", - "equivalent_fips_code": null, - "fips": "NI", - "geonameid": 2328926, - "iso3": "NGA", - "iso_numeric": 566, - "languages": "en-NG,ha,yo,ig,ff", - "name": "Nigeria", - "neighbours": "TD,NE,BJ,CM", - "phone": "234", - "population": 195874740, - "postal_code_format": "######", - "postal_code_regex": "^(\\d{6})$", - "tld": ".ng" - }, - "model": "countries_plus.country", - "pk": "NG" - }, - { - "fields": { - "area": "129494.00", - "capital": "Managua", - "continent": "NA", - "currency_code": "NIO", - "currency_name": "Cordoba", - "currency_symbol": "C$", - "equivalent_fips_code": null, - "fips": "NU", - "geonameid": 3617476, - "iso3": "NIC", - "iso_numeric": 558, - "languages": "es-NI,en", - "name": "Nicaragua", - "neighbours": "CR,HN", - "phone": "505", - "population": 6465513, - "postal_code_format": "###-###-#", - "postal_code_regex": "^(\\d{7})$", - "tld": ".ni" - }, - "model": "countries_plus.country", - "pk": "NI" - }, - { - "fields": { - "area": "268680.00", - "capital": "Wellington", - "continent": "OC", - "currency_code": "NZD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "NZ", - "geonameid": 2186224, - "iso3": "NZL", - "iso_numeric": 554, - "languages": "en-NZ,mi", - "name": "New Zealand", - "neighbours": null, - "phone": "64", - "population": 4885500, - "postal_code_format": "####", - "postal_code_regex": "^(\\d{4})$", - "tld": ".nz" - }, - "model": "countries_plus.country", - "pk": "NZ" - }, - { - "fields": { - "area": "960.00", - "capital": "Willemstad", - "continent": "NA", - "currency_code": "ANG", - "currency_name": "Guilder", - "currency_symbol": "\u0192", - "equivalent_fips_code": null, - "fips": "NT", - "geonameid": 8505032, - "iso3": "ANT", - "iso_numeric": 530, - "languages": "nl-AN,en,es", - "name": "Netherlands Antilles", - "neighbours": "GP", - "phone": "599", - "population": 300000, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".an" - }, - "model": "countries_plus.country", - "pk": "AN" - }, - { - "fields": { - "area": "140800.00", - "capital": "Kathmandu", - "continent": "AS", - "currency_code": "NPR", - "currency_name": "Rupee", - "currency_symbol": "\u20a8", - "equivalent_fips_code": null, - "fips": "NP", - "geonameid": 1282988, - "iso3": "NPL", - "iso_numeric": 524, - "languages": "ne,en", - "name": "Nepal", - "neighbours": "CN,IN", - "phone": "977", - "population": 28087871, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".np" - }, - "model": "countries_plus.country", - "pk": "NP" - }, - { - "fields": { - "area": "21.00", - "capital": "Yaren", - "continent": "OC", - "currency_code": "AUD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "NR", - "geonameid": 2110425, - "iso3": "NRU", - "iso_numeric": 520, - "languages": "na,en-NR", - "name": "Nauru", - "neighbours": null, - "phone": "674", - "population": 12704, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".nr" - }, - "model": "countries_plus.country", - "pk": "NR" - }, - { - "fields": { - "area": "825418.00", - "capital": "Windhoek", - "continent": "AF", - "currency_code": "NAD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "WA", - "geonameid": 3355338, - "iso3": "NAM", - "iso_numeric": 516, - "languages": "en-NA,af,de,hz,naq", - "name": "Namibia", - "neighbours": "ZA,BW,ZM,AO", - "phone": "264", - "population": 2448255, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".na" - }, - "model": "countries_plus.country", - "pk": "NA" - }, - { - "fields": { - "area": "102.00", - "capital": "Plymouth", - "continent": "NA", - "currency_code": "XCD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "MH", - "geonameid": 3578097, - "iso3": "MSR", - "iso_numeric": 500, - "languages": "en-MS", - "name": "Montserrat", - "neighbours": null, - "phone": "+1-664", - "population": 9341, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".ms" - }, - "model": "countries_plus.country", - "pk": "MS" - }, - { - "fields": { - "area": "1.95", - "capital": "Monaco", - "continent": "EU", - "currency_code": "EUR", - "currency_name": "Euro", - "currency_symbol": "\u20ac", - "equivalent_fips_code": null, - "fips": "MN", - "geonameid": 2993457, - "iso3": "MCO", - "iso_numeric": 492, - "languages": "fr-MC,en,it", - "name": "Monaco", - "neighbours": "FR", - "phone": "377", - "population": 38682, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".mc" - }, - "model": "countries_plus.country", - "pk": "MC" - }, - { - "fields": { - "area": "702.00", - "capital": "Palikir", - "continent": "OC", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "FM", - "geonameid": 2081918, - "iso3": "FSM", - "iso_numeric": 583, - "languages": "en-FM,chk,pon,yap,kos,uli,woe,nkr,kpg", - "name": "Micronesia", - "neighbours": null, - "phone": "691", - "population": 112640, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".fm" - }, - "model": "countries_plus.country", - "pk": "FM" - }, - { - "fields": { - "area": "2040.00", - "capital": "Port Louis", - "continent": "AF", - "currency_code": "MUR", - "currency_name": "Rupee", - "currency_symbol": "\u20a8", - "equivalent_fips_code": null, - "fips": "MP", - "geonameid": 934292, - "iso3": "MUS", - "iso_numeric": 480, - "languages": "en-MU,bho,fr", - "name": "Mauritius", - "neighbours": null, - "phone": "230", - "population": 1265303, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".mu" - }, - "model": "countries_plus.country", - "pk": "MU" - }, - { - "fields": { - "area": "181.30", - "capital": "Majuro", - "continent": "OC", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "RM", - "geonameid": 2080185, - "iso3": "MHL", - "iso_numeric": 584, - "languages": "mh,en-MH", - "name": "Marshall Islands", - "neighbours": null, - "phone": "692", - "population": 58413, - "postal_code_format": "#####-####", - "postal_code_regex": "^969\\d{2}(-\\d{4})$", - "tld": ".mh" - }, - "model": "countries_plus.country", - "pk": "MH" - }, - { - "fields": { - "area": "316.00", - "capital": "Valletta", - "continent": "EU", - "currency_code": "EUR", - "currency_name": "Euro", - "currency_symbol": "\u20ac", - "equivalent_fips_code": null, - "fips": "MT", - "geonameid": 2562770, - "iso3": "MLT", - "iso_numeric": 470, - "languages": "mt,en-MT", - "name": "Malta", - "neighbours": null, - "phone": "356", - "population": 483530, - "postal_code_format": "@@@ ####", - "postal_code_regex": "^[A-Z]{3}\\s?\\d{4}$", - "tld": ".mt" - }, - "model": "countries_plus.country", - "pk": "MT" - }, - { - "fields": { - "area": "300.00", - "capital": "Male", - "continent": "AS", - "currency_code": "MVR", - "currency_name": "Rufiyaa", - "currency_symbol": "\u0783.", - "equivalent_fips_code": null, - "fips": "MV", - "geonameid": 1282028, - "iso3": "MDV", - "iso_numeric": 462, - "languages": "dv,en", - "name": "Maldives", - "neighbours": null, - "phone": "960", - "population": 515696, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".mv" - }, - "model": "countries_plus.country", - "pk": "MV" - }, - { - "fields": { - "area": "329750.00", - "capital": "Kuala Lumpur", - "continent": "AS", - "currency_code": "MYR", - "currency_name": "Ringgit", - "currency_symbol": "RM", - "equivalent_fips_code": null, - "fips": "MY", - "geonameid": 1733045, - "iso3": "MYS", - "iso_numeric": 458, - "languages": "ms-MY,en,zh,ta,te,ml,pa,th", - "name": "Malaysia", - "neighbours": "BN,TH,ID", - "phone": "60", - "population": 31528585, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".my" - }, - "model": "countries_plus.country", - "pk": "MY" - }, - { - "fields": { - "area": "1759540.00", - "capital": "Tripoli", - "continent": "AF", - "currency_code": "LYD", - "currency_name": "Dinar", - "currency_symbol": "\u0644.\u062f", - "equivalent_fips_code": null, - "fips": "LY", - "geonameid": 2215636, - "iso3": "LBY", - "iso_numeric": 434, - "languages": "ar-LY,it,en", - "name": "Libya", - "neighbours": "TD,NE,DZ,SD,TN,EG", - "phone": "218", - "population": 6678567, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".ly" - }, - "model": "countries_plus.country", - "pk": "LY" - }, - { - "fields": { - "area": "111370.00", - "capital": "Monrovia", - "continent": "AF", - "currency_code": "LRD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "LI", - "geonameid": 2275384, - "iso3": "LBR", - "iso_numeric": 430, - "languages": "en-LR", - "name": "Liberia", - "neighbours": "SL,CI,GN", - "phone": "231", - "population": 4818977, - "postal_code_format": "####", - "postal_code_regex": "^(\\d{4})$", - "tld": ".lr" - }, - "model": "countries_plus.country", - "pk": "LR" - }, - { - "fields": { - "area": "30355.00", - "capital": "Maseru", - "continent": "AF", - "currency_code": "LSL", - "currency_name": "Loti", - "currency_symbol": "L", - "equivalent_fips_code": null, - "fips": "LT", - "geonameid": 932692, - "iso3": "LSO", - "iso_numeric": 426, - "languages": "en-LS,st,zu,xh", - "name": "Lesotho", - "neighbours": "ZA", - "phone": "266", - "population": 2108132, - "postal_code_format": "###", - "postal_code_regex": "^(\\d{3})$", - "tld": ".ls" - }, - "model": "countries_plus.country", - "pk": "LS" - }, - { - "fields": { - "area": "10400.00", - "capital": "Beirut", - "continent": "AS", - "currency_code": "LBP", - "currency_name": "Pound", - "currency_symbol": "\u0644.\u0644", - "equivalent_fips_code": null, - "fips": "LE", - "geonameid": 272103, - "iso3": "LBN", - "iso_numeric": 422, - "languages": "ar-LB,fr-LB,en,hy", - "name": "Lebanon", - "neighbours": "SY,IL", - "phone": "961", - "population": 6848925, - "postal_code_format": "#### ####|####", - "postal_code_regex": "^(\\d{4}(\\d{4})?)$", - "tld": ".lb" - }, - "model": "countries_plus.country", - "pk": "LB" - }, - { - "fields": { - "area": "236800.00", - "capital": "Vientiane", - "continent": "AS", - "currency_code": "LAK", - "currency_name": "Kip", - "currency_symbol": "\u20ad", - "equivalent_fips_code": null, - "fips": "LA", - "geonameid": 1655842, - "iso3": "LAO", - "iso_numeric": 418, - "languages": "lo,fr,en", - "name": "Laos", - "neighbours": "CN,MM,KH,TH,VN", - "phone": "856", - "population": 7061507, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".la" - }, - "model": "countries_plus.country", - "pk": "LA" - }, - { - "fields": { - "area": "17820.00", - "capital": "Kuwait City", - "continent": "AS", - "currency_code": "KWD", - "currency_name": "Dinar", - "currency_symbol": "\u062f.\u0643", - "equivalent_fips_code": null, - "fips": "KU", - "geonameid": 285570, - "iso3": "KWT", - "iso_numeric": 414, - "languages": "ar-KW,en", - "name": "Kuwait", - "neighbours": "SA,IQ", - "phone": "965", - "population": 4137309, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".kw" - }, - "model": "countries_plus.country", - "pk": "KW" - }, - { - "fields": { - "area": "811.00", - "capital": "Tarawa", - "continent": "OC", - "currency_code": "AUD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "KR", - "geonameid": 4030945, - "iso3": "KIR", - "iso_numeric": 296, - "languages": "en-KI,gil", - "name": "Kiribati", - "neighbours": null, - "phone": "686", - "population": 115847, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".ki" - }, - "model": "countries_plus.country", - "pk": "KI" - }, - { - "fields": { - "area": "582650.00", - "capital": "Nairobi", - "continent": "AF", - "currency_code": "KES", - "currency_name": "Shilling", - "currency_symbol": "Sh", - "equivalent_fips_code": null, - "fips": "KE", - "geonameid": 192950, - "iso3": "KEN", - "iso_numeric": 404, - "languages": "en-KE,sw-KE", - "name": "Kenya", - "neighbours": "ET,TZ,SS,SO,UG", - "phone": "254", - "population": 51393010, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".ke" - }, - "model": "countries_plus.country", - "pk": "KE" - }, - { - "fields": { - "area": "92300.00", - "capital": "Amman", - "continent": "AS", - "currency_code": "JOD", - "currency_name": "Dinar", - "currency_symbol": "\u062f.\u0627", - "equivalent_fips_code": null, - "fips": "JO", - "geonameid": 248816, - "iso3": "JOR", - "iso_numeric": 400, - "languages": "ar-JO,en", - "name": "Jordan", - "neighbours": "SY,SA,IQ,IL,PS", - "phone": "962", - "population": 9956011, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".jo" - }, - "model": "countries_plus.country", - "pk": "JO" - }, - { - "fields": { - "area": "116.00", - "capital": "Saint Helier", - "continent": "EU", - "currency_code": "GBP", - "currency_name": "Pound", - "currency_symbol": "\u00a3", - "equivalent_fips_code": null, - "fips": "JE", - "geonameid": 3042142, - "iso3": "JEY", - "iso_numeric": 832, - "languages": "en,fr,nrf", - "name": "Jersey", - "neighbours": null, - "phone": "+44-1534", - "population": 90812, - "postal_code_format": "@# #@@|@## #@@|@@# #@@|@@## #@@|@#@ #@@|@@#@ #@@|GIR0AA", - "postal_code_regex": "^((?:(?:[A-PR-UWYZ][A-HK-Y]\\d[ABEHMNPRV-Y0-9]|[A-PR-UWYZ]\\d[A-HJKPS-UW0-9])\\s\\d[ABD-HJLNP-UW-Z]{2})|GIR\\s?0AA)$", - "tld": ".je" - }, - "model": "countries_plus.country", - "pk": "JE" - }, - { - "fields": { - "area": "10991.00", - "capital": "Kingston", - "continent": "NA", - "currency_code": "JMD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "JM", - "geonameid": 3489940, - "iso3": "JAM", - "iso_numeric": 388, - "languages": "en-JM", - "name": "Jamaica", - "neighbours": null, - "phone": "+1-876", - "population": 2934855, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".jm" - }, - "model": "countries_plus.country", - "pk": "JM" - }, - { - "fields": { - "area": "20770.00", - "capital": "Jerusalem", - "continent": "AS", - "currency_code": "ILS", - "currency_name": "Shekel", - "currency_symbol": "\u20aa", - "equivalent_fips_code": null, - "fips": "IS", - "geonameid": 294640, - "iso3": "ISR", - "iso_numeric": 376, - "languages": "he,ar-IL,en-IL,", - "name": "Israel", - "neighbours": "SY,JO,LB,EG,PS", - "phone": "972", - "population": 8883800, - "postal_code_format": "#######", - "postal_code_regex": "^(\\d{7}|\\d{5})$", - "tld": ".il" - }, - "model": "countries_plus.country", - "pk": "IL" - }, - { - "fields": { - "area": "572.00", - "capital": "Douglas", - "continent": "EU", - "currency_code": "GBP", - "currency_name": "Pound", - "currency_symbol": "\u00a3", - "equivalent_fips_code": null, - "fips": "IM", - "geonameid": 3042225, - "iso3": "IMN", - "iso_numeric": 833, - "languages": "en,gv", - "name": "Isle of Man", - "neighbours": null, - "phone": "+44-1624", - "population": 84077, - "postal_code_format": "@# #@@|@## #@@|@@# #@@|@@## #@@|@#@ #@@|@@#@ #@@|GIR0AA", - "postal_code_regex": "^((?:(?:[A-PR-UWYZ][A-HK-Y]\\d[ABEHMNPRV-Y0-9]|[A-PR-UWYZ]\\d[A-HJKPS-UW0-9])\\s\\d[ABD-HJLNP-UW-Z]{2})|GIR\\s?0AA)$", - "tld": ".im" - }, - "model": "countries_plus.country", - "pk": "IM" - }, - { - "fields": { - "area": "70280.00", - "capital": "Dublin", - "continent": "EU", - "currency_code": "EUR", - "currency_name": "Euro", - "currency_symbol": "\u20ac", - "equivalent_fips_code": null, - "fips": "EI", - "geonameid": 2963597, - "iso3": "IRL", - "iso_numeric": 372, - "languages": "en-IE,ga-IE", - "name": "Ireland", - "neighbours": "GB", - "phone": "353", - "population": 4853506, - "postal_code_format": "@@@ @@@@", - "postal_code_regex": "^(D6W|[AC-FHKNPRTV-Y][0-9]{2})\\s?([AC-FHKNPRTV-Y0-9]{4})", - "tld": ".ie" - }, - "model": "countries_plus.country", - "pk": "IE" - }, - { - "fields": { - "area": "1919440.00", - "capital": "Jakarta", - "continent": "AS", - "currency_code": "IDR", - "currency_name": "Rupiah", - "currency_symbol": "Rp", - "equivalent_fips_code": null, - "fips": "ID", - "geonameid": 1643084, - "iso3": "IDN", - "iso_numeric": 360, - "languages": "id,en,nl,jv", - "name": "Indonesia", - "neighbours": "PG,TL,MY", - "phone": "62", - "population": 267663435, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".id" - }, - "model": "countries_plus.country", - "pk": "ID" - }, - { - "fields": { - "area": "3287590.00", - "capital": "New Delhi", - "continent": "AS", - "currency_code": "INR", - "currency_name": "Rupee", - "currency_symbol": "\u20a8", - "equivalent_fips_code": null, - "fips": "IN", - "geonameid": 1269750, - "iso3": "IND", - "iso_numeric": 356, - "languages": "en-IN,hi,bn,te,mr,ta,ur,gu,kn,ml,or,pa,as,bh,sat,ks,ne,sd,kok,doi,mni,sit,sa,fr,lus,inc", - "name": "India", - "neighbours": "CN,NP,MM,BT,PK,BD", - "phone": "91", - "population": 1352617328, - "postal_code_format": "######", - "postal_code_regex": "^(\\d{6})$", - "tld": ".in" - }, - "model": "countries_plus.country", - "pk": "IN" - }, - { - "fields": { - "area": "103000.00", - "capital": "Reykjavik", - "continent": "EU", - "currency_code": "ISK", - "currency_name": "Krona", - "currency_symbol": "kr", - "equivalent_fips_code": null, - "fips": "IC", - "geonameid": 2629691, - "iso3": "ISL", - "iso_numeric": 352, - "languages": "is,en,de,da,sv,no", - "name": "Iceland", - "neighbours": null, - "phone": "354", - "population": 353574, - "postal_code_format": "###", - "postal_code_regex": "^(\\d{3})$", - "tld": ".is" - }, - "model": "countries_plus.country", - "pk": "IS" - }, - { - "fields": { - "area": "1092.00", - "capital": "Hong Kong", - "continent": "AS", - "currency_code": "HKD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "HK", - "geonameid": 1819730, - "iso3": "HKG", - "iso_numeric": 344, - "languages": "zh-HK,yue,zh,en", - "name": "Hong Kong", - "neighbours": null, - "phone": "852", - "population": 7451000, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".hk" - }, - "model": "countries_plus.country", - "pk": "HK" - }, - { - "fields": { - "area": "214970.00", - "capital": "Georgetown", - "continent": "SA", - "currency_code": "GYD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "GY", - "geonameid": 3378535, - "iso3": "GUY", - "iso_numeric": 328, - "languages": "en-GY", - "name": "Guyana", - "neighbours": "SR,BR,VE", - "phone": "592", - "population": 779004, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".gy" - }, - "model": "countries_plus.country", - "pk": "GY" - }, - { - "fields": { - "area": "78.00", - "capital": "St Peter Port", - "continent": "EU", - "currency_code": "GBP", - "currency_name": "Pound", - "currency_symbol": "\u00a3", - "equivalent_fips_code": null, - "fips": "GK", - "geonameid": 3042362, - "iso3": "GGY", - "iso_numeric": 831, - "languages": "en,nrf", - "name": "Guernsey", - "neighbours": null, - "phone": "+44-1481", - "population": 65228, - "postal_code_format": "@# #@@|@## #@@|@@# #@@|@@## #@@|@#@ #@@|@@#@ #@@|GIR0AA", - "postal_code_regex": "^((?:(?:[A-PR-UWYZ][A-HK-Y]\\d[ABEHMNPRV-Y0-9]|[A-PR-UWYZ]\\d[A-HJKPS-UW0-9])\\s\\d[ABD-HJLNP-UW-Z]{2})|GIR\\s?0AA)$", - "tld": ".gg" - }, - "model": "countries_plus.country", - "pk": "GG" - }, - { - "fields": { - "area": "549.00", - "capital": "Hagatna", - "continent": "OC", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "GQ", - "geonameid": 4043988, - "iso3": "GUM", - "iso_numeric": 316, - "languages": "en-GU,ch-GU", - "name": "Guam", - "neighbours": null, - "phone": "+1-671", - "population": 165768, - "postal_code_format": "969##", - "postal_code_regex": "^(969\\d{2})$", - "tld": ".gu" - }, - "model": "countries_plus.country", - "pk": "GU" - }, - { - "fields": { - "area": "344.00", - "capital": "St. George's", - "continent": "NA", - "currency_code": "XCD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "GJ", - "geonameid": 3580239, - "iso3": "GRD", - "iso_numeric": 308, - "languages": "en-GD", - "name": "Grenada", - "neighbours": null, - "phone": "+1-473", - "population": 111454, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".gd" - }, - "model": "countries_plus.country", - "pk": "GD" - }, - { - "fields": { - "area": "2166086.00", - "capital": "Nuuk", - "continent": "NA", - "currency_code": "DKK", - "currency_name": "Krone", - "currency_symbol": "kr", - "equivalent_fips_code": null, - "fips": "GL", - "geonameid": 3425505, - "iso3": "GRL", - "iso_numeric": 304, - "languages": "kl,da-GL,en", - "name": "Greenland", - "neighbours": null, - "phone": "299", - "population": 56025, - "postal_code_format": "####", - "postal_code_regex": "^(\\d{4})$", - "tld": ".gl" - }, - "model": "countries_plus.country", - "pk": "GL" - }, - { - "fields": { - "area": "131940.00", - "capital": "Athens", - "continent": "EU", - "currency_code": "EUR", - "currency_name": "Euro", - "currency_symbol": "\u20ac", - "equivalent_fips_code": null, - "fips": "GR", - "geonameid": 390903, - "iso3": "GRC", - "iso_numeric": 300, - "languages": "el-GR,en,fr", - "name": "Greece", - "neighbours": "AL,MK,TR,BG", - "phone": "30", - "population": 10727668, - "postal_code_format": "### ##", - "postal_code_regex": "^(\\d{5})$", - "tld": ".gr" - }, - "model": "countries_plus.country", - "pk": "GR" - }, - { - "fields": { - "area": "6.50", - "capital": "Gibraltar", - "continent": "EU", - "currency_code": "GIP", - "currency_name": "Pound", - "currency_symbol": "\u00a3", - "equivalent_fips_code": null, - "fips": "GI", - "geonameid": 2411586, - "iso3": "GIB", - "iso_numeric": 292, - "languages": "en-GI,es,it,pt", - "name": "Gibraltar", - "neighbours": "ES", - "phone": "350", - "population": 33718, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".gi" - }, - "model": "countries_plus.country", - "pk": "GI" - }, - { - "fields": { - "area": "239460.00", - "capital": "Accra", - "continent": "AF", - "currency_code": "GHS", - "currency_name": "Cedi", - "currency_symbol": "\u20b5", - "equivalent_fips_code": null, - "fips": "GH", - "geonameid": 2300660, - "iso3": "GHA", - "iso_numeric": 288, - "languages": "en-GH,ak,ee,tw", - "name": "Ghana", - "neighbours": "CI,TG,BF", - "phone": "233", - "population": 29767108, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".gh" - }, - "model": "countries_plus.country", - "pk": "GH" - }, - { - "fields": { - "area": "11300.00", - "capital": "Banjul", - "continent": "AF", - "currency_code": "GMD", - "currency_name": "Dalasi", - "currency_symbol": "D", - "equivalent_fips_code": null, - "fips": "GA", - "geonameid": 2413451, - "iso3": "GMB", - "iso_numeric": 270, - "languages": "en-GM,mnk,wof,wo,ff", - "name": "Gambia", - "neighbours": "SN", - "phone": "220", - "population": 2280102, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".gm" - }, - "model": "countries_plus.country", - "pk": "GM" - }, - { - "fields": { - "area": "18270.00", - "capital": "Suva", - "continent": "OC", - "currency_code": "FJD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "FJ", - "geonameid": 2205218, - "iso3": "FJI", - "iso_numeric": 242, - "languages": "en-FJ,fj", - "name": "Fiji", - "neighbours": null, - "phone": "679", - "population": 883483, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".fj" - }, - "model": "countries_plus.country", - "pk": "FJ" - }, - { - "fields": { - "area": "12173.00", - "capital": "Stanley", - "continent": "SA", - "currency_code": "FKP", - "currency_name": "Pound", - "currency_symbol": "\u00a3", - "equivalent_fips_code": null, - "fips": "FK", - "geonameid": 3474414, - "iso3": "FLK", - "iso_numeric": 238, - "languages": "en-FK", - "name": "Falkland Islands", - "neighbours": null, - "phone": "500", - "population": 2638, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".fk" - }, - "model": "countries_plus.country", - "pk": "FK" - }, - { - "fields": { - "area": "1127127.00", - "capital": "Addis Ababa", - "continent": "AF", - "currency_code": "ETB", - "currency_name": "Birr", - "currency_symbol": "Br", - "equivalent_fips_code": null, - "fips": "ET", - "geonameid": 337996, - "iso3": "ETH", - "iso_numeric": 231, - "languages": "am,en-ET,om-ET,ti-ET,so-ET,sid", - "name": "Ethiopia", - "neighbours": "ER,KE,SD,SS,SO,DJ", - "phone": "251", - "population": 109224559, - "postal_code_format": "####", - "postal_code_regex": "^(\\d{4})$", - "tld": ".et" - }, - "model": "countries_plus.country", - "pk": "ET" - }, - { - "fields": { - "area": "17363.00", - "capital": "Mbabane", - "continent": "AF", - "currency_code": "SZL", - "currency_name": "Lilangeni", - "currency_symbol": "L", - "equivalent_fips_code": null, - "fips": "WZ", - "geonameid": 934841, - "iso3": "SWZ", - "iso_numeric": 748, - "languages": "en-SZ,ss-SZ", - "name": "Eswatini", - "neighbours": "ZA,MZ", - "phone": "268", - "population": 1136191, - "postal_code_format": "@###", - "postal_code_regex": "^([A-Z]\\d{3})$", - "tld": ".sz" - }, - "model": "countries_plus.country", - "pk": "SZ" - }, - { - "fields": { - "area": "1001450.00", - "capital": "Cairo", - "continent": "AF", - "currency_code": "EGP", - "currency_name": "Pound", - "currency_symbol": "\u00a3,\u062c.\u0645", - "equivalent_fips_code": null, - "fips": "EG", - "geonameid": 357994, - "iso3": "EGY", - "iso_numeric": 818, - "languages": "ar-EG,en,fr", - "name": "Egypt", - "neighbours": "LY,SD,IL,PS", - "phone": "20", - "population": 98423595, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".eg" - }, - "model": "countries_plus.country", - "pk": "EG" - }, - { - "fields": { - "area": "754.00", - "capital": "Roseau", - "continent": "NA", - "currency_code": "XCD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "DO", - "geonameid": 3575830, - "iso3": "DMA", - "iso_numeric": 212, - "languages": "en-DM", - "name": "Dominica", - "neighbours": null, - "phone": "+1-767", - "population": 71625, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".dm" - }, - "model": "countries_plus.country", - "pk": "DM" - }, - { - "fields": { - "area": "43094.00", - "capital": "Copenhagen", - "continent": "EU", - "currency_code": "DKK", - "currency_name": "Krone", - "currency_symbol": "kr", - "equivalent_fips_code": null, - "fips": "DA", - "geonameid": 2623032, - "iso3": "DNK", - "iso_numeric": 208, - "languages": "da-DK,en,fo,de-DK", - "name": "Denmark", - "neighbours": "DE", - "phone": "45", - "population": 5797446, - "postal_code_format": "####", - "postal_code_regex": "^(\\d{4})$", - "tld": ".dk" - }, - "model": "countries_plus.country", - "pk": "DK" - }, - { - "fields": { - "area": "9250.00", - "capital": "Nicosia", - "continent": "EU", - "currency_code": "EUR", - "currency_name": "Euro", - "currency_symbol": "\u20ac", - "equivalent_fips_code": null, - "fips": "CY", - "geonameid": 146669, - "iso3": "CYP", - "iso_numeric": 196, - "languages": "el-CY,tr-CY,en", - "name": "Cyprus", - "neighbours": null, - "phone": "357", - "population": 1189265, - "postal_code_format": "####", - "postal_code_regex": "^(\\d{4})$", - "tld": ".cy" - }, - "model": "countries_plus.country", - "pk": "CY" - }, - { - "fields": { - "area": "51100.00", - "capital": "San Jose", - "continent": "NA", - "currency_code": "CRC", - "currency_name": "Colon", - "currency_symbol": "\u20a1", - "equivalent_fips_code": null, - "fips": "CS", - "geonameid": 3624060, - "iso3": "CRI", - "iso_numeric": 188, - "languages": "es-CR,en", - "name": "Costa Rica", - "neighbours": "PA,NI", - "phone": "506", - "population": 4999441, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".cr" - }, - "model": "countries_plus.country", - "pk": "CR" - }, - { - "fields": { - "area": "240.00", - "capital": "Avarua", - "continent": "OC", - "currency_code": "NZD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "CW", - "geonameid": 1899402, - "iso3": "COK", - "iso_numeric": 184, - "languages": "en-CK,mi", - "name": "Cook Islands", - "neighbours": null, - "phone": "682", - "population": 21388, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".ck" - }, - "model": "countries_plus.country", - "pk": "CK" - }, - { - "fields": { - "area": "14.00", - "capital": "West Island", - "continent": "AS", - "currency_code": "AUD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "CK", - "geonameid": 1547376, - "iso3": "CCK", - "iso_numeric": 166, - "languages": "ms-CC,en", - "name": "Cocos Islands", - "neighbours": null, - "phone": "61", - "population": 628, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".cc" - }, - "model": "countries_plus.country", - "pk": "CC" - }, - { - "fields": { - "area": "135.00", - "capital": "Flying Fish Cove", - "continent": "OC", - "currency_code": "AUD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "KT", - "geonameid": 2078138, - "iso3": "CXR", - "iso_numeric": 162, - "languages": "en,zh,ms-CC", - "name": "Christmas Island", - "neighbours": null, - "phone": "61", - "population": 1500, - "postal_code_format": "####", - "postal_code_regex": "^(\\d{4})$", - "tld": ".cx" - }, - "model": "countries_plus.country", - "pk": "CX" - }, - { - "fields": { - "area": "262.00", - "capital": "George Town", - "continent": "NA", - "currency_code": "KYD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "CJ", - "geonameid": 3580718, - "iso3": "CYM", - "iso_numeric": 136, - "languages": "en-KY", - "name": "Cayman Islands", - "neighbours": null, - "phone": "+1-345", - "population": 64174, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".ky" - }, - "model": "countries_plus.country", - "pk": "KY" - }, - { - "fields": { - "area": "9984670.00", - "capital": "Ottawa", - "continent": "NA", - "currency_code": "CAD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "CA", - "geonameid": 6251999, - "iso3": "CAN", - "iso_numeric": 124, - "languages": "en-CA,fr-CA,iu", - "name": "Canada", - "neighbours": "US", - "phone": "1", - "population": 37058856, - "postal_code_format": "@#@ #@#", - "postal_code_regex": "^([ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJKLMNPRSTVWXYZ]) ?(\\d[ABCEGHJKLMNPRSTVWXYZ]\\d)$ ", - "tld": ".ca" - }, - "model": "countries_plus.country", - "pk": "CA" - }, - { - "fields": { - "area": "475440.00", - "capital": "Yaounde", - "continent": "AF", - "currency_code": "XAF", - "currency_name": "Franc", - "currency_symbol": "Fr", - "equivalent_fips_code": null, - "fips": "CM", - "geonameid": 2233387, - "iso3": "CMR", - "iso_numeric": 120, - "languages": "en-CM,fr-CM", - "name": "Cameroon", - "neighbours": "TD,CF,GA,GQ,CG,NG", - "phone": "237", - "population": 25216237, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".cm" - }, - "model": "countries_plus.country", - "pk": "CM" - }, - { - "fields": { - "area": "181040.00", - "capital": "Phnom Penh", - "continent": "AS", - "currency_code": "KHR", - "currency_name": "Riels", - "currency_symbol": "\u17db", - "equivalent_fips_code": null, - "fips": "CB", - "geonameid": 1831722, - "iso3": "KHM", - "iso_numeric": 116, - "languages": "km,fr,en", - "name": "Cambodia", - "neighbours": "LA,TH,VN", - "phone": "855", - "population": 16249798, - "postal_code_format": "#####", - "postal_code_regex": "^(\\d{5})$", - "tld": ".kh" - }, - "model": "countries_plus.country", - "pk": "KH" - }, - { - "fields": { - "area": "5770.00", - "capital": "Bandar Seri Begawan", - "continent": "AS", - "currency_code": "BND", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "BX", - "geonameid": 1820814, - "iso3": "BRN", - "iso_numeric": 96, - "languages": "ms-BN,en-BN", - "name": "Brunei", - "neighbours": "MY", - "phone": "673", - "population": 428962, - "postal_code_format": "@@####", - "postal_code_regex": "^([A-Z]{2}\\d{4})$", - "tld": ".bn" - }, - "model": "countries_plus.country", - "pk": "BN" - }, - { - "fields": { - "area": "153.00", - "capital": "Road Town", - "continent": "NA", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "VI", - "geonameid": 3577718, - "iso3": "VGB", - "iso_numeric": 92, - "languages": "en-VG", - "name": "British Virgin Islands", - "neighbours": null, - "phone": "+1-284", - "population": 29802, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".vg" - }, - "model": "countries_plus.country", - "pk": "VG" - }, - { - "fields": { - "area": "60.00", - "capital": "Diego Garcia", - "continent": "AS", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "IO", - "geonameid": 1282588, - "iso3": "IOT", - "iso_numeric": 86, - "languages": "en-IO", - "name": "British Indian Ocean Territory", - "neighbours": null, - "phone": "246", - "population": 4000, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".io" - }, - "model": "countries_plus.country", - "pk": "IO" - }, - { - "fields": { - "area": "8511965.00", - "capital": "Brasilia", - "continent": "SA", - "currency_code": "BRL", - "currency_name": "Real", - "currency_symbol": "R$", - "equivalent_fips_code": null, - "fips": "BR", - "geonameid": 3469034, - "iso3": "BRA", - "iso_numeric": 76, - "languages": "pt-BR,es,en,fr", - "name": "Brazil", - "neighbours": "SR,PE,BO,UY,GY,PY,GF,VE,CO,AR", - "phone": "55", - "population": 209469333, - "postal_code_format": "#####-###", - "postal_code_regex": "^\\d{5}-\\d{3}$", - "tld": ".br" - }, - "model": "countries_plus.country", - "pk": "BR" - }, - { - "fields": { - "area": "600370.00", - "capital": "Gaborone", - "continent": "AF", - "currency_code": "BWP", - "currency_name": "Pula", - "currency_symbol": "P", - "equivalent_fips_code": null, - "fips": "BC", - "geonameid": 933860, - "iso3": "BWA", - "iso_numeric": 72, - "languages": "en-BW,tn-BW", - "name": "Botswana", - "neighbours": "ZW,ZA,NA", - "phone": "267", - "population": 2254126, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".bw" - }, - "model": "countries_plus.country", - "pk": "BW" - }, - { - "fields": { - "area": "328.00", - "capital": null, - "continent": "NA", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": null, - "geonameid": 7626844, - "iso3": "BES", - "iso_numeric": 535, - "languages": "nl,pap,en", - "name": "Bonaire, Saint Eustatius and Saba ", - "neighbours": null, - "phone": "599", - "population": 18012, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".bq" - }, - "model": "countries_plus.country", - "pk": "BQ" - }, - { - "fields": { - "area": "53.00", - "capital": "Hamilton", - "continent": "NA", - "currency_code": "BMD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "BD", - "geonameid": 3573345, - "iso3": "BMU", - "iso_numeric": 60, - "languages": "en-BM,pt", - "name": "Bermuda", - "neighbours": null, - "phone": "+1-441", - "population": 63968, - "postal_code_format": "@@ ##", - "postal_code_regex": "^([A-Z]{2}\\d{2})$", - "tld": ".bm" - }, - "model": "countries_plus.country", - "pk": "BM" - }, - { - "fields": { - "area": "22966.00", - "capital": "Belmopan", - "continent": "NA", - "currency_code": "BZD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "BH", - "geonameid": 3582678, - "iso3": "BLZ", - "iso_numeric": 84, - "languages": "en-BZ,es", - "name": "Belize", - "neighbours": "GT,MX", - "phone": "501", - "population": 383071, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".bz" - }, - "model": "countries_plus.country", - "pk": "BZ" - }, - { - "fields": { - "area": "431.00", - "capital": "Bridgetown", - "continent": "NA", - "currency_code": "BBD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "BB", - "geonameid": 3374084, - "iso3": "BRB", - "iso_numeric": 52, - "languages": "en-BB", - "name": "Barbados", - "neighbours": null, - "phone": "+1-246", - "population": 286641, - "postal_code_format": "BB#####", - "postal_code_regex": "^(?:BB)*(\\d{5})$", - "tld": ".bb" - }, - "model": "countries_plus.country", - "pk": "BB" - }, - { - "fields": { - "area": "144000.00", - "capital": "Dhaka", - "continent": "AS", - "currency_code": "BDT", - "currency_name": "Taka", - "currency_symbol": "\u09f3", - "equivalent_fips_code": null, - "fips": "BG", - "geonameid": 1210997, - "iso3": "BGD", - "iso_numeric": 50, - "languages": "bn-BD,en", - "name": "Bangladesh", - "neighbours": "MM,IN", - "phone": "880", - "population": 161356039, - "postal_code_format": "####", - "postal_code_regex": "^(\\d{4})$", - "tld": ".bd" - }, - "model": "countries_plus.country", - "pk": "BD" - }, - { - "fields": { - "area": "665.00", - "capital": "Manama", - "continent": "AS", - "currency_code": "BHD", - "currency_name": "Dinar", - "currency_symbol": "\u0628.\u062f", - "equivalent_fips_code": null, - "fips": "BA", - "geonameid": 290291, - "iso3": "BHR", - "iso_numeric": 48, - "languages": "ar-BH,en,fa,ur", - "name": "Bahrain", - "neighbours": null, - "phone": "973", - "population": 1569439, - "postal_code_format": "####|###", - "postal_code_regex": "^(\\d{3}\\d?)$", - "tld": ".bh" - }, - "model": "countries_plus.country", - "pk": "BH" - }, - { - "fields": { - "area": "13940.00", - "capital": "Nassau", - "continent": "NA", - "currency_code": "BSD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "BF", - "geonameid": 3572887, - "iso3": "BHS", - "iso_numeric": 44, - "languages": "en-BS", - "name": "Bahamas", - "neighbours": null, - "phone": "+1-242", - "population": 385640, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".bs" - }, - "model": "countries_plus.country", - "pk": "BS" - }, - { - "fields": { - "area": "7686850.00", - "capital": "Canberra", - "continent": "OC", - "currency_code": "AUD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "AS", - "geonameid": 2077456, - "iso3": "AUS", - "iso_numeric": 36, - "languages": "en-AU", - "name": "Australia", - "neighbours": null, - "phone": "61", - "population": 24992369, - "postal_code_format": "####", - "postal_code_regex": "^(\\d{4})$", - "tld": ".au" - }, - "model": "countries_plus.country", - "pk": "AU" - }, - { + "model": "peachjam.documentnature", + "pk": 1, "fields": { - "area": "193.00", - "capital": "Oranjestad", - "continent": "NA", - "currency_code": "AWG", - "currency_name": "Guilder", - "currency_symbol": "\u0192", - "equivalent_fips_code": null, - "fips": "AA", - "geonameid": 3577279, - "iso3": "ABW", - "iso_numeric": 533, - "languages": "nl-AW,pap,es,en", - "name": "Aruba", - "neighbours": null, - "phone": "297", - "population": 105845, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".aw" - }, - "model": "countries_plus.country", - "pk": "AW" + "name": "Document", + "code": "document" + } }, { + "model": "peachjam.documentnature", + "pk": 3, "fields": { - "area": "2766890.00", - "capital": "Buenos Aires", - "continent": "SA", - "currency_code": "ARS", - "currency_name": "Peso", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "AR", - "geonameid": 3865483, - "iso3": "ARG", - "iso_numeric": 32, - "languages": "es-AR,en,it,de,fr,gn", - "name": "Argentina", - "neighbours": "CL,BO,UY,PY,BR", - "phone": "54", - "population": 44494502, - "postal_code_format": "@####@@@", - "postal_code_regex": "^[A-Z]?\\d{4}[A-Z]{0,3}$", - "tld": ".ar" - }, - "model": "countries_plus.country", - "pk": "AR" + "name": "Charter", + "code": "charter" + } }, { "fields": { - "area": "443.00", - "capital": "St. John's", - "continent": "NA", - "currency_code": "XCD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "AC", - "geonameid": 3576396, - "iso3": "ATG", - "iso_numeric": 28, - "languages": "en-AG", - "name": "Antigua and Barbuda", - "neighbours": null, - "phone": "+1-268", - "population": 96286, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".ag" + "description": "", + "name": "Activity report", + "code": "activity-report" }, - "model": "countries_plus.country", - "pk": "AG" + "model": "peachjam.documentnature", + "pk": 8 }, { + "model": "peachjam.courtclass", + "pk": 2, "fields": { - "area": "102.00", - "capital": "The Valley", - "continent": "NA", - "currency_code": "XCD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "AV", - "geonameid": 3573511, - "iso3": "AIA", - "iso_numeric": 660, - "languages": "en-AI", - "name": "Anguilla", - "neighbours": null, - "phone": "+1-264", - "population": 13254, - "postal_code_format": null, - "postal_code_regex": null, - "tld": ".ai" - }, - "model": "countries_plus.country", - "pk": "AI" + "name": "High Court", + "description": "" + } }, { "fields": { - "area": "199.00", - "capital": "Pago Pago", - "continent": "OC", - "currency_code": "USD", - "currency_name": "Dollar", - "currency_symbol": "$", - "equivalent_fips_code": null, - "fips": "AQ", - "geonameid": 5880801, - "iso3": "ASM", - "iso_numeric": 16, - "languages": "en-AS,sm,to", - "name": "American Samoa", - "neighbours": null, - "phone": "+1-684", - "population": 55465, - "postal_code_format": "#####-####", - "postal_code_regex": "96799", - "tld": ".as" + "code": "ECOWASCJ", + "court_class": 2, + "name": "ECOWAS Community Court of Justice" }, - "model": "countries_plus.country", - "pk": "AS" + "model": "peachjam.court", + "pk": 1 }, { "fields": { @@ -3295,23 +195,6 @@ "model": "peachjam.coredocument", "pk": 5389 }, - { - "fields": { - "frbr_uri": "/akn/aa-au/doc/activity-report/2017/nn", - "title": "Activity Report of the Pan-African Parliament, July 2016 to June 2017" - }, - "model": "peachjam.work", - "pk": 3573 - }, - { - "fields": { - "description": "", - "name": "Activity report", - "code": "activity-report" - }, - "model": "peachjam.documentnature", - "pk": 8 - }, { "fields": { "citation": null, @@ -3468,177 +351,11 @@ }, { "fields": { - "code": "au", - "jurisdiction": "AA", - "name": "African Union (AU)" - }, - "model": "peachjam.locality", - "pk": 1 - }, - { - "fields": { - "area": null, - "capital": null, - "continent": "AF", - "currency_code": null, - "currency_name": null, - "currency_symbol": null, - "equivalent_fips_code": null, - "fips": null, - "geonameid": null, - "iso3": "AAA", - "iso_numeric": 10000, - "languages": null, - "name": "African Regional Bodies", - "neighbours": null, - "phone": null, - "population": null, - "postal_code_format": null, - "postal_code_regex": null, - "tld": null - }, - "model": "countries_plus.country", - "pk": "AA" - }, - { - "fields": { - "countries_spoken": [ - "AS", - "AI", - "AG", - "AR", - "AW", - "AU", - "BS", - "BH", - "BD", - "BB", - "BZ", - "BM", - "BQ", - "BW", - "BR", - "IO", - "VG", - "BN", - "KH", - "CM", - "CA", - "KY", - "CX", - "CC", - "CK", - "CR", - "CY", - "DK", - "DM", - "EG", - "SZ", - "ET", - "FK", - "FJ", - "GM", - "GH", - "GI", - "GR", - "GL", - "GD", - "GU", - "GG", - "GY", - "HK", - "IS", - "IN", - "ID", - "IE", - "IM", - "IL", - "JM", - "JE", - "JO", - "KE", - "KI", - "KW", - "LA", - "LB", - "LS", - "LR", - "LY", - "MY", - "MV", - "MT", - "MH", - "MU", - "FM", - "MC", - "MS", - "NA", - "NR", - "NP", - "AN", - "NZ", - "NI", - "NG", - "NU", - "NF", - "MP", - "OM", - "PK", - "PW", - "PA", - "PG", - "PH", - "PN", - "PR", - "RW", - "SH", - "KN", - "LC", - "VC", - "WS", - "SC", - "SL", - "SG", - "SX", - "SB", - "SO", - "ZA", - "GS", - "KR", - "SS", - "LK", - "SD", - "SR", - "SY", - "TZ", - "TH", - "TL", - "TK", - "TO", - "TT", - "TC", - "TV", - "UG", - "AE", - "GB", - "US", - "UM", - "VI", - "VU", - "VN", - "ZM", - "ZW" - ], - "family": "Indo-European", - "iso_639_2B": "eng", - "iso_639_2T": "eng", - "iso_639_3": "eng", - "name_en": "English", - "name_native": "English", - "notes": "" + "frbr_uri": "/akn/aa-au/doc/activity-report/2017/nn", + "title": "Activity Report of the Pan-African Parliament, July 2016 to June 2017" }, - "model": "languages_plus.language", - "pk": "en" + "model": "peachjam.work", + "pk": 3573 }, { "fields": { @@ -5886,15 +2603,6 @@ "model": "peachjam.work", "pk": 3716 }, - { - "fields": { - "description": "", - "name": "Charter", - "code": "charter" - }, - "model": "peachjam.documentnature", - "pk": 3 - }, { "fields": { "citation": null, @@ -8143,6 +4851,7 @@ }, { "fields": { + "nature": 2, "citation": "Obi vs Federal Republic of Nigeria [2016] ECOWASCJ 52 (09 November 2016)", "content_html": "", "content_html_is_akn": false, @@ -8182,6 +4891,7 @@ }, { "fields": { + "nature": 2, "citation": "Ababacar and Ors vs Senegal [2018] ECOWASCJ 17 (29 June 2018)", "content_html": "", "content_html_is_akn": false, @@ -8253,6 +4963,7 @@ }, { "fields": { + "nature": 4, "citation": null, "content_html": "\n\n\n\n \n\n\n
African Union
\n \n \n\n \n \n \n\n \nAfrican Union
\n \n \n\n \n \n \n\n \nd?ee(e,a,i,!0,!1,p):T(t,n,r,a,i,s,l,c,p)},G=(e,t,n,r,a,i,s,l,c)=>{let u=0;const d=t.length;let p=e.length-1,h=d-1;for(;u<=p&&u<=h;){const r=e[u],o=t[u]=c?Sn(t[u]):Cn(t[u]);if(!hn(r,o))break;_(r,o,n,null,a,i,s,l,c),u++}for(;u<=p&&u<=h;){const r=e[p],o=t[h]=c?Sn(t[h]):Cn(t[h]);if(!hn(r,o))break;_(r,o,n,null,a,i,s,l,c),p--,h--}if(u>p){if(u<=h){const e=h+1,o=e\\n \\n
\\n Explanation
\\n \\n
\\n\\n abcxxxxxxdef\n // -> abcxxxdef\n // e.g: xxxabcdefxxx\n // -> defxxxabc\n // Only extract an overlap if it is as big as the edit ahead or behind it.\n pointer = 1;\n while (pointer < diffs.length) {\n if (diffs[pointer - 1][0] == DIFF_DELETE &&\n diffs[pointer][0] == DIFF_INSERT) {\n var deletion = diffs[pointer - 1][1];\n var insertion = diffs[pointer][1];\n var overlap_length1 = this.diff_commonOverlap_(deletion, insertion);\n var overlap_length2 = this.diff_commonOverlap_(insertion, deletion);\n if (overlap_length1 >= overlap_length2) {\n if (overlap_length1 >= deletion.length / 2 ||\n overlap_length1 >= insertion.length / 2) {\n // Overlap found. Insert an equality and trim the surrounding edits.\n diffs.splice(pointer, 0, new diff_match_patch.Diff(DIFF_EQUAL,\n insertion.substring(0, overlap_length1)));\n diffs[pointer - 1][1] =\n deletion.substring(0, deletion.length - overlap_length1);\n diffs[pointer + 1][1] = insertion.substring(overlap_length1);\n pointer++;\n }\n } else {\n if (overlap_length2 >= deletion.length / 2 ||\n overlap_length2 >= insertion.length / 2) {\n // Reverse overlap found.\n // Insert an equality and swap and trim the surrounding edits.\n diffs.splice(pointer, 0, new diff_match_patch.Diff(DIFF_EQUAL,\n deletion.substring(0, overlap_length2)));\n diffs[pointer - 1][0] = DIFF_INSERT;\n diffs[pointer - 1][1] =\n insertion.substring(0, insertion.length - overlap_length2);\n diffs[pointer + 1][0] = DIFF_DELETE;\n diffs[pointer + 1][1] =\n deletion.substring(overlap_length2);\n pointer++;\n }\n }\n pointer++;\n }\n pointer++;\n }\n};\n\n\n/**\n * Look for single edits surrounded on both sides by equalities\n * which can be shifted sideways to align the edit to a word boundary.\n * e.g: The cat came. -> The cat came.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {\n /**\n * Given two strings, compute a score representing whether the internal\n * boundary falls on logical boundaries.\n * Scores range from 6 (best) to 0 (worst).\n * Closure, but does not reference any external variables.\n * @param {string} one First string.\n * @param {string} two Second string.\n * @return {number} The score.\n * @private\n */\n function diff_cleanupSemanticScore_(one, two) {\n if (!one || !two) {\n // Edges are the best.\n return 6;\n }\n\n // Each port of this function behaves slightly differently due to\n // subtle differences in each language's definition of things like\n // 'whitespace'. Since this function's purpose is largely cosmetic,\n // the choice has been made to use each language's native features\n // rather than force total conformity.\n var char1 = one.charAt(one.length - 1);\n var char2 = two.charAt(0);\n var nonAlphaNumeric1 = char1.match(diff_match_patch.nonAlphaNumericRegex_);\n var nonAlphaNumeric2 = char2.match(diff_match_patch.nonAlphaNumericRegex_);\n var whitespace1 = nonAlphaNumeric1 &&\n char1.match(diff_match_patch.whitespaceRegex_);\n var whitespace2 = nonAlphaNumeric2 &&\n char2.match(diff_match_patch.whitespaceRegex_);\n var lineBreak1 = whitespace1 &&\n char1.match(diff_match_patch.linebreakRegex_);\n var lineBreak2 = whitespace2 &&\n char2.match(diff_match_patch.linebreakRegex_);\n var blankLine1 = lineBreak1 &&\n one.match(diff_match_patch.blanklineEndRegex_);\n var blankLine2 = lineBreak2 &&\n two.match(diff_match_patch.blanklineStartRegex_);\n\n if (blankLine1 || blankLine2) {\n // Five points for blank lines.\n return 5;\n } else if (lineBreak1 || lineBreak2) {\n // Four points for line breaks.\n return 4;\n } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {\n // Three points for end of sentences.\n return 3;\n } else if (whitespace1 || whitespace2) {\n // Two points for whitespace.\n return 2;\n } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {\n // One point for non-alphanumeric.\n return 1;\n }\n return 0;\n }\n\n var pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n var equality1 = diffs[pointer - 1][1];\n var edit = diffs[pointer][1];\n var equality2 = diffs[pointer + 1][1];\n\n // First, shift the edit as far left as possible.\n var commonOffset = this.diff_commonSuffix(equality1, edit);\n if (commonOffset) {\n var commonString = edit.substring(edit.length - commonOffset);\n equality1 = equality1.substring(0, equality1.length - commonOffset);\n edit = commonString + edit.substring(0, edit.length - commonOffset);\n equality2 = commonString + equality2;\n }\n\n // Second, step character by character right, looking for the best fit.\n var bestEquality1 = equality1;\n var bestEdit = edit;\n var bestEquality2 = equality2;\n var bestScore = diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n while (edit.charAt(0) === equality2.charAt(0)) {\n equality1 += edit.charAt(0);\n edit = edit.substring(1) + equality2.charAt(0);\n equality2 = equality2.substring(1);\n var score = diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n // The >= encourages trailing rather than leading whitespace on edits.\n if (score >= bestScore) {\n bestScore = score;\n bestEquality1 = equality1;\n bestEdit = edit;\n bestEquality2 = equality2;\n }\n }\n\n if (diffs[pointer - 1][1] != bestEquality1) {\n // We have an improvement, save it back to the diff.\n if (bestEquality1) {\n diffs[pointer - 1][1] = bestEquality1;\n } else {\n diffs.splice(pointer - 1, 1);\n pointer--;\n }\n diffs[pointer][1] = bestEdit;\n if (bestEquality2) {\n diffs[pointer + 1][1] = bestEquality2;\n } else {\n diffs.splice(pointer + 1, 1);\n pointer--;\n }\n }\n }\n pointer++;\n }\n};\n\n// Define some regex patterns for matching boundaries.\ndiff_match_patch.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;\ndiff_match_patch.whitespaceRegex_ = /\\s/;\ndiff_match_patch.linebreakRegex_ = /[\\r\\n]/;\ndiff_match_patch.blanklineEndRegex_ = /\\n\\r?\\n$/;\ndiff_match_patch.blanklineStartRegex_ = /^\\r?\\n\\r?\\n/;\n\n/**\n * Reduce the number of edits by eliminating operationally trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupEfficiency = function(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastEquality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Is there an insertion operation before the last equality.\n var pre_ins = false;\n // Is there a deletion operation before the last equality.\n var pre_del = false;\n // Is there an insertion operation after the last equality.\n var post_ins = false;\n // Is there a deletion operation after the last equality.\n var post_del = false;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) { // Equality found.\n if (diffs[pointer][1].length < this.Diff_EditCost &&\n (post_ins || post_del)) {\n // Candidate found.\n equalities[equalitiesLength++] = pointer;\n pre_ins = post_ins;\n pre_del = post_del;\n lastEquality = diffs[pointer][1];\n } else {\n // Not a candidate, and can never become one.\n equalitiesLength = 0;\n lastEquality = null;\n }\n post_ins = post_del = false;\n } else { // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_DELETE) {\n post_del = true;\n } else {\n post_ins = true;\n }\n /*\n * Five types to be split:\n * ABXYCD\n * AXCD\n * ABXC\n * AXCD\n * ABXC\n */\n if (lastEquality && ((pre_ins && pre_del && post_ins && post_del) ||\n ((lastEquality.length < this.Diff_EditCost / 2) &&\n (pre_ins + pre_del + post_ins + post_del) == 3))) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0,\n new diff_match_patch.Diff(DIFF_DELETE, lastEquality));\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n equalitiesLength--; // Throw away the equality we just deleted;\n lastEquality = null;\n if (pre_ins && pre_del) {\n // No changes made which could affect previous entry, keep going.\n post_ins = post_del = true;\n equalitiesLength = 0;\n } else {\n equalitiesLength--; // Throw away the previous equality.\n pointer = equalitiesLength > 0 ?\n equalities[equalitiesLength - 1] : -1;\n post_ins = post_del = false;\n }\n changes = true;\n }\n }\n pointer++;\n }\n\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupMerge = function(diffs) {\n // Add a dummy entry at the end.\n diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ''));\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = this.diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, new diff_match_patch.Diff(DIFF_EQUAL,\n text_insert.substring(0, commonlength)));\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = this.diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n pointer -= count_delete + count_insert;\n diffs.splice(pointer, count_delete + count_insert);\n if (text_delete.length) {\n diffs.splice(pointer, 0,\n new diff_match_patch.Diff(DIFF_DELETE, text_delete));\n pointer++;\n }\n if (text_insert.length) {\n diffs.splice(pointer, 0,\n new diff_match_patch.Diff(DIFF_INSERT, text_insert));\n pointer++;\n }\n pointer++;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n};\n\n\n/**\n * loc is a location in text1, compute and return the equivalent location in\n * text2.\n * e.g. 'The cat' vs 'The big cat', 1->1, 5->8\n * @param {!Array.} diffs Array of diff tuples.\n * @param {number} loc Location within text1.\n * @return {number} Location within text2.\n */\ndiff_match_patch.prototype.diff_xIndex = function(diffs, loc) {\n var chars1 = 0;\n var chars2 = 0;\n var last_chars1 = 0;\n var last_chars2 = 0;\n var x;\n for (x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_INSERT) { // Equality or deletion.\n chars1 += diffs[x][1].length;\n }\n if (diffs[x][0] !== DIFF_DELETE) { // Equality or insertion.\n chars2 += diffs[x][1].length;\n }\n if (chars1 > loc) { // Overshot the location.\n break;\n }\n last_chars1 = chars1;\n last_chars2 = chars2;\n }\n // Was the location was deleted?\n if (diffs.length != x && diffs[x][0] === DIFF_DELETE) {\n return last_chars2;\n }\n // Add the remaining character length.\n return last_chars2 + (loc - last_chars1);\n};\n\n\n/**\n * Convert a diff array into a pretty HTML report.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} HTML representation.\n */\ndiff_match_patch.prototype.diff_prettyHtml = function(diffs) {\n var html = [];\n var pattern_amp = /&/g;\n var pattern_lt = //g;\n var pattern_para = /\\n/g;\n for (var x = 0; x < diffs.length; x++) {\n var op = diffs[x][0]; // Operation (insert, delete, equal)\n var data = diffs[x][1]; // Text of change.\n var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<')\n .replace(pattern_gt, '>').replace(pattern_para, '¶
');\n switch (op) {\n case DIFF_INSERT:\n html[x] = '' + text + '';\n break;\n case DIFF_DELETE:\n html[x] = '' + text + '';\n break;\n case DIFF_EQUAL:\n html[x] = '' + text + '';\n break;\n }\n }\n return html.join('');\n};\n\n\n/**\n * Compute and return the source text (all equalities and deletions).\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Source text.\n */\ndiff_match_patch.prototype.diff_text1 = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_INSERT) {\n text[x] = diffs[x][1];\n }\n }\n return text.join('');\n};\n\n\n/**\n * Compute and return the destination text (all equalities and insertions).\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Destination text.\n */\ndiff_match_patch.prototype.diff_text2 = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_DELETE) {\n text[x] = diffs[x][1];\n }\n }\n return text.join('');\n};\n\n\n/**\n * Compute the Levenshtein distance; the number of inserted, deleted or\n * substituted characters.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {number} Number of changes.\n */\ndiff_match_patch.prototype.diff_levenshtein = function(diffs) {\n var levenshtein = 0;\n var insertions = 0;\n var deletions = 0;\n for (var x = 0; x < diffs.length; x++) {\n var op = diffs[x][0];\n var data = diffs[x][1];\n switch (op) {\n case DIFF_INSERT:\n insertions += data.length;\n break;\n case DIFF_DELETE:\n deletions += data.length;\n break;\n case DIFF_EQUAL:\n // A deletion and an insertion is one substitution.\n levenshtein += Math.max(insertions, deletions);\n insertions = 0;\n deletions = 0;\n break;\n }\n }\n levenshtein += Math.max(insertions, deletions);\n return levenshtein;\n};\n\n\n/**\n * Crush the diff into an encoded string which describes the operations\n * required to transform text1 into text2.\n * E.g. =3\\t-2\\t+ing -> Keep 3 chars, delete 2 chars, insert 'ing'.\n * Operations are tab-separated. Inserted text is escaped using %xx notation.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Delta text.\n */\ndiff_match_patch.prototype.diff_toDelta = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n switch (diffs[x][0]) {\n case DIFF_INSERT:\n text[x] = '+' + encodeURI(diffs[x][1]);\n break;\n case DIFF_DELETE:\n text[x] = '-' + diffs[x][1].length;\n break;\n case DIFF_EQUAL:\n text[x] = '=' + diffs[x][1].length;\n break;\n }\n }\n return text.join('\\t').replace(/%20/g, ' ');\n};\n\n\n/**\n * Given the original text1, and an encoded string which describes the\n * operations required to transform text1 into text2, compute the full diff.\n * @param {string} text1 Source string for the diff.\n * @param {string} delta Delta text.\n * @return {!Array.} Array of diff tuples.\n * @throws {!Error} If invalid input.\n */\ndiff_match_patch.prototype.diff_fromDelta = function(text1, delta) {\n var diffs = [];\n var diffsLength = 0; // Keeping our own length var is faster in JS.\n var pointer = 0; // Cursor in text1\n var tokens = delta.split(/\\t/g);\n for (var x = 0; x < tokens.length; x++) {\n // Each token begins with a one character parameter which specifies the\n // operation of this token (delete, insert, equality).\n var param = tokens[x].substring(1);\n switch (tokens[x].charAt(0)) {\n case '+':\n try {\n diffs[diffsLength++] =\n new diff_match_patch.Diff(DIFF_INSERT, decodeURI(param));\n } catch (ex) {\n // Malformed URI sequence.\n throw new Error('Illegal escape in diff_fromDelta: ' + param);\n }\n break;\n case '-':\n // Fall through.\n case '=':\n var n = parseInt(param, 10);\n if (isNaN(n) || n < 0) {\n throw new Error('Invalid number in diff_fromDelta: ' + param);\n }\n var text = text1.substring(pointer, pointer += n);\n if (tokens[x].charAt(0) == '=') {\n diffs[diffsLength++] = new diff_match_patch.Diff(DIFF_EQUAL, text);\n } else {\n diffs[diffsLength++] = new diff_match_patch.Diff(DIFF_DELETE, text);\n }\n break;\n default:\n // Blank tokens are ok (from a trailing \\t).\n // Anything else is an error.\n if (tokens[x]) {\n throw new Error('Invalid diff operation in diff_fromDelta: ' +\n tokens[x]);\n }\n }\n }\n if (pointer != text1.length) {\n throw new Error('Delta length (' + pointer +\n ') does not equal source text length (' + text1.length + ').');\n }\n return diffs;\n};\n\n\n// MATCH FUNCTIONS\n\n\n/**\n * Locate the best instance of 'pattern' in 'text' near 'loc'.\n * @param {string} text The text to search.\n * @param {string} pattern The pattern to search for.\n * @param {number} loc The location to search around.\n * @return {number} Best match index or -1.\n */\ndiff_match_patch.prototype.match_main = function(text, pattern, loc) {\n // Check for null inputs.\n if (text == null || pattern == null || loc == null) {\n throw new Error('Null input. (match_main)');\n }\n\n loc = Math.max(0, Math.min(loc, text.length));\n if (text == pattern) {\n // Shortcut (potentially not guaranteed by the algorithm)\n return 0;\n } else if (!text.length) {\n // Nothing to match.\n return -1;\n } else if (text.substring(loc, loc + pattern.length) == pattern) {\n // Perfect match at the perfect spot! (Includes case of null pattern)\n return loc;\n } else {\n // Do a fuzzy compare.\n return this.match_bitap_(text, pattern, loc);\n }\n};\n\n\n/**\n * Locate the best instance of 'pattern' in 'text' near 'loc' using the\n * Bitap algorithm.\n * @param {string} text The text to search.\n * @param {string} pattern The pattern to search for.\n * @param {number} loc The location to search around.\n * @return {number} Best match index or -1.\n * @private\n */\ndiff_match_patch.prototype.match_bitap_ = function(text, pattern, loc) {\n if (pattern.length > this.Match_MaxBits) {\n throw new Error('Pattern too long for this browser.');\n }\n\n // Initialise the alphabet.\n var s = this.match_alphabet_(pattern);\n\n var dmp = this; // 'this' becomes 'window' in a closure.\n\n /**\n * Compute and return the score for a match with e errors and x location.\n * Accesses loc and pattern through being a closure.\n * @param {number} e Number of errors in match.\n * @param {number} x Location of match.\n * @return {number} Overall score for match (0.0 = good, 1.0 = bad).\n * @private\n */\n function match_bitapScore_(e, x) {\n var accuracy = e / pattern.length;\n var proximity = Math.abs(loc - x);\n if (!dmp.Match_Distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy;\n }\n return accuracy + (proximity / dmp.Match_Distance);\n }\n\n // Highest score beyond which we give up.\n var score_threshold = this.Match_Threshold;\n // Is there a nearby exact match? (speedup)\n var best_loc = text.indexOf(pattern, loc);\n if (best_loc != -1) {\n score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold);\n // What about in the other direction? (speedup)\n best_loc = text.lastIndexOf(pattern, loc + pattern.length);\n if (best_loc != -1) {\n score_threshold =\n Math.min(match_bitapScore_(0, best_loc), score_threshold);\n }\n }\n\n // Initialise the bit arrays.\n var matchmask = 1 << (pattern.length - 1);\n best_loc = -1;\n\n var bin_min, bin_mid;\n var bin_max = pattern.length + text.length;\n var last_rd;\n for (var d = 0; d < pattern.length; d++) {\n // Scan for the best match; each iteration allows for one more error.\n // Run a binary search to determine how far from 'loc' we can stray at this\n // error level.\n bin_min = 0;\n bin_mid = bin_max;\n while (bin_min < bin_mid) {\n if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) {\n bin_min = bin_mid;\n } else {\n bin_max = bin_mid;\n }\n bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min);\n }\n // Use the result from this iteration as the maximum for the next.\n bin_max = bin_mid;\n var start = Math.max(1, loc - bin_mid + 1);\n var finish = Math.min(loc + bin_mid, text.length) + pattern.length;\n\n var rd = Array(finish + 2);\n rd[finish + 1] = (1 << d) - 1;\n for (var j = finish; j >= start; j--) {\n // The alphabet (s) is a sparse hash, so the following line generates\n // warnings.\n var charMatch = s[text.charAt(j - 1)];\n if (d === 0) { // First pass: exact match.\n rd[j] = ((rd[j + 1] << 1) | 1) & charMatch;\n } else { // Subsequent passes: fuzzy match.\n rd[j] = (((rd[j + 1] << 1) | 1) & charMatch) |\n (((last_rd[j + 1] | last_rd[j]) << 1) | 1) |\n last_rd[j + 1];\n }\n if (rd[j] & matchmask) {\n var score = match_bitapScore_(d, j - 1);\n // This match will almost certainly be better than any existing match.\n // But check anyway.\n if (score <= score_threshold) {\n // Told you so.\n score_threshold = score;\n best_loc = j - 1;\n if (best_loc > loc) {\n // When passing loc, don't exceed our current distance from loc.\n start = Math.max(1, 2 * loc - best_loc);\n } else {\n // Already passed loc, downhill from here on in.\n break;\n }\n }\n }\n }\n // No hope for a (better) match at greater error levels.\n if (match_bitapScore_(d + 1, loc) > score_threshold) {\n break;\n }\n last_rd = rd;\n }\n return best_loc;\n};\n\n\n/**\n * Initialise the alphabet for the Bitap algorithm.\n * @param {string} pattern The text to encode.\n * @return {!Object} Hash of character locations.\n * @private\n */\ndiff_match_patch.prototype.match_alphabet_ = function(pattern) {\n var s = {};\n for (var i = 0; i < pattern.length; i++) {\n s[pattern.charAt(i)] = 0;\n }\n for (var i = 0; i < pattern.length; i++) {\n s[pattern.charAt(i)] |= 1 << (pattern.length - i - 1);\n }\n return s;\n};\n\n\n// PATCH FUNCTIONS\n\n\n/**\n * Increase the context until it is unique,\n * but don't let the pattern expand beyond Match_MaxBits.\n * @param {!diff_match_patch.patch_obj} patch The patch to grow.\n * @param {string} text Source text.\n * @private\n */\ndiff_match_patch.prototype.patch_addContext_ = function(patch, text) {\n if (text.length == 0) {\n return;\n }\n if (patch.start2 === null) {\n throw Error('patch not initialized');\n }\n var pattern = text.substring(patch.start2, patch.start2 + patch.length1);\n var padding = 0;\n\n // Look for the first and last matches of pattern in text. If two different\n // matches are found, increase the pattern length.\n while (text.indexOf(pattern) != text.lastIndexOf(pattern) &&\n pattern.length < this.Match_MaxBits - this.Patch_Margin -\n this.Patch_Margin) {\n padding += this.Patch_Margin;\n pattern = text.substring(patch.start2 - padding,\n patch.start2 + patch.length1 + padding);\n }\n // Add one chunk for good luck.\n padding += this.Patch_Margin;\n\n // Add the prefix.\n var prefix = text.substring(patch.start2 - padding, patch.start2);\n if (prefix) {\n patch.diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, prefix));\n }\n // Add the suffix.\n var suffix = text.substring(patch.start2 + patch.length1,\n patch.start2 + patch.length1 + padding);\n if (suffix) {\n patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, suffix));\n }\n\n // Roll back the start points.\n patch.start1 -= prefix.length;\n patch.start2 -= prefix.length;\n // Extend the lengths.\n patch.length1 += prefix.length + suffix.length;\n patch.length2 += prefix.length + suffix.length;\n};\n\n\n/**\n * Compute a list of patches to turn text1 into text2.\n * Use diffs if provided, otherwise compute it ourselves.\n * There are four ways to call this function, depending on what data is\n * available to the caller:\n * Method 1:\n * a = text1, b = text2\n * Method 2:\n * a = diffs\n * Method 3 (optimal):\n * a = text1, b = diffs\n * Method 4 (deprecated, use method 3):\n * a = text1, b = text2, c = diffs\n *\n * @param {string|!Array.} a text1 (methods 1,3,4) or\n * Array of diff tuples for text1 to text2 (method 2).\n * @param {string|!Array.=} opt_b text2 (methods 1,4) or\n * Array of diff tuples for text1 to text2 (method 3) or undefined (method 2).\n * @param {string|!Array.=} opt_c Array of diff tuples\n * for text1 to text2 (method 4) or undefined (methods 1,2,3).\n * @return {!Array.} Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_make = function(a, opt_b, opt_c) {\n var text1, diffs;\n if (typeof a == 'string' && typeof opt_b == 'string' &&\n typeof opt_c == 'undefined') {\n // Method 1: text1, text2\n // Compute diffs from text1 and text2.\n text1 = /** @type {string} */(a);\n diffs = this.diff_main(text1, /** @type {string} */(opt_b), true);\n if (diffs.length > 2) {\n this.diff_cleanupSemantic(diffs);\n this.diff_cleanupEfficiency(diffs);\n }\n } else if (a && typeof a == 'object' && typeof opt_b == 'undefined' &&\n typeof opt_c == 'undefined') {\n // Method 2: diffs\n // Compute text1 from diffs.\n diffs = /** @type {!Array.} */(a);\n text1 = this.diff_text1(diffs);\n } else if (typeof a == 'string' && opt_b && typeof opt_b == 'object' &&\n typeof opt_c == 'undefined') {\n // Method 3: text1, diffs\n text1 = /** @type {string} */(a);\n diffs = /** @type {!Array.} */(opt_b);\n } else if (typeof a == 'string' && typeof opt_b == 'string' &&\n opt_c && typeof opt_c == 'object') {\n // Method 4: text1, text2, diffs\n // text2 is not used.\n text1 = /** @type {string} */(a);\n diffs = /** @type {!Array.} */(opt_c);\n } else {\n throw new Error('Unknown call format to patch_make.');\n }\n\n if (diffs.length === 0) {\n return []; // Get rid of the null case.\n }\n var patches = [];\n var patch = new diff_match_patch.patch_obj();\n var patchDiffLength = 0; // Keeping our own length var is faster in JS.\n var char_count1 = 0; // Number of characters into the text1 string.\n var char_count2 = 0; // Number of characters into the text2 string.\n // Start with text1 (prepatch_text) and apply the diffs until we arrive at\n // text2 (postpatch_text). We recreate the patches one by one to determine\n // context info.\n var prepatch_text = text1;\n var postpatch_text = text1;\n for (var x = 0; x < diffs.length; x++) {\n var diff_type = diffs[x][0];\n var diff_text = diffs[x][1];\n\n if (!patchDiffLength && diff_type !== DIFF_EQUAL) {\n // A new patch starts here.\n patch.start1 = char_count1;\n patch.start2 = char_count2;\n }\n\n switch (diff_type) {\n case DIFF_INSERT:\n patch.diffs[patchDiffLength++] = diffs[x];\n patch.length2 += diff_text.length;\n postpatch_text = postpatch_text.substring(0, char_count2) + diff_text +\n postpatch_text.substring(char_count2);\n break;\n case DIFF_DELETE:\n patch.length1 += diff_text.length;\n patch.diffs[patchDiffLength++] = diffs[x];\n postpatch_text = postpatch_text.substring(0, char_count2) +\n postpatch_text.substring(char_count2 +\n diff_text.length);\n break;\n case DIFF_EQUAL:\n if (diff_text.length <= 2 * this.Patch_Margin &&\n patchDiffLength && diffs.length != x + 1) {\n // Small equality inside a patch.\n patch.diffs[patchDiffLength++] = diffs[x];\n patch.length1 += diff_text.length;\n patch.length2 += diff_text.length;\n } else if (diff_text.length >= 2 * this.Patch_Margin) {\n // Time for a new patch.\n if (patchDiffLength) {\n this.patch_addContext_(patch, prepatch_text);\n patches.push(patch);\n patch = new diff_match_patch.patch_obj();\n patchDiffLength = 0;\n // Unlike Unidiff, our patch lists have a rolling context.\n // https://github.com/google/diff-match-patch/wiki/Unidiff\n // Update prepatch text & pos to reflect the application of the\n // just completed patch.\n prepatch_text = postpatch_text;\n char_count1 = char_count2;\n }\n }\n break;\n }\n\n // Update the current character count.\n if (diff_type !== DIFF_INSERT) {\n char_count1 += diff_text.length;\n }\n if (diff_type !== DIFF_DELETE) {\n char_count2 += diff_text.length;\n }\n }\n // Pick up the leftover patch if not empty.\n if (patchDiffLength) {\n this.patch_addContext_(patch, prepatch_text);\n patches.push(patch);\n }\n\n return patches;\n};\n\n\n/**\n * Given an array of patches, return another array that is identical.\n * @param {!Array.} patches Array of Patch objects.\n * @return {!Array.} Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_deepCopy = function(patches) {\n // Making deep copies is hard in JavaScript.\n var patchesCopy = [];\n for (var x = 0; x < patches.length; x++) {\n var patch = patches[x];\n var patchCopy = new diff_match_patch.patch_obj();\n patchCopy.diffs = [];\n for (var y = 0; y < patch.diffs.length; y++) {\n patchCopy.diffs[y] =\n new diff_match_patch.Diff(patch.diffs[y][0], patch.diffs[y][1]);\n }\n patchCopy.start1 = patch.start1;\n patchCopy.start2 = patch.start2;\n patchCopy.length1 = patch.length1;\n patchCopy.length2 = patch.length2;\n patchesCopy[x] = patchCopy;\n }\n return patchesCopy;\n};\n\n\n/**\n * Merge a set of patches onto the text. Return a patched text, as well\n * as a list of true/false values indicating which patches were applied.\n * @param {!Array.} patches Array of Patch objects.\n * @param {string} text Old text.\n * @return {!Array.