Debian Codegraph @

docs/plugins/bareasc.rst

raw
1 Bare-ASCII Search Plugin
2 ========================
3
4 The ``bareasc`` plugin provides a prefixed query that searches your library
5 using simple ASCII character matching, with accented characters folded to their
6 base ASCII character. This can be useful if you want to find a track with
7 accented characters in the title or artist, particularly if you are not
8 confident you have the accents correct. It is also not unknown for the accents
9 to not be correct in the database entry or wrong in the CD information.
10
11 First, enable the plugin named ``bareasc`` (see :ref:`using-plugins`). You'll
12 then be able to use the ``#`` prefix to use bare-ASCII matching:
13
14 ::
15
16 $ beet ls '#dvorak'
17 István Kertész - REQUIEM - Dvořàk: Requiem, op.89 - Confutatis maledictis
18
19 Command
20 -------
21
22 In addition to the query prefix, the plugin provides a utility ``bareasc``
23 command. This command is **exactly** the same as the ``beet list`` command
24 except that the output is passed through the bare-ASCII transformation before
25 being printed. This allows you to easily check what the library data looks like
26 in bare ASCII, which can be useful if you are trying to work out why a query is
27 not matching.
28
29 Using the same example track as above:
30
31 ::
32
33 $ beet bareasc 'Dvořàk'
34 Istvan Kertesz - REQUIEM - Dvorak: Requiem, op.89 - Confutatis maledictis
35
36 Note: the ``bareasc`` command does *not* automatically use bare-ASCII queries.
37 If you want a bare-ASCII query you still need to specify the ``#`` prefix.
38
39 Notes
40 -----
41
42 If the query string is all in lower case, the comparison ignores case as well as
43 accents.
44
45 The default ``bareasc`` prefix (``#``) is used as a comment character in some
46 shells so may need to be protected (for example in quotes) when typed into the
47 command line.
48
49 The bare ASCII transliteration is quite simple. It may not give the expected
50 output for all languages. For example, German u-umlaut ``ü`` is transformed into
51 ASCII ``u``, not into ``ue``.
52
53 The bare ASCII transformation also changes Unicode punctuation like double
54 quotes, apostrophes and even some hyphens. It is often best to leave out
55 punctuation in the queries. Note that the punctuation changes are often not even
56 visible with normal terminal fonts. You can always use the ``bareasc`` command
57 to print the transformed entries and use a command like ``diff`` to compare with
58 the output from the ``list`` command.
59
60 Configuration
61 -------------
62
63 To configure the plugin, make a ``bareasc:`` section in your configuration file.
64 The only available option is:
65
66 - **prefix**: The character used to designate bare-ASCII queries. Default:
67 ``#``, which may need to be escaped in some shells.
68
69 Credits
70 -------
71
72 The hard work in this plugin is done in Sean Burke's `Unidecode
73 <https://pypi.org/project/Unidecode/>`__ library. Thanks are due to Sean and to
74 all the people who created the Python version and the beets extensible query
75 architecture.