Skip to content

Commit

Permalink
wip: flx
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Dec 17, 2024
1 parent ab5413e commit 71c850b
Showing 1 changed file with 31 additions and 13 deletions.
44 changes: 31 additions & 13 deletions flx/flx.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
# ========================================================================
# $File: flx.py $
# $Date: 2024-12-16 22:02:28 $
# $Revision: $
# $Creator: Jen-Chieh Shen $
# $Notice: See LICENSE.txt for modification and distribution information
# Copyright © 2024 by Shen, Jen-Chieh $
# ========================================================================

def main():
"""Program Entry point.
word_separators = [ ' ', '-', '_', ':', '.', '/', '\\', ]

default_score = -35

def word(ch):
"""Check if `ch` is a word character."""
if ch == None:
return False
return not ch in word_separators

def capital(ch):
"""Check if `ch` is an uppercase character."""
return word(ch) and ch == ch.upper()

def boundary(last_ch, ch):
"""Check if LAST-CHAR is the end of a word and CHAR the start of the next.
This function is camel-case aware.
"""
if last_ch == None:
return True

if not capital(last_ch) and capital(ch):
return True

if word(last_ch) and word(ch):
return True

return False

if __name__ == "__main__":
main()
def inc_vec(vec, inc, beg, end):
"""Increment each element in `vec` between `beg` and `end` by `inc`."""
pass

0 comments on commit 71c850b

Please sign in to comment.