GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/util/didyoumean.h Lines: 4 5 80.0 %
Date: 2021-11-07 Branches: 1 2 50.0 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Kshitij Bansal, Tim King
4
 *
5
 * This file is part of the cvc5 project.
6
 *
7
 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8
 * in the top-level source directory and their institutional affiliations.
9
 * All rights reserved.  See the file COPYING in the top-level source
10
 * directory for licensing information.
11
 * ****************************************************************************
12
 *
13
 * Did-you-mean style suggestions.
14
 *
15
 * ``What do you mean? I don't understand.'' An attempt to be more
16
 * helpful than that. Similar to one in git.
17
 *
18
 * There are no dependencies on cvc5 (except namespace).
19
 */
20
21
#pragma once
22
23
#include "cvc5_export.h"
24
25
#include <string>
26
#include <vector>
27
28
namespace cvc5 {
29
30
8
class CVC5_EXPORT DidYouMean {
31
 public:
32
  void addWord(const std::string& word) { d_words.emplace_back(word); }
33
4
  void addWords(const std::vector<std::string>& words)
34
  {
35
4
    d_words.insert(d_words.end(), words.begin(), words.end());
36
4
  }
37
38
  std::vector<std::string> getMatch(const std::string& input);
39
40
  /**
41
   * This is provided to make it easier to ensure consistency of
42
   * output. Returned string is empty if there are no matches.
43
   */
44
  std::string getMatchAsString(const std::string& input);
45
46
 private:
47
  std::vector<std::string> d_words;
48
};
49
50
}  // namespace cvc5