Giter Site home page Giter Site logo

kwic's Introduction

KWIC - Keyword in Context stability-deprecated Build Status

⚠️ This repository is no longer maintained by Lukas Martinelli.

The KWIC index system accepts an ordered set of lines, each line is an ordered set of words, and each word is an ordered set of characters. Any line may be "circularly shifted" by repeatedly removing the first word and appending it at the end of the line. The KWIC index system outputs a listing of all circular shifts of all lines in alphabetical order.

Project Setup for Cevelop

  1. Install Cevelop
  2. Open the repository as a workspace
  3. Import as existing projects into workspace

Build Project

You can use Eclipse to build the project or the provided makefile.

make

Run Tests

We use CUTE for our unit tests. To run the tests you need to compile the tests and then simply run the executable. This will output the test results to the console and a XML file.

make test

Example:

Input:

this is a test
this is another test

Result:

a test this is
another test this is
is a test this
is another test this
test this is a
test this is another
this is a test
this is another test

kwic's People

Contributors

lukasmartinelli avatar manuelroth avatar

Stargazers

Kevin Feng avatar Lin Xiangyu avatar Pascal Birchler avatar  avatar

Watchers

James Cloos avatar  avatar

kwic's Issues

Review by lecturer

main.cpp

  • vorbildlich, permuteLines schlechter Funktionsname!

kwic.cpp

  • operator>> << im namespace kwic werden ggf. nicht gefunden, weil keiner der Parametertypen in diesem Namespace definiert ist (ADL-Problem)
  • permuteLines/permuteWords/permutations -> schlechter Name, es werden nur Rotationen keine Permutationen erzeugt

kwic.h

  • <vector> fehlt hier (wird von word.h unnötigerweise mitgebracht)
  • warum operator>> ? in dem namespace wird er nicht gesucht bei der Anwendung

word.cpp

  • Vergleichsoperatoren zum Teil falsch implementiert (operator> nutzt nicht operator< der Word Klasse, sondern von std::string
  • operator== und damit auch != ineffizient implementiert
  • Schematisch Vergleichsoperatoren inline im Header realisieren.
  • Wo sind die Lesefunktionen/Print? Die gehören aufgrund Ihrer Komplexität in das .cpp file, sonst wird der header von zu vielen Dingen abhängig

word.h

  • warum namespace kwic? Word Klasse sollte nicht von Kwic Anwendung abhängig sein!
  • public member Variable führt Prüfung der Klasseninvariante ad absurdum! Ganz mieses Design
  • Implementierung der shift-operatoren ändert direkt member-Variable! Schlecht!
  • Logik war vorgegeben in read()/print() member funktionen
  • default ctor hätte auch mit Word(std::string value="") erreicht werden können.
  • viel zu starke dependencies im header (<istream> und <ostream> (auch wenn indirekt)
  • wozu braucht es <vector>?

Test.cpp

  • Arrange/Act/Assert braucht man nicht zu kommentieren, einfach machen!
  • eigene header zuerst
  • testWordsAreDelimitedByNonAlphanumericCharacters -> nicht Vorgabe getestet, umständlich (Schleife) und EOF Verhalten nicht geprüft
  • testPermuteSingleLineReturnsAllMutationsSorted umständlich implementiert! Man kann mit ASSERT_EQUAL auch vectors vergleichen!
    • const auto mit =Word ist eher ungeschickt, besser Word const word{"this"};
    • Wenn man den Typ sowieso konkret hinschreibt, ist auto schlecht!
  • keine Tests für mehr Zeilen als die Vorlage, schade
  • testWordRightShiftPutsWordsIntoSentenceUntilEndOfLine prüft nicht, ob wirklich EOF erreicht wurde!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.