Catalog PyPI
PACKAGE EXPLORERView in registry

abclf

PyPI

Classify American vs. British English

americanbritishenglishvariant
Versions collected1
Direct dependencies8From release 1.0.1
Last observed20 Oct, 17:14 UTC

README

Version 1.0.1 documentation

American-British-variety-classifier

A minimalistic spelling- and vocabulary-based American-vs-British variety classifier.

Description

This classifier is based on the VarCon database. First the database was read and used in its entirety, after which progressive prunings were performed to improve performance.

The classifier performs rudimentary preprocessing (some weird character deletion to reduce the odds of discarding non-important words) and then checks all lowercase nonnumerical words if they are present in the dictionary. The final step is assigning variety to the input text, for which we use the following logic:

  • for documents with no identified American or British lexemes it returns UNK,
  • if one variant has more than twice as many identified words as the other, it classifies the instance as the more frequent variant,
  • else it classifies it as MIX.

Installation

pip install abclf

Use

import abclf
text = "The flautist heard a rumour about the gray haired clarinettist in a wollen pullover"
abclf.get_variant(text)

# 'B'

Authors

  • Peter Rupnik
  • Taja Kuzman
  • Nikola Ljubešić
Copyright 2000-2020 by Kevin Atkinson (kevina@gnu.org) and Benjamin
Titze (btitze@protonmail.ch).

Copyright 2000-2019 by Kevin Atkinson

Permission to use, copy, modify, distribute and sell this array, the
associated software, and its documentation for any purpose is hereby
granted without fee, provided that the above copyright notice appears
in all copies and that both that copyright notice and this permission
notice appear in supporting documentation. Kevin Atkinson makes no
representations about the suitability of this array for any
purpose. It is provided "as is" without express or implied warranty.

Copyright 2016 by Benjamin Titze

Permission to use, copy, modify, distribute and sell this array, the
associated software, and its documentation for any purpose is hereby
granted without fee, provided that the above copyright notice appears
in all copies and that both that copyright notice and this permission
notice appear in supporting documentation. Benjamin Titze makes no
representations about the suitability of this array for any
purpose. It is provided "as is" without express or implied warranty.

Since the original words lists come from the Ispell distribution:

Copyright 1993, Geoff Kuenning, Granada Hills, CA
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.
3. All modifications to the source code must be clearly marked as
   such.  Binary redistributions based on modified source code
   must be clearly marked as modified versions in the documentation
   and/or other materials provided with the distribution.
(clause 4 removed with permission from Geoff Kuenning)
5. The name of Geoff Kuenning may not be used to endorse or promote
   products derived from this software without specific prior
   written permission.

THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

Downloads & popularity

1downloads
1-day window · source-reported counts17 Oct 2026
3718.50
2026-07-20: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-07-20–2026-07-202026-07-21: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-07-21–2026-07-212026-07-23: 3 · observed 2026-10-20T20:42:28.6933548Z · period 2026-07-23–2026-07-232026-07-27: 2 · observed 2026-10-20T20:42:28.6933548Z · period 2026-07-27–2026-07-272026-07-29: 14 · observed 2026-10-20T20:42:28.6933548Z · period 2026-07-29–2026-07-292026-08-01: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-01–2026-08-012026-08-02: 2 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-02–2026-08-022026-08-03: 8 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-03–2026-08-032026-08-04: 8 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-04–2026-08-042026-08-06: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-06–2026-08-062026-08-09: 2 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-09–2026-08-092026-08-12: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-12–2026-08-122026-08-13: 3 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-13–2026-08-132026-08-14: 5 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-14–2026-08-142026-08-17: 6 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-17–2026-08-172026-08-18: 37 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-18–2026-08-182026-08-19: 4 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-19–2026-08-192026-08-20: 5 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-20–2026-08-202026-08-23: 3 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-23–2026-08-232026-08-24: 10 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-24–2026-08-242026-08-25: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-25–2026-08-252026-08-28: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-28–2026-08-282026-08-30: 2 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-30–2026-08-302026-08-31: 5 · observed 2026-10-20T20:42:28.6933548Z · period 2026-08-31–2026-08-312026-09-01: 3 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-01–2026-09-012026-09-03: 2 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-03–2026-09-032026-09-06: 6 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-06–2026-09-062026-09-07: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-07–2026-09-072026-09-09: 3 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-09–2026-09-092026-09-10: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-10–2026-09-102026-09-12: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-12–2026-09-122026-09-15: 2 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-15–2026-09-152026-09-18: 2 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-18–2026-09-182026-09-19: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-19–2026-09-192026-09-21: 2 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-21–2026-09-212026-09-24: 7 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-24–2026-09-242026-09-26: 3 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-26–2026-09-262026-09-27: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-27–2026-09-272026-09-28: 3 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-28–2026-09-282026-09-29: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-29–2026-09-292026-09-30: 2 · observed 2026-10-20T20:42:28.6933548Z · period 2026-09-30–2026-09-302026-10-01: 3 · observed 2026-10-20T20:42:28.6933548Z · period 2026-10-01–2026-10-012026-10-06: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-10-06–2026-10-062026-10-07: 2 · observed 2026-10-20T20:42:28.6933548Z · period 2026-10-07–2026-10-072026-10-08: 3 · observed 2026-10-20T20:42:28.6933548Z · period 2026-10-08–2026-10-082026-10-09: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-10-09–2026-10-092026-10-10: 3 · observed 2026-10-20T20:42:28.6933548Z · period 2026-10-10–2026-10-102026-10-12: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-10-12–2026-10-122026-10-13: 2 · observed 2026-10-20T20:42:28.6933548Z · period 2026-10-13–2026-10-132026-10-14: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-10-14–2026-10-142026-10-15: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-10-15–2026-10-152026-10-17: 1 · observed 2026-10-20T20:42:28.6933548Z · period 2026-10-17–2026-10-17
20 Jul17 Oct

pypistats · 52 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-17 – 2026-10-1712026-10-20T20:42:28.6933548Z
2026-10-15 – 2026-10-1512026-10-20T20:42:28.6933548Z
2026-10-14 – 2026-10-1412026-10-20T20:42:28.6933548Z
2026-10-13 – 2026-10-1322026-10-20T20:42:28.6933548Z
2026-10-12 – 2026-10-1212026-10-20T20:42:28.6933548Z
2026-10-10 – 2026-10-1032026-10-20T20:42:28.6933548Z
2026-10-09 – 2026-10-0912026-10-20T20:42:28.6933548Z
2026-10-08 – 2026-10-0832026-10-20T20:42:28.6933548Z
2026-10-07 – 2026-10-0722026-10-20T20:42:28.6933548Z
2026-10-06 – 2026-10-0612026-10-20T20:42:28.6933548Z
2026-10-01 – 2026-10-0132026-10-20T20:42:28.6933548Z
2026-09-30 – 2026-09-3022026-10-20T20:42:28.6933548Z
2026-09-29 – 2026-09-2912026-10-20T20:42:28.6933548Z
2026-09-28 – 2026-09-2832026-10-20T20:42:28.6933548Z
2026-09-27 – 2026-09-2712026-10-20T20:42:28.6933548Z
2026-09-26 – 2026-09-2632026-10-20T20:42:28.6933548Z
2026-09-24 – 2026-09-2472026-10-20T20:42:28.6933548Z
2026-09-21 – 2026-09-2122026-10-20T20:42:28.6933548Z
2026-09-19 – 2026-09-1912026-10-20T20:42:28.6933548Z
2026-09-18 – 2026-09-1822026-10-20T20:42:28.6933548Z
2026-09-15 – 2026-09-1522026-10-20T20:42:28.6933548Z
2026-09-12 – 2026-09-1212026-10-20T20:42:28.6933548Z
2026-09-10 – 2026-09-1012026-10-20T20:42:28.6933548Z
2026-09-09 – 2026-09-0932026-10-20T20:42:28.6933548Z
2026-09-07 – 2026-09-0712026-10-20T20:42:28.6933548Z
2026-09-06 – 2026-09-0662026-10-20T20:42:28.6933548Z
2026-09-03 – 2026-09-0322026-10-20T20:42:28.6933548Z
2026-09-01 – 2026-09-0132026-10-20T20:42:28.6933548Z
2026-08-31 – 2026-08-3152026-10-20T20:42:28.6933548Z
2026-08-30 – 2026-08-3022026-10-20T20:42:28.6933548Z
2026-08-28 – 2026-08-2812026-10-20T20:42:28.6933548Z
2026-08-25 – 2026-08-2512026-10-20T20:42:28.6933548Z
2026-08-24 – 2026-08-24102026-10-20T20:42:28.6933548Z
2026-08-23 – 2026-08-2332026-10-20T20:42:28.6933548Z
2026-08-20 – 2026-08-2052026-10-20T20:42:28.6933548Z
2026-08-19 – 2026-08-1942026-10-20T20:42:28.6933548Z
2026-08-18 – 2026-08-18372026-10-20T20:42:28.6933548Z
2026-08-17 – 2026-08-1762026-10-20T20:42:28.6933548Z
2026-08-14 – 2026-08-1452026-10-20T20:42:28.6933548Z
2026-08-13 – 2026-08-1332026-10-20T20:42:28.6933548Z
2026-08-12 – 2026-08-1212026-10-20T20:42:28.6933548Z
2026-08-09 – 2026-08-0922026-10-20T20:42:28.6933548Z
2026-08-06 – 2026-08-0612026-10-20T20:42:28.6933548Z
2026-08-04 – 2026-08-0482026-10-20T20:42:28.6933548Z
2026-08-03 – 2026-08-0382026-10-20T20:42:28.6933548Z
2026-08-02 – 2026-08-0222026-10-20T20:42:28.6933548Z
2026-08-01 – 2026-08-0112026-10-20T20:42:28.6933548Z
2026-07-29 – 2026-07-29142026-10-20T20:42:28.6933548Z
2026-07-27 – 2026-07-2722026-10-20T20:42:28.6933548Z
2026-07-23 – 2026-07-2332026-10-20T20:42:28.6933548Z
2026-07-21 – 2026-07-2112026-10-20T20:42:28.6933548Z
2026-07-20 – 2026-07-2012026-10-20T20:42:28.6933548Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.121 Mar 20238

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
macocu/american-british-variety-classifier

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:14 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:236e7111d91a0c8e71268b800a18bee3ca64b74f94fa31343643dbc28c43d646