Python implementation of Project Fluent

Overview

Project Fluent

This is a collection of Python packages to use the Fluent localization system.

python-fluent consists of these packages:

fluent.syntax

The syntax package includes the parser, serializer, and traversal utilities like Visitor and Transformer. You’re looking for this package if you work on tooling for Fluent in Python.

fluent.runtime

The runtime package includes the library required to use Fluent to localize your Python application. It comes with a Localization class to use, based on an implementation of FluentBundle. It uses the tooling parser above to read Fluent files.

fluent.pygments

A plugin for pygments to add syntax highlighting to Sphinx.

Discuss

We’d love to hear your thoughts on Project Fluent! Whether you’re a localizer looking for a better way to express yourself in your language, or a developer trying to make your app localizable and multilingual, or a hacker looking for a project to contribute to, please do get in touch on the mailing list and the IRC channel.

Get Involved

python-fluent is open-source, licensed under the Apache License, Version 2.0. We encourage everyone to take a look at our code and we’ll listen to your feedback.

Comments
  • Implement MessageContext.format

    Implement MessageContext.format

    Implementation of #65

    This is incomplete, but at a reviewable level - the remaining work to be done shouldn't influence the overall design that much.

    I'm unlikely to get back to this soon, but leaving this here so that others are aware that a start has been made, and if anyone wants to give feedback then they can.

    opened by spookylukey 31
  • AttributeError: 'FluentBundle' object has no attribute 'add_messages'

    AttributeError: 'FluentBundle' object has no attribute 'add_messages'

    I'm shopping around for gettext replacements. Is the python fluent client (and fluent more broadly) still being maintained?

    I mainly ask because even the happy path described in the docs does not work properly right now:

    pip install fluent.runtime
    python
    
    from fluent.runtime import FluentBundle
    bundle = FluentBundle(['en-US'])
    bundle.add_messages("""""")
    Traceback (most recent call last):
      File "/park/server/env/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3331, in run_code
        exec(code_obj, self.user_global_ns, self.user_ns)
      File "<ipython-input-2-2a5756cb5134>", line 4, in <module>
        bundle.add_messages("""""")
    AttributeError: 'FluentBundle' object has no attribute 'add_messages'
    

    Looks like it was yanked out in the 0.3.0 "pre-release" and the docs weren't updated.

    Anyway, Fluent seems cool, but I'd rather not go through the heartache of using it only to learn in 6 months that Mozilla has abandoned it. Thanks for any insight you have!

    opened by plowman 13
  • Migrate empty translations

    Migrate empty translations

    Migrate empty translations as {""}. See https://bugzil.la/1441942.

    Empty plural variants are also kept as {""} to preserve as much of the original intent as possible. Dropping them could result in different behavior when the default variant is displayed instead.

    This doesn't address migrating leading and trailing whitespace in non-whitespace-only legacy translations. See https://bugzil.la/1374246.

    See https://github.com/projectfluent/python-fluent/pull/54#issuecomment-371536006.

    opened by stasm 10
  • Implement BaseNode.visit API

    Implement BaseNode.visit API

    BaseNode.traverse can be costly because it clones the entire tree under the node it ran on. We should add a new method just for non-destructive visiting. This will be useful for the equals methods, as well as for the compare-locales checks.

    fluent.syntax 
    opened by stasm 9
  • Docs and/or status of project

    Docs and/or status of project

    At first I was going to ask for docs on how to actually use this package. On further inspection it doesn't look like it has yet reached minimum functionality. If would be great if the README could be updated to indicate the project status.

    Thanks!

    opened by spookylukey 9
  • Compiling MessageContext

    Compiling MessageContext

    This is a second implementation of MessageContext using a compile-to-python strategy. The PR builds on top of #67 and should be reviewed after that has been merged.

    My idea is that both implementations will be available, with the compiler the default because it is much faster (some benchmarks included in the new benchmark script). The interpreter is much easier to add new things to (which could be important for other contributors) and has some features/behaviour that the compiler doesn't have (documented). In addition, the two implementations can help test each other to some extent, and if you have any planned extensions, having two implementations, although twice the work, can help to ensure that the new feature doesn't limit you to a specific implementation strategy.

    For example, I have an escapers feature that I need for django-ftl - see docs , which I've been able to implement for both the interpreter and compiler, but starting with the interpreter was easier. (That branch hasn't been updated for the 0.6 spec changes yet).

    This branch is mostly complete, but probably needs some final cleanup. I'm opening it now in order to make @stasm aware of its existence (especially as I'm away for a bit now). It doesn't change that much from the interpreter MessageContext already implemented, but does clean up and clarify a few things (e.g. the error handling strategy), and MessageContext gains a check_message method (currently undocumented).

    If you want to look at it, I imagine that starting with reading the tests/test_compiler.py tests will be the best way to go - it will illustrate the whole strategy, and the kind of optimizations that are implemented, which should explain a lot of the compiler.py and codegen.py code.

    opened by spookylukey 8
  • Attributes and tags and multiline patterns should allow blank lines before them

    Attributes and tags and multiline patterns should allow blank lines before them

    Currently, none of the following messages parses correctly:

    foo =
    
    
        Mutliline Foo Value
    
    
    bar1
    
    
        .attr = Attr
    
    
    bar2
    
    
        .attr1 = Attr1
    
    
        .attr2 = Attr2
    
    
    
    bar3 =
    
    
        Multiline Bar Value
    
    
        .attr = Attr
    
    
    bar4
    
    
        .attr =
    
    
            Multiline Attr Value
    
    
    qux1 = Qux
    
    
        #tag
    
    
    qux2 = Qux
    
    
        #tag1
    
    
        #tag2
    
    opened by stasm 8
  • Never migrate partial translations

    Never migrate partial translations

    Partial translations may break the AST because they produce TextElements with None values. For now, explicitly skip any transforms which depend on at least one missing legacy string.

    In the future we might be able to allow partial migrations in some situations, like migrating a subset of attributes of a message. See https://bugzilla.mozilla.org/show_bug.cgi?id=1321271.

    opened by stasm 7
  • Documentation is out of date

    Documentation is out of date

    Edit: It appeared that the fluent.runtime I installed with pip install fluent.runtime was actually a lot older than what I expected.

    When adding messages to Fluent bundles, the documentation at https://fluent-runtime.readthedocs.io/en/latest/index.html states you can directly add the messages as a template string like so:

    >>> bundle.add_messages("""
    ... welcome = Welcome to this great app!
    ... greet-by-name = Hello, { $name }!
    ... """)
    

    In reality, you have to wrap the template string into a FluentResource and use bundle.add_resource instead of bundle.add_messages because it does not exist. The add_resource function checks if there is a body key in the resource function parameter, which is generated by the FluentResource class.

    from fluent.runtime import FluentBundle, FluentResource
    
    bundle = FluentBundle(['en-us'])
    bundle.add_resource(FluentResource("""
    welcome = Welcome!
    """))
    

    Also, bundle.format() does not exist.

    opened by alehuo 5
  • Add the Placeable node

    Add the Placeable node

    WIP. Implement https://github.com/projectfluent/fluent/pull/52.

    This doesn't pass structure tests because the AST changes, obviously. All but one behavior tests pass. I'm trying to find the bug.

    opened by stasm 5
  • Add Spans to all Nodes

    Add Spans to all Nodes

    Most AST nodes can now have a Span. Use FluentParser(with_spans=True) to enable this behavior. The with_annotations config option to FluentParser has been removed. The parser always produces Annotations if necessary now.

    opened by stasm 5
  • Bump certifi from 2020.12.5 to 2022.12.7 in /docs

    Bump certifi from 2020.12.5 to 2022.12.7 in /docs

    Bumps certifi from 2020.12.5 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Incorrect handling of tabs in message value

    Incorrect handling of tabs in message value

    As identified in https://github.com/mozilla/pontoon/issues/2470#issuecomment-1107451952, this happens:

    from fluent.syntax import ast, FluentParser, FluentSerializer
    parser = FluentParser()
    serializer = FluentSerializer()
    
    string = """places-open-in-container-tab =
        .label = Բացել նոր ներդիրում
        .accesskey =	
    """
    
    string
    'places-open-in-container-tab =\n    .label = Բացել նոր ներդիրում\n    .accesskey = \t\n'
    
    serializer.serialize(parser.parse(string))
    'places-open-in-container-tab =\n    .label = Բացել նոր ներդիրում\n    .accesskey = \n'
    

    Tabs should not be lost; they count as valid inline_text characters according to the spec.

    opened by eemeli 2
  • Bump babel from 2.9.0 to 2.9.1 in /docs

    Bump babel from 2.9.0 to 2.9.1 in /docs

    Bumps babel from 2.9.0 to 2.9.1.

    Release notes

    Sourced from babel's releases.

    Version 2.9.1

    Bugfixes

    • The internal locale-data loading functions now validate the name of the locale file to be loaded and only allow files within Babel's data directory. Thank you to Chris Lyne of Tenable, Inc. for discovering the issue!
    Changelog

    Sourced from babel's changelog.

    Version 2.9.1

    Bugfixes

    
    * The internal locale-data loading functions now validate the name of the locale file to be loaded and only
      allow files within Babel's data directory.  Thank you to Chris Lyne of Tenable, Inc. for discovering the issue!
    
    Commits
    • a99fa24 Use 2.9.0's setup.py for 2.9.1
    • 60b33e0 Become 2.9.1
    • 412015e Merge pull request #782 from python-babel/locale-basename
    • 5caf717 Disallow special filenames on Windows
    • 3a700b5 Run locale identifiers through os.path.basename()
    • 5afe2b2 Merge pull request #754 from python-babel/github-ci
    • 58de834 Replace Travis + Appveyor with GitHub Actions (WIP)
    • d1bbc08 import_cldr: use logging; add -q option
    • 156b7fb Quiesce CLDR download progress bar if requested (or not a TTY)
    • 613dc17 Make the import warnings about unsupported number systems less verbose
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Cannot read string beyond 1000 characters

    Cannot read string beyond 1000 characters

    When trying to access a string with the format_value() method, it returns the string normally given it's a relatively short string. But if a string longer than 73 lines is entered, it returns {???} instead of said string. PFA test case which will help reproduce the bug here.

    bug help wanted fluent.runtime 
    opened by GetPsyched 1
  • FluentLocalization swallows errors

    FluentLocalization swallows errors

    fluent_value does not provide a way to retrieve errors produced out of bundle - https://github.com/projectfluent/python-fluent/blob/c58681f1e90c14dd36c2ff35d7d487235b685177/fluent.runtime/fluent/runtime/fallback.py#L37

    This makes it really hard to debug them for the user :)

    bug help wanted fluent.runtime 
    opened by zbraniecki 0
  • [email protected](Sep 15, 2020)

    • Fix serialization of multiline patterns starting with special characters. (#156)

      The built-in behavior of FluentSerializer is to serialize multiline patterns starting on a new line:

      key =
          Foo
          Bar
      

      This used to lead to syntax errors if the pattern started with one of the special characters in the Fluent Syntax: a curly brace, a period, an asterisk, or a square bracket, and if it was originally written with the first line on the same line as the identifier:

      key = *Foo
          Bar
      

      Such a pattern must not be serialized as following, because the asterisk has a special meaning if placed at the beginning of a line.

      # Syntax Error
      key =
          *Foo
          Bar
      

      The fix preserves the original layout of the pattern, i.e. it is now serialized starting inline with the identifier

    Source code(tar.gz)
    Source code(zip)
  • [email protected](May 20, 2020)

    • Documentation is now on https://projectfluent.org/python-fluent/fluent.syntax/.
    • Removal of deprecated BaseNode.traverse method.
    • Refactor Visitor and Transformer into fluent.syntax.visitor (from .ast)
    Source code(tar.gz)
    Source code(zip)
  • [email protected](May 20, 2020)

  • [email protected](May 20, 2020)

  • [email protected](Oct 23, 2019)

    • Added fluent.runtime.FluentResource and fluent.runtime.FluentBundle.add_resource.
    • Removed fluent.runtime.FluentBundle.add_messages.
    • Replaced bundle.format() with bundle.format_pattern(bundle.get_message().value).
    • Added fluent.runtime.FluentLocalization as main entrypoint for applications.
    Source code(tar.gz)
    Source code(zip)
  • [email protected](Sep 10, 2019)

  • [email protected](Sep 10, 2019)

    • Release a version with compatibility with the latest fluent.syntax 0.17.0.
    • First release with Fluent Syntax 1.0
    • Next release should revise APIs to be aligned with other implementations.
    Source code(tar.gz)
    Source code(zip)
  • [email protected](Aug 15, 2019)

    Initial release of fluent.pygments.

    Use this module to add syntax highlighting to documentation written in Sphinx and other tools that use pygments underneath.

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Aug 6, 2019)

  • [email protected](Aug 1, 2019)

  • [email protected](Apr 17, 2019)

  • [email protected](Mar 26, 2019)

    This release of fluent.syntax brings support for version 0.9 of the Fluent Syntax spec. The API remains unchanged. Files written in valid Syntax 0.8 may parse differently in this release. See the compatibility note below. Consult the full Syntax 0.9 changelog for details.

    • Flatten complex reference expressions.

      Reference expressions which may take complex forms, such as a reference to a message's attribute, or a parameterized reference to an attribute of a term, are now stored in a simplified manner. Instead of nesting multiple expression nodes (e.g. CallExpression of an AttributeExpression of a TermReference), all information is available directly in the reference expression.

      This change affects the following AST nodes:

      • MessageReference now has an optional attribute field,
      • FunctionReference now has a required arguments field,
      • TermReference now has an optional attribute field and an optional arguments field.
    • Remove VariantLists.

      The VariantLists and the VariantExpression syntax and AST nodes were deprecated in Syntax 0.9 and have now been removed.

    • Rename StringLiteral.raw to value.

      StringLiteral.value contains the exact contents of the string literal, character-for-character. Escape sequences are stored verbatim without processing. A new method, Literal.parse, can be used to process the raw value of the literal into an unescaped form.

    • Rename args to arguments.

      The args field of MessageReference, TermReference, FunctionReference, and Annotation has been renamed to arguments.

    Backward-incompatible changes:

    • VariantLists are no longer valid syntax. A syntax error is reported when a VariantList or a VariantExpression is found in the parsed file
    Source code(tar.gz)
    Source code(zip)
  • [email protected](Mar 25, 2019)

    • Make BaseNode.equals stricter when comparing lists.

      Starting from this version, BaseNode.equals now takes the order of variants and attributes into account when comparing two nodes.

    • Remove FluentSerializer.serialize_expression.

      The stateless equivalent can still be imported from fluent.syntax.serializer:

      from fluent.syntax.serializer import serialize_expression
      
    Source code(tar.gz)
    Source code(zip)
  • [email protected](Feb 15, 2019)

    • Fixes to the Visitor API

      The Visitor API introduced in 0.11 was changed to align more with what Python's ast.Visitor does. This also allows implementations to have code after descending into child nodes.

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Feb 14, 2019)

    • API enhancements

      There are two new APIs in fluent.syntax.ast, Visitor and Transformer. Use these APIs for read-only iteration over AST trees, and in-place mutation of AST trees, respectively. There's also a new method BaseNode.clone, which can be used to create a deep copy of an AST node.

    • DEPRECATIONS

      The API BaseNode.traverse is deprecated and will be removed in a future release. Please adjust your code to the Visitor or Transformer APIs.

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Jan 21, 2019)

    First release to PyPI of fluent.runtime. This release contains a FluentBundle implementation that can generate transaltions from FTL spec. It targets the Fluent 0.6 spec.

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Jan 15, 2019)

    The fluent package which used to provide the fluent.syntax module has been renamed to fluent.syntax on PyPI. The code is identical to fluent 0.10.

    Source code(tar.gz)
    Source code(zip)
  • 0.10.0(Dec 13, 2018)

    This release brings support for version 0.8 of the Fluent Syntax spec. The API remains unchanged. Files written in valid Syntax 0.7 may not parse correctly in this release. See the summary of backwards-incompatible changes below.

    • Implement Fluent Syntax 0.8. (#303)

      This is only a quick summary of the spec changes in Syntax 0.8. Consult the full changelog for details.

      In multiline Patterns, all common indent is now removed from each indented line in the final value of the pattern.

      multiline =
          This message has 2 spaces of indent
            on the second line of its value.
      

      Terms can now be parameterized via the call expression syntax.

      # A parametrized Term with a Pattern as a value.
      -thing = { $article ->
         *[definite] the thing
          [indefinite] a thing
      }
      
      this = This is { -thing(article: "indefinite") }.
      

      VariantLists are now deprecated and will be removed from the Syntax before version 1.0.

      All escapes sequences can only be used in StringLiterals now (see below). \UHHHHHH is a new escape sequence format suitable for codepoints above U+FFFF, e.g. {"\U01F602"}.

    Backward-incompatible changes:

    • The backslash character (\) is now considered a regular character in TextElements. It's no longer possible to use escape sequences in TextElements. Please use StringLiterals instead, e.g. {"\u00A0"}.
    • The closing curly brace character (}) is not allowed in TextElements now. Please use StringLiterals instead: {"}"}.
    • StringLiteral.value was changed to store the unescaped ("cooked") value. StringLiteral.raw has been added to store the raw value.
    • The AST of CallExpressions was changed to better accommodate the introduction of parameterized Terms. The Function AST node has been replaced by the FunctionReference node.
    • The leading dash (-) is no longer part of the Identifier node in Terms and TermReferences.
    Source code(tar.gz)
    Source code(zip)
  • 0.9.0(Oct 23, 2018)

    This release brings support for version 0.7 of the Fluent Syntax spec. The API remains unchanged. Files written in valid Syntax 0.6 may not parse correctly in this release. See the summary of backwards-incompatible changes below.

    • Implement Fluent Syntax 0.7. (#287)

      The major new feature of Syntax 0.7 is the relaxation of the indentation requirement for all non-text elements of patterns. It's finally possible to leave the closing brace of select expressions unindented:

      emails = { $unread_email_count ->
          [one] You have one unread email.
         *[other] You have { $unread_email_count } unread emails.
      }
      

      Consult the changelog to learn about other changes in Syntax 0.7.

    Backward-incompatible changes:

    • Variant keys can now be either NumberLiterals (as previously) or Identifiers. The VariantName node class has been removed. Variant keys with spaces in them produce syntax errors, e.g. [New York].
    • CR is not a valid EOL character anymore. Please use LF or CRLF.
    • Tab is not recognized as syntax whitespace. It can only be used in translation content.
    Source code(tar.gz)
    Source code(zip)
  • 0.8.0(Jul 24, 2018)

    • Implement support for Fluent Syntax 0.6. (#69)

      Syntax 0.6 keeps the syntax unchanged but makes many changes to the AST. Consult https://github.com/projectfluent/fluent/releases/tag/v0.6.0 for the list of changes.

    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Apr 11, 2018)

    • Remove fluent.migrate.

      The migration code has been moved into its own repository: fluent-migration. See bug 1445881 for more information about the move.

    • Add the ref field to VariantExpression. (#62)

      The Identifier-typed id field has been removed. The new ref field contains the MessageReference node rigt now. The range of valid expressions for ref may be extended in the future.

    • Fix missing Spans on Function nodes.

    Source code(tar.gz)
    Source code(zip)
  • 0.6.4(Mar 1, 2018)

    • use compare-locales for plurals ordering (bug 1415844)
    • create transforms when all dependencies have been met up to a changeset
    • support variant keys in BaseNode.equals
    • serialize select expressions on a new line
    Source code(tar.gz)
    Source code(zip)
  • 0.6.3(Feb 13, 2018)

  • 0.6.2(Feb 8, 2018)

    • Inline Patterns may start with any character. (#48)

      }, ., * and [ are only special when they appear at the beginning of indented Pattern lines. When a Pattern starts on the same line as id = or [variant key], its first character doesn't carry any special meaning and it may be one of those four ones as well.

      This also fixes a regression from 0.6.0 where a message at the EOF without value nor attributes was incorrectly parsed as a message with an empty Pattern rather than produce a syntax error.

    • Require compare-locales to run and test fluent.migrate. (#47)

    Source code(tar.gz)
    Source code(zip)
  • 0.6.1(Feb 6, 2018)

    Various fixes to fluent.migrate for bug 1424682.

    • Accept Patterns and PatternElements in REPLACE. (#41)

      REPLACE can now use Patterns, PatternElements and Expressions as replacement values. This makes REPLACE accept the same Transforms as CONCAT.

    • Never migrate partial translations. (#44)

      Partial translations may break the AST because they produce TextElements with None values. For now, we explicitly skip any transforms which depend on at least one missing legacy string to avoid serialization errors.

    • Warn about unknown FTL entries in transforms. (#40)

    • Fix how files are passed to hg annotate. (#39)

    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Jan 31, 2018)

    • Implement Fluent Syntax 0.5.

      • Add support for terms.
      • Add support for #, ## and ### comments.
      • Remove support for tags.
      • Add support for = after the identifier in message and term defintions.
      • Forbid newlines in string expressions.
      • Allow trailing comma in call expression argument lists.

      In fluent-syntax 0.6.x the new Syntax 0.5 is supported alongside the old Syntax 0.4. This should make migrations easier.

      FluentParser will correctly parse Syntax 0.4 comments (prefixed with //), sections and message definitions without the = after the identifier. The one exception are tags which are no longer supported. Please use attributed defined on terms instead.

      FluentSerializer always serializes using the new Syntax 0.5.

    • Expose FluentSerializer.serializeExpression. (#134)

    • Fix Bug 1428000 - Migrate: only annotate affected files (#34)

    Source code(tar.gz)
    Source code(zip)
  • 0.4.4(Nov 29, 2017)

    • Run Structure and Behavior tests in Python 3 (#22)

    • Bug 1411943 - Fix Blame for Mercurial 4.3+ (#23)

    • Bug 1412808 - Remove the LITERAL helper. (#25)

    • Bug 1321279 - Read target FTL files before migrations. (#24)

      The reference file for the transforms must now be passed as the second argument to add_transforms.

    • Bug 1318960 - Migrate files only when their messages change (#26)

    • Bug 1366298 - Skip SelectExpression in PLURALS for one plural category (#27)

    • Bug 1321290 - Migrate HTML entities to Unicode characters (#28)

    • Bug 1420225 - Read legacy files when scanning for Sources in transforms (#30)

      MergeContext.maybe_add_localization is now automatically called internally when the context encounters a transforms which is a subclass of Source.

    Source code(tar.gz)
    Source code(zip)
  • 0.4.3(Nov 29, 2017)

    • Bug 1397234 - Allow blank lines before attributes, tags and multiline patterns
    • Bug 1406342 - Trim trailing newline in Comment and Section spans
    Source code(tar.gz)
    Source code(zip)
  • 0.4.2(Nov 29, 2017)

    • Add an intermediate Placeable node for Expressions within Patterns.

      This allows storing more precise information about the whitespace around the placeable's braces.

      See https://github.com/projectfluent/fluent/pull/52.

    • Serializer: Add newlines around standalone comments.

    Source code(tar.gz)
    Source code(zip)
  • 0.4.1(Nov 29, 2017)

    • Add BaseNode.equals for deep-equality testing.

      Nodes are deeply compared on a field by field basis. If possible, False is returned early. When comparing attributes, tags and variants in SelectExpressions, the order doesn't matter. By default, spans are not taken into account. Other fields may also be ignored if necessary:

      message1.equals(message2, ignored_fields=['comment', 'span'])
      
    Source code(tar.gz)
    Source code(zip)
Owner
Project Fluent
A localization paradigm designed to unleash the entire expressive power of natural language translations.
Project Fluent
Active learning for Mask R-CNN in Detectron2

MaskAL - Active learning for Mask R-CNN in Detectron2 Summary MaskAL is an active learning framework that automatically selects the most-informative i

49 Dec 20, 2022
Computer Vision and Pattern Recognition, NUS CS4243, 2022

CS4243_2022 Computer Vision and Pattern Recognition, NUS CS4243, 2022 Cloud Machine #1 : Google Colab (Free GPU) Follow this Notebook installation : h

Xavier Bresson 142 Dec 15, 2022
QuadTree Attention for Vision Transformers (ICLR2022)

This repository contains codes for quadtree attention. This repo contains codes for feature matching, image classficiation, object detection and seman

tangshitao 222 Dec 28, 2022
Image Fusion Transformer

Image-Fusion-Transformer Platform Python 3.7 Pytorch =1.0 Training Dataset MS-COCO 2014 (T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ram

Vibashan VS 68 Dec 23, 2022
NeRD: Neural Reflectance Decomposition from Image Collections

NeRD: Neural Reflectance Decomposition from Image Collections Project Page | Video | Paper | Dataset Implementation for NeRD. A novel method which dec

Computergraphics (University of Tübingen) 195 Dec 29, 2022
La source de mon module 'pyfade' disponible sur Pypi.

Version: 1.2 Introduction Pyfade est un module permettant de créer des dégradés colorés. Il vous permettra de changer chaque ligne de votre texte par

Billy 20 Sep 12, 2021
Binary Stochastic Neurons in PyTorch

Binary Stochastic Neurons in PyTorch http://r2rt.com/binary-stochastic-neurons-in-tensorflow.html https://github.com/pytorch/examples/tree/master/mnis

Onur Kaplan 54 Nov 21, 2022
This repository contains the code for the ICCV 2019 paper "Occupancy Flow - 4D Reconstruction by Learning Particle Dynamics"

Occupancy Flow This repository contains the code for the project Occupancy Flow - 4D Reconstruction by Learning Particle Dynamics. You can find detail

189 Dec 29, 2022
Code for our paper 'Generalized Category Discovery'

Generalized Category Discovery This repo is a placeholder for code for our paper: Generalized Category Discovery Abstract: In this paper, we consider

107 Dec 28, 2022
Pytorch implementations of popular off-policy multi-agent reinforcement learning algorithms, including QMix, VDN, MADDPG, and MATD3.

Off-Policy Multi-Agent Reinforcement Learning (MARL) Algorithms This repository contains implementations of various off-policy multi-agent reinforceme

183 Dec 28, 2022
An implementation of the [Hierarchical (Sig-Wasserstein) GAN] algorithm for large dimensional Time Series Generation

Hierarchical GAN for large dimensional financial market data Implementation This repository is an implementation of the [Hierarchical (Sig-Wasserstein

11 Nov 29, 2022
A library for preparing, training, and evaluating scalable deep learning hybrid recommender systems using PyTorch.

collie_recs Collie is a library for preparing, training, and evaluating implicit deep learning hybrid recommender systems, named after the Border Coll

ShopRunner 97 Jan 03, 2023
Code for "Adversarial Attack Generation Empowered by Min-Max Optimization", NeurIPS 2021

Min-Max Adversarial Attacks [Paper] [arXiv] [Video] [Slide] Adversarial Attack Generation Empowered by Min-Max Optimization Jingkang Wang, Tianyun Zha

Jingkang Wang 12 Nov 23, 2022
Unofficial PyTorch implementation of Fastformer based on paper "Fastformer: Additive Attention Can Be All You Need"."

Fastformer-PyTorch Unofficial PyTorch implementation of Fastformer based on paper Fastformer: Additive Attention Can Be All You Need. Usage : import t

Hong-Jia Chen 126 Dec 06, 2022
Covid-19 Test AI (Deep Learning - NNs) Software. Accuracy is the %96.5, loss is the 0.09 :)

Covid-19 Test AI (Deep Learning - NNs) Software I developed a segmentation algorithm to understand whether Covid-19 Test Photos are positive or negati

Emirhan BULUT 28 Dec 04, 2021
Driller: augmenting AFL with symbolic execution!

Driller Driller is an implementation of the driller paper. This implementation was built on top of AFL with angr being used as a symbolic tracer. Dril

Shellphish 791 Jan 06, 2023
Project looking into use of autoencoder for semi-supervised learning and comparing data requirements compared to supervised learning.

Project looking into use of autoencoder for semi-supervised learning and comparing data requirements compared to supervised learning.

Tom-R.T.Kvalvaag 2 Dec 17, 2021
A coin flip game in which you can put the amount of money below or equal to 1000 and then choose heads or tail

COIN_FLIPPY ##This is a simple example package. You can use Github-flavored Markdown to write your content. Coinflippy A coin flip game in which you c

2 Dec 26, 2021
graph-theoretic framework for robust pairwise data association

CLIPPER: A Graph-Theoretic Framework for Robust Data Association Data association is a fundamental problem in robotics and autonomy. CLIPPER provides

MIT Aerospace Controls Laboratory 118 Dec 28, 2022
DataCLUE: 国内首个以数据为中心的AI测评(含模型分析报告)

DataCLUE: A Benchmark Suite for Data-centric NLP You can get the english version of README. 以数据为中心的AI测评(DataCLUE) 内容导引 章节 描述 简介 介绍以数据为中心的AI测评(DataCLUE

CLUE benchmark 135 Dec 22, 2022