Skip to content

Commit

Permalink
Add ALPH.svg mapping into the midashi
Browse files Browse the repository at this point in the history
The source dict only had it in the title and not the midashi, so you couldn't see it
  • Loading branch information
Thermospore committed Aug 24, 2021
1 parent 8d5f82c commit cf6720b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 12 additions & 4 deletions koj72yomi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ int main()
vector<string> iconReplace;
ifstream iconMap("map_icon.txt");
string line;
string yajirusi2Map = "";
int yaj2Pos = -1;
int ALPHPos = -1;
while (getline(iconMap, line))
{
// Skip comment lines
Expand All @@ -129,9 +130,11 @@ int main()
iconFind.push_back(line.substr(0,tabPos));
iconReplace.push_back(line.substr(tabPos + 1));

// Store yajirusi2.svg mapping for easy reference later
// Store some mapping indexes for easy reference later
if (iconFind.back() == "yajirusi2.svg")
yajirusi2Map = iconReplace.back();
yaj2Pos = iconReplace.size() - 1;
if (iconFind.back() == "ALPH.svg")
ALPHPos = iconReplace.size() - 1;
}
iconMap.close();

Expand Down Expand Up @@ -496,6 +499,11 @@ int main()
fnOpenReplace = "\"";
fnCloseReplace = titleTag + "\", ";

// Add ALPH.svg icon mapping for ALPH entries
// (originally it was in the title, not the midashi, so you couldn't see it)
if(alphEntry)
fnOpenReplace += iconReplace[ALPHPos];

// Add readings for phrase entries
if (phraseEntry == true)
{
Expand Down Expand Up @@ -577,7 +585,7 @@ int main()
if (tagContents.find("") == 0 ||
tagContents.find("<sup>(→)</sup>") == 0 ||
tagContents.find("<object class=\\\"icon\\\" data=\\\"yajirusi1.svg\\\"></object>") == 0 ||
html.find(yajirusi2Map, openTagStart - yajirusi2Map.length()) == openTagStart - yajirusi2Map.length() ||
html.find(iconReplace[yaj2Pos], openTagStart - iconReplace[yaj2Pos].length()) == openTagStart - iconReplace[yaj2Pos].length() ||
// These are exclusively the "参照" refs (with a single exception in こ‐じっかり 【小確】)
(tagContents.find("") == 0 && tagContents.find("") == tagContents.length() - 3))
{
Expand Down
4 changes: 2 additions & 2 deletions map_icon.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Author: shoui520 & thermospore
# Null means you should just remove it
# Any whitespace at the end of the line is intentional
square_a.svg 〘
square_b.svg 〙
yajirusi2.svg ➡
Expand All @@ -11,5 +11,5 @@ kigo.svg 季:
angle_b.svg 》
kan3.svg 🈪
kan4.svg ", {"tag": "img", "path": "gaiji/kan4.svg", "width": 1, "height": 1, "background": false, "appearance": "monochrome", "collapsible": false, "collapsed": false, "sizeUnits": "em"}, "
ALPH.svg null
ALPH.svg 🄰
bungo.png 〚文〛

0 comments on commit cf6720b

Please sign in to comment.