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

Change to use glossarist gem #31

Merged
merged 9 commits into from
Feb 21, 2024
Merged

Change to use glossarist gem #31

merged 9 commits into from
Feb 21, 2024

Conversation

ronaldtse
Copy link
Member

Fixes #30

This is a WIP. @HassanAkbar can you please help complete this?

The way to reproduce is as follows:

bundle exec tc211-termbase-xlsx2yaml "20231214 Multi-Lingual Glossary – Published __unlocked__ with Math.xlsx"

20231214 Multi-Lingual Glossary – Published unlocked with Math.xlsx

@ronaldtse ronaldtse added the enhancement New feature or request label Feb 11, 2024
@HassanAkbar
Copy link
Member

@ronaldtse Tried to run this locally and run into relaton-un exception which is already reported here -> relaton/relaton-un#14

Will try to work on the code based on the test file, but I think to test this completely we will have to wait for the fix.

@ronaldtse
Copy link
Member Author

@HassanAkbar please manually remove this cell and fix other issues. There is no reason to be blocked by it.

@ronaldtse
Copy link
Member Author

@HassanAkbar the issue is resolved. Can you continue? Thanks.

@HassanAkbar HassanAkbar changed the title WIP: Change to use glossarist gem Change to use glossarist gem Feb 18, 2024
@HassanAkbar
Copy link
Member

@ronaldtse this is now ready for review.

} if lineage_source
end

def to_localized_concept_hash
Copy link

Choose a reason for hiding this comment

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

Method has too many lines. [17/10]

value = "superseded"
when "информация отсутствует" # "information absent"!?
value = "retired"
when %w(notValid valid superseded retired) # do nothing
Copy link

Choose a reason for hiding this comment

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

Avoid when branches without a body.


attr_accessor *(INPUT_ATTRIBS | OUTPUT_ATTRIBS)

def initialize(options={})
Copy link

Choose a reason for hiding this comment

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

Method has too many lines. [19/10]
Surrounding space missing in default value assignment.

release
)

OUTPUT_ATTRIBS = INPUT_ATTRIBS - %i(term alt abbrev synonyms classification) + %i(terms)
Copy link

Choose a reason for hiding this comment

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

Line is too long. [92/80]

return @sections if @sections

@sections = []
sections_raw.each_with_index do |x,i|
Copy link

Choose a reason for hiding this comment

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

Space missing after comma.

end
end

def get_section(x)
Copy link

Choose a reason for hiding this comment

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

Method has too many lines. [11/10]
Method parameter must be at least 3 characters long.


def sections
return @sections if @sections
def sections
Copy link

Choose a reason for hiding this comment

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

Assignment Branch Condition size for sections is too high. [<5, 16, 5> 17.49/15]
Method has too many lines. [23/10]

"pol"
else
code
end
Copy link

Choose a reason for hiding this comment

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

end at 39, 6 is not aligned with case at 30, 23.

"dut"
when "工作语言代码"
"chn"
when "pl"
Copy link

Choose a reason for hiding this comment

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

Indent when as deep as case.

@language_code = case code
when "dut/nld"
"dut"
when "工作语言代码"
Copy link

Choose a reason for hiding this comment

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

Indent when as deep as case.

"entry_status" => "valid",
"review_date" => Time.parse("2013-01-29 00:00:00"),
"review_decision_date" => Time.parse("2016-10-01 00:00:00"),
"review_decision_event" => "Publication of ISO 19104:2016"
Copy link

Choose a reason for hiding this comment

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

Put a comma after the last item of a multiline hash.

},
{
"origin" => {
"ref" => "ISO/TS 19104:2008"
Copy link

Choose a reason for hiding this comment

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

Put a comma after the last item of a multiline hash.

"origin" => {
"ref" => "ISO 1087-1:2000",
"clause" => "3.4.9",
"link" => "https://www.iso.org/standard/20057.html"
Copy link

Choose a reason for hiding this comment

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

Put a comma after the last item of a multiline hash.

],
"definition" => [
{
"content" => "designation formed by omitting words or letters from a longer form and designating the same concept"
Copy link

Choose a reason for hiding this comment

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

Put a comma after the last item of a multiline hash.
Line is too long. [134/80]

end

context "localized_concept count" do
let(:localized_concepts_count) { Dir.glob("concepts/localized_concept/*").count }
Copy link

Choose a reason for hiding this comment

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

Line is too long. [87/80]

@ronaldtse ronaldtse merged commit f761f1c into main Feb 21, 2024
15 checks passed
@ronaldtse
Copy link
Member Author

Thank you @HassanAkbar !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to latest Glossarist YAML format
2 participants