Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ lib/*
data/*
misc/*
build
test/support/*
.DS_Store
scraper/config/secrets.exs
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ CFLAGS := -g -Wall -std=c++11 -O1
LIB := -L lib
INC := -I include

TEST_TARGET := bin/testx
TEST_SRCDIR := test
TEST_INC := -I include -I src

$(TARGET): $(OBJECTS)
@echo " Linking..."
@echo " $(CC) $^ -o $(TARGET) $(LIB)"; $(CC) $^ -o $(TARGET) $(LIB)
Expand All @@ -19,6 +23,10 @@ $(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
mkdir -p $(BUILDDIR)
echo " $(CC) $(CFLAGS) $(INC) -c -o $@ $<"; $(CC) $(CFLAGS) $(INC) -c -o $@ $<

test: $(TEST_SRCDIR)/*.$(SRCEXT)
@echo "Building Tests..."
$(CC) $(CFLAGS) -o $(TEST_TARGET) $(TEST_INC) $^

clean:
@echo "Cleaning..."
@echo " $(RM) -r $(BUILDDIR) $(TARGET)"; $(RM) -r $(BUILDDIR) $(TARGET)
2 changes: 1 addition & 1 deletion include/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Battle {
// Spits the constructed fire
void spit();

private:
// Builds the flame from a base word using a Model
std::string traceBack(Word* base, std::string stressPattern, Model* m, Nouncer* n);

Expand All @@ -30,7 +31,6 @@ class Battle {

WordList filterStressPattern(WordList* leadersList, std::string stressPattern);

private:

// The fire to be spit
std::string fire;
Expand Down
12 changes: 2 additions & 10 deletions include/denouncer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ class Denouncer {
Denouncer();
~Denouncer();

std::vector<std::pair<std::string, std::string>>* getDict();

// Add a nounce and corresponding word to the vector
void addNounce(std::string nounce, std::string word);

Expand All @@ -32,17 +30,11 @@ class Denouncer {
// Look up the value at the given index in the vector
std::string lookUp(int index);

// Look up the value of the given nounce in the vector
std::string lookUp(std::string nounce);

// Prints the data structure
void print(std::string filename);

// size of dict
int getSize() {return dict->size();}
int getSize() {return dict.size();}

private:
std::vector<std::pair<std::string, std::string>>* dict;
std::vector<std::pair<std::string, std::string>> dict;

int binarySearch(std::string nounce, int start, int end);

Expand Down
Loading