| 1 |
# SOME DESCRIPTIVE TITLE. |
| 2 |
# Copyright (C) Kovid Goyal |
| 3 |
# This file is distributed under the same license as the calibre package. |
| 4 |
# |
| 5 |
# Translators: |
| 6 |
# abuyop <[email protected]>, 2015,2017-2018 |
| 7 |
msgid "" |
| 8 |
msgstr "" |
| 9 |
"Project-Id-Version: calibre\n" |
| 10 |
"Report-Msgid-Bugs-To: \n" |
| 11 |
"POT-Creation-Date: 2021-12-01 12:56+0000\n" |
| 12 |
"PO-Revision-Date: 2021-11-23 15:50+0000\n" |
| 13 |
"Last-Translator: Kovid Goyal <[email protected]>\n" |
| 14 |
"Language-Team: Malay (http://www.transifex.com/calibre/calibre/language/ms/)\n" |
| 15 |
"MIME-Version: 1.0\n" |
| 16 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 17 |
"Content-Transfer-Encoding: 8bit\n" |
| 18 |
"Language: ms\n" |
| 19 |
"Plural-Forms: nplurals=1; plural=0;\n" |
| 20 |
|
| 21 |
#: ../../__w/calibre/calibre/manual/regexp.rst:4 |
| 22 |
msgid "All about using regular expressions in calibre" |
| 23 |
msgstr "Semua berkenaan penggunaan ungkapan nalar di dalam calibre" |
| 24 |
|
| 25 |
#: ../../__w/calibre/calibre/manual/regexp.rst:6 |
| 26 |
msgid "" |
| 27 |
"Regular expressions are features used in many places in calibre to perform " |
| 28 |
"sophisticated manipulation of e-book content and metadata. This tutorial is " |
| 29 |
"a gentle introduction to getting you started with using regular expressions " |
| 30 |
"in calibre." |
| 31 |
msgstr "Ungkapan nalar merupakan fitur yang banyak digunakan di dalam calibre untuk membuat manipulasi rumit bagi kandungan serta data meta e-buku. Tutorial ini merupakan pengenalan asasi untuk anda memulakan penggunaan ungkapan nalar di dalam calibre." |
| 32 |
|
| 33 |
#: ../../__w/calibre/calibre/manual/regexp.rst:11 |
| 34 |
msgid "Contents" |
| 35 |
msgstr "Kandungan" |
| 36 |
|
| 37 |
#: ../../__w/calibre/calibre/manual/regexp.rst:14 |
| 38 |
msgid "First, a word of warning and a word of courage" |
| 39 |
msgstr "Pertama sekali, untuk pembakar semangat dan peringatan mesra" |
| 40 |
|
| 41 |
#: ../../__w/calibre/calibre/manual/regexp.rst:16 |
| 42 |
msgid "" |
| 43 |
"This is, inevitably, going to be somewhat technical- after all, regular " |
| 44 |
"expressions are a technical tool for doing technical stuff. I'm going to " |
| 45 |
"have to use some jargon and concepts that may seem complicated or " |
| 46 |
"convoluted. I'm going to try to explain those concepts as clearly as I can, " |
| 47 |
"but really can't do without using them at all. That being said, don't be " |
| 48 |
"discouraged by any jargon, as I've tried to explain everything new. And " |
| 49 |
"while regular expressions themselves may seem like an arcane, black magic " |
| 50 |
"(or, to be more prosaic, a random string of mumbo-jumbo letters and signs), " |
| 51 |
"I promise that they are not all that complicated. Even those who understand " |
| 52 |
"regular expressions really well have trouble reading the more complex ones, " |
| 53 |
"but writing them isn't as difficult- you construct the expression step by " |
| 54 |
"step. So, take a step and follow me into the rabbit hole." |
| 55 |
msgstr "Perbincangan ini akan menjadi lebih teknikal, ungkapan nalar atau regular expression ialah alat teknikal untuk membuat pekara-perkara teknikal :P. Terdapat beberapa istilah atau jargon dan konsep mungkin rumit atau berbelit (tak pe kita teruskan). Walaubagaimanapun, penerangan akan dibuat semudah yang mungkin, kerana istilah-istilah ini wajib digunakan. Jom kita teruskan." |
| 56 |
|
| 57 |
#: ../../__w/calibre/calibre/manual/regexp.rst:19 |
| 58 |
msgid "Where in calibre can you use regular expressions?" |
| 59 |
msgstr "Kenapa calibre menggunakan ungkapan nalar?" |
| 60 |
|
| 61 |
#: ../../__w/calibre/calibre/manual/regexp.rst:21 |
| 62 |
msgid "" |
| 63 |
"There are a few places calibre uses regular expressions. There's the " |
| 64 |
":guilabel:`Search & replace` in conversion options, metadata detection from " |
| 65 |
"filenames in the import settings and Search & replace when editing the " |
| 66 |
"metadata of books in bulk. The calibre book editor can also use regular " |
| 67 |
"expressions in its :guilabel:`Search and replace` feature. Finally, you can " |
| 68 |
"use regular expressions when searching the calibre book list and when " |
| 69 |
"searching inside the calibre E-book viewer." |
| 70 |
msgstr "" |
| 71 |
|
| 72 |
#: ../../__w/calibre/calibre/manual/regexp.rst:30 |
| 73 |
msgid "What on earth *is* a regular expression?" |
| 74 |
msgstr "Apa *itu* ungkapan nalar atau regular expression?" |
| 75 |
|
| 76 |
#: ../../__w/calibre/calibre/manual/regexp.rst:32 |
| 77 |
msgid "" |
| 78 |
"A regular expression is a way to describe sets of strings. A single regular " |
| 79 |
"expression can *match* a number of different strings. This is what makes " |
| 80 |
"regular expression so powerful -- they are a concise way of describing a " |
| 81 |
"potentially large number of variations." |
| 82 |
msgstr "Ungkapan nalar ialah satu cara menjelaskan set-set rentetan. Ungkapan nalar boleh *padankan* sejumlah rentetan yang berbeza. Ia menjadikan ungkapan nalar sangat hebat -- ia merupakan cara teringkas dan padat untuk menjelaskan sejumlah besar variasi." |
| 83 |
|
| 84 |
#: ../../__w/calibre/calibre/manual/regexp.rst:34 |
| 85 |
msgid "" |
| 86 |
"I'm using string here in the sense it is used in programming languages: a " |
| 87 |
"string of one or more characters, characters including actual characters, " |
| 88 |
"numbers, punctuation and so-called whitespace (linebreaks, tabulators etc.)." |
| 89 |
" Please note that generally, uppercase and lowercase characters are not " |
| 90 |
"considered the same, thus \"a\" being a different character from \"A\" and " |
| 91 |
"so forth. In calibre, regular expressions are case insensitive in the Search" |
| 92 |
" bar, but not in the conversion options. There's a way to make every regular" |
| 93 |
" expression case insensitive, but we'll discuss that later. It gets " |
| 94 |
"complicated because regular expressions allow for variations in the strings " |
| 95 |
"it matches, so one expression can match multiple strings, which is why " |
| 96 |
"people bother using them at all. More on that in a bit." |
| 97 |
msgstr "Retetan yang digunakan di sini adalah berbentuk bahasa pengaturcaraan: satu rentetan yang mengandungi lebih daripada satu aksara termasuklah aksara, tanda baca dan juga ruang putih atau whitespace (hentian baris, tabulator dan lain-lain). Perhatian aksara huruf besar dan kecil juga tidak dianggap sama, maka \"a\" adalah berbeza dangan \"A\". Dalam calibre, ungkapan nalar adalah peka kata, yang mana akan dibincangkan kemudian. Ia menjadi lebih rumit kerana ungkapan nalar membenarkan variasi dalam rentetan yang disepadankan, jadi satu ungkapan boleh dipadankan dengan berbilang rentetan." |
| 98 |
|
| 99 |
#: ../../__w/calibre/calibre/manual/regexp.rst:37 |
| 100 |
msgid "Care to explain?" |
| 101 |
msgstr "Teruskan penjelasan?" |
| 102 |
|
| 103 |
#: ../../__w/calibre/calibre/manual/regexp.rst:39 |
| 104 |
msgid "" |
| 105 |
"Well, that's why we're here. First, this is the most important concept in " |
| 106 |
"regular expressions: *A string by itself is a regular expression that " |
| 107 |
"matches itself*. That is to say, if I wanted to match the string ``\"Hello, " |
| 108 |
"World!\"`` using a regular expression, the regular expression to use would " |
| 109 |
"be ``Hello, World!``. And yes, it really is that simple. You'll notice, " |
| 110 |
"though, that this *only* matches the exact string ``\"Hello, World!\"``, not" |
| 111 |
" e.g. ``\"Hello, wOrld!\"`` or ``\"hello, world!\"`` or any other such " |
| 112 |
"variation." |
| 113 |
msgstr "Konsep terpenting dalam ungkapan nalar: *rentetan A itu sendiri ialah ungkapan nalar yang disepadankan dengan dirinya sendiri*/ Jika mahu padankan dengan rentetan `\"Hello, World!\"`` menggunakan ungkapan nalar, ia menjadi ``Hello, World!``. Ya nampak mudah. Anda dapati ia *hanya* disepadankan dengan rentetan ``\"Hello, World!\"`` dengan tepat, bukannya ``\"Hello, wOrld!\"`` atau ``\"hello, world!\"`` atau lain-lain variasi sebegitu." |
| 114 |
|
| 115 |
#: ../../__w/calibre/calibre/manual/regexp.rst:42 |
| 116 |
msgid "That doesn't sound too bad. What's next?" |
| 117 |
msgstr "Ok nampak jelas, berikutnya?" |
| 118 |
|
| 119 |
#: ../../__w/calibre/calibre/manual/regexp.rst:44 |
| 120 |
msgid "" |
| 121 |
"Next is the beginning of the really good stuff. Remember where I said that " |
| 122 |
"regular expressions can match multiple strings? This is where it gets a " |
| 123 |
"little more complicated. Say, as a somewhat more practical exercise, the " |
| 124 |
"e-book you wanted to convert had a nasty footer counting the pages, like " |
| 125 |
"\"Page 5 of 423\". Obviously the page number would rise from 1 to 423, thus " |
| 126 |
"you'd have to match 423 different strings, right? Wrong, actually: regular " |
| 127 |
"expressions allow you to define sets of characters that are matched: To " |
| 128 |
"define a set, you put all the characters you want to be in the set into " |
| 129 |
"square brackets. So, for example, the set ``[abc]`` would match either the " |
| 130 |
"character \"a\", \"b\" or \"c\". *Sets will always only match one of the " |
| 131 |
"characters in the set*. They \"understand\" character ranges, that is, if " |
| 132 |
"you wanted to match all the lower case characters, you'd use the set " |
| 133 |
"``[a-z]`` for lower- and uppercase characters you'd use ``[a-zA-Z]`` and so " |
| 134 |
"on. Got the idea? So, obviously, using the expression ``Page [0-9] of 423`` " |
| 135 |
"you'd be able to match the first 9 pages, thus reducing the expressions " |
| 136 |
"needed to three: The second expression ``Page [0-9][0-9] of 423`` would " |
| 137 |
"match all two-digit page numbers, and I'm sure you can guess what the third " |
| 138 |
"expression would look like. Yes, go ahead. Write it down." |
| 139 |
msgstr "" |
| 140 |
|
| 141 |
#: ../../__w/calibre/calibre/manual/regexp.rst:47 |
| 142 |
msgid "Hey, neat! This is starting to make sense!" |
| 143 |
msgstr "" |
| 144 |
|
| 145 |
#: ../../__w/calibre/calibre/manual/regexp.rst:49 |
| 146 |
msgid "" |
| 147 |
"I was hoping you'd say that. But brace yourself, now it gets even better! We" |
| 148 |
" just saw that using sets, we could match one of several characters at once." |
| 149 |
" But you can even repeat a character or set, reducing the number of " |
| 150 |
"expressions needed to handle the above page number example to one. Yes, ONE!" |
| 151 |
" Excited? You should be! It works like this: Some so-called special " |
| 152 |
"characters, \"+\", \"?\" and \"*\", *repeat the single element preceding " |
| 153 |
"them*. (Element means either a single character, a character set, an escape " |
| 154 |
"sequence or a group (we'll learn about those last two later)- in short, any " |
| 155 |
"single entity in a regular expression). These characters are called " |
| 156 |
"wildcards or quantifiers. To be more precise, \"?\" matches *0 or 1* of the " |
| 157 |
"preceding element, \"*\" matches *0 or more* of the preceding element and " |
| 158 |
"\"+\" matches *1 or more* of the preceding element. A few examples: The " |
| 159 |
"expression ``a?`` would match either \"\" (which is the empty string, not " |
| 160 |
"strictly useful in this case) or \"a\", the expression ``a*`` would match " |
| 161 |
"\"\", \"a\", \"aa\" or any number of a's in a row, and, finally, the " |
| 162 |
"expression ``a+`` would match \"a\", \"aa\" or any number of a's in a row " |
| 163 |
"(Note: it wouldn't match the empty string!). Same deal for sets: The " |
| 164 |
"expression ``[0-9]+`` would match *every integer number there is*! I know " |
| 165 |
"what you're thinking, and you're right: If you use that in the above case of" |
| 166 |
" matching page numbers, wouldn't that be the single one expression to match " |
| 167 |
"all the page numbers? Yes, the expression ``Page [0-9]+ of 423`` would match" |
| 168 |
" every page number in that book!" |
| 169 |
msgstr "" |
| 170 |
|
| 171 |
#: ../../__w/calibre/calibre/manual/regexp.rst:52 |
| 172 |
msgid "" |
| 173 |
"A note on these quantifiers: They generally try to match as much text as " |
| 174 |
"possible, so be careful when using them. This is called \"greedy " |
| 175 |
"behaviour\"- I'm sure you get why. It gets problematic when you, say, try to" |
| 176 |
" match a tag. Consider, for example, the string ``\"<p " |
| 177 |
"class=\"calibre2\">Title here</p>\"`` and let's say you'd want to match the " |
| 178 |
"opening tag (the part between the first pair of angle brackets, a little " |
| 179 |
"more on tags later). You'd think that the expression ``<p.*>`` would match " |
| 180 |
"that tag, but actually, it matches the whole string! (The character \".\" is" |
| 181 |
" another special character. It matches anything *except* linebreaks, so, " |
| 182 |
"basically, the expression ``.*`` would match any single line you can think " |
| 183 |
"of). Instead, try using ``<p.*?>`` which makes the quantifier ``\"*\"`` non-" |
| 184 |
"greedy. That expression would only match the first opening tag, as intended." |
| 185 |
" There's actually another way to accomplish this: The expression " |
| 186 |
"``<p[^>]*>`` will match that same opening tag- you'll see why after the next" |
| 187 |
" section. Just note that there quite frequently is more than one way to " |
| 188 |
"write a regular expression." |
| 189 |
msgstr "" |
| 190 |
|
| 191 |
#: ../../__w/calibre/calibre/manual/regexp.rst:56 |
| 192 |
msgid "" |
| 193 |
"Well, these special characters are very neat and all, but what if I wanted " |
| 194 |
"to match a dot or a question mark?" |
| 195 |
msgstr "" |
| 196 |
|
| 197 |
#: ../../__w/calibre/calibre/manual/regexp.rst:58 |
| 198 |
msgid "" |
| 199 |
"You can of course do that: Just put a backslash in front of any special " |
| 200 |
"character and it is interpreted as the literal character, without any " |
| 201 |
"special meaning. This pair of a backslash followed by a single character is " |
| 202 |
"called an escape sequence, and the act of putting a backslash in front of a " |
| 203 |
"special character is called escaping that character. An escape sequence is " |
| 204 |
"interpreted as a single element. There are of course escape sequences that " |
| 205 |
"do more than just escaping special characters, for example ``\"\\t\"`` means" |
| 206 |
" a tabulator. We'll get to some of the escape sequences later. Oh, and by " |
| 207 |
"the way, concerning those special characters: Consider any character we " |
| 208 |
"discuss in this introduction as having some function to be special and thus " |
| 209 |
"needing to be escaped if you want the literal character." |
| 210 |
msgstr "" |
| 211 |
|
| 212 |
#: ../../__w/calibre/calibre/manual/regexp.rst:61 |
| 213 |
msgid "So, what are the most useful sets?" |
| 214 |
msgstr "" |
| 215 |
|
| 216 |
#: ../../__w/calibre/calibre/manual/regexp.rst:63 |
| 217 |
msgid "" |
| 218 |
"Knew you'd ask. Some useful sets are ``[0-9]`` matching a single number, " |
| 219 |
"``[a-z]`` matching a single lowercase letter, ``[A-Z]`` matching a single " |
| 220 |
"uppercase letter, ``[a-zA-Z]`` matching a single letter and ``[a-zA-Z0-9]`` " |
| 221 |
"matching a single letter or number. You can also use an escape sequence as " |
| 222 |
"shorthand:" |
| 223 |
msgstr "" |
| 224 |
|
| 225 |
#: ../../__w/calibre/calibre/manual/regexp.rst:66 |
| 226 |
msgid "``\\d``" |
| 227 |
msgstr "" |
| 228 |
|
| 229 |
#: ../../__w/calibre/calibre/manual/regexp.rst:66 |
| 230 |
msgid "is equivalent to ``[0-9]``" |
| 231 |
msgstr "" |
| 232 |
|
| 233 |
#: ../../__w/calibre/calibre/manual/regexp.rst:70 |
| 234 |
msgid "``\\w``" |
| 235 |
msgstr "" |
| 236 |
|
| 237 |
#: ../../__w/calibre/calibre/manual/regexp.rst:69 |
| 238 |
msgid "is equivalent to ``[a-zA-Z0-9_]``" |
| 239 |
msgstr "" |
| 240 |
|
| 241 |
#: ../../__w/calibre/calibre/manual/regexp.rst:73 |
| 242 |
msgid "``\\s``" |
| 243 |
msgstr "" |
| 244 |
|
| 245 |
#: ../../__w/calibre/calibre/manual/regexp.rst:73 |
| 246 |
msgid "is equivalent to any whitespace" |
| 247 |
msgstr "" |
| 248 |
|
| 249 |
#: ../../__w/calibre/calibre/manual/regexp.rst:76 |
| 250 |
msgid "" |
| 251 |
"\"Whitespace\" is a term for anything that won't be printed. These " |
| 252 |
"characters include space, tabulator, line feed, form feed, carriage return, " |
| 253 |
"non-breaking spaces, etc." |
| 254 |
msgstr "" |
| 255 |
|
| 256 |
#: ../../__w/calibre/calibre/manual/regexp.rst:78 |
| 257 |
msgid "" |
| 258 |
"As a last note on sets, you can also define a set as any character *but* " |
| 259 |
"those in the set. You do that by including the character ``\"^\"`` as the " |
| 260 |
"*very first character in the set*. Thus, ``[^a]`` would match any character " |
| 261 |
"excluding \"a\". That's called complementing the set. Those escape sequence " |
| 262 |
"shorthands we saw earlier can also be complemented: ``\"\\D\"`` means any " |
| 263 |
"non-number character, thus being equivalent to ``[^0-9]``. The other " |
| 264 |
"shorthands can be complemented by, you guessed it, using the respective " |
| 265 |
"uppercase letter instead of the lowercase one. So, going back to the example" |
| 266 |
" ``<p[^>]*>`` from the previous section, now you can see that the character " |
| 267 |
"set it's using tries to match any character except for a closing angle " |
| 268 |
"bracket." |
| 269 |
msgstr "" |
| 270 |
|
| 271 |
#: ../../__w/calibre/calibre/manual/regexp.rst:81 |
| 272 |
msgid "" |
| 273 |
"But if I had a few varying strings I wanted to match, things get " |
| 274 |
"complicated?" |
| 275 |
msgstr "" |
| 276 |
|
| 277 |
#: ../../__w/calibre/calibre/manual/regexp.rst:83 |
| 278 |
msgid "" |
| 279 |
"Fear not, life still is good and easy. Consider this example: The book " |
| 280 |
"you're converting has \"Title\" written on every odd page and \"Author\" " |
| 281 |
"written on every even page. Looks great in print, right? But in e-books, " |
| 282 |
"it's annoying. You can group whole expressions in normal parentheses, and " |
| 283 |
"the character ``\"|\"`` will let you match *either* the expression to its " |
| 284 |
"right *or* the one to its left. Combine those and you're done. Too fast for " |
| 285 |
"you? Okay, first off, we group the expressions for odd and even pages, thus " |
| 286 |
"getting ``(Title)(Author)`` as our two needed expressions. Now we make " |
| 287 |
"things simpler by using the vertical bar (``\"|\"`` is called the vertical " |
| 288 |
"bar character): If you use the expression ``(Title|Author)`` you'll either " |
| 289 |
"get a match for \"Title\" (on the odd pages) or you'd match \"Author\" (on " |
| 290 |
"the even pages). Well, wasn't that easy?" |
| 291 |
msgstr "" |
| 292 |
|
| 293 |
#: ../../__w/calibre/calibre/manual/regexp.rst:85 |
| 294 |
msgid "" |
| 295 |
"You can, of course, use the vertical bar without using grouping parentheses," |
| 296 |
" as well. Remember when I said that quantifiers repeat the element preceding" |
| 297 |
" them? Well, the vertical bar works a little differently: The expression " |
| 298 |
"\"Title|Author\" will also match either the string \"Title\" or the string " |
| 299 |
"\"Author\", just as the above example using grouping. *The vertical bar " |
| 300 |
"selects between the entire expression preceding and following it*. So, if " |
| 301 |
"you wanted to match the strings \"Calibre\" and \"calibre\" and wanted to " |
| 302 |
"select only between the upper- and lowercase \"c\", you'd have to use the " |
| 303 |
"expression ``(c|C)alibre``, where the grouping ensures that only the \"c\" " |
| 304 |
"will be selected. If you were to use ``c|Calibre``, you'd get a match on the" |
| 305 |
" string \"c\" or on the string \"Calibre\", which isn't what we wanted. In " |
| 306 |
"short: If in doubt, use grouping together with the vertical bar." |
| 307 |
msgstr "" |
| 308 |
|
| 309 |
#: ../../__w/calibre/calibre/manual/regexp.rst:88 |
| 310 |
msgid "You missed..." |
| 311 |
msgstr "" |
| 312 |
|
| 313 |
#: ../../__w/calibre/calibre/manual/regexp.rst:90 |
| 314 |
msgid "" |
| 315 |
"... wait just a minute, there's one last, really neat thing you can do with " |
| 316 |
"groups. If you have a group that you previously matched, you can use " |
| 317 |
"references to that group later in the expression: Groups are numbered " |
| 318 |
"starting with 1, and you reference them by escaping the number of the group " |
| 319 |
"you want to reference, thus, the fifth group would be referenced as ``\\5``." |
| 320 |
" So, if you searched for ``([^ ]+) \\1`` in the string \"Test Test\", you'd " |
| 321 |
"match the whole string!" |
| 322 |
msgstr "" |
| 323 |
|
| 324 |
#: ../../__w/calibre/calibre/manual/regexp.rst:94 |
| 325 |
msgid "" |
| 326 |
"In the beginning, you said there was a way to make a regular expression case" |
| 327 |
" insensitive?" |
| 328 |
msgstr "" |
| 329 |
|
| 330 |
#: ../../__w/calibre/calibre/manual/regexp.rst:96 |
| 331 |
msgid "" |
| 332 |
"Yes, I did, thanks for paying attention and reminding me. You can tell " |
| 333 |
"calibre how you want certain things handled by using something called flags." |
| 334 |
" You include flags in your expression by using the special construct " |
| 335 |
"``(?flags go here)`` where, obviously, you'd replace \"flags go here\" with " |
| 336 |
"the specific flags you want. For ignoring case, the flag is ``i``, thus you " |
| 337 |
"include ``(?i)`` in your expression. Thus, ``(?i)test`` would match " |
| 338 |
"\"Test\", \"tEst\", \"TEst\" and any case variation you could think of." |
| 339 |
msgstr "" |
| 340 |
|
| 341 |
#: ../../__w/calibre/calibre/manual/regexp.rst:98 |
| 342 |
msgid "" |
| 343 |
"Another useful flag lets the dot match any character at all, *including* the" |
| 344 |
" newline, the flag ``s``. If you want to use multiple flags in an " |
| 345 |
"expression, just put them in the same statement: ``(?is)`` would ignore case" |
| 346 |
" and make the dot match all. It doesn't matter which flag you state first, " |
| 347 |
"``(?si)`` would be equivalent to the above." |
| 348 |
msgstr "" |
| 349 |
|
| 350 |
#: ../../__w/calibre/calibre/manual/regexp.rst:101 |
| 351 |
msgid "" |
| 352 |
"I think I'm beginning to understand these regular expressions now... how do " |
| 353 |
"I use them in calibre?" |
| 354 |
msgstr "" |
| 355 |
|
| 356 |
#: ../../__w/calibre/calibre/manual/regexp.rst:104 |
| 357 |
msgid "Conversions" |
| 358 |
msgstr "" |
| 359 |
|
| 360 |
#: ../../__w/calibre/calibre/manual/regexp.rst:106 |
| 361 |
msgid "" |
| 362 |
"Let's begin with the conversion settings, which is really neat. In the " |
| 363 |
":guilabel:`Search & replace` part, you can input a regexp (short for regular" |
| 364 |
" expression) that describes the string that will be replaced during the " |
| 365 |
"conversion. The neat part is the wizard. Click on the wizard staff and you " |
| 366 |
"get a preview of what calibre \"sees\" during the conversion process. Scroll" |
| 367 |
" down to the string you want to remove, select and copy it, paste it into " |
| 368 |
"the regexp field on top of the window. If there are variable parts, like " |
| 369 |
"page numbers or so, use sets and quantifiers to cover those, and while " |
| 370 |
"you're at it, remember to escape special characters, if there are some. Hit " |
| 371 |
"the button labeled :guilabel:`Test` and calibre highlights the parts it " |
| 372 |
"would replace were you to use the regexp. Once you're satisfied, hit OK and " |
| 373 |
"convert. Be careful if your conversion source has tags like this example::" |
| 374 |
msgstr "" |
| 375 |
|
| 376 |
#: ../../__w/calibre/calibre/manual/regexp.rst:116 |
| 377 |
msgid "" |
| 378 |
"(shamelessly ripped out of `this thread " |
| 379 |
"<https://www.mobileread.com/forums/showthread.php?t=75594\">`_). You'd have " |
| 380 |
"to remove some of the tags as well. In this example, I'd recommend beginning" |
| 381 |
" with the tag ``<b class=\"calibre2\">``, now you have to end with the " |
| 382 |
"corresponding closing tag (opening tags are ``<tag>``, closing tags are " |
| 383 |
"``</tag>``), which is simply the next ``</b>`` in this case. (Refer to a " |
| 384 |
"good HTML manual or ask in the forum if you are unclear on this point). The " |
| 385 |
"opening tag can be described using ``<b.*?>``, the closing tag using " |
| 386 |
"``</b>``, thus we could remove everything between those tags using " |
| 387 |
"``<b.*?>.*?</b>``. But using this expression would be a bad idea, because it" |
| 388 |
" removes everything enclosed by <b>- tags (which, by the way, render the " |
| 389 |
"enclosed text in bold print), and it's a fair bet that we'll remove portions" |
| 390 |
" of the book in this way. Instead, include the beginning of the enclosed " |
| 391 |
"string as well, making the regular expression " |
| 392 |
"``<b.*?>\\s*Generated\\s+by\\s+ABC\\s+Amber\\s+LIT.*?</b>`` The ``\\s`` with" |
| 393 |
" quantifiers are included here instead of explicitly using the spaces as " |
| 394 |
"seen in the string to catch any variations of the string that might occur. " |
| 395 |
"Remember to check what calibre will remove to make sure you don't remove any" |
| 396 |
" portions you want to keep if you test a new expression. If you only check " |
| 397 |
"one occurrence, you might miss a mismatch somewhere else in the text. Also " |
| 398 |
"note that should you accidentally remove more or fewer tags than you " |
| 399 |
"actually wanted to, calibre tries to repair the damaged code after doing the" |
| 400 |
" removal." |
| 401 |
msgstr "" |
| 402 |
|
| 403 |
#: ../../__w/calibre/calibre/manual/regexp.rst:119 |
| 404 |
msgid "Adding books" |
| 405 |
msgstr "Menambah buku" |
| 406 |
|
| 407 |
#: ../../__w/calibre/calibre/manual/regexp.rst:121 |
| 408 |
msgid "" |
| 409 |
"Another thing you can use regular expressions for is to extract metadata " |
| 410 |
"from filenames. You can find this feature in the \"Adding books\" part of " |
| 411 |
"the settings. There's a special feature here: You can use field names for " |
| 412 |
"metadata fields, for example ``(?P<title>)`` would indicate that calibre " |
| 413 |
"uses this part of the string as book title. The allowed field names are " |
| 414 |
"listed in the windows, together with another nice test field. An example: " |
| 415 |
"Say you want to import a whole bunch of files named like ``Classical Texts: " |
| 416 |
"The Divine Comedy by Dante Alighieri.mobi``. (Obviously, this is already in " |
| 417 |
"your library, since we all love classical italian poetry) or ``Science " |
| 418 |
"Fiction epics: The Foundation Trilogy by Isaac Asimov.epub``. This is " |
| 419 |
"obviously a naming scheme that calibre won't extract any meaningful data out" |
| 420 |
" of - its standard expression for extracting metadata is ``(?P<title>.+) - " |
| 421 |
"(?P<author>[^_]+)``. A regular expression that works here would be " |
| 422 |
"``[a-zA-Z]+: (?P<title>.+) by (?P<author>.+)``. Please note that, inside the" |
| 423 |
" group for the metadata field, you need to use expressions to describe what " |
| 424 |
"the field actually matches. And also note that, when using the test field " |
| 425 |
"calibre provides, you need to add the file extension to your testing " |
| 426 |
"filename, otherwise you won't get any matches at all, despite using a " |
| 427 |
"working expression." |
| 428 |
msgstr "" |
| 429 |
|
| 430 |
#: ../../__w/calibre/calibre/manual/regexp.rst:125 |
| 431 |
msgid "Bulk editing metadata" |
| 432 |
msgstr "" |
| 433 |
|
| 434 |
#: ../../__w/calibre/calibre/manual/regexp.rst:127 |
| 435 |
msgid "" |
| 436 |
"The last part is regular expression :guilabel:`Search and replace` in " |
| 437 |
"metadata fields. You can access this by selecting multiple books in the " |
| 438 |
"library and using bulk metadata edit. Be very careful when using this last " |
| 439 |
"feature, as it can do **Very Bad Things** to your library! Doublecheck that " |
| 440 |
"your expressions do what you want them to using the test fields, and only " |
| 441 |
"mark the books you really want to change! In the regular expression search " |
| 442 |
"mode, you can search in one field, replace the text with something and even " |
| 443 |
"write the result into another field. A practical example: Say your library " |
| 444 |
"contained the books of Frank Herbert's Dune series, named after the fashion " |
| 445 |
"``Dune 1 - Dune``, ``Dune 2 - Dune Messiah`` and so on. Now you want to get " |
| 446 |
"``Dune`` into the series field. You can do that by searching for ``(.*?) " |
| 447 |
"\\d+ - .*`` in the title field and replacing it with ``\\1`` in the series " |
| 448 |
"field. See what I did there? That's a reference to the first group you're " |
| 449 |
"replacing the series field with. Now that you have the series all set, you " |
| 450 |
"only need to do another search for ``.*? -`` in the title field and replace " |
| 451 |
"it with ``\"\"`` (an empty string), again in the title field, and your " |
| 452 |
"metadata is all neat and tidy. Isn't that great? By the way, instead of " |
| 453 |
"replacing the entire field, you can also append or prepend to the field, so," |
| 454 |
" if you *wanted* the book title to be prepended with series info, you could " |
| 455 |
"do that as well. As you by now have undoubtedly noticed, there's a checkbox " |
| 456 |
"labeled :guilabel:`Case sensitive`, so you won't have to use flags to select" |
| 457 |
" behaviour here." |
| 458 |
msgstr "" |
| 459 |
|
| 460 |
#: ../../__w/calibre/calibre/manual/regexp.rst:129 |
| 461 |
msgid "" |
| 462 |
"Well, that just about concludes the very short introduction to regular " |
| 463 |
"expressions. Hopefully I'll have shown you enough to at least get you " |
| 464 |
"started and to enable you to continue learning by yourself- a good starting " |
| 465 |
"point would be the `Python documentation for regexps " |
| 466 |
"<https://docs.python.org/library/re.html>`_." |
| 467 |
msgstr "" |
| 468 |
|
| 469 |
#: ../../__w/calibre/calibre/manual/regexp.rst:131 |
| 470 |
msgid "" |
| 471 |
"One last word of warning, though: Regexps are powerful, but also really easy" |
| 472 |
" to get wrong. calibre provides really great testing possibilities to see if" |
| 473 |
" your expressions behave as you expect them to. Use them. Try not to shoot " |
| 474 |
"yourself in the foot. (God, I love that expression...). But should you, " |
| 475 |
"despite the warning, injure your foot (or any other body parts), try to " |
| 476 |
"learn from it." |
| 477 |
msgstr "" |
| 478 |
|
| 479 |
#: ../../__w/calibre/calibre/manual/regexp.rst:135 |
| 480 |
msgid "Quick reference" |
| 481 |
msgstr "Rujukan pantas" |
| 482 |
|
| 483 |
#: ../../__w/calibre/calibre/manual/regexp.rst:143 |
| 484 |
msgid "Credits" |
| 485 |
msgstr "Penghargaan" |
| 486 |
|
| 487 |
#: ../../__w/calibre/calibre/manual/regexp.rst:145 |
| 488 |
msgid "Thanks for helping with tips, corrections and such:" |
| 489 |
msgstr "Terima kasih atas bantuan petua, pembetulan dan juga:" |
| 490 |
|
| 491 |
#: ../../__w/calibre/calibre/manual/regexp.rst:147 |
| 492 |
msgid "ldolse" |
| 493 |
msgstr "ldolse" |
| 494 |
|
| 495 |
#: ../../__w/calibre/calibre/manual/regexp.rst:148 |
| 496 |
msgid "kovidgoyal" |
| 497 |
msgstr "kovidgoyal" |
| 498 |
|
| 499 |
#: ../../__w/calibre/calibre/manual/regexp.rst:149 |
| 500 |
msgid "chaley" |
| 501 |
msgstr "chaley" |
| 502 |
|
| 503 |
#: ../../__w/calibre/calibre/manual/regexp.rst:150 |
| 504 |
msgid "dwanthny" |
| 505 |
msgstr "dwanthny" |
| 506 |
|
| 507 |
#: ../../__w/calibre/calibre/manual/regexp.rst:151 |
| 508 |
msgid "kacir" |
| 509 |
msgstr "kacir" |
| 510 |
|
| 511 |
#: ../../__w/calibre/calibre/manual/regexp.rst:152 |
| 512 |
msgid "Starson17" |
| 513 |
msgstr "Starson17" |
| 514 |
|
| 515 |
#: ../../__w/calibre/calibre/manual/regexp.rst:153 |
| 516 |
msgid "Orpheu" |
| 517 |
msgstr "Orpheu" |
| 518 |
|
| 519 |
#: ../../__w/calibre/calibre/manual/regexp.rst:155 |
| 520 |
msgid "" |
| 521 |
"For more about regexps see `The Python User Manual " |
| 522 |
"<https://docs.python.org/library/re.html>`_. The actual regular expression " |
| 523 |
"library used by calibre is: `regex <https://bitbucket.org/mrabarnett/mrab-" |
| 524 |
"regex/src/hg/>`_ which supports several useful enhancements over the Python " |
| 525 |
"standard library one." |
| 526 |
msgstr "" |