Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Tools=>Stealth Scannos #672

Open
okrick opened this issue Jan 16, 2025 · 4 comments
Open

Tools=>Stealth Scannos #672

okrick opened this issue Jan 16, 2025 · 4 comments
Labels
future feature New feature or request, but not core

Comments

@okrick
Copy link

okrick commented Jan 16, 2025

For future implementation, I propose adding the following search and replace rule to the stealth scannos in GG2:

  • Search: ([\*#])/\n(\-[^\n]+[\-\\]\n+)/\1\n
  • Replace: \2
  • Hint: This rule is designed to remove block markups (like block quotes, poetry, or tables) that cross page boundaries.

This macro proves highly effective once I've navigated past the preliminary material like the title page verso and dedications.

@windymilla windymilla added the future feature New feature or request, but not core label Jan 16, 2025
@windymilla
Copy link
Collaborator

This does look useful @okrick. At the moment, included in the GG2 release are two scannos files:

  1. regex.json - which has various error checking regexes
  2. en-common.json - which has various common English scannos
    It's possible your suggestion (and some others) would be better in a third file - providing useful regexes & their replacements for certain operations (as distinct to error checks).

Note that you could add such a file yourself anyway, containing any regexs & replacements you like:

  1. Copy regex.json from under the release (data/scannos folder) or from here and save it somewhere safe on your computer (not under the release).
  2. Rename that file, e.g. "my_regexes.json"
  3. Edit that file - it should be fairly clear what to do if you look at other examples in the file. For example, you could delete some of the entries in there - making sure you delete the whole thing including it's surrounding braces, e.g.
{
"match": "\\.(\"?\\n *\"?\\p{Lower})",
"replacement": ",\\1",
"hint": "Find a period with the following word starting with a lower case character and change the period to a comma"
},
  1. You could edit a regex "match", "replacement", and "hint" to be what you want.
  2. Notice the positions of commas after match & replacement, but not after hint, and also needed after the close braces, except the last one.
  3. Save the file
  4. In GG2, run Stealth Scannos, and click the Load File button on the right. This will let you find your new scannos file and select it and use it to do scanno checks.
  5. Next time you want to use the same file, it will already be in the dropdown list of files, so you won't need to use the Load File button, just the dropdown to switch between scanno files.

@okrick
Copy link
Author

okrick commented Jan 16, 2025

You're right. I tried that just now.

However, I'm encountering the following issues:

  1. File Not Recognized:
  • I copied regex.json to rick-regex.json within the scannos directory C:Users\okric\AppData\Local\Programs\Python\Python311\Lib\site-packages\guiguts\data\scannos).
  • Despite this, rick-regex.json doesn't appear in the available list, even after closing and reopening GG2.
  • This is unexpected because the project's ralston.txt.json file does appear in the dropdown, even though it resides in the project directory, not the scannos directory.
  1. Incorrect Default Load Directory:
  • The "Stealth Scannos Results Load File" dialog defaults to the project directory instead of the expected scannos directory.
  • Navigating to the scannos directory requires a lengthy and complex path, which would be inconvenient for most users.

@windymilla
Copy link
Collaborator

No, you must not put it in the scannos dir. It must be somewhere safe but not under the release, ie not where GG2 is installed. The user must not and cannot put files under the release. They could vanish when you upgrade.

After you've put it somewhere else, to make it appear in the drop down list, you need to use the Load File button to load the file and tell GG2 where it is, as described in point 7. Only then will you find it in the drop down list.

@okrick
Copy link
Author

okrick commented Jan 16, 2025

Ah, this is mentioned in the GG2 help. I should have checked there first.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
future feature New feature or request, but not core
Projects
None yet
Development

No branches or pull requests

2 participants