Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set a feature if the feature name is in a variable #175

Closed
reckart opened this issue Aug 13, 2021 · 1 comment
Closed

How to set a feature if the feature name is in a variable #175

reckart opened this issue Aug 13, 2021 · 1 comment
Milestone

Comments

@reckart
Copy link
Member

reckart commented Aug 13, 2021

Is your feature request related to a problem? Please describe.
I have a feature name but only in a variable. It does not seem to be possible to do a fs[myFeatureNameVar] = "bonkers". What works is setattr(fs, myFeatureNameVar, "bonkers") - but it does not seem to be terribly intuitive.

Describe the solution you'd like
Since we have a get(featurename) method, maybe have a set(featurename, value) method?

Describe alternatives you've considered
Maybe the x = fs[var]and fs[var] = x syntax could work?

@jcklie jcklie added this to the 0.6.0 milestone Aug 14, 2021
jcklie added a commit that referenced this issue Aug 14, 2021
 - Add set to FeatureStructure
 - Move fs getting/setting tests
jcklie added a commit that referenced this issue Aug 14, 2021
jcklie added a commit that referenced this issue Aug 14, 2021
@jcklie
Copy link
Collaborator

jcklie commented Aug 14, 2021

@jcklie jcklie closed this as completed Aug 14, 2021
reckart added a commit that referenced this issue Aug 19, 2021
* main:
  #172 - Naming: cas.add_annotation(s) (#181)
  #175 - Set a feature if the feature name is in a variable (#180)
  #175 - Set a feature if the feature name is in a variable
  #174 - FSes that are only transitively referenced cannot be serialized (#179)
  #170 - Handling of the "uima.noNamespace" prefix (#178)
  No issue
  #173 - Rename add_feature to create_feature (#177)

# Conflicts:
#	cassis/typesystem.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants