Giter Club home page Giter Club logo

cstr's Introduction

cstr

Simple C implementations of string algorithms (simpler than stralg). For teaching purposes

cstr's People

Contributors

mailund avatar

Stargazers

 avatar

Watchers

 avatar  avatar

cstr's Issues

Rethink how search algorithms should be wrapped.

The current wrapper

struct cstr_exact_matcher
{
    exact_next_fn next;
    exact_free_fn free;
    cstr_sslice x, p;
};

with polymorphism works for searches where we have x and p up front, but not as well for cases where we preprocess x, such as suffix trees and suffix arrays. A uniform interface would be better.

Figure out a way to deal with const casting (to avoid it) in _Generic

With code such as

#define CSTR_SLICE_STRING(STR)                                               \
  _Generic((STR),                                                            \
           char *                                                            \
           : CSTR_SLICE((uint8_t *)STR, (long long)cstr_strlen(STR)),        \
           const char *                                                      \
           : CSTR_SLICE((const uint8_t *)STR, (long long)cstr_strlen(STR)))

the issue is that if STR is const char *, it won't be cast to a non-const, but the type checker will still complain that it would be in the first branch.

Alphabet handles sentinels inconsistently

The alphabet always adds the sentinel to inter slices but never to string slices and it assumes that the slice it builds the alphabet from doesn't contain the sentinel. This needs to be more consistent to be easy to use.

Clean up the BWT code

What I have now is a mess I hacked up in an afternoon as an example to a student. It isn't fit to work as example code, and I need to clean it up.

Bring back compiler attributes

Once I figure out how to use attributes to properly track resources in the static analyser (and once linters can understand C23), I want to get them back again. Right now, I have to leave the code annotation free. There is too much hassle, and I can't get it to work 80% of the time anyway.

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.