Skip to content

Commit

Permalink
fix titles being the same as descriptions in disambiguation results
Browse files Browse the repository at this point in the history
  • Loading branch information
barrust committed Feb 2, 2019
1 parent 6a175da commit efcee54
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion mediawiki/mediawikipage.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def _raise_disambiguation_error(self, page, pageid):
item = lis_item.find_all("a")
one_disambiguation = dict()
one_disambiguation["description"] = lis_item.text
if item and hasattr(item, "title"):
if item and hasattr(item[0], "title"):
one_disambiguation["title"] = item[0]["title"]
else:
# these are non-linked records so double up the text
Expand Down
22 changes: 11 additions & 11 deletions tests/mock_responses.json
Original file line number Diff line number Diff line change
Expand Up @@ -6239,43 +6239,43 @@
"missing_title_disamb_dets": [
{
"description": "Leaching (agriculture), the loss of water-soluble plant nutrients from the soil; or applying a small amount of excess irrigation to avoid soil salinity",
"title": "Leaching (agriculture), the loss of water-soluble plant nutrients from the soil; or applying a small amount of excess irrigation to avoid soil salinity"
"title": "Leaching (agriculture)"
},
{
"description": "Leaching (chemistry), the process of extracting substances from a solid by dissolving them in a liquid",
"title": "Leaching (chemistry), the process of extracting substances from a solid by dissolving them in a liquid"
"title": "Leaching (chemistry)"
},
{
"description": "Leaching (metallurgy), a widely used extractive metallurgy technique which converts metals into soluble salts in aqueous media\nDump leaching, an industrial process to extract metals from ore taken directly from the mine and stacked on the leach pad without crushing\nHeap leaching, an industrial process to extract metals from ore which has been crushed into small chunks\nTank leaching, a hydro metallurgical method of extracting valuable material from ore\nIn-situ leaching, a process of recovering minerals such as copper and uranium through boreholes drilled into the deposit",
"title": "Leaching (metallurgy), a widely used extractive metallurgy technique which converts metals into soluble salts in aqueous media\nDump leaching, an industrial process to extract metals from ore taken directly from the mine and stacked on the leach pad without crushing\nHeap leaching, an industrial process to extract metals from ore which has been crushed into small chunks\nTank leaching, a hydro metallurgical method of extracting valuable material from ore\nIn-situ leaching, a process of recovering minerals such as copper and uranium through boreholes drilled into the deposit"
"title": "Leaching (metallurgy)"
},
{
"description": "Dump leaching, an industrial process to extract metals from ore taken directly from the mine and stacked on the leach pad without crushing",
"title": "Dump leaching, an industrial process to extract metals from ore taken directly from the mine and stacked on the leach pad without crushing"
"title": "Dump leaching"
},
{
"description": "Heap leaching, an industrial process to extract metals from ore which has been crushed into small chunks",
"title": "Heap leaching, an industrial process to extract metals from ore which has been crushed into small chunks"
"title": "Heap leaching"
},
{
"description": "Tank leaching, a hydro metallurgical method of extracting valuable material from ore",
"title": "Tank leaching, a hydro metallurgical method of extracting valuable material from ore"
"title": "Tank leaching"
},
{
"description": "In-situ leaching, a process of recovering minerals such as copper and uranium through boreholes drilled into the deposit",
"title": "In-situ leaching, a process of recovering minerals such as copper and uranium through boreholes drilled into the deposit"
"title": "In-situ leaching"
},
{
"description": "Leaching (pedology), the loss of mineral and organic solutes due to percolation from soil",
"title": "Leaching (pedology), the loss of mineral and organic solutes due to percolation from soil"
"title": "Leaching (pedology)"
},
{
"description": "Bioleaching, the extraction of specific metals from their ores through the use of bacteria and fungi",
"title": "Bioleaching, the extraction of specific metals from their ores through the use of bacteria and fungi"
"title": "Bioleaching"
},
{
"description": "Leachate, the liquid that drains or 'leaches' from a landfill",
"title": "Leachate, the liquid that drains or 'leaches' from a landfill"
"title": "Leachate"
},
{
"description": "Leach (disambiguation)",
Expand Down Expand Up @@ -15973,4 +15973,4 @@
"Zygophyllum fabago"
]
}
}
}

0 comments on commit efcee54

Please sign in to comment.