markdown that renders better on github/pages
parent
3339517340
commit
075a7cd0fd
|
|
@ -228,7 +228,7 @@ std::string DiscreteConditional::markdown(
|
|||
std::stringstream ss;
|
||||
|
||||
// Print out signature.
|
||||
ss << " $P(";
|
||||
ss << " *P(";
|
||||
bool first = true;
|
||||
for (Key key : frontals()) {
|
||||
if (!first) ss << ",";
|
||||
|
|
@ -237,7 +237,7 @@ std::string DiscreteConditional::markdown(
|
|||
}
|
||||
if (nrParents() == 0) {
|
||||
// We have no parents, call factor method.
|
||||
ss << ")$:" << std::endl;
|
||||
ss << ")*:\n" << std::endl;
|
||||
ss << DecisionTreeFactor::markdown(keyFormatter);
|
||||
return ss.str();
|
||||
}
|
||||
|
|
@ -250,7 +250,7 @@ std::string DiscreteConditional::markdown(
|
|||
ss << keyFormatter(parent);
|
||||
first = false;
|
||||
}
|
||||
ss << ")$:" << std::endl;
|
||||
ss << ")*:\n" << std::endl;
|
||||
|
||||
// Print out header and construct argument for `cartesianProduct`.
|
||||
std::vector<std::pair<Key, size_t>> pairs;
|
||||
|
|
|
|||
|
|
@ -180,13 +180,13 @@ TEST(DiscreteBayesNet, markdown) {
|
|||
string expected =
|
||||
"`DiscreteBayesNet` of size 2\n"
|
||||
"\n"
|
||||
" $P(Asia)$:\n"
|
||||
" *P(Asia)*:\n\n"
|
||||
"|Asia|value|\n"
|
||||
"|:-:|:-:|\n"
|
||||
"|0|0.99|\n"
|
||||
"|1|0.01|\n"
|
||||
"\n"
|
||||
" $P(Smoking|Asia)$:\n"
|
||||
" *P(Smoking|Asia)*:\n\n"
|
||||
"|Asia|0|1|\n"
|
||||
"|:-:|:-:|:-:|\n"
|
||||
"|0|0.8|0.2|\n"
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ TEST(DiscreteConditional, markdown_prior) {
|
|||
DiscreteKey A(Symbol('x', 1), 3);
|
||||
DiscreteConditional conditional(A % "1/2/2");
|
||||
string expected =
|
||||
" $P(x1)$:\n"
|
||||
" *P(x1)*:\n\n"
|
||||
"|x1|value|\n"
|
||||
"|:-:|:-:|\n"
|
||||
"|0|0.2|\n"
|
||||
|
|
@ -131,7 +131,7 @@ TEST(DiscreteConditional, markdown_multivalued) {
|
|||
DiscreteConditional conditional(
|
||||
A | B = "2/88/10 2/20/78 33/33/34 33/33/34 95/2/3");
|
||||
string expected =
|
||||
" $P(a1|b1)$:\n"
|
||||
" *P(a1|b1)*:\n\n"
|
||||
"|b1|0|1|2|\n"
|
||||
"|:-:|:-:|:-:|:-:|\n"
|
||||
"|0|0.02|0.88|0.1|\n"
|
||||
|
|
@ -149,7 +149,7 @@ TEST(DiscreteConditional, markdown) {
|
|||
DiscreteKey A(2, 2), B(1, 2), C(0, 3);
|
||||
DiscreteConditional conditional(A, {B, C}, "0/1 1/3 1/1 3/1 0/1 1/0");
|
||||
string expected =
|
||||
" $P(A|B,C)$:\n"
|
||||
" *P(A|B,C)*:\n\n"
|
||||
"|B|C|0|1|\n"
|
||||
"|:-:|:-:|:-:|:-:|\n"
|
||||
"|0|0|0|1|\n"
|
||||
|
|
|
|||
Loading…
Reference in New Issue