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

missing quotes for 'title' in apple.dict format #407

Closed
boydkelly opened this issue Jan 4, 2023 · 8 comments
Closed

missing quotes for 'title' in apple.dict format #407

boydkelly opened this issue Jan 4, 2023 · 8 comments
Labels

Comments

@boydkelly
Copy link

Converting from xdxf to apple.dict the output xml file is missing quote marks for the element. This is not only indicated by the xml linter, but the apple build_dict.sh sript also rejects the file. Since the title can be "This is the title" it absolutely needs quotes.
Thanks for such an awesome utility!

Screenshot from 2023-01-04 11-41-09

@ilius
Copy link
Owner

ilius commented Jan 5, 2023

I pushed a fix.
Please try again.

@boydkelly
Copy link
Author

ah thanks so much. But hmmm.... I cloned master from here and did setup.py install and made sure my pyglossary was coming from /usr/local/bin. But no luck. The quotes are still missing...

@ilius
Copy link
Owner

ilius commented Jan 5, 2023

You don't have to install.
Can try running main.py.

@ilius
Copy link
Owner

ilius commented Jan 5, 2023

If you want to install, add -f flag to setup.py install.

@boydkelly
Copy link
Author

ol thanks! That works.

@soshial
Copy link
Contributor

soshial commented Jan 21, 2023

Is it possible to add tests to Pyglossary for the case of quoted titles?

@soshial
Copy link
Contributor

soshial commented Jan 27, 2023

I think that nested <d:entry> also is a mistake, @ilius.

An example source XML looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!--
	This is a sample dictionary source file.
	It can be built using Dictionary Development Kit.
-->
<d:dictionary xmlns="http://www.w3.org/1999/xhtml" xmlns:d="http://www.apple.com/DTDs/DictionaryService-1.0.rng">
<d:entry id="dictionary_application" d:title="Dictionary application">
	<d:index d:value="Dictionary application"/>
	<h1>Dictionary application </h1>
	<p>
		An application to look up dictionary on Mac OS X.<br/>
	</p>
	<span class="column">
		The Dictionary application first appeared in Tiger.
	</span>
	<span class="picture">
		It's application icon looks like below.<br/>
		<img src="Images/_internal_dictionary.png" alt="Dictionary.app Icon"/>
	</span>
</d:entry>
<d:entry id="make_1" d:title="make">
	<d:index d:value="make"/>
	<d:index d:value="makes"/>
	<d:index d:value="made" d:title="made (make)"/>
	<d:index d:value="making" d:priority="2"/>
	<d:index d:value="make it" d:parental-control="1" d:anchor="xpointer(//*[@id='make_it'])"/>
	<div d:priority="2"><h1>make</h1></div>
	<span class="syntax">
		<span d:pr="US">| māk |</span>
		<span d:pr="US_IPA">| meɪk |</span>
		<span d:pr="UK_IPA">| meɪk |</span>
	</span>
	<div>
		<ol>
			<li>
				Form by putting parts together or combining substances; construct; create; produce 
				<span d:priority="2"> : <i>Mother made her a beautiful dress</i>
				</span>
				.
			</li>
			<li>
				Cause to be or become
				<span d:priority="2"> : <i>The news made me happy</i>
				</span>
				.
			</li>
		</ol>
	</div>
	<div d:parental-control="1" d:priority="2">
		<h3>PHRASES</h3>
		<div id="make_it"><b>make it</b> : succeed in something; survive.</div>
		<h4><a href="x-dictionary:r:make_up_ones_mind"><b>make up one's mind</b></a></h4>
	</div>
</d:entry>
<d:entry id="make_up_ones_mind" d:title="make up one's mind" d:parental-control="1">
	<d:index d:value="make up one's mind"/>
	<h1>make up one's mind</h1>
	<ul>
		<li>
		make a decision.
		</li>
	</ul>
</d:entry>
<d:entry id="front_back_matter" d:title="Front/Back Matter">
	<h1><b>My Dictionary</b></h1>
	<h2>Front/Back Matter</h2>
	<div>
		This is a front matter page of the sample dictionary.<br/><br/>
	</div>
	<div>
		<b>To see</b> this page,
		<ol>
			<li>Open "Go" menu.</li>
			<li>Choose "Front/Back Matter" menu item. 
			If it has sub-menu items, choose one of them.</li>
		</ol>
	</div>
	<div>
		<b>To prepare</b> the menu item, do the followings.
		<ol>
			<li>Prepare this page source as an entry.</li>
			<li>Add "DCSDictionaryFrontMatterReferenceID" key and its value to the plist of the dictionary.
			The value should be the string of this page entry id. </li>
		</ol>
	</div>
	<br/>
</d:entry>
</d:dictionary>

@ilius
Copy link
Owner

ilius commented Jan 27, 2023

He has removed entry 2 and 3 and forgot to remove that entry closing.

@ilius ilius added the Bug label May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants