• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Language函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Language函数的典型用法代码示例。如果您正苦于以下问题:C++ Language函数的具体用法?C++ Language怎么用?C++ Language使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Language函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: left

    DataFrameJoinVisitors::DataFrameJoinVisitors(const Rcpp::DataFrame& left_, const Rcpp::DataFrame& right_, Rcpp::CharacterVector names_left, Rcpp::CharacterVector names_right, bool warn_ ) :
        left(left_), right(right_),
        visitor_names_left(names_left),
        visitor_names_right(names_right),
        nvisitors(names_left.size()),
        visitors(nvisitors),
        warn(warn_)
    {
        std::string name_left, name_right ;

        IntegerVector indices_left  = Language( "match", names_left,  RCPP_GET_NAMES(left)  ).fast_eval() ;
        IntegerVector indices_right = Language( "match", names_right, RCPP_GET_NAMES(right) ).fast_eval() ;

        for( int i=0; i<nvisitors; i++){
            name_left  = names_left[i] ;
            name_right = names_right[i] ;

            if( indices_left[i] == NA_INTEGER ){
              stop( "'%s' column not found in lhs, cannot join" ) ;
            }
            if( indices_right[i] == NA_INTEGER ){
              stop( "'%s' column not found in rhs, cannot join" ) ;
            }

            visitors[i] = join_visitor( left[indices_left[i]-1], right[indices_right[i]-1], name_left, name_right, warn ) ;

        }
    }
开发者ID:ahtealeb,项目名称:dplyr,代码行数:28,代码来源:api.cpp


示例2: tr

// This routine called before any translations loaded, so strings must be translated explicitly.
void Settings::makeDefault ()
{
    _regionID = "1";            // Default city

    _cities["1"] = tr ("Moscow");
    _cities["10174"] = tr ("St.Petersburg");
    _cities["20544"] = tr ("Kiev");
    _cities["11162"] = tr ("Ekaterinburg");

    setCheck (C_ShowLight, true);
    setCheck (C_ShowRank, true);
    setCheck (C_ShowHint, true);

    setCheck (C_UpdateOnWiFi, true);

    setCheck (C_UpdateWhenLocked, true);

    _updateIntervalIndex = 3;

    // languages
    _langs.append (Language (QString (""),   tr ("System")));
    _langs.append (Language (QString ("en"), tr ("English")));
    _langs.append (Language (QString ("ru"), tr ("Russian")));
    setLanguageIndex (0);
}
开发者ID:Shmuma,项目名称:yandex-traffic-widget,代码行数:26,代码来源:settings.cpp


示例3: MakeNotMember

void Channel::Say(ObjectGuid guid, std::string const& what, uint32 lang)
{
    if (what.empty())
        return;

    // TODO: Add proper RBAC check
    if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
        lang = LANG_UNIVERSAL;

    if (!IsOn(guid))
    {
        WorldPacket data;
        MakeNotMember(&data);
        SendToOne(&data, guid);
        return;
    }

    if (playersStore[guid].IsMuted())
    {
        WorldPacket data;
        MakeMuted(&data);
        SendToOne(&data, guid);
        return;
    }

    WorldPacket data;
    if (Player* player = ObjectAccessor::FindPlayer(guid))
        ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), player, player, what, 0, _name);
    else
        ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), guid, guid, what, 0, "", "", 0, false, _name);

    SendToAll(&data, !playersStore[guid].IsModerator() ? guid : ObjectGuid::Empty);
}
开发者ID:AllThing,项目名称:TrinityCore,代码行数:33,代码来源:Channel.cpp


示例4: Language

Language Language::TryParse(const std::wstring& s)
{
    if (IsValidCode(s))
        return Language(s);

    // Is it a standard language code?
    if (std::regex_match(s, RE_LANG_CODE_PERMISSIVE))
    {
        std::wstring s2(s);
        TryNormalize(s2);
        if (IsValidCode(s2))
            return Language(s2);
    }

    // If not, perhaps it's a human-readable name (perhaps coming from the language control)?
    auto names = GetDisplayNamesData();
    icu::UnicodeString s_icu = ToIcuStr(s);
    s_icu.foldCase();
    std::wstring folded = StdFromIcuStr(s_icu);
    auto i = names.names.find(folded);
    if (i != names.names.end())
        return Language(i->second);

    // Maybe it was in English?
    i = names.namesEng.find(folded);
    if (i != names.namesEng.end())
        return Language(i->second);

    return Language(); // invalid
}
开发者ID:mfloryan,项目名称:poedit,代码行数:30,代码来源:language.cpp


示例5: Choose_Mailbox

void Choose_Mailbox(char *Option)
{
    char    *temp;

    if (HasNoEmail())
	return;

    if (strlen(Option)) {
	if (!strcmp(Option, "M+")) {
	    if (!strcmp(sMailbox, "mailbox"))
		SetEmailArea((char *)"archive");
	    else if (!strcmp(sMailbox, "archive"))
		SetEmailArea((char *)"trash");
	    else if (!strcmp(sMailbox, "trash"))
		SetEmailArea((char *)"mailbox");
	}
	if (!strcmp(Option, "M-")) {
	    if (!strcmp(sMailbox, "mailbox"))
		SetEmailArea((char *)"trash");
	    else if (!strcmp(sMailbox, "trash"))
		SetEmailArea((char *)"archive");
	    else if (!strcmp(sMailbox, "archive"));
		SetEmailArea((char *)"mailbox");
	}
	Syslog('+', "Emailarea: %s", sMailbox);
	return;
    }

    clear();
    Enter(1);
    /*  Message areas  */
    pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(231));
    Enter(2);

    pout(WHITE, BLACK, (char *)"    1"); pout(LIGHTBLUE, BLACK, (char *)" . "); pout(CYAN, BLACK, (char *) Language(467)); Enter(1);
    pout(WHITE, BLACK, (char *)"    2"); pout(LIGHTBLUE, BLACK, (char *)" . "); pout(CYAN, BLACK, (char *) Language(468)); Enter(1);
    pout(WHITE, BLACK, (char *)"    3"); pout(LIGHTBLUE, BLACK, (char *)" . "); pout(CYAN, BLACK, (char *) Language(469)); Enter(1);

    pout(CFG.MoreF, CFG.MoreB, (char *) Language(470));
    colour(CFG.InputColourF, CFG.InputColourB);
    temp = calloc(81, sizeof(char));
    GetstrC(temp, 7);

    switch (atoi(temp)) {
	case 1:	SetEmailArea((char *)"mailbox");
		break;
	case 2: SetEmailArea((char *)"archive");
		break;
	case 3: SetEmailArea((char *)"trash");
		break;
    }

    Syslog('+', "Emailarea: %s", sMailbox);
    free(temp);
}
开发者ID:bbs-io,项目名称:mbse,代码行数:55,代码来源:email.c


示例6: data

    CharacterVectorOrderer::CharacterVectorOrderer( const CharacterVector& data_ ) :
        data(data_),
        set(),
        orders(no_init(data.size()))
    {
        int n = data.size() ;
        if( n == 0 ) return ;

        // 1 - gather unique SEXP pointers from data
        SEXP* p_data = Rcpp::internal::r_vector_start<STRSXP>(data);
        SEXP previous = *p_data++ ;
        set.insert( previous ) ;
        for( int i=1; i<n; i++, p_data++){
            SEXP s = *p_data ;

            // we've just seen this string, keep going
            if( s == previous ) continue ;

            // is this string in the set already
            set.insert(s) ;
            previous = s ;
        }

        // retrieve unique strings from the set
        int n_uniques = set.size() ;
        CharacterVector uniques( set.begin(), set.end() ) ;
        CharacterVector s_uniques = Language( "sort", uniques ).fast_eval() ;

        // order the uniques with a callback to R
        IntegerVector o = Language( "match", uniques, s_uniques ).fast_eval() ;

        // combine uniques and o into a hash map for fast retrieval
        dplyr_hash_map<SEXP,int> map ;
        for( int i=0; i<n_uniques; i++){
            map.insert( std::make_pair(uniques[i], o[i] ) ) ;
        }

        // grab min ranks
        p_data = Rcpp::internal::r_vector_start<STRSXP>(data);
        previous = *p_data++ ;

        int o_pos ;
        orders[0] = o_pos = map.find(previous)->second ;

        for( int i=1; i<n; i++, p_data++){
            SEXP s = *p_data;
            if( s == previous ) {
                orders[i] = o_pos ;
                continue ;
            }
            previous = s ;
            orders[i] = o_pos = map.find(s)->second ;
        }

    }
开发者ID:Aprilara,项目名称:dplyr,代码行数:55,代码来源:api.cpp


示例7: QuickScan_Email

void QuickScan_Email(void)
{
    int     FoundMsg  = FALSE;
    int	    i;
    char    temp[81];

    iLineCount = 2;
    WhosDoingWhat(READ_POST, NULL);

    if (EmailBase.Total == 0) {
	Enter(1);
	/* There are no messages in this area. */
	pout(WHITE, BLACK, (char *) Language(205));
	Enter(2);
	sleep(3);
	return;
    }

    clear(); 
    /* #    From                  To                       Subject */
    poutCR(YELLOW, BLUE, (char *) Language(220));

    if (Msg_Open(sMailpath)) {
	for (i = EmailBase.Lowest; i <= EmailBase.Highest; i++) {
	    if (Msg_ReadHeader(i)) {
                                
		snprintf(temp, 81, "%-6u", Msg.Id);
		pout(WHITE, BLACK, temp);
		snprintf(temp, 81, "%s ", padleft(Msg.From, 20, ' '));
		pout(CYAN, BLACK, temp);

		snprintf(temp, 81, "%s ", padleft(Msg.To, 20, ' '));
		pout(GREEN, BLACK, temp);
		snprintf(temp, 81, "%s", padleft(Msg.Subject, 31, ' '));
		pout(MAGENTA, BLACK, temp);
		Enter(1);
		FoundMsg = TRUE;
		if (LC(1))
		    break;
	    }
	}
	Msg_Close();
    }

    if(!FoundMsg) {
	Enter(1);
	/* There are no messages in this area. */
	pout(LIGHTGREEN, BLACK, (char *) Language(205));
	Enter(2);
	sleep(3);
    }

    iLineCount = 2;
    Pause();
}
开发者ID:bbs-io,项目名称:mbse,代码行数:55,代码来源:email.c


示例8: assert

    void
    CapabilityContainer::init( vector<Capability*> const & vecCap, TypeSystem const & typeSystem, EnMatchPolicy enMatchPolicy ) {
      iv_enMatchPolicy = enMatchPolicy;
      vector<Capability*>::const_iterator it;
      assert(iv_mapLang2InputTypesOrFeatures.size() == 0);
      assert(iv_mapLang2OutputTypesOrFeatures.size() == 0);
      for (it = vecCap.begin(); it != vecCap.end(); ++it) {
        assert(EXISTS(*it));
        Capability const & cap = (*(*it));
        initTypeOrFeatures(
          iv_mapLang2InputTypesOrFeatures,
          cap.getCapabilityTypes(Capability::INPUT),
          cap.getSupportedLanguages(),
          typeSystem);
        initTypeOrFeatures(
          iv_mapLang2InputTypesOrFeatures,
          cap.getCapabilityFeatures(Capability::INPUT),
          cap.getSupportedLanguages(),
          typeSystem);
        initTypeOrFeatures(
          iv_mapLang2OutputTypesOrFeatures,
          cap.getCapabilityTypes(Capability::OUTPUT),
          cap.getSupportedLanguages(),
          typeSystem);
        initTypeOrFeatures(
          iv_mapLang2OutputTypesOrFeatures,
          cap.getCapabilityFeatures(Capability::OUTPUT),
          cap.getSupportedLanguages(),
          typeSystem);
      }

      // try to find input tofs for unspecifed language
      assert(iv_psetInputTOFsForUnspecifiedLang == NULL);
      TySetTypeOrFeatures const * pSetInputTOFs =
        findInputTOFs(Language(Language::UNSPECIFIED));
      if (pSetInputTOFs != NULL) {
        iv_psetInputTOFsForUnspecifiedLang = pSetInputTOFs;
      }
      // try to find output tofs for unspecifed language
      assert(iv_psetOutputTOFsForUnspecifiedLang == NULL);
      TySetTypeOrFeatures const * pSetOutputTOFs =
        findOutputTOFs(Language(Language::UNSPECIFIED));
      if (pSetOutputTOFs != NULL) {
        iv_psetOutputTOFsForUnspecifiedLang = pSetOutputTOFs;
      }

      copyEntriesForUnspecifedLanguage();
      if (hasEmptyOutputTypeOrFeatures(Language(Language::UNSPECIFIED))) {
        iv_bHasEmptyOutputTOFsForUnspecifiedLang = true;
      }

      computeClosure(iv_mapLang2OutputTypesOrFeatures, iv_mapLang2OutputTypesOrFeaturesNoTerritory );
      computeClosure(iv_mapLang2InputTypesOrFeatures, iv_mapLang2InputTypesOrFeaturesNoTerritory );
    }
开发者ID:mathtexts,项目名称:uimacpp,代码行数:54,代码来源:internal_capability_container.cpp


示例9: MakeNotMember

void Channel::Say(uint64 guid, std::string const& what, uint32 lang)
{
    if (what.empty())
        return;

    if (!IsOn(guid))
    {
        WorldPacket data;
        MakeNotMember(&data);
        SendToOne(&data, guid);
        return;
    }

    PlayerInfo& pinfo = playersStore[guid];

    if (pinfo.IsMuted())
    {
        WorldPacket data;
        MakeMuted(&data);
        SendToOne(&data, guid);
        return;
    }

    Player* player = pinfo.plrPtr;

    if (player && !player->GetSession()->GetSecurity()) // pussywizard: prevent spam on populated channels
    {
        uint32 speakDelay = 0;
        if (_channelRights.speakDelay > 0)
            speakDelay = _channelRights.speakDelay;
        else if (playersStore.size() >= 10)
            speakDelay = 5;

        if (!pinfo.IsAllowedToSpeak(speakDelay))
        {
            std::string timeStr = secsToTimeString(pinfo.lastSpeakTime + speakDelay - sWorld->GetGameTime());
            if (_channelRights.speakMessage.length() > 0)
                player->GetSession()->SendNotification(_channelRights.speakMessage.c_str());
            player->GetSession()->SendNotification("You must wait %s before speaking again.", timeStr.c_str());
            return;
        }
    }

    WorldPacket data;
    if (player)
        ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), player, player, what, 0, _name);
    else
        ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), guid, guid, what, 0, "", "", 0, false, _name);

    SendToAll(&data, pinfo.IsModerator() ? 0 : guid);
}
开发者ID:Keader,项目名称:Sunwell,代码行数:51,代码来源:Channel.cpp


示例10: Language

Language LanguageListModel::get(int index) const
{
    if (index < 0 || index >= m_languages.count())
        return Language();

    return m_languages.at(index);
}
开发者ID:trajkopetko,项目名称:taot,代码行数:7,代码来源:languagelistmodel.cpp


示例11: operator

 WorldPackets::Chat::Chat* operator()(LocaleConstant locale) const
 {
     std::string const& text = sCreatureTextMgr->GetLocalizedChatString(_source->GetEntry(), _gender, _textGroup, _textId, locale);
     WorldPackets::Chat::Chat* chat = new WorldPackets::Chat::Chat();
     chat->Initialize(_msgType, Language(_language), _talker, _target, text, 0, "", locale);
     return chat;
 }
开发者ID:DSlayerMan,项目名称:DraenorCore,代码行数:7,代码来源:CreatureTextMgr.cpp


示例12: check_attribute_compatibility

void check_attribute_compatibility(SEXP left, SEXP right) {
  SEXP att_left  = ATTRIB(left);
  SEXP att_right = ATTRIB(right);
  int n_left = count_attributes(att_left);
  int n_right = count_attributes(att_right);
  
  if (Rf_inherits(left, "POSIXct") &&  Rf_inherits(right, "POSIXct")) {
    return;
  }

  if (n_left != n_right)
    stop("attributes of different sizes");

  List list_left(n_left), list_right(n_left);

  SEXP p_left = att_left;
  int i = 0;
  while (!Rf_isNull(p_left)) {
    SEXP name = TAG(p_left);
    if (name != R_NamesSymbol && name != R_DimSymbol) {
      list_left[i]  = CAR(p_left);
      list_right[i] = grab_attribute(name, att_right);
    }
    p_left = CDR(p_left);
  }
  RObject test = Language("all.equal", list_left, list_right).fast_eval();
  if (!is<bool>(test) || !as<bool>(test)) {
    stop("attributes are different");
  }
}
开发者ID:jayhesselberth,项目名称:dplyr,代码行数:30,代码来源:join.cpp


示例13: SetupEPGDumpLanguage

void SetupEPGDumpLanguage( void* Handle, unsigned long lLanguageCode )
{
	REMUXER *pRemuxer = (REMUXER *)Handle;
	if ( pRemuxer->demuxer->ts_parser )
		SetupTSEPGDumpLanguage( pRemuxer->demuxer->ts_parser, lLanguageCode );
	SageLog(( _LOG_ERROR, 3, TEXT("Set default EPG language \"%s\"."), Language(lLanguageCode, NULL )  ));
}
开发者ID:neurocis,项目名称:sagetv,代码行数:7,代码来源:Remuxer.c


示例14: window

Main::Main(sf::RenderWindow & window) : window(window)
{
	playingGame = true;
	
	/*
	Create the language variable (default: American English)
	*/
	l = Language("en-US");

	/*
	Load options from Options.txt
	Current things the program is looking for:
		openFile;
		language	=	[ja-JP]
	*/
	KFile options(sf::String(RESOURCES + "Options.txt"));
	wstring w;
	options.readLine(w);
	l = Language(StringEditor::substring(w, StringEditor::findCharacter(w, L'=', 1) + 1, w.length()));

	/*
	Instantiate the font based off of the game language
	English users don't need the Japanese character set loaded (saves space)
	*/
	font = KText(l);

	/*
	Sets the game state; the final version of the game should have this set to logo screen,
	then goes to the main menu
	*/
	gs = GameState::MAIN_MENU;

	/*
	Loads the game modes.
	Only one variable should be loaded at one point, so we need to figure out how to unload modes
	when you aren't using them. Ie, single player and multiplayer shouldn't be loaded on the stack
	(I don't think I am using that term correctly)
	*/
	mainMenu = MainMenu(l);

	/*
	Create a black background
	*/
	bg.setSize(sf::Vector2f((float)INT_MAX, (float)INT_MAX));
	bg.setFillColor(sf::Color::Black);
	bg.setPosition(sf::Vector2f((float)(INT_MIN / 2), (float)(INT_MIN / 2)));
}
开发者ID:Poindexter-Games,项目名称:Javamon,代码行数:47,代码来源:Main.cpp


示例15: builder

void Channel::Say(ObjectGuid const& guid, std::string const& what, uint32 lang) const
{
    if (what.empty())
        return;

    // TODO: Add proper RBAC check
    if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
        lang = LANG_UNIVERSAL;

    if (!IsOn(guid))
    {
        NotMemberAppend appender;
        ChannelNameBuilder<NotMemberAppend> builder(this, appender);
        SendToOne(builder, guid);
        return;
    }

    PlayerInfo const& playerInfo = _playersStore.at(guid);
    if (playerInfo.IsMuted())
    {
        MutedAppend appender;
        ChannelNameBuilder<MutedAppend> builder(this, appender);
        SendToOne(builder, guid);
        return;
    }

    auto builder = [&](LocaleConstant locale)
    {
        LocaleConstant localeIdx = sWorld->GetAvailableDbcLocale(locale);

        WorldPackets::Chat::Chat* packet = new WorldPackets::Chat::Chat();
        if (Player* player = ObjectAccessor::FindConnectedPlayer(guid))
            packet->Initialize(CHAT_MSG_CHANNEL, Language(lang), player, player, what, 0, GetName(localeIdx));
        else
        {
            packet->Initialize(CHAT_MSG_CHANNEL, Language(lang), nullptr, nullptr, what, 0, GetName(localeIdx));
            packet->SenderGUID = guid;
            packet->TargetGUID = guid;
        }

        return packet;
    };

    SendToAll(builder, !playerInfo.IsModerator() ? guid : ObjectGuid::Empty);
}
开发者ID:Lyill,项目名称:TrinityCore,代码行数:45,代码来源:Channel.cpp


示例16: addLanguage

void Languages::initLanguages()
{
    addLanguage(Language(QObject::tr("English"), "en"));
    addLanguage(Language(QObject::tr("Chinese (Simplified)"), "zh_CN"));
    /*addLanguage(Language(QObject::tr("Chinese (Traditional)"), "zh_TW"));
    addLanguage(Language(QObject::tr("Spanish"), "es"));
    addLanguage(Language(QObject::tr("French"), "fr"));
    addLanguage(Language(QObject::tr("German"), "de"));
    addLanguage(Language(QObject::tr("Italian"), "it"));
    addLanguage(Language(QObject::tr("Japanese"), "ja"));
    addLanguage(Language(QObject::tr("Korean"), "ko"));
    addLanguage(Language(QObject::tr("Russian"), "ru"));
    addLanguage(Language(QObject::tr("Dutch"), "nl"));
    addLanguage(Language(QObject::tr("Portuguese"), "pt"));
    addLanguage(Language(QObject::tr("Tamil"), "ta"));
    addLanguage(Language(QObject::tr("Arabic"), "ar"));
    addLanguage(Language(QObject::tr("Bengali"), "bn"));*/
}
开发者ID:0359xiaodong,项目名称:ocrstyle,代码行数:18,代码来源:Languages.cpp


示例17: GetBgMap

void BattleGround::SendYellToAll(int32 entry, uint32 language, ObjectGuid guid)
{
    Creature* source = GetBgMap()->GetCreature(guid);
    if (!source)
        return;
    MaNGOS::BattleGroundYellBuilder bg_builder(Language(language), entry, source);
    MaNGOS::LocalizedPacketDo<MaNGOS::BattleGroundYellBuilder> bg_do(bg_builder);
    BroadcastWorker(bg_do);
}
开发者ID:Calixa,项目名称:mangos-classic,代码行数:9,代码来源:BattleGround.cpp


示例18: get_uniques

    CharacterVector get_uniques( const CharacterVector& left, const CharacterVector& right){
        int nleft = left.size(), nright = right.size() ;
        int n = nleft + nright ;

        CharacterVector big = no_init(n) ;
        CharacterVector::iterator it = big.begin() ;
        std::copy( left.begin(), left.end(), it ) ;
        std::copy( right.begin(), right.end(), it + nleft ) ;
        return Language( "unique", big ).fast_eval() ;
    }
开发者ID:Aprilara,项目名称:dplyr,代码行数:10,代码来源:api.cpp


示例19: tmplang

Language
Language::from_spec(const std::string& language, const std::string& country, const std::string& modifier)
{
  typedef std::unordered_map<std::string, std::vector<const LanguageSpec*> > LanguageSpecMap;
  static LanguageSpecMap language_map;

  if (language_map.empty())
  { // Init language_map
    for(int i = 0; languages[i].language != NULL; ++i)
      language_map[languages[i].language].push_back(&languages[i]);
  }

  LanguageSpecMap::iterator i = language_map.find(language);
  if (i != language_map.end())
  {
    std::vector<const LanguageSpec*>& lst = i->second;

    LanguageSpec tmpspec;
    tmpspec.language = language.c_str();
    tmpspec.country  = country.c_str();
    tmpspec.modifier = modifier.c_str();
    Language tmplang(&tmpspec);

    const LanguageSpec* best_match = 0;
    int best_match_score = 0;
    for(std::vector<const LanguageSpec*>::iterator j = lst.begin(); j != lst.end(); ++j)
    { // Search for the language that best matches the given spec, value country more then modifier
      int score = Language::match(Language(*j), tmplang);

      if (score > best_match_score)
      {
        best_match = *j;
        best_match_score = score;
      }
    }
    assert(best_match);
    return Language(best_match);
  }
  else
  {
    return Language();
  }
}
开发者ID:righnatios,项目名称:0ad,代码行数:43,代码来源:language.cpp


示例20: setTranslatedText

void TranslationInterface::resetTranslation()
{
    m_service->cancelTranslation();
    m_service->clear();
    setTranslatedText(QString());
    setTranscription(new SourceTranslatedTextPair());
    setTranslit(new SourceTranslatedTextPair());
    setDetectedLanguage(Language());
    m_dict->clear();
}
开发者ID:smyhu,项目名称:taot,代码行数:10,代码来源:translationinterface.cpp



注:本文中的Language函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Last函数代码示例发布时间:2022-05-30
下一篇:
C++ Label函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap