Skip to content

Commit 57d1ce8

Browse files
committed
fix #633
This reorders and factorizes some parts of the 'Inverse Content Creation' algorithm. It does not change the behaviour of the algorithm, except for one corner case: if the active context has no default language but has a default base direction, the default combined tag is now _{dir}. In the previous version, it was @none_{dir}. I find this more consistent with steps 3.13.4 and 3.15.1, and I suspect that this former discrepency was actually a bug.
1 parent 79a8de9 commit 57d1ce8

File tree

1 file changed

+15
-35
lines changed

1 file changed

+15
-35
lines changed

index.html

+15-35
Original file line numberDiff line numberDiff line change
@@ -1994,10 +1994,20 @@ <h3>Algorithm</h3>
19941994

19951995
<ol>
19961996
<li>Initialize <var>result</var> to an empty <a class="changed">map</a>.</li>
1997-
<li>Initialize <var>default language</var> to <code>@none</code>.
1998-
If the <var>active context</var> has a <a>default language</a>,
1999-
set <var>default language</var> to the <a>default language</a> from the <var>active context</var>
2000-
<span class="changed">normalized to lower case</span>.</li>
1997+
<li class="changed">Initialize <var>default lang dir</var> as follows:<ul>
1998+
<li>If the <var>active context</var> has a <a>default language</a> and a <a>default base direction</a>,
1999+
set <var>default lang dir</var> to
2000+
the concatenation of those <a>default language</a> and <a>default base direction</a>,
2001+
separated by an underscore (`"_"`),
2002+
normalized to lower case.</li>
2003+
<li>Otherwise, if the <var>active context</var> has a <a>default language</a>,
2004+
set <var>default lang dir</var> to that <a>default language</a>
2005+
normalized to lower case.</li>
2006+
<li>Otherwise, if the <var>active context</var> has a <a>default base direction</a>,
2007+
set <var>default lang dir</var> to the <a>default base direction</a> from the <var>active context</var>
2008+
preceded by an underscore (`"_"`).</li>
2009+
<li>Otherwise, set <var>default lang dir</var> to <code>@none</code>.</li>
2010+
</ul></li>
20012011
<li>For each key <a>term</a> and value <a>term definition</a> in
20022012
the <var>active context</var>, ordered by shortest <a>term</a>
20032013
first (breaking ties by choosing the lexicographically least
@@ -2097,39 +2107,9 @@ <h3>Algorithm</h3>
20972107
being processed.</li>
20982108
</ol>
20992109
</li>
2100-
<li class="changed">Otherwise, if <a>term definition</a> has a
2101-
<a>direction mapping</a> (might be <code>null</code>):
2102-
<ol>
2103-
<li>If the <a>direction mapping</a> equals <code>null</code>,
2104-
set <var>direction</var> to <code>@none</code>; otherwise
2105-
to <a>direction mapping</a> preceded by an underscore (`"_"`).</li>
2106-
<li>If <var>language map</var> does not have a <var>direction</var> <a>entry</a>,
2107-
create one and set its value to the <a>term</a>
2108-
being processed.</li>
2109-
</ol>
2110-
</li>
2111-
<li class="changed">Otherwise, if <var>active context</var> has a
2112-
<a>default base direction</a>:
2113-
<ol>
2114-
<li>Initialize a variable <var>lang dir</var>
2115-
with the concatenation of <var>default language</var> and <a>default base direction</a>,
2116-
separate by an underscore (`"_"`),
2117-
normalized to lower case.</li>
2118-
<li>If <var>language map</var> does not have a <var>lang dir</var> <a>entry</a>,
2119-
create one and set its value to the <a>term</a>
2120-
being processed.</li>
2121-
<li>If <var>language map</var> does not have an `@none` <a>entry</a>,
2122-
create one and set its value to the <a>term</a>
2123-
being processed.</li>
2124-
<li>If <var>type map</var> does not have an `@none` <a>entry</a>,
2125-
create one and set its value to the <a>term</a>
2126-
being processed.</li>
2127-
</ol>
2128-
</li>
21292110
<li>Otherwise:
21302111
<ol>
2131-
<li>If <var>language map</var> does not have a <var>default language</var> <a>entry</a>
2132-
<span class="changed">(after being normalized to lower case)</span>,
2112+
<li>If <var>language map</var> does not have a <var>default lang dir</var> <a>entry</a>,
21332113
create one and set its value to the <a>term</a>
21342114
being processed.</li>
21352115
<li>If <var>language map</var> does not have an <code>@none</code>

0 commit comments

Comments
 (0)