Replies: 15 comments 19 replies
-
@AndrewHC36 RE: "Can u elaborate what translation type, agency field, raw translation are?" Here is my code sketch for reference enum AgencyField {
...
}
...
enum TranslationType {
Agency { field_name: AgencyField },
...
}
struct RawTranslation<T> {
// confusingly also contains field_name
translation_type: TranslationType,
...
} RawTranslation is an attempt to make invalid lines of translations.txt as unrepresentable as possible at the data structure level. It's a rewrite of the RawTranslation struct in the original PR which was an intermediary struct for parsing the translations file and creating the translations hashmap. The original struct was all Strings which was closer to the original spec but allowed representation of basically every kind of invalid translation imaginable. AgencyField is one of a number of enums (one for each table) which limits the field_name of the struct to be one valid for the table in the translation the struct represents. That is, AgencyField can be one of and only one of the field_names in the Agency table. This is again to reduce the space of representative invalid translations. TranslationType is an enum I got from some of @kylerchin 's initial code, pictured below. It was initially just an enum of valid table_names, but in my proposed code sketch, the enum has the enumerated valid field names nested within it, so being called TableName would hide that fact. I think a more descriptive name is in order, but I haven't come up with one yet. I am open to suggestions for that as well as the rest of my code sketch. |
Beta Was this translation helpful? Give feedback.
-
Hello! I've done an analysis of our entire static dataset. Here's what we've found. https://github.com/catenarytransit/gtfs-dataset-analysis/blob/main/translation_pivot_analysis.csv I have yet to peel away what this table means, I'll do that in the morning. So far, there's 7 different types of Chinese covering Cantonese and various traditional character usage in HK and Taiwan, etc. |
Beta Was this translation helpful? Give feedback.
-
Regarding language types, perhaps we should keep that as a string? Unless we plan on adding every type of language-script-region-variant as allowed under the GTFS standard. Another thing that's tricky is Chinese variants. Possible language options under www org: |
Beta Was this translation helpful? Give feedback.
-
The disadvantage of doing the struct method could be that it's harder to
program with maybe, because each table needs to be accessed individually.
Actually, as long as they all have the same value , it's easy with function
calls. The advantage is that it saves memory, because you don't need a
million copies of the table name.
CC: @AndrewHC36
2024년 1월 17일 (수) 16:13, Andrew Shen ***@***.***>님이 작성:
… I feel like we should go back to use struct fields for table names. For
field names, we can use enum with that way.
—
Reply to this email directly, view it on GitHub
<#2 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZQTZS4LU5U3HJPE72TXDDYPBSK3AVCNFSM6AAAAABB2OUCYGVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DCNRTGIZDI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
What is the plan for the API? Is it the same as the original PR i.e. |
Beta Was this translation helpful? Give feedback.
-
Posted by maintainer of Rust GTFS structures:
Originally posted by @antoine-de in rust-transit/gtfs-structure#74 (comment) |
Beta Was this translation helpful? Give feedback.
-
This library https://github.com/pyfisch/rust-language-tags/ looks a lot more comprehensive compared to oxilangtag. |
Beta Was this translation helpful? Give feedback.
-
Well it works!!! Here's some example usage: https://github.com/catenarytransit/gtfs_translation_test |
Beta Was this translation helpful? Give feedback.
-
The PR for this discussion is now: rust-transit/gtfs-structure#155 |
Beta Was this translation helpful? Give feedback.
-
Send by me: rust-transit/gtfs-structure#155 (comment)
|
Beta Was this translation helpful? Give feedback.
-
I'm stuck, asking for StopTimes is not possible right now |
Beta Was this translation helpful? Give feedback.
-
A first beta of a hashmap data structure is now ready here: https://github.com/catenarytransit/gtfs-translations Further impls will be added to the gtfs structures library eventually |
Beta Was this translation helpful? Give feedback.
-
We are attempting to create the standard for https://github.com/rust-transit/gtfs-structure
The original pull request was somewhat abandoned / rejected. rust-transit/gtfs-structure#74
The translation is especially difficult to understand, because it allows arbritary translation either based on the primary key of each table, or by matching field values.
Another challenge is producing a viable data lookup system that can output translated stop names, route names without excess lookups.
CC: @AndrewHC36 @CallMeJai
Beta Was this translation helpful? Give feedback.
All reactions