Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Definitions' scopes are too broad #25

Closed
waldoj opened this issue Jul 22, 2016 · 5 comments
Closed

Definitions' scopes are too broad #25

waldoj opened this issue Jul 22, 2016 · 5 comments

Comments

@waldoj
Copy link
Member

waldoj commented Jul 22, 2016

A lot of definitions are scoped globally, despite that there's nothing in the text that should lead to that. My best guess is that this is from State::extract_definitions opening with $scope = 'global', setting the default scope to global. (It's also possible that we start with this for perfectly good reasons.) Step through the code while scraping definitions to figure out what's up.

@waldoj
Copy link
Member Author

waldoj commented Jul 23, 2016

Well, that didn't work. We we have no definitions appearing at all.

@waldoj
Copy link
Member Author

waldoj commented Jul 24, 2016

Ah, I think the problem is from #26. Perhaps this fix did work.

@waldoj
Copy link
Member Author

waldoj commented Jul 24, 2016

This looks a bit better

SELECT scope, COUNT(*) AS number FROM dictionary GROUP BY scope;
+---------+--------+
| scope   | number |
+---------+--------+
| Section |    148 |
| article |    260 |
| chapter |    547 |
| part    |    108 |
| section |    997 |
| title   |     26 |
+---------+--------+

I mean, other than the obvious case problem (Section vs. section) and the complete lack of any global definitions. Still, the presence of article and part both look great. The low numbers are also because of #26.

@waldoj
Copy link
Member Author

waldoj commented Jul 24, 2016

This looks better:

SELECT scope, COUNT(*) AS number FROM dictionary GROUP BY scope;
+----------+--------+
| scope    | number |
+----------+--------+
| article  |   1474 |
| chapter  |   4402 |
| part     |    143 |
| section  |   1949 |
| subtitle |     21 |
| title    |    473 |
+----------+--------+

Except that there are still no global definitions.

@waldoj
Copy link
Member Author

waldoj commented Jul 24, 2016

Ah-ha—the problem was GLOBAL_DEFINITIONS in config.inc.php. I had this:

define('GLOBAL_DEFINITIONS', '1,2.1');

instead of this:

define('GLOBAL_DEFINITIONS', '1,2.1,2');

Previously, we used the SGML, which only included titles and chapters. But now the XML includes subtitles, parts, and articles, and definitions are found within Article 2 of Title 1, Chapter 2.1. So the prior scope wasn't working. I updated GLOBAL_DEFINITIONS, started a re-parse, and global definitions are streaming in now.

@waldoj waldoj closed this as completed Jul 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant