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

make construct use category a String? instead of a list, set it to PO… #899

Closed
wants to merge 1 commit into from

Conversation

ggurdin
Copy link
Collaborator

@ggurdin ggurdin commented Nov 1, 2024

…S for vocab constructs

Thank you so much for your contribution to FluffyChat ❤️❤️❤️

Please make sure that your Pull Request meet the following acceptance criteria:

  • Code formatting and import sorting has been done with dart format lib/ test/ and dart run import_sorter:main --no-comments
  • The commit message uses the format of Conventional Commits
  • The commit message describes what has been changed, why it has been changed and how it has been changed
  • Every new feature or change of the design/GUI is linked to an approved design proposal in an issue
  • Every new feature in the app or the build system has a strategy how this will be tested and maintained from now on for every release, e.g. a volunteer who takes over maintainership

Pull Request has been tested on:

  • Android
  • iOS
  • Browser (Chromium based)
  • Browser (Firefox based)
  • Browser (WebKit based)
  • Desktop Linux
  • Desktop Windows
  • Desktop macOS


factory ConstructIdentifier.fromJson(Map<String, dynamic> json) {
final categoryEntry = json['cat'];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want json['cat'] ?? json ['categories'] for backwards compatibility here.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add to the ContructIdentifier toJson as well!

@@ -134,7 +142,7 @@ class OneConstructUse {
data['constructType'] = constructType.string;

if (id != null) data['id'] = id;
data['categories'] = categories;
data['categories'] = category;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move to 'cat' to save some space

return OneConstructUse(
useType: ConstructUseTypeUtil.fromString(json['useType']),
lemma: json['lemma'],
form: json['form'],
categories: json['categories'] != null
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here of json['cat'] ?? json['categories']

@ggurdin ggurdin closed this Nov 1, 2024
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

Successfully merging this pull request may close these issues.

Make ConstructUse category a string instead of a list and set it to the token's POS for vocab constructs
2 participants