#8899 Try exact matches for eclipse summary category search.

Fixes incorrect classification for vectors with 8 characters starting with
'N' (e.g NLINSMAX). They were classified as "network", but lookup table have
them correctly classified as "misc".
This commit is contained in:
Kristian Bendiksen
2022-05-31 20:25:35 +02:00
parent 34a5d3e756
commit 92afb11a76
3 changed files with 16 additions and 6 deletions

View File

@@ -157,8 +157,14 @@ RifEclipseSummaryAddress RifEclipseSummaryAddress::fromEclipseTextAddress( const
//--------------------------------------------------------------------------------------------------
RifEclipseSummaryAddress::SummaryVarCategory RifEclipseSummaryAddress::identifyCategory( const std::string& vectorName )
{
// Try to an exact match on the vector name first in the vector table.
bool exactMatch = true;
auto exactCategory = RiuSummaryQuantityNameInfoProvider::instance()->categoryFromVectorName( vectorName, exactMatch );
if ( exactCategory != SUMMARY_INVALID ) return exactCategory;
if ( vectorName.size() < 3 || vectorName.size() > 8 ) return SUMMARY_INVALID;
// Try to match the base vector name with more heuristics
auto strippedQuantityName = baseVectorName( vectorName );
// First, try to lookup vector in vector table