Code Cleanup
- Removed unused text.cpp guess function.
This commit is contained in:
31
src/text.cpp
31
src/text.cpp
@@ -475,37 +475,6 @@ const char* optionalBlankLine ()
|
|||||||
return context.verbose ("blank") ? newline : noline;
|
return context.verbose ("blank") ? newline : noline;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
void guess (
|
|
||||||
const std::string& type,
|
|
||||||
std::vector<std::string>& options,
|
|
||||||
std::string& candidate)
|
|
||||||
{
|
|
||||||
std::vector <std::string> matches;
|
|
||||||
autoComplete (candidate, options, matches,
|
|
||||||
context.config.getInteger ("abbreviation.minimum"));
|
|
||||||
if (1 == matches.size ())
|
|
||||||
candidate = matches[0];
|
|
||||||
|
|
||||||
else if (0 == matches.size ())
|
|
||||||
candidate = "";
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::sort (matches.begin (), matches.end ());
|
|
||||||
|
|
||||||
std::string error = format (STRING_TEXT_AMBIGUOUS, type, candidate);
|
|
||||||
for (size_t i = 0; i < matches.size (); ++i)
|
|
||||||
{
|
|
||||||
if (i)
|
|
||||||
error += ", ";
|
|
||||||
error += matches[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
bool nontrivial (const std::string& input)
|
bool nontrivial (const std::string& input)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ std::string ucFirst (const std::string&);
|
|||||||
const std::string str_replace (std::string&, const std::string&, const std::string&);
|
const std::string str_replace (std::string&, const std::string&, const std::string&);
|
||||||
const std::string str_replace (const std::string&, const std::string&, const std::string&);
|
const std::string str_replace (const std::string&, const std::string&, const std::string&);
|
||||||
const char* optionalBlankLine ();
|
const char* optionalBlankLine ();
|
||||||
void guess (const std::string&, std::vector<std::string>&, std::string&);
|
|
||||||
bool nontrivial (const std::string&);
|
bool nontrivial (const std::string&);
|
||||||
bool digitsOnly (const std::string&);
|
bool digitsOnly (const std::string&);
|
||||||
bool noSpaces (const std::string&);
|
bool noSpaces (const std::string&);
|
||||||
|
|||||||
Reference in New Issue
Block a user