Compare commits
23 Commits
v0.3.5-lat
...
refactor/i
Author | SHA1 | Date | |
---|---|---|---|
aa99aa7686 | |||
6dac9d5a7c | |||
f19fcac6c4 | |||
ebeb62f72d | |||
d71d8eb1ec | |||
4ac12479cc | |||
7fc53e4113 | |||
06c62e284d | |||
d5d31eb5fe | |||
156f558a45 | |||
e96832a60c | |||
e1a5de74ad | |||
90339be30e | |||
4da80d26a3 | |||
cb062788a7 | |||
acfd179435 | |||
d1b606782f | |||
784cf41003 | |||
0f342c96ee | |||
3022ada51a | |||
9dada59c56 | |||
8683693cd1 | |||
144d7cb83c |
216
.gitignore
vendored
216
.gitignore
vendored
@@ -1,7 +1,215 @@
|
||||
# Project specific additions
|
||||
.devflag
|
||||
.vscode
|
||||
.vscode/
|
||||
.directory
|
||||
__pycache__/
|
||||
scripts/
|
||||
.idea
|
||||
cache
|
||||
.idea/
|
||||
cache/
|
||||
nucleon/test.toml
|
||||
electron/test.toml
|
||||
*.egg-info/
|
||||
build/
|
||||
dist/
|
||||
|
||||
# Project specific directories
|
||||
config/
|
||||
data/cache/
|
||||
data/electrion/
|
||||
data/nucleon/
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
share/python-wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
*.py,cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
cover/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
db.sqlite3
|
||||
db.sqlite3-journal
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
.pybuilder/
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# IPython
|
||||
profile_default/
|
||||
ipython_config.py
|
||||
|
||||
# pyenv
|
||||
# For a library or package, you might want to ignore these files since the code is
|
||||
# intended to run in multiple environments; otherwise, check them in:
|
||||
# .python-version
|
||||
|
||||
# pipenv
|
||||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||
# install all needed dependencies.
|
||||
#Pipfile.lock
|
||||
|
||||
# poetry
|
||||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||
# commonly used for packaging.
|
||||
#poetry.lock
|
||||
#poetry.toml
|
||||
|
||||
# pdm
|
||||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
||||
#pdm.lock
|
||||
#pdm.toml
|
||||
|
||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
||||
__pypackages__/
|
||||
|
||||
# Celery stuff
|
||||
celerybeat-schedule
|
||||
celerybeat.pid
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
.dmypy.json
|
||||
dmypy.json
|
||||
|
||||
# Pyre type checker
|
||||
.pyre/
|
||||
|
||||
# pytype static type analyzer
|
||||
.pytype/
|
||||
|
||||
# Cython debug symbols
|
||||
cython_debug/
|
||||
|
||||
# PyCharm
|
||||
.idea/
|
||||
|
||||
# Audio cache and temporary files
|
||||
*.mp3
|
||||
*.wav
|
||||
*.ogg
|
||||
*.tmp
|
||||
|
||||
# LLM cache files
|
||||
*.cache
|
||||
*.jsonl
|
||||
|
||||
# Log files
|
||||
*.log
|
||||
logs/
|
||||
|
||||
# OS generated files
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
# Windows
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
Desktop.ini
|
||||
|
||||
# Linux
|
||||
*~
|
||||
|
||||
# VSCode
|
||||
.vscode/
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
*.code-workspace
|
||||
|
||||
# Temporary files
|
||||
*.tmp
|
||||
*.temp
|
@@ -1,20 +0,0 @@
|
||||
# 贡献指南
|
||||
## 使用 Nuitka 静态编译
|
||||
运行
|
||||
|
||||
```bash
|
||||
nuitka --clang --jobs=6 --standalone --onefile main.py
|
||||
```
|
||||
|
||||
## 打开调试日志
|
||||
|
||||
分别运行
|
||||
|
||||
```shell
|
||||
textual console -x SYSTEM -x EVENT -x DEBUG -x INFO
|
||||
```
|
||||
|
||||
```shell
|
||||
textual run --dev main.py
|
||||
```
|
||||
|
232
LICENSE
232
LICENSE
@@ -1,232 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
“This License” refers to version 3 of the GNU General Public License.
|
||||
|
||||
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
|
||||
|
||||
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
|
||||
|
||||
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
|
||||
|
||||
A “covered work” means either the unmodified Program or a work based on the Program.
|
||||
|
||||
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
|
||||
|
||||
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
|
||||
|
||||
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
|
||||
|
||||
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
|
||||
|
||||
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
|
||||
|
||||
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
|
||||
|
||||
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
|
||||
|
||||
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
|
||||
|
||||
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
|
||||
|
||||
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
|
||||
|
||||
HeurAMS
|
||||
Copyright (C) 2025 Wang Zhiyu
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
HeurAMS Copyright (C) 2025 Wang Zhiyu
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>.
|
61
NOTE.md
61
NOTE.md
@@ -1,61 +0,0 @@
|
||||
# 实用技巧
|
||||
|
||||
## 用于数据组织的 prompt
|
||||
|
||||
```` markdown
|
||||
1. 我应该先给你一个文件范例
|
||||
```
|
||||
# 散列表的键翻译
|
||||
["keydata"]
|
||||
note = "笔记"
|
||||
keyword_note = "关键词翻译"
|
||||
translation = "语句翻译"
|
||||
|
||||
# 测试项目元数据
|
||||
["testdata"]
|
||||
# 记忆时显示的额外信息
|
||||
additional_inf = ["translation","keyword_note", "note"]
|
||||
# 填空测试, content 指代键名
|
||||
fill_blank_test = {"from"=["content"], "hint"=["translation"]}
|
||||
# 选择题测试
|
||||
draw_card_test = {"from"=["keyword_note"]}
|
||||
|
||||
["臣/密/言: /臣/以/险衅/, 夙/遭/闵凶./"] # 键名应该使用"/"基于意思断句(填空生成需要, 避免分离单个标点), 句末应该有断句, 不要断得太碎
|
||||
note = []
|
||||
translation = "臣子李密陈言: 我因命运不好, 小时候遭遇到了不幸"
|
||||
keyword_note = {"险衅"="凶险祸患(这里指命运不好)", "夙"="早时, 这里指年幼的时候", "闵"="通'悯', 指可忧患的事", "凶"="不幸, 指丧父"}
|
||||
|
||||
["生孩/六月/, 慈父/见背/; /行年/四岁/, 舅/夺/母志./"]
|
||||
note = []
|
||||
translation = "刚出生六个月, 我慈爱的父亲就不幸去世了。经过了四年, 舅父逼母亲改嫁"
|
||||
keyword_note = {"见背"="死的委婉说法", "行年"="经历的年岁", "母志"="母亲守节之志(改嫁的委婉说法)"}
|
||||
|
||||
["祖母/刘/愍/臣/孤弱/, 躬亲/抚养./"]
|
||||
note = []
|
||||
translation = "我的祖母刘氏, 怜悯我从小丧父, 便亲自对我加以抚养"
|
||||
keyword_note = {"愍"="怜悯", "躬亲"="亲身"}
|
||||
|
||||
["臣/少/多/疾病/, 九岁/不行/, 零丁/孤苦/, 至于/成立./"]
|
||||
note = []
|
||||
translation = "臣小的时候经常生病, 九岁时还不会行走。孤独无靠, 一直到成人自立"
|
||||
keyword_note = {"成立"="成人自立"}
|
||||
|
||||
["既/无/伯叔/, 终/鲜/兄弟/, 门/衰/祚/薄/, 晚/有/儿息./"]
|
||||
note = []
|
||||
translation = "既没有叔叔伯伯, 又没什么兄弟, 门庭衰微而福分浅薄, 很晚才有儿子"
|
||||
keyword_note = {"鲜"="少, 这里指'无'", "祚薄"="福分浅薄", "儿息"="亲生子女"}
|
||||
|
||||
["外/无/期功/强近/之亲/, 内/无/应门/五尺/之僮/, 茕茕/孑立/, 形影/相吊./"]
|
||||
note = []
|
||||
translation = "在外面没有比较亲近的亲戚, 在家里又没有照应门户的童仆。生活孤单没有依靠, 每天只有自己的身体和影子相互安慰"
|
||||
keyword_note = {"期功"="指关系较近的亲属", "茕茕孑立"="孤单无依靠的样子", "吊"="安慰"}
|
||||
|
||||
...# 还有重复
|
||||
```
|
||||
2. 这是新的信息
|
||||
```
|
||||
{源数据}
|
||||
```
|
||||
生成新的"{文件名}.toml"
|
||||
````
|
||||
|
94
README.md
94
README.md
@@ -1,94 +0,0 @@
|
||||
# 潜进 (HeurAMS) - 启发式辅助记忆程序
|
||||
> 形人而我无形,**则我专而敌分**
|
||||
|
||||
## 概述
|
||||
"潜进" (HeurAMS: Heuristic Auxiliary Memorizing Scheduler, 启发式记忆辅助调度器) 是为习题册, 古诗词, 及其他问答/记忆/理解型知识设计的辅助记忆软件, 提供动态规划的优化记忆方案
|
||||
|
||||
## 关于此仓库
|
||||
"潜进" 软件组项目包含多个子项目:
|
||||
- 此仓库包含了 "潜进" 项目的核心和基于 Textual 的基本用户界面的实现
|
||||
- 关于基于 Flutter 的现代用户界面, 请参阅 "潜进-F" (HeurAMS-F) 仓库
|
||||
- 关于数据同步实现, 请参阅 "潜进-S" (HeurSync) 仓库
|
||||
- 关于云端文档源实现, 请参阅 "潜进-R" (HeurRepo) 仓库
|
||||
|
||||
## 开发计划
|
||||
0.1.x: 简易调度器实现与最小原型
|
||||
0.2.x: 使用 Textual 构建 TUI, 项目可行性验证与采用 SM-2 原始算法用户自评估的原型
|
||||
0.3.x (当前): 基本数据结构, 基于 SM-2 改进算法的自动复习测评评估与遵从 IoC 设计的功能实现, 重点设计古诗文记忆理解功能, 以及 TUI 界面实现, 简单的语言模型集成
|
||||
0.4.x: 更新文件格式, 引入动态数据结构(自动内容生成), 深度语言模型集成
|
||||
0.5.x: 引入云同步与文档源
|
||||
0.6.x: 引入其他算法接口, 与跨语言库引入, 使用 Flutter 构建跨平台现代客户端
|
||||
|
||||
## 技术集成与特性
|
||||
|
||||
### 间隔迭代算法
|
||||
> 许多出版物都广泛讨论了不同重复间隔对学习效果的影响。特别是,间隔效应被认为是一种普遍现象。间隔效应是指,如果重复的间隔是分散/稀疏的,而不是集中重复,那么学习任务的表现会更好。因此,有观点提出,学习中使用的最佳重复间隔是**最长的、但不会导致遗忘的间隔**。
|
||||
- 采用经实证的 SM-2 间隔迭代算法, 此算法亦用作 Anki 闪卡记忆软件的默认闪卡调度器
|
||||
> 计划: 将添加 FSRS 算法 (Anki 的新可选闪卡调度器) 与一种 SM-15 变体算法作为后续替代
|
||||
> 参考 https://github.com/slaypni/SM-15
|
||||
> 使用 SM-15 的变体:
|
||||
> SM-2 后续算法并非完全开放, 故使用一种基于 SM-15 描述实现的变体算法
|
||||
- 动态规划每个记忆单元的记忆间隔时间表
|
||||
- 动态跟踪记忆反馈数据,优化长期记忆保留率与稳定性
|
||||
|
||||
### 学习进程优化
|
||||
- 逐字解析:支持逐字详细释义解析
|
||||
- 语法分析:接入生成式人工智能, 支持古文结构交互式解析
|
||||
- 自然语音:集成微软神经网络文本转语音 (TTS) 技术
|
||||
|
||||
### 实用用户界面
|
||||
|
||||
- 响应式 Textual 框架构建的跨平台 TUI 界面
|
||||
- 支持触屏/鼠标/键盘多操作模式
|
||||
- 简洁直观的复习流程设计
|
||||
|
||||
## 屏幕截图 (基本用户界面)
|
||||
|
||||
> 单击图片以放大
|
||||
|
||||
<img src="./readme_src/img1.png" alt="img1" style="zoom: 33%;" />
|
||||
<img src="./readme_src/img2.png" alt="img2" style="zoom:33%;" />
|
||||
<img src="./readme_src/img3.png" alt="img3" style="zoom:33%;" />
|
||||
<img src="./readme_src/img4.png" alt="img4" style="zoom:33%;" />
|
||||
|
||||
## 技术架构
|
||||
|
||||
> 有关技术与实现的细节, 请参阅 CONTRIBUTING.md
|
||||
> 提交拉取请求以参与到此开放源代码项目
|
||||
|
||||
``` mermaid
|
||||
graph TD
|
||||
subgraph 后端
|
||||
A[SM-2 算法] --> B[间隔迭代算法]
|
||||
B --> C[迭代记忆参数]
|
||||
end
|
||||
|
||||
subgraph 用户界面
|
||||
D[展示模块] --> E[用户界面]
|
||||
E --> F[进度追踪面板]
|
||||
end
|
||||
|
||||
subgraph 外部服务
|
||||
G[LLM]
|
||||
H[TTS]
|
||||
end
|
||||
|
||||
C --> D
|
||||
F -->|用户数据| C
|
||||
D --> G
|
||||
D --> H
|
||||
```
|
||||
|
||||
## 系统与平台要求
|
||||
|
||||
- 依赖组件: Python 3.7+ (与 PIP), Git (半自动更新 & 安装需要), requirements.txt 中依赖包
|
||||
- 可选依赖: curl (首次下载需要)
|
||||
- 平台支持:Windows / macOS / Linux / Android (需要 Termux 或 Linux) (终端或浏览器)
|
||||
- 网络连接:可预缓存语音文件, 需联网使用大模型服务功能
|
||||
|
||||
运行此命令以在具备以上前置条件的计算机上快速安装/保留数据更新:
|
||||
```
|
||||
curl -O https://gitea.imwangzhiyu.xyz/ajax/HeurAMS/raw/branch/main/tweak.py
|
||||
|
||||
python3 tweak.py
|
||||
```
|
@@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns:xlink="http://www.w3.org/1999/xlink" width="554.4pt" height="554.4pt" viewBox="0 0 554.4 554.4" xmlns="http://www.w3.org/2000/svg" version="1.1">
|
||||
<defs>
|
||||
<style type="text/css">*{stroke-linejoin: round; stroke-linecap: butt}</style>
|
||||
</defs>
|
||||
<g id="figure_1">
|
||||
<g id="patch_1">
|
||||
<path d="M 0 554.4
|
||||
L 554.4 554.4
|
||||
L 554.4 0
|
||||
L 0 0
|
||||
L 0 554.4
|
||||
z
|
||||
" style="fill: none"/>
|
||||
</g>
|
||||
<g id="axes_1">
|
||||
<g id="patch_2">
|
||||
<path d="M 66.528 487.872
|
||||
L 199.584 487.872
|
||||
L 199.584 354.816
|
||||
L 66.528 354.816
|
||||
z
|
||||
" clip-path="url(#p4da876c7a0)" style="fill: #1660a5; stroke: #1660a5; stroke-linejoin: miter"/>
|
||||
</g>
|
||||
<g id="patch_3">
|
||||
<path d="M 199.584 354.816
|
||||
L 487.872 354.816
|
||||
L 487.872 66.528
|
||||
L 199.584 66.528
|
||||
z
|
||||
" clip-path="url(#p4da876c7a0)" style="fill: #545f70; stroke: #545f70; stroke-linejoin: miter"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="p4da876c7a0">
|
||||
<rect x="0" y="0" width="554.4" height="554.4"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.1 KiB |
297
compositions.py
297
compositions.py
@@ -1,297 +0,0 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.events import Event
|
||||
from textual.widgets import (
|
||||
Collapsible,
|
||||
Header,
|
||||
Footer,
|
||||
Markdown,
|
||||
ListView,
|
||||
ListItem,
|
||||
Label,
|
||||
Static,
|
||||
Button,
|
||||
)
|
||||
from textual.containers import Container, Horizontal, Center
|
||||
from textual.screen import Screen
|
||||
from textual.widget import Widget
|
||||
import uuid
|
||||
from typing import Tuple, Dict
|
||||
import particles as pt
|
||||
import puzzles as pz
|
||||
import re
|
||||
import random
|
||||
import copy
|
||||
|
||||
|
||||
class Composition:
|
||||
def __init__(
|
||||
self,
|
||||
screen: Screen,
|
||||
reactor,
|
||||
atom: Tuple[pt.Electron, pt.Nucleon, Dict] = pt.Atom.placeholder(),
|
||||
):
|
||||
self.screen = screen
|
||||
self.atom = atom
|
||||
from reactor import Reactor
|
||||
|
||||
self.reactor: Reactor = reactor
|
||||
self.reg = dict()
|
||||
|
||||
def regid(self, id_):
|
||||
self.reg[id_] = id_ + str(uuid.uuid4())
|
||||
return self.reg[id_]
|
||||
|
||||
def getid(self, id_):
|
||||
if id_ not in self.reg.keys():
|
||||
return "None"
|
||||
return self.reg[id_]
|
||||
|
||||
def recid(self, id_):
|
||||
return id_[:-36]
|
||||
|
||||
def compose(self):
|
||||
yield Label("示例标签", id="testlabel")
|
||||
yield Button("示例按钮", id="testbtn")
|
||||
|
||||
def handler(self, event, type_):
|
||||
return 1
|
||||
|
||||
|
||||
class Finished(Composition):
|
||||
def __init__(self, screen: Screen, reactor, atom: Tuple[pt.Electron, pt.Nucleon, Dict]):
|
||||
super().__init__(screen, reactor, atom)
|
||||
|
||||
def compose(self):
|
||||
yield Label("本次记忆进程结束", id=self.regid("msg"))
|
||||
|
||||
|
||||
class Placeholder(Composition):
|
||||
def __init__(self, screen: Screen):
|
||||
self.screen = screen
|
||||
|
||||
def compose(self):
|
||||
yield Label("示例标签", id="testlabel")
|
||||
yield Button("示例按钮", id="testbtn", classes="choice")
|
||||
|
||||
def handler(self, event, type_):
|
||||
self.screen.query_one("#testlabel", Label).update("hi")
|
||||
|
||||
|
||||
class Recognition(Composition):
|
||||
def __init__(self, screen: Screen, reactor, atom: Tuple[pt.Electron, pt.Nucleon, Dict]):
|
||||
super().__init__(screen, reactor, atom)
|
||||
|
||||
def compose(self):
|
||||
with Center():
|
||||
yield Static(f"[dim]{self.atom[1]['translation']}[/]")
|
||||
yield Label(f"")
|
||||
s = str(self.atom[1]["content"])
|
||||
replace_dict = {
|
||||
", ": ",",
|
||||
". ": ".",
|
||||
"; ": ";",
|
||||
": ": ":",
|
||||
"/,": ",",
|
||||
"./": ".",
|
||||
"/;": ";",
|
||||
";/": ";",
|
||||
":/": ":",
|
||||
}
|
||||
for old, new in replace_dict.items():
|
||||
s = s.replace(old, new)
|
||||
result = re.split(r"(?<=[,;:|])", s.replace("/", " "))
|
||||
for i in result:
|
||||
with Center():
|
||||
yield Label(
|
||||
f"[b][b]{i.replace('/', ' ')}[/][/]",
|
||||
id=self.regid("sentence" + str(hash(i))),
|
||||
)
|
||||
for i in self.atom[2]["testdata"]["additional_inf"]:
|
||||
if self.atom[1][i]:
|
||||
if isinstance(self.atom[1][i], list):
|
||||
for j in self.atom[1][i]:
|
||||
yield Markdown(f"### {self.atom[2]['keydata'][i]}: {j}")
|
||||
continue
|
||||
if isinstance(self.atom[1][i], Dict):
|
||||
t = ""
|
||||
for j, k in self.atom[1][i].items(): # type: ignore
|
||||
# 弱智的 Pylance 类型推导
|
||||
t += f"> **{j}**: {k} \n"
|
||||
yield Markdown(t, id=self.regid("tran"))
|
||||
with Center():
|
||||
yield Button("我已知晓", id=self.regid("ok"))
|
||||
|
||||
def handler(self, event, type_):
|
||||
if type_ == "button":
|
||||
if event.button.id == self.getid("ok"):
|
||||
self.reactor.report(self.atom, 5)
|
||||
return 0
|
||||
return -1
|
||||
|
||||
|
||||
class BasicEvaluation(Composition):
|
||||
def __init__(self, screen: Screen, reactor, atom: Tuple[pt.Electron, pt.Nucleon, Dict]):
|
||||
super().__init__(screen, reactor, atom)
|
||||
|
||||
def compose(self):
|
||||
yield Label(self.atom[1]["content"], id="sentence")
|
||||
with Container(id="button_container"):
|
||||
btn = {}
|
||||
btn["5"] = Button(
|
||||
"完美回想", variant="success", id=self.regid("feedback5"), classes="choice"
|
||||
)
|
||||
btn["4"] = Button(
|
||||
"犹豫后正确", variant="success", id=self.regid("feedback4"), classes="choice"
|
||||
)
|
||||
btn["3"] = Button(
|
||||
"困难地正确", variant="warning", id=self.regid("feedback3"), classes="choice"
|
||||
)
|
||||
btn["2"] = Button(
|
||||
"错误但熟悉", variant="warning", id=self.regid("feedback2"), classes="choice"
|
||||
)
|
||||
btn["1"] = Button(
|
||||
"错误且不熟", variant="error", id=self.regid("feedback1"), classes="choice"
|
||||
)
|
||||
btn["0"] = Button(
|
||||
"完全空白", variant="error", id=self.regid("feedback0"), classes="choice"
|
||||
)
|
||||
yield Horizontal(btn["5"], btn["4"])
|
||||
yield Horizontal(btn["3"], btn["2"])
|
||||
yield Horizontal(btn["1"], btn["0"])
|
||||
|
||||
def handler(self, event, type_):
|
||||
if "feedback" in event.button.id:
|
||||
assess = int(self.recid(event.button.id)[8:9])
|
||||
ret = self.reactor.report(self.atom, assess)
|
||||
return ret
|
||||
|
||||
|
||||
class FillBlank(Composition):
|
||||
def __init__(self, screen: Screen, reactor, atom: Tuple[pt.Electron, pt.Nucleon, Dict]):
|
||||
super().__init__(screen, reactor, atom)
|
||||
self.inputlist = []
|
||||
self.hashtable = {}
|
||||
self._work()
|
||||
|
||||
def _work(self):
|
||||
self.puzzle = pz.BlankPuzzle(self.atom[1]["content"], 2)
|
||||
self.puzzle.refresh()
|
||||
self.ans = copy.copy(self.puzzle.answer)
|
||||
random.shuffle(self.ans)
|
||||
|
||||
def compose(self):
|
||||
yield Label(self.puzzle.wording, id=self.regid("sentence"))
|
||||
yield Label(f"当前输入: {self.inputlist}", id=self.regid("inputpreview"))
|
||||
for i in self.ans:
|
||||
self.hashtable[str(hash(i))] = i
|
||||
yield Button(i, id=self.regid(f"select{hash(i)}"))
|
||||
yield Button("退格", id=self.regid(f"delete"))
|
||||
|
||||
def handler(self, event, type_):
|
||||
# TODO: 改动:在线错误纠正
|
||||
if type_ == "button":
|
||||
if self.recid(event.button.id) == "delete":
|
||||
if len(self.inputlist) > 0:
|
||||
self.inputlist.pop()
|
||||
else:
|
||||
return 1
|
||||
else:
|
||||
self.inputlist.append(self.hashtable[self.recid(event.button.id)[6:]])
|
||||
if len(self.inputlist) < len(self.puzzle.answer):
|
||||
return 1
|
||||
else:
|
||||
if self.inputlist == self.puzzle.answer:
|
||||
self.reactor.report(self.atom, 4)
|
||||
return 0
|
||||
else:
|
||||
self.inputlist = []
|
||||
self.reactor.report(self.atom, 2)
|
||||
return 1
|
||||
|
||||
|
||||
class DrawCard(Composition):
|
||||
def __init__(self, screen: Screen, reactor, atom: Tuple[pt.Electron, pt.Nucleon, Dict]):
|
||||
super().__init__(screen, reactor, atom)
|
||||
self.inputlist = []
|
||||
self.hashtable = {}
|
||||
self._work()
|
||||
|
||||
def _work(self):
|
||||
self.puzzle = pz.SelectionPuzzle(self.atom[1]["keyword_note"], [], 2, "选择正确词义: ") # type: ignore
|
||||
self.puzzle.refresh()
|
||||
|
||||
def compose(self):
|
||||
yield Label(self.atom[1].content.replace("/",""), id=self.regid("sentence"))
|
||||
yield Label(self.puzzle.wording[len(self.inputlist)], id=self.regid("puzzle"))
|
||||
yield Label(f"当前输入: {self.inputlist}", id=self.regid("inputpreview"))
|
||||
for i in self.puzzle.options[len(self.inputlist)]:
|
||||
self.hashtable[str(hash(i))] = i
|
||||
yield Button(i, id=self.regid(f"select{hash(i)}"))
|
||||
yield Button("退格", id=self.regid(f"delete"))
|
||||
|
||||
def handler(self, event, type_):
|
||||
if type_ == "button":
|
||||
if self.recid(event.button.id) == "delete":
|
||||
if len(self.inputlist) > 0:
|
||||
self.inputlist.pop()
|
||||
else:
|
||||
return 1
|
||||
else:
|
||||
self.inputlist.append(self.hashtable[self.recid(event.button.id)[6:]])
|
||||
if len(self.inputlist) < len(self.puzzle.answer):
|
||||
return 1
|
||||
else:
|
||||
if self.inputlist == self.puzzle.answer:
|
||||
self.reactor.report(self.atom, 4)
|
||||
return 0
|
||||
else:
|
||||
self.inputlist = []
|
||||
self.reactor.report(self.atom, 2)
|
||||
return 1
|
||||
|
||||
|
||||
registry = {
|
||||
"sample": Composition,
|
||||
"recognition": Recognition,
|
||||
"fill_blank_test": FillBlank,
|
||||
"draw_card_test": DrawCard,
|
||||
"basic_evaluation": BasicEvaluation,
|
||||
}
|
||||
|
||||
|
||||
class TestScreen(Screen):
|
||||
def __init__(self):
|
||||
super().__init__(name=None, id=None, classes=None)
|
||||
self.comp = Recognition(self, None, pt.Atom.advanced_placeholder())
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Header(show_clock=True)
|
||||
yield from self.comp.compose()
|
||||
yield Footer()
|
||||
|
||||
def on_mount(self) -> None:
|
||||
pass
|
||||
|
||||
def on_button_pressed(self, event: Event) -> None:
|
||||
self.comp.handler(event, "button")
|
||||
|
||||
def action_quit_app(self) -> None:
|
||||
self.app.exit()
|
||||
|
||||
|
||||
class AppLauncher(App):
|
||||
CSS_PATH = "styles.css"
|
||||
TITLE = "测试布局"
|
||||
BINDINGS = [("escape", "quit", "退出"), ("d", "toggle_dark", "改变色调")]
|
||||
SCREENS = {
|
||||
"testscreen": TestScreen,
|
||||
}
|
||||
|
||||
def on_mount(self) -> None:
|
||||
self.action_toggle_dark()
|
||||
self.push_screen("testscreen")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = AppLauncher()
|
||||
app.run()
|
@@ -1,8 +0,0 @@
|
||||
# [调试] 将更改保存到文件
|
||||
save = 1
|
||||
# [调试] 覆写时间, 设为 -1 以禁用
|
||||
time_override = -1
|
||||
# [调试] 一键通过
|
||||
quick_pass = 0
|
||||
# 对于每个项目的新记忆核子数量
|
||||
tasked_number = 6
|
40
install.bat
40
install.bat
@@ -1,40 +0,0 @@
|
||||
@echo off
|
||||
echo "HeurAMS 环境安装脚本"
|
||||
echo "正在检测系统中是否安装 Python 3.x..."
|
||||
|
||||
rem 检查 Python 3 是否存在
|
||||
where python >nul 2>nul
|
||||
if %errorlevel% neq 0 (
|
||||
echo "错误: 未检测到 Python. 请确保 Python 已添加到系统 PATH 中,然后再次运行此脚本。"
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
rem 检查 Python 版本是否为 3.x
|
||||
for /f "tokens=*" %%i in ('python -c "import sys; print(f'{sys.version_info.major}')"') do set PYTHON_MAJOR_VERSION=%%i
|
||||
if "%PYTHON_MAJOR_VERSION%"=="3" (
|
||||
for /f "tokens=*" %%i in ('python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"') do set PYTHON_VERSION=%%i
|
||||
echo "检测到 Python 3 已安装, 版本为: %PYTHON_VERSION%"
|
||||
) else (
|
||||
echo "错误: 未检测到 Python 3. 请先安装 Python 3, 然后再次运行此脚本."
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo "---"
|
||||
echo "正在安装 requirements.txt 中的依赖..."
|
||||
|
||||
rem 检查 requirements.txt 文件是否存在
|
||||
if exist "requirements.txt" (
|
||||
python -m pip install -r requirements.txt
|
||||
if %errorlevel% equ 0 (
|
||||
echo "依赖安装成功."
|
||||
) else (
|
||||
echo "错误: 依赖安装失败. 请检查 requirements.txt 文件或网络连接."
|
||||
exit /b 1
|
||||
)
|
||||
) else (
|
||||
echo "警告: 未找到 requirements.txt 文件. 跳过依赖安装."
|
||||
)
|
||||
|
||||
echo "---"
|
||||
echo "HeurAMS 的环境依赖已安装"
|
||||
pause
|
28
install.sh
28
install.sh
@@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "HeurAMS 环境安装脚本"
|
||||
echo "正在检测系统中是否安装 Python 3.x..."
|
||||
if command -v python3 &>/dev/null; then
|
||||
PYTHON_VERSION=$(python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
|
||||
echo "检测到 Python 3 已安装, 版本为: ${PYTHON_VERSION}"
|
||||
else
|
||||
echo "错误: 未检测到 Python 3. 请先安装 Python 3, 然后再次运行此脚本. "
|
||||
exit 1 # 退出脚本, 因为 Python 3 是必需的
|
||||
fi
|
||||
|
||||
echo "---"
|
||||
echo "正在安装 requirements.txt 中的依赖..."
|
||||
if [ -f "requirements.txt" ]; then
|
||||
python3 -m pip install -r requirements.txt
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "依赖安装成功. "
|
||||
else
|
||||
echo "错误: 依赖安装失败. 请检查 requirements.txt 文件或网络连接. "
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "警告: 未找到 requirements.txt 文件. 跳过依赖安装. "
|
||||
fi
|
||||
|
||||
echo "---"
|
||||
echo "HeurAMS 的环境依赖已安装"
|
@@ -1 +0,0 @@
|
||||
# 语言模型接入
|
@@ -1,2 +0,0 @@
|
||||
ver = "0.3.5"
|
||||
stage = "prototype"
|
@@ -1,42 +0,0 @@
|
||||
# 散列表的键翻译
|
||||
["keydata"]
|
||||
note = "笔记"
|
||||
keyword_note = "关键词翻译"
|
||||
translation = "语句翻译"
|
||||
|
||||
# 测试项目元数据
|
||||
["testdata"]
|
||||
# 记忆时显示的额外信息
|
||||
additional_inf = ["translation","keyword_note", "note"]
|
||||
# 填空测试, content 指代键名
|
||||
fill_blank_test = {"from"=["content"], "hint"=["translation"]}
|
||||
|
||||
["喇叭/, 唢呐/, 曲儿/小/腔儿/大/"]
|
||||
note = ["用喇叭唢呐比喻宦官,表面写乐器,实则讽刺宦官本事小却官腔十足"]
|
||||
translation = "喇叭和唢呐,吹的曲子虽短,声音却很响亮"
|
||||
keyword_note = {"喇叭" = "铜制管乐器,比喻宦官", "唢呐" = "管乐器,同'锁呐'", "曲儿小" = "曲子很短", "腔儿大" = "声音很响,暗指官腔十足"}
|
||||
|
||||
["官船/来往/乱如麻/, 全仗/你/抬/声价/"]
|
||||
note = ["揭露宦官倚仗皇帝权势作威作福的丑态"]
|
||||
translation = "官船来往频繁乱如麻,全凭借你抬高名誉地位"
|
||||
keyword_note = {"官船" = "官府衙门的船只", "乱如麻" = "形容来往频繁", "仗" = "倚仗,凭借", "声价" = "名誉地位,同'身价'"}
|
||||
|
||||
["军/听了/军愁/, 民/听了/民怕/"]
|
||||
note = ["表现宦官监军扰民,令军民都感到恐惧和忧愁"]
|
||||
translation = "军队听了军队发愁,百姓听了百姓害怕"
|
||||
keyword_note = {"军愁" = "军队因受宦官监军搅扰而发愁", "民怕" = "百姓害怕宦官的欺压"}
|
||||
|
||||
["哪里/去辨/甚么/真共假/?/"]
|
||||
note = ["讽刺世人无法分辨宦官传达的旨意真假,暗指宦官常常假传圣旨"]
|
||||
translation = "哪里会去辨别什么真和假?"
|
||||
keyword_note = {"辨" = "分辨、分别", "甚么" = "同'什么'", "真共假" = "真和假"}
|
||||
|
||||
["眼见/的/吹翻了/这家/, 吹伤了/那家/, "]
|
||||
note = ["具体描写宦官欺压百姓造成的严重后果"]
|
||||
translation = "眼看着使有的人家倾家荡产,有的人家元气大伤"
|
||||
keyword_note = {"吹翻了" = "使倾家荡产", "吹伤了" = "使元气大伤"}
|
||||
|
||||
["只吹/的/水尽/鹅飞/罢/!/"]
|
||||
note = ["用比喻手法表现宦官欺压导致民穷财尽、家破人亡的悲惨结局"]
|
||||
translation = "直吹得江水枯竭鹅飞跑,家破人亡啊!"
|
||||
keyword_note = {"水尽鹅飞" = "比喻民穷财尽,家破人亡", "罢" = "语气词,表示完结"}
|
@@ -1,47 +0,0 @@
|
||||
# 散列表的键翻译
|
||||
["keydata"]
|
||||
note = "笔记"
|
||||
keyword_note = "关键词翻译"
|
||||
translation = "语句翻译"
|
||||
|
||||
# 测试项目元数据
|
||||
["testdata"]
|
||||
# 记忆时显示的额外信息
|
||||
additional_inf = ["translation","keyword_note", "note"]
|
||||
# 填空测试, content 指代键名
|
||||
fill_blank_test = {"from"=["content"], "hint"=["translation"]}
|
||||
|
||||
["燎/沉香/, 消/溽暑/"]
|
||||
note = ["描写夏日焚香消暑的雅致生活场景"]
|
||||
translation = "焚烧沉香,来消除夏日潮湿的暑气"
|
||||
keyword_note = {"燎" = "烧", "沉香" = "一种名贵香料,置水中则下沉", "溽暑" = "潮湿的暑气"}
|
||||
|
||||
["鸟雀/呼晴/, 侵晓/窥檐/语/"]
|
||||
note = ["通过鸟雀欢鸣表现雨后初晴的喜悦气氛"]
|
||||
translation = "快天亮的时候,鸟雀都在屋檐下叫个不停,欢呼天已放晴"
|
||||
keyword_note = {"呼晴" = "唤晴,鸟鸣可占晴雨", "侵晓" = "快天亮的时候", "窥檐语" = "在屋檐下窥视鸣叫"}
|
||||
|
||||
["叶上/初阳/干/宿雨/, 水面/清圆/, 一一/风荷/举/"]
|
||||
note = ["描绘晨光中荷叶挺立的生动画面,'举'字用得极妙"]
|
||||
translation = "初出的阳光晒干了荷叶上昨夜的雨滴,水面上的荷叶清润圆正,迎着晨风,每一片都挺出水面"
|
||||
keyword_note = {"初阳" = "初出的阳光", "宿雨" = "昨夜下的雨", "清圆" = "清润圆正", "风荷举" = "荷叶迎着晨风挺出水面"}
|
||||
|
||||
["故乡/遥/, 何日/去/?/"]
|
||||
note = ["由景生情,转入思乡之情的抒发"]
|
||||
translation = "想到那遥远的故乡,什么时候才能回去啊?"
|
||||
keyword_note = {"故乡遥" = "故乡遥远", "何日去" = "何时能够回去"}
|
||||
|
||||
["家住/吴门/, 久作/长安/旅/"]
|
||||
note = ["点明作者江南人的身份和长期客居京城的境遇"]
|
||||
translation = "我家本在江南一带,却长久地客居汴京"
|
||||
keyword_note = {"吴门" = "泛指江南一带,今江苏苏州", "长安" = "借指北宋都城汴京", "旅" = "客居"}
|
||||
|
||||
["五月/渔郎/相忆/否/?/"]
|
||||
note = ["用反问句式表达对故乡亲友的深切思念"]
|
||||
translation = "又到五月,不知家乡的朋友是否也在思念我?"
|
||||
keyword_note = {"渔郎" = "指故乡的钓鱼朋友", "相忆" = "相互思念"}
|
||||
|
||||
["小楫/轻舟/, 梦入/芙蓉/浦/"]
|
||||
note = ["以梦境作结,表现归乡不得只能在梦中重返故地的惆怅"]
|
||||
translation = "在梦中,我划着一叶小舟,又闯入那西湖的荷花塘中"
|
||||
keyword_note = {"小楫" = "短桨,指划船用具", "轻舟" = "轻快的小船", "芙蓉浦" = "有荷花的水边,指杭州西湖"}
|
@@ -1,72 +0,0 @@
|
||||
# 散列表的键翻译
|
||||
["keydata"]
|
||||
note = "笔记"
|
||||
keyword_note = "关键词翻译"
|
||||
translation = "语句翻译"
|
||||
|
||||
# 测试项目元数据
|
||||
["testdata"]
|
||||
# 记忆时显示的额外信息
|
||||
additional_inf = ["translation","keyword_note", "note"]
|
||||
# 填空测试, content 指代键名
|
||||
fill_blank_test = {"from"=["content"], "hint"=["translation"]}
|
||||
|
||||
["国脉/微/如缕/"]
|
||||
note = ["词人以'如缕'比喻国家命脉衰微脆弱,形势危急"]
|
||||
translation = "国家的命脉已经衰微得像一根细丝"
|
||||
keyword_note = {"国脉" = "国家的命脉", "微" = "衰微", "如缕" = "像丝线一样,形容脆弱"}
|
||||
|
||||
["问/长缨/何时/入手/, 缚将/戎主/?/"]
|
||||
note = ["表达作者渴望投身军旅、为国擒敌的迫切心情"]
|
||||
translation = "试问,捆敌的长绳何时才能到我手中,将敌酋捆绑擒来?"
|
||||
keyword_note = {"长缨" = "长带子,喻指擒敌的武器", "缚将" = "捆绑", "戎主" = "敌人的首领"}
|
||||
|
||||
["未必/人间/无/好汉/, 谁与/宽些/尺度/?/"]
|
||||
note = ["批判当时用人制度僵化,呼吁不拘一格降人才"]
|
||||
translation = "人世间未必没有英雄好汉,只是谁能放宽用人的标准呢?"
|
||||
keyword_note = {"好汉" = "英雄豪杰", "尺度" = "标准,这里指用人标准"}
|
||||
|
||||
["试看取/当年/韩五/"]
|
||||
note = ["韩世忠虽出身行伍却成为抗金名将,说明人才不一定需要名师传授"]
|
||||
translation = "试看当年的韩世忠将军"
|
||||
keyword_note = {"韩五" = "南宋抗金名将韩世忠,排行第五"}
|
||||
|
||||
["岂有/谷城公/付授/, 也不干/曾遇/骊山母/"]
|
||||
note = ["用典说明韩世忠的成功并非依靠神仙指点或名师传授"]
|
||||
translation = "他既没有得到谷城公的传授,也不曾遇见骊山老母"
|
||||
keyword_note = {"谷城公" = "即黄石公,传说曾向张良传授兵书", "骊山母" = "道教女仙,传说曾向李筌讲解《阴符》"}
|
||||
|
||||
["谈笑起/, 两河路/"]
|
||||
note = ["形容韩世忠指挥若定,在河北地区大败金兵"]
|
||||
translation = "却在谈笑间指挥大军,收复河北失地"
|
||||
keyword_note = {"两河路" = "指宋代河北东路和河北西路,即今河北、山西、河南部分地区"}
|
||||
|
||||
["少时/棋柝/曾/联句/"]
|
||||
note = ["回忆作者年轻时在军中的生活经历"]
|
||||
translation = "年轻时曾在军营中一边下棋一边联句作诗"
|
||||
keyword_note = {"棋柝" = "下棋和打更", "联句" = "多人合作写诗,每人一句或几句"}
|
||||
|
||||
["叹/而今/登楼/揽镜/, 事机/频误/"]
|
||||
note = ["抒发作者年老力衰、壮志未酬的感慨"]
|
||||
translation = "可叹如今登楼远望、揽镜自照,已力不从心,多次错过了报国机会"
|
||||
keyword_note = {"登楼揽镜" = "上楼照镜,慨叹功业未建人已衰老", "事机" = "机会,指从军报国的机会"}
|
||||
|
||||
["闻说/北风/吹面/急/, 边上/冲梯/屡舞/"]
|
||||
note = ["描绘边境危急,蒙古军攻势凶猛"]
|
||||
translation = "听说北风凛冽(暗示蒙古军南侵),边境上敌军攻城的冲车云梯不断飞舞"
|
||||
keyword_note = {"北风" = "暗指北来的蒙古兵", "冲梯" = "冲车和云梯,古代攻城器具"}
|
||||
|
||||
["君/莫道/投鞭/虚语/"]
|
||||
note = ["警告不要轻视敌军实力,用苻坚投鞭断流的典故"]
|
||||
translation = "你不要认为'投鞭断流'只是空话(喻敌军强大)"
|
||||
keyword_note = {"投鞭" = "前秦苻坚曾说投鞭长江可断流,形容兵多将广"}
|
||||
|
||||
["自古/一贤/能/制难/, 有/金汤/便可/无/张许/?/"]
|
||||
note = ["反问强调贤才比坚固城池更重要"]
|
||||
translation = "自古以来,一位贤才就能解除危难,难道有了坚固城池就可以没有张巡、许远这样的良将吗?"
|
||||
keyword_note = {"制难" = "解除危难", "金汤" = "金城汤池,比喻坚固的防御工事", "张许" = "张巡和许远,唐代安史之乱中死守睢阳的名将"}
|
||||
|
||||
["快/投笔/, 莫/题柱/"]
|
||||
note = ["呼吁文人弃文从武,为国效力"]
|
||||
translation = "赶快像班超那样投笔从戎,不要像司马相如那样只追求功名利禄"
|
||||
keyword_note = {"投笔" = "投笔从戎,用汉代班超典故", "题柱" = "用司马相如题桥柱追求功名的典故"}
|
@@ -1,42 +0,0 @@
|
||||
# 散列表的键翻译
|
||||
["keydata"]
|
||||
note = "笔记"
|
||||
keyword_note = "关键词翻译"
|
||||
translation = "语句翻译"
|
||||
|
||||
# 测试项目元数据
|
||||
["testdata"]
|
||||
# 记忆时显示的额外信息
|
||||
additional_inf = ["translation","keyword_note", "note"]
|
||||
# 填空测试, content 指代键名
|
||||
fill_blank_test = {"from"=["content"], "hint"=["translation"]}
|
||||
|
||||
["东风/夜放/花千树/, 更/吹落/、/星/如雨/"]
|
||||
note = ["描写元宵夜灯火辉煌的景象,用夸张手法表现花灯之多如千树花开"]
|
||||
translation = "东风吹开了元宵夜的火树银花,花灯灿烂,就像千树花开"
|
||||
keyword_note = {"花千树" = "花灯之多如千树开花", "星如雨" = "焰火纷纷,乱落如雨"}
|
||||
|
||||
["宝马/雕车/香/满路/"]
|
||||
note = ["描绘元宵节繁华街道上豪华马车往来不绝的盛况"]
|
||||
translation = "豪华的马车在飘香的街道行过"
|
||||
keyword_note = {"宝马雕车" = "豪华的马车", "香满路" = "香气弥漫整条街道"}
|
||||
|
||||
["凤箫/声动/, 玉壶/光转/, 一夜/鱼龙/舞/"]
|
||||
note = ["描写元宵夜音乐悠扬、月光流转、灯舞不停的欢乐场景"]
|
||||
translation = "悠扬的凤箫声四处回荡,玉壶般的明月渐渐转向西边,一夜舞动鱼灯、龙灯不停歇"
|
||||
keyword_note = {"凤箫" = "箫的美称", "玉壶" = "比喻明月,亦可指灯", "鱼龙舞" = "舞动鱼形、龙形的彩灯"}
|
||||
|
||||
["蛾儿/雪柳/黄金缕/, 笑语/盈盈/暗香/去/"]
|
||||
note = ["描写元宵节妇女们盛装出游、笑语盈盈的热闹场面"]
|
||||
translation = "美人头上都戴着华丽的饰物,笑语盈盈地随人群走过,只有衣香犹在暗中飘散"
|
||||
keyword_note = {"蛾儿" = "古代妇女元宵节的头饰", "雪柳" = "古代妇女元宵节的饰物", "黄金缕" = "头饰上的金丝绦", "盈盈" = "仪态娇美的样子", "暗香" = "女性身上散发出来的香气"}
|
||||
|
||||
["众里/寻他/千百度/"]
|
||||
note = ["表达在人群中反复寻找意中人的执着心情"]
|
||||
translation = "我在人群中寻找她千百回"
|
||||
keyword_note = {"千百度" = "千百遍,形容次数极多"}
|
||||
|
||||
["蓦然/回首/, 那人/却在/, 灯火/阑珊/处/"]
|
||||
note = ["最后发现意中人却在冷清之处,意境深远,成为千古名句"]
|
||||
translation = "猛然回头,不经意间却在灯火将尽未尽之处发现了她"
|
||||
keyword_note = {"蓦然" = "突然,猛然", "阑珊" = "暗淡、零落,指灯火稀疏的地方"}
|
@@ -1,93 +0,0 @@
|
||||
# Wang Zhiyu 2025
|
||||
# Nucleon 是 HeurAMS 软件项目使用的专有源文件格式 (格式版本 v1, 基于 toml 格式)
|
||||
# 建议使用的 MIME 类型: application/vnd.xyz.imwangzhiyu.heurams-nucleon.v1+toml
|
||||
|
||||
# 散列表的键翻译
|
||||
["keydata"]
|
||||
note = "笔记"
|
||||
keyword_note = "关键词翻译"
|
||||
translation = "语句翻译"
|
||||
|
||||
# 测试项目元数据
|
||||
["testdata"]
|
||||
# 记忆时显示的额外信息
|
||||
additional_inf = ["translation","keyword_note", "note"]
|
||||
# 填空测试, content 指代键名
|
||||
fill_blank_test = {"from"=["content"], "hint"=["translation"]}
|
||||
# 选择题测试
|
||||
draw_card_test = {"from"=["keyword_note"]}
|
||||
|
||||
["君子/曰: /学/不可以/已./"]
|
||||
note = []
|
||||
translation = "君子说: 学习是不可以停止的"
|
||||
keyword_note = {"君子"="指有学问有修养的人", "已"="停止"}
|
||||
|
||||
["青/, 取之/于蓝/, 而/青/于蓝/; /冰/, 水/为之/, 而/寒/于水./"]
|
||||
note = []
|
||||
translation = "靛青是从蓝草里提取的, 可是比蓝草的颜色更深; 冰是水凝结而成的, 却比水还要寒冷"
|
||||
keyword_note = {"青"="靛青, 一种染料", "蓝"="蓼蓝, 一年生草本植物, 叶子含蓝汁, 可以做蓝色染料"}
|
||||
|
||||
["木直/中绳/, 𫐓/以为/轮/, 其曲/中规./"]
|
||||
note = []
|
||||
translation = "一块木材直得合乎墨线, 假如用火烤使它弯曲做成车轮, 它的弧度就可以符合圆规的标准"
|
||||
keyword_note = {"中绳"="合乎拉直的墨线", "𫐓"="通'煣', 古代用火烤使木条弯曲的一种工艺", "规"="圆规, 画圆的工具"}
|
||||
|
||||
["虽/有/槁暴/, 不复/挺者/, 𫐓/使之/然也./"]
|
||||
note = []
|
||||
translation = "即使又被风吹日晒而干枯了, 木材也不会再挺直, 是因为经过加工使它成为这样的"
|
||||
keyword_note = {"有"="通'又'", "槁暴"="晒干。槁, 枯。暴, 同'曝', 晒干", "挺"="直"}
|
||||
|
||||
["故/木/受绳/则直/, 金/就砺/则利/, 君子/博学/而/日/参省/乎己/, 则/知明/而/行/无过矣./"]
|
||||
note = []
|
||||
translation = "所以木材用墨线量过再经辅具加工就能取直, 刀剑在磨刀石上磨过就能变得锋利, 君子广泛地学习并且每天检验反省自己, 那么他就会智慧明达而且行为没有过失了"
|
||||
keyword_note = {"受绳"="用墨线量过", "金"="指金属制的刀剑等", "就砺"="拿到磨刀石上去磨", "博学"="广泛地学习", "参省"="检验反省。参, 一译检验, 检查; 二译同'叁', 多次", "知"="同'智', 见识"}
|
||||
|
||||
["吾尝/终日/而思矣/, 不如/须臾/之所学也/; /吾尝/跂/而望矣/, 不如/登高/之博见也./"]
|
||||
note = []
|
||||
translation = "我曾经整天思索, 却不如片刻学到的知识多; 我曾经踮起脚远望, 却不如登到高处看得广阔"
|
||||
keyword_note = {"须臾"="片刻, 一会儿", "跂"="踮起脚后跟", "博见"="看见的范围广, 见得广"}
|
||||
|
||||
["登高/而招/, 臂/非加长也/, 而/见者/远/; /顺风/而呼/, 声/非加疾也/, 而/闻者/彰./"]
|
||||
note = []
|
||||
translation = "登到高处招手, 胳膊没有加长, 可是别人在远处也能看见; 顺着风呼叫, 声音没有变得洪亮, 可是听的人在远处也能听得很清楚"
|
||||
keyword_note = {"疾"="声音洪大", "彰"="明显, 清楚。这里指听得更清楚"}
|
||||
|
||||
["假/舆马者/, 非/利足也/, 而/致/千里/; /假/舟楫者/, 非/能水也/, 而/绝/江河./"]
|
||||
note = []
|
||||
translation = "借助车马的人, 并不是脚走得快, 却可以达到千里之外; 借助舟船的人, 并不善于游泳, 却可以横渡江河"
|
||||
keyword_note = {"假"="凭借, 利用", "舆"="车厢, 这里指车", "利足"="脚走得快", "水"="游泳", "绝"="横渡"}
|
||||
|
||||
["君子/生/非异也/, 善/假于/物也./"]
|
||||
note = []
|
||||
translation = "君子的资质秉性跟一般人没有不同, 只是君子善于借助外物罢了"
|
||||
keyword_note = {"生"="通'性', 天赋, 资质"}
|
||||
|
||||
["积土/成山/, 风雨/兴焉/; /积水/成渊/, 蛟龙/生焉/; /积善/成德/, 而/神明/自得/, 圣心/备焉./"]
|
||||
note = []
|
||||
translation = "堆积土石成了高山, 风雨从这里兴起; 汇积水流成为深渊, 蛟龙从这儿产生; 积累善行养成高尚的道德, 精神得到提升, 圣人的心境由此具备"
|
||||
keyword_note = {"神明"="精神", "圣心"="圣人的心境"}
|
||||
|
||||
["故/不积/跬步/, 无以/至/千里/; /不积/小流/, 无以/成/江海./"]
|
||||
note = []
|
||||
translation = "所以不积累一步半步的行程, 就没有办法达到千里之远; 不积累细小的流水, 就没有办法汇成江河大海"
|
||||
keyword_note = {"跬"="行走时两脚之间的距离, 等于现在所说的一步、古人所说的半步", "步"="古人说一步, 指左右脚都向前迈一次的距离, 等于现在的两步"}
|
||||
|
||||
["骐骥/一跃/, 不能/十步/; /驽马/十驾/, 功在/不舍./"]
|
||||
note = []
|
||||
translation = "骏马一跨跃, 也不足十步远; 劣马连走十天, 它的成功在于不停止"
|
||||
keyword_note = {"骐骥"="骏马, 千里马", "驽马"="劣马", "十驾"="劣马拉车连走十天也能到达。驾, 古代马拉车时, 早晨套一上车, 晚上卸去。套车叫驾, 所以这里用'驾'指代马车一天的行程", "舍"="舍弃。指不放弃行路"}
|
||||
|
||||
["锲/而舍之/, 朽木/不折/; /锲/而不舍/, 金石/可镂./"]
|
||||
note = []
|
||||
translation = "如果刻几下就停下来了, 那么腐朽的木头也刻不断。如果不停地刻下去, 那么金石也能雕刻成功"
|
||||
keyword_note = {"锲"="用刀雕刻", "镂"="原指在金属上雕刻, 泛指雕刻"}
|
||||
|
||||
["蚓/无/爪牙/之利/, 筋骨/之强/, 上/食/埃土/, 下/饮/黄泉/, 用心/一也./"]
|
||||
note = []
|
||||
translation = "蚯蚓没有锐利的爪子和牙齿, 强健的筋骨, 却能向上吃到泥土, 向下喝到地下的泉水, 这是由于它用心专一"
|
||||
keyword_note = {"黄泉"="地下的泉水", "一"="专一"}
|
||||
|
||||
["蟹/六跪/而/二螯/, 非/蛇鳝/之穴/无可/寄托者/, 用心/躁也./"]
|
||||
note = []
|
||||
translation = "螃蟹有六条腿, 两个蟹钳, 但是没有蛇、鳝的洞穴它就无处藏身, 这是因为它用心浮躁"
|
||||
keyword_note = {"六跪"="六条腿。蟹实际上是八条腿。跪, 蟹脚", "螯"="螃蟹等节肢动物身前的大爪, 形如钳", "蛇鳝"="异文'蛇蟮'", "躁"="浮躁, 不专心"}
|
158
nucleon/师说.toml
158
nucleon/师说.toml
@@ -1,158 +0,0 @@
|
||||
# Wang Zhiyu 2025
|
||||
# Nucleon 是 HeurAMS 软件项目使用的专有源文件格式 (格式版本 v1, 基于 toml 格式)
|
||||
# 建议使用的 MIME 类型: application/vnd.xyz.imwangzhiyu.heurams-nucleon.v1+toml
|
||||
|
||||
# 散列表的键翻译
|
||||
["keydata"]
|
||||
note = "笔记"
|
||||
keyword_note = "关键词翻译"
|
||||
translation = "语句翻译"
|
||||
|
||||
# 测试项目元数据
|
||||
["testdata"]
|
||||
# 记忆时显示的额外信息
|
||||
additional_inf = ["translation","keyword_note", "note"]
|
||||
# 填空测试, content 指代键名
|
||||
fill_blank_test = {"from"=["content"], "hint"=["translation"]}
|
||||
# 选择题测试
|
||||
draw_card_test = {"from"=["keyword_note"]}
|
||||
|
||||
["古之/学者/必有/师./"]
|
||||
note = ["学者:求学的人"]
|
||||
translation = "古代求学的人一定有老师"
|
||||
keyword_note = {"学者"="求学的人"}
|
||||
|
||||
["师者/, 所以/传道/受业/解惑/也./"]
|
||||
note = ["受:通'授',传授,讲授"]
|
||||
translation = "老师是传授道理,教授学业,解决疑难问题的人"
|
||||
keyword_note = {"传道"="传授道理", "受业"="教授学业", "解惑"="解决疑难问题", "受"="通'授',传授"}
|
||||
|
||||
["人非/生而/知之/者/, 孰能/无惑/?/"]
|
||||
note = []
|
||||
translation = "人不是生下来就懂得道理的,谁能没有疑惑"
|
||||
keyword_note = {"孰能"="谁能"}
|
||||
|
||||
["惑而/不从/师/, 其/为惑/也/, 终/不解/矣./"]
|
||||
note = []
|
||||
translation = "有疑惑却不跟从老师学习,他所存在的疑惑,就始终不能解决"
|
||||
keyword_note = {"终"="始终"}
|
||||
|
||||
["生乎/吾前/, 其/闻道/也/固/先乎/吾/, 吾/从而/师之/;/"]
|
||||
note = []
|
||||
translation = "在我之前出生的人,他懂得道理本来就比我早,我跟从他,拜他为师"
|
||||
keyword_note = {"闻道"="懂得道理", "固"="本来", "师之"="以他为师"}
|
||||
|
||||
["生乎/吾后/, 其/闻道/也/亦/先乎/吾/, 吾/从而/师之/./"]
|
||||
note = []
|
||||
translation = "在我之后出生的人,他懂得道理如果也比我早,我也跟从他学习,把他当作老师"
|
||||
keyword_note = {"亦"="也"}
|
||||
|
||||
["吾/师道/也/, 夫/庸知/其年/之/先后/生于/吾乎/?/"]
|
||||
note = []
|
||||
translation = "我学习的是道理,哪里管他的年龄比我大还是比我小呢"
|
||||
keyword_note = {"师道"="学习道理", "庸知"="哪里管"}
|
||||
|
||||
["是故/无贵/无贱/, 无长/无少/, 道之/所存/, 师之/所存/也./"]
|
||||
note = []
|
||||
translation = "因此,不论地位显贵还是地位低下,不论年长年少,道理存在的地方,就是老师存在的地方"
|
||||
keyword_note = {"是故"="因此", "所存"="存在的地方"}
|
||||
|
||||
["嗟乎!/ 师道/之/不传/也/久矣!/ 欲人/之/无惑/也/难矣!/"]
|
||||
note = []
|
||||
translation = "唉!从师学习的风尚没有流传已经很久了,想要人们没有疑惑很难呐"
|
||||
keyword_note = {"嗟乎"="感叹词,唉", "师道"="从师学习的风尚"}
|
||||
|
||||
["古之/圣人/, 其/出人/也/远矣/, 犹且/从师/而问/焉/;/"]
|
||||
note = []
|
||||
translation = "古代的圣人,他们超过一般人很远了,尚且跟从老师向老师请教"
|
||||
keyword_note = {"出人"="超出一般人", "犹且"="尚且"}
|
||||
|
||||
["今之/众人/, 其/下/圣人/也/亦/远矣/, 而/耻学/于师/./"]
|
||||
note = []
|
||||
translation = "现在的一般人,他们跟圣人相比相差很远了,却以向老师学为羞耻"
|
||||
keyword_note = {"众人"="一般人", "下"="低于,不如", "耻学于师"="以向老师学习为耻"}
|
||||
|
||||
["是故/圣/益圣/, 愚/益愚/./"]
|
||||
note = []
|
||||
translation = "所以圣人就更加圣明,愚人就更加愚昧"
|
||||
keyword_note = {"益"="更加"}
|
||||
|
||||
["圣人/之/所以/为圣/, 愚人/之/所以/为愚/, 其/皆/出于/此乎!/"]
|
||||
note = []
|
||||
translation = "圣人之所以成为圣人,愚人之所以成为愚人,大概都是这个原因引起的吧"
|
||||
keyword_note = {"所以"="...的原因", "其"="大概"}
|
||||
|
||||
["爱/其子/, 择师/而教/之/;/ 于/其身/也/, 则/耻师/焉/, 惑矣/./"]
|
||||
note = []
|
||||
translation = "众人喜爱他们的孩子,选择老师教育孩子;他们自己呢,却以从师学习为耻,这真是糊涂啊"
|
||||
keyword_note = {"其身"="他们自己", "耻师"="以从师为耻", "惑"="糊涂"}
|
||||
|
||||
["彼/童子/之师/, 授之/书/而习/其/句读/者/, 非/吾/所谓/传其道/解其惑/者也/./"]
|
||||
note = ["句读:也叫句逗。古代称文辞意尽处为句,语意未尽而须停顿处为读"]
|
||||
translation = "那孩子的老师,教他们读书,学习书中的文句,并不是我所说的给人传授道理,给人解释疑惑的老师"
|
||||
keyword_note = {"句读"="文句停顿", "所谓"="所说的"}
|
||||
|
||||
["句读/之/不知/, 惑之/不解/, 或/师焉/, 或/不焉/, 小学/而/大遗/, 吾/未见/其明/也/./"]
|
||||
note = ["不:通'否',表否定"]
|
||||
translation = "不理解文句,疑惑得不到解决,有的向老师学习,有的却不向老师求教,小的方面学习,大的方面却放弃了,我看不出他们有什么明智的呢"
|
||||
keyword_note = {"或"="有的", "不"="通'否'", "小学"="小的方面学习", "大遗"="大的方面放弃"}
|
||||
|
||||
["巫医/乐师/百工/之人/, 不耻/相师/./"]
|
||||
note = ["巫医:古代用祝祷、占卜等迷信方法或兼用药物医治疾病为业的人", "百工:泛指手工业者"]
|
||||
translation = "医生,乐师及各种工匠,不以互相学习为耻"
|
||||
keyword_note = {"巫医"="医生", "乐师"="音乐师", "百工"="各种工匠", "不耻相师"="不以互相学习为耻"}
|
||||
|
||||
["士大夫/之族/, 曰师/曰弟子/云者/, 则/群聚/而笑/之/./"]
|
||||
note = []
|
||||
translation = "士大夫这类人中,如有人称人家为老师,称自己为学生,这些人就聚集在一起嘲笑他"
|
||||
keyword_note = {"族"="类", "云者"="如此说"}
|
||||
|
||||
["问之/, 则曰/:/“彼与/彼年/相若/也/, 道/相似/也/./"]
|
||||
note = []
|
||||
translation = "问那些嘲笑者,他们就说:那个人与某人年龄相近,修养和学业也差不多"
|
||||
keyword_note = {"相若"="相近", "相似"="差不多"}
|
||||
|
||||
["位卑/则/足羞/, 官盛/则/近谀/.”/"]
|
||||
note = []
|
||||
translation = "以地位低的人为师,足以感到羞愧,称官位高的人为师就近于谄媚"
|
||||
keyword_note = {"位卑"="地位低", "足羞"="足以羞愧", "官盛"="官位高", "近谀"="近于谄媚"}
|
||||
|
||||
["呜呼!/ 师道/之/不复/, 可知/矣/./"]
|
||||
note = []
|
||||
translation = "啊!从师学习的风尚不能恢复,由此就可以知道了"
|
||||
keyword_note = {"不复"="不能恢复"}
|
||||
|
||||
["巫医/乐师/百工/之人/, 君子/不齿/, 今/其智/乃/反不能/及/, 其/可怪/也欤!/"]
|
||||
note = ["不齿:不屑与之同列,表示鄙视"]
|
||||
translation = "医生、乐师及各种工匠,士大夫之类的人是不屑与他们为伍的,现在士大夫们的智慧反而不如他们。难道值得奇怪吗"
|
||||
keyword_note = {"君子"="士大夫", "不齿"="不屑为伍", "乃"="反而", "及"="如"}
|
||||
|
||||
["圣人/无常/师/./ 孔子/师/郯子/、/苌弘/、/师襄/、/老聃/./"]
|
||||
note = ["郯子:春秋时郯国国君", "苌弘:周敬王大夫", "师襄:鲁国乐官", "老聃:即老子"]
|
||||
translation = "圣人没有固定的老师,孔子曾经以郯子、苌弘、师襄、老聃为师"
|
||||
keyword_note = {"常师"="固定的老师"}
|
||||
|
||||
["郯子/之徒/, 其/贤/不及/孔子/./"]
|
||||
note = []
|
||||
translation = "郯子这一类人,他们的道德才能不如孔子"
|
||||
keyword_note = {"之徒"="这一类人", "贤"="道德才能", "不及"="不如"}
|
||||
|
||||
["孔子/曰/:/三人/行/, 则/必有/我师/./"]
|
||||
note = []
|
||||
translation = "孔子说:几个人走在一起,其中就一定有我的老师"
|
||||
keyword_note = {"三人行"="几个人一起走"}
|
||||
|
||||
["是故/弟子/不必/不如/师/, 师/不必/贤于/弟子/, 闻道/有/先后/, 术业/有/专攻/, 如是/而已/./"]
|
||||
note = []
|
||||
translation = "因此学生不一定不如老师,老师也不一定比弟子强,听闻道理有先有后,学问和技艺上各有各的主攻方向,像这样罢了"
|
||||
keyword_note = {"不必"="不一定", "贤于"="比...强", "术业"="学问技艺", "专攻"="专门研究", "而已"="罢了"}
|
||||
|
||||
["李氏/子蟠/, 年/十七/, 好/古文/, 六艺/经传/皆/通习/之/, 不拘/于时/, 学/于余/./"]
|
||||
note = ["六艺经传:六经的经文和传文"]
|
||||
translation = "李蟠,十七岁,爱好古文,六经的经文和传文都普遍学习了,不被世俗的限制,向我学习"
|
||||
keyword_note = {"好"="爱好", "古文"="先秦文章", "六艺经传"="六经的经文和传文", "通习"="普遍学习", "不拘于时"="不被时俗限制"}
|
||||
|
||||
["余/嘉/其/能行/古道/, 作/《师说》/以/贻之/./"]
|
||||
note = []
|
||||
translation = "我赞许他能遵行古人从师学习的风尚,特别写了这篇《师说》来赠给他"
|
||||
keyword_note = {"嘉"="赞许", "古道"="古人风尚", "贻"="赠送"}
|
@@ -1,243 +0,0 @@
|
||||
# Wang Zhiyu 2025
|
||||
# Nucleon 是 HeurAMS 软件项目使用的专有源文件格式 (格式版本 v1, 基于 toml 格式)
|
||||
# 建议使用的 MIME 类型: application/vnd.xyz.imwangzhiyu.heurams-nucleon.v1+toml
|
||||
|
||||
# 散列表的键翻译
|
||||
["keydata"]
|
||||
note = "笔记"
|
||||
keyword_note = "关键词翻译"
|
||||
translation = "语句翻译"
|
||||
|
||||
# 测试项目元数据
|
||||
["testdata"]
|
||||
# 记忆时显示的额外信息
|
||||
additional_inf = ["translation","keyword_note", "note"]
|
||||
# 填空测试, content 指代键名
|
||||
fill_blank_test = {"from"=["content"], "hint"=["translation"]}
|
||||
# 选择题测试
|
||||
draw_card_test = {"from"=["keyword_note"]}
|
||||
|
||||
["余家贫/, 耕植/不足/以自给./"]
|
||||
note = []
|
||||
translation = "我家境贫困,靠种田不能够自给"
|
||||
keyword_note = {"耕植"="耕田植桑", "自给"="自己供给自己"}
|
||||
|
||||
["幼稚/盈室/, 瓶/无/储粟/, 生生/所资/, 未见/其术./"]
|
||||
note = []
|
||||
translation = "孩子很多,米瓮里没有存粮,维持生活所需的一切东西,找不到取得的办法"
|
||||
keyword_note = {"幼稚"="孩童", "盈室"="满屋", "瓶"="米瓮", "储粟"="存粮", "生生"="维持生计", "所资"="所需的东西", "术"="方法"}
|
||||
|
||||
["亲故/多劝/余/为/长吏/, 脱然/有怀/, 求之/靡途./"]
|
||||
note = []
|
||||
translation = "亲友大都劝我去做官,我心里也有这个念头,可是求取官职缺少门路"
|
||||
keyword_note = {"亲故"="亲友", "长吏"="较高职位的县吏", "脱然"="不经意的样子", "有怀"="心有所动", "靡途"="没有门路"}
|
||||
|
||||
["会/有/四方/之事/, 诸侯/以/惠爱/为德/, 家叔/以/余/贫苦/, 遂/见用/于/小邑./"]
|
||||
note = []
|
||||
translation = "恰巧遇到四方勤王的大事,诸侯大臣都以广施惠爱作为美德,叔父也因为我家境贫苦(替我设法),我就被委任到小县做官"
|
||||
keyword_note = {"会有"="恰巧遇到", "四方之事"="出使到外地的事情", "诸侯"="州郡长官", "惠爱"="广施惠爱", "家叔"="叔父陶夔", "见用于"="被委任到", "小邑"="小县"}
|
||||
|
||||
["于时/风波/未静/, 心/惮/远役/, 彭泽/去家/百里/, 公田/之利/, 足以/为酒./"]
|
||||
note = []
|
||||
translation = "那时社会动荡不安,心里也惧怕到远地当官。彭泽县离家只有百余里路程,公田收获的粮食,足够造酒饮用"
|
||||
keyword_note = {"风波"="社会动荡", "未静"="不安定", "惮"="惧怕", "远役"="到远地当官", "彭泽"="县名", "去家"="离家", "公田"="官田", "为酒"="造酒"}
|
||||
|
||||
["故/便/求之./ 及/少日/, 眷然/有/归欤/之情./"]
|
||||
note = []
|
||||
translation = "故而就向叔父谋求这个官职。等到过了一些日子,很怀念家乡,便有归去的心愿"
|
||||
keyword_note = {"求之"="谋求这个官职", "少日"="过了一些日子", "眷然"="思恋的样子", "归欤之情"="回去的心情"}
|
||||
|
||||
["何则/?/ 质性/自然/, 非/矫厉/所得./"]
|
||||
note = []
|
||||
translation = "那是为什么?我本性任其自然,这是勉强不得的"
|
||||
keyword_note = {"何则"="为什么", "质性"="本性", "自然"="任其自然", "矫厉"="造作勉强"}
|
||||
|
||||
["饥冻/虽切/, 违己/交病./"]
|
||||
note = []
|
||||
translation = "饥寒虽然来得急迫,但是违背本意去做官,使我身心都感痛苦"
|
||||
keyword_note = {"虽切"="虽然急迫", "违己"="违背本意", "交病"="身心痛苦"}
|
||||
|
||||
["尝/从/人事/, 皆/口腹/自役./"]
|
||||
note = []
|
||||
translation = "过去为官做事,都是为了口腹而役使自己"
|
||||
keyword_note = {"从人事"="从事于仕途人事交往", "口腹自役"="为了口腹需要而驱使自己"}
|
||||
|
||||
["于是/怅然/慷慨/, 深愧/平生/之志./"]
|
||||
note = []
|
||||
translation = "于是惆怅感慨,为平生的抱负未能实现而深感惭愧"
|
||||
keyword_note = {"怅然"="失意的样子", "慷慨"="感慨", "平生之志"="平生的抱负"}
|
||||
|
||||
["犹望/一稔/, 当/敛裳/宵逝./"]
|
||||
note = []
|
||||
translation = "只再等上一年,便收拾行装连夜离去"
|
||||
keyword_note = {"犹望"="还希望", "一稔"="公田收获一次", "敛裳"="收拾行装", "宵逝"="连夜离去"}
|
||||
|
||||
["寻/程氏妹/丧于/武昌/, 情/在/骏奔/, 自免/去职./"]
|
||||
note = []
|
||||
translation = "不久,嫁到程家的妹妹在武昌去世,去吊丧的心情像骏马奔驰一样急迫,自己请求免去官职"
|
||||
keyword_note = {"寻"="不久", "程氏妹"="嫁给程家的妹妹", "丧于"="在...去世", "骏奔"="像骏马奔驰一样急迫", "自免"="自己请求免去", "去职"="离职"}
|
||||
|
||||
["仲秋/至冬/, 在官/八十/余日./"]
|
||||
note = []
|
||||
translation = "自立秋第二个月到冬天,在职共八十多天"
|
||||
keyword_note = {"仲秋"="农历八月", "在官"="在职"}
|
||||
|
||||
["因事/顺心/, 命篇/曰/《/归去来兮/》./"]
|
||||
note = []
|
||||
translation = "因辞官而顺遂了心愿,写了一篇文章,题目叫《归去来兮》"
|
||||
keyword_note = {"因事"="因辞官之事", "顺心"="顺遂心愿", "命篇"="命名文章"}
|
||||
|
||||
["归去/来兮/, 田园/将芜/胡不归/?/"]
|
||||
note = []
|
||||
translation = "回家去吧!田园快要荒芜了,为什么不回去呢?"
|
||||
keyword_note = {"归去来兮"="回去吧", "将芜"="快要荒芜", "胡不归"="为什么不回去"}
|
||||
|
||||
["既/自以/心为/形役/, 奚/惆怅/而/独悲/?/"]
|
||||
note = []
|
||||
translation = "既然自己使心为身所驱役,又何必怅惘而独自悲戚呢?"
|
||||
keyword_note = {"心为形役"="心神被形体役使", "奚"="为什么", "惆怅"="怅惘", "独悲"="独自悲戚"}
|
||||
|
||||
["悟/已往/之/不谏/, 知/来者/之/可追./"]
|
||||
note = []
|
||||
translation = "我已明悟过去的错误已经不可挽回,未来的事还来得及补救"
|
||||
keyword_note = {"已往"="过去", "不谏"="不可挽回", "来者"="未来的事", "可追"="可以补救"}
|
||||
|
||||
["实/迷途/其/未远/, 觉/今是/而/昨非./"]
|
||||
note = []
|
||||
translation = "我确实走入了迷途,但还不算太远,已觉悟如今的做法是对的,而曾经的行为是错的"
|
||||
keyword_note = {"迷途"="走入迷途", "其"="但", "未远"="不算太远", "今是"="现在正确", "昨非"="过去错误"}
|
||||
|
||||
["舟/遥遥/以/轻飏/, 风/飘飘/而/吹衣./"]
|
||||
note = []
|
||||
translation = "船在水面上轻轻地飘荡着前进,微风吹拂着衣裳,衣袂翩翩"
|
||||
keyword_note = {"遥遥"="飘摇放流", "轻飏"="轻轻地飘荡", "飘飘"="微风吹拂"}
|
||||
|
||||
["问/征夫/以/前路/, 恨/晨光/之/熹微./"]
|
||||
note = []
|
||||
translation = "向行人打听前面的路程,遗憾的是天刚刚放亮"
|
||||
keyword_note = {"征夫"="行人", "前路"="前面的路程", "恨"="遗憾", "熹微"="天色微明"}
|
||||
|
||||
["乃/瞻/衡宇/, 载欣/载奔./"]
|
||||
note = []
|
||||
translation = "刚刚看到自己简陋的家门,心中欣喜,奔跑过去"
|
||||
keyword_note = {"乃"="刚刚", "瞻"="看见", "衡宇"="横木为门的简陋房屋", "载欣载奔"="一边高兴一边奔跑"}
|
||||
|
||||
["僮仆/欢迎/, 稚子/候门./"]
|
||||
note = []
|
||||
translation = "家中童仆欢喜地前来迎接,孩子们守候在门前"
|
||||
keyword_note = {"僮仆"="童仆", "欢迎"="欢喜迎接", "稚子"="幼儿", "候门"="在门前等候"}
|
||||
|
||||
["三径/就荒/, 松菊/犹存./"]
|
||||
note = []
|
||||
translation = "院子里的小路快要荒芜了,松菊还长在那里"
|
||||
keyword_note = {"三径"="院中小路", "就荒"="快要荒芜", "犹存"="还存在"}
|
||||
|
||||
["携幼/入室/, 有酒/盈樽./"]
|
||||
note = []
|
||||
translation = "带着孩子们进了屋,美酒已经盛满了酒樽"
|
||||
keyword_note = {"携幼"="带着孩子", "入室"="进屋", "盈樽"="满杯"}
|
||||
|
||||
["引/壶觞/以/自酌/, 眄/庭柯/以/怡颜./"]
|
||||
note = []
|
||||
translation = "我端起酒壶酒杯自斟自饮,看看院子里的树木,觉得很愉快"
|
||||
keyword_note = {"引"="端起", "壶觞"="酒壶酒杯", "自酌"="自斟自饮", "眄"="随便看看", "庭柯"="院子里的树木", "怡颜"="使面容愉快"}
|
||||
|
||||
["倚/南窗/以/寄傲/, 审/容膝/之/易安./"]
|
||||
note = []
|
||||
translation = "倚着南窗寄托我的傲世之情,深知这狭小之地容易使我心安"
|
||||
keyword_note = {"寄傲"="寄托傲世之情", "审"="深知", "容膝"="仅能容膝的小屋", "易安"="容易安适"}
|
||||
|
||||
["园/日涉/以/成趣/, 门/虽设/而/常关./"]
|
||||
note = []
|
||||
translation = "天天到园里行走,自成一种乐趣,小园的门经常地关闭着"
|
||||
keyword_note = {"日涉"="天天走到", "成趣"="自成乐趣", "虽设"="虽然设置", "常关"="经常关闭"}
|
||||
|
||||
["策/扶老/以/流憩/, 时/矫首/而/遐观./"]
|
||||
note = []
|
||||
translation = "拄着拐杖出去走走,随时随地休息,时时抬头望着远方(的天空)"
|
||||
keyword_note = {"策"="拄着", "扶老"="手杖", "流憩"="到处走走歇歇", "矫首"="抬头", "遐观"="远望"}
|
||||
|
||||
["云/无心/以/出岫/, 鸟/倦飞/而/知还./"]
|
||||
note = []
|
||||
translation = "云气自然而然地从山峰飘浮而出,倦飞的鸟儿也知道飞回巢中"
|
||||
keyword_note = {"无心"="自然而然", "出岫"="从山中冒出", "倦飞"="飞累了", "知还"="知道返回"}
|
||||
|
||||
["景/翳翳/以/将入/, 抚/孤松/而/盘桓./"]
|
||||
note = []
|
||||
translation = "日光暗淡,太阳快要落下去了,我手抚着孤松徘徊着不忍离去"
|
||||
keyword_note = {"景"="日光", "翳翳"="阴暗的样子", "将入"="快要落下", "抚"="手抚", "孤松"="孤立的松树", "盘桓"="徘徊"}
|
||||
|
||||
["归去/来兮/, 请/息交/以/绝游./"]
|
||||
note = []
|
||||
translation = "回家去吧!请让我同外界断绝交游"
|
||||
keyword_note = {"息交"="停止交往", "绝游"="断绝交游"}
|
||||
|
||||
["世/与我/而/相违/, 复/驾言/兮/焉求/?/"]
|
||||
note = []
|
||||
translation = "世事与我所想的相违背,还要驾车出去追求什么?"
|
||||
keyword_note = {"相违"="相违背", "驾言"="驾车出游", "焉求"="追求什么"}
|
||||
|
||||
["悦/亲戚/之/情话/, 乐/琴书/以/消忧./"]
|
||||
note = []
|
||||
translation = "以亲人间的知心话为愉悦,以弹琴读书为乐来消除忧愁"
|
||||
keyword_note = {"悦"="以...为愉悦", "情话"="知心话", "乐"="以...为乐", "琴书"="弹琴读书", "消忧"="消除忧愁"}
|
||||
|
||||
["农人/告余/以/春及/, 将/有事/于/西畴./"]
|
||||
note = []
|
||||
translation = "农夫告诉我春天到了,西边田野里要开始耕种了"
|
||||
keyword_note = {"告余"="告诉我", "春及"="春天到了", "有事"="指耕种之事", "西畴"="西边田野"}
|
||||
|
||||
["或/命/巾车/, 或/棹/孤舟./"]
|
||||
note = []
|
||||
translation = "有时驾着有布篷的小车,有时划着一条小船"
|
||||
keyword_note = {"或"="有时", "命"="叫上", "巾车"="有帷的小车", "棹"="划船"}
|
||||
|
||||
["既/窈窕/以/寻壑/, 亦/崎岖/而/经丘./"]
|
||||
note = []
|
||||
translation = "有时经过幽深曲折的山谷,有时走过高低不平的山路"
|
||||
keyword_note = {"窈窕"="幽深曲折", "寻壑"="经过山谷", "崎岖"="高低不平", "经丘"="走过山路"}
|
||||
|
||||
["木/欣欣/以/向荣/, 泉/涓涓/而/始流./"]
|
||||
note = []
|
||||
translation = "草木茂盛,细水缓流"
|
||||
keyword_note = {"欣欣"="草木茂盛", "向荣"="滋长茂盛", "涓涓"="水流细微", "始流"="开始流动"}
|
||||
|
||||
["善/万物/之/得时/, 感/吾生/之/行休./"]
|
||||
note = []
|
||||
translation = "(我)羡慕自然界的万物一到春天便及时生长茂盛,感叹自己的一生行将结束"
|
||||
keyword_note = {"善"="羡慕", "得时"="及时生长", "感"="感叹", "行休"="行将结束"}
|
||||
|
||||
["已矣乎/!/ 寓形/宇内/复/几时/?/"]
|
||||
note = []
|
||||
translation = "算了吧!活在世上还能有多久?"
|
||||
keyword_note = {"已矣乎"="算了吧", "寓形宇内"="活在世上", "复几时"="还能有多久"}
|
||||
|
||||
["曷不/委心/任/去留/?/"]
|
||||
note = []
|
||||
translation = "为什么不随心所欲,听凭自然的生死?"
|
||||
keyword_note = {"曷不"="为什么不", "委心"="随心所欲", "任去留"="听凭生死"}
|
||||
|
||||
["胡为乎/遑遑/欲/何之/?/"]
|
||||
note = []
|
||||
translation = "为什么心神不定,想要到哪里去呢?"
|
||||
keyword_note = {"胡为乎"="为什么", "遑遑"="心神不定", "欲何之"="想要到哪里去"}
|
||||
|
||||
["富贵/非/吾愿/, 帝乡/不可/期./"]
|
||||
note = []
|
||||
translation = "富贵不是我所求,修成神仙是没有希望的"
|
||||
keyword_note = {"非吾愿"="不是我的愿望", "帝乡"="仙境", "不可期"="不可企及"}
|
||||
|
||||
["怀/良辰/以/孤往/, 或/植杖/而/耘耔./"]
|
||||
note = []
|
||||
translation = "爱惜那良辰美景我独自去欣赏,有时放下手杖,拿起农具除草培土"
|
||||
keyword_note = {"怀"="爱惜", "良辰"="美好时光", "孤往"="独自外出", "植杖"="放下手杖", "耘耔"="除草培土"}
|
||||
|
||||
["登/东皋/以/舒啸/, 临/清流/而/赋诗./"]
|
||||
note = []
|
||||
translation = "登上东边的山坡我放声呼啸,傍着清清的溪流把诗歌吟唱"
|
||||
keyword_note = {"东皋"="东边高地", "舒啸"="放声长啸", "临"="面对", "清流"="清清溪流", "赋诗"="吟诗"}
|
||||
|
||||
["聊/乘化/以/归尽/, 乐夫/天命/复/奚疑/!/"]
|
||||
note = []
|
||||
translation = "姑且顺随自然的变化,走到生命的尽头。乐天安命,还有什么可疑虑的呢?"
|
||||
keyword_note = {"聊"="姑且", "乘化"="顺随自然变化", "归尽"="走到生命尽头", "乐夫天命"="乐天安命", "复奚疑"="还有什么疑虑"}
|
@@ -1,123 +0,0 @@
|
||||
# Wang Zhiyu 2025
|
||||
# Nucleon 是 HeurAMS 软件项目使用的专有源文件格式 (格式版本 v1, 基于 toml 格式)
|
||||
# 建议使用的 MIME 类型: application/vnd.xyz.imwangzhiyu.heurams-nucleon.v1+toml
|
||||
|
||||
# 散列表的键翻译
|
||||
["keydata"]
|
||||
note = "笔记"
|
||||
keyword_note = "关键词翻译"
|
||||
translation = "语句翻译"
|
||||
|
||||
# 测试项目元数据
|
||||
["testdata"]
|
||||
# 记忆时显示的额外信息
|
||||
additional_inf = ["translation","keyword_note", "note"]
|
||||
# 填空测试, content 指代键名
|
||||
fill_blank_test = {"from"=["content"], "hint"=["translation"]}
|
||||
# 选择题测试
|
||||
draw_card_test = {"from"=["keyword_note"]}
|
||||
|
||||
["海客/谈/瀛洲/, 烟涛/微茫/信/难求/; /越人/语/天姥/, 云霞/明灭/或/可睹./"]
|
||||
note = []
|
||||
translation = "听海外来客们谈起瀛洲,烟波渺茫实在难以寻求。越中来人说起天姥山,在云雾忽明忽暗间有时能看见。"
|
||||
keyword_note = {"海客"="海外来客", "瀛洲"="古代传说中的东海三座仙山之一", "烟涛"="波涛渺茫,远看像烟雾笼罩的样子", "微茫"="景象模糊不清", "信"="确实,实在", "越人"="指浙江一带的人", "天姥"="天姥山,在浙江新昌东面", "明灭"="忽明忽暗", "或"="有时", "睹"="看见"}
|
||||
|
||||
["天姥/连天/向天/横/, 势/拔/五岳/掩/赤城./"]
|
||||
note = []
|
||||
translation = "天姥山仿佛连接着天遮断了天空,山势高峻超过五岳,遮掩过赤城山。"
|
||||
keyword_note = {"向天横"="遮蔽天空", "拔"="超出", "五岳"="指东岳泰山、西岳华山、中岳嵩山、北岳恒山、南岳衡山", "掩"="遮掩", "赤城"="山名,在今浙江天台北部"}
|
||||
|
||||
["天台/四万/八千/丈/, 对此/欲倒/东南/倾./"]
|
||||
note = []
|
||||
translation = "天台山虽高四万八千丈,面对着它好像要向东南倾斜拜倒一样。"
|
||||
keyword_note = {"天台"="山名,在今浙江天台北部", "四万八千丈"="极言其高", "对此"="对着天姥山", "欲"="好像要", "东南倾"="向东南方向倾斜"}
|
||||
|
||||
["我/欲/因之/梦/吴越/, 一夜/飞度/镜湖/月./"]
|
||||
note = []
|
||||
translation = "我想依据越人说的话梦游到吴越,一天夜晚飞渡过明月映照下的镜湖。"
|
||||
keyword_note = {"因之"="依据越人的话", "梦"="梦游", "吴越"="指越地", "飞度"="飞渡", "镜湖"="又名鉴湖,在浙江绍兴南面"}
|
||||
|
||||
["湖月/照/我影/, 送我/至/剡溪./"]
|
||||
note = []
|
||||
translation = "镜湖上的月光照着我的身影,一直送我到了剡溪。"
|
||||
keyword_note = {"湖月"="镜湖上的月光", "照我影"="照着我的身影", "剡溪"="水名,在浙江嵊州南面"}
|
||||
|
||||
["谢公/宿处/今/尚在/, 渌水/荡漾/清猿/啼./"]
|
||||
note = []
|
||||
translation = "谢灵运住的地方如今还在,清澈的湖水荡漾,猿猴凄清啼叫。"
|
||||
keyword_note = {"谢公"="指南朝诗人谢灵运", "宿处"="住宿的地方", "尚"="还", "渌水"="清澈的水", "荡漾"="水波摇动的样子", "清猿"="叫声凄清的猿猴"}
|
||||
|
||||
["脚/著/谢公/屐/, 身/登/青云/梯./"]
|
||||
note = []
|
||||
translation = "我脚上穿着谢公当年特制的木鞋,攀登直上云霄的山路。"
|
||||
keyword_note = {"著"="穿", "谢公屐"="谢灵运特制的木屐", "青云梯"="指直上云霄的山路"}
|
||||
|
||||
["半壁/见/海日/, 空中/闻/天鸡./"]
|
||||
note = []
|
||||
translation = "上到半山腰就看见了从海上升起的太阳,空中传来天鸡报晓的啼鸣之声。"
|
||||
keyword_note = {"半壁"="半山腰", "海日"="从海上升起的太阳", "天鸡"="古代传说中的神鸡"}
|
||||
|
||||
["千岩/万转/路/不定/, 迷花/倚石/忽/已暝./"]
|
||||
note = []
|
||||
translation = "无数山岩重叠,山道曲折,盘旋变化不定。迷恋着花,依倚着石,不觉天色已晚。"
|
||||
keyword_note = {"千岩万转"="山岩重叠,道路曲折", "不定"="变化不定", "迷花"="迷恋花草", "倚石"="倚靠石头", "忽"="忽然", "暝"="天黑"}
|
||||
|
||||
["熊咆/龙吟/殷/岩泉/, 栗/深林/兮/惊/层巅./"]
|
||||
note = []
|
||||
translation = "熊在怒吼,龙在长鸣,岩中的泉水在震响,使深林战栗,使高耸而重叠的山峰惊颤。"
|
||||
keyword_note = {"熊咆"="熊的怒吼", "龙吟"="龙的鸣叫", "殷"="震响", "岩泉"="山岩中的泉水", "栗"="使...战栗", "惊"="使...惊颤", "层巅"="重叠的山峰"}
|
||||
|
||||
["云/青青/兮/欲雨/, 水/澹澹/兮/生烟./"]
|
||||
note = []
|
||||
translation = "云层黑沉沉的,像是要下雨,水波动荡生起了薄薄的烟雾。"
|
||||
keyword_note = {"青青"="黑沉沉的样子", "欲雨"="将要下雨", "澹澹"="水波荡漾的样子", "生烟"="产生烟雾"}
|
||||
|
||||
["列缺/霹雳/, 丘峦/崩摧./"]
|
||||
note = []
|
||||
translation = "电光闪闪,雷声轰鸣,山峰好像要崩塌似的。"
|
||||
keyword_note = {"列缺"="闪电", "霹雳"="雷声", "丘峦"="山峰", "崩摧"="崩塌"}
|
||||
|
||||
["洞天/石扉/, 訇然/中开./"]
|
||||
note = []
|
||||
translation = "仙府的石门,“訇”的一声从中间打开。"
|
||||
keyword_note = {"洞天"="仙人居住的洞府", "石扉"="石门", "訇然"="巨大的响声", "中开"="从中间打开"}
|
||||
|
||||
["青冥/浩荡/不见/底/, 日月/照耀/金银/台./"]
|
||||
note = []
|
||||
translation = "洞中蔚蓝的天空广阔无际,看不到尽头,日月照耀着金银做的宫阙。"
|
||||
keyword_note = {"青冥"="天空", "浩荡"="广阔无边的样子", "不见底"="看不到尽头", "金银台"="金银铸成的宫阙"}
|
||||
|
||||
["霓/为衣/兮/风/为马/, 云之/君兮/纷纷/而来下./"]
|
||||
note = []
|
||||
translation = "用彩虹做衣裳,将风作为马来乘,云中的神仙们纷纷下来。"
|
||||
keyword_note = {"霓"="彩虹", "为衣"="做衣裳", "为马"="作为马", "云之君"="云中的神仙", "纷纷"="众多的样子", "来下"="下来"}
|
||||
|
||||
["虎/鼓瑟/兮/鸾/回车/, 仙之/人兮/列/如麻./"]
|
||||
note = []
|
||||
translation = "老虎弹奏着琴瑟,鸾鸟驾着车。仙人们排成列,密密麻麻。"
|
||||
keyword_note = {"鼓瑟"="弹奏琴瑟", "鸾"="传说中的神鸟", "回车"="驾车", "列如麻"="排列得像麻一样密集"}
|
||||
|
||||
["忽/魂悸/以/魄动/, 恍/惊起/而/长嗟./"]
|
||||
note = []
|
||||
translation = "忽然魂魄惊动,我猛然惊醒,不禁长声叹息。"
|
||||
keyword_note = {"魂悸"="魂魄惊动", "魄动"="精神震动", "恍"="恍然", "惊起"="惊醒坐起", "长嗟"="长声叹息"}
|
||||
|
||||
["惟/觉时/之/枕席/, 失/向来/之/烟霞./"]
|
||||
note = []
|
||||
translation = "醒来时只有身边的枕席,刚才梦中所见的烟雾云霞全都消失了。"
|
||||
keyword_note = {"惟"="只有", "觉时"="醒来时", "向来"="刚才", "烟霞"="指梦中的仙境景象"}
|
||||
|
||||
["世间/行乐/亦/如此/, 古来/万事/东流/水./"]
|
||||
note = []
|
||||
translation = "人世间的欢乐也是像梦中的幻境这样,自古以来万事都像东流的水一样一去不复返。"
|
||||
keyword_note = {"行乐"="人世欢乐", "如此"="像这样", "古来"="自古以来", "东流水"="向东流去的水"}
|
||||
|
||||
["别君/去兮/何时/还? /且/放/白鹿/青崖/间/, 须/行/即骑/访/名山./"]
|
||||
note = []
|
||||
translation = "告别诸君,此番远去不知何时才能回来?暂且把白鹿放牧在青崖间,等到要远行时就骑上它寻访名山。"
|
||||
keyword_note = {"别君"="告别诸君", "去兮"="离去啊", "还"="回来", "且"="暂且", "白鹿"="传说神仙或隐士多骑白鹿", "青崖"="青翠的山崖", "须"="等待", "即"="就", "访"="寻访"}
|
||||
|
||||
["安能/摧眉/折腰/事/权贵/, 使我/不得/开心/颜?/"]
|
||||
note = []
|
||||
translation = "岂能卑躬屈膝去侍奉权贵,让自己不能有舒心畅意的笑颜!"
|
||||
keyword_note = {"安能"="怎么能", "摧眉折腰"="低头弯腰", "事"="侍奉", "权贵"="有权势的贵族", "开心颜"="心情愉快,笑逐颜开"}
|
243
nucleon/赤壁赋.toml
243
nucleon/赤壁赋.toml
@@ -1,243 +0,0 @@
|
||||
# Wang Zhiyu 2025
|
||||
# Nucleon 是 HeurAMS 软件项目使用的专有源文件格式 (格式版本 v1, 基于 toml 格式)
|
||||
# 建议使用的 MIME 类型: application/vnd.xyz.imwangzhiyu.heurams-nucleon.v1+toml
|
||||
|
||||
# 散列表的键翻译
|
||||
["keydata"]
|
||||
note = "笔记"
|
||||
keyword_note = "关键词翻译"
|
||||
translation = "语句翻译"
|
||||
|
||||
# 测试项目元数据
|
||||
["testdata"]
|
||||
# 记忆时显示的额外信息
|
||||
additional_inf = ["translation","keyword_note", "note"]
|
||||
# 填空测试, content 指代键名
|
||||
fill_blank_test = {"from"=["content"], "hint"=["translation"]}
|
||||
# 选择题测试
|
||||
draw_card_test = {"from"=["keyword_note"]}
|
||||
|
||||
["壬戌/之秋/, 七月/既望/, 苏子/与客/泛舟/游于/赤壁/之下/"]
|
||||
note = []
|
||||
translation = "壬戌年秋天,七月十六日,我与友人在赤壁下泛舟游玩"
|
||||
keyword_note = {"壬戌" = "宋神宗元丰五年(1082)", "既望" = "农历十六日(望指十五日)"}
|
||||
|
||||
["清风/徐来/, 水波/不兴/"]
|
||||
note = []
|
||||
translation = "清风阵阵拂来,水面波澜不起"
|
||||
keyword_note = {"徐" = "舒缓地", "兴" = "起,作"}
|
||||
|
||||
["举酒/属客/, 诵/明月/之诗/, 歌/窈窕/之章/"]
|
||||
note = []
|
||||
translation = "举起酒杯向同伴劝酒,吟诵《明月》中'窈窕'这一章"
|
||||
keyword_note = {"属" = "通'嘱',劝请", "窈窕之章" = "指《诗经·陈风·月出》篇"}
|
||||
|
||||
["少焉/, 月出/于/东山/之上/, 徘徊/于/斗牛/之间/"]
|
||||
note = []
|
||||
translation = "不一会儿,明月从东山后升起,在斗宿与牛宿之间来回移动"
|
||||
keyword_note = {"少焉" = "一会儿", "斗牛" = "斗宿和牛宿,星宿名"}
|
||||
|
||||
["白露/横江/, 水光/接天/"]
|
||||
note = []
|
||||
translation = "月光下,白茫茫的雾气笼罩江面,天光、水色连成一片"
|
||||
keyword_note = {"白露" = "白茫茫的水汽", "横" = "笼罩,横贯"}
|
||||
|
||||
["纵/一苇/之所如/, 凌/万顷/之茫然/"]
|
||||
note = []
|
||||
translation = "任凭一片苇叶似的小船随意漂浮,越过浩瀚无垠的江面"
|
||||
keyword_note = {"一苇" = "像一片苇叶的小船", "凌" = "越过", "万顷" = "形容江面宽广"}
|
||||
|
||||
["浩浩乎/如/冯虚/御风/, 而/不知/其所止/"]
|
||||
note = []
|
||||
translation = "浩浩淼淼(像长出羽翼一样)驾风凌空飞行,并不知道到哪里才会停栖"
|
||||
keyword_note = {"冯虚" = "同'凭虚',凌空", "御风" = "驾风"}
|
||||
|
||||
["飘飘乎/如/遗世/独立/, 羽化/而/登仙/"]
|
||||
note = []
|
||||
translation = "飘飘摇摇好像要离开尘世飘飞而起,羽化成仙进入仙境"
|
||||
keyword_note = {"遗世" = "超脱尘世", "羽化" = "道教称成仙为羽化"}
|
||||
|
||||
["于是/饮酒/乐甚/, 扣舷/而歌之/"]
|
||||
note = []
|
||||
translation = "在这时喝酒喝得非常高兴,打着节拍唱起歌来"
|
||||
keyword_note = {"扣舷" = "敲打船边,打节拍"}
|
||||
|
||||
["歌曰/: '桂棹/兮/兰桨/, 击/空明/兮/溯/流光/'"]
|
||||
note = []
|
||||
translation = "歌中唱到:'桂木船棹啊香兰船桨,击打着月光下的清波,在泛着月光的水面逆流而上'"
|
||||
keyword_note = {"空明" = "月光下的清澈江水", "溯" = "逆流而上", "流光" = "月光浮动的水面"}
|
||||
|
||||
["渺渺兮/予怀/, 望/美人/兮/天一方/"]
|
||||
note = []
|
||||
translation = "我的情思啊悠远茫茫,眺望美人(君主)啊,却在天的另一方"
|
||||
keyword_note = {"渺渺" = "悠远的样子", "美人" = "指内心思慕的人,常喻君主"}
|
||||
|
||||
["客有/吹洞箫/者/, 倚歌/而和之/"]
|
||||
note = []
|
||||
translation = "有会吹洞箫的客人,配着节奏为歌声伴和"
|
||||
keyword_note = {"倚歌" = "随着歌声", "和" = "应和"}
|
||||
|
||||
["其声/呜呜然/, 如怨/如慕/, 如泣/如诉/"]
|
||||
note = []
|
||||
translation = "洞箫的声音呜呜咽咽:有如哀怨有如思慕,既像啜泣也像倾诉"
|
||||
keyword_note = {"慕" = "思慕,眷恋"}
|
||||
|
||||
["余音/袅袅/, 不绝/如缕/"]
|
||||
note = []
|
||||
translation = "余音在江上回荡,像细丝一样连续不断"
|
||||
keyword_note = {"袅袅" = "声音婉转悠长", "缕" = "细丝"}
|
||||
|
||||
["舞/幽壑/之潜蛟/, 泣/孤舟/之嫠妇/"]
|
||||
note = []
|
||||
translation = "能使深谷中的蛟龙为之起舞,能使孤舟上的寡妇为之饮泣"
|
||||
keyword_note = {"幽壑" = "深谷", "嫠妇" = "寡妇"}
|
||||
|
||||
["苏子/愀然/, 正襟/危坐/而问/客曰/"]
|
||||
note = []
|
||||
translation = "我的神色也愁惨起来,整好衣襟坐端正,向客人问道"
|
||||
keyword_note = {"愀然" = "容色改变的样子", "正襟危坐" = "整理衣襟,端正坐着"}
|
||||
|
||||
["何为/其然也?/"]
|
||||
note = []
|
||||
translation = "'箫声为什么这样哀怨呢?'"
|
||||
keyword_note = {"然" = "这样"}
|
||||
|
||||
["客曰/: '月明/星稀/, 乌鹊/南飞/', 此非/曹孟德/之诗乎?/"]
|
||||
note = []
|
||||
translation = "客人回答:'月明星稀,乌鹊南飞,这不是曹公孟德的诗么?'"
|
||||
keyword_note = {"曹孟德" = "曹操,字孟德"}
|
||||
|
||||
["西望/夏口/, 东望/武昌/, 山川/相缪/, 郁乎/苍苍/"]
|
||||
note = []
|
||||
translation = "这里向西可以望到夏口,向东可以望到武昌,山河接壤连绵不绝,目力所及,一片郁郁苍苍"
|
||||
keyword_note = {"相缪" = "相互盘绕", "郁乎苍苍" = "树木茂密苍翠"}
|
||||
|
||||
["此非/孟德/之困于/周郎/者乎?/"]
|
||||
note = []
|
||||
translation = "这不正是曹孟德被周瑜所围困的地方么?"
|
||||
keyword_note = {"周郎" = "周瑜"}
|
||||
|
||||
["方其/破/荆州/, 下/江陵/, 顺流/而东也/"]
|
||||
note = []
|
||||
translation = "当初他攻陷荆州,夺得江陵,沿长江顺流东下"
|
||||
keyword_note = {"破" = "攻破", "下" = "攻下"}
|
||||
|
||||
["舳舻/千里/, 旌旗/蔽空/"]
|
||||
note = []
|
||||
translation = "麾下的战船首尾相连延绵千里,旗子将天空全都蔽住"
|
||||
keyword_note = {"舳舻" = "战船首尾相接"}
|
||||
|
||||
["酾酒/临江/, 横槊/赋诗/"]
|
||||
note = []
|
||||
translation = "面对大江斟酒,横执长矛吟诗"
|
||||
keyword_note = {"酾酒" = "斟酒", "横槊" = "横执长矛"}
|
||||
|
||||
["固/一世/之雄也/, 而今/安在哉?/"]
|
||||
note = []
|
||||
translation = "本来是当世的一位英雄人物,然而现在又在哪里呢?"
|
||||
keyword_note = {"固" = "本来", "安在" = "在哪里"}
|
||||
|
||||
["况/吾与子/渔樵/于/江渚/之上/, 侣/鱼虾/而友/麋鹿/"]
|
||||
note = []
|
||||
translation = "何况我与你在江中的小洲打渔砍柴,以鱼虾为侣,以麋鹿为友"
|
||||
keyword_note = {"渔樵" = "打渔砍柴", "侣" = "以...为伴侣", "友" = "以...为朋友"}
|
||||
|
||||
["驾/一叶/之扁舟/, 举/匏樽/以相属/"]
|
||||
note = []
|
||||
translation = "在江上驾着这一叶小舟,举起杯盏相互敬酒"
|
||||
keyword_note = {"扁舟" = "小舟", "匏樽" = "用葫芦做的酒器"}
|
||||
|
||||
["寄/蜉蝣/于天地/, 渺/沧海/之一粟/"]
|
||||
note = []
|
||||
translation = "如同蜉蝣置身于广阔的天地中,像沧海中的一粒粟米那样渺小"
|
||||
keyword_note = {"蜉蝣" = "一种生命短暂的昆虫", "粟" = "米粒"}
|
||||
|
||||
["哀/吾生/之须臾/, 羡/长江/之无穷/"]
|
||||
note = []
|
||||
translation = "哀叹我们的一生只是短暂的片刻,不由羡慕长江的没有穷尽"
|
||||
keyword_note = {"须臾" = "片刻", "无穷" = "没有穷尽"}
|
||||
|
||||
["挟/飞仙/以遨游/, 抱/明月/而长终/"]
|
||||
note = []
|
||||
translation = "想要携同仙人携手遨游各地,与明月相拥而永存世间"
|
||||
keyword_note = {"挟" = "携同", "长终" = "永远存在"}
|
||||
|
||||
["知/不可乎/骤得/, 托/遗响/于悲风/"]
|
||||
note = []
|
||||
translation = "知道上面这些想法不能一下子实现,只得将憾恨化为箫音,托寄在悲凉的秋风中罢了"
|
||||
keyword_note = {"骤得" = "一下子得到", "遗响" = "余音,指箫声"}
|
||||
|
||||
["苏子/曰/: '客/亦知/夫/水与月/乎?/"]
|
||||
note = []
|
||||
translation = "我问道:'你可也知道这水与月?'"
|
||||
keyword_note = {"夫" = "那"}
|
||||
|
||||
["逝者/如斯/, 而/未尝/往也/"]
|
||||
note = []
|
||||
translation = "江水总是不停的流逝,但它们并没有流走"
|
||||
keyword_note = {"逝者如斯" = "语出《论语》,流逝的就像这样", "往" = "流失"}
|
||||
|
||||
["盈虚者/如彼/, 而/卒莫/消长也/"]
|
||||
note = []
|
||||
translation = "月亮总是那样有圆有缺,但它终究也没有增减"
|
||||
keyword_note = {"盈虚" = "圆缺", "卒" = "最终", "消长" = "增减"}
|
||||
|
||||
["盖将/自其/变者/而观之/, 则/天地/曾不能/以一瞬/"]
|
||||
note = []
|
||||
translation = "可见,从事物易变的一面看来,天地间万事万物时刻在变动,连一眨眼的工夫都不停止"
|
||||
keyword_note = {"曾" = "甚至", "一瞬" = "一眨眼"}
|
||||
|
||||
["自其/不变者/而观之/, 则/物与我/皆无尽也/"]
|
||||
note = []
|
||||
translation = "而从事物不变的一面看来,万物同我们来说都是永恒的"
|
||||
keyword_note = {"无尽" = "没有穷尽"}
|
||||
|
||||
["而又/何羡乎/!"]
|
||||
note = []
|
||||
translation = "又有什么可羡慕的呢?"
|
||||
keyword_note = {"何羡" = "羡慕什么"}
|
||||
|
||||
["且夫/天地/之间/, 物/各有主/"]
|
||||
note = []
|
||||
translation = "何况天地之间,万物各有主宰者"
|
||||
keyword_note = {"且夫" = "况且", "各有主" = "各有主宰"}
|
||||
|
||||
["苟/非吾之/所有/, 虽/一毫/而莫取/"]
|
||||
note = []
|
||||
translation = "若不是自己应该拥有的,即使一分一毫也不能求取"
|
||||
keyword_note = {"苟" = "如果", "一毫" = "一丝一毫"}
|
||||
|
||||
["惟/江上/之清风/, 与/山间/之明月/"]
|
||||
note = []
|
||||
translation = "只有江上的清风,以及山间的明月"
|
||||
keyword_note = {"惟" = "只有"}
|
||||
|
||||
["耳得之/而为声/, 目遇之/而成色/"]
|
||||
note = []
|
||||
translation = "听到便成了声音,进入眼帘便绘出形色"
|
||||
keyword_note = {"得" = "听到", "遇" = "看到"}
|
||||
|
||||
["取之/无禁/, 用之/不竭/"]
|
||||
note = []
|
||||
translation = "取得这些不会有人禁止,感受这些也不会有竭尽的忧虑"
|
||||
keyword_note = {"无禁" = "没有禁止", "不竭" = "不会枯竭"}
|
||||
|
||||
["是/造物者/之无尽藏也/, 而/吾与子/之所共适/"]
|
||||
note = []
|
||||
translation = "这是大自然恩赐的没有穷尽的宝藏,我和你可以共同享受"
|
||||
keyword_note = {"造物者" = "大自然", "无尽藏" = "无穷无尽的宝藏", "共适" = "共同享受"}
|
||||
|
||||
["客/喜而笑/, 洗盏/更酌/"]
|
||||
note = []
|
||||
translation = "客人高兴地笑了,洗净酒杯重新饮酒"
|
||||
keyword_note = {"更酌" = "重新斟酒"}
|
||||
|
||||
["肴核/既尽/, 杯盘/狼籍/"]
|
||||
note = []
|
||||
translation = "菜肴果品都已吃完,杯子盘子杂乱一片"
|
||||
keyword_note = {"肴核" = "菜肴和果品", "狼籍" = "凌乱的样子"}
|
||||
|
||||
["相与/枕藉/乎/舟中/, 不知/东方/之既白/"]
|
||||
note = []
|
||||
translation = "大家互相枕着垫着睡在船上,不知不觉东方已经露出白色的曙光"
|
||||
keyword_note = {"枕藉" = "相互枕着躺着", "既白" = "已经天亮"}
|
159
nucleon/陈情表.toml
159
nucleon/陈情表.toml
@@ -1,159 +0,0 @@
|
||||
# Wang Zhiyu 2025
|
||||
# Nucleon 是 HeurAMS 软件项目使用的专有源文件格式 (格式版本 v1, 基于 toml 格式)
|
||||
# 建议使用的 MIME 类型: application/vnd.xyz.imwangzhiyu.heurams-nucleon.v1+toml
|
||||
# 示例文件: 陈情表
|
||||
|
||||
# 散列表的键翻译
|
||||
["keydata"]
|
||||
note = "笔记"
|
||||
keyword_note = "关键词翻译"
|
||||
translation = "语句翻译"
|
||||
|
||||
# 测试项目元数据
|
||||
["testdata"]
|
||||
# 记忆时显示的额外信息
|
||||
additional_inf = ["translation","keyword_note", "note"]
|
||||
# 填空测试, content 指代键名
|
||||
fill_blank_test = {"from"=["content"], "hint"=["translation"]}
|
||||
# 选择题测试
|
||||
draw_card_test = {"from"=["keyword_note"]}
|
||||
|
||||
["臣/密/言: /臣/以/险衅/, 夙/遭/闵凶./"] # 键名应该使用"/"基于意思断句(填空生成需要, 避免分离单个标点), 句末应该有断句, 不要断得太碎
|
||||
note = []
|
||||
translation = "臣子李密陈言: 我因命运不好, 小时候遭遇到了不幸"
|
||||
keyword_note = {"险衅"="凶险祸患(这里指命运不好)", "夙"="早时, 这里指年幼的时候", "闵"="通'悯', 指可忧患的事", "凶"="不幸, 指丧父"}
|
||||
|
||||
["生孩/六月/, 慈父/见背/; /行年/四岁/, 舅/夺/母志./"]
|
||||
note = []
|
||||
translation = "刚出生六个月, 我慈爱的父亲就不幸去世了。经过了四年, 舅父逼母亲改嫁"
|
||||
keyword_note = {"见背"="死的委婉说法", "行年"="经历的年岁", "母志"="母亲守节之志(改嫁的委婉说法)"}
|
||||
|
||||
["祖母/刘/愍/臣/孤弱/, 躬亲/抚养./"]
|
||||
note = []
|
||||
translation = "我的祖母刘氏, 怜悯我从小丧父, 便亲自对我加以抚养"
|
||||
keyword_note = {"愍"="怜悯", "躬亲"="亲身"}
|
||||
|
||||
["臣/少/多/疾病/, 九岁/不行/, 零丁/孤苦/, 至于/成立./"]
|
||||
note = []
|
||||
translation = "臣小的时候经常生病, 九岁时还不会行走。孤独无靠, 一直到成人自立"
|
||||
keyword_note = {"成立"="成人自立"}
|
||||
|
||||
["既/无/伯叔/, 终/鲜/兄弟/, 门/衰/祚/薄/, 晚/有/儿息./"]
|
||||
note = []
|
||||
translation = "既没有叔叔伯伯, 又没什么兄弟, 门庭衰微而福分浅薄, 很晚才有儿子"
|
||||
keyword_note = {"鲜"="少, 这里指'无'", "祚薄"="福分浅薄", "儿息"="亲生子女"}
|
||||
|
||||
["外/无/期功/强近/之亲/, 内/无/应门/五尺/之僮/, 茕茕/孑立/, 形影/相吊./"]
|
||||
note = []
|
||||
translation = "在外面没有比较亲近的亲戚, 在家里又没有照应门户的童仆。生活孤单没有依靠, 每天只有自己的身体和影子相互安慰"
|
||||
keyword_note = {"期功"="指关系较近的亲属", "茕茕孑立"="孤单无依靠的样子", "吊"="安慰"}
|
||||
|
||||
["而/刘/夙/婴/疾病/, 常/在/床蓐/, 臣/侍/汤药/, 未曾/废离./"]
|
||||
note = []
|
||||
translation = "但祖母又早被疾病缠绕, 常年卧床不起, 我侍奉她吃饭喝药, 从来就没有停止侍奉而离开她"
|
||||
keyword_note = {"婴"="被...缠绕", "蓐"="通'褥', 床垫", "废"="停止服侍", "离"="离开"}
|
||||
|
||||
["逮/奉/圣朝/, 沐浴/清化./"]
|
||||
note = []
|
||||
translation = "到了晋朝建立, 我蒙受着清明的政治教化"
|
||||
keyword_note = {"逮"="及, 到", "奉"="承奉", "圣朝"="指当时的晋朝", "沐浴清化"="蒙受清平教化"}
|
||||
|
||||
["前/太守/臣/逵/察/臣/孝廉/; /后/刺史/臣/荣/举/臣/秀才./"]
|
||||
note = []
|
||||
translation = "前任太守逵, 考察后推举臣下为孝廉, 后任刺史荣又推举臣下为优秀人才"
|
||||
keyword_note = {"察"="考察和推举", "孝廉"="孝顺, 品性纯洁", "举"="推举", "秀才"="优秀人才"}
|
||||
|
||||
["臣/以/供养/无主/, 辞/不赴命./"]
|
||||
note = []
|
||||
translation = "臣下因为供奉赡养祖母的事无人承担, 辞谢不接受任命"
|
||||
keyword_note = {"无主"="无人承担"}
|
||||
|
||||
["诏书/特下/, 拜/臣/郎中/, 寻/蒙/国恩/, 除/臣/洗马./"]
|
||||
note = []
|
||||
translation = "朝廷又特地下了诏书, 任命我为郎中, 不久又蒙受国家恩命, 任命我为太子洗马"
|
||||
keyword_note = {"拜"="授予官职", "郎中"="尚书省的属官", "寻"="不久", "除"="拜官受职", "洗马"="太子的属官"}
|
||||
|
||||
["猥/以/微贱/, 当/侍/东宫/, 非/臣/陨首/所能/上报./"]
|
||||
note = []
|
||||
translation = "像我这样出身微贱地位卑下的人, 担当侍奉太子的职务, 这实在不是我杀身捐躯所能报答朝廷的"
|
||||
keyword_note = {"猥"="谦词", "微贱"="卑微低贱", "东宫"="太子居处", "陨首"="杀身"}
|
||||
|
||||
["臣/具/以表/闻/, 辞/不就职./"]
|
||||
note = []
|
||||
translation = "我将以上苦衷上表报告, 加以推辞不去就职"
|
||||
keyword_note = {"具"="详细", "闻"="使...知道"}
|
||||
|
||||
["诏书/切峻/, 责/臣/逋慢/; /郡县/逼迫/, 催/臣/上道/; /州司/临门/, 急于/星火./"]
|
||||
note = []
|
||||
translation = "但是诏书急切严峻, 责备我逃避命令, 有意拖延, 态度傲慢。郡县长官催促我立刻上路; 州官登门督促, 比流星坠落还要急迫"
|
||||
keyword_note = {"切峻"="急切而严厉", "逋慢"="逃避怠慢", "星火"="流星的光, 喻急迫"}
|
||||
|
||||
["臣/欲/奉诏/奔驰/, 则/刘/病/日笃/, 欲/苟/顺/私情/, 则/告诉/不许./"]
|
||||
note = []
|
||||
translation = "我很想遵从皇上的旨意赴京就职, 但祖母刘氏的病却一天比一天重; 想要姑且顺从自己的私情, 但报告申诉不被允许"
|
||||
keyword_note = {"日笃"="病情日益加重", "苟"="姑且", "告诉"="报告申诉"}
|
||||
|
||||
["臣/之/进退/, 实为/狼狈./"]
|
||||
note = []
|
||||
translation = "我是进退两难, 十分狼狈"
|
||||
keyword_note = {"狼狈"="进退两难的样子"}
|
||||
|
||||
["伏惟/圣朝/以/孝/治/天下/, 凡/在/故老/, 犹/蒙/矜育/, 况/臣/孤苦/, 特为/尤甚./"]
|
||||
note = []
|
||||
translation = "我俯伏思量晋朝是用孝道来治理天下的, 凡是年老而德高的旧臣, 尚且还受到怜悯养育, 何况我的孤苦程度更为严重呢"
|
||||
keyword_note = {"伏惟"="下对上的敬辞", "故老"="年老德高的旧臣", "矜育"="怜悯养育"}
|
||||
|
||||
["且/臣/少/仕/伪朝/, 历职/郎署/, 本图/宦达/, 不矜/名节./"]
|
||||
note = []
|
||||
translation = "况且我年轻的时候曾经做过蜀汉的官, 担任过郎官职务, 本来就希望做官显达, 并不顾惜名声节操"
|
||||
keyword_note = {"伪朝"="对前朝的蔑称", "历职"="连续任职", "郎署"="尚书郎的官衙", "宦达"="官场上显达"}
|
||||
|
||||
["今/臣/亡国/贱俘/, 至微/至陋/, 过/蒙/拔擢/, 宠命/优渥/, 岂敢/盘桓/, 有所/希冀!/"]
|
||||
note = []
|
||||
translation = "现在我是一个低贱的亡国俘虏, 十分卑微浅陋, 受到过分提拔, 恩宠优厚, 怎敢犹豫不决而有非分的企求呢"
|
||||
keyword_note = {"拔擢"="提拔", "优渥"="优厚", "盘桓"="徘徊不前", "希冀"="非分的企求"}
|
||||
|
||||
["但/以/刘/日薄/西山/, 气息/奄奄/, 人命/危浅/, 朝不/虑夕./"]
|
||||
note = []
|
||||
translation = "只是因为祖母刘氏寿命即将终了, 气息微弱, 生命垂危, 早上不能想到晚上怎样"
|
||||
keyword_note = {"日薄西山"="太阳接近西山, 喻人寿命将终", "危浅"="生命垂危"}
|
||||
|
||||
["臣/无/祖母/, 无以/至今日/, 祖母/无/臣/, 无以/终余年./"]
|
||||
note = []
|
||||
translation = "臣下我如果没有祖母, 就没有今天的样子; 祖母如果没有我的照料, 也无法度过她的余生"
|
||||
keyword_note = {"终余年"="度过余生"}
|
||||
|
||||
["母孙/二人/, 更相/为命/, 是以/区区/不能/废远./"]
|
||||
note = []
|
||||
translation = "我们祖孙二人, 互相依靠而维持生命, 因此我的内心不愿废止奉养, 远离祖母"
|
||||
keyword_note = {"更相"="相互", "区区"="自己的私情", "废远"="废止奉养而远离"}
|
||||
|
||||
["臣/密/今年/四十/有四/, 祖母/今年/九十/有六/, 是/臣/尽节/于/陛下/之日/长/, 报养/刘/之日/短./"]
|
||||
note = []
|
||||
translation = "臣下我现在的年龄四十四岁了, 祖母现在的年龄九十六岁了, 臣下我在陛下面前尽忠尽节的日子还长着呢, 而在祖母刘氏面前尽孝尽心的日子已经不多了"
|
||||
keyword_note = {"有"="又", "尽节"="尽忠节"}
|
||||
|
||||
["乌鸟/私情/, 愿/乞/终养./"]
|
||||
note = []
|
||||
translation = "我怀着乌鸦反哺的私情, 乞求能够准许我完成对祖母养老送终的心愿"
|
||||
keyword_note = {"乌鸟私情"="乌鸦反哺之情, 喻孝心", "终养"="养老至终"}
|
||||
|
||||
["臣/之/辛苦/, 非独/蜀之/人士/及/二州/牧伯/所见/明知/, 皇天/后土/, 实所/共鉴./"]
|
||||
note = []
|
||||
translation = "我的辛酸苦楚, 并不仅仅被蜀地的百姓及益州、梁州的长官所亲眼目睹、内心明白, 连天地神明也都看得清清楚楚"
|
||||
keyword_note = {"辛苦"="辛酸苦楚", "牧伯"="州郡长官", "皇天后土"="天地神明", "鉴"="明察"}
|
||||
|
||||
["愿/陛下/矜悯/愚诚/, 听/臣/微志/, 庶/刘/侥幸/, 保/卒/余年./"]
|
||||
note = []
|
||||
translation = "希望陛下能怜悯我愚昧诚心, 请允许我完成臣下一点小小的心愿, 使祖母刘氏能够侥幸地保全她的余生"
|
||||
keyword_note = {"矜悯"="怜悯", "听"="准许", "庶"="或许(表希望)", "卒余年"="终老"}
|
||||
|
||||
["臣/生/当/陨首/, 死/当/结草./"]
|
||||
note = []
|
||||
translation = "我活着应当杀身报效朝廷, 死了也要结草衔环来报答陛下的恩情"
|
||||
keyword_note = {"陨首"="掉脑袋, 指献出生命", "结草"="死后报恩的典故"}
|
||||
|
||||
["臣/不胜/犬马/怖惧/之情/, 谨/拜表/以闻./"]
|
||||
note = []
|
||||
translation = "臣下我怀着牛马一样不胜恐惧的心情, 恭敬地呈上此表来使陛下知道这件事"
|
||||
keyword_note = {"不胜"="禁不住", "犬马怖惧"="臣子谦卑的自比", "闻"="使...知道"}
|
@@ -1,93 +0,0 @@
|
||||
# Wang Zhiyu 2025
|
||||
# Nucleon 是 HeurAMS 软件项目使用的专有源文件格式 (格式版本 v1, 基于 toml 格式)
|
||||
# 建议使用的 MIME 类型: application/vnd.xyz.imwangzhiyu.heurams-nucleon.v1+toml
|
||||
|
||||
# 散列表的键翻译
|
||||
["keydata"]
|
||||
note = "笔记"
|
||||
keyword_note = "关键词翻译"
|
||||
translation = "语句翻译"
|
||||
|
||||
# 测试项目元数据
|
||||
["testdata"]
|
||||
# 记忆时显示的额外信息
|
||||
additional_inf = ["translation","keyword_note", "note"]
|
||||
# 填空测试, content 指代键名
|
||||
fill_blank_test = {"from"=["content"], "hint"=["translation"]}
|
||||
# 选择题测试
|
||||
draw_card_test = {"from"=["keyword_note"]}
|
||||
|
||||
["臣闻/求木之/长者/, 必固/其根本/; /欲流之/远者/, 必浚/其泉源/; /思国之/安者/, 必积/其德义./"]
|
||||
note = []
|
||||
translation = "我听说想要树木长得好,一定要使它的根牢固;想要泉水流得远,一定要疏通它的源泉;想要国家安定,一定要厚积道德仁义"
|
||||
keyword_note = {"长(zhǎng)"="生长,这里指长得好", "固"="使……牢固", "根本"="树根", "浚(jùn)"="疏通,挖深", "德义"="道德仁义"}
|
||||
|
||||
["源不深/而望/流之远/, 根不固/而求/木之长/, 德不厚/而思/国之理/, 臣虽/下愚/, 知其/不可/, 而况于/明哲乎!/"]
|
||||
note = ["思国之理 一作:思国之治"]
|
||||
translation = "源泉不深却希望泉水流得远,根系不牢固却想要树木生长得高,道德不深厚却想要国家安定,微臣虽然愚笨,(也)知道这是不可能的,更何况(您这)聪明睿智(的人)呢!"
|
||||
keyword_note = {"下愚"="处于地位低见识浅的人", "明哲"="聪明睿智的人", "国之理"="国家治理,太平"}
|
||||
|
||||
["人君/当/神器之重/, 居/域中之大/, 将崇/极天之峻/, 永保/无疆之休./"]
|
||||
note = []
|
||||
translation = "国君掌握帝位的重权,在天地间尊大,就要推崇皇权的高峻,永保永无止境的美善"
|
||||
keyword_note = {"神器"="帝位", "域中"="天地之间", "休"="美,这里指政权的平和美好"}
|
||||
|
||||
["不念/居安思危/, 戒奢/以俭/, 德不处/其厚/, 情不胜/其欲/, 斯亦/伐根/以求/木茂/, 塞源/而欲/流长者也./"]
|
||||
note = ["塞源而欲流长者也 一作:塞源而欲流长也"]
|
||||
translation = "如果不在安逸的环境中想着危难,戒奢侈而行节俭,道德不能保持宽厚,性情不能克服欲望,这也如同挖断树根却想要树木长得茂盛,堵塞源泉却想要泉水流得远一样啊!"
|
||||
keyword_note = {"居安思危"="在安逸时想到危难", "戒奢以俭"="戒除奢侈而行节俭", "伐"="砍伐", "塞"="堵塞"}
|
||||
|
||||
["凡百/元首/, 承天/景命/, 莫不/殷忧/而道著/, 功成/而德衰./"]
|
||||
note = ["凡百 一作:凡昔"]
|
||||
translation = "(古代)所有的帝王,承受了上天赋予的重大使命,他们没有一个不为国家深切地忧虑而且治理成效显著的,但一旦功业建成就德性衰减"
|
||||
keyword_note = {"凡百"="所有的", "元首"="帝王", "景命"="大命,重大使命", "殷忧"="深忧"}
|
||||
|
||||
["有/善始者/实繁/, 能/克终者/盖寡./"]
|
||||
note = []
|
||||
translation = "国君开头做得好的实在很多,能够坚持到底的大概很少"
|
||||
keyword_note = {"善始"="开头做得好", "克终"="能够坚持到底", "盖"="大概,表推测语气"}
|
||||
|
||||
["岂/取之易/而守之难乎/? /昔/取之/而有余/, 今/守之/而不足/, 何也/?/"]
|
||||
note = []
|
||||
translation = "难道是取得天下容易守住天下困难吗?过去夺取天下时力量有余,现在守卫天下却力量不足,这是为什么呢?"
|
||||
keyword_note = {"取"="取得天下", "守"="守卫天下"}
|
||||
|
||||
["夫/在殷忧/, 必/竭诚/以待下/; /既得志/, 则/纵情/以傲物./"]
|
||||
note = []
|
||||
translation = "因为处在深重的忧虑之中,一定能竭尽诚心来对待臣民。成功之后,就放纵自己的性情来傲视别人"
|
||||
keyword_note = {"竭诚"="竭尽诚心", "待下"="对待臣下", "纵情"="放纵情感", "傲物"="傲视别人"}
|
||||
|
||||
["竭诚/则/胡越/为一体/, 傲物/则/骨肉/为行路./"]
|
||||
note = ["胡越 一作:吴越"]
|
||||
translation = "竭尽诚心,胡越之人也将同心同德;傲视别人,至亲骨肉也会成为不相干的路人"
|
||||
keyword_note = {"胡越"="胡地在北,越地在南,比喻相隔遥远", "骨肉"="指父母兄弟子女", "行路"="路人,比喻毫无关系的人"}
|
||||
|
||||
["虽/董之/以严刑/, 振之/以威怒/, 终/苟免/而不怀仁/, 貌恭/而不心服./"]
|
||||
note = []
|
||||
translation = "即使用严酷的刑罚来督责(人们),用威风怒气来吓唬(人们),人们最终只求苟且免于刑罚而不怀念感激国君的仁德,表面上恭敬但在心里不服气"
|
||||
keyword_note = {"董"="督责", "振"="通'震',震慑", "苟免"="苟且免于刑罚", "怀仁"="怀念仁德"}
|
||||
|
||||
["怨/不在大/, 可畏/惟人/; /载舟/覆舟/, 所宜/深慎/; /奔车/朽索/, 其可/忽乎!/"]
|
||||
note = []
|
||||
translation = "(臣民)对国君的怨恨不在大小,可怕的只是百姓的力量;(他们像水一样)能够负载船只,也能颠覆船只,这是应当深切戒慎的。用腐烂的绳索驾驭疾驰的马车,这样可以忽视不理吗?"
|
||||
keyword_note = {"惟人"="只是百姓(因避讳写作'人')", "载舟覆舟"="比喻百姓能拥戴皇帝,也能推翻他的统治", "奔车朽索"="用腐烂的绳索驾驭疾驰的马车"}
|
||||
|
||||
["君人者/, 诚能/见可欲/则思/知足/以自戒/, 将有作/则思/知止/以安人/, 念高危/则思/谦冲/而自牧/, 惧满溢/则思/江海/下百川/, 乐盘游/则思/三驱/以为度/, 忧懈怠/则思/慎始/而敬终/, 虑壅蔽/则思/虚心/以纳下/, 想谗邪/则思/正身/以黜恶/, 恩所加/则思/无因喜/以谬赏/, 罚所及/则思/无因怒/而滥刑./"]
|
||||
note = ["想谗邪 一作:惧谗邪"]
|
||||
translation = "统治天下的人,如果真的能够做到一见到能引起(自己)喜好的东西就要想到用知足来自我克制,将要兴建什么就要想到适可而止来使百姓安定,想到(君位)高而险,就要不忘谦虚,加强自身的道德修养。害怕骄傲自满,就要像江海居于百川之下(而能容纳百川),喜爱狩猎就想到网三面留一面,担心意志松懈就想到(做事)要慎始慎终,担心(言路)不通受蒙蔽就想到虚心采纳臣下的意见,考虑到(朝中可能会出现)谗佞奸邪就想到使自身端正(才能)罢黜奸邪,施加恩泽就要考虑到不要因为一时高兴而奖赏不当,动用刑罚就要想到不要因为一时发怒而滥用刑罚"
|
||||
keyword_note = {"见可欲"="见到能引起喜好的东西", "有作"="兴建建筑物", "知止"="知道适可而止", "谦冲"="谦虚", "自牧"="自我修养", "下百川"="居于百川之下", "三驱"="一年打猎三次为度", "慎始敬终"="谨慎开始谨慎结束", "壅蔽"="堵塞蒙蔽", "谗邪"="谗佞奸邪", "黜恶"="罢黜奸恶", "谬赏"="错误奖赏", "滥刑"="滥用刑罚"}
|
||||
|
||||
["总/此十思/, 弘兹/九德/, 简能/而任之/, 择善/而从之/, 则/智者/尽其谋/, 勇者/竭其力/, 仁者/播其惠/, 信者/效其忠./"]
|
||||
note = ["弘兹 一作:宏兹"]
|
||||
translation = "全面做到这十件应该深思的事,弘扬这九种美德,选拔有才能的人而任用他,挑选好的意见而听从它。那么有智慧的人就能充分献出他的谋略,勇敢的人就能完全使出他的力量,仁爱的人就能散播他的恩惠,诚信的人就能献出他的忠诚"
|
||||
keyword_note = {"弘兹"="弘扬这", "九德"="九种美德", "简能"="选拔有才能的人", "择善"="挑选好的意见", "效"="献出"}
|
||||
|
||||
["文武/争驰/, 在君/无事/, 可以/尽/豫游之乐/, 可以/养/松乔之寿/, 鸣琴/垂拱/, 不言/而化./"]
|
||||
note = ["在君 一作:君臣"]
|
||||
translation = "文臣武将争先恐后前来效力,国君没有大事烦扰,可以尽情享受出游的快乐,可以颐养得像赤松子与王子乔那样长寿,皇上弹着琴垂衣拱手就能治理好天下,不用再说什么,天下人就已经都有教化了"
|
||||
keyword_note = {"争驰"="争先效力", "豫游"="出游", "松乔"="赤松子和王子乔,古代传说中的仙人", "垂拱"="垂衣拱手,比喻轻易治理天下", "化"="教化"}
|
||||
|
||||
["何必/劳神/苦思/, 代下/司职/, 役/聪明/之耳目/, 亏/无为/之大道哉!/"]
|
||||
note = []
|
||||
translation = "为什么一定要(自己)劳神费思,代替臣下管理职事,役使自己灵敏、明亮的耳、眼,减损顺其自然就能治理好天下的大道理呢!"
|
||||
keyword_note = {"代下司职"="代替臣下管理职事", "役"="役使", "亏"="减损", "无为"="道家主张清静虚无,顺其自然"}
|
@@ -1,173 +0,0 @@
|
||||
# Wang Zhiyu 2025
|
||||
# Nucleon 是 HeurAMS 软件项目使用的专有源文件格式 (格式版本 v1, 基于 toml 格式)
|
||||
# 建议使用的 MIME 类型: application/vnd.xyz.imwangzhiyu.heurams-nucleon.v1+toml
|
||||
|
||||
# 散列表的键翻译
|
||||
["keydata"]
|
||||
note = "笔记"
|
||||
keyword_note = "关键词翻译"
|
||||
translation = "语句翻译"
|
||||
|
||||
# 测试项目元数据
|
||||
["testdata"]
|
||||
# 记忆时显示的额外信息
|
||||
additional_inf = ["translation","keyword_note", "note"]
|
||||
# 填空测试, content 指代键名
|
||||
fill_blank_test = {"from"=["content"], "hint"=["translation"]}
|
||||
# 选择题测试
|
||||
draw_card_test = {"from"=["keyword_note"]}
|
||||
|
||||
["秦孝公/据/崤函/之固/, 拥/雍州/之地/, 君臣/固守/以窥/周室/, 有/席卷/天下/, 包举/宇内/, 囊括/四海/之意/, 并吞/八荒/之心./"]
|
||||
note = []
|
||||
translation = "秦孝公占据着崤山和函谷关的险固地势,拥有雍州的土地,君臣牢固地守卫着,借以窥视周王室(的权力),有席卷天下,包办天宇之间,囊括四海的意图,并统天下的雄心"
|
||||
keyword_note = {"据"="占据", "崤函"="崤山和函谷关", "雍州"="古代九州之一", "窥"="窥视", "席卷"="像卷席子一样全部卷进去", "包举"="像打包一样全部拿走", "囊括"="像装口袋一样全部装进去", "八荒"="八方荒远之地"}
|
||||
|
||||
["当是时也/, 商君/佐之/, 内/立法度/, 务/耕织/, 修/守战/之具/, 外/连衡/而斗/诸侯./"]
|
||||
note = []
|
||||
translation = "正当这时,商鞅辅佐他,对内建立法规制度,从事耕作纺织,修造防守和进攻的器械;对外实行连衡策略,使诸侯自相争斗"
|
||||
keyword_note = {"商君"="商鞅", "法度"="法规制度", "务"="从事", "耕织"="耕作纺织", "守战之具"="防守和进攻的器械", "连衡"="连横策略", "斗"="使...相斗"}
|
||||
|
||||
["于是/秦人/拱手/而取/西河/之外./"]
|
||||
note = []
|
||||
translation = "因此,秦人轻而易举地夺取了黄河以西的土地"
|
||||
keyword_note = {"拱手"="两手相合,形容毫不费力", "西河"="黄河以西地区"}
|
||||
|
||||
["孝公/既没/, 惠文/、/武/、/昭襄/蒙/故业/, 因/遗策/, 南取/汉中/, 西举/巴/、/蜀/, 东割/膏腴/之地/, 北收/要害/之郡./"]
|
||||
note = []
|
||||
translation = "秦孝公死了以后,惠文王、武王、昭襄王承继先前的基业,沿袭前代的策略,向南夺取汉中,向西攻取巴、蜀,向东割取肥沃的地区,向北占领非常重要的地区"
|
||||
keyword_note = {"既没"="死后", "蒙"="承继", "故业"="先前的基业", "因"="沿袭", "遗策"="前代的策略", "膏腴"="肥沃", "要害"="非常重要"}
|
||||
|
||||
["诸侯/恐惧/, 会盟/而谋/弱秦/, 不爱/珍器/重宝/肥饶/之地/, 以致/天下/之士/, 合从/缔交/, 相与/为一./"]
|
||||
note = []
|
||||
translation = "诸侯恐慌害怕,集会结盟,商议削弱秦国。不吝惜奇珍贵重的器物和肥沃富饶的土地,用来招纳天下的优秀人才,采用合纵的策略缔结盟约,互相援助,成为一体"
|
||||
keyword_note = {"会盟"="集会结盟", "弱秦"="削弱秦国", "不爱"="不吝惜", "珍器重宝"="奇珍贵重的器物", "以致"="用来招纳", "合从"="合纵策略", "缔交"="缔结盟约"}
|
||||
|
||||
["当此/之时/, 齐有/孟尝/, 赵有/平原/, 楚有/春申/, 魏有/信陵./"]
|
||||
note = []
|
||||
translation = "在这个时候,齐国有孟尝君,赵国有平原君,楚国有春申君,魏国有信陵君"
|
||||
keyword_note = {"孟尝"="孟尝君田文", "平原"="平原君赵胜", "春申"="春申君黄歇", "信陵"="信陵君魏无忌"}
|
||||
|
||||
["此/四君/者/, 皆/明智/而/忠信/, 宽厚/而/爱人/, 尊贤/而/重士/, 约从/离衡/, 兼/韩/、/魏/、/燕/、/楚/、/齐/、/赵/、/宋/、/卫/、/中山/之众./"]
|
||||
note = []
|
||||
translation = "这四位封君,都见识英明有智谋,心地诚而讲信义,待人宽宏厚道而爱惜人民,尊重贤才而重用士人,以合纵之约击破秦的连横之策,联合韩、魏、燕、楚、齐、赵、宋、卫、中山的部队"
|
||||
keyword_note = {"明智"="见识英明有智谋", "忠信"="心地诚而讲信义", "爱人"="爱惜人民", "尊贤"="尊重贤才", "重士"="重用士人", "约从"="采用合纵策略", "离衡"="破坏连横策略", "兼"="联合"}
|
||||
|
||||
["于是/六国/之士/, 有/甯越/、/徐尚/、/苏秦/、/杜赫/之属/为之/谋/, 齐明/、/周最/、/陈轸/、/召滑/、/楼缓/、/翟景/、/苏厉/、/乐毅/之徒/通其/意/, 吴起/、/孙膑/、/带佗/、/倪良/、/王廖/、/田忌/、/廉颇/、/赵奢/之伦/制其/兵./"]
|
||||
note = []
|
||||
translation = "在这时,六国的士人,有宁越、徐尚、苏秦、杜赫等人为他们出谋划策,齐明、周最、陈轸、召滑、楼缓、翟景、苏厉、乐毅等人沟通他们的意见,吴起、孙膑、带佗、倪良、王廖、田忌、廉颇、赵奢等人统率他们的军队"
|
||||
keyword_note = {"之属"="等人", "为之谋"="为他们出谋划策", "之徒"="等人", "通其意"="沟通他们的意见", "之伦"="等人", "制其兵"="统率他们的军队"}
|
||||
|
||||
["尝以/十倍/之地/, 百万/之众/, 叩关/而攻/秦./"]
|
||||
note = []
|
||||
translation = "他们曾经用十倍于秦的土地,上百万的军队,攻打函谷关来攻打秦国"
|
||||
keyword_note = {"尝"="曾经", "以"="用", "叩关"="攻打函谷关"}
|
||||
|
||||
["秦人/开关/延敌/, 九国/之师/, 逡巡/而不敢/进./"]
|
||||
note = []
|
||||
translation = "秦人打开函谷关口迎战敌人,九国的军队有所顾虑徘徊不敢入关"
|
||||
keyword_note = {"开关"="打开函谷关", "延敌"="迎战敌人", "九国"="九个国家", "逡巡"="有所顾虑徘徊"}
|
||||
|
||||
["秦/无/亡矢/遗镞/之费/, 而/天下/诸侯/已困/矣./"]
|
||||
note = []
|
||||
translation = "秦人没有一兵一卒的耗费,然而天下的诸侯就已窘迫不堪了"
|
||||
keyword_note = {"亡矢"="丢失箭矢", "遗镞"="遗失箭头", "费"="耗费", "困"="窘迫不堪"}
|
||||
|
||||
["于是/从散/约败/, 争/割地/而赂/秦./"]
|
||||
note = []
|
||||
translation = "因此,纵约失败了,各诸侯国争着割地来贿赂秦国"
|
||||
keyword_note = {"从散"="纵约失败", "约败"="盟约破坏", "赂"="贿赂"}
|
||||
|
||||
["秦/有余力/而制/其弊/, 追亡/逐北/, 伏尸/百万/, 流血/漂橹/; /因利/乘便/, 宰割/天下/, 分裂/山河./"]
|
||||
note = []
|
||||
translation = "秦有剩余的力量趁他们困乏而制服他们,追赶逃走的败兵,百万败兵横尸道路,流淌的血液可以漂浮盾牌。秦国凭借这便利的形势,割取天下的土地,重新划分山河的区域"
|
||||
keyword_note = {"制其弊"="趁他们困乏而制服他们", "追亡"="追赶逃兵", "逐北"="追逐败兵", "伏尸"="横尸", "漂橹"="漂浮盾牌", "因利乘便"="凭借便利的形势", "宰割"="割取", "分裂"="划分"}
|
||||
|
||||
["强国/请服/, 弱国/入朝./"]
|
||||
note = []
|
||||
translation = "强国主动表示臣服,弱国入秦朝拜"
|
||||
keyword_note = {"请服"="请求臣服", "入朝"="入秦朝拜"}
|
||||
|
||||
["延及/孝文王/、/庄襄王/, 享国/之日/浅/, 国家/无事./"]
|
||||
note = []
|
||||
translation = "延续到孝文王、庄襄王,统治的时间不长,秦国并没有什么大事发生"
|
||||
keyword_note = {"延及"="延续到", "享国"="统治国家", "浅"="时间短", "无事"="没有大事发生"}
|
||||
|
||||
["及至/始皇/, 奋/六世/之余烈/, 振/长策/而御/宇内/, 吞/二周/而亡/诸侯/, 履/至尊/而制/六合/, 执/敲扑/而鞭笞/天下/, 威振/四海./"]
|
||||
note = []
|
||||
translation = "到始皇的时候,发展六世遗留下来的功业,以武力来统治各国,将东周,西周和各诸侯国统统消灭,登上皇帝的宝座来统治天下,用严酷的刑罚来奴役天下的百姓,威风震慑四海"
|
||||
keyword_note = {"奋"="发展", "余烈"="遗留下来的功业", "振长策"="挥动长鞭", "御宇内"="统治天下", "吞"="吞并", "二周"="东周和西周", "履至尊"="登上皇位", "制六合"="统治天下", "敲扑"="刑具", "鞭笞"="鞭打,奴役", "威振"="威风震慑"}
|
||||
|
||||
["南取/百越/之地/, 以为/桂林/、/象郡/; /百越/之君/, 俯首/系颈/, 委命/下吏./"]
|
||||
note = []
|
||||
translation = "秦始皇向南攻取百越的土地,把它划为桂林郡和象郡,百越的君主低着头,颈上捆着绳子(愿意服从投降),把性命交给司法官吏"
|
||||
keyword_note = {"百越"="古代南方少数民族", "以为"="把它作为", "俯首"="低头", "系颈"="颈上捆着绳子", "委命"="把性命交给", "下吏"="司法官吏"}
|
||||
|
||||
["乃使/蒙恬/北筑/长城/而守/藩篱/, 却/匈奴/七百/余里/; /胡人/不敢/南下/而牧马/, 士/不敢/弯弓/而报怨./"]
|
||||
note = []
|
||||
translation = "秦始皇于是又命令蒙恬在北方修筑长城,守卫边境,使匈奴退却七百多里;胡人不敢向下到南边来放牧,勇士不敢拉弓射箭来报仇"
|
||||
keyword_note = {"蒙恬"="秦朝名将", "藩篱"="边境", "却"="使...退却", "匈奴"="北方少数民族", "胡人"="指匈奴人", "牧马"="放牧", "弯弓"="拉弓", "报怨"="报仇"}
|
||||
|
||||
["于是/废/先王/之道/, 焚/百家/之言/, 以愚/黔首/; /隳/名城/, 杀/豪杰/; /收/天下/之兵/, 聚之/咸阳/, 销/锋镝/, 铸以为/金人/十二/, 以弱/天下/之民./"]
|
||||
note = []
|
||||
translation = "秦始皇接着就废除古代帝王的治世之道,焚烧诸子百家的著作,来使百姓愚蠢;毁坏高大的城墙,杀掉英雄豪杰;收缴天下的兵器,集中在咸阳,销毁兵刃和箭头,冶炼它们铸造十二个铜人,以便削弱百姓的反抗力量"
|
||||
keyword_note = {"先王"="古代帝王", "道"="治世之道", "百家之言"="诸子百家的著作", "愚"="使...愚蠢", "黔首"="百姓", "隳"="毁坏", "名城"="高大的城墙", "兵"="兵器", "销"="销毁", "锋镝"="兵刃和箭头", "铸以为"="铸造成为", "金人"="铜人", "弱"="削弱"}
|
||||
|
||||
["然后/践华/为城/, 因河/为池/, 据/亿丈/之城/, 临/不测/之渊/, 以为/固./"]
|
||||
note = []
|
||||
translation = "然后凭借华山为城墙,依据黄河为城池,凭借着高耸的华山,往下看着深不可测的黄河,认为这是险固的地方"
|
||||
keyword_note = {"践华"="凭借华山", "因河"="依据黄河", "为城"="作为城墙", "为池"="作为护城河", "亿丈"="形容极高", "不测"="深不可测", "渊"="深水", "固"="险固"}
|
||||
|
||||
["良将/劲弩/守/要害/之处/, 信臣/精卒/陈/利兵/而谁何./"]
|
||||
note = []
|
||||
translation = "好的将领手执强弩,守卫着要害的地方,可靠的官员和精锐的士卒,拿着锋利的兵器,盘问过往行人"
|
||||
keyword_note = {"劲弩"="强弩", "要害"="重要关键", "信臣"="可靠的官员", "精卒"="精锐的士卒", "陈"="陈列,拿着", "利兵"="锋利的兵器", "谁何"="盘问行人"}
|
||||
|
||||
["天下/已定/, 始皇/之心/, 自以为/关中/之固/, 金城/千里/, 子孙/帝王/万世/之业/也./"]
|
||||
note = []
|
||||
translation = "天下已经安定,始皇心里自己认为这关中的险固地势、方圆千里的坚固的城防,是子子孙孙称帝称王直至万代的基业"
|
||||
keyword_note = {"自以为"="自己认为", "关中"="函谷关以西地区", "固"="险固地势", "金城"="坚固的城池", "帝王"="称帝称王", "万世"="万代"}
|
||||
|
||||
["始皇/既没/, 余威/震于/殊俗./"]
|
||||
note = []
|
||||
translation = "始皇去世之后,他的余威(依然)震慑着边远地区"
|
||||
keyword_note = {"既没"="死后", "余威"="剩余的威势", "震"="震慑", "殊俗"="不同的风俗,指边远地区"}
|
||||
|
||||
["然/陈涉/瓮牖/绳枢/之子/, 氓隶/之人/, 而/迁徙/之徒/也/; /才能/不及/中人/, 非有/仲尼/、/墨翟/之贤/, 陶朱/、/猗顿/之富/; /蹑足/行伍/之间/, 而/倔起/阡陌/之中/, 率/疲弊/之卒/, 将/数百/之众/, 转而/攻秦/; /斩木/为兵/, 揭竿/为旗/, 天下/云集/响应/, 赢粮/而景从./"]
|
||||
note = []
|
||||
translation = "可是,陈涉不过是个破瓮做窗户、草绳做户枢的贫家子弟,是氓、隶一类的人,(后来)做了被迁谪戍边的卒子;才能不如普通人,并没有孔丘、墨翟那样的贤德,也不像陶朱、猗顿那样富有。(他)跻身于戍卒的队伍中,从田野间突然奋起发难,率领着疲惫无力的士兵,指挥着几百人的队伍,掉转头来进攻秦国,砍下树木作武器,举起竹竿当旗帜,天下豪杰像云一样聚集,回声似的应和他,许多人都背着粮食,如影随形"
|
||||
keyword_note = {"瓮牖"="用破瓮做窗户", "绳枢"="用草绳系户枢", "氓隶"="平民和奴隶", "迁徙之徒"="被征发戍边的人", "中人"="普通人", "仲尼"="孔子", "墨翟"="墨子", "陶朱"="范蠡", "猗顿"="春秋时富商", "蹑足"="置身于", "行伍"="军队", "倔起"="突然奋起", "阡陌"="田野", "疲弊"="疲惫无力", "将"="率领", "斩木为兵"="砍树木作武器", "揭竿为旗"="举竹竿当旗帜", "云集"="像云一样聚集", "响应"="像回声一样应和", "赢粮"="背着粮食", "景从"="如影随形"}
|
||||
|
||||
["山东/豪俊/遂/并起/而亡/秦族/矣./"]
|
||||
note = []
|
||||
translation = "崤山以东的英雄豪杰于是一齐起事,消灭了秦的家族"
|
||||
keyword_note = {"山东"="崤山以东", "豪俊"="英雄豪杰", "并起"="一齐起事", "亡"="消灭", "秦族"="秦的家族"}
|
||||
|
||||
["且夫/天下/非/小弱/也/, 雍州/之地/, 崤函/之固/, 自若/也./"]
|
||||
note = []
|
||||
translation = "况且那天下并没有缩小削弱,雍州的地势,崤山和函谷关的险固,是保持原来的样子"
|
||||
keyword_note = {"且夫"="况且", "小弱"="变小削弱", "自若"="保持原样"}
|
||||
|
||||
["陈涉/之位/, 非/尊于/齐/、/楚/、/燕/、/赵/、/韩/、/魏/、/宋/、/卫/、/中山/之君/也/; /锄櫌/棘矜/, 非/铦于/钩戟/长铩/也/; /谪戍/之众/, 非/抗于/九国/之师/也/; /深谋/远虑/, 行军/用兵/之道/, 非及/乡时/之士/也./"]
|
||||
note = []
|
||||
translation = "陈涉的地位,没有比齐、楚、燕、赵、韩、魏、宋、卫、中山的国君更加尊贵;锄头木棍也不比钩戟长矛更锋利;那迁谪戍边的士兵也不能和九国部队抗衡;深谋远虑,行军用兵的方法,也比不上先前九国的武将谋臣"
|
||||
keyword_note = {"尊于"="比...尊贵", "锄櫌"="锄头", "棘矜"="木棍", "铦于"="比...锋利", "钩戟"="带钩的戟", "长铩"="长矛", "谪戍"="被贬戍边", "抗于"="和...抗衡", "九国"="九个国家", "深谋远虑"="深谋远虑", "行军用兵"="行军作战", "非及"="比不上", "乡时"="先前"}
|
||||
|
||||
["然而/成败/异变/, 功业/相反/, 何也/?/"]
|
||||
note = []
|
||||
translation = "可是条件好者失败而条件差者成功,功业完全相反,为什么呢?"
|
||||
keyword_note = {"成败异变"="成功失败发生变化", "功业相反"="功业完全相反"}
|
||||
|
||||
["试使/山东/之国/与/陈涉/度长/絜大/, 比权/量力/, 则/不可/同年/而语/矣./"]
|
||||
note = []
|
||||
translation = "假使拿东方诸侯国跟陈涉比一比长短大小,量一量权势力量,就更不能相提并论了"
|
||||
keyword_note = {"试使"="假使", "度长絜大"="衡量长短大小", "比权量力"="比较权势力量", "同年而语"="相提并论"}
|
||||
|
||||
["然/秦/以/区区/之地/, 致/万乘/之势/, 序/八州/而朝/同列/, 百有/余年/矣/; /然后/以/六合/为家/, 崤函/为宫/; /一夫/作难/而/七庙/隳/, 身死/人手/, 为/天下/笑者/, 何也/?/"]
|
||||
note = []
|
||||
translation = "然而秦凭借着它的小小的地方,发展到兵车万乘的国势,管辖全国,使六国诸侯都来朝见,已经一百多年了;这之后把天下作为家业,用崤山、函谷关作为自己的内宫;陈涉一人起义国家就灭亡了,秦王子婴死在别人(项羽)手里,被天下人耻笑,这是为什么呢?"
|
||||
keyword_note = {"区区"="小小", "致"="达到", "万乘"="兵车万乘", "序八州"="管辖全国", "朝同列"="使同列来朝拜", "百有余年"="一百多年", "六合为家"="把天下作为家业", "崤函为宫"="把崤山函谷关作为内宫", "一夫作难"="一人起义", "七庙隳"="宗庙毁灭,国家灭亡", "身死人手"="死在别人手里", "为天下笑"="被天下人耻笑"}
|
||||
|
||||
["仁义/不施/而/攻守/之势/异也./"]
|
||||
note = []
|
||||
translation = "就因为不施行仁政而使攻守的形势发生了变化啊"
|
||||
keyword_note = {"仁义"="仁政", "不施"="不施行", "攻守之势"="进攻和防守的形势", "异"="发生变化"}
|
@@ -1 +0,0 @@
|
||||
# HeurSync 同步器
|
57
precache.py
57
precache.py
@@ -1,57 +0,0 @@
|
||||
# 音频预缓存实用程序, 独立于主程序之外, 但依赖其他组件
|
||||
import particles as pt
|
||||
import auxiliary as aux
|
||||
import edge_tts as tts
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import time
|
||||
|
||||
|
||||
def precache(text: str):
|
||||
"""预缓存单个文本的音频"""
|
||||
cache_dir = Path("./cache/voice/")
|
||||
cache_dir.mkdir(parents=True, exist_ok=True)
|
||||
cache = cache_dir / f"{aux.get_md5(text)}.wav"
|
||||
if not cache.exists():
|
||||
communicate = tts.Communicate(text, "zh-CN-XiaoxiaoNeural")
|
||||
communicate.save_sync(f"./cache/voice/{aux.get_md5(text)}.wav")
|
||||
|
||||
|
||||
def proc_file(path: Path):
|
||||
"""处理单个文件"""
|
||||
nu = pt.NucleonUnion(path)
|
||||
c = 0
|
||||
for i in nu.nucleons:
|
||||
c += 1
|
||||
print(f"预缓存 [{nu.name}] ({c}/{len(nu)}): {i['content'].replace('/', '')}")
|
||||
precache(i['content'].replace('/', ''))
|
||||
|
||||
|
||||
def walk(path_str: str):
|
||||
"""遍历目录处理所有文件"""
|
||||
path = Path(path_str)
|
||||
print(f"正在遍历目录: {path}")
|
||||
try:
|
||||
for item in path.iterdir():
|
||||
if item.is_file() and item.suffix == ".toml":
|
||||
print(f"正预缓存文件: {item.name}")
|
||||
proc_file(item)
|
||||
elif item.is_dir():
|
||||
print(f"进入目录: {item.name}")
|
||||
except:
|
||||
print("发生一个异常, 于 5 秒后自动重新下载")
|
||||
time.sleep(5)
|
||||
walk(path_str)
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("音频预缓存实用程序")
|
||||
print("A: 全部缓存")
|
||||
print("C: 清空缓存")
|
||||
|
||||
choice = input("输入选项 $ ").upper()
|
||||
|
||||
if choice == "A":
|
||||
walk("./nucleon")
|
||||
elif choice == "C":
|
||||
shutil.rmtree("./cache/voice", ignore_errors=True)
|
||||
print("缓存已清空")
|
121
puzzles.py
121
puzzles.py
@@ -1,121 +0,0 @@
|
||||
import random
|
||||
|
||||
|
||||
class BasePuzzle:
|
||||
pass
|
||||
|
||||
|
||||
class BlankPuzzle(BasePuzzle):
|
||||
"""填空题谜题生成器
|
||||
|
||||
Args:
|
||||
text: 原始字符串(需要 "/" 分割句子, 末尾应有 "/")
|
||||
min_denominator: 最小概率倒数(如占所有可生成填空数的 1/7 中的 7, 若期望值小于 1, 则取 1)
|
||||
"""
|
||||
|
||||
def __init__(self, text: str, min_denominator: int):
|
||||
self.text = text
|
||||
self.min_denominator = min_denominator
|
||||
self.wording = "填空题 - 尚未刷新谜题"
|
||||
self.answer = ["填空题 - 尚未刷新谜题"]
|
||||
|
||||
def refresh(self): # 刷新谜题
|
||||
placeholder = "___SLASH___"
|
||||
tmp_text = self.text.replace("/", placeholder)
|
||||
words = tmp_text.split(placeholder)
|
||||
if not words:
|
||||
return
|
||||
words = [word for word in words if word]
|
||||
num_blanks = min(max(1, len(words) // self.min_denominator), len(words))
|
||||
indices_to_blank = random.sample(range(len(words)), num_blanks)
|
||||
indices_to_blank.sort()
|
||||
blanked_words = list(words)
|
||||
answer = list()
|
||||
for index in indices_to_blank:
|
||||
blanked_words[index] = "__" * len(words[index])
|
||||
answer.append(words[index])
|
||||
self.answer = answer
|
||||
self.wording = "".join(blanked_words)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.wording}\n{str(self.answer)}"
|
||||
|
||||
|
||||
class SelectionPuzzle(BasePuzzle):
|
||||
"""选择题谜题生成器
|
||||
|
||||
Args:
|
||||
mapping: 正确选项映射 {问题: 答案}
|
||||
jammer: 干扰项列表
|
||||
max_riddles_num: 最大生成谜题数 (默认2个)
|
||||
prefix: 问题前缀
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
mapping: dict,
|
||||
jammer: list,
|
||||
max_riddles_num: int = 2,
|
||||
prefix: str = ""
|
||||
):
|
||||
self.prefix = prefix
|
||||
self.mapping = mapping
|
||||
self.jammer = list(set(jammer + list(mapping.values())))
|
||||
while len(self.jammer) < 4:
|
||||
self.jammer.append(" ")
|
||||
self.max_riddles_num = max(1, min(max_riddles_num, 5))
|
||||
self.wording = "选择题 - 尚未刷新谜题"
|
||||
self.answer = ["选择题 - 尚未刷新谜题"]
|
||||
self.options = []
|
||||
|
||||
def refresh(self):
|
||||
"""刷新谜题,根据题目数量生成适当数量的谜题"""
|
||||
if not self.mapping:
|
||||
self.wording = "无可用题目"
|
||||
self.answer = ["无答案"]
|
||||
self.options = []
|
||||
return
|
||||
|
||||
num_questions = min(self.max_riddles_num, len(self.mapping))
|
||||
questions = random.sample(list(self.mapping.items()), num_questions)
|
||||
puzzles = []
|
||||
answers = []
|
||||
all_options = []
|
||||
|
||||
for question, correct_answer in questions:
|
||||
options = [correct_answer]
|
||||
available_jammers = [
|
||||
j for j in self.jammer if j != correct_answer
|
||||
]
|
||||
if len(available_jammers) >= 3:
|
||||
selected_jammers = random.sample(available_jammers, 3)
|
||||
else:
|
||||
selected_jammers = random.choices(available_jammers, k=3)
|
||||
options.extend(selected_jammers)
|
||||
random.shuffle(options)
|
||||
puzzles.append(question)
|
||||
answers.append(correct_answer)
|
||||
all_options.append(options)
|
||||
|
||||
question_texts = []
|
||||
for i, puzzle in enumerate(puzzles):
|
||||
question_texts.append(f"{self.prefix}:\n {i+1}. {puzzle}")
|
||||
|
||||
self.wording = question_texts
|
||||
self.answer = answers
|
||||
self.options = all_options
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.wording}\n正确答案: {', '.join(self.answer)}"
|
||||
|
||||
if __name__ == "__main__":
|
||||
puz = SelectionPuzzle(
|
||||
{"1+1": "2", "1+2": "3", "1+3": "4"},
|
||||
["2", "5", "0"],
|
||||
3,
|
||||
'求值: '
|
||||
)
|
||||
puz.refresh()
|
||||
print(puz.wording)
|
||||
print(puz.answer)
|
||||
print(puz.options)
|
11
pyproject.toml
Normal file
11
pyproject.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=45", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "heurams"
|
||||
version = "0.4.0"
|
||||
description = "Heuristic Assisted Memory Scheduler"
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["src"]
|
192
reactor.py
192
reactor.py
@@ -1,192 +0,0 @@
|
||||
import typing
|
||||
import particles as pt
|
||||
import pathlib
|
||||
import auxiliary as aux
|
||||
import compositions as comps
|
||||
import random
|
||||
#from pprint import pprint as print # debug
|
||||
|
||||
class Glimpse():
|
||||
"""轻量级只读, 用于状态指示"""
|
||||
def __init__(self, nucleon_union: pt.NucleonUnion):
|
||||
self.name = nucleon_union.name
|
||||
self.nuc_u = nucleon_union
|
||||
self.elt_u = self.nuc_u.linked_electron_union()
|
||||
self.lastest_date = -1
|
||||
self.next_date = 0x3f3f3f3f
|
||||
self.avg_efactor = 0
|
||||
self.total_num = 0
|
||||
self.activated_num = 0
|
||||
self.is_initialized = 0
|
||||
if self.elt_u != 0:
|
||||
self.is_initialized = 1
|
||||
self.total_num = len(self.elt_u.electrons)
|
||||
for i in self.elt_u.electrons:
|
||||
if i['next_date'] > 0:
|
||||
self.next_date = min(self.next_date, i['next_date'])
|
||||
self.lastest_date = max(self.lastest_date, i['last_date'])
|
||||
if i['is_activated']:
|
||||
self.avg_efactor += i['efactor']
|
||||
self.activated_num += 1
|
||||
if self.next_date == 0x3f3f3f3f:
|
||||
self.next_date = -1
|
||||
self.is_initialized = 0
|
||||
if self.activated_num == 0:
|
||||
return
|
||||
self.avg_efactor = round(self.avg_efactor / self.activated_num, 2)
|
||||
if self.next_date == 0x3f3f3f3f:
|
||||
self.next_date = -1
|
||||
return
|
||||
|
||||
class Apparatus():
|
||||
"""反应器对象, 决策一个原子的不同记忆方式, 并反馈到布局"""
|
||||
def __init__(self, screen, reactor, atom):
|
||||
self.electron: pt.Electron = atom[0]
|
||||
self.nucleon: pt.Nucleon = atom[1]
|
||||
self.positron: dict = atom[2]
|
||||
self.testdata = self.positron["testdata"]
|
||||
self.procession: typing.List[comps.Composition] = list()
|
||||
if self.positron["is_new_activation"] == 1:
|
||||
self.positron["is_new_activation"] = 0
|
||||
self.procession.append(comps.registry["recognition"](screen, reactor, atom))
|
||||
return
|
||||
for i in self.positron["testdata"].keys():
|
||||
if i == "additional_inf":
|
||||
continue
|
||||
if i == "fill_blank_test": # 加深
|
||||
self.procession.append(comps.registry[i](screen, reactor, atom))
|
||||
self.procession.append(comps.registry[i](screen, reactor, atom))
|
||||
self.procession.append(comps.registry[i](screen, reactor, atom))
|
||||
# self.procession.reverse()
|
||||
random.shuffle(self.procession)
|
||||
|
||||
def iterator(self):
|
||||
yield from self.procession
|
||||
|
||||
|
||||
class Reactor():
|
||||
"""反应堆对象, 处理和分配一次文件记忆流程的资源与策略"""
|
||||
def __init__(self, nucleon_file: pt.NucleonUnion, electron_file: pt.ElectronUnion, screen, tasked_num):
|
||||
# 导入原子对象
|
||||
self.nucleon_file = nucleon_file
|
||||
self.electron_file = electron_file
|
||||
self.tasked_num = tasked_num
|
||||
self.atoms_new = list()
|
||||
self.atoms_review = list()
|
||||
counter = self.tasked_num
|
||||
self.screen = screen
|
||||
self.electron_dict = electron_file.electrons_dict
|
||||
self.quality_dict = {}
|
||||
|
||||
def electron_dict_get_fallback(key) -> pt.Electron:
|
||||
value = self.electron_dict.get(key)
|
||||
# 如果值不存在,则设置默认值
|
||||
if value is None:
|
||||
value = pt.Electron(key, {}) # 获取默认值
|
||||
self.electron_dict[key] = value # 将默认值存入字典
|
||||
electron_file.sync()
|
||||
return value # 返回获取的值(可能是默认值)
|
||||
|
||||
for nucleon in nucleon_file.nucleons:
|
||||
# atom = (Electron, Nucleon, Positron) 即 (记忆元数据, 内容元数据, 运行时数据)
|
||||
atom = (electron_dict_get_fallback(nucleon.content), nucleon, {}) # 使用 "Positron" 代称 atom[2]
|
||||
atom[2]["testdata"] = nucleon_file.testdata
|
||||
atom[2]["keydata"] = nucleon_file.keydata
|
||||
if atom[0]["is_activated"] == 0:
|
||||
if counter > 0:
|
||||
atom[2]["is_new_activation"] = 1
|
||||
atom[0]["is_activated"] = 1
|
||||
self.atoms_new.append(atom)
|
||||
counter -= 1
|
||||
else:
|
||||
atom[2]["is_new_activation"] = 0
|
||||
if int(atom[0]["next_date"]) <= aux.get_daystamp():
|
||||
atom[0]["last_date"] = aux.get_daystamp()
|
||||
self.atoms_review.append(atom)
|
||||
# 设置运行时
|
||||
self.index: int
|
||||
self.procession: list
|
||||
self.failed: list
|
||||
self.round_title: str
|
||||
self.current_atom: typing.Tuple[pt.Electron, pt.Nucleon, dict]
|
||||
self.round_set = 0
|
||||
self.current_atom = pt.Atom.placeholder()
|
||||
#print(self.atoms_new)
|
||||
|
||||
def set_round(self, title, procession):
|
||||
self.round_set = 1
|
||||
self.round_title = title
|
||||
self.procession = procession
|
||||
self.failed = list()
|
||||
self.index = -1
|
||||
|
||||
def set_round_templated(self, stage):
|
||||
titles = {
|
||||
1: "复习模式",
|
||||
2: "新记忆模式",
|
||||
3: "总复习模式"
|
||||
}
|
||||
processions = {
|
||||
1: self.atoms_review,
|
||||
2: self.atoms_new,
|
||||
3: (self.atoms_new + self.atoms_review)
|
||||
}
|
||||
ret = 1
|
||||
if stage == 1 and len(processions[1]) == 0:
|
||||
stage = 2
|
||||
ret = 2
|
||||
if stage == 1 and len(processions[2]) == 0:
|
||||
stage = 3
|
||||
ret = 3
|
||||
self.set_round(title=titles[stage], procession=processions[stage])
|
||||
return ret
|
||||
|
||||
def forward(self, step = 1):
|
||||
"""
|
||||
返回值规则:
|
||||
1: 重定向至 failed
|
||||
-1: 此轮已完成
|
||||
0: 下一个记忆单元
|
||||
"""
|
||||
if self.index + step >= len(self.procession):
|
||||
if len(self.failed) > 0:
|
||||
self.procession = self.failed
|
||||
self.index = -1
|
||||
self.forward(step)
|
||||
if "- 额外复习" not in self.round_title:
|
||||
self.round_title += " - 额外复习"
|
||||
self.failed = list()
|
||||
return 1 # 自动重定向到 failed
|
||||
else:
|
||||
self.round_set = 0
|
||||
return -1 # 此轮已完成
|
||||
self.index += step
|
||||
self.current_atom = self.procession[self.index]
|
||||
self.current_appar = Apparatus(self.screen, self, self.current_atom).iterator()
|
||||
return 0
|
||||
|
||||
def save(self):
|
||||
self._deploy_report()
|
||||
print("Progress saved")
|
||||
# self.nucleon_file.save()
|
||||
if self.electron_file.total["last_date"] < aux.get_daystamp():
|
||||
self.electron_file.save()
|
||||
|
||||
def _deploy_report(self):
|
||||
"部署所有 _report"
|
||||
for e, q in self.quality_dict.items():
|
||||
if q == -1:
|
||||
e.revisor(5, True)
|
||||
continue
|
||||
e.revisor(q)
|
||||
|
||||
def report(self, atom, quality):
|
||||
"向反应器和最低质量记录汇报"
|
||||
if atom in self.atoms_new:
|
||||
self.quality_dict[atom[0]] = -1
|
||||
print(self.quality_dict)
|
||||
return
|
||||
self.quality_dict[atom[0]] = min(quality, self.quality_dict.get(atom[0], 5))
|
||||
if quality <= 3:
|
||||
self.failed.append(atom)
|
||||
print(self.quality_dict)
|
77
reactor_k.py
77
reactor_k.py
@@ -1,77 +0,0 @@
|
||||
# reactor.py 设计改进型 尚未完成功能重构
|
||||
import particles as pt
|
||||
import auxiliary as aux
|
||||
import time
|
||||
from typing import List
|
||||
|
||||
class BaseScheduler():
|
||||
"调度器接口"
|
||||
|
||||
def revisor(self, electron: pt.Electron, quality: int):
|
||||
"""由 quality 更新电子的记忆参数"""
|
||||
pass
|
||||
|
||||
def get_atoms_for_review(self, electron_file: pt.ElectronUnion):
|
||||
"""从电子文件中筛选出当前需要复习的所有原子"""
|
||||
pass
|
||||
|
||||
def get_atoms_for_learning(self, nucleon_file: pt.NucleonUnion, limit: int):
|
||||
"""从核子文件中获取待学习的新原子"""
|
||||
pass
|
||||
|
||||
class SM2Scheduler(BaseScheduler):
|
||||
"基于 SM-2 的调度器实现"
|
||||
def revisor(self, electron: pt.Electron, quality: int, is_new_activation):
|
||||
print(f"REVISOR: {quality}, {is_new_activation}")
|
||||
if quality == -1:
|
||||
return -1
|
||||
|
||||
electron.metadata['efactor'] = electron.metadata['efactor'] + (
|
||||
0.1 - (5 - quality) * (0.08 + (5 - quality) * 0.02)
|
||||
)
|
||||
electron.metadata['efactor'] = max(1.3, electron.metadata['efactor'])
|
||||
|
||||
if quality < 3:
|
||||
# 若保留率低于 3,重置重复次数
|
||||
electron.metadata['rept'] = 0
|
||||
electron.metadata['interval'] = 0 # 设为0,以便下面重新计算 I(1)
|
||||
else:
|
||||
electron.metadata['rept'] += 1
|
||||
|
||||
electron.metadata['real_rept'] += 1
|
||||
|
||||
if is_new_activation: # 初次激活
|
||||
electron.metadata['rept'] = 0
|
||||
electron.metadata['efactor'] = 2.5
|
||||
|
||||
if electron.metadata['rept'] == 0: # 刚被重置或初次激活后复习
|
||||
electron.metadata['interval'] = 1 # I(1)
|
||||
elif electron.metadata['rept'] == 1:
|
||||
electron.metadata['interval'] = 6 # I(2) 经验公式
|
||||
else:
|
||||
electron.metadata['interval'] = round(
|
||||
electron.metadata['interval'] * electron.metadata['efactor']
|
||||
)
|
||||
|
||||
electron.metadata['last_date'] = aux.get_daystamp()
|
||||
electron.metadata['next_date'] = aux.get_daystamp() + electron.metadata['interval']
|
||||
electron.metadata['last_modify'] = time.time()
|
||||
|
||||
def get_atoms_for_learning(self, nucleon_file: pt.NucleonUnion, limit: int):
|
||||
def electron_dict_get_fallback(key) -> pt.Electron:
|
||||
value = self.electron_dict.get(key)
|
||||
# 如果值不存在,则设置默认值
|
||||
if value is None:
|
||||
value = pt.Electron(key, {}) # 获取默认值
|
||||
self.electron_dict[key] = value # 将默认值存入字典
|
||||
electron_file.sync()
|
||||
return value # 返回获取的值(可能是默认值)
|
||||
|
||||
for i in nucleon_file.nucleons:
|
||||
if i.metadata
|
||||
|
||||
def get_atoms_for_review(self, electron_file: pt.ElectronUnion):
|
||||
return super().get_atoms_for_review(electron_file)
|
||||
|
||||
class FSRSScheduler():
|
||||
"基于 FSRS 的调度器实现"
|
Binary file not shown.
Before Width: | Height: | Size: 120 KiB |
Binary file not shown.
Before Width: | Height: | Size: 559 KiB |
Binary file not shown.
Before Width: | Height: | Size: 177 KiB |
Binary file not shown.
Before Width: | Height: | Size: 161 KiB |
@@ -1,8 +0,0 @@
|
||||
aiohttp==3.12.13
|
||||
aiohttp_jinja2==1.6
|
||||
edge_tts==7.0.2
|
||||
Jinja2==3.1.6
|
||||
playsound==1.2.2
|
||||
rich==14.1.0
|
||||
textual==5.0.1
|
||||
toml==0.10.2
|
264
screens.py
264
screens.py
@@ -1,264 +0,0 @@
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.widgets import (
|
||||
Header,
|
||||
Footer,
|
||||
ListView,
|
||||
ProgressBar,
|
||||
DirectoryTree,
|
||||
ListItem,
|
||||
Label,
|
||||
Markdown,
|
||||
Static,
|
||||
Button,
|
||||
)
|
||||
from textual.containers import Container, Horizontal, Center
|
||||
from textual.screen import Screen
|
||||
import pathlib
|
||||
import threading
|
||||
import edge_tts as tts
|
||||
from playsound import playsound
|
||||
import particles as pt
|
||||
from reactor import Reactor, Apparatus, Glimpse
|
||||
import auxiliary as aux
|
||||
import compositions as compo
|
||||
import builtins
|
||||
import metadata
|
||||
|
||||
config = aux.ConfigFile("config.toml")
|
||||
|
||||
class MemScreen(Screen):
|
||||
BINDINGS = [
|
||||
("d", "toggle_dark", "改变色调"),
|
||||
("q", "pop_screen", "返回主菜单"),
|
||||
("v", "play_voice", "朗读"),
|
||||
]
|
||||
if config.get("quick_pass"):
|
||||
BINDINGS.append(("k", "quick_pass", "快速通过[调试]"))
|
||||
btn = dict()
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
nucleon_file: pt.NucleonUnion,
|
||||
electron_file: pt.ElectronUnion,
|
||||
tasked_num,
|
||||
):
|
||||
super().__init__(name=None, id=None, classes=None)
|
||||
self.reactor = Reactor(nucleon_file, electron_file, self, tasked_num)
|
||||
self.stage = 1
|
||||
self.stage += self.reactor.set_round_templated(self.stage)
|
||||
first_forward = self.reactor.forward()
|
||||
print(first_forward)
|
||||
if first_forward == -1:
|
||||
self.stage = 3
|
||||
self.reactor.set_round_templated(3)
|
||||
print(self.reactor.forward())
|
||||
#self._forward_judge(first_forward)
|
||||
self.compo = next(self.reactor.current_appar)
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
if type(self.compo).__name__ == "Recognition":
|
||||
self.action_play_voice()
|
||||
yield Header(show_clock=True)
|
||||
with Center():
|
||||
yield Static(
|
||||
f"{len(self.reactor.procession) - self.reactor.index}/{len(self.reactor.procession)}"
|
||||
)
|
||||
yield from self.compo.compose()
|
||||
yield Footer()
|
||||
|
||||
def on_mount(self):
|
||||
pass
|
||||
|
||||
def on_button_pressed(self, event):
|
||||
ret = self.compo.handler(event, "button")
|
||||
self._forward_judge(ret)
|
||||
|
||||
def _forward_judge(self, ret):
|
||||
if ret == -1:
|
||||
return
|
||||
if ret == 0:
|
||||
try:
|
||||
self.compo = next(self.reactor.current_appar)
|
||||
self.refresh_ui()
|
||||
except StopIteration:
|
||||
nxt = self.reactor.forward(1)
|
||||
try:
|
||||
self.compo = next(self.reactor.current_appar)
|
||||
except:
|
||||
pass
|
||||
if nxt == -1:
|
||||
if self.reactor.round_set == 0:
|
||||
if self.stage == 4:
|
||||
if config.get("save"):
|
||||
self.reactor.save()
|
||||
self.compo = compo.Finished(
|
||||
self, None, pt.Atom.placeholder()
|
||||
)
|
||||
self.refresh_ui()
|
||||
else:
|
||||
self.reactor.set_round_templated(self.stage)
|
||||
self.reactor.forward(1)
|
||||
self.stage += 1
|
||||
self.compo = next(self.reactor.current_appar)
|
||||
self.refresh_ui()
|
||||
return
|
||||
return
|
||||
else:
|
||||
self.refresh_ui()
|
||||
return
|
||||
if ret == 1:
|
||||
self.refresh_ui()
|
||||
return
|
||||
|
||||
def refresh_ui(self):
|
||||
self.call_later(self.recompose)
|
||||
print(type(self.compo).__name__)
|
||||
|
||||
def action_play_voice(self):
|
||||
def play():
|
||||
cache_dir = pathlib.Path(f"./cache/voice/")
|
||||
cache_dir.mkdir(parents=True, exist_ok=True)
|
||||
cache = cache_dir / f"{aux.get_md5(self.reactor.current_atom[1].content.replace('/',''))}.wav"
|
||||
if not cache.exists():
|
||||
communicate = tts.Communicate(
|
||||
self.reactor.current_atom[1].content.replace("/", ""),
|
||||
"zh-CN-XiaoxiaoNeural",
|
||||
)
|
||||
communicate.save_sync(
|
||||
f"./cache/voice/{aux.get_md5(self.reactor.current_atom[1].content.replace('/',''))}.wav"
|
||||
)
|
||||
playsound(str(cache))
|
||||
|
||||
threading.Thread(target=play).start()
|
||||
|
||||
def action_quick_pass(self):
|
||||
self.reactor.report(self.reactor.current_atom, 5)
|
||||
self._forward_judge(0)
|
||||
def action_toggle_dark(self):
|
||||
self.app.action_toggle_dark()
|
||||
|
||||
def action_pop_screen(self):
|
||||
self.app.pop_screen()
|
||||
|
||||
|
||||
class PreparationScreen(Screen):
|
||||
BINDINGS = [("q", "go_back", "返回"), ("escape", "quit_app", "退出")]
|
||||
|
||||
def __init__(
|
||||
self, nucleon_file: pt.NucleonUnion, electron_file: pt.ElectronUnion
|
||||
) -> None:
|
||||
super().__init__(name=None, id=None, classes=None)
|
||||
self.nucleon_file = nucleon_file
|
||||
self.electron_file = electron_file
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Header(show_clock=True)
|
||||
with Container(id="learning_screen_container"):
|
||||
yield Label(f"记忆项目: [b]{self.nucleon_file.name}[/b]\n")
|
||||
yield Label(
|
||||
f"核子文件对象: ./nucleon/[b]{self.nucleon_file.name}[/b].toml"
|
||||
)
|
||||
yield Label(
|
||||
f"电子文件对象: ./electron/[b]{self.electron_file.name}[/b].toml"
|
||||
)
|
||||
yield Label(f"核子数量:{len(self.nucleon_file)}")
|
||||
yield Button(
|
||||
"开始记忆",
|
||||
id="start_memorizing_button",
|
||||
variant="primary",
|
||||
classes="start-button",
|
||||
)
|
||||
yield Static(f"\n全文如下:\n")
|
||||
yield Static(self._get_full_content().replace("/", ""), classes="full")
|
||||
yield Footer()
|
||||
|
||||
def _get_full_content(self):
|
||||
content = ""
|
||||
for i in self.nucleon_file.nucleons:
|
||||
content += i["content"]
|
||||
return content
|
||||
|
||||
def action_go_back(self):
|
||||
self.app.pop_screen()
|
||||
|
||||
def action_quit_app(self):
|
||||
self.app.exit()
|
||||
|
||||
def on_button_pressed(self, event: Button.Pressed) -> None:
|
||||
if event.button.id == "start_memorizing_button":
|
||||
newscr = MemScreen(
|
||||
self.nucleon_file, self.electron_file, config.get("tasked_number", 6)
|
||||
)
|
||||
self.app.push_screen(newscr)
|
||||
|
||||
class DashboardScreen(Screen):
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Header(show_clock=True)
|
||||
yield Container(
|
||||
Label(f'欢迎使用 "潜进" 启发式辅助记忆调度器, 版本 {metadata.ver}', classes="title-label"),
|
||||
Label(f"当前的 UNIX 日时间戳: {aux.get_daystamp()}"),
|
||||
Label("选择待学习的记忆单元:", classes="title-label"),
|
||||
ListView(id="file-list", classes="file-list-view"),
|
||||
Label(f"\"潜进\" 开放源代码软件项目 | 版本 {metadata.ver} {metadata.stage.capitalize()} | Wang Zhiyu 2025"),
|
||||
)
|
||||
yield Footer()
|
||||
|
||||
def item_desc_generator(self, path) -> dict:
|
||||
gmp = Glimpse(pt.NucleonUnion(path))
|
||||
res = dict()
|
||||
res[0] = f"{gmp.name}.toml\0"
|
||||
res[1] = f""
|
||||
if gmp.is_initialized:
|
||||
res[1] += f" 已激活单元: {gmp.activated_num}/{gmp.total_num}\n"
|
||||
res[1] += f" 下一次复习: {gmp.next_date} (最后复习于 {gmp.lastest_date})\n"
|
||||
res[1] += f" 系数均值: {gmp.avg_efactor}"
|
||||
else:
|
||||
res[1] = " 尚未激活"
|
||||
return res
|
||||
|
||||
def on_mount(self) -> None:
|
||||
file_list_widget = self.query_one("#file-list", ListView)
|
||||
nucleon_path = pathlib.Path("./nucleon")
|
||||
nucleon_files = sorted(
|
||||
[f for f in nucleon_path.iterdir() if f.suffix == ".toml"],
|
||||
key=lambda f: Glimpse(pt.NucleonUnion(f)).next_date,
|
||||
reverse=True
|
||||
)
|
||||
|
||||
if nucleon_files:
|
||||
for file in nucleon_files:
|
||||
text = self.item_desc_generator(pathlib.Path(file))
|
||||
file_list_widget.append(ListItem(
|
||||
Label(text[0] + '\n' + text[1]),
|
||||
))
|
||||
else:
|
||||
file_list_widget.append(
|
||||
ListItem(Static("在 ./nucleon/ 中未找到任何核子文件. 请放置文件后重启应用."))
|
||||
)
|
||||
file_list_widget.disabled = True
|
||||
|
||||
def on_list_view_selected(self, event: ListView.Selected) -> None:
|
||||
if not isinstance(event.item, ListItem):
|
||||
return
|
||||
|
||||
selected_label = event.item.query_one(Label)
|
||||
if "未找到任何 .toml 文件" in str(selected_label.renderable):
|
||||
return
|
||||
|
||||
selected_filename = str(selected_label.renderable).partition('\0')[0].replace('*', "")
|
||||
nucleon_file = pt.NucleonUnion(
|
||||
pathlib.Path("./nucleon") / selected_filename
|
||||
)
|
||||
electron_file_path = pathlib.Path("./electron") / selected_filename
|
||||
if electron_file_path.exists():
|
||||
pass
|
||||
else:
|
||||
electron_file_path.touch()
|
||||
electron_file = pt.ElectronUnion(
|
||||
pathlib.Path("./electron") / selected_filename
|
||||
)
|
||||
self.app.push_screen(PreparationScreen(nucleon_file, electron_file))
|
||||
|
||||
def action_quit_app(self) -> None:
|
||||
self.app.exit()
|
||||
|
3
serve.py
3
serve.py
@@ -1,3 +0,0 @@
|
||||
from webshare import server
|
||||
server = server.Server("python3 main.py", title="辅助记忆程序", host="0.0.0.0")
|
||||
server.serve()
|
@@ -1,10 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
from textual.app import App
|
||||
import screens
|
||||
import os
|
||||
|
||||
class AppLauncher(App):
|
||||
CSS_PATH = "styles.css"
|
||||
TITLE = "潜进 - 辅助记忆程序"
|
||||
TITLE = "潜进 - 辅助记忆调度器"
|
||||
BINDINGS = [("escape", "quit", "退出"), ("d", "toggle_dark", "改变色调")]
|
||||
SCREENS = {
|
||||
"dashboard": screens.DashboardScreen,
|
31
src/heurams/context.py
Normal file
31
src/heurams/context.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
全局上下文管理模块
|
||||
"""
|
||||
from contextvars import ContextVar
|
||||
from typing import Optional
|
||||
from heurams.services.config import ConfigFile
|
||||
|
||||
config_var: ContextVar[ConfigFile] = ContextVar('config_var', default=ConfigFile("")) # 配置文件
|
||||
|
||||
runtime_var: ContextVar = ContextVar('runtime_var', default=None) # 运行时共享数据
|
||||
|
||||
class ConfigContext:
|
||||
"""
|
||||
功能完备的上下文管理器
|
||||
用于临时切换配置的作用域, 支持嵌套使用
|
||||
Example:
|
||||
>>> with ConfigContext(test_config):
|
||||
... get_daystamp() # 使用 test_config
|
||||
>>> get_daystamp() # 恢复原配置
|
||||
"""
|
||||
|
||||
def __init__(self, config_provider: ConfigFile):
|
||||
self.config_provider = config_provider
|
||||
self._token = None
|
||||
|
||||
def __enter__(self):
|
||||
self._token = config_var.set(self.config_provider)
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
config_var.reset(self._token) # type: ignore
|
140
src/heurams/interface/screens/memory.py
Normal file
140
src/heurams/interface/screens/memory.py
Normal file
@@ -0,0 +1,140 @@
|
||||
|
||||
class MemScreen(Screen):
|
||||
BINDINGS = [
|
||||
("d", "toggle_dark", "改变色调"),
|
||||
("q", "pop_screen", "返回主菜单"),
|
||||
("v", "play_voice", "朗读"),
|
||||
# ("p", "precache_current", "预缓存当前单元集"), # 新增预缓存快捷键
|
||||
]
|
||||
if config.get("quick_pass"):
|
||||
BINDINGS.append(("k", "quick_pass", "快速通过[调试]"))
|
||||
btn = dict()
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
nucleon_file: pt.NucleonUnion,
|
||||
electron_file: pt.ElectronUnion,
|
||||
tasked_num,
|
||||
):
|
||||
super().__init__(name=None, id=None, classes=None)
|
||||
self.nucleon_file = nucleon_file
|
||||
self.electron_file = electron_file
|
||||
self.reactor = Reactor(nucleon_file, electron_file, self, tasked_num)
|
||||
self.stage = 1
|
||||
self.stage += self.reactor.set_round_templated(self.stage)
|
||||
first_forward = self.reactor.forward()
|
||||
print(first_forward)
|
||||
if first_forward == -1:
|
||||
self.stage = 3
|
||||
self.reactor.set_round_templated(3)
|
||||
print(self.reactor.forward())
|
||||
#self._forward_judge(first_forward)
|
||||
self.compo = next(self.reactor.current_appar)
|
||||
self.feedback_state = 0 # 默认状态
|
||||
self.feedback_state_map = {
|
||||
0: "",
|
||||
255: "回答有误, 请重试. 或者重新学习此单元",
|
||||
}
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
if type(self.compo).__name__ == "Recognition":
|
||||
self.action_play_voice()
|
||||
yield Header(show_clock=True)
|
||||
with Center():
|
||||
yield Static(
|
||||
f"当前进度: {len(self.reactor.procession) - self.reactor.index}/{len(self.reactor.procession)}"
|
||||
)
|
||||
yield Label(self.feedback_state_map[self.feedback_state])
|
||||
yield from self.compo.compose()
|
||||
if self.feedback_state == 255:
|
||||
yield Button("重新学习此单元", id="re-recognize", variant="warning")
|
||||
yield Footer()
|
||||
|
||||
def on_mount(self):
|
||||
pass
|
||||
|
||||
def on_button_pressed(self, event):
|
||||
try:
|
||||
if event.button.id == "re-recognize":
|
||||
return
|
||||
except:
|
||||
pass
|
||||
ret = self.compo.handler(event, "button")
|
||||
self._forward_judge(ret)
|
||||
def _forward_judge(self, ret):
|
||||
self.feedback_state = 0
|
||||
if ret == -1:
|
||||
return
|
||||
if ret == 0:
|
||||
try:
|
||||
self.compo = next(self.reactor.current_appar)
|
||||
self.refresh_ui()
|
||||
except StopIteration:
|
||||
nxt = self.reactor.forward(1)
|
||||
try:
|
||||
self.compo = next(self.reactor.current_appar)
|
||||
except:
|
||||
pass
|
||||
if nxt == -1:
|
||||
if self.reactor.round_set == 0:
|
||||
if self.stage == 4:
|
||||
if config.get("save"):
|
||||
self.reactor.save()
|
||||
self.compo = compo.Finished(
|
||||
self, None, pt.Atom.placeholder()
|
||||
)
|
||||
self.refresh_ui()
|
||||
else:
|
||||
self.reactor.set_round_templated(self.stage)
|
||||
self.reactor.forward(1)
|
||||
self.stage += 1
|
||||
self.compo = next(self.reactor.current_appar)
|
||||
self.refresh_ui()
|
||||
return
|
||||
return
|
||||
else:
|
||||
self.refresh_ui()
|
||||
return
|
||||
if ret >= 1:
|
||||
if ret == 2:
|
||||
self.feedback_state = 255 # 表示错误
|
||||
else:
|
||||
self.feedback_state = 0
|
||||
self.refresh_ui()
|
||||
return
|
||||
|
||||
def refresh_ui(self):
|
||||
self.call_later(self.recompose)
|
||||
print(type(self.compo).__name__)
|
||||
|
||||
def action_play_voice(self):
|
||||
def play():
|
||||
cache_dir = pathlib.Path(f"./cache/voice/")
|
||||
cache_dir.mkdir(parents=True, exist_ok=True)
|
||||
cache = cache_dir / f"{aux.get_md5(self.reactor.current_atom[1].content.replace('/',''))}.wav"
|
||||
if not cache.exists():
|
||||
import edge_tts as tts
|
||||
communicate = tts.Communicate(
|
||||
self.reactor.current_atom[1].content.replace("/", ""),
|
||||
"zh-CN-XiaoxiaoNeural",
|
||||
)
|
||||
communicate.save_sync(
|
||||
f"./cache/voice/{aux.get_md5(self.reactor.current_atom[1].content.replace('/',''))}.wav"
|
||||
)
|
||||
playsound(str(cache))
|
||||
|
||||
threading.Thread(target=play).start()
|
||||
|
||||
def action_precache_current(self):
|
||||
"""预缓存当前单元集的音频"""
|
||||
precache_screen = PrecachingScreen(self.nucleon_file)
|
||||
self.app.push_screen(precache_screen)
|
||||
|
||||
def action_quick_pass(self):
|
||||
self.reactor.report(self.reactor.current_atom, 5)
|
||||
self._forward_judge(0)
|
||||
def action_toggle_dark(self):
|
||||
self.app.action_toggle_dark()
|
||||
|
||||
def action_pop_screen(self):
|
||||
self.app.pop_screen()
|
185
src/heurams/interface/screens/precache.py
Normal file
185
src/heurams/interface/screens/precache.py
Normal file
@@ -0,0 +1,185 @@
|
||||
|
||||
class PrecachingScreen(Screen):
|
||||
"""预缓存音频文件屏幕"""
|
||||
BINDINGS = [("q", "go_back", "返回"), ("escape", "quit_app", "退出")]
|
||||
|
||||
def __init__(self, nucleon_file = None):
|
||||
super().__init__(name=None, id=None, classes=None)
|
||||
self.nucleon_file = nucleon_file
|
||||
self.is_precaching = False
|
||||
self.current_file = ""
|
||||
self.current_item = ""
|
||||
self.progress = 0
|
||||
self.total = 0
|
||||
self.processed = 0
|
||||
self.precache_worker = None
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Header(show_clock=True)
|
||||
with Container(id="precache_container"):
|
||||
yield Label("[b]音频预缓存[/b]", classes="title-label")
|
||||
|
||||
if self.nucleon_file:
|
||||
yield Static(f"目标单元集: [b]{self.nucleon_file.name}[/b]", classes="target-info")
|
||||
yield Static(f"单元数量: {len(self.nucleon_file.nucleons)}", classes="target-info")
|
||||
else:
|
||||
yield Static("目标: 所有单元集", classes="target-info")
|
||||
|
||||
yield Static(id="status", classes="status-info")
|
||||
yield Static(id="current_item", classes="current-item")
|
||||
yield ProgressBar(total=100, show_eta=False, id="progress_bar")
|
||||
|
||||
with Horizontal(classes="button-group"):
|
||||
if not self.is_precaching:
|
||||
yield Button("开始预缓存", id="start_precache", variant="primary")
|
||||
else:
|
||||
yield Button("取消预缓存", id="cancel_precache", variant="error")
|
||||
yield Button("清空缓存", id="clear_cache", variant="warning")
|
||||
yield Button("返回", id="go_back", variant="default")
|
||||
yield Footer()
|
||||
|
||||
def on_mount(self):
|
||||
"""挂载时初始化状态"""
|
||||
self.update_status("就绪", "等待开始...")
|
||||
|
||||
def update_status(self, status, current_item="", progress=None):
|
||||
"""更新状态显示"""
|
||||
status_widget = self.query_one("#status", Static)
|
||||
item_widget = self.query_one("#current_item", Static)
|
||||
progress_bar = self.query_one("#progress_bar", ProgressBar)
|
||||
|
||||
status_widget.update(f"状态: {status}")
|
||||
item_widget.update(f"当前项目: {current_item}" if current_item else "")
|
||||
|
||||
if progress is not None:
|
||||
progress_bar.progress = progress
|
||||
progress_bar.advance(0) # 刷新显示
|
||||
|
||||
def precache_single_text(self, text: str):
|
||||
"""预缓存单个文本的音频"""
|
||||
cache_dir = pathlib.Path("./cache/voice/")
|
||||
cache_dir.mkdir(parents=True, exist_ok=True)
|
||||
cache = cache_dir / f"{aux.get_md5(text)}.wav"
|
||||
if not cache.exists():
|
||||
try:
|
||||
import edge_tts as tts
|
||||
communicate = tts.Communicate(text, "zh-CN-XiaoxiaoNeural")
|
||||
communicate.save_sync(str(cache))
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f"预缓存失败 '{text}': {e}")
|
||||
return False
|
||||
return True
|
||||
|
||||
def precache_file(self, nucleon_union: pt.NucleonUnion):
|
||||
"""预缓存单个文件的所有内容"""
|
||||
self.current_file = nucleon_union.name
|
||||
total_items = len(nucleon_union.nucleons)
|
||||
|
||||
for idx, nucleon in enumerate(nucleon_union.nucleons):
|
||||
# 检查是否被取消
|
||||
worker = get_current_worker()
|
||||
if worker and worker.is_cancelled:
|
||||
return False
|
||||
|
||||
text = nucleon['content'].replace('/', '')
|
||||
self.current_item = text[:50] + "..." if len(text) > 50 else text
|
||||
self.processed += 1
|
||||
|
||||
# 更新进度
|
||||
progress = int((self.processed / self.total) * 100) if self.total > 0 else 0
|
||||
self.update_status(
|
||||
f"处理中: {nucleon_union.name} ({idx+1}/{total_items})",
|
||||
self.current_item,
|
||||
progress
|
||||
)
|
||||
|
||||
# 预缓存音频
|
||||
success = self.precache_single_text(text)
|
||||
if not success:
|
||||
self.update_status("错误", f"处理失败: {self.current_item}")
|
||||
time.sleep(1) # 短暂暂停以便用户看到错误信息
|
||||
|
||||
return True
|
||||
|
||||
def precache_all_files(self):
|
||||
"""预缓存所有文件"""
|
||||
nucleon_path = pathlib.Path("./nucleon")
|
||||
nucleon_files = [f for f in nucleon_path.iterdir() if f.suffix == ".toml"]
|
||||
|
||||
# 计算总项目数
|
||||
self.total = 0
|
||||
for file in nucleon_files:
|
||||
try:
|
||||
nu = pt.NucleonUnion(file)
|
||||
self.total += len(nu.nucleons)
|
||||
except:
|
||||
continue
|
||||
|
||||
self.processed = 0
|
||||
self.is_precaching = True
|
||||
|
||||
for file in nucleon_files:
|
||||
try:
|
||||
nu = pt.NucleonUnion(file)
|
||||
if not self.precache_file(nu):
|
||||
break # 用户取消
|
||||
except Exception as e:
|
||||
print(f"处理文件失败 {file}: {e}")
|
||||
continue
|
||||
|
||||
self.is_precaching = False
|
||||
self.update_status("完成", "所有音频文件已预缓存", 100)
|
||||
|
||||
def precache_single_file(self):
|
||||
"""预缓存单个文件"""
|
||||
if not self.nucleon_file:
|
||||
return
|
||||
|
||||
self.total = len(self.nucleon_file.nucleons)
|
||||
self.processed = 0
|
||||
self.is_precaching = True
|
||||
|
||||
success = self.precache_file(self.nucleon_file)
|
||||
|
||||
self.is_precaching = False
|
||||
if success:
|
||||
self.update_status("完成", f"'{self.nucleon_file.name}' 音频文件已预缓存", 100)
|
||||
else:
|
||||
self.update_status("已取消", "预缓存操作被用户取消", 0)
|
||||
|
||||
def on_button_pressed(self, event: Button.Pressed) -> None:
|
||||
if event.button.id == "start_precache" and not self.is_precaching:
|
||||
# 开始预缓存
|
||||
if self.nucleon_file:
|
||||
self.precache_worker = self.run_worker(self.precache_single_file, thread=True)
|
||||
else:
|
||||
self.precache_worker = self.run_worker(self.precache_all_files, thread=True)
|
||||
|
||||
elif event.button.id == "cancel_precache" and self.is_precaching:
|
||||
# 取消预缓存
|
||||
if self.precache_worker:
|
||||
self.precache_worker.cancel()
|
||||
self.is_precaching = False
|
||||
self.update_status("已取消", "预缓存操作被用户取消", 0)
|
||||
|
||||
elif event.button.id == "clear_cache":
|
||||
# 清空缓存
|
||||
try:
|
||||
shutil.rmtree("./cache/voice", ignore_errors=True)
|
||||
self.update_status("已清空", "音频缓存已清空", 0)
|
||||
except Exception as e:
|
||||
self.update_status("错误", f"清空缓存失败: {e}")
|
||||
|
||||
elif event.button.id == "go_back":
|
||||
self.action_go_back()
|
||||
|
||||
def action_go_back(self):
|
||||
if self.is_precaching and self.precache_worker:
|
||||
self.precache_worker.cancel()
|
||||
self.app.pop_screen()
|
||||
|
||||
def action_quit_app(self):
|
||||
if self.is_precaching and self.precache_worker:
|
||||
self.precache_worker.cancel()
|
||||
self.app.exit()
|
@@ -1,7 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
import pathlib
|
||||
import toml
|
||||
import time
|
||||
import auxiliary as aux
|
||||
import heurams.services.timer as timer
|
||||
from typing import List
|
||||
|
||||
class Electron:
|
||||
@@ -79,8 +80,8 @@ class Electron:
|
||||
self.metadata['interval'] * self.metadata['efactor']
|
||||
)
|
||||
|
||||
self.metadata['last_date'] = aux.get_daystamp()
|
||||
self.metadata['next_date'] = aux.get_daystamp() + self.metadata['interval']
|
||||
self.metadata['last_date'] = timer.get_daystamp()
|
||||
self.metadata['next_date'] = timer.get_daystamp() + self.metadata['interval']
|
||||
self.metadata['last_modify'] = time.time()
|
||||
|
||||
def __str__(self):
|
||||
@@ -231,7 +232,7 @@ class ElectronUnion:
|
||||
|
||||
def save(self):
|
||||
# print(1)
|
||||
self.total["last_date"] = aux.get_daystamp()
|
||||
self.total["last_date"] = timer.get_daystamp()
|
||||
with open(self.path, 'w') as f:
|
||||
tmp = {i.content: i.metadata for i in self.electrons}
|
||||
tmp["total"] = self.total
|
126
src/heurams/kernel/particles/electron.py
Normal file
126
src/heurams/kernel/particles/electron.py
Normal file
@@ -0,0 +1,126 @@
|
||||
#!/usr/bin/env python3
|
||||
import pathlib
|
||||
import toml
|
||||
import time
|
||||
import heurams.services.timer as timer
|
||||
|
||||
class Electron:
|
||||
"""电子: 记忆分析元数据及算法"""
|
||||
algorithm = "SM-2" # 暂时使用 SM-2 算法进行记忆拟合, 考虑 SM-15 替代
|
||||
|
||||
def __init__(self, content: str, metadata: dict):
|
||||
self.content = content
|
||||
self.metadata = metadata
|
||||
if metadata == {}:
|
||||
# print("NULL")
|
||||
self._default_init()
|
||||
|
||||
def _default_init(self):
|
||||
defaults = {
|
||||
'efactor': 2.5, # 易度系数, 越大越简单, 最大为5
|
||||
'real_rept': 0, # (实际)重复次数
|
||||
'rept': 0, # (有效)重复次数
|
||||
'interval': 0, # 最佳间隔
|
||||
'last_date': 0, # 上一次复习的时间戳
|
||||
'next_date': 0, # 将要复习的时间戳
|
||||
'is_activated': 0, # 激活状态
|
||||
# *NOTE: 此处"时间戳"是以天为单位的整数, 即 UNIX 时间戳除以一天的秒数取整
|
||||
'last_modify': time.time() # 最后修改时间戳(此处是UNIX时间戳)
|
||||
}
|
||||
self.metadata = defaults
|
||||
|
||||
def activate(self):
|
||||
self.metadata['is_activated'] = 1
|
||||
self.metadata['last_modify'] = time.time()
|
||||
|
||||
def modify(self, var: str, value):
|
||||
if var in self.metadata:
|
||||
self.metadata[var] = value
|
||||
self.metadata['last_modify'] = time.time()
|
||||
else:
|
||||
print(f"警告: '{var}' 非已知元数据字段")
|
||||
|
||||
def revisor(self, quality: int = 5, is_new_activation: bool = False):
|
||||
"""SM-2 算法迭代决策机制实现
|
||||
根据 quality(0 ~ 5) 进行参数迭代最佳间隔
|
||||
quality 由主程序评估
|
||||
|
||||
Args:
|
||||
quality (int): 记忆保留率量化参数
|
||||
"""
|
||||
print(f"REVISOR: {quality}, {is_new_activation}")
|
||||
if quality == -1:
|
||||
return -1
|
||||
|
||||
self.metadata['efactor'] = self.metadata['efactor'] + (
|
||||
0.1 - (5 - quality) * (0.08 + (5 - quality) * 0.02)
|
||||
)
|
||||
self.metadata['efactor'] = max(1.3, self.metadata['efactor'])
|
||||
|
||||
if quality < 3:
|
||||
# 若保留率低于 3,重置重复次数
|
||||
self.metadata['rept'] = 0
|
||||
self.metadata['interval'] = 0 # 设为0,以便下面重新计算 I(1)
|
||||
else:
|
||||
self.metadata['rept'] += 1
|
||||
|
||||
self.metadata['real_rept'] += 1
|
||||
|
||||
if is_new_activation: # 初次激活
|
||||
self.metadata['rept'] = 0
|
||||
self.metadata['efactor'] = 2.5
|
||||
|
||||
if self.metadata['rept'] == 0: # 刚被重置或初次激活后复习
|
||||
self.metadata['interval'] = 1 # I(1)
|
||||
elif self.metadata['rept'] == 1:
|
||||
self.metadata['interval'] = 6 # I(2) 经验公式
|
||||
else:
|
||||
self.metadata['interval'] = round(
|
||||
self.metadata['interval'] * self.metadata['efactor']
|
||||
)
|
||||
|
||||
self.metadata['last_date'] = timer.get_daystamp()
|
||||
self.metadata['next_date'] = timer.get_daystamp() + self.metadata['interval']
|
||||
self.metadata['last_modify'] = time.time()
|
||||
|
||||
def __str__(self):
|
||||
return (
|
||||
f"记忆单元预览 \n"
|
||||
f"内容: '{self.content}' \n"
|
||||
f"易度系数: {self.metadata['efactor']:.2f} \n"
|
||||
f"已经重复的次数: {self.metadata['rept']} \n"
|
||||
f"下次间隔: {self.metadata['interval']} 天 \n"
|
||||
f"下次复习日期时间戳: {self.metadata['next_date']}"
|
||||
)
|
||||
|
||||
def __eq__(self, other):
|
||||
if self.content == other.content:
|
||||
return True
|
||||
return False
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self.content)
|
||||
|
||||
def __getitem__(self, key):
|
||||
if key == "content":
|
||||
return self.content
|
||||
if key in self.metadata:
|
||||
return self.metadata[key]
|
||||
else:
|
||||
raise KeyError(f"Key '{key}' not found in metadata.")
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
if key == "content":
|
||||
raise AttributeError("content 应为只读")
|
||||
self.metadata[key] = value
|
||||
self.metadata['last_modify'] = time.time()
|
||||
|
||||
def __iter__(self):
|
||||
yield from self.metadata.keys()
|
||||
|
||||
def __len__(self):
|
||||
return len(self.metadata)
|
||||
|
||||
@staticmethod
|
||||
def placeholder():
|
||||
return Electron("电子对象样例内容", {})
|
1
src/heurams/services/audio_service.py
Normal file
1
src/heurams/services/audio_service.py
Normal file
@@ -0,0 +1 @@
|
||||
# 音频服务
|
1
src/heurams/services/cache.py
Normal file
1
src/heurams/services/cache.py
Normal file
@@ -0,0 +1 @@
|
||||
# 缓存服务
|
@@ -1,11 +1,7 @@
|
||||
import time
|
||||
# 配置文件服务
|
||||
import pathlib
|
||||
import toml
|
||||
import typing
|
||||
from playsound import playsound
|
||||
import threading
|
||||
import hashlib
|
||||
import edge_tts as tts
|
||||
|
||||
class ConfigFile:
|
||||
def __init__(self, path: str):
|
||||
@@ -37,31 +33,3 @@ class ConfigFile:
|
||||
def get(self, key: str, default: typing.Any = None) -> typing.Any:
|
||||
"""获取配置值,如果不存在返回默认值"""
|
||||
return self.data.get(key, default)
|
||||
|
||||
def action_play_voice(content):
|
||||
config = ConfigFile("config.toml")
|
||||
if config.get("auto_voice", False):
|
||||
return
|
||||
def play():
|
||||
communicate = tts.Communicate(
|
||||
content,
|
||||
"zh-CN-YunjianNeural",
|
||||
)
|
||||
communicate.save_sync(
|
||||
f"./cache/voice/{content}.wav"
|
||||
)
|
||||
playsound(f"./cache/voice/{content}.wav")
|
||||
threading.Thread(target=play).start()
|
||||
|
||||
def get_daystamp() -> int:
|
||||
"""获取当前日戳(以天为单位的整数时间戳)"""
|
||||
config = ConfigFile("config.toml")
|
||||
time_override = config.get("time_override", -1)
|
||||
|
||||
if time_override != -1:
|
||||
return int(time_override)
|
||||
|
||||
return int(time.time() // (24 * 3600))
|
||||
|
||||
def get_md5(text):
|
||||
return hashlib.md5(text.encode('utf-8')).hexdigest()
|
5
src/heurams/services/hasher.py
Normal file
5
src/heurams/services/hasher.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# 哈希服务
|
||||
import hashlib
|
||||
|
||||
def get_md5(text):
|
||||
return hashlib.md5(text.encode('utf-8')).hexdigest()
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user