• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CS2113-AY1819S2-T09-1 / main / 618
92%

Build:
DEFAULT BRANCH: master
Ran 30 Mar 2019 04:08AM UTC
Jobs 1
Files 105
Run time 4s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
618

push

travis-ci

Creastery
[#65/#129] Logic: improve `FindCommand` to handle boolean expressions (#119)

`FindCommandParser#getKeywordsPredicate(...)` creates a predicate that
does an implicit boolean OR operation when combining predicates.

This may not desirable for our users as they will not be able to have
tighter search results
e.g. Finding for module's `name` with both `Programming` and
`Methodology`.

We aim to improve our `FindCommand` to improve flexibility in finding
modules easily by treating the user command arguments as a boolean
expression.

Consider the following example.

  find name/Structures || (code/CS2040C && credits/4)

We aim to tokenize it to:
* name/Structures
* ||
* (
* code/CS2040C
* &&
* credits/4
* )

Afterwards, we apply Shunting-yard algorithm to parse and process the
arguments accordingly.

However, `StringTokenizer` is insufficient in extracting prefixed
arguments and boolean operators, as we want to keep boolean operators as
tokens. Likewise, `ArgumentTokenizer` is also not suitable, as we do not
want to use whitespace as delimiter for splitting and extracting
arguments.

Therefore, to enable us to improve the `find` command, let's implement:
* a custom `BooleanExpressionTokenizer` to extract prefixed arguments
  and boolean operators as tokens
* a custom `BooleanExpressionParser`` which handles the parsing of the
  argument tokens and apply Shunting-yard algorithm
* declare the operators supported (i.e. `&&` for logical AND, || `for`
  logical OR, () to group expression to be evaluated first
* Refactor `FindCommandParser` to utilise
  `BooleanExpressionParser#parse(...)`
* implement and modify unit tests for the `find` command to ensure that
  the expected behaviour is intended

  [ 1/14] Logic: create `BooleanExpressionParser` class
  [ 2/14] Logic: create `Operator` class
  [ 3/14] Logic: add helper method on Operator
  [ 4/14] Logic: add helper method on Operator
  [ 5/14] Logic: add helper method for `BooleanExpressionParser`
  [ 6/14] Log... (continued)

2242 of 2585 relevant lines covered (86.73%)

0.87 hits per line

Jobs
ID Job ID Ran Files Coverage
1 618.1 30 Mar 2019 04:08AM UTC 0
86.73
Travis Job 618.1
Source Files on build 618
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #618
  • 9890225d on github
  • Prev Build on master (#617)
  • Next Build on master (#623)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc