Skip to content

Commit

Permalink
support for unicode characters and bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sspola committed May 31, 2022
1 parent 5ffb760 commit 1b44118
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
setup(
name = 'simpful',
packages = ['simpful'], # this must be the same as the name above
version = '2.6.3',
version = '2.6.4',
description = 'A user-friendly Python library for fuzzy logic',
author = 'Marco S. Nobile',
author_email = '[email protected]',
Expand Down
4 changes: 2 additions & 2 deletions simpful/rule_parsing.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import re
from numpy import array

regex_clause_with_parentheses = re.compile(r"^\([a-z,_,A-Z,0-9]*\s*IS\s*[a-z,_,A-Z,0-9]*\)$")
regex_clause = re.compile(r"^[a-z,_,A-Z,0-9]*\s*IS\s*[a-z,_,A-Z,0-9]*$")
regex_clause_with_parentheses = re.compile(r"^\(\w*\s*IS\s*\w*\)$")
regex_clause = re.compile(r"^\w*\s*IS\s*\w*$")

class Clause(object):

Expand Down
7 changes: 3 additions & 4 deletions simpful/simpful.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def draw(self, ax, TGT=None, highlight=None, xscale="linear"):

for nn, fs in enumerate(self._FSlist):
if isinstance(fs, SingletonsSet):
print(fs._funpointer._pairs)
xs = [pair[0] for pair in fs._funpointer._pairs]
ys = [pair[1] for pair in fs._funpointer._pairs]
ax.vlines(x=xs, ymin=0.0, ymax=ys, linestyles=linestyles[nn%4], color=next(ax._get_lines.prop_cycler)['color'], label=fs._term)
Expand All @@ -143,7 +142,7 @@ def draw(self, ax, TGT=None, highlight=None, xscale="linear"):
ax.axvline(x=TGT, ymin=0.0, ymax=1.0, color="red", linestyle="--", linewidth=2.0)
ax.set_xlabel(self._concept)
ax.set_ylabel("Membership degree")
ax.set_ylim(bottom=-0.05)
ax.set_ylim(bottom=-0.05, top=1.05)
if xscale == "log":
ax.set_xscale("symlog", linthresh=10e-2)
ax.set_xlim(x[0], x[-1])
Expand Down Expand Up @@ -626,7 +625,7 @@ def Sugeno_inference(self, terms=None, ignore_errors=False, ignore_warnings=Fals
Returns:
a dictionary, containing as keys the variables' names and as values their numerical inferred values.
"""
if self._sanitize and terms is not None:
if self._sanitize_input and terms is not None:
terms = [self._sanitize(term) for term in terms]

# default: inference on ALL rules/terms
Expand Down Expand Up @@ -669,7 +668,7 @@ def Mamdani_inference(self, terms=None, subdivisions=1000, ignore_errors=False,
Returns:
a dictionary, containing as keys the variables' names and as values their numerical inferred values.
"""
if self._sanitize and terms is not None:
if self._sanitize_input and terms is not None:
terms = [self._sanitize(term) for term in terms]

# default: inference on ALL rules/terms
Expand Down

0 comments on commit 1b44118

Please sign in to comment.