├── .github └── workflows │ └── release.yml ├── .gitignore ├── LICENSE ├── README.md ├── build.zig ├── build.zig.zon ├── res ├── a_midsummer_nights_dream.txt ├── nice.shakespeare.txt └── test.txt └── src ├── decode.zig ├── encode.zig ├── main.zig ├── progress_bar.zig ├── queue.zig ├── test.zig └── utils.zig /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | on: 3 | push: 4 | branches: 5 | - main 6 | 7 | jobs: 8 | # lint: 9 | # runs-on: ubuntu-latest 10 | # steps: 11 | # - uses: actions/checkout@v3 12 | # - uses: goto-bus-stop/setup-zig@v2 13 | # with: 14 | # version: master 15 | # - run: zig fmt --check src build.zig 16 | 17 | test: 18 | strategy: 19 | matrix: 20 | # os: [ubuntu-latest, macos-latest, windows-latest] 21 | os: [ubuntu-latest] 22 | runs-on: ${{ matrix.os }} 23 | steps: 24 | - uses: actions/checkout@v3 25 | with: 26 | submodules: recursive 27 | - uses: goto-bus-stop/setup-zig@v2 28 | with: 29 | version: master 30 | - run: zig build test 31 | 32 | build: 33 | strategy: 34 | matrix: 35 | include: 36 | - name: linux-x86_64 37 | target: x86_64-linux 38 | optimize: optimize=ReleaseFast 39 | 40 | - name: windows-x86_64 41 | target: x86_64-windows 42 | optimize: optimize=ReleaseFast 43 | 44 | - name: macos-aarch64 45 | target: aarch64-macos 46 | optimize: optimize=ReleaseFast 47 | 48 | - name: macos-x86 49 | target: x86_64-macos 50 | optimize: optimize=ReleaseFast 51 | runs-on: ubuntu-latest 52 | steps: 53 | - uses: actions/checkout@v3 54 | with: 55 | submodules: recursive 56 | - uses: goto-bus-stop/setup-zig@v2 57 | with: 58 | version: master 59 | 60 | - name: zig build -D${{ matrix.optimize }} -Dtarget=${{ matrix.target }} 61 | run: | 62 | zig build -D${{ matrix.optimize }} -Dtarget=${{ matrix.target }} 63 | 64 | - uses: actions/upload-artifact@v3 65 | with: 66 | name: entreepy #-${{ matrix.name }} 67 | path: zig-out/bin/* #entreepy-${{ matrix.name }} 68 | retention-days: 1 69 | 70 | create-release: 71 | needs: [test, build] 72 | runs-on: ubuntu-latest 73 | steps: 74 | - uses: actions/checkout@v3 75 | - uses: actions/download-artifact@v3 76 | - name: Creating release 77 | env: 78 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 79 | run: | 80 | gh release create v1.1.0 -t "1.1.0" entreepy/entreepy* 81 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | zig-cache/ 2 | zig-out/ 3 | /release/ 4 | /debug/ 5 | /build/ 6 | /build-*/ 7 | /docgen_tmp/ 8 | 9 | res/* 10 | !res/test.txt 11 | !res/nice.shakespeare.txt 12 | !res/a_midsummer_nights_dream.txt 13 | 14 | decoded_* 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | entreepy
2 | [![Actions Status](https://github.com/typio/entreepy/workflows/release/badge.svg)](https://github.com/typio/entreepy/actions) 3 | ==== 4 | 5 | > Text compression tool :zap: 6 | 7 | The name is entropy coding + binary trees. 8 | 9 | ### Usage 10 | 11 | ![output](https://github.com/typio/entreepy/assets/26017543/75444090-547e-4c5b-a139-73918f22c789) 12 | 13 | ``` 14 | Entreepy - Text compression tool 15 | 16 | Usage: entreepy [options] [command] [file] [command options] 17 | 18 | Options: 19 | -h, --help show help 20 | -p, --print print decompressed text to stdout 21 | -t, --test test/dry run, does not write to file 22 | -d, --debug print huffman code dictionary and performance times to stdout 23 | 24 | Commands: 25 | c compress a file 26 | d decompress a file 27 | 28 | Command Options: 29 | -o, --output output file (default: [file].et or decoded_[file]) 30 | 31 | Examples: 32 | entreepy -d c text.txt -o text.txt.et 33 | entreepy -ptd d text.txt.et -o decoded_text.txt 34 | ``` 35 | 36 | Input file must be < 1 terabyte. Be sure to use the same version of the program to decompress as compress. 37 | 38 | ### Performance 39 | 40 | 41 | 42 | I use a decode map which is keyed by the integer value of the code and stores a subarray of letters with matching code integer value - that is, the letters that correspond to codes with the same integer value - indexed by length minus one. For example, the map might include the following entries: 43 | 44 | `{ 2: [_, a (10), e (010), ...], 13: [_, _, _, _, z (01101), ...] }.` 45 | 46 | By utilizing this decode map, decoding can be performed much more quickly than by traversing a binary tree. 47 | 48 | #### Performance on MacBook Air M2, 8 GB RAM - v1.0.0 49 | | File | Original File Size | Compressed Size | Compression Time | Decompression Time | 50 | | ---- | :----------------: | :-------------: | :--------------: | :----------------: | 51 | | [Macbeth, Act V, Scene V](https://github.com/typio/entreepy/blob/main/res/nice.shakespeare.txt) | 477 bytes | 374 bytes | 600μs | 3.2ms | 52 | | [A Midsummer Night's Dream](https://github.com/typio/entreepy/blob/main/res/a_midsummer_nights_dream.txt) | ~ 112 KB | ~ 68 KB | 6.7ms | 262ms | 53 | | [The Complete Works of Shakespeare](https://ocw.mit.edu/ans7870/6/6.006/s08/lecturenotes/files/t8.shakespeare.txt) | ~ 5.2 MB | ~ 3.0 MB | 111ms | 11.8s | 54 | 55 | Next I'll add block based parallel decoding. After that I'm interested in exploring additional compression techniques; to support non-text file formats. 56 | 57 | ### Compressed File Format 58 | 59 | Uses the `.et` file format, identified by the magic number `e7 c0 de`. 60 | 61 | ```bf 62 | | magic number -> 3 bytes | 63 | | file format version -> 1 byte | 64 | | length of dictionary - 1 -> 1 byte | 65 | | length of body -> 4 bytes | 66 | 67 | for n symbols 68 | | symbol -> 1 byte | 69 | | symbol code length -> 1 byte | 70 | | symbol code -> m bits | 71 | 72 | | packed big-endian bitstream of codes | starting on new byte 73 | ``` 74 | -------------------------------------------------------------------------------- /build.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | pub fn build(b: *std.Build) void { 4 | const optimize = b.standardOptimizeOption(.{}); 5 | const target = b.standardTargetOptions(.{}); 6 | 7 | var gpa = std.heap.GeneralPurposeAllocator(.{ .enable_memory_limit = true, .safety = true }){}; 8 | defer _ = gpa.deinit(); 9 | const allocator = gpa.allocator(); 10 | 11 | const os = @tagName(target.result.os.tag); 12 | const arch = @tagName(target.result.cpu.arch); 13 | 14 | const name = std.fmt.allocPrint(allocator, "entreepy-{s}-{s}", .{ os, arch }) catch "e"; 15 | defer allocator.free(name); 16 | 17 | const exe = b.addExecutable(.{ 18 | .name = name, 19 | 20 | .root_source_file = .{ .path = "src/main.zig" }, 21 | .target = target, 22 | .optimize = optimize, 23 | }); 24 | 25 | b.installArtifact(exe); 26 | 27 | const run_cmd = b.addRunArtifact(exe); 28 | 29 | run_cmd.step.dependOn(b.getInstallStep()); 30 | 31 | if (b.args) |args| { 32 | run_cmd.addArgs(args); 33 | } 34 | 35 | const run_step = b.step("run", "Run the app"); 36 | run_step.dependOn(&run_cmd.step); 37 | 38 | const unit_tests = b.addTest(.{ 39 | .root_source_file = .{ .path = "src/test.zig" }, 40 | .target = target, 41 | .optimize = optimize, 42 | }); 43 | 44 | const run_unit_tests = b.addRunArtifact(unit_tests); 45 | 46 | const test_step = b.step("test", "Run unit tests"); 47 | test_step.dependOn(&run_unit_tests.step); 48 | } 49 | -------------------------------------------------------------------------------- /build.zig.zon: -------------------------------------------------------------------------------- 1 | .{ 2 | .name = "entreepy", 3 | 4 | .version = "1.1.0", 5 | 6 | .dependencies = .{}, 7 | 8 | .minimum_zig_version = "0.12.0", 9 | 10 | .paths = .{""}, 11 | } 12 | -------------------------------------------------------------------------------- /res/a_midsummer_nights_dream.txt: -------------------------------------------------------------------------------- 1 | ***The Project Gutenberg's Etext of Shakespeare's First Folio*** 2 | *******************A Midsommer Nights Dreame******************** 3 | 4 | 5 | ******************************************************************* 6 | THIS EBOOK WAS ONE OF PROJECT GUTENBERG'S EARLY FILES PRODUCED AT A 7 | TIME WHEN PROOFING METHODS AND TOOLS WERE NOT WELL DEVELOPED. THERE 8 | IS AN IMPROVED EDITION OF THIS TITLE WHICH MAY BE VIEWED AS EBOOK 9 | (#1514) at https://www.gutenberg.org/ebooks/1514 10 | ******************************************************************* 11 | 12 | 13 | This is our 3rd edition of most of these plays. See the index. 14 | 15 | 16 | Copyright laws are changing all over the world, be sure to check 17 | the copyright laws for your country before posting these files!! 18 | 19 | Please take a look at the important information in this header. 20 | We encourage you to keep this file on your own disk, keeping an 21 | electronic path open for the next readers. Do not remove this. 22 | 23 | 24 | **Welcome To The World of Free Plain Vanilla Electronic Texts** 25 | 26 | **Etexts Readable By Both Humans and By Computers, Since 1971** 27 | 28 | *These Etexts Prepared By Hundreds of Volunteers and Donations* 29 | 30 | Information on contacting Project Gutenberg to get Etexts, and 31 | further information is included below. We need your donations. 32 | 33 | 34 | A Midsommer Nights Dreame 35 | 36 | by William Shakespeare 37 | 38 | July, 2000 [Etext #2242] 39 | 40 | 41 | ***The Project Gutenberg's Etext of Shakespeare's First Folio*** 42 | ********************A Midsommer Nights Dreame******************* 43 | 44 | *****This file should be named 2242.txt or 2242.zip****** 45 | 46 | Project Gutenberg Etexts are usually created from multiple editions, 47 | all of which are in the Public Domain in the United States, unless a 48 | copyright notice is included. Therefore, we usually do NOT keep any 49 | of these books in compliance with any particular paper edition. 50 | 51 | 52 | We are now trying to release all our books one month in advance 53 | of the official release dates, leaving time for better editing. 54 | 55 | Please note: neither this list nor its contents are final till 56 | midnight of the last day of the month of any such announcement. 57 | The official release date of all Project Gutenberg Etexts is at 58 | Midnight, Central Time, of the last day of the stated month. A 59 | preliminary version may often be posted for suggestion, comment 60 | and editing by those who wish to do so. To be sure you have an 61 | up to date first edition [xxxxx10x.xxx] please check file sizes 62 | in the first week of the next month. Since our ftp program has 63 | a bug in it that scrambles the date [tried to fix and failed] a 64 | look at the file size will have to do, but we will try to see a 65 | new copy has at least one byte more or less. 66 | 67 | 68 | Information about Project Gutenberg (one page) 69 | 70 | We produce about two million dollars for each hour we work. The 71 | time it takes us, a rather conservative estimate, is fifty hours 72 | to get any etext selected, entered, proofread, edited, copyright 73 | searched and analyzed, the copyright letters written, etc. This 74 | projected audience is one hundred million readers. If our value 75 | per text is nominally estimated at one dollar then we produce $2 76 | million dollars per hour this year as we release thirty-six text 77 | files per month, or 432 more Etexts in 1999 for a total of 2000+ 78 | If these reach just 10% of the computerized population, then the 79 | total should reach over 200 billion Etexts given away this year. 80 | 81 | The Goal of Project Gutenberg is to Give Away One Trillion Etext 82 | Files by December 31, 2001. [10,000 x 100,000,000 = 1 Trillion] 83 | This is ten thousand titles each to one hundred million readers, 84 | which is only ~5% of the present number of computer users. 85 | 86 | At our revised rates of production, we will reach only one-third 87 | of that goal by the end of 2001, or about 3,333 Etexts unless we 88 | manage to get some real funding; currently our funding is mostly 89 | from Michael Hart's salary at Carnegie-Mellon University, and an 90 | assortment of sporadic gifts; this salary is only good for a few 91 | more years, so we are looking for something to replace it, as we 92 | don't want Project Gutenberg to be so dependent on one person. 93 | 94 | We need your donations more than ever! 95 | 96 | 97 | All donations should be made to "Project Gutenberg/CMU": and are 98 | tax deductible to the extent allowable by law. (CMU = Carnegie- 99 | Mellon University). 100 | 101 | For these and other matters, please mail to: 102 | 103 | Project Gutenberg 104 | P. O. Box 2782 105 | Champaign, IL 61825 106 | 107 | When all other email fails. . .try our Executive Director: 108 | Michael S. Hart 109 | hart@pobox.com forwards to hart@prairienet.org and archive.org 110 | if your mail bounces from archive.org, I will still see it, if 111 | it bounces from prairienet.org, better resend later on. . . . 112 | 113 | We would prefer to send you this information by email. 114 | 115 | ****** 116 | 117 | To access Project Gutenberg etexts, use any Web browser 118 | to view http://promo.net/pg. This site lists Etexts by 119 | author and by title, and includes information about how 120 | to get involved with Project Gutenberg. You could also 121 | download our past Newsletters, or subscribe here. This 122 | is one of our major sites, please email hart@pobox.com, 123 | for a more complete list of our various sites. 124 | 125 | To go directly to the etext collections, use FTP or any 126 | Web browser to visit a Project Gutenberg mirror (mirror 127 | sites are available on 7 continents; mirrors are listed 128 | at http://promo.net/pg). 129 | 130 | Mac users, do NOT point and click, typing works better. 131 | 132 | Example FTP session: 133 | 134 | ftp sunsite.unc.edu 135 | login: anonymous 136 | password: your@login 137 | cd pub/docs/books/gutenberg 138 | cd etext90 through etext99 139 | dir [to see files] 140 | get or mget [to get files. . .set bin for zip files] 141 | GET GUTINDEX.?? [to get a year's listing of books, e.g., GUTINDEX.99] 142 | GET GUTINDEX.ALL [to get a listing of ALL books] 143 | 144 | *** 145 | 146 | **Information prepared by the Project Gutenberg legal advisor** 147 | 148 | (Three Pages) 149 | 150 | 151 | ***START**THE SMALL PRINT!**FOR PUBLIC DOMAIN ETEXTS**START*** 152 | Why is this "Small Print!" statement here? You know: lawyers. 153 | They tell us you might sue us if there is something wrong with 154 | your copy of this etext, even if you got it for free from 155 | someone other than us, and even if what's wrong is not our 156 | fault. So, among other things, this "Small Print!" statement 157 | disclaims most of our liability to you. It also tells you how 158 | you can distribute copies of this etext if you want to. 159 | 160 | *BEFORE!* YOU USE OR READ THIS ETEXT 161 | By using or reading any part of this PROJECT GUTENBERG-tm 162 | etext, you indicate that you understand, agree to and accept 163 | this "Small Print!" statement. If you do not, you can receive 164 | a refund of the money (if any) you paid for this etext by 165 | sending a request within 30 days of receiving it to the person 166 | you got it from. If you received this etext on a physical 167 | medium (such as a disk), you must return it with your request. 168 | 169 | ABOUT PROJECT GUTENBERG-TM ETEXTS 170 | This PROJECT GUTENBERG-tm etext, like most PROJECT GUTENBERG- 171 | tm etexts, is a "public domain" work distributed by Professor 172 | Michael S. Hart through the Project Gutenberg Association at 173 | Carnegie-Mellon University (the "Project"). Among other 174 | things, this means that no one owns a United States copyright 175 | on or for this work, so the Project (and you!) can copy and 176 | distribute it in the United States without permission and 177 | without paying copyright royalties. Special rules, set forth 178 | below, apply if you wish to copy and distribute this etext 179 | under the Project's "PROJECT GUTENBERG" trademark. 180 | 181 | To create these etexts, the Project expends considerable 182 | efforts to identify, transcribe and proofread public domain 183 | works. Despite these efforts, the Project's etexts and any 184 | medium they may be on may contain "Defects". Among other 185 | things, Defects may take the form of incomplete, inaccurate or 186 | corrupt data, transcription errors, a copyright or other 187 | intellectual property infringement, a defective or damaged 188 | disk or other etext medium, a computer virus, or computer 189 | codes that damage or cannot be read by your equipment. 190 | 191 | LIMITED WARRANTY; DISCLAIMER OF DAMAGES 192 | But for the "Right of Replacement or Refund" described below, 193 | [1] the Project (and any other party you may receive this 194 | etext from as a PROJECT GUTENBERG-tm etext) disclaims all 195 | liability to you for damages, costs and expenses, including 196 | legal fees, and [2] YOU HAVE NO REMEDIES FOR NEGLIGENCE OR 197 | UNDER STRICT LIABILITY, OR FOR BREACH OF WARRANTY OR CONTRACT, 198 | INCLUDING BUT NOT LIMITED TO INDIRECT, CONSEQUENTIAL, PUNITIVE 199 | OR INCIDENTAL DAMAGES, EVEN IF YOU GIVE NOTICE OF THE 200 | POSSIBILITY OF SUCH DAMAGES. 201 | 202 | If you discover a Defect in this etext within 90 days of 203 | receiving it, you can receive a refund of the money (if any) 204 | you paid for it by sending an explanatory note within that 205 | time to the person you received it from. If you received it 206 | on a physical medium, you must return it with your note, and 207 | such person may choose to alternatively give you a replacement 208 | copy. If you received it electronically, such person may 209 | choose to alternatively give you a second opportunity to 210 | receive it electronically. 211 | 212 | THIS ETEXT IS OTHERWISE PROVIDED TO YOU "AS-IS". NO OTHER 213 | WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, ARE MADE TO YOU AS 214 | TO THE ETEXT OR ANY MEDIUM IT MAY BE ON, INCLUDING BUT NOT 215 | LIMITED TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A 216 | PARTICULAR PURPOSE. 217 | 218 | Some states do not allow disclaimers of implied warranties or 219 | the exclusion or limitation of consequential damages, so the 220 | above disclaimers and exclusions may not apply to you, and you 221 | may have other legal rights. 222 | 223 | INDEMNITY 224 | You will indemnify and hold the Project, its directors, 225 | officers, members and agents harmless from all liability, cost 226 | and expense, including legal fees, that arise directly or 227 | indirectly from any of the following that you do or cause: 228 | [1] distribution of this etext, [2] alteration, modification, 229 | or addition to the etext, or [3] any Defect. 230 | 231 | DISTRIBUTION UNDER "PROJECT GUTENBERG-tm" 232 | You may distribute copies of this etext electronically, or by 233 | disk, book or any other medium if you either delete this 234 | "Small Print!" and all other references to Project Gutenberg, 235 | or: 236 | 237 | [1] Only give exact copies of it. Among other things, this 238 | requires that you do not remove, alter or modify the 239 | etext or this "small print!" statement. You may however, 240 | if you wish, distribute this etext in machine readable 241 | binary, compressed, mark-up, or proprietary form, 242 | including any form resulting from conversion by word pro- 243 | cessing or hypertext software, but only so long as 244 | *EITHER*: 245 | 246 | [*] The etext, when displayed, is clearly readable, and 247 | does *not* contain characters other than those 248 | intended by the author of the work, although tilde 249 | (~), asterisk (*) and underline (_) characters may 250 | be used to convey punctuation intended by the 251 | author, and additional characters may be used to 252 | indicate hypertext links; OR 253 | 254 | [*] The etext may be readily converted by the reader at 255 | no expense into plain ASCII, EBCDIC or equivalent 256 | form by the program that displays the etext (as is 257 | the case, for instance, with most word processors); 258 | OR 259 | 260 | [*] You provide, or agree to also provide on request at 261 | no additional cost, fee or expense, a copy of the 262 | etext in its original plain ASCII form (or in EBCDIC 263 | or other equivalent proprietary form). 264 | 265 | [2] Honor the etext refund and replacement provisions of this 266 | "Small Print!" statement. 267 | 268 | [3] Pay a trademark license fee to the Project of 20% of the 269 | net profits you derive calculated using the method you 270 | already use to calculate your applicable taxes. If you 271 | don't derive profits, no royalty is due. Royalties are 272 | payable to "Project Gutenberg Association/Carnegie-Mellon 273 | University" within the 60 days following each 274 | date you prepare (or were legally required to prepare) 275 | your annual (or equivalent periodic) tax return. 276 | 277 | WHAT IF YOU *WANT* TO SEND MONEY EVEN IF YOU DON'T HAVE TO? 278 | The Project gratefully accepts contributions in money, time, 279 | scanning machines, OCR software, public domain etexts, royalty 280 | free copyright licenses, and every other sort of contribution 281 | you can think of. Money should be paid to "Project Gutenberg 282 | Association / Carnegie-Mellon University". 283 | 284 | *END*THE SMALL PRINT! FOR PUBLIC DOMAIN ETEXTS*Ver.04.29.93*END* 285 | 286 | 287 | 288 | 289 | 290 | Project Gutenberg's Etext of Shakespeare's The first Part of 291 | Henry the Sixt 292 | 293 | 294 | 295 | 296 | Executive Director's Notes: 297 | 298 | In addition to the notes below, and so you will *NOT* think all 299 | the spelling errors introduced by the printers of the time have 300 | been corrected, here are the first few lines of Hamlet, as they 301 | are presented herein: 302 | 303 | Barnardo. Who's there? 304 | Fran. Nay answer me: Stand & vnfold 305 | your selfe 306 | 307 | Bar. Long liue the King 308 | 309 | *** 310 | 311 | As I understand it, the printers often ran out of certain words 312 | or letters they had often packed into a "cliche". . .this is the 313 | original meaning of the term cliche. . .and thus, being unwilling 314 | to unpack the cliches, and thus you will see some substitutions 315 | that look very odd. . .such as the exchanges of u for v, v for u, 316 | above. . .and you may wonder why they did it this way, presuming 317 | Shakespeare did not actually write the play in this manner. . . . 318 | 319 | The answer is that they MAY have packed "liue" into a cliche at a 320 | time when they were out of "v"'s. . .possibly having used "vv" in 321 | place of some "w"'s, etc. This was a common practice of the day, 322 | as print was still quite expensive, and they didn't want to spend 323 | more on a wider selection of characters than they had to. 324 | 325 | You will find a lot of these kinds of "errors" in this text, as I 326 | have mentioned in other times and places, many "scholars" have an 327 | extreme attachment to these errors, and many have accorded them a 328 | very high place in the "canon" of Shakespeare. My father read an 329 | assortment of these made available to him by Cambridge University 330 | in England for several months in a glass room constructed for the 331 | purpose. To the best of my knowledge he read ALL those available 332 | . . .in great detail. . .and determined from the various changes, 333 | that Shakespeare most likely did not write in nearly as many of a 334 | variety of errors we credit him for, even though he was in/famous 335 | for signing his name with several different spellings. 336 | 337 | So, please take this into account when reading the comments below 338 | made by our volunteer who prepared this file: you may see errors 339 | that are "not" errors. . . . 340 | 341 | So. . .with this caveat. . .we have NOT changed the canon errors, 342 | here is the Project Gutenberg Etext of Shakespeare's The first 343 | Part of Henry the Sixt. 344 | 345 | Michael S. Hart 346 | Project Gutenberg 347 | Executive Director 348 | 349 | 350 | *** 351 | 352 | 353 | Scanner's Notes: What this is and isn't. This was taken from 354 | a copy of Shakespeare's first folio and it is as close as I can 355 | come in ASCII to the printed text. 356 | 357 | The elongated S's have been changed to small s's and the 358 | conjoined ae have been changed to ae. I have left the spelling, 359 | punctuation, capitalization as close as possible to the 360 | printed text. I have corrected some spelling mistakes (I have put 361 | together a spelling dictionary devised from the spellings of the 362 | Geneva Bible and Shakespeare's First Folio and have unified 363 | spellings according to this template), typo's and expanded 364 | abbreviations as I have come across them. Everything within 365 | brackets [] is what I have added. So if you don't like that 366 | you can delete everything within the brackets if you want a 367 | purer Shakespeare. 368 | 369 | Another thing that you should be aware of is that there are textual 370 | differences between various copies of the first folio. So there may 371 | be differences (other than what I have mentioned above) between 372 | this and other first folio editions. This is due to the printer's 373 | habit of setting the type and running off a number of copies and 374 | then proofing the printed copy and correcting the type and then 375 | continuing the printing run. The proof run wasn't thrown away but 376 | incorporated into the printed copies. This is just the way it is. 377 | The text I have used was a composite of more than 30 different 378 | First Folio editions' best pages. 379 | 380 | If you find any scanning errors, out and out typos, punctuation 381 | errors, or if you disagree with my spelling choices please feel 382 | free to email me those errors. I wish to make this the best 383 | etext possible. My email address for right now are haradda@aol.com 384 | and davidr@inconnect.com. I hope that you enjoy this. 385 | 386 | David Reed 387 | 388 | A Midsommer Nights Dreame 389 | 390 | Actus primus. 391 | 392 | Enter Theseus, Hippolita, with others. 393 | 394 | Theseus. Now faire Hippolita, our nuptiall houre 395 | Drawes on apace: foure happy daies bring in 396 | Another Moon: but oh, me thinkes, how slow 397 | This old Moon wanes; She lingers my desires 398 | Like to a Step-dame, or a Dowager, 399 | Long withering out a yong mans reuennew 400 | 401 | Hip. Foure daies wil quickly steep the[m]selues in nights 402 | Foure nights wil quickly dreame away the time: 403 | And then the Moone, like to a siluer bow, 404 | Now bent in heauen, shal behold the night 405 | Of our solemnities 406 | 407 | The. Go Philostrate, 408 | Stirre vp the Athenian youth to merriments, 409 | Awake the pert and nimble spirit of mirth, 410 | Turne melancholy forth to Funerals: 411 | The pale companion is not for our pompe, 412 | Hippolita, I woo'd thee with my sword, 413 | And wonne thy loue, doing thee iniuries: 414 | But I will wed thee in another key, 415 | With pompe, with triumph, and with reuelling. 416 | Enter Egeus and his daughter Hermia, Lysander, and Demetrius. 417 | 418 | Ege. Happy be Theseus, our renowned Duke 419 | 420 | The. Thanks good Egeus: what's the news with thee? 421 | Ege. Full of vexation, come I, with complaint 422 | Against my childe, my daughter Hermia. 423 | 424 | Stand forth Demetrius. 425 | 426 | My Noble Lord, 427 | This man hath my consent to marrie her. 428 | 429 | Stand forth Lysander. 430 | 431 | And my gracious Duke, 432 | This man hath bewitch'd the bosome of my childe: 433 | Thou, thou Lysander, thou hast giuen her rimes, 434 | And interchang'd loue-tokens with my childe: 435 | Thou hast by Moone-light at her window sung, 436 | With faining voice, verses of faining loue, 437 | And stolne the impression of her fantasie, 438 | With bracelets of thy haire, rings, gawdes, conceits, 439 | Knackes, trifles, Nose-gaies, sweet meats (messengers 440 | Of strong preuailment in vnhardned youth) 441 | With cunning hast thou filch'd my daughters heart, 442 | Turn'd her obedience (which is due to me) 443 | To stubborne harshnesse. And my gracious Duke, 444 | Be it so she will not heere before your Grace, 445 | Consent to marrie with Demetrius, 446 | I beg the ancient priuiledge of Athens; 447 | As she is mine, I may dispose of her; 448 | Which shall be either to this Gentleman, 449 | Or to her death, according to our Law, 450 | Immediately prouided in that case 451 | 452 | The. What say you Hermia? be aduis'd faire Maide, 453 | To you your Father should be as a God; 454 | One that compos'd your beauties; yea and one 455 | To whom you are but as a forme in waxe 456 | By him imprinted: and within his power, 457 | To leaue the figure, or disfigure it: 458 | Demetrius is a worthy Gentleman 459 | 460 | Her. So is Lysander 461 | 462 | The. In himselfe he is. 463 | But in this kinde, wanting your fathers voyce, 464 | The other must be held the worthier 465 | 466 | Her. I would my father look'd but with my eyes 467 | 468 | The. Rather your eies must with his iudgment looke 469 | 470 | Her. I do entreat your Grace to pardon me. 471 | I know not by what power I am made bold, 472 | Nor how it may concerne my modestie 473 | In such a presence heere to pleade my thoughts: 474 | But I beseech your Grace, that I may know 475 | The worst that may befall me in this case, 476 | If I refuse to wed Demetrius 477 | 478 | The. Either to dye the death, or to abiure 479 | For euer the society of men. 480 | Therefore faire Hermia question your desires, 481 | Know of your youth, examine well your blood, 482 | Whether (if you yeeld not to your fathers choice) 483 | You can endure the liuerie of a Nunne, 484 | For aye to be in shady Cloister mew'd, 485 | To liue a barren sister all your life, 486 | Chanting faint hymnes to the cold fruitlesse Moone, 487 | Thrice blessed they that master so their blood, 488 | To vndergo such maiden pilgrimage, 489 | But earthlier happie is the Rose distil'd, 490 | Then that which withering on the virgin thorne, 491 | Growes, liues, and dies, in single blessednesse 492 | 493 | Her. So will I grow, so liue, so die my Lord, 494 | Ere I will yeeld my virgin Patent vp 495 | Vnto his Lordship, whose vnwished yoake, 496 | My soule consents not to giue soueraignty 497 | 498 | The. Take time to pause, and by the next new Moon 499 | The sealing day betwixt my loue and me, 500 | For euerlasting bond of fellowship: 501 | Vpon that day either prepare to dye, 502 | For disobedience to your fathers will, 503 | Or else to wed Demetrius as hee would, 504 | Or on Dianaes Altar to protest 505 | For aie, austerity, and single life 506 | 507 | Dem. Relent sweet Hermia, and Lysander, yeelde 508 | Thy crazed title to my certaine right 509 | 510 | Lys. You haue her fathers loue, Demetrius: 511 | Let me haue Hermiaes: do you marry him 512 | 513 | Egeus. Scornfull Lysander, true, he hath my Loue; 514 | And what is mine, my loue shall render him. 515 | And she is mine, and all my right of her, 516 | I do estate vnto Demetrius 517 | 518 | Lys. I am my Lord, as well deriu'd as he, 519 | As well possest: my loue is more then his: 520 | My fortunes euery way as fairely ranck'd 521 | (If not with vantage) as Demetrius: 522 | And (which is more then all these boasts can be) 523 | I am belou'd of beauteous Hermia. 524 | Why should not I then prosecute my right? 525 | Demetrius, Ile auouch it to his head, 526 | Made loue to Nedars daughter, Helena, 527 | And won her soule: and she (sweet Ladie) dotes, 528 | Deuoutly dotes, dotes in Idolatry, 529 | Vpon this spotted and inconstant man 530 | 531 | The. I must confesse, that I haue heard so much, 532 | And with Demetrius thought to haue spoke thereof: 533 | But being ouer-full of selfe-affaires, 534 | My minde did lose it. But Demetrius come, 535 | And come Egeus, you shall go with me, 536 | I haue some priuate schooling for you both. 537 | For you faire Hermia, looke you arme your selfe, 538 | To fit your fancies to your Fathers will; 539 | Or else the Law of Athens yeelds you vp 540 | (Which by no meanes we may extenuate) 541 | To death, or to a vow of single life. 542 | Come my Hippolita, what cheare my loue? 543 | Demetrius and Egeus go along: 544 | I must imploy you in some businesse 545 | Against our nuptiall, and conferre with you 546 | Of something, neerely that concernes your selues 547 | 548 | Ege. With dutie and desire we follow you. 549 | 550 | Exeunt. 551 | 552 | Manet Lysander and Hermia. 553 | 554 | Lys. How now my loue? Why is your cheek so pale? 555 | How chance the Roses there do fade so fast? 556 | Her. Belike for want of raine, which I could well 557 | Beteeme them, from the tempest of mine eyes 558 | 559 | Lys. For ought that euer I could reade, 560 | Could euer heare by tale or historie, 561 | The course of true loue neuer did run smooth, 562 | But either it was different in blood 563 | 564 | Her. O crosse! too high to be enthral'd to loue 565 | 566 | Lys. Or else misgraffed, in respect of yeares 567 | 568 | Her. O spight! too old to be ingag'd to yong 569 | 570 | Lys. Or else it stood vpon the choise of merit 571 | 572 | Her. O hell! to choose loue by anothers eie 573 | 574 | Lys. Or if there were a simpathie in choise, 575 | Warre, death, or sicknesse, did lay siege to it; 576 | Making it momentarie, as a sound: 577 | Swift as a shadow, short as any dreame, 578 | Briefe as the lightning in the collied night, 579 | That (in a spleene) vnfolds both heauen and earth; 580 | And ere a man hath power to say, behold, 581 | The iawes of darkness do deuoure it vp: 582 | So quicke bright things come to confusion 583 | 584 | Her. If then true Louers haue beene euer crost, 585 | It stands as an edict in destinie: 586 | Then let vs teach our triall patience, 587 | Because it is a customarie crosse, 588 | As due to loue, as thoughts, and dreames, and sighes, 589 | Wishes and teares; poore Fancies followers 590 | 591 | Lys. A good perswasion; therefore heare me Hermia, 592 | I haue a Widdow Aunt, a dowager, 593 | Of great reuennew, and she hath no childe, 594 | From Athens is her house remou'd seuen leagues, 595 | And she respects me, as her onely sonne: 596 | There gentle Hermia, may I marrie thee, 597 | And to that place, the sharpe Athenian Law 598 | Cannot pursue vs. If thou lou'st me, then 599 | Steale forth thy Fathers house to morrow night: 600 | And in the wood, a league without the towne, 601 | (Where I did meete thee once with Helena. 602 | To do obseruance for a morne of May) 603 | There will I stay for thee 604 | 605 | Her. My good Lysander, 606 | I sweare to thee, by Cupids strongest bow, 607 | By his best arrow with the golden head, 608 | By the simplicitie of Venus Doues, 609 | By that which knitteth soules, and prospers loue, 610 | And by that fire which burn'd the Carthage Queene, 611 | When the false Troyan vnder saile was seene, 612 | By all the vowes that euer men haue broke, 613 | (In number more then euer women spoke) 614 | In that same place thou hast appointed me, 615 | To morrow truly will I meete with thee 616 | 617 | Lys. Keepe promise loue: looke here comes Helena. 618 | Enter Helena. 619 | 620 | Her. God speede faire Helena, whither away? 621 | Hel. Cal you me faire? that faire againe vnsay, 622 | Demetrius loues you faire: O happie faire! 623 | Your eyes are loadstarres, and your tongues sweete ayre 624 | More tuneable then Larke to shepheards eare, 625 | When wheate is greene, when hauthorne buds appeare, 626 | Sicknesse is catching: O were fauor so, 627 | Your words I catch, faire Hermia ere I go, 628 | My eare should catch your voice, my eye, your eye, 629 | My tongue should catch your tongues sweete melodie, 630 | Were the world mine, Demetrius being bated, 631 | The rest Ile giue to be to you translated. 632 | O teach me how you looke, and with what art 633 | You sway the motion of Demetrius hart 634 | 635 | Her. I frowne vpon him, yet he loues me still 636 | 637 | Hel. O that your frownes would teach my smiles 638 | such skil 639 | 640 | Her. I giue him curses, yet he giues me loue 641 | 642 | Hel. O that my prayers could such affection mooue 643 | 644 | Her. The more I hate, the more he followes me 645 | 646 | Hel. The more I loue, the more he hateth me 647 | 648 | Her. His folly Helena is none of mine 649 | 650 | Hel. None but your beauty, wold that fault wer mine 651 | Her. Take comfort: he no more shall see my face, 652 | Lysander and my selfe will flie this place. 653 | Before the time I did Lysander see, 654 | Seem'd Athens like a Paradise to mee. 655 | O then, what graces in my Loue do dwell, 656 | That he hath turn'd a heauen into hell 657 | 658 | Lys. Helen, to you our mindes we will vnfold, 659 | To morrow night, when Phoebe doth behold 660 | Her siluer visage, in the watry glasse, 661 | Decking with liquid pearle, the bladed grasse 662 | (A time that Louers flights doth still conceale) 663 | Through Athens gates, haue we deuis'd to steale 664 | 665 | Her. And in the wood, where often you and I, 666 | Vpon faint Primrose beds, were wont to lye, 667 | Emptying our bosomes, of their counsell sweld: 668 | There my Lysander, and my selfe shall meete, 669 | And thence from Athens turne away our eyes 670 | To seeke new friends and strange companions, 671 | Farwell sweet play-fellow, pray thou for vs, 672 | And good lucke grant thee thy Demetrius. 673 | Keepe word Lysander we must starue our sight, 674 | From louers foode, till morrow deepe midnight. 675 | 676 | Exit Hermia. 677 | 678 | Lys. I will my Hermia. Helena adieu, 679 | As you on him, Demetrius dotes on you. 680 | 681 | Exit Lysander. 682 | 683 | Hele. How happy some, ore othersome can be? 684 | Through Athens I am thought as faire as she. 685 | But what of that? Demetrius thinkes not so: 686 | He will not know, what all, but he doth know, 687 | And as hee erres, doting on Hermias eyes; 688 | So I, admiring of his qualities: 689 | Things base and vilde, holding no quantity, 690 | Loue can transpose to forme and dignity, 691 | Loue lookes not with the eyes, but with the minde, 692 | And therefore is wing'd Cupid painted blinde. 693 | Nor hath loues minde of any iudgement taste: 694 | Wings and no eyes, figure, vnheedy haste. 695 | And therefore is Loue said to be a childe, 696 | Because in choise he is often beguil'd, 697 | As waggish boyes in game themselues forsweare; 698 | So the boy Loue is periur'd euery where. 699 | For ere Demetrius lookt on Hermias eyne, 700 | He hail'd downe oathes that he was onely mine. 701 | And when this Haile some heat from Hermia felt, 702 | So he dissolu'd, and showres of oathes did melt, 703 | I will goe tell him of faire Hermias flight: 704 | Then to the wood will he, to morrow night 705 | Pursue her; and for his intelligence, 706 | If I haue thankes, it is a deere expence: 707 | But heerein meane I to enrich my paine, 708 | To haue his sight thither, and backe againe. 709 | Enter. 710 | 711 | Enter Quince the Carpenter, Snug the Ioyner, Bottome the Weauer, 712 | Flute 713 | the bellowes-mender, Snout the Tinker, and Starueling the Taylor. 714 | 715 | Quin. Is all our company heere? 716 | Bot. You were best to call them generally, man by 717 | man according to the scrip 718 | 719 | Qui. Here is the scrowle of euery mans name, which 720 | is thought fit through all Athens, to play in our Enterlude 721 | before the Duke and the Dutches, on his wedding 722 | day at night 723 | 724 | Bot. First, good Peter Quince, say what the play treats 725 | on: then read the names of the Actors: and so grow on 726 | to a point 727 | 728 | Quin. Marry our play is the most lamentable comedy, 729 | and most cruell death of Pyramus and Thisbie 730 | 731 | Bot. A very good peece of worke I assure you, and a 732 | merry. Now good Peter Quince, call forth your Actors 733 | by the scrowle. Masters spread your selues 734 | 735 | Quince. Answere as I call you. Nick Bottome the 736 | Weauer 737 | 738 | Bottome. Ready; name what part I am for, and 739 | proceed 740 | 741 | Quince. You Nicke Bottome are set downe for Pyramus 742 | 743 | Bot. What is Pyramus, a louer, or a tyrant? 744 | Quin. A Louer that kills himselfe most gallantly for 745 | loue 746 | 747 | Bot. That will aske some teares in the true performing 748 | of it: if I do it, let the audience looke to their eies: 749 | I will mooue stormes; I will condole in some measure. 750 | To the rest yet, my chiefe humour is for a tyrant. I could 751 | play Ercles rarely, or a part to teare a Cat in, to make all 752 | split the raging Rocks; and shiuering shocks shall break 753 | the locks of prison gates, and Phibbus carre shall shine 754 | from farre, and make and marre the foolish Fates. This 755 | was lofty. Now name the rest of the Players. This 756 | is Ercles vaine, a tyrants vaine: a louer is more condoling 757 | 758 | Quin. Francis Flute the Bellowes-mender 759 | 760 | Flu. Heere Peter Quince 761 | 762 | Quin. You must take Thisbie on you 763 | 764 | Flut. What is Thisbie, a wandring Knight? 765 | Quin. It is the Lady that Pyramus must loue 766 | 767 | Flut. Nay faith, let not mee play a woman, I haue a 768 | beard comming 769 | 770 | Qui. That's all one, you shall play it in a Maske, and 771 | you may speake as small as you will 772 | 773 | Bot. And I may hide my face, let me play Thisbie too: 774 | Ile speake in a monstrous little voyce; Thisne, Thisne, ah 775 | Pyramus my louer deare, thy Thisbie deare, and Lady 776 | deare 777 | 778 | Quin. No no, you must play Pyramus, and Flute, you 779 | Thisby 780 | 781 | Bot. Well, proceed 782 | 783 | Qu. Robin Starueling the Taylor 784 | 785 | Star. Heere Peter Quince 786 | 787 | Quince. Robin Starueling, you must play Thisbies 788 | mother? 789 | Tom Snowt, the Tinker 790 | 791 | Snowt. Heere Peter Quince 792 | 793 | Quin. you, Pyramus father; my self, Thisbies father; 794 | Snugge the Ioyner, you the Lyons part: and I hope there 795 | is a play fitted 796 | 797 | Snug. Haue you the Lions part written? pray you if 798 | be, giue it me, for I am slow of studie 799 | 800 | Quin. You may doe it extemporie, for it is nothing 801 | but roaring 802 | 803 | Bot. Let mee play the Lyon too, I will roare that I 804 | will doe any mans heart good to heare me. I will roare, 805 | that I will make the Duke say, Let him roare againe, let 806 | him roare againe 807 | 808 | Quin. If you should do it too terribly, you would 809 | fright the Dutchesse and the Ladies, that they would 810 | shrike, and that were enough to hang us all 811 | 812 | All. That would hang vs euery mothers sonne 813 | 814 | Bottome. I graunt you friends, if that you should 815 | fright the Ladies out of their Wittes, they would 816 | haue no more discretion but to hang vs: but I will aggrauate 817 | my voyce so, that I will roare you as gently as 818 | any sucking Doue; I will roare and 'twere any Nightingale 819 | 820 | Quin. You can play no part but Piramus, for Piramus 821 | is a sweet-fac'd man, a proper man as one shall see in 822 | a summers day; a most louely Gentleman-like man, therfore 823 | you must needs play Piramus 824 | 825 | Bot. Well, I will vndertake it. What beard were I 826 | best to play it in? 827 | Quin. Why, what you will 828 | 829 | Bot. I will discharge it, in either your straw-colour 830 | beard, your orange tawnie beard, your purple in graine 831 | beard, or your French-crowne colour'd beard, your perfect 832 | yellow 833 | 834 | Quin. Some of your French Crownes haue no haire 835 | at all, and then you will play bare-fac'd. But masters here 836 | are your parts, and I am to intreat you, request you, and 837 | desire you, to con them by too morrow night: and meet 838 | me in the palace wood, a mile without the Towne, by 839 | Moone-light, there we will rehearse: for if we meete in 840 | the Citie, we shalbe dog'd with company, and our deuises 841 | knowne. In the meane time, I wil draw a bil of properties, 842 | such as our play wants. I pray you faile me not 843 | 844 | Bottom. We will meete, and there we may rehearse 845 | more obscenely and couragiously. Take paines, be perfect, 846 | adieu 847 | 848 | Quin. At the Dukes oake we meete 849 | 850 | Bot. Enough, hold or cut bow-strings. 851 | 852 | Exeunt. 853 | 854 | Actus Secundus. 855 | 856 | Enter a Fairie at one dore, and Robin goodfellow at another. 857 | 858 | Rob. How now spirit, whether wander you? 859 | Fai. Ouer hil, ouer dale, through bush, through briar, 860 | Ouer parke, ouer pale, through flood, through fire, 861 | I do wander euerie where, swifter then y Moons sphere; 862 | And I serue the Fairy Queene, to dew her orbs vpon the green. 863 | The Cowslips tall, her pensioners bee, 864 | In their gold coats, spots you see, 865 | Those be Rubies, Fairie fauors, 866 | In those freckles, liue their sauors, 867 | I must go seeke some dew drops heere, 868 | And hang a pearle in euery cowslips eare. 869 | Farewell thou Lob of spirits, Ile be gon, 870 | Our Queene and all her Elues come heere anon 871 | 872 | Rob. The King doth keepe his Reuels here to night, 873 | Take heed the Queene come not within his sight, 874 | For Oberon is passing fell and wrath, 875 | Because that she, as her attendant, hath 876 | A louely boy stolne from an Indian King, 877 | She neuer had so sweet a changeling, 878 | And iealous Oberon would haue the childe 879 | Knight of his traine, to trace the Forrests wilde. 880 | But she (perforce) with-holds the loued boy, 881 | Crownes him with flowers, and makes him all her ioy. 882 | And now they neuer meete in groue, or greene, 883 | By fountaine cleere, or spangled star-light sheene, 884 | But they do square, that all their Elues for feare 885 | Creepe into Acorne cups and hide them there 886 | 887 | Fai. Either I mistake your shape and making quite, 888 | Or else you are that shrew'd and knauish spirit 889 | Cal'd Robin Good-fellow. Are you not hee, 890 | That frights the maidens of the Villagree, 891 | Skim milke, and sometimes labour in the querne, 892 | And bootlesse make the breathlesse huswife cherne, 893 | And sometime make the drinke to beare no barme, 894 | Misleade night-wanderers, laughing at their harme, 895 | Those that Hobgoblin call you, and sweet Pucke, 896 | You do their worke, and they shall haue good lucke. 897 | Are not you he? 898 | Rob. Thou speak'st aright; 899 | I am that merrie wanderer of the night: 900 | I iest to Oberon, and make him smile, 901 | When I a fat and bean-fed horse beguile, 902 | Neighing in likenesse of a silly foale, 903 | And sometime lurke I in a Gossips bole, 904 | In very likenesse of a roasted crab: 905 | And when she drinkes, against her lips I bob, 906 | And on her withered dewlop poure the Ale. 907 | The wisest Aunt telling the saddest tale, 908 | Sometime for three-foot stoole, mistaketh me, 909 | Then slip I from her bum, downe topples she, 910 | And tailour cries, and fals into a coffe. 911 | And then the whole quire hold their hips, and loffe, 912 | And waxen in their mirth, and neeze, and sweare, 913 | A merrier houre was neuer wasted there. 914 | But roome Fairy, heere comes Oberon 915 | 916 | Fair. And heere my Mistris: 917 | Would that he were gone. 918 | Enter the King of Fairies at one doore with his traine, and the 919 | Queene at 920 | another with hers. 921 | 922 | Ob. Ill met by Moone-light. 923 | Proud Tytania 924 | 925 | Qu. What, iealous Oberon? Fairy skip hence. 926 | I haue forsworne his bed and companie 927 | 928 | Ob. Tarrie rash Wanton; am not I thy Lord? 929 | Qu. Then I must be thy Lady: but I know 930 | When thou wast stolne away from Fairy Land, 931 | And in the shape of Corin, sate all day, 932 | Playing on pipes of Corne, and versing loue 933 | To amorous Phillida. Why art thou heere 934 | Come from the farthest steepe of India? 935 | But that forsooth the bouncing Amazon 936 | Your buskin'd Mistresse, and your Warrior loue, 937 | To Theseus must be Wedded; and you come, 938 | To giue their bed ioy and prosperitie 939 | 940 | Ob. How canst thou thus for shame Tytania. 941 | Glance at my credite, with Hippolita? 942 | Knowing I know thy loue to Theseus? 943 | Didst thou not leade him through the glimmering night 944 | From Peregenia, whom he rauished? 945 | And make him with faire Eagles breake his faith 946 | With Ariadne, and Antiopa? 947 | Que. These are the forgeries of iealousie, 948 | And neuer since the middle Summers spring 949 | Met we on hil, in dale, forrest, or mead, 950 | By paued fountaine, or by rushie brooke, 951 | Or in the beached margent of the sea, 952 | To dance our ringlets to the whistling Winde, 953 | But with thy braules thou hast disturb'd our sport. 954 | Therefore the Windes, piping to vs in vaine, 955 | As in reuenge, haue suck'd vp from the sea 956 | Contagious fogges: Which falling in the Land, 957 | Hath euerie petty Riuer made so proud, 958 | That they haue ouer-borne their Continents. 959 | The Oxe hath therefore stretch'd his yoake in vaine, 960 | The Ploughman lost his sweat, and the greene Corne 961 | Hath rotted, ere his youth attain'd a beard: 962 | The fold stands empty in the drowned field, 963 | And Crowes are fatted with the murrion flocke, 964 | The nine mens Morris is fild vp with mud, 965 | And the queint Mazes in the wanton greene, 966 | For lacke of tread are vndistinguishable. 967 | The humane mortals want their winter heere, 968 | No night is now with hymne or caroll blest; 969 | Therefore the Moone (the gouernesse of floods) 970 | Pale in her anger, washes all the aire; 971 | That Rheumaticke diseases doe abound. 972 | And through this distemperature, we see 973 | The seasons alter; hoared headed Frosts 974 | Fall in the fresh lap of the crimson Rose, 975 | And on old Hyems chinne and Icie crowne, 976 | An odorous Chaplet of sweet Sommer buds 977 | Is as in mockry set. The Spring, the Sommer, 978 | The childing Autumne, angry Winter change 979 | Their wonted Liueries, and the mazed world, 980 | By their increase, now knowes not which is which; 981 | And this same progeny of euills, 982 | Comes from our debate, from our dissention, 983 | We are their parents and originall 984 | 985 | Ober. Do you amend it then, it lies in you, 986 | Why should Titania crosse her Oberon? 987 | I do but beg a little changeling boy, 988 | To be my Henchman 989 | 990 | Qu. Set your heart at rest, 991 | The Fairy land buyes not the childe of me, 992 | His mother was a Votresse of my Order, 993 | And in the spiced Indian aire, by night 994 | Full often hath she gossipt by my side, 995 | And sat with me on Neptunes yellow sands, 996 | Marking th' embarked traders on the flood, 997 | When we haue laught to see the sailes conceiue, 998 | And grow big bellied with the wanton winde: 999 | Which she with pretty and with swimming gate, 1000 | Following (her wombe then rich with my yong squire) 1001 | Would imitate, and saile vpon the Land, 1002 | To fetch me trifles, and returne againe, 1003 | As from a voyage, rich with merchandize. 1004 | But she being mortall, of that boy did die, 1005 | And for her sake I doe reare vp her boy, 1006 | And for her sake I will not part with him 1007 | 1008 | Ob. How long within this wood intend you stay? 1009 | Qu. Perchance till after Theseus wedding day. 1010 | If you will patiently dance in our Round, 1011 | And see our Moone-light reuels, goe with vs; 1012 | If not, shun me and I will spare your haunts 1013 | 1014 | Ob. Giue me that boy, and I will goe with thee 1015 | 1016 | Qu. Not for thy Fairy Kingdome. Fairies away: 1017 | We shall chide downe right, if I longer stay. 1018 | 1019 | Exeunt 1020 | 1021 | Ob. Wel, go thy way: thou shalt not from this groue, 1022 | Till I torment thee for this iniury. 1023 | My gentle Pucke come hither; thou remembrest 1024 | Since once I sat vpon a promontory, 1025 | And heard a Meare-maide on a Dolphins backe, 1026 | Vttering such dulcet and harmonious breath, 1027 | That the rude sea grew ciuill at her song, 1028 | And certaine starres shot madly from their Spheares, 1029 | To heare the Sea-maids musicke 1030 | 1031 | Puc. I remember 1032 | 1033 | Ob. That very time I say (but thou couldst not) 1034 | Flying betweene the cold Moone and the earth, 1035 | Cupid all arm'd; a certaine aime he tooke 1036 | At a faire Vestall, throned by the West, 1037 | And loos'd his loue-shaft smartly from his bow, 1038 | As it should pierce a hundred thousand hearts, 1039 | But I might see young Cupids fiery shaft 1040 | Quencht in the chaste beames of the watry Moone; 1041 | And the imperiall Votresse passed on, 1042 | In maiden meditation, fancy free. 1043 | Yet markt I where the bolt of Cupid fell. 1044 | It fell vpon a little westerne flower; 1045 | Before, milke-white: now purple with loues wound, 1046 | And maidens call it, Loue in idlenesse. 1047 | Fetch me that flower; the hearb I shew'd thee once, 1048 | The iuyce of it, on sleeping eye-lids laid, 1049 | Will make or man or woman madly dote 1050 | Vpon the next liue creature that it sees. 1051 | Fetch me this hearbe, and be thou heere againe, 1052 | Ere the Leuiathan can swim a league 1053 | 1054 | Pucke. Ile put a girdle about the earth, in forty minutes 1055 | 1056 | Ober. Hauing once this iuyce, 1057 | Ile watch Titania, when she is asleepe, 1058 | And drop the liquor of it in her eyes: 1059 | The next thing when she waking lookes vpon, 1060 | (Be it on Lyon, Beare, or Wolfe, or Bull, 1061 | On medling Monkey, or on busie Ape) 1062 | Shee shall pursue it, with the soule of loue. 1063 | And ere I take this charme off from her sight, 1064 | (As I can take it with another hearbe) 1065 | Ile make her render vp her Page to me. 1066 | But who comes heere? I am inuisible, 1067 | And I will ouer-heare their conference. 1068 | Enter Demetrius, Helena following him. 1069 | 1070 | Deme. I loue thee not, therefore pursue me not, 1071 | Where is Lysander, and faire Hermia? 1072 | The one Ile stay, the other stayeth me. 1073 | Thou toldst me they were stolne into this wood; 1074 | And heere am I, and wood within this wood, 1075 | Because I cannot meet my Hermia. 1076 | Hence, get thee gone, and follow me no more 1077 | 1078 | Hel. You draw me, you hard-hearted Adamant, 1079 | But yet you draw not Iron, for my heart 1080 | Is true as steele. Leaue you your power to draw, 1081 | And I shall haue no power to follow you 1082 | 1083 | Deme. Do I entice you? do I speake you faire? 1084 | Or rather doe I not in plainest truth, 1085 | Tell you I doe not, nor I cannot loue you? 1086 | Hel. And euen for that doe I loue thee the more; 1087 | I am your spaniell, and Demetrius, 1088 | The more you beat me, I will fawne on you. 1089 | Vse me but as your spaniell; spurne me, strike me, 1090 | Neglect me, lose me; onely giue me leaue 1091 | (Vnworthy as I am) to follow you. 1092 | What worser place can I beg in your loue, 1093 | (And yet a place of high respect with me) 1094 | Then to be vsed as you doe your dogge 1095 | 1096 | Dem. Tempt not too much the hatred of my spirit, 1097 | For I am sicke when I do looke on thee 1098 | 1099 | Hel. And I am sicke when I looke not on you 1100 | 1101 | Dem. You doe impeach your modesty too much, 1102 | To leaue the Citty, and commit your selfe 1103 | Into the hands of one that loues you not, 1104 | To trust the opportunity of night. 1105 | And the ill counsell of a desert place, 1106 | With the rich worth of your virginity 1107 | 1108 | Hel. Your vertue is my priuiledge: for that 1109 | It is not night when I doe see your face. 1110 | Therefore I thinke I am not in the night, 1111 | Nor doth this wood lacke worlds of company, 1112 | For you in my respect are all the world. 1113 | Then how can it be said I am alone, 1114 | When all the world is heere to looke on me? 1115 | Dem. Ile run from thee, and hide me in the brakes, 1116 | And leaue thee to the mercy of wilde beasts 1117 | 1118 | Hel. The wildest hath not such a heart as you; 1119 | Runne when you will, the story shall be chang'd: 1120 | Apollo flies and Daphne holds the chase; 1121 | The Doue pursues the Griffin, the milde Hinde 1122 | Makes speed to catch the Tyger. Bootlesse speede, 1123 | When cowardise pursues, and valour flies 1124 | 1125 | Demet. I will not stay thy questions, let me go; 1126 | Or if thou follow me, doe not beleeue, 1127 | But I shall doe thee mischiefe in the wood 1128 | 1129 | Hel. I, in the Temple, in the Towne, and Field 1130 | You doe me mischiefe. Fye Demetrius, 1131 | Your wrongs doe set a scandall on my sexe: 1132 | We cannot fight for loue, as men may doe; 1133 | We should be woo'd, and were not made to wooe. 1134 | I follow thee, and make a heauen of hell, 1135 | To die vpon the hand I loue so well. 1136 | Enter. 1137 | 1138 | Ob. Fare thee well Nymph, ere he do leaue this groue, 1139 | Thou shalt flie him, and he shall seeke thy loue. 1140 | Hast thou the flower there? Welcome wanderer. 1141 | Enter Pucke. 1142 | 1143 | Puck. I there it is 1144 | 1145 | Ob. I pray thee giue it me. 1146 | I know a banke where the wilde time blowes, 1147 | Where Oxslips and the nodding Violet growes, 1148 | Quite ouer-cannoped with luscious woodbine, 1149 | With sweet muske roses, and with Eglantine; 1150 | There sleepes Tytania, sometime of the night, 1151 | Lul'd in these flowers, with dances and delight: 1152 | And there the snake throwes her enammel'd skinne, 1153 | Weed wide enough to rap a Fairy in. 1154 | And with the iuyce of this Ile streake her eyes, 1155 | And make her full of hatefull fantasies. 1156 | Take thou some of it, and seek through this groue; 1157 | A sweet Athenian Lady is in loue 1158 | With a disdainefull youth: annoint his eyes, 1159 | But doe it when the next thing he espies, 1160 | May be the Lady. Thou shalt know the man, 1161 | By the Athenian garments he hath on. 1162 | Effect it with some care, that he may proue 1163 | More fond on her, then she vpon her loue; 1164 | And looke thou meet me ere the first Cocke crow 1165 | 1166 | Pu. Feare not my Lord, your seruant shall do so. 1167 | Enter. 1168 | 1169 | Enter Queene of Fairies, with her traine. 1170 | 1171 | Queen. Come, now a Roundell, and a Fairy song; 1172 | Then for the third part of a minute hence, 1173 | Some to kill Cankers in the muske rose buds, 1174 | Some warre with Reremise, for their leathern wings. 1175 | To make my small Elues coates, and some keepe backe 1176 | The clamorous Owle that nightly hoots and wonders 1177 | At our queint spirits: Sing me now asleepe, 1178 | Then to your offices, and let me rest 1179 | 1180 | Fairies Sing. You spotted Snakes with double tongue, 1181 | Thorny Hedgehogges be not seene, 1182 | Newts and blinde wormes do no wrong, 1183 | Come not neere our Fairy Queene. 1184 | Philomele with melodie, 1185 | Sing in your sweet Lullaby. 1186 | Lulla, lulla, lullaby, lulla, lulla, lullaby, 1187 | Neuer harme, nor spell, nor charme, 1188 | Come our louely Lady nye, 1189 | So good night with Lullaby 1190 | 1191 | 2.Fairy. Weauing Spiders come not heere, 1192 | Hence you long leg'd Spinners, hence: 1193 | Beetles blacke approach not neere; 1194 | Worme nor Snayle doe no offence. 1195 | Philomele with melody, &c 1196 | 1197 | 1.Fairy. Hence away, now all is well; 1198 | One aloofe, stand Centinell. 1199 | 1200 | Shee sleepes. 1201 | 1202 | Enter Oberon. 1203 | 1204 | Ober. What thou seest when thou dost wake, 1205 | Do it for thy true Loue take: 1206 | Loue and languish for his sake. 1207 | Be it Ounce, or Catte, or Beare, 1208 | Pard, or Boare with bristled haire, 1209 | In thy eye that shall appeare, 1210 | When thou wak'st, it is thy deare, 1211 | Wake when some vile thing is neere. 1212 | Enter Lisander and Hermia. 1213 | 1214 | Lis. Faire loue, you faint with wandring in y woods, 1215 | And to speake troth I haue forgot our way: 1216 | Wee'll rest vs Hermia, If you thinke it good, 1217 | And tarry for the comfort of the day 1218 | 1219 | Her. Be it so Lysander; finde you out a bed, 1220 | For I vpon this banke will rest my head 1221 | 1222 | Lys. One turfe shall serue as pillow for vs both, 1223 | One heart, one bed, two bosomes, and one troth 1224 | 1225 | Her. Nay good Lysander, for my sake my deere 1226 | Lie further off yet, doe not lie so neere 1227 | 1228 | Lys. O take the sence sweet, of my innocence, 1229 | Loue takes the meaning, in loues conference, 1230 | I meane that my heart vnto yours is knit, 1231 | So that but one heart can you make of it. 1232 | Two bosomes interchanged with an oath, 1233 | So then two bosomes, and a single troth. 1234 | Then by your side, no bed-roome me deny, 1235 | For lying so, Hermia, I doe not lye 1236 | 1237 | Her. Lysander riddles very prettily; 1238 | Now much beshrew my manners and my pride, 1239 | If Hermia meant to say, Lysander lied. 1240 | But gentle friend, for loue and courtesie 1241 | Lie further off, in humane modesty, 1242 | Such separation, as may well be said, 1243 | Becomes a vertuous batchelour, and a maide, 1244 | So farre be distant, and good night sweet friend; 1245 | Thy loue nere alter, till thy sweet life end 1246 | 1247 | Lys. Amen, amen, to that faire prayer, say I, 1248 | And then end life, when I end loyalty: 1249 | Heere is my bed, sleepe giue thee all his rest 1250 | 1251 | Her. With halfe that wish, the wishers eyes be prest. 1252 | Enter Pucke. They sleepe. 1253 | 1254 | Puck. Through the Forest haue I gone, 1255 | But Athenian finde I none, 1256 | One whose eyes I might approue 1257 | This flowers force in stirring loue. 1258 | Nigh and silence: who is heere? 1259 | Weedes of Athens he doth weare: 1260 | This is he (my master said) 1261 | Despised the Athenian maide: 1262 | And heere the maiden sleeping sound, 1263 | On the danke and durty ground. 1264 | Pretty soule, she durst not lye 1265 | Neere this lacke-loue, this kill-curtesie. 1266 | Churle, vpon thy eyes I throw 1267 | All the power this charme doth owe: 1268 | When thou wak'st, let loue forbid 1269 | Sleepe his seate on thy eye-lid. 1270 | So awake when I am gone: 1271 | For I must now to Oberon. 1272 | Enter. 1273 | 1274 | Enter Demetrius and Helena running. 1275 | 1276 | Hel. Stay, though thou kill me, sweete Demetrius 1277 | 1278 | De. I charge thee hence, and do not haunt me thus 1279 | 1280 | Hel. O wilt thou darkling leaue me? do not so 1281 | 1282 | De. Stay on thy perill, I alone will goe. 1283 | 1284 | Exit Demetrius. 1285 | 1286 | Hel. O I am out of breath, in this fond chace, 1287 | The more my prayer, the lesser is my grace, 1288 | Happy is Hermia, wheresoere she lies; 1289 | For she hath blessed and attractiue eyes. 1290 | How came her eyes so bright? Not with salt teares. 1291 | If so, my eyes are oftner washt then hers. 1292 | No, no, I am as vgly as a Beare; 1293 | For beasts that meete me, runne away for feare, 1294 | Therefore no maruaile, though Demetrius 1295 | Doe as a monster, flie my presence thus. 1296 | What wicked and dissembling glasse of mine, 1297 | Made me compare with Hermias sphery eyne? 1298 | But who is here? Lysander on the ground; 1299 | Deade or asleepe? I see no bloud, no wound, 1300 | Lysander, if you liue, good sir awake 1301 | 1302 | Lys. And run through fire I will for thy sweet sake. 1303 | Transparent Helena, nature her shewes art, 1304 | That through thy bosome makes me see thy heart. 1305 | Where is Demetrius? oh how fit a word 1306 | Is that vile name, to perish on my sword! 1307 | Hel. Do not say so Lysander, say not so: 1308 | What though he loue your Hermia? Lord, what though? 1309 | Yet Hermia still loues you; then be content 1310 | 1311 | Lys. Content with Hermia? no, I do repent 1312 | The tedious minutes I with her haue spent. 1313 | Not Hermia, but Helena now I loue; 1314 | Who will not change a Rauen for a Doue? 1315 | The will of man is by his reason sway'd: 1316 | And reason saies you are the worthier Maide. 1317 | Things growing are not ripe vntill their season; 1318 | So I being yong, till now ripe not to reason, 1319 | And touching now the point of humane skill, 1320 | Reason becomes the Marshall to my will. 1321 | And leades me to your eyes, where I orelooke 1322 | Loues stories, written in Loues richest booke 1323 | 1324 | Hel. Wherefore was I to this keene mockery borne? 1325 | When at your hands did I deserue this scorne? 1326 | Ist not enough, ist not enough, yong man, 1327 | That I did neuer, no nor neuer can, 1328 | Deserue a sweete looke from Demetrius eye, 1329 | But you must flout my insufficiency? 1330 | Good troth you do me wrong (good-sooth you do) 1331 | In such disdainfull manner, me to wooe. 1332 | But fare you well; perforce I must confesse, 1333 | I thought you Lord of more true gentlenesse. 1334 | Oh, that a Lady of one man refus'd, 1335 | Should of another therefore be abus'd. 1336 | Enter 1337 | 1338 | Lys. She sees not Hermia: Hermia sleepe thou there, 1339 | And neuer maist thou come Lysander neere; 1340 | For as a surfeit of the sweetest things 1341 | The deepest loathing to the stomacke brings: 1342 | Or as the heresies that men do leaue, 1343 | Are hated most of those that did deceiue: 1344 | So thou, my surfeit, and my heresie, 1345 | Of all be hated; but the most of me; 1346 | And all my powers addresse your loue and might, 1347 | To honour Helen, and to be her Knight. 1348 | Enter. 1349 | 1350 | Her. Helpe me Lysander, helpe me; do thy best 1351 | To plucke this crawling serpent from my brest. 1352 | Aye me, for pitty; what a dreame was here? 1353 | Lysander looke, how I do quake with feare: 1354 | Me-thought a serpent eate my heart away, 1355 | And yet sat smiling at his cruell prey. 1356 | Lysander, What remoou'd? Lysander, Lord, 1357 | What, out of hearing, gone? No sound, no word? 1358 | Alacke where are you? speake and if you heare: 1359 | Speake of all loues; I sound almost with feare. 1360 | No, then I well perceiue you are not nye, 1361 | Either death or you Ile finde immediately. 1362 | Enter. 1363 | 1364 | 1365 | Actus Tertius. 1366 | 1367 | Enter the Clownes. 1368 | 1369 | Bot. Are we all met? 1370 | Quin. Pat, pat, and here's a maruailous conuenient 1371 | place for our rehearsall. This greene plot shall be our 1372 | stage, this hauthorne brake our tyring house, and we will 1373 | do it in action, as we will do it before the Duke 1374 | 1375 | Bot. Peter Quince? 1376 | Peter. What saist thou, bully Bottome? 1377 | Bot. There are things in this Comedy of Piramus and 1378 | Thisby, that will neuer please. First, Piramus must draw a 1379 | sword to kill himselfe; which the Ladies cannot abide. 1380 | How answere you that? 1381 | Snout. Berlaken, a parlous feare 1382 | 1383 | Star. I beleeue we must leaue the killing out, when 1384 | all is done 1385 | 1386 | Bot. Not a whit, I haue a deuice to make all well. 1387 | Write me a Prologue, and let the Prologue seeme to say, 1388 | we will do no harme with our swords, and that Pyramus 1389 | is not kill'd indeede: and for the more better assurance, 1390 | tell them, that I Piramus am not Piramus, but Bottome the 1391 | Weauer; this will put them out of feare 1392 | 1393 | Quin. Well, we will haue such a Prologue, and it shall 1394 | be written in eight and sixe 1395 | 1396 | Bot. No, make it two more, let it be written in eight 1397 | and eight 1398 | 1399 | Snout. Will not the Ladies be afear'd of the Lyon? 1400 | Star. I feare it, I promise you 1401 | 1402 | Bot. Masters, you ought to consider with your selues, to 1403 | bring in (God shield vs) a Lyon among Ladies, is a most 1404 | dreadfull thing. For there is not a more fearefull wilde 1405 | foule then your Lyon liuing: and wee ought to looke 1406 | to it 1407 | 1408 | Snout. Therefore another Prologue must tell he is not 1409 | a Lyon 1410 | 1411 | Bot. Nay, you must name his name, and halfe his face 1412 | must be seene through the Lyons necke, and he himselfe 1413 | must speake through, saying thus, or to the same defect; 1414 | Ladies, or faire Ladies, I would wish you, or I would 1415 | request you, or I would entreat you, not to feare, not to 1416 | tremble: my life for yours. If you thinke I come hither 1417 | as a Lyon, it were pitty of my life. No, I am no such 1418 | thing, I am a man as other men are; and there indeed let 1419 | him name his name, and tell him plainly hee is Snug the 1420 | ioyner 1421 | 1422 | Quin. Well, it shall be so; but there is two hard 1423 | things, that is, to bring the Moone-light into a chamber: 1424 | for you know Piramus and Thisby meete by Moonelight 1425 | 1426 | Sn. Doth the Moone shine that night wee play our 1427 | play? 1428 | Bot. A Calender, a Calender, looke in the Almanack, 1429 | finde out Moone-shine, finde out Moone-shine. 1430 | Enter Pucke. 1431 | 1432 | Quin. Yes, it doth shine that night 1433 | 1434 | Bot. Why then may you leaue a casement of the great 1435 | chamber window (where we play) open, and the Moone 1436 | may shine in at the casement 1437 | 1438 | Quin. I, or else one must come in with a bush of thorns 1439 | and a lanthorne, and say he comes to disfigure, or to present 1440 | the person of Moone-shine. Then there is another 1441 | thing, we must haue a wall in the great Chamber; for Piramus 1442 | and Thisby (saies the story) did talke through the 1443 | chinke of a wall 1444 | 1445 | Sn. You can neuer bring in a wall. What say you 1446 | Bottome? 1447 | Bot. Some man or other must present wall, and let 1448 | him haue some Plaster, or some Lome, or some rough 1449 | cast about him, to signifie wall; or let him hold his fingers 1450 | thus; and through that cranny shall Piramus and 1451 | Thisby whisper 1452 | 1453 | Quin. If that may be, then all is well. Come, sit 1454 | downe euery mothers sonne, and rehearse your parts. 1455 | Piramus, you begin; when you haue spoken your speech, 1456 | enter into that Brake, and so euery one according to his 1457 | cue. 1458 | Enter Robin. 1459 | 1460 | Rob. What hempen home-spuns haue we swaggering 1461 | here, 1462 | So neere the Cradle of the Faierie Queene? 1463 | What, a Play toward? Ile be an auditor, 1464 | An Actor too perhaps, if I see cause 1465 | 1466 | Quin. Speake Piramus: Thisby stand forth 1467 | 1468 | Pir. Thisby, the flowers of odious sauors sweete 1469 | 1470 | Quin. Odours, odours 1471 | 1472 | Pir. Odours sauors sweete, 1473 | So hath thy breath, my dearest Thisby deare. 1474 | But harke, a voyce: stay thou but here a while, 1475 | And by and by I will to thee appeare. 1476 | 1477 | Exit. Pir. 1478 | 1479 | Puck. A stranger Piramus, then ere plaid here 1480 | 1481 | This. Must I speake now? 1482 | Pet. I marry must you. For you must vnderstand he 1483 | goes but to see a noyse that he heard, and is to come againe 1484 | 1485 | Thys. Most radiant Piramus, most Lilly white of hue, 1486 | Of colour like the red rose on triumphant bryer, 1487 | Most brisky Iuuenall, and eke most louely Iew, 1488 | As true as truest horse, that yet would neuer tyre, 1489 | Ile meete thee Piramus, at Ninnies toombe 1490 | 1491 | Pet. Ninus toombe man: why, you must not speake 1492 | that yet; that you answere to Piramus: you speake all 1493 | your part at once, cues and all. Piramus enter, your cue is 1494 | past; it is neuer tyre 1495 | 1496 | Thys. O, as true as truest horse, that yet would neuer 1497 | tyre: 1498 | Pir. If I were faire, Thisby I were onely thine 1499 | 1500 | Pet. O monstrous. O strange. We are hanted; pray 1501 | masters, flye masters, helpe. 1502 | 1503 | The Clownes all Exit. 1504 | 1505 | Puk. Ile follow you, Ile leade you about a Round, 1506 | Through bogge, through bush, through brake, through bryer, 1507 | Sometime a horse Ile be, sometime a hound: 1508 | A hogge, a headlesse beare, sometime a fire, 1509 | And neigh, and barke, and grunt, and rore, and burne, 1510 | Like horse, hound, hog, beare, fire, at euery turne. 1511 | Enter. 1512 | 1513 | Enter Piramus with the Asse head. 1514 | 1515 | Bot. Why do they run away? This is a knauery of 1516 | them to make me afeard. 1517 | Enter Snowt 1518 | 1519 | Sn. O Bottom, thou art chang'd; What doe I see on 1520 | thee? 1521 | Bot. What do you see? You see an Asse-head of your 1522 | owne, do you? 1523 | Enter Peter Quince. 1524 | 1525 | Pet. Blesse thee Bottome, blesse thee; thou art translated. 1526 | Enter. 1527 | 1528 | Bot. I see their knauery; this is to make an asse of me, 1529 | to fright me if they could; but I will not stirre from 1530 | this place, do what they can. I will walke vp and downe 1531 | here, and I will sing that they shall heare I am not afraid. 1532 | The Woosell cocke, so blacke of hew, 1533 | With Orenge-tawny bill. 1534 | The Throstle, with his note so true, 1535 | The Wren and little quill 1536 | 1537 | Tyta. What Angell wakes me from my flowry bed? 1538 | Bot. The Finch, the Sparrow, and the Larke, 1539 | The plainsong Cuckow gray; 1540 | Whose note full many a man doth marke, 1541 | And dares not answere, nay. 1542 | For indeede, who would set his wit to so foolish a bird? 1543 | Who would giue a bird the lye, though he cry Cuckow, 1544 | neuer so? 1545 | Tyta. I pray thee gentle mortall, sing againe, 1546 | Mine eare is much enamored of thy note; 1547 | On the first view to say, to sweare I loue thee. 1548 | So is mine eye enthralled to thy shape. 1549 | And thy faire vertues force (perforce) doth moue me 1550 | 1551 | Bot. Me-thinkes mistresse, you should haue little 1552 | reason for that: and yet to say the truth, reason and 1553 | loue keepe little company together, nowadayes. 1554 | The more the pittie, that some honest neighbours will 1555 | not make them friends. Nay, I can gleeke vpon occasion 1556 | 1557 | Tyta. Thou art as wise, as thou art beautifull 1558 | 1559 | Bot. Not so neither: but if I had wit enough to get 1560 | out of this wood, I haue enough to serue mine owne 1561 | turne 1562 | 1563 | Tyta. Out of this wood, do not desire to goe, 1564 | Thou shalt remaine here, whether thou wilt or no. 1565 | I am a spirit of no common rate: 1566 | The Summer still doth tend vpon my state, 1567 | And I doe loue thee; therefore goe with me, 1568 | Ile giue thee Fairies to attend on thee; 1569 | And they shall fetch thee Iewels from the deepe, 1570 | And sing, while thou on pressed flowers dost sleepe: 1571 | And I will purge thy mortall grossenesse so, 1572 | That thou shalt like an airie spirit go. 1573 | Enter Pease-blossome, Cobweb, Moth, Mustardseede, and foure 1574 | Fairies. 1575 | 1576 | Fai. Ready; and I, and I, and I, Where shall we go? 1577 | Tita. Be kinde and curteous to this Gentleman, 1578 | Hop in his walkes, and gambole in his eies, 1579 | Feede him with Apricocks, and Dewberries, 1580 | With purple Grapes, greene Figs, and Mulberries, 1581 | The honie-bags steale from the humble Bees, 1582 | And for night-tapers crop their waxen thighes, 1583 | And light them at the fierie-Glow-wormes eyes, 1584 | To haue my loue to bed, and to arise: 1585 | And plucke the wings from painted Butterflies, 1586 | To fan the Moone-beames from his sleeping eies. 1587 | Nod to him Elues, and doe him curtesies 1588 | 1589 | 1.Fai. Haile mortall, haile 1590 | 1591 | 2.Fai. Haile 1592 | 1593 | 3.Fai. Haile 1594 | 1595 | Bot. I cry your worships mercy hartily; I beseech 1596 | your worships name 1597 | 1598 | Cob. Cobweb 1599 | 1600 | Bot. I shall desire you of more acquaintance, good 1601 | Master Cobweb: if I cut my finger, I shall make bold 1602 | with you. 1603 | Your name honest Gentleman? 1604 | Pease. Pease Blossome 1605 | 1606 | Bot. I pray you commend me to mistresse Squash, 1607 | your mother, and to master Peascod your father. Good 1608 | master Pease-blossome, I shal desire of you more acquaintance 1609 | to. Your name I beseech you sir? 1610 | Mus. Mustard-seede 1611 | 1612 | Peas. Pease-blossome 1613 | 1614 | Bot. Good master Mustard seede, I know your patience 1615 | well: that same cowardly gyant-like Oxe beefe 1616 | hath deuoured many a gentleman of your house. I promise 1617 | you, your kindred hath made my eyes water ere 1618 | now. I desire you more acquaintance, good Master 1619 | Mustard-seede 1620 | 1621 | Tita. Come waite vpon him, lead him to my bower. 1622 | The Moone me-thinks, lookes with a watrie eie, 1623 | And when she weepes, weepe euerie little flower, 1624 | Lamenting some enforced chastitie. 1625 | Tye vp my louers tongue, bring him silently. 1626 | Enter. 1627 | 1628 | Enter King of Pharies, solus. 1629 | 1630 | Ob. I wonder if Titania be awak't; 1631 | Then what it was that next came in her eye, 1632 | Which she must dote on, in extremitie. 1633 | Enter Pucke. 1634 | 1635 | Here comes my messenger: how now mad spirit, 1636 | What night-rule now about this haunted groue? 1637 | Puck. My Mistris with a monster is in loue, 1638 | Neere to her close and consecrated bower, 1639 | While she was in her dull and sleeping hower, 1640 | A crew of patches, rude Mechanicals, 1641 | That worke for bread vpon Athenian stals, 1642 | Were met together to rehearse a Play, 1643 | Intended for great Theseus nuptiall day: 1644 | The shallowest thick-skin of that barren sort, 1645 | Who Piramus presented, in their sport, 1646 | Forsooke his Scene, and entred in a brake, 1647 | When I did him at this aduantage take, 1648 | An Asses nole I fixed on his head. 1649 | Anon his Thisbie must be answered, 1650 | And forth my Mimmick comes: when they him spie, 1651 | As Wilde-geese, that the creeping Fowler eye, 1652 | Or russed-pated choughes, many in sort 1653 | (Rising and cawing at the guns report) 1654 | Seuer themselues, and madly sweepe the skye: 1655 | So at his sight, away his fellowes flye, 1656 | And at our stampe, here ore and ore one fals; 1657 | He murther cries, and helpe from Athens cals. 1658 | Their sense thus weake, lost with their feares thus strong, 1659 | Made senslesse things begin to do them wrong. 1660 | For briars and thornes at their apparell snatch, 1661 | Some sleeues, some hats, from yeelders all things catch, 1662 | I led them on in this distracted feare, 1663 | And left sweete Piramus translated there: 1664 | When in that moment (so it came to passe) 1665 | Tytania waked, and straightway lou'd an Asse 1666 | 1667 | Ob. This fals out better then I could deuise: 1668 | But hast thou yet lacht the Athenians eyes, 1669 | With the loue iuyce, as I bid thee doe? 1670 | Rob. I tooke him sleeping (that is finisht to) 1671 | And the Athenian woman by his side, 1672 | That when he wak't, of force she must be eyde. 1673 | Enter Demetrius and Hermia. 1674 | 1675 | Ob. Stand close, this is the same Athenian 1676 | 1677 | Rob. This is the woman, but not this the man 1678 | 1679 | Dem. O why rebuke you him that loues you so? 1680 | Lay breath so bitter on your bitter foe 1681 | 1682 | Her. Now I but chide, but I should vse thee worse. 1683 | For thou (I feare) hast giuen me cause to curse, 1684 | If thou hast slaine Lysander in his sleepe, 1685 | Being oreshooes in bloud, plunge in the deepe, and kill 1686 | me too: 1687 | The Sunne was not so true vnto the day, 1688 | As he to me. Would he haue stollen away, 1689 | From sleeping Hermia? Ile beleeue as soone 1690 | This whole earth may be bord, and that the Moone 1691 | May through the Center creepe, and so displease 1692 | Her brothers noonetide, with th'Antipodes. 1693 | It cannot be but thou hast murdred him, 1694 | So should a murtherer looke, so dead, so grim 1695 | 1696 | Dem. So should the murderer looke, and so should I, 1697 | Pierst through the heart with your stearne cruelty: 1698 | Yet you the murderer lookes as bright as cleare, 1699 | As yonder Venus in her glimmering spheare 1700 | 1701 | Her. What's this to my Lysander? where is he? 1702 | Ah good Demetrius, wilt thou giue him me? 1703 | Dem. I'de rather giue his carkasse to my hounds 1704 | 1705 | Her. Out dog, out cur, thou driu'st me past the bounds 1706 | Of maidens patience. Hast thou slaine him then? 1707 | Henceforth be neuer numbred among men. 1708 | Oh, once tell true, euen for my sake, 1709 | Durst thou a lookt vpon him, being awake? 1710 | And hast thou kill'd him sleeping? O braue tutch: 1711 | Could not a worme, an Adder do so much? 1712 | An Adder did it: for with doubler tongue 1713 | Then thine (thou serpent) neuer Adder stung 1714 | 1715 | Dem. You spend your passion on a mispris'd mood, 1716 | I am not guiltie of Lysanders blood: 1717 | Nor is he dead for ought that I can tell 1718 | 1719 | Her. I pray thee tell me then that he is well 1720 | 1721 | Dem. And if I could, what should I get therefore? 1722 | Her. A priuiledge, neuer to see me more; 1723 | And from thy hated presence part I: see me no more 1724 | Whether he be dead or no. 1725 | Enter. 1726 | 1727 | Dem. There is no following her in this fierce vaine, 1728 | Here therefore for a while I will remaine. 1729 | So sorrowes heauinesse doth heauier grow: 1730 | For debt that bankrout slip doth sorrow owe, 1731 | Which now in some slight measure it will pay, 1732 | If for his tender here I make some stay. 1733 | 1734 | Lie downe. 1735 | 1736 | Ob. What hast thou done? Thou hast mistaken quite 1737 | And laid the loue iuyce on some true loues sight: 1738 | Of thy misprision, must perforce ensue 1739 | Some true loue turn'd, and not a false turn'd true 1740 | 1741 | Rob. Then fate ore-rules, that one man holding troth, 1742 | A million faile, confounding oath on oath 1743 | 1744 | Ob. About the wood, goe swifter then the winde, 1745 | And Helena of Athens looke thou finde. 1746 | All fancy sicke she is, and pale of cheere, 1747 | With sighes of loue, that costs the fresh bloud deare. 1748 | By some illusion see thou bring her heere, 1749 | Ile charme his eyes against she doth appeare 1750 | 1751 | Robin. I go, I go, looke how I goe, 1752 | Swifter then arrow from the Tartars bowe. 1753 | Enter. 1754 | 1755 | Ob. Flower of this purple die, 1756 | Hit with Cupids archery, 1757 | Sinke in apple of his eye, 1758 | When his loue he doth espie, 1759 | Let her shine as gloriously 1760 | As the Venus of the sky. 1761 | When thou wak'st if she be by, 1762 | Beg of her for remedy. 1763 | Enter Pucke. 1764 | 1765 | Puck. Captaine of our Fairy band, 1766 | Helena is heere at hand, 1767 | And the youth, mistooke by me, 1768 | Pleading for a Louers fee. 1769 | Shall we their fond Pageant see? 1770 | Lord, what fooles these mortals be! 1771 | Ob. Stand aside: the noyse they make, 1772 | Will cause Demetrius to awake 1773 | 1774 | Puck. Then will two at once wooe one, 1775 | That must needs be sport alone: 1776 | And those things doe best please me, 1777 | That befall preposterously. 1778 | Enter Lysander and Helena. 1779 | 1780 | Lys. Why should you think y I should wooe in scorn? 1781 | Scorne and derision neuer comes in teares: 1782 | Looke when I vow I weepe; and vowes so borne, 1783 | In their natiuity all truth appeares. 1784 | How can these things in me, seeme scorne to you? 1785 | Bearing the badge of faith to proue them true 1786 | 1787 | Hel. You doe aduance your cunning more & more, 1788 | When truth kils truth, O diuelish holy fray! 1789 | These vowes are Hermias. Will you giue her ore? 1790 | Weigh oath with oath, and you will nothing weigh. 1791 | Your vowes to her, and me, (put in two scales) 1792 | Will euen weigh, and both as light as tales 1793 | 1794 | Lys. I had no iudgement, when to her I swore 1795 | 1796 | Hel. Nor none in my minde, now you giue her ore 1797 | 1798 | Lys. Demetrius loues her, and he loues not you. 1799 | 1800 | Awa. 1801 | 1802 | Dem. O Helen, goddesse, nimph, perfect, diuine, 1803 | To what, my loue, shall I compare thine eyne! 1804 | Christall is muddy, O how ripe in show, 1805 | Thy lips, those kissing cherries, tempting grow! 1806 | That pure congealed white, high Taurus snow, 1807 | Fan'd with the Easterne winde, turnes to a crow, 1808 | When thou holdst vp thy hand. O let me kisse 1809 | This Princesse of pure white, this seale of blisse 1810 | 1811 | Hell. O spight! O hell! I see you are all bent 1812 | To set against me, for your merriment: 1813 | If you were ciuill, and knew curtesie, 1814 | You would not doe me thus much iniury. 1815 | Can you not hate me, as I know you doe, 1816 | But you must ioyne in soules to mocke me to? 1817 | If you are men, as men you are in show, 1818 | You would not vse a gentle Lady so; 1819 | To vow, and sweare, and superpraise my parts, 1820 | When I am sure you hate me with your hearts. 1821 | You both are Riuals, and loue Hermia; 1822 | And now both Riuals to mocke Helena. 1823 | A trim exploit, a manly enterprize, 1824 | To coniure teares vp in a poore maids eyes, 1825 | With your derision; none of noble sort, 1826 | Would so offend a Virgin, and extort 1827 | A poore soules patience, all to make you sport, 1828 | Lysa. You are vnkind Demetrius; be not so, 1829 | For you loue Hermia; this you know I know; 1830 | And here with all good will, with all my heart, 1831 | In Hermias loue I yeeld you vp my part; 1832 | And yours of Helena, To me bequeath, 1833 | Whom I do loue, and will do to my death 1834 | 1835 | Hel. Neuer did mockers wast more idle breth 1836 | 1837 | Dem. Lysander, keep thy Hermia, I will none: 1838 | If ere I lou'd her, all that loue is gone. 1839 | My heart to her, but as guest-wise soiourn'd, 1840 | And now to Helen it is home return'd, 1841 | There to remaine 1842 | 1843 | Lys. It is not so 1844 | 1845 | De. Disparage not the faith thou dost not know, 1846 | Lest to thy perill thou abide it deare. 1847 | Looke where thy Loue comes, yonder is thy deare. 1848 | Enter Hermia. 1849 | 1850 | Her. Dark night, that from the eye his function takes, 1851 | The eare more quicke of apprehension makes, 1852 | Wherein it doth impaire the seeing sense, 1853 | It paies the hearing double recompence. 1854 | Thou art not by mine eye, Lysander found, 1855 | Mine eare (I thanke it) brought me to that sound. 1856 | But why vnkindly didst thou leaue me so? 1857 | Lysan. Why should hee stay whom Loue doth presse to go? 1858 | Her. What loue could presse Lysander from my side? 1859 | Lys. Lysanders loue (that would not let him bide) 1860 | Faire Helena; who more engilds the night, 1861 | Then all yon fierie oes, and eies of light. 1862 | Why seek'st thou me? Could not this make thee know, 1863 | The hate I bare thee, made me leaue thee so? 1864 | Her. You speake not as you thinke; it cannot be 1865 | 1866 | Hel. Loe, she is one of this confederacy, 1867 | Now I perceiue they haue conioyn'd all three, 1868 | To fashion this false sport in spight of me. 1869 | Iniurous Hermia, most vngratefull maid, 1870 | Haue you conspir'd, haue you with these contriu'd 1871 | To baite me, with this foule derision? 1872 | Is all the counsell that we two haue shar'd, 1873 | The sisters vowes, the houres that we haue spent, 1874 | When wee haue chid the hasty footed time, 1875 | For parting vs; O, is all forgot? 1876 | All schooledaies friendship, child-hood innocence? 1877 | We Hermia, like two Artificiall gods, 1878 | Haue with our needles, created both one flower, 1879 | Both on one sampler, sitting on one cushion, 1880 | Both warbling of one song, both in one key: 1881 | As if our hands, our sides, voices, and mindes 1882 | Had beene incorporate. So we grew together, 1883 | Like to a double cherry, seeming parted, 1884 | But yet a vnion in partition, 1885 | Two louely berries molded on one stem, 1886 | So with two seeming bodies, but one heart, 1887 | Two of the first life coats in Heraldry, 1888 | Due but to one and crowned with one crest. 1889 | And will you rent our ancient loue asunder, 1890 | To ioyne with men in scorning your poore friend? 1891 | It is not friendly, 'tis not maidenly. 1892 | Our sexe as well as I, may chide you for it, 1893 | Though I alone doe feele the iniurie 1894 | 1895 | Her. I am amazed at your passionate words, 1896 | I scorne you not; It seemes that you scorne me 1897 | 1898 | Hel. Haue you not set Lysander, as in scorne 1899 | To follow me, and praise my eies and face? 1900 | And made your other loue, Demetrius 1901 | (Who euen but now did spurne me with his foote) 1902 | To call me goddesse, nimph, diuine, and rare, 1903 | Precious, celestiall? Wherefore speakes he this 1904 | To her he hates? and wherefore doth Lysander 1905 | Denie your loue (so rich within his soule) 1906 | And tender me (forsooth) affection, 1907 | But by your setting on, by your consent? 1908 | What though I be not so in grace as you, 1909 | So hung vpon with loue, so fortunate? 1910 | (But miserable most, to loue vnlou'd) 1911 | This you should pittie, rather then despise 1912 | 1913 | Her. I vnderstand not what you meane by this 1914 | 1915 | Hel. I, doe, perseuer, counterfeit sad lookes, 1916 | Make mouthes vpon me when I turne my backe, 1917 | Winke each at other, hold the sweete iest vp: 1918 | This sport well carried, shall be chronicled. 1919 | If you haue any pittie, grace, or manners, 1920 | You would not make me such an argument: 1921 | But fare ye well, 'tis partly mine owne fault, 1922 | Which death or absence soone shall remedie 1923 | 1924 | Lys. Stay gentle Helena, heare my excuse, 1925 | My loue, my life, my soule, faire Helena 1926 | 1927 | Hel. O excellent! 1928 | Her. Sweete, do not scorne her so 1929 | 1930 | Dem. If she cannot entreate, I can compell 1931 | 1932 | Lys. Thou canst compell, no more then she entreate. 1933 | Thy threats haue no more strength then her weak praise. 1934 | Helen, I loue thee, by my life I doe; 1935 | I sweare by that which I will lose for thee, 1936 | To proue him false, that saies I loue thee not 1937 | 1938 | Dem. I say, I loue thee more then he can do 1939 | 1940 | Lys. If thou say so, withdraw and proue it too 1941 | 1942 | Dem. Quick, come 1943 | 1944 | Her. Lysander, whereto tends all this? 1945 | Lys. Away, you Ethiope 1946 | 1947 | Dem. No, no, Sir, seeme to breake loose; 1948 | Take on as you would follow, 1949 | But yet come not: you are a tame man, go 1950 | 1951 | Lys. Hang off thou cat, thou bur; vile thing let loose, 1952 | Or I will shake thee from me like a serpent 1953 | 1954 | Her. Why are you growne so rude? 1955 | What change is this sweete Loue? 1956 | Lys. Thy loue? out tawny Tartar, out; 1957 | Out loathed medicine; O hated poison hence 1958 | 1959 | Her. Do you not iest? 1960 | Hel. Yes sooth, and so do you 1961 | 1962 | Lys. Demetrius: I will keepe my word with thee 1963 | 1964 | Dem. I would I had your bond: for I perceiue 1965 | A weake bond holds you; Ile not trust your word 1966 | 1967 | Lys. What, should I hurt her, strike her, kill her dead? 1968 | Although I hate her, Ile not harme her so 1969 | 1970 | Her. What, can you do me greater harme then hate? 1971 | Hate me, wherefore? O me, what newes my Loue? 1972 | Am not I Hermia? Are not you Lysander? 1973 | I am as faire now, as I was ere while. 1974 | Since night you lou'd me: yet since night you left me. 1975 | Why then you left me (O the gods forbid) 1976 | In earnest, shall I say? 1977 | Lys. I, by my life; 1978 | And neuer did desire to see thee more. 1979 | Therefore be out of hope, of question, of doubt; 1980 | Be certaine, nothing truer: 'tis no iest, 1981 | That I do hate thee, and loue Helena 1982 | 1983 | Her. O me, you iugler, you canker blossome, 1984 | You theefe of loue; What, haue you come by night, 1985 | And stolne my loues heart from him? 1986 | Hel. Fine yfaith: 1987 | Haue you no modesty, no maiden shame, 1988 | No touch of bashfulnesse? What, will you teare 1989 | Impatient answers from my gentle tongue? 1990 | Fie, fie, you counterfeit, you puppet, you 1991 | 1992 | Her. Puppet? why so? I, that way goes the game. 1993 | Now I perceiue that she hath made compare 1994 | Betweene our statures, she hath vrg'd her height, 1995 | And with her personage, her tall personage, 1996 | Her height (forsooth) she hath preuail'd with him. 1997 | And are you growne so high in his esteeme, 1998 | Because I am so dwarfish, and so low? 1999 | How low am I, thou painted May-pole? Speake, 2000 | How low am I? I am not yet so low, 2001 | But that my nailes can reach vnto thine eyes 2002 | 2003 | Hel. I pray you though you mocke me, gentlemen, 2004 | Let her not hurt me; I was neuer curst: 2005 | I haue no gift at all in shrewishnesse; 2006 | I am a right maide for my cowardize; 2007 | Let her not strike me: you perhaps may thinke, 2008 | Because she is something lower then my selfe, 2009 | That I can match her 2010 | 2011 | Her. Lower? harke againe 2012 | 2013 | Hel. Good Hermia, do not be so bitter with me, 2014 | I euermore did loue you Hermia, 2015 | Did euer keepe your counsels, neuer wronged you, 2016 | Saue that in loue vnto Demetrius, 2017 | I told him of your stealth vnto this wood. 2018 | He followed you, for loue I followed him, 2019 | But he hath chid me hence, and threatned me 2020 | To strike me, spurne me, nay to kill me too; 2021 | And now, so you will let me quiet go, 2022 | To Athens will I beare my folly backe, 2023 | And follow you no further. Let me go. 2024 | You see how simple, and how fond I am 2025 | 2026 | Her. Why get you gone: who ist that hinders you? 2027 | Hel. A foolish heart, that I leaue here behinde 2028 | 2029 | Her. What, with Lysander? 2030 | Her. With Demetrius 2031 | 2032 | Lys. Be not afraid, she shall not harme thee Helena 2033 | 2034 | Dem. No sir, she shall not, though you take her part 2035 | 2036 | Hel. O when she's angry, she is keene and shrewd, 2037 | She was a vixen when she went to schoole, 2038 | And though she be but little, she is fierce 2039 | 2040 | Her. Little againe? Nothing but low and little? 2041 | Why will you suffer her to flout me thus? 2042 | Let me come to her 2043 | 2044 | Lys. Get you gone you dwarfe, 2045 | You minimus, of hindring knot-grasse made, 2046 | You bead, you acorne 2047 | 2048 | Dem. You are too officious, 2049 | In her behalfe that scornes your seruices. 2050 | Let her alone, speake not of Helena, 2051 | Take not her part. For if thou dost intend 2052 | Neuer so little shew of loue to her, 2053 | Thou shalt abide it 2054 | 2055 | Lys. Now she holds me not, 2056 | Now follow if thou dar'st, to try whose right, 2057 | Of thine or mine is most in Helena 2058 | 2059 | Dem. Follow? Nay, Ile goe with thee cheeke by 2060 | iowle. 2061 | 2062 | Exit Lysander and Demetrius. 2063 | 2064 | Her. You Mistris, all this coyle is long of you. 2065 | Nay, goe not backe 2066 | 2067 | Hel. I will not trust you I, 2068 | Nor longer stay in your curst companie. 2069 | Your hands then mine, are quicker for a fray, 2070 | My legs are longer though to runne away. 2071 | Enter Oberon and Pucke. 2072 | 2073 | Ob. This is thy negligence, still thou mistak'st, 2074 | Or else committ'st thy knaueries willingly 2075 | 2076 | Puck. Beleeue me, King of shadowes, I mistooke, 2077 | Did not you tell me, I should know the man, 2078 | By the Athenian garments he hath on? 2079 | And so farre blamelesse proues my enterprize, 2080 | That I haue nointed an Athenians eies, 2081 | And so farre am I glad, it so did sort, 2082 | As this their iangling I esteeme a sport 2083 | 2084 | Ob. Thou seest these Louers seeke a place to fight, 2085 | Hie therefore Robin, ouercast the night, 2086 | The starrie Welkin couer thou anon, 2087 | With drooping fogge as blacke as Acheron, 2088 | And lead these testie Riuals so astray, 2089 | As one come not within anothers way. 2090 | Like to Lysander, sometime frame thy tongue, 2091 | Then stirre Demetrius vp with bitter wrong; 2092 | And sometime raile thou like Demetrius; 2093 | And from each other looke thou leade them thus, 2094 | Till ore their browes, death-counterfeiting, sleepe 2095 | With leaden legs, and Battie-wings doth creepe: 2096 | Then crush this hearbe into Lysanders eie, 2097 | Whose liquor hath this vertuous propertie, 2098 | To take from thence all error, with his might, 2099 | and make his eie-bals role with wonted sight. 2100 | When they next wake, all this derision 2101 | Shall seeme a dreame, and fruitless vision, 2102 | And backe to Athens shall the Louers wend 2103 | With league, whose date till death shall neuer end. 2104 | Whiles I in this affaire do thee imploy, 2105 | Ile to my Queene, and beg her Indian Boy; 2106 | And then I will her charmed eie release 2107 | From monsters view, and all things shall be peace 2108 | 2109 | Puck. My Fairie Lord, this must be done with haste, 2110 | For night-swift Dragons cut the Clouds full fast, 2111 | And yonder shines Auroras harbinger; 2112 | At whose approach Ghosts wandring here and there, 2113 | Troope home to Church-yards; damned spirits all, 2114 | That in crosse-waies and flouds haue buriall, 2115 | Alreadie to their wormie beds are gone; 2116 | For feare least day should looke their shames vpon, 2117 | They wilfully themselues exile from light, 2118 | And must for aye consort with blacke browd night 2119 | 2120 | Ob. But we are spirits of another sort: 2121 | I, with the mornings loue haue oft made sport, 2122 | And like a Forrester, the groues may tread, 2123 | Euen till the Easterne gate all fierie red, 2124 | Opening on Neptune, With faire blessed beames, 2125 | Turnes into yellow gold, his salt greene streames. 2126 | But not withstanding haste, make no delay: 2127 | We may effect this businesse, yet ere day 2128 | 2129 | Puck. Vp and downe, vp and downe, I will leade 2130 | them vp and downe: I am fear'd in field and towne. 2131 | Goblin, lead them vp and downe: here comes one. 2132 | Enter Lysander. 2133 | 2134 | Lys. Where art thou, proud Demetrius? 2135 | Speake thou now 2136 | 2137 | Rob. Here villaine, drawne & readie. Where art thou? 2138 | Lys. I will be with thee straight 2139 | 2140 | Rob. Follow me then to plainer ground. 2141 | Enter Demetrius. 2142 | 2143 | Dem. Lysander, speake againe; 2144 | Thou runaway, thou coward, art thou fled? 2145 | Speake in some bush: Where dost thou hide thy head? 2146 | Rob. Thou coward, art thou bragging to the stars, 2147 | Telling the bushes that thou look'st for wars, 2148 | And wilt not come? Come recreant, come thou childe, 2149 | Ile whip thee with a rod. He is defil'd 2150 | That drawes a sword on thee 2151 | 2152 | Dem. Yea, art thou there? 2153 | Ro. Follow my voice, we'l try no manhood here. 2154 | Enter. 2155 | 2156 | Lys. He goes before me, and still dares me on, 2157 | When I come where he cals, then he's gone. 2158 | The Villaine is much lighter heel'd then I: 2159 | I followed fast, but faster he did flye; 2160 | 2161 | shifting places. 2162 | 2163 | That fallen am I in darke vneuen way, 2164 | And here wil rest me. Come thou gentle day: 2165 | 2166 | lye down. 2167 | 2168 | For if but once thou shew me thy gray light, 2169 | Ile finde Demetrius, and reuenge this spight. 2170 | Enter Robin and Demetrius. 2171 | 2172 | Rob. Ho, ho, ho; coward, why com'st thou not? 2173 | Dem. Abide me, if thou dar'st. For well I wot, 2174 | Thou runst before me, shifting euery place, 2175 | And dar'st not stand, nor looke me in the face. 2176 | Where art thou? 2177 | Rob. Come hither, I am here 2178 | 2179 | Dem. Nay then thou mock'st me; thou shalt buy this 2180 | deere, 2181 | If euer I thy face by day-light see. 2182 | Now goe thy way: faintnesse constraineth me, 2183 | To measure out my length on this cold bed, 2184 | By daies approach looke to be visited. 2185 | Enter Helena. 2186 | 2187 | Hel. O weary night, O long and tedious night, 2188 | Abate thy houres, shine comforts from the East, 2189 | That I may backe to Athens by day-light, 2190 | From these that my poore companie detest; 2191 | And sleepe that sometime shuts vp sorrowes eie, 2192 | Steale me a while from mine owne companie. 2193 | 2194 | Sleepe. 2195 | 2196 | Rob. Yet but three? Come one more, 2197 | Two of both kindes makes vp foure. 2198 | Here she comes, curst and sad, 2199 | Cupid is a knauish lad, 2200 | Enter Hermia. 2201 | 2202 | Thus to make poore females mad 2203 | 2204 | Her. Neuer so wearie, neuer so in woe, 2205 | Bedabbled with the dew, and torne with briars, 2206 | I can no further crawle, no further goe; 2207 | My legs can keepe no pace with my desires. 2208 | Here will I rest me till the breake of day, 2209 | Heauens shield Lysander, if they meane a fray 2210 | 2211 | Rob. On the ground sleepe sound, 2212 | Ile apply your eie gentle louer, remedy. 2213 | When thou wak'st, thou tak'st 2214 | True delight in the sight of thy former Ladies eye, 2215 | And the Country Prouerb knowne, 2216 | That euery man should take his owne, 2217 | In your waking shall be showne. 2218 | Iacke shall haue Iill, nought shall goe ill. 2219 | The man shall haue his Mare againe, and all shall bee 2220 | well. 2221 | 2222 | They sleepe all the Act. 2223 | 2224 | 2225 | Actus Quartus. 2226 | 2227 | Enter Queene of Fairies, and Clowne, and Fairies, and the King 2228 | behinde 2229 | them. 2230 | 2231 | Tita. Come, sit thee downe vpon this flowry bed, 2232 | While I thy amiable cheekes doe coy, 2233 | And sticke muske roses in thy sleeke smoothe head, 2234 | And kisse thy faire large eares, my gentle ioy 2235 | 2236 | Clow. Where's Peaseblossome? 2237 | Peas. Ready 2238 | 2239 | Clow. Scratch my head, Pease-blossome. Wher's Mounsieuer 2240 | Cobweb 2241 | 2242 | Cob. Ready 2243 | 2244 | Clowne. Mounsieur Cobweb, good Mounsier get your 2245 | weapons in your hand, & kill me a red hipt humble-Bee, 2246 | on the top of a thistle; and good Mounsieur bring mee 2247 | the hony bag. Doe not fret your selfe too much in the 2248 | action, Mounsieur; and good mounsieur haue a care the 2249 | hony bag breake not, I would be loth to haue you ouerflowne 2250 | with a hony-bag signiour. Where's Mounsieur 2251 | Mustardseed? 2252 | Mus. Ready 2253 | 2254 | Clo. Giue me your neafe, Mounsieur Mustardseed. 2255 | Pray you leaue your courtesie good Mounsieur 2256 | 2257 | Mus. What's your will? 2258 | Clo. Nothing good Mounsieur, but to help Caualery 2259 | Cobweb to scratch. I must to the Barbers Mounsieur, for 2260 | me-thinkes I am maruellous hairy about the face. And I 2261 | am such a tender asse, if my haire do but tickle me, I must 2262 | scratch 2263 | 2264 | Tita. What, wilt thou heare some musicke, my sweet 2265 | loue 2266 | 2267 | Clow. I haue a reasonable good eare in musicke. Let 2268 | vs haue the tongs and the bones. 2269 | 2270 | Musicke Tongs, Rurall Musicke. 2271 | 2272 | Tita. Or say sweete Loue, what thou desirest to eat 2273 | 2274 | Clowne. Truly a pecke of Prouender; I could munch 2275 | your good dry Oates. Me-thinkes I haue a great desire 2276 | to a bottle of hay: good hay, sweete hay hath no fellow 2277 | 2278 | Tita. I haue a venturous Fairy, 2279 | That shall seeke the Squirrels hoard, 2280 | And fetch thee new Nuts 2281 | 2282 | Clown. I had rather haue a handfull or two of dried 2283 | pease. But I pray you let none of your people stirre me, I 2284 | haue an exposition of sleepe come vpon me 2285 | 2286 | Tyta. Sleepe thou, and I will winde thee in my arms, 2287 | Fairies be gone, and be alwaies away. 2288 | So doth the woodbine, the sweet Honisuckle, 2289 | Gently entwist; the female Iuy so 2290 | Enrings the barky fingers of the Elme. 2291 | O how I loue thee! how I dote on thee! 2292 | Enter Robin goodfellow and Oberon. 2293 | 2294 | Ob. Welcome good Robin: 2295 | Seest thou this sweet sight? 2296 | Her dotage now I doe begin to pitty. 2297 | For meeting her of late behinde the wood, 2298 | Seeking sweet sauours for this hatefull foole, 2299 | I did vpbraid her, and fall out with her. 2300 | For she his hairy temples then had rounded, 2301 | With coronet of fresh and fragrant flowers. 2302 | And that same dew which somtime on the buds, 2303 | Was wont to swell like round and orient pearles; 2304 | Stood now within the pretty flouriets eyes, 2305 | Like teares that did their owne disgrace bewaile. 2306 | When I had at my pleasure taunted her, 2307 | And she in milde termes beg'd my patience, 2308 | I then did aske of her, her changeling childe, 2309 | Which straight she gaue me, and her fairy sent 2310 | To beare him to my Bower in Fairy Land. 2311 | And now I haue the Boy, I will vndoe 2312 | This hatefull imperfection of her eyes. 2313 | And gentle Pucke, take this transformed scalpe, 2314 | From off the head of this Athenian swaine; 2315 | That he awaking when the other doe, 2316 | May all to Athens backe againe repaire, 2317 | And thinke no more of this nights accidents, 2318 | But as the fierce vexation of dreame. 2319 | But first I will release the Fairy Queene. 2320 | Be thou as thou wast wont to be; 2321 | See as thou wast wont to see. 2322 | Dians bud, or Cupids flower, 2323 | Hath such force and blessed power. 2324 | Now my Titania wake you my sweet Queene 2325 | 2326 | Tita. My Oberon, what visions haue I seene! 2327 | Me-thought I was enamoured of an asse 2328 | 2329 | Ob. There lies your loue 2330 | 2331 | Tita. How came these things to passe? 2332 | Oh, how mine eyes doth loath this visage now! 2333 | Ob. Silence a while. Robin take off his head: 2334 | Titania, musick call, and strike more dead 2335 | Then common sleepe; of all these, fine the sense 2336 | 2337 | Tita. Musicke, ho musicke, such as charmeth sleepe. 2338 | 2339 | Musick still. 2340 | 2341 | Rob. When thou wak'st, with thine owne fooles eies 2342 | peepe 2343 | 2344 | Ob. Sound musick; come my Queen, take hands with me 2345 | And rocke the ground whereon these sleepers be. 2346 | Now thou and I new in amity, 2347 | And will to morrow midnight, solemnly 2348 | Dance in Duke Theseus house triumphantly, 2349 | And blesse it to all faire posterity. 2350 | There shall the paires of faithfull Louers be 2351 | Wedded, with Theseus, all in iollity 2352 | 2353 | Rob. Faire King attend, and marke, 2354 | I doe heare the morning Larke, 2355 | Ob. Then my Queene in silence sad, 2356 | Trip we after the nights shade; 2357 | We the Globe can compasse soone, 2358 | Swifter then the wandering Moone 2359 | 2360 | Tita. Come my Lord, and in our flight, 2361 | Tell me how it came this night, 2362 | That I sleeping heere was found, 2363 | 2364 | Sleepers Lye still. 2365 | 2366 | With these mortals on the ground. 2367 | 2368 | Exeunt. 2369 | 2370 | Winde Hornes. 2371 | 2372 | Enter Theseus, Egeus, Hippolita and all his traine. 2373 | 2374 | Thes. Goe one of you, finde out the Forrester, 2375 | For now our obseruation is perform'd; 2376 | And since we haue the vaward of the day, 2377 | My Loue shall heare the musicke of my hounds. 2378 | Vncouple in the Westerne valley, let them goe; 2379 | Dispatch I say, and finde the Forrester. 2380 | We will faire Queene, vp to the Mountains top, 2381 | And marke the musicall confusion 2382 | Of hounds and eccho in coniunction 2383 | 2384 | Hip. I was with Hercules and Cadmus once. 2385 | When in a wood of Creete they bayed the Beare 2386 | With hounds of Sparta; neuer did I heare 2387 | Such gallant chiding. For besides the groues, 2388 | The skies, the fountaines, euery region neere, 2389 | Seeme all one mutuall cry. I neuer heard 2390 | So musicall a discord, such sweet thunder 2391 | 2392 | Thes. My hounds are bred out of the Spartan kinde, 2393 | So flew'd, so sanded, and their heads are hung 2394 | With eares that sweepe away the morning dew, 2395 | Crooke kneed, and dew-lapt, like Thessalian Buls, 2396 | Slow in pursuit, but match'd in mouth like bels, 2397 | Each vnder each. A cry more tuneable 2398 | Was neuer hallowed to, nor cheer'd with horne, 2399 | In Creete, in Sparta, nor in Thessaly; 2400 | Iudge when you heare. But soft, what nimphs are these? 2401 | Egeus. My Lord, this is my daughter heere asleepe, 2402 | And this Lysander, this Demetrius is, 2403 | This Helena, olde Nedars Helena, 2404 | I wonder of this being heere together 2405 | 2406 | The. No doubt they rose vp early, to obserue 2407 | The right of May; and hearing our intent, 2408 | Came heere in grace of our solemnity. 2409 | But speake Egeus, is not this the day 2410 | That Hermia should giue answer of her choice? 2411 | Egeus. It is, my Lord 2412 | 2413 | Thes. Goe bid the hunts-men wake them with their 2414 | hornes. 2415 | 2416 | Hornes and they wake. 2417 | 2418 | Shout within, they all start vp. 2419 | 2420 | Thes. Good morrow friends: Saint Valentine is past, 2421 | Begin these wood birds but to couple now? 2422 | Lys. Pardon my Lord 2423 | 2424 | Thes. I pray you all stand vp. 2425 | I know you two are Riuall enemies. 2426 | How comes this gentle concord in the world, 2427 | That hatred is so farre from iealousie, 2428 | To sleepe by hate, and feare no enmity 2429 | 2430 | Lys. My Lord, I shall reply amazedly, 2431 | Halfe sleepe, halfe waking. but as yet, I sweare, 2432 | I cannot truly say how I came heere. 2433 | But as I thinke (for truly would I speake) 2434 | And now I doe bethinke me, so it is; 2435 | I came with Hermia hither. Our intent 2436 | Was to be gone from Athens, where we might be 2437 | Without the perill of the Athenian Law 2438 | 2439 | Ege. Enough, enough, my Lord: you haue enough; 2440 | I beg the Law, the Law, vpon his head: 2441 | They would have stolne away, they would Demetrius, 2442 | Thereby to haue defeated you and me: 2443 | You of your wife, and me of my consent; 2444 | Of my consent, that she should be your wife 2445 | 2446 | Dem. My Lord, faire Helen told me of their stealth, 2447 | Of this their purpose hither, to this wood, 2448 | And I in furie hither followed them; 2449 | Faire Helena, in fancy followed me. 2450 | But my good Lord, I wot not by what not by what power, 2451 | (But by some power it is) my loue 2452 | To Hermia (melted as the snow) 2453 | Seems to me now as the remembrance of an idle gaude, 2454 | Which in my childehood I did doat vpon: 2455 | And all the faith, the vertue of my heart, 2456 | The obiect and the pleasure of mine eye, 2457 | Is onely Helena. To her, my Lord, 2458 | Was I betroth'd, ere I see Hermia, 2459 | But like a sickenesse did I loath this food, 2460 | But as in health, come to my naturall taste, 2461 | Now doe I wish it, loue it, long for it, 2462 | And will for euermore be true to it 2463 | 2464 | Thes. Faire Louers, you are fortunately met; 2465 | Of this discourse we shall heare more anon. 2466 | Egeus, I will ouer-beare your will; 2467 | For in the Temple, by and by with vs, 2468 | These couples shall eternally be knit. 2469 | And for the morning now is something worne, 2470 | Our purpos'd hunting shall be set aside. 2471 | Away, with vs to Athens; three and three, 2472 | Wee'll hold a feast in great solemnitie. 2473 | Come Hippolita. 2474 | 2475 | Exit Duke and Lords. 2476 | 2477 | Dem. These things seeme small & vndistinguishable, 2478 | Like farre off mountaines turned into Clouds 2479 | 2480 | Her. Me-thinks I see these things with parted eye, 2481 | When euery thing seemes double 2482 | 2483 | Hel. So me-thinkes: 2484 | And I haue found Demetrius, like a iewell, 2485 | Mine owne, and not mine owne 2486 | 2487 | Dem. It seemes to mee, 2488 | That yet we sleepe, we dreame. Do not you thinke, 2489 | The Duke was heere, and bid vs follow him? 2490 | Her. Yea, and my Father 2491 | 2492 | Hel. And Hippolita 2493 | 2494 | Lys. And he bid vs follow to the Temple 2495 | 2496 | Dem. Why then we are awake; lets follow him, and 2497 | by the way let vs recount our dreames. 2498 | 2499 | Bottome wakes. 2500 | 2501 | Exit Louers. 2502 | 2503 | Clo. When my cue comes, call me, and I will answer. 2504 | My next is, most faire Piramus. Hey ho. Peter Quince? 2505 | Flute the bellowes-mender? Snout the tinker? Starueling? 2506 | Gods my life! Stolne hence, and left me asleepe: I 2507 | haue had a most rare vision. I had a dreame, past the wit 2508 | of man, to say, what dreame it was. Man is but an Asse, 2509 | if he goe about to expound this dreame. Me-thought I 2510 | was, there is no man can tell what. Me-thought I was, 2511 | and me-thought I had. But man is but a patch'd foole, 2512 | if he will offer to say, what me-thought I had. The eye of 2513 | man hath not heard, the eare of man hath not seen, mans 2514 | hand is not able to taste, his tongue to conceiue, nor his 2515 | heart to report, what my dreame was. I will get Peter 2516 | Quince to write a ballet of this dreame, it shall be called 2517 | Bottomes Dreame, because it hath no bottome; and I will 2518 | sing it in the latter end of a play, before the Duke. Peraduenture, 2519 | to make it the more gracious, I shall sing it 2520 | at her death. 2521 | Enter. 2522 | 2523 | Enter Quince, Flute, Thisbie, Snout, and Starueling. 2524 | 2525 | Quin. Haue you sent to Bottomes house? Is he come 2526 | home yet? 2527 | Staru. He cannot be heard of. Out of doubt hee is 2528 | transported 2529 | 2530 | This. If he come not, then the play is mar'd. It goes 2531 | not forward, doth it? 2532 | Quin. It is not possible: you haue not a man in all 2533 | Athens, able to discharge Piramus but he 2534 | 2535 | This. No, hee hath simply the best wit of any handycraft 2536 | man in Athens 2537 | 2538 | Quin. Yea, and the best person too, and hee is a very 2539 | Paramour, for a sweet voyce 2540 | 2541 | This. You must say, Paragon. A Paramour is (God 2542 | blesse vs) a thing of nought. 2543 | Enter Snug the Ioyner. 2544 | 2545 | Snug. Masters, the Duke is comming from the Temple, 2546 | and there is two or three Lords & Ladies more married. 2547 | If our sport had gone forward, we had all bin made 2548 | men 2549 | 2550 | This. O sweet bully Bottome: thus hath he lost sixepence 2551 | a day, during his life; he could not haue scaped sixpence 2552 | a day. And the Duke had not giuen him sixpence 2553 | a day for playing Piramus, Ile be hang'd. He would haue 2554 | deserued it. Sixpence a day in Piramus, or nothing. 2555 | Enter Bottome. 2556 | 2557 | Bot. Where are these Lads? Where are these hearts? 2558 | Quin. Bottome, o most couragious day! O most happie 2559 | houre! 2560 | Bot. Masters, I am to discourse wonders; but ask me 2561 | not what. For if I tell you, I am no true Athenian. I 2562 | will tell you euery thing as it fell out 2563 | 2564 | Qu. Let vs heare, sweet Bottome 2565 | 2566 | Bot. Not a word of me: all that I will tell you, is, that 2567 | the Duke hath dined. Get your apparell together, good 2568 | strings to your beards, new ribbands to your pumps, 2569 | meete presently at the Palace, euery man looke ore his 2570 | part: for the short and the long is, our play is preferred: 2571 | In any case let Thisby haue cleane linnen: and let not him 2572 | that playes the Lion, paire his nailes, for they shall hang 2573 | out for the Lions clawes. And most deare Actors, eate 2574 | no Onions, nor Garlicke; for wee are to vtter sweete 2575 | breath, and I doe not doubt but to heare them say, it is a 2576 | sweet Comedy. No more words: away, go away. 2577 | 2578 | Exeunt. 2579 | 2580 | 2581 | Actus Quintus. 2582 | 2583 | Enter Theseus, Hippolita, Egeus and his Lords. 2584 | 2585 | Hip. 'Tis strange my Theseus, y these louers speake of 2586 | 2587 | The. More strange then true. I neuer may beleeue 2588 | These anticke fables, nor these Fairy toyes, 2589 | Louers and mad men haue such seething braines, 2590 | Such shaping phantasies, that apprehend more 2591 | Then coole reason euer comprehends. 2592 | The Lunaticke, the Louer, and the Poet, 2593 | Are of imagination all compact. 2594 | One sees more diuels then vaste hell can hold; 2595 | That is the mad man. The Louer, all as franticke, 2596 | Sees Helens beauty in a brow of Egipt. 2597 | The Poets eye in a fine frenzy rolling, doth glance 2598 | From heauen to earth, from earth to heauen. 2599 | And as imagination bodies forth the forms of things 2600 | Vnknowne; the Poets pen turnes them to shapes, 2601 | And giues to aire nothing, a locall habitation, 2602 | And a name. Such tricks hath strong imagination, 2603 | That if it would but apprehend some ioy, 2604 | It comprehends some bringer of that ioy. 2605 | Or in the night, imagining some feare, 2606 | Howe easie is a bush suppos'd a Beare? 2607 | Hip. But all the storie of the night told ouer, 2608 | And all their minds transfigur'd so together, 2609 | More witnesseth than fancies images, 2610 | And growes to something of great constancie; 2611 | But howsoeuer, strange, and admirable. 2612 | Enter louers, Lysander, Demetrius, Hermia, and Helena. 2613 | 2614 | The. Heere come the louers, full of ioy and mirth: 2615 | Ioy, gentle friends, ioy and fresh dayes 2616 | Of loue accompany your hearts 2617 | 2618 | Lys. More then to vs, waite in your royall walkes, 2619 | your boord, your bed 2620 | 2621 | The. Come now, what maskes, what dances shall 2622 | we haue, 2623 | To weare away this long age of three houres, 2624 | Between our after supper, and bed-time? 2625 | Where is our vsuall manager of mirth? 2626 | What Reuels are in hand? Is there no play, 2627 | To ease the anguish of a torturing houre? 2628 | Call Egeus 2629 | 2630 | Ege. Heere mighty Theseus 2631 | 2632 | The. Say, what abridgement haue you for this euening? 2633 | What maske? What musicke? How shall we beguile 2634 | The lazie time, if not with some delight? 2635 | Ege. There is a breefe how many sports are rife: 2636 | Make choise of which your Highnesse will see first 2637 | 2638 | Lis. The battell with the Centaurs to be sung 2639 | By an Athenian Eunuch, to the Harpe 2640 | 2641 | The. Wee'l none of that. That haue I told my Loue 2642 | In glory of my kinsman Hercules 2643 | 2644 | Lis. The riot of the tipsie Bachanals, 2645 | Tearing the Thracian singer, in their rage? 2646 | The. That is an old deuice, and it was plaid 2647 | When I from Thebes came last a Conqueror 2648 | 2649 | Lis. The thrice three Muses, mourning for the death 2650 | of learning, late deceast in beggerie 2651 | 2652 | The. That is some Satire keene and criticall, 2653 | Not sorting with a nuptiall ceremonie 2654 | 2655 | Lis. A tedious breefe Scene of yong Piramus, 2656 | And his loue Thisby; very tragicall mirth 2657 | 2658 | The. Merry and tragicall? Tedious, and briefe? That 2659 | is, hot ice, and wondrous strange snow. How shall wee 2660 | finde the concord of this discord? 2661 | Ege. A play there is, my Lord, some ten words long, 2662 | Which is as breefe, as I haue knowne a play; 2663 | But by ten words, my Lord, it is too long; 2664 | Which makes it tedious. For in all the play, 2665 | There is not one word apt, one Player fitted. 2666 | And tragicall my noble Lord it is: for Piramus 2667 | Therein doth kill himselfe. Which when I saw 2668 | Rehearst, I must confesse, made mine eyes water: 2669 | But more merrie teares, the passion of loud laughter 2670 | Neuer shed 2671 | 2672 | Thes. What are they that do play it? 2673 | Ege. Hard handed men, that worke in Athens heere, 2674 | Which neuer labour'd in their mindes till now; 2675 | And now haue toyled their vnbreathed memories 2676 | With this same play, against your nuptiall 2677 | 2678 | The. And we will heare it 2679 | 2680 | Hip. No my noble Lord, it is not for you. I haue heard 2681 | It ouer, and it is nothing, nothing in the world; 2682 | Vnless you can finde sport in their intents, 2683 | Extreamely stretched, and cond with cruell paine, 2684 | To doe you seruice 2685 | 2686 | Thes. I will heare that play. For neuer any thing 2687 | Can be amisse, when simplenesse and duty tender it. 2688 | Goe bring them in, and take your places, Ladies 2689 | 2690 | Hip. I loue not to see wretchednesse orecharged; 2691 | And duty in his seruice perishing 2692 | 2693 | Thes. Why gentle sweet, you shall see no such thing 2694 | 2695 | Hip. He saies, they can doe nothing in this kinde 2696 | 2697 | Thes. The kinder we, to giue them thanks for nothing 2698 | Our sport shall be, to take what they mistake; 2699 | And what poore duty cannot doe, noble respect 2700 | Takes it in might, not merit. 2701 | Where I haue come, great Clearkes haue purposed 2702 | To greete me with premeditated welcomes; 2703 | Where I haue seene them shiuer and looke pale, 2704 | Make periods in the midst of sentences, 2705 | Throttle their practiz'd accent in their feares, 2706 | And in conclusion, dumbly haue broke off, 2707 | Not paying me a welcome. Trust me sweete, 2708 | Out of this silence yet, I pickt a welcome: 2709 | And in the modesty of fearefull duty, 2710 | I read as much, as from the ratling tongue 2711 | Of saucy and audacious eloquence. 2712 | Loue therefore, and tongue-tide simplicity, 2713 | In least, speake most, to my capacity 2714 | 2715 | Egeus. So please your Grace, the Prologue is addrest 2716 | 2717 | Duke. Let him approach. 2718 | 2719 | Flor. Trum. 2720 | 2721 | Enter the Prologue. Quince. 2722 | 2723 | Pro. If we offend, it is with our good will. 2724 | That you should thinke, we come not to offend, 2725 | But with good will. To shew our simple skill, 2726 | That is the true beginning of our end. 2727 | Consider then, we come but in despight. 2728 | We do not come, as minding to content you, 2729 | Our true intent is. All for your delight, 2730 | We are not heere. That you should here repent you, 2731 | The Actors are at hand; and by their show, 2732 | You shall know all, that you are like to know 2733 | 2734 | Thes. This fellow doth not stand vpon points 2735 | 2736 | Lys. He hath rid his Prologue, like a rough Colt: he 2737 | knowes not the stop. A good morall my lord. it is not 2738 | enough to speake, but to speake true 2739 | 2740 | Hip. Indeed hee hath plaid on his Prologue, like a 2741 | childe on a Recorder, a sound, but not in gouernment 2742 | 2743 | Thes. His speech was like a tangled chaine: nothing 2744 | impaired, but all disordered. Who is next? 2745 | 2746 | Tawyer with a Trumpet before them. 2747 | 2748 | Enter Pyramus and Thisby, Wall, Moone-shine, and Lyon. 2749 | 2750 | Prol. Gentles, perchance you wonder at this show, 2751 | But wonder on, till truth make all things plaine. 2752 | This man is Piramus, if you would know; 2753 | This beauteous Lady, Thisby is certaine. 2754 | This man, with lyme and rough-cast, doth present 2755 | Wall, that vile wall, which did these louers sunder: 2756 | And through walls chink (poor soules) they are content 2757 | To whisper. At the which, let no man wonder. 2758 | This man, with Lanthorne, dog, and bush of thorne, 2759 | Presenteth moone-shine. For if you will know, 2760 | By moone-shine did these Louers thinke no scorne 2761 | To meet at Ninus toombe, there, there to wooe: 2762 | This grizly beast (which Lyon hight by name) 2763 | The trusty Thisby, comming first by night, 2764 | Did scarre away, or rather did affright: 2765 | And as she fled, her mantle she did fall; 2766 | Which Lyon vile with bloody mouth did staine. 2767 | Anon comes Piramus, sweet youth and tall, 2768 | And findes his Thisbies Mantle slaine; 2769 | Whereat, with blade, with bloody blamefull blade, 2770 | He brauely broacht his boiling bloudy breast, 2771 | And Thisby, tarrying in Mulberry shade, 2772 | His dagger drew, and died. For all the rest, 2773 | Let Lyon, Moone-shine, Wall, and Louers twaine, 2774 | At large discourse, while here they doe remaine. 2775 | 2776 | Exit all but Wall. 2777 | 2778 | Thes. I wonder if the Lion be to speake 2779 | 2780 | Deme. No wonder, my Lord: one Lion may, when 2781 | many Asses doe. 2782 | 2783 | Exit Lyon, Thisbie, and Mooneshine. 2784 | 2785 | Wall. In this same Interlude, it doth befall, 2786 | That I, one Snowt (by name) present a wall: 2787 | And such a wall, as I would haue you thinke, 2788 | That had in it a crannied hole or chinke: 2789 | Through which the Louers, Piramus and Thisbie 2790 | Did whisper often, very secretly. 2791 | This loame, this rough-cast, and this stone doth shew, 2792 | That I am that same Wall; the truth is so. 2793 | And this the cranny is, right and sinister, 2794 | Through which the fearfull Louers are to whisper 2795 | 2796 | Thes. Would you desire Lime and Haire to speake 2797 | better? 2798 | Deme. It is the wittiest partition, that euer I heard 2799 | discourse, my Lord 2800 | 2801 | Thes. Pyramus drawes neere the Wall, silence. 2802 | Enter Pyramus. 2803 | 2804 | Pir. O grim lookt night, o night with hue so blacke, 2805 | O night, which euer art, when day is not: 2806 | O night, o night, alacke, alacke, alacke, 2807 | I feare my Thisbies promise is forgot. 2808 | And thou o wall, thou sweet and louely wall, 2809 | That stands between her fathers ground and mine, 2810 | Thou wall, o Wall, o sweet and louely wall, 2811 | Shew me thy chinke, to blinke through with mine eine. 2812 | Thankes courteous wall. Ioue shield thee well for this. 2813 | But what see I? No Thisbie doe I see. 2814 | O wicked wall, through whom I see no blisse, 2815 | Curst be thy stones for thus deceiuing mee 2816 | 2817 | Thes. The wall me-thinkes being sensible, should 2818 | curse againe 2819 | 2820 | Pir. No in truth sir, he should not. Deceiuing me, 2821 | Is Thisbies cue; she is to enter, and I am to spy 2822 | Her through the wall. You shall see it will fall. 2823 | Enter Thisbie. 2824 | 2825 | Pat as I told you; yonder she comes 2826 | 2827 | This. O wall, full often hast thou heard my mones, 2828 | For parting my faire Piramus, and me 2829 | My cherry lips haue often kist thy stones; 2830 | Thy stones with Lime and Haire knit vp in thee 2831 | 2832 | Pyra. I see a voyce; now will I to the chinke, 2833 | To spy and I can heare my Thisbies face. Thisbie? 2834 | This. My Loue thou art, my Loue I thinke 2835 | 2836 | Pir. Thinke what thou wilt, I am thy Louers grace, 2837 | And like Limander am I trusty still 2838 | 2839 | This. And like Helen till the Fates me kill 2840 | 2841 | Pir. Not Shafalus to Procrus was so true 2842 | 2843 | This. As Shafalus to Procrus, I to you 2844 | 2845 | Pir. O kisse me through the hole of this vile wall 2846 | 2847 | This. I kisse the wals hole, not your lips at all 2848 | 2849 | Pir. Wilt thou at Ninnies tombe meete me straight 2850 | way? 2851 | This. Tide life, tide death, I come without delay 2852 | 2853 | Wall. Thus haue I Wall, my part discharged so; 2854 | And being done, thus Wall away doth go. 2855 | 2856 | Exit Clow. 2857 | 2858 | Du. Now is the morall downe between the two 2859 | Neighbours 2860 | 2861 | Dem. No remedie my Lord, when Wals are so wilfull, 2862 | to heare without warning 2863 | 2864 | Dut. This is the silliest stuffe that ere I heard 2865 | 2866 | Du. The best in this kind are but shadowes, and the 2867 | worst are no worse, if imagination amend them 2868 | 2869 | Dut. It must be your imagination then, & not theirs 2870 | 2871 | Duk. If wee imagine no worse of them then they of 2872 | themselues, they may passe for excellent men. Here com 2873 | two noble beasts, in a man and a Lion. 2874 | Enter Lyon and Moone-shine 2875 | 2876 | Lyon. You Ladies, you (whose gentle harts do feare 2877 | The smallest monstrous mouse that creepes on floore) 2878 | May now perchance, both quake and tremble heere, 2879 | When Lion rough in wildest rage doth roare. 2880 | Then know that I, one Snug the Ioyner am 2881 | A Lion fell, nor else no Lions dam: 2882 | For if I should as Lion come in strife 2883 | Into this place, 'twere pittie of my life 2884 | 2885 | Du. A verie gentle beast, and of good conscience 2886 | 2887 | Dem. The verie best at a beast, my Lord, y ere I saw 2888 | 2889 | Lis. This Lion is a verie Fox for his valor 2890 | 2891 | Du. True, and a Goose for his discretion 2892 | 2893 | Dem. Not so my Lord: for his valor cannot carrie 2894 | his discretion, and the fox carries the Goose 2895 | 2896 | Du. His discretion I am sure cannot carrie his valor: 2897 | for the Goose carries not the Fox. It is well; leaue it to 2898 | his discretion, and let vs hearken to the Moone 2899 | 2900 | Moone. This Lanthorne doth the horned Moone present 2901 | 2902 | De. He should haue worne the hornes on his head 2903 | 2904 | Du. Hee is no crescent, and his hornes are inuisible, 2905 | within the circumference 2906 | 2907 | Moon. This lanthorne doth the horned Moone present: 2908 | My selfe, the man i'th Moone doth seeme to be 2909 | 2910 | Du. This is the greatest error of all the rest; the man 2911 | Should be put into the Lanthorne. How is it els the man 2912 | i'th Moone? 2913 | Dem. He dares not come there for the candle. 2914 | For you see, it is already in snuffe 2915 | 2916 | Dut. I am wearie of this Moone; would he would 2917 | change 2918 | 2919 | Du. It appeares by his smal light of discretion, that 2920 | he is in the wane: but yet in courtesie, in all reason, we 2921 | must stay the time 2922 | 2923 | Lys. Proceed Moone 2924 | 2925 | Moon. All that I haue to say, is to tell you, that the 2926 | Lanthorne is the Moone; I, the man in the Moone; this 2927 | thorne bush; my thorne bush; and this dog, my dog 2928 | 2929 | Dem. Why all these should be in the Lanthorne: for 2930 | they are in the Moone. But silence, heere comes Thisby. 2931 | Enter Thisby. 2932 | 2933 | This. This is old Ninnies tombe: where is my loue? 2934 | Lyon. Oh. 2935 | 2936 | The Lion roares, Thisby runs off. 2937 | 2938 | Dem. Well roar'd Lion 2939 | 2940 | Du. Well run Thisby 2941 | 2942 | Dut. Well shone Moone. 2943 | Truly the Moone shines with a good grace 2944 | 2945 | Du. Wel mouz'd Lion 2946 | 2947 | Dem. And then came Piramus 2948 | 2949 | Lys. And so the Lion vanisht. 2950 | Enter Piramus. 2951 | 2952 | Pyr. Sweet Moone, I thank thee for thy sunny beames, 2953 | I thanke thee Moone, for shining now so bright: 2954 | For by thy gracious, golden, glittering beames, 2955 | I trust to taste of truest Thisbies sight. 2956 | But stay: O spight! but marke, poore Knight, 2957 | What dreadful dole is heere? 2958 | Eyes do you see! How can it be! 2959 | O dainty Ducke: O Deere! 2960 | Thy mantle good; what staind with blood! 2961 | Approch you furies fell: 2962 | O Fates! come, come: Cut thred and thrum, 2963 | Quaile, crush, conclude, and quell 2964 | 2965 | Du. This passion, and the death of a deare friend, 2966 | Would go neere to make a man looke sad 2967 | 2968 | Dut. Beshrew my heart, but I pittie the man 2969 | 2970 | Pir. O wherefore Nature, did'st thou Lions frame? 2971 | Since lion vilde hath heere deflour'd my deere: 2972 | Which is: no, no, which was the fairest Dame 2973 | That liu'd, that lou'd, that like'd, that look'd with cheere. 2974 | Come teares, confound: Out sword, and wound 2975 | The pap of Piramus: 2976 | I, that left pap, where heart doth hop; 2977 | Thus dye I, thus, thus, thus. 2978 | Now am I dead, now am I fled, my soule is in the sky, 2979 | Tongue lose thy light, Moone take thy flight, 2980 | Now dye, dye, dye, dye, dye 2981 | 2982 | Dem. No Die, but an ace for him; for he is but one 2983 | 2984 | Lis. Lesse then an ace man. For he is dead, he is nothing 2985 | 2986 | Du. With the helpe of a Surgeon, he might yet recouer, 2987 | and proue an Asse 2988 | 2989 | Dut. How chance Moone-shine is gone before? 2990 | Thisby comes backe, and findes her Louer. 2991 | Enter Thisby. 2992 | 2993 | Duke. She wil finde him by starre-light. 2994 | Heere she comes, and her passion ends the play 2995 | 2996 | Dut. Me thinkes shee should not vse a long one for 2997 | such a Piramus: I hope she will be breefe 2998 | 2999 | Dem. A Moth wil turne the ballance, which Piramus 3000 | which Thisby is the better 3001 | 3002 | Lys. She hath spyed him already, with those sweete eyes 3003 | 3004 | Dem. And thus she meanes, videlicit 3005 | 3006 | This. Asleepe my Loue? What, dead my Doue? 3007 | O Piramus arise: 3008 | Speake, speake. Quite dumbe? Dead, dead? A tombe 3009 | Must couer thy sweet eyes. 3010 | These Lilly Lips, this cherry nose, 3011 | These yellow Cowslip cheekes 3012 | Are gone, are gone: Louers make mone: 3013 | His eyes were greene as Leekes. 3014 | O Sisters three, come, come to mee, 3015 | With hands as pale as Milke, 3016 | Lay them in gore, since you haue shore 3017 | with sheeres, his thred of silke. 3018 | Tongue not a word: Come trusty sword: 3019 | Come blade, my brest imbrue: 3020 | And farwell friends, thus Thisbie ends; 3021 | Adieu, adieu, adieu 3022 | 3023 | Duk. Moone-shine & Lion are left to burie the dead 3024 | 3025 | Deme. I, and Wall too 3026 | 3027 | Bot. No, I assure you, the wall is downe, that parted 3028 | their Fathers. Will it please you to see the Epilogue, or 3029 | to heare a Bergomask dance, betweene two of our company? 3030 | Duk. No Epilogue, I pray you; for your play needs 3031 | no excuse. Neuer excuse; for when the plaiers are all 3032 | dead, there need none to be blamed. Marry, if hee that 3033 | writ it had plaid Piramus, and hung himselfe in Thisbies 3034 | garter, it would haue beene a fine Tragedy: and so it is 3035 | truely, and very notably discharg'd. but come, your 3036 | Burgomaske; let your Epilogue alone. 3037 | The iron tongue of midnight hath told twelue. 3038 | Louers to bed, 'tis almost Fairy time. 3039 | I feare we shall out-sleepe the comming morne, 3040 | As much as we this night haue ouer-watcht. 3041 | This palpable grosse play hath well beguil'd 3042 | The heauy gate of night. Sweet friends to bed. 3043 | A fortnight hold we this solemnity. 3044 | In nightly Reuels; and new iollitie. 3045 | 3046 | Exeunt. 3047 | 3048 | Enter Pucke. 3049 | 3050 | Puck. Now the hungry Lyons rores, 3051 | And the Wolfe beholds the Moone: 3052 | Whilest the heauy ploughman snores, 3053 | All with weary taske fore-done. 3054 | Now the wasted brands doe glow, 3055 | Whil'st the scritch-owle, scritching loud, 3056 | Puts the wretch that lies in woe, 3057 | In remembrance of a shrowd. 3058 | Now it is the time of night, 3059 | That the graues, all gaping wide, 3060 | Euery one lets forth his spright, 3061 | In the Church-way paths to glide, 3062 | And we Fairies, that do runne, 3063 | By the triple Hecates teame, 3064 | From the presence of the Sunne, 3065 | Following darkenesse like a dreame, 3066 | Now are frollicke; not a Mouse 3067 | Shall disturbe this hallowed house. 3068 | I am sent with broome before, 3069 | To sweep the dust behinde the doore. 3070 | Enter King and Queene of Fairies, with their traine. 3071 | 3072 | Ob. Through the house giue glimmering light, 3073 | By the dead and drowsie fier, 3074 | Euerie Elfe and Fairie spright, 3075 | Hop as light as bird from brier, 3076 | And this Ditty after me, sing and dance it trippinglie, 3077 | Tita. First rehearse this song by roate, 3078 | To each word a warbling note. 3079 | Hand in hand, with Fairie grace, 3080 | Will we sing and blesse this place. 3081 | 3082 | The Song. 3083 | 3084 | Now vntill the breake of day, 3085 | Through this house each Fairy stray. 3086 | To the best Bride-bed will we, 3087 | Which by vs shall blessed be: 3088 | And the issue there create, 3089 | Euer shall be fortunate: 3090 | So shall all the couples three, 3091 | Euer true in louing be: 3092 | And the blots of Natures hand, 3093 | Shall not in their issue stand. 3094 | Neuer mole, harelip, nor scarre, 3095 | nor mark prodigious, such as are 3096 | Despised in Natiuitie, 3097 | Shall vpon their children be. 3098 | With this field dew consecrate, 3099 | Euery Fairy take his gate, 3100 | And each seuerall chamber blesse, 3101 | Through this Pallace with sweet peace, 3102 | Euer shall in safety rest. 3103 | And the owner of it blest. 3104 | Trip away, make no stay; 3105 | Meet me all by breake of day 3106 | 3107 | Robin. If we shadowes haue offended, 3108 | Thinke but this (and all is mended) 3109 | That you haue but slumbred heere, 3110 | While these Visions did appeare. 3111 | And this weake and idle theame, 3112 | No more yeelding but a dreame, 3113 | Gentles, doe not reprehend. 3114 | If you pardon, we will mend. 3115 | And as I am an honest Pucke, 3116 | If we haue vnearned lucke, 3117 | Now to scape the Serpents tongue, 3118 | We will make amends ere long: 3119 | Else the Pucke a lyar call. 3120 | So good night vnto you all. 3121 | Giue me your hands, if we be friends, 3122 | And Robin shall restore amends. 3123 | 3124 | FINIS. A MIDSOMMER Nights Dreame. 3125 | -------------------------------------------------------------------------------- /res/nice.shakespeare.txt: -------------------------------------------------------------------------------- 1 | She should have died hereafter; 2 | There would have been a time for such a word. 3 | Tomorrow, and tomorrow, and tomorrow 4 | Creeps in this petty pace from day to day 5 | To the last syllable of recorded time; 6 | And all our yesterdays have lighted fools 7 | The way to dusty death. Out, out, brief candle! 8 | Life's but a walking shadow, a poor player 9 | That struts and frets his hour upon the stage 10 | And then is heard no more. It is a tale 11 | Told by an idiot, full of sound and fury, 12 | Signifying nothing. 13 | -------------------------------------------------------------------------------- /res/test.txt: -------------------------------------------------------------------------------- 1 | A_DEAD_DAD_CEDED_A_BAD_BABE_A_BEADED_ABACA_BED 2 | -------------------------------------------------------------------------------- /src/decode.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | const Allocator = std.mem.Allocator; 4 | const print_progress = @import("progress_bar.zig").print_progress; 5 | const format_file_size = @import("utils.zig").format_file_size; 6 | 7 | pub const DecodeFlags = struct { 8 | write_output: bool = false, 9 | print_output: bool = false, 10 | debug: bool = false, 11 | }; 12 | 13 | pub fn decode(allocator: Allocator, compressed_text: []const u8, out_writer: anytype, std_out: std.fs.File, flags: DecodeFlags) !usize { 14 | var bytes_written: u32 = 0; 15 | const start_time = std.time.microTimestamp(); 16 | defer if (flags.debug) std_out.writer().print("time taken: {d}μs\n", .{std.time.microTimestamp() - 17 | start_time}) catch {}; 18 | 19 | var decoding_progress: usize = 0; 20 | var decoding_state_msg: []const u8 = "Decoding file..."; 21 | 22 | var print_progress_thread: ?std.Thread = null; 23 | if (!flags.print_output) { 24 | print_progress_thread = try std.Thread.spawn(.{}, print_progress, .{ 1, &decoding_progress, &decoding_state_msg }); 25 | } 26 | 27 | decoding_progress = 5; 28 | decoding_state_msg = "Reading file header..."; 29 | 30 | var reading_dict_letter: bool = true; 31 | var reading_dict_code_len: bool = false; 32 | var reading_dict_code: bool = false; 33 | 34 | const decode_dictionary_length: u8 = compressed_text[0] + 1; 35 | 36 | var decode_body_length: u32 = compressed_text[1]; 37 | decode_body_length <<= 8; 38 | decode_body_length |= compressed_text[2]; 39 | decode_body_length <<= 8; 40 | decode_body_length |= compressed_text[3]; 41 | decode_body_length <<= 8; 42 | decode_body_length |= compressed_text[4]; 43 | 44 | var longest_code: u8 = 0; 45 | var shortest_code: usize = std.math.maxInt(usize); 46 | 47 | // value is an array of symbols of same integer value indexed by code length 48 | // (allows for distinguishing between 00 and 000 for example) 49 | var decode_table = std.AutoHashMap(usize, [32]u8).init( 50 | allocator, 51 | ); 52 | defer decode_table.deinit(); 53 | 54 | var current_letter: u8 = 0; 55 | var current_code_length: u8 = 0; 56 | var current_code_data: usize = 0; 57 | 58 | decoding_progress = 10; 59 | decoding_state_msg = "Reading prefix code dictionary..."; 60 | 61 | var global_pos: usize = 0; 62 | var pos: usize = 0; // bit pos in byte 63 | var build_bits: usize = 0b0; 64 | var i: usize = 0; // bit pos in current read 65 | var letters_read: u8 = 0; 66 | for (compressed_text[5..]) |byte| { 67 | pos = 0; 68 | 69 | read: while (true) { 70 | if (reading_dict_letter) { 71 | while (i <= 7) { 72 | if (pos > 7) break :read; 73 | build_bits <<= 1; 74 | build_bits |= (byte >> @as(u3, @truncate(7 - pos))) & 1; 75 | pos += 1; 76 | i += 1; 77 | } 78 | 79 | current_letter = @as(u8, @truncate(build_bits)); 80 | 81 | reading_dict_letter = false; 82 | reading_dict_code_len = true; 83 | 84 | build_bits = 0b0; 85 | i = 0; 86 | } 87 | 88 | if (reading_dict_code_len) { 89 | while (i <= 7) { 90 | if (pos > 7) break :read; 91 | build_bits <<= 1; 92 | build_bits |= (byte >> @as(u3, @truncate(7 - pos))) & 1; 93 | pos += 1; 94 | i += 1; 95 | } 96 | 97 | current_code_length = @as(u8, @truncate(build_bits)); 98 | 99 | if (current_code_length > longest_code) longest_code = current_code_length; 100 | if (current_code_length < shortest_code) shortest_code = current_code_length; 101 | 102 | reading_dict_code_len = false; 103 | reading_dict_code = true; 104 | 105 | build_bits = 0b0; 106 | i = 0; 107 | } 108 | 109 | if (reading_dict_code) { 110 | while (i < current_code_length) { 111 | if (pos > 7) break :read; 112 | build_bits <<= 1; 113 | build_bits |= (byte >> @as(u3, @truncate(7 - pos))) & 1; 114 | 115 | pos += 1; 116 | i += 1; 117 | } 118 | 119 | current_code_data = build_bits; 120 | 121 | // if table has code add another letter to entry orelse 122 | // add new entry with new letter 123 | var decode_entry = decode_table.get(current_code_data) orelse [_]u8{0} ** 32; 124 | decode_entry[current_code_length - 1] = current_letter; 125 | try decode_table.put(current_code_data, decode_entry); 126 | 127 | letters_read += 1; 128 | 129 | reading_dict_code = false; 130 | reading_dict_letter = true; 131 | 132 | build_bits = 0b0; 133 | i = 0; 134 | } 135 | } 136 | global_pos += 1; 137 | 138 | if (letters_read == decode_dictionary_length) { 139 | break; 140 | } 141 | } 142 | 143 | var window: u32 = 0; 144 | var window_len: usize = 0; 145 | var checking_code_len: usize = 2; 146 | var testing_code: usize = 0; 147 | var decoded_letters_read: usize = 0; 148 | 149 | decoding_progress = 20; 150 | decoding_state_msg = "Decoding text..."; 151 | 152 | const decoding_sections = 30; 153 | for (0..decoding_sections) |s| { 154 | decoding_progress = 30 + (100 - 30) * s / decoding_sections; 155 | 156 | const body_start = 5 + global_pos; 157 | const body_length = compressed_text.len - body_start; 158 | 159 | for (compressed_text[body_start + s * body_length / decoding_sections .. body_start + (s + 1) * body_length / decoding_sections]) |byte| { 160 | // for (compressed_text[5 + global_pos ..]) |byte| { 161 | window <<= 8; 162 | window |= byte; 163 | window_len += 8; 164 | 165 | // while there are potential matches in window 166 | decode_text: while (window_len >= longest_code) { 167 | // loop through all possible code lengths, checking start of window for match 168 | checking_code_len = shortest_code; 169 | while (window_len >= checking_code_len) { 170 | if (decoded_letters_read >= decode_body_length or 171 | window_len < checking_code_len) 172 | { 173 | break :decode_text; 174 | } 175 | 176 | testing_code = window & 177 | ((@as(u32, 0b1) << @as(u5, @truncate(checking_code_len))) - 1) << @as(u5, @truncate(window_len - checking_code_len)); 178 | 179 | testing_code >>= @as(u6, @truncate(window_len - checking_code_len)); 180 | 181 | if (decode_table.get(testing_code)) |entry| { 182 | if (entry[checking_code_len - 1] > 0) { 183 | const c = entry[checking_code_len - 1]; 184 | 185 | if (flags.write_output) { 186 | try out_writer.writeByte(c); 187 | bytes_written += 1; 188 | } 189 | if (flags.print_output) try std_out.writer().print("{c}", .{c}); 190 | 191 | decoded_letters_read += 1; 192 | 193 | window = window & ((@as(u32, 0b1) << 194 | @as(u5, @truncate(window_len - checking_code_len))) - 1); 195 | window_len -= checking_code_len; 196 | checking_code_len = shortest_code; 197 | } 198 | } 199 | checking_code_len += 1; 200 | } 201 | } 202 | } 203 | } 204 | 205 | if (!flags.print_output) { 206 | decoding_progress = 100; 207 | decoding_state_msg = "Done decompressing!"; 208 | print_progress_thread.?.join(); 209 | } 210 | 211 | const formatted_original_size = format_file_size(allocator, @floatFromInt(compressed_text.len)) catch unreachable; 212 | defer allocator.free(formatted_original_size); 213 | 214 | const formatted_decompressed_size = format_file_size(allocator, @floatFromInt(bytes_written)) catch unreachable; 215 | defer allocator.free(formatted_decompressed_size); 216 | 217 | std.debug.print("{s} => {s}\n", .{ formatted_original_size, formatted_decompressed_size }); 218 | 219 | return bytes_written; 220 | } 221 | -------------------------------------------------------------------------------- /src/encode.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | const Queue = @import("queue.zig").Queue; 4 | const print_progress = @import("progress_bar.zig").print_progress; 5 | const format_file_size = @import("utils.zig").format_file_size; 6 | 7 | const Allocator = std.mem.Allocator; 8 | 9 | pub const EncodeFlags = packed struct { 10 | write_output: bool = false, 11 | print_output: bool = false, 12 | debug: bool = false, 13 | _padding: u30 = 0, 14 | }; 15 | 16 | const Node = struct { 17 | symbol: ?u8, 18 | weight: usize, 19 | parent: ?*Node, 20 | left: ?*Node, 21 | right: ?*Node, 22 | visited: bool, 23 | }; 24 | 25 | pub fn encode(allocator: Allocator, text: []const u8, out_writer: anytype, std_out: std.fs.File, flags: EncodeFlags) !usize { 26 | const start_time = std.time.microTimestamp(); 27 | defer if (flags.debug) std_out.writer().print("time taken: {d}μs\n", .{std.time.microTimestamp() - 28 | start_time}) catch {}; 29 | 30 | var encoding_progress: usize = 0; 31 | var encoding_state_msg: []const u8 = "Encoding file..."; 32 | 33 | var print_progress_thread: ?std.Thread = null; 34 | // TODO: Make progress bar work with debug flag 35 | if (!flags.print_output and !flags.debug) { 36 | print_progress_thread = try std.Thread.spawn(.{}, print_progress, .{ 0, &encoding_progress, &encoding_state_msg }); 37 | } 38 | 39 | encoding_progress = 10; 40 | encoding_state_msg = "Counting characters..."; 41 | 42 | // array where index is the ascii char and value is number of occurences 43 | var occurences_book = [_]usize{0} ** 256; 44 | 45 | for (text) |c| { 46 | occurences_book[c] += 1; 47 | } 48 | 49 | encoding_progress = 20; 50 | encoding_state_msg = "Sorting characters..."; 51 | 52 | // an array of ascii chars sorted from least to most frequent then 53 | // alphabetically, 0 occurence ascii chars at the end 54 | var sorted_letter_book = [_]u8{0} ** 256; 55 | 56 | // simple custom sort, <256 passes, ~100 microseconds 57 | var book_index: u8 = 0; 58 | var min_value: usize = 1; 59 | var next_min_value: usize = 0; 60 | while (next_min_value != std.math.maxInt(usize)) { 61 | next_min_value = std.math.maxInt(usize); 62 | for (occurences_book, 0..) |occurences, char_code| { 63 | if (occurences < next_min_value and occurences > min_value) { 64 | next_min_value = occurences; 65 | } 66 | // occurences is definitionally sorted in ASCII alphabetical order 67 | // so ties (different char_codes with same occurences) with be resolved alphabetically 68 | if (occurences == min_value) { 69 | sorted_letter_book[book_index] = @intCast(char_code); 70 | if (book_index < 255) book_index += 1; 71 | } 72 | } 73 | min_value = next_min_value; 74 | } 75 | 76 | encoding_progress = 25; 77 | encoding_state_msg = "Building code tree..."; 78 | 79 | const symbols_length = book_index; // exclusive index 80 | 81 | // max amt of nodes is 256 leaves + 257 internal? not for huffman...? 82 | var nodes: [513]?Node = [_]?Node{null} ** 513; 83 | var nodes_index: u16 = 0; 84 | 85 | var leaf_queue = Queue(*Node, 256){}; 86 | var sapling_queue = Queue(*Node, 256){}; 87 | 88 | // add every letter as a leaf node to the leaf_queue 89 | for (sorted_letter_book[0..symbols_length], 0..) |c, i| { 90 | nodes[i] = Node{ 91 | .symbol = c, 92 | .weight = occurences_book[c], 93 | .parent = null, 94 | .left = null, 95 | .right = null, 96 | .visited = false, 97 | }; 98 | try leaf_queue.enqueue(&nodes[i].?); 99 | } 100 | nodes_index = symbols_length; 101 | 102 | while (leaf_queue.count + sapling_queue.count > 1) { 103 | // get 2 lowest nodes from either queue 104 | var lowest_nodes: [2]*Node = [2]*Node{ undefined, undefined }; 105 | 106 | for (lowest_nodes, 0..) |_, i| { 107 | // this ones first because ties going to leaf queue is more optimal 108 | // for minimizing code length variance 109 | if (sapling_queue.count == 0) { 110 | lowest_nodes[i] = try leaf_queue.dequeue(); 111 | } else if (leaf_queue.count == 0) { 112 | lowest_nodes[i] = try sapling_queue.dequeue(); 113 | } else if (leaf_queue.peek().?.weight <= sapling_queue.peek().?.weight) { 114 | lowest_nodes[i] = try leaf_queue.dequeue(); 115 | } else { 116 | lowest_nodes[i] = try sapling_queue.dequeue(); 117 | } 118 | } 119 | 120 | nodes[nodes_index] = Node{ 121 | .symbol = null, 122 | .weight = lowest_nodes[0].weight + lowest_nodes[1].weight, 123 | .parent = null, 124 | .left = lowest_nodes[0], 125 | .right = lowest_nodes[1], 126 | .visited = false, 127 | }; 128 | const internal_parent = &nodes[nodes_index].?; 129 | nodes_index += 1; 130 | 131 | lowest_nodes[0].parent = internal_parent; 132 | lowest_nodes[1].parent = internal_parent; 133 | 134 | try sapling_queue.enqueue(internal_parent); 135 | } 136 | 137 | const root_node: *Node = 138 | if (leaf_queue.count > 0) try leaf_queue.dequeue() else try sapling_queue.dequeue(); 139 | 140 | // index number is ascii char, value is huffman code 141 | const Code = struct { 142 | data: u32, 143 | length: u8, 144 | }; 145 | 146 | var dictionary: [256]Code = [_]Code{Code{ .data = 0, .length = 0 }} ** 256; 147 | 148 | const HistoryNode = struct { 149 | node: *Node, 150 | path: Code, 151 | }; 152 | 153 | encoding_progress = 30; 154 | encoding_state_msg = "Creating codes..."; 155 | 156 | // clear progress bar if it's being printed ahead of printing codes 157 | // if (flags.debug and !flags.print_output) { 158 | // try std_out.writer().print("\x1B[4F\x1B[4K", .{}); 159 | // } 160 | 161 | var traversal_stack: [513]?HistoryNode = [_]?HistoryNode{null} ** 513; 162 | var traversal_stack_top: usize = 1; 163 | traversal_stack[0] = HistoryNode{ 164 | .node = root_node, 165 | .path = Code{ 166 | .data = 0, 167 | .length = 0, 168 | }, 169 | }; 170 | var traverser: HistoryNode = undefined; 171 | while (traversal_stack_top > 0) { 172 | traverser = traversal_stack[traversal_stack_top - 1].?; 173 | traversal_stack_top -= 1; 174 | 175 | if (traverser.node.right != null) { 176 | var new_traverser = HistoryNode{ 177 | .node = traverser.node.right.?, 178 | .path = traverser.path, 179 | }; 180 | 181 | new_traverser.path.data <<= 1; 182 | new_traverser.path.data |= 1; 183 | new_traverser.path.length += 1; 184 | 185 | traversal_stack[traversal_stack_top] = new_traverser; 186 | 187 | traversal_stack_top += 1; 188 | } 189 | 190 | if (traverser.node.left != null) { 191 | var new_traverser = HistoryNode{ 192 | .node = traverser.node.left.?, 193 | .path = traverser.path, 194 | }; 195 | new_traverser.path.data <<= 1; 196 | new_traverser.path.data |= 0; 197 | new_traverser.path.length += 1; 198 | 199 | traversal_stack[traversal_stack_top] = new_traverser; 200 | 201 | traversal_stack_top += 1; 202 | } 203 | 204 | if (traverser.node.right == null and traverser.node.left == null) { 205 | if (flags.debug) try std_out.writer().print("{c} {} - ", .{ traverser.node.symbol orelse 0, traverser.node.symbol orelse 0 }); 206 | var j: u8 = traverser.path.length; 207 | while (j > 0) : (j -= 1) { 208 | if (flags.debug) try std_out.writer().print("{b}", .{traverser.path.data >> 209 | @as(u5, @truncate(j - 1)) & 1}); 210 | } 211 | if (flags.debug) try std_out.writer().print("\n", .{}); 212 | dictionary[traverser.node.symbol orelse unreachable] = traverser.path; 213 | } 214 | } 215 | 216 | // if (flags.debug and !flags.print_output) { 217 | // try std_out.writer().print("\n\n", .{}); 218 | // } 219 | 220 | // debug check that there are no colliding prefixes 221 | if (flags.debug) { 222 | for (dictionary, 0..) |code_1, i| { 223 | for (dictionary, 0..) |code_2, j| { 224 | if (code_1.length == 0 or code_2.length == 0 or i == j) continue; 225 | 226 | var isPrefix = true; 227 | const shorter = @min(code_1.length, code_2.length); 228 | var k: usize = 0; 229 | 230 | while (k <= shorter) : (k += 1) { 231 | const code_1_bit = (code_1.data >> @as(u5, @truncate(code_1.length - k))) & 1; 232 | const code_2_bit = (code_2.data >> @as(u5, @truncate(code_2.length - k))) & 1; 233 | 234 | if (code_1_bit != code_2_bit) { 235 | isPrefix = false; 236 | break; 237 | } 238 | } 239 | 240 | if (isPrefix) { 241 | const l_i = @as(u8, @truncate(i)); 242 | const l_j = @as(u8, @truncate(j)); 243 | try std_out.writer().print("Found colliding prefix codes for {} {c} and {} {c}", .{ l_i, l_i, l_j, l_j }); 244 | } 245 | } 246 | } 247 | } 248 | 249 | encoding_progress = 35; 250 | encoding_state_msg = "Writing file header..."; 251 | 252 | // estimate of header length when every unique char is used 253 | const max_header_length: usize = 7200; 254 | var out_buffer = try allocator.alloc(u8, max_header_length + text.len); 255 | defer allocator.free(out_buffer); 256 | var out_buffer_out = std.io.fixedBufferStream(out_buffer); 257 | var bit_stream_writer = std.io.bitWriter(.big, out_buffer_out.writer()); 258 | 259 | var bits_written: usize = 0; 260 | 261 | // write magic number 262 | try bit_stream_writer.writeBits(@as(u24, 0xe7c0de), 24); 263 | bits_written += 24; 264 | 265 | // write format version 266 | try bit_stream_writer.writeBits(@as(u8, 0x01), 8); 267 | bits_written += 8; 268 | 269 | // write dictionary length 270 | var dictionary_length: usize = 0; // dictionary length - 1 271 | for (dictionary) |code| { 272 | if (code.length > 0) dictionary_length += 1; 273 | } 274 | if (dictionary_length > 0) dictionary_length -= 1; 275 | try bit_stream_writer.writeBits(dictionary_length, 8); 276 | bits_written += 8; 277 | 278 | // write body length 279 | try bit_stream_writer.writeBits(text.len, 32); 280 | bits_written += 32; 281 | 282 | // write dictionary 283 | // write dictionary as: 284 | // | ascii value - u8 | length of code - u8 | code - n bits | 285 | for (dictionary, 0..) |code, i| { 286 | if (code.length > 0) { 287 | try bit_stream_writer.writeBits(i, 8); 288 | bits_written += 8; 289 | try bit_stream_writer.writeBits(code.length, 8); 290 | bits_written += 8; 291 | var j: usize = code.length; 292 | while (j > 0) : (j -= 1) { 293 | try bit_stream_writer.writeBits((code.data >> @as(u5, @truncate(j - 1))) & 1, 1); 294 | bits_written += 1; 295 | } 296 | } 297 | } 298 | try bit_stream_writer.flushBits(); 299 | bits_written = if (bits_written % 8 != 0) (bits_written / 8 + 1) * 8 else bits_written; 300 | 301 | encoding_progress = 40; 302 | encoding_state_msg = "Writing compressed text..."; 303 | const writing_sections = 10; 304 | for (0..writing_sections) |i| { 305 | encoding_progress = 60 + (100 - 60) * i / writing_sections; 306 | // write compressed bits 307 | for (text[i * text.len / writing_sections .. (i + 1) * text.len / writing_sections]) |char| { 308 | const code = dictionary[char]; 309 | var j: usize = code.length; 310 | while (j > 0) : (j -= 1) { 311 | try bit_stream_writer.writeBits((code.data >> @as(u5, @truncate(j - 1))) & 1, 1); 312 | bits_written += 1; 313 | } 314 | } 315 | } 316 | 317 | try bit_stream_writer.flushBits(); 318 | bits_written = if (bits_written % 8 != 0) (bits_written / 8 + 1) * 8 else bits_written; 319 | if (flags.write_output) try out_writer.writeAll(out_buffer[0 .. bits_written / 8]); 320 | if (flags.debug) try std_out.writer().print("\nbits in output: {d}\n", .{bits_written}); 321 | 322 | if (!flags.print_output and !flags.debug) { 323 | encoding_progress = 100; 324 | encoding_state_msg = "Done compressing!"; 325 | print_progress_thread.?.join(); 326 | } 327 | 328 | const formatted_original_size = format_file_size(allocator, @floatFromInt(text.len)) catch unreachable; 329 | defer allocator.free(formatted_original_size); 330 | 331 | const formatted_compressed_size = format_file_size(allocator, @floatFromInt(bits_written / 8)) catch unreachable; 332 | defer allocator.free(formatted_compressed_size); 333 | 334 | std.debug.print("{s} => {s}\n", .{ formatted_original_size, formatted_compressed_size }); 335 | 336 | return bits_written / 8; 337 | } 338 | -------------------------------------------------------------------------------- /src/main.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | const encode = @import("encode.zig").encode; 4 | const decode = @import("decode.zig").decode; 5 | 6 | const print = std.debug.print; 7 | const log = std.log; 8 | const fs = std.fs; 9 | const mem = std.mem; 10 | const Allocator = mem.Allocator; 11 | 12 | const Mode = enum { 13 | None, 14 | Compress, 15 | Decompress, 16 | }; 17 | 18 | const Options = struct { 19 | print: bool, 20 | debug: bool, 21 | dry: bool, 22 | mode: Mode, 23 | file_in_path: []const u8, 24 | file_out_path: []const u8, 25 | }; 26 | 27 | const CliError = error{ 28 | InvalidOption, 29 | InvalidCommand, 30 | NoInputFile, 31 | InvalidCommandArgument, 32 | }; 33 | 34 | fn read_text_file(allocator: Allocator, filepath: []const u8) ![]const u8 { 35 | var file = try fs.cwd().openFile(filepath, .{}); 36 | defer file.close(); 37 | const buffer = try allocator.alloc(u8, (try file.stat()).size); 38 | try file.reader().readNoEof(buffer); 39 | return buffer; 40 | } 41 | 42 | fn run_cli(allocator: Allocator, std_out: std.fs.File) !Options { 43 | var options = Options{ .print = false, .debug = false, .dry = false, .mode = .None, .file_in_path = undefined, .file_out_path = undefined }; 44 | 45 | const help_text = 46 | \\Entreepy - Text compression tool 47 | \\ 48 | \\Usage: entreepy [options] [command] [file] [command options] 49 | \\ 50 | \\Options: 51 | \\ -h, --help show help 52 | \\ -p, --print print decompressed text to stdout 53 | \\ -t, --test test/dry run, does not write to file 54 | \\ -d, --debug print huffman code dictionary and performance times to stdout 55 | \\ 56 | \\Commands: 57 | \\ c compress a file 58 | \\ d decompress a file 59 | \\ 60 | \\Command Options: 61 | \\ -o, --output output file (default: [file].et or decoded_[file]) 62 | \\ 63 | \\Examples: 64 | \\ entreepy -d c text.txt -o text.txt.et 65 | \\ entreepy -ptd d text.txt.et -o decoded_text.txt 66 | \\ 67 | ; 68 | 69 | var args = try std.process.argsWithAllocator(allocator); 70 | _ = args.skip(); // skip exe path 71 | var hasUserArgs = false; 72 | 73 | const CLIParsingState = enum { reading_normal, reading_out_path, reading_in_path }; 74 | 75 | var cli_parsing_state: CLIParsingState = .reading_normal; 76 | 77 | while (args.next()) |arg| { 78 | hasUserArgs = true; 79 | switch (cli_parsing_state) { 80 | .reading_normal => { 81 | switch (arg[0]) { 82 | '-' => { 83 | for (arg[1..]) |c| { 84 | switch (c) { 85 | 'h' => { 86 | std_out.writeAll(help_text) catch {}; 87 | options.mode = .None; 88 | return options; 89 | }, 90 | 'p' => options.print = true, 91 | 'd' => options.debug = true, 92 | 't' => options.dry = true, 93 | 'o' => cli_parsing_state = .reading_out_path, 94 | '-' => { 95 | if (mem.eql(u8, arg[2..], "help")) { 96 | std_out.writeAll(help_text) catch {}; 97 | options.mode = .None; 98 | return options; 99 | } else if (mem.eql(u8, arg[2..], "print")) { 100 | options.print = true; 101 | break; 102 | } else if (mem.eql(u8, arg[2..], "debug")) { 103 | options.debug = true; 104 | break; 105 | } else if (mem.eql(u8, arg[2..], "test")) { 106 | options.dry = true; 107 | break; 108 | } else if (mem.eql(u8, arg[2..], "output")) { 109 | cli_parsing_state = .reading_out_path; 110 | break; 111 | } else { 112 | log.err("invalid option: {s}\n", .{arg}); 113 | return error.InvalidOption; 114 | } 115 | }, 116 | else => { 117 | log.err("invalid option: {s}\n", .{arg}); 118 | return error.InvalidOption; 119 | }, 120 | } 121 | } 122 | }, 123 | 'c', 'd' => { 124 | if (arg[0] == 'c') { 125 | options.mode = .Compress; 126 | } else { 127 | options.mode = .Decompress; 128 | } 129 | cli_parsing_state = .reading_in_path; 130 | }, 131 | else => { 132 | log.err("invalid command: {s}\n", .{arg}); 133 | return error.InvalidCommand; 134 | }, 135 | } 136 | }, 137 | .reading_in_path => { 138 | options.file_in_path = arg; 139 | cli_parsing_state = .reading_normal; 140 | }, 141 | .reading_out_path => { 142 | options.file_out_path = try allocator.dupe(u8, arg); 143 | cli_parsing_state = .reading_normal; 144 | }, 145 | } 146 | } 147 | 148 | if (!hasUserArgs) { 149 | std_out.writeAll(help_text) catch {}; 150 | options.mode = .None; 151 | return options; 152 | } 153 | 154 | // FIX: Generating default filename causes segfault on linux 155 | if (options.file_out_path.len == 0) { 156 | if (options.mode == .Compress) { 157 | options.file_out_path = 158 | try mem.concat(allocator, u8, &[2][]const u8{ options.file_in_path, ".et" }); 159 | } else { 160 | // removes the ".et" extension if it's there and adds "decoded_" to the front of the file name 161 | const file_in_dir = fs.path.dirname(options.file_in_path) orelse ""; 162 | var new_file_name = fs.path.basename(options.file_in_path); 163 | if (mem.eql(u8, new_file_name[new_file_name.len - 3 ..], ".et")) 164 | new_file_name = new_file_name[0 .. new_file_name.len - 3]; 165 | const decoded_file_name = try mem.concat(allocator, u8, &[2][]const u8{ "decoded_", new_file_name }); 166 | defer allocator.free(decoded_file_name); 167 | options.file_out_path = 168 | try fs.path.join(allocator, &[_][]const u8{ file_in_dir, decoded_file_name }); 169 | } 170 | } 171 | 172 | return options; 173 | } 174 | 175 | pub fn main() !void { 176 | var gpa = std.heap.GeneralPurposeAllocator(.{}){}; 177 | defer _ = gpa.deinit(); 178 | const allocator = gpa.allocator(); 179 | const std_out = std.io.getStdOut(); 180 | defer std_out.close(); 181 | 182 | const options = try run_cli(allocator, std_out); 183 | defer allocator.free(options.file_out_path); 184 | if (options.mode == .None) return; 185 | 186 | const text_in = try read_text_file(allocator, options.file_in_path); 187 | defer allocator.free(text_in); 188 | 189 | var out_file: std.fs.File = undefined; 190 | var out_writer: std.fs.File.Writer = undefined; 191 | if (!options.dry) { 192 | out_file = try std.fs.cwd().createFile( 193 | options.file_out_path, 194 | .{ .read = true }, 195 | ); 196 | out_writer = out_file.writer(); 197 | } 198 | 199 | // TODO: Add checks for to error if it isnt in valid .et file format file format version, min length, magic number, 200 | 201 | if (options.mode == .Compress) { 202 | _ = try encode(allocator, text_in, out_writer, std_out, .{ .write_output = !options.dry, .print_output = options.print, .debug = options.debug }); 203 | } else { 204 | _ = try decode(allocator, text_in[4..], out_writer, std_out, .{ .write_output = !options.dry, .print_output = options.print, .debug = options.debug }); 205 | } 206 | 207 | if (!options.dry) out_file.close(); 208 | } 209 | -------------------------------------------------------------------------------- /src/progress_bar.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | const Color = struct { r: i32, g: i32, b: i32 }; 4 | 5 | const stdout = std.io.getStdOut().writer(); 6 | const bar_length: usize = 30; 7 | const steps_per_color: i32 = 60; 8 | 9 | pub fn print_progress(theme: u8, progress: *usize, state_msg: *const []const u8) !void { 10 | var stops: [4]Color = undefined; 11 | switch (theme) { 12 | 0 => { 13 | stops = [_]Color{ Color{ .r = 0x00, .g = 0xb4, .b = 0xd8 }, Color{ .r = 0x90, .g = 0xe0, .b = 0xef }, Color{ .r = 0xca, .g = 0xc0, .b = 0xf8 }, Color{ .r = 0x90, .g = 0xe0, .b = 0xef } }; 14 | }, 15 | else => { 16 | stops = [_]Color{ Color{ .r = 0x83, .g = 0x3a, .b = 0xb4 }, Color{ .r = 0xe7, .g = 0x22, .b = 0x38 }, Color{ .r = 0xfc, .g = 0xb0, .b = 0x45 }, Color{ .r = 0xe7, .g = 0x22, .b = 0x38 } }; 17 | }, 18 | } 19 | 20 | var step: usize = 0; 21 | 22 | std.debug.print("\n\n\n\n", .{}); 23 | 24 | while (progress.* <= 100) : (step += 1) { 25 | const bar_done = progress.* * bar_length / 100; 26 | 27 | std.debug.print("\x1B[4F\x1B[4K", .{}); 28 | std.debug.print("{s}\t\t\t\t\t\t\n", .{state_msg.*}); 29 | std.debug.print("╔", .{}); 30 | inline for (0..bar_length + 2) |_| { 31 | std.debug.print("═", .{}); 32 | } 33 | 34 | std.debug.print("╗\n║ ", .{}); 35 | 36 | for (0..bar_done) |j| { 37 | const stop = stops[@divTrunc(step + j, steps_per_color) % 3]; 38 | const stop_next = stops[(@divTrunc(step + j, steps_per_color) + 1) % 3]; 39 | 40 | var c: Color = undefined; 41 | 42 | c = Color{ 43 | .r = stop.r + @divTrunc((stop_next.r - stop.r) * @rem(@as(i32, @intCast(step + j)), steps_per_color), steps_per_color), 44 | .g = stop.g + @divTrunc((stop_next.g - stop.g) * @rem(@as(i32, @intCast(step + j)), steps_per_color), steps_per_color), 45 | .b = stop.b + @divTrunc((stop_next.b - stop.b) * @rem(@as(i32, @intCast(step + j)), steps_per_color), steps_per_color), 46 | }; 47 | std.debug.print("\x1B[38;2;{};{};{}m█\x1B[m", .{ c.r, c.g, c.b }); 48 | } 49 | 50 | for (bar_done..@max(bar_done, bar_length)) |_| { 51 | std.debug.print(" ", .{}); 52 | } 53 | 54 | std.debug.print(" ║\n╚", .{}); 55 | 56 | inline for (0..bar_length + 2) |_| { 57 | std.debug.print("═", .{}); 58 | } 59 | 60 | std.debug.print("╝\n", .{}); 61 | 62 | if (bar_done == bar_length) { 63 | break; 64 | } 65 | std.time.sleep(10_000_000); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/queue.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | const QueueError = error{ 4 | OutOfBounds, 5 | QueueFull, 6 | QueueEmpty, 7 | }; 8 | 9 | pub fn Queue(comptime T: type, comptime length: usize) type { 10 | return struct { 11 | count: usize = 0, 12 | front: usize = 0, 13 | back: usize = 0, 14 | data: [length]?T = [_]?T{null} ** length, 15 | 16 | const Self = @This(); 17 | 18 | pub fn enqueue(self: *Self, new_value: T) QueueError!void { 19 | if (self.count == self.data.len) return QueueError.QueueFull; 20 | 21 | self.back = (self.back % self.data.len) + 1; 22 | 23 | self.data[self.back - 1] = new_value; 24 | self.count += 1; 25 | } 26 | 27 | pub fn dequeue(self: *Self) QueueError!T { 28 | if (self.count == 0) { 29 | return QueueError.QueueEmpty; 30 | } 31 | 32 | const value = self.data[self.front] orelse QueueError.OutOfBounds; 33 | self.front = (self.front + 1) % self.data.len; 34 | self.count -= 1; 35 | return value; 36 | } 37 | 38 | pub fn peek(self: Self) ?T { 39 | if (self.count == 0) return null; 40 | return self.data[self.front]; 41 | } 42 | }; 43 | } 44 | 45 | test "queue enqueue and peek" { 46 | var q = Queue(u8, 3){}; 47 | 48 | try q.enqueue(42); 49 | try std.testing.expectEqual(@as(?u8, 42), q.peek()); 50 | 51 | try q.enqueue(24); 52 | try std.testing.expectEqual(@as(?u8, 42), q.peek()); 53 | } 54 | 55 | test "queue single element" { 56 | var q = Queue(u8, 3){}; 57 | 58 | try q.enqueue(1); 59 | try std.testing.expectEqual(try q.dequeue(), 1); 60 | try std.testing.expectError(QueueError.QueueEmpty, q.dequeue()); 61 | } 62 | 63 | test "queue is full after enqueues" { 64 | var q = Queue(u8, 3){}; 65 | 66 | try q.enqueue(1); 67 | try q.enqueue(2); 68 | try q.enqueue(3); 69 | 70 | try std.testing.expectError(QueueError.QueueFull, q.enqueue(4)); 71 | } 72 | 73 | test "queue empty after dequeues" { 74 | var q = Queue(u8, 3){}; 75 | 76 | try q.enqueue(1); 77 | try q.enqueue(2); 78 | try q.enqueue(3); 79 | _ = try q.dequeue(); 80 | _ = try q.dequeue(); 81 | _ = try q.dequeue(); 82 | 83 | try std.testing.expectError(QueueError.QueueEmpty, q.dequeue()); 84 | } 85 | 86 | test "queue wrap around after full cycle" { 87 | var q = Queue(u8, 3){}; 88 | 89 | try q.enqueue(1); 90 | try q.enqueue(2); 91 | try q.enqueue(3); 92 | try std.testing.expectEqual(try q.dequeue(), 1); 93 | try std.testing.expectEqual(try q.dequeue(), 2); 94 | try q.enqueue(4); 95 | try q.enqueue(5); 96 | try std.testing.expectEqual(try q.dequeue(), 3); 97 | try std.testing.expectEqual(try q.dequeue(), 4); 98 | try std.testing.expectEqual(try q.dequeue(), 5); 99 | 100 | try std.testing.expectError(QueueError.QueueEmpty, q.dequeue()); 101 | } 102 | 103 | test "queue peek after wrap around" { 104 | var q = Queue(u8, 3){}; 105 | 106 | try q.enqueue(1); 107 | try q.enqueue(2); 108 | try q.enqueue(3); 109 | try std.testing.expectEqual(try q.dequeue(), 1); 110 | try q.enqueue(4); 111 | try std.testing.expectEqual(@as(?u8, 2), q.peek()); 112 | } 113 | -------------------------------------------------------------------------------- /src/test.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | const testing = std.testing; 3 | 4 | const encode = @import("encode.zig").encode; 5 | const decode = @import("decode.zig").decode; 6 | 7 | fn round_trip(text_in: []const u8) ![]const u8 { 8 | const stderr = std.io.getStdErr(); 9 | 10 | const encoded_buffer: []u8 = try testing.allocator.alloc(u8, text_in.len * 2); 11 | defer testing.allocator.free(encoded_buffer); 12 | var encoded_stream = std.io.fixedBufferStream(encoded_buffer); 13 | const encoded_writer = encoded_stream.writer(); 14 | 15 | const encoded_len = try encode(testing.allocator, text_in, encoded_writer, stderr, .{ .write_output = true, .print_output = false, .debug = false }); 16 | 17 | // const msg = try std.fmt.allocPrint(testing.allocator, "bits encoded {}", .{encoded_len}); 18 | // try stderr.writeAll(msg); 19 | // testing.allocator.free(msg); 20 | 21 | const decoded_buffer: []u8 = try testing.allocator.alloc(u8, text_in.len * 2); 22 | defer testing.allocator.free(decoded_buffer); 23 | var decoded_stream = std.io.fixedBufferStream(decoded_buffer); 24 | const decoded_writer = decoded_stream.writer(); 25 | 26 | const decoded_len = try decode(testing.allocator, encoded_buffer[4..encoded_len], decoded_writer, stderr, .{ .write_output = true, .print_output = false, .debug = false }); 27 | 28 | // const msg2 = try std.fmt.allocPrint(testing.allocator, "\ndecoded buffer: {s}", .{decoded_buffer[0..decoded_len]}); 29 | // try stderr.writeAll(msg2); 30 | // testing.allocator.free(msg2); 31 | 32 | return try testing.allocator.dupe(u8, decoded_buffer[0..decoded_len]); 33 | } 34 | 35 | test "round trip basic" { 36 | var file = try std.fs.cwd().openFile("res/test.txt", .{}); 37 | defer file.close(); 38 | const text_in = try testing.allocator.alloc(u8, (try file.stat()).size); 39 | try file.reader().readNoEof(text_in); 40 | defer testing.allocator.free(text_in); 41 | 42 | const text_out = try round_trip(text_in); 43 | defer testing.allocator.free(text_out); 44 | 45 | try testing.expectEqualStrings(text_in, text_out); 46 | } 47 | 48 | test "round trip soliloquy" { 49 | var file = try std.fs.cwd().openFile("res/nice.shakespeare.txt", .{}); 50 | defer file.close(); 51 | const text_in = try testing.allocator.alloc(u8, (try file.stat()).size); 52 | try file.reader().readNoEof(text_in); 53 | defer testing.allocator.free(text_in); 54 | 55 | const text_out = try round_trip(text_in); 56 | defer testing.allocator.free(text_out); 57 | 58 | try testing.expectEqualStrings(text_in, text_out); 59 | } 60 | 61 | test "round trip play" { 62 | var file = try std.fs.cwd().openFile("res/a_midsummer_nights_dream.txt", .{}); 63 | defer file.close(); 64 | const text_in = try testing.allocator.alloc(u8, (try file.stat()).size); 65 | try file.reader().readNoEof(text_in); 66 | defer testing.allocator.free(text_in); 67 | 68 | const text_out = try round_trip(text_in); 69 | defer testing.allocator.free(text_out); 70 | 71 | try testing.expectEqualStrings(text_in, text_out); 72 | } 73 | 74 | test "queue" { 75 | _ = @import("queue.zig"); 76 | } 77 | -------------------------------------------------------------------------------- /src/utils.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | pub fn format_file_size(allocator: std.mem.Allocator, byte_count: f32) ![]const u8 { 4 | if (byte_count < 1024) { 5 | return std.fmt.allocPrint(allocator, "{d} B", .{byte_count}); 6 | } else if (byte_count < 1024 * 1024) { 7 | return std.fmt.allocPrint(allocator, "{d:.2} KB", .{byte_count / 1024}); 8 | } else if (byte_count < 1024 * 1024 * 1024) { 9 | return std.fmt.allocPrint(allocator, "{d:.2} MB", .{byte_count / (1024 * 1024)}); 10 | } else { 11 | return std.fmt.allocPrint(allocator, "{d:.2} GB", .{byte_count / (1024 * 1024 * 1024)}); 12 | } 13 | } 14 | --------------------------------------------------------------------------------